scb-wc-test 0.1.105 → 0.1.107
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/mvc/components/scb-accordion/scb-accordion.js +8 -2
- package/mvc/components/scb-avatar/scb-avatar.js +19 -10
- package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -3
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +13 -7
- package/mvc/components/scb-button/scb-button.js +34 -32
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +13 -11
- package/mvc/components/scb-card/scb-card.js +44 -41
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +15 -13
- package/mvc/components/scb-checkbox/scb-checkbox.js +6 -6
- package/mvc/components/scb-chip/scb-chip.js +27 -7
- package/mvc/components/scb-divider/scb-divider.js +41 -15
- package/mvc/components/scb-fact-card/scb-fact-card.js +37 -18
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -43
- package/mvc/components/scb-icon-button/scb-icon-button.js +16 -10
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +5 -5
- package/mvc/components/scb-pagination/scb-pagination.js +165 -107
- package/mvc/components/scb-radio-button/scb-radio-group.js +22 -11
- package/mvc/components/scb-search/scb-search.js +84 -32
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +15 -13
- package/mvc/components/scb-status-pill/scb-status-pill.js +17 -13
- package/mvc/components/scb-stepper/scb-stepper.js +32 -29
- package/mvc/components/scb-switch/scb-switch.js +11 -8
- package/mvc/components/scb-tabs/scb-tabs.js +22 -19
- package/mvc/components/scb-textfield/scb-textfield.js +14 -10
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +188 -178
- package/package.json +2 -2
- package/scb-accordion/scb-accordion.d.ts +13 -0
- package/scb-accordion/scb-accordion.js +53 -21
- package/scb-avatar/scb-avatar.d.ts +6 -0
- package/scb-avatar/scb-avatar.js +96 -61
- package/scb-breadcrumb/scb-breadcrumb-item.js +8 -9
- package/scb-breadcrumb/scb-breadcrumb.d.ts +6 -0
- package/scb-breadcrumb/scb-breadcrumb.js +61 -30
- package/scb-button/scb-button.d.ts +10 -0
- package/scb-button/scb-button.js +89 -65
- package/scb-calendar-card/scb-calendar-card.d.ts +5 -0
- package/scb-calendar-card/scb-calendar-card.js +79 -55
- package/scb-card/scb-card.d.ts +5 -0
- package/scb-card/scb-card.js +165 -140
- package/scb-checkbox/scb-checkbox-group.d.ts +3 -1
- package/scb-checkbox/scb-checkbox-group.js +59 -40
- package/scb-checkbox/scb-checkbox.d.ts +11 -0
- package/scb-checkbox/scb-checkbox.js +78 -56
- package/scb-chip/scb-chip.d.ts +24 -0
- package/scb-chip/scb-chip.js +137 -65
- package/scb-divider/scb-divider.d.ts +14 -0
- package/scb-divider/scb-divider.js +91 -43
- package/scb-fact-card/scb-fact-card.d.ts +10 -0
- package/scb-fact-card/scb-fact-card.js +135 -94
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +10 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +179 -120
- package/scb-icon-button/scb-icon-button.d.ts +10 -1
- package/scb-icon-button/scb-icon-button.js +88 -59
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +10 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +76 -52
- package/scb-list/scb-list.d.ts +7 -1
- package/scb-list/scb-list.js +62 -40
- package/scb-notification-card/scb-notification-card.d.ts +5 -0
- package/scb-notification-card/scb-notification-card.js +56 -39
- package/scb-pagination/scb-pagination.d.ts +12 -1
- package/scb-pagination/scb-pagination.js +235 -147
- package/scb-radio-button/scb-radio-group.d.ts +14 -3
- package/scb-radio-button/scb-radio-group.js +120 -67
- package/scb-search/scb-search.d.ts +15 -2
- package/scb-search/scb-search.js +152 -69
- package/scb-segmented-button/scb-segmented-button.d.ts +45 -4
- package/scb-segmented-button/scb-segmented-button.js +163 -72
- package/scb-status-pill/scb-status-pill.d.ts +12 -1
- package/scb-status-pill/scb-status-pill.js +51 -27
- package/scb-stepper/scb-stepper.d.ts +11 -3
- package/scb-stepper/scb-stepper.js +134 -101
- package/scb-switch/scb-switch.d.ts +21 -2
- package/scb-switch/scb-switch.js +97 -45
- package/scb-tabs/scb-tabs.d.ts +8 -0
- package/scb-tabs/scb-tabs.js +74 -44
- package/scb-textfield/scb-textfield.d.ts +7 -0
- package/scb-textfield/scb-textfield.js +43 -16
- package/scb-toc/scb-toc.d.ts +10 -1
- package/scb-toc/scb-toc.js +49 -18
- package/scb-viz/scb-viz.d.ts +10 -3
- package/scb-viz/scb-viz.js +278 -236
- package/scb-wc-test.bundle.js +1184 -901
|
@@ -1,58 +1,87 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import{a as g,n as h,i as v,x as n,t as S}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(l,e,s){try{customElements.get(l)||o(l,e,s)}catch(i){var r=String(i||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=t=>{throw TypeError(t)},a=(t,o,l,e)=>{for(var s=e>1?void 0:e?y(o,l):o,r=t.length-1,i;r>=0;r--)(i=t[r])&&(s=(e?i(o,l,s):i(s))||s);return e&&s&&w(o,l,s),s},m=(t,o,l)=>o.has(t)||f("Cannot "+l),x=(t,o,l)=>o.has(t)?f("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(t):o.set(t,l),b=(t,o,l)=>(m(t,o,"access private method"),l),d,p;let c=class extends v{constructor(){super(...arguments),x(this,d),this.variant="standard",this.width="100%",this.showScrollbar=!0,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing="",this.spacingTop="",this.spacingBottom="",this.contentFlex=!1,this.updateScrollButtons=()=>{this.requestUpdate();const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return;t.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const o=t;o.scrollLeft+o.clientWidth<o.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.handleScroll=()=>{const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");t&&(this.updateScrollButtons(),this.dispatchCustomEvent("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEvent("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEvent("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEvent("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEvent("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)}}doScrollBy(t){const o=this.shadowRoot?.querySelector(".scb-horizontal-scroller");o&&o.scrollBy({left:t,behavior:"smooth"})}get canScrollLeft(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");return t?t.scrollLeft>0:!1}get canScrollRight(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t)return!1;const o=t;return o.scrollLeft+o.clientWidth<o.scrollWidth-1}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this.updateScrollButtons,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",this.updateScrollButtons,!0)}dispatchCustomEvent(t,o={}){this.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,composed:!0}))}firstUpdated(){const t=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),o=this.shadowRoot?.querySelector(".scroll-shadow-left"),l=this.shadowRoot?.querySelector(".scroll-shadow-right"),e=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("scroll",this.handleScroll),t.addEventListener("wheel",function(r){r.deltaY!==0&&(r.preventDefault(),t.scrollLeft+=r.deltaY)},{passive:!1}));const s=()=>{if(e&&o&&l){const r=e.getBoundingClientRect();o.style.height=`${r.height}px`,l.style.height=`${r.height}px`}};s(),e&&new ResizeObserver(s).observe(e),this.updateComplete.then(()=>{this.updateScrollButtons()}),b(this,d,p).call(this)}updated(t){const o=this.shadowRoot?.querySelector(".scroll-shadow-left"),l=this.shadowRoot?.querySelector(".scroll-shadow-right"),e=this.shadowRoot?.querySelector("slot"),s=this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(s){s.addEventListener("scroll",this.handleScroll),s.addEventListener("wheel",function(u){u.deltaY!==0&&(u.preventDefault(),s.scrollLeft+=u.deltaY)},{passive:!1}),s.scrollLeft>0?this.setAttribute("data-scroll-left",""):this.removeAttribute("data-scroll-left");const i=s;i.scrollLeft+i.clientWidth<i.scrollWidth-1?this.setAttribute("data-scroll-right",""):this.removeAttribute("data-scroll-right")}t.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width);const r=()=>{if(e&&o&&l){const i=e.getBoundingClientRect();o.style.height=`${i.height}px`,l.style.height=`${i.height}px`}};r(),e&&new ResizeObserver(r).observe(e),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&b(this,d,p).call(this)}mapSpacingToken(t){if(!t)return;const o=String(t).trim();if(o)return/^\d+$/.test(o)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(o,10)))})`:o}render(){const t=this.variant,o=!!(this.canScrollLeft||this.canScrollRight);switch(t){case"inline":return n`
|
|
2
|
+
<div class="scb-horizontal-scroller ${o?"canScroll":""}" tabindex="0">
|
|
3
|
+
${this.variant!="inline"?n`<div class="scroll-shadow-left"></div>`:""}
|
|
4
|
+
<slot></slot>
|
|
5
|
+
<md-focus-ring inward></md-focus-ring>
|
|
6
|
+
${this.variant!="inline"?n`<div class="scroll-shadow-right"></div>`:""}
|
|
7
|
+
</div>
|
|
8
|
+
${o?n`
|
|
9
|
+
<div class="scroll-buttons">
|
|
10
|
+
${this.canScrollLeft?n`
|
|
11
|
+
<scb-button
|
|
12
|
+
class="scroll-button-left"
|
|
13
|
+
variant="text"
|
|
14
|
+
label="${this.leftScrollButtonLabel}"
|
|
15
|
+
aria-label="Scrolla vänster"
|
|
16
|
+
icon="chevron_left"
|
|
17
|
+
@click="${()=>this.doScrollBy(-100)}"
|
|
18
|
+
></scb-button>
|
|
19
|
+
`:""}
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
${this.canScrollRight?n`
|
|
22
|
+
<scb-button
|
|
23
|
+
class="scroll-button-right"
|
|
24
|
+
variant="text"
|
|
25
|
+
label="${this.rightScrollButtonLabel}"
|
|
26
|
+
aria-label="Scrolla höger"
|
|
27
|
+
icon="chevron_right"
|
|
28
|
+
trailing-icon
|
|
29
|
+
@click="${()=>this.doScrollBy(100)}"
|
|
30
|
+
></scb-button>
|
|
31
|
+
`:""}
|
|
32
|
+
</div>
|
|
33
|
+
`:""}
|
|
34
|
+
`;default:return n`
|
|
35
|
+
${this.canScrollLeft?n`
|
|
36
|
+
<scb-icon-button
|
|
37
|
+
class="scroll-button-left"
|
|
38
|
+
icon="chevron_left"
|
|
39
|
+
aria-label="Scrolla vänster"
|
|
40
|
+
variant="filled-tonal"
|
|
41
|
+
@click="${()=>this.doScrollBy(-100)}"
|
|
42
|
+
></scb-icon-button>
|
|
43
|
+
`:""}
|
|
44
|
+
<div class="scroll-shadow-left"></div>
|
|
45
|
+
<div class="scb-horizontal-scroller">
|
|
46
|
+
<slot></slot>
|
|
47
|
+
<md-focus-ring inward></md-focus-ring>
|
|
17
48
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
${this.canScrollRight?c`
|
|
30
|
-
<scb-icon-button class="scroll-button-right" icon="chevron_right" aria-label="Scrolla höger" variant="filled-tonal" @click="${()=>this.doScrollBy(100)}"></scb-icon-button>
|
|
31
|
-
`:""}
|
|
32
|
-
`}}};a.styles=u`
|
|
49
|
+
<div class="scroll-shadow-right"></div>
|
|
50
|
+
${this.canScrollRight?n`
|
|
51
|
+
<scb-icon-button
|
|
52
|
+
class="scroll-button-right"
|
|
53
|
+
icon="chevron_right"
|
|
54
|
+
aria-label="Scrolla höger"
|
|
55
|
+
variant="filled-tonal"
|
|
56
|
+
@click="${()=>this.doScrollBy(100)}"
|
|
57
|
+
></scb-icon-button>
|
|
58
|
+
`:""}
|
|
59
|
+
`}}};d=new WeakSet;p=function(){const t=this.mapSpacingToken(this.spacing),o=this.mapSpacingToken(this.spacingTop),l=this.mapSpacingToken(this.spacingBottom),e=o??t,s=l??t;e?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",e):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),s?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",s):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end")};c.styles=g`
|
|
33
60
|
:host {
|
|
34
61
|
display: flex;
|
|
35
62
|
position: relative;
|
|
36
63
|
align-items: center;
|
|
37
64
|
gap: var(--spacing-3);
|
|
38
65
|
padding: 0px var(--spacing-8);
|
|
66
|
+
margin-block-start: var(--scb-horizontal-scroller-spacing-block-start, 0);
|
|
67
|
+
margin-block-end: var(--scb-horizontal-scroller-spacing-block-end, 0);
|
|
39
68
|
}
|
|
40
69
|
.scb-horizontal-scroller {
|
|
41
70
|
overflow-x: auto;
|
|
42
|
-
-ms-overflow-style: none;
|
|
71
|
+
-ms-overflow-style: none; /* IE and Edge */
|
|
43
72
|
scrollbar-width: none;
|
|
44
73
|
width: 100%;
|
|
45
74
|
}
|
|
46
|
-
:host([show-scrollbar]) .scb-horizontal-scroller{
|
|
47
|
-
|
|
75
|
+
:host([show-scrollbar]) .scb-horizontal-scroller {
|
|
76
|
+
scrollbar-width: auto;
|
|
48
77
|
}
|
|
49
78
|
|
|
50
|
-
:host([content-flex]) .scb-horizontal-scroller{
|
|
79
|
+
:host([content-flex]) .scb-horizontal-scroller {
|
|
51
80
|
display: flex;
|
|
52
81
|
flex-direction: row;
|
|
53
82
|
flex: 1 1 auto;
|
|
54
83
|
}
|
|
55
|
-
|
|
84
|
+
|
|
56
85
|
.scb-horizontal-scroller::-webkit-scrollbar {
|
|
57
86
|
border-radius: var(--md-sys-shape-corner-large);
|
|
58
87
|
height: 4px;
|
|
@@ -68,13 +97,13 @@ import{a as u,n as h,i as b,x as c,t as f}from"../../vendor/vendor.js";import"..
|
|
|
68
97
|
border-radius: var(--md-sys-shape-corner-large);
|
|
69
98
|
}
|
|
70
99
|
.scb-horizontal-scroller:focus {
|
|
71
|
-
|
|
100
|
+
outline: none;
|
|
72
101
|
}
|
|
73
102
|
md-focus-ring {
|
|
74
103
|
border-radius: var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large));
|
|
75
104
|
}
|
|
76
105
|
|
|
77
|
-
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{
|
|
106
|
+
:host([show-scrollbar]) .scb-horizontal-scroller.canScroll {
|
|
78
107
|
padding-bottom: var(--spacing-5);
|
|
79
108
|
}
|
|
80
109
|
slot {
|
|
@@ -113,12 +142,12 @@ import{a as u,n as h,i as b,x as c,t as f}from"../../vendor/vendor.js";import"..
|
|
|
113
142
|
right: 0;
|
|
114
143
|
}
|
|
115
144
|
:host([data-scroll-left]) .scroll-shadow-left {
|
|
116
|
-
box-shadow: 16px 0 16px -8px rgba(0,0,0,0.12);
|
|
145
|
+
box-shadow: 16px 0 16px -8px rgba(0, 0, 0, 0.12);
|
|
117
146
|
}
|
|
118
147
|
:host([data-scroll-right]) .scroll-shadow-right {
|
|
119
|
-
box-shadow: -16px 0 16px -8px rgba(0,0,0,0.12);
|
|
148
|
+
box-shadow: -16px 0 16px -8px rgba(0, 0, 0, 0.12);
|
|
120
149
|
}
|
|
121
|
-
:host([variant=
|
|
150
|
+
:host([variant='inline']) {
|
|
122
151
|
flex-direction: column;
|
|
123
152
|
align-items: unset;
|
|
124
153
|
padding: 0;
|
|
@@ -138,8 +167,7 @@ import{a as u,n as h,i as b,x as c,t as f}from"../../vendor/vendor.js";import"..
|
|
|
138
167
|
z-index: auto;
|
|
139
168
|
}
|
|
140
169
|
}
|
|
141
|
-
:host([variant=
|
|
170
|
+
:host([variant='inline'][show-scrollbar]) {
|
|
142
171
|
gap: var(--spacing-5);
|
|
143
172
|
}
|
|
144
|
-
|
|
145
|
-
`;n([h({type:String,reflect:!0})],a.prototype,"variant",2);n([h({type:String,reflect:!0})],a.prototype,"width",2);n([h({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],a.prototype,"showScrollbar",2);n([h({type:String,reflect:!0,attribute:"right-scroll-button-label"})],a.prototype,"rightScrollButtonLabel",2);n([h({type:String,reflect:!0,attribute:"left-scroll-button-label"})],a.prototype,"leftScrollButtonLabel",2);n([h({type:Boolean,reflect:!0,attribute:"content-flex"})],a.prototype,"contentFlex",2);a=n([f("scb-horizontal-scroller")],a);
|
|
173
|
+
`;a([h({type:String,reflect:!0})],c.prototype,"variant",2);a([h({type:String,reflect:!0})],c.prototype,"width",2);a([h({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],c.prototype,"showScrollbar",2);a([h({type:String,reflect:!0,attribute:"right-scroll-button-label"})],c.prototype,"rightScrollButtonLabel",2);a([h({type:String,reflect:!0,attribute:"left-scroll-button-label"})],c.prototype,"leftScrollButtonLabel",2);a([h({type:String,reflect:!0})],c.prototype,"spacing",2);a([h({type:String,reflect:!0,attribute:"spacing-top"})],c.prototype,"spacingTop",2);a([h({type:String,reflect:!0,attribute:"spacing-bottom"})],c.prototype,"spacingBottom",2);a([h({type:Boolean,reflect:!0,attribute:"content-flex"})],c.prototype,"contentFlex",2);c=a([S("scb-horizontal-scroller")],c);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_}from"../../vendor/preload-helper.js";import{a as
|
|
2
|
+
import{_ as h}from"../../vendor/preload-helper.js";import{a as g,n as a,i as m,x as r,t as f}from"../../vendor/vendor.js";import"../../vendor/vendor-material.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(i,l,n){try{customElements.get(i)||e(i,l,n)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=t=>{throw TypeError(t)},s=(t,e,i,l)=>{for(var n=l>1?void 0:l?y(e,i):e,d=t.length-1,c;d>=0;d--)(c=t[d])&&(n=(l?c(e,i,n):c(n))||n);return l&&n&&v(e,i,n),n},A=(t,e,i)=>e.has(t)||b("Cannot "+i),$=(t,e,i)=>e.has(t)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),p=(t,e,i)=>(A(t,e,"access private method"),i),_,u;let o=class extends m{constructor(){super(...arguments),$(this,_),this.icon="home",this.tooltip="",this.ariaLabel="",this.variant="standard",this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.__loadedVariants=new Set,this.__iconLoaded=!1,this.__lastMdHost=null,this.__onInnerChange=()=>{const e=!!this.__getMdHost()?.selected;this.toggle&&(this.selected=e),this.dispatchEvent(new CustomEvent("change",{detail:{selected:e},bubbles:!0,composed:!0}))}}async firstUpdated(){await this.__ensureDepsLoaded(),await this.updateComplete,this.__attachChangeListener(),this.__syncTitleAndAria(),p(this,_,u).call(this)}updated(t){if(super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&p(this,_,u).call(this),t.has("variant")){this.__ensureDepsLoaded().then(()=>{queueMicrotask(()=>{this.__attachChangeListener(),this.__syncTitleAndAria()})});return}(t.has("toggle")||t.has("icon")||t.has("toggleofficon")||t.has("toggleonicon")||t.has("selected")||t.has("disabled")||t.has("tooltip")||t.has("ariaLabel"))&&queueMicrotask(()=>{this.__attachChangeListener(),this.__syncTitleAndAria()})}disconnectedCallback(){this.__lastMdHost?.removeEventListener?.("change",this.__onInnerChange),this.__lastMdHost=null,super.disconnectedCallback()}async __ensureDepsLoaded(){if(!this.__loadedVariants.has(this.variant)){switch(this.variant){case"filled":await h(()=>import("../../vendor/vendor-material.js").then(t=>t.f),__vite__mapDeps([0,1]),import.meta.url);break;case"outlined":await h(()=>import("../../vendor/vendor-material.js").then(t=>t.o),__vite__mapDeps([0,1]),import.meta.url);break;case"filled-tonal":await h(()=>import("../../vendor/vendor-material.js").then(t=>t.c),__vite__mapDeps([0,1]),import.meta.url);break;default:await h(()=>import("../../vendor/vendor-material.js").then(t=>t.d),__vite__mapDeps([0,1]),import.meta.url);break}this.__loadedVariants.add(this.variant)}this.__iconLoaded||(await h(()=>import("../../vendor/vendor-material.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),this.__iconLoaded=!0)}__getMdHost(){return this.renderRoot.querySelector("md-filled-icon-button, md-outlined-icon-button, md-filled-tonal-icon-button, md-icon-button")}__attachChangeListener(){const t=this.__getMdHost();t&&t!==this.__lastMdHost&&(this.__lastMdHost?.removeEventListener?.("change",this.__onInnerChange),t.addEventListener("change",this.__onInnerChange),this.__lastMdHost=t),this.toggle&&t&&"selected"in t&&(t.selected=this.selected)}__syncTitleAndAria(){const t=this.__getMdHost();if(!t)return;const e=(this.tooltip||this.getAttribute("title")||"").trim(),i=(this.ariaLabel||this.getAttribute("aria-label")||"").trim(),l=this.getAttribute("aria-controls"),n=this.getAttribute("aria-expanded");this.tooltip&&this.setAttribute("title",e);const d=i||e||this.icon.trim()||void 0;d?t.setAttribute("aria-label",d):t.removeAttribute("aria-label"),e?t.setAttribute("title",e):t.removeAttribute("title"),l!==null?t.setAttribute("aria-controls",l):t.removeAttribute("aria-controls"),n!==null?t.setAttribute("aria-expanded",n):t.removeAttribute("aria-expanded")}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__renderToggleIcons(){return r`
|
|
3
3
|
<md-icon aria-hidden="true">${this.toggleofficon}</md-icon>
|
|
4
4
|
<md-icon slot="selected" aria-hidden="true">${this.toggleonicon}</md-icon>
|
|
5
|
-
`}__renderSingleIcon(){return
|
|
5
|
+
`}__renderSingleIcon(){return r`<md-icon aria-hidden="true">${this.icon}</md-icon>`}__renderMd(){const t=this.toggle?this.__renderToggleIcons():this.__renderSingleIcon();if(this.toggle)switch(this.variant){case"filled":return r`
|
|
6
6
|
<md-filled-icon-button
|
|
7
7
|
toggle
|
|
8
8
|
?selected=${this.selected}
|
|
@@ -10,7 +10,7 @@ import{_}from"../../vendor/preload-helper.js";import{a as u,n as d,i as h,x as s
|
|
|
10
10
|
>
|
|
11
11
|
${t}
|
|
12
12
|
</md-filled-icon-button>
|
|
13
|
-
`;case"outlined":return
|
|
13
|
+
`;case"outlined":return r`
|
|
14
14
|
<md-outlined-icon-button
|
|
15
15
|
toggle
|
|
16
16
|
?selected=${this.selected}
|
|
@@ -18,7 +18,7 @@ import{_}from"../../vendor/preload-helper.js";import{a as u,n as d,i as h,x as s
|
|
|
18
18
|
>
|
|
19
19
|
${t}
|
|
20
20
|
</md-outlined-icon-button>
|
|
21
|
-
`;case"filled-tonal":return
|
|
21
|
+
`;case"filled-tonal":return r`
|
|
22
22
|
<md-filled-tonal-icon-button
|
|
23
23
|
toggle
|
|
24
24
|
?selected=${this.selected}
|
|
@@ -26,24 +26,30 @@ import{_}from"../../vendor/preload-helper.js";import{a as u,n as d,i as h,x as s
|
|
|
26
26
|
>
|
|
27
27
|
${t}
|
|
28
28
|
</md-filled-tonal-icon-button>
|
|
29
|
-
`;default:return
|
|
29
|
+
`;default:return r`
|
|
30
30
|
<md-icon-button toggle ?selected=${this.selected} ?disabled=${this.disabled}>
|
|
31
31
|
${t}
|
|
32
32
|
</md-icon-button>
|
|
33
|
-
`}switch(this.variant){case"filled":return
|
|
33
|
+
`}switch(this.variant){case"filled":return r`
|
|
34
34
|
<md-filled-icon-button ?disabled=${this.disabled}>
|
|
35
35
|
${t}
|
|
36
36
|
</md-filled-icon-button>
|
|
37
|
-
`;case"outlined":return
|
|
37
|
+
`;case"outlined":return r`
|
|
38
38
|
<md-outlined-icon-button ?disabled=${this.disabled}>
|
|
39
39
|
${t}
|
|
40
40
|
</md-outlined-icon-button>
|
|
41
|
-
`;case"filled-tonal":return
|
|
41
|
+
`;case"filled-tonal":return r`
|
|
42
42
|
<md-filled-tonal-icon-button ?disabled=${this.disabled}>
|
|
43
43
|
${t}
|
|
44
44
|
</md-filled-tonal-icon-button>
|
|
45
|
-
`;default:return
|
|
45
|
+
`;default:return r`
|
|
46
46
|
<md-icon-button ?disabled=${this.disabled}>
|
|
47
47
|
${t}
|
|
48
48
|
</md-icon-button>
|
|
49
|
-
`}}render(){return this.__renderMd()}};
|
|
49
|
+
`}}render(){return this.__renderMd()}};_=new WeakSet;u=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t;e?this.style.setProperty("--scb-icon-button-spacing-block-start",e):this.style.removeProperty("--scb-icon-button-spacing-block-start"),i?this.style.setProperty("--scb-icon-button-spacing-block-end",i):this.style.removeProperty("--scb-icon-button-spacing-block-end")};o.styles=g`
|
|
50
|
+
:host {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
margin-block-start: var(--scb-icon-button-spacing-block-start, 0);
|
|
53
|
+
margin-block-end: var(--scb-icon-button-spacing-block-end, 0);
|
|
54
|
+
}
|
|
55
|
+
`;s([a({type:String})],o.prototype,"icon",2);s([a({type:String})],o.prototype,"tooltip",2);s([a({type:String,attribute:"aria-label"})],o.prototype,"ariaLabel",2);s([a({type:String})],o.prototype,"variant",2);s([a({type:Boolean,reflect:!0})],o.prototype,"toggle",2);s([a({type:Boolean,reflect:!0})],o.prototype,"selected",2);s([a({type:String})],o.prototype,"toggleofficon",2);s([a({type:String})],o.prototype,"toggleonicon",2);s([a({type:Boolean,reflect:!0})],o.prototype,"disabled",2);s([a({type:String,reflect:!0})],o.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",2);o=s([f("scb-icon-button")],o);export{o as ScbIconButton};
|
|
@@ -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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as
|
|
2
|
+
import{_ as u}from"../../vendor/preload-helper.js";import{a as f,n as a,i as m,x as l,t as b}from"../../vendor/vendor.js";import"../../vendor/vendor-material.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(r,n,o){try{customElements.get(r)||t(r,n,o)}catch(p){var c=String(p||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var v=Object.defineProperty,k=Object.getOwnPropertyDescriptor,y=e=>{throw TypeError(e)},s=(e,t,r,n)=>{for(var o=n>1?void 0:n?k(t,r):t,c=e.length-1,p;c>=0;c--)(p=e[c])&&(o=(n?p(t,r,o):p(o))||o);return n&&o&&v(t,r,o),o},_=(e,t,r)=>t.has(e)||y("Cannot "+r),z=(e,t,r)=>t.has(e)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),g=(e,t,r)=>(_(e,t,"access private method"),r),h,d;let i=class extends m{constructor(){super(...arguments),z(this,h),this.keyfigure=0,this.subtitle="",this.supportingText="",this.cardHref="",this.icon="",this.size="standard",this.unit="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.sizing="stretch",this.spacing="",this.spacingTop="",this.spacingBottom="",this.__onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&this.cardHref&&(e.preventDefault(),window.location.href=this.cardHref)},this.__handleHrefNavigation=e=>{this.cardHref&&(e.target.closest("a")||(window.location.href=this.cardHref))}}formatNumber(e){if(typeof e=="number")return e.toLocaleString("sv-SE").replace(/\u00A0/g," ");const t=Number(e);return Number.isNaN(t)?String(e):t.toLocaleString("sv-SE").replace(/\u00A0/g," ")}async firstUpdated(){i.__iconLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),i.__iconLoaded=!0),i.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),i.__rippleLoaded=!0),this.__applyInnerSizing(),g(this,h,d).call(this)}render(){const e=!!this.cardHref,t=this.formatNumber(this.keyfigure),r=(this.unit||"").trim(),n=r?`${t} ${r}`:t;return l`
|
|
3
3
|
<div
|
|
4
4
|
class="scb-keyfigure-card ${e?"clickable":""} ${this.size}"
|
|
5
5
|
role=${e?"link":"group"}
|
|
@@ -15,7 +15,7 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n as a,i as u,x
|
|
|
15
15
|
${this.keyfigure!==void 0&&this.keyfigure!==null&&this.keyfigure!==""?l`
|
|
16
16
|
<div class="keyfigure">
|
|
17
17
|
<span class="value" aria-label="${n}">
|
|
18
|
-
${t}${
|
|
18
|
+
${t}${r?l`<span class="unit" aria-hidden="true">\u00A0${r}</span>`:""}
|
|
19
19
|
</span>
|
|
20
20
|
${e?l`<md-icon>arrow_forward</md-icon>`:""}
|
|
21
21
|
</div>
|
|
@@ -31,7 +31,7 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n as a,i as u,x
|
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<md-focus-ring></md-focus-ring>
|
|
34
|
-
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing()}};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=
|
|
34
|
+
`}__applyInnerSizing(){const e=this.renderRoot.querySelector(".scb-keyfigure-card");if(!e)return;this.width&&this.width.trim()!==""?(e.style.inlineSize="100%",e.style.maxInlineSize="100%"):(e.style.removeProperty("inline-size"),e.style.removeProperty("max-inline-size")),this.height&&this.height.trim()!==""||this.sizing==="stretch"?e.style.blockSize="100%":e.style.removeProperty("block-size"),this.maxHeight&&this.maxHeight.trim()!==""?e.style.maxBlockSize="100%":e.style.removeProperty("max-block-size")}updated(e){super.updated(e),e.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),e.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),e.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),e.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(e.has("width")||e.has("height")||e.has("maxHeight")||e.has("sizing"))&&this.__applyInnerSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&g(this,h,d).call(this)}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}};h=new WeakSet;d=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),r=this.mapSpacingToken(this.spacingBottom),n=t??e,o=r??e;n?this.style.setProperty("--scb-keyfigure-card-spacing-block-start",n):this.style.removeProperty("--scb-keyfigure-card-spacing-block-start"),o?this.style.setProperty("--scb-keyfigure-card-spacing-block-end",o):this.style.removeProperty("--scb-keyfigure-card-spacing-block-end")};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=f`
|
|
35
35
|
:host {
|
|
36
36
|
display: block;
|
|
37
37
|
box-sizing: border-box;
|
|
@@ -39,6 +39,8 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n as a,i as u,x
|
|
|
39
39
|
inline-size: 100%;
|
|
40
40
|
min-inline-size: 0;
|
|
41
41
|
padding: var(--scb-keyfigure-card-focus-ring-gap, 4px);
|
|
42
|
+
margin-block-start: var(--scb-keyfigure-card-spacing-block-start, 0);
|
|
43
|
+
margin-block-end: var(--scb-keyfigure-card-spacing-block-end, 0);
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/* Ska vi ha tabulära eller inte? */
|
|
@@ -147,4 +149,4 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n as a,i as u,x
|
|
|
147
149
|
line-height: var(--md-sys-typescale-display-medium-line-height);
|
|
148
150
|
letter-spacing: var(--md-sys-typescale-display-medium-tracking);
|
|
149
151
|
}
|
|
150
|
-
`;
|
|
152
|
+
`;s([a({attribute:"keyfigure"})],i.prototype,"keyfigure",2);s([a({type:String,attribute:"subtitle"})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);s([a({type:String,attribute:"card-href"})],i.prototype,"cardHref",2);s([a({type:String})],i.prototype,"icon",2);s([a({type:String})],i.prototype,"size",2);s([a({type:String})],i.prototype,"unit",2);s([a({type:String,reflect:!0})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0})],i.prototype,"sizing",2);s([a({type:String,reflect:!0})],i.prototype,"spacing",2);s([a({type:String,reflect:!0,attribute:"spacing-top"})],i.prototype,"spacingTop",2);s([a({type:String,reflect:!0,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);i=s([b("scb-keyfigure-card")],i);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_
|
|
2
|
+
import{_}from"../../vendor/preload-helper.js";import{a as m,n as c,e as f,i as g,x as v,t as b}from"../../vendor/vendor.js";import"./scb-list-item.js";import"../../vendor/vendor-material.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(s,r,i){try{customElements.get(s)||t(s,r,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var y=Object.defineProperty,k=Object.getOwnPropertyDescriptor,d=e=>{throw TypeError(e)},p=(e,t,s,r)=>{for(var i=r>1?void 0:r?k(t,s):t,n=e.length-1,a;n>=0;n--)(a=e[n])&&(i=(r?a(t,s,i):a(i))||i);return r&&i&&y(t,s,i),i},h=(e,t,s)=>t.has(e)||d("Cannot "+s),S=(e,t,s)=>(h(e,t,"read from private field"),t.get(e)),w=(e,t,s)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,r)=>(h(e,t,"write to private field"),t.set(e,s),s),l;let o=class extends g{constructor(){super(...arguments),w(this,l,!1),this.noDivider=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this._onSlotChange=()=>this._setupItems()}async firstUpdated(){S(this,l)||(await _(()=>import("../../vendor/vendor-material.js").then(e=>e.l),__vite__mapDeps([0,1]),import.meta.url),E(this,l,!0)),this._setupItems(),this._applySpacing()}updated(e){super.updated(e),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing()}_getItems(){return(this._slotEl?.assignedElements({flatten:!0})??[]).filter(t=>t instanceof HTMLElement)}_setupItems(){this._getItems().forEach((s,r)=>{s.hasAttribute("role")||s.setAttribute("role","listitem"),s.setAttribute("tabindex",r===0?"0":"-1")});const t=this.renderRoot?.querySelector("md-list");t&&!t.hasAttribute("data-kbd")&&(t.setAttribute("data-kbd","true"),t.addEventListener("keydown",s=>this._onKeyDown(s)))}_onKeyDown(e){const t=this._getItems();if(!t.length)return;const s=t.findIndex(i=>i.getAttribute("tabindex")==="0"),r=i=>{const n=(i%t.length+t.length)%t.length;t.forEach(u=>u.setAttribute("tabindex","-1"));const a=t[n];a.setAttribute("tabindex","0"),a.focus()};switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),r(s<0?0:s+1);break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),r(s<0?0:s-1);break;case"Home":e.preventDefault(),r(0);break;case"End":e.preventDefault(),r(t.length-1);break}}_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}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,s=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),s?this.style.marginBlockEnd=s:this.style.removeProperty("margin-block-end")}render(){return v`
|
|
3
3
|
<md-list role="list" @slotchange=${this._onSlotChange}>
|
|
4
4
|
<slot></slot>
|
|
5
5
|
</md-list>
|
|
6
|
-
`}};
|
|
6
|
+
`}};l=new WeakMap;o.styles=[m`
|
|
7
7
|
:host {
|
|
8
8
|
display: block;
|
|
9
9
|
--scb-list-bg: transparent;
|
|
@@ -23,4 +23,4 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as p,n as h,e as v,i
|
|
|
23
23
|
:host([no-divider]) ::slotted(scb-list-item) {
|
|
24
24
|
--stroke-border: 0px;
|
|
25
25
|
}
|
|
26
|
-
`];
|
|
26
|
+
`];p([c({type:Boolean,attribute:"no-divider",reflect:!0})],o.prototype,"noDivider",2);p([c({type:String,reflect:!0})],o.prototype,"spacing",2);p([c({type:String,reflect:!0,attribute:"spacing-top"})],o.prototype,"spacingTop",2);p([c({type:String,reflect:!0,attribute:"spacing-bottom"})],o.prototype,"spacingBottom",2);p([f("slot")],o.prototype,"_slotEl",2);o=p([b("scb-list")],o);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p,n as o,i as d,x as a,t as f}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/preload-helper.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(r,l,s){try{customElements.get(r)||n(r,l,s)}catch(h){var c=String(h||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var g=Object.defineProperty,m=Object.getOwnPropertyDescriptor,e=(t,n,r,l)=>{for(var s=l>1?void 0:l?m(n,r):n,c=t.length-1,h;c>=0;c--)(h=t[c])&&(s=(l?h(n,r,s):h(s))||s);return l&&s&&g(n,r,s),s};let i=class extends d{constructor(){super(...arguments),this.variant="success",this.direction="horizontal",this.title="",this.subtitle="",this.supportingText="",this.open=!1,this.linkText="",this.linkHref="#",this.showIcon=!1,this.showCloseButton=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.fullHeight=!1,this.fullWidth=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this._closeNotification=()=>{this.open=!1;const t=new CustomEvent("close",{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t)}}_iconForVariant(){switch(this.variant){case"success":return"check_circle";case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}__resolveSpacingToken(t){const n=(t??"").trim();return n?/^(?:[0-9]|1[0-4])$/.test(n)?`var(--spacing-${n})`:n:""}__applySpacing(){const t=this.__resolveSpacingToken(this.spacingTop||this.spacing),n=this.__resolveSpacingToken(this.spacingBottom||this.spacing);t?this.style.marginBlockStart=t:this.style.removeProperty("margin-block-start"),n?this.style.marginBlockEnd=n:this.style.removeProperty("margin-block-end")}updated(t){super.updated(t),t.has("width")&&(this.width&&this.width.trim()!==""?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth&&this.maxWidth.trim()!==""?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height&&this.height.trim()!==""?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight&&this.maxHeight.trim()!==""?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&this.__applySpacing()}render(){const t=this.direction==="vertical"?"vertical":"horizontal",n=this.variant==="success"?"--_icon-color: var(--md-sys-color-on-success-container);":this.variant==="error"?"--_icon-color: var(--md-sys-color-on-error-container);":this.variant==="warning"?"--_icon-color: var(--md-sys-color-on-warning-container);":"--_icon-color: var(--md-sys-color-on-info-container);";return a`
|
|
2
2
|
<div
|
|
3
3
|
class="notification"
|
|
4
4
|
type=${this.variant}
|
|
@@ -6,7 +6,7 @@ import{a as d,n as e,i as p,x as a,t as f}from"../../vendor/vendor.js";import"..
|
|
|
6
6
|
aria-live="assertive"
|
|
7
7
|
aria-atomic="true"
|
|
8
8
|
>
|
|
9
|
-
<div class="notification-main ${
|
|
9
|
+
<div class="notification-main ${t}">
|
|
10
10
|
${this.showIcon?a`
|
|
11
11
|
<div class="notification-leading-icon">
|
|
12
12
|
<md-icon aria-hidden="true">
|
|
@@ -36,7 +36,7 @@ import{a as d,n as e,i as p,x as a,t as f}from"../../vendor/vendor.js";import"..
|
|
|
36
36
|
<scb-icon-button
|
|
37
37
|
aria-label="Stäng meddelande"
|
|
38
38
|
icon="close"
|
|
39
|
-
style=${
|
|
39
|
+
style=${n}
|
|
40
40
|
@click=${this._closeNotification}
|
|
41
41
|
>
|
|
42
42
|
</scb-icon-button>
|
|
@@ -44,7 +44,7 @@ import{a as d,n as e,i as p,x as a,t as f}from"../../vendor/vendor.js";import"..
|
|
|
44
44
|
`:null}
|
|
45
45
|
</div>
|
|
46
46
|
<md-focus-ring></md-focus-ring>
|
|
47
|
-
`}};
|
|
47
|
+
`}};i.styles=[p`
|
|
48
48
|
:host {
|
|
49
49
|
display: block;
|
|
50
50
|
position: relative;
|
|
@@ -294,4 +294,4 @@ import{a as d,n as e,i as p,x as a,t as f}from"../../vendor/vendor.js";import"..
|
|
|
294
294
|
box-shadow: 0 0 0 2px var(--md-sys-color-primary, #1976d2);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
`];
|
|
297
|
+
`];e([o({type:String})],i.prototype,"variant",2);e([o({type:String,reflect:!0})],i.prototype,"direction",2);e([o({type:String})],i.prototype,"title",2);e([o({type:String})],i.prototype,"subtitle",2);e([o({type:String,attribute:"supporting-text"})],i.prototype,"supportingText",2);e([o({type:Boolean,reflect:!0})],i.prototype,"open",2);e([o({type:String,attribute:"link-text"})],i.prototype,"linkText",2);e([o({type:String,attribute:"link-href"})],i.prototype,"linkHref",2);e([o({type:Boolean,attribute:"show-icon"})],i.prototype,"showIcon",2);e([o({type:Boolean,attribute:"show-close-button"})],i.prototype,"showCloseButton",2);e([o({type:String,reflect:!0})],i.prototype,"sizing",2);e([o({type:String,reflect:!0})],i.prototype,"width",2);e([o({type:String,reflect:!0,attribute:"max-width"})],i.prototype,"maxWidth",2);e([o({type:String,reflect:!0})],i.prototype,"height",2);e([o({type:String,reflect:!0,attribute:"max-height"})],i.prototype,"maxHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-height"})],i.prototype,"fullHeight",2);e([o({type:Boolean,reflect:!0,attribute:"full-width"})],i.prototype,"fullWidth",2);e([o({type:String})],i.prototype,"spacing",2);e([o({type:String,attribute:"spacing-top"})],i.prototype,"spacingTop",2);e([o({type:String,attribute:"spacing-bottom"})],i.prototype,"spacingBottom",2);i=e([f("scb-notification-card")],i);
|