scb-wc 0.1.120 → 0.1.122

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.
@@ -1,4 +1,4 @@
1
- import{g as p,h as f,m as b,p as s,v as r,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as a}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,o){try{customElements.get(t)||e(t,i,o)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var h,g={fromAttribute(d){if(d===null)return!1;const e=d.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},n=(h=class extends f{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.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__scrollLocked=!1,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},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=()=>{const t=this.shadowRoot?.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(i=>{const o=i.tagName;o==="SCB-TEXTFIELD"&&(i.value=""),o==="SCB-CHECKBOX"&&(i.checked=!1),o==="SCB-RADIO-BUTTON"&&(i.checked=!1),o==="SCB-SWITCH"&&(i.selected=!1),o==="SCB-CHIP"&&(i.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{const t=this.shadowRoot?.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}},this.__onFormSubmit=t=>{const i=t.currentTarget;if(!(i instanceof HTMLFormElement))return;if(this.__syncSlottedFormValues(i),!this.__validateFormAndSlottedFields(i)){t.preventDefault();return}const o=new FormData(i);if(!this.__fireCancelable("submit",{form:i,formData:o})){t.preventDefault();return}this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const i=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled"));if(!i.length)return;const o=i[0],l=i[i.length-1];t.shiftKey&&document.activeElement===o?(l.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===l&&(o.focus(),t.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),this.__toggleScrollLock(!1),super.disconnectedCallback()}__applyZIndex(){const 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(){const 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.__applyZIndex(),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const t=e.get("open");this.__updateTriggersExpanded(),this.open&&!t?!this.inSb&&!this.__usesInPlaceLayout()&&this.updateComplete.then(()=>{const i=this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');i?i.focus():this.shadowRoot?.querySelector(".container")?.focus()}):!this.open&&t&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}(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(){const e=getComputedStyle(this);return e.getPropertyValue("--scb-dialog-scrim-position").trim()==="relative"||e.getPropertyValue("--scb-dialog-container-position").trim()==="absolute"}__toggleScrollLock(e){const t=document.documentElement,i=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;const o=window.innerWidth-t.clientWidth;t.style.overflow="hidden",i.style.paddingRight=o>0?`${o}px`:"",this.__scrollLocked=!0;return}this.__scrollLocked&&(t.style.overflow="",i.style.paddingRight="",this.__scrollLocked=!1)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,o=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),o?this.style.setProperty("--scb-dialog-spacing-inline-start",o):this.style.removeProperty("--scb-dialog-spacing-inline-start"),l?this.style.setProperty("--scb-dialog-spacing-inline-end",l):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}))}__getSlottedElements(){const e=this.shadowRoot?.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const o of t)i.push(o,...Array.from(o.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const o=document.createElement("input");o.type="hidden",o.name=t,o.value=i,o.setAttribute("data-scb-dialog-generated","true"),e.append(o)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;const i=(t.getAttribute("name")??"").trim();if(i&&!(t.disabled===!0||t.hasAttribute("disabled"))){if(t instanceof HTMLInputElement){if(t.form===e)return;const o=(t.type||"").toLowerCase();if(o==="checkbox"||o==="radio"){t.checked&&this.__appendHiddenFormValue(e,i,t.value||"on");return}this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(o=>{this.__appendHiddenFormValue(e,i,o.value)});return}this.__appendHiddenFormValue(e,i,t.value??"");return}switch(t.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(e,i,String(t.value??""));return;case"SCB-CHECKBOX":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-SWITCH":(t.selected||t.checked)&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-CHIP":t.selected&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;default:"value"in t&&this.__appendHiddenFormValue(e,i,String(t.value??""))}}})}__validateFormAndSlottedFields(e){const t=c=>c.disabled===!0||c.hasAttribute("disabled");let i=e.reportValidity(),o=null;const l=new Set;return this.__getSlottedElements().forEach(c=>{if(!(c instanceof HTMLElement)||l.has(c)||t(c))return;l.add(c);const u=c;if(c.tagName==="SCB-TEXTFIELD"&&u.error===!0){o||(o=c),i=!1;return}if(typeof u.reportValidity=="function"){const m=!!u.reportValidity();!m&&!o&&(o=c),i=i&&m}}),!i&&o&&o.focus(),i}__slotIsEmpty(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return r`
1
+ import{g as p,h as f,m as b,p as s,v as r,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as a}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,o){try{customElements.get(t)||e(t,i,o)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var h,g={fromAttribute(d){if(d===null)return!1;const e=d.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},n=(h=class extends f{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.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__scrollLocked=!1,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},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=()=>{const t=this.shadowRoot?.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(i=>{const o=i.tagName;o==="SCB-TEXTFIELD"&&(i.value=""),o==="SCB-CHECKBOX"&&(i.checked=!1),o==="SCB-RADIO-BUTTON"&&(i.checked=!1),o==="SCB-SWITCH"&&(i.selected=!1),o==="SCB-CHIP"&&(i.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{const t=this.shadowRoot?.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}},this.__onFormSubmit=t=>{const i=t.currentTarget;if(!(i instanceof HTMLFormElement)||(t.preventDefault(),t.stopPropagation(),this.__syncSlottedFormValues(i),!this.__validateFormAndSlottedFields(i)))return;const o=new FormData(i);this.__fireCancelable("submit",{form:i,formData:o})&&(this.__setOpen(!1),this.formAction.trim()&&HTMLFormElement.prototype.submit.call(i))},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const i=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled"));if(!i.length)return;const o=i[0],l=i[i.length-1];t.shiftKey&&document.activeElement===o?(l.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===l&&(o.focus(),t.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),this.__toggleScrollLock(!1),super.disconnectedCallback()}__applyZIndex(){const 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(){const 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.__applyZIndex(),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const t=e.get("open");this.__updateTriggersExpanded(),this.open&&!t?!this.inSb&&!this.__usesInPlaceLayout()&&this.updateComplete.then(()=>{const i=this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');i?i.focus():this.shadowRoot?.querySelector(".container")?.focus()}):!this.open&&t&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}(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(){const e=getComputedStyle(this);return e.getPropertyValue("--scb-dialog-scrim-position").trim()==="relative"||e.getPropertyValue("--scb-dialog-container-position").trim()==="absolute"}__toggleScrollLock(e){const t=document.documentElement,i=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;const o=window.innerWidth-t.clientWidth;t.style.overflow="hidden",i.style.paddingRight=o>0?`${o}px`:"",this.__scrollLocked=!0;return}this.__scrollLocked&&(t.style.overflow="",i.style.paddingRight="",this.__scrollLocked=!1)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,o=this.mapSpacingToken(this.spacingLeft),l=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),o?this.style.setProperty("--scb-dialog-spacing-inline-start",o):this.style.removeProperty("--scb-dialog-spacing-inline-start"),l?this.style.setProperty("--scb-dialog-spacing-inline-end",l):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}))}__getSlottedElements(){const e=this.shadowRoot?.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const o of t)i.push(o,...Array.from(o.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const o=document.createElement("input");o.type="hidden",o.name=t,o.value=i,o.setAttribute("data-scb-dialog-generated","true"),e.append(o)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;const i=(t.getAttribute("name")??"").trim();if(i&&!(t.disabled===!0||t.hasAttribute("disabled"))){if(t instanceof HTMLInputElement){if(t.form===e)return;const o=(t.type||"").toLowerCase();if(o==="checkbox"||o==="radio"){t.checked&&this.__appendHiddenFormValue(e,i,t.value||"on");return}this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(o=>{this.__appendHiddenFormValue(e,i,o.value)});return}this.__appendHiddenFormValue(e,i,t.value??"");return}switch(t.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(e,i,String(t.value??""));return;case"SCB-CHECKBOX":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-SWITCH":(t.selected||t.checked)&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-CHIP":t.selected&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;default:"value"in t&&this.__appendHiddenFormValue(e,i,String(t.value??""))}}})}__validateFormAndSlottedFields(e){const t=c=>c.disabled===!0||c.hasAttribute("disabled");let i=e.reportValidity(),o=null;const l=new Set;return this.__getSlottedElements().forEach(c=>{if(!(c instanceof HTMLElement)||l.has(c)||t(c))return;l.add(c);const u=c;if(c.tagName==="SCB-TEXTFIELD"&&u.error===!0){o||(o=c),i=!1;return}if(typeof u.reportValidity=="function"){const m=!!u.reportValidity();!m&&!o&&(o=c),i=i&&m}}),!i&&o&&o.focus(),i}__slotIsEmpty(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return r`
2
2
  <div class="header">
3
3
  <div class="title">
4
4
  ${this.icon?r`<md-icon class="dialog-icon">${this.icon}</md-icon>`:p}
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js","../scb-checkbox/scb-checkbox.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateFieldGet2.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/md-focus-ring.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/delegate.js","../../vendor/form-associated.js","../../vendor/redispatch-event.js","../../vendor/ripple.js","../../vendor/validator.js","../../vendor/checkbox-validator.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js"])))=>i.map(i=>d[i]);
2
- import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,r,l){try{customElements.get(t)||s(t,r,l)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g,_;function f(){return g??(g=u(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),g}function b(){return _??(_=u(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),_}var i=class extends y{constructor(...s){super(...s),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingSwitchLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.density=0,this.noDivider=!1,this.__scbCheckboxLoaded=!1,this.__scbSwitchLoaded=!1,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__focusVisibleRaf=null,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".row"),l=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await b();await c(t,r,l,d)},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onFocusIn=()=>{this.__scheduleFocusVisibleSync()},this.__onFocusOut=()=>{this.__scheduleFocusVisibleSync()},this.__onPointerDown=()=>{this.toggleAttribute("data-focus-visible",!1)},this.__onLazyFocusRingKeydown=t=>{t.key==="Tab"&&f().then(({ensureFocusRingOnTab:r})=>r(t))},this.onRowClick=()=>{if(this.type==="link"&&!this.disabled&&(!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),r=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),r){const l=!this.trailingSwitchSelected;r.selected=l,this.__setTrailingSwitchSelected(l,!0)}},this.__onTrailingSwitchChange=t=>{const r=t.detail?.selected,l=typeof r=="boolean"?r:t.currentTarget?.selected??!1;this.__setTrailingSwitchSelected(l,!0)},this.__onKeydown=t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const r=this.shadowRoot?.querySelector("a[href]");if(r){t.preventDefault(),r.click();return}}t.preventDefault(),this.onRowClick()}}}static get styles(){return k`:host{display:block;border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);margin-bottom:calc(var(--stroke-border, 1px)*-1);outline:0;position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font)}:host([hidden]){display:none}:host([no-divider]){--stroke-border:0px}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px))}:host([data-focus-visible]) md-focus-ring{display:block}.row{display:flex;align-items:center;gap:var(--spacing-5, 16px);padding-block:var(--spacing-7, 24px);padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-none, 0px);-webkit-tap-highlight-color:transparent;position:relative;overflow:hidden;cursor:default}:host([type="link"]) .row{cursor:pointer}:host([density="-2"]) .row,:host-context([data-density="-2"]) .row{padding-block:var(--spacing-5, 16px)}:host([density="-4"]) .row,:host-context([data-density="-4"]) .row{padding-block:var(--spacing-4, 12px)}md-ripple{border-radius:inherit;inset:0;position:absolute;pointer-events:none}.material-icon{display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-icon.scb-svg-icon{fill:currentColor;font:inherit}.leading{align-self:center;display:grid;place-items:center}.img{width:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));height:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));object-fit:contain;border-radius:var(--radius-s, 8px);filter:var(--scb-list-leading-image-filter, none)}.texts{display:grid;gap:var(--spacing-1, 2px);min-inline-size:0}.label,.overline,.supporting-text{font-family:var(--brand-font);font-size:var(--md-sys-typescale-label-medium-size);line-height:var(--md-sys-typescale-label-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-label-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.label,.supporting-text{font-size:var(--md-sys-typescale-title-large-size);line-height:var(--md-sys-typescale-title-large-line-height);font-weight:var(--weight-semibold);letter-spacing:var(--md-sys-typescale-title-large-tracking);color:var(--md-sys-color-on-surface)}.supporting-text{font-size:var(--md-sys-typescale-body-medium-size);line-height:var(--md-sys-typescale-body-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-body-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.trailing{margin-left:auto;align-self:center;display:flex}.trailing.trailing-switch{justify-content:flex-end}.trailing scb-checkbox{margin-inline-end:var(--scb-list-trailing-checkbox-nudge)}:host([trailing-variant="checkbox"]) .row,:host([trailing-variant="switch"]) .row{cursor:pointer}:host([disabled]) .row{cursor:default}.link{text-decoration:none;color:inherit;display:flex;width:100%;gap:12px}`}async firstUpdated(){await this.__ensureDepsLoaded(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("focusout",this.__onFocusOut),this.addEventListener("pointerdown",this.__onPointerDown,!0),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.addEventListener("keydown",this.__onKeydown)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("focusout",this.__onFocusOut),this.removeEventListener("pointerdown",this.__onPointerDown,!0),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.removeEventListener("keydown",this.__onKeydown),this.__focusVisibleRaf!==null&&(cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=null),super.disconnectedCallback()}updated(s){super.updated(s),(s.has("leading")||s.has("leadingVariant")||s.has("trailing")||s.has("trailingVariant")||s.has("type")||s.has("target"))&&this.__ensureDepsLoaded()}async __ensureDepsLoaded(){this.trailing&&this.trailingVariant==="checkbox"&&!this.__scbCheckboxLoaded&&(await u(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18]),import.meta.url),this.__scbCheckboxLoaded=!0),this.trailing&&this.trailingVariant==="switch"&&!this.__scbSwitchLoaded&&(await u(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([19,5,7,8,9,1,10,11,12,13,14,15,16,17]),import.meta.url),this.__scbSwitchLoaded=!0)}__ensureRipple(s){if(!(this.type!=="link"||this.disabled)){if(s&&(this.__pendingRippleEvent=s),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,b().then(({ensureRippleReady:t})=>t()).then(()=>{this.disabled||(this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple()))}))}}__scheduleFocusVisibleSync(){this.__focusVisibleRaf!==null&&cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=requestAnimationFrame(()=>{this.__focusVisibleRaf=null;const s=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=this.matches(":focus-visible")||s instanceof HTMLElement&&s.matches(":focus-visible");this.toggleAttribute("data-focus-visible",t),t&&this.__ensureFocusRing()})}__ensureFocusRing(){this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,f().then(({ensureFocusRingReady:s})=>s()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}__setTrailingSwitchSelected(s,t){this.trailingSwitchSelected=s,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:s},bubbles:!0,composed:!0}))}render(){const s=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?o`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>`:n;case"avatar":return o`
2
+ import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,r,l){try{customElements.get(t)||s(t,r,l)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g,_;function v(){return g??(g=u(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),g}function m(){return _??(_=u(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),_}var i=class extends y{constructor(...s){super(...s),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingSwitchLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.density=0,this.noDivider=!1,this.__scbCheckboxLoaded=!1,this.__scbSwitchLoaded=!1,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__focusVisibleRaf=null,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".row"),l=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await m();await c(t,r,l,d)},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onFocusIn=()=>{this.__scheduleFocusVisibleSync()},this.__onFocusOut=()=>{this.__scheduleFocusVisibleSync()},this.__onPointerDown=()=>{this.toggleAttribute("data-focus-visible",!1)},this.__onLazyFocusRingKeydown=t=>{t.key==="Tab"&&v().then(({ensureFocusRingOnTab:r})=>r(t))},this.onRowClick=()=>{if(this.type==="link"&&!this.disabled&&(!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),r=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),r){const l=!this.trailingSwitchSelected;r.selected=l,this.__setTrailingSwitchSelected(l,!0)}},this.__onTrailingSwitchChange=t=>{const r=t.detail?.selected,l=typeof r=="boolean"?r:t.currentTarget?.selected??!1;this.__setTrailingSwitchSelected(l,!0)},this.__onKeydown=t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const r=this.shadowRoot?.querySelector("a[href]");if(r){t.preventDefault(),r.click();return}}t.preventDefault(),this.onRowClick()}}}static get styles(){return k`:host{display:block;border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);margin-bottom:calc(var(--stroke-border, 1px)*-1);outline:0;position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font)}:host([hidden]){display:none}:host([no-divider]){--stroke-border:0px}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px))}:host([data-focus-visible]) md-focus-ring{display:block}.row{display:flex;align-items:center;gap:var(--spacing-5, 16px);padding-block:var(--spacing-7, 24px);padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-none, 0px);-webkit-tap-highlight-color:transparent;position:relative;overflow:hidden;cursor:default}:host([type="link"]) .row{cursor:pointer}:host([density="-2"]) .row,:host-context([data-density="-2"]) .row{padding-block:var(--spacing-5, 16px)}:host([density="-4"]) .row,:host-context([data-density="-4"]) .row{padding-block:var(--spacing-4, 12px)}md-ripple{border-radius:inherit;inset:0;position:absolute;pointer-events:none}.material-icon{display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-icon.scb-svg-icon{fill:currentColor;font:inherit}.leading{align-self:center;display:grid;place-items:center}.img{width:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));height:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));object-fit:contain;border-radius:var(--radius-s, 8px);filter:var(--scb-list-leading-image-filter, none)}.texts{display:grid;gap:var(--spacing-1, 2px);min-inline-size:0}.label,.overline,.supporting-text{font-family:var(--brand-font);font-size:var(--md-sys-typescale-label-medium-size);line-height:var(--md-sys-typescale-label-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-label-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.label,.supporting-text{font-size:var(--md-sys-typescale-title-large-size);line-height:var(--md-sys-typescale-title-large-line-height);font-weight:var(--weight-semibold);letter-spacing:var(--md-sys-typescale-title-large-tracking);color:var(--md-sys-color-on-surface)}.supporting-text{font-size:var(--md-sys-typescale-body-medium-size);line-height:var(--md-sys-typescale-body-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-body-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.label ::slotted(*),.supporting-text ::slotted(*){color:inherit!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;font-weight:inherit!important;letter-spacing:inherit!important;margin-block:0!important;margin-inline:0!important}.trailing{margin-left:auto;align-self:center;display:flex}.trailing.trailing-switch{justify-content:flex-end}.trailing scb-checkbox{margin-inline-end:var(--scb-list-trailing-checkbox-nudge)}:host([trailing-variant="checkbox"]) .row,:host([trailing-variant="switch"]) .row{cursor:pointer}:host([disabled]) .row{cursor:default}.link{text-decoration:none;color:inherit;display:flex;width:100%;gap:12px}`}async firstUpdated(){await this.__ensureDepsLoaded(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("focusout",this.__onFocusOut),this.addEventListener("pointerdown",this.__onPointerDown,!0),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.addEventListener("keydown",this.__onKeydown)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("focusout",this.__onFocusOut),this.removeEventListener("pointerdown",this.__onPointerDown,!0),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.removeEventListener("keydown",this.__onKeydown),this.__focusVisibleRaf!==null&&(cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=null),super.disconnectedCallback()}updated(s){super.updated(s),(s.has("leading")||s.has("leadingVariant")||s.has("trailing")||s.has("trailingVariant")||s.has("type")||s.has("target"))&&this.__ensureDepsLoaded()}async __ensureDepsLoaded(){this.trailing&&this.trailingVariant==="checkbox"&&!this.__scbCheckboxLoaded&&(await u(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18]),import.meta.url),this.__scbCheckboxLoaded=!0),this.trailing&&this.trailingVariant==="switch"&&!this.__scbSwitchLoaded&&(await u(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([19,5,7,8,9,1,10,11,12,13,14,15,16,17]),import.meta.url),this.__scbSwitchLoaded=!0)}__ensureRipple(s){if(!(this.type!=="link"||this.disabled)){if(s&&(this.__pendingRippleEvent=s),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,m().then(({ensureRippleReady:t})=>t()).then(()=>{this.disabled||(this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple()))}))}}__scheduleFocusVisibleSync(){this.__focusVisibleRaf!==null&&cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=requestAnimationFrame(()=>{this.__focusVisibleRaf=null;const s=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=this.matches(":focus-visible")||s instanceof HTMLElement&&s.matches(":focus-visible");this.toggleAttribute("data-focus-visible",t),t&&this.__ensureFocusRing()})}__ensureFocusRing(){this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,v().then(({ensureFocusRingReady:s})=>s()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}__setTrailingSwitchSelected(s,t){this.trailingSwitchSelected=s,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:s},bubbles:!0,composed:!0}))}render(){const s=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?o`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>`:n;case"avatar":return o`
3
3
  <div class="leading">
4
4
  <scb-avatar
5
5
  label=${this.avatarLabel}
@@ -25,7 +25,7 @@ import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";im
25
25
  @click=${h=>h.stopPropagation()}
26
26
  @change=${this.__onTrailingSwitchChange}
27
27
  ></scb-switch>
28
- </div>`);else this.type==="link"&&(c=o`<div class="trailing"><span class="material-icon" aria-hidden="true">${r}</span></div>`);const m=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":n,v=o`
28
+ </div>`);else this.type==="link"&&(c=o`<div class="trailing"><span class="material-icon" aria-hidden="true">${r}</span></div>`);const b=this.type==="link"&&this.target==="_blank"?"noopener noreferrer":n,f=o`
29
29
  ${s}
30
30
  <div class="texts">
31
31
  ${this.overline?o`<div class="overline">${this.overline}</div>`:n}
@@ -42,7 +42,7 @@ import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";im
42
42
  ?inert=${this.disabled}
43
43
  aria-disabled=${this.disabled?"true":"false"}
44
44
  >
45
- ${this.type==="link"&&t?o`<a class="link" href=${t} target=${this.target||n} rel=${m}>${v}</a>`:v}
45
+ ${this.type==="link"&&t?o`<a class="link" href=${t} target=${this.target||n} rel=${b}>${f}</a>`:f}
46
46
  ${this.type==="link"&&this.__rippleLoaded?o`<md-ripple></md-ripple>`:n}
47
47
  </div>
48
48
 
@@ -1,9 +1,9 @@
1
- import{h as b,m,p as o,v as i,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as d}from"../../vendor/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var c=customElements.define.bind(customElements);customElements.define=function(a,h,p){try{customElements.get(a)||c(a,h,p)}catch(r){var l=String(r||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var n,e=(n=class extends b{constructor(...c){super(...c),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",d)}disconnectedCallback(){this.removeEventListener("focusin",d),super.disconnectedCallback()}render(){return i`
1
+ import{h as m,m as b,p as i,v as o,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as d}from"../../vendor/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(a,h,p){try{customElements.get(a)||n(a,h,p)}catch(l){var r=String(l||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var c,e=(c=class extends m{constructor(...n){super(...n),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",d)}disconnectedCallback(){this.removeEventListener("focusin",d),super.disconnectedCallback()}render(){return o`
2
2
  <div class="item ${this.checked?"checked":""}" ?aria-disabled=${this.disabled}>
3
3
  <md-ripple></md-ripple>
4
- ${this.showCheckbox?i`<md-icon class="${this.checked?"checkbox-checked":""}" aria-hidden="true">${this.checked?"check_box":"check_box_outline_blank"}</md-icon>`:null}
5
- ${this.showRadio?i`<md-icon class="${this.checked?"radio-checked":""}" aria-hidden="true">${this.checked?"radio_button_checked":"radio_button_unchecked"}</md-icon>`:null}
6
- <div class="label">${this.label?this.label:i`<slot></slot>`}</div>
4
+ ${this.showCheckbox?o`<md-icon class="${this.checked?"checkbox-checked":""}" aria-hidden="true">${this.checked?"check_box":"check_box_outline_blank"}</md-icon>`:null}
5
+ ${this.showRadio?o`<md-icon class="${this.checked?"radio-checked":""}" aria-hidden="true">${this.checked?"radio_button_checked":"radio_button_unchecked"}</md-icon>`:null}
6
+ <div class="label">${this.label?this.label:o`<slot></slot>`}</div>
7
7
  <md-focus-ring inward></md-focus-ring>
8
8
  </div>
9
- `}},n.styles=u`:host{display:block;outline:0}:host([hidden]){display:none}:host([disabled]){pointer-events:none;opacity:.38}:host(:focus-visible) .item{outline:2px solid var(--md-sys-color-primary);outline-offset:-2px}:host([data-focused]) .item{background-color:var(--md-sys-color-surface-container)}.item{display:flex;align-items:center;padding:var(--scb-select-option-padding-y, var(--spacing-3)) var(--scb-select-option-padding-x, var(--spacing-5));gap:var(--scb-select-option-gap, var(--spacing-4));min-height:var(--scb-select-option-min-height, 40px);position:relative;font-size:var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));line-height:var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));letter-spacing:var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking))}.label{min-width:0;flex:1 1 auto}md-icon{font-size:var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));line-height:1;flex:0 0 auto}md-focus-ring{border-radius:var(--md-sys-shape-corner-small)}.item.checked{background-color:var(--md-sys-color-secondary-container)}:host([no-highlight-selected]) .item.checked{background-color:transparent}md-icon.radio-checked{color:var(--md-sys-color-primary)}`,n);t([o({type:String})],e.prototype,"value",void 0);t([o({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);t([o({type:Boolean})],e.prototype,"showCheckbox",void 0);t([o({type:Boolean})],e.prototype,"checked",void 0);t([o({type:Boolean})],e.prototype,"showRadio",void 0);t([o({type:String})],e.prototype,"label",void 0);t([o({type:Boolean,attribute:"no-highlight-selected",reflect:!0})],e.prototype,"noHighlightSelected",void 0);e=t([m("scb-select-option")],e);
9
+ `}},c.styles=u`:host{display:block;outline:0}:host([hidden]){display:none}:host([disabled]){pointer-events:none;opacity:.38}:host(:focus-visible) .item{outline:2px solid var(--md-sys-color-primary);outline-offset:-2px}:host([data-focused]) .item{background-color:var(--md-sys-color-surface-container)}.item{display:flex;align-items:center;padding:var(--scb-select-option-padding-y, var(--spacing-3)) var(--scb-select-option-padding-x, var(--spacing-5));gap:var(--scb-select-option-gap, var(--spacing-4));min-height:var(--scb-select-option-min-height, 40px);position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, Inter, Arial, sans-serif);font-size:var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));line-height:var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));font-weight:var(--scb-select-option-font-weight, var(--md-sys-typescale-body-large-weight));letter-spacing:var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking))}.label{min-width:0;flex:1 1 auto}.label ::slotted(*){color:inherit!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;font-weight:inherit!important;letter-spacing:inherit!important;margin-block:0!important;margin-inline:0!important}md-icon{font-size:var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));line-height:1;flex:0 0 auto}md-focus-ring{border-radius:var(--md-sys-shape-corner-small)}.item.checked{background-color:var(--md-sys-color-secondary-container)}:host([no-highlight-selected]) .item.checked{background-color:transparent}md-icon.radio-checked{color:var(--md-sys-color-primary)}`,c);t([i({type:String})],e.prototype,"value",void 0);t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);t([i({type:Boolean})],e.prototype,"showCheckbox",void 0);t([i({type:Boolean})],e.prototype,"checked",void 0);t([i({type:Boolean})],e.prototype,"showRadio",void 0);t([i({type:String})],e.prototype,"label",void 0);t([i({type:Boolean,attribute:"no-highlight-selected",reflect:!0})],e.prototype,"noHighlightSelected",void 0);e=t([b("scb-select-option")],e);
@@ -1,5 +1,5 @@
1
- import{h as g,m as _,p as b,v,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as f}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,t){try{customElements.get(s)||e(s,r,t)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,w=96,S=32,m=(p=class extends g{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return v`
1
+ import{h as g,m as _,p as b,v,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as f}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var y=typeof globalThis<"u"?globalThis:window;if(!y.__scb_ce_guard_installed__){y.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,r,e){try{customElements.get(s)||t(s,r,e)}catch(a){var l=String(a||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,w=96,S=32,m=(p=class extends g{constructor(...t){super(...t),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return v`
2
2
  <div class="scb-table-scroll-wrapper">
3
3
  <slot @slotchange=${this._onSlotChange}></slot>
4
4
  </div>
5
- `}firstUpdated(){const 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()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const e=this.shadowRoot?.querySelector("slot");if(!e)return null;const s=e.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const t=r,l=t.tagName.toLowerCase()==="tbody"?t:t.querySelector("tbody");if(l)return l}return null}_getTables(){const e=this.shadowRoot?.querySelector("slot");if(!e)return[];const s=e.assignedNodes({flatten:!0}),r=[];return s.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const l=t;l.tagName.toLowerCase()==="table"&&r.push(l),r.push(...Array.from(l.querySelectorAll("table")))}}),r}_attachThListeners(){const e=this.shadowRoot?.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0}),r=[],t=[],l=[],a=[];s.forEach(o=>{o.nodeType===Node.ELEMENT_NODE&&(r.push(...o.querySelectorAll("thead")),t.push(...o.querySelectorAll("th")),l.push(...o.querySelectorAll("td")),a.push(...o.querySelectorAll("tr")))}),r.forEach(o=>{o.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),t.forEach((o,i)=>{o.style.textAlign="left",o.style.padding="12px",o.style.position="relative",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-label-medium-font)",o.style.fontSize="var(--md-sys-typescale-label-medium-size)",o.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",o.style.fontWeight=" var(--weight-bold)",o.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",o.style.verticalAlign="bottom",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual";const c=(o.textContent??"").replace(/\s+/g," ").trim();for(;o.firstChild;)o.removeChild(o.firstChild);const u=document.createElement("p");if(u.textContent=c,u.style.margin="0",this.dataSorting){const d=document.createElement("scb-icon-button");d.className="scb-sort-icon",d.onclick=()=>this._onThClick(i),d.setAttribute("variant","standard"),d.setAttribute("size","small"),d.style.alignSelf="end",this._sortedColumn===i?(d.setAttribute("variant","filled-tonal"),d.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(d.setAttribute("icon","swap_horiz"),d.style.transform+=" rotate(90deg)");const h=document.createElement("div");h.style.display="flex",h.style.gap="8px",h.style.flexWrap="nowrap",h.style.alignItems="center",h.appendChild(u),h.appendChild(d),o.appendChild(h)}else o.appendChild(u)}),l.forEach(o=>{o.style.padding="12px",o.style.textAlign="left",o.style.borderTop="1px solid var(--md-sys-color-outline-variant)",o.style.verticalAlign="text-top",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-body-medium-font)",o.style.fontSize="var(--md-sys-typescale-body-medium-size)",o.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",o.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",o.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual"}),a.forEach(o=>{const i=Array.from(o.cells);i.forEach((c,u)=>{c.style.borderRight=u===i.length-1?"none":"1px solid var(--md-sys-color-on-surface)"})});const n=this._getTbody();n&&Array.from(n.querySelectorAll("tr")).forEach((o,i)=>{const c=i%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";Array.from(o.cells).forEach(u=>{u.style.backgroundColor=c})}),this._queueColumnWidthUpdate()}_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;const s=Array.from(e.querySelectorAll("thead tr")),r=s[s.length-1];if(!r)return;const t=Array.from(r.cells).map((a,n)=>{const o=this._measureCellContentWidth(a),i=this._measureColumnReadableBodyWidth(e,n),c=Math.max(o,i);return`${Math.ceil(c>0?Math.max(c,w):0)}px`}),l=t.reduce((a,n)=>a+parseFloat(n),0);this._applyGeneratedColGroup(e,t),e.style.tableLayout="fixed",e.style.width=`${Math.ceil(l)}px`,e.style.minWidth=`${Math.ceil(l)}px`,e.style.maxWidth="none"})}_applyGeneratedColGroup(e,s){const r=document.createElement("colgroup");r.setAttribute("data-scb-generated-column-widths","true"),s.forEach(t=>{const l=document.createElement("col");l.style.width=t,l.style.minWidth=t,r.appendChild(l)}),e.insertBefore(r,e.firstChild)}_removeGeneratedColGroup(e){e.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(e){const s=e.firstElementChild?.cloneNode(!0)??document.createElement("span");e.firstElementChild||(s.textContent=e.textContent??"");const r=window.getComputedStyle(e),t=document.createElement("div");t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width="max-content",t.style.maxWidth="none",t.style.whiteSpace="nowrap",t.style.fontFamily=r.fontFamily,t.style.fontSize=r.fontSize,t.style.fontWeight=r.fontWeight,t.style.lineHeight=r.lineHeight,t.style.letterSpacing=r.letterSpacing,s instanceof HTMLElement&&(s.style.width="max-content",s.style.maxWidth="none",s.style.whiteSpace="nowrap"),t.appendChild(s),document.body.appendChild(t);const l=parseFloat(r.paddingLeft||"0"),a=parseFloat(r.paddingRight||"0"),n=parseFloat(r.borderLeftWidth||"0"),o=parseFloat(r.borderRightWidth||"0"),i=t.getBoundingClientRect().width+l+a+n+o;return document.body.removeChild(t),i}_measureColumnReadableBodyWidth(e,s){return Array.from(e.querySelectorAll("tbody tr")).reduce((r,t)=>{const l=t.cells[s];if(!l)return r;const a=(l.textContent??"").replace(/\s+/g," ").trim().split(" ").filter(Boolean).reduce((o,i)=>Math.max(o,this._measureCellTextWidth(l,i)),0),n=a>0?a+S:0;return Math.max(r,n)},0)}_measureCellTextWidth(e,s){const r=window.getComputedStyle(e),t=document.createElement("span");t.textContent=s,t.style.position="absolute",t.style.left="-99999px",t.style.top="0",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.whiteSpace="nowrap",t.style.fontFamily=r.fontFamily,t.style.fontSize=r.fontSize,t.style.fontWeight=r.fontWeight,t.style.lineHeight=r.lineHeight,t.style.letterSpacing=r.letterSpacing,document.body.appendChild(t);const l=parseFloat(r.paddingLeft||"0"),a=parseFloat(r.paddingRight||"0"),n=parseFloat(r.borderLeftWidth||"0"),o=parseFloat(r.borderRightWidth||"0"),i=t.getBoundingClientRect().width+l+a+n+o;return document.body.removeChild(t),i}_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})))}_sortTable(e,s){const r=this._getTbody();if(!r)return;const t=Array.from(r.querySelectorAll("tr"));t.sort((l,a)=>{const n=this._getCellSortableValue(l.children[e]),o=this._getCellSortableValue(a.children[e]);return this._compareCellValues(n,o,s)}),t.forEach(l=>r.appendChild(l))}_getCellSortableValue(e){if(!e)return"";const s=e,r=this._getSortableAttributeValue(s);if(r)return r;const t=[],l=s.textContent?.replace(/\s+/g," ").trim();return l&&t.push(l),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(a=>{const n=this._getSortableAttributeValue(a);n&&!t.includes(n)&&t.push(n)}),t.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,s,r){const t=this._parseSortableNumber(e),l=this._parseSortableNumber(s);if(t!==null&&l!==null)return r==="asc"?t-l:l-t;const a=Date.parse(e.replace(/\s+/g," ")),n=Date.parse(s.replace(/\s+/g," "));if(!isNaN(a)&&!isNaN(n))return r==="asc"?a-n:n-a;const o=e.localeCompare(s,"sv");return r==="asc"?o:-o}_parseSortableNumber(e){const s=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}},p.styles=C`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, Inter, Arial, sans-serif)}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;min-width:100%;overflow:hidden}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,p);f([b({type:Boolean,attribute:"data-sorting"})],m.prototype,"dataSorting",void 0);f([b({type:String,attribute:"column-width-mode"})],m.prototype,"columnWidthMode",void 0);m=f([_("scb-table")],m);
5
+ `}firstUpdated(){const t=this.shadowRoot?.querySelector("slot");t&&(t.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners())}updated(t){t.has("dataSorting")&&(this.dataSorting||(this._sortedColumn=null,this._sortDirection="asc"),this._attachThListeners()),t.has("columnWidthMode")&&this._queueColumnWidthUpdate()}disconnectedCallback(){super.disconnectedCallback(),this._columnWidthFrame!==null&&(cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=null)}_getTbody(){const t=this.shadowRoot?.querySelector("slot");if(!t)return null;const s=t.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const e=r,l=e.tagName.toLowerCase()==="tbody"?e:e.querySelector("tbody");if(l)return l}return null}_getTables(){const t=this.shadowRoot?.querySelector("slot");if(!t)return[];const s=t.assignedNodes({flatten:!0}),r=[];return s.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){const l=e;l.tagName.toLowerCase()==="table"&&r.push(l),r.push(...Array.from(l.querySelectorAll("table")))}}),r}_attachThListeners(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const s=t.assignedNodes({flatten:!0}),r=[],e=[],l=[],a=[];s.forEach(o=>{o.nodeType===Node.ELEMENT_NODE&&(r.push(...o.querySelectorAll("thead")),e.push(...o.querySelectorAll("th")),l.push(...o.querySelectorAll("td")),a.push(...o.querySelectorAll("tr")))}),r.forEach(o=>{o.style.borderTop="1px solid var(--md-sys-color-on-surface)"}),e.forEach((o,n)=>{o.style.textAlign="left",o.style.padding="12px",o.style.position="relative",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-label-medium-font)",o.style.fontSize="var(--md-sys-typescale-label-medium-size)",o.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",o.style.fontWeight="var(--weight-bold)",o.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",o.style.verticalAlign="bottom",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual";const c=(o.textContent??"").replace(/\s+/g," ").trim();for(;o.firstChild;)o.removeChild(o.firstChild);const u=document.createElement("p");if(u.textContent=c,this._applyGeneratedCellTextReset(u),this.dataSorting){const d=document.createElement("scb-icon-button");d.className="scb-sort-icon",d.onclick=()=>this._onThClick(n),d.setAttribute("variant","standard"),d.setAttribute("size","small"),d.style.alignSelf="end",this._sortedColumn===n?(d.setAttribute("variant","filled-tonal"),d.setAttribute("icon",this._sortDirection==="asc"?"arrow_downward":"arrow_upward")):(d.setAttribute("icon","swap_horiz"),d.style.transform+=" rotate(90deg)");const h=document.createElement("div");h.style.display="flex",h.style.gap="8px",h.style.flexWrap="nowrap",h.style.alignItems="center",h.appendChild(u),h.appendChild(d),o.appendChild(h)}else o.appendChild(u)}),l.forEach(o=>{o.style.padding="12px",o.style.textAlign="left",o.style.borderTop="1px solid var(--md-sys-color-outline-variant)",o.style.verticalAlign="text-top",o.style.backgroundColor="var(--md-sys-color-surface)",o.style.fontFamily="var(--md-sys-typescale-body-medium-font)",o.style.fontSize="var(--md-sys-typescale-body-medium-size)",o.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",o.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",o.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)",o.style.borderRight="1px solid var(--md-sys-color-on-surface)",o.style.borderBottom="1px solid var(--md-sys-color-on-surface)",o.style.overflowWrap="normal",o.style.wordBreak="normal",o.style.hyphens="manual"}),a.forEach(o=>{const n=Array.from(o.cells);n.forEach((c,u)=>{c.style.borderRight=u===n.length-1?"none":"1px solid var(--md-sys-color-on-surface)"})});const i=this._getTbody();i&&Array.from(i.querySelectorAll("tr")).forEach((o,n)=>{const c=n%2===0?"var(--md-sys-color-surface-container)":"var(--md-sys-color-surface)";Array.from(o.cells).forEach(u=>{u.style.backgroundColor=c})}),this._queueColumnWidthUpdate()}_applyGeneratedCellTextReset(t){t.style.margin="0",t.style.color="inherit",t.style.fontFamily="inherit",t.style.fontSize="inherit",t.style.lineHeight="inherit",t.style.fontWeight="inherit",t.style.letterSpacing="inherit"}_queueColumnWidthUpdate(){this._columnWidthFrame!==null&&cancelAnimationFrame(this._columnWidthFrame),this._columnWidthFrame=requestAnimationFrame(()=>{this._columnWidthFrame=null,this._applyColumnWidthMode()})}_applyColumnWidthMode(){this._getTables().forEach(t=>{if(this._removeGeneratedColGroup(t),t.style.tableLayout="",t.style.width="",t.style.minWidth="",t.style.maxWidth="",this.columnWidthMode!=="header")return;const s=Array.from(t.querySelectorAll("thead tr")),r=s[s.length-1];if(!r)return;const e=Array.from(r.cells).map((a,i)=>{const o=this._measureCellContentWidth(a),n=this._measureColumnReadableBodyWidth(t,i),c=Math.max(o,n);return`${Math.ceil(c>0?Math.max(c,w):0)}px`}),l=e.reduce((a,i)=>a+parseFloat(i),0);this._applyGeneratedColGroup(t,e),t.style.tableLayout="fixed",t.style.width=`${Math.ceil(l)}px`,t.style.minWidth=`${Math.ceil(l)}px`,t.style.maxWidth="none"})}_applyGeneratedColGroup(t,s){const r=document.createElement("colgroup");r.setAttribute("data-scb-generated-column-widths","true"),s.forEach(e=>{const l=document.createElement("col");l.style.width=e,l.style.minWidth=e,r.appendChild(l)}),t.insertBefore(r,t.firstChild)}_removeGeneratedColGroup(t){t.querySelector('colgroup[data-scb-generated-column-widths="true"]')?.remove()}_measureCellContentWidth(t){const s=t.firstElementChild?.cloneNode(!0)??document.createElement("span");t.firstElementChild||(s.textContent=t.textContent??"");const r=window.getComputedStyle(t),e=document.createElement("div");e.style.position="absolute",e.style.left="-99999px",e.style.top="0",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.width="max-content",e.style.maxWidth="none",e.style.whiteSpace="nowrap",e.style.fontFamily=r.fontFamily,e.style.fontSize=r.fontSize,e.style.fontWeight=r.fontWeight,e.style.lineHeight=r.lineHeight,e.style.letterSpacing=r.letterSpacing,s instanceof HTMLElement&&(s.style.width="max-content",s.style.maxWidth="none",s.style.whiteSpace="nowrap"),e.appendChild(s),document.body.appendChild(e);const l=parseFloat(r.paddingLeft||"0"),a=parseFloat(r.paddingRight||"0"),i=parseFloat(r.borderLeftWidth||"0"),o=parseFloat(r.borderRightWidth||"0"),n=e.getBoundingClientRect().width+l+a+i+o;return document.body.removeChild(e),n}_measureColumnReadableBodyWidth(t,s){return Array.from(t.querySelectorAll("tbody tr")).reduce((r,e)=>{const l=e.cells[s];if(!l)return r;const a=(l.textContent??"").replace(/\s+/g," ").trim().split(" ").filter(Boolean).reduce((o,n)=>Math.max(o,this._measureCellTextWidth(l,n)),0),i=a>0?a+S:0;return Math.max(r,i)},0)}_measureCellTextWidth(t,s){const r=window.getComputedStyle(t),e=document.createElement("span");e.textContent=s,e.style.position="absolute",e.style.left="-99999px",e.style.top="0",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.whiteSpace="nowrap",e.style.fontFamily=r.fontFamily,e.style.fontSize=r.fontSize,e.style.fontWeight=r.fontWeight,e.style.lineHeight=r.lineHeight,e.style.letterSpacing=r.letterSpacing,document.body.appendChild(e);const l=parseFloat(r.paddingLeft||"0"),a=parseFloat(r.paddingRight||"0"),i=parseFloat(r.borderLeftWidth||"0"),o=parseFloat(r.borderRightWidth||"0"),n=e.getBoundingClientRect().width+l+a+i+o;return document.body.removeChild(e),n}_onThClick(t){this.dataSorting&&(this._sortedColumn===t?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=t,this._sortDirection="asc"),this._sortTable(t,this._sortDirection),this._attachThListeners(),this.dispatchEvent(new CustomEvent("tablesortchange",{detail:{sortedColumn:this._sortedColumn,sortDirection:this._sortDirection},bubbles:!0,composed:!0})))}_sortTable(t,s){const r=this._getTbody();if(!r)return;const e=Array.from(r.querySelectorAll("tr"));e.sort((l,a)=>{const i=this._getCellSortableValue(l.children[t]),o=this._getCellSortableValue(a.children[t]);return this._compareCellValues(i,o,s)}),e.forEach(l=>r.appendChild(l))}_getCellSortableValue(t){if(!t)return"";const s=t,r=this._getSortableAttributeValue(s);if(r)return r;const e=[],l=s.textContent?.replace(/\s+/g," ").trim();return l&&e.push(l),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(a=>{const i=this._getSortableAttributeValue(a);i&&!e.includes(i)&&e.push(i)}),e.join(" ").trim()}_getSortableAttributeValue(t){return(t.getAttribute("data-sort-value")??t.getAttribute("data-sort")??t.getAttribute("aria-label")??t.getAttribute("label")??t.getAttribute("value")??t.getAttribute("title")??"").replace(/\s+/g," ").trim()}_compareCellValues(t,s,r){const e=this._parseSortableNumber(t),l=this._parseSortableNumber(s);if(e!==null&&l!==null)return r==="asc"?e-l:l-e;const a=Date.parse(t.replace(/\s+/g," ")),i=Date.parse(s.replace(/\s+/g," "));if(!isNaN(a)&&!isNaN(i))return r==="asc"?a-i:i-a;const o=t.localeCompare(s,"sv");return r==="asc"?o:-o}_parseSortableNumber(t){const s=t.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}},p.styles=C`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, Inter, Arial, sans-serif)}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;min-width:100%;overflow:hidden}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,p);f([b({type:Boolean,attribute:"data-sorting"})],m.prototype,"dataSorting",void 0);f([b({type:String,attribute:"column-width-mode"})],m.prototype,"columnWidthMode",void 0);m=f([_("scb-table")],m);
@@ -1,4 +1,4 @@
1
- import{h as _,m,p as b,v as p,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,a){try{customElements.get(s)||e(s,r,a)}catch(t){var l=String(t||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw t}}}}catch{}})();var g,d=(g=class extends _{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,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._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=s=>{const r=s.detail;r&&typeof r.page=="number"&&this._changePage(r.page)}}disconnectedCallback(){super.disconnectedCallback(),this._disconnectTbodyObserver()}attributeChangedCallback(e,s,r){if(super.attributeChangedCallback(e,s,r),s!==r){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return p`
1
+ import{h as _,m,p as b,v as p,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,a){try{customElements.get(s)||e(s,r,a)}catch(t){var l=String(t||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw t}}}}catch{}})();var y,d=(y=class extends _{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,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._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=s=>{const r=s.detail;r&&typeof r.page=="number"&&this._changePage(r.page)}}disconnectedCallback(){super.disconnectedCallback(),this._disconnectTbodyObserver()}attributeChangedCallback(e,s,r){if(super.attributeChangedCallback(e,s,r),s!==r){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return p`
2
2
  ${this.filteringSearch?p`
3
3
  <div style="margin-bottom: 12px;">
4
4
  <scb-search
@@ -22,4 +22,4 @@ import{h as _,m,p as b,v as p,y as v}from"../../vendor/vendor.js";import"../../v
22
22
  ></scb-pagination>
23
23
  `:""}
24
24
  </div>
25
- `}_onSearchInput(e){const s=e.target.value;this.searchTerm=s,this._filterTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const o=i.querySelector("tbody");o&&(r=o)}}),!r)return;const a=r,l=this._getTopLevelRows(a),t=this.searchTerm.trim().toLowerCase();if(!t)this._filteredRows=null,l.forEach(i=>i.style.display=""),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=l.filter(o=>this._getRowSearchText(o).toLowerCase().includes(t)),l.forEach(o=>o.style.display="none");let i=this._filteredRows;this._sortedColumn!==null&&(i=[...i],i.sort((o,c)=>{const h=this._getCellSortableValue(o.children[this._sortedColumn]),n=this._getCellSortableValue(c.children[this._sortedColumn]);return this._compareCellValues(h,n,this._sortDirection)}),this._filteredRows=i),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(o=>o.style.display="")}}firstUpdated(){const e=this.shadowRoot.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has("searchTerm")||e.has("currentPage")||e.has("pageSize")||e.has("filteringSearch")||e.has("pagination"))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&(this._tbodyObserver.disconnect(),this._tbodyObserver=null),this._observedTbody=null}_attachTbodyObserver(){const 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(){const e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),s=Math.min(Math.max(1,this.currentPage),e);s!==this.currentPage&&(this.currentPage=s)}_getTbody(){const e=this.shadowRoot.querySelector("slot");if(!e)return null;const s=e.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const a=r.querySelector("tbody");if(a)return a}return null}_getTopLevelRows(e){return Array.from(e.children).filter(s=>s instanceof HTMLTableRowElement)}_attachThListeners(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0}),r=[],a=[],l=[];s.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(r.push(...t.querySelectorAll("th")),a.push(...t.querySelectorAll("td")),l.push(...t.querySelectorAll("tr")))}),r.forEach((t,i)=>{t.style.textAlign="left",t.style.padding="16px 0px 16px 32px",t.style.position="relative",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-label-medium-font)",t.style.fontSize="var(--md-sys-typescale-label-medium-size)",t.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-label-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",t.style.verticalAlign="bottom";const o=t.firstChild;if(o&&o.nodeType===Node.TEXT_NODE&&o.textContent?.trim()||o&&o.nodeType===Node.ELEMENT_NODE&&o.tagName.toLowerCase()!=="p"){const h=document.createElement("p");h.textContent=o.textContent?o.textContent.trim():"",h.style.margin="0",t.replaceChild(h,o),t.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(y=>y.remove());const n=document.createElement("scb-icon-button");n.className="scb-sort-icon",n.onclick=()=>this._onThClick(i),n.setAttribute("variant","standard"),n.setAttribute("size","small"),this._sortedColumn===i?(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)",n.style.alignSelf="end");var c=document.createElement("div");c.style.display="flex",c.style.gap="8px",c.style.flexWrap="nowrap",c.style.alignItems="center",c.appendChild(h),c.appendChild(n),t.appendChild(c)}}),a.forEach(t=>{t.style.padding="16px 0px 16px 32px",t.style.textAlign="left",t.style.borderTop="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="text-top",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-body-medium-font)",t.style.fontSize="var(--md-sys-typescale-body-medium-size)",t.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)"}),l.forEach((t,i)=>{i%2===1&&t.querySelectorAll("td").forEach(h=>{h.style.backgroundColor="var(--scb-background-row)"});const o=t.querySelectorAll("th");o.length>0&&o.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===o.length-1?h.style.paddingRight="24px":h.style.paddingRight=""});const c=t.querySelectorAll("td");c.length>0&&c.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===c.length-1?h.style.paddingRight="24px":h.style.paddingRight=""})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,s){const r=this.shadowRoot.querySelector("slot");if(!r)return;const a=r.assignedNodes({flatten:!0});let l=null;if(a.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const c=o.querySelector("tbody");c&&(l=c)}}),!l)return;let t;this._filteredRows?t=[...this._filteredRows]:t=this._getTopLevelRows(l),t.sort((o,c)=>{const h=this._getCellSortableValue(o.children[e]),n=this._getCellSortableValue(c.children[e]);return this._compareCellValues(h,n,s)});const i=this._tbodyObserver!==null;i&&this._disconnectTbodyObserver();try{t.forEach(o=>l.appendChild(o))}finally{i&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=t,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(s=>this._getCellSortableValue(s)).join(" ")}_getCellSortableValue(e){if(!e)return"";const s=e,r=this._getSortableAttributeValue(s);if(r)return r;const a=[],l=s.textContent?.replace(/\s+/g," ").trim();return l&&a.push(l),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(t=>{const i=this._getSortableAttributeValue(t);i&&!a.includes(i)&&a.push(i)}),a.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,s,r){const a=this._parseSortableNumber(e),l=this._parseSortableNumber(s);if(a!==null&&l!==null)return r==="asc"?a-l:l-a;const t=Date.parse(e.replace(/\s+/g," ")),i=Date.parse(s.replace(/\s+/g," "));if(!isNaN(t)&&!isNaN(i))return r==="asc"?t-i:i-t;const o=e.localeCompare(s,"sv");return r==="asc"?o:-o}_parseSortableNumber(e){const s=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}_updateTotalRows(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;s.forEach(a=>{if(a.nodeType===Node.ELEMENT_NODE){const l=a.querySelector("tbody");l&&(r=l)}}),r&&(this.totalRows=this._getTopLevelRows(r).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const o=i.querySelector("tbody");o&&(r=o)}}),!r)return;let a;this._filteredRows?a=this._filteredRows:a=this._getTopLevelRows(r),this._getTopLevelRows(r).forEach(i=>i.style.display="none");const l=(this.currentPage-1)*this.pageSize,t=l+this.pageSize;a.slice(l,t).forEach(i=>i.style.display="")}_changePage(e){const s=Math.ceil(this.totalRows/this.pageSize);e<1||e>s||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}},g.styles=v`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, Inter, Arial, sans-serif);--scb-background-row:var(--md-sys-color-surface)}scb-search{max-width:400px}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;border-radius:24px;min-width:100%;overflow:hidden}.pagination{margin-top:16px;display:flex;justify-self:center}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,g);u([b({type:String})],d.prototype,"searchTerm",void 0);u([b({type:Boolean,attribute:"with-pagination"})],d.prototype,"pagination",void 0);u([b({type:Boolean,attribute:"with-filtering-search"})],d.prototype,"filteringSearch",void 0);u([b({type:Boolean,attribute:"no-scroll"})],d.prototype,"noScroll",void 0);u([b({type:Number,attribute:"page-size"})],d.prototype,"pageSize",void 0);u([b({type:Number})],d.prototype,"currentPage",void 0);u([b({type:Number})],d.prototype,"totalRows",void 0);d=u([m("scb-table-advanced")],d);
25
+ `}_onSearchInput(e){const s=e.target.value;this.searchTerm=s,this._filterTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0}))}_filterTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const i=o.querySelector("tbody");i&&(r=i)}}),!r)return;const a=r,l=this._getTopLevelRows(a),t=this.searchTerm.trim().toLowerCase();if(!t)this._filteredRows=null,l.forEach(o=>o.style.display=""),this._updateTotalRows(),this._ensureCurrentPageWithinBounds(),this.pagination&&this._paginateTable(),this._sortedColumn!==null&&this._sortTable(this._sortedColumn,this._sortDirection);else{this._filteredRows=l.filter(i=>this._getRowSearchText(i).toLowerCase().includes(t)),l.forEach(i=>i.style.display="none");let o=this._filteredRows;this._sortedColumn!==null&&(o=[...o],o.sort((i,c)=>{const h=this._getCellSortableValue(i.children[this._sortedColumn]),n=this._getCellSortableValue(c.children[this._sortedColumn]);return this._compareCellValues(h,n,this._sortDirection)}),this._filteredRows=o),this.totalRows=this._filteredRows.length,this._ensureCurrentPageWithinBounds(),this.pagination?this._paginateTable():this._filteredRows.forEach(i=>i.style.display="")}}firstUpdated(){const e=this.shadowRoot.querySelector("slot");e&&(e.addEventListener("slotchange",()=>this._attachThListeners()),this._attachThListeners(),this._attachTbodyObserver(),this._refreshFromTableContent())}updated(e){super.updated(e),(e.has("searchTerm")||e.has("currentPage")||e.has("pageSize")||e.has("filteringSearch")||e.has("pagination"))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_disconnectTbodyObserver(){this._tbodyObserver&&(this._tbodyObserver.disconnect(),this._tbodyObserver=null),this._observedTbody=null}_attachTbodyObserver(){const 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(){const e=Math.max(1,Math.ceil(this.totalRows/this.pageSize)),s=Math.min(Math.max(1,this.currentPage),e);s!==this.currentPage&&(this.currentPage=s)}_getTbody(){const e=this.shadowRoot.querySelector("slot");if(!e)return null;const s=e.assignedNodes({flatten:!0});for(const r of s)if(r.nodeType===Node.ELEMENT_NODE){const a=r.querySelector("tbody");if(a)return a}return null}_getTopLevelRows(e){return Array.from(e.children).filter(s=>s instanceof HTMLTableRowElement)}_attachThListeners(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0}),r=[],a=[],l=[];s.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(r.push(...t.querySelectorAll("th")),a.push(...t.querySelectorAll("td")),l.push(...t.querySelectorAll("tr")))}),r.forEach((t,o)=>{t.style.textAlign="left",t.style.padding="16px 0px 16px 32px",t.style.position="relative",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-label-medium-font)",t.style.fontSize="var(--md-sys-typescale-label-medium-size)",t.style.lineHeight="var(--md-sys-typescale-label-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-label-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-label-medium-tracking)",t.style.verticalAlign="bottom";const i=t.firstChild;if(i instanceof HTMLParagraphElement&&this._applyGeneratedCellTextReset(i),i&&i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()||i&&i.nodeType===Node.ELEMENT_NODE&&i.tagName.toLowerCase()!=="p"){const h=document.createElement("p");h.textContent=i.textContent?i.textContent.trim():"",this._applyGeneratedCellTextReset(h),t.replaceChild(h,i),t.querySelectorAll("scb-icon-button.scb-sort-icon").forEach(g=>g.remove());const n=document.createElement("scb-icon-button");n.className="scb-sort-icon",n.onclick=()=>this._onThClick(o),n.setAttribute("variant","standard"),n.setAttribute("size","small"),this._sortedColumn===o?(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)",n.style.alignSelf="end");var c=document.createElement("div");c.style.display="flex",c.style.gap="8px",c.style.flexWrap="nowrap",c.style.alignItems="center",c.appendChild(h),c.appendChild(n),t.appendChild(c)}}),a.forEach(t=>{t.style.padding="16px 0px 16px 32px",t.style.textAlign="left",t.style.borderTop="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="text-top",t.style.backgroundColor="var(--md-sys-color-surface)",t.style.fontFamily="var(--md-sys-typescale-body-medium-font)",t.style.fontSize="var(--md-sys-typescale-body-medium-size)",t.style.lineHeight="var(--md-sys-typescale-body-medium-line-height)",t.style.fontWeight="var(--md-sys-typescale-body-medium-weight)",t.style.letterSpacing="var(--md-sys-typescale-body-medium-tracking)"}),l.forEach((t,o)=>{o%2===1&&t.querySelectorAll("td").forEach(h=>{h.style.backgroundColor="var(--scb-background-row)"});const i=t.querySelectorAll("th");i.length>0&&i.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===i.length-1?h.style.paddingRight="24px":h.style.paddingRight=""});const c=t.querySelectorAll("td");c.length>0&&c.forEach((h,n)=>{n===0&&(h.style.paddingLeft="24px"),n===c.length-1?h.style.paddingRight="24px":h.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"}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection==="asc"?"desc":"asc":(this._sortedColumn=e,this._sortDirection="asc"),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,s){const r=this.shadowRoot.querySelector("slot");if(!r)return;const a=r.assignedNodes({flatten:!0});let l=null;if(a.forEach(i=>{if(i.nodeType===Node.ELEMENT_NODE){const c=i.querySelector("tbody");c&&(l=c)}}),!l)return;let t;this._filteredRows?t=[...this._filteredRows]:t=this._getTopLevelRows(l),t.sort((i,c)=>{const h=this._getCellSortableValue(i.children[e]),n=this._getCellSortableValue(c.children[e]);return this._compareCellValues(h,n,s)});const o=this._tbodyObserver!==null;o&&this._disconnectTbodyObserver();try{t.forEach(i=>l.appendChild(i))}finally{o&&this._attachTbodyObserver()}this._filteredRows&&(this._filteredRows=t,this.totalRows=this._filteredRows.length),this.pagination&&this._paginateTable()}_getRowSearchText(e){return Array.from(e.cells).map(s=>this._getCellSortableValue(s)).join(" ")}_getCellSortableValue(e){if(!e)return"";const s=e,r=this._getSortableAttributeValue(s);if(r)return r;const a=[],l=s.textContent?.replace(/\s+/g," ").trim();return l&&a.push(l),s.querySelectorAll("[data-sort-value], [data-sort], [aria-label], [label], [value], [title]").forEach(t=>{const o=this._getSortableAttributeValue(t);o&&!a.includes(o)&&a.push(o)}),a.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,s,r){const a=this._parseSortableNumber(e),l=this._parseSortableNumber(s);if(a!==null&&l!==null)return r==="asc"?a-l:l-a;const t=Date.parse(e.replace(/\s+/g," ")),o=Date.parse(s.replace(/\s+/g," "));if(!isNaN(t)&&!isNaN(o))return r==="asc"?t-o:o-t;const i=e.localeCompare(s,"sv");return r==="asc"?i:-i}_parseSortableNumber(e){const s=e.trim();if(!/^[+-]?(?:\d+|\d{1,3}(?:[\s\u00a0\u202f]\d{3})+)(?:[,.]\d+)?$/.test(s))return null;const r=Number(s.replace(/[\s\u00a0\u202f]/g,"").replace(",","."));return Number.isNaN(r)?null:r}_updateTotalRows(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;s.forEach(a=>{if(a.nodeType===Node.ELEMENT_NODE){const l=a.querySelector("tbody");l&&(r=l)}}),r&&(this.totalRows=this._getTopLevelRows(r).length,this._ensureCurrentPageWithinBounds())}_paginateTable(){const e=this.shadowRoot.querySelector("slot");if(!e)return;const s=e.assignedNodes({flatten:!0});let r=null;if(s.forEach(o=>{if(o.nodeType===Node.ELEMENT_NODE){const i=o.querySelector("tbody");i&&(r=i)}}),!r)return;let a;this._filteredRows?a=this._filteredRows:a=this._getTopLevelRows(r),this._getTopLevelRows(r).forEach(o=>o.style.display="none");const l=(this.currentPage-1)*this.pageSize,t=l+this.pageSize;a.slice(l,t).forEach(o=>o.style.display="")}_changePage(e){const s=Math.ceil(this.totalRows/this.pageSize);e<1||e>s||(this.currentPage=e,this._paginateTable(),this.dispatchEvent(new CustomEvent("tableadvancedchange",{detail:{searchTerm:this.searchTerm,currentPage:this.currentPage},bubbles:!0,composed:!0})),this.requestUpdate())}},y.styles=T`:host{display:block;color:var(--md-sys-color-on-surface);font-family:var(--brand-font, Inter, Arial, sans-serif);--scb-background-row:var(--md-sys-color-surface)}scb-search{max-width:400px}.scb-table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:auto;max-width:100%;padding-bottom:24px}.scb-table-scroll-wrapper::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:8px;width:10px}.scb-table-scroll-wrapper::-webkit-scrollbar-thumb{background:var(--md-sys-color-on-surface);border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-table-scroll-wrapper::-webkit-scrollbar-track{background:var(--md-sys-color-secondary-container);border-radius:var(--md-sys-shape-corner-large)}::slotted(table){border-collapse:collapse;border-spacing:0;border-radius:24px;min-width:100%;overflow:hidden}.pagination{margin-top:16px;display:flex;justify-self:center}::slotted(th) .scb-sort-icon{pointer-events:none}::slotted(th:hover) .scb-sort-icon{pointer-events:auto}`,y);u([b({type:String})],d.prototype,"searchTerm",void 0);u([b({type:Boolean,attribute:"with-pagination"})],d.prototype,"pagination",void 0);u([b({type:Boolean,attribute:"with-filtering-search"})],d.prototype,"filteringSearch",void 0);u([b({type:Boolean,attribute:"no-scroll"})],d.prototype,"noScroll",void 0);u([b({type:Number,attribute:"page-size"})],d.prototype,"pageSize",void 0);u([b({type:Number})],d.prototype,"currentPage",void 0);u([b({type:Number})],d.prototype,"totalRows",void 0);d=u([m("scb-table-advanced")],d);
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-button/scb-button.js","../../vendor/assertClassBrand.js","../../vendor/decorate.js","../../vendor/preload-helper.js","../../vendor/vendor.js","../../vendor/vendor-lit.js"])))=>i.map(i=>d[i]);
2
- import{g as H,h as N,i as k,m as z,p as h,v,y as I}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as R}from"../../vendor/preload-helper.js";import{t as l}from"../../vendor/decorate.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(c){var p=String(c||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var w,V=0,a=(w=class extends N{constructor(...t){super(...t),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this.maxWidth="300px",this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++V}`,this._buttonDepsLoaded=!1,this._listeningForPositionChanges=!1,this._onWindowReposition=()=>{if(!this.open)return;const e=this._getTooltipElement(),i=this._triggerEl;!e||!i||this._positionTooltip(e,i)},this._ensureButtonDepsIfNeeded=()=>{this._buttonDepsLoaded||this.querySelector('[slot="scb-tooltip-button"]')&&(this._buttonDepsLoaded=!0,R(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},this._onTriggerMouseEnter=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerFocus=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTooltipMouseEnter=()=>{this._hasTooltipContent()&&(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||this._setOpenState(!1))},this._onTriggerClick=()=>{this._hasTooltipContent()&&(this._clickActive=!this._clickActive,this._clickActive?this._setOpenState(!0):this._hoverActive||this._setOpenState(!1))}}firstUpdated(){this._originalPosition=this.position,this._updateDelayCss(),this._updateMaxWidthCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this._ensureButtonDepsIfNeeded(),this.open&&this._syncOpenState()}updated(t){if(t.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("delay")&&this._updateDelayCss(),t.has("maxWidth")&&this._updateMaxWidthCss(),(t.has("supportingtext")||t.has("label")||t.has("variant"))&&(this._hasTooltipContent()||(this._hoverActive=!1,this._clickActive=!1,this.open=!1),this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("open")){if(this.open&&!this._hasTooltipContent()){this.open=!1;return}this._syncOpenState(),this._dispatchOpenChanged()}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._detachPositionListeners()}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_syncOpenState(){const t=this._getTooltipElement();t&&(this.open?this._showTooltip(t):this._hideTooltip(t))}_setOpenState(t){if(this.open===t){t&&this._syncOpenState();return}this.open=t}_hasTooltipContent(){const t=(this.supportingtext||"").trim();return this.variant==="rich"?!!((this.label||"").trim()||t):!!t}_updateDelayCss(){const t=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${t}s`)}_updateMaxWidthCss(){const t=(this.maxWidth||"").trim(),e=t.toLowerCase()==="none",i=e?"none":t||"300px";this.style.setProperty("--max-width",i),this.style.setProperty("--wrap",e?"nowrap":"normal")}_dispatchOpenChanged(){const t={open:this.open};this.dispatchEvent(new CustomEvent("open-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("openchanged",{detail:t,bubbles:!0,composed:!0}))}_findTriggerElement(){const t=this.querySelector("[scb-tooltip-anchor]:not([slot])");return t||(Array.from(this.children).find(e=>e.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const t=this._triggerEl;t&&(this._detachTriggerListeners(),t.removeAttribute("aria-describedby"));const e=this._findTriggerElement();this._triggerEl=e,e&&this._hasTooltipContent()&&(e.setAttribute("aria-describedby",this._tooltipId),(this.trigger==="click"||this.trigger==="hover-click")&&e.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(e.addEventListener("mouseenter",this._onTriggerMouseEnter),e.addEventListener("mouseleave",this._onTriggerMouseLeave),e.addEventListener("focus",this._onTriggerFocus),e.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTooltipMouseEnter),t.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const t=this._triggerEl;t&&(t.removeEventListener("click",this._onTriggerClick),t.removeEventListener("mouseenter",this._onTriggerMouseEnter),t.removeEventListener("mouseleave",this._onTriggerMouseLeave),t.removeEventListener("focus",this._onTriggerFocus),t.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(t){if(!this._hasTooltipContent()){this.open=!1;return}this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const e=this._triggerEl;this._resetPosition(),t.classList.remove("hidden"),t.setAttribute("aria-hidden","false"),this._attachPositionListeners(),requestAnimationFrame(()=>{e&&this._positionTooltip(t,e),t.setAttribute("open","")})}_hideTooltip(t){t.removeAttribute("open"),t.setAttribute("aria-hidden","true"),this._detachPositionListeners(),this._scheduleHidden(t)}_attachPositionListeners(){this._listeningForPositionChanges||(this._listeningForPositionChanges=!0,window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}))}_detachPositionListeners(){this._listeningForPositionChanges&&(this._listeningForPositionChanges=!1,window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0))}_scheduleHidden(t){const e=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(e<=0){t.classList.add("hidden");return}this._hideTimeout=window.setTimeout(()=>{t.classList.add("hidden"),this._hideTimeout=null},e)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(t,e){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),p=(this.offset??0)+8,c=8,_=c,m=window.innerHeight-c,b=c,y=window.innerWidth-c,O=o=>o>=_&&o+s.height<=m,M=o=>o>=b&&o+s.width<=y,T=(o,r,n,g)=>{let d=0;o<n&&(d+=n-o);const S=o+r;return S>g&&(d+=S-g),d},A=o=>{let r=0,n=0;switch(o){case"top":r=i.top-s.height-p,n=i.left-(s.width-i.width)/2;break;case"bottom":r=i.bottom+p,n=i.left-(s.width-i.width)/2;break;case"left":n=i.left-s.width-p,r=i.top-(s.height-i.height)/2;break;case"right":n=i.right+p,r=i.top-(s.height-i.height)/2;break}const g=T(r,s.height,_,m),d=T(n,s.width,b,y);return{pos:o,top:r,left:n,fitsV:O(r),fitsH:M(n),totalOverflow:g+d}},x=this.position==="top"||this.position==="bottom",E=this.position,L=[E,this._getOppositePosition(E),x?"left":"top",x?"right":"bottom"].map(A);let u=L.find(o=>o.fitsV&&o.fitsH)??L.reduce((o,r)=>r.totalOverflow<o.totalOverflow?r:o);const C=(o,r,n)=>Math.min(Math.max(o,r),n),P=_,$=m-s.height,D=b,W=y-s.width,B=C(u.top,P,$),F=C(u.left,D,W);t.style.top=`${B}px`,t.style.left=`${F}px`,this.position!==u.pos&&(this.position=u.pos)}_getOppositePosition(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement(),this.open&&this._syncOpenState()}render(){const t=this._hasTooltipContent(),e=this.arrow?v`<svg
2
+ import{g as N,h as z,i as k,m as H,p as h,v,y as I}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as R}from"../../vendor/preload-helper.js";import{t as l}from"../../vendor/decorate.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,s){try{customElements.get(e)||t(e,i,s)}catch(c){var p=String(c||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var w,V=0,a=(w=class extends z{constructor(...t){super(...t),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this.maxWidth="300px",this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++V}`,this._buttonDepsLoaded=!1,this._listeningForPositionChanges=!1,this._onWindowReposition=()=>{if(!this.open)return;const e=this._getTooltipElement(),i=this._triggerEl;!e||!i||this._positionTooltip(e,i)},this._ensureButtonDepsIfNeeded=()=>{this._buttonDepsLoaded||this.querySelector('[slot="scb-tooltip-button"]')&&(this._buttonDepsLoaded=!0,R(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},this._onTriggerMouseEnter=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerFocus=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTooltipMouseEnter=()=>{this._hasTooltipContent()&&(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||this._setOpenState(!1))},this._onTriggerClick=()=>{this._hasTooltipContent()&&(this._clickActive=!this._clickActive,this._clickActive?this._setOpenState(!0):this._hoverActive||this._setOpenState(!1))}}firstUpdated(){this._originalPosition=this.position,this._updateDelayCss(),this._updateMaxWidthCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this._ensureButtonDepsIfNeeded(),this.open&&this._syncOpenState()}updated(t){if(t.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("delay")&&this._updateDelayCss(),t.has("maxWidth")&&this._updateMaxWidthCss(),(t.has("supportingtext")||t.has("label")||t.has("variant"))&&(this._hasTooltipContent()||(this._hoverActive=!1,this._clickActive=!1,this.open=!1),this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("open")){if(this.open&&!this._hasTooltipContent()){this.open=!1;return}this._syncOpenState(),this._dispatchOpenChanged()}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._detachPositionListeners()}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_syncOpenState(){const t=this._getTooltipElement();t&&(this.open?this._showTooltip(t):this._hideTooltip(t))}_setOpenState(t){if(this.open===t){t&&this._syncOpenState();return}this.open=t}_hasTooltipContent(){const t=(this.supportingtext||"").trim();return this.variant==="rich"?!!((this.label||"").trim()||t):!!t}_updateDelayCss(){const t=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${t}s`)}_updateMaxWidthCss(){const t=(this.maxWidth||"").trim(),e=t.toLowerCase()==="none",i=e?"none":t||"300px";this.style.setProperty("--max-width",i),this.style.setProperty("--wrap",e?"nowrap":"normal")}_dispatchOpenChanged(){const t={open:this.open};this.dispatchEvent(new CustomEvent("open-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("openchanged",{detail:t,bubbles:!0,composed:!0}))}_findTriggerElement(){const t=this.querySelector("[scb-tooltip-anchor]:not([slot])");return t||(Array.from(this.children).find(e=>e.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const t=this._triggerEl;t&&(this._detachTriggerListeners(),t.removeAttribute("aria-describedby"));const e=this._findTriggerElement();this._triggerEl=e,e&&this._hasTooltipContent()&&(e.setAttribute("aria-describedby",this._tooltipId),(this.trigger==="click"||this.trigger==="hover-click")&&e.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(e.addEventListener("mouseenter",this._onTriggerMouseEnter),e.addEventListener("mouseleave",this._onTriggerMouseLeave),e.addEventListener("focus",this._onTriggerFocus),e.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTooltipMouseEnter),t.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const t=this._triggerEl;t&&(t.removeEventListener("click",this._onTriggerClick),t.removeEventListener("mouseenter",this._onTriggerMouseEnter),t.removeEventListener("mouseleave",this._onTriggerMouseLeave),t.removeEventListener("focus",this._onTriggerFocus),t.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(t){if(!this._hasTooltipContent()){this.open=!1;return}this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const e=this._triggerEl;this._resetPosition(),t.classList.remove("hidden"),t.setAttribute("aria-hidden","false"),this._attachPositionListeners(),requestAnimationFrame(()=>{e&&this._positionTooltip(t,e),t.setAttribute("open","")})}_hideTooltip(t){t.removeAttribute("open"),t.setAttribute("aria-hidden","true"),this._detachPositionListeners(),this._scheduleHidden(t)}_attachPositionListeners(){this._listeningForPositionChanges||(this._listeningForPositionChanges=!0,window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}))}_detachPositionListeners(){this._listeningForPositionChanges&&(this._listeningForPositionChanges=!1,window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0))}_scheduleHidden(t){const e=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(e<=0){t.classList.add("hidden");return}this._hideTimeout=window.setTimeout(()=>{t.classList.add("hidden"),this._hideTimeout=null},e)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(t,e){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),p=(this.offset??0)+8,c=8,_=c,m=window.innerHeight-c,b=c,y=window.innerWidth-c,O=o=>o>=_&&o+s.height<=m,M=o=>o>=b&&o+s.width<=y,x=(o,r,n,g)=>{let d=0;o<n&&(d+=n-o);const S=o+r;return S>g&&(d+=S-g),d},A=o=>{let r=0,n=0;switch(o){case"top":r=i.top-s.height-p,n=i.left-(s.width-i.width)/2;break;case"bottom":r=i.bottom+p,n=i.left-(s.width-i.width)/2;break;case"left":n=i.left-s.width-p,r=i.top-(s.height-i.height)/2;break;case"right":n=i.right+p,r=i.top-(s.height-i.height)/2;break}const g=x(r,s.height,_,m),d=x(n,s.width,b,y);return{pos:o,top:r,left:n,fitsV:O(r),fitsH:M(n),totalOverflow:g+d}},T=this.position==="top"||this.position==="bottom",E=this.position,L=[E,this._getOppositePosition(E),T?"left":"top",T?"right":"bottom"].map(A);let u=L.find(o=>o.fitsV&&o.fitsH)??L.reduce((o,r)=>r.totalOverflow<o.totalOverflow?r:o);const C=(o,r,n)=>Math.min(Math.max(o,r),n),P=_,$=m-s.height,D=b,W=y-s.width,B=C(u.top,P,$),F=C(u.left,D,W);t.style.top=`${B}px`,t.style.left=`${F}px`,this.position!==u.pos&&(this.position=u.pos)}_getOppositePosition(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement(),this.open&&this._syncOpenState()}render(){const t=this._hasTooltipContent(),e=this.arrow?v`<svg
3
3
  class="scb-tooltip-arrow"
4
4
  xmlns="http://www.w3.org/2000/svg"
5
5
  width="13"
@@ -11,7 +11,7 @@ import{g as H,h as N,i as k,m as z,p as h,v,y as I}from"../../vendor/vendor.js";
11
11
  d="M6.5 6L0.5 0H12.5L6.5 6Z"
12
12
  fill="var(--md-sys-color-inverse-surface, #0F0865)"
13
13
  />
14
- </svg>`:H,i=this.label||this.supportingtext;return t?this.variant==="rich"?v`
14
+ </svg>`:N,i=this.label||this.supportingtext;return t?this.variant==="rich"?v`
15
15
  <div
16
16
  id=${this._tooltipId}
17
17
  class="scb-tooltip hidden"
@@ -46,4 +46,4 @@ import{g as H,h as N,i as k,m as z,p as h,v,y as I}from"../../vendor/vendor.js";
46
46
  ${e}
47
47
  </div>
48
48
  <slot @slotchange=${this._onDefaultSlotChange}></slot>
49
- `:v`<slot @slotchange=${this._onDefaultSlotChange}></slot>`}},w.styles=I`:host{position:relative;display:inline-block;--delay:0.25s;--max-width:300px;--wrap:normal}.scb-tooltip{position:fixed;min-width:120px;max-width:var(--max-width);width:max-content;opacity:0;z-index:var(--scb-tooltip-z-index, 1000);transition:opacity var(--delay) ease-in-out,visibility var(--delay) ease-in-out}.scb-tooltip[open]{opacity:1;visibility:visible}.hidden,.scb-tooltip{visibility:hidden}.scb-tooltip-supporting-text{font-family:var(--brand-font, Inter);font-size:var(--md-sys-typescale-body-small-size);font-style:normal;line-height:var(--md-sys-typescale-body-small-line-height);letter-spacing:var(--md-sys-typescale-body-small-tracking);white-space:var(--wrap)}:host([variant='plain']) .scb-tooltip{max-width:var(--max-width)}:host([variant='plain']) .scb-tooltip-container{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;background:var(--md-sys-color-inverse-surface);border-radius:var(--md-sys-shape-corner-extra-small);min-height:14px;width:100%}:host([variant='plain']) .scb-tooltip-supporting-text{padding:var(--spacing-2) var(--spacing-3);color:var(--md-sys-color-inverse-on-surface)}.scb-tooltip-arrow{width:12px;height:6px;position:absolute}:host([position='top']) .scb-tooltip-arrow{left:50%;bottom:-6px;transform:translateX(-50%) rotate(0deg)}:host([position='right']) .scb-tooltip-arrow{left:-9px;top:50%;transform:translateY(-50%) rotate(90deg)}:host([position='bottom']) .scb-tooltip-arrow{left:50%;top:-6px;transform:translateX(-50%) rotate(180deg)}:host([position='left']) .scb-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%) translateX(-3px) rotate(270deg)}:host([variant='plain'][arrow='false']) .scb-tooltip-arrow{display:none}:host([variant='rich']){align-items:flex-start;gap:var(--spacing-2)}:host([variant='rich']) .scb-tooltip{background:var(--md-sys-color-surface-container, #ebf8ff);box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 1px 10px 0 rgba(0,0,0,.12),0 4px 5px 0 rgba(0,0,0,.14);display:inline-flex;padding-bottom:var(--spacing-3);flex-direction:column;align-items:flex-start;gap:var(--spacing-3);border-radius:var(--md-sys-shape-corner-medium);min-width:200px;max-width:var(--max-width)}:host([variant='rich']) .scb-tooltip-text-container{display:flex;min-width:220px;padding:var(--spacing-4) var(--spacing-5) var(--spacing-2) var(--spacing-5);align-items:flex-start;gap:var(--spacing-2);flex-direction:column}:host([variant='rich']) .scb-tooltip-label{font-family:var(--brand-font, Inter);font-size:var(--md-sys-typescale-title-small-size);font-style:normal;font-weight:var(--weight-semibold);line-height:var(--md-sys-typescale-title-small-Line-Height);letter-spacing:var(--md-sys-typescale-title-small-Tracking)}:host([variant='rich']) .scb-tooltip-supporting-text{color:var(--md-sys-color-on-surface-variant, rgba(11, 5, 68, 0.75))}:host([variant='rich']) .scb-tooltip-button-container{display:flex;padding:0 var(--spacing-3);align-items:center;gap:var(--spacing-3);align-self:stretch}`,w);l([h({type:String,reflect:!0})],a.prototype,"variant",void 0);l([h({type:Boolean,reflect:!0})],a.prototype,"arrow",void 0);l([h({type:String,attribute:"supporting-text"})],a.prototype,"supportingtext",void 0);l([h({type:String})],a.prototype,"label",void 0);l([h({type:String,reflect:!0})],a.prototype,"trigger",void 0);l([h({type:String,reflect:!0})],a.prototype,"position",void 0);l([h({type:Boolean,reflect:!0})],a.prototype,"open",void 0);l([h({type:Number,reflect:!0})],a.prototype,"delay",void 0);l([h({type:Number,reflect:!0})],a.prototype,"offset",void 0);l([h({type:String,reflect:!0,attribute:"max-width"})],a.prototype,"maxWidth",void 0);a=l([z("scb-tooltip")],a);export{a as ScbTooltip};
49
+ `:v`<slot @slotchange=${this._onDefaultSlotChange}></slot>`}},w.styles=I`:host{position:relative;display:inline-block;--delay:0.25s;--max-width:300px;--wrap:normal}.scb-tooltip{position:fixed;min-width:120px;max-width:var(--max-width);width:max-content;opacity:0;z-index:var(--scb-tooltip-z-index, 1000);transition:opacity var(--delay) ease-in-out,visibility var(--delay) ease-in-out}.scb-tooltip[open]{opacity:1;visibility:visible}.hidden,.scb-tooltip{visibility:hidden}.scb-tooltip-supporting-text{font-family:var(--brand-font, Inter);font-size:var(--md-sys-typescale-body-small-size);font-style:normal;line-height:var(--md-sys-typescale-body-small-line-height);letter-spacing:var(--md-sys-typescale-body-small-tracking);white-space:var(--wrap)}:host([variant='plain']) .scb-tooltip{max-width:var(--max-width)}:host([variant='plain']) .scb-tooltip-container{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;background:var(--md-sys-color-inverse-surface);border-radius:var(--md-sys-shape-corner-extra-small);min-height:14px;width:100%}:host([variant='plain']) .scb-tooltip-supporting-text{padding:var(--spacing-2) var(--spacing-3);color:var(--md-sys-color-inverse-on-surface)}.scb-tooltip-arrow{width:12px;height:6px;position:absolute}:host([position='top']) .scb-tooltip-arrow{left:50%;bottom:-6px;transform:translateX(-50%) rotate(0deg)}:host([position='right']) .scb-tooltip-arrow{left:-9px;top:50%;transform:translateY(-50%) rotate(90deg)}:host([position='bottom']) .scb-tooltip-arrow{left:50%;top:-6px;transform:translateX(-50%) rotate(180deg)}:host([position='left']) .scb-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%) translateX(-3px) rotate(270deg)}:host([variant='plain'][arrow='false']) .scb-tooltip-arrow{display:none}:host([variant='rich']){align-items:flex-start;gap:var(--spacing-2)}:host([variant='rich']) .scb-tooltip{background:var(--md-sys-color-surface-container, #ebf8ff);box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 1px 10px 0 rgba(0,0,0,.12),0 4px 5px 0 rgba(0,0,0,.14);display:inline-flex;padding-bottom:var(--spacing-3);flex-direction:column;align-items:flex-start;gap:var(--spacing-3);border-radius:var(--md-sys-shape-corner-medium);min-width:200px;max-width:var(--max-width)}:host([variant='rich']) .scb-tooltip-text-container{display:flex;min-width:220px;padding:var(--spacing-4) var(--spacing-5) var(--spacing-2) var(--spacing-5);align-items:flex-start;gap:var(--spacing-2);flex-direction:column}:host([variant='rich']) .scb-tooltip-label{font-family:var(--brand-font, Inter);font-size:var(--md-sys-typescale-title-small-size);font-style:normal;font-weight:var(--weight-semibold);line-height:var(--md-sys-typescale-title-small-line-height);letter-spacing:var(--md-sys-typescale-title-small-tracking)}:host([variant='rich']) .scb-tooltip-supporting-text{color:var(--md-sys-color-on-surface-variant, rgba(11, 5, 68, 0.75))}:host([variant='rich']) .scb-tooltip-button-container{display:flex;padding:0 var(--spacing-3);align-items:center;gap:var(--spacing-3);align-self:stretch}`,w);l([h({type:String,reflect:!0})],a.prototype,"variant",void 0);l([h({type:Boolean,reflect:!0})],a.prototype,"arrow",void 0);l([h({type:String,attribute:"supporting-text"})],a.prototype,"supportingtext",void 0);l([h({type:String})],a.prototype,"label",void 0);l([h({type:String,reflect:!0})],a.prototype,"trigger",void 0);l([h({type:String,reflect:!0})],a.prototype,"position",void 0);l([h({type:Boolean,reflect:!0})],a.prototype,"open",void 0);l([h({type:Number,reflect:!0})],a.prototype,"delay",void 0);l([h({type:Number,reflect:!0})],a.prototype,"offset",void 0);l([h({type:String,reflect:!0,attribute:"max-width"})],a.prototype,"maxWidth",void 0);a=l([H("scb-tooltip")],a);export{a as ScbTooltip};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -468,5 +468,5 @@
468
468
  },
469
469
  "./mvc/*": "./mvc/*"
470
470
  },
471
- "buildHash": "7885BCEDDB6B74E847A777347BC0F84E576E3F0C1CF74BBA34260A885BE4F12C"
471
+ "buildHash": "7F7922515DEDD8E8A753E9438D7A6B9BEA10F6C41A1654F2218A64EC373BC057"
472
472
  }
@@ -14,6 +14,7 @@ export declare class ScbTable extends LitElement {
14
14
  private _getTbody;
15
15
  private _getTables;
16
16
  private _attachThListeners;
17
+ private _applyGeneratedCellTextReset;
17
18
  private _queueColumnWidthUpdate;
18
19
  private _applyColumnWidthMode;
19
20
  private _applyGeneratedColGroup;
@@ -30,6 +30,7 @@ export declare class ScbTableAdvanced extends LitElement {
30
30
  private _getTbody;
31
31
  private _getTopLevelRows;
32
32
  private _attachThListeners;
33
+ private _applyGeneratedCellTextReset;
33
34
  private _onThClick;
34
35
  private _sortTable;
35
36
  private _getRowSearchText;
@@ -44,20 +44,12 @@ var s = { fromAttribute(e) {
44
44
  }
45
45
  }, this.__onFormSubmit = (e) => {
46
46
  let t = e.currentTarget;
47
- if (!(t instanceof HTMLFormElement)) return;
48
- if (this.__syncSlottedFormValues(t), !this.__validateFormAndSlottedFields(t)) {
49
- e.preventDefault();
50
- return;
51
- }
47
+ if (!(t instanceof HTMLFormElement) || (e.preventDefault(), e.stopPropagation(), this.__syncSlottedFormValues(t), !this.__validateFormAndSlottedFields(t))) return;
52
48
  let n = new FormData(t);
53
- if (!this.__fireCancelable("submit", {
49
+ this.__fireCancelable("submit", {
54
50
  form: t,
55
51
  formData: n
56
- })) {
57
- e.preventDefault();
58
- return;
59
- }
60
- this.__setOpen(!1);
52
+ }) && (this.__setOpen(!1), this.formAction.trim() && HTMLFormElement.prototype.submit.call(t));
61
53
  }, this.__onKeydownTrap = (e) => {
62
54
  if (!this.open || e.key !== "Tab") return;
63
55
  let t = Array.from(this.shadowRoot.querySelectorAll("button,[href],input,select,textarea,[tabindex]:not([tabindex=\"-1\"])")).filter((e) => !e.hasAttribute("disabled"));
@@ -165,6 +165,17 @@ var d = class extends t {
165
165
  color: var(--md-sys-color-on-surface-variant);
166
166
  }
167
167
 
168
+ .label ::slotted(*),
169
+ .supporting-text ::slotted(*) {
170
+ color: inherit !important;
171
+ font-family: inherit !important;
172
+ font-size: inherit !important;
173
+ line-height: inherit !important;
174
+ font-weight: inherit !important;
175
+ letter-spacing: inherit !important;
176
+ margin-block: 0 !important;
177
+ margin-inline: 0 !important;
178
+ }
168
179
 
169
180
  .trailing { margin-left: auto; align-self: center; display: flex; }
170
181
  .trailing.trailing-switch {
@@ -43,14 +43,27 @@ var s = class extends n {
43
43
  gap: var(--scb-select-option-gap, var(--spacing-4));
44
44
  min-height: var(--scb-select-option-min-height, 40px);
45
45
  position: relative;
46
+ color: var(--md-sys-color-on-surface);
47
+ font-family: var(--brand-font, Inter, Arial, sans-serif);
46
48
  font-size: var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));
47
49
  line-height: var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));
50
+ font-weight: var(--scb-select-option-font-weight, var(--md-sys-typescale-body-large-weight));
48
51
  letter-spacing: var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking));
49
52
  }
50
53
  .label {
51
54
  min-width: 0;
52
55
  flex: 1 1 auto;
53
56
  }
57
+ .label ::slotted(*) {
58
+ color: inherit !important;
59
+ font-family: inherit !important;
60
+ font-size: inherit !important;
61
+ line-height: inherit !important;
62
+ font-weight: inherit !important;
63
+ letter-spacing: inherit !important;
64
+ margin-block: 0 !important;
65
+ margin-inline: 0 !important;
66
+ }
54
67
  md-icon {
55
68
  font-size: var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));
56
69
  line-height: 1;
@@ -105,11 +105,11 @@ var o = 96, s = 32, c = class extends t {
105
105
  }), n.forEach((e) => {
106
106
  e.style.borderTop = "1px solid var(--md-sys-color-on-surface)";
107
107
  }), r.forEach((e, t) => {
108
- e.style.textAlign = "left", e.style.padding = "12px", e.style.position = "relative", e.style.backgroundColor = "var(--md-sys-color-surface)", e.style.fontFamily = "var(--md-sys-typescale-label-medium-font)", e.style.fontSize = "var(--md-sys-typescale-label-medium-size)", e.style.lineHeight = "var(--md-sys-typescale-label-medium-line-height)", e.style.fontWeight = " var(--weight-bold)", e.style.letterSpacing = "var(--md-sys-typescale-label-medium-tracking)", e.style.verticalAlign = "bottom", e.style.borderRight = "1px solid var(--md-sys-color-on-surface)", e.style.borderBottom = "1px solid var(--md-sys-color-on-surface)", e.style.overflowWrap = "normal", e.style.wordBreak = "normal", e.style.hyphens = "manual";
108
+ e.style.textAlign = "left", e.style.padding = "12px", e.style.position = "relative", e.style.backgroundColor = "var(--md-sys-color-surface)", e.style.fontFamily = "var(--md-sys-typescale-label-medium-font)", e.style.fontSize = "var(--md-sys-typescale-label-medium-size)", e.style.lineHeight = "var(--md-sys-typescale-label-medium-line-height)", e.style.fontWeight = "var(--weight-bold)", e.style.letterSpacing = "var(--md-sys-typescale-label-medium-tracking)", e.style.verticalAlign = "bottom", e.style.borderRight = "1px solid var(--md-sys-color-on-surface)", e.style.borderBottom = "1px solid var(--md-sys-color-on-surface)", e.style.overflowWrap = "normal", e.style.wordBreak = "normal", e.style.hyphens = "manual";
109
109
  let n = (e.textContent ?? "").replace(/\s+/g, " ").trim();
110
110
  for (; e.firstChild;) e.removeChild(e.firstChild);
111
111
  let r = document.createElement("p");
112
- if (r.textContent = n, r.style.margin = "0", this.dataSorting) {
112
+ if (r.textContent = n, this._applyGeneratedCellTextReset(r), this.dataSorting) {
113
113
  let n = document.createElement("scb-icon-button");
114
114
  n.className = "scb-sort-icon", n.onclick = () => this._onThClick(t), n.setAttribute("variant", "standard"), n.setAttribute("size", "small"), 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)");
115
115
  let i = document.createElement("div");
@@ -131,6 +131,9 @@ var o = 96, s = 32, c = class extends t {
131
131
  });
132
132
  }), this._queueColumnWidthUpdate();
133
133
  }
134
+ _applyGeneratedCellTextReset(e) {
135
+ 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";
136
+ }
134
137
  _queueColumnWidthUpdate() {
135
138
  this._columnWidthFrame !== null && cancelAnimationFrame(this._columnWidthFrame), this._columnWidthFrame = requestAnimationFrame(() => {
136
139
  this._columnWidthFrame = null, this._applyColumnWidthMode();
@@ -216,9 +216,9 @@ var o = class extends t {
216
216
  }), n.forEach((e, t) => {
217
217
  e.style.textAlign = "left", e.style.padding = "16px 0px 16px 32px", e.style.position = "relative", e.style.backgroundColor = "var(--md-sys-color-surface)", e.style.fontFamily = "var(--md-sys-typescale-label-medium-font)", e.style.fontSize = "var(--md-sys-typescale-label-medium-size)", e.style.lineHeight = "var(--md-sys-typescale-label-medium-line-height)", e.style.fontWeight = "var(--md-sys-typescale-label-medium-weight)", e.style.letterSpacing = "var(--md-sys-typescale-label-medium-tracking)", e.style.verticalAlign = "bottom";
218
218
  let n = e.firstChild;
219
- if (n && n.nodeType === Node.TEXT_NODE && n.textContent?.trim() || n && n.nodeType === Node.ELEMENT_NODE && n.tagName.toLowerCase() !== "p") {
219
+ if (n instanceof HTMLParagraphElement && this._applyGeneratedCellTextReset(n), n && n.nodeType === Node.TEXT_NODE && n.textContent?.trim() || n && n.nodeType === Node.ELEMENT_NODE && n.tagName.toLowerCase() !== "p") {
220
220
  let i = document.createElement("p");
221
- i.textContent = n.textContent ? n.textContent.trim() : "", i.style.margin = "0", e.replaceChild(i, n), e.querySelectorAll("scb-icon-button.scb-sort-icon").forEach((e) => e.remove());
221
+ i.textContent = n.textContent ? n.textContent.trim() : "", this._applyGeneratedCellTextReset(i), e.replaceChild(i, n), e.querySelectorAll("scb-icon-button.scb-sort-icon").forEach((e) => e.remove());
222
222
  let a = document.createElement("scb-icon-button");
223
223
  a.className = "scb-sort-icon", a.onclick = () => this._onThClick(t), a.setAttribute("variant", "standard"), a.setAttribute("size", "small"), this._sortedColumn === t ? (a.setAttribute("variant", "filled-tonal"), a.setAttribute("icon", this._sortDirection === "asc" ? "arrow_downward" : "arrow_upward")) : (a.setAttribute("icon", "swap_horiz"), a.style.transform += " rotate(90deg)", a.style.alignSelf = "end");
224
224
  var r = document.createElement("div");
@@ -240,6 +240,9 @@ var o = class extends t {
240
240
  });
241
241
  }), this.pagination && this._paginateTable();
242
242
  }
243
+ _applyGeneratedCellTextReset(e) {
244
+ 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";
245
+ }
243
246
  _onThClick(e) {
244
247
  this._sortedColumn === e ? this._sortDirection = this._sortDirection === "asc" ? "desc" : "asc" : (this._sortedColumn = e, this._sortDirection = "asc"), this._sortTable(e, this._sortDirection), this._attachThListeners();
245
248
  }
@@ -162,8 +162,8 @@ var c = 0, l = class extends t {
162
162
  font-size: var(--md-sys-typescale-title-small-size);
163
163
  font-style: normal;
164
164
  font-weight: var(--weight-semibold);
165
- line-height: var(--md-sys-typescale-title-small-Line-Height);
166
- letter-spacing: var(--md-sys-typescale-title-small-Tracking);
165
+ line-height: var(--md-sys-typescale-title-small-line-height);
166
+ letter-spacing: var(--md-sys-typescale-title-small-tracking);
167
167
  }
168
168
 
169
169
  :host([variant='rich']) .scb-tooltip-supporting-text {
package/scb-wc.bundle.js CHANGED
@@ -1767,6 +1767,17 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
1767
1767
  color: var(--md-sys-color-on-surface-variant);
1768
1768
  }
1769
1769
 
1770
+ .label ::slotted(*),
1771
+ .supporting-text ::slotted(*) {
1772
+ color: inherit !important;
1773
+ font-family: inherit !important;
1774
+ font-size: inherit !important;
1775
+ line-height: inherit !important;
1776
+ font-weight: inherit !important;
1777
+ letter-spacing: inherit !important;
1778
+ margin-block: 0 !important;
1779
+ margin-inline: 0 !important;
1780
+ }
1770
1781
 
1771
1782
  .trailing { margin-left: auto; align-self: center; display: flex; }
1772
1783
  .trailing.trailing-switch {
@@ -2540,8 +2551,8 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
2540
2551
  font-size: var(--md-sys-typescale-title-small-size);
2541
2552
  font-style: normal;
2542
2553
  font-weight: var(--weight-semibold);
2543
- line-height: var(--md-sys-typescale-title-small-Line-Height);
2544
- letter-spacing: var(--md-sys-typescale-title-small-Tracking);
2554
+ line-height: var(--md-sys-typescale-title-small-line-height);
2555
+ letter-spacing: var(--md-sys-typescale-title-small-tracking);
2545
2556
  }
2546
2557
 
2547
2558
  :host([variant='rich']) .scb-tooltip-supporting-text {
@@ -5474,7 +5485,7 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
5474
5485
  </div>`:x}
5475
5486
  </label>
5476
5487
  <slot></slot>
5477
- `}};N([g({type:Boolean,reflect:!0})],wu.prototype,`disabled`,void 0),N([g({type:Boolean,reflect:!0})],wu.prototype,`checked`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`name`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`value`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`size`,void 0),N([g({type:Boolean,reflect:!0})],wu.prototype,`deselectable`,void 0),N([g({type:String})],wu.prototype,`label`,void 0),N([g({type:String,attribute:`supporting-text`})],wu.prototype,`supportingText`,void 0),N([g({type:String,attribute:`aria-label`})],wu.prototype,`ariaLabel`,void 0),wu=N([o(`scb-radio-button`)],wu),C(),y(),Sc(),Zc(),Lc(),sl(),O(),P();var Tu={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},H=class extends S{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.formId=``,this.formAction=``,this.formMethod=``,this.__lastTriggerEl=null,this.__scrollLocked=!1,this.__onDocumentClick=e=>{this.__getActionFromEvent(e)===`toggle`&&(this.__setOpen(!this.open),e.stopPropagation())},this.__onDocumentKeydown=e=>{this.open&&e.key===`Escape`&&(this.__fire(`esc`),this.__setOpen(!1))},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.shadowRoot?.querySelector(`slot`)?.assignedElements({flatten:!0})??[]).forEach(e=>{let t=e.tagName;t===`SCB-TEXTFIELD`&&(e.value=``),t===`SCB-CHECKBOX`&&(e.checked=!1),t===`SCB-RADIO-BUTTON`&&(e.checked=!1),t===`SCB-SWITCH`&&(e.selected=!1),t===`SCB-CHIP`&&(e.selected=!1)}),this.__fire(`reset`)},this.__onSubmit=()=>{let e=this.shadowRoot?.querySelector(`form`);if(e instanceof HTMLFormElement){if(this.__syncSlottedFormValues(e),!this.__validateFormAndSlottedFields(e))return;e.requestSubmit()}},this.__onFormSubmit=e=>{let t=e.currentTarget;if(!(t instanceof HTMLFormElement))return;if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t)){e.preventDefault();return}let n=new FormData(t);if(!this.__fireCancelable(`submit`,{form:t,formData:n})){e.preventDefault();return}this.__setOpen(!1)},this.__onKeydownTrap=e=>{if(!this.open||e.key!==`Tab`)return;let t=Array.from(this.shadowRoot.querySelectorAll(`button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`disabled`));if(!t.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(r.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===r&&(n.focus(),e.preventDefault())}}static{this.styles=m`
5488
+ `}};N([g({type:Boolean,reflect:!0})],wu.prototype,`disabled`,void 0),N([g({type:Boolean,reflect:!0})],wu.prototype,`checked`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`name`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`value`,void 0),N([g({type:String,reflect:!0})],wu.prototype,`size`,void 0),N([g({type:Boolean,reflect:!0})],wu.prototype,`deselectable`,void 0),N([g({type:String})],wu.prototype,`label`,void 0),N([g({type:String,attribute:`supporting-text`})],wu.prototype,`supportingText`,void 0),N([g({type:String,attribute:`aria-label`})],wu.prototype,`ariaLabel`,void 0),wu=N([o(`scb-radio-button`)],wu),C(),y(),Sc(),Zc(),Lc(),sl(),O(),P();var Tu={fromAttribute(e){if(e===null)return!1;let t=e.trim().toLowerCase();return t!==`false`&&t!==`0`&&t!==`no`}},H=class extends S{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.formId=``,this.formAction=``,this.formMethod=``,this.__lastTriggerEl=null,this.__scrollLocked=!1,this.__onDocumentClick=e=>{this.__getActionFromEvent(e)===`toggle`&&(this.__setOpen(!this.open),e.stopPropagation())},this.__onDocumentKeydown=e=>{this.open&&e.key===`Escape`&&(this.__fire(`esc`),this.__setOpen(!1))},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.shadowRoot?.querySelector(`slot`)?.assignedElements({flatten:!0})??[]).forEach(e=>{let t=e.tagName;t===`SCB-TEXTFIELD`&&(e.value=``),t===`SCB-CHECKBOX`&&(e.checked=!1),t===`SCB-RADIO-BUTTON`&&(e.checked=!1),t===`SCB-SWITCH`&&(e.selected=!1),t===`SCB-CHIP`&&(e.selected=!1)}),this.__fire(`reset`)},this.__onSubmit=()=>{let e=this.shadowRoot?.querySelector(`form`);if(e instanceof HTMLFormElement){if(this.__syncSlottedFormValues(e),!this.__validateFormAndSlottedFields(e))return;e.requestSubmit()}},this.__onFormSubmit=e=>{let t=e.currentTarget;if(!(t instanceof HTMLFormElement)||(e.preventDefault(),e.stopPropagation(),this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t)))return;let n=new FormData(t);this.__fireCancelable(`submit`,{form:t,formData:n})&&(this.__setOpen(!1),this.formAction.trim()&&HTMLFormElement.prototype.submit.call(t))},this.__onKeydownTrap=e=>{if(!this.open||e.key!==`Tab`)return;let t=Array.from(this.shadowRoot.querySelectorAll(`button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`disabled`));if(!t.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(r.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===r&&(n.focus(),e.preventDefault())}}static{this.styles=m`
5478
5489
  :host {
5479
5490
  display:block;
5480
5491
  position:relative;
@@ -12660,14 +12671,27 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
12660
12671
  gap: var(--scb-select-option-gap, var(--spacing-4));
12661
12672
  min-height: var(--scb-select-option-min-height, 40px);
12662
12673
  position: relative;
12674
+ color: var(--md-sys-color-on-surface);
12675
+ font-family: var(--brand-font, Inter, Arial, sans-serif);
12663
12676
  font-size: var(--scb-select-option-font-size, var(--md-sys-typescale-body-large-size));
12664
12677
  line-height: var(--scb-select-option-line-height, var(--md-sys-typescale-body-large-line-height));
12678
+ font-weight: var(--scb-select-option-font-weight, var(--md-sys-typescale-body-large-weight));
12665
12679
  letter-spacing: var(--scb-select-option-letter-spacing, var(--md-sys-typescale-body-large-tracking));
12666
12680
  }
12667
12681
  .label {
12668
12682
  min-width: 0;
12669
12683
  flex: 1 1 auto;
12670
12684
  }
12685
+ .label ::slotted(*) {
12686
+ color: inherit !important;
12687
+ font-family: inherit !important;
12688
+ font-size: inherit !important;
12689
+ line-height: inherit !important;
12690
+ font-weight: inherit !important;
12691
+ letter-spacing: inherit !important;
12692
+ margin-block: 0 !important;
12693
+ margin-inline: 0 !important;
12694
+ }
12671
12695
  md-icon {
12672
12696
  font-size: var(--scb-select-option-icon-size, var(--icon-size-medium, 24px));
12673
12697
  line-height: 1;
@@ -13639,7 +13663,7 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
13639
13663
  <div class="scb-table-scroll-wrapper">
13640
13664
  <slot @slotchange=${this._onSlotChange}></slot>
13641
13665
  </div>
13642
- `}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()}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=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`thead`)),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),n.forEach(e=>{e.style.borderTop=`1px solid var(--md-sys-color-on-surface)`}),r.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`12px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=` var(--weight-bold)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`;let n=(e.textContent??``).replace(/\s+/g,` `).trim();for(;e.firstChild;)e.removeChild(e.firstChild);let r=document.createElement(`p`);if(r.textContent=n,r.style.margin=`0`,this.dataSorting){let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,`small`),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)`);let i=document.createElement(`div`);i.style.display=`flex`,i.style.gap=`8px`,i.style.flexWrap=`nowrap`,i.style.alignItems=`center`,i.appendChild(r),i.appendChild(n),e.appendChild(i)}else e.appendChild(r)}),i.forEach(e=>{e.style.padding=`12px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),a.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--md-sys-color-on-surface)`})});let o=this._getTbody();o&&Array.from(o.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--md-sys-color-surface-container)`:`var(--md-sys-color-surface)`;Array.from(e.cells).forEach(e=>{e.style.backgroundColor=n})}),this._queueColumnWidthUpdate()}_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,Tf):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+Ef: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})))}_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([g({type:Boolean,attribute:`data-sorting`})],Df.prototype,`dataSorting`,void 0),N([g({type:String,attribute:`column-width-mode`})],Df.prototype,`columnWidthMode`,void 0),Df=N([o(`scb-table`)],Df),C(),y(),Zc(),ou(),P();var Of=class extends S{constructor(...e){super(...e),this.searchTerm=``,this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,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._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=e=>{let t=e.detail;t&&typeof t.page==`number`&&this._changePage(t.page)}}static{this.styles=m`
13666
+ `}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()}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=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`thead`)),r.push(...e.querySelectorAll(`th`)),i.push(...e.querySelectorAll(`td`)),a.push(...e.querySelectorAll(`tr`)))}),n.forEach(e=>{e.style.borderTop=`1px solid var(--md-sys-color-on-surface)`}),r.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`12px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=`var(--weight-bold)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`;let n=(e.textContent??``).replace(/\s+/g,` `).trim();for(;e.firstChild;)e.removeChild(e.firstChild);let r=document.createElement(`p`);if(r.textContent=n,this._applyGeneratedCellTextReset(r),this.dataSorting){let n=document.createElement(`scb-icon-button`);n.className=`scb-sort-icon`,n.onclick=()=>this._onThClick(t),n.setAttribute(`variant`,`standard`),n.setAttribute(`size`,`small`),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)`);let i=document.createElement(`div`);i.style.display=`flex`,i.style.gap=`8px`,i.style.flexWrap=`nowrap`,i.style.alignItems=`center`,i.appendChild(r),i.appendChild(n),e.appendChild(i)}else e.appendChild(r)}),i.forEach(e=>{e.style.padding=`12px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`,e.style.borderRight=`1px solid var(--md-sys-color-on-surface)`,e.style.borderBottom=`1px solid var(--md-sys-color-on-surface)`,e.style.overflowWrap=`normal`,e.style.wordBreak=`normal`,e.style.hyphens=`manual`}),a.forEach(e=>{let t=Array.from(e.cells);t.forEach((e,n)=>{e.style.borderRight=n===t.length-1?`none`:`1px solid var(--md-sys-color-on-surface)`})});let o=this._getTbody();o&&Array.from(o.querySelectorAll(`tr`)).forEach((e,t)=>{let n=t%2==0?`var(--md-sys-color-surface-container)`:`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`}_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,Tf):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+Ef: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})))}_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([g({type:Boolean,attribute:`data-sorting`})],Df.prototype,`dataSorting`,void 0),N([g({type:String,attribute:`column-width-mode`})],Df.prototype,`columnWidthMode`,void 0),Df=N([o(`scb-table`)],Df),C(),y(),Zc(),ou(),P();var Of=class extends S{constructor(...e){super(...e),this.searchTerm=``,this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,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._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=e=>{let t=e.detail;t&&typeof t.page==`number`&&this._changePage(t.page)}}static{this.styles=m`
13643
13667
  :host {
13644
13668
  display: block;
13645
13669
  color: var(--md-sys-color-on-surface);
@@ -13714,7 +13738,7 @@ var ScbWc=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module
13714
13738
  ></scb-pagination>
13715
13739
  `:``}
13716
13740
  </div>
13717
- `}_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._refreshFromTableContent())}updated(e){super.updated(e),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_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=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`th`)),r.push(...e.querySelectorAll(`td`)),i.push(...e.querySelectorAll(`tr`)))}),n.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`16px 0px 16px 32px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-label-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`;let n=e.firstChild;if(n&&n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()||n&&n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()!==`p`){let i=document.createElement(`p`);i.textContent=n.textContent?n.textContent.trim():``,i.style.margin=`0`,e.replaceChild(i,n),e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let a=document.createElement(`scb-icon-button`);a.className=`scb-sort-icon`,a.onclick=()=>this._onThClick(t),a.setAttribute(`variant`,`standard`),a.setAttribute(`size`,`small`),this._sortedColumn===t?(a.setAttribute(`variant`,`filled-tonal`),a.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(a.setAttribute(`icon`,`swap_horiz`),a.style.transform+=` rotate(90deg)`,a.style.alignSelf=`end`);var r=document.createElement(`div`);r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(i),r.appendChild(a),e.appendChild(r)}}),r.forEach(e=>{e.style.padding=`16px 0px 16px 32px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`}),i.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=`24px`),t===n.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===r.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``})}),this.pagination&&this._paginateTable()}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,t){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([g({type:String})],Of.prototype,`searchTerm`,void 0),N([g({type:Boolean,attribute:`with-pagination`})],Of.prototype,`pagination`,void 0),N([g({type:Boolean,attribute:`with-filtering-search`})],Of.prototype,`filteringSearch`,void 0),N([g({type:Boolean,attribute:`no-scroll`})],Of.prototype,`noScroll`,void 0),N([g({type:Number,attribute:`page-size`})],Of.prototype,`pageSize`,void 0),N([g({type:Number})],Of.prototype,`currentPage`,void 0),N([g({type:Number})],Of.prototype,`totalRows`,void 0),Of=N([o(`scb-table-advanced`)],Of),y(),C(),O(),P();var kf=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,m`
13741
+ `}_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._refreshFromTableContent())}updated(e){super.updated(e),(e.has(`searchTerm`)||e.has(`currentPage`)||e.has(`pageSize`)||e.has(`filteringSearch`)||e.has(`pagination`))&&this.updateComplete.then(()=>{this.isConnected&&this._refreshFromTableContent()})}_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=[];t.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(n.push(...e.querySelectorAll(`th`)),r.push(...e.querySelectorAll(`td`)),i.push(...e.querySelectorAll(`tr`)))}),n.forEach((e,t)=>{e.style.textAlign=`left`,e.style.padding=`16px 0px 16px 32px`,e.style.position=`relative`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-label-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-label-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-label-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-label-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-label-medium-tracking)`,e.style.verticalAlign=`bottom`;let n=e.firstChild;if(n instanceof HTMLParagraphElement&&this._applyGeneratedCellTextReset(n),n&&n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()||n&&n.nodeType===Node.ELEMENT_NODE&&n.tagName.toLowerCase()!==`p`){let i=document.createElement(`p`);i.textContent=n.textContent?n.textContent.trim():``,this._applyGeneratedCellTextReset(i),e.replaceChild(i,n),e.querySelectorAll(`scb-icon-button.scb-sort-icon`).forEach(e=>e.remove());let a=document.createElement(`scb-icon-button`);a.className=`scb-sort-icon`,a.onclick=()=>this._onThClick(t),a.setAttribute(`variant`,`standard`),a.setAttribute(`size`,`small`),this._sortedColumn===t?(a.setAttribute(`variant`,`filled-tonal`),a.setAttribute(`icon`,this._sortDirection===`asc`?`arrow_downward`:`arrow_upward`)):(a.setAttribute(`icon`,`swap_horiz`),a.style.transform+=` rotate(90deg)`,a.style.alignSelf=`end`);var r=document.createElement(`div`);r.style.display=`flex`,r.style.gap=`8px`,r.style.flexWrap=`nowrap`,r.style.alignItems=`center`,r.appendChild(i),r.appendChild(a),e.appendChild(r)}}),r.forEach(e=>{e.style.padding=`16px 0px 16px 32px`,e.style.textAlign=`left`,e.style.borderTop=`1px solid var(--md-sys-color-outline-variant)`,e.style.verticalAlign=`text-top`,e.style.backgroundColor=`var(--md-sys-color-surface)`,e.style.fontFamily=`var(--md-sys-typescale-body-medium-font)`,e.style.fontSize=`var(--md-sys-typescale-body-medium-size)`,e.style.lineHeight=`var(--md-sys-typescale-body-medium-line-height)`,e.style.fontWeight=`var(--md-sys-typescale-body-medium-weight)`,e.style.letterSpacing=`var(--md-sys-typescale-body-medium-tracking)`}),i.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=`24px`),t===n.length-1?e.style.paddingRight=`24px`:e.style.paddingRight=``});let r=e.querySelectorAll(`td`);r.length>0&&r.forEach((e,t)=>{t===0&&(e.style.paddingLeft=`24px`),t===r.length-1?e.style.paddingRight=`24px`: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`}_onThClick(e){this._sortedColumn===e?this._sortDirection=this._sortDirection===`asc`?`desc`:`asc`:(this._sortedColumn=e,this._sortDirection=`asc`),this._sortTable(e,this._sortDirection),this._attachThListeners()}_sortTable(e,t){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([g({type:String})],Of.prototype,`searchTerm`,void 0),N([g({type:Boolean,attribute:`with-pagination`})],Of.prototype,`pagination`,void 0),N([g({type:Boolean,attribute:`with-filtering-search`})],Of.prototype,`filteringSearch`,void 0),N([g({type:Boolean,attribute:`no-scroll`})],Of.prototype,`noScroll`,void 0),N([g({type:Number,attribute:`page-size`})],Of.prototype,`pageSize`,void 0),N([g({type:Number})],Of.prototype,`currentPage`,void 0),N([g({type:Number})],Of.prototype,`totalRows`,void 0),Of=N([o(`scb-table-advanced`)],Of),y(),C(),O(),P();var kf=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,m`
13718
13742
  /* Icon-only: dölj textslot */
13719
13743
  :host([icon-only]) slot:not([name='icon']) {
13720
13744
  display: none;