scb-wc 0.1.262 → 0.1.264
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/scb-wc.bundle.js
CHANGED
|
@@ -3742,6 +3742,10 @@
|
|
|
3742
3742
|
}
|
|
3743
3743
|
|
|
3744
3744
|
.scb-tooltip-supporting-text {
|
|
3745
|
+
box-sizing: border-box;
|
|
3746
|
+
min-width: 0;
|
|
3747
|
+
max-width: 100%;
|
|
3748
|
+
overflow-wrap: anywhere;
|
|
3745
3749
|
font-family: var(--scb-tooltip-supporting-font, var(--scb-tooltip-design-supporting-medium-font));
|
|
3746
3750
|
font-size: var(--scb-tooltip-supporting-size, var(--scb-tooltip-design-supporting-medium-size));
|
|
3747
3751
|
font-style: normal;
|
|
@@ -3828,8 +3832,10 @@
|
|
|
3828
3832
|
}
|
|
3829
3833
|
|
|
3830
3834
|
:host([variant='rich']) .scb-tooltip-text-container {
|
|
3835
|
+
box-sizing: border-box;
|
|
3831
3836
|
display: flex;
|
|
3832
|
-
min-width:
|
|
3837
|
+
min-width: 0;
|
|
3838
|
+
max-width: 100%;
|
|
3833
3839
|
padding: var(--scb-tooltip-design-rich-padding-block-medium) var(--scb-tooltip-design-rich-padding-inline-medium) var(--spacing-2) var(--scb-tooltip-design-rich-padding-inline-medium);
|
|
3834
3840
|
align-items: flex-start;
|
|
3835
3841
|
gap: var(--spacing-2);
|
|
@@ -3932,7 +3938,7 @@
|
|
|
3932
3938
|
${t}
|
|
3933
3939
|
</div>
|
|
3934
3940
|
<slot @slotchange=${this._onDefaultSlotChange}></slot>
|
|
3935
|
-
`}},N([_({type:String,reflect:!0})],Ml.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0})],Ml.prototype,`arrow`,void 0),N([_({type:String,attribute:`supporting-text`})],Ml.prototype,`supportingtext`,void 0),N([_({type:String})],Ml.prototype,`label`,void 0),N([_({type:String,reflect:!0})],Ml.prototype,`trigger`,void 0),N([_({type:String,reflect:!0})],Ml.prototype,`position`,void 0),N([_({type:Boolean,reflect:!0})],Ml.prototype,`open`,void 0),N([_({type:Number,reflect:!0})],Ml.prototype,`delay`,void 0),N([_({type:Number,reflect:!0})],Ml.prototype,`offset`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],Ml.prototype,`maxWidth`,void 0),Ml=N([a(`scb-tooltip`)],Ml)})),Pl=n({ensureScbCardVariantStyles:()=>Fl,renderScbCardVariant:()=>
|
|
3941
|
+
`}},N([_({type:String,reflect:!0})],Ml.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0})],Ml.prototype,`arrow`,void 0),N([_({type:String,attribute:`supporting-text`})],Ml.prototype,`supportingtext`,void 0),N([_({type:String})],Ml.prototype,`label`,void 0),N([_({type:String,reflect:!0})],Ml.prototype,`trigger`,void 0),N([_({type:String,reflect:!0})],Ml.prototype,`position`,void 0),N([_({type:Boolean,reflect:!0})],Ml.prototype,`open`,void 0),N([_({type:Number,reflect:!0})],Ml.prototype,`delay`,void 0),N([_({type:Number,reflect:!0})],Ml.prototype,`offset`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],Ml.prototype,`maxWidth`,void 0),Ml=N([a(`scb-tooltip`)],Ml)})),Pl=n({ensureScbCardVariantStyles:()=>Fl,renderScbCardVariant:()=>Vl});function Fl(e){if(!(e instanceof ShadowRoot)||e.querySelector(`style[data-scb-card-variants]`))return;let t=document.createElement(`style`);t.dataset.scbCardVariants=``,t.textContent=Ul,e.appendChild(t)}function Il(e){let t=document.createElement(`textarea`);return t.innerHTML=e,t.value}function Ll(e){let t=String(e??``);for(let e=0;e<5;e+=1){let e=Il(t);if(e===t)break;t=e}return t.replace(/<\s*(br|\/p|\/div|\/li|\/h[1-6]|\/tr)\b[^>]*>/gi,` `).replace(/<[^>]*>/g,` `).replace(/\s+/g,` `).trim()}function Rl(e,t){let n=e.renderRoot?.querySelector(`.scb-card`);n&&(t?n.classList.add(`no-hover`):n.classList.remove(`no-hover`))}function zl(e,t,n){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:n})),e.dispatchEvent(new CustomEvent(t.replace(`-`,``),{bubbles:!0,composed:!0,detail:n}))}function Bl(e,t,n){e.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:n}}))}function Vl(e,t,n){switch(t){case`list`:return x`
|
|
3936
3942
|
<div class="full-content">
|
|
3937
3943
|
${n.hasListTopContent?n.topContentTpl(!1):S}
|
|
3938
3944
|
<div class="content list ${n.hasListTopContent?`has-top-content`:``}">
|
|
@@ -3940,7 +3946,7 @@
|
|
|
3940
3946
|
</div>
|
|
3941
3947
|
${n.footerTpl()}
|
|
3942
3948
|
</div>
|
|
3943
|
-
`;case`social`:return
|
|
3949
|
+
`;case`social`:return Hl(e,n);case`link`:return x`
|
|
3944
3950
|
<div class="full-content">
|
|
3945
3951
|
${n.topContentTpl(!1)}
|
|
3946
3952
|
<div class="content links">
|
|
@@ -3973,11 +3979,11 @@
|
|
|
3973
3979
|
${n.topContentTpl(!!n.effectiveHref)}
|
|
3974
3980
|
${n.footerTpl()}
|
|
3975
3981
|
</div>
|
|
3976
|
-
`}}function
|
|
3982
|
+
`}}function Hl(e,t){let n=e.commentsHref,r=Ll(e.supportingText),i=e=>{e.stopPropagation()},a=e.commentsText?`${e.commentsText}: `:``,o=e.likesText?`${e.likesText}: `:``,s=e.likeLabel||e.likesText||`Gilla`,c=()=>{e.likesInteractive&&zl(e,`like-hover`,{hasLiked:e.hasLiked,likes:e.likes??0})},l=t=>n=>{n.stopPropagation(),Bl(e,t,n)},u=e.likesDisabled?S:x`
|
|
3977
3983
|
<span
|
|
3978
3984
|
class="likes"
|
|
3979
|
-
@mouseenter=${()=>{
|
|
3980
|
-
@mouseleave=${()=>
|
|
3985
|
+
@mouseenter=${()=>{Rl(e,!0),c()}}
|
|
3986
|
+
@mouseleave=${()=>Rl(e,!1)}
|
|
3981
3987
|
>
|
|
3982
3988
|
${e.likesInteractive?x`
|
|
3983
3989
|
<scb-icon-button
|
|
@@ -3987,8 +3993,8 @@
|
|
|
3987
3993
|
icon="thumb_up"
|
|
3988
3994
|
?icon-filled=${e.hasLiked}
|
|
3989
3995
|
aria-label=${s}
|
|
3990
|
-
@click=${t=>{t.stopPropagation(),e.hasLiked=!e.hasLiked,
|
|
3991
|
-
@keydown=${t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),e.hasLiked=!e.hasLiked,
|
|
3996
|
+
@click=${t=>{t.stopPropagation(),e.hasLiked=!e.hasLiked,zl(e,`like-click`,{hasLiked:e.hasLiked,likes:e.likes??0})}}
|
|
3997
|
+
@keydown=${t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),e.hasLiked=!e.hasLiked,zl(e,`like-click`,{hasLiked:e.hasLiked,likes:e.likes??0}))}}
|
|
3992
3998
|
></scb-icon-button>
|
|
3993
3999
|
`:x`<span class="card-icon" aria-hidden="true">thumb_up</span>`}
|
|
3994
4000
|
<span class="social-text">${o}${e.likes??0}</span>
|
|
@@ -4004,16 +4010,16 @@
|
|
|
4004
4010
|
href="${e.authorHref||`#`}"
|
|
4005
4011
|
tabindex="0"
|
|
4006
4012
|
@click=${i}
|
|
4007
|
-
@mouseenter=${()=>
|
|
4008
|
-
@mouseleave=${()=>
|
|
4013
|
+
@mouseenter=${()=>Rl(e,!0)}
|
|
4014
|
+
@mouseleave=${()=>Rl(e,!1)}
|
|
4009
4015
|
>${e.authorText}</a
|
|
4010
4016
|
>
|
|
4011
4017
|
`:S}
|
|
4012
4018
|
${e.commentsDisabled?S:x`
|
|
4013
4019
|
<span
|
|
4014
4020
|
class="comments"
|
|
4015
|
-
@mouseenter=${()=>
|
|
4016
|
-
@mouseleave=${()=>
|
|
4021
|
+
@mouseenter=${()=>Rl(e,!0)}
|
|
4022
|
+
@mouseleave=${()=>Rl(e,!1)}
|
|
4017
4023
|
>
|
|
4018
4024
|
${n===``?x`
|
|
4019
4025
|
<span class="card-icon" aria-hidden="true">comment</span>
|
|
@@ -4035,7 +4041,7 @@
|
|
|
4035
4041
|
<scb-tooltip
|
|
4036
4042
|
variant="rich"
|
|
4037
4043
|
for="like-button"
|
|
4038
|
-
supporting-text=${
|
|
4044
|
+
supporting-text=${e.likesHoverContent}
|
|
4039
4045
|
trigger="hover"
|
|
4040
4046
|
position="right"
|
|
4041
4047
|
>
|
|
@@ -4082,7 +4088,7 @@
|
|
|
4082
4088
|
</div>
|
|
4083
4089
|
${t.footerTpl()}
|
|
4084
4090
|
</div>
|
|
4085
|
-
`}var Wl
|
|
4091
|
+
`}var Ul,Wl=t((()=>{w(),Ul=`
|
|
4086
4092
|
.scb-card.no-hover,
|
|
4087
4093
|
.scb-card.no-hover:hover,
|
|
4088
4094
|
.scb-card.no-hover:active {
|
|
@@ -4284,7 +4290,7 @@
|
|
|
4284
4290
|
.scb-card.filled-alternative .content.list ::slotted(scb-list) {
|
|
4285
4291
|
--scb-list-bg: var(--md-sys-color-surface-container, var(--p-95));
|
|
4286
4292
|
}
|
|
4287
|
-
`}));w(),b(),uc(),cc(),P();var
|
|
4293
|
+
`}));w(),b(),uc(),cc(),P();var Gl=new Set([`social-comments-text`,`social-comments`,`social-comments-disabled`,`social-comments-href`,`social-comments-link-label`,`social-likes-text`,`social-like-label`,`social-likes`,`social-likes-disabled`,`social-likes-hover-content`,`social-has-liked`,`social-likes-interactive`,`social-author`,`social-author-text`,`social-author-href`,`social-reply-enabled`,`social-reply-label`,`social-edit-enabled`,`social-edit-label`,`social-delete-enabled`,`social-delete-label`]),Kl=`data-scb-card-managed-list-size`,ql=`data-scb-card-managed-action-button-size`,Jl=`data-scb-card-managed-avatar-size`,Yl=new Set([`small`,`medium`,`large`]),Xl=new Set([`small`,`medium`,`large`,`extra-large`]),Zl,Ql,$l,eu,tu,nu,ru,iu,au,ou;function su(){return iu??=Promise.resolve().then(()=>(j(),nc)),iu}function cu(){return au??=Promise.resolve().then(()=>(Ec(),Sc)),au}function lu(){return Zl??=Promise.resolve().then(()=>(rl(),$c)),Zl}function uu(){return Ql??=Promise.resolve().then(()=>(dl(),il)),Ql}function du(){return $l??=Promise.resolve().then(()=>(Mc(),Dc)),$l}function fu(){return eu??=Promise.resolve().then(()=>(gl(),ml)),eu}function pu(){return tu??=Promise.resolve().then(()=>(yl(),_l)),tu}function mu(){return nu??=Promise.resolve().then(()=>(_c(),mc)),nu}function hu(){return ru??=Promise.resolve().then(()=>(Nl(),kl)),ru}function gu(){return ou??=Promise.resolve().then(()=>(Wl(),Pl)),ou}var B={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},V=class extends C{constructor(...e){super(...e),this.__dependencyKey=``,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__isSyncingManagedSocialAttributes=!1,this.type=`standard`,this.variant=`standard`,this.direction=`dynamic`,this.size=lc[`scb-card`].size,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.commentsLinkLabel=`Gå till kommentarer`,this.likesText=``,this.likeLabel=``,this.likesDisabled=!1,this.likesHoverContent=``,this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText=``,this.authorHref=``,this.replyEnabled=!1,this.replyLabel=`Svara`,this.editEnabled=!1,this.editLabel=`Redigera`,this.deleteEnabled=!1,this.deleteLabel=`Ta bort`,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=>{let t=e.currentTarget.closest(`.media`);t&&t.classList.add(`is-loaded`)},this.__ensureRippleOnInteraction=(e,t=!1)=>{if(this.__primaryHref()){if(e&&(this.__pendingRippleEvent=e),t&&(this.__pendingRippleClick=!0),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,cu().then(({ensureRippleReady:e})=>e()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}},this.__syncRipple=async()=>{let e=this.renderRoot.querySelector(`md-ripple`),t=this.renderRoot.querySelector(`.scb-card`),n=this.__pendingRippleEvent,r=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;let{syncRippleToControl:i}=await cu();await i(e,t,n,r)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,su().then(({ensureFocusRingReady:e})=>e()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=e=>{if(e.target!==e.currentTarget)return;let t=this.__primaryHref();(e.key===`Enter`||e.key===` `)&&t&&(e.preventDefault(),this.__ensureRippleOnInteraction(void 0,!0),this.__navigate(t,e))},this.__handleHrefNavigation=e=>{let t=this.__primaryHref();t&&(e.target.closest(`a`)||this.__navigate(t,e))},this.__handleSlottedCardLinkClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLAnchorElement&&e.getAttribute(`slot`)===`card-link`)?.getAttribute(`href`)||this.__primaryHref();t&&(this.__dispatchCardNavigate(t,e)||e.preventDefault())}}static{this.styles=p`
|
|
4288
4294
|
/*
|
|
4289
4295
|
Designbrygga:
|
|
4290
4296
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -5523,7 +5529,7 @@
|
|
|
5523
5529
|
--scb-card-design-standard-supporting-font-weight: var(--scb-card-design-standard-supporting-large-font-weight);
|
|
5524
5530
|
}
|
|
5525
5531
|
/* design:bindings:scb-card:end */
|
|
5526
|
-
`}attributeChangedCallback(e,t,n){this.__isSyncingManagedSocialAttributes&&
|
|
5532
|
+
`}attributeChangedCallback(e,t,n){this.__isSyncingManagedSocialAttributes&&Gl.has(e)||super.attributeChangedCallback(e,t,n)}get likeButton(){return this.cardType===`social`?this.renderRoot.querySelector(`.likes scb-icon-button`):null}__calcAspectWH(e){let t=(e||``).trim();if(!t)return{w:600,h:400};let n=t.includes(`/`)?t.split(`/`):t.includes(`:`)?t.split(`:`):t.includes(`x`)?t.split(`x`):null;if(n&&n.length===2){let e=Number(n[0]),t=Number(n[1]);if(e>0&&t>0)return{w:e,h:t}}let r=Number(t);return isFinite(r)&&r>0?{w:1e3,h:Math.round(1e3/r)}:{w:600,h:400}}__mediaReserveAspect(e=``){let t=(this.mediaAspect||``).trim();if(t)return t;let n=Number(this.mediaWidth)||0,r=Number(this.mediaHeight)||0;return n>0&&r>0?`${n} / ${r}`:e}__mediaReserveStyle(e=``){let t=this.__mediaReserveAspect(e);return t?`--scb-card-media-aspect:${t};`:``}__slottedMediaAspect(){let e=this.querySelector(`[slot="media"]`);if(!e)return``;let t=Number(e.getAttribute(`width`))||0,n=Number(e.getAttribute(`height`))||0;return t>0&&n>0?`${t} / ${n}`:``}__isAvatarMedia(){return(this.mediaType||``).toLowerCase()===`avatar`||this.querySelector(`:scope > [slot="media"]`)?.localName===`scb-avatar`}get __resolvedTitle(){return this.cardTitle||this.title}get cardType(){let e=(this.type||`standard`).toLowerCase();switch(e){case`standard`:case`list`:case`social`:case`link`:case`action`:case`container`:return e;default:return`standard`}}__ensureVariantRenderer(){return this.cardType===`standard`||this.__variantRenderer?Promise.resolve():gu().then(e=>{this.__variantRenderer!==e&&(this.__variantRenderer=e,e.ensureScbCardVariantStyles(this.renderRoot),this.requestUpdate())})}__dispatchCardNavigate(e,t){let n={href:e,originalEvent:t},r=new CustomEvent(`card-navigate`,{bubbles:!0,composed:!0,cancelable:!0,detail:n});if(this.dispatchEvent(r),r.defaultPrevented)return!1;let i=new CustomEvent(`cardnavigate`,{bubbles:!0,composed:!0,cancelable:!0,detail:n});return this.dispatchEvent(i),!i.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__slottedCardLink(){return this.querySelector(`:scope > a[slot="card-link"]`)}__primaryHref(){return this.__effectiveHref()||this.__slottedCardLink()?.getAttribute(`href`)||``}__navigate(e,t){e&&this.__dispatchCardNavigate(e,t)&&window.open(e,`_self`)}__slotNames(){let e=new Set;for(let t of Array.from(this.children)){let n=t.getAttribute(`slot`);n&&e.add(n)}return e}__hasSlottedContent(e,t){return t?t.has(e):Array.from(this.children).some(t=>t.getAttribute(`slot`)===e)}__hasLightDomElement(e){return!!this.querySelector(e)}__syncListCardListSize(){let e=Array.from(this.querySelectorAll(`scb-list`));if(this.cardType!==`list`){for(let t of e){let e=t.getAttribute(Kl);e!==null&&t.getAttribute(`size`)===e&&t.removeAttribute(`size`),t.removeAttribute(Kl)}return}let t=this.size||`large`;for(let n of e){let e=n.getAttribute(Kl);if(e!==null&&n.getAttribute(`size`)!==e){n.removeAttribute(Kl);continue}(!n.hasAttribute(`size`)||e!==null)&&(n.setAttribute(`size`,t),n.setAttribute(Kl,t))}}__actionCardButtonSize(){let e=getComputedStyle(this).getPropertyValue(`--scb-card-size-actions-button-size`).trim();return Yl.has(e)?e:`medium`}__cardAvatarSize(){let e=getComputedStyle(this).getPropertyValue(`--scb-card-size-avatar-component-size`).trim();return Xl.has(e)?e:`medium`}__syncAvatarSizes(){let e=Array.from(this.querySelectorAll(`:scope > scb-avatar[slot="media"]`)),t=this.__cardAvatarSize();for(let n of e){let e=n.getAttribute(Jl);if(e!==null&&n.getAttribute(`size`)!==e){n.removeAttribute(Jl);continue}(!n.hasAttribute(`size`)||e!==null)&&(n.setAttribute(`size`,t),n.setAttribute(Jl,t))}}__socialIconButtonSize(){return M(this,`--scb-card-size-social-icon-button-component-size`,[`tiny`,`extra-small`,`small`,`medium`,`large`],this.size===`small`?`small`:`medium`)}__syncActionCardButtonSizes(){let e=Array.from(this.querySelectorAll(`:scope > [slot="actions"] scb-button, :scope > scb-button[slot="actions"]`));if(this.cardType!==`action`){for(let t of e){let e=t.getAttribute(ql);e!==null&&t.getAttribute(`size`)===e&&t.removeAttribute(`size`),t.removeAttribute(ql)}return}let t=this.__actionCardButtonSize();for(let n of e){let e=n.getAttribute(ql);if(e!==null&&n.getAttribute(`size`)!==e){n.removeAttribute(ql);continue}(!n.hasAttribute(`size`)||e!==null)&&(n.setAttribute(`size`,t),n.setAttribute(ql,t))}}__slottedText(e){return(this.querySelector(`:scope > [slot="${e}"]`)?.textContent??``).replace(/\s+/g,` `).trim()}__ensureDependenciesReady(){let e=[],t=[],n=this.cardType,r=!!this.vignette?.trim(),i=(n,r)=>{t.push(n),e.push(r())};(n===`list`||this.__hasLightDomElement(`scb-list, scb-list-item`))&&i(`list`,lu),n!==`standard`&&i(`card-variants`,()=>this.__ensureVariantRenderer()),(n===`social`&&(!this.likesDisabled&&this.likesInteractive||!this.commentsDisabled&&this.commentsHref||this.replyEnabled||this.editEnabled||this.deleteEnabled)||this.__hasLightDomElement(`scb-icon-button`))&&i(`icon-button`,uu),this.__hasLightDomElement(`scb-button`)&&i(`button`,du),this.__hasLightDomElement(`scb-link`)&&i(`link`,fu),(r||this.__hasLightDomElement(`scb-chip`))&&i(`chip`,pu),((this.mediaType||``).toLowerCase()===`avatar`||this.__hasLightDomElement(`scb-avatar`))&&i(`avatar`,mu),(n===`social`&&this.likesHoverContent||this.__hasLightDomElement(`scb-tooltip`))&&i(`tooltip`,hu);let a=t.sort().join(`|`);a!==this.__dependencyKey&&(this.__dependencyKey=a,e.length>0&&Promise.all(e).then(()=>this.requestUpdate()))}__mediaTemplate(e){let t=this.__isAvatarMedia();if(this.__hasSlottedContent(`media`,e)){let e=t?``:this.__mediaReserveStyle(this.__slottedMediaAspect());return x`
|
|
5527
5533
|
<div class="media ${t?`avatar-media`:``} ${e?`has-reserved-space`:``}" style=${e||S}>
|
|
5528
5534
|
<slot name="media"></slot>
|
|
5529
5535
|
</div>
|
|
@@ -5617,7 +5623,7 @@
|
|
|
5617
5623
|
${_e(!!s)}
|
|
5618
5624
|
${ve()}
|
|
5619
5625
|
</div>
|
|
5620
|
-
`))}updated(e){if(super.updated(e),e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),e.has(`type`)||e.has(`size`)){if(this.cardType===`list`){let e=this.size===`small`?`-4`:this.size===`medium`?`-2`:`0`;this.setAttribute(`data-density`,e)}else this.removeAttribute(`data-density`);this.__syncListCardListSize(),this.__syncActionCardButtonSizes()}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(),this.__ensureDependenciesReady(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing(),(e.has(`innerPadding`)||e.has(`paddingTop`)||e.has(`paddingBottom`)||e.has(`paddingLeft`)||e.has(`paddingRight`))&&this.__applyPadding()}async firstUpdated(e){this.__lightDomObserver=new MutationObserver(()=>{this.__ensureDependenciesReady(),this.__syncListCardListSize(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes()}),this.__lightDomObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`slot`]}),this.__ensureDependenciesReady(),this.__syncListCardListSize(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes(),this.__applySpacing(),this.__applyPadding(),this.__syncSocialAttributes(),this.__primaryHref()&&this.contains(document.activeElement)&&this.__ensureFocusRingOnFocusVisible(),this.__primaryHref()&&this.matches(`:hover`)&&this.__ensureRippleOnInteraction()}disconnectedCallback(){this.__lightDomObserver?.disconnect(),this.__lightDomObserver=void 0,super.disconnectedCallback()}};N([_({type:String,reflect:!0,converter:B})],V.prototype,`type`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`variant`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`direction`,void 0),N([_({type:String,reflect:!0})],V.prototype,`size`,void 0),N([_({type:String,attribute:`media-type`})],V.prototype,`mediaType`,void 0),N([_({type:String,attribute:`media-href`})],V.prototype,`mediaHref`,void 0),N([_({type:String,attribute:`media-alt`})],V.prototype,`mediaAlt`,void 0),N([_({type:String,attribute:`media-srcset`})],V.prototype,`mediaSrcset`,void 0),N([_({type:String,attribute:`media-sizes`})],V.prototype,`mediaSizes`,void 0),N([_({type:String,attribute:`media-loading`})],V.prototype,`mediaLoading`,void 0),N([_({type:String,attribute:`media-decoding`})],V.prototype,`mediaDecoding`,void 0),N([_({type:String,attribute:`media-fetchpriority`})],V.prototype,`mediaFetchPriority`,void 0),N([_({type:String,attribute:`media-fit`})],V.prototype,`mediaFit`,void 0),N([_({type:String,attribute:`media-position`})],V.prototype,`mediaPosition`,void 0),N([_({type:String,attribute:`media-width`})],V.prototype,`mediaWidth`,void 0),N([_({type:String,attribute:`media-height`})],V.prototype,`mediaHeight`,void 0),N([_({type:String,attribute:`media-aspect`})],V.prototype,`mediaAspect`,void 0),N([_({type:Boolean,attribute:`media-placeholder`})],V.prototype,`mediaPlaceholder`,void 0),N([_({type:String,attribute:`card-href`,reflect:!0,converter:B})],V.prototype,`cardHref`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`href`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`title`,void 0),N([_({type:String,attribute:`card-title`,reflect:!0,converter:B})],V.prototype,`cardTitle`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`subtitle`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`vignette`,void 0),N([_({type:String,attribute:`vignette-variant`,converter:B})],V.prototype,`vignetteVariant`,void 0),N([_({type:String,attribute:`vignette-spacing`,reflect:!0,converter:B})],V.prototype,`vignetteSpacing`,void 0),N([_({type:String,attribute:`vignette-spacing-top`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingTop`,void 0),N([_({type:String,attribute:`vignette-spacing-bottom`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingBottom`,void 0),N([_({type:String,attribute:`vignette-spacing-left`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingLeft`,void 0),N([_({type:String,attribute:`vignette-spacing-right`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingRight`,void 0),N([_({type:String,attribute:`supporting-text`,reflect:!0,converter:B})],V.prototype,`supportingText`,void 0),N([_({type:Date,reflect:!0})],V.prototype,`date`,void 0),N([_({type:String,attribute:`social-comments-text`})],V.prototype,`commentsText`,void 0),N([_({type:Number,attribute:`social-comments`})],V.prototype,`comments`,void 0),N([_({type:Boolean,attribute:`social-comments-disabled`})],V.prototype,`commentsDisabled`,void 0),N([_({type:String,attribute:`social-comments-href`})],V.prototype,`commentsHref`,void 0),N([_({type:String,attribute:`social-comments-link-label`})],V.prototype,`commentsLinkLabel`,void 0),N([_({type:String,attribute:`social-likes-text`})],V.prototype,`likesText`,void 0),N([_({type:String,attribute:`social-like-label`})],V.prototype,`likeLabel`,void 0),N([_({type:Number,attribute:`social-likes`})],V.prototype,`likes`,void 0),N([_({type:Boolean,attribute:`social-likes-disabled`})],V.prototype,`likesDisabled`,void 0),N([_({type:String,attribute:`social-likes-hover-content`})],V.prototype,`likesHoverContent`,void 0),N([_({type:Boolean,attribute:`social-has-liked`})],V.prototype,`hasLiked`,void 0),N([_({type:Boolean,attribute:`social-likes-interactive`})],V.prototype,`likesInteractive`,void 0),N([_({type:Boolean,attribute:`social-author`})],V.prototype,`author`,void 0),N([_({type:String,attribute:`social-author-text`})],V.prototype,`authorText`,void 0),N([_({type:String,attribute:`social-author-href`})],V.prototype,`authorHref`,void 0),N([_({type:Boolean,attribute:`social-reply-enabled`})],V.prototype,`replyEnabled`,void 0),N([_({type:String,attribute:`social-reply-label`})],V.prototype,`replyLabel`,void 0),N([_({type:Boolean,attribute:`social-edit-enabled`})],V.prototype,`editEnabled`,void 0),N([_({type:String,attribute:`social-edit-label`})],V.prototype,`editLabel`,void 0),N([_({type:Boolean,attribute:`social-delete-enabled`})],V.prototype,`deleteEnabled`,void 0),N([_({type:String,attribute:`social-delete-label`})],V.prototype,`deleteLabel`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`sizing`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`,converter:B})],V.prototype,`maxWidth`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`,converter:B})],V.prototype,`maxHeight`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0,converter:B})],V.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0,converter:B})],V.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0,converter:B})],V.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0,converter:B})],V.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`padding`,reflect:!0,converter:B})],V.prototype,`innerPadding`,void 0),N([_({type:String,attribute:`padding-top`,reflect:!0,converter:B})],V.prototype,`paddingTop`,void 0),N([_({type:String,attribute:`padding-bottom`,reflect:!0,converter:B})],V.prototype,`paddingBottom`,void 0),N([_({type:String,attribute:`padding-left`,reflect:!0,converter:B})],V.prototype,`paddingLeft`,void 0),N([_({type:String,attribute:`padding-right`,reflect:!0,converter:B})],V.prototype,`paddingRight`,void 0),V=N([a(`scb-card`)],V);var vu=class extends V{constructor(){super(),this.type=`list`}get cardType(){return`list`}};vu=N([a(`scb-list-card`)],vu);var yu=class extends V{constructor(){super(),this.type=`link`}get cardType(){return`link`}};yu=N([a(`scb-link-card`)],yu);var bu=class extends V{constructor(){super(),this.type=`action`}get cardType(){return`action`}};bu=N([a(`scb-action-card`)],bu);var xu=class extends V{constructor(){super(),this.type=`social`}get cardType(){return`social`}};xu=N([a(`scb-social-card`)],xu);var Su=class extends V{constructor(){super(),this.type=`container`}get cardType(){return`container`}};Su=N([a(`scb-container-card`)],Su);var Cu=n({ScbSearch:()=>H}),wu,H,Tu=t((()=>{w(),b(),E(),D(),j(),Ol(),uc(),cc(),P(),wu=0,H=class extends C{static{this.formAssociated=!0}async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??=Promise.resolve().then(()=>(rl(),$c)).then(()=>{this._listDepsLoaded=!0}),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){let e=(this.value??``).trim().length>0;!this._inputFocused||!e||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText=``,this.inputLabel=``,this.clearLabel=`Rensa sökfält`,this.suggestionsLabel=`Sökförslag`,this.errorText=``,this.value=``,this.name=``,this.disabled=!1,this.required=!1,this.error=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size=lc[`scb-search`].size,this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++wu}`,this._kbMode=!1,this._valueOnFocus=``,this._lastChangeValue=``,this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key===`Tab`&&(ic(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._onViewportScroll=()=>{this._positionSuggestionPopover()},this._listScrollHandler=()=>{let e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e)},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
5626
|
+
`))}updated(e){if(super.updated(e),e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),e.has(`type`)||e.has(`size`)){if(this.cardType===`list`){let e=this.size===`small`?`-4`:this.size===`medium`?`-2`:`0`;this.setAttribute(`data-density`,e)}else this.removeAttribute(`data-density`);this.__syncListCardListSize(),this.__syncActionCardButtonSizes()}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(),this.__ensureDependenciesReady(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing(),(e.has(`innerPadding`)||e.has(`paddingTop`)||e.has(`paddingBottom`)||e.has(`paddingLeft`)||e.has(`paddingRight`))&&this.__applyPadding()}async firstUpdated(e){this.__lightDomObserver=new MutationObserver(()=>{this.__ensureDependenciesReady(),this.__syncListCardListSize(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes()}),this.__lightDomObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`slot`]}),this.__ensureDependenciesReady(),this.__syncListCardListSize(),this.__syncActionCardButtonSizes(),this.__syncAvatarSizes(),this.__applySpacing(),this.__applyPadding(),this.__syncSocialAttributes(),this.__primaryHref()&&this.contains(document.activeElement)&&this.__ensureFocusRingOnFocusVisible(),this.__primaryHref()&&this.matches(`:hover`)&&this.__ensureRippleOnInteraction()}disconnectedCallback(){this.__lightDomObserver?.disconnect(),this.__lightDomObserver=void 0,super.disconnectedCallback()}};N([_({type:String,reflect:!0,converter:B})],V.prototype,`type`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`variant`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`direction`,void 0),N([_({type:String,reflect:!0})],V.prototype,`size`,void 0),N([_({type:String,attribute:`media-type`})],V.prototype,`mediaType`,void 0),N([_({type:String,attribute:`media-href`})],V.prototype,`mediaHref`,void 0),N([_({type:String,attribute:`media-alt`})],V.prototype,`mediaAlt`,void 0),N([_({type:String,attribute:`media-srcset`})],V.prototype,`mediaSrcset`,void 0),N([_({type:String,attribute:`media-sizes`})],V.prototype,`mediaSizes`,void 0),N([_({type:String,attribute:`media-loading`})],V.prototype,`mediaLoading`,void 0),N([_({type:String,attribute:`media-decoding`})],V.prototype,`mediaDecoding`,void 0),N([_({type:String,attribute:`media-fetchpriority`})],V.prototype,`mediaFetchPriority`,void 0),N([_({type:String,attribute:`media-fit`})],V.prototype,`mediaFit`,void 0),N([_({type:String,attribute:`media-position`})],V.prototype,`mediaPosition`,void 0),N([_({type:String,attribute:`media-width`})],V.prototype,`mediaWidth`,void 0),N([_({type:String,attribute:`media-height`})],V.prototype,`mediaHeight`,void 0),N([_({type:String,attribute:`media-aspect`})],V.prototype,`mediaAspect`,void 0),N([_({type:Boolean,attribute:`media-placeholder`})],V.prototype,`mediaPlaceholder`,void 0),N([_({type:String,attribute:`card-href`,reflect:!0,converter:B})],V.prototype,`cardHref`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`href`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`title`,void 0),N([_({type:String,attribute:`card-title`,reflect:!0,converter:B})],V.prototype,`cardTitle`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`subtitle`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`vignette`,void 0),N([_({type:String,attribute:`vignette-variant`,converter:B})],V.prototype,`vignetteVariant`,void 0),N([_({type:String,attribute:`vignette-spacing`,reflect:!0,converter:B})],V.prototype,`vignetteSpacing`,void 0),N([_({type:String,attribute:`vignette-spacing-top`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingTop`,void 0),N([_({type:String,attribute:`vignette-spacing-bottom`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingBottom`,void 0),N([_({type:String,attribute:`vignette-spacing-left`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingLeft`,void 0),N([_({type:String,attribute:`vignette-spacing-right`,reflect:!0,converter:B})],V.prototype,`vignetteSpacingRight`,void 0),N([_({type:String,attribute:`supporting-text`,reflect:!0,converter:B})],V.prototype,`supportingText`,void 0),N([_({type:Date,reflect:!0})],V.prototype,`date`,void 0),N([_({type:String,attribute:`social-comments-text`})],V.prototype,`commentsText`,void 0),N([_({type:Number,attribute:`social-comments`})],V.prototype,`comments`,void 0),N([_({type:Boolean,attribute:`social-comments-disabled`})],V.prototype,`commentsDisabled`,void 0),N([_({type:String,attribute:`social-comments-href`})],V.prototype,`commentsHref`,void 0),N([_({type:String,attribute:`social-comments-link-label`})],V.prototype,`commentsLinkLabel`,void 0),N([_({type:String,attribute:`social-likes-text`})],V.prototype,`likesText`,void 0),N([_({type:String,attribute:`social-like-label`})],V.prototype,`likeLabel`,void 0),N([_({type:Number,attribute:`social-likes`})],V.prototype,`likes`,void 0),N([_({type:Boolean,attribute:`social-likes-disabled`})],V.prototype,`likesDisabled`,void 0),N([_({type:String,attribute:`social-likes-hover-content`})],V.prototype,`likesHoverContent`,void 0),N([_({type:Boolean,attribute:`social-has-liked`})],V.prototype,`hasLiked`,void 0),N([_({type:Boolean,attribute:`social-likes-interactive`})],V.prototype,`likesInteractive`,void 0),N([_({type:Boolean,attribute:`social-author`})],V.prototype,`author`,void 0),N([_({type:String,attribute:`social-author-text`})],V.prototype,`authorText`,void 0),N([_({type:String,attribute:`social-author-href`})],V.prototype,`authorHref`,void 0),N([_({type:Boolean,attribute:`social-reply-enabled`})],V.prototype,`replyEnabled`,void 0),N([_({type:String,attribute:`social-reply-label`})],V.prototype,`replyLabel`,void 0),N([_({type:Boolean,attribute:`social-edit-enabled`})],V.prototype,`editEnabled`,void 0),N([_({type:String,attribute:`social-edit-label`})],V.prototype,`editLabel`,void 0),N([_({type:Boolean,attribute:`social-delete-enabled`})],V.prototype,`deleteEnabled`,void 0),N([_({type:String,attribute:`social-delete-label`})],V.prototype,`deleteLabel`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`sizing`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`,converter:B})],V.prototype,`maxWidth`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`,converter:B})],V.prototype,`maxHeight`,void 0),N([_({type:String,reflect:!0,converter:B})],V.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0,converter:B})],V.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0,converter:B})],V.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0,converter:B})],V.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0,converter:B})],V.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`padding`,reflect:!0,converter:B})],V.prototype,`innerPadding`,void 0),N([_({type:String,attribute:`padding-top`,reflect:!0,converter:B})],V.prototype,`paddingTop`,void 0),N([_({type:String,attribute:`padding-bottom`,reflect:!0,converter:B})],V.prototype,`paddingBottom`,void 0),N([_({type:String,attribute:`padding-left`,reflect:!0,converter:B})],V.prototype,`paddingLeft`,void 0),N([_({type:String,attribute:`padding-right`,reflect:!0,converter:B})],V.prototype,`paddingRight`,void 0),V=N([a(`scb-card`)],V);var _u=class extends V{constructor(){super(),this.type=`list`}get cardType(){return`list`}};_u=N([a(`scb-list-card`)],_u);var vu=class extends V{constructor(){super(),this.type=`link`}get cardType(){return`link`}};vu=N([a(`scb-link-card`)],vu);var yu=class extends V{constructor(){super(),this.type=`action`}get cardType(){return`action`}};yu=N([a(`scb-action-card`)],yu);var bu=class extends V{constructor(){super(),this.type=`social`}get cardType(){return`social`}};bu=N([a(`scb-social-card`)],bu);var xu=class extends V{constructor(){super(),this.type=`container`}get cardType(){return`container`}};xu=N([a(`scb-container-card`)],xu);var Su=n({ScbSearch:()=>H}),Cu,H,wu=t((()=>{w(),b(),E(),D(),j(),Ol(),uc(),cc(),P(),Cu=0,H=class extends C{static{this.formAssociated=!0}async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??=Promise.resolve().then(()=>(rl(),$c)).then(()=>{this._listDepsLoaded=!0}),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){let e=(this.value??``).trim().length>0;!this._inputFocused||!e||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText=``,this.inputLabel=``,this.clearLabel=`Rensa sökfält`,this.suggestionsLabel=`Sökförslag`,this.errorText=``,this.value=``,this.name=``,this.disabled=!1,this.required=!1,this.error=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size=lc[`scb-search`].size,this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++Cu}`,this._kbMode=!1,this._valueOnFocus=``,this._lastChangeValue=``,this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key===`Tab`&&(ic(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._onViewportScroll=()=>{this._positionSuggestionPopover()},this._listScrollHandler=()=>{let e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e)},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
5621
5627
|
:host {
|
|
5622
5628
|
/* Fälttext: base text current. JSON-källa: src/tokens/source/typography.json. */
|
|
5623
5629
|
--scb-fields-text-font-weight-current: var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));
|
|
@@ -6268,7 +6274,7 @@
|
|
|
6268
6274
|
<md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
|
|
6269
6275
|
`:S}
|
|
6270
6276
|
${n?x`<span id="search-supporting-text" class="supporting-text">${n}</span>`:S}
|
|
6271
|
-
`}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??``).trim()?this.errorText||`Fyll i det här fältet.`:``}_syncValidity(){let e=this._inputEl(),t=this.disabled?``:this._getValidationMessage(),n=this.error,r=this._validationMessage;if(e&&e.setCustomValidity(t),this._internals)if(t){let n=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(n,t,e??void 0)}else this._internals.setValidity({});this._validationMessage=t,this.error=this.disabled?!1:t?this._hasValidationBeenReported||n:n&&!this._hasValidationBeenReported&&!r,e&&e.setAttribute(`aria-invalid`,this.error?`true`:`false`),this.toggleAttribute(`aria-invalid`,this.error),(n!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();let e=this._inputEl();return e?e.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??``),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){let e=this._getActiveItem(),t={value:this.value};e&&(t.active=this._itemPayload(e)),this._dispatchSubmit(t)}focus(e){let t=this._inputEl();if(t){t.focus(e);return}this.updateComplete.then(()=>this._inputEl()?.focus(e))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName(`scb-list-item`)).some(e=>!e.hasAttribute(`hidden`)&&e.style.display!==`none`)}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(e){e.stopPropagation();let t=e.target;this.value=t.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();let n={value:this.value};this.dispatchEvent(new CustomEvent(`scb-search-input`,{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchinput`,{detail:n,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(e){e.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??``,this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??``)&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}_handleKey(e){if(this.disabled||!this._inputEl())return;let t=this._getVisibleItems(),n=(this.value??``).trim().length>0,r=this._inputFocused&&n&&t.length>0,i=e.key,a=e.keyCode,o=i===`ArrowDown`||i===`Down`||a===40,s=i===`ArrowUp`||i===`Up`||a===38,c=i===`Home`||a===36,l=i===`End`||a===35,u=i===`Enter`||a===13,d=i===`Escape`||i===`Esc`||a===27;if(o){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(t,1);return}if(s){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(t,-1);return}if(c){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=t.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(l){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=t.length?t.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(u){if(!r){let t=this._internals?.form??this._form??this.closest(`form`);t?(e.preventDefault(),this.reportValidity()&&t.requestSubmit()):this.submit();return}e.preventDefault();let t=this._getActiveItem();if(t){let e=t.getAttribute(`label`)||``;this.value=e,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(t)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(d){e.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value=``,this._activeIndex=-1,this._kbMode=!1;let e=this._inputEl();e&&(e.value=``,e.focus()),this._filterSuggestions(``),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent(`scb-search-clear`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchclear`,{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(e){let t=(e??``).trim().toLowerCase(),n=Array.from(this.querySelectorAll(`scb-list-item`)),r=0;for(let e of n){let n=`${(e.getAttribute(`label`)||``).toLowerCase()} ${(e.getAttribute(`supporting-text`)||``).toLowerCase()}`.trim();t!==``&&n.includes(t)?(e.removeAttribute(`hidden`),r++):e.setAttribute(`hidden`,``),this._ensureOptionA11y(e)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector(`#searchInput`)??null}_listEl(){return this.renderRoot?.querySelector(`scb-list.suggestion-list`)??null}_ringEl(){return this.renderRoot?.querySelector(`#optionRing`)??null}_getVisibleItems(){return Array.from(this.querySelectorAll(`scb-list-item`)).filter(e=>!e.hasAttribute(`hidden`)&&e.style.display!==`none`)}_getActiveItem(){let e=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=e.length?null:e[this._activeIndex]??null}_moveActive(e,t){if(!e.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let n=this._activeIndex+t;this._activeIndex===-1?n=t>0?0:e.length-1:(n<0&&(n=0),n>=e.length&&(n=e.length-1)),this._activeIndex=n,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){let e=this._getActiveItem(),t=this._listEl();if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top?t.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(t.scrollTop+=r.bottom-n.bottom)}_itemPayload(e){return{label:e.getAttribute(`label`)||``,supportingText:e.getAttribute(`supporting-text`)||``,href:e.getAttribute(`href`)||``,type:e.getAttribute(`type`)||``,id:e.id||``}}_ensureListboxA11y(){let e=this._listEl();e&&(e.id||=this._listboxId,e.setAttribute(`role`,`listbox`),e.setAttribute(`aria-label`,this.suggestionsLabel)),Array.from(this.querySelectorAll(`scb-list-item`)).forEach(e=>this._ensureOptionA11y(e))}_ensureOptionA11y(e){e.id||=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`,e.setAttribute(`role`,`option`),e.setAttribute(`tabindex`,`-1`)}_updateComboboxA11y(){let e=this._inputEl();if(!e)return;let t=this._getVisibleItems(),n=(this.value??``).trim().length>0,r=this._inputFocused&&n&&t.length>0;e.setAttribute(`role`,`combobox`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-controls`,this._listboxId),e.setAttribute(`aria-expanded`,String(r));let i=r?this._getActiveItem():null;`ariaActiveDescendantElement`in Element.prototype?e.ariaActiveDescendantElement=i:i?.id?e.setAttribute(`aria-activedescendant`,i.id):e.removeAttribute(`aria-activedescendant`),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(e){let t=this._ringEl(),n=this._listEl();if(!t||!n)return;let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),a=i.top-r.top,o=i.left-r.left,s=i.width,c=i.height;t.style.top=`${a}px`,t.style.left=`${o}px`,t.style.width=`${s}px`,t.style.height=`${c}px`,t.setAttribute(`data-show`,`true`)}_hideOptionRing(){let e=this._ringEl();e&&e.removeAttribute(`data-show`)}_onWindowResize(){let e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e),this._positionSuggestionPopover()}_syncSuggestionPopover(){let e=this._listEl();if(!e||this.fullScreen){z(e);return}Sl(e)&&requestAnimationFrame(()=>this._positionSuggestionPopover())}_positionSuggestionPopover(){let e=this._listEl(),t=this._inputEl();if(!e||!t||!wl(e))return;let n=t.getBoundingClientRect(),r=Math.max(0,window.innerWidth-16),i=Math.min(n.width,r),a=Math.min(Math.max(n.left,8),window.innerWidth-8-i),o=e.getBoundingClientRect().height||e.scrollHeight,s=window.innerHeight-n.bottom-8,c=n.top-8,l=o>s&&c>s,u=Math.max(0,l?c:s);e.style.position=`fixed`,e.style.left=`${Math.round(a)}px`,e.style.width=`${Math.round(i)}px`,e.style.right=`auto`,e.style.maxHeight=`${Math.round(u)}px`,l?(e.style.top=`auto`,e.style.bottom=`${Math.round(window.innerHeight-n.top)}px`):(e.style.top=`${Math.round(n.bottom)}px`,e.style.bottom=`auto`)}_attachListScrollListener(){let e=this._listEl();!e||this._listWithHandler===e||(this._detachListScrollListener(),e.addEventListener(`scroll`,this._listScrollHandler,{passive:!0}),this._listWithHandler=e)}_detachListScrollListener(){this._listWithHandler&&=(this._listWithHandler.removeEventListener(`scroll`,this._listScrollHandler),void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){let e=this.value??``;e!==this._lastChangeValue&&(this._lastChangeValue=e,this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})))}_dispatchSubmit(e){this.dispatchEvent(new CustomEvent(`scb-search-submit`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchsubmit`,{detail:e,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-search-spacing-block-start`,t):this.style.removeProperty(`--scb-search-spacing-block-start`),n?this.style.setProperty(`--scb-search-spacing-block-end`,n):this.style.removeProperty(`--scb-search-spacing-block-end`),r?this.style.setProperty(`--scb-search-spacing-inline-start`,r):this.style.removeProperty(`--scb-search-spacing-inline-start`),i?this.style.setProperty(`--scb-search-spacing-inline-end`,i):this.style.removeProperty(`--scb-search-spacing-inline-end`)}_syncFormValue(){if(!this._internals)return;let e=this.disabled?null:this.value;this._internals.setFormValue(e)}},N([_({type:String,attribute:`trailing-icon`})],H.prototype,`trailingIcon`,void 0),N([_({type:String,attribute:`supporting-text`})],H.prototype,`supportingText`,void 0),N([_({type:String,attribute:`input-label`})],H.prototype,`inputLabel`,void 0),N([_({type:String,attribute:`clear-label`})],H.prototype,`clearLabel`,void 0),N([_({type:String,attribute:`suggestions-label`})],H.prototype,`suggestionsLabel`,void 0),N([_({type:String,attribute:`error-text`})],H.prototype,`errorText`,void 0),N([_({type:String})],H.prototype,`value`,void 0),N([_({type:String,reflect:!0})],H.prototype,`name`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`autocomplete`,void 0),N([_({type:String,reflect:!0})],H.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],H.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],H.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],H.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],H.prototype,`spacingRight`,void 0),N([_({type:String,reflect:!0})],H.prototype,`size`,void 0),N([_({type:Boolean,attribute:`full-screen`,reflect:!0})],H.prototype,`fullScreen`,void 0),N([v()],H.prototype,`_listDepsLoaded`,void 0),H=N([a(`scb-search`)],H)}));w(),b(),uc(),dl(),Mc(),Tu(),_c(),Ol(),cc(),P();var Eu={default:{size:`small`,variant:`centered`},"small-flexible":{size:`small`,variant:`start`},search:{size:`small`,variant:`search`},"medium-flexible":{size:`medium`,variant:`start`},"large-flexible":{size:`large`,variant:`start`}},Du={"action-padding-inline":{small:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`,medium:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`,large:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`},"action-padding-block":{small:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`,medium:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`,large:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`}},Ou=`data-scb-app-bar-managed-action-size`,ku=`data-scb-app-bar-managed-avatar-size`,Au=class extends C{constructor(...e){super(...e),this.title=``,this.appBarTitle=``,this.size=lc[`scb-app-bar`].size,this.variant=`centered`,this.type=``,this.position=`default`,this.ariaLabel=``,this.defaultAriaLabel=`Appfält`,this.searchAriaLabel=`Sökfält`,this.searchSupportingText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__titleResizeRaf=0}static{this.styles=[p`
|
|
6277
|
+
`}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??``).trim()?this.errorText||`Fyll i det här fältet.`:``}_syncValidity(){let e=this._inputEl(),t=this.disabled?``:this._getValidationMessage(),n=this.error,r=this._validationMessage;if(e&&e.setCustomValidity(t),this._internals)if(t){let n=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(n,t,e??void 0)}else this._internals.setValidity({});this._validationMessage=t,this.error=this.disabled?!1:t?this._hasValidationBeenReported||n:n&&!this._hasValidationBeenReported&&!r,e&&e.setAttribute(`aria-invalid`,this.error?`true`:`false`),this.toggleAttribute(`aria-invalid`,this.error),(n!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();let e=this._inputEl();return e?e.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??``),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){let e=this._getActiveItem(),t={value:this.value};e&&(t.active=this._itemPayload(e)),this._dispatchSubmit(t)}focus(e){let t=this._inputEl();if(t){t.focus(e);return}this.updateComplete.then(()=>this._inputEl()?.focus(e))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName(`scb-list-item`)).some(e=>!e.hasAttribute(`hidden`)&&e.style.display!==`none`)}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(e){e.stopPropagation();let t=e.target;this.value=t.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();let n={value:this.value};this.dispatchEvent(new CustomEvent(`scb-search-input`,{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchinput`,{detail:n,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(e){e.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??``,this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??``)&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}_handleKey(e){if(this.disabled||!this._inputEl())return;let t=this._getVisibleItems(),n=(this.value??``).trim().length>0,r=this._inputFocused&&n&&t.length>0,i=e.key,a=e.keyCode,o=i===`ArrowDown`||i===`Down`||a===40,s=i===`ArrowUp`||i===`Up`||a===38,c=i===`Home`||a===36,l=i===`End`||a===35,u=i===`Enter`||a===13,d=i===`Escape`||i===`Esc`||a===27;if(o){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(t,1);return}if(s){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(t,-1);return}if(c){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=t.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(l){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=t.length?t.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(u){if(!r){let t=this._internals?.form??this._form??this.closest(`form`);t?(e.preventDefault(),this.reportValidity()&&t.requestSubmit()):this.submit();return}e.preventDefault();let t=this._getActiveItem();if(t){let e=t.getAttribute(`label`)||``;this.value=e,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(t)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(d){e.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value=``,this._activeIndex=-1,this._kbMode=!1;let e=this._inputEl();e&&(e.value=``,e.focus()),this._filterSuggestions(``),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent(`scb-search-clear`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchclear`,{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(e){let t=(e??``).trim().toLowerCase(),n=Array.from(this.querySelectorAll(`scb-list-item`)),r=0;for(let e of n){let n=`${(e.getAttribute(`label`)||``).toLowerCase()} ${(e.getAttribute(`supporting-text`)||``).toLowerCase()}`.trim();t!==``&&n.includes(t)?(e.removeAttribute(`hidden`),r++):e.setAttribute(`hidden`,``),this._ensureOptionA11y(e)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector(`#searchInput`)??null}_listEl(){return this.renderRoot?.querySelector(`scb-list.suggestion-list`)??null}_ringEl(){return this.renderRoot?.querySelector(`#optionRing`)??null}_getVisibleItems(){return Array.from(this.querySelectorAll(`scb-list-item`)).filter(e=>!e.hasAttribute(`hidden`)&&e.style.display!==`none`)}_getActiveItem(){let e=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=e.length?null:e[this._activeIndex]??null}_moveActive(e,t){if(!e.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let n=this._activeIndex+t;this._activeIndex===-1?n=t>0?0:e.length-1:(n<0&&(n=0),n>=e.length&&(n=e.length-1)),this._activeIndex=n,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){let e=this._getActiveItem(),t=this._listEl();if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top?t.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(t.scrollTop+=r.bottom-n.bottom)}_itemPayload(e){return{label:e.getAttribute(`label`)||``,supportingText:e.getAttribute(`supporting-text`)||``,href:e.getAttribute(`href`)||``,type:e.getAttribute(`type`)||``,id:e.id||``}}_ensureListboxA11y(){let e=this._listEl();e&&(e.id||=this._listboxId,e.setAttribute(`role`,`listbox`),e.setAttribute(`aria-label`,this.suggestionsLabel)),Array.from(this.querySelectorAll(`scb-list-item`)).forEach(e=>this._ensureOptionA11y(e))}_ensureOptionA11y(e){e.id||=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`,e.setAttribute(`role`,`option`),e.setAttribute(`tabindex`,`-1`)}_updateComboboxA11y(){let e=this._inputEl();if(!e)return;let t=this._getVisibleItems(),n=(this.value??``).trim().length>0,r=this._inputFocused&&n&&t.length>0;e.setAttribute(`role`,`combobox`),e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-controls`,this._listboxId),e.setAttribute(`aria-expanded`,String(r));let i=r?this._getActiveItem():null;`ariaActiveDescendantElement`in Element.prototype?e.ariaActiveDescendantElement=i:i?.id?e.setAttribute(`aria-activedescendant`,i.id):e.removeAttribute(`aria-activedescendant`),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(e){let t=this._ringEl(),n=this._listEl();if(!t||!n)return;let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),a=i.top-r.top,o=i.left-r.left,s=i.width,c=i.height;t.style.top=`${a}px`,t.style.left=`${o}px`,t.style.width=`${s}px`,t.style.height=`${c}px`,t.setAttribute(`data-show`,`true`)}_hideOptionRing(){let e=this._ringEl();e&&e.removeAttribute(`data-show`)}_onWindowResize(){let e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e),this._positionSuggestionPopover()}_syncSuggestionPopover(){let e=this._listEl();if(!e||this.fullScreen){z(e);return}Sl(e)&&requestAnimationFrame(()=>this._positionSuggestionPopover())}_positionSuggestionPopover(){let e=this._listEl(),t=this._inputEl();if(!e||!t||!wl(e))return;let n=t.getBoundingClientRect(),r=Math.max(0,window.innerWidth-16),i=Math.min(n.width,r),a=Math.min(Math.max(n.left,8),window.innerWidth-8-i),o=e.getBoundingClientRect().height||e.scrollHeight,s=window.innerHeight-n.bottom-8,c=n.top-8,l=o>s&&c>s,u=Math.max(0,l?c:s);e.style.position=`fixed`,e.style.left=`${Math.round(a)}px`,e.style.width=`${Math.round(i)}px`,e.style.right=`auto`,e.style.maxHeight=`${Math.round(u)}px`,l?(e.style.top=`auto`,e.style.bottom=`${Math.round(window.innerHeight-n.top)}px`):(e.style.top=`${Math.round(n.bottom)}px`,e.style.bottom=`auto`)}_attachListScrollListener(){let e=this._listEl();!e||this._listWithHandler===e||(this._detachListScrollListener(),e.addEventListener(`scroll`,this._listScrollHandler,{passive:!0}),this._listWithHandler=e)}_detachListScrollListener(){this._listWithHandler&&=(this._listWithHandler.removeEventListener(`scroll`,this._listScrollHandler),void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){let e=this.value??``;e!==this._lastChangeValue&&(this._lastChangeValue=e,this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})))}_dispatchSubmit(e){this.dispatchEvent(new CustomEvent(`scb-search-submit`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbsearchsubmit`,{detail:e,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-search-spacing-block-start`,t):this.style.removeProperty(`--scb-search-spacing-block-start`),n?this.style.setProperty(`--scb-search-spacing-block-end`,n):this.style.removeProperty(`--scb-search-spacing-block-end`),r?this.style.setProperty(`--scb-search-spacing-inline-start`,r):this.style.removeProperty(`--scb-search-spacing-inline-start`),i?this.style.setProperty(`--scb-search-spacing-inline-end`,i):this.style.removeProperty(`--scb-search-spacing-inline-end`)}_syncFormValue(){if(!this._internals)return;let e=this.disabled?null:this.value;this._internals.setFormValue(e)}},N([_({type:String,attribute:`trailing-icon`})],H.prototype,`trailingIcon`,void 0),N([_({type:String,attribute:`supporting-text`})],H.prototype,`supportingText`,void 0),N([_({type:String,attribute:`input-label`})],H.prototype,`inputLabel`,void 0),N([_({type:String,attribute:`clear-label`})],H.prototype,`clearLabel`,void 0),N([_({type:String,attribute:`suggestions-label`})],H.prototype,`suggestionsLabel`,void 0),N([_({type:String,attribute:`error-text`})],H.prototype,`errorText`,void 0),N([_({type:String})],H.prototype,`value`,void 0),N([_({type:String,reflect:!0})],H.prototype,`name`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],H.prototype,`autocomplete`,void 0),N([_({type:String,reflect:!0})],H.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],H.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],H.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],H.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],H.prototype,`spacingRight`,void 0),N([_({type:String,reflect:!0})],H.prototype,`size`,void 0),N([_({type:Boolean,attribute:`full-screen`,reflect:!0})],H.prototype,`fullScreen`,void 0),N([v()],H.prototype,`_listDepsLoaded`,void 0),H=N([a(`scb-search`)],H)}));w(),b(),uc(),dl(),Mc(),wu(),_c(),Ol(),cc(),P();var Tu={default:{size:`small`,variant:`centered`},"small-flexible":{size:`small`,variant:`start`},search:{size:`small`,variant:`search`},"medium-flexible":{size:`medium`,variant:`start`},"large-flexible":{size:`large`,variant:`start`}},Eu={"action-padding-inline":{small:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`,medium:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`,large:`var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px))`},"action-padding-block":{small:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`,medium:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`,large:`var(--scb-buttons-padding-block-small, var(--spacing-2, 4px))`}},Du=`data-scb-app-bar-managed-action-size`,Ou=`data-scb-app-bar-managed-avatar-size`,ku=class extends C{constructor(...e){super(...e),this.title=``,this.appBarTitle=``,this.size=lc[`scb-app-bar`].size,this.variant=`centered`,this.type=``,this.position=`default`,this.ariaLabel=``,this.defaultAriaLabel=`Appfält`,this.searchAriaLabel=`Sökfält`,this.searchSupportingText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__titleResizeRaf=0}static{this.styles=[p`
|
|
6272
6278
|
:host {
|
|
6273
6279
|
display: block;
|
|
6274
6280
|
font-family: var(--brand-font, Inter, Arial, sans-serif);
|
|
@@ -6523,7 +6529,7 @@
|
|
|
6523
6529
|
}
|
|
6524
6530
|
|
|
6525
6531
|
/* design:bindings:scb-app-bar:end */
|
|
6526
|
-
`]}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.__titleResizeObserver=new ResizeObserver(()=>this.#e()))}disconnectedCallback(){this.__titleResizeRaf&&=(cancelAnimationFrame(this.__titleResizeRaf),0),this.__titleResizeObserver?.disconnect(),this.__titleResizeObserver=void 0,z(this.renderRoot.querySelector(`header`)),super.disconnectedCallback()}handleActionsSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{this.#p(e)}),this.#e()}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{this.#m(e)}),this.#e()}firstUpdated(){this.#a(),this.#g(),this.#t()}updated(e){if((e.has(`title`)||e.has(`appBarTitle`))&&(this.dispatchEvent(new CustomEvent(`title-changed`,{detail:{title:this.#o},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`app-bar-title-changed`,{detail:{appBarTitle:this.#o},bubbles:!0,composed:!0}))),e.has(`position`)){let e=this.renderRoot.querySelector(`header`);this.position===`top`||this.position===`bottom`?Sl(e):z(e),this.dispatchEvent(new CustomEvent(`position-changed`,{detail:{position:this.position},bubbles:!0,composed:!0}))}e.has(`type`)&&this.dispatchEvent(new CustomEvent(`type-changed`,{detail:{type:this.type},bubbles:!0,composed:!0})),e.has(`size`)&&this.dispatchEvent(new CustomEvent(`size-changed`,{detail:{size:this.#l},bubbles:!0,composed:!0})),e.has(`variant`)&&this.dispatchEvent(new CustomEvent(`variant-changed`,{detail:{variant:this.#u},bubbles:!0,composed:!0})),(e.has(`type`)||e.has(`size`)||e.has(`variant`))&&this.updateComplete.then(()=>{this.#t()}),e.has(`searchSupportingText`)&&this.dispatchEvent(new CustomEvent(`search-supporting-text-changed`,{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0})),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#a(),this.#g()}#e(){this.#u===`centered`&&(this.__titleResizeRaf||=requestAnimationFrame(()=>{this.__titleResizeRaf=0,this.#i()}))}#t(){this.__titleResizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(`header`);if(e&&e.style.removeProperty(`--scb-app-bar-title-max-width`),this.#u!==`centered`||!this.__titleResizeObserver)return;let t=this.shadowRoot?.querySelector(`header.variant-centered`);if(!t)return;let n=t.querySelector(`.leading`),r=t.querySelector(`.trailing`);!n||!r||(this.__titleResizeObserver.observe(t),this.__titleResizeObserver.observe(n),this.__titleResizeObserver.observe(r),this.#e())}#n(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?t:0}#r(e){let t=getComputedStyle(e);return this.#n(t.columnGap||t.gap)}#i(){let e=this.shadowRoot?.querySelector(`header.variant-centered`);if(!e)return;let t=e.querySelector(`.leading`),n=e.querySelector(`.trailing`);if(!t||!n)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=getComputedStyle(e),s=this.#n(o.paddingInlineStart||o.paddingLeft),c=this.#n(o.paddingInlineEnd||o.paddingRight),l=Math.max(0,r.width-s-c),u=Math.max(i.width,a.width),d=Math.max(this.#r(t),this.#r(n)),f=Math.max(0,l-u*2-d*2);e.style.setProperty(`--scb-app-bar-title-max-width`,`${f}px`)}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#a(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-app-bar-spacing-block-start`,t):this.style.removeProperty(`--scb-app-bar-spacing-block-start`),n?this.style.setProperty(`--scb-app-bar-spacing-block-end`,n):this.style.removeProperty(`--scb-app-bar-spacing-block-end`),r?this.style.setProperty(`--scb-app-bar-spacing-inline-start`,r):this.style.removeProperty(`--scb-app-bar-spacing-inline-start`),i?this.style.setProperty(`--scb-app-bar-spacing-inline-end`,i):this.style.removeProperty(`--scb-app-bar-spacing-inline-end`)}get#o(){return this.appBarTitle||this.title}get#s(){return this.ariaLabel.trim()||(this.#u===`search`?this.searchAriaLabel:this.defaultAriaLabel)}get#c(){return this.type?
|
|
6532
|
+
`]}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.__titleResizeObserver=new ResizeObserver(()=>this.#e()))}disconnectedCallback(){this.__titleResizeRaf&&=(cancelAnimationFrame(this.__titleResizeRaf),0),this.__titleResizeObserver?.disconnect(),this.__titleResizeObserver=void 0,z(this.renderRoot.querySelector(`header`)),super.disconnectedCallback()}handleActionsSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{this.#p(e)}),this.#e()}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(e=>{this.#m(e)}),this.#e()}firstUpdated(){this.#a(),this.#g(),this.#t()}updated(e){if((e.has(`title`)||e.has(`appBarTitle`))&&(this.dispatchEvent(new CustomEvent(`title-changed`,{detail:{title:this.#o},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`app-bar-title-changed`,{detail:{appBarTitle:this.#o},bubbles:!0,composed:!0}))),e.has(`position`)){let e=this.renderRoot.querySelector(`header`);this.position===`top`||this.position===`bottom`?Sl(e):z(e),this.dispatchEvent(new CustomEvent(`position-changed`,{detail:{position:this.position},bubbles:!0,composed:!0}))}e.has(`type`)&&this.dispatchEvent(new CustomEvent(`type-changed`,{detail:{type:this.type},bubbles:!0,composed:!0})),e.has(`size`)&&this.dispatchEvent(new CustomEvent(`size-changed`,{detail:{size:this.#l},bubbles:!0,composed:!0})),e.has(`variant`)&&this.dispatchEvent(new CustomEvent(`variant-changed`,{detail:{variant:this.#u},bubbles:!0,composed:!0})),(e.has(`type`)||e.has(`size`)||e.has(`variant`))&&this.updateComplete.then(()=>{this.#t()}),e.has(`searchSupportingText`)&&this.dispatchEvent(new CustomEvent(`search-supporting-text-changed`,{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0})),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#a(),this.#g()}#e(){this.#u===`centered`&&(this.__titleResizeRaf||=requestAnimationFrame(()=>{this.__titleResizeRaf=0,this.#i()}))}#t(){this.__titleResizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(`header`);if(e&&e.style.removeProperty(`--scb-app-bar-title-max-width`),this.#u!==`centered`||!this.__titleResizeObserver)return;let t=this.shadowRoot?.querySelector(`header.variant-centered`);if(!t)return;let n=t.querySelector(`.leading`),r=t.querySelector(`.trailing`);!n||!r||(this.__titleResizeObserver.observe(t),this.__titleResizeObserver.observe(n),this.__titleResizeObserver.observe(r),this.#e())}#n(e){if(!e)return 0;let t=parseFloat(e);return Number.isFinite(t)?t:0}#r(e){let t=getComputedStyle(e);return this.#n(t.columnGap||t.gap)}#i(){let e=this.shadowRoot?.querySelector(`header.variant-centered`);if(!e)return;let t=e.querySelector(`.leading`),n=e.querySelector(`.trailing`);if(!t||!n)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=getComputedStyle(e),s=this.#n(o.paddingInlineStart||o.paddingLeft),c=this.#n(o.paddingInlineEnd||o.paddingRight),l=Math.max(0,r.width-s-c),u=Math.max(i.width,a.width),d=Math.max(this.#r(t),this.#r(n)),f=Math.max(0,l-u*2-d*2);e.style.setProperty(`--scb-app-bar-title-max-width`,`${f}px`)}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#a(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-app-bar-spacing-block-start`,t):this.style.removeProperty(`--scb-app-bar-spacing-block-start`),n?this.style.setProperty(`--scb-app-bar-spacing-block-end`,n):this.style.removeProperty(`--scb-app-bar-spacing-block-end`),r?this.style.setProperty(`--scb-app-bar-spacing-inline-start`,r):this.style.removeProperty(`--scb-app-bar-spacing-inline-start`),i?this.style.setProperty(`--scb-app-bar-spacing-inline-end`,i):this.style.removeProperty(`--scb-app-bar-spacing-inline-end`)}get#o(){return this.appBarTitle||this.title}get#s(){return this.ariaLabel.trim()||(this.#u===`search`?this.searchAriaLabel:this.defaultAriaLabel)}get#c(){return this.type?Tu[this.type]:void 0}get#l(){return this.#c&&!this.hasAttribute(`size`)?this.#c.size:this.size===`medium`||this.size===`large`?this.size:`small`}get#u(){return this.#c&&!this.hasAttribute(`variant`)?this.#c.variant:this.variant===`start`||this.variant===`search`?this.variant:`centered`}get#d(){return this.position===`bottom`?`position-bottom`:this.position===`top`?`position-top`:``}#f(e){let t=this.#l,n=Eu[e]?.[t],r=`--scb-app-bar-design-${e}-${t}`;return n?`var(${r}, ${n})`:`var(${r})`}#p(e){if(!(e instanceof HTMLElement))return;let t=e.tagName;t!==`SCB-ICON-BUTTON`&&t!==`SCB-BUTTON`||(this.#h(e,Du,M(this,`--scb-app-bar-design-action-component-size-${this.#l}`,[`small`,`medium`,`large`],`medium`)),t===`SCB-BUTTON`&&(e.style.setProperty(`--scb-button-padding-inline`,this.#f(`action-padding-inline`)),e.style.setProperty(`--scb-button-icon-edge-space`,this.#f(`action-padding-inline`)),e.style.setProperty(`--scb-button-padding-block`,this.#f(`action-padding-block`))))}#m(e){!(e instanceof HTMLElement)||e.tagName!==`SCB-AVATAR`||this.#h(e,Ou,M(this,`--scb-app-bar-design-avatar-component-size-${this.#l}`,[`small`,`medium`,`large`,`extra-large`],`medium`))}#h(e,t,n){let r=e.getAttribute(t);if(r!==null&&e.getAttribute(`size`)!==r){e.removeAttribute(t);return}(!e.hasAttribute(`size`)||r!==null)&&(e.setAttribute(`size`,n),e.setAttribute(t,n))}#g(){this.renderRoot.querySelectorAll(`slot[name="leading"], slot[name="trailing"]`).forEach(e=>{e.assignedElements({flatten:!0}).forEach(e=>this.#p(e))}),this.renderRoot.querySelectorAll(`slot[name="avatar"]`).forEach(e=>{e.assignedElements({flatten:!0}).forEach(e=>this.#m(e))})}render(){let e=this.#u,t=this.#l,n=M(this,`--scb-app-bar-design-search-component-size-${t}`,[`extra-small`,`small`,`medium`,`large`],`small`);return x`
|
|
6527
6533
|
<header class=${`variant-${e} size-${t} ${this.#d}`} role="banner" aria-label=${this.#s}>
|
|
6528
6534
|
<div class="leading">
|
|
6529
6535
|
<slot name="leading" @slotchange=${this.handleActionsSlotChange}></slot>
|
|
@@ -6540,7 +6546,7 @@
|
|
|
6540
6546
|
<slot name="avatar" @slotchange=${this.handleAvatarSlotChange}></slot>
|
|
6541
6547
|
</div>
|
|
6542
6548
|
</header>
|
|
6543
|
-
`}};N([_({type:String,reflect:!0})],
|
|
6549
|
+
`}};N([_({type:String,reflect:!0})],ku.prototype,`title`,void 0),N([_({type:String,attribute:`app-bar-title`,reflect:!0})],ku.prototype,`appBarTitle`,void 0),N([_({type:String,reflect:!0})],ku.prototype,`size`,void 0),N([_({type:String,reflect:!0})],ku.prototype,`variant`,void 0),N([_({type:String})],ku.prototype,`type`,void 0),N([_({type:String,reflect:!0})],ku.prototype,`position`,void 0),N([_({type:String,attribute:`aria-label`,reflect:!0})],ku.prototype,`ariaLabel`,void 0),N([_({type:String,attribute:`default-aria-label`})],ku.prototype,`defaultAriaLabel`,void 0),N([_({type:String,attribute:`search-aria-label`})],ku.prototype,`searchAriaLabel`,void 0),N([_({type:String,attribute:`search-supporting-text`,reflect:!0})],ku.prototype,`searchSupportingText`,void 0),N([_({type:String,reflect:!0})],ku.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],ku.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],ku.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],ku.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],ku.prototype,`spacingRight`,void 0),ku=N([a(`scb-app-bar`)],ku),w(),b(),P();var Au=class extends C{constructor(...e){super(...e),this._slotClickHandler=e=>{let t=this.shadowRoot?.querySelector(`slot`),n=e.target;n&&n!==t&&n.dispatchEvent(new CustomEvent(`hide-badge`,{bubbles:!0,composed:!0}))},this.autoHide=!1,this.sizing=`fit-content`,this.position=`relative`,this.positionTop=0,this.positionRight=void 0,this.positionSide=`right`,this.positionLeft=void 0,this.value=``,this.label=``,this.hidden=!1,this.variant=`dot`,this._badgeVisible=!0,this._onHideBadge=()=>{this._badgeVisible=!1,this.requestUpdate()}}static{this.styles=p`
|
|
6544
6550
|
:host {
|
|
6545
6551
|
display: block;
|
|
6546
6552
|
position: relative;
|
|
@@ -6640,7 +6646,7 @@
|
|
|
6640
6646
|
aria-label=${l?S:c}
|
|
6641
6647
|
aria-hidden=${l?`true`:S}>${this.variant===`dot`?``:r}</div>
|
|
6642
6648
|
</div>
|
|
6643
|
-
`}};N([_({type:Boolean,reflect:!0,attribute:`auto-hide`})],
|
|
6649
|
+
`}};N([_({type:Boolean,reflect:!0,attribute:`auto-hide`})],Au.prototype,`autoHide`,void 0),N([_({type:String,reflect:!0})],Au.prototype,`sizing`,void 0),N([_({type:String,reflect:!0})],Au.prototype,`position`,void 0),N([_({type:String,attribute:`position-top`})],Au.prototype,`positionTop`,void 0),N([_({type:String,attribute:`position-right`})],Au.prototype,`positionRight`,void 0),N([_({type:String,reflect:!0,attribute:`position-side`})],Au.prototype,`positionSide`,void 0),N([_({type:String,attribute:`position-left`})],Au.prototype,`positionLeft`,void 0),N([_({type:String,reflect:!0})],Au.prototype,`value`,void 0),N([_({type:String,reflect:!0})],Au.prototype,`label`,void 0),N([_({type:Boolean,reflect:!0})],Au.prototype,`hidden`,void 0),N([_({type:String,reflect:!0})],Au.prototype,`variant`,void 0),Au=N([a(`scb-badge`)],Au),w(),b(),gl(),P();var ju=class extends C{constructor(...e){super(...e),this.label=``,this.isCurrent=!1,this.href=``}connectedCallback(){if(super.connectedCallback(),this.hasAttribute(`current`)&&!this.hasAttribute(`is-current`)&&(this.isCurrent=!0),!this.href){let e=this.getAttribute(`href`);e&&(this.href=e)}}static get styles(){return p`
|
|
6644
6650
|
:host {
|
|
6645
6651
|
--scb-breadcrumb-link-font-family: var(--scb-breadcrumb-link-text-font, var(--scb-typography-body-medium-font, var(--md-sys-typescale-body-medium-font)));
|
|
6646
6652
|
--scb-breadcrumb-link-font-size: var(--scb-breadcrumb-link-text-size, var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size, 16px)));
|
|
@@ -6697,7 +6703,7 @@
|
|
|
6697
6703
|
`}getLabelContent(){return this.label||x`<slot></slot>`}updated(e){e.has(`isCurrent`)&&(this.dispatchEvent(new CustomEvent(`current-changed`,{detail:{isCurrent:this.isCurrent},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`currentchanged`,{detail:{isCurrent:this.isCurrent,value:this.isCurrent},bubbles:!0,composed:!0})))}render(){let e=this.getLabelContent();switch(!0){case this.isCurrent:return x`<span class="breadcrumb-current">${e}</span>`;default:return x`
|
|
6698
6704
|
<scb-link href="${this.href||this.getAttribute(`href`)||``}">${e}</scb-link>
|
|
6699
6705
|
<span class="breadcrumb-separator">/</span>
|
|
6700
|
-
`}}};N([_({type:String})],
|
|
6706
|
+
`}}};N([_({type:String})],ju.prototype,`label`,void 0),N([_({type:Boolean,attribute:`is-current`,reflect:!0})],ju.prototype,`isCurrent`,void 0),N([_({type:String,attribute:`item-href`})],ju.prototype,`href`,void 0),ju=N([a(`scb-breadcrumb-item`)],ju),w(),b(),gl(),P();var Mu,Nu=()=>{customElements.get(`md-focus-ring`)||(Mu??=Promise.resolve().then(()=>(Vt(),zt)).then(()=>void 0))},Pu=class extends C{constructor(...e){super(...e),this.showAll=!1,this.currentIndex=void 0,this.showAllLabel=`Visa alla`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static get styles(){return p`
|
|
6701
6707
|
:host {
|
|
6702
6708
|
display: block;
|
|
6703
6709
|
box-sizing: border-box;
|
|
@@ -6863,7 +6869,7 @@
|
|
|
6863
6869
|
aria-label=${this.showAllLabel}
|
|
6864
6870
|
role="button"
|
|
6865
6871
|
tabindex="0"
|
|
6866
|
-
@focusin=${
|
|
6872
|
+
@focusin=${Nu}
|
|
6867
6873
|
@click=${this._onEllipsisClick}
|
|
6868
6874
|
@keydown=${e=>{(e.key===`Enter`||e.key===` `)&&this._onEllipsisClick()}}
|
|
6869
6875
|
>
|
|
@@ -6880,12 +6886,12 @@
|
|
|
6880
6886
|
</span>
|
|
6881
6887
|
`})}
|
|
6882
6888
|
</div>
|
|
6883
|
-
`}};N([_({type:Boolean,attribute:`show-all`,reflect:!0})],
|
|
6889
|
+
`}};N([_({type:Boolean,attribute:`show-all`,reflect:!0})],Pu.prototype,`showAll`,void 0),N([_({type:Number,attribute:`current-index`,reflect:!0})],Pu.prototype,`currentIndex`,void 0),N([_({type:String,attribute:`show-all-label`})],Pu.prototype,`showAllLabel`,void 0),N([_({type:String,reflect:!0})],Pu.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Pu.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Pu.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Pu.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Pu.prototype,`spacingRight`,void 0),Pu=N([a(`scb-breadcrumb`)],Pu),w(),b(),P();var Fu=class extends C{constructor(...e){super(...e),this.title=``,this.description=``,this.startDate=``,this.endDate=``,this.href=``}get date(){return this.startDate}set date(e){let t=(e??``)+``;t!==this.startDate&&(this.startDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],`date`]}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`date`&&(this.date=n??``)}static{this.styles=p`
|
|
6884
6890
|
:host {
|
|
6885
6891
|
display: block;
|
|
6886
6892
|
}
|
|
6887
6893
|
`}updated(e){super.updated?.(e),(e.has(`title`)||e.has(`description`)||e.has(`startDate`)||e.has(`endDate`)||e.has(`href`))&&this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}render(){return x`
|
|
6888
|
-
`}};N([_({type:String})],
|
|
6894
|
+
`}};N([_({type:String})],Fu.prototype,`title`,void 0),N([_({type:String})],Fu.prototype,`description`,void 0),N([_({type:String,attribute:`start-date`})],Fu.prototype,`startDate`,void 0),N([_({type:String,attribute:`end-date`})],Fu.prototype,`endDate`,void 0),N([_({type:String})],Fu.prototype,`href`,void 0),Fu=N([a(`scb-calendar-event`)],Fu);var Iu,Lu=t((()=>{w(),b(),P(),Iu=class extends C{constructor(...e){super(...e),this.variant=`thin`,this.direction=`horizontal`,this.inset=`none`,this.overlay=!1,this.anchor=`end`,this.spacing=void 0}static{this.styles=p`
|
|
6889
6895
|
:host {
|
|
6890
6896
|
--scb-divider-spacing-orth: 0;
|
|
6891
6897
|
|
|
@@ -6960,7 +6966,7 @@
|
|
|
6960
6966
|
}
|
|
6961
6967
|
|
|
6962
6968
|
/* design:bindings:scb-divider:end */
|
|
6963
|
-
`}firstUpdated(){this.#e()}updated(e){e.has(`spacing`)&&this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#e(){let e=this.mapSpacingToken(this.spacing);e?this.style.setProperty(`--scb-divider-spacing-orth`,e):this.style.removeProperty(`--scb-divider-spacing-orth`)}render(){return x``}},N([_({type:String,reflect:!0})],
|
|
6969
|
+
`}firstUpdated(){this.#e()}updated(e){e.has(`spacing`)&&this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#e(){let e=this.mapSpacingToken(this.spacing);e?this.style.setProperty(`--scb-divider-spacing-orth`,e):this.style.removeProperty(`--scb-divider-spacing-orth`)}render(){return x``}},N([_({type:String,reflect:!0})],Iu.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],Iu.prototype,`direction`,void 0),N([_({type:String,reflect:!0})],Iu.prototype,`inset`,void 0),N([_({type:Boolean,reflect:!0})],Iu.prototype,`overlay`,void 0),N([_({type:String,reflect:!0})],Iu.prototype,`anchor`,void 0),N([_({type:String,reflect:!0})],Iu.prototype,`spacing`,void 0),Iu=N([a(`scb-divider`)],Iu)}));w(),b(),dl(),Mc(),D(),E(),Lu(),j(),Ol(),cc(),P();var Ru=class extends C{constructor(...e){super(...e),this._currentDate=new Date,this._selectedDate=null,this._showMonthDropdown=!1,this._showYearDropdown=!1,this.variant=`date`,this.lang=`sv`,this.selectedValue=``,this.open=!0,this._selectedHour=0,this._selectedMinute=0,this._viewportMargin=8,this._popupOffset=4,this._onWindowReposition=()=>{this._positionPopupWithinViewport()},this._monthNames=[this.lang==`sv`?`Januari`:`January`,this.lang==`sv`?`Februari`:`February`,this.lang==`sv`?`Mars`:`March`,(this.lang,`April`),this.lang==`sv`?`Maj`:`May`,this.lang==`sv`?`Juni`:`June`,this.lang==`sv`?`Juli`:`July`,this.lang==`sv`?`Augusti`:`August`,(this.lang,`September`),this.lang==`sv`?`Oktober`:`October`,(this.lang,`November`),(this.lang,`December`)],this._onPopupKeydown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),!this._closeOpenDropdowns()&&this._close())},this._outsideClickHandler=e=>{this.open&&(e.composedPath().includes(this)||this._close())},this._prevMonth=()=>{let e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===0?this._currentDate=new Date(e-1,11,1):this._currentDate=new Date(e,t-1,1)},this._prevYear=()=>{let e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e-1,t,1)},this._nextMonth=()=>{let e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===11?this._currentDate=new Date(e+1,0,1):this._currentDate=new Date(e,t+1,1)},this._nextYear=()=>{let e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e+1,t,1)},this._onTimeChange=e=>{let[t,n]=e.target.value.split(`:`),r=parseInt(t,10),i=parseInt(n,10);this._selectedHour=isNaN(r)?0:Math.max(0,Math.min(23,r)),this._selectedMinute=isNaN(i)?0:Math.max(0,Math.min(59,i)),this._fireDateTimeChange()},this._close=()=>{this.open=!1,this.dispatchEvent(new CustomEvent(`datepicker-closed`,{bubbles:!0,composed:!0}))}}_isRenderedInsideDialog(){let e=this.getRootNode(),t=e instanceof ShadowRoot?e.host:null;return t instanceof HTMLElement&&t.closest(`scb-dialog`)?!0:!!this.closest(`scb-dialog`)}_usesInPlaceLayout(){let e=getComputedStyle(this).position;return e===`relative`||e===`static`}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=sc(this,this.renderRoot)}_positionPopupWithinViewport(){if(!this.open)return;let e=this.renderRoot.querySelector(`.datepicker-popup`);if(!e)return;if(this._usesInPlaceLayout()){z(e);return}let t=this.parentElement?.getBoundingClientRect();if(!t)return;let n=window.innerWidth,r=window.innerHeight,i=Math.max(220,n-this._viewportMargin*2);if(wl(e)){let a=Math.min(this.getBoundingClientRect().width||e.offsetWidth||380,i),o=e.offsetHeight||420,s=Math.min(Math.max(t.left,this._viewportMargin),n-this._viewportMargin-a),c=r-t.bottom-this._viewportMargin,l=t.top-this._viewportMargin,u=c<o+this._popupOffset&&l>c;this._isRenderedInsideDialog()?(this.style.setProperty(`--scb-datepicker-position`,`absolute`),this.style.setProperty(`--scb-datepicker-left`,`0px`),this.style.setProperty(`--scb-datepicker-top`,`${t.height+this._popupOffset}px`)):(this.style.setProperty(`--scb-datepicker-position`,`fixed`),this.style.setProperty(`--scb-datepicker-left`,`${s}px`),this.style.setProperty(`--scb-datepicker-top`,`${t.bottom+this._popupOffset}px`)),this.style.setProperty(`--scb-datepicker-computed-width`,`${a}px`),this.style.setProperty(`--scb-datepicker-transform`,`none`),this.style.setProperty(`--scb-datepicker-bottom`,`auto`),e.style.position=`fixed`,e.style.left=`${Math.round(s)}px`,e.style.width=`${Math.round(a)}px`,e.style.right=`auto`,e.style.bottom=`auto`,e.style.maxHeight=`${Math.max(0,(u?l:c)-this._popupOffset)}px`,e.style.top=u?`${Math.max(this._viewportMargin,t.top-o-this._popupOffset)}px`:`${t.bottom+this._popupOffset}px`;return}if(this._isRenderedInsideDialog()){let a=Math.min(e.offsetWidth||380,i),o=e.offsetHeight||420,s=Math.min(Math.max(t.left,this._viewportMargin),n-this._viewportMargin-a),c=r-t.bottom-this._viewportMargin,l=t.top-this._viewportMargin,u=c<o+this._popupOffset&&l>c;if(this.style.setProperty(`--scb-datepicker-position`,`absolute`),this.style.setProperty(`--scb-datepicker-computed-width`,`${a}px`),this.style.setProperty(`--scb-datepicker-left`,`${s-t.left}px`),this.style.setProperty(`--scb-datepicker-transform`,`none`),this.style.setProperty(`--scb-datepicker-bottom`,`auto`),u){let e=Math.max(this._viewportMargin,t.top-o-this._popupOffset)-t.top;this.style.setProperty(`--scb-datepicker-top`,`${e}px`),this.style.setProperty(`--scb-datepicker-max-height`,`${Math.max(0,l-this._popupOffset)}px`)}else this.style.setProperty(`--scb-datepicker-top`,`${t.height+this._popupOffset}px`),this.style.setProperty(`--scb-datepicker-max-height`,`${Math.max(0,c-this._popupOffset)}px`);return}let a=Math.min(e.offsetWidth||380,i),o=e.offsetHeight||420,s=Math.min(Math.max(t.left,this._viewportMargin),n-this._viewportMargin-a),c=r-t.bottom-this._viewportMargin,l=t.top-this._viewportMargin,u=c<o+this._popupOffset&&l>c;this.style.setProperty(`--scb-datepicker-position`,`fixed`),this.style.setProperty(`--scb-datepicker-computed-width`,`${a}px`),this.style.setProperty(`--scb-datepicker-left`,`${s}px`),this.style.setProperty(`--scb-datepicker-transform`,`none`),u?(this.style.setProperty(`--scb-datepicker-top`,`${Math.max(this._viewportMargin,t.top-o-this._popupOffset)}px`),this.style.setProperty(`--scb-datepicker-bottom`,`auto`),this.style.setProperty(`--scb-datepicker-max-height`,`${Math.max(0,l-this._popupOffset)}px`)):(this.style.setProperty(`--scb-datepicker-top`,`${t.bottom+this._popupOffset}px`),this.style.setProperty(`--scb-datepicker-bottom`,`auto`),this.style.setProperty(`--scb-datepicker-max-height`,`${Math.max(0,c-this._popupOffset)}px`))}static{this.styles=[p`
|
|
6964
6970
|
:host {
|
|
6965
6971
|
--scb-datepicker-z-index: var(--scb-layer-popover, 1100);
|
|
6966
6972
|
--scb-datepicker-viewport-margin: 8px;
|
|
@@ -7379,7 +7385,7 @@
|
|
|
7379
7385
|
`:``}
|
|
7380
7386
|
</div>
|
|
7381
7387
|
</div>
|
|
7382
|
-
`}_getMonthDays(e,t){let n=new Date(Date.UTC(e,t,1)),r=new Date(Date.UTC(e,t+1,0)),i=[],a=[],o=n.getUTCDay(),s=o===0?6:o-1;for(let e=0;e<s;e++)a.push(null);for(let n=1;n<=r.getUTCDate();n++){let r=new Date(Date.UTC(e,t,n));a.push(r),a.length===7&&(i.push(a),a=[])}if(a.length){for(;a.length<7;)a.push(null);i.push(a)}return i}_toggleMonthDropdown(){this._showMonthDropdown=!this._showMonthDropdown,this._showMonthDropdown&&(this._showYearDropdown=!1,setTimeout(()=>{this._centerOptionInContent(`#selected-month`)},0))}_toggleYearDropdown(){this._showYearDropdown=!this._showYearDropdown,this._showYearDropdown&&(this._showMonthDropdown=!1,setTimeout(()=>{this._centerOptionInContent(`#selected-year`)},0))}_centerOptionInContent(e){let t=this.renderRoot.querySelector(`.datepicker-content`),n=this.renderRoot.querySelector(e);if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();t.scrollTop+=i.top-r.top-(t.clientHeight-i.height)/2}_onMonthChangeCustom(e){let t=this._currentDate.getFullYear();this._currentDate=new Date(t,e,1),this._showMonthDropdown=!1}_onYearChangeCustom(e){let t=this._currentDate.getMonth();this._currentDate=new Date(e,t,1),this._showYearDropdown=!1}_isToday(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}_isSelected(e){return this._selectedDate&&e.getDate()===this._selectedDate.getDate()&&e.getMonth()===this._selectedDate.getMonth()&&e.getFullYear()===this._selectedDate.getFullYear()}_selectDate(e){if(this._selectedDate=e,this.variant===`datetime-local`){let t=new Date(e);t.setHours(this._selectedHour??0,this._selectedMinute??0,0,0),this._selectedHour=t.getHours(),this._selectedMinute=t.getMinutes();let n=e=>e.toString().padStart(2,`0`),r=`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`;this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:r},bubbles:!0,composed:!0}))}else{let t=e.toISOString().slice(0,10);this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:t},bubbles:!0,composed:!0}))}}_fireDateTimeChange(){if(this.variant===`datetime-local`&&this._selectedDate){let e=new Date(this._selectedDate);e.setHours(this._selectedHour??0,this._selectedMinute??0,0,0);let t=e=>e.toString().padStart(2,`0`),n=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}`;this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:n},bubbles:!0,composed:!0}))}}};N([v()],
|
|
7388
|
+
`}_getMonthDays(e,t){let n=new Date(Date.UTC(e,t,1)),r=new Date(Date.UTC(e,t+1,0)),i=[],a=[],o=n.getUTCDay(),s=o===0?6:o-1;for(let e=0;e<s;e++)a.push(null);for(let n=1;n<=r.getUTCDate();n++){let r=new Date(Date.UTC(e,t,n));a.push(r),a.length===7&&(i.push(a),a=[])}if(a.length){for(;a.length<7;)a.push(null);i.push(a)}return i}_toggleMonthDropdown(){this._showMonthDropdown=!this._showMonthDropdown,this._showMonthDropdown&&(this._showYearDropdown=!1,setTimeout(()=>{this._centerOptionInContent(`#selected-month`)},0))}_toggleYearDropdown(){this._showYearDropdown=!this._showYearDropdown,this._showYearDropdown&&(this._showMonthDropdown=!1,setTimeout(()=>{this._centerOptionInContent(`#selected-year`)},0))}_centerOptionInContent(e){let t=this.renderRoot.querySelector(`.datepicker-content`),n=this.renderRoot.querySelector(e);if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();t.scrollTop+=i.top-r.top-(t.clientHeight-i.height)/2}_onMonthChangeCustom(e){let t=this._currentDate.getFullYear();this._currentDate=new Date(t,e,1),this._showMonthDropdown=!1}_onYearChangeCustom(e){let t=this._currentDate.getMonth();this._currentDate=new Date(e,t,1),this._showYearDropdown=!1}_isToday(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}_isSelected(e){return this._selectedDate&&e.getDate()===this._selectedDate.getDate()&&e.getMonth()===this._selectedDate.getMonth()&&e.getFullYear()===this._selectedDate.getFullYear()}_selectDate(e){if(this._selectedDate=e,this.variant===`datetime-local`){let t=new Date(e);t.setHours(this._selectedHour??0,this._selectedMinute??0,0,0),this._selectedHour=t.getHours(),this._selectedMinute=t.getMinutes();let n=e=>e.toString().padStart(2,`0`),r=`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`;this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:r},bubbles:!0,composed:!0}))}else{let t=e.toISOString().slice(0,10);this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:t},bubbles:!0,composed:!0}))}}_fireDateTimeChange(){if(this.variant===`datetime-local`&&this._selectedDate){let e=new Date(this._selectedDate);e.setHours(this._selectedHour??0,this._selectedMinute??0,0,0);let t=e=>e.toString().padStart(2,`0`),n=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())} ${t(e.getHours())}:${t(e.getMinutes())}`;this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:n},bubbles:!0,composed:!0}))}}};N([v()],Ru.prototype,`_currentDate`,void 0),N([v()],Ru.prototype,`_selectedDate`,void 0),N([v()],Ru.prototype,`_showMonthDropdown`,void 0),N([v()],Ru.prototype,`_showYearDropdown`,void 0),N([_({type:String})],Ru.prototype,`variant`,void 0),N([_({type:String})],Ru.prototype,`lang`,void 0),N([_({type:String})],Ru.prototype,`selectedValue`,void 0),N([_({type:Boolean})],Ru.prototype,`open`,void 0),N([v()],Ru.prototype,`_selectedHour`,void 0),N([v()],Ru.prototype,`_selectedMinute`,void 0),Ru=N([a(`scb-datepicker`)],Ru),w(),b(),D(),E(),j(),dl(),Nl(),uc(),cc(),P();var U=class extends C{static{this.formAssociated=!0}constructor(){super(),this._internals=null,this._inputFocused=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key===`Tab`&&(ic(),this._kbShouldShowRing=!0,this._inputFocused&&this.#s())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this.#s()},this._hasRenderedOnce=!1,this._boundField=null,this._onFieldInput=()=>{let e=this._boundField;if(!e)return;let t=e;this.value=t instanceof HTMLInputElement&&t.type===`file`?t.files?.[0]?.name??``:t.value,this.#n(),this.#r(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0}))},this._onFieldChange=()=>{this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this._onFieldSelect=()=>{this.dispatchEvent(new Event(`select`,{bubbles:!0,composed:!0}))},this._onFieldFocus=()=>{this._inputFocused=!0,this.#s()},this._onFieldBlur=()=>{this._inputFocused=!1,this.#s()},this.type=`text`,this.lang=`sv`,this.label=``,this.supportingText=``,this.helpText=``,this.helpLabel=`Visa hjälptext`,this.clearLabel=`Rensa fält`,this.dateButtonLabel=`Välj datum`,this.errorText=``,this.leadingIcon=``,this.name=``,this.pattern=``,this.accept=``,this.multiple=!1,this.value=``,this.underLabel=``,this.error=!1,this.disabled=!1,this.required=!1,this.size=lc[`scb-textfield`].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._inputId=``,this._showDatepicker=!1,this._toggleDatepicker=()=>{this._showDatepicker=!this._showDatepicker},this._openDatepicker=()=>{this._showDatepicker=!0},this._onDatepickerClosed=()=>{this._showDatepicker=!1},this._onDateSelected=e=>{if(this.value=e.detail.value,this._showDatepicker=!1,this._internals){let e=this.disabled?null:this.value;this._internals.setFormValue(e)}this.#r(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0}))},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=[p`
|
|
7383
7389
|
/*
|
|
7384
7390
|
Designbrygga:
|
|
7385
7391
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -8211,7 +8217,7 @@
|
|
|
8211
8217
|
<md-focus-ring class="input-ring"></md-focus-ring>
|
|
8212
8218
|
</div>
|
|
8213
8219
|
</div>
|
|
8214
|
-
`}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,this.#n(),this.#i(),this.#e()}updated(e){super.updated(e),this.toggleAttribute(`aria-disabled`,this.disabled),e.has(`size`)&&this._syncDensityForSize(),e.has(`lang`)&&this._hasValidationBeenReported&&this.#r(!1),this._internals&&(e.has(`value`)||e.has(`disabled`)||e.has(`multiple`))&&this.#n(),e.has(`type`)&&(this.#i(),this._hasRenderedOnce&&this.#o()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e(),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest(`form`),this._form&&(this._form.addEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener(`reset`,this._formResetHandler,!0)),window.addEventListener(`keydown`,this._onGlobalKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0)),this.#a(),window.removeEventListener(`keydown`,this._onGlobalKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,this.#r(!0)}checkValidity(){return this.#r(!1)}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#r(!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||``}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type===`file`?this.shadowRoot?.querySelector(`input[type="file"]`)?.files??null:null}formResetCallback(){this.value=this._initialValue;let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type===`file`?``:this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,this.#n(),this.#r(!1)}_onClearClick(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value=``,this.value=``,this._internals){let e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(``),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-textfield-spacing-block-start`,t):this.style.removeProperty(`--scb-textfield-spacing-block-start`),n?this.style.setProperty(`--scb-textfield-spacing-block-end`,n):this.style.removeProperty(`--scb-textfield-spacing-block-end`),r?this.style.setProperty(`--scb-textfield-spacing-inline-start`,r):this.style.removeProperty(`--scb-textfield-spacing-inline-start`),i?this.style.setProperty(`--scb-textfield-spacing-inline-end`,i):this.style.removeProperty(`--scb-textfield-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}get _resolvedLang(){return String(this.lang??``).trim().toLowerCase().split(/[-_]/,1)[0]===`en`?`en`:`sv`}_localizedDefaultLabel(e,t,n){return this._resolvedLang===`en`&&e===t?n:e}_invalidInputMessage(){return this._resolvedLang===`en`?`Invalid input.`:`Ogiltig inmatning.`}_requiredMessage(){return this._resolvedLang===`en`?`Fill in this field.`:`Fyll i det här fältet.`}#n(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!==`file`){this._internals.setFormValue(this.value);return}let e=this.files;if(!e?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(e[0]);return}let t=new FormData,n=this.name.trim()||`file`;for(let r of Array.from(e))t.append(n,r);this._internals.setFormValue(t)}#r(e=!1){let t=this.shadowRoot?.querySelector(`.scb-textfield`);if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return!0;let n=this._invalidInputMessage(),r=``,i=`customError`;if(t.setCustomValidity(``),this.disabled)r=``;else if(this._customValidationMessage)r=this._customValidationMessage,i=`customError`,t.setCustomValidity(r);else if(this.required&&!t.value)r=this.errorText||this._requiredMessage(),i=`valueMissing`,t.setCustomValidity(r);else if(!t.validity.valid){let e=t.validity;i=[`badInput`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`].find(t=>e[t])??`customError`,r=this.errorText||t.validationMessage||n,this.errorText&&t.setCustomValidity(this.errorText)}let a=e?t.reportValidity():t.checkValidity(),o=a?``:this._customValidationMessage||this.errorText||r||t.validationMessage||n,s=this.error,c=this._validationMessage;return this._validationMessage=o,this.error=this.disabled?!1:o?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!c,this._internals&&(a?this._internals.setValidity({}):this._internals.setValidity({[i]:!0},o,t)),(s!==this.error||c!==this._validationMessage)&&this.requestUpdate(),a}#i(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&this._boundField!==e&&(this.#a(),this._boundField=e,this.type!==`time`&&e.addEventListener(`input`,this._onFieldInput),e.addEventListener(`change`,this._onFieldChange),e.addEventListener(`select`,this._onFieldSelect),e.addEventListener(`focus`,this._onFieldFocus),e.addEventListener(`blur`,this._onFieldBlur))}#a(){let e=this._boundField;e&&(e.removeEventListener(`input`,this._onFieldInput),e.removeEventListener(`change`,this._onFieldChange),e.removeEventListener(`select`,this._onFieldSelect),e.removeEventListener(`focus`,this._onFieldFocus),e.removeEventListener(`blur`,this._onFieldBlur),this._boundField=null)}#o(){this._showDatepicker=!1;let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=``,e.setCustomValidity(``)),this.value=``,this.error=!1,this._internals){let e=this.disabled?null:``;this._internals.setFormValue(e),this._internals.setValidity({})}}#s(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}};N([_({type:String,reflect:!0})],U.prototype,`type`,void 0),N([_({type:String})],U.prototype,`lang`,void 0),N([_({type:String})],U.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],U.prototype,`supportingText`,void 0),N([_({type:String,attribute:`help-text`})],U.prototype,`helpText`,void 0),N([_({type:String,attribute:`help-label`})],U.prototype,`helpLabel`,void 0),N([_({type:String,attribute:`clear-label`})],U.prototype,`clearLabel`,void 0),N([_({type:String,attribute:`date-button-label`})],U.prototype,`dateButtonLabel`,void 0),N([_({type:String,attribute:`error-text`})],U.prototype,`errorText`,void 0),N([_({type:String,attribute:`leading-icon`})],U.prototype,`leadingIcon`,void 0),N([_({type:String})],U.prototype,`name`,void 0),N([_({type:String})],U.prototype,`pattern`,void 0),N([_({type:String})],U.prototype,`accept`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`multiple`,void 0),N([_({type:String,attribute:`value`})],U.prototype,`value`,void 0),N([_({type:String})],U.prototype,`underLabel`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`required`,void 0),N([_({type:String,reflect:!0})],U.prototype,`size`,void 0),N([_({type:String,reflect:!0})],U.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],U.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],U.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],U.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],U.prototype,`spacingRight`,void 0),N([v()],U.prototype,`_showDatepicker`,void 0),U=N([a(`scb-textfield`)],U),Wc(),w(),b(),D(),P();var Bu=class extends C{static{this.formAssociated=!0}constructor(){super(),this.name=``,this.orientation=`vertical`,this.disabled=!1,this.required=!1,this.error=!1,this.deselectable=!1,this.ariaLabel=null,this.supportingText=``,this.errorText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value=``,this._internals=null,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._supportingTextId=`scb-radio-group-supporting-${Math.random().toString(36).slice(2,11)}`,this.#e=()=>Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-radio-button`),this.#t=()=>{let e=this.#e();if(!e.length)return;let t=null;for(let n of e){let e=n;this.name&&n.setAttribute(`name`,this.name),this.disabled?n.setAttribute(`disabled`,``):n.removeAttribute(`disabled`),this.orientation===`horizontal`?n.setAttribute(`orientation`,`horizontal`):n.removeAttribute(`orientation`),this.deselectable?n.setAttribute(`deselectable`,``):n.removeAttribute(`deselectable`);let r=e.value??n.getAttribute(`value`)??``,i=typeof e.checked==`boolean`?e.checked:n.hasAttribute(`checked`);if(this.value){let t=String(r)===this.value;t&&!i?e.checked=!0:!t&&i&&(e.checked=!1)}else i&&t===null&&(t=String(r))}!this.value&&t!==null&&(this.value=t)},this.#n=e=>{e.target!==this&&e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`)&&(e.stopImmediatePropagation(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})))},this.#r=e=>{if(e.target===this)return;let t=e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`);if(!t)return;e.stopImmediatePropagation();let n=t?.checked===!0,r=n?t?.value??t?.getAttribute?.(`value`)??e.target?.value??``:``;this.value=String(r??``);let i={value:String(r??``),checked:n,originalIsTrusted:e?.isTrusted===!0};this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scb-change`,{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbchange`,{detail:i,bubbles:!0,composed:!0}))},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
8220
|
+
`}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,this.#n(),this.#i(),this.#e()}updated(e){super.updated(e),this.toggleAttribute(`aria-disabled`,this.disabled),e.has(`size`)&&this._syncDensityForSize(),e.has(`lang`)&&this._hasValidationBeenReported&&this.#r(!1),this._internals&&(e.has(`value`)||e.has(`disabled`)||e.has(`multiple`))&&this.#n(),e.has(`type`)&&(this.#i(),this._hasRenderedOnce&&this.#o()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e(),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest(`form`),this._form&&(this._form.addEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener(`reset`,this._formResetHandler,!0)),window.addEventListener(`keydown`,this._onGlobalKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0)),this.#a(),window.removeEventListener(`keydown`,this._onGlobalKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,this.#r(!0)}checkValidity(){return this.#r(!1)}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#r(!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||``}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type===`file`?this.shadowRoot?.querySelector(`input[type="file"]`)?.files??null:null}formResetCallback(){this.value=this._initialValue;let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type===`file`?``:this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,this.#n(),this.#r(!1)}_onClearClick(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value=``,this.value=``,this._internals){let e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(``),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-textfield-spacing-block-start`,t):this.style.removeProperty(`--scb-textfield-spacing-block-start`),n?this.style.setProperty(`--scb-textfield-spacing-block-end`,n):this.style.removeProperty(`--scb-textfield-spacing-block-end`),r?this.style.setProperty(`--scb-textfield-spacing-inline-start`,r):this.style.removeProperty(`--scb-textfield-spacing-inline-start`),i?this.style.setProperty(`--scb-textfield-spacing-inline-end`,i):this.style.removeProperty(`--scb-textfield-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}get _resolvedLang(){return String(this.lang??``).trim().toLowerCase().split(/[-_]/,1)[0]===`en`?`en`:`sv`}_localizedDefaultLabel(e,t,n){return this._resolvedLang===`en`&&e===t?n:e}_invalidInputMessage(){return this._resolvedLang===`en`?`Invalid input.`:`Ogiltig inmatning.`}_requiredMessage(){return this._resolvedLang===`en`?`Fill in this field.`:`Fyll i det här fältet.`}#n(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!==`file`){this._internals.setFormValue(this.value);return}let e=this.files;if(!e?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(e[0]);return}let t=new FormData,n=this.name.trim()||`file`;for(let r of Array.from(e))t.append(n,r);this._internals.setFormValue(t)}#r(e=!1){let t=this.shadowRoot?.querySelector(`.scb-textfield`);if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return!0;let n=this._invalidInputMessage(),r=``,i=`customError`;if(t.setCustomValidity(``),this.disabled)r=``;else if(this._customValidationMessage)r=this._customValidationMessage,i=`customError`,t.setCustomValidity(r);else if(this.required&&!t.value)r=this.errorText||this._requiredMessage(),i=`valueMissing`,t.setCustomValidity(r);else if(!t.validity.valid){let e=t.validity;i=[`badInput`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`].find(t=>e[t])??`customError`,r=this.errorText||t.validationMessage||n,this.errorText&&t.setCustomValidity(this.errorText)}let a=e?t.reportValidity():t.checkValidity(),o=a?``:this._customValidationMessage||this.errorText||r||t.validationMessage||n,s=this.error,c=this._validationMessage;return this._validationMessage=o,this.error=this.disabled?!1:o?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!c,this._internals&&(a?this._internals.setValidity({}):this._internals.setValidity({[i]:!0},o,t)),(s!==this.error||c!==this._validationMessage)&&this.requestUpdate(),a}#i(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&this._boundField!==e&&(this.#a(),this._boundField=e,this.type!==`time`&&e.addEventListener(`input`,this._onFieldInput),e.addEventListener(`change`,this._onFieldChange),e.addEventListener(`select`,this._onFieldSelect),e.addEventListener(`focus`,this._onFieldFocus),e.addEventListener(`blur`,this._onFieldBlur))}#a(){let e=this._boundField;e&&(e.removeEventListener(`input`,this._onFieldInput),e.removeEventListener(`change`,this._onFieldChange),e.removeEventListener(`select`,this._onFieldSelect),e.removeEventListener(`focus`,this._onFieldFocus),e.removeEventListener(`blur`,this._onFieldBlur),this._boundField=null)}#o(){this._showDatepicker=!1;let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=``,e.setCustomValidity(``)),this.value=``,this.error=!1,this._internals){let e=this.disabled?null:``;this._internals.setFormValue(e),this._internals.setValidity({})}}#s(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}};N([_({type:String,reflect:!0})],U.prototype,`type`,void 0),N([_({type:String})],U.prototype,`lang`,void 0),N([_({type:String})],U.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],U.prototype,`supportingText`,void 0),N([_({type:String,attribute:`help-text`})],U.prototype,`helpText`,void 0),N([_({type:String,attribute:`help-label`})],U.prototype,`helpLabel`,void 0),N([_({type:String,attribute:`clear-label`})],U.prototype,`clearLabel`,void 0),N([_({type:String,attribute:`date-button-label`})],U.prototype,`dateButtonLabel`,void 0),N([_({type:String,attribute:`error-text`})],U.prototype,`errorText`,void 0),N([_({type:String,attribute:`leading-icon`})],U.prototype,`leadingIcon`,void 0),N([_({type:String})],U.prototype,`name`,void 0),N([_({type:String})],U.prototype,`pattern`,void 0),N([_({type:String})],U.prototype,`accept`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`multiple`,void 0),N([_({type:String,attribute:`value`})],U.prototype,`value`,void 0),N([_({type:String})],U.prototype,`underLabel`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],U.prototype,`required`,void 0),N([_({type:String,reflect:!0})],U.prototype,`size`,void 0),N([_({type:String,reflect:!0})],U.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],U.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],U.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],U.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],U.prototype,`spacingRight`,void 0),N([v()],U.prototype,`_showDatepicker`,void 0),U=N([a(`scb-textfield`)],U),Wc(),w(),b(),D(),P();var zu=class extends C{static{this.formAssociated=!0}constructor(){super(),this.name=``,this.orientation=`vertical`,this.disabled=!1,this.required=!1,this.error=!1,this.deselectable=!1,this.ariaLabel=null,this.supportingText=``,this.errorText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value=``,this._internals=null,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._supportingTextId=`scb-radio-group-supporting-${Math.random().toString(36).slice(2,11)}`,this.#e=()=>Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-radio-button`),this.#t=()=>{let e=this.#e();if(!e.length)return;let t=null;for(let n of e){let e=n;this.name&&n.setAttribute(`name`,this.name),this.disabled?n.setAttribute(`disabled`,``):n.removeAttribute(`disabled`),this.orientation===`horizontal`?n.setAttribute(`orientation`,`horizontal`):n.removeAttribute(`orientation`),this.deselectable?n.setAttribute(`deselectable`,``):n.removeAttribute(`deselectable`);let r=e.value??n.getAttribute(`value`)??``,i=typeof e.checked==`boolean`?e.checked:n.hasAttribute(`checked`);if(this.value){let t=String(r)===this.value;t&&!i?e.checked=!0:!t&&i&&(e.checked=!1)}else i&&t===null&&(t=String(r))}!this.value&&t!==null&&(this.value=t)},this.#n=e=>{e.target!==this&&e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`)&&(e.stopImmediatePropagation(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})))},this.#r=e=>{if(e.target===this)return;let t=e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`);if(!t)return;e.stopImmediatePropagation();let n=t?.checked===!0,r=n?t?.value??t?.getAttribute?.(`value`)??e.target?.value??``:``;this.value=String(r??``);let i={value:String(r??``),checked:n,originalIsTrusted:e?.isTrusted===!0};this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scb-change`,{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbchange`,{detail:i,bubbles:!0,composed:!0}))},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
8215
8221
|
:host {
|
|
8216
8222
|
display: block;
|
|
8217
8223
|
|
|
@@ -8317,7 +8323,7 @@
|
|
|
8317
8323
|
${this.error?x`<md-icon aria-hidden="true">error</md-icon>`:``}
|
|
8318
8324
|
</div>
|
|
8319
8325
|
`:``}
|
|
8320
|
-
`}firstUpdated(){this.addEventListener(`input`,this.#n),this.addEventListener(`change`,this.#r),this._initialValue=this.value,this._form=this.closest(`form`),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.error=!1,this._hasValidationBeenReported=!1,this.requestUpdate(),this.#t(),this.__syncFormValue(),this.#i()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener(`reset`,this._formResetHandler,!0),this._form.addEventListener(`submit`,this._formSubmitHandler,!0)),this.__syncFormValue(),this.#i()}disconnectedCallback(){this.removeEventListener(`input`,this.#n),this.removeEventListener(`change`,this.#r),this._form&&this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),super.disconnectedCallback()}willUpdate(e){(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#o(),(e.has(`name`)||e.has(`disabled`)||e.has(`orientation`)||e.has(`deselectable`)||e.has(`required`)||e.has(`value`))&&this.#t(),(e.has(`value`)||e.has(`disabled`)||e.has(`name`))&&this.__syncFormValue(),(e.has(`value`)||e.has(`disabled`)||e.has(`required`)||e.has(`errorText`))&&this.#i()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}checkValidity(){return this.#i(),this._internals?.checkValidity()??!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.#i(),this._internals?.reportValidity()??!this.error}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#i()}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1),this.#i()}#e;#t;#n;#r;#i(){let e=!this.disabled&&this.required&&!this.value.trim(),t=this.disabled?``:this._customValidationMessage||(e?this.errorText||`Välj ett alternativ.`:``),n=this.error,r=this._validationMessage;if(this._internals){let e=t?this._customValidationMessage?{customError:!0}:{valueMissing:!0}:{};this._internals.setValidity(e,t,this.shadowRoot?.querySelector(`.g`)??void 0)}this._validationMessage=t,this.error=this.disabled?!1:t?this._hasValidationBeenReported||n:n&&!this._hasValidationBeenReported&&!r,this.toggleAttribute(`aria-invalid`,this.error),(n!==this.error||r!==this._validationMessage)&&this.requestUpdate()}#a(){return this.error?this._validationMessage||this.errorText||`Ogiltigt val.`:this.supportingText}__syncFormValue(){if(!this._internals)return;let e=typeof this.name==`string`&&this.name.trim()!==``,t=typeof this.value==`string`&&this.value.trim()!==``,n=this.disabled||!e||!t?null:this.value;this._internals.setFormValue(n)}#o(){let e=this.#s(this.spacing),t=this.#s(this.spacingTop)??e,n=this.#s(this.spacingBottom)??e,r=this.#s(this.spacingLeft),i=this.#s(this.spacingRight);t?this.style.setProperty(`--scb-radio-group-spacing-block-start`,t):this.style.removeProperty(`--scb-radio-group-spacing-block-start`),n?this.style.setProperty(`--scb-radio-group-spacing-block-end`,n):this.style.removeProperty(`--scb-radio-group-spacing-block-end`),r?this.style.setProperty(`--scb-radio-group-spacing-inline-start`,r):this.style.removeProperty(`--scb-radio-group-spacing-inline-start`),i?this.style.setProperty(`--scb-radio-group-spacing-inline-end`,i):this.style.removeProperty(`--scb-radio-group-spacing-inline-end`)}#s(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String})],
|
|
8326
|
+
`}firstUpdated(){this.addEventListener(`input`,this.#n),this.addEventListener(`change`,this.#r),this._initialValue=this.value,this._form=this.closest(`form`),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.error=!1,this._hasValidationBeenReported=!1,this.requestUpdate(),this.#t(),this.__syncFormValue(),this.#i()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener(`reset`,this._formResetHandler,!0),this._form.addEventListener(`submit`,this._formSubmitHandler,!0)),this.__syncFormValue(),this.#i()}disconnectedCallback(){this.removeEventListener(`input`,this.#n),this.removeEventListener(`change`,this.#r),this._form&&this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),super.disconnectedCallback()}willUpdate(e){(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#o(),(e.has(`name`)||e.has(`disabled`)||e.has(`orientation`)||e.has(`deselectable`)||e.has(`required`)||e.has(`value`))&&this.#t(),(e.has(`value`)||e.has(`disabled`)||e.has(`name`))&&this.__syncFormValue(),(e.has(`value`)||e.has(`disabled`)||e.has(`required`)||e.has(`errorText`))&&this.#i()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}checkValidity(){return this.#i(),this._internals?.checkValidity()??!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.#i(),this._internals?.reportValidity()??!this.error}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#i()}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1),this.#i()}#e;#t;#n;#r;#i(){let e=!this.disabled&&this.required&&!this.value.trim(),t=this.disabled?``:this._customValidationMessage||(e?this.errorText||`Välj ett alternativ.`:``),n=this.error,r=this._validationMessage;if(this._internals){let e=t?this._customValidationMessage?{customError:!0}:{valueMissing:!0}:{};this._internals.setValidity(e,t,this.shadowRoot?.querySelector(`.g`)??void 0)}this._validationMessage=t,this.error=this.disabled?!1:t?this._hasValidationBeenReported||n:n&&!this._hasValidationBeenReported&&!r,this.toggleAttribute(`aria-invalid`,this.error),(n!==this.error||r!==this._validationMessage)&&this.requestUpdate()}#a(){return this.error?this._validationMessage||this.errorText||`Ogiltigt val.`:this.supportingText}__syncFormValue(){if(!this._internals)return;let e=typeof this.name==`string`&&this.name.trim()!==``,t=typeof this.value==`string`&&this.value.trim()!==``,n=this.disabled||!e||!t?null:this.value;this._internals.setFormValue(n)}#o(){let e=this.#s(this.spacing),t=this.#s(this.spacingTop)??e,n=this.#s(this.spacingBottom)??e,r=this.#s(this.spacingLeft),i=this.#s(this.spacingRight);t?this.style.setProperty(`--scb-radio-group-spacing-block-start`,t):this.style.removeProperty(`--scb-radio-group-spacing-block-start`),n?this.style.setProperty(`--scb-radio-group-spacing-block-end`,n):this.style.removeProperty(`--scb-radio-group-spacing-block-end`),r?this.style.setProperty(`--scb-radio-group-spacing-inline-start`,r):this.style.removeProperty(`--scb-radio-group-spacing-inline-start`),i?this.style.setProperty(`--scb-radio-group-spacing-inline-end`,i):this.style.removeProperty(`--scb-radio-group-spacing-inline-end`)}#s(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String})],zu.prototype,`name`,void 0),N([_({type:String,reflect:!0})],zu.prototype,`orientation`,void 0),N([_({type:Boolean,reflect:!0})],zu.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],zu.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],zu.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],zu.prototype,`deselectable`,void 0),N([_({type:String,attribute:`aria-label`})],zu.prototype,`ariaLabel`,void 0),N([_({type:String,attribute:`supporting-text`})],zu.prototype,`supportingText`,void 0),N([_({type:String,attribute:`error-text`})],zu.prototype,`errorText`,void 0),N([_({type:String,reflect:!0})],zu.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],zu.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],zu.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],zu.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],zu.prototype,`spacingRight`,void 0),N([_({type:String,reflect:!0})],zu.prototype,`value`,void 0),zu=N([a(`scb-radio-group`)],zu),w(),b(),P();var Bu=!1,Vu=0,Hu=e=>{e.metaKey||e.altKey||e.ctrlKey||(Bu=!0)},Uu=()=>{Bu=!1},Wu=()=>{Vu===0&&(window.addEventListener(`keydown`,Hu,!0),window.addEventListener(`pointerdown`,Uu,!0),window.addEventListener(`mousedown`,Uu,!0),window.addEventListener(`touchstart`,Uu,!0)),Vu+=1},Gu=()=>{Vu=Math.max(0,Vu-1),Vu===0&&(window.removeEventListener(`keydown`,Hu,!0),window.removeEventListener(`pointerdown`,Uu,!0),window.removeEventListener(`mousedown`,Uu,!0),window.removeEventListener(`touchstart`,Uu,!0))},Ku=class extends C{constructor(...e){super(...e),this.disabled=!1,this.checked=!1,this.name=``,this.value=``,this.deselectable=!1,this.label=``,this.supportingText=``,this.ariaLabel=``,this._radioId=``,this._showOuterFocusRing=!1,this.#n=()=>{this.disabled||this.label?.trim()&&Bu&&this.#e(!0)},this.#r=()=>{this.#e(!1)},this.#i=()=>{this.#e(!1)},this._onClick=e=>{if(this.disabled)return;e.preventDefault(),e.stopPropagation();let t=!this.deselectable||!this.checked;t!==this.checked&&(this.checked=t,this.#a(),this.checked&&this.dispatchEvent(new CustomEvent(`scb-radio-change`,{detail:{name:this.name,source:this},bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{detail:{checked:this.checked,value:this.checked?this.value:``},bubbles:!0,composed:!0})))},this._onRadioChange=e=>{e.detail.name===this.name&&e.detail.source!==this&&(this.checked=!1)}}#e(e){this._showOuterFocusRing!==e&&(this._showOuterFocusRing=e,this.requestUpdate())}#t(){let e=!!this.label?.trim();this.toggleAttribute(`data-has-label`,e),e||this.#e(!1)}#n;#r;#i;connectedCallback(){super.connectedCallback(),Wu(),this._radioId=this.id||`scb-radio-${Math.random().toString(36).substr(2,9)}`,this.#t(),this.addEventListener(`focusin`,this.#n),this.addEventListener(`focusout`,this.#r),this.addEventListener(`pointerdown`,this.#i,!0),document.addEventListener(`scb-radio-change`,this._onRadioChange)}disconnectedCallback(){super.disconnectedCallback(),Gu(),this.removeEventListener(`focusin`,this.#n),this.removeEventListener(`focusout`,this.#r),this.removeEventListener(`pointerdown`,this.#i,!0),document.removeEventListener(`scb-radio-change`,this._onRadioChange)}firstUpdated(){this.#a()}updated(e){super.updated(e),e.has(`disabled`)&&(this.toggleAttribute(`aria-disabled`,this.disabled),this.disabled&&this.#e(!1)),e.has(`label`)&&this.#t(),e.has(`checked`)&&this.#a()}#a(){let e=this.shadowRoot?.querySelector(`md-radio`);e&&(e.checked=this.checked,this.checked?e.setAttribute(`checked`,``):e.removeAttribute(`checked`))}static{this.styles=p`
|
|
8321
8327
|
/* layout med inline-grid */
|
|
8322
8328
|
:host {
|
|
8323
8329
|
/* Valtext: base text current. JSON-källa: src/tokens/source/typography.json. */
|
|
@@ -8487,7 +8493,7 @@
|
|
|
8487
8493
|
</div>`:S}
|
|
8488
8494
|
</label>
|
|
8489
8495
|
<slot></slot>
|
|
8490
|
-
`}};N([_({type:Boolean,reflect:!0})],
|
|
8496
|
+
`}};N([_({type:Boolean,reflect:!0})],Ku.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],Ku.prototype,`checked`,void 0),N([_({type:String,reflect:!0})],Ku.prototype,`name`,void 0),N([_({type:String,reflect:!0})],Ku.prototype,`value`,void 0),N([_({type:Boolean,reflect:!0})],Ku.prototype,`deselectable`,void 0),N([_({type:String})],Ku.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],Ku.prototype,`supportingText`,void 0),N([_({type:String,attribute:`aria-label`})],Ku.prototype,`ariaLabel`,void 0),Ku=N([a(`scb-radio-button`)],Ku),w(),b(),Mc(),dl(),Kc(),yl(),D(),cc(),Ol(),P();var W,qu={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},Ju=new Set,Yu=``,Xu=``,G=class extends C{static{W=this}constructor(...e){super(...e),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant=`basic`,this.label=``,this.icon=``,this.supportingText=``,this.okButton=`OK`,this.cancelButton=`Avbryt`,this.deleteButton=`Delete`,this.confirmButton=`Ta bort`,this.denyButton=`Avbryt`,this.resetButton=`Återställ`,this.submitButton=`Spara`,this.closeLabel=`Stäng dialog`,this.formId=``,this.formAction=``,this.formMethod=``,this.formEnctype=``,this.__lastTriggerEl=null,this.__focusBeforeOpen=null,this.__stackInactive=!1,this.__submitting=!1,this.__redirectingFocus=!1,this.__scrollLocked=!1,this.__initialControlStates=new Map,this.__onDocumentClick=e=>{this.__getActionFromEvent(e)===`toggle`&&(this.__setOpen(!this.open),e.stopPropagation())},this.__onDocumentKeydown=e=>{if(!this.open||e.key!==`Escape`)return;let t=W.__getTopmostOpenDialog();t&&t!==this||this.__hasOpenNestedOverlay(e)||(e.preventDefault(),e.stopPropagation(),this.__fireCancelable(`esc`)&&this.__setOpen(!1))},this.__onDocumentFocusIn=e=>{this.__redirectingFocus||W.__getTopmostOpenDialog()!==this||e.composedPath().includes(this)||(this.__redirectingFocus=!0,queueMicrotask(()=>{this.__focusInitial(),this.__redirectingFocus=!1}))},this.__rememberInitialControlStates=()=>{for(let e of this.__getSlottedElements()){if(!(e instanceof HTMLElement)||this.__initialControlStates.has(e))continue;let t={},n=e;`value`in n&&(t.value=n.value),`checked`in n&&(t.checked=n.checked),`selected`in n&&(t.selected=n.selected),Object.keys(t).length>0&&this.__initialControlStates.set(e,t)}},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire(`scrim`),this.__setOpen(!1))},this.__onOk=()=>{this.__fire(`ok`),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire(`cancel`),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire(`confirm`),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire(`deny`),this.__setOpen(!1)},this.__onReset=()=>{let e=this.shadowRoot?.querySelector(`form`);e instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(e),e.reset()),this.__rememberInitialControlStates();for(let[e,t]of this.__initialControlStates){if(!e.isConnected)continue;if(e instanceof HTMLInputElement){e.type===`file`?e.value=``:e.value=e.defaultValue,e.checked=e.defaultChecked;continue}if(e instanceof HTMLTextAreaElement){e.value=e.defaultValue;continue}if(e instanceof HTMLSelectElement){for(let t of Array.from(e.options))t.selected=t.defaultSelected;continue}let n=e;n.formResetCallback?.(),`value`in t&&(n.value=t.value),`checked`in t&&(n.checked=t.checked),`selected`in t&&(n.selected=t.selected),n.requestUpdate?.()}this.__fire(`reset`)},this.__onSubmit=()=>{if(this.__submitting)return;let e=this.shadowRoot?.querySelector(`form`);if(e instanceof HTMLFormElement){if(!this.__validateFormAndSlottedFields(e))return;e.requestSubmit()}},this.__onFormSubmit=async e=>{let t=e.currentTarget;if(!(t instanceof HTMLFormElement)||(e.preventDefault(),e.stopPropagation(),this.__submitting)||!this.__validateFormAndSlottedFields(t))return;let n=this.__createFormData(t),r=this.__getFormMethod(),i=t.action;if(this.__fireCancelable(`submit`,{form:t,formData:n,method:r,action:i})){if(this.formAction.trim()&&(r===`PUT`||r===`DELETE`)){let e=new AbortController;this.__submitAbortController=e,this.__submitting=!0,this.setAttribute(`aria-busy`,`true`);try{let a=await fetch(i,{method:r,body:n,credentials:`same-origin`,signal:e.signal}),o={form:t,formData:n,method:r,action:i,response:a,status:a.status};if(!a.ok){this.__fire(`submit-error`,o);return}this.__fire(`submit-success`,o),this.open&&this.__setOpen(!1)}catch(e){e instanceof DOMException&&e.name===`AbortError`&&!this.isConnected||this.__fire(`submit-error`,{form:t,formData:n,method:r,action:i,error:e})}finally{this.__submitAbortController===e&&(this.__submitAbortController=void 0,this.__submitting=!1,this.removeAttribute(`aria-busy`))}return}if(this.formAction.trim()){let e=e=>{this.__appendSlottedFiles(t,e.formData)},r=t.getAttribute(`enctype`);Array.from(n.values()).some(e=>e instanceof File)&&!this.formEnctype.trim()&&(t.enctype=`multipart/form-data`),t.addEventListener(`formdata`,e,{once:!0});try{this.__setOpen(!1),HTMLFormElement.prototype.submit.call(t)}finally{t.removeEventListener(`formdata`,e),r===null?t.removeAttribute(`enctype`):t.setAttribute(`enctype`,r)}return}this.__setOpen(!1)}},this.__onKeydownTrap=e=>{if(!this.open||e.key!==`Tab`||W.__getTopmostOpenDialog()&&W.__getTopmostOpenDialog()!==this)return;let t=this.__collectFocusableElements();if(!t.length)return;let n=t[0],r=t[t.length-1],i=this.__currentFocusableFromEvent(e,t);!i||!t.includes(i)?((e.shiftKey?r:n).focus(),e.preventDefault()):e.shiftKey&&i===n?(r.focus(),e.preventDefault()):!e.shiftKey&&i===r&&(n.focus(),e.preventDefault())}}static{this.__openDialogs=[]}static{this.__backgroundInertSnapshot=new Map}static{this.__focusableSelector=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`scb-button:not([disabled])`,`scb-icon-button:not([disabled])`,`scb-textfield:not([disabled])`,`scb-checkbox:not([disabled])`,`scb-radio-button:not([disabled])`,`scb-switch:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`)}static{this.styles=p`
|
|
8491
8497
|
:host {
|
|
8492
8498
|
display:block;
|
|
8493
8499
|
position:relative;
|
|
@@ -8764,7 +8770,7 @@
|
|
|
8764
8770
|
}
|
|
8765
8771
|
|
|
8766
8772
|
/* design:bindings:scb-dialog:end */
|
|
8767
|
-
`}__getActionFromEvent(e){if(!this.id)return null;for(let t of e.composedPath())if(t instanceof Element&&(t.getAttribute(`data-dialog-toggle`)===this.id||t.getAttribute(`aria-controls`)===this.id))return this.__lastTriggerEl=t,`toggle`;return null}__hasOpenNestedOverlay(e){let t=`scb-options-menu, scb-dropdown, scb-select`;return e.composedPath().some(e=>e instanceof Element&&e!==this&&e.matches(t)&&!!e.open)?!0:Array.from(this.querySelectorAll(t)).some(e=>!!e.open)}__isModalOverlay(){return!this.inSb&&!this.__usesInPlaceLayout()}static __getTopmostOpenDialog(){return[...W.__openDialogs].reverse().find(e=>e.open&&e.isConnected&&e.__isModalOverlay())}static __restoreBackgroundInert(){for(let[e,t]of W.__backgroundInertSnapshot)e.inert=t;W.__backgroundInertSnapshot.clear()}static __setBackgroundInert(e){if(W.__restoreBackgroundInert(),!e)return;let t=e;for(;;){let e=t.parentNode;if(e instanceof Element||e instanceof ShadowRoot)for(let n of Array.from(e.children))n===t||!(n instanceof HTMLElement)||(W.__backgroundInertSnapshot.set(n,n.inert),n.inert=!0);if(e instanceof ShadowRoot){t=e.host;continue}if(e instanceof Element){t=e;continue}break}}__getRequestedZIndex(){if(typeof this.zIndex==`number`&&Number.isFinite(this.zIndex))return Math.trunc(this.zIndex);let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--scb-layer-dialog-scrim`),10);return Number.isFinite(e)?e:1e3}__setStackLayer(e){this.style.setProperty(`--z-dialog-scrim`,String(e)),this.style.setProperty(`--z-dialog`,String(e+1))}__setStackInactive(e){this.__stackInactive!==e&&(this.__stackInactive=e,this.requestUpdate())}static __syncModalStack(){W.__openDialogs=W.__openDialogs.filter(e=>e.open&&e.isConnected&&e.__isModalOverlay());let e=W.__getTopmostOpenDialog(),t=W.__openDialogs.map(e=>e.__getRequestedZIndex()),n=t.length?Math.max(...t):1e3;W.__openDialogs.forEach((t,r)=>{t.__setStackInactive(t!==e),t.__setStackLayer(n+r*2)}),W.__setBackgroundInert(e)}__registerOpenDialog(){this.__isModalOverlay()&&(W.__openDialogs=W.__openDialogs.filter(e=>e!==this),W.__openDialogs.push(this),W.__syncModalStack())}__unregisterOpenDialog(){let e=[...W.__openDialogs].reverse().find(e=>e===this||e.open&&e.isConnected)===this;return W.__openDialogs=W.__openDialogs.filter(e=>e!==this),this.__setStackInactive(!1),W.__syncModalStack(),this.__applyZIndex(),e}__getDeepActiveElement(){let e=this.ownerDocument.activeElement;for(;e instanceof HTMLElement&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}__isInsideDialog(e){let t=e;for(;t;){if(t===this)return!0;t=t instanceof ShadowRoot?t.host:t.parentNode}return!1}__focusInitial(){if(!this.open||this.__stackInactive||W.__getTopmostOpenDialog()!==this)return;let e=this.__collectFocusableElements()[0];if(e){e.focus();return}this.shadowRoot?.querySelector(`.container`)?.focus()}__clearSavedFocus(){this.__lastTriggerEl=null,this.__focusBeforeOpen=null}async __restoreFocusAfterClose(){let e=this.__lastTriggerEl?.isConnected?this.__lastTriggerEl:this.__focusBeforeOpen?.isConnected?this.__focusBeforeOpen:null;this.__clearSavedFocus(),await Promise.resolve();let t=W.__getTopmostOpenDialog();if(t){await t.updateComplete,e&&t.__isInsideDialog(e)&&e.focus();let n=t.__getDeepActiveElement();(!n||!t.__isInsideDialog(n))&&t.__focusInitial();return}e?.focus()}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener(`click`,this.__onDocumentClick,!1),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),document.addEventListener(`focusin`,this.__onDocumentFocusIn,!0),this.addEventListener(`keydown`,this.__onKeydownTrap),this.open&&this.hasUpdated&&(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__toggleScrollLock(!0),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial()))}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),document.removeEventListener(`focusin`,this.__onDocumentFocusIn,!0),this.removeEventListener(`keydown`,this.__onKeydownTrap),this.__submitAbortController?.abort(),z(this.shadowRoot?.querySelector(`.layer`));let e=this.__unregisterOpenDialog();this.__toggleScrollLock(!1),e?this.__restoreFocusAfterClose():this.__clearSavedFocus(),super.disconnectedCallback()}__applyZIndex(){let e=typeof this.zIndex==`number`&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty(`--z-dialog-scrim`),this.style.removeProperty(`--z-dialog`);return}this.style.setProperty(`--z-dialog-scrim`,String(e)),this.style.setProperty(`--z-dialog`,String(e+1))}__applyMaxSize(){let e=(this.maxW??``).trim(),t=(this.maxH??``).trim();e?(this.style.setProperty(`--scb-dialog-max-w`,e),this.style.setProperty(`--scb-dialog-width`,`min(${e}, 90vw)`)):(this.style.removeProperty(`--scb-dialog-max-w`),this.style.removeProperty(`--scb-dialog-width`)),t?this.style.setProperty(`--scb-dialog-max-h`,t):this.style.removeProperty(`--scb-dialog-max-h`)}updated(e){if(e.has(`zIndex`)&&(this.open&&this.__isModalOverlay()?W.__syncModalStack():this.__applyZIndex()),(e.has(`maxW`)||e.has(`maxH`))&&this.__applyMaxSize(),e.has(`open`)){let t=e.get(`open`);this.__updateTriggersExpanded(),this.open&&!t?(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial())):!this.open&&t&&(this.__unregisterOpenDialog()?this.__restoreFocusAfterClose():this.__clearSavedFocus()),this.__toggleScrollLock(this.open)}if(e.has(`inSb`)&&this.open&&(this.__unregisterOpenDialog(),this.__registerOpenDialog(),this.__toggleScrollLock(!1),this.__toggleScrollLock(!0)),e.has(`open`)||e.has(`inSb`)){let e=this.shadowRoot?.querySelector(`.layer`);if(this.open&&this.__isModalOverlay())Sl(e);else if(this.open||Tl(this),!this.open&&wl(e)){let t=this.shadowRoot?.querySelector(`.container`);Cl(e,void 0,t??e??void 0)}else z(e)}(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute(`aria-controls`)&&e.setAttribute(`aria-expanded`,String(this.open))})}__usesInPlaceLayout(){let e=getComputedStyle(this);return e.getPropertyValue(`--scb-dialog-scrim-position`).trim()===`relative`||e.getPropertyValue(`--scb-dialog-container-position`).trim()===`absolute`}__toggleScrollLock(e){let t=document.documentElement,n=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;if(Yu.size===0){Xu=t.style.overflow,Zu=n.style.paddingRight;let e=window.innerWidth-t.clientWidth;if(t.style.overflow=`hidden`,e>0){let t=Number.parseFloat(getComputedStyle(n).paddingRight)||0;n.style.paddingRight=`${t+e}px`}}Yu.add(this),this.__scrollLocked=!0;return}this.__scrollLocked&&=(Yu.delete(this),Yu.size===0&&(t.style.overflow=Xu,n.style.paddingRight=Zu),!1)}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-dialog-spacing-block-start`,t):this.style.removeProperty(`--scb-dialog-spacing-block-start`),n?this.style.setProperty(`--scb-dialog-spacing-block-end`,n):this.style.removeProperty(`--scb-dialog-spacing-block-end`),r?this.style.setProperty(`--scb-dialog-spacing-inline-start`,r):this.style.removeProperty(`--scb-dialog-spacing-inline-start`),i?this.style.setProperty(`--scb-dialog-spacing-inline-end`,i):this.style.removeProperty(`--scb-dialog-spacing-inline-end`)}__setOpen(e){this.open=e,this.__fire(e?`open`:`close`)}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__fireCancelable(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}__getFormMethod(){let e=String(this.formMethod||`GET`).trim().toUpperCase();return e===`POST`||e===`PUT`||e===`DELETE`?e:`GET`}__getSlottedElements(){let e=this.shadowRoot?.querySelector(`slot`);if(!(e instanceof HTMLSlotElement))return[];let t=e.assignedElements({flatten:!0}),n=[];for(let e of t)n.push(e,...Array.from(e.querySelectorAll(`*`)));return n}__appendHiddenFormValue(e,t,n){let r=document.createElement(`input`);r.type=`hidden`,r.name=t,r.value=n,r.setAttribute(`data-scb-dialog-generated`,`true`),e.append(r)}__clearGeneratedFormValues(e){e.querySelectorAll(`input[data-scb-dialog-generated="true"]`).forEach(e=>e.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;let n=(t.getAttribute(`name`)??``).trim();if(n&&!(t.disabled===!0||t.hasAttribute(`disabled`))){if(t instanceof HTMLInputElement){if(t.form===e)return;let r=(t.type||``).toLowerCase();if(r===`file`)return;if(r===`checkbox`||r===`radio`){t.checked&&this.__appendHiddenFormValue(e,n,t.value||`on`);return}this.__appendHiddenFormValue(e,n,t.value??``);return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,n,t.value??``);return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(t=>{this.__appendHiddenFormValue(e,n,t.value)});return}this.__appendHiddenFormValue(e,n,t.value??``);return}switch(t.tagName){case`SCB-TEXTFIELD`:if(String(t.type??``).toLowerCase()===`file`)return;this.__appendHiddenFormValue(e,n,String(t.value??``));return;case`SCB-CHECKBOX`:t.checked&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-RADIO-BUTTON`:t.checked&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-SWITCH`:(t.selected||t.checked)&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-CHIP`:t.selected&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;default:`value`in t&&this.__appendHiddenFormValue(e,n,String(t.value??``))}}})}__appendSlottedFiles(e,t){for(let n of this.__getSlottedElements()){if(!(n instanceof HTMLElement))continue;let r=(n.getAttribute(`name`)??``).trim();if(!(!r||n.disabled===!0||n.hasAttribute(`disabled`))){if(n instanceof HTMLInputElement&&n.type===`file`){if(n.form===e)continue;for(let e of Array.from(n.files??[]))t.append(r,e);continue}if(n.tagName===`SCB-TEXTFIELD`&&String(n.type??``).toLowerCase()===`file`){let e=n.files;for(let n of Array.from(e??[]))t.append(r,n)}}}}__createFormData(e){this.__syncSlottedFormValues(e);let t=new FormData(e);return this.__appendSlottedFiles(e,t),t}__validateFormAndSlottedFields(e){let t=e=>e.disabled===!0||e.hasAttribute(`disabled`),n=e.reportValidity(),r=null,i=new Set;return this.__getSlottedElements().forEach(e=>{if(!(e instanceof HTMLElement)||i.has(e)||t(e))return;i.add(e);let a=e;if(e.tagName===`SCB-TEXTFIELD`&&a.error===!0){r||=e,n=!1;return}if(typeof a.reportValidity==`function`){let t=!!a.reportValidity();!t&&!r&&(r=e),n&&=t}}),!n&&r&&r.focus(),n}__isFocusableElement(e){if(!(e instanceof HTMLElement)||!e.matches(W.__focusableSelector)||e.disabled||e.getAttribute(`aria-hidden`)===`true`)return!1;let t=getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`}__collectAssignedFocusableElements(e){let t=[];return this.__isFocusableElement(e)&&t.push(e),t.push(...Array.from(e.querySelectorAll(W.__focusableSelector)).filter(e=>this.__isFocusableElement(e))),t}__collectFocusableElements(){let e=this.shadowRoot;if(!e)return[];let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))},i=e=>{if(e instanceof HTMLSlotElement){e.assignedElements({flatten:!0}).flatMap(e=>this.__collectAssignedFocusableElements(e)).forEach(r);return}e instanceof HTMLElement&&this.__isFocusableElement(e)&&r(e),e.childNodes.forEach(i)};return e.childNodes.forEach(i),t}__currentFocusableFromEvent(e,t){let n=e.composedPath();return t.find(e=>n.includes(e))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__slotIsEmpty(){let e=this.shadowRoot?.querySelector(`slot`);return!e||e.assignedElements({flatten:!0}).length===0}renderHeader(e){let t=this.variant===`form`||this.variant===`floating`||this.variant===`iframe`;return x`
|
|
8773
|
+
`}__getActionFromEvent(e){if(!this.id)return null;for(let t of e.composedPath())if(t instanceof Element&&(t.getAttribute(`data-dialog-toggle`)===this.id||t.getAttribute(`aria-controls`)===this.id))return this.__lastTriggerEl=t,`toggle`;return null}__hasOpenNestedOverlay(e){let t=`scb-options-menu, scb-dropdown, scb-select`;return e.composedPath().some(e=>e instanceof Element&&e!==this&&e.matches(t)&&!!e.open)?!0:Array.from(this.querySelectorAll(t)).some(e=>!!e.open)}__isModalOverlay(){return!this.inSb&&!this.__usesInPlaceLayout()}static __getTopmostOpenDialog(){return[...W.__openDialogs].reverse().find(e=>e.open&&e.isConnected&&e.__isModalOverlay())}static __restoreBackgroundInert(){for(let[e,t]of W.__backgroundInertSnapshot)e.inert=t;W.__backgroundInertSnapshot.clear()}static __setBackgroundInert(e){if(W.__restoreBackgroundInert(),!e)return;let t=e;for(;;){let e=t.parentNode;if(e instanceof Element||e instanceof ShadowRoot)for(let n of Array.from(e.children))n===t||!(n instanceof HTMLElement)||(W.__backgroundInertSnapshot.set(n,n.inert),n.inert=!0);if(e instanceof ShadowRoot){t=e.host;continue}if(e instanceof Element){t=e;continue}break}}__getRequestedZIndex(){if(typeof this.zIndex==`number`&&Number.isFinite(this.zIndex))return Math.trunc(this.zIndex);let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--scb-layer-dialog-scrim`),10);return Number.isFinite(e)?e:1e3}__setStackLayer(e){this.style.setProperty(`--z-dialog-scrim`,String(e)),this.style.setProperty(`--z-dialog`,String(e+1))}__setStackInactive(e){this.__stackInactive!==e&&(this.__stackInactive=e,this.requestUpdate())}static __syncModalStack(){W.__openDialogs=W.__openDialogs.filter(e=>e.open&&e.isConnected&&e.__isModalOverlay());let e=W.__getTopmostOpenDialog(),t=W.__openDialogs.map(e=>e.__getRequestedZIndex()),n=t.length?Math.max(...t):1e3;W.__openDialogs.forEach((t,r)=>{t.__setStackInactive(t!==e),t.__setStackLayer(n+r*2)}),W.__setBackgroundInert(e)}__registerOpenDialog(){this.__isModalOverlay()&&(W.__openDialogs=W.__openDialogs.filter(e=>e!==this),W.__openDialogs.push(this),W.__syncModalStack())}__unregisterOpenDialog(){let e=[...W.__openDialogs].reverse().find(e=>e===this||e.open&&e.isConnected)===this;return W.__openDialogs=W.__openDialogs.filter(e=>e!==this),this.__setStackInactive(!1),W.__syncModalStack(),this.__applyZIndex(),e}__getDeepActiveElement(){let e=this.ownerDocument.activeElement;for(;e instanceof HTMLElement&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}__isInsideDialog(e){let t=e;for(;t;){if(t===this)return!0;t=t instanceof ShadowRoot?t.host:t.parentNode}return!1}__focusInitial(){if(!this.open||this.__stackInactive||W.__getTopmostOpenDialog()!==this)return;let e=this.__collectFocusableElements()[0];if(e){e.focus();return}this.shadowRoot?.querySelector(`.container`)?.focus()}__clearSavedFocus(){this.__lastTriggerEl=null,this.__focusBeforeOpen=null}async __restoreFocusAfterClose(){let e=this.__lastTriggerEl?.isConnected?this.__lastTriggerEl:this.__focusBeforeOpen?.isConnected?this.__focusBeforeOpen:null;this.__clearSavedFocus(),await Promise.resolve();let t=W.__getTopmostOpenDialog();if(t){await t.updateComplete,e&&t.__isInsideDialog(e)&&e.focus();let n=t.__getDeepActiveElement();(!n||!t.__isInsideDialog(n))&&t.__focusInitial();return}e?.focus()}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener(`click`,this.__onDocumentClick,!1),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),document.addEventListener(`focusin`,this.__onDocumentFocusIn,!0),this.addEventListener(`keydown`,this.__onKeydownTrap),this.open&&this.hasUpdated&&(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__toggleScrollLock(!0),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial()))}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),document.removeEventListener(`focusin`,this.__onDocumentFocusIn,!0),this.removeEventListener(`keydown`,this.__onKeydownTrap),this.__submitAbortController?.abort(),z(this.shadowRoot?.querySelector(`.layer`));let e=this.__unregisterOpenDialog();this.__toggleScrollLock(!1),e?this.__restoreFocusAfterClose():this.__clearSavedFocus(),super.disconnectedCallback()}__applyZIndex(){let e=typeof this.zIndex==`number`&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty(`--z-dialog-scrim`),this.style.removeProperty(`--z-dialog`);return}this.style.setProperty(`--z-dialog-scrim`,String(e)),this.style.setProperty(`--z-dialog`,String(e+1))}__applyMaxSize(){let e=(this.maxW??``).trim(),t=(this.maxH??``).trim();e?(this.style.setProperty(`--scb-dialog-max-w`,e),this.style.setProperty(`--scb-dialog-width`,`min(${e}, 90vw)`)):(this.style.removeProperty(`--scb-dialog-max-w`),this.style.removeProperty(`--scb-dialog-width`)),t?this.style.setProperty(`--scb-dialog-max-h`,t):this.style.removeProperty(`--scb-dialog-max-h`)}updated(e){if(e.has(`zIndex`)&&(this.open&&this.__isModalOverlay()?W.__syncModalStack():this.__applyZIndex()),(e.has(`maxW`)||e.has(`maxH`))&&this.__applyMaxSize(),e.has(`open`)){let t=e.get(`open`);this.__updateTriggersExpanded(),this.open&&!t?(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial())):!this.open&&t&&(this.__unregisterOpenDialog()?this.__restoreFocusAfterClose():this.__clearSavedFocus()),this.__toggleScrollLock(this.open)}if(e.has(`inSb`)&&this.open&&(this.__unregisterOpenDialog(),this.__registerOpenDialog(),this.__toggleScrollLock(!1),this.__toggleScrollLock(!0)),e.has(`open`)||e.has(`inSb`)){let e=this.shadowRoot?.querySelector(`.layer`);if(this.open&&this.__isModalOverlay())Sl(e);else if(this.open||Tl(this),!this.open&&wl(e)){let t=this.shadowRoot?.querySelector(`.container`);Cl(e,void 0,t??e??void 0)}else z(e)}(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute(`aria-controls`)&&e.setAttribute(`aria-expanded`,String(this.open))})}__usesInPlaceLayout(){let e=getComputedStyle(this);return e.getPropertyValue(`--scb-dialog-scrim-position`).trim()===`relative`||e.getPropertyValue(`--scb-dialog-container-position`).trim()===`absolute`}__toggleScrollLock(e){let t=document.documentElement,n=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;if(Ju.size===0){Yu=t.style.overflow,Xu=n.style.paddingRight;let e=window.innerWidth-t.clientWidth;if(t.style.overflow=`hidden`,e>0){let t=Number.parseFloat(getComputedStyle(n).paddingRight)||0;n.style.paddingRight=`${t+e}px`}}Ju.add(this),this.__scrollLocked=!0;return}this.__scrollLocked&&=(Ju.delete(this),Ju.size===0&&(t.style.overflow=Yu,n.style.paddingRight=Xu),!1)}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-dialog-spacing-block-start`,t):this.style.removeProperty(`--scb-dialog-spacing-block-start`),n?this.style.setProperty(`--scb-dialog-spacing-block-end`,n):this.style.removeProperty(`--scb-dialog-spacing-block-end`),r?this.style.setProperty(`--scb-dialog-spacing-inline-start`,r):this.style.removeProperty(`--scb-dialog-spacing-inline-start`),i?this.style.setProperty(`--scb-dialog-spacing-inline-end`,i):this.style.removeProperty(`--scb-dialog-spacing-inline-end`)}__setOpen(e){this.open=e,this.__fire(e?`open`:`close`)}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__fireCancelable(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}__getFormMethod(){let e=String(this.formMethod||`GET`).trim().toUpperCase();return e===`POST`||e===`PUT`||e===`DELETE`?e:`GET`}__getSlottedElements(){let e=this.shadowRoot?.querySelector(`slot`);if(!(e instanceof HTMLSlotElement))return[];let t=e.assignedElements({flatten:!0}),n=[];for(let e of t)n.push(e,...Array.from(e.querySelectorAll(`*`)));return n}__appendHiddenFormValue(e,t,n){let r=document.createElement(`input`);r.type=`hidden`,r.name=t,r.value=n,r.setAttribute(`data-scb-dialog-generated`,`true`),e.append(r)}__clearGeneratedFormValues(e){e.querySelectorAll(`input[data-scb-dialog-generated="true"]`).forEach(e=>e.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;let n=(t.getAttribute(`name`)??``).trim();if(n&&!(t.disabled===!0||t.hasAttribute(`disabled`))){if(t instanceof HTMLInputElement){if(t.form===e)return;let r=(t.type||``).toLowerCase();if(r===`file`)return;if(r===`checkbox`||r===`radio`){t.checked&&this.__appendHiddenFormValue(e,n,t.value||`on`);return}this.__appendHiddenFormValue(e,n,t.value??``);return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,n,t.value??``);return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(t=>{this.__appendHiddenFormValue(e,n,t.value)});return}this.__appendHiddenFormValue(e,n,t.value??``);return}switch(t.tagName){case`SCB-TEXTFIELD`:if(String(t.type??``).toLowerCase()===`file`)return;this.__appendHiddenFormValue(e,n,String(t.value??``));return;case`SCB-CHECKBOX`:t.checked&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-RADIO-BUTTON`:t.checked&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-SWITCH`:(t.selected||t.checked)&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;case`SCB-CHIP`:t.selected&&this.__appendHiddenFormValue(e,n,String(t.value??t.getAttribute(`value`)??`on`));return;default:`value`in t&&this.__appendHiddenFormValue(e,n,String(t.value??``))}}})}__appendSlottedFiles(e,t){for(let n of this.__getSlottedElements()){if(!(n instanceof HTMLElement))continue;let r=(n.getAttribute(`name`)??``).trim();if(!(!r||n.disabled===!0||n.hasAttribute(`disabled`))){if(n instanceof HTMLInputElement&&n.type===`file`){if(n.form===e)continue;for(let e of Array.from(n.files??[]))t.append(r,e);continue}if(n.tagName===`SCB-TEXTFIELD`&&String(n.type??``).toLowerCase()===`file`){let e=n.files;for(let n of Array.from(e??[]))t.append(r,n)}}}}__createFormData(e){this.__syncSlottedFormValues(e);let t=new FormData(e);return this.__appendSlottedFiles(e,t),t}__validateFormAndSlottedFields(e){let t=e=>e.disabled===!0||e.hasAttribute(`disabled`),n=e.reportValidity(),r=null,i=new Set;return this.__getSlottedElements().forEach(e=>{if(!(e instanceof HTMLElement)||i.has(e)||t(e))return;i.add(e);let a=e;if(e.tagName===`SCB-TEXTFIELD`&&a.error===!0){r||=e,n=!1;return}if(typeof a.reportValidity==`function`){let t=!!a.reportValidity();!t&&!r&&(r=e),n&&=t}}),!n&&r&&r.focus(),n}__isFocusableElement(e){if(!(e instanceof HTMLElement)||!e.matches(W.__focusableSelector)||e.disabled||e.getAttribute(`aria-hidden`)===`true`)return!1;let t=getComputedStyle(e);return t.display!==`none`&&t.visibility!==`hidden`}__collectAssignedFocusableElements(e){let t=[];return this.__isFocusableElement(e)&&t.push(e),t.push(...Array.from(e.querySelectorAll(W.__focusableSelector)).filter(e=>this.__isFocusableElement(e))),t}__collectFocusableElements(){let e=this.shadowRoot;if(!e)return[];let t=[],n=new Set,r=e=>{n.has(e)||(n.add(e),t.push(e))},i=e=>{if(e instanceof HTMLSlotElement){e.assignedElements({flatten:!0}).flatMap(e=>this.__collectAssignedFocusableElements(e)).forEach(r);return}e instanceof HTMLElement&&this.__isFocusableElement(e)&&r(e),e.childNodes.forEach(i)};return e.childNodes.forEach(i),t}__currentFocusableFromEvent(e,t){let n=e.composedPath();return t.find(e=>n.includes(e))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__slotIsEmpty(){let e=this.shadowRoot?.querySelector(`slot`);return!e||e.assignedElements({flatten:!0}).length===0}renderHeader(e){let t=this.variant===`form`||this.variant===`floating`||this.variant===`iframe`;return x`
|
|
8768
8774
|
<div class="header">
|
|
8769
8775
|
<div class="title">
|
|
8770
8776
|
${this.icon?x`<md-icon class="dialog-icon">${this.icon}</md-icon>`:S}
|
|
@@ -8830,7 +8836,7 @@
|
|
|
8830
8836
|
${this.renderBody(e,t)}
|
|
8831
8837
|
</div>
|
|
8832
8838
|
</div>
|
|
8833
|
-
`}};N([_({type:Boolean,reflect:!0,converter:
|
|
8839
|
+
`}};N([_({type:Boolean,reflect:!0,converter:qu})],G.prototype,`open`,void 0),N([_({type:String,attribute:`max-w`,reflect:!0})],G.prototype,`maxW`,void 0),N([_({type:String,attribute:`max-h`,reflect:!0})],G.prototype,`maxH`,void 0),N([_({type:Number,attribute:`z-index`,reflect:!0})],G.prototype,`zIndex`,void 0),N([_({type:Boolean,attribute:!1})],G.prototype,`inSb`,void 0),N([_({type:Boolean,attribute:`scrim-close`,converter:qu})],G.prototype,`scrimClose`,void 0),N([_({type:String,reflect:!0})],G.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],G.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],G.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],G.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],G.prototype,`spacingRight`,void 0),N([_({type:String,reflect:!0})],G.prototype,`variant`,void 0),N([_({type:String})],G.prototype,`label`,void 0),N([_({type:String})],G.prototype,`icon`,void 0),N([_({type:String,attribute:`supporting-text`})],G.prototype,`supportingText`,void 0),N([_({type:String,attribute:`ok-button`})],G.prototype,`okButton`,void 0),N([_({type:String,attribute:`cancel-button`})],G.prototype,`cancelButton`,void 0),N([_({type:String,attribute:`delete-button`})],G.prototype,`deleteButton`,void 0),N([_({type:String,attribute:`confirm-button`})],G.prototype,`confirmButton`,void 0),N([_({type:String,attribute:`deny-button`})],G.prototype,`denyButton`,void 0),N([_({type:String,attribute:`reset-button`})],G.prototype,`resetButton`,void 0),N([_({type:String,attribute:`submit-button`})],G.prototype,`submitButton`,void 0),N([_({type:String,attribute:`close-label`})],G.prototype,`closeLabel`,void 0),N([_({type:String,attribute:`form-id`})],G.prototype,`formId`,void 0),N([_({type:String,attribute:`form-action`})],G.prototype,`formAction`,void 0),N([_({type:String,attribute:`form-method`})],G.prototype,`formMethod`,void 0),N([_({type:String,attribute:`form-enctype`})],G.prototype,`formEnctype`,void 0),G=W=N([a(`scb-dialog`)],G),w(),b(),dl(),rl(),j(),cc(),P();var Zu={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},Qu=class extends C{constructor(...e){super(...e),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=>{let t=Array.from(this.shadowRoot?.querySelectorAll(`.calendar-day[data-date]`)??[]),n=this.shadowRoot?.activeElement,r=n&&t.includes(n)?n:document.activeElement,i=t.indexOf(r);if(i===-1)return;let a;switch(e.key){case`ArrowRight`:a=t[i+1];break;case`ArrowLeft`:a=t[i-1];break;case`ArrowDown`:a=this.__dayOffsetFrom(r,7);break;case`ArrowUp`:a=this.__dayOffsetFrom(r,-7);break;case`Home`:a=Array.from(r.closest(`[role="row"]`)?.querySelectorAll(`.calendar-day[data-date]`)??[])[0];break;case`End`:{let e=Array.from(r.closest(`[role="row"]`)?.querySelectorAll(`.calendar-day[data-date]`)??[]);a=e[e.length-1];break}case`PageUp`:e.preventDefault(),this.__focusAdjacentMonth(r,-1);return;case`PageDown`:e.preventDefault(),this.__focusAdjacentMonth(r,1);return;default:return}a&&a!==r&&(e.preventDefault(),this.__focusCalendarDay(a))},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._rovingDate=``,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(e){let t=(e??``)+``;t!==this.selectedDate&&(this.selectedDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],`value`]}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`value`&&(this.value=n??``)}static{this.styles=p`
|
|
8834
8840
|
:host {
|
|
8835
8841
|
display: block;
|
|
8836
8842
|
margin-block-start: var(--scb-calendar-spacing-block-start, 0);
|
|
@@ -9081,7 +9087,7 @@
|
|
|
9081
9087
|
</scb-list>
|
|
9082
9088
|
</scb-dialog>
|
|
9083
9089
|
`:``}
|
|
9084
|
-
`}};N([_({type:String})]
|
|
9090
|
+
`}};N([_({type:String})],Qu.prototype,`lang`,void 0),N([_({type:Boolean,attribute:`disable-weekend`,reflect:!0,converter:Zu})],Qu.prototype,`disableWeekend`,void 0),N([_({type:Boolean,attribute:`public-holidays`,converter:Zu})],Qu.prototype,`publicHolidays`,void 0),N([_({type:Number,attribute:`display-year`,reflect:!0})],Qu.prototype,`displayYear`,void 0),N([_({type:Number,attribute:`display-month`,reflect:!0})],Qu.prototype,`displayMonth`,void 0),N([_({type:String,attribute:`selected-date`,reflect:!0})],Qu.prototype,`selectedDate`,void 0),N([_({attribute:!1})],Qu.prototype,`events`,void 0),N([_({type:String,attribute:`events-json`})],Qu.prototype,`eventsJson`,void 0),N([_({type:String,reflect:!0})],Qu.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Qu.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Qu.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Qu.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Qu.prototype,`spacingRight`,void 0),Qu=N([a(`scb-calendar`)],Qu),w(),b(),P();var $u=new Intl.DateTimeFormat(`sv-SE`,{month:`short`}),ed=new Intl.DateTimeFormat(`sv-SE`,{month:`short`,timeZone:`UTC`}),td={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},nd,rd;function id(){return nd??=Promise.resolve().then(()=>(j(),nc)),nd}function ad(){return rd??=Promise.resolve().then(()=>(Ec(),Sc)),rd}var K=class extends C{constructor(...e){super(...e),this.variant=`default`,this.date=null,this.direction=`horizontal`,this.title=``,this.calendarCardTitle=``,this.subtitle=``,this.supportingText=``,this.cardHref=``,this.cardHrefNav=``,this.showMedia=null,this.dateLabelPrefix=`Datum:`,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,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__onPointerInteraction=e=>{this.__ensureRipple(e)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,id().then(({ensureFocusRingReady:e})=>e()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__getSlottedText(e){return this.querySelector(`[slot="${e}"]`)?.textContent?.trim()??``}get __resolvedTitle(){return this.__getSlottedText(`heading`)||this.calendarCardTitle||this.title}get __resolvedSubtitle(){return this.__getSlottedText(`subtitle`)||this.subtitle}get __resolvedLabel(){return this.__resolvedTitle||this.__resolvedSubtitle||`Kalenderkort`}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing()}static{this.styles=p`
|
|
9085
9091
|
/*
|
|
9086
9092
|
Designbrygga:
|
|
9087
9093
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -9518,7 +9524,7 @@
|
|
|
9518
9524
|
}
|
|
9519
9525
|
|
|
9520
9526
|
/* design:bindings:scb-calendar-card:end */
|
|
9521
|
-
`}__ensureRipple(e){if(this.cardHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,
|
|
9527
|
+
`}__ensureRipple(e){if(this.cardHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,ad().then(({ensureRippleReady:e})=>e()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){let e=this.renderRoot.querySelector(`md-ripple`),t=this.renderRoot.querySelector(`.calendar-card`),n=this.__pendingRippleEvent,r=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;let{syncRippleToControl:i}=await ad();await i(e,t,n,r)}render(){let e=this.variant?`${this.variant.toLowerCase()}`:``,t=this.direction?`${this.direction.toLowerCase()}`:``,n=this.cardHref?`clickable`:``,r=this.__hasSlottedContent(`heading`),i=this.__hasSlottedContent(`subtitle`),a=this.__hasSlottedContent(`supporting-text`),o=this.calendarCardTitle||this.title,s=this.subtitle,c=this.supportingText,l=r||!!o,u=i||!!s,d=a||!!c,{day:f,month:p}=this.__getDateParts(),m=this.mediaWidth&&this.mediaWidth.trim()!==``?this.mediaWidth:``,h=this.mediaHeight&&this.mediaHeight.trim()!==``?this.mediaHeight:``,g=this.mediaAspect&&this.mediaAspect.trim()!==``?this.mediaAspect:``,ee=`${m?`inline-size:${m};`:``}${h?`block-size:${h};`:``}${g?`aspect-ratio:${g};`:``}`;return x`
|
|
9522
9528
|
<div
|
|
9523
9529
|
class="calendar-card ${t} ${n} ${e}"
|
|
9524
9530
|
role="${this.cardHref?`link`:`group`}"
|
|
@@ -9557,7 +9563,7 @@
|
|
|
9557
9563
|
</div>
|
|
9558
9564
|
</div>
|
|
9559
9565
|
${this.cardHref&&this.__focusRingLoaded?x`<md-focus-ring></md-focus-ring>`:``}
|
|
9560
|
-
`}__getDateParts(){let e={day:1,month:`Jan`};if(!this.date)return e;let t=typeof this.date==`string`?this.date.trim():this.date,n=t instanceof Date?t:new Date(t);if(Number.isNaN(n.getTime()))return e;let r=typeof t==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(t),i=r?n.getUTCDate():n.getDate(),a=(r?
|
|
9566
|
+
`}__getDateParts(){let e={day:1,month:`Jan`};if(!this.date)return e;let t=typeof this.date==`string`?this.date.trim():this.date,n=t instanceof Date?t:new Date(t);if(Number.isNaN(n.getTime()))return e;let r=typeof t==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(t),i=r?n.getUTCDate():n.getDate(),a=(r?ed:$u).format(n).replace(`.`,``).trim();return{day:i,month:a.charAt(0).toUpperCase()+a.slice(1)}}__applyInnerSizing(){let e=this.renderRoot.querySelector(`.calendar-card`);e&&(this.width&&this.width.trim()!==``?(e.style.inlineSize=`100%`,e.style.maxInlineSize=`100%`):(e.style.removeProperty(`inline-size`),e.style.removeProperty(`max-inline-size`)),this.height&&this.height.trim()!==``||this.sizing===`stretch`?e.style.blockSize=`100%`:e.style.removeProperty(`block-size`),this.maxHeight&&this.maxHeight.trim()!==``?e.style.maxBlockSize=`100%`:e.style.removeProperty(`max-block-size`))}_onKeyDown(e){(e.key===`Enter`||e.key===` `)&&this.cardHref&&(e.preventDefault(),this.__navigate())}_handleHrefNavigation(){this.cardHref&&((!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.__navigate())}__navigate(){this.cardHref&&(this.cardHrefNav===`tab`?window.open(this.cardHref,`_blank`):this.cardHrefNav===`window`?window.open(this.cardHref,`_blank`,`noopener,noreferrer,width=800,height=600`):window.open(this.cardHref,`_self`))}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-calendar-card-spacing-block-start`,t):this.style.removeProperty(`--scb-calendar-card-spacing-block-start`),n?this.style.setProperty(`--scb-calendar-card-spacing-block-end`,n):this.style.removeProperty(`--scb-calendar-card-spacing-block-end`),r?this.style.setProperty(`--scb-calendar-card-spacing-inline-start`,r):this.style.removeProperty(`--scb-calendar-card-spacing-inline-start`),i?this.style.setProperty(`--scb-calendar-card-spacing-inline-end`,i):this.style.removeProperty(`--scb-calendar-card-spacing-inline-end`)}updated(e){e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`minWidth`)&&(this.minWidth?this.style.minInlineSize=this.minWidth:this.style.removeProperty(`min-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),e.has(`minHeight`)&&(this.minHeight?this.style.minBlockSize=this.minHeight:this.style.removeProperty(`min-block-size`)),(e.has(`width`)||e.has(`height`)||e.has(`maxHeight`)||e.has(`sizing`))&&this.__applyInnerSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}};N([_({type:String,reflect:!0})],K.prototype,`variant`,void 0),N([_({type:String,attribute:`date`})],K.prototype,`date`,void 0),N([_({type:String,reflect:!0})],K.prototype,`direction`,void 0),N([_({type:String,reflect:!0,converter:td})],K.prototype,`title`,void 0),N([_({type:String,attribute:`calendar-card-title`,reflect:!0,converter:td})],K.prototype,`calendarCardTitle`,void 0),N([_({type:String,reflect:!0,converter:td})],K.prototype,`subtitle`,void 0),N([_({type:String,attribute:`supporting-text`,reflect:!0,converter:td})],K.prototype,`supportingText`,void 0),N([_({type:String,attribute:`card-href`})],K.prototype,`cardHref`,void 0),N([_({type:String,attribute:`card-href-nav`})],K.prototype,`cardHrefNav`,void 0),N([_({type:Boolean,reflect:!0,attribute:`show-media`})],K.prototype,`showMedia`,void 0),N([_({type:String,attribute:`date-label-prefix`})],K.prototype,`dateLabelPrefix`,void 0),N([_({type:String,attribute:`media-width`})],K.prototype,`mediaWidth`,void 0),N([_({type:String,attribute:`media-height`})],K.prototype,`mediaHeight`,void 0),N([_({type:String,attribute:`media-aspect`})],K.prototype,`mediaAspect`,void 0),N([_({type:String,reflect:!0})],K.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],K.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`min-width`})],K.prototype,`minWidth`,void 0),N([_({type:String,reflect:!0})],K.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`})],K.prototype,`maxHeight`,void 0),N([_({type:String,attribute:`min-height`})],K.prototype,`minHeight`,void 0),N([_({type:String,reflect:!0,converter:td})],K.prototype,`sizing`,void 0),N([_({type:String,reflect:!0})],K.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],K.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],K.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],K.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],K.prototype,`spacingRight`,void 0),K=N([a(`scb-calendar-card`)],K),w(),b(),Mc(),P();var od=class extends C{constructor(...e){super(...e),this._contentId=`scb-collapse-content-${Math.random().toString(36).substr(2,9)}`,this.variant=`elements`,this.collapsedHeight=40,this.visibleElements=1,this.expanded=!1,this.hideToggle=!1,this.toggleButtonVariant=`text`,this.toggleButtonSize=`medium`,this.togglePosition=`after`,this.toggleLayout=`block`,this._elementCount=0,this.expandButtonLabel=`Mer`,this.collapseButtonLabel=`Mindre`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.itemsGap=void 0,this._contentHeight=0,this.#r=0,this.#i=0,this.#o=0,this.#s=0}get _regionLabel(){return`${this.expanded?this.collapseButtonLabel:this.expandButtonLabel} – ${this._contentId}`}static{this.styles=p`
|
|
9561
9567
|
:host {
|
|
9562
9568
|
display: block;
|
|
9563
9569
|
box-sizing: border-box;
|
|
@@ -9716,7 +9722,7 @@
|
|
|
9716
9722
|
</div>
|
|
9717
9723
|
${this.togglePosition===`after`?n:``}
|
|
9718
9724
|
</div>
|
|
9719
|
-
`}}};N([_({type:String})],
|
|
9725
|
+
`}}};N([_({type:String})],od.prototype,`variant`,void 0),N([_({type:Number,attribute:`collapsed-height`,reflect:!0})],od.prototype,`collapsedHeight`,void 0),N([_({type:Number,attribute:`visible-elements`,reflect:!0})],od.prototype,`visibleElements`,void 0),N([_({type:Boolean,reflect:!0})],od.prototype,`expanded`,void 0),N([_({type:Boolean,attribute:`hide-toggle`,reflect:!0})],od.prototype,`hideToggle`,void 0),N([_({type:String,attribute:`toggle-button-variant`,reflect:!0})],od.prototype,`toggleButtonVariant`,void 0),N([_({type:String,attribute:`toggle-button-size`,reflect:!0})],od.prototype,`toggleButtonSize`,void 0),N([_({type:String,attribute:`toggle-position`,reflect:!0})],od.prototype,`togglePosition`,void 0),N([_({type:String,attribute:`toggle-layout`,reflect:!0})],od.prototype,`toggleLayout`,void 0),N([_({type:String,attribute:`expand-button-label`,reflect:!0})],od.prototype,`expandButtonLabel`,void 0),N([_({type:String,attribute:`collapse-button-label`,reflect:!0})],od.prototype,`collapseButtonLabel`,void 0),N([_({type:String,reflect:!0})],od.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],od.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],od.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],od.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],od.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`items-gap`,reflect:!0})],od.prototype,`itemsGap`,void 0),od=N([a(`scb-collapse`)],od),w(),b(),Ol(),cc(),P();var sd,cd=`data-scb-cookies-consent-managed-button-size`;function ld(){return!!document.querySelector(`script[src*="/scb-button/scb-button.js"],script[src$="scb-button.js"]`)}var ud={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},dd=class extends C{constructor(...e){super(...e),this.open=!0,this.autoRemove=!0,this.title=``,this.supportingText=``,this.ariaLabel=`Cookie-inställningar`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._updateButtonWidth=()=>{let e=window.innerWidth<=480,t=this.shadowRoot.querySelector(`slot[name="buttons"]`);t&&t.assignedElements().forEach(t=>{e?t.setAttribute(`full-width`,``):t.removeAttribute(`full-width`)})},this.__onButtonHydrationInteraction=e=>{let t=e.target;t instanceof Element&&t.closest(`scb-button[slot="buttons"]`)&&this.__ensureSlottedButtonsReady(!0)},this.__onButtonsSlotChange=()=>{this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth()}}static{this.styles=p`
|
|
9720
9726
|
:host {
|
|
9721
9727
|
position: var(--scb-cookies-consent-position, fixed);
|
|
9722
9728
|
width: var(--scb-cookies-consent-width, 100%);
|
|
@@ -9822,7 +9828,7 @@
|
|
|
9822
9828
|
}
|
|
9823
9829
|
|
|
9824
9830
|
/* design:bindings:scb-cookies-consent:end */
|
|
9825
|
-
`}__syncButtonSizes(){let e=M(this,`--scb-cookies-consent-design-actions-button-size-medium`,[`small`,`medium`,`large`],`medium`),t=Array.from(this.querySelectorAll(`:scope > scb-button[slot="buttons"]`));for(let n of t){let t=n.getAttribute(
|
|
9831
|
+
`}__syncButtonSizes(){let e=M(this,`--scb-cookies-consent-design-actions-button-size-medium`,[`small`,`medium`,`large`],`medium`),t=Array.from(this.querySelectorAll(`:scope > scb-button[slot="buttons"]`));for(let n of t){let t=n.getAttribute(cd);if(t!==null&&n.getAttribute(`size`)!==t){n.removeAttribute(cd);continue}(!n.hasAttribute(`size`)||t!==null)&&(n.setAttribute(`size`,e),n.setAttribute(cd,e))}}__ensureSlottedButtonsReady(e=!1){if(!(!this.querySelector(`scb-button[slot="buttons"]`)||customElements.get(`scb-button`))){if(ld()){customElements.whenDefined(`scb-button`).then(()=>this.requestUpdate());return}e&&(sd??=Promise.resolve().then(()=>(Mc(),Dc)),sd.then(()=>this.requestUpdate()))}}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-cookies-consent-spacing-block-start`,t):this.style.removeProperty(`--scb-cookies-consent-spacing-block-start`),n?this.style.setProperty(`--scb-cookies-consent-spacing-block-end`,n):this.style.removeProperty(`--scb-cookies-consent-spacing-block-end`),r?this.style.setProperty(`--scb-cookies-consent-spacing-inline-start`,r):this.style.removeProperty(`--scb-cookies-consent-spacing-inline-start`),i?this.style.setProperty(`--scb-cookies-consent-spacing-inline-end`,i):this.style.removeProperty(`--scb-cookies-consent-spacing-inline-end`)}firstUpdated(e){this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth(),window.addEventListener(`resize`,this._updateButtonWidth),this.addEventListener(`pointerover`,this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener(`focusin`,this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener(`pointerdown`,this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener(`keydown`,this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener(`click`,e=>{let t=e.target;t.slot===`buttons`&&(t.id===`accept-btn`?this.closeAndRemove(`cookies-accept`):t.id===`decline-btn`?this.closeAndRemove(`cookies-decline`):t.id===`handle-btn`&&this.closeAndRemove(`cookies-handle`))}),this.applySpacing(),this.__syncTopLayer()}__syncTopLayer(){this.open&&getComputedStyle(this).position===`fixed`?Sl(this):z(this)}updated(e){super.updated(e),this.__syncButtonSizes(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.applySpacing(),e.has(`open`)&&(this.__syncTopLayer(),e.get(`open`)!==void 0&&(this.open&&this._updateButtonWidth(),this.dispatchEvent(new CustomEvent(`openchange`,{bubbles:!0,composed:!0,detail:{open:this.open}}))))}connectedCallback(){super.connectedCallback(),this.id||=`cookie-consent`}disconnectedCallback(){z(this),super.disconnectedCallback(),window.removeEventListener(`resize`,this._updateButtonWidth),this.removeEventListener(`pointerover`,this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener(`focusin`,this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener(`pointerdown`,this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener(`keydown`,this.__onButtonHydrationInteraction,{capture:!0})}closeAndRemove(e){let t={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent(e,t));let n=e.includes(`-`)?e.replace(/-/g,``):``;n&&n!==e&&this.dispatchEvent(new CustomEvent(n,t)),this.autoRemove?this.remove():this.open=!1}render(){return this.open?x`
|
|
9826
9832
|
<div role="dialog" class="cookies-consent" aria-modal="true" aria-label=${this.ariaLabel}>
|
|
9827
9833
|
<h2><slot name="title">${this.title}</slot></h2>
|
|
9828
9834
|
<div class="supporting-text">
|
|
@@ -9832,7 +9838,7 @@
|
|
|
9832
9838
|
<slot name="buttons" @slotchange=${this.__onButtonsSlotChange}></slot>
|
|
9833
9839
|
</div>
|
|
9834
9840
|
</div>
|
|
9835
|
-
`:null}};N([_({type:Boolean,reflect:!0,converter:
|
|
9841
|
+
`:null}};N([_({type:Boolean,reflect:!0,converter:ud})],dd.prototype,`open`,void 0),N([_({type:Boolean,attribute:`auto-remove`,reflect:!0,converter:ud})],dd.prototype,`autoRemove`,void 0),N([_({type:String,reflect:!0})],dd.prototype,`title`,void 0),N([_({type:String,attribute:`supporting-text`,reflect:!0})],dd.prototype,`supportingText`,void 0),N([_({type:String,attribute:`aria-label`,reflect:!0})],dd.prototype,`ariaLabel`,void 0),N([_({type:String,reflect:!0})],dd.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],dd.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],dd.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],dd.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],dd.prototype,`spacingRight`,void 0),dd=N([a(`scb-cookies-consent`)],dd);var fd=n({ScbDrawer:()=>md}),q,pd,md,hd=t((()=>{w(),b(),Lu(),Ol(),P(),pd={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},md=class extends C{static{q=this}constructor(...e){super(...e),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.ariaLabel=`Sidopanel`,this.__effectiveSide=`left`,this.__lastTriggerEl=null,this.__scrollLockHeld=!1,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=e=>{let t=this.__getActionFromEvent(e);if(t){t===`open`&&this.__setOpen(!0),t===`close`&&this.__setOpen(!1),t===`toggle`&&this.__setOpen(!this.open),e.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(e.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=e=>{if(this.open){if(e.key===`Escape`){if(this.__hasOpenNestedOverlay(e))return;e.preventDefault(),e.stopPropagation(),this.__setOpen(!1);return}if(this.overlay&&e.key===`Tab`){let t=this.__getFocusable();if(t.length===0)return;let n=t[0],r=t[t.length-1],i=this.__currentFocusableFromEvent(e,t);e.shiftKey?(i===n||!i)&&(e.preventDefault(),r.focus()):(i===r||!i)&&(e.preventDefault(),n.focus())}}}}static{this.__overlayEl=null}static{this.__overlayStack=[]}static{this.__lockedCount=0}static{this.__prevDocOverflow=null}static{this.__prevBodyOverflow=null}static{this.__prevBodyPaddingRight=null}static __ensureOverlayStyles(){if(typeof document>`u`||document.getElementById(`scb-drawer-overlay-styles`))return;let e=document.createElement(`style`);e.id=`scb-drawer-overlay-styles`,e.textContent=`
|
|
9836
9842
|
.scb-drawer-global-overlay {
|
|
9837
9843
|
position: fixed;
|
|
9838
9844
|
inset: 0;
|
|
@@ -9982,7 +9988,7 @@
|
|
|
9982
9988
|
>
|
|
9983
9989
|
<div class="panel"><slot></slot></div>
|
|
9984
9990
|
</div>
|
|
9985
|
-
`}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener(`click`,this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),this.overlay&&(q.__hideOverlay(this),this.__releaseScrollLock()),z(this),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;let t=e.composedPath();for(let e of t)if(e instanceof Element){if(e.getAttribute(`data-drawer-open`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1,`open`;if(e.getAttribute(`data-drawer-close`)===this.id)return this.contains(e)||(this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1),`close`;if(e.getAttribute(`data-drawer-toggle`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1,`toggle`;if(e.getAttribute(`aria-controls`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!0,`toggle`}return null}__hasOpenNestedOverlay(e){let t=`scb-options-menu, scb-dropdown, scb-select`;return e.composedPath().some(e=>e instanceof Element&&e!==this&&e.matches(t)&&!!e.open)?!0:Array.from(this.querySelectorAll(t)).some(e=>!!e.open)}__getFocusable(){let e=[`button`,`[href]`,`input`,`select`,`textarea`,`[tabindex]:not([tabindex="-1"])`,`scb-button`,`scb-icon-button`,`scb-textfield`,`scb-checkbox`,`scb-radio-button`,`scb-switch`,`scb-chip`,`scb-menu-item`].join(`, `),t=new Set,n=n=>{n.querySelectorAll(e).forEach(e=>{let n=this.__resolveFocusable(e);n&&t.add(n)})};return n(this),n(this.renderRoot),Array.from(t).filter(e=>!this.__isDisabledOrHidden(e))}__resolveFocusable(e){return this.__isDisabledOrHidden(e)?null:e.tagName===`SCB-BUTTON`||e.tagName===`SCB-ICON-BUTTON`?e.shadowRoot?.querySelector(`.native-button, button, a`)??e:e.tagName===`SCB-MENU-ITEM`?e.shadowRoot?.querySelector(`.scb-menu-label-text`)??e:e}__isDisabledOrHidden(e){if(e.disabled||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=getComputedStyle(e);return t.display===`none`||t.visibility===`hidden`}__currentFocusableFromEvent(e,t){let n=e.composedPath();return t.find(e=>n.includes(e))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__setOpen(e){this.open=e}async __focusFirstControl(){await this.updateComplete;for(let e=0;e<4;e+=1){if(await new Promise(e=>requestAnimationFrame(()=>e())),!this.open||!this.isConnected)return;let e=this.__getFocusable()[0];if(e?.focus?.({preventScroll:!0}),e&&this.__isFocused(e))return}}__isFocused(e){if(document.activeElement===e)return!0;let t=e.getRootNode();return t instanceof ShadowRoot&&t.activeElement===e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute(`aria-controls`)===this.id&&this.__lastTriggerEl.setAttribute(`aria-expanded`,String(e))}__syncEffectiveSide(e){let t=this.left&&this.right,n;n=t?e.has(`left`)&&this.left&&!e.has(`right`)?`left`:`right`:this.right?`right`:`left`,this.__effectiveSide!==n&&(this.__effectiveSide=n),this.getAttribute(`data-side`)!==n&&this.setAttribute(`data-side`,n)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(this.open&&this.floating&&this.overlay&&q.__syncOverlayColors(this),e.has(`open`)){let t=!!e.get(`open`);this.__applyOpenSideEffects(t,this.open)}(e.has(`open`)||e.has(`floating`))&&(this.open&&this.floating?Sl(this):(this.open||Tl(this),!this.open&&(wl(this)||this.__scrollLockHeld)?Cl(this,this.__scrollLockHeld?()=>this.__releaseScrollLock():void 0):z(this)))}__applyOpenSideEffects(e,t){if(t&&!e)this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(q.__showOverlay(this),this.lockScroll&&this.__acquireScrollLock()),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),this.__focusFirstControl(),this.dispatchEvent(new CustomEvent(`scb-drawer-opened`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbdraweropened`,{bubbles:!0,composed:!0}));else if(!t&&e){this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&q.__hideOverlay(this),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0);let e=this.__lastTriggerEl;requestAnimationFrame(()=>{if(this.open||!this.isConnected)return;let t=this.getRootNode(),n=t instanceof ShadowRoot?t.activeElement:this.ownerDocument.activeElement;(!n||n===this.ownerDocument.body||n===e||this.contains(n))&&e?.focus?.({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`scb-drawer-closed`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbdrawerclosed`,{bubbles:!0,composed:!0}))}}__acquireScrollLock(){this.__scrollLockHeld||=(q.__lockScrollEnable(),!0)}__releaseScrollLock(){this.__scrollLockHeld&&(this.__scrollLockHeld=!1,q.__lockScrollDisable())}},N([_({type:Boolean,reflect:!0,converter:
|
|
9991
|
+
`}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener(`click`,this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),this.overlay&&(q.__hideOverlay(this),this.__releaseScrollLock()),z(this),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;let t=e.composedPath();for(let e of t)if(e instanceof Element){if(e.getAttribute(`data-drawer-open`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1,`open`;if(e.getAttribute(`data-drawer-close`)===this.id)return this.contains(e)||(this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1),`close`;if(e.getAttribute(`data-drawer-toggle`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!1,`toggle`;if(e.getAttribute(`aria-controls`)===this.id)return this.__lastTriggerEl=e,this.__lastTriggerWasAriaControls=!0,`toggle`}return null}__hasOpenNestedOverlay(e){let t=`scb-options-menu, scb-dropdown, scb-select`;return e.composedPath().some(e=>e instanceof Element&&e!==this&&e.matches(t)&&!!e.open)?!0:Array.from(this.querySelectorAll(t)).some(e=>!!e.open)}__getFocusable(){let e=[`button`,`[href]`,`input`,`select`,`textarea`,`[tabindex]:not([tabindex="-1"])`,`scb-button`,`scb-icon-button`,`scb-textfield`,`scb-checkbox`,`scb-radio-button`,`scb-switch`,`scb-chip`,`scb-menu-item`].join(`, `),t=new Set,n=n=>{n.querySelectorAll(e).forEach(e=>{let n=this.__resolveFocusable(e);n&&t.add(n)})};return n(this),n(this.renderRoot),Array.from(t).filter(e=>!this.__isDisabledOrHidden(e))}__resolveFocusable(e){return this.__isDisabledOrHidden(e)?null:e.tagName===`SCB-BUTTON`||e.tagName===`SCB-ICON-BUTTON`?e.shadowRoot?.querySelector(`.native-button, button, a`)??e:e.tagName===`SCB-MENU-ITEM`?e.shadowRoot?.querySelector(`.scb-menu-label-text`)??e:e}__isDisabledOrHidden(e){if(e.disabled||e.getAttribute(`aria-hidden`)===`true`)return!0;let t=getComputedStyle(e);return t.display===`none`||t.visibility===`hidden`}__currentFocusableFromEvent(e,t){let n=e.composedPath();return t.find(e=>n.includes(e))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__setOpen(e){this.open=e}async __focusFirstControl(){await this.updateComplete;for(let e=0;e<4;e+=1){if(await new Promise(e=>requestAnimationFrame(()=>e())),!this.open||!this.isConnected)return;let e=this.__getFocusable()[0];if(e?.focus?.({preventScroll:!0}),e&&this.__isFocused(e))return}}__isFocused(e){if(document.activeElement===e)return!0;let t=e.getRootNode();return t instanceof ShadowRoot&&t.activeElement===e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute(`aria-controls`)===this.id&&this.__lastTriggerEl.setAttribute(`aria-expanded`,String(e))}__syncEffectiveSide(e){let t=this.left&&this.right,n;n=t?e.has(`left`)&&this.left&&!e.has(`right`)?`left`:`right`:this.right?`right`:`left`,this.__effectiveSide!==n&&(this.__effectiveSide=n),this.getAttribute(`data-side`)!==n&&this.setAttribute(`data-side`,n)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(this.open&&this.floating&&this.overlay&&q.__syncOverlayColors(this),e.has(`open`)){let t=!!e.get(`open`);this.__applyOpenSideEffects(t,this.open)}(e.has(`open`)||e.has(`floating`))&&(this.open&&this.floating?Sl(this):(this.open||Tl(this),!this.open&&(wl(this)||this.__scrollLockHeld)?Cl(this,this.__scrollLockHeld?()=>this.__releaseScrollLock():void 0):z(this)))}__applyOpenSideEffects(e,t){if(t&&!e)this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(q.__showOverlay(this),this.lockScroll&&this.__acquireScrollLock()),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),this.__focusFirstControl(),this.dispatchEvent(new CustomEvent(`scb-drawer-opened`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbdraweropened`,{bubbles:!0,composed:!0}));else if(!t&&e){this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&q.__hideOverlay(this),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0);let e=this.__lastTriggerEl;requestAnimationFrame(()=>{if(this.open||!this.isConnected)return;let t=this.getRootNode(),n=t instanceof ShadowRoot?t.activeElement:this.ownerDocument.activeElement;(!n||n===this.ownerDocument.body||n===e||this.contains(n))&&e?.focus?.({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`scb-drawer-closed`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbdrawerclosed`,{bubbles:!0,composed:!0}))}}__acquireScrollLock(){this.__scrollLockHeld||=(q.__lockScrollEnable(),!0)}__releaseScrollLock(){this.__scrollLockHeld&&(this.__scrollLockHeld=!1,q.__lockScrollDisable())}},N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`floating`,void 0),N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`left`,void 0),N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`right`,void 0),N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`open`,void 0),N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`overlay`,void 0),N([_({type:Boolean,reflect:!0,attribute:`lock-scroll`,converter:pd})],md.prototype,`lockScroll`,void 0),N([_({type:Boolean,reflect:!0,attribute:`close-on-overlay`,converter:pd})],md.prototype,`closeOnOverlay`,void 0),N([_({type:Boolean,reflect:!0,converter:pd})],md.prototype,`modal`,void 0),N([_({type:String,reflect:!0,attribute:`aria-label`})],md.prototype,`ariaLabel`,void 0),md=q=N([a(`scb-drawer`)],md)}));hd(),w(),b(),Mc(),cc(),P();var J=class extends C{static{this.formAssociated=!0}constructor(){super(),this._internals=null,this.type=`default`,this.name=``,this.multiple=!1,this.label=``,this.supportingText=``,this.metaText=``,this.buttonLabel=``,this.replaceButtonLabel=``,this.removeButtonLabel=``,this.removeSelectedFileLabel=``,this.selectedImagesLabel=``,this.selectedFilesLabel=``,this.imagePreviewLabel=``,this.filePreviewLabel=``,this.selectedImagesPreviewText=``,this.existingFileLabel=``,this.selectedFileLabel=``,this.previewEyebrow=``,this.emptyPreviewTitle=``,this.emptyPreviewMeta=``,this.accept=``,this.hidePreview=!1,this.showExistingPreview=!1,this.disabled=!1,this.required=!1,this.error=!1,this.errorText=``,this.previewSrc=``,this.previewAlt=``,this.previewTitle=``,this.previewMeta=``,this.existingValue=``,this.existingValueName=``,this.removeValueName=``,this._isDragOver=!1,this._selectedPreviewKind=`empty`,this._selectedPreviewSrc=``,this._selectedPreviewAlt=``,this._selectedPreviewTitle=``,this._selectedPreviewMeta=``,this._selectedPreviewItems=[],this._markedForRemoval=!1,this._dragDepth=0,this._previewSource=`external`,this._form=null,this._formDataHandler=null,this._formSubmitHandler=null,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._supportingTextId=`scb-drop-zone-supporting-${Math.random().toString(36).slice(2)}`,this._metaTextId=`scb-drop-zone-meta-${Math.random().toString(36).slice(2)}`,this._errorTextId=`scb-drop-zone-error-${Math.random().toString(36).slice(2)}`,`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
9986
9992
|
:host {
|
|
9987
9993
|
display: block;
|
|
9988
9994
|
width: 100%;
|
|
@@ -10697,7 +10703,7 @@
|
|
|
10697
10703
|
|
|
10698
10704
|
${this._renderSelectedImageCards()}
|
|
10699
10705
|
</div>
|
|
10700
|
-
`}};N([_({type:String,reflect:!0})],J.prototype,`type`,void 0),N([_({type:String})],J.prototype,`name`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`multiple`,void 0),N([_({type:String})],J.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],J.prototype,`supportingText`,void 0),N([_({type:String,attribute:`meta-text`})],J.prototype,`metaText`,void 0),N([_({type:String,attribute:`button-label`})],J.prototype,`buttonLabel`,void 0),N([_({type:String,attribute:`replace-button-label`})],J.prototype,`replaceButtonLabel`,void 0),N([_({type:String,attribute:`remove-button-label`})],J.prototype,`removeButtonLabel`,void 0),N([_({type:String,attribute:`remove-selected-file-label`})],J.prototype,`removeSelectedFileLabel`,void 0),N([_({type:String,attribute:`selected-images-label`})],J.prototype,`selectedImagesLabel`,void 0),N([_({type:String,attribute:`selected-files-label`})],J.prototype,`selectedFilesLabel`,void 0),N([_({type:String,attribute:`image-preview-label`})],J.prototype,`imagePreviewLabel`,void 0),N([_({type:String,attribute:`file-preview-label`})],J.prototype,`filePreviewLabel`,void 0),N([_({type:String,attribute:`selected-images-preview-text`})],J.prototype,`selectedImagesPreviewText`,void 0),N([_({type:String,attribute:`existing-file-label`})],J.prototype,`existingFileLabel`,void 0),N([_({type:String,attribute:`selected-file-label`})],J.prototype,`selectedFileLabel`,void 0),N([_({type:String,attribute:`preview-eyebrow`})],J.prototype,`previewEyebrow`,void 0),N([_({type:String,attribute:`empty-preview-title`})],J.prototype,`emptyPreviewTitle`,void 0),N([_({type:String,attribute:`empty-preview-meta`})],J.prototype,`emptyPreviewMeta`,void 0),N([_({type:String})],J.prototype,`accept`,void 0),N([_({type:Boolean,attribute:`hide-preview`,reflect:!0})],J.prototype,`hidePreview`,void 0),N([_({type:Boolean,attribute:`show-existing-preview`,reflect:!0})],J.prototype,`showExistingPreview`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`error`,void 0),N([_({type:String,attribute:`error-text`})],J.prototype,`errorText`,void 0),N([_({type:String,attribute:`preview-src`})],J.prototype,`previewSrc`,void 0),N([_({type:String,attribute:`preview-alt`})],J.prototype,`previewAlt`,void 0),N([_({type:String,attribute:`preview-title`})],J.prototype,`previewTitle`,void 0),N([_({type:String,attribute:`preview-meta`})],J.prototype,`previewMeta`,void 0),N([_({type:String,attribute:`existing-value`})],J.prototype,`existingValue`,void 0),N([_({type:String,attribute:`existing-value-name`})],J.prototype,`existingValueName`,void 0),N([_({type:String,attribute:`remove-value-name`})],J.prototype,`removeValueName`,void 0),N([v()],J.prototype,`_isDragOver`,void 0),N([v()],J.prototype,`_selectedPreviewKind`,void 0),N([v()],J.prototype,`_selectedPreviewSrc`,void 0),N([v()],J.prototype,`_selectedPreviewAlt`,void 0),N([v()],J.prototype,`_selectedPreviewTitle`,void 0),N([v()],J.prototype,`_selectedPreviewMeta`,void 0),N([v()],J.prototype,`_selectedPreviewItems`,void 0),N([v()],J.prototype,`_markedForRemoval`,void 0),J=N([a(`scb-drop-zone`)],J);var _d
|
|
10706
|
+
`}};N([_({type:String,reflect:!0})],J.prototype,`type`,void 0),N([_({type:String})],J.prototype,`name`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`multiple`,void 0),N([_({type:String})],J.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],J.prototype,`supportingText`,void 0),N([_({type:String,attribute:`meta-text`})],J.prototype,`metaText`,void 0),N([_({type:String,attribute:`button-label`})],J.prototype,`buttonLabel`,void 0),N([_({type:String,attribute:`replace-button-label`})],J.prototype,`replaceButtonLabel`,void 0),N([_({type:String,attribute:`remove-button-label`})],J.prototype,`removeButtonLabel`,void 0),N([_({type:String,attribute:`remove-selected-file-label`})],J.prototype,`removeSelectedFileLabel`,void 0),N([_({type:String,attribute:`selected-images-label`})],J.prototype,`selectedImagesLabel`,void 0),N([_({type:String,attribute:`selected-files-label`})],J.prototype,`selectedFilesLabel`,void 0),N([_({type:String,attribute:`image-preview-label`})],J.prototype,`imagePreviewLabel`,void 0),N([_({type:String,attribute:`file-preview-label`})],J.prototype,`filePreviewLabel`,void 0),N([_({type:String,attribute:`selected-images-preview-text`})],J.prototype,`selectedImagesPreviewText`,void 0),N([_({type:String,attribute:`existing-file-label`})],J.prototype,`existingFileLabel`,void 0),N([_({type:String,attribute:`selected-file-label`})],J.prototype,`selectedFileLabel`,void 0),N([_({type:String,attribute:`preview-eyebrow`})],J.prototype,`previewEyebrow`,void 0),N([_({type:String,attribute:`empty-preview-title`})],J.prototype,`emptyPreviewTitle`,void 0),N([_({type:String,attribute:`empty-preview-meta`})],J.prototype,`emptyPreviewMeta`,void 0),N([_({type:String})],J.prototype,`accept`,void 0),N([_({type:Boolean,attribute:`hide-preview`,reflect:!0})],J.prototype,`hidePreview`,void 0),N([_({type:Boolean,attribute:`show-existing-preview`,reflect:!0})],J.prototype,`showExistingPreview`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],J.prototype,`error`,void 0),N([_({type:String,attribute:`error-text`})],J.prototype,`errorText`,void 0),N([_({type:String,attribute:`preview-src`})],J.prototype,`previewSrc`,void 0),N([_({type:String,attribute:`preview-alt`})],J.prototype,`previewAlt`,void 0),N([_({type:String,attribute:`preview-title`})],J.prototype,`previewTitle`,void 0),N([_({type:String,attribute:`preview-meta`})],J.prototype,`previewMeta`,void 0),N([_({type:String,attribute:`existing-value`})],J.prototype,`existingValue`,void 0),N([_({type:String,attribute:`existing-value-name`})],J.prototype,`existingValueName`,void 0),N([_({type:String,attribute:`remove-value-name`})],J.prototype,`removeValueName`,void 0),N([v()],J.prototype,`_isDragOver`,void 0),N([v()],J.prototype,`_selectedPreviewKind`,void 0),N([v()],J.prototype,`_selectedPreviewSrc`,void 0),N([v()],J.prototype,`_selectedPreviewAlt`,void 0),N([v()],J.prototype,`_selectedPreviewTitle`,void 0),N([v()],J.prototype,`_selectedPreviewMeta`,void 0),N([v()],J.prototype,`_selectedPreviewItems`,void 0),N([v()],J.prototype,`_markedForRemoval`,void 0),J=N([a(`scb-drop-zone`)],J);var gd,_d=t((()=>{w(),b(),Lu(),D(),E(),j(),P(),gd=class extends C{constructor(...e){super(...e),this.label=``,this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon=``,this.trailingIcon=``,this.itemHref=``,this.href=``,this._observedSubMenu=null,this._syncSubMenuFlags=()=>{let e=this.nextElementSibling,t=!!(e&&e.tagName===`SCB-OPTIONS-SUB-MENU`),n=!!(t&&e.hasAttribute(`open-left`));t!==this.hasSubMenu&&(this.hasSubMenu=t),n!==this.openLeft&&(this.openLeft=n);let r=t?e:null;r!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=r,r&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(r,{attributes:!0,attributeFilter:[`open-left`]})))},this.handleClick=e=>{this._effectiveHref?this._navigateToHref(e):this._toggleSubMenu()},this._onBlur=e=>{let t=this.closest(`scb-options-sub-menu`);if(t&&t.open){let n=e.relatedTarget;(!n||!t.contains(n))&&(t.dispatchEvent(new CustomEvent(`hide-submenu`,{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent(`hidesubmenu`,{bubbles:!0,composed:!0})))}},this._onFocus=()=>{let e=this.nextElementSibling;this.classList.contains(`open-submenu`)&&(e&&e.tagName===`SCB-OPTIONS-SUB-MENU`&&e.hasAttribute(`open`)||this.classList.remove(`open-submenu`))},this._onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.handleClick(e);return}if(e.key===`ArrowDown`){e.preventDefault();let t=this.nextElementSibling;for(;t&&t.tagName!==`SCB-OPTIONS-MENU-ITEM`;)t=t.nextElementSibling;t&&(t.shadowRoot?.querySelector(`li`))?.focus();return}if(e.key===`ArrowUp`){e.preventDefault();let t=this.previousElementSibling;for(;t&&t.tagName!==`SCB-OPTIONS-MENU-ITEM`;)t=t.previousElementSibling;t&&(t.shadowRoot?.querySelector(`li`))?.focus();return}if(e.key===`ArrowRight`){e.preventDefault();let t=this.nextElementSibling;t&&t.tagName===`SCB-OPTIONS-SUB-MENU`&&(t.hasAttribute(`open`)||(this._toggleSubMenu(),t.dispatchEvent(new CustomEvent(`show-submenu`,{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent(`showsubmenu`,{bubbles:!0,composed:!0}))),setTimeout(()=>{let e=t.querySelector(`scb-options-menu-item`);e&&(e.shadowRoot?.querySelector(`li`))?.focus()},0));return}if(e.key===`ArrowLeft`){e.preventDefault();let t=this.nextElementSibling;if(t&&t.tagName===`SCB-OPTIONS-SUB-MENU`&&t.hasAttribute(`open`)){this._toggleSubMenu(),t.dispatchEvent(new CustomEvent(`hide-submenu`,{bubbles:!0,composed:!0})),t.dispatchEvent(new CustomEvent(`hidesubmenu`,{bubbles:!0,composed:!0}));return}let n=this.closest(`scb-options-sub-menu`);if(n){let e=n.previousElementSibling;e&&e.tagName===`SCB-OPTIONS-MENU-ITEM`&&(e.shadowRoot?.querySelector(`li`))?.focus()}return}}}static{this.styles=p`
|
|
10701
10707
|
:host {
|
|
10702
10708
|
display: block;
|
|
10703
10709
|
}
|
|
@@ -10817,7 +10823,7 @@
|
|
|
10817
10823
|
<md-ripple></md-ripple>
|
|
10818
10824
|
`}
|
|
10819
10825
|
</li>
|
|
10820
|
-
`}_navigateToHref(e){let t=this._effectiveHref;if(!t)return;let n={href:t},r=new CustomEvent(`item-navigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),i=new CustomEvent(`itemnavigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),a=!this.dispatchEvent(r),o=!this.dispatchEvent(i);e.preventDefault(),e.stopPropagation(),!a&&!o&&(window.location.href=t)}_toggleSubMenu(){let e=this.nextElementSibling;e&&e.tagName===`SCB-OPTIONS-SUB-MENU`&&(this.classList.toggle(`open-submenu`),e.hasAttribute(`open`)?(e.dispatchEvent(new CustomEvent(`hide-submenu`,{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(`hidesubmenu`,{bubbles:!0,composed:!0}))):(e.dispatchEvent(new CustomEvent(`show-submenu`,{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(`showsubmenu`,{bubbles:!0,composed:!0}))))}},N([_({type:String})],
|
|
10826
|
+
`}_navigateToHref(e){let t=this._effectiveHref;if(!t)return;let n={href:t},r=new CustomEvent(`item-navigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),i=new CustomEvent(`itemnavigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),a=!this.dispatchEvent(r),o=!this.dispatchEvent(i);e.preventDefault(),e.stopPropagation(),!a&&!o&&(window.location.href=t)}_toggleSubMenu(){let e=this.nextElementSibling;e&&e.tagName===`SCB-OPTIONS-SUB-MENU`&&(this.classList.toggle(`open-submenu`),e.hasAttribute(`open`)?(e.dispatchEvent(new CustomEvent(`hide-submenu`,{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(`hidesubmenu`,{bubbles:!0,composed:!0}))):(e.dispatchEvent(new CustomEvent(`show-submenu`,{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent(`showsubmenu`,{bubbles:!0,composed:!0}))))}},N([_({type:String})],gd.prototype,`label`,void 0),N([_({type:Boolean})],gd.prototype,`hasSubMenu`,void 0),N([_({type:Boolean})],gd.prototype,`openLeft`,void 0),N([_({type:Boolean})],gd.prototype,`divider`,void 0),N([_({type:String,attribute:`leading-icon`})],gd.prototype,`leadingIcon`,void 0),N([_({type:String,attribute:`trailing-icon`})],gd.prototype,`trailingIcon`,void 0),N([_({type:String,attribute:`item-href`})],gd.prototype,`itemHref`,void 0),N([_({type:String})],gd.prototype,`href`,void 0),gd=N([a(`scb-options-menu-item`)],gd)})),vd,yd=t((()=>{w(),b(),Ol(),P(),vd=class extends C{constructor(...e){super(...e),this.open=!1,this._show=()=>{this.setAttribute(`open`,``),this.open=!0},this._hide=e=>{this.removeAttribute(`open`),this.open=!1,e&&e.stopPropagation()},this._onViewportChange=()=>{this.open&&this._positionPopover()}}static{this.styles=p`
|
|
10821
10827
|
:host {
|
|
10822
10828
|
display: block;
|
|
10823
10829
|
position: relative;
|
|
@@ -10870,7 +10876,7 @@
|
|
|
10870
10876
|
<div role="menu" class="submenu${this.open?` open`:``}">
|
|
10871
10877
|
<slot></slot>
|
|
10872
10878
|
</div>
|
|
10873
|
-
`}},N([_({type:Boolean,reflect:!0})],
|
|
10879
|
+
`}},N([_({type:Boolean,reflect:!0})],vd.prototype,`open`,void 0),vd=N([a(`scb-options-sub-menu`)],vd)})),bd,xd=t((()=>{w(),pl(),b(),_d(),yd(),uc(),Ol(),P(),bd=class extends C{constructor(...e){super(...e),this.open=!1,this.size=lc[`scb-options-menu`].size,this.inSb=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__lastTriggerEl=null,this.__onViewportChange=()=>{this.open&&this.__positionToTrigger()},this.__onDocumentClick=e=>{let t=this.__getActionFromEvent(e);if(t){t===`open`&&this.__setOpen(!0),t===`close`&&this.__setOpen(!1),t===`toggle`&&(this.__setOpen(!this.open),this.dispatchEvent(new CustomEvent(`toggle`,{bubbles:!0,composed:!0}))),e.stopPropagation();return}if(!this.inSb&&this.open&&!this.isClickInScbMenu(e)){this.__setOpen(!1);return}},this.__onDocumentKeydown=e=>{if(this.open&&e.key===`Escape`){e.preventDefault(),e.stopPropagation(),this.__setOpen(!1);return}}}static{this.styles=p`
|
|
10874
10880
|
:host {
|
|
10875
10881
|
position: absolute;
|
|
10876
10882
|
display: block;
|
|
@@ -11059,7 +11065,7 @@
|
|
|
11059
11065
|
>
|
|
11060
11066
|
<slot></slot>
|
|
11061
11067
|
</div>
|
|
11062
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this.__onDocumentClick,!1),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),window.addEventListener(`resize`,this.__onViewportChange,{passive:!0}),window.addEventListener(`scroll`,this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),window.removeEventListener(`resize`,this.__onViewportChange),window.removeEventListener(`scroll`,this.__onViewportChange,!0),z(this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null),super.disconnectedCallback()}__setOpen(e){this.open=e}__getActionFromEvent(e){if(!this.id)return null;let t=e.composedPath();for(let e of t)if(e instanceof Element){if(e.getAttribute(`data-menu-open`)===this.id)return this.__lastTriggerEl=e,`open`;if(e.getAttribute(`data-menu-close`)===this.id)return this.__lastTriggerEl=e,`close`;if(e.getAttribute(`data-menu-toggle`)===this.id||e.getAttribute(`aria-controls`)===this.id)return this.__lastTriggerEl=e,`toggle`}return null}isClickInScbMenu(e){return e.composedPath().some(e=>e instanceof Element&&(e.tagName===`SCB-OPTIONS-MENU`||e.tagName===`SCB-OPTIONS-SUB-MENU`))}updated(e){e.has(`open`)&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent(`open`,{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__applyOpenSideEffects(){if(this.__updateTriggersExpanded(),this.open)this.__lastTriggerEl&&!this.closest(`scb-dropdown`)&&Sl(this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null),this.__positionToTrigger();else{Tl(this);let e=this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null,t=()=>{e?.style.removeProperty(`max-height`),e?.style.removeProperty(`overflow-x`),e?.style.removeProperty(`overflow-y`)};wl(e)?Cl(e,t):(z(e),t()),this.__restoreFocusToTrigger()}}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;let e=this.__lastTriggerEl,t=this.shadowRoot?.querySelector(`.scb-options-menu-panel`);t&&requestAnimationFrame(()=>{if(!this.open)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=t.offsetWidth||r.width,s=getComputedStyle(this).getPropertyValue(`--scb-options-menu-inline-align`).trim()===`end`?n.right-o:n.left,c=t.scrollHeight||t.offsetHeight||r.height;s+o>i-8&&(s=Math.max(8,i-8-o)),s<8&&(s=8);let l=Math.max(0,a-n.bottom-4-8),u=Math.max(0,n.top-4-8),d=c>l&&u>l,f=d?u:l,p=Math.min(c,f),m=d?Math.max(8,n.top-4-p):n.bottom+4,h=d?`bottom`:`top`;t.style.position=`fixed`,t.style.left=`${Math.round(s)}px`,t.style.top=`${Math.round(m)}px`,t.style.maxHeight=`min(var(--scb-options-menu-max-height), ${Math.floor(f)}px)`,t.style.overflowX=`hidden`,t.style.overflowY=`auto`,this.style.setProperty(`--scb-options-menu-transform-origin`,h)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.({preventScroll:!0})})}__updateTriggersExpanded(){if(!this.id)return;let e=String(this.open),t=t=>{let n=t.getAttribute(`aria-controls`)===this.id,r=t.getAttribute(`data-menu-open`)===this.id||t.getAttribute(`data-menu-toggle`)===this.id;(n||r)&&(n||t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,e))};this.__lastTriggerEl&&t(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(t)}__applySpacing(){let e=this.__mapSpacingToken(this.spacing),t=this.__mapSpacingToken(this.spacingTop)??e,n=this.__mapSpacingToken(this.spacingBottom)??e,r=this.__mapSpacingToken(this.spacingLeft),i=this.__mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-options-menu-spacing-block-start`,t):this.style.removeProperty(`--scb-options-menu-spacing-block-start`),n?this.style.setProperty(`--scb-options-menu-spacing-block-end`,n):this.style.removeProperty(`--scb-options-menu-spacing-block-end`),r?this.style.setProperty(`--scb-options-menu-spacing-inline-start`,r):this.style.removeProperty(`--scb-options-menu-spacing-inline-start`),i?this.style.setProperty(`--scb-options-menu-spacing-inline-end`,i):this.style.removeProperty(`--scb-options-menu-spacing-inline-end`)}__mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}},N([_({type:Boolean,reflect:!0})],
|
|
11068
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this.__onDocumentClick,!1),document.addEventListener(`keydown`,this.__onDocumentKeydown,!0),window.addEventListener(`resize`,this.__onViewportChange,{passive:!0}),window.addEventListener(`scroll`,this.__onViewportChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener(`click`,this.__onDocumentClick,!1),document.removeEventListener(`keydown`,this.__onDocumentKeydown,!0),window.removeEventListener(`resize`,this.__onViewportChange),window.removeEventListener(`scroll`,this.__onViewportChange,!0),z(this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null),super.disconnectedCallback()}__setOpen(e){this.open=e}__getActionFromEvent(e){if(!this.id)return null;let t=e.composedPath();for(let e of t)if(e instanceof Element){if(e.getAttribute(`data-menu-open`)===this.id)return this.__lastTriggerEl=e,`open`;if(e.getAttribute(`data-menu-close`)===this.id)return this.__lastTriggerEl=e,`close`;if(e.getAttribute(`data-menu-toggle`)===this.id||e.getAttribute(`aria-controls`)===this.id)return this.__lastTriggerEl=e,`toggle`}return null}isClickInScbMenu(e){return e.composedPath().some(e=>e instanceof Element&&(e.tagName===`SCB-OPTIONS-MENU`||e.tagName===`SCB-OPTIONS-SUB-MENU`))}updated(e){e.has(`open`)&&(this.__applyOpenSideEffects(),this.open?this.dispatchEvent(new CustomEvent(`open`,{bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__applyOpenSideEffects(){if(this.__updateTriggersExpanded(),this.open)this.__lastTriggerEl&&!this.closest(`scb-dropdown`)&&Sl(this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null),this.__positionToTrigger();else{Tl(this);let e=this.shadowRoot?.querySelector(`.scb-options-menu-panel`)??null,t=()=>{e?.style.removeProperty(`max-height`),e?.style.removeProperty(`overflow-x`),e?.style.removeProperty(`overflow-y`)};wl(e)?Cl(e,t):(z(e),t()),this.__restoreFocusToTrigger()}}__positionToTrigger(){if(!this.open||!this.__lastTriggerEl)return;let e=this.__lastTriggerEl,t=this.shadowRoot?.querySelector(`.scb-options-menu-panel`);t&&requestAnimationFrame(()=>{if(!this.open)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,o=t.offsetWidth||r.width,s=getComputedStyle(this).getPropertyValue(`--scb-options-menu-inline-align`).trim()===`end`?n.right-o:n.left,c=t.scrollHeight||t.offsetHeight||r.height;s+o>i-8&&(s=Math.max(8,i-8-o)),s<8&&(s=8);let l=Math.max(0,a-n.bottom-4-8),u=Math.max(0,n.top-4-8),d=c>l&&u>l,f=d?u:l,p=Math.min(c,f),m=d?Math.max(8,n.top-4-p):n.bottom+4,h=d?`bottom`:`top`;t.style.position=`fixed`,t.style.left=`${Math.round(s)}px`,t.style.top=`${Math.round(m)}px`,t.style.maxHeight=`min(var(--scb-options-menu-max-height), ${Math.floor(f)}px)`,t.style.overflowX=`hidden`,t.style.overflowY=`auto`,this.style.setProperty(`--scb-options-menu-transform-origin`,h)})}__restoreFocusToTrigger(){this.__lastTriggerEl&&requestAnimationFrame(()=>{this.__lastTriggerEl?.focus?.({preventScroll:!0})})}__updateTriggersExpanded(){if(!this.id)return;let e=String(this.open),t=t=>{let n=t.getAttribute(`aria-controls`)===this.id,r=t.getAttribute(`data-menu-open`)===this.id||t.getAttribute(`data-menu-toggle`)===this.id;(n||r)&&(n||t.setAttribute(`aria-controls`,this.id),t.setAttribute(`aria-expanded`,e))};this.__lastTriggerEl&&t(this.__lastTriggerEl),document.querySelectorAll(`[aria-controls="${this.id}"], [data-menu-open="${this.id}"], [data-menu-close="${this.id}"], [data-menu-toggle="${this.id}"]`).forEach(t)}__applySpacing(){let e=this.__mapSpacingToken(this.spacing),t=this.__mapSpacingToken(this.spacingTop)??e,n=this.__mapSpacingToken(this.spacingBottom)??e,r=this.__mapSpacingToken(this.spacingLeft),i=this.__mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-options-menu-spacing-block-start`,t):this.style.removeProperty(`--scb-options-menu-spacing-block-start`),n?this.style.setProperty(`--scb-options-menu-spacing-block-end`,n):this.style.removeProperty(`--scb-options-menu-spacing-block-end`),r?this.style.setProperty(`--scb-options-menu-spacing-inline-start`,r):this.style.removeProperty(`--scb-options-menu-spacing-inline-start`),i?this.style.setProperty(`--scb-options-menu-spacing-inline-end`,i):this.style.removeProperty(`--scb-options-menu-spacing-inline-end`)}__mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}},N([_({type:Boolean,reflect:!0})],bd.prototype,`open`,void 0),N([_({type:String,reflect:!0})],bd.prototype,`size`,void 0),N([_({type:Boolean,attribute:!1})],bd.prototype,`inSb`,void 0),N([_({type:String,reflect:!0})],bd.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],bd.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],bd.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],bd.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],bd.prototype,`spacingRight`,void 0),bd=N([a(`scb-options-menu`)],bd)})),Sd=n({ScbDropdown:()=>Y}),Y,Cd=t((()=>{w(),b(),D(),j(),Ol(),Mc(),yc(),xd(),uc(),P(),Y=class extends C{constructor(...e){super(...e),this.label=`Dropdown`,this.variant=`filled`,this.size=lc[`scb-dropdown`].size,this.open=!1,this.disabled=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.menuGap=`3`,this.width=null,this.minWidth=null,this.maxWidth=null,this.dataIndex=null,this.ariaCurrent=null,this._slottedMenuEl=null,this._slottedTriggers=new Map,this._triggerObserver=new MutationObserver(()=>this._syncSlottedTrigger()),this._pendingTriggerDefinitions=new Set,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._panelPlacementRaf=null,this._onViewportChange=()=>{this.open&&this._schedulePanelPlacement()},this._onDocumentClickBound=e=>{if(!this.open)return;let t=e.composedPath(),n=t.find(e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-dropdown`);if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.open=!1,this.updateComplete.then(()=>this.focus({preventScroll:!0})))},this._onSlottedMenuOpen=()=>{this.open||=!0},this._onSlottedMenuClose=()=>{this.open&&=!1},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerSlotChange=()=>{this._syncSlottedTrigger(),this._onViewportChange()},this._onTriggerClick=e=>{this.hasAttribute(`as-tab`)||e.stopPropagation(),!this.disabled&&(this.open=!this.open)},this._onSlottedTriggerClick=e=>{let t=this._getSlottedTrigger();if(!(!t||!e.composedPath().includes(t)||e.defaultPrevented)){if(this.disabled||t.matches(`:disabled, [disabled], [aria-disabled="true"]`)||this._triggerControlEl?.matches(`:disabled, [disabled], [aria-disabled="true"]`)){e.preventDefault();return}this._onTriggerClick(e)}}}static{this.styles=p`
|
|
11063
11069
|
:host {
|
|
11064
11070
|
display: inline-block;
|
|
11065
11071
|
position: relative;
|
|
@@ -11546,7 +11552,7 @@
|
|
|
11546
11552
|
</div>
|
|
11547
11553
|
</div>
|
|
11548
11554
|
</div>
|
|
11549
|
-
`}},N([_({type:String})],Y.prototype,`label`,void 0),N([_({type:String})],Y.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],Y.prototype,`size`,void 0),N([_({type:Boolean,reflect:!0})],Y.prototype,`open`,void 0),N([_({type:Boolean,reflect:!0})],Y.prototype,`disabled`,void 0),N([_({type:String,reflect:!0})],Y.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Y.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Y.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Y.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Y.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`menu-gap`})],Y.prototype,`menuGap`,void 0),N([_({type:String})],Y.prototype,`width`,void 0),N([_({type:String,attribute:`min-width`})],Y.prototype,`minWidth`,void 0),N([_({type:String,attribute:`max-width`})],Y.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`data-index`})],Y.prototype,`dataIndex`,void 0),N([_({type:String,attribute:`aria-current`})],Y.prototype,`ariaCurrent`,void 0),N([y(`[data-scb-dropdown-trigger]`)],Y.prototype,`_defaultTriggerEl`,void 0),N([y(`slot[name="trigger"]`)],Y.prototype,`_triggerSlotEl`,void 0),N([y(`slot:not([name])`)],Y.prototype,`_slotEl`,void 0),N([y(`.panel-surface`)],Y.prototype,`_panelSurfaceEl`,void 0),N([y(`.panel-inner`)],Y.prototype,`_panelInnerEl`,void 0),Y=N([a(`scb-dropdown`)],Y)}));
|
|
11555
|
+
`}},N([_({type:String})],Y.prototype,`label`,void 0),N([_({type:String})],Y.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],Y.prototype,`size`,void 0),N([_({type:Boolean,reflect:!0})],Y.prototype,`open`,void 0),N([_({type:Boolean,reflect:!0})],Y.prototype,`disabled`,void 0),N([_({type:String,reflect:!0})],Y.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Y.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Y.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Y.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Y.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`menu-gap`})],Y.prototype,`menuGap`,void 0),N([_({type:String})],Y.prototype,`width`,void 0),N([_({type:String,attribute:`min-width`})],Y.prototype,`minWidth`,void 0),N([_({type:String,attribute:`max-width`})],Y.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`data-index`})],Y.prototype,`dataIndex`,void 0),N([_({type:String,attribute:`aria-current`})],Y.prototype,`ariaCurrent`,void 0),N([y(`[data-scb-dropdown-trigger]`)],Y.prototype,`_defaultTriggerEl`,void 0),N([y(`slot[name="trigger"]`)],Y.prototype,`_triggerSlotEl`,void 0),N([y(`slot:not([name])`)],Y.prototype,`_slotEl`,void 0),N([y(`.panel-surface`)],Y.prototype,`_panelSurfaceEl`,void 0),N([y(`.panel-inner`)],Y.prototype,`_panelInnerEl`,void 0),Y=N([a(`scb-dropdown`)],Y)}));Cd(),w(),b(),P();var wd=class extends C{constructor(...e){super(...e),this.title=``,this.factCardTitle=``,this.subtitle=``,this.supportingText=``,this.__slotPresenceSignature=``,this.__onSlotChange=()=>{[this.__hasSlotContent(`heading`),this.__hasSlotContent(`subtitle`),this.__hasSlotContent(`supporting-text`),this.__hasSlotContent(`default`)].join(`:`)!==this.__slotPresenceSignature&&this.requestUpdate()}}get#e(){return this.factCardTitle||this.title}static{this.styles=p`
|
|
11550
11556
|
/*
|
|
11551
11557
|
Designbrygga:
|
|
11552
11558
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -11727,7 +11733,7 @@
|
|
|
11727
11733
|
<div class="content links" ?hidden=${!o}>
|
|
11728
11734
|
<slot @slotchange=${this.__onSlotChange}></slot>
|
|
11729
11735
|
</div>
|
|
11730
|
-
`}__hasSlotContent(e){return Array.from(this.childNodes).some(t=>t.nodeType===Node.TEXT_NODE?e==="default"&&!!t.textContent?.trim():t instanceof Element&&(t.getAttribute(`slot`)||`default`)===e)}};N([_({type:String,reflect:!0,attribute:`title`})],
|
|
11736
|
+
`}__hasSlotContent(e){return Array.from(this.childNodes).some(t=>t.nodeType===Node.TEXT_NODE?e==="default"&&!!t.textContent?.trim():t instanceof Element&&(t.getAttribute(`slot`)||`default`)===e)}};N([_({type:String,reflect:!0,attribute:`title`})],wd.prototype,`title`,void 0),N([_({type:String,reflect:!0,attribute:`fact-card-title`})],wd.prototype,`factCardTitle`,void 0),N([_({type:String,reflect:!0,attribute:`subtitle`})],wd.prototype,`subtitle`,void 0),N([_({type:String,reflect:!0,attribute:`supporting-text`})],wd.prototype,`supportingText`,void 0),wd=N([a(`scb-fact-card-content`)],wd),w(),b(),dl(),gl(),cc(),P();var Td,Ed={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},Dd=class extends C{static{Td=this}constructor(...e){super(...e),this.__onCloseClick=e=>{e.stopPropagation(),this.__setOpen(!1)},this.variant=`filled`,this.title=``,this.subtitle=``,this.supportingText=``,this.icon=``,this.showCloseButton=!1,this.closeLabel=`Stäng faktakort`,this.__hasIconSlot=!1,this.open=!0,this.__lastTriggerEl=null,this.sizing=``,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.__onIconSlotChange=()=>{let e=this.renderRoot.querySelector(`slot[name="icon"]`);this.__hasIconSlot=!!e?.assignedNodes({flatten:!0}).some(e=>e.nodeType!==Node.TEXT_NODE||!!e.textContent?.trim())}}static{this.__iconLoaded=!1}static{this.__instances=new Map}static{this.__docListenerAttached=!1}static __handleDocClick(e){let t=e.composedPath();for(let e of t){if(!(e instanceof Element))continue;let t=e.getAttribute(`data-fact-card-toggle`)||e.getAttribute(`aria-controls`);if(!t)continue;let n=Td.__instances.get(t);if(!n){Td.__instances.delete(t);continue}n.__lastTriggerEl=e,n.__setOpen(!n.open);break}}static __ensureDocListener(){Td.__docListenerAttached||(document.addEventListener(`click`,Td.__handleDocClick,!0),Td.__docListenerAttached=!0)}static __maybeRemoveDocListener(){Td.__docListenerAttached&&Td.__instances.size===0&&(document.removeEventListener(`click`,Td.__handleDocClick,!0),Td.__docListenerAttached=!1)}connectedCallback(){super.connectedCallback(),this.id&&Td.__instances.set(this.id,this),Td.__ensureDocListener()}disconnectedCallback(){this.id&&Td.__instances.delete(this.id),Td.__maybeRemoveDocListener(),super.disconnectedCallback()}updated(e){e.has(`open`)&&this.__updateTriggersExpanded(),e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute(`aria-controls`)&&e.setAttribute(`aria-expanded`,String(this.open))})}__setOpen(e){let t=this.open;t!==e&&(this.open=e,this.dispatchEvent(new CustomEvent(`openchange`,{bubbles:!0,composed:!0,detail:{open:this.open}})),e&&!t?this.dispatchEvent(new CustomEvent(`open`,{bubbles:!0,composed:!0})):!e&&t&&this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0})))}static{this.styles=p`
|
|
11731
11737
|
/*
|
|
11732
11738
|
Designbrygga:
|
|
11733
11739
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -11999,9 +12005,9 @@
|
|
|
11999
12005
|
</div>
|
|
12000
12006
|
</div>
|
|
12001
12007
|
</div>
|
|
12002
|
-
`}async firstUpdated(){this.#e(),
|
|
12008
|
+
`}async firstUpdated(){this.#e(),Td.__iconLoaded||(await Promise.resolve().then(()=>(D(),zi)),Td.__iconLoaded=!0)}__hasLightDomSlot(e){return Array.from(this.children).some(t=>t.getAttribute(`slot`)===e)}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#e(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),n=this.mapSpacingToken(this.spacingBottom),r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight),a=t??e,o=n??e;a?this.style.setProperty(`--scb-fact-card-spacing-block-start`,a):this.style.removeProperty(`--scb-fact-card-spacing-block-start`),o?this.style.setProperty(`--scb-fact-card-spacing-block-end`,o):this.style.removeProperty(`--scb-fact-card-spacing-block-end`),r?this.style.setProperty(`--scb-fact-card-spacing-inline-start`,r):this.style.removeProperty(`--scb-fact-card-spacing-inline-start`),i?this.style.setProperty(`--scb-fact-card-spacing-inline-end`,i):this.style.removeProperty(`--scb-fact-card-spacing-inline-end`)}};N([_({type:String})],Dd.prototype,`variant`,void 0),N([_({type:String,attribute:`title`})],Dd.prototype,`title`,void 0),N([_({type:String,attribute:`subtitle`})],Dd.prototype,`subtitle`,void 0),N([_({type:String,attribute:`supporting-text`})],Dd.prototype,`supportingText`,void 0),N([_({type:String})],Dd.prototype,`icon`,void 0),N([_({type:Boolean,attribute:`show-close-button`})],Dd.prototype,`showCloseButton`,void 0),N([_({type:String,attribute:`close-label`})],Dd.prototype,`closeLabel`,void 0),N([v()],Dd.prototype,`__hasIconSlot`,void 0),N([_({type:Boolean,reflect:!0})],Dd.prototype,`open`,void 0),N([_({type:String,reflect:!0,converter:Ed})],Dd.prototype,`sizing`,void 0),N([_({type:String,reflect:!0})],Dd.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],Dd.prototype,`maxWidth`,void 0),N([_({type:String,reflect:!0})],Dd.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`})],Dd.prototype,`maxHeight`,void 0),N([_({type:String,reflect:!0})],Dd.prototype,`spacing`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-top`})],Dd.prototype,`spacingTop`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-bottom`})],Dd.prototype,`spacingBottom`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-left`})],Dd.prototype,`spacingLeft`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-right`})],Dd.prototype,`spacingRight`,void 0),Dd=Td=N([a(`scb-fact-card`)],Dd),w(),b(),P();var Od=class extends C{constructor(...e){super(...e),this.title=``}static{this.styles=p`
|
|
12003
12009
|
:host { display: none; }
|
|
12004
|
-
`}render(){return x`<slot></slot>`}};N([_({type:String,reflect:!0})],
|
|
12010
|
+
`}render(){return x`<slot></slot>`}};N([_({type:String,reflect:!0})],Od.prototype,`title`,void 0),Od=N([a(`scb-footer-section`)],Od);var kd=n({ScbGridItem:()=>jd}),Ad,jd,Md=t((()=>{w(),b(),P(),Ad={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},jd=class extends C{constructor(...e){super(...e),this.fit=!1}static{this.styles=p`
|
|
12005
12011
|
:host {
|
|
12006
12012
|
box-sizing: border-box;
|
|
12007
12013
|
display: block;
|
|
@@ -12032,7 +12038,7 @@
|
|
|
12032
12038
|
block-size: 100%;
|
|
12033
12039
|
inline-size: 100%;
|
|
12034
12040
|
}
|
|
12035
|
-
`}firstUpdated(){this.#e()}updated(){this.#e()}#e(){this.#t(`--col-span`,this.hasAttribute(`col-span`)?String(this.colSpan):null),this.#t(`--col-span-compact`,this.hasAttribute(`col-span-compact`)?String(this.colSpanCompact):null),this.#t(`--col-span-medium`,this.hasAttribute(`col-span-medium`)?String(this.colSpanMedium):null),this.#t(`--col-span-expanded`,this.hasAttribute(`col-span-expanded`)?String(this.colSpanExpanded):null),this.#t(`--row-rule`,this.hasAttribute(`row-span`)?`span ${this.rowSpan}`:null),this.#t(`--row-rule-compact`,this.hasAttribute(`row-span-compact`)?`span ${this.rowSpanCompact}`:null),this.#t(`--row-rule-medium`,this.hasAttribute(`row-span-medium`)?`span ${this.rowSpanMedium}`:null),this.#t(`--row-rule-expanded`,this.hasAttribute(`row-span-expanded`)?`span ${this.rowSpanExpanded}`:null),this.align?(this.style.setProperty(`--scb-grid-item-align`,this.align),this.style.setProperty(`align-self`,this.align)):(this.style.setProperty(`--scb-grid-item-align`,`initial`),this.style.removeProperty(`align-self`)),this.justify?(this.style.setProperty(`--scb-grid-item-justify`,this.justify),this.style.setProperty(`justify-self`,this.justify)):(this.style.setProperty(`--scb-grid-item-justify`,`initial`),this.style.removeProperty(`justify-self`))}#t(e,t){this.style.setProperty(e,t===null||t===``?`initial`:t)}render(){return x`<slot></slot>`}},N([_({type:Number,attribute:`col-span`,reflect:!0})],
|
|
12041
|
+
`}firstUpdated(){this.#e()}updated(){this.#e()}#e(){this.#t(`--col-span`,this.hasAttribute(`col-span`)?String(this.colSpan):null),this.#t(`--col-span-compact`,this.hasAttribute(`col-span-compact`)?String(this.colSpanCompact):null),this.#t(`--col-span-medium`,this.hasAttribute(`col-span-medium`)?String(this.colSpanMedium):null),this.#t(`--col-span-expanded`,this.hasAttribute(`col-span-expanded`)?String(this.colSpanExpanded):null),this.#t(`--row-rule`,this.hasAttribute(`row-span`)?`span ${this.rowSpan}`:null),this.#t(`--row-rule-compact`,this.hasAttribute(`row-span-compact`)?`span ${this.rowSpanCompact}`:null),this.#t(`--row-rule-medium`,this.hasAttribute(`row-span-medium`)?`span ${this.rowSpanMedium}`:null),this.#t(`--row-rule-expanded`,this.hasAttribute(`row-span-expanded`)?`span ${this.rowSpanExpanded}`:null),this.align?(this.style.setProperty(`--scb-grid-item-align`,this.align),this.style.setProperty(`align-self`,this.align)):(this.style.setProperty(`--scb-grid-item-align`,`initial`),this.style.removeProperty(`align-self`)),this.justify?(this.style.setProperty(`--scb-grid-item-justify`,this.justify),this.style.setProperty(`justify-self`,this.justify)):(this.style.setProperty(`--scb-grid-item-justify`,`initial`),this.style.removeProperty(`justify-self`))}#t(e,t){this.style.setProperty(e,t===null||t===``?`initial`:t)}render(){return x`<slot></slot>`}},N([_({type:Number,attribute:`col-span`,reflect:!0})],jd.prototype,`colSpan`,void 0),N([_({type:Number,attribute:`col-span-compact`,reflect:!0})],jd.prototype,`colSpanCompact`,void 0),N([_({type:Number,attribute:`col-span-medium`,reflect:!0})],jd.prototype,`colSpanMedium`,void 0),N([_({type:Number,attribute:`col-span-expanded`,reflect:!0})],jd.prototype,`colSpanExpanded`,void 0),N([_({type:Number,attribute:`row-span`,reflect:!0})],jd.prototype,`rowSpan`,void 0),N([_({type:Number,attribute:`row-span-compact`,reflect:!0})],jd.prototype,`rowSpanCompact`,void 0),N([_({type:Number,attribute:`row-span-medium`,reflect:!0})],jd.prototype,`rowSpanMedium`,void 0),N([_({type:Number,attribute:`row-span-expanded`,reflect:!0})],jd.prototype,`rowSpanExpanded`,void 0),N([_({type:String,reflect:!0})],jd.prototype,`align`,void 0),N([_({type:String,reflect:!0})],jd.prototype,`justify`,void 0),N([_({type:Boolean,reflect:!0,converter:Ad})],jd.prototype,`fit`,void 0),jd=N([a(`scb-grid-item`)],jd)})),Nd,Pd,Fd=t((()=>{w(),b(),P(),Nd={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},Pd=class extends C{constructor(...e){super(...e),this.direction=`column`,this.gap=``,this.rowGap=``,this.columnGap=``,this.align=`stretch`,this.justify=`start`,this.wrap=!1,this.inline=!1}static{this.styles=p`
|
|
12036
12042
|
:host {
|
|
12037
12043
|
box-sizing: border-box;
|
|
12038
12044
|
display: block;
|
|
@@ -12072,7 +12078,7 @@
|
|
|
12072
12078
|
}
|
|
12073
12079
|
|
|
12074
12080
|
/* design:bindings:scb-stack:end */
|
|
12075
|
-
`}firstUpdated(){this.#e()}updated(){this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};let t=e.trim().split(/\s+/);if(t.length===1){let e=this.mapSpacingToken(t[0]);return{row:e,col:e}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}#e(){this.style.setProperty(`--scb-stack-direction`,this.direction);let e=`var(--scb-stack-design-layout-gap-medium)`,t=this.parseGapShorthand(this.gap),n=this.mapSpacingToken(this.rowGap)??t.row??e,r=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty(`--scb-stack-gap`,`${n}`),this.style.setProperty(`--scb-stack-row-gap`,n),this.style.setProperty(`--scb-stack-column-gap`,r),this.style.setProperty(`--scb-stack-align`,{start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`,baseline:`baseline`}[this.align]??`stretch`),this.style.setProperty(`--scb-stack-justify`,{start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`,around:`space-around`,evenly:`space-evenly`}[this.justify]??`flex-start`),this.style.setProperty(`--scb-stack-wrap`,this.wrap?`wrap`:`nowrap`)}render(){return x`<div class="base"><slot></slot></div>`}},N([_({type:String,reflect:!0})],
|
|
12081
|
+
`}firstUpdated(){this.#e()}updated(){this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};let t=e.trim().split(/\s+/);if(t.length===1){let e=this.mapSpacingToken(t[0]);return{row:e,col:e}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}#e(){this.style.setProperty(`--scb-stack-direction`,this.direction);let e=`var(--scb-stack-design-layout-gap-medium)`,t=this.parseGapShorthand(this.gap),n=this.mapSpacingToken(this.rowGap)??t.row??e,r=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty(`--scb-stack-gap`,`${n}`),this.style.setProperty(`--scb-stack-row-gap`,n),this.style.setProperty(`--scb-stack-column-gap`,r),this.style.setProperty(`--scb-stack-align`,{start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`,baseline:`baseline`}[this.align]??`stretch`),this.style.setProperty(`--scb-stack-justify`,{start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`,around:`space-around`,evenly:`space-evenly`}[this.justify]??`flex-start`),this.style.setProperty(`--scb-stack-wrap`,this.wrap?`wrap`:`nowrap`)}render(){return x`<div class="base"><slot></slot></div>`}},N([_({type:String,reflect:!0})],Pd.prototype,`direction`,void 0),N([_({type:String,reflect:!0})],Pd.prototype,`gap`,void 0),N([_({type:String,attribute:`row-gap`,reflect:!0})],Pd.prototype,`rowGap`,void 0),N([_({type:String,attribute:`column-gap`,reflect:!0})],Pd.prototype,`columnGap`,void 0),N([_({type:String,reflect:!0})],Pd.prototype,`align`,void 0),N([_({type:String,reflect:!0})],Pd.prototype,`justify`,void 0),N([_({type:Boolean,reflect:!0,converter:Nd})],Pd.prototype,`wrap`,void 0),N([_({type:Boolean,reflect:!0,converter:Nd})],Pd.prototype,`inline`,void 0),Pd=N([a(`scb-stack`)],Pd)})),Id=n({ScbGrid:()=>Ld}),Ld,Rd=t((()=>{w(),b(),Md(),Fd(),P(),Ld=class extends C{constructor(...e){super(...e),this.colsCompact=4,this.colsMedium=8,this.colsExpanded=12,this.gap=``,this.rowGap=``,this.columnGap=``,this.alignItems=`stretch`,this.justifyItems=`stretch`,this.paddingInline=``,this.paddingBlock=``,this.maxWidth=``,this.autoRows=``}static{this.styles=p`
|
|
12076
12082
|
:host {
|
|
12077
12083
|
box-sizing: border-box;
|
|
12078
12084
|
display: block;
|
|
@@ -12178,7 +12184,7 @@
|
|
|
12178
12184
|
}
|
|
12179
12185
|
|
|
12180
12186
|
/* design:bindings:scb-grid:end */
|
|
12181
|
-
`}firstUpdated(){this.#e()}updated(){this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};let t=e.trim().split(/\s+/);if(t.length===1){let e=this.mapSpacingToken(t[0]);return{row:e,col:e}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}#e(){this.style.setProperty(`--scb-grid-cols-compact`,String(this.colsCompact)),this.style.setProperty(`--scb-grid-cols-medium`,String(this.colsMedium)),this.style.setProperty(`--scb-grid-cols-expanded`,String(this.colsExpanded));let e=`var(--scb-grid-design-layout-gap-medium)`,t=this.parseGapShorthand(this.gap),n=this.mapSpacingToken(this.rowGap)??t.row??e,r=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty(`--scb-grid-row-gap`,n),this.style.setProperty(`--scb-grid-column-gap`,r),this.style.setProperty(`--scb-grid-gap`,`${n} ${r}`),this.style.setProperty(`--scb-grid-align-items`,this.alignItems),this.style.setProperty(`--scb-grid-justify-items`,this.justifyItems);let i=this.mapSpacingToken(this.paddingInline),a=this.mapSpacingToken(this.paddingBlock);this.style.setProperty(`--scb-grid-max-width`,this.maxWidth||`var(--scb-grid-default-max-width, 1440px)`),this.style.setProperty(`--scb-grid-padding-inline`,i??`0`),this.style.setProperty(`--scb-grid-padding-block`,a??`0`),this.style.setProperty(`--scb-grid-auto-rows`,this.autoRows||`auto`)}render(){return x`<div class="grid"><slot></slot></div>`}},N([_({type:Number,attribute:`cols-compact`,reflect:!0})],
|
|
12187
|
+
`}firstUpdated(){this.#e()}updated(){this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}parseGapShorthand(e){if(!e)return{};let t=e.trim().split(/\s+/);if(t.length===1){let e=this.mapSpacingToken(t[0]);return{row:e,col:e}}return{row:this.mapSpacingToken(t[0]),col:this.mapSpacingToken(t[1])}}#e(){this.style.setProperty(`--scb-grid-cols-compact`,String(this.colsCompact)),this.style.setProperty(`--scb-grid-cols-medium`,String(this.colsMedium)),this.style.setProperty(`--scb-grid-cols-expanded`,String(this.colsExpanded));let e=`var(--scb-grid-design-layout-gap-medium)`,t=this.parseGapShorthand(this.gap),n=this.mapSpacingToken(this.rowGap)??t.row??e,r=this.mapSpacingToken(this.columnGap)??t.col??e;this.style.setProperty(`--scb-grid-row-gap`,n),this.style.setProperty(`--scb-grid-column-gap`,r),this.style.setProperty(`--scb-grid-gap`,`${n} ${r}`),this.style.setProperty(`--scb-grid-align-items`,this.alignItems),this.style.setProperty(`--scb-grid-justify-items`,this.justifyItems);let i=this.mapSpacingToken(this.paddingInline),a=this.mapSpacingToken(this.paddingBlock);this.style.setProperty(`--scb-grid-max-width`,this.maxWidth||`var(--scb-grid-default-max-width, 1440px)`),this.style.setProperty(`--scb-grid-padding-inline`,i??`0`),this.style.setProperty(`--scb-grid-padding-block`,a??`0`),this.style.setProperty(`--scb-grid-auto-rows`,this.autoRows||`auto`)}render(){return x`<div class="grid"><slot></slot></div>`}},N([_({type:Number,attribute:`cols-compact`,reflect:!0})],Ld.prototype,`colsCompact`,void 0),N([_({type:Number,attribute:`cols-medium`,reflect:!0})],Ld.prototype,`colsMedium`,void 0),N([_({type:Number,attribute:`cols-expanded`,reflect:!0})],Ld.prototype,`colsExpanded`,void 0),N([_({type:String,reflect:!0})],Ld.prototype,`gap`,void 0),N([_({type:String,attribute:`row-gap`,reflect:!0})],Ld.prototype,`rowGap`,void 0),N([_({type:String,attribute:`column-gap`,reflect:!0})],Ld.prototype,`columnGap`,void 0),N([_({type:String,attribute:`align-items`,reflect:!0})],Ld.prototype,`alignItems`,void 0),N([_({type:String,attribute:`justify-items`,reflect:!0})],Ld.prototype,`justifyItems`,void 0),N([_({type:String,attribute:`padding-inline`,reflect:!0})],Ld.prototype,`paddingInline`,void 0),N([_({type:String,attribute:`padding-block`,reflect:!0})],Ld.prototype,`paddingBlock`,void 0),N([_({type:String,attribute:`max-width`,reflect:!0})],Ld.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`auto-rows`,reflect:!0})],Ld.prototype,`autoRows`,void 0),Ld=N([a(`scb-grid`)],Ld)}));w(),b(),gl(),Rd(),Md(),P();var zd={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},Bd=class extends C{constructor(...e){super(...e),this.maxWidth=`1440px`,this.deferPaint=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.sections=[],this.description=`Statistikmyndigheten SCB förser samhället med statistik för beslutsfattande, debatt och forskning.`,this.navigationLabel=`Sidfot med länkar`,this.#e=null,this.#t=``,this.#r=!1,this.#i=`scb-footer-${Math.random().toString(36).slice(2)}-sec`}#e;#t;#n;#r;#i;static{this.styles=p`
|
|
12182
12188
|
:host {
|
|
12183
12189
|
display: block;
|
|
12184
12190
|
color: var(--scb-footer-content-color, var(--p-100));
|
|
@@ -12437,7 +12443,7 @@
|
|
|
12437
12443
|
</div>
|
|
12438
12444
|
</div>
|
|
12439
12445
|
</footer>
|
|
12440
|
-
`}};N([_({type:String,attribute:`max-width`,reflect:!0,converter:{fromAttribute:e=>{if(e==null)return`1440px`;let t=e.trim();return t===``?`1440px`:/^\d+$/.test(t)?`${t}px`:t}}})],
|
|
12446
|
+
`}};N([_({type:String,attribute:`max-width`,reflect:!0,converter:{fromAttribute:e=>{if(e==null)return`1440px`;let t=e.trim();return t===``?`1440px`:/^\d+$/.test(t)?`${t}px`:t}}})],Bd.prototype,`maxWidth`,void 0),N([_({type:Boolean,reflect:!0,attribute:`defer-paint`,converter:zd})],Bd.prototype,`deferPaint`,void 0),N([_({type:String,reflect:!0})],Bd.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Bd.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Bd.prototype,`spacingBottom`,void 0),N([_({type:Array})],Bd.prototype,`sections`,void 0),N([_({type:String})],Bd.prototype,`description`,void 0),N([_({type:String,attribute:`navigation-label`})],Bd.prototype,`navigationLabel`,void 0),Bd=N([a(`scb-footer`)],Bd),w(),b(),uc(),P();var Vd=class extends C{constructor(...e){super(...e),this.icon=``,this.size=lc[`scb-icon`].size,this.filled=!1,this.label=``}static{this.styles=p`
|
|
12441
12447
|
:host {
|
|
12442
12448
|
display: inline-flex;
|
|
12443
12449
|
inline-size: var(--scb-icon-size, var(--scb-icon-design-icon-medium));
|
|
@@ -12519,7 +12525,7 @@
|
|
|
12519
12525
|
aria-label=${t||S}
|
|
12520
12526
|
role=${t?`img`:S}
|
|
12521
12527
|
>${e}</span>
|
|
12522
|
-
`}};N([_({type:String})],
|
|
12528
|
+
`}};N([_({type:String})],Vd.prototype,`icon`,void 0),N([_({type:String,reflect:!0})],Vd.prototype,`size`,void 0),N([_({type:Boolean,reflect:!0})],Vd.prototype,`filled`,void 0),N([_({type:String})],Vd.prototype,`label`,void 0),Vd=N([a(`scb-icon`)],Vd),w(),b(),D(),dl(),cc(),P();var Hd={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},X=class extends C{constructor(...e){super(...e),this.variant=`success`,this.direction=`horizontal`,this.title=``,this.notificationCardTitle=``,this.subtitle=``,this.supportingText=``,this.open=!1,this.linkText=``,this.linkHref=`#`,this.href=``,this.showIcon=!1,this.showCloseButton=!1,this.closeLabel=`Stäng meddelande`,this.sizing=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasHeading=!1,this.__hasSubtitle=!1,this.__hasSupportingText=!1,this.__hasFooter=!1,this.__hasIcon=!1,this._closeNotification=()=>{this.open=!1;let e=new CustomEvent(`openchange`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(e);let t=new CustomEvent(`notification-close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t);let n=new CustomEvent(`close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(n);let r=new CustomEvent(`Close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(r)},this.__syncSlots=()=>{this.__hasHeading=this.__slotHasContent(`heading`),this.__hasSubtitle=this.__slotHasContent(`subtitle`),this.__hasSupportingText=this.__slotHasContent(`supporting-text`),this.__hasFooter=this.__slotHasContent(`footer`),this.__hasIcon=this.__slotHasContent(`icon`)}}get#e(){return this.notificationCardTitle||this.title}static{this.styles=[p`
|
|
12523
12529
|
/*
|
|
12524
12530
|
Designbrygga:
|
|
12525
12531
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -13038,7 +13044,7 @@
|
|
|
13038
13044
|
</div>
|
|
13039
13045
|
`:null}
|
|
13040
13046
|
</div>
|
|
13041
|
-
`}};N([_({type:String,reflect:!0})],X.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],X.prototype,`direction`,void 0),N([_({type:String})],X.prototype,`title`,void 0),N([_({type:String,attribute:`notification-card-title`})],X.prototype,`notificationCardTitle`,void 0),N([_({type:String})],X.prototype,`subtitle`,void 0),N([_({type:String,attribute:`supporting-text`})],X.prototype,`supportingText`,void 0),N([_({type:Boolean,reflect:!0})],X.prototype,`open`,void 0),N([_({type:String,attribute:`link-text`})],X.prototype,`linkText`,void 0),N([_({type:String,attribute:`link-href`})],X.prototype,`linkHref`,void 0),N([_({type:String})],X.prototype,`href`,void 0),N([_({type:Boolean,attribute:`show-icon`})],X.prototype,`showIcon`,void 0),N([_({type:Boolean,attribute:`show-close-button`})],X.prototype,`showCloseButton`,void 0),N([_({type:String,attribute:`close-label`})],X.prototype,`closeLabel`,void 0),N([_({type:String,reflect:!0,converter:
|
|
13047
|
+
`}};N([_({type:String,reflect:!0})],X.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],X.prototype,`direction`,void 0),N([_({type:String})],X.prototype,`title`,void 0),N([_({type:String,attribute:`notification-card-title`})],X.prototype,`notificationCardTitle`,void 0),N([_({type:String})],X.prototype,`subtitle`,void 0),N([_({type:String,attribute:`supporting-text`})],X.prototype,`supportingText`,void 0),N([_({type:Boolean,reflect:!0})],X.prototype,`open`,void 0),N([_({type:String,attribute:`link-text`})],X.prototype,`linkText`,void 0),N([_({type:String,attribute:`link-href`})],X.prototype,`linkHref`,void 0),N([_({type:String})],X.prototype,`href`,void 0),N([_({type:Boolean,attribute:`show-icon`})],X.prototype,`showIcon`,void 0),N([_({type:Boolean,attribute:`show-close-button`})],X.prototype,`showCloseButton`,void 0),N([_({type:String,attribute:`close-label`})],X.prototype,`closeLabel`,void 0),N([_({type:String,reflect:!0,converter:Hd})],X.prototype,`sizing`,void 0),N([_({type:String,reflect:!0})],X.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],X.prototype,`maxWidth`,void 0),N([_({type:String,reflect:!0})],X.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`})],X.prototype,`maxHeight`,void 0),N([_({type:Boolean,reflect:!0,attribute:`full-height`})],X.prototype,`fullHeight`,void 0),N([_({type:Boolean,reflect:!0,attribute:`full-width`})],X.prototype,`fullWidth`,void 0),N([_({type:String})],X.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`})],X.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`})],X.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`})],X.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`})],X.prototype,`spacingRight`,void 0),N([v()],X.prototype,`__hasHeading`,void 0),N([v()],X.prototype,`__hasSubtitle`,void 0),N([v()],X.prototype,`__hasSupportingText`,void 0),N([v()],X.prototype,`__hasFooter`,void 0),N([v()],X.prototype,`__hasIcon`,void 0),X=N([a(`scb-notification-card`)],X),w(),b(),P();var Ud=class extends C{constructor(...e){super(...e),this.heading=`Det finns fel i formuläret`,this.headingLevel=`2`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=p`
|
|
13042
13048
|
:host {
|
|
13043
13049
|
display: block;
|
|
13044
13050
|
margin-block-start: var(--scb-form-error-summary-spacing-block-start, 0);
|
|
@@ -13142,7 +13148,7 @@
|
|
|
13142
13148
|
</div>
|
|
13143
13149
|
</scb-notification-card>
|
|
13144
13150
|
</div>
|
|
13145
|
-
`}#e(){return[`2`,`3`,`4`,`5`,`6`].includes(this.headingLevel)?this.headingLevel:`2`}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#n(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);this.#r(`--scb-form-error-summary-spacing-block-start`,t),this.#r(`--scb-form-error-summary-spacing-block-end`,n),this.#r(`--scb-form-error-summary-spacing-inline-start`,r),this.#r(`--scb-form-error-summary-spacing-inline-end`,i)}#r(e,t){t?this.style.setProperty(e,t):this.style.removeProperty(e)}};N([_({type:String,reflect:!0})],
|
|
13151
|
+
`}#e(){return[`2`,`3`,`4`,`5`,`6`].includes(this.headingLevel)?this.headingLevel:`2`}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#n(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);this.#r(`--scb-form-error-summary-spacing-block-start`,t),this.#r(`--scb-form-error-summary-spacing-block-end`,n),this.#r(`--scb-form-error-summary-spacing-inline-start`,r),this.#r(`--scb-form-error-summary-spacing-inline-end`,i)}#r(e,t){t?this.style.setProperty(e,t):this.style.removeProperty(e)}};N([_({type:String,reflect:!0})],Ud.prototype,`heading`,void 0),N([_({type:String,attribute:`heading-level`,reflect:!0})],Ud.prototype,`headingLevel`,void 0),N([_({type:String,reflect:!0})],Ud.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Ud.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Ud.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Ud.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Ud.prototype,`spacingRight`,void 0),Ud=N([a(`scb-form-error-summary`)],Ud),w();var Wd=new Map([[`arrow_forward`,`M12 4l-1.41 1.41L15.17 10H4v2h11.17l-4.58 4.59L12 18l8-8-8-8Z`],[`chevron_left`,`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59Z`],[`chevron_right`,`M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12l-4.58 4.59Z`],[`close`,`M18.3 5.71 16.89 4.3 12 9.17 7.11 4.3 5.7 5.71 10.59 10.6 5.7 15.49 7.11 16.9 12 12.01l4.89 4.89 1.41-1.41-4.89-4.89 4.89-4.89Z`],[`menu`,`M3 6h18v2H3V6Zm0 5h18v2H3v-2Zm0 5h18v2H3v-2Z`],[`open_in_new`,`M14 3h7v7h-2V6.41l-9.83 9.83-1.41-1.41L17.59 5H14V3ZM5 5h6v2H7v10h10v-4h2v6H5V5Z`],[`payments`,`M3 6h18v12H3V6Zm2 2v8h14V8H5Zm7 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM7 9h2v2H7V9Zm8 4h2v2h-2v-2Z`],[`person_4`,`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-8 8c0-3.31 3.58-6 8-6s8 2.69 8 6v1H4v-1Z`],[`price_change`,`M12 2 3 6v6c0 5 3.84 9.74 9 10 5.16-.26 9-5 9-10V6l-9-4Zm1 15h-2v-2h2v2Zm0-4h-2V7h2v6Zm-7 6.5V15h2v2.6a9.1 9.1 0 0 1-2-3.1Zm12-1.9V15h2a9.1 9.1 0 0 1-2 3.1Z`],[`search`,`M9.5 3a6.5 6.5 0 0 1 5.17 10.44l5.45 5.44-1.42 1.42-5.44-5.45A6.5 6.5 0 1 1 9.5 3Zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z`],[`trending_up`,`M16 6h5v5h-2V9.41l-6.17 6.17-4-4L3.41 17 2 15.59l6.83-6.83 4 4L17.59 8H16V6Z`],[`volume_up`,`M3 9v6h4l5 5V4L7 9H3Zm13.5 3a4.5 4.5 0 0 0-2.5-4.03v8.06A4.5 4.5 0 0 0 16.5 12Zm-2.5-8.7v2.06A7 7 0 0 1 18 12a7 7 0 0 1-4 6.64v2.06A9 9 0 0 0 20 12a9 9 0 0 0-6-8.7Z`],[`work`,`M10 4h4a2 2 0 0 1 2 2v2h4a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h4V6a2 2 0 0 1 2-2Zm0 4h4V6h-4v2Zm-6 2v8h16v-8H4Zm6 3h4v2h-4v-2Z`]]);function Gd(e,t=`material-icon`,n){let r=(e||``).trim(),i=Wd.get(r);return i?nt`
|
|
13146
13152
|
<svg
|
|
13147
13153
|
class=${`${t} scb-svg-icon`}
|
|
13148
13154
|
part=${n||S}
|
|
@@ -13152,7 +13158,7 @@
|
|
|
13152
13158
|
>
|
|
13153
13159
|
<path d=${i}></path>
|
|
13154
13160
|
</svg>
|
|
13155
|
-
`:S}w(),b(),P();var
|
|
13161
|
+
`:S}w(),b(),P();var Kd;function qd(){return Kd??=Promise.resolve().then(()=>(j(),nc)),Kd}var Jd=class extends C{constructor(...e){super(...e),this.variant=`standard`,this.width=`100%`,this.showScrollbar=!1,this.rightScrollButtonLabel=`Scrolla höger`,this.leftScrollButtonLabel=`Scrolla vänster`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap=``,this.snap=!1,this._canScrollLeft=!1,this._canScrollRight=!1,this.__scrollLeft=()=>{this.doScrollBy(-this.getScrollStep())},this.__scrollRight=()=>{this.doScrollBy(this.getScrollStep())},this.updateScrollButtons=()=>{let e=this.scrollerEl||this.shadowRoot?.querySelector(`.scb-horizontal-scroller`);if(!e){this._canScrollLeft=!1,this._canScrollRight=!1,this.toggleAttribute(`data-scroll-left`,!1),this.toggleAttribute(`data-scroll-right`,!1);return}let t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;this._canScrollLeft=t,this._canScrollRight=n,this.toggleAttribute(`data-scroll-left`,t),this.toggleAttribute(`data-scroll-right`,n)},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.__onFocusIn=()=>{qd().then(({ensureFocusRingReady:e})=>e())},this.__onLazyFocusRingKeydown=e=>{!(e instanceof KeyboardEvent)||e.key!==`Tab`||qd().then(({ensureFocusRingOnTab:t})=>t(e))},this.handleScroll=()=>{let e=this.scrollerEl;e&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias(`scb-scroll`,{scrollLeft:e.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias(`scb-scroll-start`,{scrollLeft:e.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias(`scb-scroll-end`,{scrollLeft:e.scrollLeft})},120),e.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias(`scb-scroll-right`,{scrollLeft:e.scrollLeft}):e.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias(`scb-scroll-left`,{scrollLeft:e.scrollLeft}),this.lastScrollLeft=e.scrollLeft)},this.handleWheel=e=>{let t=this.scrollerEl||this.shadowRoot?.querySelector(`.scb-horizontal-scroller`);if(!t||e.deltaY===0)return;let n=t.scrollLeft,r=n>0,i=n+t.clientWidth<t.scrollWidth-1;!r&&!i||(t.scrollLeft+=e.deltaY,t.scrollLeft!==n&&e.preventDefault())}}static{this.styles=p`
|
|
13156
13162
|
/*
|
|
13157
13163
|
Designstyrning:
|
|
13158
13164
|
- Gap, fade, slot-padding och scrollbarens defaultvärden kommer från src/tokens/source/sizing.json.
|
|
@@ -13440,7 +13446,7 @@
|
|
|
13440
13446
|
aria-label=${this.leftScrollButtonLabel}
|
|
13441
13447
|
@click=${this.__scrollLeft}
|
|
13442
13448
|
>
|
|
13443
|
-
${
|
|
13449
|
+
${Gd(`chevron_left`,`scroll-control-icon`)}
|
|
13444
13450
|
<span>${this.leftScrollButtonLabel}</span>
|
|
13445
13451
|
</button>
|
|
13446
13452
|
`:``}
|
|
@@ -13453,7 +13459,7 @@
|
|
|
13453
13459
|
@click=${this.__scrollRight}
|
|
13454
13460
|
>
|
|
13455
13461
|
<span>${this.rightScrollButtonLabel}</span>
|
|
13456
|
-
${
|
|
13462
|
+
${Gd(`chevron_right`,`scroll-control-icon`)}
|
|
13457
13463
|
</button>
|
|
13458
13464
|
`:``}
|
|
13459
13465
|
</div>
|
|
@@ -13466,7 +13472,7 @@
|
|
|
13466
13472
|
aria-label=${this.leftScrollButtonLabel}
|
|
13467
13473
|
@click=${this.__scrollLeft}
|
|
13468
13474
|
>
|
|
13469
|
-
${
|
|
13475
|
+
${Gd(`chevron_left`,`scroll-control-icon`)}
|
|
13470
13476
|
</button>
|
|
13471
13477
|
`:``}
|
|
13472
13478
|
<div class="scroll-shadow-left"></div>
|
|
@@ -13482,10 +13488,10 @@
|
|
|
13482
13488
|
aria-label=${this.rightScrollButtonLabel}
|
|
13483
13489
|
@click=${this.__scrollRight}
|
|
13484
13490
|
>
|
|
13485
|
-
${
|
|
13491
|
+
${Gd(`chevron_right`,`scroll-control-icon`)}
|
|
13486
13492
|
</button>
|
|
13487
13493
|
`:``}
|
|
13488
|
-
`}}};N([_({type:String,reflect:!0})],
|
|
13494
|
+
`}}};N([_({type:String,reflect:!0})],Jd.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],Jd.prototype,`width`,void 0),N([_({type:Boolean,reflect:!0,attribute:`show-scrollbar`})],Jd.prototype,`showScrollbar`,void 0),N([_({type:String,reflect:!0,attribute:`right-scroll-button-label`})],Jd.prototype,`rightScrollButtonLabel`,void 0),N([_({type:String,reflect:!0,attribute:`left-scroll-button-label`})],Jd.prototype,`leftScrollButtonLabel`,void 0),N([_({type:String,reflect:!0})],Jd.prototype,`spacing`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-top`})],Jd.prototype,`spacingTop`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-bottom`})],Jd.prototype,`spacingBottom`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-left`})],Jd.prototype,`spacingLeft`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-right`})],Jd.prototype,`spacingRight`,void 0),N([_({type:Boolean,reflect:!0,attribute:`content-flex`})],Jd.prototype,`contentFlex`,void 0),N([_({type:String,reflect:!0,attribute:`internal-gap`})],Jd.prototype,`internalGap`,void 0),N([_({type:Boolean,reflect:!0})],Jd.prototype,`snap`,void 0),N([v()],Jd.prototype,`_canScrollLeft`,void 0),N([v()],Jd.prototype,`_canScrollRight`,void 0),Jd=N([a(`scb-horizontal-scroller`)],Jd),w(),b(),Ol(),P();var Yd,Xd=class extends C{static{Yd=this}constructor(...e){super(...e),this.open=!1,this.variant=`scrim`,this.isStatic=!1,this.ariaLabel=``,this.__lastTriggerEl=null,this.#r=e=>{this.isStatic||this.#n(e)||this.#t()},this.#a=e=>{if(this.open){if(e.key===`Tab`){this.#o(e);return}e.key===`Escape`&&(this.#i(e)||(e.preventDefault(),e.stopPropagation(),this.#t()))}}}static{this.__instances=new Map}static{this.__docListenerAttached=!1}static __handleDocClick(e){let t=e.composedPath();for(let e of t){if(!(e instanceof Element))continue;let t=e.getAttribute(`data-overlay-open`),n=e.getAttribute(`data-overlay-close`),r=e.getAttribute(`data-overlay-toggle`),i=e.getAttribute(`aria-controls`),a=t||n||r||i;if(!a)continue;let o=Yd.__instances.get(a);if(!o){Yd.__instances.delete(a);continue}(!n||!o.contains(e))&&(o.__lastTriggerEl=e),t?o.#e(!0):n?o.#e(!1):o.#e(!o.open);break}}static __ensureDocListener(){Yd.__docListenerAttached||(document.addEventListener(`click`,Yd.__handleDocClick,!0),Yd.__docListenerAttached=!0)}static __maybeRemoveDocListener(){!Yd.__docListenerAttached||Yd.__instances.size>0||(document.removeEventListener(`click`,Yd.__handleDocClick,!0),Yd.__docListenerAttached=!1)}static{this.styles=p`
|
|
13489
13495
|
:host {
|
|
13490
13496
|
position: fixed;
|
|
13491
13497
|
inset: 0;
|
|
@@ -13555,7 +13561,7 @@
|
|
|
13555
13561
|
<slot></slot>
|
|
13556
13562
|
</div>
|
|
13557
13563
|
</div>
|
|
13558
|
-
`:S}connectedCallback(){super.connectedCallback(),this.id&&
|
|
13564
|
+
`:S}connectedCallback(){super.connectedCallback(),this.id&&Yd.__instances.set(this.id,this),Yd.__ensureDocListener(),window.addEventListener(`keydown`,this.#a)}updated(e){e.has(`open`)&&(this.#p(),this.open?(Sl(this.renderRoot.querySelector(`.scrim`)),this.#d()):(Tl(this),z(this.renderRoot.querySelector(`.scrim`)),this.#f()))}disconnectedCallback(){this.id&&Yd.__instances.delete(this.id),Yd.__maybeRemoveDocListener(),window.removeEventListener(`keydown`,this.#a),z(this.renderRoot.querySelector(`.scrim`)),super.disconnectedCallback()}};N([_({type:Boolean,reflect:!0})],Xd.prototype,`open`,void 0),N([_({type:String,reflect:!0})],Xd.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0,attribute:`static`})],Xd.prototype,`isStatic`,void 0),N([_({type:String,attribute:`aria-label`})],Xd.prototype,`ariaLabel`,void 0),Xd=Yd=N([a(`scb-overlay`)],Xd),w(),b(),P();var Zd={fromAttribute(e){return e===null||e.toLowerCase()!==`false`},toAttribute(e){return e?``:`false`}},Qd=class extends C{constructor(...e){super(...e),this.variant=`default`,this.enableClickCarousel=!0,this.imageFallbackAlt=`Galleri-bild`,this.openImageLabel=`Öppna bild i karusell`,this.openImagePrefixLabel=`Öppna bild:`,this.carouselLabel=`Bildkarusell`,this.overlayOpen=!1,this.overlayIndex=0,this.overlayImages=[],this.#e=[],this.#t=[],this.#n=``,this.#r=null,this.#i=()=>{this.#f()},this.#a=e=>{if(!this.enableClickCarousel)return;let t=e.currentTarget;t instanceof HTMLElement&&t.setAttribute(`data-scb-gallery-hover`,``)},this.#o=e=>{if(!this.enableClickCarousel)return;let t=e.currentTarget;t instanceof HTMLElement&&t.removeAttribute(`data-scb-gallery-hover`)},this.#s=e=>{if(!this.enableClickCarousel)return;let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=t.getAttribute(`data-scb-gallery-slide-index`);if(n==null)return;let r=Number(n);Number.isFinite(r)&&this.#h(r)},this.#c=e=>{this.enableClickCarousel&&(e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||(e.preventDefault(),this.#s(e)))},this.#g=()=>{this.overlayOpen=!1,this.#p()}}#e;#t;#n;#r;static{this.styles=p`
|
|
13559
13565
|
:host {
|
|
13560
13566
|
display: block;
|
|
13561
13567
|
}
|
|
@@ -13713,15 +13719,15 @@
|
|
|
13713
13719
|
</div>
|
|
13714
13720
|
</scb-overlay>
|
|
13715
13721
|
`:``}
|
|
13716
|
-
`}};N([_({type:String,reflect:!0})]
|
|
13722
|
+
`}};N([_({type:String,reflect:!0})],Qd.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0,attribute:`enable-carousel`,converter:Zd})],Qd.prototype,`enableClickCarousel`,void 0),N([_({type:String,attribute:`image-fallback-alt`})],Qd.prototype,`imageFallbackAlt`,void 0),N([_({type:String,attribute:`open-image-label`})],Qd.prototype,`openImageLabel`,void 0),N([_({type:String,attribute:`open-image-prefix-label`})],Qd.prototype,`openImagePrefixLabel`,void 0),N([_({type:String,attribute:`carousel-label`})],Qd.prototype,`carouselLabel`,void 0),N([v()],Qd.prototype,`overlayOpen`,void 0),N([v()],Qd.prototype,`overlayIndex`,void 0),N([v()],Qd.prototype,`overlayImages`,void 0),Qd=N([a(`scb-gallery-grid`)],Qd);var $d=class extends HTMLElement{get label(){return this.getAttribute(`label`)??``}set label(e){this.setAttribute(`label`,e)}get icon(){return this.getAttribute(`icon`)??void 0}set icon(e){e==null||e===``?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}connectedCallback(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`),this.style.display=`none`}};customElements.define(`scb-header-menu-group`,$d),w(),b(),P();var ef=class extends C{constructor(...e){super(...e),this.label=``,this.href=``}static{this.styles=p`
|
|
13717
13723
|
:host {
|
|
13718
13724
|
display: none !important;
|
|
13719
13725
|
}
|
|
13720
|
-
`}connectedCallback(){super.connectedCallback(),this._hideDataNode()}_hideDataNode(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`)}render(){return x`<slot></slot>`}};N([_({type:String})],
|
|
13726
|
+
`}connectedCallback(){super.connectedCallback(),this._hideDataNode()}_hideDataNode(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`)}render(){return x`<slot></slot>`}};N([_({type:String})],ef.prototype,`label`,void 0),N([_({type:String})],ef.prototype,`href`,void 0),N([_({type:String})],ef.prototype,`icon`,void 0),ef=N([a(`scb-header-menu-item`)],ef),w(),b(),P();var tf=class extends C{constructor(...e){super(...e),this.label=``,this.href=``,this.drawerId=``}static{this.styles=p`
|
|
13721
13727
|
:host {
|
|
13722
13728
|
display: none !important;
|
|
13723
13729
|
}
|
|
13724
|
-
`}connectedCallback(){super.connectedCallback(),this._hideDataNode()}_hideDataNode(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`)}render(){return x`<slot></slot>`}};N([_({type:String})],
|
|
13730
|
+
`}connectedCallback(){super.connectedCallback(),this._hideDataNode()}_hideDataNode(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`)}render(){return x`<slot></slot>`}};N([_({type:String})],tf.prototype,`label`,void 0),N([_({type:String})],tf.prototype,`href`,void 0),N([_({type:String,attribute:`drawer-id`})],tf.prototype,`drawerId`,void 0),tf=N([a(`scb-header-tab`)],tf);var nf=class extends HTMLElement{static get observedAttributes(){return[`role`]}get label(){return this.getAttribute(`label`)??``}set label(e){this.setAttribute(`label`,e)}get href(){return this.getAttribute(`href`)??`#`}set href(e){this.setAttribute(`href`,e)}get target(){return this.getAttribute(`target`)??void 0}set target(e){e==null?this.removeAttribute(`target`):this.setAttribute(`target`,e)}connectedCallback(){this.#e()}attributeChangedCallback(e){e===`role`&&this.#e()}#e(){this.hasAttribute(`role`)&&this.removeAttribute(`role`),this.setAttribute(`aria-hidden`,`true`),this.style.display=`none`}};customElements.define(`scb-header-utility`,nf);var rf,af,of,sf=t((()=>{w(),b(),yc(),P(),af={fromAttribute:e=>e!=null&&!/^(false|0|off|no)$/i.test(e),toAttribute:e=>e?``:null},of=class extends C{static{rf=this}constructor(...e){super(...e),this.label=``,this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon=``,this.itemHref=``,this.hasChildren=!1,this.loading=!1,this.showSubmenuLabel=`Visa undermeny för`,this.hideSubmenuLabel=`Dölj undermeny för`,this.loadingLabel=`Laddar…`,this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=e=>{e&&e.stopPropagation(),this.__isExpandable&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{let t=this.__keyboardItems(),n=t.indexOf(this);switch(e.key){case`ArrowDown`:{e.preventDefault();let r=t[n+1]||t[0];this.__focusMenuItem(r);break}case`ArrowUp`:{e.preventDefault();let r=t[n-1]||t[t.length-1];this.__focusMenuItem(r);break}case`Home`:{e.preventDefault();let n=t[0];this.__focusMenuItem(n);break}case`End`:{e.preventDefault();let n=t[t.length-1];this.__focusMenuItem(n);break}case`ArrowRight`:if(!this.__isExpandable)break;e.preventDefault(),this.expanded||this.__setExpanded(!0);break;case`ArrowLeft`:if(!this.__isExpandable)break;e.preventDefault(),this.expanded&&this.__setExpanded(!1);break}}}static{this.__rippleLoaded=!1}static{this.__iconLoaded=!1}static{this.__focusRingLoaded=!1}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}get __isExpandable(){return this.hasSlotContent||this.hasChildren}__submenuButtonLabel(){let e=this.expanded?this.hideSubmenuLabel:this.showSubmenuLabel;return this.label?`${e} ${this.label}`:e}async __ensureDepsLoaded(){rf.__rippleLoaded||(await Promise.resolve().then(()=>(E(),mn)),rf.__rippleLoaded=!0),rf.__focusRingLoaded||(await Promise.resolve().then(()=>(Vt(),zt)),rf.__focusRingLoaded=!0),this.leadingIcon&&!rf.__iconLoaded&&(await Promise.resolve().then(()=>(D(),zi)),rf.__iconLoaded=!0)}static{this.styles=p`
|
|
13725
13731
|
/*
|
|
13726
13732
|
Designbrygga:
|
|
13727
13733
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -14024,7 +14030,7 @@
|
|
|
14024
14030
|
</div>
|
|
14025
14031
|
</div>
|
|
14026
14032
|
</div>
|
|
14027
|
-
`}__isHiddenByCollapsedAncestor(e,t){let n=e.parentElement;for(;n&&n!==t;){if(n.localName===`scb-menu-item`&&!n.expanded)return!0;n=n.parentElement}return!1}__keyboardItems(){let e=this.closest(`scb-sub-menu, scb-menu`);return e?Array.from(e.querySelectorAll(`scb-menu-item`)).filter(t=>!this.__isHiddenByCollapsedAncestor(t,e)):[this]}__focusMenuItem(e){(e?.shadowRoot?.querySelector(`.scb-menu-label-text`))?.focus()}},N([_({type:String})],
|
|
14033
|
+
`}__isHiddenByCollapsedAncestor(e,t){let n=e.parentElement;for(;n&&n!==t;){if(n.localName===`scb-menu-item`&&!n.expanded)return!0;n=n.parentElement}return!1}__keyboardItems(){let e=this.closest(`scb-sub-menu, scb-menu`);return e?Array.from(e.querySelectorAll(`scb-menu-item`)).filter(t=>!this.__isHiddenByCollapsedAncestor(t,e)):[this]}__focusMenuItem(e){(e?.shadowRoot?.querySelector(`.scb-menu-label-text`))?.focus()}},N([_({type:String})],of.prototype,`label`,void 0),N([_({type:Boolean,reflect:!0})],of.prototype,`selected`,void 0),N([_({type:Boolean,attribute:`no-highlight-selected`,reflect:!0})],of.prototype,`noHighlightSelected`,void 0),N([_({type:String,attribute:`leading-icon`})],of.prototype,`leadingIcon`,void 0),N([_({type:String,attribute:`item-href`})],of.prototype,`itemHref`,void 0),N([_({type:Boolean,attribute:`has-children`,reflect:!0,converter:af})],of.prototype,`hasChildren`,void 0),N([_({type:Boolean,reflect:!0,converter:af})],of.prototype,`loading`,void 0),N([_({type:String,attribute:`show-submenu-label`})],of.prototype,`showSubmenuLabel`,void 0),N([_({type:String,attribute:`hide-submenu-label`})],of.prototype,`hideSubmenuLabel`,void 0),N([_({type:String,attribute:`loading-label`})],of.prototype,`loadingLabel`,void 0),N([v()],of.prototype,`hasSlotContent`,void 0),N([_({type:Boolean,reflect:!0})],of.prototype,`expanded`,void 0),of=rf=N([a(`scb-menu-item`)],of)})),cf,lf=t((()=>{w(),b(),Lu(),P(),cf=class extends C{constructor(...e){super(...e),this.label=``}static{this.styles=p`
|
|
14028
14034
|
/*
|
|
14029
14035
|
Designbrygga:
|
|
14030
14036
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -14082,7 +14088,7 @@
|
|
|
14082
14088
|
<div class="scb-menu-label">${this.label}</div>
|
|
14083
14089
|
</div>
|
|
14084
14090
|
`:``}
|
|
14085
|
-
`}},N([_({type:String})],
|
|
14091
|
+
`}},N([_({type:String})],cf.prototype,`label`,void 0),cf=N([a(`scb-menu-section`)],cf)})),uf,df=t((()=>{w(),b(),P(),uf=class extends C{constructor(...e){super(...e),this.label=``,this._onGlobalSelect=e=>{let t=e;this.querySelectorAll(`scb-menu-item`).forEach(e=>e.selected=!1),this.contains(t.detail.item)&&(t.detail.item.selected=!0)}}static{this.styles=p`
|
|
14086
14092
|
:host {
|
|
14087
14093
|
display: block;
|
|
14088
14094
|
width: 100%;
|
|
@@ -14091,7 +14097,7 @@
|
|
|
14091
14097
|
<nav aria-label="${this.label}">
|
|
14092
14098
|
<slot></slot>
|
|
14093
14099
|
</nav>
|
|
14094
|
-
`}},N([_({type:String})],
|
|
14100
|
+
`}},N([_({type:String})],uf.prototype,`label`,void 0),uf=N([a(`scb-sub-menu`)],uf)})),ff=n({ScbMenu:()=>pf}),pf,mf=t((()=>{w(),b(),Lu(),sf(),lf(),df(),P(),pf=class extends C{constructor(...e){super(...e),this.label=``,this.subLabel=``,this.noHighlightSelected=!1,this.elevation=!1,this.lazySrc=``,this.lazyIdParam=`id`,this.lazyChildrenField=``,this.lazyIdField=`id`,this.lazyLabelField=`label`,this.lazyHrefField=`href`,this.lazyHasChildrenField=`hasChildren`,this.lazyHasLinkField=`hasLink`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._lazyCache=new Map,this._onGlobalSelect=e=>{let t=e;this.querySelectorAll(`scb-menu-item`).forEach(e=>{e.selected=!1,this.noHighlightSelected?e.setAttribute(`no-highlight-selected`,``):e.removeAttribute(`no-highlight-selected`)}),this.contains(t.detail.item)&&(t.detail.item.selected=!0)},this._onMenuExpand=e=>{this._loadLazyChildren(e)}}static{this.styles=p`
|
|
14095
14101
|
/*
|
|
14096
14102
|
Designbrygga:
|
|
14097
14103
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -14204,9 +14210,9 @@
|
|
|
14204
14210
|
<slot></slot>
|
|
14205
14211
|
</div>
|
|
14206
14212
|
</nav>
|
|
14207
|
-
`}firstUpdated(e){super.firstUpdated(e),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#e(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-menu-spacing-block-start`,t):this.style.removeProperty(`--scb-menu-spacing-block-start`),n?this.style.setProperty(`--scb-menu-spacing-block-end`,n):this.style.removeProperty(`--scb-menu-spacing-block-end`),r?this.style.setProperty(`--scb-menu-spacing-inline-start`,r):this.style.removeProperty(`--scb-menu-spacing-inline-start`),i?this.style.setProperty(`--scb-menu-spacing-inline-end`,i):this.style.removeProperty(`--scb-menu-spacing-inline-end`)}connectedCallback(){super.connectedCallback(),window.addEventListener(`scb-menu-select`,this._onGlobalSelect),this.addEventListener(`scb-menu-expand`,this._onMenuExpand)}disconnectedCallback(){window.removeEventListener(`scb-menu-select`,this._onGlobalSelect),this.removeEventListener(`scb-menu-expand`,this._onMenuExpand),super.disconnectedCallback()}async _loadLazyChildren(e){if(!this.lazySrc)return;let t=e.detail?.item;if(!t||!this.contains(t)||!e.detail?.expanded||t.hasAttribute(`data-loaded`)||!t.hasAttribute(`has-children`)||e.detail?.lazy===!1||this._hasSubMenu(t))return;let n=t.getAttribute(`data-node-id`)??t.dataset.nodeId;if(n){this._setItemLoading(t,!0),t.removeAttribute(`data-load-error`);try{let e=await this._fetchLazyChildren(n),r=this._createSubMenu(t,e);t.appendChild(r),t.setAttribute(`data-loaded`,``),this.dispatchEvent(new CustomEvent(`scb-menu-lazy-load`,{bubbles:!0,composed:!0,detail:{item:t,nodeId:n,children:e}}))}catch(e){t.setAttribute(`data-load-error`,``),this.dispatchEvent(new CustomEvent(`scb-menu-lazy-error`,{bubbles:!0,composed:!0,detail:{item:t,nodeId:n,error:e}}))}finally{this._setItemLoading(t,!1)}}}_setItemLoading(e,t){e.loading=t,e.toggleAttribute(`loading`,t),t?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`)}_hasSubMenu(e){return Array.from(e.children).some(e=>e.tagName===`SCB-SUB-MENU`)}_createSubMenu(e,t){let n=document.createElement(`scb-sub-menu`);n.setAttribute(`label`,e.getAttribute(`label`)??``);for(let e of t)n.appendChild(this._createLazyMenuItem(e));return n}_createLazyMenuItem(e){let t=document.createElement(`scb-menu-item`),n=this._getRecordValue(e,this.lazyIdField,[`id`,`Id`]),r=this._getRecordValue(e,this.lazyLabelField,[`label`,`Label`,`name`,`Name`]),i=this._getRecordValue(e,this.lazyHrefField,[`href`,`Href`,`url`,`Url`]),a=this._toBoolean(this._getRecordValue(e,this.lazyHasChildrenField,[`hasChildren`,`HasChildren`])),o=this._getRecordValue(e,this.lazyHasLinkField,[`hasLink`,`HasLink`]),s=o==null?!!i:this._toBoolean(o);return r!=null&&t.setAttribute(`label`,String(r)),n!=null&&t.setAttribute(`data-node-id`,String(n)),a&&t.setAttribute(`has-children`,``),s&&i!=null&&String(i).trim()&&t.setAttribute(`item-href`,String(i)),t}async _fetchLazyChildren(e){let t=`${this.lazySrc}|${this.lazyIdParam}|${e}`,n=this._lazyCache.get(t);return n||(n=fetch(this._createLazyUrl(e),{credentials:`same-origin`}).then(async e=>{if(!e.ok)throw Error(`Kunde inte ladda menybarn (${e.status}).`);let t=await e.json();return this._normalizeChildren(t)}).catch(e=>{throw this._lazyCache.delete(t),e}),this._lazyCache.set(t,n)),n}_createLazyUrl(e){if(this.lazySrc.includes(`{id}`))return this.lazySrc.split(`{id}`).join(encodeURIComponent(e));let t=new URL(this.lazySrc,document.baseURI);return this.lazyIdParam&&t.searchParams.set(this.lazyIdParam,e),t.toString()}_normalizeChildren(e){let t=Array.isArray(e)?e:this._getRecordValue(e,this.lazyChildrenField,[`children`,`Children`,`items`,`Items`,`data`,`Data`]);return Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)):[]}_getRecordValue(e,t,n=[]){if(!e||typeof e!=`object`||Array.isArray(e))return;let r=e,i=[t,...n].filter(Boolean);for(let e of i){if(e in r)return r[e];let t=Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase());if(t)return r[t]}}_toBoolean(e){return typeof e==`boolean`?e:typeof e==`number`?e!==0:typeof e==`string`?!/^(false|0|off|no|nej)$/i.test(e.trim()):!!e}},N([_({type:String})],
|
|
14213
|
+
`}firstUpdated(e){super.firstUpdated(e),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#e(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-menu-spacing-block-start`,t):this.style.removeProperty(`--scb-menu-spacing-block-start`),n?this.style.setProperty(`--scb-menu-spacing-block-end`,n):this.style.removeProperty(`--scb-menu-spacing-block-end`),r?this.style.setProperty(`--scb-menu-spacing-inline-start`,r):this.style.removeProperty(`--scb-menu-spacing-inline-start`),i?this.style.setProperty(`--scb-menu-spacing-inline-end`,i):this.style.removeProperty(`--scb-menu-spacing-inline-end`)}connectedCallback(){super.connectedCallback(),window.addEventListener(`scb-menu-select`,this._onGlobalSelect),this.addEventListener(`scb-menu-expand`,this._onMenuExpand)}disconnectedCallback(){window.removeEventListener(`scb-menu-select`,this._onGlobalSelect),this.removeEventListener(`scb-menu-expand`,this._onMenuExpand),super.disconnectedCallback()}async _loadLazyChildren(e){if(!this.lazySrc)return;let t=e.detail?.item;if(!t||!this.contains(t)||!e.detail?.expanded||t.hasAttribute(`data-loaded`)||!t.hasAttribute(`has-children`)||e.detail?.lazy===!1||this._hasSubMenu(t))return;let n=t.getAttribute(`data-node-id`)??t.dataset.nodeId;if(n){this._setItemLoading(t,!0),t.removeAttribute(`data-load-error`);try{let e=await this._fetchLazyChildren(n),r=this._createSubMenu(t,e);t.appendChild(r),t.setAttribute(`data-loaded`,``),this.dispatchEvent(new CustomEvent(`scb-menu-lazy-load`,{bubbles:!0,composed:!0,detail:{item:t,nodeId:n,children:e}}))}catch(e){t.setAttribute(`data-load-error`,``),this.dispatchEvent(new CustomEvent(`scb-menu-lazy-error`,{bubbles:!0,composed:!0,detail:{item:t,nodeId:n,error:e}}))}finally{this._setItemLoading(t,!1)}}}_setItemLoading(e,t){e.loading=t,e.toggleAttribute(`loading`,t),t?e.setAttribute(`aria-busy`,`true`):e.removeAttribute(`aria-busy`)}_hasSubMenu(e){return Array.from(e.children).some(e=>e.tagName===`SCB-SUB-MENU`)}_createSubMenu(e,t){let n=document.createElement(`scb-sub-menu`);n.setAttribute(`label`,e.getAttribute(`label`)??``);for(let e of t)n.appendChild(this._createLazyMenuItem(e));return n}_createLazyMenuItem(e){let t=document.createElement(`scb-menu-item`),n=this._getRecordValue(e,this.lazyIdField,[`id`,`Id`]),r=this._getRecordValue(e,this.lazyLabelField,[`label`,`Label`,`name`,`Name`]),i=this._getRecordValue(e,this.lazyHrefField,[`href`,`Href`,`url`,`Url`]),a=this._toBoolean(this._getRecordValue(e,this.lazyHasChildrenField,[`hasChildren`,`HasChildren`])),o=this._getRecordValue(e,this.lazyHasLinkField,[`hasLink`,`HasLink`]),s=o==null?!!i:this._toBoolean(o);return r!=null&&t.setAttribute(`label`,String(r)),n!=null&&t.setAttribute(`data-node-id`,String(n)),a&&t.setAttribute(`has-children`,``),s&&i!=null&&String(i).trim()&&t.setAttribute(`item-href`,String(i)),t}async _fetchLazyChildren(e){let t=`${this.lazySrc}|${this.lazyIdParam}|${e}`,n=this._lazyCache.get(t);return n||(n=fetch(this._createLazyUrl(e),{credentials:`same-origin`}).then(async e=>{if(!e.ok)throw Error(`Kunde inte ladda menybarn (${e.status}).`);let t=await e.json();return this._normalizeChildren(t)}).catch(e=>{throw this._lazyCache.delete(t),e}),this._lazyCache.set(t,n)),n}_createLazyUrl(e){if(this.lazySrc.includes(`{id}`))return this.lazySrc.split(`{id}`).join(encodeURIComponent(e));let t=new URL(this.lazySrc,document.baseURI);return this.lazyIdParam&&t.searchParams.set(this.lazyIdParam,e),t.toString()}_normalizeChildren(e){let t=Array.isArray(e)?e:this._getRecordValue(e,this.lazyChildrenField,[`children`,`Children`,`items`,`Items`,`data`,`Data`]);return Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&!Array.isArray(e)):[]}_getRecordValue(e,t,n=[]){if(!e||typeof e!=`object`||Array.isArray(e))return;let r=e,i=[t,...n].filter(Boolean);for(let e of i){if(e in r)return r[e];let t=Object.keys(r).find(t=>t.toLowerCase()===e.toLowerCase());if(t)return r[t]}}_toBoolean(e){return typeof e==`boolean`?e:typeof e==`number`?e!==0:typeof e==`string`?!/^(false|0|off|no|nej)$/i.test(e.trim()):!!e}},N([_({type:String})],pf.prototype,`label`,void 0),N([_({type:String,attribute:`sub-label`})],pf.prototype,`subLabel`,void 0),N([_({type:Boolean,attribute:`no-highlight-selected`,reflect:!0})],pf.prototype,`noHighlightSelected`,void 0),N([_({type:Boolean,reflect:!0})],pf.prototype,`elevation`,void 0),N([_({type:String,attribute:`lazy-src`})],pf.prototype,`lazySrc`,void 0),N([_({type:String,attribute:`lazy-id-param`})],pf.prototype,`lazyIdParam`,void 0),N([_({type:String,attribute:`lazy-children-field`})],pf.prototype,`lazyChildrenField`,void 0),N([_({type:String,attribute:`lazy-id-field`})],pf.prototype,`lazyIdField`,void 0),N([_({type:String,attribute:`lazy-label-field`})],pf.prototype,`lazyLabelField`,void 0),N([_({type:String,attribute:`lazy-href-field`})],pf.prototype,`lazyHrefField`,void 0),N([_({type:String,attribute:`lazy-has-children-field`})],pf.prototype,`lazyHasChildrenField`,void 0),N([_({type:String,attribute:`lazy-has-link-field`})],pf.prototype,`lazyHasLinkField`,void 0),N([_({type:String,reflect:!0})],pf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],pf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],pf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],pf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],pf.prototype,`spacingRight`,void 0),pf=N([a(`scb-menu`)],pf)})),hf=n({renderHeaderDrawer:()=>vf}),gf,_f,vf,yf=t((()=>{w(),gf=e=>!e||e.length===0?x``:x`${e.map(_f)}`,_f=e=>{let t=Array.isArray(e.children)&&e.children.length>0,n=(e.href??``).trim(),r=(e.icon??``).trim(),i=t?x`
|
|
14208
14214
|
<scb-sub-menu label=${e.label}>
|
|
14209
|
-
${e.children.map(
|
|
14215
|
+
${e.children.map(_f)}
|
|
14210
14216
|
</scb-sub-menu>
|
|
14211
14217
|
`:S;return r&&n?x`
|
|
14212
14218
|
<scb-menu-item label=${e.label} ?selected=${!1} leading-icon=${r} item-href=${n}>
|
|
@@ -14220,7 +14226,7 @@
|
|
|
14220
14226
|
<scb-menu-item label=${e.label} ?selected=${!1} item-href=${n}>
|
|
14221
14227
|
${i}
|
|
14222
14228
|
</scb-menu-item>
|
|
14223
|
-
`:x`<scb-menu-item label=${e.label} ?selected=${!1}>${i}</scb-menu-item>`},
|
|
14229
|
+
`:x`<scb-menu-item label=${e.label} ?selected=${!1}>${i}</scb-menu-item>`},vf=e=>x`
|
|
14224
14230
|
<scb-drawer
|
|
14225
14231
|
id=${e.drawerId}
|
|
14226
14232
|
floating
|
|
@@ -14262,7 +14268,7 @@
|
|
|
14262
14268
|
></scb-menu-section>
|
|
14263
14269
|
`:S}
|
|
14264
14270
|
|
|
14265
|
-
${
|
|
14271
|
+
${gf(e.menu)}
|
|
14266
14272
|
|
|
14267
14273
|
${e.includeUtilityInMenu&&(e.utils?.length??0)>0?x`
|
|
14268
14274
|
<scb-menu-section label=''></scb-menu-section>
|
|
@@ -14276,7 +14282,7 @@
|
|
|
14276
14282
|
</scb-menu>
|
|
14277
14283
|
`}
|
|
14278
14284
|
</scb-drawer>
|
|
14279
|
-
`})),
|
|
14285
|
+
`})),bf=n({ScbSkeleton:()=>xf}),xf,Sf=t((()=>{w(),b(),P(),xf=class extends C{constructor(...e){super(...e),this.variant=`rectangular`,this.width=`100%`,this.height=`100%`,this.borderSize=`small`,this.assistiveText=``,this._managedAriaHidden=!1,this._managedRole=!1,this._managedAriaLive=!1,this._managedAriaLabel=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=p`
|
|
14280
14286
|
:host {
|
|
14281
14287
|
display: inline-block;
|
|
14282
14288
|
max-width: var(--scb-skeleton-width);
|
|
@@ -14330,7 +14336,7 @@
|
|
|
14330
14336
|
<div
|
|
14331
14337
|
class="skeleton${this.variant===`circular`?` circle`:``} ${this.variant===`rounded`?` rounded`:``}"
|
|
14332
14338
|
><slot></slot></div>
|
|
14333
|
-
`}},N([_({type:String})],
|
|
14339
|
+
`}},N([_({type:String})],xf.prototype,`variant`,void 0),N([_({type:String})],xf.prototype,`width`,void 0),N([_({type:String})],xf.prototype,`height`,void 0),N([_({type:String,attribute:`border-size`})],xf.prototype,`borderSize`,void 0),N([_({type:String,attribute:`assistive-text`})],xf.prototype,`assistiveText`,void 0),N([_({type:String,reflect:!0})],xf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],xf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],xf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],xf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],xf.prototype,`spacingRight`,void 0),xf=N([a(`scb-skeleton`)],xf)}));w(),b(),uc(),P();var Cf,wf=0,Tf=new Set([`search`,`actions`,`actions-desktop`,`actions-mobile`]),Ef=[0,2,4,8,12,16,20,24,32,40,48,64,80,96,120];(()=>{if(typeof window>`u`||typeof document>`u`||!(`customElements`in window)||document.head.querySelector(`style[data-scb-header-pre-upgrade]`))return;let e=document.createElement(`style`);e.setAttribute(`data-scb-header-pre-upgrade`,``),e.textContent=`
|
|
14334
14340
|
scb-header:not(:defined),
|
|
14335
14341
|
scb-header[data-upgrading] {
|
|
14336
14342
|
display: block;
|
|
@@ -14383,7 +14389,7 @@
|
|
|
14383
14389
|
);
|
|
14384
14390
|
}
|
|
14385
14391
|
}
|
|
14386
|
-
`,document.head.appendChild(e);let t=e=>{let t=String(e??``).trim();if(t){if(/^\d+$/.test(t)){let e=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${e}, ${Df[e]}px)`}return t}},n=e=>{let t=String(e??``).trim();if(!t)return!1;try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0}catch{return!1}},r=e=>e!=null&&!/^(false|0|off|no)$/i.test(e.trim()),i=e=>{for(let t of Array.from(e.children)){if(Ef.has(t.getAttribute(`slot`)??``))continue;let e=t.tagName.toLowerCase();if(e===`scb-header-tab`||e===`scb-dropdown`)return!0}return!1},a=e=>{i(e)||n(e.getAttribute(`tabs`))||r(e.getAttribute(`reserve-tabs`))||r(e.getAttribute(`layout-pending`))?e.setAttribute(`data-pre-has-tabs`,``):e.removeAttribute(`data-pre-has-tabs`);let a=t(e.getAttribute(`spacing`)),o=t(e.getAttribute(`spacing-top`))??a,s=t(e.getAttribute(`spacing-bottom`))??a,c=t(e.getAttribute(`padding-inline`)),l=t(e.getAttribute(`padding-inline-expanded`))??c;o?e.style.setProperty(`--scb-header-spacing-block-start`,o):e.style.removeProperty(`--scb-header-spacing-block-start`),s?e.style.setProperty(`--scb-header-spacing-block-end`,s):e.style.removeProperty(`--scb-header-spacing-block-end`),c?e.style.setProperty(`--scb-header-padding-inline`,c):e.style.removeProperty(`--scb-header-padding-inline`),l?e.style.setProperty(`--scb-header-padding-inline-expanded`,l):e.style.removeProperty(`--scb-header-padding-inline-expanded`);let u=(e.getAttribute(`logo-width`)??``).trim();u?e.style.setProperty(`--scb-header-pre-logo-w`,u):e.style.removeProperty(`--scb-header-pre-logo-w`);let d=(e.getAttribute(`logo-height`)??``).trim();d?e.style.setProperty(`--scb-header-pre-logo-img-h`,d):e.style.removeProperty(`--scb-header-pre-logo-img-h`);let f=(e.getAttribute(`search-height`)??``).trim();f?e.style.setProperty(`--scb-header-pre-control-size`,f):e.style.removeProperty(`--scb-header-pre-control-size`)};document.querySelectorAll(`scb-header`).forEach(a);let o=new MutationObserver(e=>{for(let t of e){if(t.type===`attributes`){let e=t.target;e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-header`&&a(e);continue}if(t.type===`childList`){let e=[...Array.from(t.addedNodes),...Array.from(t.removedNodes)];for(let t of e){if(!(t instanceof HTMLElement))continue;if(t.tagName.toLowerCase()===`scb-header`){a(t);continue}let e=t.closest?.(`scb-header`);e&&a(e)}}}});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabs`,`spacing`,`spacing-top`,`spacing-bottom`,`padding-inline`,`padding-inline-expanded`,`logo-width`,`logo-height`,`logo-aspect-ratio`,`logo-alt`,`logotype-text`,`search-height`,`reserve-tabs`,`layout-pending`]}),customElements.whenDefined(`scb-header`).then(()=>{o.disconnect()})})();var Of={fromAttribute:e=>e==null||!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},kf={fromAttribute:e=>e!=null&&!/^(false|0|off|no)$/i.test(e),toAttribute:e=>e?``:null},Af={fromAttribute:e=>e===`small`||e===`medium`||e===`large`?e:`medium`,toAttribute:e=>{let t=String(e??``);return t===`small`||t===`medium`||t===`large`?t:null}},Z=class extends C{static{wf=this}constructor(){super(),this.maxWidth=`1440px`,this.size=lc[`scb-header`].size,this.logoText=``,this.logotypeText=``,this.logoAlt=``,this.logoHref=`/`,this.logoSrc=``,this.logoWidth=``,this.logoHeight=``,this.logoAspectRatio=``,this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel=`Sök`,this.searchClearLabel=`Rensa sökfält`,this.searchCloseLabel=`Stäng sök`,this.menuButtonLabel=`Meny`,this.menuOpenLabel=`Öppna meny`,this.utilityNavigationLabel=`Funktionslänkar`,this.mainNavigationLabel=`Huvudnavigering`,this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText=``,this._drawerId=`main-drawer`,this._menuExpanded=!1,this._searchId=`header-search`,this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._hasResponsiveActions=!1,this._observedLayout=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=e=>{e.stopPropagation();let t=e.detail;this.dispatchEvent(new CustomEvent(`scb-menu-select`,{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbmenuselect`,{detail:t,bubbles:!0,composed:!0}));let n=t?.item,r=typeof t?.href==`string`?t.href:typeof t?.itemHref==`string`?t.itemHref:typeof t?.item_href==`string`?t.item_href:``,i=n?n.getAttribute(`item-href`)??n.getAttribute(`href`)??``:``;String(r||i||``).trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=e=>{e.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._tabsCollapsed=!1,this._desktop=typeof window<`u`&&window.innerWidth>=wf.BP_MD_DEFAULT,this._hideLogoText=!1,this._slotWatchers=[],this._harvestPending=!1,this._onActionsSlotChange=()=>{this._hasResponsiveActions=this._customActions.some(e=>e.slot!==`actions`),this._observeLayout(),this._scheduleMeasure()},this._harvest=(e={})=>{let t=Array.from(this.children);this._hasResponsiveActions=t.some(e=>{let t=e.getAttribute(`slot`)??``;return t!==`actions`&&Ef.has(t)});let n=[],r=[],i=[],a=-1,o=!1,s=e=>({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??void 0,icon:e.getAttribute(`icon`)??void 0}),c=e=>{e.hasAttribute(`role`)&&e.removeAttribute(`role`),e.hasAttribute(`hidden`)||e.setAttribute(`hidden`,``),e.getAttribute(`aria-hidden`)!==`true`&&e.setAttribute(`aria-hidden`,`true`)};for(let e of t){if(Ef.has(e.getAttribute(`slot`)??``))continue;let t=e.tagName.toLowerCase();if(this._isDrawerCloseNode(e)){this._syncDrawerCloseNode(e);continue}if(t===`scb-header-tab`){c(e);let t=e.getAttribute(`label`)??``,r=e.getAttribute(`href`),i=r&&r.trim()!==``?r:void 0;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length),n.push({kind:`tab`,label:t,href:i});continue}if(t===`scb-badge`){let t=e.querySelector(`scb-dropdown`);if(t){o=!0;let r=t.getAttribute(`label`)??``;(t.hasAttribute(`selected`)||t.getAttribute(`selected`)===`true`||t.getAttribute(`active`)===`true`||t.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length);let i=`scb-header-tab-${n.length}`;e.getAttribute(`slot`)!==i&&e.setAttribute(`slot`,i),t.hasAttribute(`slot`)&&t.removeAttribute(`slot`),t.hasAttribute(`as-tab`)||t.setAttribute(`as-tab`,``),n.push({kind:`dropdown`,slotName:i,label:r});continue}}if(t===`scb-dropdown`){o=!0;let t=e.getAttribute(`label`)??``;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length);let r=`scb-header-tab-${n.length}`;e.getAttribute(`slot`)!==r&&e.setAttribute(`slot`,r),e.hasAttribute(`as-tab`)||e.setAttribute(`as-tab`,``),n.push({kind:`dropdown`,slotName:r,label:t});continue}if(t===`scb-header-utility`){c(e),r.push({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??`#`,target:e.getAttribute(`target`)??void 0});continue}if(t===`scb-header-menu-group`){c(e);let t={label:e.getAttribute(`label`)??``,icon:e.getAttribute(`icon`)??void 0,children:[]};e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t.children.push(s(e))),i.push(t);continue}if(t===`scb-header-menu-item`){c(e),i.push(s(e));continue}e.hasAttribute(`slot`)||c(e)}let l=!this._sameNavItems(this._slotNavItems,n),u=!this._sameUtilityItems(this._slotUtils,r),d=!this._sameMenuNodes(this._slotMenu,i);l&&(this._slotNavItems=n),u&&(this._slotUtils=r),d&&(this._slotMenu=i),o&&this._ensureDropdownReady(),!this.hasAttribute(`active-tab`)&&a>=0&&this.activeTab!==a&&(this.activeTab=a),(e.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;let e=this._top,t=this._logoGroup;if(!e||!t)return;let n=window.innerWidth;this._desktop=n>=this.BP_MD;let r=e.clientWidth,i=this._overflows(this._util),a=!this._desktop||i;this._collapsed?!a&&r>=this._unlockAtWidth&&this._setCollapsed(!1):a&&(this._unlockAtWidth=r+this._HYST,this._setCollapsed(!0)),this._setTabsCollapsed(this._tabsOverflows());let o=this.renderRoot.querySelector(`.actions`),s=this._customActions;for(let e of s)e.slot===`actions`||e.getClientRects().length>0||(e.matches(`scb-dropdown`)&&e.removeAttribute(`open`),e.querySelectorAll(`scb-dropdown[open]`).forEach(e=>e.removeAttribute(`open`)));let c=s.filter(e=>!e.hidden&&(this._hasResponsiveActions?e.getClientRects().length>0:this._visible(e))),l=o?this._num(getComputedStyle(o).columnGap,0):0,u=!1;if(this.showSearch&&n>=this.BP_SM&&n<this.BP_MD&&this._searchWrap){let i=getComputedStyle(this._searchWrap),a=Math.max(this._num(i.minWidth,this._tokenPx(`--scb-header-search-min`,250)),this._tokenPx(`--scb-header-search-min`,250)),o=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),s=this.showDrawer&&(this.alwaysShowMenuButton||n<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48):0;u=t.getBoundingClientRect().width+o+a+o+s+c.reduce((e,t)=>e+t.getBoundingClientRect().width+l,0)+8>r+.5}this._setHideSearch(u);let d=!1,f=[...Array.from(o?.querySelectorAll(`.header-icon-button`)??[]),...c].filter(e=>this._visible(e));if(f.length>0&&!this._visible(this._util)&&!this._visible(this._searchWrap)){let n=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),i=f.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+l*Math.max(0,f.length-1);this._hideLogoText&&this.removeAttribute(`data-hide-logo-text`);let a=t.getBoundingClientRect().width;this._hideLogoText&&this.setAttribute(`data-hide-logo-text`,``),d=a+n+i+(this._hideLogoText?this._HYST:0)>r+.5}this._setHideLogoText(d)},this._onGlobalFocusRingKeydown=e=>{e.key===`Tab`&&(this.toggleAttribute(`data-keyboard-focus`,!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute(`data-keyboard-focus`)},this._onLocalFocusIn=e=>{let t=e.composedPath()[0];t instanceof HTMLElement&&t.matches(`:focus-visible`)&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-open`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`draweropen`,{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this._hasResponsiveActions&&requestAnimationFrame(()=>{if(!this.isConnected||this._menuExpanded)return;let e=this.renderRoot.querySelector(`scb-drawer`),t=this.shadowRoot?.activeElement??this.ownerDocument.activeElement;(!t||t===this.ownerDocument.body||t===e||e?.contains(t))&&this._menuBtn?.focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`drawer-close`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`drawerclose`,{bubbles:!0,composed:!0}))},this._onMenuClick=async e=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent(`menu-click`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`menuclick`,{bubbles:!0,composed:!0})),!this._drawerReady&&(e.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{let e=!this._mobileSearchOpen;this._setMobileSearchOpen(e),e&&this.updateComplete.then(()=>{this.renderRoot.querySelector(`.mobile-search-panel .header-search-input`)?.focus?.()})},this._onTabClick=e=>{let t=e.currentTarget;if(!t)return;let n=t.tagName.toLowerCase()===`a`;if(n&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;let r=t.getAttribute(`data-index`),i=r==null?0:Number(r),a=this._getNavItems()[i];if(a?.kind===`dropdown`)return;this.activeTab=i;let o=a?.kind===`tab`?a.href??``:``,s=new CustomEvent(`tab-change`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0}),c=new CustomEvent(`tabchange`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(s)&&this.dispatchEvent(c))&&n&&e.preventDefault()},this._onDropdownTabActivate=e=>{let t=e.detail?.dataIndex,n=typeof t==`number`?t:typeof t==`string`?Number(t):this._readTabIndexFromEvent(e);if(n==null||!Number.isFinite(n))return;let r=this._getNavItems();n<0||n>=r.length||r[n]?.kind===`dropdown`&&(this.activeTab=n,this.dispatchEvent(new CustomEvent(`tab-change`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`tabchange`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{let t=e.key;if(t!==`ArrowLeft`&&t!==`ArrowRight`&&t!==`Home`&&t!==`End`)return;let n=this._getNavItems();if(!n.length)return;let r=this._readTabIndexFromEvent(e);if(r==null)return;let i=Math.max(0,Math.min(n.length-1,r));t===`ArrowRight`?i=(i+1)%n.length:t===`ArrowLeft`?i=(i-1+n.length)%n.length:t===`Home`?i=0:t===`End`&&(i=n.length-1),e.preventDefault(),this._focusTabAtIndex(i)},this._onNativeSearchInput=e=>{let t=e.currentTarget;this._emitSearchInput(t?.value??``)},this._onNativeSearchSubmit=e=>{e.preventDefault();let t=e.currentTarget?.querySelector(`.header-search-input`);this._emitSearchChange(t?.value??``)},this._onSearchClear=()=>{this.searchText=``,this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:``},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:``},bubbles:!0,composed:!0}))},this._onNativeSearchClear=e=>{e.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{let t=(e.currentTarget?.closest(`form`))?.querySelector(`.header-search-input`);t&&(t.value=``),t?.focus()})};let e=++Tf;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}static{this._JSON_ARRAY={fromAttribute:e=>{if(e==null||e===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute:e=>e==null?null:JSON.stringify(e)}}requestLayout(){this.layoutPending||(this.setAttribute(`data-layout-settling`,``),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute(`data-layout-settling`))}))}static{this.BP_SM_DEFAULT=600}static{this.BP_MD_DEFAULT=840}get _HYST(){return this._tokenPx(`--spacing-11`,64)}get BP_SM(){return this._tokenPx(`--bp-sm`,wf.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx(`--bp-md`,wf.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}static{this.styles=p`
|
|
14392
|
+
`,document.head.appendChild(e);let t=e=>{let t=String(e??``).trim();if(t){if(/^\d+$/.test(t)){let e=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${e}, ${Ef[e]}px)`}return t}},n=e=>{let t=String(e??``).trim();if(!t)return!1;try{let e=JSON.parse(t);return Array.isArray(e)&&e.length>0}catch{return!1}},r=e=>e!=null&&!/^(false|0|off|no)$/i.test(e.trim()),i=e=>{for(let t of Array.from(e.children)){if(Tf.has(t.getAttribute(`slot`)??``))continue;let e=t.tagName.toLowerCase();if(e===`scb-header-tab`||e===`scb-dropdown`)return!0}return!1},a=e=>{i(e)||n(e.getAttribute(`tabs`))||r(e.getAttribute(`reserve-tabs`))||r(e.getAttribute(`layout-pending`))?e.setAttribute(`data-pre-has-tabs`,``):e.removeAttribute(`data-pre-has-tabs`);let a=t(e.getAttribute(`spacing`)),o=t(e.getAttribute(`spacing-top`))??a,s=t(e.getAttribute(`spacing-bottom`))??a,c=t(e.getAttribute(`padding-inline`)),l=t(e.getAttribute(`padding-inline-expanded`))??c;o?e.style.setProperty(`--scb-header-spacing-block-start`,o):e.style.removeProperty(`--scb-header-spacing-block-start`),s?e.style.setProperty(`--scb-header-spacing-block-end`,s):e.style.removeProperty(`--scb-header-spacing-block-end`),c?e.style.setProperty(`--scb-header-padding-inline`,c):e.style.removeProperty(`--scb-header-padding-inline`),l?e.style.setProperty(`--scb-header-padding-inline-expanded`,l):e.style.removeProperty(`--scb-header-padding-inline-expanded`);let u=(e.getAttribute(`logo-width`)??``).trim();u?e.style.setProperty(`--scb-header-pre-logo-w`,u):e.style.removeProperty(`--scb-header-pre-logo-w`);let d=(e.getAttribute(`logo-height`)??``).trim();d?e.style.setProperty(`--scb-header-pre-logo-img-h`,d):e.style.removeProperty(`--scb-header-pre-logo-img-h`);let f=(e.getAttribute(`search-height`)??``).trim();f?e.style.setProperty(`--scb-header-pre-control-size`,f):e.style.removeProperty(`--scb-header-pre-control-size`)};document.querySelectorAll(`scb-header`).forEach(a);let o=new MutationObserver(e=>{for(let t of e){if(t.type===`attributes`){let e=t.target;e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-header`&&a(e);continue}if(t.type===`childList`){let e=[...Array.from(t.addedNodes),...Array.from(t.removedNodes)];for(let t of e){if(!(t instanceof HTMLElement))continue;if(t.tagName.toLowerCase()===`scb-header`){a(t);continue}let e=t.closest?.(`scb-header`);e&&a(e)}}}});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabs`,`spacing`,`spacing-top`,`spacing-bottom`,`padding-inline`,`padding-inline-expanded`,`logo-width`,`logo-height`,`logo-aspect-ratio`,`logo-alt`,`logotype-text`,`search-height`,`reserve-tabs`,`layout-pending`]}),customElements.whenDefined(`scb-header`).then(()=>{o.disconnect()})})();var Df={fromAttribute:e=>e==null||!/^(false|0|off|no)$/i.test(e),toAttribute:e=>String(!!e)},Of={fromAttribute:e=>e!=null&&!/^(false|0|off|no)$/i.test(e),toAttribute:e=>e?``:null},kf={fromAttribute:e=>e===`small`||e===`medium`||e===`large`?e:`medium`,toAttribute:e=>{let t=String(e??``);return t===`small`||t===`medium`||t===`large`?t:null}},Z=class extends C{static{Cf=this}constructor(){super(),this.maxWidth=`1440px`,this.size=lc[`scb-header`].size,this.logoText=``,this.logotypeText=``,this.logoAlt=``,this.logoHref=`/`,this.logoSrc=``,this.logoWidth=``,this.logoHeight=``,this.logoAspectRatio=``,this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel=`Sök`,this.searchClearLabel=`Rensa sökfält`,this.searchCloseLabel=`Stäng sök`,this.menuButtonLabel=`Meny`,this.menuOpenLabel=`Öppna meny`,this.utilityNavigationLabel=`Funktionslänkar`,this.mainNavigationLabel=`Huvudnavigering`,this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText=``,this._drawerId=`main-drawer`,this._menuExpanded=!1,this._searchId=`header-search`,this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._hasResponsiveActions=!1,this._observedLayout=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=e=>{e.stopPropagation();let t=e.detail;this.dispatchEvent(new CustomEvent(`scb-menu-select`,{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbmenuselect`,{detail:t,bubbles:!0,composed:!0}));let n=t?.item,r=typeof t?.href==`string`?t.href:typeof t?.itemHref==`string`?t.itemHref:typeof t?.item_href==`string`?t.item_href:``,i=n?n.getAttribute(`item-href`)??n.getAttribute(`href`)??``:``;String(r||i||``).trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=e=>{e.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._tabsCollapsed=!1,this._desktop=typeof window<`u`&&window.innerWidth>=Cf.BP_MD_DEFAULT,this._hideLogoText=!1,this._slotWatchers=[],this._harvestPending=!1,this._onActionsSlotChange=()=>{this._hasResponsiveActions=this._customActions.some(e=>e.slot!==`actions`),this._observeLayout(),this._scheduleMeasure()},this._harvest=(e={})=>{let t=Array.from(this.children);this._hasResponsiveActions=t.some(e=>{let t=e.getAttribute(`slot`)??``;return t!==`actions`&&Tf.has(t)});let n=[],r=[],i=[],a=-1,o=!1,s=e=>({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??void 0,icon:e.getAttribute(`icon`)??void 0}),c=e=>{e.hasAttribute(`role`)&&e.removeAttribute(`role`),e.hasAttribute(`hidden`)||e.setAttribute(`hidden`,``),e.getAttribute(`aria-hidden`)!==`true`&&e.setAttribute(`aria-hidden`,`true`)};for(let e of t){if(Tf.has(e.getAttribute(`slot`)??``))continue;let t=e.tagName.toLowerCase();if(this._isDrawerCloseNode(e)){this._syncDrawerCloseNode(e);continue}if(t===`scb-header-tab`){c(e);let t=e.getAttribute(`label`)??``,r=e.getAttribute(`href`),i=r&&r.trim()!==``?r:void 0;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length),n.push({kind:`tab`,label:t,href:i});continue}if(t===`scb-badge`){let t=e.querySelector(`scb-dropdown`);if(t){o=!0;let r=t.getAttribute(`label`)??``;(t.hasAttribute(`selected`)||t.getAttribute(`selected`)===`true`||t.getAttribute(`active`)===`true`||t.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length);let i=`scb-header-tab-${n.length}`;e.getAttribute(`slot`)!==i&&e.setAttribute(`slot`,i),t.hasAttribute(`slot`)&&t.removeAttribute(`slot`),t.hasAttribute(`as-tab`)||t.setAttribute(`as-tab`,``),n.push({kind:`dropdown`,slotName:i,label:r});continue}}if(t===`scb-dropdown`){o=!0;let t=e.getAttribute(`label`)??``;(e.hasAttribute(`selected`)||e.getAttribute(`selected`)===`true`||e.getAttribute(`active`)===`true`||e.getAttribute(`aria-current`)===`page`)&&a===-1&&(a=n.length);let r=`scb-header-tab-${n.length}`;e.getAttribute(`slot`)!==r&&e.setAttribute(`slot`,r),e.hasAttribute(`as-tab`)||e.setAttribute(`as-tab`,``),n.push({kind:`dropdown`,slotName:r,label:t});continue}if(t===`scb-header-utility`){c(e),r.push({label:e.getAttribute(`label`)??``,href:e.getAttribute(`href`)??`#`,target:e.getAttribute(`target`)??void 0});continue}if(t===`scb-header-menu-group`){c(e);let t={label:e.getAttribute(`label`)??``,icon:e.getAttribute(`icon`)??void 0,children:[]};e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t.children.push(s(e))),i.push(t);continue}if(t===`scb-header-menu-item`){c(e),i.push(s(e));continue}e.hasAttribute(`slot`)||c(e)}let l=!this._sameNavItems(this._slotNavItems,n),u=!this._sameUtilityItems(this._slotUtils,r),d=!this._sameMenuNodes(this._slotMenu,i);l&&(this._slotNavItems=n),u&&(this._slotUtils=r),d&&(this._slotMenu=i),o&&this._ensureDropdownReady(),!this.hasAttribute(`active-tab`)&&a>=0&&this.activeTab!==a&&(this.activeTab=a),(e.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;let e=this._top,t=this._logoGroup;if(!e||!t)return;let n=window.innerWidth;this._desktop=n>=this.BP_MD;let r=e.clientWidth,i=this._overflows(this._util),a=!this._desktop||i;this._collapsed?!a&&r>=this._unlockAtWidth&&this._setCollapsed(!1):a&&(this._unlockAtWidth=r+this._HYST,this._setCollapsed(!0)),this._setTabsCollapsed(this._tabsOverflows());let o=this.renderRoot.querySelector(`.actions`),s=this._customActions;for(let e of s)e.slot===`actions`||e.getClientRects().length>0||(e.matches(`scb-dropdown`)&&e.removeAttribute(`open`),e.querySelectorAll(`scb-dropdown[open]`).forEach(e=>e.removeAttribute(`open`)));let c=s.filter(e=>!e.hidden&&(this._hasResponsiveActions?e.getClientRects().length>0:this._visible(e))),l=o?this._num(getComputedStyle(o).columnGap,0):0,u=!1;if(this.showSearch&&n>=this.BP_SM&&n<this.BP_MD&&this._searchWrap){let i=getComputedStyle(this._searchWrap),a=Math.max(this._num(i.minWidth,this._tokenPx(`--scb-header-search-min`,250)),this._tokenPx(`--scb-header-search-min`,250)),o=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),s=this.showDrawer&&(this.alwaysShowMenuButton||n<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx(`--icon-size-extra-extra-large`,48):0;u=t.getBoundingClientRect().width+o+a+o+s+c.reduce((e,t)=>e+t.getBoundingClientRect().width+l,0)+8>r+.5}this._setHideSearch(u);let d=!1,f=[...Array.from(o?.querySelectorAll(`.header-icon-button`)??[]),...c].filter(e=>this._visible(e));if(f.length>0&&!this._visible(this._util)&&!this._visible(this._searchWrap)){let n=this._num(getComputedStyle(e).gap,this._tokenPx(`--spacing-7`,24)),i=f.reduce((e,t)=>e+t.getBoundingClientRect().width,0)+l*Math.max(0,f.length-1);this._hideLogoText&&this.removeAttribute(`data-hide-logo-text`);let a=t.getBoundingClientRect().width;this._hideLogoText&&this.setAttribute(`data-hide-logo-text`,``),d=a+n+i+(this._hideLogoText?this._HYST:0)>r+.5}this._setHideLogoText(d)},this._onGlobalFocusRingKeydown=e=>{e.key===`Tab`&&(this.toggleAttribute(`data-keyboard-focus`,!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute(`data-keyboard-focus`)},this._onLocalFocusIn=e=>{let t=e.composedPath()[0];t instanceof HTMLElement&&t.matches(`:focus-visible`)&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent(`drawer-open`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`draweropen`,{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this._hasResponsiveActions&&requestAnimationFrame(()=>{if(!this.isConnected||this._menuExpanded)return;let e=this.renderRoot.querySelector(`scb-drawer`),t=this.shadowRoot?.activeElement??this.ownerDocument.activeElement;(!t||t===this.ownerDocument.body||t===e||e?.contains(t))&&this._menuBtn?.focus({preventScroll:!0})}),this.dispatchEvent(new CustomEvent(`drawer-close`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`drawerclose`,{bubbles:!0,composed:!0}))},this._onMenuClick=async e=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent(`menu-click`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`menuclick`,{bubbles:!0,composed:!0})),!this._drawerReady&&(e.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{let e=!this._mobileSearchOpen;this._setMobileSearchOpen(e),e&&this.updateComplete.then(()=>{this.renderRoot.querySelector(`.mobile-search-panel .header-search-input`)?.focus?.()})},this._onTabClick=e=>{let t=e.currentTarget;if(!t)return;let n=t.tagName.toLowerCase()===`a`;if(n&&(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))return;let r=t.getAttribute(`data-index`),i=r==null?0:Number(r),a=this._getNavItems()[i];if(a?.kind===`dropdown`)return;this.activeTab=i;let o=a?.kind===`tab`?a.href??``:``,s=new CustomEvent(`tab-change`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0}),c=new CustomEvent(`tabchange`,{detail:{index:i,href:o},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(s)&&this.dispatchEvent(c))&&n&&e.preventDefault()},this._onDropdownTabActivate=e=>{let t=e.detail?.dataIndex,n=typeof t==`number`?t:typeof t==`string`?Number(t):this._readTabIndexFromEvent(e);if(n==null||!Number.isFinite(n))return;let r=this._getNavItems();n<0||n>=r.length||r[n]?.kind===`dropdown`&&(this.activeTab=n,this.dispatchEvent(new CustomEvent(`tab-change`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent(`tabchange`,{detail:{index:n,href:``},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=e=>{let t=e.key;if(t!==`ArrowLeft`&&t!==`ArrowRight`&&t!==`Home`&&t!==`End`)return;let n=this._getNavItems();if(!n.length)return;let r=this._readTabIndexFromEvent(e);if(r==null)return;let i=Math.max(0,Math.min(n.length-1,r));t===`ArrowRight`?i=(i+1)%n.length:t===`ArrowLeft`?i=(i-1+n.length)%n.length:t===`Home`?i=0:t===`End`&&(i=n.length-1),e.preventDefault(),this._focusTabAtIndex(i)},this._onNativeSearchInput=e=>{let t=e.currentTarget;this._emitSearchInput(t?.value??``)},this._onNativeSearchSubmit=e=>{e.preventDefault();let t=e.currentTarget?.querySelector(`.header-search-input`);this._emitSearchChange(t?.value??``)},this._onSearchClear=()=>{this.searchText=``,this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:``},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:``},bubbles:!0,composed:!0}))},this._onNativeSearchClear=e=>{e.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{let t=(e.currentTarget?.closest(`form`))?.querySelector(`.header-search-input`);t&&(t.value=``),t?.focus()})};let e=++wf;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}static{this._JSON_ARRAY={fromAttribute:e=>{if(e==null||e===``)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},toAttribute:e=>e==null?null:JSON.stringify(e)}}requestLayout(){this.layoutPending||(this.setAttribute(`data-layout-settling`,``),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute(`data-layout-settling`))}))}static{this.BP_SM_DEFAULT=600}static{this.BP_MD_DEFAULT=840}get _HYST(){return this._tokenPx(`--spacing-11`,64)}get BP_SM(){return this._tokenPx(`--bp-sm`,Cf.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx(`--bp-md`,Cf.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}static{this.styles=p`
|
|
14387
14393
|
:host {
|
|
14388
14394
|
/* Headertext: base text current. JSON-källa: src/tokens/source/typography.json. */
|
|
14389
14395
|
--scb-header-search-text-font-weight-current: var(--scb-header-design-search-text-large-font-weight);
|
|
@@ -15672,7 +15678,7 @@
|
|
|
15672
15678
|
}
|
|
15673
15679
|
|
|
15674
15680
|
/* design:bindings:scb-header:end */
|
|
15675
|
-
`}get _top(){return this.renderRoot.querySelector(`.top-row`)}get _util(){return this.renderRoot.querySelector(`.utility`)}get _logoGroup(){return this.renderRoot.querySelector(`.logo-wrap`)||this.renderRoot.querySelector(`.logo-group`)}get _searchWrap(){return this.renderRoot.querySelector(`.search`)}get _menuBtn(){return this.renderRoot.querySelector(`.menu-trigger`)}get _tabsNav(){return this.renderRoot.querySelector(`.tabs-nav`)}get _customActions(){return[...this.renderRoot.querySelectorAll(`slot`)].filter(e=>Ef.has(e.name)).flatMap(e=>e.assignedElements({flatten:!0})).filter(e=>e instanceof HTMLElement)}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=[`label`,`href`,`icon`,`target`,`selected`,`aria-current`,`active`,`role`],t=t=>{let n=new MutationObserver(e=>{this._scheduleHarvest()});this._slotWatchers.push(n),n.observe(t,{attributes:!0,attributeFilter:e})},n=()=>{this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=Array.from(this.children);for(let r of e){if(Ef.has(r.getAttribute(`slot`)??``))continue;let e=r.tagName.toLowerCase();if((e===`scb-header-tab`||e===`scb-dropdown`||e===`scb-header-utility`||e===`scb-header-menu-item`||e===`scb-header-menu-group`||e===`scb-badge`)&&t(r),e===`scb-badge`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0});let a=e.querySelector(`scb-dropdown`);a&&t(a);continue}if(e===`scb-header-menu-group`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0,subtree:!0}),e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t(e))}}},r=new MutationObserver(e=>{let t=!1;for(let n of e)if(n.type===`childList`){t=!0;break}t&&n(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),n()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.kind!==i.kind||r.label!==i.label)return!1;if(r.kind===`tab`&&i.kind===`tab`){if((r.href??``)!==(i.href??``))return!1}else if(r.kind===`dropdown`&&i.kind===`dropdown`&&r.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.label!==i.label||r.href!==i.href||(r.target??``)!==(i.target??``))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.label!==i.label||(r.href??``)!==(i.href??``)||(r.icon??``)!==(i.icon??``)||!this._sameMenuNodes(r.children??[],i.children??[]))return!1}return!0}_isDrawerCloseNode(e){let t=e.tagName.toLowerCase(),n=e.getAttribute(`slot`);if(n===`drawer-close`)return!0;if(n||t!==`scb-icon-button`)return!1;let r=(e.getAttribute(`icon`)??``).trim().toLowerCase(),i=(e.getAttribute(`aria-label`)??``).trim().toLowerCase();return r===`close`||i.includes(`stäng`)||i.includes(`close`)}_syncDrawerCloseNode(e){e.getAttribute(`slot`)!==`drawer-close`&&e.setAttribute(`slot`,`drawer-close`),e.setAttribute(`data-drawer-close`,this._drawerId),e.setAttribute(`aria-controls`,this._drawerId),this._drawerReady?(e.removeAttribute(`hidden`),e.removeAttribute(`aria-hidden`)):(e.hasAttribute(`hidden`)||e.setAttribute(`hidden`,``),e.getAttribute(`aria-hidden`)!==`true`&&e.setAttribute(`aria-hidden`,`true`))}_syncDrawerCloseNodes(){for(let e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute(`data-collapsed`,``):this.removeAttribute(`data-collapsed`))}_setHideSearch(e){e?this.setAttribute(`data-hide-search`,``):this.removeAttribute(`data-hide-search`)}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute(`data-hide-logo-text`,``):this.removeAttribute(`data-hide-logo-text`))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute(`data-mobile-search-open`,e))}_num(e,t){let n=Number.parseFloat(String(e??``).trim());return Number.isFinite(n)?n:t}_tokenPx(e,t){let n=getComputedStyle(this);return this._num(n.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!==`none`:!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){let e=this._tabsNav,t=e?.closest(`.tabs-row`);if(!e||!t||!this._desktop||!this.showDrawer)return!1;let n=t.querySelector(`.menu-trigger--tabs-right`),r=n&&(this.alwaysShowMenuButton||this._collapsed),i=r?n.getBoundingClientRect().width:0,a=r?this._num(getComputedStyle(t).columnGap,0):0,o=t.getBoundingClientRect().width-i-a;return e.getBoundingClientRect().width>o+.5}_setTabsCollapsed(e){if(this._tabsCollapsed===e)return;let t=this._tabsNav,n=e&&!!t?.contains(this.shadowRoot?.activeElement??null);if(e)for(let e of this._getNavItems()){if(e.kind!==`dropdown`)continue;let t=this._getDropdownForSlot(e.slotName);n||=t===document.activeElement,t?.removeAttribute(`open`)}this._tabsCollapsed=e,this.toggleAttribute(`data-tabs-collapsed`,e),n&&this.updateComplete.then(()=>this._menuBtn?.focus())}_observeLayout(){if(!this._ro)return;let e=[this._top,this._tabsNav,this._tabsNav?.closest(`.tabs-row`),this._menuBtn,...this._customActions].filter(e=>!!e);if(!(e.length===this._observedLayout.length&&e.every((e,t)=>e===this._observedLayout[t]))){this._ro?.disconnect(),this._observedLayout=e;for(let t of e)this._ro?.observe(t,{box:`border-box`})}}connectedCallback(){super.connectedCallback(),window.addEventListener(`keydown`,this._onGlobalFocusRingKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute(`data-upgrading`,``),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute(`data-upgrading`))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener(`focusin`,this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._observeLayout(),window.addEventListener(`resize`,this._onWindowResize,{passive:!0})}updated(e){e.has(`searchMax`)&&this.style.setProperty(`--scb-header-search-max`,this.searchMax??`380px`),e.has(`searchMin`)&&this.style.setProperty(`--scb-header-search-min`,this.searchMin??`250px`),e.has(`searchHeight`)&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty(`--scb-search-height`,this.searchHeight.trim()):this.style.removeProperty(`--scb-search-height`)),(e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`))&&this._applyLogoSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`))&&this._applySpacing(),(e.has(`paddingInline`)||e.has(`paddingInlineExpanded`))&&this._applyPaddingInline(),(e.has(`banner`)||e.has(`bannerLabel`))&&this._syncLandmarkAttributes(),(e.has(`utilityItems`)||e.has(`_collapsed`)||e.has(`_tabsCollapsed`)||e.has(`_desktop`)||e.has(`_mobileSearchOpen`)||e.has(`tabs`)||e.has(`logoText`)||e.has(`logotypeText`)||e.has(`logoSrc`)||e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`)||e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`_slotUtils`)||e.has(`_slotMenu`)||e.has(`_hasResponsiveActions`)||e.has(`showDrawer`)||e.has(`alwaysShowMenuButton`)||e.has(`showSearch`)||e.has(`layoutPending`)||e.has(`searchMax`)||e.has(`searchMin`)||e.has(`paddingInline`)||e.has(`paddingInlineExpanded`)||e.has(`size`))&&this.updateComplete.then(()=>{this._observeLayout(),this._scheduleMeasure()}),(e.has(`showDrawer`)||e.has(`deferDrawer`))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has(`showSearch`)&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has(`layoutPending`)&&!this.layoutPending&&this.requestLayout(),(e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`tabs`)||e.has(`size`))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._observedLayout=[],this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener(`focusin`,this._onLocalFocusIn),window.removeEventListener(`keydown`,this._onGlobalFocusRingKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalFocusRingPointerDown,!0),window.removeEventListener(`resize`,this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t){if(/^\d+$/.test(t)){let e=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${e}, ${Df[e]}px)`}return t}}_applySpacing(){let e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,n=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty(`--scb-header-spacing-block-start`,t):this.style.removeProperty(`--scb-header-spacing-block-start`),n?this.style.setProperty(`--scb-header-spacing-block-end`,n):this.style.removeProperty(`--scb-header-spacing-block-end`)}_applyPaddingInline(){let e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty(`--scb-header-padding-inline`,e):this.style.removeProperty(`--scb-header-padding-inline`),t?this.style.setProperty(`--scb-header-padding-inline-expanded`,t):this.style.removeProperty(`--scb-header-padding-inline-expanded`)}_syncLandmarkAttributes(){let e=this.renderRoot.querySelector(`.header-landmark`);if(!e)return;if(!this.banner){e.removeAttribute(`role`),e.removeAttribute(`aria-label`);return}e.setAttribute(`role`,`banner`);let t=(this.bannerLabel??``).trim();t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}_applyLogoSizing(){let e=(this.logoWidth??``).trim(),t=(this.logoHeight??``).trim(),n=(this.logoAspectRatio??``).trim();e?this.style.setProperty(`--scb-header-logo-img-w`,e):this.style.removeProperty(`--scb-header-logo-img-w`),t?this.style.setProperty(`--scb-header-logo-img-h`,t):e?this.style.setProperty(`--scb-header-logo-img-h`,`auto`):this.style.removeProperty(`--scb-header-logo-img-h`),n?this.style.setProperty(`--scb-header-logo-img-aspect-ratio`,n):this.style.removeProperty(`--scb-header-logo-img-aspect-ratio`)}_closeDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get(`md-focus-ring`)||(this._focusRingImportPromise??=Promise.resolve().then(()=>(j(),nc)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??=Promise.all([Promise.resolve().then(()=>(gd(),pd)),Promise.resolve().then(()=>(hf(),pf)),Promise.resolve().then(()=>(Tu(),Cu)),Promise.resolve().then(()=>(bf(),gf)).then(e=>{this._drawerRenderer=e}),this._ensureDrawerSlotComponentsReady()]).then(()=>void 0),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll(`[slot="drawer-menu"], [slot="drawer-close"]`)].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector(`[slot="drawer-menu"], [slot="drawer-close"]`)&&await Promise.all([this._drawerSlotContains(`scb-button`)?Promise.resolve().then(()=>(Mc(),Dc)):Promise.resolve(),this._drawerSlotContains(`scb-icon-button`)?Promise.resolve().then(()=>(dl(),il)):Promise.resolve(),this._drawerSlotContains(`scb-skeleton`)?Promise.resolve().then(()=>(Cf(),xf)):Promise.resolve(),this._drawerSlotContains(`scb-grid`)?Promise.resolve().then(()=>(zd(),Ld)):Promise.resolve(),this._drawerSlotContains(`scb-grid-item`)?Promise.resolve().then(()=>(Nd(),Ad)):Promise.resolve()])}async _ensureDropdownReady(){customElements.get(`scb-dropdown`)||(this._dropdownImportPromise??=Promise.resolve().then(()=>(wd(),Cd)).then(()=>void 0),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(`.menu-trigger`).forEach(e=>{e.setAttribute(`aria-expanded`,String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:`tab`,...e}))}_getDropdownForSlot(e){let t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()===`scb-dropdown`?t:t.querySelector(`scb-dropdown`):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!==`dropdown`)return;let n=this._getDropdownForSlot(e.slotName);if(!n)return;let r=String(t);n.getAttribute(`data-index`)!==r&&n.setAttribute(`data-index`,r),n.hasAttribute(`as-tab`)||n.setAttribute(`as-tab`,``);let i=this.size,a=n;a?.size!==i&&(a.size=i),t===this.activeTab?n.getAttribute(`aria-current`)!==`page`&&n.setAttribute(`aria-current`,`page`):n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)})}_readTabIndexFromEvent(e){let t=e.composedPath?e.composedPath():[];for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-index`);if(t==null)continue;let n=Number(t);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){let t=this._getNavItems()[e];if(t){if(t.kind===`dropdown`){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute(`data-no-utility`,e),this.toggleAttribute(`data-no-search`,t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent(`search-input`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchinput`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent(`search-change`,{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchchange`,{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e=``,t=!1){let n=e?`menu-trigger ${e}`:`menu-trigger`,r=(this.menuButtonLabel??``).trim(),i=(this.menuOpenLabel??``).trim()||r,a=this._menuExpanded?`true`:`false`;return t?x`
|
|
15681
|
+
`}get _top(){return this.renderRoot.querySelector(`.top-row`)}get _util(){return this.renderRoot.querySelector(`.utility`)}get _logoGroup(){return this.renderRoot.querySelector(`.logo-wrap`)||this.renderRoot.querySelector(`.logo-group`)}get _searchWrap(){return this.renderRoot.querySelector(`.search`)}get _menuBtn(){return this.renderRoot.querySelector(`.menu-trigger`)}get _tabsNav(){return this.renderRoot.querySelector(`.tabs-nav`)}get _customActions(){return[...this.renderRoot.querySelectorAll(`slot`)].filter(e=>Tf.has(e.name)).flatMap(e=>e.assignedElements({flatten:!0})).filter(e=>e instanceof HTMLElement)}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=[`label`,`href`,`icon`,`target`,`selected`,`aria-current`,`active`,`role`],t=t=>{let n=new MutationObserver(e=>{this._scheduleHarvest()});this._slotWatchers.push(n),n.observe(t,{attributes:!0,attributeFilter:e})},n=()=>{this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[];let e=Array.from(this.children);for(let r of e){if(Tf.has(r.getAttribute(`slot`)??``))continue;let e=r.tagName.toLowerCase();if((e===`scb-header-tab`||e===`scb-dropdown`||e===`scb-header-utility`||e===`scb-header-menu-item`||e===`scb-header-menu-group`||e===`scb-badge`)&&t(r),e===`scb-badge`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0});let a=e.querySelector(`scb-dropdown`);a&&t(a);continue}if(e===`scb-header-menu-group`){let e=r,i=new MutationObserver(e=>{n(),this._scheduleHarvest()});this._slotWatchers.push(i),i.observe(e,{childList:!0,subtree:!0}),e.querySelectorAll(`scb-header-menu-item`).forEach(e=>t(e))}}},r=new MutationObserver(e=>{let t=!1;for(let n of e)if(n.type===`childList`){t=!0;break}t&&n(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),n()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.kind!==i.kind||r.label!==i.label)return!1;if(r.kind===`tab`&&i.kind===`tab`){if((r.href??``)!==(i.href??``))return!1}else if(r.kind===`dropdown`&&i.kind===`dropdown`&&r.slotName!==i.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.label!==i.label||r.href!==i.href||(r.target??``)!==(i.target??``))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(!r||!i||r.label!==i.label||(r.href??``)!==(i.href??``)||(r.icon??``)!==(i.icon??``)||!this._sameMenuNodes(r.children??[],i.children??[]))return!1}return!0}_isDrawerCloseNode(e){let t=e.tagName.toLowerCase(),n=e.getAttribute(`slot`);if(n===`drawer-close`)return!0;if(n||t!==`scb-icon-button`)return!1;let r=(e.getAttribute(`icon`)??``).trim().toLowerCase(),i=(e.getAttribute(`aria-label`)??``).trim().toLowerCase();return r===`close`||i.includes(`stäng`)||i.includes(`close`)}_syncDrawerCloseNode(e){e.getAttribute(`slot`)!==`drawer-close`&&e.setAttribute(`slot`,`drawer-close`),e.setAttribute(`data-drawer-close`,this._drawerId),e.setAttribute(`aria-controls`,this._drawerId),this._drawerReady?(e.removeAttribute(`hidden`),e.removeAttribute(`aria-hidden`)):(e.hasAttribute(`hidden`)||e.setAttribute(`hidden`,``),e.getAttribute(`aria-hidden`)!==`true`&&e.setAttribute(`aria-hidden`,`true`))}_syncDrawerCloseNodes(){for(let e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute(`data-collapsed`,``):this.removeAttribute(`data-collapsed`))}_setHideSearch(e){e?this.setAttribute(`data-hide-search`,``):this.removeAttribute(`data-hide-search`)}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute(`data-hide-logo-text`,``):this.removeAttribute(`data-hide-logo-text`))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute(`data-mobile-search-open`,e))}_num(e,t){let n=Number.parseFloat(String(e??``).trim());return Number.isFinite(n)?n:t}_tokenPx(e,t){let n=getComputedStyle(this);return this._num(n.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!==`none`:!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){let e=this._tabsNav,t=e?.closest(`.tabs-row`);if(!e||!t||!this._desktop||!this.showDrawer)return!1;let n=t.querySelector(`.menu-trigger--tabs-right`),r=n&&(this.alwaysShowMenuButton||this._collapsed),i=r?n.getBoundingClientRect().width:0,a=r?this._num(getComputedStyle(t).columnGap,0):0,o=t.getBoundingClientRect().width-i-a;return e.getBoundingClientRect().width>o+.5}_setTabsCollapsed(e){if(this._tabsCollapsed===e)return;let t=this._tabsNav,n=e&&!!t?.contains(this.shadowRoot?.activeElement??null);if(e)for(let e of this._getNavItems()){if(e.kind!==`dropdown`)continue;let t=this._getDropdownForSlot(e.slotName);n||=t===document.activeElement,t?.removeAttribute(`open`)}this._tabsCollapsed=e,this.toggleAttribute(`data-tabs-collapsed`,e),n&&this.updateComplete.then(()=>this._menuBtn?.focus())}_observeLayout(){if(!this._ro)return;let e=[this._top,this._tabsNav,this._tabsNav?.closest(`.tabs-row`),this._menuBtn,...this._customActions].filter(e=>!!e);if(!(e.length===this._observedLayout.length&&e.every((e,t)=>e===this._observedLayout[t]))){this._ro?.disconnect(),this._observedLayout=e;for(let t of e)this._ro?.observe(t,{box:`border-box`})}}connectedCallback(){super.connectedCallback(),window.addEventListener(`keydown`,this._onGlobalFocusRingKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute(`data-upgrading`,``),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute(`data-upgrading`))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener(`focusin`,this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._observeLayout(),window.addEventListener(`resize`,this._onWindowResize,{passive:!0})}updated(e){e.has(`searchMax`)&&this.style.setProperty(`--scb-header-search-max`,this.searchMax??`380px`),e.has(`searchMin`)&&this.style.setProperty(`--scb-header-search-min`,this.searchMin??`250px`),e.has(`searchHeight`)&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty(`--scb-search-height`,this.searchHeight.trim()):this.style.removeProperty(`--scb-search-height`)),(e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`))&&this._applyLogoSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`))&&this._applySpacing(),(e.has(`paddingInline`)||e.has(`paddingInlineExpanded`))&&this._applyPaddingInline(),(e.has(`banner`)||e.has(`bannerLabel`))&&this._syncLandmarkAttributes(),(e.has(`utilityItems`)||e.has(`_collapsed`)||e.has(`_tabsCollapsed`)||e.has(`_desktop`)||e.has(`_mobileSearchOpen`)||e.has(`tabs`)||e.has(`logoText`)||e.has(`logotypeText`)||e.has(`logoSrc`)||e.has(`logoWidth`)||e.has(`logoHeight`)||e.has(`logoAspectRatio`)||e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`_slotUtils`)||e.has(`_slotMenu`)||e.has(`_hasResponsiveActions`)||e.has(`showDrawer`)||e.has(`alwaysShowMenuButton`)||e.has(`showSearch`)||e.has(`layoutPending`)||e.has(`searchMax`)||e.has(`searchMin`)||e.has(`paddingInline`)||e.has(`paddingInlineExpanded`)||e.has(`size`))&&this.updateComplete.then(()=>{this._observeLayout(),this._scheduleMeasure()}),(e.has(`showDrawer`)||e.has(`deferDrawer`))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has(`showSearch`)&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has(`layoutPending`)&&!this.layoutPending&&this.requestLayout(),(e.has(`activeTab`)||e.has(`_slotNavItems`)||e.has(`tabs`)||e.has(`size`))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._observedLayout=[],this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener(`focusin`,this._onLocalFocusIn),window.removeEventListener(`keydown`,this._onGlobalFocusRingKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalFocusRingPointerDown,!0),window.removeEventListener(`resize`,this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t){if(/^\d+$/.test(t)){let e=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${e}, ${Ef[e]}px)`}return t}}_applySpacing(){let e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,n=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty(`--scb-header-spacing-block-start`,t):this.style.removeProperty(`--scb-header-spacing-block-start`),n?this.style.setProperty(`--scb-header-spacing-block-end`,n):this.style.removeProperty(`--scb-header-spacing-block-end`)}_applyPaddingInline(){let e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty(`--scb-header-padding-inline`,e):this.style.removeProperty(`--scb-header-padding-inline`),t?this.style.setProperty(`--scb-header-padding-inline-expanded`,t):this.style.removeProperty(`--scb-header-padding-inline-expanded`)}_syncLandmarkAttributes(){let e=this.renderRoot.querySelector(`.header-landmark`);if(!e)return;if(!this.banner){e.removeAttribute(`role`),e.removeAttribute(`aria-label`);return}e.setAttribute(`role`,`banner`);let t=(this.bannerLabel??``).trim();t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}_applyLogoSizing(){let e=(this.logoWidth??``).trim(),t=(this.logoHeight??``).trim(),n=(this.logoAspectRatio??``).trim();e?this.style.setProperty(`--scb-header-logo-img-w`,e):this.style.removeProperty(`--scb-header-logo-img-w`),t?this.style.setProperty(`--scb-header-logo-img-h`,t):e?this.style.setProperty(`--scb-header-logo-img-h`,`auto`):this.style.removeProperty(`--scb-header-logo-img-h`),n?this.style.setProperty(`--scb-header-logo-img-aspect-ratio`,n):this.style.removeProperty(`--scb-header-logo-img-aspect-ratio`)}_closeDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){let e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get(`md-focus-ring`)||(this._focusRingImportPromise??=Promise.resolve().then(()=>(j(),nc)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??=Promise.all([Promise.resolve().then(()=>(hd(),fd)),Promise.resolve().then(()=>(mf(),ff)),Promise.resolve().then(()=>(wu(),Su)),Promise.resolve().then(()=>(yf(),hf)).then(e=>{this._drawerRenderer=e}),this._ensureDrawerSlotComponentsReady()]).then(()=>void 0),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll(`[slot="drawer-menu"], [slot="drawer-close"]`)].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector(`[slot="drawer-menu"], [slot="drawer-close"]`)&&await Promise.all([this._drawerSlotContains(`scb-button`)?Promise.resolve().then(()=>(Mc(),Dc)):Promise.resolve(),this._drawerSlotContains(`scb-icon-button`)?Promise.resolve().then(()=>(dl(),il)):Promise.resolve(),this._drawerSlotContains(`scb-skeleton`)?Promise.resolve().then(()=>(Sf(),bf)):Promise.resolve(),this._drawerSlotContains(`scb-grid`)?Promise.resolve().then(()=>(Rd(),Id)):Promise.resolve(),this._drawerSlotContains(`scb-grid-item`)?Promise.resolve().then(()=>(Md(),kd)):Promise.resolve()])}async _ensureDropdownReady(){customElements.get(`scb-dropdown`)||(this._dropdownImportPromise??=Promise.resolve().then(()=>(Cd(),Sd)).then(()=>void 0),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(`.menu-trigger`).forEach(e=>{e.setAttribute(`aria-expanded`,String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:`tab`,...e}))}_getDropdownForSlot(e){let t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()===`scb-dropdown`?t:t.querySelector(`scb-dropdown`):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!==`dropdown`)return;let n=this._getDropdownForSlot(e.slotName);if(!n)return;let r=String(t);n.getAttribute(`data-index`)!==r&&n.setAttribute(`data-index`,r),n.hasAttribute(`as-tab`)||n.setAttribute(`as-tab`,``);let i=this.size,a=n;a?.size!==i&&(a.size=i),t===this.activeTab?n.getAttribute(`aria-current`)!==`page`&&n.setAttribute(`aria-current`,`page`):n.hasAttribute(`aria-current`)&&n.removeAttribute(`aria-current`)})}_readTabIndexFromEvent(e){let t=e.composedPath?e.composedPath():[];for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-index`);if(t==null)continue;let n=Number(t);if(Number.isFinite(n))return n}return null}_focusTabAtIndex(e){let t=this._getNavItems()[e];if(t){if(t.kind===`dropdown`){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute(`data-no-utility`,e),this.toggleAttribute(`data-no-search`,t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent(`search-input`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchinput`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`search-text-change`,{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchtextchange`,{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent(`search-change`,{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`searchchange`,{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e=``,t=!1){let n=e?`menu-trigger ${e}`:`menu-trigger`,r=(this.menuButtonLabel??``).trim(),i=(this.menuOpenLabel??``).trim()||r,a=this._menuExpanded?`true`:`false`;return t?x`
|
|
15676
15682
|
<button
|
|
15677
15683
|
type="button"
|
|
15678
15684
|
class=${`${n} header-icon-button`}
|
|
@@ -15916,7 +15922,7 @@
|
|
|
15916
15922
|
</clipPath>
|
|
15917
15923
|
</defs>
|
|
15918
15924
|
</svg>
|
|
15919
|
-
`}};N([_({type:String,attribute:`max-width`})],Z.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`padding-inline`,reflect:!0})],Z.prototype,`paddingInline`,void 0),N([_({type:String,attribute:`padding-inline-expanded`,reflect:!0})],Z.prototype,`paddingInlineExpanded`,void 0),N([_({type:String,reflect:!0})],Z.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Z.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Z.prototype,`spacingBottom`,void 0),N([_({type:String,reflect:!0,converter:
|
|
15925
|
+
`}};N([_({type:String,attribute:`max-width`})],Z.prototype,`maxWidth`,void 0),N([_({type:String,attribute:`padding-inline`,reflect:!0})],Z.prototype,`paddingInline`,void 0),N([_({type:String,attribute:`padding-inline-expanded`,reflect:!0})],Z.prototype,`paddingInlineExpanded`,void 0),N([_({type:String,reflect:!0})],Z.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Z.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Z.prototype,`spacingBottom`,void 0),N([_({type:String,reflect:!0,converter:kf})],Z.prototype,`size`,void 0),N([_({type:String,attribute:`logo-text`})],Z.prototype,`logoText`,void 0),N([_({type:String,attribute:`logotype-text`})],Z.prototype,`logotypeText`,void 0),N([_({type:String,attribute:`logo-alt`})],Z.prototype,`logoAlt`,void 0),N([_({type:String,attribute:`logo-href`})],Z.prototype,`logoHref`,void 0),N([_({type:String,attribute:`logo-src`})],Z.prototype,`logoSrc`,void 0),N([_({type:String,attribute:`logo-width`})],Z.prototype,`logoWidth`,void 0),N([_({type:String,attribute:`logo-height`})],Z.prototype,`logoHeight`,void 0),N([_({type:String,attribute:`logo-aspect-ratio`})],Z.prototype,`logoAspectRatio`,void 0),N([_({type:Boolean,attribute:`logo-invert-dm`,reflect:!0,converter:Of})],Z.prototype,`logoInvertDm`,void 0),N([_({type:Boolean,reflect:!0})],Z.prototype,`banner`,void 0),N([_({type:String,attribute:`banner-label`})],Z.prototype,`bannerLabel`,void 0),N([_({type:Array,attribute:`tabs`,converter:Z._JSON_ARRAY})],Z.prototype,`tabs`,void 0),N([_({type:Number,attribute:`active-tab`,reflect:!0})],Z.prototype,`activeTab`,void 0),N([_({type:Boolean,attribute:`reserve-tabs`,reflect:!0,converter:Of})],Z.prototype,`reserveTabs`,void 0),N([_({type:Number,attribute:`reserve-tabs-count`})],Z.prototype,`reserveTabsCount`,void 0),N([_({type:String,attribute:`reserve-tabs-widths`})],Z.prototype,`reserveTabsWidths`,void 0),N([_({type:Boolean,attribute:`layout-pending`,reflect:!0,converter:Of})],Z.prototype,`layoutPending`,void 0),N([_({type:Array,attribute:`utility-items`,converter:Z._JSON_ARRAY})],Z.prototype,`utilityItems`,void 0),N([_({type:String,attribute:`search-placeholder`})],Z.prototype,`searchPlaceholder`,void 0),N([_({type:String,attribute:`search-button-label`})],Z.prototype,`searchButtonLabel`,void 0),N([_({type:String,attribute:`search-clear-label`})],Z.prototype,`searchClearLabel`,void 0),N([_({type:String,attribute:`search-close-label`})],Z.prototype,`searchCloseLabel`,void 0),N([_({type:String,attribute:`menu-label`})],Z.prototype,`menuLabel`,void 0),N([_({type:String,attribute:`menu-button-label`})],Z.prototype,`menuButtonLabel`,void 0),N([_({type:String,attribute:`menu-open-label`})],Z.prototype,`menuOpenLabel`,void 0),N([_({type:String,attribute:`menu-sub-label`})],Z.prototype,`menuSubLabel`,void 0),N([_({type:String,attribute:`menu-section-label`})],Z.prototype,`menuSectionLabel`,void 0),N([_({type:String,attribute:`menu-search-placeholder`})],Z.prototype,`menuSearchPlaceholder`,void 0),N([_({type:String,attribute:`utility-navigation-label`})],Z.prototype,`utilityNavigationLabel`,void 0),N([_({type:String,attribute:`main-navigation-label`})],Z.prototype,`mainNavigationLabel`,void 0),N([_({type:Array,attribute:`menu-data`,converter:Z._JSON_ARRAY})],Z.prototype,`menuData`,void 0),N([_({type:Boolean,attribute:`defer-drawer`,reflect:!0,converter:Of})],Z.prototype,`deferDrawer`,void 0),N([_({type:Boolean,attribute:`show-drawer`,reflect:!0,converter:Df})],Z.prototype,`showDrawer`,void 0),N([_({type:Boolean,attribute:`always-show-menu-button`,reflect:!0,converter:Of})],Z.prototype,`alwaysShowMenuButton`,void 0),N([_({type:Boolean,attribute:`show-search`,reflect:!0,converter:Df})],Z.prototype,`showSearch`,void 0),N([_({type:Boolean,attribute:`include-utility-in-menu`,reflect:!0,converter:Of})],Z.prototype,`includeUtilityInMenu`,void 0),N([_({type:Boolean,attribute:`drawer-overlay`,reflect:!0,converter:Df})],Z.prototype,`drawerOverlay`,void 0),N([_({type:String,attribute:`search-max`})],Z.prototype,`searchMax`,void 0),N([_({type:String,attribute:`search-min`})],Z.prototype,`searchMin`,void 0),N([_({type:String,attribute:`search-height`})],Z.prototype,`searchHeight`,void 0),N([_({type:String,attribute:`search-text`,reflect:!0})],Z.prototype,`searchText`,void 0),N([v()],Z.prototype,`_drawerId`,void 0),N([v()],Z.prototype,`_menuExpanded`,void 0),N([v()],Z.prototype,`_searchId`,void 0),N([v()],Z.prototype,`_drawerReady`,void 0),N([v()],Z.prototype,`_mobileSearchOpen`,void 0),N([v()],Z.prototype,`_slotNavItems`,void 0),N([v()],Z.prototype,`_slotUtils`,void 0),N([v()],Z.prototype,`_slotMenu`,void 0),N([v()],Z.prototype,`_hasResponsiveActions`,void 0),N([v()],Z.prototype,`_collapsed`,void 0),N([v()],Z.prototype,`_tabsCollapsed`,void 0),N([v()],Z.prototype,`_desktop`,void 0),N([v()],Z.prototype,`_hideLogoText`,void 0),Z=Cf=N([a(`scb-header`)],Z),w(),b(),uc(),P();var Af={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},jf,Mf,Nf;function Pf(){return jf??=Promise.resolve().then(()=>(j(),nc)),jf}function Ff(){return Mf??=Promise.resolve().then(()=>(Ec(),Sc)),Mf}function If(){return Nf??=Promise.resolve().then(()=>(D(),zi)),Nf}var Lf=class extends C{constructor(...e){super(...e),this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.keyfigure=0,this.subtitle=``,this.supportingText=``,this.cardHref=``,this.href=``,this.icon=``,this.size=lc[`scb-keyfigure-card`].size,this.unit=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.sizing=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onPointerInteraction=e=>{this.__ensureRipple(e)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,Pf().then(({ensureFocusRingReady:e})=>e()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=e=>{let t=this.__effectiveHref;(e.key===`Enter`||e.key===` `)&&t&&(e.preventDefault(),this.__navigate(t,e))},this.__handleHrefNavigation=e=>{let t=this.__effectiveHref;t&&((!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),!e.target.closest(`a`)&&this.__navigate(t,e))}}static{this.styles=p`
|
|
15920
15926
|
/*
|
|
15921
15927
|
Designbrygga:
|
|
15922
15928
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -16306,7 +16312,7 @@
|
|
|
16306
16312
|
--scb-keyfigure-card-design-supporting-font-weight: var(--scb-keyfigure-card-design-supporting-large-font-weight);
|
|
16307
16313
|
}
|
|
16308
16314
|
/* design:bindings:scb-keyfigure-card:end */
|
|
16309
|
-
`}formatNumber(e){if(typeof e==`number`)return e.toLocaleString(`sv-SE`).replace(/\u00A0/g,` `);let t=Number(e);return Number.isNaN(t)?String(e):t.toLocaleString(`sv-SE`).replace(/\u00A0/g,` `)}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing(),this.__ensureSlottedIconDeps()}get __effectiveHref(){return(this.cardHref||this.href||``).trim()}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__slottedText(e){return Array.from(this.querySelectorAll(`[slot="${e}"]`)).map(e=>e.textContent?.trim()??``).filter(Boolean).join(` `)}async __ensureSlottedIconDeps(){let e=this.querySelector(`[slot="icon"]`);e&&(e.localName===`md-icon`||e.querySelector?.(`md-icon`))&&await
|
|
16315
|
+
`}formatNumber(e){if(typeof e==`number`)return e.toLocaleString(`sv-SE`).replace(/\u00A0/g,` `);let t=Number(e);return Number.isNaN(t)?String(e):t.toLocaleString(`sv-SE`).replace(/\u00A0/g,` `)}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing(),this.__ensureSlottedIconDeps()}get __effectiveHref(){return(this.cardHref||this.href||``).trim()}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__slottedText(e){return Array.from(this.querySelectorAll(`[slot="${e}"]`)).map(e=>e.textContent?.trim()??``).filter(Boolean).join(` `)}async __ensureSlottedIconDeps(){let e=this.querySelector(`[slot="icon"]`);e&&(e.localName===`md-icon`||e.querySelector?.(`md-icon`))&&await If()}__ensureRipple(e){if(this.__effectiveHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,Ff().then(({ensureRippleReady:e})=>e()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){let e=this.renderRoot.querySelector(`md-ripple`),t=this.renderRoot.querySelector(`.scb-keyfigure-card`),n=this.__pendingRippleEvent,r=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;let{syncRippleToControl:i}=await Ff();await i(e,t,n,r)}render(){let e=this.__effectiveHref,t=!!e,n=this.formatNumber(this.keyfigure),r=(this.unit||``).trim(),i=r?`${n} ${r}`:n,a=this.__hasSlottedContent(`icon`),o=this.__hasSlottedContent(`subtitle`),s=this.__hasSlottedContent(`supporting-text`),c=o?this.__slottedText(`subtitle`):this.subtitle,l=this.supportingText,u=o||!!c,d=s||!!l;return x`
|
|
16310
16316
|
<div
|
|
16311
16317
|
class="scb-keyfigure-card ${t?`clickable`:``} ${this.size}"
|
|
16312
16318
|
role=${t?`link`:`group`}
|
|
@@ -16347,7 +16353,7 @@
|
|
|
16347
16353
|
</div>
|
|
16348
16354
|
|
|
16349
16355
|
${t&&this.__focusRingLoaded?x`<md-focus-ring></md-focus-ring>`:``}
|
|
16350
|
-
`}__applyInnerSizing(){let e=this.renderRoot.querySelector(`.scb-keyfigure-card`);e&&(this.width&&this.width.trim()!==``?(e.style.inlineSize=`100%`,e.style.maxInlineSize=`100%`):(e.style.removeProperty(`inline-size`),e.style.removeProperty(`max-inline-size`)),this.height&&this.height.trim()!==``||this.sizing===`stretch`?e.style.blockSize=`100%`:e.style.removeProperty(`block-size`),this.maxHeight&&this.maxHeight.trim()!==``?e.style.maxBlockSize=`100%`:e.style.removeProperty(`max-block-size`))}updated(e){super.updated(e),e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),(e.has(`width`)||e.has(`height`)||e.has(`maxHeight`)||e.has(`sizing`))&&this.__applyInnerSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-keyfigure-card-spacing-block-start`,t):this.style.removeProperty(`--scb-keyfigure-card-spacing-block-start`),n?this.style.setProperty(`--scb-keyfigure-card-spacing-block-end`,n):this.style.removeProperty(`--scb-keyfigure-card-spacing-block-end`),r?this.style.setProperty(`--scb-keyfigure-card-spacing-inline-start`,r):this.style.removeProperty(`--scb-keyfigure-card-spacing-inline-start`),i?this.style.setProperty(`--scb-keyfigure-card-spacing-inline-end`,i):this.style.removeProperty(`--scb-keyfigure-card-spacing-inline-end`)}__dispatchNavigateEvents(e,t){let n={href:e},r=new CustomEvent(`card-navigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),i=new CustomEvent(`cardnavigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r)&&this.dispatchEvent(i)}__navigate(e,t){this.__dispatchNavigateEvents(e,t)&&(window.location.href=e)}};N([_({attribute:`keyfigure`})],
|
|
16356
|
+
`}__applyInnerSizing(){let e=this.renderRoot.querySelector(`.scb-keyfigure-card`);e&&(this.width&&this.width.trim()!==``?(e.style.inlineSize=`100%`,e.style.maxInlineSize=`100%`):(e.style.removeProperty(`inline-size`),e.style.removeProperty(`max-inline-size`)),this.height&&this.height.trim()!==``||this.sizing===`stretch`?e.style.blockSize=`100%`:e.style.removeProperty(`block-size`),this.maxHeight&&this.maxHeight.trim()!==``?e.style.maxBlockSize=`100%`:e.style.removeProperty(`max-block-size`))}updated(e){super.updated(e),e.has(`width`)&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty(`inline-size`)),e.has(`maxWidth`)&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty(`max-inline-size`)),e.has(`height`)&&(this.height?this.style.blockSize=this.height:this.style.removeProperty(`block-size`)),e.has(`maxHeight`)&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty(`max-block-size`)),(e.has(`width`)||e.has(`height`)||e.has(`maxHeight`)||e.has(`sizing`))&&this.__applyInnerSizing(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-keyfigure-card-spacing-block-start`,t):this.style.removeProperty(`--scb-keyfigure-card-spacing-block-start`),n?this.style.setProperty(`--scb-keyfigure-card-spacing-block-end`,n):this.style.removeProperty(`--scb-keyfigure-card-spacing-block-end`),r?this.style.setProperty(`--scb-keyfigure-card-spacing-inline-start`,r):this.style.removeProperty(`--scb-keyfigure-card-spacing-inline-start`),i?this.style.setProperty(`--scb-keyfigure-card-spacing-inline-end`,i):this.style.removeProperty(`--scb-keyfigure-card-spacing-inline-end`)}__dispatchNavigateEvents(e,t){let n={href:e},r=new CustomEvent(`card-navigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0}),i=new CustomEvent(`cardnavigate`,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r)&&this.dispatchEvent(i)}__navigate(e,t){this.__dispatchNavigateEvents(e,t)&&(window.location.href=e)}};N([_({attribute:`keyfigure`})],Lf.prototype,`keyfigure`,void 0),N([_({type:String,attribute:`subtitle`})],Lf.prototype,`subtitle`,void 0),N([_({type:String,attribute:`supporting-text`})],Lf.prototype,`supportingText`,void 0),N([_({type:String,attribute:`card-href`})],Lf.prototype,`cardHref`,void 0),N([_({type:String,attribute:`href`})],Lf.prototype,`href`,void 0),N([_({type:String})],Lf.prototype,`icon`,void 0),N([_({type:String,reflect:!0})],Lf.prototype,`size`,void 0),N([_({type:String})],Lf.prototype,`unit`,void 0),N([_({type:String,reflect:!0})],Lf.prototype,`width`,void 0),N([_({type:String,reflect:!0,attribute:`max-width`})],Lf.prototype,`maxWidth`,void 0),N([_({type:String,reflect:!0})],Lf.prototype,`height`,void 0),N([_({type:String,reflect:!0,attribute:`max-height`})],Lf.prototype,`maxHeight`,void 0),N([_({type:String,reflect:!0,converter:Af})],Lf.prototype,`sizing`,void 0),N([_({type:String,reflect:!0})],Lf.prototype,`spacing`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-top`})],Lf.prototype,`spacingTop`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-bottom`})],Lf.prototype,`spacingBottom`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-left`})],Lf.prototype,`spacingLeft`,void 0),N([_({type:String,reflect:!0,attribute:`spacing-right`})],Lf.prototype,`spacingRight`,void 0),Lf=N([a(`scb-keyfigure-card`)],Lf),w(),b(),pl(),j(),P();var Rf=class extends C{constructor(...e){super(...e),this.href=``,this.ariaLabel=``,this.variant=`filled`,this.inverse=!1,this.external=!1,this.#e=e=>{ac(e);let t=e.composedPath()[0];!(t instanceof HTMLElement)||!t.matches(`:focus-visible`)||customElements.whenDefined(`md-focus-ring`).then(()=>{this.toggleAttribute(`data-native-focus-ring-ready`,!0);let e=this.renderRoot.querySelector(`md-focus-ring`);e.visible=t.matches(`:focus-visible`)})}}static{this.styles=p`
|
|
16351
16357
|
:host {
|
|
16352
16358
|
display: inline-flex;
|
|
16353
16359
|
inline-size: fit-content;
|
|
@@ -16569,7 +16575,7 @@
|
|
|
16569
16575
|
</span>
|
|
16570
16576
|
<md-focus-ring aria-hidden="true"></md-focus-ring>
|
|
16571
16577
|
</a>
|
|
16572
|
-
`}#e};N([_({type:String,reflect:!0})],
|
|
16578
|
+
`}#e};N([_({type:String,reflect:!0})],Rf.prototype,`href`,void 0),N([_({type:String,reflect:!0})],Rf.prototype,`target`,void 0),N([_({type:String,reflect:!0})],Rf.prototype,`rel`,void 0),N([_({type:String,reflect:!0})],Rf.prototype,`download`,void 0),N([_({type:String,attribute:`aria-label`})],Rf.prototype,`ariaLabel`,void 0),N([_({type:String,reflect:!0})],Rf.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0})],Rf.prototype,`inverse`,void 0),N([_({type:Boolean,reflect:!0})],Rf.prototype,`external`,void 0),Rf=N([a(`scb-link-button`)],Rf),mf(),w(),b(),P();var zf=class extends C{constructor(...e){super(...e),this.href=``,this.dataHref=``,this.disabled=!1,this.__onClick=e=>{if(e.defaultPrevented)return;if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}let t=(this.href||``).trim();if(t){if(t.startsWith(`#`)){typeof window<`u`&&(window.location.hash=t.slice(1));return}if((this.getAttribute(`target`)||``).trim()===`_blank`){window.open(t,`_blank`,`noopener,noreferrer`);return}window.location.href=t}},this.__onKeyDown=e=>{if(!this.disabled){if(e.key===`Enter`){e.preventDefault(),this.click();return}e.key===` `&&e.preventDefault()}},this.__onKeyUp=e=>{this.disabled||e.key===` `&&(e.preventDefault(),this.click())}}static{this.styles=p`
|
|
16573
16579
|
:host {
|
|
16574
16580
|
display: inline-flex;
|
|
16575
16581
|
align-items: center;
|
|
@@ -16596,7 +16602,7 @@
|
|
|
16596
16602
|
.label {
|
|
16597
16603
|
pointer-events: none;
|
|
16598
16604
|
}
|
|
16599
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.__onClick),this.addEventListener(`keydown`,this.__onKeyDown),this.addEventListener(`keyup`,this.__onKeyUp),this.__syncA11y()}disconnectedCallback(){this.removeEventListener(`click`,this.__onClick),this.removeEventListener(`keydown`,this.__onKeyDown),this.removeEventListener(`keyup`,this.__onKeyUp),super.disconnectedCallback()}updated(){this.__syncA11y()}__syncA11y(){let e=!!(this.href||``).trim();if(this.disabled){this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1,this.removeAttribute(`role`);return}this.removeAttribute(`aria-disabled`),this.tabIndex=0,this.setAttribute(`role`,e?`link`:`button`)}render(){return x`<span class="label"><slot></slot></span>`}};N([_({type:String})],
|
|
16605
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.__onClick),this.addEventListener(`keydown`,this.__onKeyDown),this.addEventListener(`keyup`,this.__onKeyUp),this.__syncA11y()}disconnectedCallback(){this.removeEventListener(`click`,this.__onClick),this.removeEventListener(`keydown`,this.__onKeyDown),this.removeEventListener(`keyup`,this.__onKeyUp),super.disconnectedCallback()}updated(){this.__syncA11y()}__syncA11y(){let e=!!(this.href||``).trim();if(this.disabled){this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1,this.removeAttribute(`role`);return}this.removeAttribute(`aria-disabled`),this.tabIndex=0,this.setAttribute(`role`,e?`link`:`button`)}render(){return x`<span class="label"><slot></slot></span>`}};N([_({type:String})],zf.prototype,`href`,void 0),N([_({type:String,attribute:`data-href`})],zf.prototype,`dataHref`,void 0),N([_({type:Boolean,reflect:!0})],zf.prototype,`disabled`,void 0),zf=N([a(`scb-nav-item`)],zf),w(),b(),E(),j(),P();var Bf={fromAttribute(e){return e!==null&&e.toLowerCase()!==`false`}},Vf=class extends C{constructor(...e){super(...e),this.__itemsEl=null,this.__resizeObserver=null,this.__resizeRaf=null,this.__canScrollLeft=!1,this.__canScrollRight=!1,this.label=``,this.activeHref=``,this.activateOnClick=!0,this.scrollShadow=!1,this.leftScrollButtonLabel=`Scrolla vänster`,this.rightScrollButtonLabel=`Scrolla höger`,this.sticky=!1,this.stickyTop=`0px`,this.stickyZIndex=5,this.stickyBackground=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__autoAriaLabel=!1,this.__itemIdPrefix=`scb-nav-${Math.random().toString(36).slice(2)}`,this.__itemIdCounter=0,this.__onSlotChange=async()=>{await this.__decorateItems(),this.__applyActiveHref(),this.__scheduleScrollControlUpdate()},this.__scrollLeft=()=>{this.__scrollBy(-this.__getScrollStep())},this.__scrollRight=()=>{this.__scrollBy(this.__getScrollStep())},this.__onWheel=e=>{if(e.ctrlKey)return;let t=this.__itemsEl;if(!t)return;let n=t.scrollWidth-t.clientWidth;if(n<=1)return;let r=this.__normalizeWheelDelta(e);if(r===0)return;let i=Math.max(0,Math.min(n,t.scrollLeft+r));i!==t.scrollLeft&&(e.preventDefault(),t.scrollLeft=i,this.__updateScrollControls())},this.__onItemsScroll=()=>{this.__updateScrollControls()},this.__onClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&(e.tagName===`A`||e.tagName===`BUTTON`||e.tagName===`SCB-NAV-ITEM`));if(!t)return;let n=this.__getItemHref(t);this.dispatchEvent(new CustomEvent(`scb-nav-select`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.dispatchEvent(new CustomEvent(`scbnavselect`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.activateOnClick&&n&&(this.activeHref=n)}}static{this.styles=p`
|
|
16600
16606
|
/*
|
|
16601
16607
|
Designbrygga:
|
|
16602
16608
|
- Ändra tokenvärden i src/tokens/source/sizing.json eller src/tokens/source/typography.json.
|
|
@@ -16903,7 +16909,7 @@
|
|
|
16903
16909
|
aria-label=${this.leftScrollButtonLabel}
|
|
16904
16910
|
@click=${this.__scrollLeft}
|
|
16905
16911
|
>
|
|
16906
|
-
${
|
|
16912
|
+
${Gd(`chevron_left`,`scb-nav__scroll-control-icon`)}
|
|
16907
16913
|
</button>
|
|
16908
16914
|
`:``}
|
|
16909
16915
|
${this.scrollShadow?x`<div class="scb-nav__scroll-shadow-left"></div>`:``}
|
|
@@ -16918,11 +16924,11 @@
|
|
|
16918
16924
|
aria-label=${this.rightScrollButtonLabel}
|
|
16919
16925
|
@click=${this.__scrollRight}
|
|
16920
16926
|
>
|
|
16921
|
-
${
|
|
16927
|
+
${Gd(`chevron_right`,`scb-nav__scroll-control-icon`)}
|
|
16922
16928
|
</button>
|
|
16923
16929
|
`:``}
|
|
16924
16930
|
</div>
|
|
16925
|
-
`}};N([v()],
|
|
16931
|
+
`}};N([v()],Vf.prototype,`__canScrollLeft`,void 0),N([v()],Vf.prototype,`__canScrollRight`,void 0),N([_({type:String})],Vf.prototype,`label`,void 0),N([_({type:String,attribute:`active-href`})],Vf.prototype,`activeHref`,void 0),N([_({type:Boolean,attribute:`activate-on-click`,converter:Bf})],Vf.prototype,`activateOnClick`,void 0),N([_({type:Boolean,attribute:`scroll-shadow`,converter:Bf})],Vf.prototype,`scrollShadow`,void 0),N([_({type:String,attribute:`left-scroll-button-label`})],Vf.prototype,`leftScrollButtonLabel`,void 0),N([_({type:String,attribute:`right-scroll-button-label`})],Vf.prototype,`rightScrollButtonLabel`,void 0),N([_({type:Boolean,reflect:!0})],Vf.prototype,`sticky`,void 0),N([_({type:String,attribute:`sticky-top`})],Vf.prototype,`stickyTop`,void 0),N([_({type:Number,attribute:`sticky-z-index`})],Vf.prototype,`stickyZIndex`,void 0),N([_({type:String,attribute:`sticky-background`})],Vf.prototype,`stickyBackground`,void 0),N([_({type:String,reflect:!0})],Vf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Vf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Vf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Vf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Vf.prototype,`spacingRight`,void 0),Vf=N([a(`scb-nav`)],Vf),w(),b(),gl(),Mc(),dl(),D(),cc(),P();var Hf=class extends C{constructor(...e){super(...e),this.variant=`icon-text`,this.alignment=`start`,this.page=1,this.totalPages=0,this.pagingHref=``,this.baseUri=``,this.paginationAriaLabel=`Paginering`,this.currentAriaLabel=`Nuvarande sida, `,this.pagingNumberAriaLabel=`Gå till sida `,this.previousLabel=`Föregående`,this.nextLabel=`Nästa`,this.previousAriaLabel=`Föregående sida`,this.nextAriaLabel=`Nästa sida`,this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{let e=(this.getBoundingClientRect().width||window.innerWidth)<=768||window.innerWidth<=768;this.isNarrow!==e&&(this.isNarrow=e)}}static{this.styles=[p`
|
|
16926
16932
|
:host {
|
|
16927
16933
|
display: block;
|
|
16928
16934
|
width: 100%;
|
|
@@ -17323,7 +17329,7 @@
|
|
|
17323
17329
|
${p}
|
|
17324
17330
|
</div>
|
|
17325
17331
|
</nav>
|
|
17326
|
-
`}};N([_({type:String})],
|
|
17332
|
+
`}};N([_({type:String})],Hf.prototype,`variant`,void 0),N([_({type:String})],Hf.prototype,`alignment`,void 0),N([_({type:Number})],Hf.prototype,`page`,void 0),N([_({type:Number,attribute:`total-pages`})],Hf.prototype,`totalPages`,void 0),N([_({type:String,attribute:`paging-href`})],Hf.prototype,`pagingHref`,void 0),N([_({type:String,attribute:`base-uri`})],Hf.prototype,`baseUri`,void 0),N([_({type:String,attribute:`pagination-aria-label`})],Hf.prototype,`paginationAriaLabel`,void 0),N([_({type:String,attribute:`current-aria-label`})],Hf.prototype,`currentAriaLabel`,void 0),N([_({type:String,attribute:`paging-number-aria-label`})],Hf.prototype,`pagingNumberAriaLabel`,void 0),N([_({type:String,attribute:`previous-label`})],Hf.prototype,`previousLabel`,void 0),N([_({type:String,attribute:`next-label`})],Hf.prototype,`nextLabel`,void 0),N([_({type:String,attribute:`previous-aria-label`})],Hf.prototype,`previousAriaLabel`,void 0),N([_({type:String,attribute:`next-aria-label`})],Hf.prototype,`nextAriaLabel`,void 0),N([_({type:Boolean})],Hf.prototype,`isNarrow`,void 0),N([_({type:String})],Hf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`})],Hf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`})],Hf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`})],Hf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`})],Hf.prototype,`spacingRight`,void 0),Hf=N([a(`scb-pagination`)],Hf),w(),b(),P();var Uf={fromAttribute(e){return e!==null&&e.toLowerCase()!==`false`}},Wf=class extends C{constructor(...e){super(...e),this.id=``,this.type=`circular`,this.progress=25,this.isStatic=!0,this.loadingLabel=`Laddar`,this.progressLabel=`Förlopp`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._isSyncingAria=!1,this._defaultAriaLabelApplied=!1,this._defaultAriaValueTextApplied=!1}static{this.styles=[p`
|
|
17327
17333
|
.circular {
|
|
17328
17334
|
display: flex;
|
|
17329
17335
|
align-items: center;
|
|
@@ -17423,7 +17429,7 @@
|
|
|
17423
17429
|
</div>
|
|
17424
17430
|
`}
|
|
17425
17431
|
</div>
|
|
17426
|
-
`}};N([_({type:String})],
|
|
17432
|
+
`}};N([_({type:String})],Wf.prototype,`id`,void 0),N([_({type:String,reflect:!0})],Wf.prototype,`type`,void 0),N([_({type:Number,reflect:!0})],Wf.prototype,`progress`,void 0),N([_({type:Boolean,attribute:`is-static`,converter:Uf})],Wf.prototype,`isStatic`,void 0),N([_({type:String,attribute:`loading-label`})],Wf.prototype,`loadingLabel`,void 0),N([_({type:String,attribute:`progress-label`})],Wf.prototype,`progressLabel`,void 0),N([_({type:String,reflect:!0})],Wf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Wf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Wf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Wf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Wf.prototype,`spacingRight`,void 0),Wf=N([a(`scb-progress-indicator`)],Wf),E(),w(),b(),j(),Ol(),P();var Gf=class extends C{constructor(...e){super(...e),this.width=`100%`,this.active=!1,this.current=!1,this.disabled=!1,this.href=``,this.label=``,this.position=`top`,this._stepId=`scb-step-${Math.random().toString(36).slice(2)}`,this._showTooltip=()=>{let e=this.renderRoot.querySelector(`.tooltip`),t=this.renderRoot.querySelector(`.progress-step`);!this.label||this.disabled||!Sl(e,t,`hint`)||this._adjustTooltipPosition()},this._hideTooltip=()=>{z(this.renderRoot.querySelector(`.tooltip`))},this._adjustTooltipPosition=()=>{let e=this.renderRoot.querySelector(`.tooltip`),t=this.renderRoot.querySelector(`.progress-step`);if(!e||!t||!wl(e))return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.position===`top`,a=n.bottom+10+r.height<=window.innerHeight-8,o=n.top-10-r.height>=8,s=i?a||!o:!o&&a,c=Math.min(Math.max(n.left+(n.width-r.width)/2,8),Math.max(8,window.innerWidth-r.width-8)),l=s?Math.min(n.bottom+10,window.innerHeight-r.height-8):Math.max(8,n.top-10-r.height);e.classList.toggle(`top`,s),e.classList.toggle(`bottom`,!s),e.classList.remove(`tooltip-left`,`tooltip-right`),e.style.left=`${c}px`,e.style.right=``,e.style.top=`${l}px`,e.style.bottom=`auto`,e.style.transform=`none`}}static{this.styles=p`
|
|
17427
17433
|
:host {
|
|
17428
17434
|
display: block;
|
|
17429
17435
|
width: var(--progress-step-width, 100%);
|
|
@@ -17591,7 +17597,7 @@
|
|
|
17591
17597
|
`}
|
|
17592
17598
|
${this.disabled?``:x`<md-focus-ring for="${this._stepId}"></md-focus-ring>`}
|
|
17593
17599
|
${this.label&&!this.disabled?x`<div class="tooltip ${this.position===`bottom`?`bottom`:`top`}">${this.label}</div>`:``}
|
|
17594
|
-
`}};N([_({type:String})],
|
|
17600
|
+
`}};N([_({type:String})],Gf.prototype,`width`,void 0),N([_({type:Boolean,reflect:!0})],Gf.prototype,`active`,void 0),N([_({type:Boolean,reflect:!0})],Gf.prototype,`current`,void 0),N([_({type:Boolean,reflect:!0})],Gf.prototype,`disabled`,void 0),N([_({type:String,reflect:!0})],Gf.prototype,`href`,void 0),N([_({type:String})],Gf.prototype,`label`,void 0),N([_({type:String})],Gf.prototype,`position`,void 0),N([v()],Gf.prototype,`_stepId`,void 0),Gf=N([a(`scb-progress-step`)],Gf),w(),b(),P();var Kf=class extends C{constructor(...e){super(...e),this.progressWidth=23,this.height=`normal`,this.position=`top`,this.ariaLabel=`Förloppssteg`,this.ariaLabelledby=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.syncSteps=()=>{let e=this.shadowRoot?.querySelector(`slot`);if(!e)return;let t=e.assignedElements({flatten:!0}).filter(e=>e instanceof Gf),n=this.clampPercent(this.progressWidth),r=t.map(e=>this.parseStepWidth(e.width)).reduce((e,t)=>{let n=e.length>0?e[e.length-1]:0;return e.push(n+t),e},[]),i=r.findIndex(e=>n<=e),a=i===-1?t.length-1:Math.max(0,i);t.forEach((e,i)=>{let o=r[i]??0;e.position=this.position,e.active=o<=n+2,e.current=i===a,e.setAttribute(`aria-posinset`,String(i+1)),e.setAttribute(`aria-setsize`,String(t.length)),i===t.length-1?e.classList.add(`last-step`):e.classList.remove(`last-step`)})}}static{this.styles=p`
|
|
17595
17601
|
:host {
|
|
17596
17602
|
display: block;
|
|
17597
17603
|
width: 100%;
|
|
@@ -17668,7 +17674,7 @@
|
|
|
17668
17674
|
<slot @slotchange=${this.syncSteps}></slot>
|
|
17669
17675
|
</div>
|
|
17670
17676
|
</nav>
|
|
17671
|
-
`}};N([_({type:Number,reflect:!0,attribute:`progress-width`})],
|
|
17677
|
+
`}};N([_({type:Number,reflect:!0,attribute:`progress-width`})],Kf.prototype,`progressWidth`,void 0),N([_({type:String,reflect:!0})],Kf.prototype,`height`,void 0),N([_({type:String,reflect:!0})],Kf.prototype,`position`,void 0),N([_({type:String,attribute:`aria-label`})],Kf.prototype,`ariaLabel`,void 0),N([_({type:String,attribute:`aria-labelledby`})],Kf.prototype,`ariaLabelledby`,void 0),N([_({type:String,reflect:!0})],Kf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Kf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Kf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Kf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Kf.prototype,`spacingRight`,void 0),Kf=N([a(`scb-progress-stepper`)],Kf),w(),b(),P();var qf=class extends C{constructor(...e){super(...e),this.navSelector=``,this.offsetTop=0,this.offsetBottom=0,this.updateHash=!0,this.activeId=``,this.layout=``,this.sidebarNavWidth=`320px`,this.sidebarHeight=`560px`,this.stackHeight=``,this.sidebarNavTop=`0px`,this.contentPadding=`0px`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__navEl=null,this.__contentEl=null,this.__contentShellEl=null,this.__links=[],this.__observer=null,this.__fallbackScrollRoot=null,this.__entries=new Map,this.__rafId=null,this.__scrollRafId=null,this.__hashAllowUpdates=!1,this.__hashBaselineReady=!1,this.__hashBaselinePos=0,this.__hashBaselineRafId=null,this.__hashScrollRoot=null,this.__hashSuspend=!1,this.__hashInitialApplied=!1,this.__onHashScrollBound=()=>this.__onHashScroll(),this.__scrollAnimSeq=0,this.__syncingActiveId=!1,this.__slotsResolvedOnce=!1,this.__motionMeasureEl=null,this.__focusableRafId=null,this.__autoOffsetTop=0,this.__autoOffsetRafId=null,this.__navResizeObserver=null,this.__onNavClickBound=e=>this.__onNavClick(e),this.__onScrollFallbackBound=()=>this.__updateActiveFromRects(),this.__onResizeBound=()=>{this.__requestActiveRecalc(),this.__requestAutoOffsetMeasure()},this.__onSlotChange=()=>{let e=this.__navEl;this.__teardown(),this.__resolveSlots(),this.__requestEnsureContentFocusable(),this.__navEl&&this.__navEl.addEventListener(`click`,this.__onNavClickBound,!0),(e!==this.__navEl||!this.__links.length)&&this.__collectLinks(),this.__requestAutoOffsetMeasure(),this.__rebuildObserver(),this.__attachHashScrollRoot(),this.__applyInitialHashIfAny(),!this.__hashInitialApplied&&this.activeId&&this.__applyActiveId(this.activeId,{updateHash:!1,scrollToTarget:!1}),this.__slotsResolvedOnce=!0}}static{this.properties={navSelector:{type:String,attribute:`nav-selector`},offsetTop:{type:Number,attribute:`offset-top`},offsetBottom:{type:Number,attribute:`offset-bottom`},updateHash:{type:Boolean,attribute:`update-hash`,converter:{fromAttribute:e=>{if(e===null)return!0;let t=e.trim().toLowerCase();return!(t===`false`||t===`0`||t===`no`)},toAttribute:e=>e?``:null}},activeId:{type:String,attribute:`active-id`,reflect:!0},layout:{type:String,reflect:!0},sidebarNavWidth:{type:String,attribute:`sidebar-nav-width`},sidebarHeight:{type:String,attribute:`sidebar-height`},stackHeight:{type:String,attribute:`stack-height`},sidebarNavTop:{type:String,attribute:`sidebar-nav-top`},contentPadding:{type:String,attribute:`content-padding`},spacing:{type:String,reflect:!0},spacingTop:{type:String,attribute:`spacing-top`,reflect:!0},spacingBottom:{type:String,attribute:`spacing-bottom`,reflect:!0},spacingLeft:{type:String,attribute:`spacing-left`,reflect:!0},spacingRight:{type:String,attribute:`spacing-right`,reflect:!0}}}static{this.styles=p`
|
|
17672
17678
|
:host {
|
|
17673
17679
|
display: contents;
|
|
17674
17680
|
}
|
|
@@ -17755,7 +17761,7 @@
|
|
|
17755
17761
|
`}return x`
|
|
17756
17762
|
<slot name="nav" @slotchange=${this.__onSlotChange}></slot>
|
|
17757
17763
|
<slot name="content" @slotchange=${this.__onSlotChange}></slot>
|
|
17758
|
-
`}};
|
|
17764
|
+
`}};qf=N([a(`scb-scrollspy`)],qf),w(),b(),D(),E(),j(),P();var Jf=class extends C{constructor(...e){super(...e),this.label=``,this.value=``,this.selected=!1,this.icon=``,this.href=``,this.disabled=!1,this.onHostKeydown=e=>{if(!this.href||this.isEffectivelyDisabled||e.code!==`Space`&&e.code!==`Enter`&&e.code!==`NumpadEnter`)return;let t=this.shadowRoot?.querySelector(`a[href]`);t&&(e.preventDefault(),e.stopPropagation(),t.click())}}get isEffectivelyDisabled(){let e=this.parentElement?.hasAttribute?.(`disabled`);return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1||e.nodeType===3&&(e.textContent??``).trim()!==``)}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,ac)}static{this.styles=p`
|
|
17759
17765
|
:host {
|
|
17760
17766
|
display: block;
|
|
17761
17767
|
block-size: 100%;
|
|
@@ -17859,7 +17865,7 @@
|
|
|
17859
17865
|
${this.selected?t&&n?a:t?x`${a}<md-icon>${this.icon}</md-icon>`:a:t?x`<md-icon>${this.icon}</md-icon>`:n?o:``}
|
|
17860
17866
|
${n?x`<span>${r}</span>`:``}
|
|
17861
17867
|
<md-focus-ring inward></md-focus-ring>
|
|
17862
|
-
`;return this.href?x`<a class="${i}" href="${this.href}" aria-disabled="${e?`true`:`false`}" tabindex="-1">${s}</a>`:x`<div class="${i}" aria-disabled="${e?`true`:`false`}">${s}</div>`}updateInteractiveAttributes(){this.setAttribute(`tabindex`,this.disabled?`-1`:`0`),this.setAttribute(`role`,this.href?`link`:`button`)}firstUpdated(){this.addEventListener(`keydown`,this.onHostKeydown),this.updateInteractiveAttributes()}disconnectedCallback(){this.removeEventListener(`focusin`,ac),this.removeEventListener(`keydown`,this.onHostKeydown),super.disconnectedCallback()}updated(e){super.updated(e),(e.has(`disabled`)||e.has(`href`))&&this.updateInteractiveAttributes()}};N([_({type:String,reflect:!0})],
|
|
17868
|
+
`;return this.href?x`<a class="${i}" href="${this.href}" aria-disabled="${e?`true`:`false`}" tabindex="-1">${s}</a>`:x`<div class="${i}" aria-disabled="${e?`true`:`false`}">${s}</div>`}updateInteractiveAttributes(){this.setAttribute(`tabindex`,this.disabled?`-1`:`0`),this.setAttribute(`role`,this.href?`link`:`button`)}firstUpdated(){this.addEventListener(`keydown`,this.onHostKeydown),this.updateInteractiveAttributes()}disconnectedCallback(){this.removeEventListener(`focusin`,ac),this.removeEventListener(`keydown`,this.onHostKeydown),super.disconnectedCallback()}updated(e){super.updated(e),(e.has(`disabled`)||e.has(`href`))&&this.updateInteractiveAttributes()}};N([_({type:String,reflect:!0})],Jf.prototype,`label`,void 0),N([_({type:String,reflect:!0})],Jf.prototype,`value`,void 0),N([_({type:Boolean,reflect:!0})],Jf.prototype,`selected`,void 0),N([_({type:String,reflect:!0})],Jf.prototype,`icon`,void 0),N([_({type:String,reflect:!0})],Jf.prototype,`href`,void 0),N([_({type:Boolean,reflect:!0})],Jf.prototype,`disabled`,void 0),Jf=N([a(`scb-segmented-item`)],Jf),w(),b(),uc(),P();var Yf=class extends C{static{this.formAssociated=!0}constructor(){super(),this._internals=null,this.variant=`single-select`,this.layout=`horizontal`,this.size=lc[`scb-segmented-button`].size,this.value=``,this.values=[],this.disabled=!1,this.required=!1,this.name=``,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._initialValue=``,this._initialValues=[],this._customValidationMessage=``,`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
17863
17869
|
:host {
|
|
17864
17870
|
--scb-segmented-button-width: 100%;
|
|
17865
17871
|
--scb-segmented-button-height: var(--scb-segmented-button-control-size-medium, var(--scb-segmented-button-design-height-medium));
|
|
@@ -18034,7 +18040,7 @@
|
|
|
18034
18040
|
--scb-segmented-button-design-gap: var(--scb-segmented-button-design-gap-large);
|
|
18035
18041
|
}
|
|
18036
18042
|
/* design:bindings:scb-segmented-button:end */
|
|
18037
|
-
`}connectedCallback(){super.connectedCallback(),this._form=this.closest(`form`),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this.updateSegments(),this._syncFormValue()},this._form.addEventListener(`reset`,this._formResetHandler,!0))}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this.updateSegments();let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>{this.updateSegments()}),e.addEventListener(`click`,e=>this.onSlotClick(e)),e.addEventListener(`focus`,()=>{this.dispatchEvent(new CustomEvent(`focus`,{detail:{},bubbles:!0,composed:!0}))},!0),e.addEventListener(`blur`,()=>{this.dispatchEvent(new CustomEvent(`blur`,{detail:{},bubbles:!0,composed:!0}))},!0),e.addEventListener(`keydown`,e=>{if(e.code===`Space`||e.code===`Enter`||e.code===`NumpadEnter`){let t=e.target;if(t&&t.closest){let n=t.closest(`scb-segmented-item`);n&&!n.hasAttribute(`disabled`)&&!this.disabled&&(this.onSlotClick(e),e.preventDefault())}}})),this._syncFormValue(),this._syncValidity(),this.#t()}updated(e){super.updated(e),this.updateSegments(),(e.has(`value`)||e.has(`values`)||e.has(`disabled`)||e.has(`variant`)||e.has(`name`))&&(this._syncFormValue(),this._syncValidity()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#t()}onSlotClick(e){let t=e.target;if(!t||!t.closest)return;let n=t.closest(`scb-segmented-item`);if(!n||this.disabled||n.hasAttribute(`disabled`))return;let r=n.getAttribute(`value`)||``;r&&(this.variant===`multi-select`?(this.values.indexOf(r)===-1?this.values=[...this.values,r]:this.values=this.values.filter(e=>e!==r),this.dispatchEvent(new CustomEvent(`change`,{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):r!==this.value&&(this.value=r,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:r},bubbles:!0,composed:!0})),this.updateSegments()),this.#e(e,n))}#e(e,t){!(e instanceof MouseEvent)||e.detail===0||queueMicrotask(()=>{document.activeElement===t&&t.blur()})}updateSegments(){let e=this.shadowRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{if(e.tagName===`SCB-SEGMENTED-ITEM`){this.layout===`responsive`?e.setAttribute(`data-scb-segmented-layout`,`responsive`):e.removeAttribute(`data-scb-segmented-layout`);let t=e.getAttribute(`value`)||``;if(t){let n=!1;n=this.variant===`multi-select`?!!this.values&&this.values.includes(t):t===this.value,e.setAttribute(`aria-pressed`,n?`true`:`false`),n?e.setAttribute(`selected`,`true`):e.removeAttribute(`selected`)}this.disabled&&e.setAttribute(`disabled`,`true`)}})}formDisabledCallback(e){this.disabled=e}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required?this.variant===`multi-select`?this.values.length===0?`Välj minst ett alternativ.`:``:this.value?``:`Välj ett alternativ.`:``}_syncValidity(){if(!this._internals)return;let e=this.disabled?``:this._getValidationMessage();e?(this._internals.setValidity({valueMissing:!0},e),this.setAttribute(`aria-invalid`,`true`)):(this._internals.setValidity({}),this.removeAttribute(`aria-invalid`))}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){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant===`multi-select`){if(!this.values||this.values.length===0){this._internals.setFormValue(null);return}let e=new FormData;for(let t of this.values)e.append(this.name,t);this._internals.setFormValue(e)}else{if(!this.value){this._internals.setFormValue(null);return}this._internals.setFormValue(this.value)}}}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#t(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-segmented-button-spacing-block-start`,t):this.style.removeProperty(`--scb-segmented-button-spacing-block-start`),n?this.style.setProperty(`--scb-segmented-button-spacing-block-end`,n):this.style.removeProperty(`--scb-segmented-button-spacing-block-end`),r?this.style.setProperty(`--scb-segmented-button-spacing-inline-start`,r):this.style.removeProperty(`--scb-segmented-button-spacing-inline-start`),i?this.style.setProperty(`--scb-segmented-button-spacing-inline-end`,i):this.style.removeProperty(`--scb-segmented-button-spacing-inline-end`)}render(){return x`<slot></slot>`}};N([_({type:String,reflect:!0})],
|
|
18043
|
+
`}connectedCallback(){super.connectedCallback(),this._form=this.closest(`form`),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this.updateSegments(),this._syncFormValue()},this._form.addEventListener(`reset`,this._formResetHandler,!0))}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0),super.disconnectedCallback()}firstUpdated(){this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this.updateSegments();let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>{this.updateSegments()}),e.addEventListener(`click`,e=>this.onSlotClick(e)),e.addEventListener(`focus`,()=>{this.dispatchEvent(new CustomEvent(`focus`,{detail:{},bubbles:!0,composed:!0}))},!0),e.addEventListener(`blur`,()=>{this.dispatchEvent(new CustomEvent(`blur`,{detail:{},bubbles:!0,composed:!0}))},!0),e.addEventListener(`keydown`,e=>{if(e.code===`Space`||e.code===`Enter`||e.code===`NumpadEnter`){let t=e.target;if(t&&t.closest){let n=t.closest(`scb-segmented-item`);n&&!n.hasAttribute(`disabled`)&&!this.disabled&&(this.onSlotClick(e),e.preventDefault())}}})),this._syncFormValue(),this._syncValidity(),this.#t()}updated(e){super.updated(e),this.updateSegments(),(e.has(`value`)||e.has(`values`)||e.has(`disabled`)||e.has(`variant`)||e.has(`name`))&&(this._syncFormValue(),this._syncValidity()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#t()}onSlotClick(e){let t=e.target;if(!t||!t.closest)return;let n=t.closest(`scb-segmented-item`);if(!n||this.disabled||n.hasAttribute(`disabled`))return;let r=n.getAttribute(`value`)||``;r&&(this.variant===`multi-select`?(this.values.indexOf(r)===-1?this.values=[...this.values,r]:this.values=this.values.filter(e=>e!==r),this.dispatchEvent(new CustomEvent(`change`,{detail:{values:this.values},bubbles:!0,composed:!0})),this.updateSegments()):r!==this.value&&(this.value=r,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:r},bubbles:!0,composed:!0})),this.updateSegments()),this.#e(e,n))}#e(e,t){!(e instanceof MouseEvent)||e.detail===0||queueMicrotask(()=>{document.activeElement===t&&t.blur()})}updateSegments(){let e=this.shadowRoot?.querySelector(`slot`);e&&e.assignedElements().forEach(e=>{if(e.tagName===`SCB-SEGMENTED-ITEM`){this.layout===`responsive`?e.setAttribute(`data-scb-segmented-layout`,`responsive`):e.removeAttribute(`data-scb-segmented-layout`);let t=e.getAttribute(`value`)||``;if(t){let n=!1;n=this.variant===`multi-select`?!!this.values&&this.values.includes(t):t===this.value,e.setAttribute(`aria-pressed`,n?`true`:`false`),n?e.setAttribute(`selected`,`true`):e.removeAttribute(`selected`)}this.disabled&&e.setAttribute(`disabled`,`true`)}})}formDisabledCallback(e){this.disabled=e}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required?this.variant===`multi-select`?this.values.length===0?`Välj minst ett alternativ.`:``:this.value?``:`Välj ett alternativ.`:``}_syncValidity(){if(!this._internals)return;let e=this.disabled?``:this._getValidationMessage();e?(this._internals.setValidity({valueMissing:!0},e),this.setAttribute(`aria-invalid`,`true`)):(this._internals.setValidity({}),this.removeAttribute(`aria-invalid`))}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){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant===`multi-select`){if(!this.values||this.values.length===0){this._internals.setFormValue(null);return}let e=new FormData;for(let t of this.values)e.append(this.name,t);this._internals.setFormValue(e)}else{if(!this.value){this._internals.setFormValue(null);return}this._internals.setFormValue(this.value)}}}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#t(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-segmented-button-spacing-block-start`,t):this.style.removeProperty(`--scb-segmented-button-spacing-block-start`),n?this.style.setProperty(`--scb-segmented-button-spacing-block-end`,n):this.style.removeProperty(`--scb-segmented-button-spacing-block-end`),r?this.style.setProperty(`--scb-segmented-button-spacing-inline-start`,r):this.style.removeProperty(`--scb-segmented-button-spacing-inline-start`),i?this.style.setProperty(`--scb-segmented-button-spacing-inline-end`,i):this.style.removeProperty(`--scb-segmented-button-spacing-inline-end`)}render(){return x`<slot></slot>`}};N([_({type:String,reflect:!0})],Yf.prototype,`variant`,void 0),N([_({type:String,reflect:!0})],Yf.prototype,`layout`,void 0),N([_({type:String,reflect:!0})],Yf.prototype,`size`,void 0),N([_({type:String,reflect:!0})],Yf.prototype,`value`,void 0),N([_({type:Array})],Yf.prototype,`values`,void 0),N([_({type:Boolean,reflect:!0})],Yf.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],Yf.prototype,`required`,void 0),N([_({type:String,reflect:!0})],Yf.prototype,`name`,void 0),N([_({type:String,reflect:!0})],Yf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Yf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Yf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Yf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Yf.prototype,`spacingRight`,void 0),Yf=N([a(`scb-segmented-button`)],Yf),w(),b(),E(),j(),P();var Xf=class extends C{constructor(...e){super(...e),this.value=``,this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label=``,this.noHighlightSelected=!1}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,ac)}updated(){this.setAttribute(`role`,`option`),this.setAttribute(`aria-selected`,this.checked?`true`:`false`),this.disabled?this.setAttribute(`aria-disabled`,`true`):this.removeAttribute(`aria-disabled`)}disconnectedCallback(){this.removeEventListener(`focusin`,ac),super.disconnectedCallback()}static{this.styles=p`
|
|
18038
18044
|
:host {
|
|
18039
18045
|
/* Fälttext: base text current. JSON-källa: src/tokens/source/typography.json. */
|
|
18040
18046
|
--scb-fields-text-font-weight-current: var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));
|
|
@@ -18243,7 +18249,7 @@
|
|
|
18243
18249
|
<div class="label">${this.label?this.label:x`<slot></slot>`}</div>
|
|
18244
18250
|
<md-focus-ring inward></md-focus-ring>
|
|
18245
18251
|
</div>
|
|
18246
|
-
`}};N([_({type:String})],
|
|
18252
|
+
`}};N([_({type:String})],Xf.prototype,`value`,void 0),N([_({type:Boolean,reflect:!0})],Xf.prototype,`disabled`,void 0),N([_({type:Boolean})],Xf.prototype,`showCheckbox`,void 0),N([_({type:Boolean})],Xf.prototype,`checked`,void 0),N([_({type:Boolean})],Xf.prototype,`showRadio`,void 0),N([_({type:String})],Xf.prototype,`label`,void 0),N([_({type:Boolean,attribute:`no-highlight-selected`,reflect:!0})],Xf.prototype,`noHighlightSelected`,void 0),Xf=N([a(`scb-select-option`)],Xf),w(),pl(),b(),D(),yc(),dl(),Nl(),j(),Ol(),uc(),cc(),P();var Q=class extends C{static{this.formAssociated=!0}constructor(){super(),this._optionsObserver=null,this._internals=null,this.focusedIndex=-1,this.variant=`single-select`,this.value=``,this.values=[],this.disabled=!1,this.required=!1,this.error=!1,this.open=!1,this.label=``,this.name=``,this.placeholder=``,this.supportingText=``,this.errorText=``,this.helpText=``,this.helpLabel=`Visa hjälptext`,this.withRadiobuttons=!1,this.noHighlightSelected=!1,this.size=lc[`scb-select`].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.zIndex=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._initialValues=[],this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._selectId=`scb-select-${Math.random().toString(36).slice(2,11)}`,this._placementFrame=0,this._optionsPlacement=`below`,this._activeOption=null,this._onDocumentClick=e=>{if(!this.open)return;let t=e.composedPath();if(!t.includes(this)){let e=t.find(e=>e instanceof HTMLElement&&e.tagName.toLowerCase()===`scb-select`);if(e&&e!==this){this._setOpen(!1);return}this._setOpen(!1),requestAnimationFrame(()=>{this.open||this._focusTrigger()})}},this._scheduleOptionsPlacement=()=>{!this.open||!this.isConnected||(this._placementFrame&&cancelAnimationFrame(this._placementFrame),this._placementFrame=requestAnimationFrame(()=>{this._placementFrame=0,this._updateOptionsPlacement()}))},this._onSlotClick=e=>{let t=this._getOptions(),n=e.composedPath(),r=t.find(e=>n.includes(e));r&&(this._selectOption(r),this._focusTrigger(),e.stopPropagation())},this._onKeyDown=e=>{if(e.key===`Tab`&&this.open){this._setOpen(!1),this._syncOptionsPopover();return}if(e.key===`Escape`&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=e.key===`ArrowDown`?1:-1;if(!this.open){this._setOpen(!0,{keyboard:!0}),this.updateComplete.then(()=>{this._setFocusedIndex(this._getInitialFocusedIndex(),{scroll:!1}),this.focusedIndex>=0&&e.key===`ArrowUp`&&this._moveFocusedIndex(-1)});return}this._moveFocusedIndex(t);return}if((e.key===`Home`||e.key===`End`)&&this.open){e.preventDefault(),e.stopPropagation();let t=this._getOptions(),n=t.findIndex(e=>!e.disabled);if(e.key===`End`){for(let e=t.length-1;e>=0;--e)if(!t[e]?.disabled){n=e;break}}this._setFocusedIndex(n);return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),this.open){let e=this._getFocusedOption();e&&this._selectOption(e);return}this._setOpen(!0,{keyboard:!0})}},this._onOptionKeyDown=e=>{if(e.key===`Escape`&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=this._getOptions(),n=e.composedPath(),r=t.find(e=>n.includes(e));r&&this._selectOption(r)}},`attachInternals`in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size===`extra-small`?this.setAttribute(`data-density`,`-5`):this.size===`small`?this.setAttribute(`data-density`,`-4`):this.size===`medium`?this.setAttribute(`data-density`,`-2`):this.removeAttribute(`data-density`)}static{this.styles=p`
|
|
18247
18253
|
:host {
|
|
18248
18254
|
/* Fälttext: base text current. JSON-källa: src/tokens/source/typography.json. */
|
|
18249
18255
|
--scb-fields-text-font-weight-current: var(--scb-select-design-text-medium-font-weight);
|
|
@@ -18964,7 +18970,7 @@
|
|
|
18964
18970
|
<slot @slotchange="${()=>{this.requestUpdate(),this._scheduleOptionsPlacement()}}"></slot>
|
|
18965
18971
|
</div>
|
|
18966
18972
|
</div>
|
|
18967
|
-
`}};N([_({type:String})],Q.prototype,`variant`,void 0),N([_({type:String})],Q.prototype,`value`,void 0),N([_({type:Array})],Q.prototype,`values`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`open`,void 0),N([_({type:String})],Q.prototype,`label`,void 0),N([_({type:String})],Q.prototype,`name`,void 0),N([_({type:String})],Q.prototype,`placeholder`,void 0),N([_({type:String,attribute:`supporting-text`})],Q.prototype,`supportingText`,void 0),N([_({type:String,attribute:`error-text`})],Q.prototype,`errorText`,void 0),N([_({type:String,attribute:`help-text`})],Q.prototype,`helpText`,void 0),N([_({type:String,attribute:`help-label`})],Q.prototype,`helpLabel`,void 0),N([_({type:Boolean,attribute:`with-radiobuttons`})],Q.prototype,`withRadiobuttons`,void 0),N([_({type:Boolean,attribute:`no-highlight-selected`,reflect:!0})],Q.prototype,`noHighlightSelected`,void 0),N([_({type:String,reflect:!0})],Q.prototype,`size`,void 0),N([_({type:String,reflect:!0})],Q.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Q.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Q.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Q.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Q.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`z-index`})],Q.prototype,`zIndex`,void 0),N([v()],Q.prototype,`_optionsPlacement`,void 0),N([v()],Q.prototype,`_activeOption`,void 0),Q=N([a(`scb-select`)],Q),
|
|
18973
|
+
`}};N([_({type:String})],Q.prototype,`variant`,void 0),N([_({type:String})],Q.prototype,`value`,void 0),N([_({type:Array})],Q.prototype,`values`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`disabled`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`required`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`error`,void 0),N([_({type:Boolean,reflect:!0})],Q.prototype,`open`,void 0),N([_({type:String})],Q.prototype,`label`,void 0),N([_({type:String})],Q.prototype,`name`,void 0),N([_({type:String})],Q.prototype,`placeholder`,void 0),N([_({type:String,attribute:`supporting-text`})],Q.prototype,`supportingText`,void 0),N([_({type:String,attribute:`error-text`})],Q.prototype,`errorText`,void 0),N([_({type:String,attribute:`help-text`})],Q.prototype,`helpText`,void 0),N([_({type:String,attribute:`help-label`})],Q.prototype,`helpLabel`,void 0),N([_({type:Boolean,attribute:`with-radiobuttons`})],Q.prototype,`withRadiobuttons`,void 0),N([_({type:Boolean,attribute:`no-highlight-selected`,reflect:!0})],Q.prototype,`noHighlightSelected`,void 0),N([_({type:String,reflect:!0})],Q.prototype,`size`,void 0),N([_({type:String,reflect:!0})],Q.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Q.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Q.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Q.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Q.prototype,`spacingRight`,void 0),N([_({type:String,attribute:`z-index`})],Q.prototype,`zIndex`,void 0),N([v()],Q.prototype,`_optionsPlacement`,void 0),N([v()],Q.prototype,`_activeOption`,void 0),Q=N([a(`scb-select`)],Q),Sf(),w(),b(),pc(),P();var Zf=class extends C{static{this.formAssociated=!0}constructor(){super(),this._internals=null,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._hasCapturedInitialValues=!1,this._initialValue=20,this._initialValueStart=0,this._initialValueEnd=100,this._errorTextId=`scb-slider-error-${Math.random().toString(36).slice(2)}`,this.ticks=!1,this.step=5,this.value=20,this.range=!1,this.valueStart=0,this.valueEnd=100,this.min=0,this.max=100,this.labeled=!0,this.disabled=!1,this.name=``,this.ariaLabel=``,this.ariaLabelStart=``,this.ariaLabelEnd=``,this.error=!1,this.errorText=``,`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
|
|
18968
18974
|
:host {
|
|
18969
18975
|
display: block;
|
|
18970
18976
|
color: var(--md-sys-color-on-surface, var(--n-10));
|
|
@@ -19067,7 +19073,7 @@
|
|
|
19067
19073
|
></md-slider>
|
|
19068
19074
|
${e?x`<p id=${this._errorTextId} class="slider-error-text">${e}</p>`:S}
|
|
19069
19075
|
</div>
|
|
19070
|
-
`}};N([_({type:Boolean})],
|
|
19076
|
+
`}};N([_({type:Boolean})],Zf.prototype,`ticks`,void 0),N([_({type:Number})],Zf.prototype,`step`,void 0),N([_({type:Number,reflect:!0})],Zf.prototype,`value`,void 0),N([_({type:Boolean})],Zf.prototype,`range`,void 0),N([_({type:Number,attribute:`value-start`})],Zf.prototype,`valueStart`,void 0),N([_({type:Number,attribute:`value-end`})],Zf.prototype,`valueEnd`,void 0),N([_({type:Number,reflect:!0})],Zf.prototype,`min`,void 0),N([_({type:Number,reflect:!0})],Zf.prototype,`max`,void 0),N([_({type:Boolean})],Zf.prototype,`labeled`,void 0),N([_({type:String,attribute:`value-label`})],Zf.prototype,`valueLabel`,void 0),N([_({type:String,attribute:`value-label-start`})],Zf.prototype,`valueLabelStart`,void 0),N([_({type:String,attribute:`value-label-end`})],Zf.prototype,`valueLabelEnd`,void 0),N([_({type:Boolean,reflect:!0})],Zf.prototype,`disabled`,void 0),N([_({type:String,reflect:!0})],Zf.prototype,`name`,void 0),N([_({type:String,attribute:`name-start`,reflect:!0})],Zf.prototype,`nameStart`,void 0),N([_({type:String,attribute:`name-end`,reflect:!0})],Zf.prototype,`nameEnd`,void 0),N([_({type:String,attribute:`aria-label`})],Zf.prototype,`ariaLabel`,void 0),N([_({type:String,attribute:`aria-label-start`})],Zf.prototype,`ariaLabelStart`,void 0),N([_({type:String,attribute:`aria-label-end`})],Zf.prototype,`ariaLabelEnd`,void 0),N([_({type:Boolean,reflect:!0})],Zf.prototype,`error`,void 0),N([_({type:String,attribute:`error-text`})],Zf.prototype,`errorText`,void 0),Zf=N([a(`scb-slider`)],Zf),w(),b(),cc(),dl(),Mc(),Ol(),P();var Qf=class extends C{constructor(...e){super(...e),this.message=``,this.open=!1,this.actionText=``,this.showClose=!1,this.closeLabel=`Stäng meddelande`,this.fixed=!1,this.fadeout=!1,this.withLongerAction=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=p`
|
|
19071
19077
|
:host {
|
|
19072
19078
|
position: relative;
|
|
19073
19079
|
display: block;
|
|
@@ -19255,7 +19261,7 @@
|
|
|
19255
19261
|
`:``}
|
|
19256
19262
|
`}
|
|
19257
19263
|
</div>
|
|
19258
|
-
`}};N([_({type:String})]
|
|
19264
|
+
`}};N([_({type:String})],Qf.prototype,`message`,void 0),N([_({type:Boolean,reflect:!0})],Qf.prototype,`open`,void 0),N([_({type:String,attribute:`action-text`})],Qf.prototype,`actionText`,void 0),N([_({type:Boolean,attribute:`show-close`})],Qf.prototype,`showClose`,void 0),N([_({type:String,attribute:`close-label`})],Qf.prototype,`closeLabel`,void 0),N([_({type:Boolean,reflect:!0})],Qf.prototype,`fixed`,void 0),N([_({type:Boolean})],Qf.prototype,`fadeout`,void 0),N([_({type:Boolean,attribute:`with-longer-action`})],Qf.prototype,`withLongerAction`,void 0),N([_({type:String,reflect:!0})],Qf.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],Qf.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],Qf.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],Qf.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],Qf.prototype,`spacingRight`,void 0),Qf=N([a(`scb-snackbar`)],Qf),w(),b(),D(),P();var $f=class extends C{constructor(...e){super(...e),this.status=``,this.label=``,this.showIcon=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=p`
|
|
19259
19265
|
:host {
|
|
19260
19266
|
display: inline-block;
|
|
19261
19267
|
border-radius: var(--scb-status-pill-design-surface-radius-medium);
|
|
@@ -19324,7 +19330,7 @@
|
|
|
19324
19330
|
`}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-status-pill-spacing-block-start`,t):this.style.removeProperty(`--scb-status-pill-spacing-block-start`),n?this.style.setProperty(`--scb-status-pill-spacing-block-end`,n):this.style.removeProperty(`--scb-status-pill-spacing-block-end`),r?this.style.setProperty(`--scb-status-pill-spacing-inline-start`,r):this.style.removeProperty(`--scb-status-pill-spacing-inline-start`),i?this.style.setProperty(`--scb-status-pill-spacing-inline-end`,i):this.style.removeProperty(`--scb-status-pill-spacing-inline-end`)}connectedCallback(){super.connectedCallback(),this.applySpacing()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.applySpacing()}render(){return x`
|
|
19325
19331
|
${this.showIcon?this.status===`success`?x`<md-icon>check_circle</md-icon>`:this.status===`warning`?x`<md-icon>warning</md-icon>`:this.status===`error`?x`<md-icon>error</md-icon>`:``:``}
|
|
19326
19332
|
<span class="label">${this.label}</span>
|
|
19327
|
-
`}};N([_({type:String,reflect:!0})]
|
|
19333
|
+
`}};N([_({type:String,reflect:!0})],$f.prototype,`status`,void 0),N([_({type:String,reflect:!0})],$f.prototype,`label`,void 0),N([_({type:Boolean,attribute:`show-icon`,reflect:!0})],$f.prototype,`showIcon`,void 0),N([_({type:String,reflect:!0})],$f.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],$f.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],$f.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],$f.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],$f.prototype,`spacingRight`,void 0),$f=N([a(`scb-status-pill`)],$f),w(),b(),D(),E(),j(),P();var ep=class extends C{constructor(...e){super(...e),this.label=``,this.subLabel=``,this.symbolVariant=`number`,this.number=0,this.active=!1,this.completed=!1,this.changeOnCompleted=!1,this.islast=!1,this.variant=`horizontal`,this.widthWeight=1,this.icon=``,this.__nativeFocusRingReady=!1,this.__nativeFocusRingPending=!1,this.__onFocusIn=e=>{let t=e.composedPath()[0];t instanceof HTMLElement&&t.matches(`:focus-visible`)&&this.__ensureNativeFocusRing()},this.__onFocusOut=()=>{this.__syncInteractiveParts()}}static{this.styles=p`
|
|
19328
19334
|
:host {
|
|
19329
19335
|
font-family: var(--brand-font);
|
|
19330
19336
|
--scb-step-slide-from-x: 0px;
|
|
@@ -19756,7 +19762,7 @@
|
|
|
19756
19762
|
<div class="sub-label" data-label="${this.subLabel}"><span class="sub-label-text">${this.subLabel}</span></div>
|
|
19757
19763
|
</div>
|
|
19758
19764
|
</div>
|
|
19759
|
-
`}}};N([_({type:String,reflect:!0})],
|
|
19765
|
+
`}}};N([_({type:String,reflect:!0})],ep.prototype,`label`,void 0),N([_({type:String,reflect:!0,attribute:`sub-label`})],ep.prototype,`subLabel`,void 0),N([_({type:String,reflect:!0,attribute:`symbol-variant`})],ep.prototype,`symbolVariant`,void 0),N([_({type:Number,reflect:!0})],ep.prototype,`number`,void 0),N([_({type:Boolean,reflect:!0})],ep.prototype,`active`,void 0),N([_({type:Boolean,reflect:!0})],ep.prototype,`completed`,void 0),N([_({type:Boolean,reflect:!0,attribute:`change-on-completed`})],ep.prototype,`changeOnCompleted`,void 0),N([_({type:Boolean,reflect:!0})],ep.prototype,`islast`,void 0),N([_({type:String,reflect:!0})],ep.prototype,`variant`,void 0),N([_({type:Number,reflect:!0,attribute:`width-weight`})],ep.prototype,`widthWeight`,void 0),N([_({type:String})],ep.prototype,`icon`,void 0),ep=N([a(`scb-step`)],ep),w(),b(),uc(),P();var tp=class extends C{constructor(...e){super(...e),this.type=``,this.label=``,this.changeOnCompleted=!1,this.variant=`horizontal`,this.symbolVariant=`number`,this.size=lc[`scb-stepper`].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.activeIndex=0,this.#t=0,this._onKeyNav=e=>{let t=this._getSteps(),n=this.activeIndex,r=n;e.detail.key===`ArrowRight`||e.detail.key===`ArrowDown`?r=n<t.length-1?n+1:0:e.detail.key===`ArrowLeft`||e.detail.key===`ArrowUp`?r=n>0?n-1:t.length-1:e.detail.key===`Home`?r=0:e.detail.key===`End`&&(r=t.length-1),r!==n&&(this._onStepClick(r),setTimeout(()=>{let e=t[r].shadowRoot?.querySelector(`.scb-step-content`);e&&`focus`in e&&typeof e.focus==`function`&&e.focus()},0))},this._onStepContainerClick=e=>{let t=this._getSteps(),n=e.composedPath(),r=t.findIndex(e=>n.includes(e));r!==-1&&this._onStepClick(r)},this._onSlotChange=()=>{let e=this._getSteps();if(e.length===0){this.activeIndex=0;return}this.activeIndex>e.length-1?this.activeIndex=e.length-1:this.activeIndex<0&&(this.activeIndex=0),this._updateSteps(),this.#i()}}#e;#t;static{this.styles=p`
|
|
19760
19766
|
:host {
|
|
19761
19767
|
--scb-stepper-width: 100%;
|
|
19762
19768
|
--scb-stepper-height: 100%;
|
|
@@ -20120,7 +20126,7 @@
|
|
|
20120
20126
|
>
|
|
20121
20127
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
20122
20128
|
</div>
|
|
20123
|
-
`}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.#e=new ResizeObserver(()=>{this.#i()}),this.#e.observe(this))}disconnectedCallback(){this.#e&&=(this.#e.disconnect(),void 0),this.#t&&=(cancelAnimationFrame(this.#t),0),super.disconnectedCallback()}#n(){let e=this.#r(this.spacing),t=this.#r(this.spacingTop)??e,n=this.#r(this.spacingBottom)??e,r=this.#r(this.spacingLeft),i=this.#r(this.spacingRight);t?this.style.setProperty(`--scb-stepper-spacing-block-start`,t):this.style.removeProperty(`--scb-stepper-spacing-block-start`),n?this.style.setProperty(`--scb-stepper-spacing-block-end`,n):this.style.removeProperty(`--scb-stepper-spacing-block-end`),r?this.style.setProperty(`--scb-stepper-spacing-inline-start`,r):this.style.removeProperty(`--scb-stepper-spacing-inline-start`),i?this.style.setProperty(`--scb-stepper-spacing-inline-end`,i):this.style.removeProperty(`--scb-stepper-spacing-inline-end`)}#r(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#i(){this.#t||=requestAnimationFrame(()=>{this.#t=0,this.#a()})}#a(){let e=this._getSteps();e.length!==0&&e.forEach(e=>{let t=e.shadowRoot;if(!t)return;let n=t.querySelector(`.label`),r=t.querySelector(`.scb-step-content`);if(!n)return;if(this.variant!==`horizontal`){n.style.removeProperty(`max-width`),n.style.removeProperty(`white-space`),n.style.removeProperty(`word-break`),n.style.removeProperty(`overflow-wrap`);return}n.style.maxWidth=`none`,n.style.whiteSpace=`nowrap`,n.style.wordBreak=`normal`,n.style.overflowWrap=`normal`;let i=r?.clientWidth??e.clientWidth;i>0&&n.scrollWidth>i&&(n.style.maxWidth=`100%`,n.style.whiteSpace=`normal`,n.style.wordBreak=`break-word`,n.style.overflowWrap=`anywhere`)})}};N([_({type:String,reflect:!0})],
|
|
20129
|
+
`}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<`u`&&(this.#e=new ResizeObserver(()=>{this.#i()}),this.#e.observe(this))}disconnectedCallback(){this.#e&&=(this.#e.disconnect(),void 0),this.#t&&=(cancelAnimationFrame(this.#t),0),super.disconnectedCallback()}#n(){let e=this.#r(this.spacing),t=this.#r(this.spacingTop)??e,n=this.#r(this.spacingBottom)??e,r=this.#r(this.spacingLeft),i=this.#r(this.spacingRight);t?this.style.setProperty(`--scb-stepper-spacing-block-start`,t):this.style.removeProperty(`--scb-stepper-spacing-block-start`),n?this.style.setProperty(`--scb-stepper-spacing-block-end`,n):this.style.removeProperty(`--scb-stepper-spacing-block-end`),r?this.style.setProperty(`--scb-stepper-spacing-inline-start`,r):this.style.removeProperty(`--scb-stepper-spacing-inline-start`),i?this.style.setProperty(`--scb-stepper-spacing-inline-end`,i):this.style.removeProperty(`--scb-stepper-spacing-inline-end`)}#r(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#i(){this.#t||=requestAnimationFrame(()=>{this.#t=0,this.#a()})}#a(){let e=this._getSteps();e.length!==0&&e.forEach(e=>{let t=e.shadowRoot;if(!t)return;let n=t.querySelector(`.label`),r=t.querySelector(`.scb-step-content`);if(!n)return;if(this.variant!==`horizontal`){n.style.removeProperty(`max-width`),n.style.removeProperty(`white-space`),n.style.removeProperty(`word-break`),n.style.removeProperty(`overflow-wrap`);return}n.style.maxWidth=`none`,n.style.whiteSpace=`nowrap`,n.style.wordBreak=`normal`,n.style.overflowWrap=`normal`;let i=r?.clientWidth??e.clientWidth;i>0&&n.scrollWidth>i&&(n.style.maxWidth=`100%`,n.style.whiteSpace=`normal`,n.style.wordBreak=`break-word`,n.style.overflowWrap=`anywhere`)})}};N([_({type:String,reflect:!0})],tp.prototype,`type`,void 0),N([_({type:String,reflect:!0})],tp.prototype,`label`,void 0),N([_({type:Boolean,reflect:!0,attribute:`change-on-completed`})],tp.prototype,`changeOnCompleted`,void 0),N([_({type:String,reflect:!0})],tp.prototype,`variant`,void 0),N([_({type:String,reflect:!0,attribute:`symbol-variant`})],tp.prototype,`symbolVariant`,void 0),N([_({type:String,reflect:!0})],tp.prototype,`size`,void 0),N([_({type:String,reflect:!0})],tp.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],tp.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],tp.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],tp.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],tp.prototype,`spacingRight`,void 0),N([_({type:Number,reflect:!0,attribute:`active-index`})],tp.prototype,`activeIndex`,void 0),tp=N([a(`scb-stepper`)],tp),w(),b(),dl(),cc(),P();var np=96,rp=32,ip=class extends C{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode=`auto`,this._sortedColumn=null,this._sortDirection=`asc`,this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}static{this.styles=p`
|
|
20124
20130
|
:host {
|
|
20125
20131
|
display: block;
|
|
20126
20132
|
color: var(--scb-tables-content-color, var(--md-sys-color-on-surface));
|
|
@@ -20207,7 +20213,7 @@
|
|
|
20207
20213
|
<div class="scb-table-scroll-wrapper">
|
|
20208
20214
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
20209
20215
|
</div>
|
|
20210
|
-
`}firstUpdated(){let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has(`dataSorting`)&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection=`asc`),this._attachThListeners()),e.has(`columnWidthMode`)&&this._queueColumnWidthUpdate(),this.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>{e.setAttribute(`size`,M(this,`--scb-table-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`))})}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e,n=t.tagName.toLowerCase()===`tbody`?t:t.querySelector(`tbody`);if(n)return n}return null}_getTables(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return[];let t=e.assignedNodes({flatten:!0}),n=[];return t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e;t.tagName.toLowerCase()===`table`&&n.push(t),n.push(...Array.from(t.querySelectorAll(`table`)))}}),n}_attachThListeners(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[],o=[];t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=Array.from(e.querySelectorAll(`thead`));n.push(...t),t.forEach(e=>{r.push(...Array.from(e.querySelectorAll(`th`)))}),i.push(...e.querySelectorAll(`th`)),a.push(...e.querySelectorAll(`td`)),o.push(...e.querySelectorAll(`tr`))}}),n.forEach(e=>{e.style.borderTop=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`}),i.forEach(e=>{let t=r.indexOf(e),n=t!==-1;e.style.textAlign=`left`,e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.position=`relative`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-header-font)`,e.style.fontSize=`var(--scb-table-header-font-size)`,e.style.lineHeight=`var(--scb-table-header-line-height)`,e.style.fontWeight=`var(--scb-table-header-font-weight)`,e.style.letterSpacing=`var(--scb-table-header-letter-spacing)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.borderBottom=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`,this._removeGeneratedSortMarkup(e),e.hasAttribute(`scope`)||(n?e.setAttribute(`scope`,`col`):e.closest(`tbody`)&&e.setAttribute(`scope`,`row`));let i=this._getOrCreateHeaderLabel(e,t),a=this._getHeaderLabelText(e,i,t);if((i instanceof HTMLParagraphElement||i.getAttribute(`data-scb-generated-label`)===`true`)&&this._applyGeneratedCellTextReset(i),this.dataSorting&&n){e.setAttribute(`aria-sort`,this._getHeaderAriaSort(t));let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,M(this,`--scb-table-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`)),n.setAttribute(`aria-label`,this._getSortButtonLabel(a,t)),n.style.alignSelf=`end`,this._sortedColumn===t?(n.setAttribute(`variant`,`filled-tonal`),n.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(n.setAttribute(`icon`,`swap_horiz`),n.style.transform+=` rotate(90deg)`),this._wrapHeaderWithSortControl(e,i,n)}else e.removeAttribute(`aria-sort`)}),a.forEach(e=>{e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--scb-tables-outline-color, var(--md-sys-color-outline-variant))`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-cell-font)`,e.style.fontSize=`var(--scb-table-cell-font-size)`,e.style.lineHeight=`var(--scb-table-cell-line-height)`,e.style.fontWeight=`var(--scb-table-cell-font-weight)`,e.style.letterSpacing=`var(--scb-table-cell-letter-spacing)`,e.style.borderRight=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.borderBottom=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),o.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`})});let s=this._getTbody();s&&Array.from(s.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--scb-tables-alternate-surface-color, var(--md-sys-color-surface-container))`:`var(--scb-tables-surface-color, var(--md-sys-color-surface))`;Array.from(e.cells).forEach(e=>{e.style.backgroundColor=n})}),this._queueColumnWidthUpdate()}_applyGeneratedCellTextReset(e){e.style.margin=`0`,e.style.color=`inherit`,e.style.fontFamily=`inherit`,e.style.fontSize=`inherit`,e.style.lineHeight=`inherit`,e.style.fontWeight=`inherit`,e.style.letterSpacing=`inherit`}_removeGeneratedSortMarkup(e){e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let t=e.querySelector(`:scope > [data-scb-sort-header="true"]`);if(!(t instanceof HTMLElement))return;let n=t.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement){t.replaceWith(n);return}t.remove()}_getOrCreateHeaderLabel(e,t){let n=e.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement)return n;let r=e.querySelector(`:scope > p`);if(r instanceof HTMLParagraphElement)return r.setAttribute(`data-scb-sort-label`,`true`),r;let i=Array.from(e.children).find(e=>e instanceof HTMLElement&&!e.matches(`scb-icon-button.scb-sort-icon`));if(i)return i.setAttribute(`data-scb-sort-label`,`true`),i;let a=this._getNormalizedText(e.textContent),o=a||this._getNormalizedText(e.getAttribute(`aria-label`))||this._getFallbackColumnLabel(t),s=document.createElement(`p`);return s.setAttribute(`data-scb-sort-label`,`true`),s.setAttribute(`data-scb-generated-label`,`true`),s.textContent=o,a||(s.setAttribute(`data-scb-visually-hidden-label`,`true`),this._applyVisuallyHiddenStyles(s)),e.textContent=``,e.appendChild(s),s}_getHeaderLabelText(e,t,n){return this._getNormalizedText(t.textContent)||this._getNormalizedText(e.getAttribute(`aria-label`))||this._getFallbackColumnLabel(n)}_getFallbackColumnLabel(e){return`kolumn ${Math.max(e,0)+1}`}_applyVisuallyHiddenStyles(e){e.style.position=`absolute`,e.style.width=`1px`,e.style.height=`1px`,e.style.padding=`0`,e.style.margin=`-1px`,e.style.overflow=`hidden`,e.style.whiteSpace=`nowrap`,e.style.clip=`rect(0, 0, 0, 0)`,e.style.clipPath=`inset(50%)`,e.style.border=`0`}_wrapHeaderWithSortControl(e,t,n){let r=document.createElement(`div`);r.setAttribute(`data-scb-sort-header`,`true`),r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(t),r.appendChild(n),e.appendChild(r)}_getNormalizedText(e){return(e??``).replace(/\s+/g,` `).trim()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout=``,e.style.width=``,e.style.minWidth=``,e.style.maxWidth=``,this.columnWidthMode!==`header`)return;let t=Array.from(e.querySelectorAll(`thead tr`)),n=t[t.length-1];if(!n)return;let r=Array.from(n.cells).map((t,n)=>{let r=this._measureCellContentWidth(t),i=this._measureColumnReadableBodyWidth(e,n),a=Math.max(r,i);return`${Math.ceil(a>0?Math.max(a,rp):0)}px`}),i=r.reduce((e,t)=>e+parseFloat(t),0);this._applyGeneratedColGroup(e,r),e.style.tableLayout=`fixed`,e.style.width=`${Math.ceil(i)}px`,e.style.minWidth=`${Math.ceil(i)}px`,e.style.maxWidth=`none`})}_applyGeneratedColGroup(e,t){let n=document.createElement(`colgroup`);n.setAttribute(`data-scb-generated-column-widths`,`true`),t.forEach(e=>{let t=document.createElement(`col`);t.style.width=e,t.style.minWidth=e,n.appendChild(t)}),e.insertBefore(n,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector(`colgroup[data-scb-generated-column-widths="true"]`)?.remove()}_measureCellContentWidth(e){let t=e.firstElementChild?.cloneNode(!0)??document.createElement(`span`);e.firstElementChild||(t.textContent=e.textContent??``);let n=window.getComputedStyle(e),r=document.createElement(`div`);r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.width=`max-content`,r.style.maxWidth=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,t instanceof HTMLElement&&(t.style.width=`max-content`,t.style.maxWidth=`none`,t.style.whiteSpace=`nowrap`),r.appendChild(t),document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=parseFloat(n.borderLeftWidth||`0`),s=parseFloat(n.borderRightWidth||`0`),c=r.getBoundingClientRect().width+i+a+o+s;return document.body.removeChild(r),c}_measureColumnReadableBodyWidth(e,t){return Array.from(e.querySelectorAll(`tbody tr`)).reduce((e,n)=>{let r=n.cells[t];if(!r)return e;let i=(r.textContent??``).replace(/\s+/g,` `).trim().split(` `).filter(Boolean).reduce((e,t)=>Math.max(e,this._measureCellTextWidth(r,t)),0),a=i>0?i+ip:0;return Math.max(e,a)},0)}_measureCellTextWidth(e,t){let n=window.getComputedStyle(e),r=document.createElement(`span`);r.textContent=t,r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=parseFloat(n.borderLeftWidth||`0`),s=parseFloat(n.borderRightWidth||`0`),c=r.getBoundingClientRect().width+i+a+o+s;return document.body.removeChild(r),c}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent(`tablesortchange`,{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_getHeaderAriaSort(e){return this._sortedColumn===e?this._sortDirection===`asc`?`ascending`:`descending`:`none`}_getSortButtonLabel(e,t){return`Sortera ${e||`kolumn ${t+1}`} ${this._sortedColumn===t&&this._sortDirection===`asc`?`fallande`:`stigande`}`}_sortTable(e,t){let n=this._getTbody();if(!n)return;let r=Array.from(n.querySelectorAll(`tr`));r.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)}),r.forEach(e=>n.appendChild(e))}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}};N([_({type:Boolean,attribute:`data-sorting`})],ap.prototype,`dataSorting`,void 0),N([_({type:String,attribute:`column-width-mode`})],ap.prototype,`columnWidthMode`,void 0),ap=N([a(`scb-table`)],ap),w(),b(),dl(),Tu(),cc(),P();var op=class extends C{constructor(...e){super(...e),this.searchTerm=``,this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.disableSorting=[],this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection=`asc`,this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._initialTableRefreshFrame=0,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=e=>{let t=e.detail;t&&typeof t.page==`number`&&this._changePage(t.page)}}static{this.styles=p`
|
|
20216
|
+
`}firstUpdated(){let e=this.shadowRoot?.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners())}updated(e){e.has(`dataSorting`)&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection=`asc`),this._attachThListeners()),e.has(`columnWidthMode`)&&this._queueColumnWidthUpdate(),this.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>{e.setAttribute(`size`,M(this,`--scb-table-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`))})}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e,n=t.tagName.toLowerCase()===`tbody`?t:t.querySelector(`tbody`);if(n)return n}return null}_getTables(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return[];let t=e.assignedNodes({flatten:!0}),n=[];return t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e;t.tagName.toLowerCase()===`table`&&n.push(t),n.push(...Array.from(t.querySelectorAll(`table`)))}}),n}_attachThListeners(){let e=this.shadowRoot?.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[],o=[];t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=Array.from(e.querySelectorAll(`thead`));n.push(...t),t.forEach(e=>{r.push(...Array.from(e.querySelectorAll(`th`)))}),i.push(...e.querySelectorAll(`th`)),a.push(...e.querySelectorAll(`td`)),o.push(...e.querySelectorAll(`tr`))}}),n.forEach(e=>{e.style.borderTop=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`}),i.forEach(e=>{let t=r.indexOf(e),n=t!==-1;e.style.textAlign=`left`,e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.position=`relative`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-header-font)`,e.style.fontSize=`var(--scb-table-header-font-size)`,e.style.lineHeight=`var(--scb-table-header-line-height)`,e.style.fontWeight=`var(--scb-table-header-font-weight)`,e.style.letterSpacing=`var(--scb-table-header-letter-spacing)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.borderBottom=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`,this._removeGeneratedSortMarkup(e),e.hasAttribute(`scope`)||(n?e.setAttribute(`scope`,`col`):e.closest(`tbody`)&&e.setAttribute(`scope`,`row`));let i=this._getOrCreateHeaderLabel(e,t),a=this._getHeaderLabelText(e,i,t);if((i instanceof HTMLParagraphElement||i.getAttribute(`data-scb-generated-label`)===`true`)&&this._applyGeneratedCellTextReset(i),this.dataSorting&&n){e.setAttribute(`aria-sort`,this._getHeaderAriaSort(t));let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,M(this,`--scb-table-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`)),n.setAttribute(`aria-label`,this._getSortButtonLabel(a,t)),n.style.alignSelf=`end`,this._sortedColumn===t?(n.setAttribute(`variant`,`filled-tonal`),n.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(n.setAttribute(`icon`,`swap_horiz`),n.style.transform+=` rotate(90deg)`),this._wrapHeaderWithSortControl(e,i,n)}else e.removeAttribute(`aria-sort`)}),a.forEach(e=>{e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--scb-tables-outline-color, var(--md-sys-color-outline-variant))`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-cell-font)`,e.style.fontSize=`var(--scb-table-cell-font-size)`,e.style.lineHeight=`var(--scb-table-cell-line-height)`,e.style.fontWeight=`var(--scb-table-cell-font-weight)`,e.style.letterSpacing=`var(--scb-table-cell-letter-spacing)`,e.style.borderRight=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.borderBottom=`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),o.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--scb-tables-strong-outline-color, var(--md-sys-color-on-surface))`})});let s=this._getTbody();s&&Array.from(s.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--scb-tables-alternate-surface-color, var(--md-sys-color-surface-container))`:`var(--scb-tables-surface-color, var(--md-sys-color-surface))`;Array.from(e.cells).forEach(e=>{e.style.backgroundColor=n})}),this._queueColumnWidthUpdate()}_applyGeneratedCellTextReset(e){e.style.margin=`0`,e.style.color=`inherit`,e.style.fontFamily=`inherit`,e.style.fontSize=`inherit`,e.style.lineHeight=`inherit`,e.style.fontWeight=`inherit`,e.style.letterSpacing=`inherit`}_removeGeneratedSortMarkup(e){e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let t=e.querySelector(`:scope > [data-scb-sort-header="true"]`);if(!(t instanceof HTMLElement))return;let n=t.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement){t.replaceWith(n);return}t.remove()}_getOrCreateHeaderLabel(e,t){let n=e.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement)return n;let r=e.querySelector(`:scope > p`);if(r instanceof HTMLParagraphElement)return r.setAttribute(`data-scb-sort-label`,`true`),r;let i=Array.from(e.children).find(e=>e instanceof HTMLElement&&!e.matches(`scb-icon-button.scb-sort-icon`));if(i)return i.setAttribute(`data-scb-sort-label`,`true`),i;let a=this._getNormalizedText(e.textContent),o=a||this._getNormalizedText(e.getAttribute(`aria-label`))||this._getFallbackColumnLabel(t),s=document.createElement(`p`);return s.setAttribute(`data-scb-sort-label`,`true`),s.setAttribute(`data-scb-generated-label`,`true`),s.textContent=o,a||(s.setAttribute(`data-scb-visually-hidden-label`,`true`),this._applyVisuallyHiddenStyles(s)),e.textContent=``,e.appendChild(s),s}_getHeaderLabelText(e,t,n){return this._getNormalizedText(t.textContent)||this._getNormalizedText(e.getAttribute(`aria-label`))||this._getFallbackColumnLabel(n)}_getFallbackColumnLabel(e){return`kolumn ${Math.max(e,0)+1}`}_applyVisuallyHiddenStyles(e){e.style.position=`absolute`,e.style.width=`1px`,e.style.height=`1px`,e.style.padding=`0`,e.style.margin=`-1px`,e.style.overflow=`hidden`,e.style.whiteSpace=`nowrap`,e.style.clip=`rect(0, 0, 0, 0)`,e.style.clipPath=`inset(50%)`,e.style.border=`0`}_wrapHeaderWithSortControl(e,t,n){let r=document.createElement(`div`);r.setAttribute(`data-scb-sort-header`,`true`),r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(t),r.appendChild(n),e.appendChild(r)}_getNormalizedText(e){return(e??``).replace(/\s+/g,` `).trim()}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(e=>{if(this._removeGeneratedColGroup(e),e.style.tableLayout=``,e.style.width=``,e.style.minWidth=``,e.style.maxWidth=``,this.columnWidthMode!==`header`)return;let t=Array.from(e.querySelectorAll(`thead tr`)),n=t[t.length-1];if(!n)return;let r=Array.from(n.cells).map((t,n)=>{let r=this._measureCellContentWidth(t),i=this._measureColumnReadableBodyWidth(e,n),a=Math.max(r,i);return`${Math.ceil(a>0?Math.max(a,np):0)}px`}),i=r.reduce((e,t)=>e+parseFloat(t),0);this._applyGeneratedColGroup(e,r),e.style.tableLayout=`fixed`,e.style.width=`${Math.ceil(i)}px`,e.style.minWidth=`${Math.ceil(i)}px`,e.style.maxWidth=`none`})}_applyGeneratedColGroup(e,t){let n=document.createElement(`colgroup`);n.setAttribute(`data-scb-generated-column-widths`,`true`),t.forEach(e=>{let t=document.createElement(`col`);t.style.width=e,t.style.minWidth=e,n.appendChild(t)}),e.insertBefore(n,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector(`colgroup[data-scb-generated-column-widths="true"]`)?.remove()}_measureCellContentWidth(e){let t=e.firstElementChild?.cloneNode(!0)??document.createElement(`span`);e.firstElementChild||(t.textContent=e.textContent??``);let n=window.getComputedStyle(e),r=document.createElement(`div`);r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.width=`max-content`,r.style.maxWidth=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,t instanceof HTMLElement&&(t.style.width=`max-content`,t.style.maxWidth=`none`,t.style.whiteSpace=`nowrap`),r.appendChild(t),document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=parseFloat(n.borderLeftWidth||`0`),s=parseFloat(n.borderRightWidth||`0`),c=r.getBoundingClientRect().width+i+a+o+s;return document.body.removeChild(r),c}_measureColumnReadableBodyWidth(e,t){return Array.from(e.querySelectorAll(`tbody tr`)).reduce((e,n)=>{let r=n.cells[t];if(!r)return e;let i=(r.textContent??``).replace(/\s+/g,` `).trim().split(` `).filter(Boolean).reduce((e,t)=>Math.max(e,this._measureCellTextWidth(r,t)),0),a=i>0?i+rp:0;return Math.max(e,a)},0)}_measureCellTextWidth(e,t){let n=window.getComputedStyle(e),r=document.createElement(`span`);r.textContent=t,r.style.position=`absolute`,r.style.left=`-99999px`,r.style.top=`0`,r.style.visibility=`hidden`,r.style.pointerEvents=`none`,r.style.whiteSpace=`nowrap`,r.style.fontFamily=n.fontFamily,r.style.fontSize=n.fontSize,r.style.fontWeight=n.fontWeight,r.style.lineHeight=n.lineHeight,r.style.letterSpacing=n.letterSpacing,document.body.appendChild(r);let i=parseFloat(n.paddingLeft||`0`),a=parseFloat(n.paddingRight||`0`),o=parseFloat(n.borderLeftWidth||`0`),s=parseFloat(n.borderRightWidth||`0`),c=r.getBoundingClientRect().width+i+a+o+s;return document.body.removeChild(r),c}_onThClick(e){this.dataSorting&&(this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent(`tablesortchange`,{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_getHeaderAriaSort(e){return this._sortedColumn===e?this._sortDirection===`asc`?`ascending`:`descending`:`none`}_getSortButtonLabel(e,t){return`Sortera ${e||`kolumn ${t+1}`} ${this._sortedColumn===t&&this._sortDirection===`asc`?`fallande`:`stigande`}`}_sortTable(e,t){let n=this._getTbody();if(!n)return;let r=Array.from(n.querySelectorAll(`tr`));r.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)}),r.forEach(e=>n.appendChild(e))}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}};N([_({type:Boolean,attribute:`data-sorting`})],ip.prototype,`dataSorting`,void 0),N([_({type:String,attribute:`column-width-mode`})],ip.prototype,`columnWidthMode`,void 0),ip=N([a(`scb-table`)],ip),w(),b(),dl(),wu(),cc(),P();var ap=class extends C{constructor(...e){super(...e),this.searchTerm=``,this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.disableSorting=[],this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection=`asc`,this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._initialTableRefreshFrame=0,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=e=>{let t=e.detail;t&&typeof t.page==`number`&&this._changePage(t.page)}}static{this.styles=p`
|
|
20211
20217
|
:host {
|
|
20212
20218
|
display: block;
|
|
20213
20219
|
color: var(--scb-tables-content-color, var(--md-sys-color-on-surface));
|
|
@@ -20332,7 +20338,7 @@
|
|
|
20332
20338
|
></scb-pagination>
|
|
20333
20339
|
`:``}
|
|
20334
20340
|
</div>
|
|
20335
|
-
`}_onSearchInput(e){let t=e.target.value;this.searchTerm=t,this._filterTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r=n,i=this._getTopLevelRows(r),a=this.searchTerm.trim().toLowerCase();if(!a)this._filteredRows=null,i.forEach(e=>e.style.display=``),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=i.filter(e=>this._getRowSearchText(e).toLowerCase().includes(a)),i.forEach(e=>e.style.display=`none`);let e=this._filteredRows;this._sortedColumn!==null&&(e=[...e],e.sort((e,t)=>{let n=this._getCellSortableValue(e.children[this._sortedColumn]),r=this._getCellSortableValue(t.children[this._sortedColumn]);return this._compareCellValues(n,r,this._sortDirection)}),this._filteredRows=e),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(e=>e.style.display=``)}}firstUpdated(){let e=this.shadowRoot.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._initialTableRefreshFrame=requestAnimationFrame(()=>{this._initialTableRefreshFrame=0,this.isConnected&&this._refreshFromTableContent()}))}updated(e){super.updated(e),e.has(`disableSorting`)&&this._sortedColumn!==null&&!this._isColumnSortable(this._sortedColumn)&&(this._sortedColumn=null,this._sortDirection=`asc`),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`)||e.has(`disableSorting`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()}),this.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>{e.setAttribute(`size`,M(this,`--scb-table-advanced-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`))})}_disconnectTbodyObserver(){this._tbodyObserver&&=(this._tbodyObserver.disconnect(),null),this._observedTbody=null}_attachTbodyObserver(){let e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){let e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),t=Math.min(Math.max(1,this.currentPage),e);t!==this.currentPage&&(this.currentPage=t)}_getTbody(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);if(t)return t}return null}_getTopLevelRows(e){return Array.from(e.children).filter(e=>e instanceof HTMLTableRowElement)}_attachThListeners(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(Array.from(e.querySelectorAll(`thead`)).forEach(e=>{n.push(...Array.from(e.querySelectorAll(`th`)))}),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),r.forEach(e=>{let t=n.indexOf(e),r=t!==-1;e.style.textAlign=`left`,e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline-end) var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.position=`relative`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-header-font)`,e.style.fontSize=`var(--scb-table-header-font-size)`,e.style.lineHeight=`var(--scb-table-header-line-height)`,e.style.fontWeight=`var(--scb-table-header-font-weight)`,e.style.letterSpacing=`var(--scb-table-header-letter-spacing)`,e.style.verticalAlign=`middle`,this._removeGeneratedSortMarkup(e),e.hasAttribute(`scope`)||(r?e.setAttribute(`scope`,`col`):e.closest(`tbody`)&&e.setAttribute(`scope`,`row`));let i=this._getOrCreateHeaderLabel(e,t);if((i instanceof HTMLParagraphElement||i.getAttribute(`data-scb-generated-label`)===`true`)&&this._applyGeneratedCellTextReset(i),!r){e.removeAttribute(`aria-sort`);return}if(!this._isColumnSortable(t)){e.removeAttribute(`aria-sort`);return}e.setAttribute(`aria-sort`,this._getHeaderAriaSort(t));let a=this._getNormalizedText(i.textContent)||`kolumn ${Math.max(t,0)+1}`,o=document.createElement(`scb-icon-button`);o.className=`scb-sort-icon`,o.onclick=()=>this._onThClick(t),o.setAttribute(`variant`,`standard`),o.setAttribute(`size`,M(this,`--scb-table-advanced-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`)),o.setAttribute(`aria-label`,this._getSortButtonLabel(a,t)),o.style.alignSelf=`center`,this._sortedColumn===t?(o.setAttribute(`variant`,`filled-tonal`),o.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(o.setAttribute(`icon`,`swap_horiz`),o.style.transform+=` rotate(90deg)`),this._wrapHeaderWithSortControl(e,i,o)}),i.forEach(e=>{e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline-end) var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--scb-tables-outline-color, var(--md-sys-color-outline-variant))`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-cell-font)`,e.style.fontSize=`var(--scb-table-cell-font-size)`,e.style.lineHeight=`var(--scb-table-cell-line-height)`,e.style.fontWeight=`var(--scb-table-cell-font-weight)`,e.style.letterSpacing=`var(--scb-table-cell-letter-spacing)`}),a.forEach((e,t)=>{t%2==1&&e.querySelectorAll(`td`).forEach(e=>{e.style.backgroundColor=`var(--scb-background-row)`});let n=e.querySelectorAll(`th`);n.length>0&&n.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`var(--scb-table-cell-edge-padding-inline)`),t===n.length-1?e.style.paddingRight=`var(--scb-table-cell-edge-padding-inline)`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`var(--scb-table-cell-edge-padding-inline)`),t===r.length-1?e.style.paddingRight=`var(--scb-table-cell-edge-padding-inline)`:e.style.paddingRight=``})}),this.pagination&&this._paginateTable()}_applyGeneratedCellTextReset(e){e.style.margin=`0`,e.style.color=`inherit`,e.style.fontFamily=`inherit`,e.style.fontSize=`inherit`,e.style.lineHeight=`inherit`,e.style.fontWeight=`inherit`,e.style.letterSpacing=`inherit`}_removeGeneratedSortMarkup(e){e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let t=e.querySelector(`:scope > [data-scb-sort-header="true"]`);if(!(t instanceof HTMLElement))return;let n=t.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement){t.replaceWith(n);return}t.remove()}_getOrCreateHeaderLabel(e,t){let n=e.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement)return n;let r=e.querySelector(`:scope > p`);if(r instanceof HTMLParagraphElement)return r.setAttribute(`data-scb-sort-label`,`true`),r;let i=Array.from(e.children).find(e=>e instanceof HTMLElement&&!e.matches(`scb-icon-button.scb-sort-icon`));if(i)return i.setAttribute(`data-scb-sort-label`,`true`),i;let a=document.createElement(`p`);return a.setAttribute(`data-scb-sort-label`,`true`),a.setAttribute(`data-scb-generated-label`,`true`),a.textContent=this._getNormalizedText(e.textContent)||`kolumn ${Math.max(t,0)+1}`,e.textContent=``,e.appendChild(a),a}_wrapHeaderWithSortControl(e,t,n){let r=document.createElement(`div`);r.setAttribute(`data-scb-sort-header`,`true`),r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(t),r.appendChild(n),e.appendChild(r)}_getNormalizedText(e){return(e??``).replace(/\s+/g,` `).trim()}_onThClick(e){this._isColumnSortable(e)&&(this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners())}_getHeaderAriaSort(e){return this._sortedColumn===e?this._sortDirection===`asc`?`ascending`:`descending`:`none`}_getSortButtonLabel(e,t){return`Sortera ${e||`kolumn ${t+1}`} ${this._sortedColumn===t&&this._sortDirection===`asc`?`fallande`:`stigande`}`}_isColumnSortable(e){return!(Array.isArray(this.disableSorting)?this.disableSorting:[]).some(t=>Number(t)===e)}_sortTable(e,t){if(!this._isColumnSortable(e))return;let n=this.shadowRoot.querySelector(`slot`);if(!n)return;let r=n.assignedNodes({flatten:!0}),i=null;if(r.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(i=t)}}),!i)return;let a;a=this._filteredRows?[...this._filteredRows]:this._getTopLevelRows(i),a.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)});let o=this._tbodyObserver!==null;o&&this._disconnectTbodyObserver();try{a.forEach(e=>i.appendChild(e))}finally{o&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=a,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(e=>this._getCellSortableValue(e)).join(` `)}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}_updateTotalRows(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),n&&(this.totalRows=this._getTopLevelRows(n).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r;r=this._filteredRows?this._filteredRows:this._getTopLevelRows(n),this._getTopLevelRows(n).forEach(e=>e.style.display=`none`);let i=(this.currentPage-1)*this.pageSize,a=i+this.pageSize;r.slice(i,a).forEach(e=>e.style.display=``)}_changePage(e){let t=Math.ceil(this.totalRows/this.pageSize);e<1||e>t||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}};N([_({type:String})],op.prototype,`searchTerm`,void 0),N([_({type:Boolean,attribute:`with-pagination`})],op.prototype,`pagination`,void 0),N([_({type:Boolean,attribute:`with-filtering-search`})],op.prototype,`filteringSearch`,void 0),N([_({type:Boolean,attribute:`no-scroll`})],op.prototype,`noScroll`,void 0),N([_({type:Number,attribute:`page-size`})],op.prototype,`pageSize`,void 0),N([_({type:Array,attribute:`disable-sorting`})],op.prototype,`disableSorting`,void 0),N([_({type:Number})],op.prototype,`currentPage`,void 0),N([_({type:Number})],op.prototype,`totalRows`,void 0),op=N([a(`scb-table-advanced`)],op),b(),w(),D(),P();var sp=class extends Ms{constructor(...e){super(...e),this.iconOnly=!1,this.inlineIcon=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.setAttribute(`aria-selected`,this.active?`true`:`false`),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...Ms.styles,p`
|
|
20341
|
+
`}_onSearchInput(e){let t=e.target.value;this.searchTerm=t,this._filterTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r=n,i=this._getTopLevelRows(r),a=this.searchTerm.trim().toLowerCase();if(!a)this._filteredRows=null,i.forEach(e=>e.style.display=``),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=i.filter(e=>this._getRowSearchText(e).toLowerCase().includes(a)),i.forEach(e=>e.style.display=`none`);let e=this._filteredRows;this._sortedColumn!==null&&(e=[...e],e.sort((e,t)=>{let n=this._getCellSortableValue(e.children[this._sortedColumn]),r=this._getCellSortableValue(t.children[this._sortedColumn]);return this._compareCellValues(n,r,this._sortDirection)}),this._filteredRows=e),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(e=>e.style.display=``)}}firstUpdated(){let e=this.shadowRoot.querySelector(`slot`);e&&(e.addEventListener(`slotchange`,()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._initialTableRefreshFrame=requestAnimationFrame(()=>{this._initialTableRefreshFrame=0,this.isConnected&&this._refreshFromTableContent()}))}updated(e){super.updated(e),e.has(`disableSorting`)&&this._sortedColumn!==null&&!this._isColumnSortable(this._sortedColumn)&&(this._sortedColumn=null,this._sortDirection=`asc`),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`)||e.has(`disableSorting`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()}),this.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>{e.setAttribute(`size`,M(this,`--scb-table-advanced-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`))})}_disconnectTbodyObserver(){this._tbodyObserver&&=(this._tbodyObserver.disconnect(),null),this._observedTbody=null}_attachTbodyObserver(){let e=this._getTbody();if(!e){this._disconnectTbodyObserver();return}this._observedTbody!==e&&(this._disconnectTbodyObserver(),this._observedTbody=e,this._tbodyObserver=new MutationObserver(()=>{this._suppressTbodyObserver||this._scheduleTableRefresh()}),this._tbodyObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}))}_scheduleTableRefresh(){this._pendingTableRefresh||(this._pendingTableRefresh=!0,queueMicrotask(()=>{this._pendingTableRefresh=!1,this._refreshFromTableContent()}))}_refreshFromTableContent(){if(this._attachTbodyObserver(),this.filteringSearch){this._filterTable();return}if(this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this._sortedColumn!==null){this._sortTable(this._sortedColumn,this._sortDirection);return}this.pagination&&this._paginateTable()}_ensureCurrentPageWithinBounds(){let e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),t=Math.min(Math.max(1,this.currentPage),e);t!==this.currentPage&&(this.currentPage=t)}_getTbody(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return null;let t=e.assignedNodes({flatten:!0});for(let e of t)if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);if(t)return t}return null}_getTopLevelRows(e){return Array.from(e.children).filter(e=>e instanceof HTMLTableRowElement)}_attachThListeners(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=[],r=[],i=[],a=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(Array.from(e.querySelectorAll(`thead`)).forEach(e=>{n.push(...Array.from(e.querySelectorAll(`th`)))}),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),r.forEach(e=>{let t=n.indexOf(e),r=t!==-1;e.style.textAlign=`left`,e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline-end) var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.position=`relative`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-header-font)`,e.style.fontSize=`var(--scb-table-header-font-size)`,e.style.lineHeight=`var(--scb-table-header-line-height)`,e.style.fontWeight=`var(--scb-table-header-font-weight)`,e.style.letterSpacing=`var(--scb-table-header-letter-spacing)`,e.style.verticalAlign=`middle`,this._removeGeneratedSortMarkup(e),e.hasAttribute(`scope`)||(r?e.setAttribute(`scope`,`col`):e.closest(`tbody`)&&e.setAttribute(`scope`,`row`));let i=this._getOrCreateHeaderLabel(e,t);if((i instanceof HTMLParagraphElement||i.getAttribute(`data-scb-generated-label`)===`true`)&&this._applyGeneratedCellTextReset(i),!r){e.removeAttribute(`aria-sort`);return}if(!this._isColumnSortable(t)){e.removeAttribute(`aria-sort`);return}e.setAttribute(`aria-sort`,this._getHeaderAriaSort(t));let a=this._getNormalizedText(i.textContent)||`kolumn ${Math.max(t,0)+1}`,o=document.createElement(`scb-icon-button`);o.className=`scb-sort-icon`,o.onclick=()=>this._onThClick(t),o.setAttribute(`variant`,`standard`),o.setAttribute(`size`,M(this,`--scb-table-advanced-design-sort-icon-button-size-medium`,[`tiny`,`extra-small`,`small`,`medium`,`large`],`small`)),o.setAttribute(`aria-label`,this._getSortButtonLabel(a,t)),o.style.alignSelf=`center`,this._sortedColumn===t?(o.setAttribute(`variant`,`filled-tonal`),o.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(o.setAttribute(`icon`,`swap_horiz`),o.style.transform+=` rotate(90deg)`),this._wrapHeaderWithSortControl(e,i,o)}),i.forEach(e=>{e.style.padding=`var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline-end) var(--scb-table-cell-padding-block) var(--scb-table-cell-padding-inline)`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--scb-tables-outline-color, var(--md-sys-color-outline-variant))`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--scb-tables-surface-color, var(--md-sys-color-surface))`,e.style.fontFamily=`var(--scb-table-cell-font)`,e.style.fontSize=`var(--scb-table-cell-font-size)`,e.style.lineHeight=`var(--scb-table-cell-line-height)`,e.style.fontWeight=`var(--scb-table-cell-font-weight)`,e.style.letterSpacing=`var(--scb-table-cell-letter-spacing)`}),a.forEach((e,t)=>{t%2==1&&e.querySelectorAll(`td`).forEach(e=>{e.style.backgroundColor=`var(--scb-background-row)`});let n=e.querySelectorAll(`th`);n.length>0&&n.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`var(--scb-table-cell-edge-padding-inline)`),t===n.length-1?e.style.paddingRight=`var(--scb-table-cell-edge-padding-inline)`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`var(--scb-table-cell-edge-padding-inline)`),t===r.length-1?e.style.paddingRight=`var(--scb-table-cell-edge-padding-inline)`:e.style.paddingRight=``})}),this.pagination&&this._paginateTable()}_applyGeneratedCellTextReset(e){e.style.margin=`0`,e.style.color=`inherit`,e.style.fontFamily=`inherit`,e.style.fontSize=`inherit`,e.style.lineHeight=`inherit`,e.style.fontWeight=`inherit`,e.style.letterSpacing=`inherit`}_removeGeneratedSortMarkup(e){e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let t=e.querySelector(`:scope > [data-scb-sort-header="true"]`);if(!(t instanceof HTMLElement))return;let n=t.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement){t.replaceWith(n);return}t.remove()}_getOrCreateHeaderLabel(e,t){let n=e.querySelector(`:scope > [data-scb-sort-label="true"]`);if(n instanceof HTMLElement)return n;let r=e.querySelector(`:scope > p`);if(r instanceof HTMLParagraphElement)return r.setAttribute(`data-scb-sort-label`,`true`),r;let i=Array.from(e.children).find(e=>e instanceof HTMLElement&&!e.matches(`scb-icon-button.scb-sort-icon`));if(i)return i.setAttribute(`data-scb-sort-label`,`true`),i;let a=document.createElement(`p`);return a.setAttribute(`data-scb-sort-label`,`true`),a.setAttribute(`data-scb-generated-label`,`true`),a.textContent=this._getNormalizedText(e.textContent)||`kolumn ${Math.max(t,0)+1}`,e.textContent=``,e.appendChild(a),a}_wrapHeaderWithSortControl(e,t,n){let r=document.createElement(`div`);r.setAttribute(`data-scb-sort-header`,`true`),r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(t),r.appendChild(n),e.appendChild(r)}_getNormalizedText(e){return(e??``).replace(/\s+/g,` `).trim()}_onThClick(e){this._isColumnSortable(e)&&(this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners())}_getHeaderAriaSort(e){return this._sortedColumn===e?this._sortDirection===`asc`?`ascending`:`descending`:`none`}_getSortButtonLabel(e,t){return`Sortera ${e||`kolumn ${t+1}`} ${this._sortedColumn===t&&this._sortDirection===`asc`?`fallande`:`stigande`}`}_isColumnSortable(e){return!(Array.isArray(this.disableSorting)?this.disableSorting:[]).some(t=>Number(t)===e)}_sortTable(e,t){if(!this._isColumnSortable(e))return;let n=this.shadowRoot.querySelector(`slot`);if(!n)return;let r=n.assignedNodes({flatten:!0}),i=null;if(r.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(i=t)}}),!i)return;let a;a=this._filteredRows?[...this._filteredRows]:this._getTopLevelRows(i),a.sort((n,r)=>{let i=this._getCellSortableValue(n.children[e]),a=this._getCellSortableValue(r.children[e]);return this._compareCellValues(i,a,t)});let o=this._tbodyObserver!==null;o&&this._disconnectTbodyObserver();try{a.forEach(e=>i.appendChild(e))}finally{o&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=a,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(e=>this._getCellSortableValue(e)).join(` `)}_getCellSortableValue(e){if(!e)return``;let t=e,n=this._getSortableAttributeValue(t);if(n)return n;let r=[],i=t.textContent?.replace(/\s+/g,` `).trim();return i&&r.push(i),t.querySelectorAll(`[data-sort-value], [data-sort], [aria-label], [label], [value], [title]`).forEach(e=>{let t=this._getSortableAttributeValue(e);t&&!r.includes(t)&&r.push(t)}),r.join(` `).trim()}_getSortableAttributeValue(e){return(e.getAttribute(`data-sort-value`)??e.getAttribute(`data-sort`)??e.getAttribute(`aria-label`)??e.getAttribute(`label`)??e.getAttribute(`value`)??e.getAttribute(`title`)??``).replace(/\s+/g,` `).trim()}_compareCellValues(e,t,n){let r=this._parseSortableNumber(e),i=this._parseSortableNumber(t);if(r!==null&&i!==null)return n===`asc`?r-i:i-r;let a=Date.parse(e.replace(/\s+/g,` `)),o=Date.parse(t.replace(/\s+/g,` `));if(!isNaN(a)&&!isNaN(o))return n===`asc`?a-o:o-a;let s=e.localeCompare(t,`sv`);return n===`asc`?s:-s}_parseSortableNumber(e){let t=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(t))return null;let n=Number(t.replace(/[\s\u00a0\u202f]/g,``).replace(`,`,`.`));return Number.isNaN(n)?null:n}_updateTotalRows(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),n&&(this.totalRows=this._getTopLevelRows(n).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){let e=this.shadowRoot.querySelector(`slot`);if(!e)return;let t=e.assignedNodes({flatten:!0}),n=null;if(t.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.querySelector(`tbody`);t&&(n=t)}}),!n)return;let r;r=this._filteredRows?this._filteredRows:this._getTopLevelRows(n),this._getTopLevelRows(n).forEach(e=>e.style.display=`none`);let i=(this.currentPage-1)*this.pageSize,a=i+this.pageSize;r.slice(i,a).forEach(e=>e.style.display=``)}_changePage(e){let t=Math.ceil(this.totalRows/this.pageSize);e<1||e>t||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent(`tableadvancedchange`,{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}};N([_({type:String})],ap.prototype,`searchTerm`,void 0),N([_({type:Boolean,attribute:`with-pagination`})],ap.prototype,`pagination`,void 0),N([_({type:Boolean,attribute:`with-filtering-search`})],ap.prototype,`filteringSearch`,void 0),N([_({type:Boolean,attribute:`no-scroll`})],ap.prototype,`noScroll`,void 0),N([_({type:Number,attribute:`page-size`})],ap.prototype,`pageSize`,void 0),N([_({type:Array,attribute:`disable-sorting`})],ap.prototype,`disableSorting`,void 0),N([_({type:Number})],ap.prototype,`currentPage`,void 0),N([_({type:Number})],ap.prototype,`totalRows`,void 0),ap=N([a(`scb-table-advanced`)],ap),b(),w(),D(),P();var op=class extends Ms{constructor(...e){super(...e),this.iconOnly=!1,this.inlineIcon=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.setAttribute(`aria-selected`,this.active?`true`:`false`),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...Ms.styles,p`
|
|
20336
20342
|
:host {
|
|
20337
20343
|
/* Styrpunkter och tokenbindningar finns i komponentens component.json. */
|
|
20338
20344
|
--md-primary-tab-container-height: var(--scb-tabs-design-height-medium);
|
|
@@ -20366,7 +20372,7 @@
|
|
|
20366
20372
|
:host([icon-only]) slot:not([name='icon']) {
|
|
20367
20373
|
display: none;
|
|
20368
20374
|
}
|
|
20369
|
-
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};N([_({type:String})],
|
|
20375
|
+
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};N([_({type:String})],op.prototype,`icon`,null),N([_({type:Boolean,reflect:!0,attribute:`icon-only`})],op.prototype,`iconOnly`,void 0),N([_({type:Boolean,reflect:!0,attribute:`inline-icon`})],op.prototype,`inlineIcon`,void 0),op=N([a(`scb-primary-tab`)],op),b(),w(),D(),P();var sp=class extends Fs{constructor(...e){super(...e),this.iconOnly=!1,this._onActivate=()=>{let e=this.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`activate`,{detail:{label:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tab`)}get icon(){return this._icon}set icon(e){let t=this._icon;t!==e&&(this._icon=e,this.requestUpdate(`icon`,t),this.updateIconSlot())}firstUpdated(e){if(super.firstUpdated(e),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}this.addEventListener(`click`,this._onActivate),this._icon&&this.updateIconSlot()}updated(){if(super.updated(),this.iconOnly&&!this.hasAttribute(`aria-label`)){let e=this.textContent?.trim()??``;e&&this.setAttribute(`aria-label`,e)}}static{this.styles=[...Fs.styles,p`
|
|
20370
20376
|
:host {
|
|
20371
20377
|
/* Styrpunkter och tokenbindningar finns i komponentens component.json. */
|
|
20372
20378
|
--md-secondary-tab-container-height: var(--scb-tabs-design-height-medium);
|
|
@@ -20386,7 +20392,7 @@
|
|
|
20386
20392
|
:host([icon-only]) slot:not([name='icon']) {
|
|
20387
20393
|
display: none;
|
|
20388
20394
|
}
|
|
20389
|
-
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};N([_({type:String})],
|
|
20395
|
+
`]}updateIconSlot(){let e=this.querySelector(`md-icon[slot="icon"]`);if(!this._icon){e?.remove();return}if(e)e.textContent=this._icon;else{let e=document.createElement(`md-icon`);e.setAttribute(`slot`,`icon`),e.textContent=this._icon,this.appendChild(e)}}};N([_({type:String})],sp.prototype,`icon`,null),N([_({type:Boolean,reflect:!0,attribute:`icon-only`})],sp.prototype,`iconOnly`,void 0),sp=N([a(`scb-secondary-tab`)],sp),b(),w(),P();var cp=class extends zs{constructor(...e){super(...e),this.ariaLabel=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._isDispatching=!1,this._onChange=e=>{if(!e.composed&&!this._isDispatching){e.stopPropagation(),this._isDispatching=!0;let t=e.target.activeTabIndex;this.dispatchEvent(new CustomEvent(`change`,{detail:{activeTabIndex:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`tabschange`,{detail:{activeTabIndex:t},bubbles:!0,composed:!0})),this._isDispatching=!1}}}static{this.styles=[...zs.styles,p`
|
|
20390
20396
|
:host {
|
|
20391
20397
|
/* Styrpunkter och tokenbindningar finns i komponentens component.json. */
|
|
20392
20398
|
--md-primary-tab-container-height: var(--scb-tabs-design-height-medium);
|
|
@@ -20451,7 +20457,7 @@
|
|
|
20451
20457
|
}
|
|
20452
20458
|
|
|
20453
20459
|
/* design:bindings:scb-tabs:end */
|
|
20454
|
-
`]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tablist`)}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`change`,this._onChange),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-tabs-spacing-block-start`,t):this.style.removeProperty(`--scb-tabs-spacing-block-start`),n?this.style.setProperty(`--scb-tabs-spacing-block-end`,n):this.style.removeProperty(`--scb-tabs-spacing-block-end`),r?this.style.setProperty(`--scb-tabs-spacing-inline-start`,r):this.style.removeProperty(`--scb-tabs-spacing-inline-start`),i?this.style.setProperty(`--scb-tabs-spacing-inline-end`,i):this.style.removeProperty(`--scb-tabs-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String,reflect:!0,attribute:`aria-label`})],
|
|
20460
|
+
`]}connectedCallback(){super.connectedCallback(),this.setAttribute(`role`,`tablist`)}firstUpdated(e){super.firstUpdated(e),this.addEventListener(`change`,this._onChange),this.#e()}updated(e){super.updated(e),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e()}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-tabs-spacing-block-start`,t):this.style.removeProperty(`--scb-tabs-spacing-block-start`),n?this.style.setProperty(`--scb-tabs-spacing-block-end`,n):this.style.removeProperty(`--scb-tabs-spacing-block-end`),r?this.style.setProperty(`--scb-tabs-spacing-inline-start`,r):this.style.removeProperty(`--scb-tabs-spacing-inline-start`),i?this.style.setProperty(`--scb-tabs-spacing-inline-end`,i):this.style.removeProperty(`--scb-tabs-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String,reflect:!0,attribute:`aria-label`})],cp.prototype,`ariaLabel`,void 0),N([_({type:String,reflect:!0})],cp.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],cp.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],cp.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],cp.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],cp.prototype,`spacingRight`,void 0),cp=N([a(`scb-tabs`)],cp),w(),b(),Lu(),yc(),D(),E(),j(),P();var lp,up=class extends C{static{lp=this}constructor(...e){super(...e),this.expanded=!1,this.label=``,this.supportingText=``,this.current=!1,this.itemHref=`#`,this.noDivider=!1,this._unique=lp._uid(),this._overflowVisibleTimer=null,this._slotHasContent=!1,this._trailingSlotHasContent=!1,this._onSlotChange=()=>{let e=this.renderRoot.querySelector(`slot:not([name])`),t=!!e&&e.assignedElements({flatten:!0}).length>0;this._slotHasContent!==t&&(this._slotHasContent=t,this.requestUpdate()),!this._slotHasContent&&this.expanded&&(this.expanded=!1),this._applyInertByExpanded()},this._toggleAccordion=()=>{if(!this._slotHasContent)return;let e=!this.expanded;this.setExpanded(e)},this._onKeyDown=e=>{let t=this.closest(`scb-toc`),n=Array.from(t?.querySelectorAll(`scb-toc-item`)||[]).map(e=>({host:e,label:e.renderRoot.querySelector(`.toc-item-label`)||null})).filter(e=>!!e.label),r=n.findIndex(e=>e.host===this);if(r<0)return;let i=e.currentTarget?.classList?.contains(`toc-chevron-button`)??!1;switch(e.key){case`Enter`:case` `:if(!i)return;e.preventDefault(),this._toggleAccordion();break;case`ArrowDown`:e.preventDefault(),r<n.length-1&&n[r+1].label.focus();break;case`ArrowUp`:e.preventDefault(),r>0&&n[r-1].label.focus();break;case`Home`:e.preventDefault(),n.length&&n[0].label.focus();break;case`End`:e.preventDefault(),n.length&&n[n.length-1].label.focus();break}}}setExpanded(e){this.expanded!==e&&(this.expanded=e)}static{this._uidPrefix=`uid-${Math.random().toString(36).slice(2)}`}static{this._uidSeq=0}static _uid(){return globalThis.crypto?.randomUUID?.()??`${lp._uidPrefix}-${++lp._uidSeq}`}static{this.styles=[p`
|
|
20455
20461
|
:host {
|
|
20456
20462
|
display: block;
|
|
20457
20463
|
--scb-toc-transition-duration: var(--motion-duration-short, 150ms);
|
|
@@ -20753,7 +20759,7 @@
|
|
|
20753
20759
|
|
|
20754
20760
|
${this.noDivider?``:x`<scb-divider></scb-divider>`}
|
|
20755
20761
|
</div>
|
|
20756
|
-
`}};N([_({type:Boolean,reflect:!0})],
|
|
20762
|
+
`}};N([_({type:Boolean,reflect:!0})],up.prototype,`expanded`,void 0),N([_({type:String,reflect:!0})],up.prototype,`label`,void 0),N([_({type:String,attribute:`supporting-text`})],up.prototype,`supportingText`,void 0),N([_({type:Boolean,reflect:!0})],up.prototype,`current`,void 0),N([_({type:String,attribute:`item-href`})],up.prototype,`itemHref`,void 0),N([_({type:Boolean,attribute:`no-divider`})],up.prototype,`noDivider`,void 0),up=lp=N([a(`scb-toc-item`)],up),w(),b(),P();var dp=class extends C{constructor(...e){super(...e),this.label=`Innehållsförteckning`,this.singleOpen=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}static{this.styles=[p`
|
|
20757
20763
|
:host {
|
|
20758
20764
|
display: block;
|
|
20759
20765
|
/* Vertikalt avstånd styrs av spacing-attributen via CSS-variabler */
|
|
@@ -20777,8 +20783,8 @@
|
|
|
20777
20783
|
<slot @slotchange=${this.#t}></slot>
|
|
20778
20784
|
</div>
|
|
20779
20785
|
</nav>
|
|
20780
|
-
`}_getDirectItems(){return Array.from(this.children).filter(e=>e.tagName===`SCB-TOC-ITEM`)}#e(e){if(!this.singleOpen)return;let t=e;if(!t.detail?.expanded)return;let n=t.target;!n||n.tagName!==`SCB-TOC-ITEM`||this._getDirectItems().forEach(e=>{e!==n&&e.expanded&&e.setExpanded(!1)})}#t(){this.#r(),this.#n()}#n(){if(!this.singleOpen)return;let e=this._getDirectItems().filter(e=>e.expanded);e.length<=1||e.slice(1).forEach(e=>e.setExpanded(!1))}#r(){let e=this._getDirectItems(),t=String(e.length);e.forEach((e,n)=>{e.setAttribute(`role`,`listitem`),e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,t)})}#i(){let e=this.#a(this.spacing),t=this.#a(this.spacingTop)??e,n=this.#a(this.spacingBottom)??e,r=this.#a(this.spacingLeft),i=this.#a(this.spacingRight);t?this.style.setProperty(`--scb-toc-spacing-block-start`,t):this.style.removeProperty(`--scb-toc-spacing-block-start`),n?this.style.setProperty(`--scb-toc-spacing-block-end`,n):this.style.removeProperty(`--scb-toc-spacing-block-end`),r?this.style.setProperty(`--scb-toc-spacing-inline-start`,r):this.style.removeProperty(`--scb-toc-spacing-inline-start`),i?this.style.setProperty(`--scb-toc-spacing-inline-end`,i):this.style.removeProperty(`--scb-toc-spacing-inline-end`)}#a(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String,reflect:!0})],fp.prototype,`label`,void 0),N([_({type:Boolean,attribute:`single-open`,reflect:!0})],fp.prototype,`singleOpen`,void 0),N([_({type:String,reflect:!0})],fp.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],fp.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],fp.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],fp.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],fp.prototype,`spacingRight`,void 0),fp=N([a(`scb-toc`)],fp),vt(),Gt();var pp={},mp=Ut(class extends Wt{constructor(){super(...arguments),this.ot=pp}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every(((e,t)=>e===this.ot[t])))return rt}else if(this.ot===t)return rt;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,n)}});vt(),Gt();var hp=class extends Wt{constructor(e){if(super(e),this.it=S,e.type!==Ht.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===S||e==null)return this._t=void 0,this.it=e;if(e===rt)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};hp.directiveName=`unsafeHTML`,hp.resultType=1,Ut(hp),Gt();var gp=class extends hp{};gp.directiveName=`unsafeSVG`,gp.resultType=2;var _p=Ut(gp),vp=(e,t,n=`1.25`)=>{let r=document.createElementNS(e,`path`);return r.setAttribute(`d`,t),r.setAttribute(`class`,`scb-viz-highcharts-pattern__mark`),r.setAttribute(`stroke-width`,n),r.setAttribute(`stroke-linecap`,`square`),r},yp=(e,t,n,r)=>{let i=document.createElementNS(e,`circle`);return i.setAttribute(`cx`,t),i.setAttribute(`cy`,n),i.setAttribute(`r`,r),i.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--dot`),i},bp=(e,t,n,r,i)=>{let a=document.createElementNS(e,`rect`);return a.setAttribute(`x`,t),a.setAttribute(`y`,n),a.setAttribute(`width`,r),a.setAttribute(`height`,i),a.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--square`),a},xp={dashStyles:[`Solid`,`ShortDash`,`ShortDot`,`ShortDashDot`,`ShortDashDotDot`,`Dot`,`LongDash`,`LongDashDot`,`Dash`,`DashDot`],markerSymbols:[`circle`,`diamond`,`square`,`triangle`,`triangle-down`],defaultPatternKind:`grid`,patterns:[{kind:`diagonal`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M-2,8 l10,-10 M0,10 l10,-10 M8,12 l4,-4`))}},{kind:`dots`,appendMarks:(e,t)=>{e.appendChild(yp(t,`2`,`2`,`1.2`)),e.appendChild(yp(t,`7`,`7`,`1.2`))}},{kind:`cross`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M0,0 L10,10 M10,0 L0,10`))}},{kind:`vertical`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M2,0 L2,10 M7,0 L7,10`))}},{kind:`horizontal`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M0,2 L10,2 M0,7 L10,7`))}},{kind:`grid`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M0,0 L10,0 M0,5 L10,5 M0,10 L10,10`,`1`))}},{kind:`diagonal-reverse`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M0,0 L10,10 M-2,2 L8,12 M2,-2 L12,8`))}},{kind:`dots-dense`,appendMarks:(e,t)=>{e.appendChild(yp(t,`2`,`2`,`1`)),e.appendChild(yp(t,`7`,`2`,`1`)),e.appendChild(yp(t,`2`,`7`,`1`)),e.appendChild(yp(t,`7`,`7`,`1`))}},{kind:`checker`,appendMarks:(e,t)=>{e.appendChild(bp(t,`0`,`0`,`4`,`4`)),e.appendChild(bp(t,`5`,`5`,`4`,`4`))}},{kind:`zigzag`,appendMarks:(e,t)=>{e.appendChild(vp(t,`M-2,8 L2,4 L6,8 L10,4 L14,8 M-2,3 L2,-1 L6,3 L10,-1 L14,3`))}}]};function Sp(){return xp.patterns.map(({kind:e})=>e)}function Cp(e){return xp.patterns.find(({kind:t})=>t===e)||xp.patterns.find(({kind:e})=>e===xp.defaultPatternKind)||xp.patterns[0]}function wp(e,t,n){let r=Cp(n);return r?.appendMarks(e,t),r?.kind||n}function Tp(e){let t=xp.dashStyles,n=xp.markerSymbols,r=Sp();return{dashStyle:t[e%t.length],markerSymbol:n[e%n.length],patternKind:r[e%r.length]}}function Ep(e){return Tp(e)}function Dp(e,t){let n=``,r=t&&t.options&&typeof t.options==`object`?t.options:{},i=t&&t.userOptions&&typeof t.userOptions==`object`?t.userOptions:{},a=e&&e.options&&typeof e.options==`object`?e.options:{},o=a.custom&&typeof a.custom==`object`?a.custom:{},s=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return r.chart&&typeof r.chart.id==`string`?n=r.chart.id:i.chart&&typeof i.chart.id==`string`&&(n=i.chart.id),n=String(n||``).trim().toLowerCase(),n===`grouped-column`||n===`grouped-bar`||r.custom&&r.custom.scbVizGroupedClustered===!0||o.scbVizGroupedCategory===!0||o.scbVizGroupedCategoryLegend===!0||s.scbVizGroupedCategory===!0||s.scbVizGroupedCategoryLegend===!0||e&&e._scbVizGroupedCategoryLegendItem===!0?!0:Op(e)}function Op(e){return Array.isArray(e?.points)&&e.points.some(e=>{let t=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return typeof t.scbVizGroup==`string`&&t.scbVizGroup.trim()})}function kp(e){let t=[e?.colorIndex,e?.options?.colorIndex,e?.userOptions?.colorIndex,e?.series?.colorIndex,e?.series?.options?.colorIndex].find(e=>Number.isInteger(e));return Number.isInteger(t)?Number(t):null}function Ap(e){return!e||typeof e!=`object`?{indexByKey:{},nextIndex:0}:((!e.scbVizGroupedSeriesDifferentiationStore||typeof e.scbVizGroupedSeriesDifferentiationStore!=`object`)&&(e.scbVizGroupedSeriesDifferentiationStore={indexByKey:{},nextIndex:0}),e.scbVizGroupedSeriesDifferentiationStore)}function jp(e,t){let n=kp(e);if(Number.isInteger(n))return`color:${n}`;let r=e?.custom&&typeof e.custom==`object`&&typeof e.custom.scbVizGroup==`string`?e.custom.scbVizGroup.trim():``;if(r)return`group:${r}`;let i=typeof e?.name==`string`?e.name.trim():``;if(i)return`name:${i}`;let a=typeof e?.series?.name==`string`?e.series.name.trim():``;return a?`series:${a}`:`fallback:${t}`}function Mp(e,t,n){let r=kp(e);if(typeof r==`number`&&Number.isInteger(r))return r;let i=Ap(t),a=jp(e,n);return Object.prototype.hasOwnProperty.call(i.indexByKey,a)||(i.indexByKey[a]=i.nextIndex,i.nextIndex+=1),i.indexByKey[a]}function Np(e,t,n){let r=Mp(e,t,n);return{variantIndex:r,...Ep(r)}}function Pp(e){return e.getCurrentPrintableView()!==`diagram`||!e.chart?.series?.length||!e.isHighchartsStyledMode(e.chart)?!1:e.chart.series.some(t=>e.getSeriesDifferentiationGroup(t,e.chart)!==null)}function Fp(e){let t=e?.element??e;return t instanceof SVGElement?t:null}function Ip(e){return!!(e?.styledMode||e?.renderer?.styledMode||e?.options?.chart?.styledMode)}function Lp(e){if(e?.container instanceof SVGSVGElement)return e.container;let t=e?.renderTo?.querySelector(`svg`)??e?.container?.querySelector?.(`svg`);return t instanceof SVGSVGElement?t:null}function Rp(e,t){let n=Fp(e);return Array.from(n?.classList??[]).find(e=>/^highcharts-color-\d+$/.test(e))??`highcharts-color-${t}`}function zp(e,t){let n=Fp(e);n&&(n.setAttribute(`data-scb-viz-role`,t.role),t.dashStyle?n.setAttribute(`data-scb-viz-dash-style`,t.dashStyle):n.removeAttribute(`data-scb-viz-dash-style`),t.patternKind?n.setAttribute(`data-scb-viz-pattern-kind`,t.patternKind):n.removeAttribute(`data-scb-viz-pattern-kind`))}function Bp(e){let t=Fp(e);t&&(t.removeAttribute(`data-scb-viz-role`),t.removeAttribute(`data-scb-viz-dash-style`),t.removeAttribute(`data-scb-viz-pattern-kind`))}function Vp(e,t){let n=Fp(e);if(!n||!t)return;let r=Array.from(n.classList).find(e=>/^highcharts-color-\d+$/.test(e));r!==t&&(r&&(n.classList.remove(r),n.setAttribute(`data-scb-viz-prev-color-class`,r)),n.classList.add(t),n.setAttribute(`data-scb-viz-added-color-class`,t))}function Hp(e){let t=Fp(e);if(!t)return;let n=t.getAttribute(`data-scb-viz-added-color-class`),r=t.getAttribute(`data-scb-viz-prev-color-class`);n&&(t.classList.remove(n),t.removeAttribute(`data-scb-viz-added-color-class`)),r&&(t.classList.add(r),t.removeAttribute(`data-scb-viz-prev-color-class`))}function Up(e){let t=[],n=[],r=Fp(e?.legendItem?.group),i=(e,t)=>{let n=Fp(t);!n||e.includes(n)||e.push(n)};if(i(t,e?.legendLine),i(t,e?.legendItem?.line),i(n,e?.legendSymbol),i(n,e?.legendItem?.symbol),i(n,e?.legendArea),i(n,e?.legendItem?.area),r){let e=r.querySelector(`.highcharts-graph, .highcharts-legend-graph, line`);e&&i(t,e),r.querySelectorAll(`rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path`).forEach(e=>{i(n,e)})}return{graphTargets:t,fillTargets:n.filter(e=>!t.includes(e))}}function Wp(e,t,n){let r=Lp(e);if(!r)return;let i=`http://www.w3.org/2000/svg`,a=r.querySelector(`defs`);a instanceof SVGDefsElement||(a=document.createElementNS(i,`defs`),r.insertBefore(a,r.firstChild));let o=`scb-viz-pattern-${t}-${n}`;if(a.querySelector(`#${o}`))return;let s=document.createElementNS(i,`pattern`);s.setAttribute(`id`,o),s.setAttribute(`patternUnits`,`userSpaceOnUse`),s.setAttribute(`width`,`10`),s.setAttribute(`height`,`10`),s.classList.add(t);let c=document.createElementNS(i,`rect`);c.setAttribute(`x`,`0`),c.setAttribute(`y`,`0`),c.setAttribute(`width`,`10`),c.setAttribute(`height`,`10`),c.setAttribute(`class`,`scb-viz-highcharts-pattern__background`),s.appendChild(c),wp(s,i,n),a.appendChild(s)}var Gp={brandAssetFill:`#fff`,vizExportBackgroundFallback:`#ffffff`,vizExportTransparentBackground:`rgba(0, 0, 0, 0)`,vizPrintBackground:`#fff`,vizPrintText:`#1f1f1f`,vizPrintTableBorder:`#c5c7d0`,vizPrintTableRowStripe:`#f5f5f5`},Kp=e=>{let t=getComputedStyle(e).backgroundColor;return t&&t!==Gp.vizExportTransparentBackground?t:Gp.vizExportBackgroundFallback};function qp({lang:e,title:t}){let n=e===`en`?`visualization`:`visualisering`;return(t||n).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||n}function Jp(e,t){let n=t===`csv`?e.lang===`en`?`-table`:`-tabell`:``;return`${qp(e)}${n}.${t}`}function Yp(e=document){return e}function Xp(e=document){let t=Yp(e);return t.fullscreenElement||t.webkitFullscreenElement||null}function Zp(e){return!!(e.requestFullscreen||e.webkitRequestFullscreen)}async function Qp(e,t=document){if(!Zp(e))return;let n=Yp(t),r=Xp(t);if(r===e){n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen();return}r&&(n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen()),e.requestFullscreen?await e.requestFullscreen():e.webkitRequestFullscreen&&await e.webkitRequestFullscreen()}async function $p(e,t=document){let n=t.createElement(`iframe`);n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.right=`0`,n.style.bottom=`0`,n.style.width=`0`,n.style.height=`0`,n.style.border=`0`,n.style.visibility=`hidden`,t.body.appendChild(n);let r=()=>{n.remove()},i=n.contentDocument,a=n.contentWindow;if(!i||!a){r();return}i.open(),i.write(e),i.close();let o=Array.from(i.images||[]);await Promise.all(o.map(e=>e.complete?Promise.resolve():new Promise(t=>{e.addEventListener(`load`,()=>t(null),{once:!0}),e.addEventListener(`error`,()=>t(null),{once:!0})})));let s=()=>{a.removeEventListener(`afterprint`,s),r()};a.addEventListener(`afterprint`,s,{once:!0}),setTimeout(()=>{a.focus(),a.print(),setTimeout(r,1e3)},50)}async function em(e,t){e.setAttribute(`data-scb-viz-force-light`,``),await new Promise(e=>requestAnimationFrame(()=>e(null)));try{return await t()}finally{e.removeAttribute(`data-scb-viz-force-light`)}}function tm(e,t){let n=t===`en`?`,`:`;`,r=e=>`"${String(e??``).replace(/\r?\n/g,` `).replace(/"/g,`""`)}"`,i=`\uFEFF${e.map(e=>e.map(r).join(n)).join(`\r
|
|
20781
|
-
`)}`;return new Blob([i],{type:`text/csv;charset=utf-8;`})}async function
|
|
20786
|
+
`}_getDirectItems(){return Array.from(this.children).filter(e=>e.tagName===`SCB-TOC-ITEM`)}#e(e){if(!this.singleOpen)return;let t=e;if(!t.detail?.expanded)return;let n=t.target;!n||n.tagName!==`SCB-TOC-ITEM`||this._getDirectItems().forEach(e=>{e!==n&&e.expanded&&e.setExpanded(!1)})}#t(){this.#r(),this.#n()}#n(){if(!this.singleOpen)return;let e=this._getDirectItems().filter(e=>e.expanded);e.length<=1||e.slice(1).forEach(e=>e.setExpanded(!1))}#r(){let e=this._getDirectItems(),t=String(e.length);e.forEach((e,n)=>{e.setAttribute(`role`,`listitem`),e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,t)})}#i(){let e=this.#a(this.spacing),t=this.#a(this.spacingTop)??e,n=this.#a(this.spacingBottom)??e,r=this.#a(this.spacingLeft),i=this.#a(this.spacingRight);t?this.style.setProperty(`--scb-toc-spacing-block-start`,t):this.style.removeProperty(`--scb-toc-spacing-block-start`),n?this.style.setProperty(`--scb-toc-spacing-block-end`,n):this.style.removeProperty(`--scb-toc-spacing-block-end`),r?this.style.setProperty(`--scb-toc-spacing-inline-start`,r):this.style.removeProperty(`--scb-toc-spacing-inline-start`),i?this.style.setProperty(`--scb-toc-spacing-inline-end`,i):this.style.removeProperty(`--scb-toc-spacing-inline-end`)}#a(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}};N([_({type:String,reflect:!0})],dp.prototype,`label`,void 0),N([_({type:Boolean,attribute:`single-open`,reflect:!0})],dp.prototype,`singleOpen`,void 0),N([_({type:String,reflect:!0})],dp.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],dp.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],dp.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],dp.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],dp.prototype,`spacingRight`,void 0),dp=N([a(`scb-toc`)],dp),vt(),Gt();var fp={},pp=Ut(class extends Wt{constructor(){super(...arguments),this.ot=fp}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every(((e,t)=>e===this.ot[t])))return rt}else if(this.ot===t)return rt;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,n)}});vt(),Gt();var mp=class extends Wt{constructor(e){if(super(e),this.it=S,e.type!==Ht.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===S||e==null)return this._t=void 0,this.it=e;if(e===rt)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};mp.directiveName=`unsafeHTML`,mp.resultType=1,Ut(mp),Gt();var hp=class extends mp{};hp.directiveName=`unsafeSVG`,hp.resultType=2;var gp=Ut(hp),_p=(e,t,n=`1.25`)=>{let r=document.createElementNS(e,`path`);return r.setAttribute(`d`,t),r.setAttribute(`class`,`scb-viz-highcharts-pattern__mark`),r.setAttribute(`stroke-width`,n),r.setAttribute(`stroke-linecap`,`square`),r},vp=(e,t,n,r)=>{let i=document.createElementNS(e,`circle`);return i.setAttribute(`cx`,t),i.setAttribute(`cy`,n),i.setAttribute(`r`,r),i.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--dot`),i},yp=(e,t,n,r,i)=>{let a=document.createElementNS(e,`rect`);return a.setAttribute(`x`,t),a.setAttribute(`y`,n),a.setAttribute(`width`,r),a.setAttribute(`height`,i),a.setAttribute(`class`,`scb-viz-highcharts-pattern__mark--square`),a},bp={dashStyles:[`Solid`,`ShortDash`,`ShortDot`,`ShortDashDot`,`ShortDashDotDot`,`Dot`,`LongDash`,`LongDashDot`,`Dash`,`DashDot`],markerSymbols:[`circle`,`diamond`,`square`,`triangle`,`triangle-down`],defaultPatternKind:`grid`,patterns:[{kind:`diagonal`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M-2,8 l10,-10 M0,10 l10,-10 M8,12 l4,-4`))}},{kind:`dots`,appendMarks:(e,t)=>{e.appendChild(vp(t,`2`,`2`,`1.2`)),e.appendChild(vp(t,`7`,`7`,`1.2`))}},{kind:`cross`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M0,0 L10,10 M10,0 L0,10`))}},{kind:`vertical`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M2,0 L2,10 M7,0 L7,10`))}},{kind:`horizontal`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M0,2 L10,2 M0,7 L10,7`))}},{kind:`grid`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M0,0 L10,0 M0,5 L10,5 M0,10 L10,10`,`1`))}},{kind:`diagonal-reverse`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M0,0 L10,10 M-2,2 L8,12 M2,-2 L12,8`))}},{kind:`dots-dense`,appendMarks:(e,t)=>{e.appendChild(vp(t,`2`,`2`,`1`)),e.appendChild(vp(t,`7`,`2`,`1`)),e.appendChild(vp(t,`2`,`7`,`1`)),e.appendChild(vp(t,`7`,`7`,`1`))}},{kind:`checker`,appendMarks:(e,t)=>{e.appendChild(yp(t,`0`,`0`,`4`,`4`)),e.appendChild(yp(t,`5`,`5`,`4`,`4`))}},{kind:`zigzag`,appendMarks:(e,t)=>{e.appendChild(_p(t,`M-2,8 L2,4 L6,8 L10,4 L14,8 M-2,3 L2,-1 L6,3 L10,-1 L14,3`))}}]};function xp(){return bp.patterns.map(({kind:e})=>e)}function Sp(e){return bp.patterns.find(({kind:t})=>t===e)||bp.patterns.find(({kind:e})=>e===bp.defaultPatternKind)||bp.patterns[0]}function Cp(e,t,n){let r=Sp(n);return r?.appendMarks(e,t),r?.kind||n}function wp(e){let t=bp.dashStyles,n=bp.markerSymbols,r=xp();return{dashStyle:t[e%t.length],markerSymbol:n[e%n.length],patternKind:r[e%r.length]}}function Tp(e){return wp(e)}function Ep(e,t){let n=``,r=t&&t.options&&typeof t.options==`object`?t.options:{},i=t&&t.userOptions&&typeof t.userOptions==`object`?t.userOptions:{},a=e&&e.options&&typeof e.options==`object`?e.options:{},o=a.custom&&typeof a.custom==`object`?a.custom:{},s=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return r.chart&&typeof r.chart.id==`string`?n=r.chart.id:i.chart&&typeof i.chart.id==`string`&&(n=i.chart.id),n=String(n||``).trim().toLowerCase(),n===`grouped-column`||n===`grouped-bar`||r.custom&&r.custom.scbVizGroupedClustered===!0||o.scbVizGroupedCategory===!0||o.scbVizGroupedCategoryLegend===!0||s.scbVizGroupedCategory===!0||s.scbVizGroupedCategoryLegend===!0||e&&e._scbVizGroupedCategoryLegendItem===!0?!0:Dp(e)}function Dp(e){return Array.isArray(e?.points)&&e.points.some(e=>{let t=e&&e.custom&&typeof e.custom==`object`?e.custom:{};return typeof t.scbVizGroup==`string`&&t.scbVizGroup.trim()})}function Op(e){let t=[e?.colorIndex,e?.options?.colorIndex,e?.userOptions?.colorIndex,e?.series?.colorIndex,e?.series?.options?.colorIndex].find(e=>Number.isInteger(e));return Number.isInteger(t)?Number(t):null}function kp(e){return!e||typeof e!=`object`?{indexByKey:{},nextIndex:0}:((!e.scbVizGroupedSeriesDifferentiationStore||typeof e.scbVizGroupedSeriesDifferentiationStore!=`object`)&&(e.scbVizGroupedSeriesDifferentiationStore={indexByKey:{},nextIndex:0}),e.scbVizGroupedSeriesDifferentiationStore)}function Ap(e,t){let n=Op(e);if(Number.isInteger(n))return`color:${n}`;let r=e?.custom&&typeof e.custom==`object`&&typeof e.custom.scbVizGroup==`string`?e.custom.scbVizGroup.trim():``;if(r)return`group:${r}`;let i=typeof e?.name==`string`?e.name.trim():``;if(i)return`name:${i}`;let a=typeof e?.series?.name==`string`?e.series.name.trim():``;return a?`series:${a}`:`fallback:${t}`}function jp(e,t,n){let r=Op(e);if(typeof r==`number`&&Number.isInteger(r))return r;let i=kp(t),a=Ap(e,n);return Object.prototype.hasOwnProperty.call(i.indexByKey,a)||(i.indexByKey[a]=i.nextIndex,i.nextIndex+=1),i.indexByKey[a]}function Mp(e,t,n){let r=jp(e,t,n);return{variantIndex:r,...Tp(r)}}function Np(e){return e.getCurrentPrintableView()!==`diagram`||!e.chart?.series?.length||!e.isHighchartsStyledMode(e.chart)?!1:e.chart.series.some(t=>e.getSeriesDifferentiationGroup(t,e.chart)!==null)}function Pp(e){let t=e?.element??e;return t instanceof SVGElement?t:null}function Fp(e){return!!(e?.styledMode||e?.renderer?.styledMode||e?.options?.chart?.styledMode)}function Ip(e){if(e?.container instanceof SVGSVGElement)return e.container;let t=e?.renderTo?.querySelector(`svg`)??e?.container?.querySelector?.(`svg`);return t instanceof SVGSVGElement?t:null}function Lp(e,t){let n=Pp(e);return Array.from(n?.classList??[]).find(e=>/^highcharts-color-\d+$/.test(e))??`highcharts-color-${t}`}function Rp(e,t){let n=Pp(e);n&&(n.setAttribute(`data-scb-viz-role`,t.role),t.dashStyle?n.setAttribute(`data-scb-viz-dash-style`,t.dashStyle):n.removeAttribute(`data-scb-viz-dash-style`),t.patternKind?n.setAttribute(`data-scb-viz-pattern-kind`,t.patternKind):n.removeAttribute(`data-scb-viz-pattern-kind`))}function zp(e){let t=Pp(e);t&&(t.removeAttribute(`data-scb-viz-role`),t.removeAttribute(`data-scb-viz-dash-style`),t.removeAttribute(`data-scb-viz-pattern-kind`))}function Bp(e,t){let n=Pp(e);if(!n||!t)return;let r=Array.from(n.classList).find(e=>/^highcharts-color-\d+$/.test(e));r!==t&&(r&&(n.classList.remove(r),n.setAttribute(`data-scb-viz-prev-color-class`,r)),n.classList.add(t),n.setAttribute(`data-scb-viz-added-color-class`,t))}function Vp(e){let t=Pp(e);if(!t)return;let n=t.getAttribute(`data-scb-viz-added-color-class`),r=t.getAttribute(`data-scb-viz-prev-color-class`);n&&(t.classList.remove(n),t.removeAttribute(`data-scb-viz-added-color-class`)),r&&(t.classList.add(r),t.removeAttribute(`data-scb-viz-prev-color-class`))}function Hp(e){let t=[],n=[],r=Pp(e?.legendItem?.group),i=(e,t)=>{let n=Pp(t);!n||e.includes(n)||e.push(n)};if(i(t,e?.legendLine),i(t,e?.legendItem?.line),i(n,e?.legendSymbol),i(n,e?.legendItem?.symbol),i(n,e?.legendArea),i(n,e?.legendItem?.area),r){let e=r.querySelector(`.highcharts-graph, .highcharts-legend-graph, line`);e&&i(t,e),r.querySelectorAll(`rect, circle, .highcharts-point, .highcharts-area, .highcharts-legend-symbol, path`).forEach(e=>{i(n,e)})}return{graphTargets:t,fillTargets:n.filter(e=>!t.includes(e))}}function Up(e,t,n){let r=Ip(e);if(!r)return;let i=`http://www.w3.org/2000/svg`,a=r.querySelector(`defs`);a instanceof SVGDefsElement||(a=document.createElementNS(i,`defs`),r.insertBefore(a,r.firstChild));let o=`scb-viz-pattern-${t}-${n}`;if(a.querySelector(`#${o}`))return;let s=document.createElementNS(i,`pattern`);s.setAttribute(`id`,o),s.setAttribute(`patternUnits`,`userSpaceOnUse`),s.setAttribute(`width`,`10`),s.setAttribute(`height`,`10`),s.classList.add(t);let c=document.createElementNS(i,`rect`);c.setAttribute(`x`,`0`),c.setAttribute(`y`,`0`),c.setAttribute(`width`,`10`),c.setAttribute(`height`,`10`),c.setAttribute(`class`,`scb-viz-highcharts-pattern__background`),s.appendChild(c),Cp(s,i,n),a.appendChild(s)}var Wp={brandAssetFill:`#fff`,vizExportBackgroundFallback:`#ffffff`,vizExportTransparentBackground:`rgba(0, 0, 0, 0)`,vizPrintBackground:`#fff`,vizPrintText:`#1f1f1f`,vizPrintTableBorder:`#c5c7d0`,vizPrintTableRowStripe:`#f5f5f5`},Gp=e=>{let t=getComputedStyle(e).backgroundColor;return t&&t!==Wp.vizExportTransparentBackground?t:Wp.vizExportBackgroundFallback};function Kp({lang:e,title:t}){let n=e===`en`?`visualization`:`visualisering`;return(t||n).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||n}function qp(e,t){let n=t===`csv`?e.lang===`en`?`-table`:`-tabell`:``;return`${Kp(e)}${n}.${t}`}function Jp(e=document){return e}function Yp(e=document){let t=Jp(e);return t.fullscreenElement||t.webkitFullscreenElement||null}function Xp(e){return!!(e.requestFullscreen||e.webkitRequestFullscreen)}async function Zp(e,t=document){if(!Xp(e))return;let n=Jp(t),r=Yp(t);if(r===e){n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen();return}r&&(n.exitFullscreen?await n.exitFullscreen():n.webkitExitFullscreen&&await n.webkitExitFullscreen()),e.requestFullscreen?await e.requestFullscreen():e.webkitRequestFullscreen&&await e.webkitRequestFullscreen()}async function Qp(e,t=document){let n=t.createElement(`iframe`);n.setAttribute(`aria-hidden`,`true`),n.style.position=`fixed`,n.style.right=`0`,n.style.bottom=`0`,n.style.width=`0`,n.style.height=`0`,n.style.border=`0`,n.style.visibility=`hidden`,t.body.appendChild(n);let r=()=>{n.remove()},i=n.contentDocument,a=n.contentWindow;if(!i||!a){r();return}i.open(),i.write(e),i.close();let o=Array.from(i.images||[]);await Promise.all(o.map(e=>e.complete?Promise.resolve():new Promise(t=>{e.addEventListener(`load`,()=>t(null),{once:!0}),e.addEventListener(`error`,()=>t(null),{once:!0})})));let s=()=>{a.removeEventListener(`afterprint`,s),r()};a.addEventListener(`afterprint`,s,{once:!0}),setTimeout(()=>{a.focus(),a.print(),setTimeout(r,1e3)},50)}async function $p(e,t){e.setAttribute(`data-scb-viz-force-light`,``),await new Promise(e=>requestAnimationFrame(()=>e(null)));try{return await t()}finally{e.removeAttribute(`data-scb-viz-force-light`)}}function em(e,t){let n=t===`en`?`,`:`;`,r=e=>`"${String(e??``).replace(/\r?\n/g,` `).replace(/"/g,`""`)}"`,i=`\uFEFF${e.map(e=>e.map(r).join(n)).join(`\r
|
|
20787
|
+
`)}`;return new Blob([i],{type:`text/csv;charset=utf-8;`})}async function tm(e,t,n){let r=await im(e,t);return r?lm(r,n===`jpeg`?`image/jpeg`:`image/png`,n===`jpeg`?.92:void 0):null}async function nm(e,t,n){let r=await im(e,t);return r?r.toDataURL(n===`jpeg`?`image/jpeg`:`image/png`,n===`jpeg`?.92:void 0):null}function rm(e,t,n=document){let r=URL.createObjectURL(e),i=n.createElement(`a`);i.href=r,i.download=t,n.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}async function im(e,t){let n=Gp(t);if(e instanceof HTMLCanvasElement){let t=e.width||Math.round(e.getBoundingClientRect().width),r=e.height||Math.round(e.getBoundingClientRect().height);if(!t||!r)return null;let i=document.createElement(`canvas`);i.width=t,i.height=r;let a=i.getContext(`2d`);return a?(a.fillStyle=n,a.fillRect(0,0,t,r),a.drawImage(e,0,0,t,r),i):null}if(e instanceof HTMLImageElement){let t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;return!t||!r?null:sm(e.currentSrc||e.src,t,r,n)}let{width:r,height:i,serialized:a}=am(e);if(!r||!i||!a)return null;let o=new Blob([a],{type:`image/svg+xml;charset=utf-8`}),s=URL.createObjectURL(o);try{return await sm(s,r,i,n)}finally{URL.revokeObjectURL(s)}}function am(e){let t=e.cloneNode(!0),n=e.getBoundingClientRect(),r=e.viewBox?.baseVal,i=Math.round(r?.width||n.width||Number(e.getAttribute(`width`))||0),a=Math.round(r?.height||n.height||Number(e.getAttribute(`height`))||0);return t.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),t.setAttribute(`xmlns:xlink`,`http://www.w3.org/1999/xlink`),!t.getAttribute(`width`)&&i&&t.setAttribute(`width`,String(i)),!t.getAttribute(`height`)&&a&&t.setAttribute(`height`,String(a)),!t.getAttribute(`viewBox`)&&i&&a&&t.setAttribute(`viewBox`,`0 0 ${i} ${a}`),om(e,t),t.querySelectorAll(`.highcharts-tooltip, .highcharts-contextmenu, .highcharts-a11y-proxy-container, .highcharts-a11y-dummy-point`).forEach(e=>e.remove()),{width:i,height:a,serialized:new XMLSerializer().serializeToString(t)}}function om(e,t){let n=getComputedStyle(e),r=``;for(let e=0;e<n.length;e+=1){let t=n[e],i=n.getPropertyValue(t);i&&(r+=`${t}:${i};`)}r&&t.setAttribute(`style`,r);let i=Array.from(e.children),a=Array.from(t.children);for(let e=0;e<i.length;e+=1){let t=i[e],n=a[e];t&&n&&om(t,n)}}async function sm(e,t,n,r){let i=Math.max(1,Math.min(2,window.devicePixelRatio||1)),a=Math.max(1,Math.round(t)),o=Math.max(1,Math.round(n)),s=document.createElement(`canvas`);s.width=Math.max(1,Math.round(a*i)),s.height=Math.max(1,Math.round(o*i));let c=s.getContext(`2d`);if(!c)return null;let l=await cm(e);return l?(c.scale(i,i),c.fillStyle=r,c.fillRect(0,0,a,o),c.drawImage(l,0,0,a,o),s):null}function cm(e){return new Promise(t=>{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>t(n),n.onerror=()=>t(null),n.src=e})}function lm(e,t,n){return new Promise(r=>{e.toBlob(e=>r(e),t,n)})}var um=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;clip:rect(0, 0, 0, 0);clip-path:inset(50%);border:0;`;function dm(e){return e===0?`Radrubrik`:`Kolumn ${e+1}`}function fm(e){return(e??``).replace(/\s+/g,` `).trim()}function pm(e,t,n,r){let i=e.html||n(e.text);return fm(i)?i:`<span class="visually-hidden" style="${um}">${n(r.getEmptyHeaderLabel?.(t)??dm(t))}</span>`}function mm(e,t,n={}){return`<table class="scb-viz-print-table">${e.headers.length?`<thead><tr>${e.headers.map((r,i)=>`<th scope="col" class="${e.alignments[i]===`right`?`align-right`:`align-left`}"><span class="scb-viz-print-table-heading-text">${pm(r,i,t,n)}</span></th>`).join(``)}</tr></thead>`:``}${`<tbody>${e.rows.map((n,r)=>{let i=e.rowHeaderRows[r]===!0;return`<tr>${n.map((n,r)=>{let a=e.alignments[r]===`right`?`align-right`:`align-left`,o=n.html||t(n.text);return r===0&&i?`<th scope="row" class="${a}">${o}</th>`:`<td class="${a}">${o}</td>`}).join(``)}</tr>`}).join(``)}</tbody>`}</table>`}function hm(e){let t=[];if(e.description&&t.push(`
|
|
20782
20788
|
<section class="print-section">
|
|
20783
20789
|
<h2>${e.escapeHtml(e.descriptionLabel)}</h2>
|
|
20784
20790
|
<div class="body-text-rich">${e.renderRichTextHtml(e.description)}</div>
|
|
@@ -20810,7 +20816,7 @@
|
|
|
20810
20816
|
<h2>${e.escapeHtml(e.moreAboutStatsLabel)}</h2>
|
|
20811
20817
|
${n.join(``)}
|
|
20812
20818
|
</section>
|
|
20813
|
-
`)}return t.join(``)}function
|
|
20819
|
+
`)}return t.join(``)}function gm(e){let t=e.escapeHtml;return`<!doctype html>
|
|
20814
20820
|
<html lang="${t(e.lang||`sv`)}">
|
|
20815
20821
|
<head>
|
|
20816
20822
|
<meta charset="utf-8">
|
|
@@ -20832,10 +20838,10 @@
|
|
|
20832
20838
|
--scb-viz-print-table-line-height: 1.5;
|
|
20833
20839
|
--scb-viz-print-table-header-font-weight: var(--weight-bold, 700);
|
|
20834
20840
|
--scb-viz-print-table-row-header-font-weight: var(--weight-regular, 400);
|
|
20835
|
-
--scb-viz-print-background: ${
|
|
20836
|
-
--scb-viz-print-text: ${
|
|
20837
|
-
--scb-viz-print-table-border: ${
|
|
20838
|
-
--scb-viz-print-table-row-stripe: ${
|
|
20841
|
+
--scb-viz-print-background: ${Wp.vizPrintBackground};
|
|
20842
|
+
--scb-viz-print-text: ${Wp.vizPrintText};
|
|
20843
|
+
--scb-viz-print-table-border: ${Wp.vizPrintTableBorder};
|
|
20844
|
+
--scb-viz-print-table-row-stripe: ${Wp.vizPrintTableRowStripe};
|
|
20839
20845
|
}
|
|
20840
20846
|
@page { margin: 16mm; }
|
|
20841
20847
|
* { box-sizing: border-box; }
|
|
@@ -20911,7 +20917,7 @@
|
|
|
20911
20917
|
${e.footerHtml||``}
|
|
20912
20918
|
</article>
|
|
20913
20919
|
</body>
|
|
20914
|
-
</html>`}var
|
|
20920
|
+
</html>`}var _m=new Set([`a`,`b`,`br`,`em`,`i`,`strong`,`sub`,`sup`,`u`]),vm=new Set([`http:`,`https:`,`mailto:`,`tel:`]),ym=new Set([`_blank`,`_self`]),bm=new Set([`nofollow`,`noopener`,`noreferrer`]);function xm(e){let t=(e??``).trim();if(!t)return null;let n=t.replace(/[\u0000-\u0020\u007f-\u009f]/g,``),r=/^[a-z][a-z0-9+.-]*:/i.exec(n)?.[0].toLowerCase();return r&&!vm.has(r)?null:t}function Sm(e){let t=xm(e.getAttribute(`href`)),n=(e.getAttribute(`target`)??``).trim().toLowerCase(),r=(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/).filter(e=>bm.has(e));if(!t){e.removeAttribute(`href`),e.removeAttribute(`target`),e.removeAttribute(`rel`);return}e.setAttribute(`href`,t),ym.has(n)?e.setAttribute(`target`,n):e.removeAttribute(`target`),n===`_blank`&&r.push(`noopener`,`noreferrer`);let i=[...new Set(r)];i.length?e.setAttribute(`rel`,i.join(` `)):e.removeAttribute(`rel`)}function Cm(e){let t=e.trim();if(!t||typeof document>`u`)return;let n=document.createElement(`template`);return n.innerHTML=t,n.content.querySelectorAll(`base, button, embed, form, iframe, input, link, math, meta, object, script, select, style, svg, template, textarea`).forEach(e=>e.remove()),Array.from(n.content.querySelectorAll(`*`)).reverse().forEach(e=>{let t=e.tagName.toLowerCase();if(!_m.has(t)){e.replaceWith(...Array.from(e.childNodes));return}Array.from(e.attributes).forEach(n=>{t===`a`&&[`href`,`rel`,`target`,`title`].includes(n.name.toLowerCase())||e.removeAttribute(n.name)}),t===`a`&&Sm(e)}),n}function wm(e){if(e&&typeof e==`object`&&`html`in e&&`text`in e){let t=typeof e.html==`string`?Cm(e.html):void 0;return{html:t?.innerHTML.trim()??``,text:typeof e.text==`string`?e.text:``,fragment:t?.content}}return{html:``,text:e==null?``:String(e)}}function Tm(e){if(!e)return;let t=e.assignedElements({flatten:!0}),n=[];t.forEach(e=>{if(e.tagName===`TABLE`){n.push(e);return}e.querySelectorAll(`table`).forEach(e=>n.push(e))});let r=n[0];if(!r)return;let i=[],a=[],o=[],s=e=>e?(e.textContent??``).replace(/\s+/g,` `).trim():``,c=e=>{if(!e)return{html:``,text:``};let{html:t,text:n}=wm({html:(e.innerHTML??``).trim(),text:s(e)});return{html:t,text:n}},l=r.querySelector(`thead tr`);l&&Array.from(l.querySelectorAll(`th, td`)).forEach(e=>{i.push(c(e))});let u=Array.from(r.querySelectorAll(`tbody tr`)),d=u.length>0?u:Array.from(r.querySelectorAll(`tr`)).filter(e=>e.closest(`thead`)===null);if(d.forEach(e=>{let t=Array.from(e.querySelectorAll(`th, td`));if(t.length===0)return;o.push(t[0].tagName===`TH`&&e.closest(`thead`)===null&&e.closest(`tfoot`)===null);let n=[];t.forEach(e=>n.push(c(e))),a.push(n)}),!l&&a.length>0){let e=a[0],t=d[0],n=Array.from(t?.querySelectorAll(`th, td`)??[]);n.length>0&&n.every(e=>e.tagName===`TH`)&&t?.closest(`tbody`)===null&&(i.splice(0,i.length,...e),a.shift(),o.shift())}return{headers:i.length>0?i:void 0,rows:a,rowHeaderRows:o.length>0?o:void 0}}function Em(e,t){let n=Math.max(e.headers?.length??0,...e.rows.map(e=>e.length)),r=[];for(let i=0;i<n;i+=1){if(i===0){r.push(`left`);continue}let n=e.rows.map(e=>wm(e[i]).text).filter(e=>e!==``&&e!=null),a=n.length>0&&n.every(e=>t(e)!==null);r.push(a?`right`:`left`)}return r}function Dm(e,t){let n=t.normalizeCell??wm,r=t.formatCell??(e=>n(e)),i=t.inferAlignments(e),a=Math.max(e.headers?.length??0,...e.rows.map(e=>e.length));return{alignments:i,colCount:a,headers:(e.headers??[]).map(e=>n(e)),rows:e.rows.map(e=>{let t=e.map((e,t)=>r(e,t,i));for(;t.length<a;)t.push({html:``,text:``});return t}),rowHeaderRows:e.rowHeaderRows??[]}}function Om(e,t=wm){let n=[];return e.headers?.length&&n.push(e.headers.map(e=>t(e).text)),e.rows.forEach(e=>{n.push(e.map(e=>t(e).text))}),n}w(),b(),yl(),Lu(),dl(),xd(),_d(),P();var km=new Set([`extra-small`,`small`,`medium`,`large`]),Am=new Set([`tiny`,`extra-small`,`small`,`medium`,`large`]),jm=new Set([`small`,`medium`,`large`]),Mm=`<svg version="1.1" id="Lager_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
20915
20921
|
viewBox="0 0 727.3 87.3" style="enable-background:new 0 0 727.3 87.3;" xml:space="preserve" fill="currentColor">
|
|
20916
20922
|
<style type="text/css">
|
|
20917
20923
|
.st0{clip-path:url(#SVGID_00000118375311472882578510000008414848687067442345_);}
|
|
@@ -21026,7 +21032,7 @@
|
|
|
21026
21032
|
<path d="M688.2,24.4h5.8v6h-5.8V24.4z M688.2,36.6h5.8v30.1h-5.8V36.6z"/>
|
|
21027
21033
|
<path d="M701.8,24.4h5.8v26.3h0.1l11.2-14.1h7l-10,11.7l11.4,18.3H720l-7.7-14l-4.6,5.4v8.7h-5.8V24.4H701.8z"/>
|
|
21028
21034
|
</svg>
|
|
21029
|
-
`,
|
|
21035
|
+
`,Nm=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;clip:rect(0, 0, 0, 0);clip-path:inset(50%);border:0;`,Pm=0,$=class extends C{constructor(...e){super(...e),this.variant=`Standard`,this.selectedChip=`Diagram`,this.title=``,this.subtitle=``,this.description=``,this.comment=``,this.source=``,this.sourceDataHref=``,this.sourceDataLinkText=``,this.footnote=``,this.lang=`sv`,this.imageHref=``,this.imageAlt=``,this.officialStatistics=!1,this.disableToggle=!1,this.contentMaxWidth=``,this.containerMaxWidth=``,this.contentHeight=``,this.toggleHeightMode=`stable`,this._actionsMenuOpen=!1,this._seriesDifferentiationEnabled=!1,this._isFullscreen=!1,this._tableDataRefreshFrame=0,this._seriesDifferentiationSnapshots=new WeakMap,this._diagramReflowFrame=0,this._fullscreenDiagramSizingFrame=0,this._fullscreenDiagramHeight=``,this._instanceId=`scb-viz-${++Pm}`,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onDocumentFullscreenChange=()=>{this._syncFullscreenState()},this._onWindowResize=()=>{this._isFullscreen&&this.#c()},this._onToggleFullscreenClick=async()=>{this._closeActionsMenu(),await this._toggleFullscreen()},this._onActionsMenuOpen=()=>{this._actionsMenuOpen=!0,!this._isActionsMenuPinnedForPreview()&&requestAnimationFrame(()=>{this._focusFirstMenuItem()})},this._onActionsMenuClose=()=>{let e=this._actionsMenuOpen;this._actionsMenuOpen=!1,e&&!this._isActionsMenuPinnedForPreview()&&requestAnimationFrame(()=>{this._focusMenuButton()})},this._onDocumentPointerDown=e=>{if(!this._actionsMenuOpen||this._isActionsMenuPinnedForPreview())return;let t=e.composedPath(),n=this.shadowRoot?.querySelector(`.actions-menu`);n&&t.includes(n)||this._closeActionsMenu()},this._onDocumentKeyDown=e=>{!this._actionsMenuOpen||this._isActionsMenuPinnedForPreview()||e.key===`Escape`&&(e.preventDefault(),this._closeActionsMenu(),this._focusMenuButton())},this._onPrintClick=async()=>{this._closeActionsMenu(),await this.#v()},this._onDownloadPngClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await this.#m(`png`))},this._onDownloadJpgClick=async()=>{this._canExportRaster()&&(this._closeActionsMenu(),await this.#m(`jpeg`))},this._onDownloadCsvClick=()=>{this._canExportCsv()&&(this._closeActionsMenu(),this.#y())},this._onToggleSeriesDifferentiationClick=()=>{this._seriesDifferentiationEnabled=!this._seriesDifferentiationEnabled,this._closeActionsMenu(),this.#p()}}applyViewModel(e){if(!e||typeof e!=`object`)throw Error(`scb-viz: ScbVizViewModel måste vara ett objekt.`);if(!e.metadata||typeof e.metadata!=`object`)throw Error(`scb-viz: metadata saknas i ScbVizViewModel.`);if(!e.options||typeof e.options!=`object`)throw Error(`scb-viz: options saknas i ScbVizViewModel.`);if(![`chart`,`table`,`image`].includes(e.selectedView))throw Error(`scb-viz: selectedView är ${JSON.stringify(e.selectedView)}, men måste vara chart, table eller image.`);if(e.selectedView===`table`&&!e.table)throw Error(`scb-viz: selectedView är "table", men table saknas i ScbVizViewModel.`);if(e.selectedView===`image`&&!e.image)throw Error(`scb-viz: selectedView är "image", men image saknas i ScbVizViewModel.`);let t=e.metadata,n=e.options;this.variant=e.selectedView===`image`?`Image`:e.selectedView===`table`&&!n.showViewToggle?`Table`:`Standard`,this.selectedChip=e.selectedView===`chart`?`Diagram`:e.selectedView===`table`?`Table`:null,this.lang=n.language?.trim()||`sv`,this.title=t.title||``,this.subtitle=t.subtitle||``,this.description=t.description||``,this.comment=t.comment||``,this.source=t.source||``,this.sourceDataHref=t.sourceDataHref||``,this.sourceDataLinkText=t.sourceDataLinkText||``,this.footnote=t.footnote||``,this.imageHref=e.image?.src||``,this.imageAlt=e.image?.alt||``,this.officialStatistics=n.officialStatistics,this.disableToggle=!n.showViewToggle,this.contentHeight=n.contentHeight?.trim()||``,this.contentMaxWidth=n.contentMaxWidth?.trim()||``,this.tableData=e.table?.data,this.valueFormat=e.table?.valueFormat,this.timeFormat=e.table?.timeFormat}refreshTableData(){this._readTableDataFromSlot()}get descriptionLabel(){return this.lang===`en`?`Description of the chart`:`Beskrivning av diagrammet`}get moreAboutStatsLabel(){return this.lang===`en`?`More about the statistics`:`Mer om statistiken`}get commentLabel(){return this.lang===`en`?`Comments`:`Kommentar`}get sourceLabel(){return this.lang===`en`?`Source`:`Källa`}get footnoteLabel(){return this.lang===`en`?`Footnotes`:`Fotnot`}get officialStatisticsLabel(){return this.lang===`en`?`Official statistics of Sweden`:`Sveriges officiella statistik`}get officialStatisticsTitle(){return this.lang===`en`?`Part of Official statistics of Sweden`:`Tillhör Sveriges officiella statistik`}get officialStatisticsAlt(){return this.lang===`en`?`Read more about Official statistics of Sweden`:`Läs mer om Sveriges officiella statistik`}get actionsMenuLabel(){return this.lang===`en`?`Open menu`:`Öppna meny`}get printLabel(){return this.lang===`en`?`Print`:`Skriv ut`}get downloadPngLabel(){return this.lang===`en`?`Download PNG`:`Ladda ner PNG`}get downloadJpgLabel(){return this.lang===`en`?`Download JPG`:`Ladda ner JPG`}get downloadCsvLabel(){return this.lang===`en`?`Download CSV`:`Ladda ner CSV`}get enableSeriesDifferentiationLabel(){return this.lang===`en`?`Show symbols and patterns`:`Visa symboler och mönster`}get disableSeriesDifferentiationLabel(){return this.lang===`en`?`Hide symbols and patterns`:`Dölj symboler och mönster`}get enterFullscreenLabel(){return this.lang===`en`?`View fullscreen`:`Visa i helskärm`}get exitFullscreenLabel(){return this.lang===`en`?`Exit fullscreen`:`Avsluta helskärm`}_getImageAltText(){return this.imageAlt||(this.lang===`en`?`Chart image`:`Diagrambild`)}_getTitleId(){return this.title?`${this._instanceId}-title`:void 0}_getSubtitleId(){return this.subtitle?`${this._instanceId}-subtitle`:void 0}_getDescriptionId(){return this.description?`${this._instanceId}-description`:void 0}_getContentAriaLabelledBy(){let e=[this._getTitleId(),this._getSubtitleId()].filter(Boolean);return e.length?e.join(` `):void 0}_getContentAriaDescribedBy(){let e=[this._getDescriptionId()].filter(Boolean);return e.length?e.join(` `):void 0}static{this.styles=p`
|
|
21030
21036
|
:host {
|
|
21031
21037
|
display: block;
|
|
21032
21038
|
box-sizing: border-box;
|
|
@@ -21610,12 +21616,12 @@
|
|
|
21610
21616
|
}
|
|
21611
21617
|
|
|
21612
21618
|
/* design:bindings:scb-viz:end */
|
|
21613
|
-
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onDocumentKeyDown),document.addEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.addEventListener(`resize`,this._onWindowResize),window.visualViewport?.addEventListener(`resize`,this._onWindowResize)}firstUpdated(e){this._scheduleTableDataRefresh(),this.#b(),this.#S(),this.#u(),this._syncChipClass(),this.#e(),this.#r(),this._syncFullscreenState(),this.#c()}updated(e){super.updated(e),(e.has(`selectedChip`)||e.has(`variant`))&&(this._syncChipClass(),this._closeActionsMenu()),e.has(`selectedChip`)&&this._dispatchSelectedChipChanged(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#b(),e.has(`containerMaxWidth`)&&this.#S(),e.has(`variant`)&&this.#e(),(e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`variant`))&&this.#u(),(e.has(`selectedChip`)||e.has(`variant`)||e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`_isFullscreen`))&&this.#r(),(e.has(`selectedChip`)||e.has(`variant`))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#p()}),(e.has(`title`)||e.has(`subtitle`)||e.has(`description`)||e.has(`comment`)||e.has(`source`)||e.has(`sourceDataHref`)||e.has(`sourceDataLinkText`)||e.has(`footnote`)||e.has(`officialStatistics`)||e.has(`selectedChip`)||e.has(`variant`)||e.has(`_isFullscreen`))&&this.#c()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onDocumentKeyDown),document.removeEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.removeEventListener(`resize`,this._onWindowResize),window.visualViewport?.removeEventListener(`resize`,this._onWindowResize),this.#t(),this.#n(),this.#s(),cancelAnimationFrame(this._tableDataRefreshFrame),this._tableDataMutationObserver?.disconnect(),this._tableDataMutationObserver=void 0}_scheduleTableDataRefresh(){cancelAnimationFrame(this._tableDataRefreshFrame),this._tableDataRefreshFrame=requestAnimationFrame(()=>{this._tableDataRefreshFrame=0,this.isConnected&&this._readTableDataFromSlot()})}_onTableSlotChange(e){this._scheduleTableDataRefresh()}_onDiagramSlotChange(){this.#u(),this.#r(),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#p()}),this.requestUpdate()}#e(){if(this.#t(),typeof ResizeObserver>`u`)return;let e=this.shadowRoot?.querySelector(`.diagram-content`);e&&(this._diagramResizeObserver=new ResizeObserver(()=>{this.#r()}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(e))}#t(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}#n(){this._diagramReflowFrame&&=(cancelAnimationFrame(this._diagramReflowFrame),0)}#r(){this.variant!==`Standard`||this.selectedChip!==`Diagram`||(this.#n(),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,this.#o()})}))}#i(e){let t=e?.getAttribute(`data-highcharts-chart`);if(!t)return;let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}#a(e){for(let t of e){let e=this.#i(t);if(e!==void 0)return e;let n=t.querySelector(`[data-highcharts-chart]`),r=this.#i(n);if(r!==void 0)return r}}#o(){if(this.variant!==`Standard`||this.selectedChip!==`Diagram`)return;let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);if(!e)return;let t=e.assignedElements({flatten:!0});if(t.length===0)return;let n=this.#a(t);if(n===void 0)return;let r=window.Highcharts?.charts?.[n];r&&(r.setSize?.(null,null,!1),r.reflow?.(),this._seriesDifferentiationEnabled&&this.#p())}_normalizeRenderableCell(e){return Tm(e)}_readTableDataFromSlot(e){let t=e||this.shadowRoot?.querySelector(`slot[name="table"]`);this._observeTableDataMutations(t),this._slottedTableData=Em(t)}_observeTableDataMutations(e){if(this._tableDataMutationObserver?.disconnect(),this._tableDataMutationObserver=void 0,!e||typeof MutationObserver>`u`)return;let t=e.assignedElements({flatten:!0});t.length&&(this._tableDataMutationObserver=new MutationObserver(()=>{this._scheduleTableDataRefresh()}),t.forEach(e=>{this._tableDataMutationObserver?.observe(e,{childList:!0,characterData:!0,subtree:!0})}))}_inferTableAlignments(e){return Dm(e,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(e){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=String(e).replace(/[ \s]+/g,``).trim();if(!t)return null;t.endsWith(`%`)&&(t=t.slice(0,-1));let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);if(n>-1&&r>-1?t=n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1&&(t=t.replace(`,`,`.`)),!/^-?\d+(?:\.\d+)?$/.test(t))return null;let i=Number(t);return Number.isFinite(i)?i:null}_formatTableCell(e,t,n){let r=this._normalizeRenderableCell(e);if(r.html)return r;let i=r.text;if(!i)return r;if(t===0){let e=this._normalizeTimeFormat(this.timeFormat),t=this._formatCategoryTimeLabel(i,e);return t===null?r:{html:``,text:t}}if(n[t]!==`right`)return r;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let e=this._localizeAutomaticNumericText(i);return e===null?r:{html:``,text:e}}let a=this._parseTableNumericValue(i);if(a===null)return r;let o=this._normalizeValueFormat(this.valueFormat),s=this._formatValueForDisplay(a,o,!0);return s===null?r:{html:``,text:s}}#s(){this._fullscreenDiagramSizingFrame&&=(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),0)}#c(){this.#s(),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,this.#l()})})}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(e){let t=Number.parseFloat(e||`0`);return Number.isFinite(t)?t:0}_getElementOuterHeight(e){let t=this.shadowRoot?.querySelector(e);if(!t)return 0;let n=getComputedStyle(t);return t.getBoundingClientRect().height+this._readCssLength(n.marginTop)+this._readCssLength(n.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!==`Standard`||this.selectedChip!==`Diagram`)return``;let e=this._getViewportHeight();if(!e)return``;let t=getComputedStyle(this),n=this._readCssLength(t.paddingTop)+this._readCssLength(t.paddingBottom)+this._getElementOuterHeight(`.header`)+this._getElementOuterHeight(`.actions-row`)+this._getElementOuterHeight(`.footer`)+16,r=Math.floor(e-n);return!Number.isFinite(r)||r<=0?``:`${Math.max(320,r)}px`}#l(){let e=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==e&&(this._fullscreenDiagramHeight=e,this.#u(),this.#r())}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||``}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||``}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode===`auto`?`auto`:`stable`}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||`600px`}#u(){let e=this.variant===`Standard`?this._getResolvedDiagramHeight():``,t=this.variant===`Standard`&&this._getResolvedToggleHeightMode()===`stable`?this._getResolvedStandardContentHeight():``;this.variant===`Standard`?this.style.setProperty(`--scb-viz-diagram-min-height`,e||`600px`):this.style.removeProperty(`--scb-viz-diagram-min-height`),e?(this.style.setProperty(`--scb-viz-diagram-height`,e),this.style.setProperty(`--scb-viz-diagram-overflow`,`hidden`)):(this.style.removeProperty(`--scb-viz-diagram-height`),this.style.removeProperty(`--scb-viz-diagram-overflow`)),t?this.style.setProperty(`--scb-viz-standard-content-height`,t):this.style.removeProperty(`--scb-viz-standard-content-height`)}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(e){return Om(e,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,t,n)=>this._formatTableCell(e,t,n)})}_getDiagramAssignedElements(){let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);return e?e.assignedElements({flatten:!0}):[]}_findExportableVisualElement(e){for(let t of e){if(t instanceof SVGSVGElement||t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)return t;let e=t.querySelector(`svg, canvas, img`);if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e}return null}_getExportableVisualElement(){if(this.variant===`Table`)return null;if(this.variant===`Image`){let e=this.shadowRoot?.querySelector(`.image-content img`);return e instanceof HTMLImageElement?e:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getDefaultValueFormat(){return{type:`number`,scale:`auto`,decimals:0,decimalSeparator:this.lang===`en`?`.`:`,`}}_normalizeValueFormat(e){let t=this._getDefaultValueFormat(),n=e&&typeof e==`object`?e:{};return{type:[`number`,`currency`,`percent`].includes(String(n.type))?String(n.type):t.type,scale:[`auto`,`raw`,`thousands`,`millions`,`billions`].includes(String(n.scale))?String(n.scale):t.scale,decimals:Number.isFinite(Number(n.decimals))?Math.max(0,Math.min(20,Number(n.decimals))):t.decimals,decimalSeparator:String(n.decimalSeparator)===`.`?`.`:String(n.decimalSeparator)===`,`?`,`:t.decimalSeparator}}_shouldPreserveSourceValueFormatting(e){let t=this._normalizeValueFormat(e);return t.type===`number`&&t.scale===`auto`}_normalizeTimeFormat(e){let t={mode:`raw`,display:`raw`},n=e&&typeof e==`object`?e:{},r=[`raw`,`year`,`monthCode`,`quarterCode`,`weekCode`,`tertialCode`],i=typeof n.mode==`string`?n.mode:t.mode,a=typeof n.display==`string`?n.display:t.display;r.includes(i)||(i=t.mode);let o={raw:[`raw`],year:[`raw`,`year`],monthCode:[`raw`,`iso-month`,`short-month`,`long-month`],quarterCode:[`raw`,`quarter-compact`,`quarter-short`,`quarter-long`],weekCode:[`raw`,`week-compact`,`week-long`],tertialCode:[`raw`,`tertial-compact`,`tertial-short`,`tertial-long`]};return o[i].includes(a)||(a=o[i][0]),i===`raw`&&(a=`raw`),{mode:i,display:a}}_getShortMonthNames(){return[`jan`,`feb`,`mar`,`apr`,`maj`,`jun`,`jul`,`aug`,`sep`,`okt`,`nov`,`dec`]}_getLongMonthNames(){return[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]}_formatCategoryTimeLabel(e,t){if(!e||t.mode===`raw`||t.display===`raw`)return null;if(t.mode===`year`){let t=/^\s*(\d{4})\s*$/.exec(e);return t?t[1]:null}if(t.mode===`monthCode`){let n=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2])-1,i=n[1],a=String(r+1).padStart(2,`0`);return t.display===`iso-month`?`${i}-${a}`:t.display===`short-month`?`${this._getShortMonthNames()[r]} ${i}`:t.display===`long-month`?`${this._getLongMonthNames()[r]} ${i}`:e}if(t.mode===`quarterCode`){let n=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(e);if(!n)return null;let r=Number(n[3]),i=n[1];return t.display===`quarter-compact`?`${i} K${r}`:t.display===`quarter-short`?`kv ${r} ${i}`:t.display===`quarter-long`?`${[`första`,`andra`,`tredje`,`fjärde`][r-1]} kvartalet ${i}`:e}if(t.mode===`weekCode`){let n=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`week-compact`?`${i} v. ${r}`:t.display===`week-long`?`vecka ${r} ${i}`:e}if(t.mode===`tertialCode`){let n=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`tertial-compact`?`${i} T${r}`:t.display===`tertial-short`?`tertial ${r} ${i}`:t.display===`tertial-long`?`${[`första`,`andra`,`tredje`][r-1]} tertialet ${i}`:e}return null}_localizeAutomaticNumericText(e){let t=this._normalizeValueFormat(this.valueFormat),n=String(e??``).trim();if(!n||n===`..`||n===`...`)return null;let r=n.replace(/[ \s]/g,``);if(!/^-?\d+(?:[.,]\d+)?$/.test(r))return null;let i=t.decimalSeparator===`.`?`.`:`,`;return i===`.`&&r.indexOf(`,`)!==-1?r.replace(`,`,`.`):i===`,`&&r.indexOf(`.`)!==-1?r.replace(`.`,`,`):r}_formatLocalizedNumber(e,t,n){let r=new Intl.NumberFormat(this.lang===`en`?`en-GB`:`sv-SE`,{minimumFractionDigits:t,maximumFractionDigits:t}),i=n===`.`||n===`,`?n:this.lang===`en`?`.`:`,`;return r.formatToParts(e).map(e=>e.type===`decimal`?i:e.value).join(``)}_formatValueForDisplay(e,t,n){if(!Number.isFinite(e))return null;let r={raw:1,thousands:1e3,millions:1e6,billions:1e9},i={raw:``,thousands:this.lang===`en`?`k`:`t`,millions:this.lang===`en`?`M`:`mn`,billions:this.lang===`en`?`B`:`md`},a=t.scale;if(a===`auto`){let t=Math.abs(e);a=t>=1e9?`billions`:t>=1e6?`millions`:t>=1e3?`thousands`:`raw`}let o=e/(r[a]||1),s=this._formatLocalizedNumber(o,t.decimals,t.decimalSeparator);t.type===`percent`?s=`${s} %`:t.type===`currency`&&(s=n?`${s} kr`:s);let c=i[a]||``;return c&&(s=`${s} ${c}`),s}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!==`diagram`)return;let e=this.#a(this._getDiagramAssignedElements());if(e!==void 0)return window.Highcharts?.charts?.[e]}_getSeriesDifferentiationGroup(e,t){let n=String(e?.type||e?.options?.type||t?.options?.chart?.type||``).trim().toLowerCase();return[`line`,`spline`,`scatter`].includes(n)?`line`:[`area`,`areaspline`].includes(n)?`area`:[`column`,`bar`].includes(n)?this._isGroupedSeriesDifferentiationChart(e,t)?`grouped-fill`:`fill`:[`pie`,`variablepie`].includes(n)?`point-fill`:null}_getSeriesDifferentiationVariantByIndex(e){return Ep(e)}_isGroupedSeriesDifferentiationChart(e,t){return Dp(e,t)}_usesGroupedPointDifferentiation(e){return Op(e)}_getGroupedSeriesDifferentiationVariant(e,t,n){let r=Np(e,t,n);return{...r,variantIndex:typeof r.variantIndex==`number`?r.variantIndex:n}}_applyGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach((t,n)=>{let r=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(r,e))return;let{variantIndex:i,patternKind:a}=this._getGroupedSeriesDifferentiationVariant(t,e,n),o=this._getHighchartsColorClassName(t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,i);this._getLegendSeriesDifferentiationTargets(t).fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:a}),this._setSeriesDifferentiationColorClass(e,o)}),this._ensureStyledModeSeriesPattern(e,o,a)})}_clearGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach(t=>{let n=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(n,e))return;let r=this._getLegendSeriesDifferentiationTargets(t);r.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),r.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})})}_shouldShowSeriesDifferentiationAction(){return Pp({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(e,t)=>this._getSeriesDifferentiationGroup(e,t),isHighchartsStyledMode:e=>this._isHighchartsStyledMode(e)})}_getSeriesDifferentiationSnapshotStore(e){let t=this._seriesDifferentiationSnapshots.get(e);return t||(t=new Map,this._seriesDifferentiationSnapshots.set(e,t)),t}_cloneSeriesOptionValue(e){return Array.isArray(e)?e.map(e=>this._cloneSeriesOptionValue(e)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this._cloneSeriesOptionValue(t)])):e}_captureSeriesDifferentiationSnapshot(e){let t=this._cloneSeriesOptionValue(e?.options?.marker),n=this._cloneSeriesOptionValue(e?.resetA11yMarkerOptions),r=this._cloneSeriesOptionValue(e?.userOptions?.marker),i=t?.states,a=e?.a11yMarkersForced===!0&&n&&Object.keys(n).length>0||i?.normal?.opacity===0&&n&&Object.keys(n).length>0?n:r;return{marker:a&&Object.keys(a).length>0?a:t&&Object.keys(t).length>0?t:{enabled:!1}}}_isHighchartsStyledMode(e){return Ip(e)}_getHighchartsSvgRoot(e){return Lp(e)}_getHighchartsColorClassName(e,t){return Rp(e,t)}_setSeriesDifferentiationMetadata(e,t){zp(e,t)}_clearSeriesDifferentiationMetadata(e){Bp(e)}_setSeriesDifferentiationColorClass(e,t){Vp(e,t)}_clearSeriesDifferentiationColorClass(e){Hp(e)}_getLegendSeriesDifferentiationTargets(e){return Up(e)}_ensureStyledModeSeriesPattern(e,t,n){Wp(e,t,n)}_applyStyledModeSeriesDifferentiation(e){let t=this._getHighchartsSvgRoot(e);if(!t)return;t.classList.add(`scb-viz-series-differentiation-enabled`);let n=Sp(),r=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((t,i)=>{let a=this._getSeriesDifferentiationGroup(t,e);if(!a)return;let o=String(t?.index??i);r.has(o)||r.set(o,this._captureSeriesDifferentiationSnapshot(t));let s=a===`grouped-fill`&&this._usesGroupedPointDifferentiation(t),c=a===`grouped-fill`?this._getGroupedSeriesDifferentiationVariant(t,e,i):{variantIndex:i,...this._getSeriesDifferentiationVariantByIndex(i)},{dashStyle:l,markerSymbol:u,patternKind:d}=c,f=this._getHighchartsColorClassName(t?.graph??t?.area??t?.group,c.variantIndex),p=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graph,{role:`graph`,dashStyle:l}),a===`area`&&(this._setSeriesDifferentiationMetadata(t?.area,{role:`area`,patternKind:d}),this._setSeriesDifferentiationColorClass(t?.area,f),this._ensureStyledModeSeriesPattern(e,f,d)),a===`fill`&&(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d)),a===`grouped-fill`&&(s?t.points?.forEach((t,n)=>{let r=this._getGroupedSeriesDifferentiationVariant(t,e,n),i=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r.variantIndex);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:r.patternKind}),this._setSeriesDifferentiationColorClass(t?.graphic,i),this._ensureStyledModeSeriesPattern(e,i,r.patternKind)}):(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d))),a===`point-fill`&&t.points?.forEach((t,r)=>{let i=n[r%n.length],a=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r),o=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(t?.graphic,a),this._ensureStyledModeSeriesPattern(e,a,i),o.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(e,a)})}),(a===`line`||a===`area`)&&p.graphTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-symbol`,dashStyle:l})}),(a===`area`||a===`fill`||a===`grouped-fill`&&!s)&&p.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e,f)}),(a===`line`||a===`area`)&&t.update({marker:{enabled:!0,symbol:u}},!1)}),this._applyGroupedLegendSeriesDifferentiation(e),e.redraw(!1)}_restoreStyledModeSeriesDifferentiation(e){this._getHighchartsSvgRoot(e)?.classList.remove(`scb-viz-series-differentiation-enabled`);let t=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((n,r)=>{let i=this._getSeriesDifferentiationGroup(n,e);if(!i)return;let a=this._getLegendSeriesDifferentiationTargets(n);if(this._clearSeriesDifferentiationMetadata(n?.graph),this._clearSeriesDifferentiationMetadata(n?.area),this._clearSeriesDifferentiationColorClass(n?.area),n.points?.forEach(e=>{let t=this._getLegendSeriesDifferentiationTargets(e);this._clearSeriesDifferentiationMetadata(e?.graphic),this._clearSeriesDifferentiationColorClass(e?.graphic),t.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),t.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})}),a.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),a.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)}),i===`line`||i===`area`){let e=t.get(String(n?.index??r));n.update({marker:this._cloneSeriesOptionValue(e?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(e),e.redraw(!1),this._seriesDifferentiationSnapshots.delete(e)}#d(e){this._isHighchartsStyledMode(e)&&this._applyStyledModeSeriesDifferentiation(e)}#f(e){this._isHighchartsStyledMode(e)&&this._restoreStyledModeSeriesDifferentiation(e)}#p(){let e=this._getCurrentHighchartsChart();if(e){if(this._seriesDifferentiationEnabled){this.#d(e);return}this.#f(e)}}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getInternalComponentSize(e,t,n){let r=getComputedStyle(this).getPropertyValue(e).trim();return n.has(r)?r:t}_buildExportFileName(e){return Jp({lang:this.lang,title:this.title},e)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return Xp()}_isFullscreenSupported(){return Zp(this._getFullscreenTarget())}_syncFullscreenState(){let e=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=e,this.toggleAttribute(`data-scb-viz-fullscreen`,e),this.#c(),this.#r()}async _toggleFullscreen(){await Qp(this._getFullscreenTarget())}_renderActionsMenu(){let e=this._getCurrentPrintableView(),t=this._canExportRaster(),n=this._canExportCsv(),r=t&&(e===`diagram`||e===`image`),i=n&&e===`table`,a=this._shouldShowSeriesDifferentiationAction(),o=`${this._instanceId}-actions-menu`;return x`
|
|
21619
|
+
`}connectedCallback(){super.connectedCallback(),document.addEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.addEventListener(`keydown`,this._onDocumentKeyDown),document.addEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.addEventListener(`resize`,this._onWindowResize),window.visualViewport?.addEventListener(`resize`,this._onWindowResize)}firstUpdated(e){this._scheduleTableDataRefresh(),this.#b(),this.#S(),this.#u(),this._syncChipClass(),this.#e(),this.#r(),this._syncFullscreenState(),this.#c()}updated(e){super.updated(e),(e.has(`selectedChip`)||e.has(`variant`))&&(this._syncChipClass(),this._closeActionsMenu()),e.has(`selectedChip`)&&this._dispatchSelectedChipChanged(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#b(),e.has(`containerMaxWidth`)&&this.#S(),e.has(`variant`)&&this.#e(),(e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`variant`))&&this.#u(),(e.has(`selectedChip`)||e.has(`variant`)||e.has(`contentMaxWidth`)||e.has(`contentHeight`)||e.has(`toggleHeightMode`)||e.has(`_isFullscreen`))&&this.#r(),(e.has(`selectedChip`)||e.has(`variant`))&&this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#p()}),(e.has(`title`)||e.has(`subtitle`)||e.has(`description`)||e.has(`comment`)||e.has(`source`)||e.has(`sourceDataHref`)||e.has(`sourceDataLinkText`)||e.has(`footnote`)||e.has(`officialStatistics`)||e.has(`selectedChip`)||e.has(`variant`)||e.has(`_isFullscreen`))&&this.#c()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`pointerdown`,this._onDocumentPointerDown,!0),document.removeEventListener(`keydown`,this._onDocumentKeyDown),document.removeEventListener(`fullscreenchange`,this._onDocumentFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onDocumentFullscreenChange),window.removeEventListener(`resize`,this._onWindowResize),window.visualViewport?.removeEventListener(`resize`,this._onWindowResize),this.#t(),this.#n(),this.#s(),cancelAnimationFrame(this._tableDataRefreshFrame),this._tableDataMutationObserver?.disconnect(),this._tableDataMutationObserver=void 0}_scheduleTableDataRefresh(){cancelAnimationFrame(this._tableDataRefreshFrame),this._tableDataRefreshFrame=requestAnimationFrame(()=>{this._tableDataRefreshFrame=0,this.isConnected&&this._readTableDataFromSlot()})}_onTableSlotChange(e){this._scheduleTableDataRefresh()}_onDiagramSlotChange(){this.#u(),this.#r(),this._seriesDifferentiationEnabled&&requestAnimationFrame(()=>{this.#p()}),this.requestUpdate()}#e(){if(this.#t(),typeof ResizeObserver>`u`)return;let e=this.shadowRoot?.querySelector(`.diagram-content`);e&&(this._diagramResizeObserver=new ResizeObserver(()=>{this.#r()}),this._diagramResizeObserver.observe(this),this._diagramResizeObserver.observe(e))}#t(){this._diagramResizeObserver?.disconnect(),this._diagramResizeObserver=void 0}#n(){this._diagramReflowFrame&&=(cancelAnimationFrame(this._diagramReflowFrame),0)}#r(){this.variant!==`Standard`||this.selectedChip!==`Diagram`||(this.#n(),this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=requestAnimationFrame(()=>{this._diagramReflowFrame=0,this.#o()})}))}#i(e){let t=e?.getAttribute(`data-highcharts-chart`);if(!t)return;let n=Number.parseInt(t,10);return Number.isNaN(n)?void 0:n}#a(e){for(let t of e){let e=this.#i(t);if(e!==void 0)return e;let n=t.querySelector(`[data-highcharts-chart]`),r=this.#i(n);if(r!==void 0)return r}}#o(){if(this.variant!==`Standard`||this.selectedChip!==`Diagram`)return;let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);if(!e)return;let t=e.assignedElements({flatten:!0});if(t.length===0)return;let n=this.#a(t);if(n===void 0)return;let r=window.Highcharts?.charts?.[n];r&&(r.setSize?.(null,null,!1),r.reflow?.(),this._seriesDifferentiationEnabled&&this.#p())}_normalizeRenderableCell(e){return wm(e)}_readTableDataFromSlot(e){let t=e||this.shadowRoot?.querySelector(`slot[name="table"]`);this._observeTableDataMutations(t),this._slottedTableData=Tm(t)}_observeTableDataMutations(e){if(this._tableDataMutationObserver?.disconnect(),this._tableDataMutationObserver=void 0,!e||typeof MutationObserver>`u`)return;let t=e.assignedElements({flatten:!0});t.length&&(this._tableDataMutationObserver=new MutationObserver(()=>{this._scheduleTableDataRefresh()}),t.forEach(e=>{this._tableDataMutationObserver?.observe(e,{childList:!0,characterData:!0,subtree:!0})}))}_inferTableAlignments(e){return Em(e,e=>this._parseTableNumericValue(e))}_parseTableNumericValue(e){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let t=String(e).replace(/[ \s]+/g,``).trim();if(!t)return null;t.endsWith(`%`)&&(t=t.slice(0,-1));let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);if(n>-1&&r>-1?t=n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1&&(t=t.replace(`,`,`.`)),!/^-?\d+(?:\.\d+)?$/.test(t))return null;let i=Number(t);return Number.isFinite(i)?i:null}_formatTableCell(e,t,n){let r=this._normalizeRenderableCell(e);if(r.html)return r;let i=r.text;if(!i)return r;if(t===0){let e=this._normalizeTimeFormat(this.timeFormat),t=this._formatCategoryTimeLabel(i,e);return t===null?r:{html:``,text:t}}if(n[t]!==`right`)return r;if(this._shouldPreserveSourceValueFormatting(this.valueFormat)){let e=this._localizeAutomaticNumericText(i);return e===null?r:{html:``,text:e}}let a=this._parseTableNumericValue(i);if(a===null)return r;let o=this._normalizeValueFormat(this.valueFormat),s=this._formatValueForDisplay(a,o,!0);return s===null?r:{html:``,text:s}}#s(){this._fullscreenDiagramSizingFrame&&=(cancelAnimationFrame(this._fullscreenDiagramSizingFrame),0)}#c(){this.#s(),this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=requestAnimationFrame(()=>{this._fullscreenDiagramSizingFrame=0,this.#l()})})}_getViewportHeight(){return Math.round(window.visualViewport?.height||window.innerHeight||document.documentElement.clientHeight||0)}_readCssLength(e){let t=Number.parseFloat(e||`0`);return Number.isFinite(t)?t:0}_getElementOuterHeight(e){let t=this.shadowRoot?.querySelector(e);if(!t)return 0;let n=getComputedStyle(t);return t.getBoundingClientRect().height+this._readCssLength(n.marginTop)+this._readCssLength(n.marginBottom)}_getFullscreenDiagramHeight(){if(!this._isFullscreen||this.variant!==`Standard`||this.selectedChip!==`Diagram`)return``;let e=this._getViewportHeight();if(!e)return``;let t=getComputedStyle(this),n=this._readCssLength(t.paddingTop)+this._readCssLength(t.paddingBottom)+this._getElementOuterHeight(`.header`)+this._getElementOuterHeight(`.actions-row`)+this._getElementOuterHeight(`.footer`)+16,r=Math.floor(e-n);return!Number.isFinite(r)||r<=0?``:`${Math.max(320,r)}px`}#l(){let e=this._getFullscreenDiagramHeight();this._fullscreenDiagramHeight!==e&&(this._fullscreenDiagramHeight=e,this.#u(),this.#r())}_getResolvedContentMaxWidth(){return this.contentMaxWidth?.trim()||``}_getResolvedDiagramHeight(){return this._fullscreenDiagramHeight||this.contentHeight?.trim()||``}_getResolvedDiagramScrollerWidth(){return this._getResolvedContentMaxWidth()}_getResolvedToggleHeightMode(){return this.toggleHeightMode===`auto`?`auto`:`stable`}_getResolvedStandardContentHeight(){return this._getResolvedDiagramHeight()||`600px`}#u(){let e=this.variant===`Standard`?this._getResolvedDiagramHeight():``,t=this.variant===`Standard`&&this._getResolvedToggleHeightMode()===`stable`?this._getResolvedStandardContentHeight():``;this.variant===`Standard`?this.style.setProperty(`--scb-viz-diagram-min-height`,e||`600px`):this.style.removeProperty(`--scb-viz-diagram-min-height`),e?(this.style.setProperty(`--scb-viz-diagram-height`,e),this.style.setProperty(`--scb-viz-diagram-overflow`,`hidden`)):(this.style.removeProperty(`--scb-viz-diagram-height`),this.style.removeProperty(`--scb-viz-diagram-overflow`)),t?this.style.setProperty(`--scb-viz-standard-content-height`,t):this.style.removeProperty(`--scb-viz-standard-content-height`)}_getResolvedTableData(){return this.tableData??this._slottedTableData}_getResolvedTableView(e){return Dm(e,{inferAlignments:e=>this._inferTableAlignments(e),normalizeCell:e=>this._normalizeRenderableCell(e),formatCell:(e,t,n)=>this._formatTableCell(e,t,n)})}_getDiagramAssignedElements(){let e=this.shadowRoot?.querySelector(`slot[name="diagram"]`);return e?e.assignedElements({flatten:!0}):[]}_findExportableVisualElement(e){for(let t of e){if(t instanceof SVGSVGElement||t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)return t;let e=t.querySelector(`svg, canvas, img`);if(e instanceof SVGSVGElement||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)return e}return null}_getExportableVisualElement(){if(this.variant===`Table`)return null;if(this.variant===`Image`){let e=this.shadowRoot?.querySelector(`.image-content img`);return e instanceof HTMLImageElement?e:null}return this._findExportableVisualElement(this._getDiagramAssignedElements())}_getDefaultValueFormat(){return{type:`number`,scale:`auto`,decimals:0,decimalSeparator:this.lang===`en`?`.`:`,`}}_normalizeValueFormat(e){let t=this._getDefaultValueFormat(),n=e&&typeof e==`object`?e:{};return{type:[`number`,`currency`,`percent`].includes(String(n.type))?String(n.type):t.type,scale:[`auto`,`raw`,`thousands`,`millions`,`billions`].includes(String(n.scale))?String(n.scale):t.scale,decimals:Number.isFinite(Number(n.decimals))?Math.max(0,Math.min(20,Number(n.decimals))):t.decimals,decimalSeparator:String(n.decimalSeparator)===`.`?`.`:String(n.decimalSeparator)===`,`?`,`:t.decimalSeparator}}_shouldPreserveSourceValueFormatting(e){let t=this._normalizeValueFormat(e);return t.type===`number`&&t.scale===`auto`}_normalizeTimeFormat(e){let t={mode:`raw`,display:`raw`},n=e&&typeof e==`object`?e:{},r=[`raw`,`year`,`monthCode`,`quarterCode`,`weekCode`,`tertialCode`],i=typeof n.mode==`string`?n.mode:t.mode,a=typeof n.display==`string`?n.display:t.display;r.includes(i)||(i=t.mode);let o={raw:[`raw`],year:[`raw`,`year`],monthCode:[`raw`,`iso-month`,`short-month`,`long-month`],quarterCode:[`raw`,`quarter-compact`,`quarter-short`,`quarter-long`],weekCode:[`raw`,`week-compact`,`week-long`],tertialCode:[`raw`,`tertial-compact`,`tertial-short`,`tertial-long`]};return o[i].includes(a)||(a=o[i][0]),i===`raw`&&(a=`raw`),{mode:i,display:a}}_getShortMonthNames(){return[`jan`,`feb`,`mar`,`apr`,`maj`,`jun`,`jul`,`aug`,`sep`,`okt`,`nov`,`dec`]}_getLongMonthNames(){return[`januari`,`februari`,`mars`,`april`,`maj`,`juni`,`juli`,`augusti`,`september`,`oktober`,`november`,`december`]}_formatCategoryTimeLabel(e,t){if(!e||t.mode===`raw`||t.display===`raw`)return null;if(t.mode===`year`){let t=/^\s*(\d{4})\s*$/.exec(e);return t?t[1]:null}if(t.mode===`monthCode`){let n=/^\s*(\d{4})M(0?[1-9]|1[0-2])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2])-1,i=n[1],a=String(r+1).padStart(2,`0`);return t.display===`iso-month`?`${i}-${a}`:t.display===`short-month`?`${this._getShortMonthNames()[r]} ${i}`:t.display===`long-month`?`${this._getLongMonthNames()[r]} ${i}`:e}if(t.mode===`quarterCode`){let n=/^\s*(\d{4})(?:K(V)?|Q)(0?[1-4])\s*$/i.exec(e);if(!n)return null;let r=Number(n[3]),i=n[1];return t.display===`quarter-compact`?`${i} K${r}`:t.display===`quarter-short`?`kv ${r} ${i}`:t.display===`quarter-long`?`${[`första`,`andra`,`tredje`,`fjärde`][r-1]} kvartalet ${i}`:e}if(t.mode===`weekCode`){let n=/^\s*(\d{4})(?:V|W)(0?[1-9]|[1-4][0-9]|5[0-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`week-compact`?`${i} v. ${r}`:t.display===`week-long`?`vecka ${r} ${i}`:e}if(t.mode===`tertialCode`){let n=/^\s*(\d{4})T(0?[1-3])\s*$/i.exec(e);if(!n)return null;let r=Number(n[2]),i=n[1];return t.display===`tertial-compact`?`${i} T${r}`:t.display===`tertial-short`?`tertial ${r} ${i}`:t.display===`tertial-long`?`${[`första`,`andra`,`tredje`][r-1]} tertialet ${i}`:e}return null}_localizeAutomaticNumericText(e){let t=this._normalizeValueFormat(this.valueFormat),n=String(e??``).trim();if(!n||n===`..`||n===`...`)return null;let r=n.replace(/[ \s]/g,``);if(!/^-?\d+(?:[.,]\d+)?$/.test(r))return null;let i=t.decimalSeparator===`.`?`.`:`,`;return i===`.`&&r.indexOf(`,`)!==-1?r.replace(`,`,`.`):i===`,`&&r.indexOf(`.`)!==-1?r.replace(`.`,`,`):r}_formatLocalizedNumber(e,t,n){let r=new Intl.NumberFormat(this.lang===`en`?`en-GB`:`sv-SE`,{minimumFractionDigits:t,maximumFractionDigits:t}),i=n===`.`||n===`,`?n:this.lang===`en`?`.`:`,`;return r.formatToParts(e).map(e=>e.type===`decimal`?i:e.value).join(``)}_formatValueForDisplay(e,t,n){if(!Number.isFinite(e))return null;let r={raw:1,thousands:1e3,millions:1e6,billions:1e9},i={raw:``,thousands:this.lang===`en`?`k`:`t`,millions:this.lang===`en`?`M`:`mn`,billions:this.lang===`en`?`B`:`md`},a=t.scale;if(a===`auto`){let t=Math.abs(e);a=t>=1e9?`billions`:t>=1e6?`millions`:t>=1e3?`thousands`:`raw`}let o=e/(r[a]||1),s=this._formatLocalizedNumber(o,t.decimals,t.decimalSeparator);t.type===`percent`?s=`${s} %`:t.type===`currency`&&(s=n?`${s} kr`:s);let c=i[a]||``;return c&&(s=`${s} ${c}`),s}_getCurrentHighchartsChart(){if(this._getCurrentPrintableView()!==`diagram`)return;let e=this.#a(this._getDiagramAssignedElements());if(e!==void 0)return window.Highcharts?.charts?.[e]}_getSeriesDifferentiationGroup(e,t){let n=String(e?.type||e?.options?.type||t?.options?.chart?.type||``).trim().toLowerCase();return[`line`,`spline`,`scatter`].includes(n)?`line`:[`area`,`areaspline`].includes(n)?`area`:[`column`,`bar`].includes(n)?this._isGroupedSeriesDifferentiationChart(e,t)?`grouped-fill`:`fill`:[`pie`,`variablepie`].includes(n)?`point-fill`:null}_getSeriesDifferentiationVariantByIndex(e){return Tp(e)}_isGroupedSeriesDifferentiationChart(e,t){return Ep(e,t)}_usesGroupedPointDifferentiation(e){return Dp(e)}_getGroupedSeriesDifferentiationVariant(e,t,n){let r=Mp(e,t,n);return{...r,variantIndex:typeof r.variantIndex==`number`?r.variantIndex:n}}_applyGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach((t,n)=>{let r=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(r,e))return;let{variantIndex:i,patternKind:a}=this._getGroupedSeriesDifferentiationVariant(t,e,n),o=this._getHighchartsColorClassName(t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,i);this._getLegendSeriesDifferentiationTargets(t).fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:a}),this._setSeriesDifferentiationColorClass(e,o)}),this._ensureStyledModeSeriesPattern(e,o,a)})}_clearGroupedLegendSeriesDifferentiation(e){(Array.isArray(e?.legend?.allItems)?e.legend.allItems:[]).forEach(t=>{let n=t&&t.series?t.series:t;if(!this._isGroupedSeriesDifferentiationChart(n,e))return;let r=this._getLegendSeriesDifferentiationTargets(t);r.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),r.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})})}_shouldShowSeriesDifferentiationAction(){return Np({chart:this._getCurrentHighchartsChart(),getCurrentPrintableView:()=>this._getCurrentPrintableView(),getSeriesDifferentiationGroup:(e,t)=>this._getSeriesDifferentiationGroup(e,t),isHighchartsStyledMode:e=>this._isHighchartsStyledMode(e)})}_getSeriesDifferentiationSnapshotStore(e){let t=this._seriesDifferentiationSnapshots.get(e);return t||(t=new Map,this._seriesDifferentiationSnapshots.set(e,t)),t}_cloneSeriesOptionValue(e){return Array.isArray(e)?e.map(e=>this._cloneSeriesOptionValue(e)):e&&typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this._cloneSeriesOptionValue(t)])):e}_captureSeriesDifferentiationSnapshot(e){let t=this._cloneSeriesOptionValue(e?.options?.marker),n=this._cloneSeriesOptionValue(e?.resetA11yMarkerOptions),r=this._cloneSeriesOptionValue(e?.userOptions?.marker),i=t?.states,a=e?.a11yMarkersForced===!0&&n&&Object.keys(n).length>0||i?.normal?.opacity===0&&n&&Object.keys(n).length>0?n:r;return{marker:a&&Object.keys(a).length>0?a:t&&Object.keys(t).length>0?t:{enabled:!1}}}_isHighchartsStyledMode(e){return Fp(e)}_getHighchartsSvgRoot(e){return Ip(e)}_getHighchartsColorClassName(e,t){return Lp(e,t)}_setSeriesDifferentiationMetadata(e,t){Rp(e,t)}_clearSeriesDifferentiationMetadata(e){zp(e)}_setSeriesDifferentiationColorClass(e,t){Bp(e,t)}_clearSeriesDifferentiationColorClass(e){Vp(e)}_getLegendSeriesDifferentiationTargets(e){return Hp(e)}_ensureStyledModeSeriesPattern(e,t,n){Up(e,t,n)}_applyStyledModeSeriesDifferentiation(e){let t=this._getHighchartsSvgRoot(e);if(!t)return;t.classList.add(`scb-viz-series-differentiation-enabled`);let n=xp(),r=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((t,i)=>{let a=this._getSeriesDifferentiationGroup(t,e);if(!a)return;let o=String(t?.index??i);r.has(o)||r.set(o,this._captureSeriesDifferentiationSnapshot(t));let s=a===`grouped-fill`&&this._usesGroupedPointDifferentiation(t),c=a===`grouped-fill`?this._getGroupedSeriesDifferentiationVariant(t,e,i):{variantIndex:i,...this._getSeriesDifferentiationVariantByIndex(i)},{dashStyle:l,markerSymbol:u,patternKind:d}=c,f=this._getHighchartsColorClassName(t?.graph??t?.area??t?.group,c.variantIndex),p=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graph,{role:`graph`,dashStyle:l}),a===`area`&&(this._setSeriesDifferentiationMetadata(t?.area,{role:`area`,patternKind:d}),this._setSeriesDifferentiationColorClass(t?.area,f),this._ensureStyledModeSeriesPattern(e,f,d)),a===`fill`&&(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d)),a===`grouped-fill`&&(s?t.points?.forEach((t,n)=>{let r=this._getGroupedSeriesDifferentiationVariant(t,e,n),i=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r.variantIndex);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:r.patternKind}),this._setSeriesDifferentiationColorClass(t?.graphic,i),this._ensureStyledModeSeriesPattern(e,i,r.patternKind)}):(t.points?.forEach(e=>{this._setSeriesDifferentiationMetadata(e?.graphic,{role:`fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e?.graphic,f)}),this._ensureStyledModeSeriesPattern(e,f,d))),a===`point-fill`&&t.points?.forEach((t,r)=>{let i=n[r%n.length],a=this._getHighchartsColorClassName(t?.graphic??t?.legendSymbol??t?.legendItem?.symbol??t?.legendItem?.group,r),o=this._getLegendSeriesDifferentiationTargets(t);this._setSeriesDifferentiationMetadata(t?.graphic,{role:`fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(t?.graphic,a),this._ensureStyledModeSeriesPattern(e,a,i),o.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:i}),this._setSeriesDifferentiationColorClass(e,a)})}),(a===`line`||a===`area`)&&p.graphTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-symbol`,dashStyle:l})}),(a===`area`||a===`fill`||a===`grouped-fill`&&!s)&&p.fillTargets.forEach(e=>{this._setSeriesDifferentiationMetadata(e,{role:`legend-fill`,patternKind:d}),this._setSeriesDifferentiationColorClass(e,f)}),(a===`line`||a===`area`)&&t.update({marker:{enabled:!0,symbol:u}},!1)}),this._applyGroupedLegendSeriesDifferentiation(e),e.redraw(!1)}_restoreStyledModeSeriesDifferentiation(e){this._getHighchartsSvgRoot(e)?.classList.remove(`scb-viz-series-differentiation-enabled`);let t=this._getSeriesDifferentiationSnapshotStore(e);e.series?.forEach((n,r)=>{let i=this._getSeriesDifferentiationGroup(n,e);if(!i)return;let a=this._getLegendSeriesDifferentiationTargets(n);if(this._clearSeriesDifferentiationMetadata(n?.graph),this._clearSeriesDifferentiationMetadata(n?.area),this._clearSeriesDifferentiationColorClass(n?.area),n.points?.forEach(e=>{let t=this._getLegendSeriesDifferentiationTargets(e);this._clearSeriesDifferentiationMetadata(e?.graphic),this._clearSeriesDifferentiationColorClass(e?.graphic),t.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),t.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)})}),a.graphTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e)}),a.fillTargets.forEach(e=>{this._clearSeriesDifferentiationMetadata(e),this._clearSeriesDifferentiationColorClass(e)}),i===`line`||i===`area`){let e=t.get(String(n?.index??r));n.update({marker:this._cloneSeriesOptionValue(e?.marker)},!1)}}),this._clearGroupedLegendSeriesDifferentiation(e),e.redraw(!1),this._seriesDifferentiationSnapshots.delete(e)}#d(e){this._isHighchartsStyledMode(e)&&this._applyStyledModeSeriesDifferentiation(e)}#f(e){this._isHighchartsStyledMode(e)&&this._restoreStyledModeSeriesDifferentiation(e)}#p(){let e=this._getCurrentHighchartsChart();if(e){if(this._seriesDifferentiationEnabled){this.#d(e);return}this.#f(e)}}_canExportRaster(){return this._getExportableVisualElement()!==null}_canExportCsv(){return!!this._getResolvedTableData()?.rows?.length}_getInternalComponentSize(e,t,n){let r=getComputedStyle(this).getPropertyValue(e).trim();return n.has(r)?r:t}_buildExportFileName(e){return qp({lang:this.lang,title:this.title},e)}_getFullscreenTarget(){return this}_getCurrentFullscreenElement(){return Yp()}_isFullscreenSupported(){return Xp(this._getFullscreenTarget())}_syncFullscreenState(){let e=this._getCurrentFullscreenElement()===this._getFullscreenTarget();this._isFullscreen=e,this.toggleAttribute(`data-scb-viz-fullscreen`,e),this.#c(),this.#r()}async _toggleFullscreen(){await Zp(this._getFullscreenTarget())}_renderActionsMenu(){let e=this._getCurrentPrintableView(),t=this._canExportRaster(),n=this._canExportCsv(),r=t&&(e===`diagram`||e===`image`),i=n&&e===`table`,a=this._shouldShowSeriesDifferentiationAction(),o=`${this._instanceId}-actions-menu`;return x`
|
|
21614
21620
|
<div class="actions-menu">
|
|
21615
21621
|
<scb-icon-button
|
|
21616
21622
|
icon="more_vert"
|
|
21617
21623
|
variant="outlined"
|
|
21618
|
-
size=${this._getInternalComponentSize(`--scb-viz-design-actions-icon-button-size-medium`,`small`,
|
|
21624
|
+
size=${this._getInternalComponentSize(`--scb-viz-design-actions-icon-button-size-medium`,`small`,Am)}
|
|
21619
21625
|
label=${this.actionsMenuLabel}
|
|
21620
21626
|
title=${this.actionsMenuLabel}
|
|
21621
21627
|
aria-label=${this.actionsMenuLabel}
|
|
@@ -21625,7 +21631,7 @@
|
|
|
21625
21631
|
></scb-icon-button>
|
|
21626
21632
|
<scb-options-menu
|
|
21627
21633
|
id=${o}
|
|
21628
|
-
size=${this._getInternalComponentSize(`--scb-viz-design-options-menu-size-medium`,`small`,
|
|
21634
|
+
size=${this._getInternalComponentSize(`--scb-viz-design-options-menu-size-medium`,`small`,jm)}
|
|
21629
21635
|
?open=${this._actionsMenuOpen}
|
|
21630
21636
|
aria-label=${this.actionsMenuLabel}
|
|
21631
21637
|
@open=${this._onActionsMenuOpen}
|
|
@@ -21682,7 +21688,7 @@
|
|
|
21682
21688
|
${this.variant===`Standard`&&!this.disableToggle?x`
|
|
21683
21689
|
<div class="flipp-wrapper">
|
|
21684
21690
|
<scb-segmented-button
|
|
21685
|
-
size=${this._getInternalComponentSize(`--scb-viz-design-segmented-button-size-medium`,`small`,
|
|
21691
|
+
size=${this._getInternalComponentSize(`--scb-viz-design-segmented-button-size-medium`,`small`,km)}
|
|
21686
21692
|
.value=${this.selectedChip||``}
|
|
21687
21693
|
@change=${e=>this._onSegmentedChange(e)}
|
|
21688
21694
|
>
|
|
@@ -21713,9 +21719,9 @@
|
|
|
21713
21719
|
</div>
|
|
21714
21720
|
`:t}_renderTable(){let e=this._getResolvedTableData();if(!e||!e.rows||e.rows.length===0)return null;let t=this._getResolvedTableView(e),n=[this.title,this.subtitle].map(e=>typeof e==`string`?e.trim():``).filter(Boolean).join(`. `),r=({html:e,text:t})=>[e,t],i=JSON.stringify([t.headers.map(r),t.rows.map(e=>e.map(r)),t.alignments,t.rowHeaderRows]);return x`
|
|
21715
21721
|
<scb-table part="table" column-width-mode="header">
|
|
21716
|
-
${
|
|
21722
|
+
${pp([n,this.lang,i],()=>this._createTable(t,n))}
|
|
21717
21723
|
</scb-table>
|
|
21718
|
-
`}_createTable({alignments:e,headers:t,rows:n,rowHeaderRows:r},i){let a=this.ownerDocument.createElement(`table`);if(a.className=`scb-viz-table`,i){let e=a.createCaption();e.className=`visually-hidden`,e.textContent=i}if(t.length){let n=a.createTHead().insertRow();t.forEach((t,r)=>{let i=this._createTableCell(t,e[r],`col`);if(!t.html&&!t.text.trim()){let e=this.ownerDocument.createElement(`span`);e.className=`visually-hidden`,e.style.cssText=
|
|
21724
|
+
`}_createTable({alignments:e,headers:t,rows:n,rowHeaderRows:r},i){let a=this.ownerDocument.createElement(`table`);if(a.className=`scb-viz-table`,i){let e=a.createCaption();e.className=`visually-hidden`,e.textContent=i}if(t.length){let n=a.createTHead().insertRow();t.forEach((t,r)=>{let i=this._createTableCell(t,e[r],`col`);if(!t.html&&!t.text.trim()){let e=this.ownerDocument.createElement(`span`);e.className=`visually-hidden`,e.style.cssText=Nm,e.textContent=this._getEmptyTableHeaderLabel(r),i.replaceChildren(e)}n.append(i)})}let o=a.createTBody();return n.forEach((t,n)=>{let i=o.insertRow();t.forEach((t,a)=>{let o=a===0&&r[n]===!0?`row`:void 0;i.append(this._createTableCell(t,e[a],o))})}),a}_createTableCell(e,t,n){let r=this.ownerDocument.createElement(n?`th`:`td`);return r.className=t===`right`?`align-right`:`align-left`,n&&(r.scope=n),e.html&&e.fragment?r.append(e.fragment):r.textContent=e.text,r}_getEmptyTableHeaderLabel(e){return e===0?this.lang===`en`?`Row header`:`Radrubrik`:this.lang===`en`?`Column ${e+1}`:`Kolumn ${e+1}`}_renderRichText(e){let t=typeof e==`string`?e.replace(/\r\n?/g,`
|
|
21719
21725
|
`):``,n=t.split(/\n{2,}/).filter(e=>e!==``);return n.length?x`${n.map(e=>x`<p class="body-text-paragraph">${e.split(`
|
|
21720
21726
|
`).map((e,t)=>x`${t>0?x`<br />`:``}${e}`)}</p>`)}`:t}_escapeHtml(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}_renderRichTextHtml(e){let t=typeof e==`string`?e.replace(/\r\n?/g,`
|
|
21721
21727
|
`):``,n=t.split(/\n{2,}/).filter(e=>e!==``);return n.length?n.map(e=>`<p class="body-text-paragraph">${e.split(`
|
|
@@ -21757,7 +21763,7 @@
|
|
|
21757
21763
|
aria-label="${this.officialStatisticsAlt}"
|
|
21758
21764
|
>
|
|
21759
21765
|
<span class="sos-logotype-small" aria-hidden="true">
|
|
21760
|
-
${
|
|
21766
|
+
${gp(Mm)}
|
|
21761
21767
|
</span>
|
|
21762
21768
|
</a>
|
|
21763
21769
|
`:``}
|
|
@@ -21765,7 +21771,7 @@
|
|
|
21765
21771
|
`}_renderMoreAboutStatsScreen(e){return this._hasMoreAboutStats(e)?x`
|
|
21766
21772
|
<div class="footer-statistics-screen">
|
|
21767
21773
|
<scb-divider></scb-divider>
|
|
21768
|
-
<scb-accordion size=${this._getInternalComponentSize(`--scb-viz-design-accordion-component-size-medium`,`large`,
|
|
21774
|
+
<scb-accordion size=${this._getInternalComponentSize(`--scb-viz-design-accordion-component-size-medium`,`large`,jm)}>
|
|
21769
21775
|
<scb-accordion-item title="${this.moreAboutStatsLabel}">
|
|
21770
21776
|
${this._renderMoreAboutStatsContent(e)}
|
|
21771
21777
|
</scb-accordion-item>
|
|
@@ -21879,7 +21885,7 @@
|
|
|
21879
21885
|
></slot>
|
|
21880
21886
|
<slot></slot>
|
|
21881
21887
|
</div>
|
|
21882
|
-
`}}}_syncChipClass(){let e=this.variant===`Standard`;this.classList.toggle(`chip-diagram`,e&&this.selectedChip===`Diagram`),this.classList.toggle(`chip-table`,e&&this.selectedChip===`Table`)}_dispatchSelectedChipChanged(){let e={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent(`selected-chip-changed`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`selectedchipchanged`,{detail:e,bubbles:!0,composed:!0}))}_onSegmentedChange(e){let t=e.detail?.value;this.selectedChip===t?this.selectedChip=null:this.selectedChip=t}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){(this.shadowRoot?.querySelector(`.actions-menu scb-icon-button`))?.focus()}_isActionsMenuPinnedForPreview(){return this.shadowRoot?.querySelector(`.actions-menu scb-options-menu`)?.inSb===!0}_focusFirstMenuItem(){let e=this.shadowRoot?.querySelector(`scb-options-menu-item`),t=()=>{e?.shadowRoot?.querySelector(`li`)?.focus()};e?.updateComplete?e.updateComplete.then(t):t()}_onActionsMenuItemKeyDown(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation(),t())}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(`.viz-container`)??this}async#m(e){let t=this._getExportableVisualElement();if(!t)return;let n=await
|
|
21888
|
+
`}}}_syncChipClass(){let e=this.variant===`Standard`;this.classList.toggle(`chip-diagram`,e&&this.selectedChip===`Diagram`),this.classList.toggle(`chip-table`,e&&this.selectedChip===`Table`)}_dispatchSelectedChipChanged(){let e={selectedChip:this.selectedChip};this.dispatchEvent(new CustomEvent(`selected-chip-changed`,{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`selectedchipchanged`,{detail:e,bubbles:!0,composed:!0}))}_onSegmentedChange(e){let t=e.detail?.value;this.selectedChip===t?this.selectedChip=null:this.selectedChip=t}_closeActionsMenu(){this._actionsMenuOpen=!1}_focusMenuButton(){(this.shadowRoot?.querySelector(`.actions-menu scb-icon-button`))?.focus()}_isActionsMenuPinnedForPreview(){return this.shadowRoot?.querySelector(`.actions-menu scb-options-menu`)?.inSb===!0}_focusFirstMenuItem(){let e=this.shadowRoot?.querySelector(`scb-options-menu-item`),t=()=>{e?.shadowRoot?.querySelector(`li`)?.focus()};e?.updateComplete?e.updateComplete.then(t):t()}_onActionsMenuItemKeyDown(e,t){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation(),t())}_getExportSurfaceTarget(){return this.shadowRoot?.querySelector(`.viz-container`)??this}async#m(e){let t=this._getExportableVisualElement();if(!t)return;let n=await tm(t,this._getExportSurfaceTarget(),e);n&&rm(n,this._buildExportFileName(e===`jpeg`?`jpg`:`png`))}_getCurrentPrintableView(){return this.variant===`Table`?`table`:this.variant===`Image`?`image`:this.selectedChip===`Table`?`table`:`diagram`}#h(e){return mm(this._getResolvedTableView(e),e=>this._escapeHtml(e),{getEmptyHeaderLabel:e=>this._getEmptyTableHeaderLabel(e)})}#g(){return hm({comment:this.comment,commentLabel:this.commentLabel,description:this.description,descriptionLabel:this.descriptionLabel,escapeHtml:e=>this._escapeHtml(e),footnote:this.footnote,footnoteLabel:this.footnoteLabel,moreAboutStatsLabel:this.moreAboutStatsLabel,officialStatistics:this.officialStatistics,renderRichTextHtml:e=>this._renderRichTextHtml(e),sosLogotypeSvg:Mm,source:this.source,sourceLabel:this.sourceLabel,sourceDataLink:this._getSourceDataLink()})}#_(e){return gm({contentHtml:e,escapeHtml:e=>this._escapeHtml(e),footerHtml:this.#g(),lang:this.lang,subtitle:this.subtitle,title:this.title})}async#v(){await $p(this,async()=>{let e=this._getCurrentPrintableView(),t=``;if(e===`table`){let e=this._getResolvedTableData();if(!e?.rows?.length)return;t=this.#h(e)}else if(e===`image`){let e=this.shadowRoot?.querySelector(`.image-content img`),n=e?.currentSrc||e?.src||this.imageHref;if(!n)return;t=`<img class="viz-image" src="${this._escapeHtml(n)}" alt="${this._escapeHtml(this._getImageAltText())}">`}else{let e=this._getExportableVisualElement();if(!e)return;let n=await nm(e,this._getExportSurfaceTarget(),`png`);if(!n)return;t=`<img class="viz-chart-image" src="${n}" alt="${this._escapeHtml(this._getImageAltText())}">`}await Qp(this.#_(t))})}#y(){let e=this._getResolvedTableData();e?.rows?.length&&rm(em(Om(e,e=>this._normalizeRenderableCell(e)),this.lang),this._buildExportFileName(`csv`))}#b(){let e=this.#x(this.spacing),t=this.#x(this.spacingTop)??e,n=this.#x(this.spacingBottom)??e,r=this.#x(this.spacingLeft),i=this.#x(this.spacingRight);t?this.style.setProperty(`--scb-viz-spacing-block-start`,t):this.style.removeProperty(`--scb-viz-spacing-block-start`),n?this.style.setProperty(`--scb-viz-spacing-block-end`,n):this.style.removeProperty(`--scb-viz-spacing-block-end`),r?this.style.setProperty(`--scb-viz-spacing-inline-start`,r):this.style.removeProperty(`--scb-viz-spacing-inline-start`),i?this.style.setProperty(`--scb-viz-spacing-inline-end`,i):this.style.removeProperty(`--scb-viz-spacing-inline-end`)}#x(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}#S(){let e=this.containerMaxWidth?.trim();e?this.style.setProperty(`--scb-viz-container-max-width`,e):this.style.removeProperty(`--scb-viz-container-max-width`)}};N([_({type:String,reflect:!0})],$.prototype,`variant`,void 0),N([_({type:String,reflect:!0,attribute:`selected-chip`})],$.prototype,`selectedChip`,void 0),N([_({type:String,reflect:!0})],$.prototype,`title`,void 0),N([_({type:String,reflect:!0})],$.prototype,`subtitle`,void 0),N([_({type:String,reflect:!0})],$.prototype,`description`,void 0),N([_({type:String,reflect:!0})],$.prototype,`comment`,void 0),N([_({type:String,reflect:!0})],$.prototype,`source`,void 0),N([_({type:String,attribute:`source-data-href`})],$.prototype,`sourceDataHref`,void 0),N([_({type:String,attribute:`source-data-link-text`})],$.prototype,`sourceDataLinkText`,void 0),N([_({type:String,reflect:!0})],$.prototype,`footnote`,void 0),N([_({type:String,reflect:!0,attribute:`lang`})],$.prototype,`lang`,void 0),N([_({type:String,reflect:!0,attribute:`image-href`})],$.prototype,`imageHref`,void 0),N([_({type:String,reflect:!0,attribute:`image-alt`})],$.prototype,`imageAlt`,void 0),N([_({type:Boolean,reflect:!0,attribute:`official-statistics`})],$.prototype,`officialStatistics`,void 0),N([_({type:Boolean,reflect:!0,attribute:`disable-toggle`})],$.prototype,`disableToggle`,void 0),N([_({type:String,attribute:`content-max-width`})],$.prototype,`contentMaxWidth`,void 0),N([_({type:String,attribute:`container-max-width`})],$.prototype,`containerMaxWidth`,void 0),N([_({type:String,attribute:`content-height`})],$.prototype,`contentHeight`,void 0),N([_({type:String,reflect:!0,attribute:`toggle-height-mode`})],$.prototype,`toggleHeightMode`,void 0),N([_({attribute:!1})],$.prototype,`tableData`,void 0),N([_({attribute:!1})],$.prototype,`valueFormat`,void 0),N([_({attribute:!1})],$.prototype,`timeFormat`,void 0),N([v()],$.prototype,`_slottedTableData`,void 0),N([v()],$.prototype,`_actionsMenuOpen`,void 0),N([v()],$.prototype,`_seriesDifferentiationEnabled`,void 0),N([v()],$.prototype,`_isFullscreen`,void 0),N([_({type:String,reflect:!0})],$.prototype,`spacing`,void 0),N([_({type:String,attribute:`spacing-top`,reflect:!0})],$.prototype,`spacingTop`,void 0),N([_({type:String,attribute:`spacing-bottom`,reflect:!0})],$.prototype,`spacingBottom`,void 0),N([_({type:String,attribute:`spacing-left`,reflect:!0})],$.prototype,`spacingLeft`,void 0),N([_({type:String,attribute:`spacing-right`,reflect:!0})],$.prototype,`spacingRight`,void 0),$=N([a(`scb-viz`)],$),_c(),Mc(),Fc(),Wc(),yl(),Lu(),Md(),Rd(),Fd(),dl(),gl(),Qc(),rl(),sf(),lf(),df(),_d(),xd(),yd(),wu(),Kc(),Nl(),_c(),Mc(),Fc(),Wc(),yl(),Lu(),hd(),Cd(),Md(),Rd(),Fd(),dl(),gl(),Qc(),rl(),sf(),lf(),mf(),df(),_d(),xd(),yd(),wu(),Sf(),Kc(),Nl();function Fm(e){if(!e.querySelector(`a, sup`))return e.textContent?.trim()??``;let t=e=>{if(e.nodeType===Node.TEXT_NODE)return[e.textContent??``];if(!(e instanceof Element))return[];let n=Array.from(e.childNodes).flatMap(t);return e.localName===`sup`?[{tag:`sup`,children:n}]:e.localName===`a`?[{tag:`a`,children:n,href:e.getAttribute(`href`),title:e.getAttribute(`title`)||void 0,ariaLabel:e.getAttribute(`aria-label`)||void 0}]:n};return Array.from(e.childNodes).flatMap(t)}var Im=e=>e.scope===`row`||e.classList.contains(`forspalt`)||e.tagName===`TH`&&!e.scope;function Lm(e,t=1/0){let n=e.tHead?Array.from(e.tHead.rows):[];if(!e.tHead)for(let t of Array.from(e.rows)){if(!t.cells.length||!Array.from(t.cells).every(e=>e.tagName===`TH`))break;n.push(t)}if(!n.length)return;let r=new Set(n),i=Array.from(e.rows).filter(e=>!r.has(e));if(!i.length||i.length>t)return;let a=i.reduce((e,t)=>{let n=Array.from(t.cells).findIndex(e=>!Im(e));return Math.max(e,n<0?t.cells.length:n)},1),o=i[0].cells.length-a;if((i.length+n.length+1)*o>t)return;let s=new Set(Array.from(e.querySelectorAll(`[id]`),e=>e.id));if(e.querySelector(`table, button, input, select, textarea, [tabindex], [contenteditable], [role]`)||Array.from(e.querySelectorAll(`*`)).some(e=>e.localName.includes(`-`))||Array.from(e.querySelectorAll(`a`)).some(e=>{let t=e.getAttribute(`href`)||``,n;try{n=decodeURIComponent(t.slice(1))}catch{return!0}return!e.closest(`th, td`)||s.has(n)||!t.startsWith(`#`)||e.getAttribute(`href`)===`#`||e.hasAttribute(`target`)||e.hasAttribute(`download`)||e.getAttributeNames().some(e=>e.startsWith(`on`))||e.hasAttribute(`aria-labelledby`)||e.hasAttribute(`aria-describedby`)})||e.getAttribute(`role`)&&e.getAttribute(`role`)!==`table`)return;let c=n.map(()=>[]),l=n.map((e,t)=>{let r=0;return Array.from(e.cells).map(e=>{for(;c[t][r];)r++;let i=e.cloneNode(!0);i.querySelectorAll(`[hidden], .visually-hidden, .sr-only`).forEach(e=>e.remove());let a=e.textContent?.trim()??``,o=!!a&&!i.textContent?.trim(),s={text:a,content:Fm(e),visuallyHidden:o,ariaLabel:e.getAttribute(`aria-label`)||(o?a:void 0),column:r,colSpan:e.colSpan,rowSpan:e.rowSpan||n.length-t},l=r+s.colSpan,u=t+s.rowSpan;if(l>256||u>c.length)throw RangeError(`header-grid`);for(let e=t;e<u;e++)for(let t=r;t<l;t++){if(c[e][t])throw RangeError(`header-grid`);c[e][t]=s}return r=l,s})}),u=c[0].length;if(u<2||c.some(e=>e.length!==u||Array.from({length:u},(t,n)=>!e[n]).some(Boolean))||a>=u||i.some(e=>e.cells.length!==u||Array.from(e.cells).some(e=>e.colSpan!==1||e.rowSpan!==1)||!Array.from(e.cells).slice(0,a).some(e=>e.textContent?.trim())||Array.from(e.cells).slice(a).some(e=>e.tagName===`TH`||Im(e))))return;if(i.some(e=>Array.from(e.cells).slice(a).every(e=>!e.textContent?.trim()))){let e=i.map(e=>JSON.stringify(Array.from(e.cells).slice(0,a).map(e=>e.textContent?.trim())));if(new Set(e).size!==e.length)return}let d=Array.from({length:u-a},(e,t)=>[...new Set(c.map(e=>e[t+a]))].filter(e=>e.text));if(!d.some(e=>!e.length))return{label:e.getAttribute(`aria-label`)||e.caption?.textContent?.trim()||``,headings:l,columns:d,stubCount:a,rows:i.map(e=>({stubs:Array.from(e.cells).slice(0,a).map(Fm),values:Array.from(e.cells).slice(a).map(Fm)}))}}w(),b(),pl(),P();var Rm=200,zm=new WeakSet,Bm=p`
|
|
21883
21889
|
scb-table-next > table {
|
|
21884
21890
|
box-sizing: border-box;
|
|
21885
21891
|
inline-size: 100%;
|
|
@@ -21918,7 +21924,7 @@
|
|
|
21918
21924
|
scb-table-next > table > tbody > tr:hover > * { background: var(--scb-tables-alternate-surface-color); }
|
|
21919
21925
|
scb-table-next > table a { color: inherit; text-decoration: underline; }
|
|
21920
21926
|
scb-table-next > table a:focus-visible { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
|
|
21921
|
-
`,
|
|
21927
|
+
`,Vm=class extends C{constructor(...e){super(...e),this._mobile=!1,this._widthReady=!1}static{this.styles=p`
|
|
21922
21928
|
:host {
|
|
21923
21929
|
display: block;
|
|
21924
21930
|
min-inline-size: 0;
|
|
@@ -21995,12 +22001,12 @@
|
|
|
21995
22001
|
}
|
|
21996
22002
|
.mobile .group.first > th { padding-block-start: calc(var(--spacing-8) + var(--spacing-2)); }
|
|
21997
22003
|
.mobile .last > * { padding-block-end: calc(var(--spacing-8) + var(--spacing-2)); }
|
|
21998
|
-
`}connectedCallback(){super.connectedCallback();let e=this.getRootNode();if(!
|
|
22004
|
+
`}connectedCallback(){super.connectedCallback();let e=this.getRootNode();if(!zm.has(e)){let t=this.ownerDocument.createElement(`style`);t.textContent=Bm.cssText,(e instanceof Document?e.head:e).appendChild(t),zm.add(e)}this._observer=new MutationObserver(()=>this._queueRead()),this._observer.observe(this,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:[`colspan`,`rowspan`,`aria-label`,`role`,`tabindex`,`contenteditable`,`scope`,`class`,`hidden`,`href`,`title`,`id`,`target`,`download`,`aria-labelledby`,`aria-describedby`]}),this._resize=new ResizeObserver(([e])=>{let t=e.contentRect.width;if(t<=0){this._widthReady=!1;return}let n=t<=575,r=n!==this._mobile;this._mobile=n,(!this._widthReady||r)&&(this._widthReady=!0,this._read())}),this._resize.observe(this)}disconnectedCallback(){this._observer?.disconnect(),this._resize?.disconnect(),this._frame!==void 0&&cancelAnimationFrame(this._frame),this._frame=void 0,this._widthReady=!1,super.disconnectedCallback()}_queueRead(){!this._mobile||!this._widthReady||this._frame!==void 0||(this._frame=requestAnimationFrame(()=>{this._frame=void 0,this._read()}))}_read(){if(!this._widthReady)return;if(!this._mobile){this._model=void 0;return}let e=this.querySelectorAll(`table`);try{this._model=e.length===1?Lm(e[0],Rm):void 0}catch(e){if(!(e instanceof RangeError))throw e;this._model=void 0}}_content(e){return typeof e==`string`?e:e.map(e=>typeof e==`string`?e:e.tag===`sup`?x`<sup>${this._content(e.children)}</sup>`:x`<a href=${e.href} title=${R(e.title)} aria-label=${R(e.ariaLabel)}>${this._content(e.children)}</a>`)}_mobileRows(e){let t=[],n=e.headings.flat().filter(t=>(t.text||t.ariaLabel)&&t.column+t.colSpan<=e.stubCount),r=n.map(e=>e.ariaLabel||e.text).join(` `),i=n.filter(e=>!e.visuallyHidden&&e.text),a=[],o=[];return e.columns.forEach((s,c)=>{let l=0;for(;l<s.length&&s[l]===a[l];)l++;o.length=l,s.forEach((e,n)=>{if(n<l)return;let r=`group-${c}-${n}`;o.push(r);let i=n===0?`outer`:`group${l===0?` first`:``}`;t.push(x`<tr class=${i}><th id=${r} aria-label=${R(e.ariaLabel)} scope="col" colspan="2">${this._content(e.content)}</th></tr>`)});let u=n.length?`stub-heading-${c}`:void 0;u&&(o.push(u),t.push(x`<tr class="stub-headings"><th id=${u} scope="col" colspan="2" aria-label=${R(r)}>${i.map((e,t)=>x`${t?` `:S}<span>${this._content(e.content)}</span>`)}</th></tr>`)),e.rows.forEach((n,r)=>{let i=`mobile-row-${c}-${r}`;t.push(x`<tr class=${r===e.rows.length-1?`last`:``}>
|
|
21999
22005
|
<th class="stub" scope="row" id=${i} headers=${R(u)}>${n.stubs.filter(e=>e!==``).map((e,t)=>x`${t?` `:S}${this._content(e)}`)}</th>
|
|
22000
22006
|
<td headers=${[...o,i].join(` `)}>${this._content(n.values[c])}</td></tr>`)}),a=s}),t}render(){let e=this._model;return x`<div class="scroll" tabindex="0" ?hidden=${!!e}><slot @slotchange=${this._queueRead}></slot></div>
|
|
22001
22007
|
${e?x`<table class="mobile" aria-label=${R(e.label||void 0)}>
|
|
22002
22008
|
<tbody>${this._mobileRows(e)}</tbody>
|
|
22003
|
-
</table>`:S}`}};N([v()],
|
|
22009
|
+
</table>`:S}`}};N([v()],Vm.prototype,`_model`,void 0),N([v()],Vm.prototype,`_mobile`,void 0),Vm=N([a(`scb-table-next`)],Vm),w(),b(),P();var Hm=class extends C{constructor(...e){super(...e),this.target=``,this.heading=``}static{this.styles=p`:host { display: none !important; }`}connectedCallback(){super.connectedCallback(),this.setAttribute(`hidden`,``),this.setAttribute(`aria-hidden`,`true`)}render(){return x`<slot></slot>`}};N([_({type:String,reflect:!0})],Hm.prototype,`target`,void 0),N([_({type:String,reflect:!0})],Hm.prototype,`heading`,void 0),Hm=N([a(`scb-tour-step`)],Hm),w(),b(),Ol(),Mc(),dl(),P();var Um,Wm={fromAttribute:e=>e!==null&&e!==`false`,toAttribute:e=>e?``:null},Gm=class extends C{static{Um=this}constructor(...e){super(...e),this.variant=`standard`,this.spotlight=!1,this.open=!1,this.autoStart=!1,this.storageKey=``,this.step=0,this.closeLabel=`Stäng guiden`,this.previousLabel=`Föregående`,this.nextLabel=`Nästa`,this.doneLabel=`Klart`,this.stepLabel=`{current} av {total}`,this._steps=[],this._stepObserver=new MutationObserver(()=>this._readSteps()),this._autoStartAttempted=!1,this._startRequest=0,this._shownStorageKey=``,this._spotlightId=`scb-tour-spotlight-${Um._nextId++}`,this._operation=0,this._frame=0,this._scrollRoots=[],this._resizeObserver=new ResizeObserver(()=>this._schedulePosition()),this._startOnLoad=async()=>{if(!this.isConnected||document.readyState!==`complete`||!this.autoStart||this.open||this._autoStartAttempted)return;this._autoStartAttempted=!0;let e=this._startRequest,t=this.storageKey;try{if(t&&localStorage.getItem(t)===`seen`)return}catch{}await this.updateComplete;let n=this._findTarget(this._steps[0]?.target);n?.localName.includes(`-`)&&(await customElements.whenDefined(n.localName),await n.updateComplete),this.isConnected&&this.autoStart&&!this.open&&e===this._startRequest&&t===this.storageKey&&this.start()},this._schedulePosition=e=>{e&&this.shadowRoot?.querySelector(`.layer`)?.removeAttribute(`data-moving`),cancelAnimationFrame(this._frame),this._frame=requestAnimationFrame(()=>this._position())},this._onResize=e=>{this._target?.scrollIntoView({block:`center`,inline:`nearest`,behavior:`instant`}),this._schedulePosition(e)},this._next=()=>{this.step>=this._steps.length-1?this._close(`complete`):this.step++},this._onKeydown=e=>{e.key!==`Escape`||!this.open||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),this.close())}}static{this._nextId=0}static{this.styles=p`
|
|
22004
22010
|
:host { display: block; }
|
|
22005
22011
|
.layer {
|
|
22006
22012
|
display: none;
|
|
@@ -22138,7 +22144,7 @@
|
|
|
22138
22144
|
}
|
|
22139
22145
|
|
|
22140
22146
|
/* design:bindings:scb-tour:end */
|
|
22141
|
-
`}connectedCallback(){super.connectedCallback(),this._readSteps(),this._stepObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`target`,`heading`]}),document.readyState!==`complete`&&window.addEventListener(`load`,this._startOnLoad,{once:!0})}disconnectedCallback(){this._startRequest++,this._stepObserver.disconnect(),window.removeEventListener(`load`,this._startOnLoad),this._hide(),super.disconnectedCallback()}updated(e){this.open&&e.has(`open`)&&(this._autoStartAttempted=!0,this._startRequest++),this.open?e.has(`open`)||e.has(`step`)||e.has(`_steps`)?this._showStep():e.has(`spotlight`)&&this._position():this._hide(),this._startOnLoad()}_readSteps(){this._steps=Array.from(this.children).filter(e=>e instanceof
|
|
22147
|
+
`}connectedCallback(){super.connectedCallback(),this._readSteps(),this._stepObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`target`,`heading`]}),document.readyState!==`complete`&&window.addEventListener(`load`,this._startOnLoad,{once:!0})}disconnectedCallback(){this._startRequest++,this._stepObserver.disconnect(),window.removeEventListener(`load`,this._startOnLoad),this._hide(),super.disconnectedCallback()}updated(e){this.open&&e.has(`open`)&&(this._autoStartAttempted=!0,this._startRequest++),this.open?e.has(`open`)||e.has(`step`)||e.has(`_steps`)?this._showStep():e.has(`spotlight`)&&this._position():this._hide(),this._startOnLoad()}_readSteps(){this._steps=Array.from(this.children).filter(e=>e instanceof Hm).map(e=>({target:e.target,heading:e.heading,content:(e.textContent??``).replace(/\s+/g,` `).trim()}))}_findTarget(e){if(!e)return null;try{let t=this.querySelector(e)??this.getRootNode().querySelector(e);return t instanceof HTMLElement?t:null}catch{return null}}start(){this._autoStartAttempted=!0,this._startRequest++,this.step=0,this.open=!0}close(){this._autoStartAttempted=!0,this._startRequest++,this._close(`dismiss`)}_close(e){if(this.open){if(this._shownStorageKey&&e!==`target-unavailable`)try{localStorage.setItem(this._shownStorageKey,`seen`)}catch{}this.open=!1,this._hide(),this.dispatchEvent(new CustomEvent(`close`,{detail:{reason:e,step:this.step},bubbles:!0,composed:!0}))}}_hide(){this._operation++,cancelAnimationFrame(this._frame),this._resizeObserver.disconnect(),window.removeEventListener(`resize`,this._onResize),window.removeEventListener(`keydown`,this._onKeydown),window.removeEventListener(`scroll`,this._schedulePosition,!0),this._scrollRoots.forEach(e=>e.removeEventListener(`scroll`,this._schedulePosition,!0)),this._scrollRoots=[];let e=(this.shadowRoot?.querySelector(`.surface`))?.contains(this.shadowRoot?.activeElement??null),t=this.shadowRoot?.querySelector(`.layer`);z(t),t?.removeAttribute(`data-moving`),e&&this._returnFocus?.isConnected&&this._returnFocus.focus({preventScroll:!0}),this._returnFocus=void 0,this._target=void 0,this._spotlightTarget=void 0,this._shownStorageKey=``}async _showStep(){let e=++this._operation;if(await this.updateComplete,!this.open||e!==this._operation)return;let t=Math.max(0,Math.min(this._steps.length-1,Math.trunc(this.step)||0));if(this.step!==t){this.step=t;return}let n=this._steps[t],r=this._findTarget(n?.target);if(!r||!this._isVisible(r)){this._close(`target-unavailable`);return}let i=this.shadowRoot.querySelector(`.surface`),a=this.shadowRoot.querySelector(`.layer`);if(!a.matches(`:popover-open`)){this._shownStorageKey=this.storageKey;let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;e instanceof HTMLElement&&(this._returnFocus=e)}this._target=r;let o=r.getBoundingClientRect();if((o.top<0||o.bottom>innerHeight||o.left<0||o.right>innerWidth)&&r.scrollIntoView({block:`center`,inline:`nearest`,behavior:`instant`}),!Sl(a,r)){this._close(`target-unavailable`);return}this._resizeObserver.disconnect(),this._resizeObserver.observe(r),this._resizeObserver.observe(i),window.addEventListener(`resize`,this._onResize),window.addEventListener(`scroll`,this._schedulePosition,!0),this._scrollRoots.forEach(e=>e.removeEventListener(`scroll`,this._schedulePosition,!0)),this._scrollRoots=[];let s=r.getRootNode();for(;s instanceof ShadowRoot;)s.addEventListener(`scroll`,this._schedulePosition,!0),this._scrollRoots.push(s),s=s.host.getRootNode();this._position(),i.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent(`stepchange`,{detail:{step:t,total:this._steps.length},bubbles:!0,composed:!0}))}_isVisible(e){let t=getComputedStyle(e),n=e.getBoundingClientRect();return e.isConnected&&t.visibility!==`hidden`&&n.width>0&&n.height>0}_position(){let e=this._target,t=this.shadowRoot?.querySelector(`.surface`);if(!this.open||!t||!e)return;if(!this._isVisible(e)){this._close(`target-unavailable`);return}let n=getComputedStyle(this),r=Number.parseFloat(n.getPropertyValue(`--spacing-4`))||12,i=Number.parseFloat(n.getPropertyValue(`--scb-tour-design-anchor-gap-medium`))||12,a=e.getBoundingClientRect();if(this.spotlight){window.addEventListener(`keydown`,this._onKeydown);let t=this.shadowRoot.querySelector(`.layer`);this._spotlightTarget!==e&&(t.toggleAttribute(`data-moving`,!!this._spotlightTarget),this._spotlightTarget=e),t.style.setProperty(`--_spotlight-left`,`${a.left}px`),t.style.setProperty(`--_spotlight-top`,`${a.top}px`),t.style.setProperty(`--_spotlight-width`,`${a.width}px`),t.style.setProperty(`--_spotlight-height`,`${a.height}px`)}else window.removeEventListener(`keydown`,this._onKeydown),this._spotlightTarget=void 0;let o=t.getBoundingClientRect(),s=innerHeight-a.bottom-i,c=a.top-i,l=s>=o.height+r||s>=c?`bottom`:`top`;t.style.setProperty(`--available-height`,`calc(${Math.max(0,(l===`bottom`?innerHeight-a.bottom:a.top)-r)}px - var(--scb-tour-design-anchor-gap-medium))`);let u=Math.max(r,Math.min(a.left+a.width/2-o.width/2,innerWidth-o.width-r));t.style.left=`${u}px`,t.style.top=l===`bottom`?`calc(${a.bottom}px + var(--scb-tour-design-anchor-gap-medium))`:`calc(${a.top}px - var(--scb-tour-design-anchor-gap-medium))`,t.dataset.side=l,t.style.setProperty(`--anchor-x`,`${a.left+a.width/2-u}px`)}render(){let e=this._steps[this.step],t=this.stepLabel.replace(`{current}`,String(this.step+1)).replace(`{total}`,String(this._steps.length));return x`
|
|
22142
22148
|
<slot name="trigger" @click=${e=>{e.defaultPrevented||this.start()}}></slot>
|
|
22143
22149
|
<slot></slot>
|
|
22144
22150
|
<div class="layer" popover="manual">
|
|
@@ -22170,4 +22176,4 @@
|
|
|
22170
22176
|
</div>
|
|
22171
22177
|
</section>
|
|
22172
22178
|
</div>
|
|
22173
|
-
`}};N([_({type:String,reflect:!0})],
|
|
22179
|
+
`}};N([_({type:String,reflect:!0})],Gm.prototype,`variant`,void 0),N([_({type:Boolean,reflect:!0,converter:Wm})],Gm.prototype,`spotlight`,void 0),N([_({type:Boolean,reflect:!0,converter:Wm})],Gm.prototype,`open`,void 0),N([_({type:Boolean,attribute:`auto-start`,converter:Wm})],Gm.prototype,`autoStart`,void 0),N([_({type:String,attribute:`storage-key`})],Gm.prototype,`storageKey`,void 0),N([_({type:Number,reflect:!0})],Gm.prototype,`step`,void 0),N([_({attribute:`close-label`})],Gm.prototype,`closeLabel`,void 0),N([_({attribute:`previous-label`})],Gm.prototype,`previousLabel`,void 0),N([_({attribute:`next-label`})],Gm.prototype,`nextLabel`,void 0),N([_({attribute:`done-label`})],Gm.prototype,`doneLabel`,void 0),N([_({attribute:`step-label`})],Gm.prototype,`stepLabel`,void 0),N([v()],Gm.prototype,`_steps`,void 0),Gm=Um=N([a(`scb-tour`)],Gm),_c(),Mc(),Fc(),Wc(),yc(),yl(),Lu(),hd(),Cd(),Md(),Rd(),Fd(),dl(),gl(),Qc(),rl(),sf(),lf(),mf(),df(),_d(),xd(),yd(),wu(),Sf(),Kc(),Nl(),j(),Ec(),Ol(),_c(),Mc(),Fc(),Wc(),yc(),yl(),Lu(),hd(),Cd(),Md(),Rd(),Fd(),dl(),gl(),Qc(),rl(),sf(),lf(),mf(),df(),_d(),xd(),yd(),wu(),Sf(),Kc(),Nl(),cc(),j(),Ec(),Ol()})();
|