scb-wc 0.1.74 → 0.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -22
- package/all.js +0 -2
- package/index.js +88 -90
- package/mvc/components/all.js +0 -2
- package/mvc/components/scb-accordion/scb-accordion-item.js +2 -2
- package/mvc/components/scb-avatar/scb-avatar.js +2 -2
- package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +33 -15
- package/mvc/components/scb-button/scb-button.js +80 -41
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
- package/mvc/components/scb-card/scb-card.js +3 -3
- package/mvc/components/scb-checkbox/scb-checkbox.js +32 -7
- package/mvc/components/scb-chip/scb-chip.js +6 -6
- package/mvc/components/scb-dialog/scb-dialog.js +1 -1
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-fab/scb-fab.js +24 -6
- package/mvc/components/scb-fact-card/scb-fact-card.js +4 -4
- package/mvc/components/scb-header/scb-header.js +474 -124
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +1 -1
- package/mvc/components/scb-icon-button/scb-icon-button.js +2 -2
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +2 -2
- package/mvc/components/scb-link/scb-link.js +14 -10
- package/mvc/components/scb-list/scb-list-item.js +5 -5
- package/mvc/components/scb-list/scb-list.js +3 -3
- package/mvc/components/scb-menu/scb-menu-item.js +2 -2
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-pagination/scb-pagination.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-radio-button/scb-radio-button.js +39 -9
- package/mvc/components/scb-search/scb-search.js +3 -3
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +3 -3
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-slider/scb-slider.js +58 -4
- package/mvc/components/scb-status-pill/scb-status-pill.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-switch/scb-switch.js +51 -6
- package/mvc/components/scb-tabs/scb-primary-tab.js +3 -2
- package/mvc/components/scb-tabs/scb-secondary-tab.js +3 -2
- package/mvc/components/scb-tabs/scb-tabs.js +11 -2
- package/mvc/components/scb-textfield/scb-textfield.js +319 -24
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
- package/mvc/vendor/assist-chip.js +20 -0
- package/mvc/vendor/attachable-controller.js +1 -0
- package/mvc/vendor/checkbox-validator.js +1 -0
- package/mvc/vendor/chip-set.js +2 -0
- package/mvc/vendor/chip.js +18 -0
- package/mvc/vendor/delegate.js +1 -0
- package/mvc/vendor/element-internals.js +1 -0
- package/mvc/vendor/elevation.js +2 -0
- package/mvc/vendor/filled-icon-button.js +2 -0
- package/mvc/vendor/filled-tonal-icon-button.js +2 -0
- package/mvc/vendor/filter-chip.js +43 -0
- package/mvc/vendor/focusable.js +1 -0
- package/mvc/vendor/form-associated.js +1 -0
- package/mvc/vendor/form-label-activation.js +1 -0
- package/mvc/vendor/form-submitter.js +1 -0
- package/mvc/vendor/icon-button.js +2 -0
- package/mvc/vendor/icon.js +2 -0
- package/mvc/vendor/list.js +8 -0
- package/mvc/vendor/md-focus-ring.js +2 -0
- package/mvc/vendor/outlined-icon-button.js +2 -0
- package/mvc/vendor/redispatch-event.js +1 -0
- package/mvc/vendor/ripple.js +2 -0
- package/mvc/vendor/rolldown-runtime.js +1 -0
- package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
- package/mvc/vendor/shared-styles.js +3 -0
- package/mvc/vendor/shared-styles2.js +30 -0
- package/mvc/vendor/tab-styles.js +17 -0
- package/mvc/vendor/validator.js +1 -0
- package/package.json +2 -2
- package/scb-breadcrumb/scb-breadcrumb.js +38 -21
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-components/scb-header/scb-header.d.ts +11 -4
- package/scb-datepicker/scb-datepicker.js +0 -1
- package/scb-header/scb-header.js +512 -156
- package/scb-link/scb-link.js +24 -20
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc.bundle.js +728 -358
- package/scb-wc.d.ts +194 -198
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
- package/mvc/vendor/vendor-material.js +0 -364
- package/scb-components/index.d.ts +0 -99
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
|
@@ -1,4 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{_ as E,b as v,d as D,g as y,h as o,l as c,p as F,v as a,y as d}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as n}from"../../vendor/decorate.js";import"../../vendor/elevation.js";import{t as R}from"../../vendor/delegate.js";import{n as N,t as P}from"../../vendor/element-internals.js";import{t as G}from"../../vendor/form-submitter.js";import{n as q,t as H}from"../../vendor/form-label-activation.js";import{n as j,t as T}from"../../vendor/assertClassBrand.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,b){try{customElements.get(e)||t(e,s,b)}catch(h){var u=String(h||"");if(u.indexOf("already been used")===-1&&u.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var U=N(E),r=class extends U{get name(){return this.getAttribute("name")??""}set name(i){this.setAttribute("name",i)}get form(){return this[P].form}constructor(){super(),this.disabled=!1,this.href="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.handleActivationClick=i=>{!q(i)||!this.buttonElement||(this.focus(),H(this.buttonElement))},this.addEventListener("click",this.handleActivationClick)}focus(){this.buttonElement?.focus()}blur(){this.buttonElement?.blur()}render(){const i=this.disabled&&!this.href,t=this.href?this.renderLink():this.renderButton(),e=this.href?"link":"button";return d`
|
|
2
|
+
${this.renderElevationOrOutline?.()}
|
|
3
|
+
<div class="background"></div>
|
|
4
|
+
<md-focus-ring part="focus-ring" for=${e}></md-focus-ring>
|
|
5
|
+
<md-ripple
|
|
6
|
+
part="ripple"
|
|
7
|
+
for=${e}
|
|
8
|
+
?disabled="${i}"></md-ripple>
|
|
9
|
+
${t}
|
|
10
|
+
`}renderButton(){const{ariaLabel:i,ariaHasPopup:t,ariaExpanded:e}=this;return d`<button
|
|
11
|
+
id="button"
|
|
12
|
+
class="button"
|
|
13
|
+
?disabled=${this.disabled}
|
|
14
|
+
aria-label="${i||a}"
|
|
15
|
+
aria-haspopup="${t||a}"
|
|
16
|
+
aria-expanded="${e||a}">
|
|
17
|
+
${this.renderContent()}
|
|
18
|
+
</button>`}renderLink(){const{ariaLabel:i,ariaHasPopup:t,ariaExpanded:e}=this;return d`<a
|
|
19
|
+
id="link"
|
|
20
|
+
class="button"
|
|
21
|
+
aria-label="${i||a}"
|
|
22
|
+
aria-haspopup="${t||a}"
|
|
23
|
+
aria-expanded="${e||a}"
|
|
24
|
+
href=${this.href}
|
|
25
|
+
target=${this.target||a}
|
|
26
|
+
>${this.renderContent()}
|
|
27
|
+
</a>`}renderContent(){const i=d`<slot
|
|
28
|
+
name="icon"
|
|
29
|
+
@slotchange="${this.handleSlotChange}"></slot>`;return d`
|
|
30
|
+
<span class="touch"></span>
|
|
31
|
+
${this.trailingIcon?a:i}
|
|
32
|
+
<span class="label"><slot></slot></span>
|
|
33
|
+
${this.trailingIcon?i:a}
|
|
34
|
+
`}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}};R(r),G(r);r.formAssociated=!0;r.shadowRootOptions={mode:"open",delegatesFocus:!0};c([o({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);c([o()],r.prototype,"href",void 0);c([o()],r.prototype,"target",void 0);c([o({type:Boolean,attribute:"trailing-icon",reflect:!0})],r.prototype,"trailingIcon",void 0);c([o({type:Boolean,attribute:"has-icon",reflect:!0})],r.prototype,"hasIcon",void 0);c([o()],r.prototype,"type",void 0);c([o({reflect:!0})],r.prototype,"value",void 0);c([F(".button")],r.prototype,"buttonElement",void 0);c([D({slot:"icon",flatten:!0})],r.prototype,"assignedIcons",void 0);var W=class extends r{renderElevationOrOutline(){return d`<md-elevation part="elevation"></md-elevation>`}},V=v`:host{--_container-color: var(--md-filled-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-elevation: var(--md-filled-button-container-elevation, 0);--_container-height: var(--md-filled-button-container-height, 40px);--_container-shadow-color: var(--md-filled-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-button-focus-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-container-elevation: var(--md-filled-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-button-hover-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-button-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-filled-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filled-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filled-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-container-elevation: var(--md-filled-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-button-pressed-label-text-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-filled-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-button-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_hover-icon-color: var(--md-filled-button-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-color: var(--md-filled-button-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-size: var(--md-filled-button-icon-size, 18px);--_pressed-icon-color: var(--md-filled-button-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_container-shape-start-start: var(--md-filled-button-container-shape-start-start, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-button-container-shape-start-end, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-button-container-shape-end-end, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-button-container-shape-end-start, var(--md-filled-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-filled-button-leading-space, 24px);--_trailing-space: var(--md-filled-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-filled-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-filled-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-filled-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-filled-button-with-trailing-icon-trailing-space, 16px)}
|
|
35
|
+
`,L=v`md-elevation{transition-duration:280ms}:host([disabled]) md-elevation{transition:none}md-elevation{--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}:host(:focus-within) md-elevation{--md-elevation-level: var(--_focus-container-elevation)}:host(:hover) md-elevation{--md-elevation-level: var(--_hover-container-elevation)}:host(:active) md-elevation{--md-elevation-level: var(--_pressed-container-elevation)}:host([disabled]) md-elevation{--md-elevation-level: var(--_disabled-container-elevation)}
|
|
36
|
+
`,x=v`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit;text-transform:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background-color:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host([disabled]) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host([disabled]) .background{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host([disabled]){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host([disabled]) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none}
|
|
37
|
+
`,z=class extends W{};z.styles=[x,L,V];z=c([y("md-filled-button")],z);var X=class extends r{renderElevationOrOutline(){return d`<div class="outline"></div>`}},Y=v`:host{--_container-height: var(--md-outlined-button-container-height, 40px);--_disabled-label-text-color: var(--md-outlined-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-button-disabled-outline-opacity, 0.12);--_focus-label-text-color: var(--md-outlined-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-outlined-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-outlined-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-outlined-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-outlined-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-outlined-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-outlined-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-outlined-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_outline-color: var(--md-outlined-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-button-outline-width, 1px);--_pressed-label-text-color: var(--md-outlined-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-outline-color: var(--md-outlined-button-pressed-outline-color, var(--md-sys-color-outline, #79747e));--_pressed-state-layer-color: var(--md-outlined-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-outlined-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-outlined-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-outlined-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-outlined-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-outlined-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-outlined-button-icon-size, 18px);--_pressed-icon-color: var(--md-outlined-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-outlined-button-container-shape-start-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-outlined-button-container-shape-start-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-outlined-button-container-shape-end-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-outlined-button-container-shape-end-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-outlined-button-leading-space, 24px);--_trailing-space: var(--md-outlined-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-outlined-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-outlined-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-outlined-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-outlined-button-with-trailing-icon-trailing-space, 16px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0}.outline{inset:0;border-style:solid;position:absolute;box-sizing:border-box;border-color:var(--_outline-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}:host(:active) .outline{border-color:var(--_pressed-outline-color)}:host([disabled]) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}@media(forced-colors: active){:host([disabled]) .background{border-color:GrayText}:host([disabled]) .outline{opacity:1}}.outline,md-ripple{border-width:var(--_outline-width)}md-ripple{inline-size:calc(100% - 2*var(--_outline-width));block-size:calc(100% - 2*var(--_outline-width));border-style:solid;border-color:rgba(0,0,0,0)}
|
|
38
|
+
`,k=class extends X{};k.styles=[x,Y];k=c([y("md-outlined-button")],k);var J=class extends r{renderElevationOrOutline(){return d`<md-elevation part="elevation"></md-elevation>`}},K=v`:host{--_container-color: var(--md-filled-tonal-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-elevation: var(--md-filled-tonal-button-container-elevation, 0);--_container-height: var(--md-filled-tonal-button-container-height, 40px);--_container-shadow-color: var(--md-filled-tonal-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-tonal-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-tonal-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-tonal-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-tonal-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-tonal-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-tonal-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-tonal-button-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-container-elevation: var(--md-filled-tonal-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-tonal-button-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-tonal-button-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_label-text-font: var(--md-filled-tonal-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-tonal-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filled-tonal-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filled-tonal-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-container-elevation: var(--md-filled-tonal-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-tonal-button-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-filled-tonal-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-tonal-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-tonal-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-icon-color: var(--md-filled-tonal-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-color: var(--md-filled-tonal-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-button-icon-size, 18px);--_pressed-icon-color: var(--md-filled-tonal-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_container-shape-start-start: var(--md-filled-tonal-button-container-shape-start-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-tonal-button-container-shape-start-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-tonal-button-container-shape-end-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-tonal-button-container-shape-end-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-filled-tonal-button-leading-space, 24px);--_trailing-space: var(--md-filled-tonal-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-filled-tonal-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-filled-tonal-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-filled-tonal-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-filled-tonal-button-with-trailing-icon-trailing-space, 16px)}
|
|
39
|
+
`,$=class extends J{};$.styles=[x,L,K];$=c([y("md-filled-tonal-button")],$);var Q=class extends r{},Z=v`:host{--_container-height: var(--md-text-button-container-height, 40px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-text-button-container-shape-start-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-text-button-container-shape-start-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-text-button-container-shape-end-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-text-button-container-shape-end-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0}
|
|
40
|
+
`,A=class extends Q{};A.styles=[x,Z];A=c([y("md-text-button")],A);var f,l=(f=new WeakSet,class extends E{constructor(...t){super(...t),j(this,f),this.variant="filled",this.size="medium",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=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasDefaultSlotContent=!1}__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}__handleDefaultSlotChange(t){const e=t.target.assignedNodes({flatten:!0}).some(s=>s.nodeType===Node.TEXT_NODE?!!s.textContent?.trim():s.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==e&&(this.__hasDefaultSlotContent=e,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const t=this.__getMdHost(),e=this.__getInnerNativeButton(t);if(!t||!e)return;const s=(this.getAttribute("aria-label")||"").trim(),b=(t.getAttribute("aria-label")||"").trim(),u=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",h=s||b||u;h?e.setAttribute("aria-label",h):e.removeAttribute("aria-label");const S=this.getAttribute("aria-controls");S!==null?e.setAttribute("aria-controls",S):e.removeAttribute("aria-controls");const I=this.getAttribute("aria-expanded");I!==null?e.setAttribute("aria-expanded",I):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(O=>{const p=this.__getMdHost(),g=this.__getInnerNativeButton(p);if(!(!p||!g)){for(const _ of O){if(_.type!=="attributes"||!_.attributeName)continue;const m=_.attributeName,w=this.getAttribute(m);if(m==="aria-label"){const M=(p.getAttribute("aria-label")||"").trim(),B=(w||M||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();B?g.setAttribute("aria-label",B):g.removeAttribute("aria-label"),p.removeAttribute("aria-label")}else(m==="aria-controls"||m==="aria-expanded")&&(w===null?g.removeAttribute(m):g.setAttribute(m,w),m==="aria-expanded"&&this.removeAttribute("aria-expanded"))}p.removeAttribute("aria-label"),p.removeAttribute("aria-controls"),p.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(),T(f,this,C).call(this)}updated(t){(t.has("variant")||t.has("label")||t.has("icon"))&&this.__syncAriaToInner(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&T(f,this,C).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 v`
|
|
2
41
|
/* Gör hosten stretchbar i t.ex. flex/grid */
|
|
3
42
|
:host {
|
|
4
43
|
display: inline-flex;
|
|
@@ -205,70 +244,70 @@ import"../../vendor/vendor-material.js";import{_ as z,b as S,g as A,h as l,v as
|
|
|
205
244
|
}
|
|
206
245
|
}
|
|
207
246
|
*/
|
|
208
|
-
`}render(){const t=!!this.icon?.trim(),e=t?
|
|
247
|
+
`}render(){const t=!!this.icon?.trim(),e=t?d`<md-icon slot="icon" part="icon" ?filled=${this.iconFilled} aria-hidden="true">${this.icon}</md-icon>`:a,s=a,b=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,u=d`
|
|
209
248
|
<slot
|
|
210
249
|
@slotchange=${this.__handleDefaultSlotChange}
|
|
211
|
-
style=${this.__hasDefaultSlotContent?
|
|
250
|
+
style=${this.__hasDefaultSlotContent?a:"display: none"}
|
|
212
251
|
></slot>
|
|
213
|
-
${this.__hasDefaultSlotContent?
|
|
214
|
-
`;switch(this.variant){case"filled":return
|
|
252
|
+
${this.__hasDefaultSlotContent?a:this.label}
|
|
253
|
+
`;switch(this.variant){case"filled":return d`
|
|
215
254
|
<md-filled-button
|
|
216
255
|
type=${this.type}
|
|
217
|
-
variant=${
|
|
256
|
+
variant=${s}
|
|
218
257
|
?trailing-icon=${this.trailingIcon}
|
|
219
258
|
?disabled=${this.disabled}
|
|
220
|
-
aria-label=${
|
|
221
|
-
href=${this.href||
|
|
222
|
-
target=${this.target||
|
|
223
|
-
rel=${this.rel||
|
|
259
|
+
aria-label=${b}
|
|
260
|
+
href=${this.href||a}
|
|
261
|
+
target=${this.target||a}
|
|
262
|
+
rel=${this.rel||a}
|
|
224
263
|
>
|
|
225
|
-
${t&&!this.trailingIcon?e:
|
|
226
|
-
${
|
|
227
|
-
${t&&this.trailingIcon?e:
|
|
264
|
+
${t&&!this.trailingIcon?e:a}
|
|
265
|
+
${u}
|
|
266
|
+
${t&&this.trailingIcon?e:a}
|
|
228
267
|
</md-filled-button>
|
|
229
|
-
`;case"outlined":return
|
|
268
|
+
`;case"outlined":return d`
|
|
230
269
|
<md-outlined-button
|
|
231
270
|
type=${this.type}
|
|
232
|
-
variant=${
|
|
271
|
+
variant=${s}
|
|
233
272
|
?trailing-icon=${this.trailingIcon}
|
|
234
273
|
?disabled=${this.disabled}
|
|
235
|
-
aria-label=${
|
|
236
|
-
href=${this.href||
|
|
237
|
-
target=${this.target||
|
|
238
|
-
rel=${this.rel||
|
|
274
|
+
aria-label=${b}
|
|
275
|
+
href=${this.href||a}
|
|
276
|
+
target=${this.target||a}
|
|
277
|
+
rel=${this.rel||a}
|
|
239
278
|
>
|
|
240
|
-
${t&&!this.trailingIcon?e:
|
|
241
|
-
${
|
|
242
|
-
${t&&this.trailingIcon?e:
|
|
279
|
+
${t&&!this.trailingIcon?e:a}
|
|
280
|
+
${u}
|
|
281
|
+
${t&&this.trailingIcon?e:a}
|
|
243
282
|
</md-outlined-button>
|
|
244
|
-
`;case"filled-tonal":return
|
|
283
|
+
`;case"filled-tonal":return d`
|
|
245
284
|
<md-filled-tonal-button
|
|
246
285
|
type=${this.type}
|
|
247
|
-
variant=${
|
|
286
|
+
variant=${s}
|
|
248
287
|
?trailing-icon=${this.trailingIcon}
|
|
249
288
|
?disabled=${this.disabled}
|
|
250
|
-
aria-label=${
|
|
251
|
-
href=${this.href||
|
|
252
|
-
target=${this.target||
|
|
253
|
-
rel=${this.rel||
|
|
289
|
+
aria-label=${b}
|
|
290
|
+
href=${this.href||a}
|
|
291
|
+
target=${this.target||a}
|
|
292
|
+
rel=${this.rel||a}
|
|
254
293
|
>
|
|
255
|
-
${t&&!this.trailingIcon?e:
|
|
256
|
-
${
|
|
257
|
-
${t&&this.trailingIcon?e:
|
|
294
|
+
${t&&!this.trailingIcon?e:a}
|
|
295
|
+
${u}
|
|
296
|
+
${t&&this.trailingIcon?e:a}
|
|
258
297
|
</md-filled-tonal-button>
|
|
259
|
-
`;case"text":return
|
|
298
|
+
`;case"text":return d`
|
|
260
299
|
<md-text-button
|
|
261
300
|
type=${this.type}
|
|
262
|
-
variant=${
|
|
301
|
+
variant=${s}
|
|
263
302
|
?trailing-icon=${this.trailingIcon}
|
|
264
303
|
?disabled=${this.disabled}
|
|
265
|
-
aria-label=${
|
|
266
|
-
href=${this.href||
|
|
267
|
-
target=${this.target||
|
|
268
|
-
rel=${this.rel||
|
|
304
|
+
aria-label=${b}
|
|
305
|
+
href=${this.href||a}
|
|
306
|
+
target=${this.target||a}
|
|
307
|
+
rel=${this.rel||a}
|
|
269
308
|
>
|
|
270
|
-
${t&&!this.trailingIcon?e:
|
|
271
|
-
${
|
|
272
|
-
${t&&this.trailingIcon?e:
|
|
309
|
+
${t&&!this.trailingIcon?e:a}
|
|
310
|
+
${u}
|
|
311
|
+
${t&&this.trailingIcon?e:a}
|
|
273
312
|
</md-text-button>
|
|
274
|
-
`;default:return
|
|
313
|
+
`;default:return d``}}});function C(){const i=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??i,e=this.mapSpacingToken(this.spacingBottom)??i,s=this.mapSpacingToken(this.spacingLeft),b=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-button-spacing-block-start",t):this.style.removeProperty("--scb-button-spacing-block-start"),e?this.style.setProperty("--scb-button-spacing-block-end",e):this.style.removeProperty("--scb-button-spacing-block-end"),s?this.style.setProperty("--scb-button-spacing-inline-start",s):this.style.removeProperty("--scb-button-spacing-inline-start"),b?this.style.setProperty("--scb-button-spacing-inline-end",b):this.style.removeProperty("--scb-button-spacing-inline-end")}n([o({type:String,reflect:!0})],l.prototype,"variant",void 0);n([o({type:String,reflect:!0})],l.prototype,"size",void 0);n([o({type:String,reflect:!0})],l.prototype,"type",void 0);n([o({type:String})],l.prototype,"label",void 0);n([o({type:Boolean,attribute:"trailing-icon"})],l.prototype,"trailingIcon",void 0);n([o({type:String})],l.prototype,"icon",void 0);n([o({type:Boolean,attribute:"icon-filled",reflect:!0})],l.prototype,"iconFilled",void 0);n([o({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0);n([o({type:Boolean,attribute:"full-width",reflect:!0})],l.prototype,"fullWidth",void 0);n([o({type:String})],l.prototype,"href",void 0);n([o({type:String})],l.prototype,"target",void 0);n([o({type:String})],l.prototype,"rel",void 0);n([o({type:String,reflect:!0})],l.prototype,"spacing",void 0);n([o({type:String,attribute:"spacing-top",reflect:!0})],l.prototype,"spacingTop",void 0);n([o({type:String,attribute:"spacing-bottom",reflect:!0})],l.prototype,"spacingBottom",void 0);n([o({type:String,attribute:"spacing-left",reflect:!0})],l.prototype,"spacingLeft",void 0);n([o({type:String,attribute:"spacing-right",reflect:!0})],l.prototype,"spacingRight",void 0);l=n([y("scb-button")],l);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../vendor/vendor-material.js";import{_ as H,b as W,g as P,h as _,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as v}from"../../vendor/decorate.js";import{n as z,t as Y}from"../../vendor/assertClassBrand.js";import"../scb-list/scb-list.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";(function(){try{var k=typeof globalThis<"u"?globalThis:window;if(!k.__scb_ce_guard_installed__){k.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||t(e,s,a)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var F,J,K={fromAttribute(k){if(k===null)return!1;const t=k.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(F=new WeakSet,J=class extends H{constructor(...t){super(...t),z(this,F),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.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let d=n;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<s.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+l<s.length?n+l:n;break;case"ArrowUp":d=n-l>=0?n-l:n;break;default:return}d!==n&&(e.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),Y(F,this,I).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("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&Y(F,this,I).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 a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",a=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",n=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:a?a+"":void 0,start:i?i+"":void 0,end:n?n+"":void 0}}_toLocalEventDate(t,e){const s=(t??"").trim();if(!s)return null;if(!s.includes("T")){const i=s.split("-").map(c=>Number(c));if(i.length!==3||i.some(c=>Number.isNaN(c)))return null;const[n,d,l]=i;return e?new Date(n,d-1,l,23,59,59,999):new Date(n,d-1,l,0,0,0,0)}const a=new Date(s);return Number.isNaN(a.getTime())?null:a}_toDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(y,E)}}else{const d=i.split("T")[0],l=e.get(d)||[];l.push({title:a.title,description:a.description,href:a.href,start:i}),e.set(d,l)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(y,E)}}else if(i&&s.title){const d=i.split("T")[0],l=e.get(d)||[];l.push({title:s.title,description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i}),e.set(d,l)}}return e}_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._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_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._dispatchSelect(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._handleDialogClose,{once:!0}))})}_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,a=e%4,i=e%7,n=(19*s+24)%30,d=(2*a+4*i+6*n+5)%7;let l=22+n+d,c=0;l==57&&(l-=7),l==56&&n==28&&d==6&&s>10&&(l-=7),l>31?(l-=31,c=4):c=3;const y=new Date(e,c-1,l);return this._easterDateCalculated["Ar"+t]=y,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,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),d=this.lang==="en",l=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const c of l){const[y,E,x]=c;if(x)return d?E:y}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",d=n?["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 l=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const c=this._getEventInputs(),y=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),E=[];let x=1;for(let r=0;r<6;r++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=x;for(let D=0;D<f.length;D++){const w=f[D];if(r===0&&w<a){if(!this.disableWeekend||w<5){const M=e===0?11:e-1,N=e===0?t-1:t,b=this._daysInMonth(N,M)-(a-w-1);h.push(T`
|
|
1
|
+
import{_ as H,b as W,g as P,h as _,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import{t as v}from"../../vendor/decorate.js";import{n as z,t as Y}from"../../vendor/assertClassBrand.js";import"../scb-list/scb-list.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";(function(){try{var k=typeof globalThis<"u"?globalThis:window;if(!k.__scb_ce_guard_installed__){k.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,a){try{customElements.get(e)||t(e,s,a)}catch(n){var i=String(n||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var F,J,K={fromAttribute(k){if(k===null)return!1;const t=k.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},m=(F=new WeakSet,J=class extends H{constructor(...t){super(...t),z(this,F),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.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=e=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),a=this.shadowRoot?.activeElement,i=a&&s.includes(a)?a:document.activeElement,n=s.indexOf(i);if(n===-1)return;let d=n;const l=this.disableWeekend?5:7;switch(e.key){case"ArrowRight":d=n+1<s.length?n+1:n;break;case"ArrowLeft":d=n-1>=0?n-1:n;break;case"ArrowDown":d=n+l<s.length?n+l:n;break;case"ArrowUp":d=n-l>=0?n-l:n;break;default:return}d!==n&&(e.preventDefault(),s[d].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(t){const e=(t??"")+"";e!==this.selectedDate&&(this.selectedDate=e)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(t,e,s){super.attributeChangedCallback(t,e,s),t==="value"&&(this.value=s??"")}connectedCallback(){super.connectedCallback(),Y(F,this,I).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("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&Y(F,this,I).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 a=this._current.getFullYear(),i=this._current.getMonth()+1;(a!==e||i!==s)&&(this._current=new Date(e,s-1,1),this._dispatchMonthChange(e,s),this.requestUpdate())}}}_ensureEventsFromJson(){const t=(this.eventsJson??"").trim();if(!t){this._eventsFromJson=null,this._eventsJsonLast=t;return}if(!(this._eventsJsonLast===t&&this._eventsFromJson!==null)){this._eventsJsonLast=t;try{const e=JSON.parse(t);Array.isArray(e)?this._eventsFromJson=e:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(t){const e=t.title??"",s=t.description??"",a=t.href??"",i=t.startDate??t["start-date"]??t.start??t.date??"",n=t.endDate??t["end-date"]??t.end??"";return{title:e+"",description:s?s+"":void 0,href:a?a+"":void 0,start:i?i+"":void 0,end:n?n+"":void 0}}_toLocalEventDate(t,e){const s=(t??"").trim();if(!s)return null;if(!s.includes("T")){const i=s.split("-").map(c=>Number(c));if(i.length!==3||i.some(c=>Number.isNaN(c)))return null;const[n,d,l]=i;return e?new Date(n,d-1,l,23,59,59,999):new Date(n,d-1,l,0,0,0,0)}const a=new Date(s);return Number.isNaN(a.getTime())?null:a}_toDateKey(t){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(t){const e=new Map;for(const s of t){const a=this._normalizeEventInput(s),i=a.start||"",n=a.end||"";if(!(!i||!a.title))if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:a.title,description:a.description,href:a.href,start:i,end:n}),e.set(y,E)}}else{const d=i.split("T")[0],l=e.get(d)||[];l.push({title:a.title,description:a.description,href:a.href,start:i}),e.set(d,l)}}return e}_buildEventMapFromChildren(){const t=Array.from(this.querySelectorAll("scb-calendar-event")),e=new Map;for(const s of t){const a=s,i=(a.startDate??a.date??"")+""||s.getAttribute("start-date")||s.getAttribute("date")||"",n=(a.endDate??"")+""||s.getAttribute("end-date")||"";if(i&&n){const d=this._toLocalEventDate(i,!1),l=this._toLocalEventDate(n,!0);if(!d||!l)continue;if(l<d){const c=i.split("T")[0],y=e.get(c)||[];y.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(c,y);continue}for(let c=new Date(d);c<=l;c.setDate(c.getDate()+1)){const y=this._toDateKey(c),E=e.get(y)||[];E.push({title:s.title??"",description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i,end:n}),e.set(y,E)}}else if(i&&s.title){const d=i.split("T")[0],l=e.get(d)||[];l.push({title:s.title,description:s.description,href:a.href||s.getAttribute("href")||void 0,start:i}),e.set(d,l)}}return e}_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._dispatchMonthChange(e,s)}_dispatchMonthChange(t,e){const s={displayYear:t,displayMonth:e};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:s}))}_dispatchSelect(t){const e={selectedDate:t};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:e}))}_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._dispatchSelect(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._handleDialogClose,{once:!0}))})}_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,a=e%4,i=e%7,n=(19*s+24)%30,d=(2*a+4*i+6*n+5)%7;let l=22+n+d,c=0;l==57&&(l-=7),l==56&&n==28&&d==6&&s>10&&(l-=7),l>31?(l-=31,c=4):c=3;const y=new Date(e,c-1,l);return this._easterDateCalculated["Ar"+t]=y,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,a=t.getDate(),i=t.getFullYear(),n=this._easterDay(i),d=this.lang==="en",l=[["Nyårsdagen","New Year's Day",s===1&&a===1],["Trettondedag jul","Epiphany",s===1&&a===6],["Långfredag","Good Friday",+t==+this._addDays(n,-2)],["Påskdagen","Easter Sunday",+t==+n],["Annandag påsk","Easter Monday",+t==+this._addDays(n,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(n,39)],["Pingstdagen","Pentecost",+t==+this._addDays(n,50)&&i<2005],["Första maj","May Day",s===5&&a===1],["Nationaldagen","National Day",s===6&&a===6&&i>=2005],["Midsommarafton","Midsummer's Eve",s===6&&a>=19&&a<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&a>=20&&a<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&a===24],["Juldagen","Christmas Day",s===12&&a===25],["Annandag jul","Boxing Day",s===12&&a===26],["Alla helgons dag","All Saints' Day",s===10&&a>=31&&t.getDay()===6||s===11&&a<=6&&t.getDay()===6]];for(const c of l){const[y,E,x]=c;if(x)return d?E:y}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),a=this._firstDayOfWeek(t,e),i=this._today,n=this.lang==="en",d=n?["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 l=n?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(l=l.slice(0,5));const c=this._getEventInputs(),y=c?this._buildEventMapFromInputs(c):this._buildEventMapFromChildren(),E=[];let x=1;for(let r=0;r<6;r++){const h=[],f=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let p=x;for(let D=0;D<f.length;D++){const w=f[D];if(r===0&&w<a){if(!this.disableWeekend||w<5){const M=e===0?11:e-1,N=e===0?t-1:t,b=this._daysInMonth(N,M)-(a-w-1);h.push(T`
|
|
2
2
|
<div class="calendar-day calendar-day--other">
|
|
3
3
|
<span class="calendar-day-number">${b}</span>
|
|
4
4
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-
|
|
2
|
-
import
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/ripple.js","../../vendor/attachable-controller.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as P,b as L,g as W,h as i,y as n}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import{t as a}from"../../vendor/decorate.js";import{n as I,t as h}from"../../vendor/assertClassBrand.js";import{t as H}from"../../vendor/preload-helper.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,l,c){try{customElements.get(s)||e(s,l,c)}catch(m){var g=String(m||"");if(g.indexOf("already been used")===-1&&g.indexOf("NotSupportedError")===-1)throw m}}}}catch{}})();var d,o,p,b={fromAttribute:r=>r??"",toAttribute:r=>typeof r!="string"||r.trim()===""?null:r},t=(d=new WeakSet,o=class extends P{constructor(...e){super(...e),I(this,d),this.variant="default",this.size="medium",this.date=null,this.direction="horizontal",this.title="",this.calendarCardTitle="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__getSlottedText(e){return this.querySelector(`[slot="${e}"]`)?.textContent?.trim()??""}async firstUpdated(){p.__iconLoaded||(await H(()=>import("../../vendor/icon.js").then(e=>e.t),__vite__mapDeps([0,1,2,3]),import.meta.url),p.__iconLoaded=!0),p.__rippleLoaded||(await H(()=>import("../../vendor/ripple.js").then(e=>e.t),__vite__mapDeps([4,1,2,5,3]),import.meta.url),p.__rippleLoaded=!0),this.__applyInnerSizing(),h(d,this,$).call(this)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",s=this.direction?`${this.direction.toLowerCase()}`:"",l=this.cardHref?"clickable":"",c=this.__hasSlottedContent("heading"),g=this.__hasSlottedContent("subtitle"),m=this.__hasSlottedContent("supporting-text"),v=this.calendarCardTitle||this.title,y=this.subtitle,f=this.supportingText,u=c||!!v,x=g||!!y,T=m||!!f,{day:z,month:w}=h(d,this,A).call(this),_=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",k=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",S=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",C=`${_?`inline-size:${_};`:""}${k?`block-size:${k};`:""}${S?`aspect-ratio:${S};`:""}`;return n`
|
|
3
3
|
<div
|
|
4
4
|
class="calendar-card ${s} ${l} ${e}"
|
|
5
5
|
role="${this.cardHref?"link":"group"}"
|
|
@@ -25,12 +25,12 @@ import"../../vendor/vendor-material.js";import{_ as P,b as L,g as W,h as i,y as
|
|
|
25
25
|
${this.cardHref?n`<div class="icon-container"><md-icon>arrow_forward</md-icon></div>`:""}
|
|
26
26
|
</div>
|
|
27
27
|
`:""}
|
|
28
|
-
${x?n`<div class="subtitle">${g?n`<slot name="subtitle"></slot>`:
|
|
28
|
+
${x?n`<div class="subtitle">${g?n`<slot name="subtitle"></slot>`:y}</div>`:""}
|
|
29
29
|
</div>
|
|
30
30
|
`:""}
|
|
31
31
|
${T?n`
|
|
32
32
|
<div class="supporting-text">
|
|
33
|
-
${m?n`<slot name="supporting-text"></slot>`:
|
|
33
|
+
${m?n`<slot name="supporting-text"></slot>`:f}
|
|
34
34
|
</div>
|
|
35
35
|
`:""}
|
|
36
36
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-
|
|
2
|
-
import
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/ripple.js","../../vendor/attachable-controller.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as lt,b as dt,g as $,h as a,v as o,y as n}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import{t as s}from"../../vendor/decorate.js";import{n as pt,t as v}from"../../vendor/assertClassBrand.js";import"../scb-button/scb-button.js";import{t as W}from"../../vendor/preload-helper.js";import"../scb-list/scb-list.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-chip/scb-chip.js";import"../scb-avatar/scb-avatar.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,r,d){try{customElements.get(e)||t(e,r,d)}catch(b){var h=String(b||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var g,_,S,ht=["standard","list","social","link","action","container"],c={fromAttribute:l=>l??"",toAttribute:l=>typeof l!="string"||l.trim()===""?null:l},i=(g=new WeakSet,_=class extends lt{constructor(...t){super(...t),pt(this,g),this.__managedSocialAttributes=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size="large",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.likesText="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=e=>{const r=e.currentTarget.closest(".media");r&&r.classList.add("is-loaded")},this.__onKeyDown=e=>{const r=this.__effectiveHref();(e.key==="Enter"||e.key===" ")&&r&&(e.preventDefault(),this.__navigate(r,e))},this.__handleHrefNavigation=e=>{const r=this.__effectiveHref();r&&(e.target.closest("a")||this.__navigate(r,e))}}attributeChangedCallback(t,e,r){this.__isSyncingManagedSocialAttributes&&this.__managedSocialAttributes.has(t)||super.attributeChangedCallback(t,e,r)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:600,h:400};const r=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(r&&r.length===2){const h=Number(r[0]),b=Number(r[1]);if(h>0&&b>0)return{w:h,h:b}}const d=Number(e);return isFinite(d)&&d>0?{w:1e3,h:Math.round(1e3/d)}:{w:600,h:400}}__noWrapText(t){return(t??"").replace(/ /g," ").replace(/-/g,"‑")}__decodeHtmlEntities(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}__normalizePlainText(t){let e=String(t??"");for(let r=0;r<5;r+=1){const d=this.__decodeHtmlEntities(e);if(d===e)break;e=d}return e.replace(/<\s*(br|\/p|\/div|\/li|\/h[1-6]|\/tr)\b[^>]*>/gi," ").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()}get cardType(){const t=(this.type||"standard").toLowerCase();return ht.includes(t)?t:"standard"}__dispatchLikeEvent(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent(t.replace("-",""),{bubbles:!0,composed:!0,detail:e}))}__dispatchSocialActionEvent(t,e){this.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:e}}))}__dispatchCardNavigate(t,e){const r={href:t,originalEvent:e},d=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});if(this.dispatchEvent(d),d.defaultPrevented)return!1;const h=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:r});return this.dispatchEvent(h),!h.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__hasSlottedContent(t){return Array.from(this.children).some(e=>e.getAttribute("slot")===t)}__mediaTemplate(){if(this.__hasSlottedContent("media"))return n`
|
|
3
3
|
<div class="media">
|
|
4
4
|
<slot name="media"></slot>
|
|
5
5
|
</div>
|
|
@@ -220,7 +220,7 @@ import"../../vendor/vendor-material.js";import{_ as lt,b as dt,g as $,h as a,v a
|
|
|
220
220
|
${x(!!b)}
|
|
221
221
|
${y()}
|
|
222
222
|
</div>
|
|
223
|
-
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.cardType==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&v(g,this,V).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&v(g,this,j).call(this)}async firstUpdated(t){S.__iconLoaded||(await W(()=>import("../../vendor/
|
|
223
|
+
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.cardType==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&v(g,this,V).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&v(g,this,j).call(this)}async firstUpdated(t){S.__iconLoaded||(await W(()=>import("../../vendor/icon.js").then(e=>e.t),__vite__mapDeps([0,1,2,3]),import.meta.url),S.__iconLoaded=!0),S.__rippleLoaded||(await W(()=>import("../../vendor/ripple.js").then(e=>e.t),__vite__mapDeps([4,1,2,5,3]),import.meta.url),S.__rippleLoaded=!0),v(g,this,V).call(this),v(g,this,j).call(this),this.__syncSocialAttributes()}},S=_,_.__iconLoaded=!1,_.__rippleLoaded=!1,_.styles=dt`
|
|
224
224
|
:host {
|
|
225
225
|
display: block;
|
|
226
226
|
container-type: inline-size;
|
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{_ as $,b as F,c as T,g as M,h as s,l as h,m as E,p as B,v as p,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/ripple.js";import{t as n}from"../../vendor/decorate.js";import{t as P}from"../../vendor/delegate.js";import{n as O}from"../../vendor/element-internals.js";import{n as D,t as G}from"../../vendor/form-label-activation.js";import{n as H,t as d}from"../../vendor/assertClassBrand.js";import{n as V,r as L,t as m}from"../../vendor/classPrivateFieldGet2.js";import{t as K}from"../../vendor/redispatch-event.js";import{i as U,n as W,r as N}from"../../vendor/validator.js";import{n as Y,r as j,t as J}from"../../vendor/form-associated.js";import{t as Q}from"../../vendor/checkbox-validator.js";import"./scb-checkbox-group.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,r,a){try{customElements.get(i)||e(i,r,a)}catch(_){var b=String(_||"");if(b.indexOf("already been used")===-1&&b.indexOf("NotSupportedError")===-1)throw _}}}}catch{}})();var X=U(j(O($))),l=class extends X{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",t=>{!D(t)||!this.input||(this.focus(),G(this.input))})}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,e=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,a=this.indeterminate,b=T({disabled:this.disabled,selected:r||a,unselected:!r&&!a,checked:r,indeterminate:a,"prev-unselected":t,"prev-checked":e,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:_,ariaInvalid:q}=this;return f`
|
|
2
|
+
<div class="container ${b}">
|
|
3
|
+
<input
|
|
4
|
+
type="checkbox"
|
|
5
|
+
id="input"
|
|
6
|
+
aria-checked=${a?"mixed":p}
|
|
7
|
+
aria-label=${_||p}
|
|
8
|
+
aria-invalid=${q||p}
|
|
9
|
+
?disabled=${this.disabled}
|
|
10
|
+
?required=${this.required}
|
|
11
|
+
.indeterminate=${this.indeterminate}
|
|
12
|
+
.checked=${this.checked}
|
|
13
|
+
@input=${this.handleInput}
|
|
14
|
+
@change=${this.handleChange} />
|
|
15
|
+
|
|
16
|
+
<div class="outline"></div>
|
|
17
|
+
<div class="background"></div>
|
|
18
|
+
<md-focus-ring part="focus-ring" for="input"></md-focus-ring>
|
|
19
|
+
<md-ripple for="input" ?disabled=${this.disabled}></md-ripple>
|
|
20
|
+
<svg class="icon" viewBox="0 0 18 18" aria-hidden="true">
|
|
21
|
+
<rect class="mark short" />
|
|
22
|
+
<rect class="mark long" />
|
|
23
|
+
</svg>
|
|
24
|
+
</div>
|
|
25
|
+
`}handleInput(t){const e=t.target;this.checked=e.checked,this.indeterminate=e.indeterminate}handleChange(t){K(this,t)}[Y](){return!this.checked||this.indeterminate?null:this.value}[J](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked=t==="true"}[W](){return new Q(()=>this)}[N](){return this.input}};P(l);l.shadowRootOptions={...$.shadowRootOptions,delegatesFocus:!0};h([s({type:Boolean})],l.prototype,"checked",void 0);h([s({type:Boolean})],l.prototype,"indeterminate",void 0);h([s({type:Boolean})],l.prototype,"required",void 0);h([s()],l.prototype,"value",void 0);h([E()],l.prototype,"prevChecked",void 0);h([E()],l.prototype,"prevDisabled",void 0);h([E()],l.prototype,"prevIndeterminate",void 0);h([B("input")],l.prototype,"input",void 0);var Z=F`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}}
|
|
26
|
+
`,S=class extends l{};S.styles=[Z];S=h([M("md-checkbox")],S);var c,v,k,g,C,I=!1,w=0,A=t=>{t.metaKey||t.altKey||t.ctrlKey||(I=!0)},u=()=>{I=!1},ee=()=>{w===0&&(window.addEventListener("keydown",A,!0),window.addEventListener("pointerdown",u,!0),window.addEventListener("mousedown",u,!0),window.addEventListener("touchstart",u,!0)),w+=1},te=()=>{w=Math.max(0,w-1),w===0&&(window.removeEventListener("keydown",A,!0),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("mousedown",u,!0),window.removeEventListener("touchstart",u,!0))},o=(c=new WeakSet,v=new WeakMap,k=new WeakMap,g=new WeakMap,C=class extends ${constructor(){super(),H(this,c),L(this,v,void 0),L(this,k,void 0),L(this,g,void 0),this._internals=null,this.disabled=!1,this.indeterminate=!1,this.checked=!1,this.required=!1,this.size="medium",this.label="",this.supportingText="",this.ariaLabel="",this.name="",this.value="on",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formResetHandler=null,this._initialChecked=!1,this._customValidationMessage="",this._checkboxId="",this._showOuterFocusRing=!1,V(v,this,()=>{this.disabled||this.label?.trim()&&I&&d(c,this,x).call(this,!0)}),V(k,this,()=>{d(c,this,x).call(this,!1)}),V(g,this,()=>{d(c,this,x).call(this,!1)}),"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),ee(),this._checkboxId=this.id||`scb-checkbox-${Math.random().toString(36).slice(2,11)}`,this._initialChecked=this.checked,d(c,this,z).call(this),this.addEventListener("focusin",m(v,this)),this.addEventListener("focusout",m(k,this)),this.addEventListener("pointerdown",m(g,this),!0),this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.checked=this._initialChecked,this.indeterminate=!1,this.__syncFormValue()},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue()}disconnectedCallback(){super.disconnectedCallback(),te(),this.removeEventListener("focusin",m(v,this)),this.removeEventListener("focusout",m(k,this)),this.removeEventListener("pointerdown",m(g,this),!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)}firstUpdated(){const e=this.shadowRoot?.querySelector("md-checkbox");e&&e.addEventListener("change",()=>{const i=e,r=!!i.checked,a=!!i.indeterminate;this.checked=r,this.indeterminate=a,this.dispatchEvent(new CustomEvent("change",{detail:{checked:r,indeterminate:a},bubbles:!0,composed:!0}))}),this.shadowRoot?.querySelector("label.wrap")?.addEventListener("click",i=>{if(!this.disabled&&!i.composedPath().some(r=>{const a=r;return a?.tagName?.toLowerCase?.()==="md-checkbox"||a?.classList?.contains("box-wrap")})){i.preventDefault();const r=this.shadowRoot.querySelector("md-checkbox");r&&(r.checked=!r.checked,r.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}}),this.__syncInnerAria(),this.__syncValidity(),d(c,this,R).call(this)}updated(e){super.updated(e),e.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&d(c,this,x).call(this,!1)),(e.has("label")||e.has("supportingText")||e.has("ariaLabel"))&&this.__syncInnerAria(),e.has("label")&&d(c,this,z).call(this),(e.has("checked")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("checked")||e.has("disabled")||e.has("required"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&d(c,this,R).call(this)}formDisabledCallback(e){this.disabled=e}__syncInnerAria(){const e=this.shadowRoot?.querySelector("md-checkbox")?.shadowRoot;if(!e)return;const i=e.querySelector('[role="checkbox"]')||e.querySelector('input[type="checkbox"]');if(!i)return;const r=!!this.label?.trim(),a=r?`${this._checkboxId}-label`:"",b=this.supportingText?`${this._checkboxId}-supporting-text`:"";r&&a?(i.setAttribute("aria-labelledby",a),i.removeAttribute("aria-label")):(i.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?i.setAttribute("aria-label",this.ariaLabel.trim()):i.removeAttribute("aria-label")),b?i.setAttribute("aria-describedby",b):i.removeAttribute("aria-describedby")}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.checked?"Markera det här fältet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-checkbox"),i=this.disabled?"":this.__getValidationMessage();this._internals&&(i?this._internals.setValidity({valueMissing:!0},i,e??void 0):this._internals.setValidity({})),this.toggleAttribute("aria-invalid",!!i)}checkValidity(){return!this.__getValidationMessage()}reportValidity(){return this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=e,this.__syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.checked?null:this.value;this._internals.setFormValue(e)}render(){const e=this.supportingText?`${this._checkboxId}-supporting-text`:void 0,i=!!this.label?.trim(),r=i?p:this.ariaLabel||p;return f`
|
|
2
27
|
<label class="wrap">
|
|
3
|
-
${
|
|
28
|
+
${i?f`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>`:p}
|
|
4
29
|
<div class="box-wrap">
|
|
5
30
|
<md-checkbox
|
|
6
31
|
id="${this._checkboxId}"
|
|
@@ -8,16 +33,16 @@ import"../../vendor/vendor-material.js";import{_ as I,b as M,g as R,h as n,v as
|
|
|
8
33
|
?indeterminate=${this.indeterminate}
|
|
9
34
|
?checked=${this.checked}
|
|
10
35
|
?required=${this.required}
|
|
11
|
-
aria-label=${
|
|
36
|
+
aria-label=${r}
|
|
12
37
|
></md-checkbox>
|
|
13
38
|
</div>
|
|
14
|
-
${
|
|
15
|
-
${this.supportingText?
|
|
39
|
+
${i?f`<span class="lbl" id="${this._checkboxId}-label">${this.label}</span>`:p}
|
|
40
|
+
${this.supportingText?f`<div id="${e}" class="supporting-text">
|
|
16
41
|
${this.supportingText}
|
|
17
42
|
</div>`:p}
|
|
18
43
|
</label>
|
|
19
44
|
<slot></slot>
|
|
20
|
-
`}},
|
|
45
|
+
`}},C.formAssociated=!0,C.styles=F`
|
|
21
46
|
:host {
|
|
22
47
|
display: inline-grid;
|
|
23
48
|
grid-template-columns: auto;
|
|
@@ -139,4 +164,4 @@ import"../../vendor/vendor-material.js";import{_ as I,b as M,g as R,h as n,v as
|
|
|
139
164
|
color: var(--md-sys-color-on-surface-variant);
|
|
140
165
|
}
|
|
141
166
|
}
|
|
142
|
-
`,
|
|
167
|
+
`,C);function x(t){this._showOuterFocusRing!==t&&(this._showOuterFocusRing=t,this.requestUpdate())}function z(){const t=!!this.label?.trim();this.toggleAttribute("data-has-label",t),t||d(c,this,x).call(this,!1)}function R(){const t=d(c,this,y).call(this,this.spacing),e=d(c,this,y).call(this,this.spacingTop)??t,i=d(c,this,y).call(this,this.spacingBottom)??t,r=d(c,this,y).call(this,this.spacingLeft),a=d(c,this,y).call(this,this.spacingRight);e?this.style.setProperty("--scb-checkbox-spacing-block-start",e):this.style.removeProperty("--scb-checkbox-spacing-block-start"),i?this.style.setProperty("--scb-checkbox-spacing-block-end",i):this.style.removeProperty("--scb-checkbox-spacing-block-end"),r?this.style.setProperty("--scb-checkbox-spacing-inline-start",r):this.style.removeProperty("--scb-checkbox-spacing-inline-start"),a?this.style.setProperty("--scb-checkbox-spacing-inline-end",a):this.style.removeProperty("--scb-checkbox-spacing-inline-end")}function y(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}n([s({type:Boolean,reflect:!0})],o.prototype,"disabled",void 0);n([s({type:Boolean,reflect:!0})],o.prototype,"indeterminate",void 0);n([s({type:Boolean,reflect:!0})],o.prototype,"checked",void 0);n([s({type:Boolean,reflect:!0})],o.prototype,"required",void 0);n([s({type:String,reflect:!0})],o.prototype,"size",void 0);n([s({type:String})],o.prototype,"label",void 0);n([s({type:String,attribute:"supporting-text"})],o.prototype,"supportingText",void 0);n([s({type:String,reflect:!0,attribute:"aria-label"})],o.prototype,"ariaLabel",void 0);n([s({type:String})],o.prototype,"name",void 0);n([s({type:String})],o.prototype,"value",void 0);n([s({type:String,reflect:!0})],o.prototype,"spacing",void 0);n([s({type:String,attribute:"spacing-top",reflect:!0})],o.prototype,"spacingTop",void 0);n([s({type:String,attribute:"spacing-bottom",reflect:!0})],o.prototype,"spacingBottom",void 0);n([s({type:String,attribute:"spacing-left",reflect:!0})],o.prototype,"spacingLeft",void 0);n([s({type:String,attribute:"spacing-right",reflect:!0})],o.prototype,"spacingRight",void 0);o=n([M("scb-checkbox")],o);export{o as ScbCheckbox};
|