mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
Align v10.34 (#621)
* feat(theme): add g80 theme * docs(data-table): use link with icon variant * feat(search): support expandable variant * fix(file-uploaded): use semantic p element instead of strong * feat(side-nav): dispatch open, close, click:overlay events * refactor(ui-shell): remove usage of deprecated Icon component * feat(ui-shell): allow custom hamburger menu icons * feat(button): support xl size * fix(code-snippet): wrap code element with pre * refactor(button): use button specific tooltip class for icon-only variant * feat(password-input): support warning, inline props * feat(data-table): support medium size
This commit is contained in:
parent
630e19b57a
commit
f9909827d0
36 changed files with 572 additions and 197 deletions
|
@ -1,4 +1,10 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {any} open
|
||||
* @event {any} close
|
||||
* @event {any} click:overlay
|
||||
*/
|
||||
|
||||
/** Set to `true` to use the fixed variant */
|
||||
export let fixed = false;
|
||||
|
||||
|
@ -11,9 +17,13 @@
|
|||
/** Set to `true` to toggle the expanded state */
|
||||
export let isOpen = false;
|
||||
|
||||
import { onMount } from "svelte";
|
||||
import { onMount, createEventDispatcher } from "svelte";
|
||||
import { shouldRenderHamburgerMenu } from "../navStore";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
$: dispatch(isOpen ? "open" : "close");
|
||||
|
||||
onMount(() => {
|
||||
shouldRenderHamburgerMenu.set(true);
|
||||
return () => shouldRenderHamburgerMenu.set(false);
|
||||
|
@ -23,6 +33,7 @@
|
|||
{#if !fixed}
|
||||
<div
|
||||
on:click="{() => {
|
||||
dispatch('click:overlay');
|
||||
isOpen = false;
|
||||
}}"
|
||||
class:bx--side-nav__overlay="{true}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue