scb-wc 0.1.78 → 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -22
- package/all.js +0 -2
- package/index.js +88 -90
- package/mvc/components/all.js +0 -2
- package/mvc/components/scb-accordion/scb-accordion-item.js +3 -173
- package/mvc/components/scb-accordion/scb-accordion.js +4 -33
- package/mvc/components/scb-app-bar/scb-app-bar.js +2 -110
- package/mvc/components/scb-avatar/scb-avatar.js +2 -94
- package/mvc/components/scb-badge/scb-badge.js +2 -72
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -12
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +4 -91
- package/mvc/components/scb-button/scb-button.js +47 -309
- package/mvc/components/scb-calendar/scb-calendar-event.js +2 -6
- package/mvc/components/scb-calendar/scb-calendar.js +6 -120
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +21 -350
- package/mvc/components/scb-card/scb-card.js +54 -819
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +3 -31
- package/mvc/components/scb-checkbox/scb-checkbox.js +5 -127
- package/mvc/components/scb-chip/scb-chip.js +2 -76
- package/mvc/components/scb-collapse/scb-collapse.js +2 -44
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +7 -73
- package/mvc/components/scb-dialog/scb-dialog.js +2 -213
- package/mvc/components/scb-divider/scb-divider.js +1 -69
- package/mvc/components/scb-drawer/scb-drawer.js +6 -102
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -410
- package/mvc/components/scb-dropdown/scb-dropdown.js +17 -222
- package/mvc/components/scb-fab/scb-fab.js +7 -95
- package/mvc/components/scb-fact-card/scb-fact-card-content.js +2 -69
- package/mvc/components/scb-fact-card/scb-fact-card.js +2 -214
- package/mvc/components/scb-footer/scb-footer-section.js +1 -3
- package/mvc/components/scb-footer/scb-footer.js +3 -172
- package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +2 -112
- package/mvc/components/scb-grid/scb-grid-item.js +1 -32
- package/mvc/components/scb-grid/scb-grid.js +1 -99
- package/mvc/components/scb-grid/scb-stack.js +1 -33
- package/mvc/components/scb-header/scb-header-menu-item.js +1 -5
- package/mvc/components/scb-header/scb-header-tab.js +1 -5
- package/mvc/components/scb-header/scb-header.js +75 -888
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +43 -168
- package/mvc/components/scb-icon-button/scb-icon-button.js +59 -171
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -218
- package/mvc/components/scb-link/scb-link.js +4 -55
- package/mvc/components/scb-list/scb-list-item.js +23 -126
- package/mvc/components/scb-list/scb-list.js +5 -26
- package/mvc/components/scb-menu/scb-menu-item.js +16 -190
- package/mvc/components/scb-menu/scb-menu-section.js +4 -36
- package/mvc/components/scb-menu/scb-menu.js +5 -69
- package/mvc/components/scb-menu/scb-sub-menu.js +2 -7
- package/mvc/components/scb-nav/scb-nav-item.js +1 -28
- package/mvc/components/scb-nav/scb-nav.js +5 -98
- package/mvc/components/scb-notification-card/scb-notification-card.js +7 -364
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +3 -50
- package/mvc/components/scb-options-menu/scb-options-menu.js +2 -82
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +2 -31
- package/mvc/components/scb-overlay/scb-overlay.js +3 -43
- package/mvc/components/scb-pagination/scb-pagination.js +19 -221
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +2 -67
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +4 -121
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +2 -56
- package/mvc/components/scb-radio-button/scb-radio-button.js +5 -116
- package/mvc/components/scb-radio-button/scb-radio-group.js +2 -32
- package/mvc/components/scb-scrollspy/scb-scrollspy.js +2 -61
- package/mvc/components/scb-search/scb-search.js +5 -249
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -32
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -70
- package/mvc/components/scb-select/scb-select-option.js +2 -54
- package/mvc/components/scb-select/scb-select.js +4 -244
- package/mvc/components/scb-skeleton/scb-skeleton.js +2 -35
- package/mvc/components/scb-slider/scb-slider.js +5 -9
- package/mvc/components/scb-snackbar/scb-snackbar.js +9 -84
- package/mvc/components/scb-status-pill/scb-status-pill.js +2 -43
- package/mvc/components/scb-stepper/scb-step.js +8 -186
- package/mvc/components/scb-stepper/scb-stepper.js +2 -130
- package/mvc/components/scb-switch/scb-switch.js +4 -49
- package/mvc/components/scb-table/scb-table.js +2 -48
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +2 -53
- package/mvc/components/scb-tabs/scb-primary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-secondary-tab.js +2 -7
- package/mvc/components/scb-tabs/scb-tabs.js +4 -31
- package/mvc/components/scb-textfield/scb-textfield.js +142 -388
- package/mvc/components/scb-toc/scb-toc-item.js +3 -251
- package/mvc/components/scb-toc/scb-toc.js +2 -16
- package/mvc/components/scb-tooltip/scb-tooltip.js +8 -155
- package/mvc/components/scb-viz/scb-viz.js +4 -619
- package/mvc/scb-wc-core.css +1 -1
- package/mvc/scb-wc-selfhost.css +1 -1
- package/mvc/scb-wc.css +1 -1
- package/mvc/vendor/assist-chip.js +3 -3
- package/mvc/vendor/chip-set.js +1 -1
- package/mvc/vendor/chip.js +2 -2
- package/mvc/vendor/elevation.js +2 -2
- package/mvc/vendor/filter-chip.js +1 -1
- package/mvc/vendor/focusable.js +1 -1
- package/mvc/vendor/form-associated.js +1 -1
- package/mvc/vendor/icon.js +2 -2
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/vendor/md-focus-ring.js +2 -2
- package/mvc/vendor/ripple.js +2 -2
- package/mvc/vendor/scb-card-variants.internal.js +284 -0
- package/mvc/vendor/scb-chevron.js +10 -0
- package/mvc/vendor/scb-header-drawer.internal.js +71 -0
- package/mvc/vendor/shared-styles.js +1 -1
- package/mvc/vendor/tab-styles.js +3 -3
- package/mvc/vendor/validator.js +1 -1
- package/mvc/vendor/vendor.js +3 -4
- package/package.json +2 -2
- package/scb-accordion/scb-accordion-item.js +33 -32
- package/scb-app-bar/scb-app-bar.js +1 -1
- package/scb-button/scb-button.js +287 -259
- package/scb-calendar/scb-calendar.js +49 -49
- package/scb-calendar-card/scb-calendar-card.js +105 -59
- package/scb-card/scb-card-variants.internal.js +230 -0
- package/scb-card/scb-card.js +387 -528
- package/scb-checkbox/scb-checkbox.js +0 -1
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-components/scb-button/scb-button.d.ts +14 -2
- package/scb-components/scb-calendar/scb-calendar.d.ts +1 -0
- package/scb-components/scb-calendar-card/scb-calendar-card.d.ts +16 -4
- package/scb-components/scb-card/scb-card-variants.internal.d.ts +15 -0
- package/scb-components/scb-card/scb-card.d.ts +26 -9
- package/scb-components/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
- package/scb-components/scb-header/scb-header-drawer.internal.d.ts +31 -0
- package/scb-components/scb-header/scb-header.d.ts +1 -2
- package/scb-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +6 -1
- package/scb-components/scb-icon-button/scb-icon-button.d.ts +28 -29
- package/scb-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -4
- package/scb-components/scb-list/scb-list-item.d.ts +20 -2
- package/scb-components/scb-list/scb-list.d.ts +1 -2
- package/scb-components/scb-nav/scb-nav.d.ts +2 -0
- package/scb-components/scb-segmented-button/scb-segmented-item.d.ts +1 -0
- package/scb-components/scb-select/scb-select-option.d.ts +2 -0
- package/scb-components/scb-toc/scb-toc-item.d.ts +1 -0
- package/scb-components/scb-tooltip/scb-tooltip.d.ts +2 -0
- package/scb-cookies-consent/scb-cookies-consent.js +43 -31
- package/scb-datepicker/scb-datepicker.js +27 -25
- package/scb-dialog/scb-dialog.js +1 -1
- package/scb-dropdown/scb-dropdown.js +29 -28
- package/scb-header/scb-header-drawer.internal.js +78 -0
- package/scb-header/scb-header.js +41 -89
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +181 -88
- package/scb-icon-button/scb-icon-button.js +293 -205
- package/scb-keyfigure-card/scb-keyfigure-card.js +96 -43
- package/scb-list/scb-list-item.js +117 -52
- package/scb-list/scb-list.js +9 -9
- package/scb-nav/scb-nav.js +26 -23
- package/scb-notification-card/scb-notification-card.js +0 -2
- package/scb-options-menu/scb-options-menu-item.js +20 -20
- package/scb-pagination/scb-pagination.js +0 -1
- package/scb-progress-stepper/scb-progress-step.js +19 -17
- package/scb-radio-button/scb-radio-button.js +0 -1
- package/scb-search/scb-search.js +29 -28
- package/scb-segmented-button/scb-segmented-item.js +22 -19
- package/scb-select/scb-select-option.js +20 -14
- package/scb-select/scb-select.js +26 -26
- package/scb-stepper/scb-step.js +34 -31
- package/scb-textfield/scb-textfield.js +39 -39
- package/scb-toc/scb-toc-item.js +26 -26
- package/scb-tooltip/scb-tooltip.js +5 -4
- package/scb-viz/scb-viz.js +1 -1
- package/scb-wc-core.css +1 -1
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc-selfhost.css +1 -1
- package/scb-wc.bundle.js +1873 -1476
- package/scb-wc.css +1 -1
- package/scb-wc.d.ts +194 -198
- package/mvc/components/scb-chevron/scb-chevron.js +0 -41
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
- package/mvc/vendor/element-internals.js +0 -1
- package/mvc/vendor/filled-icon-button.js +0 -2
- package/mvc/vendor/filled-tonal-icon-button.js +0 -2
- package/mvc/vendor/form-label-activation.js +0 -1
- package/mvc/vendor/form-submitter.js +0 -1
- package/mvc/vendor/icon-button.js +0 -2
- package/mvc/vendor/list.js +0 -8
- package/mvc/vendor/outlined-icon-button.js +0 -2
- package/mvc/vendor/shared-styles2.js +0 -30
- package/scb-components/index.d.ts +0 -99
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h,m as d,p as l,v as u,y as p}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as m}from"../../vendor/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import"../scb-divider/scb-divider.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,e,s){try{customElements.get(t)||i(t,e,s)}catch(b){var n=String(b||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var c,o=(c=class extends h{constructor(...i){super(...i),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this.href="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),s=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),s!==this.openLeft&&(this.openLeft=s);const n=e?t:null;n!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=n,n&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(n,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this._effectiveHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const s=t.relatedTarget;(!s||!e.contains(s))&&(e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0})))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let e=this.nextElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.nextElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowUp"){t.preventDefault();let e=this.previousElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.previousElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowRight"){t.preventDefault();const e=this.nextElementSibling;e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&(e.hasAttribute("open")||(this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{const s=e.querySelector("scb-options-menu-item");s&&s.shadowRoot?.querySelector("li")?.focus()},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const e=this.nextElementSibling;if(e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&e.hasAttribute("open")){this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}));return}const s=this.closest("scb-options-sub-menu");if(s){const n=s.previousElementSibling;n&&n.tagName==="SCB-OPTIONS-MENU-ITEM"&&n.shadowRoot?.querySelector("li")?.focus()}return}}}get _effectiveHref(){return this.itemHref||this.href}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const i=this.parentElement;i&&this._subMenuChildObserver.observe(i,{childList:!0})}disconnectedCallback(){this._subMenuChildObserver?.disconnect(),this._subMenuAttrObserver?.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return u`
|
|
2
2
|
${this.divider?u`<scb-divider></scb-divider>`:""}
|
|
3
|
-
<li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} role="menuitem" tabindex="0">
|
|
3
|
+
<li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} @focusin=${m} role="menuitem" tabindex="0">
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
<md-focus-ring inward></md-focus-ring>
|
|
@@ -16,51 +16,4 @@ import{_ as h,b as d,g as p,h as l,y as u}from"../../vendor/vendor.js";import"..
|
|
|
16
16
|
<md-ripple></md-ripple>
|
|
17
17
|
`}
|
|
18
18
|
</li>
|
|
19
|
-
`}_navigateToHref(i){const t=this._effectiveHref;if(!t)return;const e={href:t},s=!this.dispatchEvent(new CustomEvent("item-navigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}))||!this.dispatchEvent(new CustomEvent("itemnavigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}));i.preventDefault(),i.stopPropagation(),s||(window.location.href=t)}_toggleSubMenu(){const i=this.nextElementSibling;i&&i.tagName==="SCB-OPTIONS-SUB-MENU"&&(this.classList.toggle("open-submenu"),i.hasAttribute("open")?(i.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}))):(i.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))))}},c.styles=d
|
|
20
|
-
:host {
|
|
21
|
-
display: block;
|
|
22
|
-
}
|
|
23
|
-
:host li{
|
|
24
|
-
position: relative;
|
|
25
|
-
list-style: none;
|
|
26
|
-
padding: var(--scb-options-menu-item-padding-block, var(--spacing-3, 8px)) var(--scb-options-menu-item-padding-inline, var(--spacing-5, 16px));
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
min-height: var(--scb-options-menu-item-min-height, 56px);
|
|
29
|
-
display: flex;
|
|
30
|
-
gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
|
|
31
|
-
align-items: center;
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
:host li .label {
|
|
35
|
-
font-size: var(--scb-options-menu-label-font-size, var(--md-sys-typescale-body-large-size));
|
|
36
|
-
line-height: var(--scb-options-menu-label-line-height, var(--md-sys-typescale-body-large-line-height));
|
|
37
|
-
letter-spacing: var(--scb-options-menu-label-letter-spacing, var(--md-sys-typescale-body-large-tracking));
|
|
38
|
-
}
|
|
39
|
-
:host li md-focus-ring {
|
|
40
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
41
|
-
position: absolute;
|
|
42
|
-
inset: 0;
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
z-index: 1;
|
|
45
|
-
}
|
|
46
|
-
:host li md-icon {
|
|
47
|
-
--md-icon-size: var(--scb-options-menu-icon-size, 24px);
|
|
48
|
-
}
|
|
49
|
-
:host li md-icon.ti {
|
|
50
|
-
margin-left: auto;
|
|
51
|
-
}
|
|
52
|
-
:host li a {
|
|
53
|
-
display: flex;
|
|
54
|
-
gap: var(--scb-options-menu-item-gap, var(--spacing-4, 12px));
|
|
55
|
-
align-items: center;
|
|
56
|
-
color: var(--md-sys-color-on-surface);
|
|
57
|
-
text-decoration: none;
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
:host(.open-submenu) li {
|
|
61
|
-
background: var(--md-sys-color-secondary-container);
|
|
62
|
-
}
|
|
63
|
-
:host li:focus {
|
|
64
|
-
outline: none;
|
|
65
|
-
}
|
|
66
|
-
`,c);r([l({type:String})],o.prototype,"label",void 0);r([l({type:Boolean})],o.prototype,"hasSubMenu",void 0);r([l({type:Boolean})],o.prototype,"openLeft",void 0);r([l({type:Boolean})],o.prototype,"divider",void 0);r([l({type:String,attribute:"leading-icon"})],o.prototype,"leadingIcon",void 0);r([l({type:String,attribute:"trailing-icon"})],o.prototype,"trailingIcon",void 0);r([l({type:String,attribute:"item-href"})],o.prototype,"itemHref",void 0);r([l({type:String})],o.prototype,"href",void 0);o=r([p("scb-options-menu-item")],o);
|
|
19
|
+
`}_navigateToHref(i){const t=this._effectiveHref;if(!t)return;const e={href:t},s=!this.dispatchEvent(new CustomEvent("item-navigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}))||!this.dispatchEvent(new CustomEvent("itemnavigate",{detail:e,bubbles:!0,composed:!0,cancelable:!0}));i.preventDefault(),i.stopPropagation(),s||(window.location.href=t)}_toggleSubMenu(){const i=this.nextElementSibling;i&&i.tagName==="SCB-OPTIONS-SUB-MENU"&&(this.classList.toggle("open-submenu"),i.hasAttribute("open")?(i.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}))):(i.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),i.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))))}},c.styles=p`:host{display:block}:host li,:host li a{display:flex;gap:var(--scb-options-menu-item-gap, var(--spacing-4, 12px));align-items:center}:host li{position:relative;list-style:none;padding:var(--scb-options-menu-item-padding-block, var(--spacing-3, 8px)) var(--scb-options-menu-item-padding-inline, var(--spacing-5, 16px));cursor:pointer;min-height:var(--scb-options-menu-item-min-height, 56px)}:host li .label{font-size:var(--scb-options-menu-label-font-size, var(--md-sys-typescale-body-large-size));line-height:var(--scb-options-menu-label-line-height, var(--md-sys-typescale-body-large-line-height));letter-spacing:var(--scb-options-menu-label-letter-spacing, var(--md-sys-typescale-body-large-tracking))}:host li md-focus-ring{border-radius:var(--md-sys-shape-corner-small);position:absolute;inset:0;pointer-events:none;z-index:1}:host li md-icon{--md-icon-size:var(--scb-options-menu-icon-size, 24px)}:host li md-icon.ti{margin-left:auto}:host li a{color:var(--md-sys-color-on-surface);text-decoration:none;width:100%}:host(.open-submenu) li{background:var(--md-sys-color-secondary-container)}:host li:focus{outline:0}`,c);r([l({type:String})],o.prototype,"label",void 0);r([l({type:Boolean})],o.prototype,"hasSubMenu",void 0);r([l({type:Boolean})],o.prototype,"openLeft",void 0);r([l({type:Boolean})],o.prototype,"divider",void 0);r([l({type:String,attribute:"leading-icon"})],o.prototype,"leadingIcon",void 0);r([l({type:String,attribute:"trailing-icon"})],o.prototype,"trailingIcon",void 0);r([l({type:String,attribute:"item-href"})],o.prototype,"itemHref",void 0);r([l({type:String})],o.prototype,"href",void 0);o=r([d("scb-options-menu-item")],o);
|
|
@@ -1,88 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as y,m as v,p as r,v as x,y as E}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as n}from"../../vendor/decorate.js";import"./scb-options-menu-item.js";import"./scb-options-sub-menu.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||e(t,i,a)}catch(l){var o=String(l||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var g,s=(g=class extends y{constructor(...e){super(...e),this.open=!1,this.size="large",this.inSb=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=t=>{const i=this.__getActionFromEvent(t);if(i){i==="open"&&(this.__setOpen(!0),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0}))),i==="close"&&(this.__setOpen(!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),i==="toggle"&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0,composed:!0}))),t.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(t)){this.__setOpen(!1);return}},this.__onDocumentKeydown=t=>{if(this.open&&t.key==="Escape"){this.__setOpen(!1);return}}}firstUpdated(){this.__applySpacing()}render(){return x`
|
|
2
2
|
<div
|
|
3
3
|
role="menu"
|
|
4
4
|
class="scb-options-menu-panel${this.open?" open":""}"
|
|
5
5
|
>
|
|
6
6
|
<slot></slot>
|
|
7
7
|
</div>
|
|
8
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(e){this.open=e}__getActionFromEvent(e){if(!this.id)return null;const t=e.composedPath();for(const i of t)if(i instanceof Element){if(i.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=i,"open";if(i.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=i,"close";if(i.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=i,"toggle";if(i.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=i,"toggle"}return null}isClickInScbMenu(e){return e.composedPath().some(t=>t instanceof Element&&(t.tagName==="SCB-OPTIONS-MENU"||t.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(e){e.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const e=this.__lastTriggerEl,t=this.shadowRoot?.querySelector(".scb-options-menu-panel");t&&requestAnimationFrame(()=>{if(!this.open)return;const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=window.innerWidth,l=window.innerHeight,p=8,d=4;let c=i.left,u=i.bottom+d;const h=a.width,b=a.height;c+h>o-p&&(c=Math.max(p,o-p-h)),c<p&&(c=p);let _="top";if(u+b>l-p){const f=i.top-d-b;f>=p&&(u=f,_="bottom")}this.style.position="fixed",this.style.left=`${Math.round(c)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",_)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const e=String(this.open),t=i=>{i.getAttribute("aria-controls")===this.id&&i.setAttribute("aria-expanded",e)};this.__lastTriggerEl&&t(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(t)}__applySpacing(){const e=this.__mapSpacingToken(this.spacing),t=this.__mapSpacingToken(this.spacingTop)??e,i=this.__mapSpacingToken(this.spacingBottom)??e,a=this.__mapSpacingToken(this.spacingLeft),o=this.__mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-options-menu-spacing-block-start",t):this.style.removeProperty("--scb-options-menu-spacing-block-start"),i?this.style.setProperty("--scb-options-menu-spacing-block-end",i):this.style.removeProperty("--scb-options-menu-spacing-block-end"),a?this.style.setProperty("--scb-options-menu-spacing-inline-start",a):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),o?this.style.setProperty("--scb-options-menu-spacing-inline-end",o):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}},
|
|
9
|
-
:host {
|
|
10
|
-
position: absolute;
|
|
11
|
-
display: block;
|
|
12
|
-
width: fit-content;
|
|
13
|
-
font-family: var(--brand-font);
|
|
14
|
-
--scb-options-menu-max-width: 300px;
|
|
15
|
-
--scb-options-menu-max-height: 600px;
|
|
16
|
-
--scb-options-menu-panel-padding-block: var(--spacing-3, 8px);
|
|
17
|
-
--scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
|
|
18
|
-
--scb-options-menu-item-padding-block: var(--spacing-3, 8px);
|
|
19
|
-
--scb-options-menu-item-gap: var(--spacing-4, 12px);
|
|
20
|
-
--scb-options-menu-item-min-height: 56px;
|
|
21
|
-
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-large-size);
|
|
22
|
-
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-large-line-height);
|
|
23
|
-
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
24
|
-
--scb-options-menu-icon-size: 24px;
|
|
25
|
-
--scb-options-sub-menu-offset-top: -44px;
|
|
26
|
-
z-index: 1000;
|
|
27
|
-
|
|
28
|
-
margin-block-start: var(--scb-options-menu-spacing-block-start, 0);
|
|
29
|
-
margin-block-end: var(--scb-options-menu-spacing-block-end, 0);
|
|
30
|
-
margin-inline-start: var(--scb-options-menu-spacing-inline-start, 0);
|
|
31
|
-
margin-inline-end: var(--scb-options-menu-spacing-inline-end, 0);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([size='medium']) {
|
|
35
|
-
--scb-options-menu-panel-padding-block: var(--spacing-2, 4px);
|
|
36
|
-
--scb-options-menu-item-padding-inline: var(--spacing-5, 16px);
|
|
37
|
-
--scb-options-menu-item-padding-block: var(--spacing-2, 4px);
|
|
38
|
-
--scb-options-menu-item-gap: var(--spacing-3, 8px);
|
|
39
|
-
--scb-options-menu-item-min-height: 48px;
|
|
40
|
-
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-medium-size);
|
|
41
|
-
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
42
|
-
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-medium-tracking);
|
|
43
|
-
--scb-options-menu-icon-size: 20px;
|
|
44
|
-
--scb-options-sub-menu-offset-top: -40px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([size='small']) {
|
|
48
|
-
--scb-options-menu-panel-padding-block: var(--spacing-1, 2px);
|
|
49
|
-
--scb-options-menu-item-padding-inline: var(--spacing-4, 12px);
|
|
50
|
-
--scb-options-menu-item-padding-block: var(--spacing-2, 4px);
|
|
51
|
-
--scb-options-menu-item-gap: var(--spacing-3, 8px);
|
|
52
|
-
--scb-options-menu-item-min-height: 40px;
|
|
53
|
-
--scb-options-menu-label-font-size: var(--md-sys-typescale-body-small-size);
|
|
54
|
-
--scb-options-menu-label-line-height: var(--md-sys-typescale-body-small-line-height);
|
|
55
|
-
--scb-options-menu-label-letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
56
|
-
--scb-options-menu-icon-size: 18px;
|
|
57
|
-
--scb-options-sub-menu-offset-top: -32px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
:host > .scb-options-menu-panel {
|
|
61
|
-
padding: var(--scb-options-menu-panel-padding-block) 0;
|
|
62
|
-
color: var(--md-sys-color-on-surface);
|
|
63
|
-
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
64
|
-
background: var(--md-sys-color-surface, #FFF);
|
|
65
|
-
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
|
|
66
|
-
background: var(--md-sys-color-surface, #FFF);
|
|
67
|
-
opacity: 0;
|
|
68
|
-
max-height: 0;
|
|
69
|
-
transform: scaleY(0.8);
|
|
70
|
-
transform-origin: var(--scb-options-menu-transform-origin, top);
|
|
71
|
-
transition:
|
|
72
|
-
opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
|
|
73
|
-
transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
|
|
74
|
-
will-change: opacity, transform;
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
:host > .scb-options-menu-panel.open {
|
|
78
|
-
opacity: 1;
|
|
79
|
-
transform: scaleY(1);
|
|
80
|
-
max-width: var(--scb-options-menu-max-width);
|
|
81
|
-
max-height: var(--scb-options-menu-max-height);
|
|
82
|
-
min-width: 112px;
|
|
83
|
-
overflow: visible;
|
|
84
|
-
transition:
|
|
85
|
-
opacity 0.25s cubic-bezier(0.23, 1, 0.32, 1),
|
|
86
|
-
transform 0.32s cubic-bezier(0.23, 1, 0.32, 1);
|
|
87
|
-
}
|
|
88
|
-
`,m);n([r({type:Boolean,reflect:!0})],s.prototype,"open",void 0);n([r({type:String,reflect:!0})],s.prototype,"size",void 0);n([r({type:Boolean,attribute:!1})],s.prototype,"inSb",void 0);n([r({type:String,reflect:!0})],s.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],s.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],s.prototype,"spacingRight",void 0);s=n([x("scb-options-menu")],s);
|
|
8
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),window.addEventListener("resize",this.__onViewportChange,{passive:!0}),window.addEventListener("scroll",this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),window.removeEventListener("resize",this.__onViewportChange),window.removeEventListener("scroll",this.__onViewportChange,!0),super.disconnectedCallback()}__setOpen(e){this.open=e}__getActionFromEvent(e){if(!this.id)return null;const t=e.composedPath();for(const i of t)if(i instanceof Element){if(i.getAttribute("data-menu-open")===this.id)return this.__lastTriggerEl=i,"open";if(i.getAttribute("data-menu-close")===this.id)return this.__lastTriggerEl=i,"close";if(i.getAttribute("data-menu-toggle")===this.id)return this.__lastTriggerEl=i,"toggle";if(i.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=i,"toggle"}return null}isClickInScbMenu(e){return e.composedPath().some(t=>t instanceof Element&&(t.tagName==="SCB-OPTIONS-MENU"||t.tagName==="SCB-OPTIONS-SUB-MENU"))}updated(e){e.has("open")&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__applyOpenSideEffects(){this.__updateTriggersExpanded(),this.open?this.__positionToTrigger():this.__restoreFocusToTrigger()}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;const e=this.__lastTriggerEl,t=this.shadowRoot?.querySelector(".scb-options-menu-panel");t&&requestAnimationFrame(()=>{if(!this.open)return;const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),o=window.innerWidth,l=window.innerHeight,p=8,d=4;let c=i.left,u=i.bottom+d;const h=a.width,b=a.height;c+h>o-p&&(c=Math.max(p,o-p-h)),c<p&&(c=p);let _="top";if(u+b>l-p){const f=i.top-d-b;f>=p&&(u=f,_="bottom")}this.style.position="fixed",this.style.left=`${Math.round(c)}px`,this.style.top=`${Math.round(u)}px`,this.style.setProperty("--scb-options-menu-transform-origin",_)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.()})}__updateTriggersExpanded(){if(!this.id)return;const e=String(this.open),t=i=>{i.getAttribute("aria-controls")===this.id&&i.setAttribute("aria-expanded",e)};this.__lastTriggerEl&&t(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(t)}__applySpacing(){const e=this.__mapSpacingToken(this.spacing),t=this.__mapSpacingToken(this.spacingTop)??e,i=this.__mapSpacingToken(this.spacingBottom)??e,a=this.__mapSpacingToken(this.spacingLeft),o=this.__mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-options-menu-spacing-block-start",t):this.style.removeProperty("--scb-options-menu-spacing-block-start"),i?this.style.setProperty("--scb-options-menu-spacing-block-end",i):this.style.removeProperty("--scb-options-menu-spacing-block-end"),a?this.style.setProperty("--scb-options-menu-spacing-inline-start",a):this.style.removeProperty("--scb-options-menu-spacing-inline-start"),o?this.style.setProperty("--scb-options-menu-spacing-inline-end",o):this.style.removeProperty("--scb-options-menu-spacing-inline-end")}__mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}},g.styles=E`:host{position:absolute;display:block;width:fit-content;font-family:var(--brand-font);--scb-options-menu-max-width:300px;--scb-options-menu-max-height:600px;--scb-options-menu-panel-padding-block:var(--spacing-3, 8px);--scb-options-menu-item-padding-inline:var(--spacing-5, 16px);--scb-options-menu-item-padding-block:var(--spacing-3, 8px);--scb-options-menu-item-gap:var(--spacing-4, 12px);--scb-options-menu-item-min-height:56px;--scb-options-menu-label-font-size:var(--md-sys-typescale-body-large-size);--scb-options-menu-label-line-height:var(--md-sys-typescale-body-large-line-height);--scb-options-menu-label-letter-spacing:var(--md-sys-typescale-body-large-tracking);--scb-options-menu-icon-size:24px;--scb-options-sub-menu-offset-top:-44px;z-index:1000;margin-block-start:var(--scb-options-menu-spacing-block-start, 0);margin-block-end:var(--scb-options-menu-spacing-block-end, 0);margin-inline-start:var(--scb-options-menu-spacing-inline-start, 0);margin-inline-end:var(--scb-options-menu-spacing-inline-end, 0)}:host([size='medium']),:host([size='small']){--scb-options-menu-item-padding-block:var(--spacing-2, 4px);--scb-options-menu-item-gap:var(--spacing-3, 8px)}:host([size='medium']){--scb-options-menu-panel-padding-block:var(--spacing-2, 4px);--scb-options-menu-item-padding-inline:var(--spacing-5, 16px);--scb-options-menu-item-min-height:48px;--scb-options-menu-label-font-size:var(--md-sys-typescale-body-medium-size);--scb-options-menu-label-line-height:var(--md-sys-typescale-body-medium-line-height);--scb-options-menu-label-letter-spacing:var(--md-sys-typescale-body-medium-tracking);--scb-options-menu-icon-size:20px;--scb-options-sub-menu-offset-top:-40px}:host([size='small']){--scb-options-menu-panel-padding-block:var(--spacing-1, 2px);--scb-options-menu-item-padding-inline:var(--spacing-4, 12px);--scb-options-menu-item-min-height:40px;--scb-options-menu-label-font-size:var(--md-sys-typescale-body-small-size);--scb-options-menu-label-line-height:var(--md-sys-typescale-body-small-line-height);--scb-options-menu-label-letter-spacing:var(--md-sys-typescale-body-small-tracking);--scb-options-menu-icon-size:18px;--scb-options-sub-menu-offset-top:-32px}:host>.scb-options-menu-panel,:host>.scb-options-menu-panel.open{transition:opacity .25s cubic-bezier(.23,1,.32,1),transform .32s cubic-bezier(.23,1,.32,1)}:host>.scb-options-menu-panel{padding:var(--scb-options-menu-panel-padding-block)0;color:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-extra-small);box-shadow:0 1px 2px 0 rgba(0,0,0,.3),0 2px 6px 2px rgba(0,0,0,.15);background:var(--md-sys-color-surface, #FFF);opacity:0;max-height:0;transform:scaleY(.8);transform-origin:var(--scb-options-menu-transform-origin, top);will-change:opacity,transform}:host>.scb-options-menu-panel.open{opacity:1;transform:scaleY(1);max-width:var(--scb-options-menu-max-width);max-height:var(--scb-options-menu-max-height);min-width:112px;overflow:visible}`,g);n([r({type:Boolean,reflect:!0})],s.prototype,"open",void 0);n([r({type:String,reflect:!0})],s.prototype,"size",void 0);n([r({type:Boolean,attribute:!1})],s.prototype,"inSb",void 0);n([r({type:String,reflect:!0})],s.prototype,"spacing",void 0);n([r({type:String,attribute:"spacing-top",reflect:!0})],s.prototype,"spacingTop",void 0);n([r({type:String,attribute:"spacing-bottom",reflect:!0})],s.prototype,"spacingBottom",void 0);n([r({type:String,attribute:"spacing-left",reflect:!0})],s.prototype,"spacingLeft",void 0);n([r({type:String,attribute:"spacing-right",reflect:!0})],s.prototype,"spacingRight",void 0);s=n([v("scb-options-menu")],s);
|
|
@@ -1,34 +1,5 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as p,m as d,p as b,v as l,y as m}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,u,h){try{customElements.get(e)||t(e,u,h)}catch(r){var o=String(r||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var i,n=(i=class extends p{constructor(...t){super(...t),this.open=!1,this._show=()=>{this.setAttribute("open",""),this.open=!0},this._hide=e=>{this.removeAttribute("open"),this.open=!1,e&&e.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("show-submenu",this._show),this.addEventListener("showsubmenu",this._show),this.addEventListener("hide-submenu",this._hide),this.addEventListener("hidesubmenu",this._hide)}disconnectedCallback(){this.removeEventListener("show-submenu",this._show),this.removeEventListener("showsubmenu",this._show),this.removeEventListener("hide-submenu",this._hide),this.removeEventListener("hidesubmenu",this._hide),super.disconnectedCallback()}firstUpdated(){let t=0,e=this.parentElement;for(;e;)e.tagName==="SCB-OPTIONS-SUB-MENU"&&t++,e=e.parentElement;t%2===1?this.setAttribute("open-left",""):this.removeAttribute("open-left")}render(){return l`
|
|
2
2
|
<div role="menu" class="submenu${this.open?" open":""}">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}},i.styles=
|
|
6
|
-
:host {
|
|
7
|
-
display: block;
|
|
8
|
-
position: relative;
|
|
9
|
-
--scb-options-sub-menu-max-width: 300px;
|
|
10
|
-
--scb-options-sub-menu-max-height: 600px;
|
|
11
|
-
}
|
|
12
|
-
.submenu {
|
|
13
|
-
max-width: var(--scb-options-sub-menu-max-width);
|
|
14
|
-
max-height: var(--scb-options-sub-menu-max-height);
|
|
15
|
-
min-width: 112px;
|
|
16
|
-
display: none;
|
|
17
|
-
position: absolute;
|
|
18
|
-
left: 100%;
|
|
19
|
-
top: var(--scb-options-sub-menu-offset-top, -44px);
|
|
20
|
-
z-index: 100;
|
|
21
|
-
padding: var(--scb-options-menu-panel-padding-block, var(--spacing-3, 8px)) 0;
|
|
22
|
-
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
23
|
-
background: var(--md-sys-color-surface, #FFF);
|
|
24
|
-
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.20), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 4px 5px 0 rgba(0, 0, 0, 0.14);
|
|
25
|
-
}
|
|
26
|
-
:host([open-left]) .submenu {
|
|
27
|
-
left: auto;
|
|
28
|
-
right: 100%;
|
|
29
|
-
}
|
|
30
|
-
:host([open]) .submenu,
|
|
31
|
-
.submenu.open {
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
|
-
`,i);a([l({type:Boolean,reflect:!0})],n.prototype,"open",void 0);n=a([b("scb-options-sub-menu")],n);
|
|
5
|
+
`}},i.styles=m`:host{display:block;position:relative;--scb-options-sub-menu-max-width:300px;--scb-options-sub-menu-max-height:600px}.submenu{max-width:var(--scb-options-sub-menu-max-width);max-height:var(--scb-options-sub-menu-max-height);min-width:112px;display:none;position:absolute;left:100%;top:var(--scb-options-sub-menu-offset-top, -44px);z-index:100;padding:var(--scb-options-menu-panel-padding-block, var(--spacing-3, 8px))0;border-radius:var(--md-sys-shape-corner-extra-small);background:var(--md-sys-color-surface, #FFF);box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 1px 10px 0 rgba(0,0,0,.12),0 4px 5px 0 rgba(0,0,0,.14)}:host([open-left]) .submenu{left:auto;right:100%}.submenu.open,:host([open]) .submenu{display:block}`,i);a([b({type:Boolean,reflect:!0})],n.prototype,"open",void 0);n=a([d("scb-options-sub-menu")],n);
|
|
@@ -1,49 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g,h as L,m as w,p as f,v as z,y as A}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/decorate.js";import{n as C,t as r}from"../../vendor/assertClassBrand.js";import{n as k,r as S,t as y}from"../../vendor/classPrivateFieldGet2.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,a,h){try{customElements.get(t)||s(t,a,h)}catch(p){var d=String(p||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var n,v,u,c,e,l=(n=new WeakSet,v=new WeakMap,u=new WeakMap,c=class extends L{constructor(...s){super(...s),C(this,n),S(this,v,void 0),S(this,u,void 0),this.open=!1,this.variant="scrim",this.isStatic=!1,this.ariaLabel="",this.__lastTriggerEl=null,k(v,this,t=>{this.isStatic||r(n,this,O).call(this,t)||r(n,this,x).call(this)}),k(u,this,t=>{this.open&&t.key==="Escape"&&r(n,this,x).call(this)})}static __handleDocClick(s){const t=s.composedPath();for(const a of t){if(!(a instanceof Element))continue;const h=a.getAttribute("data-overlay-open"),d=a.getAttribute("data-overlay-close"),p=a.getAttribute("data-overlay-toggle"),E=a.getAttribute("aria-controls"),m=h||d||p||E;if(!m)continue;const o=e.__instances.get(m);if(!o){e.__instances.delete(m);continue}o.__lastTriggerEl=a,h?r(n,o,b).call(o,!0):d?r(n,o,b).call(o,!1):r(n,o,b).call(o,!o.open);break}}static __ensureDocListener(){e.__docListenerAttached||(document.addEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!0)}static __maybeRemoveDocListener(){!e.__docListenerAttached||e.__instances.size>0||(document.removeEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!1)}render(){return this.open?z`
|
|
2
2
|
<div class="scrim" @click=${y(v,this)}>
|
|
3
3
|
<div class="content" role="dialog" aria-modal="true" aria-label="${this.ariaLabel||g}">
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</div>
|
|
6
6
|
</div>
|
|
7
|
-
`:g}connectedCallback(){super.connectedCallback(),this.id&&e.__instances.set(this.id,this),e.__ensureDocListener(),window.addEventListener("keydown",y(
|
|
8
|
-
:host {
|
|
9
|
-
position: fixed;
|
|
10
|
-
inset: 0;
|
|
11
|
-
z-index: var(--scb-overlay-z-index, 1000);
|
|
12
|
-
display: none;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:host([open]) {
|
|
17
|
-
display: block;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.scrim {
|
|
21
|
-
display: grid;
|
|
22
|
-
place-items: center;
|
|
23
|
-
inline-size: 100%;
|
|
24
|
-
block-size: 100%;
|
|
25
|
-
padding: var(--scb-overlay-padding, var(--spacing-6, 24px));
|
|
26
|
-
background: var(
|
|
27
|
-
--scb-overlay-backdrop,
|
|
7
|
+
`:g}connectedCallback(){super.connectedCallback(),this.id&&e.__instances.set(this.id,this),e.__ensureDocListener(),window.addEventListener("keydown",y(u,this))}updated(s){s.has("open")&&r(n,this,D).call(this)}disconnectedCallback(){this.id&&e.__instances.delete(this.id),e.__maybeRemoveDocListener(),window.removeEventListener("keydown",y(u,this)),super.disconnectedCallback()}},e=c,c.__instances=new Map,c.__docListenerAttached=!1,c.styles=A`:host{position:fixed;inset:0;z-index:var(--scb-overlay-z-index, 1000);display:none;box-sizing:border-box}:host([open]){display:block}.scrim{display:grid;place-items:center;inline-size:100%;block-size:100%;padding:var(--scb-overlay-padding, var(--spacing-6, 24px));background:var(--scb-overlay-backdrop,
|
|
28
8
|
color-mix(in srgb, var(--md-sys-color-scrim) 32%, transparent)
|
|
29
|
-
);
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([variant='solid']) .scrim {
|
|
34
|
-
background: var(--md-sys-color-surface);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.content {
|
|
38
|
-
position: relative;
|
|
39
|
-
max-inline-size: 100%;
|
|
40
|
-
max-block-size: 100%;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.content ::slotted(*) {
|
|
45
|
-
margin: auto;
|
|
46
|
-
max-inline-size: 100%;
|
|
47
|
-
max-block-size: 100%;
|
|
48
|
-
}
|
|
49
|
-
`,c);function b(i){this.open=i}function x(){this.open&&(this.isStatic||(r(n,this,b).call(this,!1),this.dispatchEvent(new CustomEvent("scb-overlay-dismiss",{bubbles:!0,composed:!0}))))}function O(i){const s=this.renderRoot.querySelector("slot");if(!(s instanceof HTMLSlotElement))return!1;const t=i.composedPath();return s.assignedNodes({flatten:!0}).some(a=>t.includes(a))}function D(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-overlay-toggle="${this.id}"], [data-overlay-open="${this.id}"], [data-overlay-close="${this.id}"]`).forEach(i=>{i.hasAttribute("aria-controls")&&i.setAttribute("aria-expanded",String(this.open))})}u([f({type:Boolean,reflect:!0})],l.prototype,"open",void 0);u([f({type:String,reflect:!0})],l.prototype,"variant",void 0);u([f({type:Boolean,reflect:!0,attribute:"static"})],l.prototype,"isStatic",void 0);u([f({type:String,attribute:"aria-label"})],l.prototype,"ariaLabel",void 0);l=e=u([z("scb-overlay")],l);
|
|
9
|
+
);box-sizing:border-box}:host([variant='solid']) .scrim{background:var(--md-sys-color-surface)}.content{position:relative;max-inline-size:100%;max-block-size:100%;box-sizing:border-box}.content ::slotted(*){margin:auto;max-inline-size:100%;max-block-size:100%}`,c);function b(i){this.open=i}function x(){this.open&&(this.isStatic||(r(n,this,b).call(this,!1),this.dispatchEvent(new CustomEvent("scb-overlay-dismiss",{bubbles:!0,composed:!0}))))}function O(i){const s=this.renderRoot.querySelector("slot");if(!(s instanceof HTMLSlotElement))return!1;const t=i.composedPath();return s.assignedNodes({flatten:!0}).some(a=>t.includes(a))}function D(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-overlay-toggle="${this.id}"], [data-overlay-open="${this.id}"], [data-overlay-close="${this.id}"]`).forEach(i=>{i.hasAttribute("aria-controls")&&i.setAttribute("aria-expanded",String(this.open))})}_([f({type:Boolean,reflect:!0})],l.prototype,"open",void 0);_([f({type:String,reflect:!0})],l.prototype,"variant",void 0);_([f({type:Boolean,reflect:!0,attribute:"static"})],l.prototype,"isStatic",void 0);_([f({type:String,attribute:"aria-label"})],l.prototype,"ariaLabel",void 0);l=e=_([w("scb-overlay")],l);
|