mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
Merge branch 'master' into rewrite-tyepscript-definitions
This commit is contained in:
commit
56718c633d
6 changed files with 81 additions and 5 deletions
|
@ -51,6 +51,9 @@
|
|||
});
|
||||
|
||||
function focus(element) {
|
||||
if(selectorPrimaryFocus == null) {
|
||||
return
|
||||
}
|
||||
const node =
|
||||
(element || innerModal).querySelector(selectorPrimaryFocus) || buttonRef;
|
||||
if (node != null) node.focus();
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
*/
|
||||
export let platformName = "";
|
||||
|
||||
/** Set to `true` to persist the hamburger menu */
|
||||
export let persistentHamburgerMenu = false;
|
||||
|
||||
/** Obtain a reference to the HTML anchor element */
|
||||
export let ref = null;
|
||||
|
||||
|
@ -36,7 +39,8 @@
|
|||
|
||||
let winWidth = undefined;
|
||||
|
||||
$: isSideNavOpen = expandedByDefault && winWidth >= 1056;
|
||||
$: isSideNavOpen =
|
||||
expandedByDefault && winWidth >= 1056 && !persistentHamburgerMenu;
|
||||
$: ariaLabel = company
|
||||
? `${company} `
|
||||
: "" + (uiShellAriaLabel || $$props["aria-label"] || platformName);
|
||||
|
@ -46,7 +50,7 @@
|
|||
|
||||
<header role="banner" aria-label="{ariaLabel}" class:bx--header="{true}">
|
||||
<slot name="skip-to-content" />
|
||||
{#if winWidth < 1056}
|
||||
{#if winWidth < 1056 || persistentHamburgerMenu}
|
||||
<HamburgerMenu bind:isOpen="{isSideNavOpen}" />
|
||||
{/if}
|
||||
<a
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
class:bx--side-nav="{true}"
|
||||
class:bx--side-nav--ux="{true}"
|
||||
class:bx--side-nav--expanded="{isOpen}"
|
||||
class:bx--side-nav--collapsed="{!isOpen && fixed}"
|
||||
class:bx--side-nav--collapsed="{!isOpen}"
|
||||
{...$$restProps}
|
||||
>
|
||||
<slot />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue