scb-wc-test 0.1.160 → 0.1.162
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-item.js +3 -3
- package/mvc/components/scb-accordion/scb-accordion.js +9 -7
- package/mvc/components/scb-app-bar/scb-app-bar.js +11 -7
- package/mvc/components/scb-avatar/scb-avatar.js +7 -5
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +8 -6
- package/mvc/components/scb-button/scb-button.js +36 -34
- package/mvc/components/scb-calendar/scb-calendar.js +25 -21
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +5 -3
- package/mvc/components/scb-card/scb-card.js +10 -8
- package/mvc/components/scb-checkbox/scb-checkbox-group.js +6 -4
- package/mvc/components/scb-checkbox/scb-checkbox.js +13 -9
- package/mvc/components/scb-chip/scb-chip.js +6 -4
- package/mvc/components/scb-collapse/scb-collapse.js +15 -7
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +8 -3
- package/mvc/components/scb-dialog/scb-dialog.js +20 -15
- package/mvc/components/scb-drawer/scb-drawer-item.js +1 -1
- package/mvc/components/scb-drawer/scb-drawer-section.js +2 -2
- package/mvc/components/scb-drawer/scb-drawer.js +8 -62
- package/mvc/components/scb-drawer/scb-sub-drawer.js +3 -3
- package/mvc/components/scb-dropdown/scb-dropdown.js +17 -12
- package/mvc/components/scb-fact-card/scb-fact-card.js +7 -5
- package/mvc/components/scb-footer/scb-footer.js +14 -12
- package/mvc/components/scb-header/scb-header.js +21 -19
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +5 -3
- package/mvc/components/scb-icon-button/scb-icon-button.js +14 -12
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -4
- package/mvc/components/scb-link/scb-link.js +13 -9
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-menu/scb-menu-section.js +2 -2
- package/mvc/components/scb-menu/scb-menu.js +6 -91
- package/mvc/components/scb-menu/scb-sub-menu.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +7 -3
- package/mvc/components/scb-notification-card/scb-notification-card.js +11 -25
- package/mvc/components/scb-pagination/scb-pagination.js +23 -18
- package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +18 -8
- package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +8 -3
- package/mvc/components/scb-radio-button/scb-radio-button.js +0 -1
- package/mvc/components/scb-radio-button/scb-radio-group.js +5 -3
- package/mvc/components/scb-search/scb-search.js +11 -6
- package/mvc/components/scb-segmented-button/scb-segmented-button.js +4 -2
- package/mvc/components/scb-select/scb-select.js +10 -6
- package/mvc/components/scb-skeleton/scb-skeleton.js +8 -3
- package/mvc/components/scb-snackbar/scb-snackbar.js +15 -10
- package/mvc/components/scb-status-pill/scb-status-pill.js +9 -4
- package/mvc/components/scb-stepper/scb-stepper.js +5 -3
- package/mvc/components/scb-switch/scb-switch.js +6 -4
- package/mvc/components/scb-tabs/scb-tabs.js +4 -2
- package/mvc/components/scb-textfield/scb-textfield.js +15 -13
- package/mvc/components/scb-toc/scb-toc-item.js +3 -6
- package/mvc/components/scb-toc/scb-toc.js +6 -3
- package/mvc/components/scb-viz/scb-viz.js +6 -4
- package/package.json +2 -10
- package/scb-accordion/scb-accordion-item.js +6 -6
- package/scb-accordion/scb-accordion.d.ts +2 -0
- package/scb-accordion/scb-accordion.js +44 -36
- package/scb-app-bar/scb-app-bar.d.ts +8 -0
- package/scb-app-bar/scb-app-bar.js +61 -25
- package/scb-avatar/scb-avatar.d.ts +2 -0
- package/scb-avatar/scb-avatar.js +30 -22
- package/scb-breadcrumb/scb-breadcrumb.d.ts +2 -0
- package/scb-breadcrumb/scb-breadcrumb.js +60 -52
- package/scb-button/scb-button.d.ts +2 -0
- package/scb-button/scb-button.js +45 -37
- package/scb-calendar/scb-calendar.d.ts +7 -0
- package/scb-calendar/scb-calendar.js +206 -174
- package/scb-calendar-card/scb-calendar-card.d.ts +2 -0
- package/scb-calendar-card/scb-calendar-card.js +63 -55
- package/scb-card/scb-card.d.ts +2 -0
- package/scb-card/scb-card.js +41 -33
- package/scb-checkbox/scb-checkbox-group.d.ts +2 -0
- package/scb-checkbox/scb-checkbox-group.js +46 -38
- package/scb-checkbox/scb-checkbox.d.ts +6 -0
- package/scb-checkbox/scb-checkbox.js +107 -75
- package/scb-chip/scb-chip.d.ts +6 -1
- package/scb-chip/scb-chip.js +24 -16
- package/scb-collapse/scb-collapse.d.ts +7 -0
- package/scb-collapse/scb-collapse.js +83 -47
- package/scb-cookies-consent/scb-cookies-consent.d.ts +10 -2
- package/scb-cookies-consent/scb-cookies-consent.js +55 -22
- package/scb-dialog/scb-dialog.d.ts +7 -0
- package/scb-dialog/scb-dialog.js +67 -36
- package/scb-drawer/scb-drawer.d.ts +0 -7
- package/scb-drawer/scb-drawer.js +65 -155
- package/scb-drawer/scb-sub-drawer.js +4 -4
- package/scb-dropdown/scb-dropdown.d.ts +7 -2
- package/scb-dropdown/scb-dropdown.js +155 -143
- package/scb-fact-card/scb-fact-card.d.ts +2 -0
- package/scb-fact-card/scb-fact-card.js +50 -42
- package/scb-footer/scb-footer.d.ts +3 -0
- package/scb-footer/scb-footer.js +92 -71
- package/scb-header/scb-header.d.ts +5 -0
- package/scb-header/scb-header.js +38 -17
- package/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +2 -0
- package/scb-horizontal-scroller/scb-horizontal-scroller.js +71 -63
- package/scb-icon-button/scb-icon-button.d.ts +4 -0
- package/scb-icon-button/scb-icon-button.js +54 -46
- package/scb-keyfigure-card/scb-keyfigure-card.d.ts +2 -0
- package/scb-keyfigure-card/scb-keyfigure-card.js +49 -41
- package/scb-link/scb-link.d.ts +8 -0
- package/scb-link/scb-link.js +81 -45
- package/scb-list/scb-list.d.ts +2 -0
- package/scb-list/scb-list.js +54 -48
- package/scb-menu/scb-menu.d.ts +0 -31
- package/scb-menu/scb-menu.js +27 -278
- package/scb-nav/scb-nav.d.ts +10 -0
- package/scb-nav/scb-nav.js +86 -57
- package/scb-notification-card/scb-notification-card.d.ts +2 -0
- package/scb-notification-card/scb-notification-card.js +28 -36
- package/scb-pagination/scb-pagination.d.ts +4 -1
- package/scb-pagination/scb-pagination.js +85 -69
- package/scb-progress-indicator/scb-progress-indicator.d.ts +11 -1
- package/scb-progress-indicator/scb-progress-indicator.js +76 -32
- package/scb-progress-stepper/scb-progress-stepper.d.ts +7 -0
- package/scb-progress-stepper/scb-progress-stepper.js +64 -33
- package/scb-radio-button/scb-radio-button.js +11 -12
- package/scb-radio-button/scb-radio-group.d.ts +2 -0
- package/scb-radio-button/scb-radio-group.js +59 -41
- package/scb-search/scb-search.d.ts +7 -0
- package/scb-search/scb-search.js +64 -33
- package/scb-segmented-button/scb-segmented-button.d.ts +4 -0
- package/scb-segmented-button/scb-segmented-button.js +53 -45
- package/scb-select/scb-select.d.ts +8 -1
- package/scb-select/scb-select.js +96 -67
- package/scb-skeleton/scb-skeleton.d.ts +10 -1
- package/scb-skeleton/scb-skeleton.js +58 -22
- package/scb-snackbar/scb-snackbar.d.ts +8 -0
- package/scb-snackbar/scb-snackbar.js +69 -36
- package/scb-status-pill/scb-status-pill.d.ts +5 -2
- package/scb-status-pill/scb-status-pill.js +47 -31
- package/scb-stepper/scb-stepper.d.ts +2 -0
- package/scb-stepper/scb-stepper.js +33 -25
- package/scb-switch/scb-switch.d.ts +4 -0
- package/scb-switch/scb-switch.js +25 -17
- package/scb-tabs/scb-tabs.d.ts +4 -0
- package/scb-tabs/scb-tabs.js +40 -32
- package/scb-textfield/scb-textfield.d.ts +4 -0
- package/scb-textfield/scb-textfield.js +43 -35
- package/scb-toc/scb-toc-item.js +6 -9
- package/scb-toc/scb-toc.d.ts +4 -0
- package/scb-toc/scb-toc.js +38 -29
- package/scb-viz/scb-viz.d.ts +4 -0
- package/scb-viz/scb-viz.js +60 -52
- package/scb-wc-test.bundle.js +658 -681
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g,n as s,i as v,E as p,x as l,t as u}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(o,a,n){try{customElements.get(o)||e(o,a,n)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var h=Object.defineProperty,
|
|
1
|
+
import{a as g,n as s,i as v,E as p,x as l,t as u}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(o,a,n){try{customElements.get(o)||e(o,a,n)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var h=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(t,e,o,a)=>{for(var n=a>1?void 0:a?b(e,o):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(n=(a?d(e,o,n):d(n))||n);return a&&n&&h(e,o,n),n};let i=class extends v{constructor(){super(...arguments),this.open=!1,this.title="",this.content="",this.overline="",this.supportingText="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.imgHrefImage="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.density=0,this._unique=i._uid(),this._onToggle=t=>{const e=t.currentTarget;this.open=!!e.open;const o=this.closest("scb-accordion");this.open&&o&&!o.hasAttribute("detached")&&o.querySelectorAll("scb-accordion-item").forEach(n=>{n!==this&&n.setOpen(!1)}),this._applyInertByOpen()}}static _uid(){return globalThis.crypto?.randomUUID?.()??`${i._uidPrefix}-${++i._uidSeq}`}firstUpdated(){this._applyInertByOpen()}_applyInertByOpen(){const t=this.renderRoot.querySelector(".scb-accordion-bottom"),e=this.renderRoot.querySelector("details");!t||!e||(e.open?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false")):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true")))}_onKeyDown(t){const e=this.closest("scb-accordion"),a=Array.from(e?.querySelectorAll("scb-accordion-item")||[]).map(d=>d.renderRoot.querySelector("details")?.querySelector(".scb-accordion-top")||null).filter(d=>!!d),n=t.currentTarget,c=a.indexOf(n);switch(t.key){case"ArrowDown":t.preventDefault(),c<a.length-1&&a[c+1].focus();break;case"ArrowUp":t.preventDefault(),c>0&&a[c-1].focus();break;case"Home":t.preventDefault(),a.length&&a[0].focus();break;case"End":t.preventDefault(),a.length&&a[a.length-1].focus();break}}setOpen(t){this.open=!!t;const e=this.renderRoot.querySelector("details");e&&(e.open=this.open),this._applyInertByOpen()}updated(t){if(t.has("open")){const e=this.renderRoot.querySelector("details");e&&e.open!==this.open&&(e.open=this.open),this._applyInertByOpen(),this.dispatchEvent(new CustomEvent("open-changed",{detail:{open:this.open,title:this.title},bubbles:!0,composed:!0}))}}render(){const t=`bottom-${this._unique}`,e=`header-${this._unique}`,o=this.leading?this.leadingVariant==="image"&&this.imgHrefImage?l`<img part="leading-image" class="img" src="${this.imgHrefImage}" alt="" />`:this.leadingVariant==="avatar"?l`
|
|
2
2
|
<scb-avatar
|
|
3
3
|
label=${this.avatarLabel}
|
|
4
4
|
alt=${this.avatarAlt}
|
|
@@ -42,7 +42,7 @@ import{a as g,n as s,i as v,E as p,x as l,t as u}from"../../vendor/vendor.js";im
|
|
|
42
42
|
position: relative;
|
|
43
43
|
--scb-accordion-hover-radius: var(--radius-none, 0px);
|
|
44
44
|
--scb-accordion-chevron-nudge-y: 3px;
|
|
45
|
-
--scb-accordion-transition-duration: var(--motion-duration-
|
|
45
|
+
--scb-accordion-transition-duration: var(--motion-duration-short, 150ms);
|
|
46
46
|
--scb-accordion-transition-easing: var(--motion-easing-emphasized-accelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)));
|
|
47
47
|
--scb-accordion-panel-padding-closed: var(--spacing-0, 0px);
|
|
48
48
|
}
|
|
@@ -188,7 +188,7 @@ import{a as g,n as s,i as v,E as p,x as l,t as u}from"../../vendor/vendor.js";im
|
|
|
188
188
|
.chevron {
|
|
189
189
|
margin-left: auto;
|
|
190
190
|
padding-top: var(--scb-accordion-chevron-nudge-y, 3px);
|
|
191
|
-
transition: transform var(--motion-duration-
|
|
191
|
+
transition: transform var(--motion-duration-short, var(--scb-accordion-transition-duration)) var(--motion-easing-standard, var(--scb-accordion-transition-easing));
|
|
192
192
|
}
|
|
193
193
|
details[open] .chevron { transform: rotate(180deg); }
|
|
194
194
|
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import{a as v,n as
|
|
1
|
+
import{a as v,n as l,i as _,E as S,x as f,t as k}from"../../vendor/vendor.js";import"./scb-accordion-item.js";import"../scb-button/scb-button.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(s,a,i){try{customElements.get(s)||e(s,a,i)}catch(h){var p=String(h||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var C=Object.defineProperty,w=Object.getOwnPropertyDescriptor,u=t=>{throw TypeError(t)},o=(t,e,s,a)=>{for(var i=a>1?void 0:a?w(e,s):e,p=t.length-1,h;p>=0;p--)(h=t[p])&&(i=(a?h(e,s,i):h(i))||i);return a&&i&&C(e,s,i),i},A=(t,e,s)=>e.has(t)||u("Cannot "+s),T=(t,e,s)=>e.has(t)?u("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),r=(t,e,s)=>(A(t,e,"access private method"),s),c,b,y,d,m,g;let n=class extends _{constructor(){super(...arguments),T(this,c),this.detached=!1,this.showCloseAll=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight=""}connectedCallback(){super.connectedCallback(),this.addEventListener("open-changed",r(this,c,d))}disconnectedCallback(){this.removeEventListener("open-changed",r(this,c,d)),super.disconnectedCallback()}render(){const t=this.detached&&this.showCloseAll,e=t?r(this,c,b).call(this):!1;return f`
|
|
2
2
|
<div class="scb-accordion" ?detached=${this.detached}>
|
|
3
|
-
${t?
|
|
3
|
+
${t?f`
|
|
4
4
|
<div class="scb-accordion-actions" role="toolbar" aria-label="Accordionkontroller">
|
|
5
5
|
<scb-button
|
|
6
6
|
variant="text"
|
|
7
7
|
label=${e?"Stäng alla":"Öppna alla"}
|
|
8
|
-
@click=${
|
|
8
|
+
@click=${r(this,c,y)}
|
|
9
9
|
></scb-button>
|
|
10
10
|
</div>
|
|
11
|
-
`:
|
|
11
|
+
`:S}
|
|
12
12
|
|
|
13
|
-
<slot @slotchange=${
|
|
13
|
+
<slot @slotchange=${r(this,c,m)}></slot>
|
|
14
14
|
</div>
|
|
15
|
-
`}firstUpdated(){
|
|
15
|
+
`}firstUpdated(){r(this,c,g).call(this)}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&r(this,c,g).call(this),(t.has("detached")||t.has("showCloseAll"))&&this.requestUpdate()}_getDirectItems(){return Array.from(this.children).filter(t=>t.tagName==="SCB-ACCORDION-ITEM")}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}};c=new WeakSet;b=function(){const t=this._getDirectItems();return t.length>0&&t.every(e=>e.open)};y=function(){if(!this.detached||!this.showCloseAll)return;const t=this._getDirectItems(),e=t.length>0&&t.every(s=>s.open);t.forEach(s=>s.setOpen(!e))};d=function(){!this.detached||!this.showCloseAll||this.requestUpdate()};m=function(){!this.detached||!this.showCloseAll||this.requestUpdate()};g=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-accordion-spacing-block-start",e):this.style.removeProperty("--scb-accordion-spacing-block-start"),s?this.style.setProperty("--scb-accordion-spacing-block-end",s):this.style.removeProperty("--scb-accordion-spacing-block-end"),a?this.style.setProperty("--scb-accordion-spacing-inline-start",a):this.style.removeProperty("--scb-accordion-spacing-inline-start"),i?this.style.setProperty("--scb-accordion-spacing-inline-end",i):this.style.removeProperty("--scb-accordion-spacing-inline-end")};n.styles=v`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
margin-block-start: var(--scb-accordion-spacing-block-start, 0);
|
|
19
19
|
margin-block-end: var(--scb-accordion-spacing-block-end, 0);
|
|
20
|
+
margin-inline-start: var(--scb-accordion-spacing-inline-start, 0);
|
|
21
|
+
margin-inline-end: var(--scb-accordion-spacing-inline-end, 0);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.scb-accordion-actions {
|
|
@@ -26,4 +28,4 @@ import{a as v,n as d,i as y,E as C,x as g,t as k}from"../../vendor/vendor.js";im
|
|
|
26
28
|
padding-block-start: var(--spacing-2, 4px);
|
|
27
29
|
padding-block-end: var(--spacing-2, 4px);
|
|
28
30
|
}
|
|
29
|
-
`;
|
|
31
|
+
`;o([l({type:Boolean,reflect:!0})],n.prototype,"detached",2);o([l({type:Boolean,attribute:"show-close-all",reflect:!0})],n.prototype,"showCloseAll",2);o([l({type:String,reflect:!0})],n.prototype,"spacing",2);o([l({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",2);o([l({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",2);o([l({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",2);o([l({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",2);n=o([k("scb-accordion")],n);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as b,n as o,i as f,x as c,t as v}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.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,a,s){try{customElements.get(i)||e(i,a,s)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var u=Object.defineProperty,y=Object.getOwnPropertyDescriptor,m=t=>{throw TypeError(t)},r=(t,e,i,a)=>{for(var s=a>1?void 0:a?y(e,i):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(s=(a?p(e,i,s):p(s))||s);return a&&s&&u(e,i,s),s},x=(t,e,i)=>e.has(t)||m("Cannot "+i),S=(t,e,i)=>e.has(t)?m("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),g=(t,e,i)=>(x(t,e,"access private method"),i),h,d;let n=class extends f{constructor(){super(...arguments),S(this,h),this.title="",this.type="default",this.position="default",this.searchSupportingText="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight=""}handleAvatarSlotChange(t){t.target.assignedElements({flatten:!0}).forEach(a=>{a.tagName==="SCB-AVATAR"&&a.setAttribute("size","small")})}firstUpdated(){g(this,h,d).call(this)}updated(t){t.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),t.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),t.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),t.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0})),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&g(this,h,d).call(this)}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}render(){switch(this.type){case"small-flexible":return c`
|
|
2
2
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<slot name="leading"></slot>
|
|
@@ -9,7 +9,7 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
9
9
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
10
10
|
</div>
|
|
11
11
|
</header>
|
|
12
|
-
`;case"medium-flexible":return
|
|
12
|
+
`;case"medium-flexible":return c`
|
|
13
13
|
<header class="medium-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Medium flexible app bar">
|
|
14
14
|
<div class="action-elements">
|
|
15
15
|
<div>
|
|
@@ -22,7 +22,7 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
22
22
|
</div>
|
|
23
23
|
<h1 class="headline">${this.title}</h1>
|
|
24
24
|
</header>
|
|
25
|
-
`;case"large-flexible":return
|
|
25
|
+
`;case"large-flexible":return c`
|
|
26
26
|
<header class="large-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Large flexible app bar">
|
|
27
27
|
<div class="action-elements">
|
|
28
28
|
<div style="">
|
|
@@ -35,7 +35,7 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
35
35
|
</div>
|
|
36
36
|
<h1 class="headline">${this.title}</h1>
|
|
37
37
|
</header>
|
|
38
|
-
`;case"search":return
|
|
38
|
+
`;case"search":return c`
|
|
39
39
|
<header class="search ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Search app bar">
|
|
40
40
|
<div class="leading">
|
|
41
41
|
<slot name="leading"></slot>
|
|
@@ -48,7 +48,7 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
48
48
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
49
49
|
</div>
|
|
50
50
|
</header>
|
|
51
|
-
`;default:return
|
|
51
|
+
`;default:return c`
|
|
52
52
|
<header class="default ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
53
53
|
<div class="leading">
|
|
54
54
|
<slot name="leading"></slot>
|
|
@@ -59,7 +59,7 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
59
59
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
60
60
|
</div>
|
|
61
61
|
</header>
|
|
62
|
-
`}}};
|
|
62
|
+
`}}};h=new WeakSet;d=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-app-bar-spacing-block-start",e):this.style.removeProperty("--scb-app-bar-spacing-block-start"),i?this.style.setProperty("--scb-app-bar-spacing-block-end",i):this.style.removeProperty("--scb-app-bar-spacing-block-end"),a?this.style.setProperty("--scb-app-bar-spacing-inline-start",a):this.style.removeProperty("--scb-app-bar-spacing-inline-start"),s?this.style.setProperty("--scb-app-bar-spacing-inline-end",s):this.style.removeProperty("--scb-app-bar-spacing-inline-end")};n.styles=[b`
|
|
63
63
|
:host {
|
|
64
64
|
display: block;
|
|
65
65
|
font-family: var(--brand, Inter);
|
|
@@ -67,6 +67,10 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
67
67
|
container-type: inline-size;
|
|
68
68
|
container-name: app-bar-container;
|
|
69
69
|
--app-search-height: 64px;
|
|
70
|
+
margin-block-start: var(--scb-app-bar-spacing-block-start, 0);
|
|
71
|
+
margin-block-end: var(--scb-app-bar-spacing-block-end, 0);
|
|
72
|
+
margin-inline-start: var(--scb-app-bar-spacing-inline-start, 0);
|
|
73
|
+
margin-inline-end: var(--scb-app-bar-spacing-inline-end, 0);
|
|
70
74
|
}
|
|
71
75
|
header {
|
|
72
76
|
background: var(--md-sys-color-surface-container);
|
|
@@ -156,4 +160,4 @@ import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"..
|
|
|
156
160
|
display: flex;
|
|
157
161
|
align-items: center;
|
|
158
162
|
}
|
|
159
|
-
`];
|
|
163
|
+
`];r([o({type:String,reflect:!0})],n.prototype,"title",2);r([o({type:String,reflect:!0})],n.prototype,"type",2);r([o({type:String,reflect:!0})],n.prototype,"position",2);r([o({type:String,attribute:"search-supporting-text",reflect:!0})],n.prototype,"searchSupportingText",2);r([o({type:String,reflect:!0})],n.prototype,"spacing",2);r([o({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",2);r([o({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",2);r([o({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",2);r([o({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",2);n=r([v("scb-app-bar")],n);
|
|
@@ -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{_ as
|
|
2
|
+
import{_ as m}from"../../vendor/preload-helper.js";import{a as f,n,r as _,i as b,E as h,x as c,t as y}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,r,o){try{customElements.get(e)||i(e,r,o)}catch(p){var l=String(p||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var z=Object.defineProperty,S=Object.getOwnPropertyDescriptor,u=t=>{throw TypeError(t)},s=(t,i,e,r)=>{for(var o=r>1?void 0:r?S(i,e):i,l=t.length-1,p;l>=0;l--)(p=t[l])&&(o=(r?p(i,e,o):p(o))||o);return r&&o&&z(i,e,o),o},k=(t,i,e)=>i.has(t)||u("Cannot "+e),x=(t,i,e)=>i.has(t)?u("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),v=(t,i,e)=>(k(t,i,"access private method"),e),g,d;let a=class extends b{constructor(){super(...arguments),x(this,g),this.src="",this.alt="",this.label="",this.size="medium",this.shape="circular",this.iconName="",this.variant="image",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this._imgError=!1,this._hasIconSlot=!1,this._onImgLoad=()=>{this._imgError=!1,this.dispatchEvent(new CustomEvent("image-load",{bubbles:!0,composed:!0}))},this._onImgError=()=>{this._imgError=!0,this.dispatchEvent(new CustomEvent("image-error",{bubbles:!0,composed:!0}))},this._onIconSlotChange=t=>{const i=t.currentTarget;this._hasIconSlot=(i.assignedNodes({flatten:!0})||[]).length>0}}async firstUpdated(){this.variant==="icon"&&await m(()=>import("../../vendor/vendor-material.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),v(this,g,d).call(this)}updated(t){super.updated(t),t.has("variant")&&this.variant==="icon"&&m(()=>import("../../vendor/vendor-material.js").then(i=>i.i),__vite__mapDeps([0,1]),import.meta.url),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&v(this,g,d).call(this)}_initials(){const t=(this.label||this.alt||"").trim();if(!t)return"?";const i=t.split(/\s+/).filter(Boolean);if(i.length===1)return i[0].slice(0,1).toUpperCase();const e=i[0].slice(0,1),r=i[i.length-1].slice(0,1);return(e+r).toUpperCase()}_ariaLabel(){const t=(this.label||this.alt||"").trim();return t||null}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}render(){const t=this._ariaLabel(),i=this.variant==="image"&&!!this.src&&!this._imgError,e=c`${h}
|
|
3
3
|
<slot name="icon" @slotchange=${this._onIconSlotChange}></slot>
|
|
4
4
|
${this._hasIconSlot?h:this.iconName?c`<md-icon aria-hidden="true">${this.iconName}</md-icon>`:c`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
5
|
-
`,
|
|
5
|
+
`,r=i?c`<img
|
|
6
6
|
class="photo"
|
|
7
7
|
part="image"
|
|
8
8
|
src=${this.src}
|
|
@@ -14,14 +14,16 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as f,n as o,r as v,i
|
|
|
14
14
|
${this._hasIconSlot?h:this.iconName?c`<md-icon aria-hidden="true">${this.iconName}</md-icon>`:c`<div class="fallback" part="fallback">${this._initials()}</div>`}
|
|
15
15
|
`;return c`
|
|
16
16
|
<div class="container" part="container" role="img" aria-label=${t??h}>
|
|
17
|
-
${this.variant==="icon"?e:
|
|
17
|
+
${this.variant==="icon"?e:r}
|
|
18
18
|
</div>
|
|
19
|
-
`}};
|
|
19
|
+
`}};g=new WeakSet;d=function(){const t=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??t,e=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft)??t,o=this.mapSpacingToken(this.spacingRight)??t;i?this.style.setProperty("--scb-avatar-spacing-block-start",i):this.style.removeProperty("--scb-avatar-spacing-block-start"),e?this.style.setProperty("--scb-avatar-spacing-block-end",e):this.style.removeProperty("--scb-avatar-spacing-block-end"),r?this.style.setProperty("--scb-avatar-spacing-inline-start",r):this.style.removeProperty("--scb-avatar-spacing-inline-start"),o?this.style.setProperty("--scb-avatar-spacing-inline-end",o):this.style.removeProperty("--scb-avatar-spacing-inline-end")};a.styles=f`
|
|
20
20
|
:host {
|
|
21
21
|
display: inline-block;
|
|
22
22
|
vertical-align: middle;
|
|
23
23
|
margin-block-start: var(--scb-avatar-spacing-block-start, 0);
|
|
24
24
|
margin-block-end: var(--scb-avatar-spacing-block-end, 0);
|
|
25
|
+
margin-inline-start: var(--scb-avatar-spacing-inline-start, 0);
|
|
26
|
+
margin-inline-end: var(--scb-avatar-spacing-inline-end, 0);
|
|
25
27
|
|
|
26
28
|
--_size: 40px;
|
|
27
29
|
--_font-size: 16px;
|
|
@@ -105,4 +107,4 @@ import{_ as g}from"../../vendor/preload-helper.js";import{a as f,n as o,r as v,i
|
|
|
105
107
|
outline-offset: 2px;
|
|
106
108
|
border-radius: var(--_radius);
|
|
107
109
|
}
|
|
108
|
-
`;
|
|
110
|
+
`;s([n({type:String})],a.prototype,"src",2);s([n({type:String})],a.prototype,"alt",2);s([n({type:String})],a.prototype,"label",2);s([n({type:String,reflect:!0})],a.prototype,"size",2);s([n({type:String,reflect:!0})],a.prototype,"shape",2);s([n({type:String,attribute:"icon-name",reflect:!0})],a.prototype,"iconName",2);s([n({type:String,reflect:!0})],a.prototype,"variant",2);s([n({type:String,reflect:!0})],a.prototype,"spacing",2);s([n({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);s([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);s([n({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",2);s([n({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",2);s([_()],a.prototype,"_imgError",2);s([_()],a.prototype,"_hasIconSlot",2);a=s([y("scb-avatar")],a);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import{n as l,t as u,i as g,a as f,x as d}from"../../vendor/vendor.js";import"./scb-breadcrumb-item.js";import"../../vendor/vendor-material.js";import"../scb-link/scb-link.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,i,r){try{customElements.get(s)||t(s,i,r)}catch(o){var c=String(o||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,m=e=>{throw TypeError(e)},n=(e,t,s,i)=>{for(var r=i>1?void 0:i?v(t,s):t,c=e.length-1,o;c>=0;c--)(o=e[c])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&y(t,s,r),r},_=(e,t,s)=>t.has(e)||m("Cannot "+s),w=(e,t,s)=>t.has(e)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),h=(e,t,s)=>(_(e,t,"access private method"),s),p,b;let a=class extends g{constructor(){super(...arguments),w(this,p),this.showAll=!1,this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight=""}static get styles(){return f`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
margin-block-start: var(--scb-breadcrumb-spacing-block-start, 0);
|
|
5
5
|
margin-block-end: var(--scb-breadcrumb-spacing-block-end, 0);
|
|
6
|
+
margin-inline-start: var(--scb-breadcrumb-spacing-inline-start, 0);
|
|
7
|
+
margin-inline-end: var(--scb-breadcrumb-spacing-inline-end, 0);
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
.scb-breadcrumb {
|
|
@@ -72,9 +74,9 @@ import{n as p,t as u,i as f,a as g,x as d}from"../../vendor/vendor.js";import"./
|
|
|
72
74
|
transform: translateY(0);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
`}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>{this.requestUpdate()}),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}firstUpdated(){
|
|
76
|
-
<div class="scb-breadcrumb ${
|
|
77
|
-
${
|
|
77
|
+
`}connectedCallback(){super.connectedCallback(),this._observer=new MutationObserver(()=>{this.requestUpdate()}),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}firstUpdated(){h(this,p,b).call(this)}updated(e){e.has("showAll")&&this.dispatchEvent(new CustomEvent("show-all-changed",{detail:{showAll:this.showAll},bubbles:!0,composed:!0})),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&h(this,p,b).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}_onEllipsisClick(){this.showAll?this.showAll=!1:(this.showAll=!0,this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelectorAll(".scb-breadcrumb.expanded > scb-breadcrumb-item");e&&(e.forEach((t,s)=>{t.classList.add("breadcrumb-animate"),t.style.animationDelay=`${s*60}ms`}),setTimeout(()=>{e.forEach(t=>{t.classList.remove("breadcrumb-animate"),t.style.animationDelay=""})},600))}))}render(){let e=[];if(this.children.length||(e=Array.from(this.shadowRoot?this.shadowRoot.querySelectorAll("scb-breadcrumb-item"):[])),e.length||(e=Array.from(this.children).filter(s=>s.tagName.toLowerCase()==="scb-breadcrumb-item")),e.length>0){const s=e.length-1;e.forEach((i,r)=>{i.toggleAttribute("is-current",r===s)})}const t=e.length>6&&!this.showAll;return d`
|
|
78
|
+
<div class="scb-breadcrumb ${t?"collapsed":"expanded"}">
|
|
79
|
+
${t?e.map((s,i)=>i===3?d`<span
|
|
78
80
|
class="ellipsis"
|
|
79
81
|
aria-label="Visa alla"
|
|
80
82
|
role="button"
|
|
@@ -88,6 +90,6 @@ import{n as p,t as u,i as f,a as g,x as d}from"../../vendor/vendor.js";import"./
|
|
|
88
90
|
</md-icon>
|
|
89
91
|
</span>
|
|
90
92
|
<span class="breadcrumb-separator">/</span>
|
|
91
|
-
${
|
|
93
|
+
${s}`:d`${s}`):e.map(s=>s)}
|
|
92
94
|
</div>
|
|
93
|
-
`}};
|
|
95
|
+
`}};p=new WeakSet;b=function(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,s=this.mapSpacingToken(this.spacingBottom)??e,i=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-breadcrumb-spacing-block-start",t):this.style.removeProperty("--scb-breadcrumb-spacing-block-start"),s?this.style.setProperty("--scb-breadcrumb-spacing-block-end",s):this.style.removeProperty("--scb-breadcrumb-spacing-block-end"),i?this.style.setProperty("--scb-breadcrumb-spacing-inline-start",i):this.style.removeProperty("--scb-breadcrumb-spacing-inline-start"),r?this.style.setProperty("--scb-breadcrumb-spacing-inline-end",r):this.style.removeProperty("--scb-breadcrumb-spacing-inline-end")};n([l({type:Boolean,attribute:"show-all",reflect:!0})],a.prototype,"showAll",2);n([l({type:String,reflect:!0})],a.prototype,"spacing",2);n([l({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);n([l({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);n([l({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",2);n([l({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",2);a=n([u("scb-breadcrumb")],a);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import{n as
|
|
1
|
+
import{n as s,t as I,i as k,a as w,x as p,E as r}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,a,l){try{customElements.get(i)||e(i,a,l)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var T=Object.defineProperty,L=Object.getOwnPropertyDescriptor,A=t=>{throw TypeError(t)},n=(t,e,i,a)=>{for(var l=a>1?void 0:a?L(e,i):e,c=t.length-1,d;c>=0;c--)(d=t[c])&&(l=(a?d(e,i,l):d(l))||l);return a&&l&&T(e,i,l),l},B=(t,e,i)=>e.has(t)||A("Cannot "+i),O=(t,e,i)=>e.has(t)?A("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),$=(t,e,i)=>(B(t,e,"access private method"),i),m,v;let o=class extends k{constructor(){super(...arguments),O(this,m),this.variant="filled",this.type="button",this.label="Button",this.trailingIcon=!1,this.icon="",this.iconFilled=!1,this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight=""}__getMdHost(){return this.renderRoot.querySelector("md-filled-button, md-outlined-button, md-filled-tonal-button, md-text-button")}__getInnerNativeButton(t){return t?.shadowRoot?.querySelector("button")??null}__syncAriaToInner(){const t=this.__getMdHost(),e=this.__getInnerNativeButton(t);if(!t||!e)return;const i=(this.getAttribute("aria-label")||"").trim(),a=(t.getAttribute("aria-label")||"").trim(),l=this.label.trim()===""?(this.icon||"").trim():"",c=i||a||l;c?e.setAttribute("aria-label",c):e.removeAttribute("aria-label");const d=this.getAttribute("aria-controls");d!==null?e.setAttribute("aria-controls",d):e.removeAttribute("aria-controls");const y=this.getAttribute("aria-expanded");y!==null?e.setAttribute("aria-expanded",y):e.removeAttribute("aria-expanded"),t.removeAttribute("aria-label"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-expanded"),this.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(x=>{const b=this.__getMdHost(),h=this.__getInnerNativeButton(b);if(!(!b||!h)){for(const f of x){if(f.type!=="attributes"||!f.attributeName)continue;const u=f.attributeName,g=this.getAttribute(u);if(u==="aria-label"){const S=(b.getAttribute("aria-label")||"").trim(),_=(g||S||(this.label.trim()===""?(this.icon||"").trim():"")).trim();_?h.setAttribute("aria-label",_):h.removeAttribute("aria-label"),b.removeAttribute("aria-label")}else(u==="aria-controls"||u==="aria-expanded")&&(g===null?h.removeAttribute(u):h.setAttribute(u,g),u==="aria-expanded"&&this.removeAttribute("aria-expanded"))}b.removeAttribute("aria-label"),b.removeAttribute("aria-controls"),b.removeAttribute("aria-expanded")}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-expanded"]})}firstUpdated(){(this.type==="submit"||this.type==="reset")&&this.addEventListener("click",()=>{if(!this.disabled){const t=this.closest("form");t&&(this.type==="submit"&&t.requestSubmit(),this.type==="reset"&&t.reset())}}),this.__syncAriaToInner(),$(this,m,v).call(this)}updated(t){t.has("variant")&&this.__syncAriaToInner(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&$(this,m,v).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}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}static get styles(){return w`
|
|
2
2
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
3
3
|
:host {
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
block-size: var(--scb-button-block-size, auto);
|
|
6
6
|
margin-block-start: var(--scb-button-spacing-block-start, 0);
|
|
7
7
|
margin-block-end: var(--scb-button-spacing-block-end, 0);
|
|
8
|
+
margin-inline-start: var(--scb-button-spacing-inline-start, 0);
|
|
9
|
+
margin-inline-end: var(--scb-button-spacing-inline-end, 0);
|
|
8
10
|
--scb-button-font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
9
11
|
}
|
|
10
12
|
|
|
@@ -82,64 +84,64 @@ import{n as a,t as I,i as k,a as w,x as h,E as i}from"../../vendor/vendor.js";im
|
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
*/
|
|
85
|
-
`}render(){const t=!!this.icon?.trim(),e=t?
|
|
87
|
+
`}render(){const t=!!this.icon?.trim(),e=t?p`<md-icon slot="icon" part="icon" ?filled=${this.iconFilled} aria-hidden="true">${this.icon}</md-icon>`:r,i=r,a=this.label.trim()===""?this.icon:void 0;switch(this.variant){case"filled":return p`
|
|
86
88
|
<md-filled-button
|
|
87
89
|
type=${this.type}
|
|
88
|
-
variant=${
|
|
90
|
+
variant=${i}
|
|
89
91
|
?trailing-icon=${this.trailingIcon}
|
|
90
92
|
?disabled=${this.disabled}
|
|
91
|
-
aria-label=${
|
|
92
|
-
href=${this.href||
|
|
93
|
-
target=${this.target||
|
|
94
|
-
rel=${this.rel||
|
|
93
|
+
aria-label=${a}
|
|
94
|
+
href=${this.href||r}
|
|
95
|
+
target=${this.target||r}
|
|
96
|
+
rel=${this.rel||r}
|
|
95
97
|
>
|
|
96
|
-
${t&&!this.trailingIcon?e:
|
|
98
|
+
${t&&!this.trailingIcon?e:r}
|
|
97
99
|
${this.label}
|
|
98
|
-
${t&&this.trailingIcon?e:
|
|
100
|
+
${t&&this.trailingIcon?e:r}
|
|
99
101
|
</md-filled-button>
|
|
100
|
-
`;case"outlined":return
|
|
102
|
+
`;case"outlined":return p`
|
|
101
103
|
<md-outlined-button
|
|
102
104
|
type=${this.type}
|
|
103
|
-
variant=${
|
|
105
|
+
variant=${i}
|
|
104
106
|
?trailing-icon=${this.trailingIcon}
|
|
105
107
|
?disabled=${this.disabled}
|
|
106
|
-
aria-label=${
|
|
107
|
-
href=${this.href||
|
|
108
|
-
target=${this.target||
|
|
109
|
-
rel=${this.rel||
|
|
108
|
+
aria-label=${a}
|
|
109
|
+
href=${this.href||r}
|
|
110
|
+
target=${this.target||r}
|
|
111
|
+
rel=${this.rel||r}
|
|
110
112
|
>
|
|
111
|
-
${t&&!this.trailingIcon?e:
|
|
113
|
+
${t&&!this.trailingIcon?e:r}
|
|
112
114
|
${this.label}
|
|
113
|
-
${t&&this.trailingIcon?e:
|
|
115
|
+
${t&&this.trailingIcon?e:r}
|
|
114
116
|
</md-outlined-button>
|
|
115
|
-
`;case"filled-tonal":return
|
|
117
|
+
`;case"filled-tonal":return p`
|
|
116
118
|
<md-filled-tonal-button
|
|
117
119
|
type=${this.type}
|
|
118
|
-
variant=${
|
|
120
|
+
variant=${i}
|
|
119
121
|
?trailing-icon=${this.trailingIcon}
|
|
120
122
|
?disabled=${this.disabled}
|
|
121
|
-
aria-label=${
|
|
122
|
-
href=${this.href||
|
|
123
|
-
target=${this.target||
|
|
124
|
-
rel=${this.rel||
|
|
123
|
+
aria-label=${a}
|
|
124
|
+
href=${this.href||r}
|
|
125
|
+
target=${this.target||r}
|
|
126
|
+
rel=${this.rel||r}
|
|
125
127
|
>
|
|
126
|
-
${t&&!this.trailingIcon?e:
|
|
128
|
+
${t&&!this.trailingIcon?e:r}
|
|
127
129
|
${this.label}
|
|
128
|
-
${t&&this.trailingIcon?e:
|
|
130
|
+
${t&&this.trailingIcon?e:r}
|
|
129
131
|
</md-filled-tonal-button>
|
|
130
|
-
`;case"text":return
|
|
132
|
+
`;case"text":return p`
|
|
131
133
|
<md-text-button
|
|
132
134
|
type=${this.type}
|
|
133
|
-
variant=${
|
|
135
|
+
variant=${i}
|
|
134
136
|
?trailing-icon=${this.trailingIcon}
|
|
135
137
|
?disabled=${this.disabled}
|
|
136
|
-
aria-label=${
|
|
137
|
-
href=${this.href||
|
|
138
|
-
target=${this.target||
|
|
139
|
-
rel=${this.rel||
|
|
138
|
+
aria-label=${a}
|
|
139
|
+
href=${this.href||r}
|
|
140
|
+
target=${this.target||r}
|
|
141
|
+
rel=${this.rel||r}
|
|
140
142
|
>
|
|
141
|
-
${t&&!this.trailingIcon?e:
|
|
143
|
+
${t&&!this.trailingIcon?e:r}
|
|
142
144
|
${this.label}
|
|
143
|
-
${t&&this.trailingIcon?e:
|
|
145
|
+
${t&&this.trailingIcon?e:r}
|
|
144
146
|
</md-text-button>
|
|
145
|
-
`;default:return
|
|
147
|
+
`;default:return p``}}};m=new WeakSet;v=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),i?this.style.setProperty("--scb-button-spacing-block-end",i):this.style.removeProperty("--scb-button-spacing-block-end"),a?this.style.setProperty("--scb-button-spacing-inline-start",a):this.style.removeProperty("--scb-button-spacing-inline-start"),l?this.style.setProperty("--scb-button-spacing-inline-end",l):this.style.removeProperty("--scb-button-spacing-inline-end")};n([s({type:String,reflect:!0})],o.prototype,"variant",2);n([s({type:String,reflect:!0})],o.prototype,"type",2);n([s({type:String})],o.prototype,"label",2);n([s({type:Boolean,attribute:"trailing-icon"})],o.prototype,"trailingIcon",2);n([s({type:String})],o.prototype,"icon",2);n([s({type:Boolean,attribute:"icon-filled",reflect:!0})],o.prototype,"iconFilled",2);n([s({type:Boolean,reflect:!0})],o.prototype,"disabled",2);n([s({type:Boolean,attribute:"full-width",reflect:!0})],o.prototype,"fullWidth",2);n([s({type:String})],o.prototype,"href",2);n([s({type:String})],o.prototype,"target",2);n([s({type:String})],o.prototype,"rel",2);n([s({type:String,reflect:!0})],o.prototype,"spacing",2);n([s({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",2);n([s({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",2);n([s({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",2);n([s({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",2);o=n([I("scb-button")],o);
|
|
@@ -1,47 +1,51 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as W,n as w,i as j,x as D,t as R}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-radio-button/scb-radio-group.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../scb-list/scb-list-item.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,i,o){try{customElements.get(s)||e(s,i,o)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var J=Object.defineProperty,U=Object.getOwnPropertyDescriptor,q=t=>{throw TypeError(t)},_=(t,e,s,i)=>{for(var o=i>1?void 0:i?U(e,s):e,a=t.length-1,d;a>=0;a--)(d=t[a])&&(o=(i?d(e,s,o):d(o))||o);return i&&o&&J(e,s,o),o},B=(t,e,s)=>e.has(t)||q("Cannot "+s),I=(t,e,s)=>e.has(t)?q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),L=(t,e,s)=>(B(t,e,"access private method"),s),N,O;let b=class extends j{constructor(){super(...arguments),I(this,N),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.spacingLeft="",this.spacingRight="",this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),i=this.shadowRoot?.activeElement,o=i&&s.includes(i)?i:document.activeElement,a=s.indexOf(o);if(a===-1)return;let d=a;const p=this.disableWeekend?5:7;switch(t.key){case"ArrowRight":d=a+1<s.length?a+1:a;break;case"ArrowLeft":d=a-1>=0?a-1:a;break;case"ArrowDown":d=a+p<s.length?a+p:a;break;case"ArrowUp":d=a-p>=0?a-p:a;break;default:return}d!==a&&(t.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback(),L(this,N,O).call(this);const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}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}updated(t){if(super.updated?.(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&L(this,N,O).call(this),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const i=this._current.getFullYear(),o=this._current.getMonth()+1;(i!==e||o!==s)&&(this._current=new Date(e,s-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}})),this.requestUpdate())}}}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:t.date}})),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._restoreDayFocus,{once:!0}));const s=i=>{i.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",s,{once:!0})})}_closePopup(){const t=this.shadowRoot?.querySelector("scb-dialog");t&&t.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,i=e%4,o=e%7,a=(19*s+24)%30,d=(2*i+4*o+6*a+5)%7;let p=22+a+d,E=0;p==57&&(p-=7),p==56&&a==28&&d==6&&s>10&&(p-=7),p>31?(p-=31,E=4):E=3;const T=new Date(e,E-1,p);return this._easterDateCalculated["Ar"+t]=T,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,i=t.getDate(),o=t.getFullYear(),a=this._easterDay(o),d=this.lang==="en",p=[["Nyårsdagen","New Year's Day",s===1&&i===1],["Trettondedag jul","Epiphany",s===1&&i===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&o<2005],["Första maj","May Day",s===5&&i===1],["Nationaldagen","National Day",s===6&&i===6&&o>=2005],["Midsommarafton","Midsummer's Eve",s===6&&i>=19&&i<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&i>=20&&i<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&i===24],["Juldagen","Christmas Day",s===12&&i===25],["Annandag jul","Boxing Day",s===12&&i===26],["Alla helgons dag","All Saints' Day",s===10&&i>=31&&t.getDay()===6||s===11&&i<=6&&t.getDay()===6]];for(const E of p){const[T,A,$]=E;if($)return d?A:T}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),i=this._firstDayOfWeek(t,e),o=this._today,a=this.lang==="en",d=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let p=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(p=p.slice(0,5));const E=Array.from(this.querySelectorAll("scb-calendar-event")),T=new Map;for(const n of E){const l=n.getAttribute("start-date")||"",y=n.getAttribute("end-date")||"";if(l&&y){const c=new Date(l),g=new Date(y);for(let h=new Date(c);h<=g;h.setDate(h.getDate()+1)){const f=h.toISOString().split("T")[0],x=T.get(f)||[];x.push({title:n.title,description:n.description,start:l,end:y}),T.set(f,x)}}else if(l&&n.title){const c=l.split("T")[0],g=T.get(c)||[];g.push({title:n.title,description:n.description,start:l}),T.set(c,g)}}const A=[];let $=1;for(let n=0;n<6;n++){const l=[],y=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let c=$;for(let g=0;g<y.length;g++){const h=y[g];if(n===0&&h<i){if(!this.disableWeekend||h<5){const f=e===0?11:e-1,x=e===0?t-1:t,F=this._daysInMonth(x,f)-(i-h-1);l.push(D`
|
|
2
2
|
<div class="calendar-day calendar-day--other">
|
|
3
|
-
<span class="calendar-day-number">${
|
|
3
|
+
<span class="calendar-day-number">${F}</span>
|
|
4
4
|
</div>
|
|
5
|
-
`)}}else if(
|
|
5
|
+
`)}}else if(c>s)l.push(D`<div></div>`);else{let f=new Date(t,e,c);if(this.disableWeekend)for(;f.getDay()===0||f.getDay()===6;)c++,f=new Date(t,e,c);if(c>s){l.push(D`<div></div>`);continue}const x=o.getFullYear()===t&&o.getMonth()===e&&o.getDate()===c,v=`${t}-${String(e+1).padStart(2,"0")}-${String(c).padStart(2,"0")}`,F=new Date(t,e,c);let P=!1,k=null;this.publicHolidays&&(k=this._swedishHolidayName(F),P=!!k);let u=T.get(v)||[];u=[...u].sort((r,m)=>{const M=r.start&&v===r.start.split("T")[0]?r.start:r.end&&v===r.end.split("T")[0]?r.end:"",S=m.start&&v===m.start.split("T")[0]?m.start:m.end&&m.end.split("T")[0]?m.end:"",C=M&&M.includes("T"),Y=S&&S.includes("T");return C&&Y?M.localeCompare(S):C?-1:Y?1:r.title.localeCompare(m.title)});const H=[...u].map(r=>{let m="",M="";if(r.start&&r.end){const S=r.start.split("T")[0],C=r.end.split("T")[0];v===S&&v===C&&r.start.includes("T")&&r.end.includes("T")?m=r.start.split("T")[1].substring(0,5)+"–"+r.end.split("T")[1].substring(0,5):v===S&&r.start.includes("T")?m=r.start.split("T")[1].substring(0,5):v===C&&r.end.includes("T")?(m=r.end.split("T")[1].substring(0,5),M=a?"cont. ":"fort. "):v!==S&&(m="",M=a?"cont. ":"fort. ")}else r.start&&r.start.includes("T")&&(m=r.start.split("T")[1].substring(0,5));return{...r,time:m,prefix:M}});l.push(D`
|
|
6
6
|
<div
|
|
7
|
-
class="calendar-day${x?" today":""}${
|
|
8
|
-
tabindex=${
|
|
9
|
-
@click=${
|
|
10
|
-
@keydown=${
|
|
11
|
-
title=${
|
|
12
|
-
role=${
|
|
13
|
-
aria-label=${
|
|
7
|
+
class="calendar-day${x?" today":""}${u.length?" has-event":""}${P?" calendar-day--holiday":""}"
|
|
8
|
+
tabindex=${u.length?"0":void 0}
|
|
9
|
+
@click=${u.length?()=>this._showEventPopup({date:v,events:u}):null}
|
|
10
|
+
@keydown=${u.length?r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this._showEventPopup({date:v,events:u}))}:null}
|
|
11
|
+
title=${k||(u.length===1?u[0].title:u.length>1?u.map(r=>r.title).join(", "):"")}
|
|
12
|
+
role=${u.length?"button":void 0}
|
|
13
|
+
aria-label=${k||(u.length?u.length===1?u[0].title:u.map(r=>r.title).join(", "):void 0)}
|
|
14
14
|
>
|
|
15
15
|
<md-focus-ring inward></md-focus-ring>
|
|
16
|
-
<span class="calendar-day-number">${
|
|
16
|
+
<span class="calendar-day-number">${c} ${k?D`<span class="calendar-day-holiday-name">${k}</span>`:""}</span>
|
|
17
17
|
<div class="calendar-titles-wrapper">
|
|
18
|
-
${
|
|
18
|
+
${H.map(r=>D`<span class="calendar-day-event-title">${r.prefix||""}${r.title}</span>`)}
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
|
-
`),
|
|
21
|
+
`),c++}}if($=c,A.push(D`<div class="calendar-grid">${l}</div>`),$>s)break}return D`
|
|
22
22
|
<div class="calendar-header">
|
|
23
23
|
<scb-icon-button @click=${this._prevMonth} icon="chevron_left" aria-label="${a?"Previous month":"Föregående månad"}"></scb-icon-button>
|
|
24
|
-
<span>${
|
|
24
|
+
<span>${d[e]} ${t}</span>
|
|
25
25
|
<scb-icon-button @click=${this._nextMonth} icon="chevron_right" aria-label="${a?"Next month":"Nästa månad"}"></scb-icon-button>
|
|
26
26
|
</div>
|
|
27
27
|
<div class="calendar-grid calendar-grid-days">
|
|
28
|
-
${p.map(n=>
|
|
28
|
+
${p.map(n=>D`<div>${n}</div>`)}
|
|
29
29
|
</div>
|
|
30
30
|
<div class="calendar-weeks">
|
|
31
|
-
${
|
|
31
|
+
${A}
|
|
32
32
|
</div>
|
|
33
|
-
${this._popupEvent&&Array.isArray(this._popupEvent.events)?
|
|
33
|
+
${this._popupEvent&&Array.isArray(this._popupEvent.events)?D`
|
|
34
34
|
<scb-dialog variant="floating" open label="${a?"Events":"Händelser"} ${this._popupEvent.date}">
|
|
35
35
|
<scb-list>
|
|
36
|
-
${[...this._popupEvent.events].sort((n,l)=>{const y=n.start&&n.start.includes("T")?n.start:n.end&&n.end.includes("T")?n.end:"",
|
|
37
|
-
<scb-list-item label="${
|
|
36
|
+
${[...this._popupEvent.events].sort((n,l)=>{const y=n.start&&n.start.includes("T")?n.start:n.end&&n.end.includes("T")?n.end:"",c=l.start&&l.start.includes("T")?l.start:l.end&&l.end.includes("T")?l.end:"",g=y&&y.includes("T"),h=c&&c.includes("T");return g&&h?y.localeCompare(c):g?-1:h?1:n.title.localeCompare(l.title)}).map(n=>{const l=this._popupEvent?.date??"";let y="",c="",g="";if(n.start&&n.end){const h=n.start.split("T")[0],f=n.end.split("T")[0];h===f&&n.start.includes("T")&&n.end.includes("T")?y=n.start.split("T")[1].substring(0,5)+" – "+n.end.split("T")[1].substring(0,5):l===h&&n.start.includes("T")&&(y="Start: "+n.start.split("T")[1].substring(0,5)+(a?" (Extended event) ":" (Flerdagsevenemang) ")),l===f&&n.end.includes("T")&&h!==f&&(g=(a?"End: ":"Slut: ")+n.end.split("T")[1].substring(0,5)),l!==h&&(c=a?"cont. ":"fort. ")}else n.start&&n.start.includes("T")&&(y=n.start.split("T")[1].substring(0,5));return D`
|
|
37
|
+
<scb-list-item label="${c}${n.title}" supporting-text="${n.description?n.description:""}" overline="${y||""}${g||""}">
|
|
38
38
|
</scb-list-item>`})}
|
|
39
39
|
</scb-list>
|
|
40
40
|
</scb-dialog>
|
|
41
41
|
`:""}
|
|
42
|
-
`}};
|
|
42
|
+
`}};N=new WeakSet;O=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,i=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-calendar-spacing-block-start",e):this.style.removeProperty("--scb-calendar-spacing-block-start"),s?this.style.setProperty("--scb-calendar-spacing-block-end",s):this.style.removeProperty("--scb-calendar-spacing-block-end"),i?this.style.setProperty("--scb-calendar-spacing-inline-start",i):this.style.removeProperty("--scb-calendar-spacing-inline-start"),o?this.style.setProperty("--scb-calendar-spacing-inline-end",o):this.style.removeProperty("--scb-calendar-spacing-inline-end")};b.styles=W`
|
|
43
43
|
:host {
|
|
44
44
|
display: block;
|
|
45
|
+
margin-block-start: var(--scb-calendar-spacing-block-start, 0);
|
|
46
|
+
margin-block-end: var(--scb-calendar-spacing-block-end, 0);
|
|
47
|
+
margin-inline-start: var(--scb-calendar-spacing-inline-start, 0);
|
|
48
|
+
margin-inline-end: var(--scb-calendar-spacing-inline-end, 0);
|
|
45
49
|
border: 1px solid var(--md-sys-color-outline-variant);
|
|
46
50
|
padding: var(--spacing-5);
|
|
47
51
|
border-radius: var(--md-sys-shape-corner-large);
|
|
@@ -143,4 +147,4 @@ import{a as j,n as $,i as q,x as v,t as P}from"../../vendor/vendor.js";import"./
|
|
|
143
147
|
gap: var(--spacing-4);
|
|
144
148
|
}
|
|
145
149
|
|
|
146
|
-
`;
|
|
150
|
+
`;_([w({type:String})],b.prototype,"lang",2);_([w({type:Boolean,attribute:"disable-weekend"})],b.prototype,"disableWeekend",2);_([w({type:Boolean,attribute:"public-holidays"})],b.prototype,"publicHolidays",2);_([w({type:Number,attribute:"display-year",reflect:!0})],b.prototype,"displayYear",2);_([w({type:Number,attribute:"display-month",reflect:!0})],b.prototype,"displayMonth",2);_([w({type:String,attribute:"selected-date",reflect:!0})],b.prototype,"selectedDate",2);_([w({type:String,reflect:!0})],b.prototype,"spacing",2);_([w({type:String,attribute:"spacing-top",reflect:!0})],b.prototype,"spacingTop",2);_([w({type:String,attribute:"spacing-bottom",reflect:!0})],b.prototype,"spacingBottom",2);_([w({type:String,attribute:"spacing-left",reflect:!0})],b.prototype,"spacingLeft",2);_([w({type:String,attribute:"spacing-right",reflect:!0})],b.prototype,"spacingRight",2);b=_([R("scb-calendar")],b);
|