scb-wc-test 0.1.146 → 0.1.147
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/all.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +104 -102
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-button/scb-button.js +1 -1
- package/mvc/components/scb-drawer/scb-drawer-item.js +38 -9
- package/mvc/components/scb-drawer/scb-drawer.js +2 -2
- package/mvc/components/scb-dropdown/scb-dropdown.js +186 -0
- package/package.json +6 -2
- package/scb-button/scb-button.js +1 -1
- package/scb-drawer/scb-drawer-item.js +58 -29
- package/scb-drawer/scb-drawer.js +2 -2
- package/scb-dropdown/scb-dropdown.d.ts +49 -0
- package/scb-dropdown/scb-dropdown.js +356 -0
- package/scb-wc-test.bundle.js +706 -492
package/all.js
CHANGED
|
@@ -26,6 +26,7 @@ import './mvc/components/scb-drawer/scb-drawer-item.js';
|
|
|
26
26
|
import './mvc/components/scb-drawer/scb-drawer-section.js';
|
|
27
27
|
import './mvc/components/scb-drawer/scb-drawer.js';
|
|
28
28
|
import './mvc/components/scb-drawer/scb-sub-drawer.js';
|
|
29
|
+
import './mvc/components/scb-dropdown/scb-dropdown.js';
|
|
29
30
|
import './mvc/components/scb-fact-card/scb-fact-card-content.js';
|
|
30
31
|
import './mvc/components/scb-fact-card/scb-fact-card.js';
|
|
31
32
|
import './mvc/components/scb-footer/scb-footer-section.js';
|
|
@@ -104,6 +105,7 @@ import './scb-drawer/scb-drawer-item.js';
|
|
|
104
105
|
import './scb-drawer/scb-drawer-section.js';
|
|
105
106
|
import './scb-drawer/scb-drawer.js';
|
|
106
107
|
import './scb-drawer/scb-sub-drawer.js';
|
|
108
|
+
import './scb-dropdown/scb-dropdown.js';
|
|
107
109
|
import './scb-fact-card/scb-fact-card-content.js';
|
|
108
110
|
import './scb-fact-card/scb-fact-card.js';
|
|
109
111
|
import './scb-footer/scb-footer-section.js';
|
package/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './scb-drawer/scb-drawer-item';
|
|
|
22
22
|
export * from './scb-drawer/scb-drawer-section';
|
|
23
23
|
export * from './scb-drawer/scb-drawer';
|
|
24
24
|
export * from './scb-drawer/scb-sub-drawer';
|
|
25
|
+
export * from './scb-dropdown/scb-dropdown';
|
|
25
26
|
export * from './scb-fact-card/scb-fact-card-content';
|
|
26
27
|
export * from './scb-fact-card/scb-fact-card';
|
|
27
28
|
export * from './scb-footer/scb-footer-section';
|
package/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import { SCBBreadcrumb as d } from "./scb-breadcrumb/scb-breadcrumb.js";
|
|
|
8
8
|
import { ScbButton as C } from "./scb-button/scb-button.js";
|
|
9
9
|
import { ScbCalendarEvent as s } from "./scb-calendar/scb-calendar-event.js";
|
|
10
10
|
import { ScbCalendar as B } from "./scb-calendar/scb-calendar.js";
|
|
11
|
-
import { ScbCalendarCard as
|
|
12
|
-
import { ScbCard as
|
|
11
|
+
import { ScbCalendarCard as g } from "./scb-calendar-card/scb-calendar-card.js";
|
|
12
|
+
import { ScbCard as w } from "./scb-card/scb-card.js";
|
|
13
13
|
import { ScbCheckboxGroup as F } from "./scb-checkbox/scb-checkbox-group.js";
|
|
14
14
|
import { ScbCheckbox as P } from "./scb-checkbox/scb-checkbox.js";
|
|
15
15
|
import { ScbChip as y } from "./scb-chip/scb-chip.js";
|
|
@@ -22,55 +22,56 @@ import { ScbDrawerItem as U } from "./scb-drawer/scb-drawer-item.js";
|
|
|
22
22
|
import { ScbDrawerSection as j } from "./scb-drawer/scb-drawer-section.js";
|
|
23
23
|
import { ScbDrawer as J } from "./scb-drawer/scb-drawer.js";
|
|
24
24
|
import { ScbSubDrawer as W } from "./scb-drawer/scb-sub-drawer.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
25
|
+
import { ScbDropdown as Y } from "./scb-dropdown/scb-dropdown.js";
|
|
26
|
+
import { ScbFactCardContent as _ } from "./scb-fact-card/scb-fact-card-content.js";
|
|
27
|
+
import { ScbFactCard as rr } from "./scb-fact-card/scb-fact-card.js";
|
|
28
|
+
import { ScbFooterSection as er } from "./scb-footer/scb-footer-section.js";
|
|
29
|
+
import { ScbFooter as cr } from "./scb-footer/scb-footer.js";
|
|
30
|
+
import { ScbGridItem as pr } from "./scb-grid/scb-grid-item.js";
|
|
31
|
+
import { ScbGrid as br } from "./scb-grid/scb-grid.js";
|
|
32
|
+
import { ScbStack as fr } from "./scb-grid/scb-stack.js";
|
|
33
|
+
import { ScbHeaderDrawerGroup as ir } from "./scb-header/scb-header-drawer-group.js";
|
|
34
|
+
import { ScbHeaderDrawerItem as dr } from "./scb-header/scb-header-drawer-item.js";
|
|
35
|
+
import { ScbHeaderTab as Cr } from "./scb-header/scb-header-tab.js";
|
|
36
|
+
import { ScbHeaderUtility as sr } from "./scb-header/scb-header-utility.js";
|
|
37
|
+
import { ScbHeader as Br } from "./scb-header/scb-header.js";
|
|
38
|
+
import { ScbHorizontalScroller as gr } from "./scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
39
|
+
import { ScbIconButton as wr } from "./scb-icon-button/scb-icon-button.js";
|
|
40
|
+
import { ScbKeyFigureCard as Fr } from "./scb-keyfigure-card/scb-keyfigure-card.js";
|
|
41
|
+
import { ScbLink as Pr } from "./scb-link/scb-link.js";
|
|
42
|
+
import { ScbListItem as yr } from "./scb-list/scb-list-item.js";
|
|
43
|
+
import { ScbList as vr } from "./scb-list/scb-list.js";
|
|
44
|
+
import { ScbMenuItem as Lr } from "./scb-menu/scb-menu-item.js";
|
|
45
|
+
import { ScbMenu as zr } from "./scb-menu/scb-menu.js";
|
|
46
|
+
import { ScbSubMenu as Rr } from "./scb-menu/scb-sub-menu.js";
|
|
47
|
+
import { ScbNav as Kr } from "./scb-nav/scb-nav.js";
|
|
48
|
+
import { ScbNotificationCard as Ur } from "./scb-notification-card/scb-notification-card.js";
|
|
49
|
+
import { ScbPagination as jr } from "./scb-pagination/scb-pagination.js";
|
|
50
|
+
import { ScbProgressIndicator as Jr } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
51
|
+
import { ScbProgressStep as Wr } from "./scb-progress-stepper/scb-progress-step.js";
|
|
52
|
+
import { ScbProgressStepper as Yr } from "./scb-progress-stepper/scb-progress-stepper.js";
|
|
53
|
+
import { ScbRadioButton as _r } from "./scb-radio-button/scb-radio-button.js";
|
|
54
|
+
import { ScbRadioGroup as ro } from "./scb-radio-button/scb-radio-group.js";
|
|
55
|
+
import { ScbScrollspy as eo } from "./scb-scrollspy/scb-scrollspy.js";
|
|
56
|
+
import { ScbSearch as co } from "./scb-search/scb-search.js";
|
|
57
|
+
import { ScbSegmentedButton as po } from "./scb-segmented-button/scb-segmented-button.js";
|
|
58
|
+
import { ScbSegmentedItem as bo } from "./scb-segmented-button/scb-segmented-item.js";
|
|
59
|
+
import { ScbSelectOption as fo } from "./scb-select/scb-select-option.js";
|
|
60
|
+
import { ScbSelect as io } from "./scb-select/scb-select.js";
|
|
61
|
+
import { ScbSkeleton as lo } from "./scb-skeleton/scb-skeleton.js";
|
|
62
|
+
import { ScbSnackbar as uo } from "./scb-snackbar/scb-snackbar.js";
|
|
63
|
+
import { ScbStatusPill as Io } from "./scb-status-pill/scb-status-pill.js";
|
|
64
|
+
import { ScbStep as Do } from "./scb-stepper/scb-step.js";
|
|
65
|
+
import { ScbStepper as ko } from "./scb-stepper/scb-stepper.js";
|
|
66
|
+
import { ScbSwitch as To } from "./scb-switch/scb-switch.js";
|
|
67
|
+
import { ScbPrimaryTab as Ho } from "./scb-tabs/scb-primary-tab.js";
|
|
68
|
+
import { ScbSecondaryTab as ho } from "./scb-tabs/scb-secondary-tab.js";
|
|
69
|
+
import { ScbTabs as Go } from "./scb-tabs/scb-tabs.js";
|
|
70
|
+
import { ScbTextField as Ao } from "./scb-textfield/scb-textfield.js";
|
|
71
|
+
import { ScbTocItem as Mo } from "./scb-toc/scb-toc-item.js";
|
|
72
|
+
import { ScbToc as No } from "./scb-toc/scb-toc.js";
|
|
73
|
+
import { ScbTooltip as Eo } from "./scb-tooltip/scb-tooltip.js";
|
|
74
|
+
import { ScbViz as Oo } from "./scb-viz/scb-viz.js";
|
|
74
75
|
export {
|
|
75
76
|
d as SCBBreadcrumb,
|
|
76
77
|
i as SCBBreadcrumbItem,
|
|
@@ -81,9 +82,9 @@ export {
|
|
|
81
82
|
f as ScbBadge,
|
|
82
83
|
C as ScbButton,
|
|
83
84
|
B as ScbCalendar,
|
|
84
|
-
|
|
85
|
+
g as ScbCalendarCard,
|
|
85
86
|
s as ScbCalendarEvent,
|
|
86
|
-
|
|
87
|
+
w as ScbCard,
|
|
87
88
|
P as ScbCheckbox,
|
|
88
89
|
F as ScbCheckboxGroup,
|
|
89
90
|
y as ScbChip,
|
|
@@ -95,54 +96,55 @@ export {
|
|
|
95
96
|
J as ScbDrawer,
|
|
96
97
|
U as ScbDrawerItem,
|
|
97
98
|
j as ScbDrawerSection,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
ir as
|
|
107
|
-
dr as
|
|
108
|
-
Cr as
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Fr as
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Kr as
|
|
119
|
-
Ur as
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Jr as
|
|
123
|
-
Wr as
|
|
124
|
-
Yr as
|
|
125
|
-
_r as
|
|
126
|
-
ro as
|
|
127
|
-
eo as
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
po as
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
lo as
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
Io as
|
|
138
|
-
|
|
99
|
+
Y as ScbDropdown,
|
|
100
|
+
rr as ScbFactCard,
|
|
101
|
+
_ as ScbFactCardContent,
|
|
102
|
+
cr as ScbFooter,
|
|
103
|
+
er as ScbFooterSection,
|
|
104
|
+
br as ScbGrid,
|
|
105
|
+
pr as ScbGridItem,
|
|
106
|
+
Br as ScbHeader,
|
|
107
|
+
ir as ScbHeaderDrawerGroup,
|
|
108
|
+
dr as ScbHeaderDrawerItem,
|
|
109
|
+
Cr as ScbHeaderTab,
|
|
110
|
+
sr as ScbHeaderUtility,
|
|
111
|
+
gr as ScbHorizontalScroller,
|
|
112
|
+
wr as ScbIconButton,
|
|
113
|
+
Fr as ScbKeyFigureCard,
|
|
114
|
+
Pr as ScbLink,
|
|
115
|
+
vr as ScbList,
|
|
116
|
+
yr as ScbListItem,
|
|
117
|
+
zr as ScbMenu,
|
|
118
|
+
Lr as ScbMenuItem,
|
|
119
|
+
Kr as ScbNav,
|
|
120
|
+
Ur as ScbNotificationCard,
|
|
121
|
+
jr as ScbPagination,
|
|
122
|
+
Ho as ScbPrimaryTab,
|
|
123
|
+
Jr as ScbProgressIndicator,
|
|
124
|
+
Wr as ScbProgressStep,
|
|
125
|
+
Yr as ScbProgressStepper,
|
|
126
|
+
_r as ScbRadioButton,
|
|
127
|
+
ro as ScbRadioGroup,
|
|
128
|
+
eo as ScbScrollspy,
|
|
129
|
+
co as ScbSearch,
|
|
130
|
+
ho as ScbSecondaryTab,
|
|
131
|
+
po as ScbSegmentedButton,
|
|
132
|
+
bo as ScbSegmentedItem,
|
|
133
|
+
io as ScbSelect,
|
|
134
|
+
fo as ScbSelectOption,
|
|
135
|
+
lo as ScbSkeleton,
|
|
136
|
+
uo as ScbSnackbar,
|
|
137
|
+
fr as ScbStack,
|
|
138
|
+
Io as ScbStatusPill,
|
|
139
|
+
Do as ScbStep,
|
|
140
|
+
ko as ScbStepper,
|
|
139
141
|
W as ScbSubDrawer,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
Rr as ScbSubMenu,
|
|
143
|
+
To as ScbSwitch,
|
|
144
|
+
Go as ScbTabs,
|
|
145
|
+
Ao as ScbTextField,
|
|
146
|
+
No as ScbToc,
|
|
147
|
+
Mo as ScbTocItem,
|
|
148
|
+
Eo as ScbTooltip,
|
|
149
|
+
Oo as ScbViz
|
|
148
150
|
};
|
package/mvc/components/all.js
CHANGED
|
@@ -22,6 +22,7 @@ import './scb-drawer/scb-drawer.js';
|
|
|
22
22
|
import './scb-drawer/scb-drawer-item.js';
|
|
23
23
|
import './scb-drawer/scb-drawer-section.js';
|
|
24
24
|
import './scb-drawer/scb-sub-drawer.js';
|
|
25
|
+
import './scb-dropdown/scb-dropdown.js';
|
|
25
26
|
import './scb-fact-card/scb-fact-card.js';
|
|
26
27
|
import './scb-fact-card/scb-fact-card-content.js';
|
|
27
28
|
import './scb-footer/scb-footer.js';
|
|
@@ -72,7 +72,7 @@ import{n as l,t as I,i as k,a as w,x as h,E as i}from"../../vendor/vendor.js";im
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
*/
|
|
75
|
-
`}render(){const t=!!this.icon?.trim(),e=t?h`<md-icon slot="icon">${this.icon}</md-icon>`:i,r=i,a=this.label.trim()===""?this.icon:void 0;switch(this.variant){case"filled":return h`
|
|
75
|
+
`}render(){const t=!!this.icon?.trim(),e=t?h`<md-icon slot="icon" part="icon">${this.icon}</md-icon>`:i,r=i,a=this.label.trim()===""?this.icon:void 0;switch(this.variant){case"filled":return h`
|
|
76
76
|
<md-filled-button
|
|
77
77
|
type=${this.type}
|
|
78
78
|
variant=${r}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as
|
|
2
|
+
import{_ as u}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i as m,E as p,x as c,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,a,n){try{customElements.get(i)||t(i,a,n)}catch(d){var o=String(d||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,i,a)=>{for(var n=a>1?void 0:a?g(t,i):t,o=e.length-1,d;o>=0;o--)(d=e[o])&&(n=(a?d(t,i,n):d(n))||n);return a&&n&&f(t,i,n),n};let r=class extends m{constructor(){super(...arguments),this.label="",this.selected=!1,this.leadingIcon="",this.itemHref="",this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const t=Array.from(this.parentElement?.querySelectorAll("scb-drawer-item")||[]),i=t.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(t[i+1]||t[0]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(t[i-1]||t[t.length-1]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"Home":{e.preventDefault(),t[0].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"End":{e.preventDefault(),t[t.length-1].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){r.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),r.__rippleLoaded=!0),r.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),r.__focusRingLoaded=!0),this.leadingIcon&&!r.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),r.__iconLoaded=!0),this.hasSlotContent&&!r.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),r.__iconButtonLoaded=!0)}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(a=>a.tagName==="SCB-SUB-DRAWER")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-drawer-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-drawer-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){const e=this.renderRoot.querySelector("slot");if(e){const t=e.assignedElements({flatten:!0});this.hasSlotContent=t.length>0&&t.every(i=>i.tagName==="SCB-SUB-DRAWER")}await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,t=!!this.itemHref,i=this.hasSlotContent;return c`
|
|
3
3
|
<div class="scb-drawer-item">
|
|
4
4
|
<div class="scb-drawer-item-label" ?selected=${this.selected}>
|
|
5
5
|
${t?c`
|
|
@@ -8,7 +8,7 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
8
8
|
class="scb-drawer-label-text"
|
|
9
9
|
aria-label="${this.label}"
|
|
10
10
|
href="${this.itemHref}"
|
|
11
|
-
aria-current=${this.selected?"page":
|
|
11
|
+
aria-current=${this.selected?"page":p}
|
|
12
12
|
@click=${this._onLinkClick}
|
|
13
13
|
@keydown=${this._onKeyDown}
|
|
14
14
|
>
|
|
@@ -26,8 +26,8 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
26
26
|
class="scb-drawer-label-text"
|
|
27
27
|
@click=${this._onButtonClick}
|
|
28
28
|
@keydown=${this._onKeyDown}
|
|
29
|
-
aria-expanded=${
|
|
30
|
-
aria-controls=${
|
|
29
|
+
aria-expanded=${i?String(this.expanded):p}
|
|
30
|
+
aria-controls=${i?this.__submenuId:p}
|
|
31
31
|
>
|
|
32
32
|
<span class="scb-drawer-click ${e?"has-icon":""}">
|
|
33
33
|
<md-ripple></md-ripple>
|
|
@@ -37,12 +37,13 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
37
37
|
</button>
|
|
38
38
|
<md-focus-ring for=${this.__focusId} inward></md-focus-ring>
|
|
39
39
|
`}
|
|
40
|
-
${
|
|
40
|
+
${i?c`
|
|
41
41
|
<scb-icon-button
|
|
42
|
-
|
|
42
|
+
class="drawer-chevron"
|
|
43
|
+
icon="keyboard_arrow_down"
|
|
43
44
|
role="presentation"
|
|
44
45
|
tabindex="-1"
|
|
45
|
-
@click=${
|
|
46
|
+
@click=${a=>{a.stopPropagation(),this._toggleExpand(a)}}
|
|
46
47
|
></scb-icon-button>
|
|
47
48
|
`:""}
|
|
48
49
|
</div>
|
|
@@ -58,12 +59,18 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
58
59
|
</div>
|
|
59
60
|
</div>
|
|
60
61
|
</div>
|
|
61
|
-
`}};
|
|
62
|
+
`}};r.__rippleLoaded=!1;r.__iconLoaded=!1;r.__iconButtonLoaded=!1;r.__focusRingLoaded=!1;r.styles=b`
|
|
62
63
|
:host {
|
|
63
64
|
/* Animationtokens */
|
|
64
65
|
--scb-drawer-sub-transition-duration: var(--scb-motion-duration-quick, 150ms);
|
|
65
66
|
--scb-drawer-sub-transition-easing: var(--scb-motion-easing-standard, cubic-bezier(.69,.16,.2,.98));
|
|
66
67
|
|
|
68
|
+
--scb-drawer-chevron-transition-duration: var(--motion-duration-medium, 150ms);
|
|
69
|
+
--scb-drawer-chevron-transition-easing: var(
|
|
70
|
+
--motion-easing-emphasized-accelerate,
|
|
71
|
+
var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98))
|
|
72
|
+
);
|
|
73
|
+
|
|
67
74
|
--scb-drawer-item-padding-y: 14px;
|
|
68
75
|
--scb-drawer-item-padding-x: 20px;
|
|
69
76
|
--scb-drawer-item-padding-x-has-icon: var(--spacing-4, 12px);
|
|
@@ -71,6 +78,13 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
71
78
|
--scb-drawer-item-gap: var(--spacing-4, 12px);
|
|
72
79
|
}
|
|
73
80
|
|
|
81
|
+
:host([expanded]) {
|
|
82
|
+
--scb-drawer-chevron-transition-easing: var(
|
|
83
|
+
--motion-easing-emphasized-decelerate,
|
|
84
|
+
var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98))
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
74
88
|
.scb-drawer-item-label {
|
|
75
89
|
display: flex;
|
|
76
90
|
align-items: center;
|
|
@@ -135,6 +149,17 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
135
149
|
flex: 0 0 auto;
|
|
136
150
|
}
|
|
137
151
|
|
|
152
|
+
scb-icon-button.drawer-chevron {
|
|
153
|
+
transform: rotate(0deg);
|
|
154
|
+
transform-origin: center;
|
|
155
|
+
transition: transform var(--motion-duration-medium, var(--scb-drawer-chevron-transition-duration))
|
|
156
|
+
var(--motion-easing-standard, var(--scb-drawer-chevron-transition-easing));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:host([expanded]) scb-icon-button.drawer-chevron {
|
|
160
|
+
transform: rotate(180deg);
|
|
161
|
+
}
|
|
162
|
+
|
|
138
163
|
/* Undermeny: CSS-grid 0fr till 1fr för höjd-animation utan JS-mätningar */
|
|
139
164
|
.submenu {
|
|
140
165
|
display: grid;
|
|
@@ -159,5 +184,9 @@ import{_ as p}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i
|
|
|
159
184
|
.submenu {
|
|
160
185
|
transition: none;
|
|
161
186
|
}
|
|
187
|
+
|
|
188
|
+
scb-icon-button.drawer-chevron {
|
|
189
|
+
transition: none;
|
|
190
|
+
}
|
|
162
191
|
}
|
|
163
|
-
`;
|
|
192
|
+
`;s([l({type:String})],r.prototype,"label",2);s([l({type:Boolean,reflect:!0})],r.prototype,"selected",2);s([l({type:String,attribute:"leading-icon"})],r.prototype,"leadingIcon",2);s([l({type:String,attribute:"item-href"})],r.prototype,"itemHref",2);s([h()],r.prototype,"hasSlotContent",2);s([l({type:Boolean,reflect:!0})],r.prototype,"expanded",2);r=s([_("scb-drawer-item")],r);export{r as ScbDrawerItem};
|
|
@@ -43,7 +43,7 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n,i as f,E as _
|
|
|
43
43
|
display: block;
|
|
44
44
|
color: var(--md-sys-color-on-surface);
|
|
45
45
|
padding: var(--spacing-4, 12px);
|
|
46
|
-
background: var(--md-sys-color-surface-container-
|
|
46
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
47
47
|
font-family: var(--brand-font);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -56,7 +56,7 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n,i as f,E as _
|
|
|
56
56
|
var(--scb-drawer-fluid-width, 70vw),
|
|
57
57
|
var(--scb-drawer-max-width, 360px)
|
|
58
58
|
);
|
|
59
|
-
background: var(--md-sys-color-surface-container-
|
|
59
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
60
60
|
box-shadow: var(
|
|
61
61
|
--scb-drawer-elevation,
|
|
62
62
|
2px 0 12px rgba(0, 0, 0, 0.15)
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import{a as c,n as o,e as h,i as m,E as a,x as p,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,l,r){try{customElements.get(s)||e(s,l,r)}catch(u){var d=String(u||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,i=(t,e,s,l)=>{for(var r=l>1?void 0:l?b(e,s):e,d=t.length-1,u;d>=0;d--)(u=t[d])&&(r=(l?u(e,s,r):u(r))||r);return l&&r&&f(e,s,r),r};let n=class extends m{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.asTab=!1,this.useMenuPositioning=!1,this.dataIndex=null,this.ariaCurrent=null,this.menuGap="3",this.width=null,this.maxWidth=null,this._slottedMenuEl=null,this._generatedMenuId=null,this._onDocumentClickBound=t=>{this.useMenuPositioning&&this._slottedMenuEl||!this.open||t.composedPath().includes(this)||(this.open=!1)},this._onDocumentKeydownBound=t=>{this.useMenuPositioning&&this._slottedMenuEl||this.open&&t.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this.requestUpdate()},this._onTriggerClick=t=>{this.disabled||(this.asTab||this.useMenuPositioning&&this._slottedMenuEl||t.stopPropagation(),!(this.useMenuPositioning&&this._slottedMenuEl)&&(this.open=!this.open))}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),super.disconnectedCallback()}focus(t){if(this.asTab){this._tabTriggerEl?.focus(t);return}if(this._triggerEl){try{this._triggerEl.focus(t)}catch{this._triggerEl.focus()}return}super.focus(t)}firstUpdated(t){super.firstUpdated(t),this._syncSlottedMenu(),this._ensureSlottedMenuId(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState()}updated(t){super.updated(t),t.has("useMenuPositioning")&&this._ensureSlottedMenuId(),t.has("menuGap")&&this._applyPanelVars(),(t.has("width")||t.has("maxWidth"))&&this._applyPanelSizing(),t.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const t=this.renderRoot.querySelector(".panel-surface");t&&(this.width&&String(this.width).trim()!==""?t.style.inlineSize=this.width:t.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?t.style.maxInlineSize=this.maxWidth:t.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size"))}_mapSpacingToken(t){const e=String(t).trim();return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}_getSlottedMenuId(){const t=this._slottedMenuEl?.id;return!t||!t.trim()?null:t.trim()}_ensureSlottedMenuId(){if(!this.useMenuPositioning||!this._slottedMenuEl)return;const t=this._slottedMenuEl;if(!(t.id&&t.id.trim())){if(!this._generatedMenuId){const e=globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2);this._generatedMenuId=`scb-dropdown-menu-${e}`}t.id=this._generatedMenuId}}_syncSlottedMenu(){const e=(this._slotEl?.assignedElements({flatten:!0})??[]).find(s=>s.tagName.toLowerCase()==="scb-menu");if(e===this._slottedMenuEl){this._ensureSlottedMenuId(),this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=e??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._ensureSlottedMenuId(),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){this._slottedMenuEl&&(this.useMenuPositioning||(this._slottedMenuEl.open=this.open))}_closeAllSubMenus(){const t=this.querySelectorAll("scb-sub-menu");for(const e of t)e.removeAttribute("open")}_applyChevronState(){if(this.asTab)return;const t=this._getChevronIconEl();t&&(t.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",t.style.transformOrigin="center",t.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){if(!this._triggerEl)return null;const e=this._triggerEl?.shadowRoot;return e?e.querySelector('md-icon[slot="icon"]')??e.querySelector("md-icon"):null}render(){const t=!!this._slottedMenuEl,e=this.useMenuPositioning?this._getSlottedMenuId():null,s=!(this.useMenuPositioning&&t);return p`
|
|
2
|
+
${this.asTab?p`
|
|
3
|
+
<div class="tab-root">
|
|
4
|
+
<button
|
|
5
|
+
type="button"
|
|
6
|
+
class="tab-link"
|
|
7
|
+
data-index=${this.dataIndex??a}
|
|
8
|
+
aria-current=${this.ariaCurrent==="page"?"page":a}
|
|
9
|
+
aria-haspopup=${e?"menu":a}
|
|
10
|
+
aria-expanded=${String(this.open)}
|
|
11
|
+
aria-controls=${e??a}
|
|
12
|
+
data-menu-toggle=${e??a}
|
|
13
|
+
?disabled=${this.disabled}
|
|
14
|
+
@click=${this._onTriggerClick}
|
|
15
|
+
>
|
|
16
|
+
${this.label}
|
|
17
|
+
<md-icon class="chevron">expand_more</md-icon>
|
|
18
|
+
</button>
|
|
19
|
+
<md-focus-ring></md-focus-ring>
|
|
20
|
+
</div>
|
|
21
|
+
`:p`
|
|
22
|
+
<scb-button
|
|
23
|
+
label=${this.label}
|
|
24
|
+
variant=${this.variant}
|
|
25
|
+
icon="expand_more"
|
|
26
|
+
aria-haspopup=${e?"menu":a}
|
|
27
|
+
aria-expanded=${String(this.open)}
|
|
28
|
+
aria-controls=${e??a}
|
|
29
|
+
data-menu-toggle=${e??a}
|
|
30
|
+
?trailing-icon=${!0}
|
|
31
|
+
?disabled=${this.disabled}
|
|
32
|
+
@click=${this._onTriggerClick}
|
|
33
|
+
></scb-button>
|
|
34
|
+
`}
|
|
35
|
+
|
|
36
|
+
${s?p`
|
|
37
|
+
<div class="panel ${t?"has-menu":""}" ?hidden=${!this.open}>
|
|
38
|
+
<div class="panel-surface">
|
|
39
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
`:p`<slot @slotchange=${this._onSlotChange}></slot>`}
|
|
43
|
+
`}};n.styles=c`
|
|
44
|
+
:host {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
position: relative;
|
|
47
|
+
overflow: visible;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([as-tab]) {
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([as-tab]) .tab-root {
|
|
55
|
+
position: relative;
|
|
56
|
+
display: block;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([as-tab]) .tab-link {
|
|
60
|
+
position: relative;
|
|
61
|
+
border: none;
|
|
62
|
+
background: transparent;
|
|
63
|
+
padding: var(--spacing-5, 16px) var(--spacing-5, 16px);
|
|
64
|
+
border-radius: var(--md-sys-shape-corner-extra-small)
|
|
65
|
+
var(--md-sys-shape-corner-extra-small) 0 0;
|
|
66
|
+
font-size: var(--md-sys-typescale-title-medium-size);
|
|
67
|
+
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
68
|
+
font-weight: var(--md-sys-typescale-title-medium-weight);
|
|
69
|
+
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
70
|
+
color: var(--md-sys-color-on-surface);
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: var(--spacing-3, 8px);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([as-tab]) .tab-link::after {
|
|
78
|
+
content: '';
|
|
79
|
+
position: absolute;
|
|
80
|
+
left: 0;
|
|
81
|
+
right: 0;
|
|
82
|
+
bottom: 0;
|
|
83
|
+
height: 3px;
|
|
84
|
+
border-radius: 999px 999px 0 0;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([as-tab]) .tab-link[aria-current='page']::after {
|
|
89
|
+
background-color: var(--md-sys-color-primary);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([as-tab]) md-focus-ring {
|
|
93
|
+
position: absolute;
|
|
94
|
+
inset: -4px;
|
|
95
|
+
border-radius: var(--md-sys-shape-corner-extra-small)
|
|
96
|
+
var(--md-sys-shape-corner-extra-small) 0 0;
|
|
97
|
+
display: none;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([as-tab]) .tab-link:focus-visible + md-focus-ring {
|
|
102
|
+
display: block;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([as-tab]) md-icon.chevron {
|
|
106
|
+
transition:
|
|
107
|
+
transform var(--motion-duration-medium, 200ms)
|
|
108
|
+
var(--motion-easing-standard, ease);
|
|
109
|
+
transform-origin: center;
|
|
110
|
+
transform: rotate(0deg);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host([as-tab][open]) md-icon.chevron {
|
|
114
|
+
transform: rotate(180deg);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.panel {
|
|
118
|
+
position: absolute;
|
|
119
|
+
inset-inline-start: 0;
|
|
120
|
+
inset-block-start: calc(100% + var(--scb-dropdown-panel-gap, var(--spacing-3, 8px)));
|
|
121
|
+
z-index: var(--scb-dropdown-z-index, 1000);
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([open]) .panel {
|
|
126
|
+
pointer-events: auto;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.panel-surface {
|
|
130
|
+
display: block;
|
|
131
|
+
width: fit-content;
|
|
132
|
+
max-width: var(--scb-dropdown-panel-max-width, 600px);
|
|
133
|
+
background: var(--md-sys-color-surface, #ffffff);
|
|
134
|
+
box-shadow: var(--elevation-2, 0px 2px 10px rgba(0, 0, 0, 0.12));
|
|
135
|
+
overflow: visible;
|
|
136
|
+
opacity: 0;
|
|
137
|
+
transform: scaleY(0.9);
|
|
138
|
+
transform-origin: top;
|
|
139
|
+
transition:
|
|
140
|
+
opacity var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease),
|
|
141
|
+
transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([open]) .panel-surface {
|
|
145
|
+
opacity: 1;
|
|
146
|
+
transform: scaleY(1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.panel.has-menu .panel-surface {
|
|
150
|
+
background: transparent;
|
|
151
|
+
box-shadow: none;
|
|
152
|
+
padding: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:host(:not([use-menu-positioning])) ::slotted(scb-menu) {
|
|
156
|
+
position: static !important;
|
|
157
|
+
transform: none !important;
|
|
158
|
+
width: fit-content;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([use-menu-positioning]) ::slotted(scb-menu) {
|
|
162
|
+
width: fit-content;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
::slotted(scb-menu) {
|
|
166
|
+
position: static !important;
|
|
167
|
+
transform: none !important;
|
|
168
|
+
width: fit-content;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
::slotted(scb-checkbox) {
|
|
172
|
+
display: block;
|
|
173
|
+
padding-right: var(--spacing-4, 12px);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
::slotted(scb-button) {
|
|
177
|
+
|
|
178
|
+
padding-right: var(--spacing-4, 12px);
|
|
179
|
+
padding-left: var(--spacing-4, 12px);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
::slotted(scb-drawer) {
|
|
183
|
+
display: block;
|
|
184
|
+
padding-right: var(--spacing-4, 12px);
|
|
185
|
+
}
|
|
186
|
+
`;i([o({type:String})],n.prototype,"label",2);i([o({type:String})],n.prototype,"variant",2);i([o({type:Boolean,reflect:!0})],n.prototype,"open",2);i([o({type:Boolean,reflect:!0})],n.prototype,"disabled",2);i([o({type:Boolean,reflect:!0,attribute:"as-tab"})],n.prototype,"asTab",2);i([o({type:Boolean,reflect:!0,attribute:"use-menu-positioning"})],n.prototype,"useMenuPositioning",2);i([o({type:String,attribute:"data-index",reflect:!0})],n.prototype,"dataIndex",2);i([o({type:String,attribute:"aria-current",reflect:!0})],n.prototype,"ariaCurrent",2);i([o({type:String,attribute:"menu-gap"})],n.prototype,"menuGap",2);i([o({type:String})],n.prototype,"width",2);i([o({type:String,attribute:"max-width"})],n.prototype,"maxWidth",2);i([h("scb-button")],n.prototype,"_triggerEl",2);i([h(".tab-link")],n.prototype,"_tabTriggerEl",2);i([h("slot")],n.prototype,"_slotEl",2);n=i([g("scb-dropdown")],n);
|