scb-wc 0.1.158 → 0.1.160

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{f as S,g as w,h as V,m as E,p as n,v as o,y as L}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{ensureFocusRingReady as F}from"../shared/lazy-focus-ring.js";import{t as T}from"../../vendor/component-defaults.js";import{t as a}from"../../vendor/decorate.js";import{n as M,t as l}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,c,d){try{customElements.get(i)||e(i,c,d)}catch(b){var p=String(b||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var s,v,r=(s=new WeakSet,v=class extends V{constructor(){super(),M(this,s),this._internals=null,this._inputFocused=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key==="Tab"&&(F(),this._kbShouldShowRing=!0,this._inputFocused&&l(s,this,x).call(this))},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&l(s,this,x).call(this)},this._hasRenderedOnce=!1,this._boundField=null,this._onFieldInput=()=>{const e=this._boundField;if(!e)return;const i=e;this.value=i instanceof HTMLInputElement&&i.type==="file"?i.files?.[0]?.name??"":i.value,l(s,this,m).call(this),l(s,this,f).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},this._onFieldChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},this._onFieldSelect=()=>{this.dispatchEvent(new Event("select",{bubbles:!0,composed:!0}))},this._onFieldFocus=()=>{this._inputFocused=!0,l(s,this,x).call(this)},this._onFieldBlur=()=>{this._inputFocused=!1,l(s,this,x).call(this)},this.type="text",this.lang="sv",this.label="",this.supportingText="",this.helpText="",this.helpLabel="Visa hjälptext",this.clearLabel="Rensa fält",this.dateButtonLabel="Välj datum",this.errorText="",this.leadingIcon="",this.name="",this.pattern="",this.accept="",this.multiple=!1,this.value="",this.underLabel="",this.error=!1,this.disabled=!1,this.required=!1,this.size=T["scb-textfield"].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue="",this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._inputId="",this._showDatepicker=!1,this._toggleDatepicker=()=>{this._showDatepicker=!this._showDatepicker},this._openDatepicker=()=>{this._showDatepicker=!0},this._onDatepickerClosed=()=>{this._showDatepicker=!1},this._onDateSelected=e=>{if(this.value=e.detail.value,this._showDatepicker=!1,this._internals){const i=this.disabled?null:this.value;this._internals.setFormValue(i)}l(s,this,f).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}_renderLabel(){const e=!!this.underLabel,i=o`
1
+ import{f as S,g as w,h as L,m as V,p as n,v as o,y as E}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{ensureFocusRingReady as F}from"../shared/lazy-focus-ring.js";import{t as T}from"../../vendor/component-defaults.js";import{t as a}from"../../vendor/decorate.js";import{n as M,t as l}from"../../vendor/assertClassBrand.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(i,c,d){try{customElements.get(i)||e(i,c,d)}catch(b){var p=String(b||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var s,v,r=(s=new WeakSet,v=class extends L{constructor(){super(),M(this,s),this._internals=null,this._inputFocused=!1,this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key==="Tab"&&(F(),this._kbShouldShowRing=!0,this._inputFocused&&l(s,this,x).call(this))},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&l(s,this,x).call(this)},this._hasRenderedOnce=!1,this._boundField=null,this._onFieldInput=()=>{const e=this._boundField;if(!e)return;const i=e;this.value=i instanceof HTMLInputElement&&i.type==="file"?i.files?.[0]?.name??"":i.value,l(s,this,m).call(this),l(s,this,f).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},this._onFieldChange=()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},this._onFieldSelect=()=>{this.dispatchEvent(new Event("select",{bubbles:!0,composed:!0}))},this._onFieldFocus=()=>{this._inputFocused=!0,l(s,this,x).call(this)},this._onFieldBlur=()=>{this._inputFocused=!1,l(s,this,x).call(this)},this.type="text",this.lang="sv",this.label="",this.supportingText="",this.helpText="",this.helpLabel="Visa hjälptext",this.clearLabel="Rensa fält",this.dateButtonLabel="Välj datum",this.errorText="",this.leadingIcon="",this.name="",this.pattern="",this.accept="",this.multiple=!1,this.value="",this.underLabel="",this.error=!1,this.disabled=!1,this.required=!1,this.size=T["scb-textfield"].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._form=null,this._formSubmitHandler=null,this._formResetHandler=null,this._initialValue="",this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._inputId="",this._showDatepicker=!1,this._toggleDatepicker=()=>{this._showDatepicker=!this._showDatepicker},this._openDatepicker=()=>{this._showDatepicker=!0},this._onDatepickerClosed=()=>{this._showDatepicker=!1},this._onDateSelected=e=>{if(this.value=e.detail.value,this._showDatepicker=!1,this._internals){const i=this.disabled?null:this.value;this._internals.setFormValue(i)}l(s,this,f).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0}))},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}_renderLabel(){const e=!!this.underLabel,i=o`
2
2
  <label
3
3
  class="scb-textfield-label ${!e&&!this.helpText?"scb-textfield-label--without-supporting":""}"
4
4
  for="${this._inputId}"
@@ -115,7 +115,7 @@ import{f as S,g as w,h as V,m as E,p as n,v as o,y as L}from"../../vendor/vendor
115
115
  <scb-datepicker
116
116
  .selectedValue=${this.value}
117
117
  .open=${this._showDatepicker}
118
- .lang=${this.lang}
118
+ .lang=${this._resolvedLang}
119
119
  @date-selected=${this._onDateSelected}
120
120
  @datepicker-closed=${this._onDatepickerClosed}
121
121
  ></scb-datepicker>
@@ -158,7 +158,7 @@ import{f as S,g as w,h as V,m as E,p as n,v as o,y as L}from"../../vendor/vendor
158
158
  variant="datetime-local"
159
159
  .selectedValue=${this.value}
160
160
  .open=${this._showDatepicker}
161
- .lang=${this.lang}
161
+ .lang=${this._resolvedLang}
162
162
  @date-selected=${this._onDateSelected}
163
163
  @datepicker-closed=${this._onDatepickerClosed}
164
164
  ></scb-datepicker>
@@ -233,7 +233,7 @@ import{f as S,g as w,h as V,m as E,p as n,v as o,y as L}from"../../vendor/vendor
233
233
  <md-focus-ring class="input-ring"></md-focus-ring>
234
234
  </div>
235
235
  </div>
236
- `}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,l(s,this,m).call(this),l(s,this,z).call(this),l(s,this,_).call(this)}updated(e){super.updated(e),this.toggleAttribute("aria-disabled",this.disabled),e.has("size")&&this._syncDensityForSize(),e.has("lang")&&this._hasValidationBeenReported&&l(s,this,f).call(this,!1),this._internals&&(e.has("value")||e.has("disabled")||e.has("multiple"))&&l(s,this,m).call(this),e.has("type")&&(l(s,this,z).call(this),this._hasRenderedOnce&&l(s,this,C).call(this)),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&l(s,this,_).call(this),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest("form"),this._form&&(this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener("reset",this._formResetHandler,!0)),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)),l(s,this,k).call(this),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,l(s,this,f).call(this,!0)}checkValidity(){return l(s,this,f).call(this,!1)}setCustomValidity(e){this._customValidationMessage=String(e??""),l(s,this,f).call(this,!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||""}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type!=="file"?null:this.shadowRoot?.querySelector('input[type="file"]')?.files??null}formResetCallback(){this.value=this._initialValue;const e=this.shadowRoot?.querySelector(".scb-textfield");e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type==="file"?"":this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,l(s,this,m).call(this),l(s,this,f).call(this,!1)}_onClearClick(){const e=this.shadowRoot?.querySelector(".scb-textfield");if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value="",this.value="",this._internals){const i=this.disabled?null:this.value;this._internals.setFormValue(i),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(""),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}_localizedDefaultLabel(e,i,c){return this.lang==="en"&&e===i?c:e}_invalidInputMessage(){return this.lang==="en"?"Invalid input.":"Ogiltig inmatning."}_requiredMessage(){return this.lang==="en"?"Fill in this field.":"Fyll i det här fältet."}},v.formAssociated=!0,v.styles=[L`:host{--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));--scb-textfield-number-max-width:280px;--scb-textfield-text-max-width:400px;--scb-textfield-search-max-width:600px;--scb-textfield-email-max-width:400px;--scb-textfield-password-max-width:400px;--scb-textfield-tel-max-width:400px;--scb-textfield-url-max-width:400px;--scb-textfield-textarea-max-width:600px;font-family:var(--brand-font);color:var(--md-sys-color-on-surface);margin-block-start:var(--scb-textfield-spacing-block-start, 0);margin-block-end:var(--scb-textfield-spacing-block-end, 0);margin-inline-start:var(--scb-textfield-spacing-inline-start, 0);margin-inline-end:var(--scb-textfield-spacing-inline-end, 0);-webkit-tap-highlight-color:transparent;--scb-textfield-padding-x:var(--scb-fields-padding-inline-medium, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-medium, var(--spacing-2, 4px));--scb-textfield-min-height:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-textfield-radius:var(--scb-fields-surface-radius-medium, var(--radius-small, 8px));--scb-textfield-font-family:var(--scb-fields-text-font-current, var(--scb-typography-body-large-font, var(--md-sys-typescale-body-large-font)));--scb-textfield-font-size:var(--scb-fields-text-size-current, var(--scb-typography-body-large-size, var(--md-sys-typescale-body-large-size)));--scb-textfield-line-height:var(--scb-fields-text-line-height-current, var(--scb-typography-body-large-line-height, var(--md-sys-typescale-body-large-line-height)));--scb-textfield-letter-spacing:var(--scb-fields-text-letter-spacing-current, var(--scb-typography-body-large-tracking, var(--md-sys-typescale-body-large-tracking)));--scb-textfield-font-weight:var(--scb-fields-text-font-weight-current, var(--scb-typography-body-large-weight, var(--md-sys-typescale-body-large-weight)));--scb-textfield-label-font-family:var(--scb-fields-label-font-current, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-textfield-label-font-size:var(--scb-fields-label-size-current, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-textfield-label-line-height:var(--scb-fields-label-line-height-current, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-textfield-label-letter-spacing:var(--scb-fields-label-letter-spacing-current, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)));--scb-textfield-label-font-weight:var(--scb-fields-label-font-weight-current, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold))));--scb-textfield-supporting-font-family:var(--scb-fields-supporting-font-current, var(--scb-typography-body-medium-font, var(--md-sys-typescale-body-medium-font)));--scb-textfield-supporting-font-size:var(--scb-fields-supporting-size-current, var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size)));--scb-textfield-supporting-line-height:var(--scb-fields-supporting-line-height-current, var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height)));--scb-textfield-supporting-letter-spacing:var(--scb-fields-supporting-letter-spacing-current, var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking)));--scb-textfield-supporting-font-weight:var(--scb-fields-supporting-font-weight-current, var(--scb-typography-body-medium-weight, var(--md-sys-typescale-body-medium-weight, var(--weight-regular))));--scb-textfield-label-gap:var(--scb-fields-label-gap, var(--spacing-3));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-medium, var(--spacing-5));--scb-textfield-leading-padding:calc(
236
+ `}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,l(s,this,m).call(this),l(s,this,z).call(this),l(s,this,_).call(this)}updated(e){super.updated(e),this.toggleAttribute("aria-disabled",this.disabled),e.has("size")&&this._syncDensityForSize(),e.has("lang")&&this._hasValidationBeenReported&&l(s,this,f).call(this,!1),this._internals&&(e.has("value")||e.has("disabled")||e.has("multiple"))&&l(s,this,m).call(this),e.has("type")&&(l(s,this,z).call(this),this._hasRenderedOnce&&l(s,this,C).call(this)),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&l(s,this,_).call(this),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest("form"),this._form&&(this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener("reset",this._formResetHandler,!0)),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0)),l(s,this,k).call(this),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,l(s,this,f).call(this,!0)}checkValidity(){return l(s,this,f).call(this,!1)}setCustomValidity(e){this._customValidationMessage=String(e??""),l(s,this,f).call(this,!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||""}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type!=="file"?null:this.shadowRoot?.querySelector('input[type="file"]')?.files??null}formResetCallback(){this.value=this._initialValue;const e=this.shadowRoot?.querySelector(".scb-textfield");e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type==="file"?"":this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,l(s,this,m).call(this),l(s,this,f).call(this,!1)}_onClearClick(){const e=this.shadowRoot?.querySelector(".scb-textfield");if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value="",this.value="",this._internals){const i=this.disabled?null:this.value;this._internals.setFormValue(i),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(""),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("onValueChanged",{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}get _resolvedLang(){return String(this.lang??"").trim().toLowerCase().split(/[-_]/,1)[0]==="en"?"en":"sv"}_localizedDefaultLabel(e,i,c){return this._resolvedLang==="en"&&e===i?c:e}_invalidInputMessage(){return this._resolvedLang==="en"?"Invalid input.":"Ogiltig inmatning."}_requiredMessage(){return this._resolvedLang==="en"?"Fill in this field.":"Fyll i det här fältet."}},v.formAssociated=!0,v.styles=[E`:host{--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));--scb-textfield-number-max-width:280px;--scb-textfield-text-max-width:400px;--scb-textfield-search-max-width:600px;--scb-textfield-email-max-width:400px;--scb-textfield-password-max-width:400px;--scb-textfield-tel-max-width:400px;--scb-textfield-url-max-width:400px;--scb-textfield-textarea-max-width:600px;font-family:var(--brand-font);color:var(--md-sys-color-on-surface);margin-block-start:var(--scb-textfield-spacing-block-start, 0);margin-block-end:var(--scb-textfield-spacing-block-end, 0);margin-inline-start:var(--scb-textfield-spacing-inline-start, 0);margin-inline-end:var(--scb-textfield-spacing-inline-end, 0);-webkit-tap-highlight-color:transparent;--scb-textfield-padding-x:var(--scb-fields-padding-inline-medium, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-medium, var(--spacing-2, 4px));--scb-textfield-min-height:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-textfield-radius:var(--scb-fields-surface-radius-medium, var(--radius-small, 8px));--scb-textfield-font-family:var(--scb-fields-text-font-current, var(--scb-typography-body-large-font, var(--md-sys-typescale-body-large-font)));--scb-textfield-font-size:var(--scb-fields-text-size-current, var(--scb-typography-body-large-size, var(--md-sys-typescale-body-large-size)));--scb-textfield-line-height:var(--scb-fields-text-line-height-current, var(--scb-typography-body-large-line-height, var(--md-sys-typescale-body-large-line-height)));--scb-textfield-letter-spacing:var(--scb-fields-text-letter-spacing-current, var(--scb-typography-body-large-tracking, var(--md-sys-typescale-body-large-tracking)));--scb-textfield-font-weight:var(--scb-fields-text-font-weight-current, var(--scb-typography-body-large-weight, var(--md-sys-typescale-body-large-weight)));--scb-textfield-label-font-family:var(--scb-fields-label-font-current, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font)));--scb-textfield-label-font-size:var(--scb-fields-label-size-current, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size)));--scb-textfield-label-line-height:var(--scb-fields-label-line-height-current, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));--scb-textfield-label-letter-spacing:var(--scb-fields-label-letter-spacing-current, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking)));--scb-textfield-label-font-weight:var(--scb-fields-label-font-weight-current, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold))));--scb-textfield-supporting-font-family:var(--scb-fields-supporting-font-current, var(--scb-typography-body-medium-font, var(--md-sys-typescale-body-medium-font)));--scb-textfield-supporting-font-size:var(--scb-fields-supporting-size-current, var(--scb-typography-body-medium-size, var(--md-sys-typescale-body-medium-size)));--scb-textfield-supporting-line-height:var(--scb-fields-supporting-line-height-current, var(--scb-typography-body-medium-line-height, var(--md-sys-typescale-body-medium-line-height)));--scb-textfield-supporting-letter-spacing:var(--scb-fields-supporting-letter-spacing-current, var(--scb-typography-body-medium-tracking, var(--md-sys-typescale-body-medium-tracking)));--scb-textfield-supporting-font-weight:var(--scb-fields-supporting-font-weight-current, var(--scb-typography-body-medium-weight, var(--md-sys-typescale-body-medium-weight, var(--weight-regular))));--scb-textfield-label-gap:var(--scb-fields-label-gap, var(--spacing-3));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-medium, var(--spacing-5));--scb-textfield-leading-padding:calc(
237
237
  var(--scb-textfield-leading-inset) +
238
238
  var(--scb-textfield-leading-icon-size) +
239
239
  var(--scb-textfield-leading-gap)
@@ -241,4 +241,4 @@ import{f as S,g as w,h as V,m as E,p as n,v as o,y as L}from"../../vendor/vendor
241
241
  var(--scb-textfield-trailing-inset) +
242
242
  var(--scb-textfield-trailing-action-size) +
243
243
  var(--spacing-2)
244
- )}:host([size='large']){--scb-fields-text-font-weight-current:var(--scb-fields-text-large-font-weight, var(--scb-fields-text-large-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-large-letter-spacing, var(--scb-fields-text-large-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-large-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-large-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-large-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-large-font-weight, var(--scb-fields-label-large-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-large-letter-spacing, var(--scb-fields-label-large-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-large-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-large-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-large-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-large-font-weight, var(--scb-fields-supporting-large-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-large-letter-spacing, var(--scb-fields-supporting-large-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-large-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-large-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-large-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-large-font-weight, var(--scb-fields-option-text-large-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-large-letter-spacing, var(--scb-fields-option-text-large-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-large-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-large-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-large-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-large, var(--spacing-5));--scb-textfield-padding-y:var(--scb-fields-padding-block-large, var(--spacing-4, 12px));--scb-textfield-min-height:var(--scb-fields-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-textfield-radius:var(--scb-fields-surface-radius-large, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-large, var(--spacing-4));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-large, var(--icon-size-medium, 24px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-large, var(--spacing-4));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-large, var(--spacing-4));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-large, var(--icon-size-medium, 24px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-large, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)))}:host([size='medium']){--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-medium, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-medium, var(--spacing-2, 4px));--scb-textfield-min-height:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-textfield-radius:var(--scb-fields-surface-radius-medium, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-medium, var(--spacing-5));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-medium, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)))}:host([size='small']){--scb-fields-text-font-weight-current:var(--scb-fields-text-small-font-weight, var(--scb-fields-text-small-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-small-letter-spacing, var(--scb-fields-text-small-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-small-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-small-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-small-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-small-font-weight, var(--scb-fields-label-small-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-small-letter-spacing, var(--scb-fields-label-small-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-small-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-small-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-small-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-small-font-weight, var(--scb-fields-supporting-small-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-small-letter-spacing, var(--scb-fields-supporting-small-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-small-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-small-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-small-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-small-font-weight, var(--scb-fields-option-text-small-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-small-letter-spacing, var(--scb-fields-option-text-small-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-small-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-small-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-small-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-small, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-small, var(--spacing-1));--scb-textfield-min-height:var(--scb-fields-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-textfield-radius:var(--scb-fields-surface-radius-small, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-small, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-small, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-small, var(--spacing-5));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-small, var(--spacing-3));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-small, var(--icon-size-small, 20px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-small, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)))}:host([type='number']){--scb-textfield-max-width:var(--scb-textfield-number-max-width)}:host([type='datetime-local']),:host([type='text']){--scb-textfield-max-width:var(--scb-textfield-text-max-width)}:host([type='search']){--scb-textfield-max-width:var(--scb-textfield-search-max-width)}:host([type='email']){--scb-textfield-max-width:var(--scb-textfield-email-max-width)}:host([type='password']){--scb-textfield-max-width:var(--scb-textfield-password-max-width)}:host([type='tel']){--scb-textfield-max-width:var(--scb-textfield-tel-max-width)}:host([type='url']){--scb-textfield-max-width:var(--scb-textfield-url-max-width)}:host([type='textarea']){--scb-textfield-max-width:var(--scb-textfield-textarea-max-width)}:host([type='date']),:host([type='time']){--scb-textfield-max-width:var(--scb-textfield-text-max-width)}input[type=time]::-webkit-calendar-picker-indicator{display:none;background:0 0}:host{display:flex;flex-direction:column;max-width:var(--scb-textfield-max-width)}:host([error]) .scb-textfield-supporting-text{color:var(--md-sys-color-error)}:host([error]) .scb-textfield{border-color:var(--md-sys-color-error)}:host([error]) .scb-textfield:focus-visible{border-color:var(--md-sys-color-error);box-shadow:inset 0 0 0 2px var(--md-sys-color-error)}:host([disabled]){opacity:.38;cursor:default}.scb-textfield-label{display:block;font-family:var(--scb-textfield-label-font-family);font-size:var(--scb-textfield-label-font-size);font-weight:var(--scb-textfield-label-font-weight);line-height:var(--scb-textfield-label-line-height);letter-spacing:var(--scb-textfield-label-letter-spacing)}.scb-textfield-label-row{display:flex;align-items:center;gap:var(--scb-fields-label-help-gap, var(--spacing-1, 2px))}.scb-textfield-label-row--without-supporting{margin-bottom:var(--scb-textfield-label-gap)}.scb-textfield-help-tooltip{display:inline-flex;align-items:center;flex:0 0 auto;line-height:0}.scb-textfield-help-button{--scb-icon-button-container-size:var(--scb-control-size-tiny, var(--scale-06, 24px));--scb-icon-button-icon-size:var(--icon-size-extra-small, 16px)}.scb-textfield-label--without-supporting,.scb-textfield-supporting-text{margin-bottom:var(--scb-textfield-label-gap)}.scb-textfield-supporting-text{display:block;font-family:var(--scb-textfield-supporting-font-family);font-size:var(--scb-textfield-supporting-font-size);line-height:var(--scb-textfield-supporting-line-height);font-weight:var(--scb-textfield-supporting-font-weight);letter-spacing:var(--scb-textfield-supporting-letter-spacing);color:var(--md-sys-color-on-surface-variant)}.scb-textfield{padding:var(--scb-textfield-padding-y) var(--scb-textfield-padding-x);block-size:var(--scb-textfield-min-height);min-height:var(--scb-textfield-min-height);border:1px solid var(--md-sys-color-outline);border-radius:var(--scb-textfield-radius);font-size:var(--scb-textfield-font-size);font-family:var(--scb-textfield-font-family);line-height:var(--scb-textfield-line-height);font-weight:var(--scb-textfield-font-weight);letter-spacing:var(--scb-textfield-letter-spacing);width:100%;box-sizing:border-box;background-color:transparent;color:var(--md-sys-color-on-surface);position:relative;z-index:1}:host([type='date']) .scb-textfield,:host([type='search']) .scb-textfield{padding-right:var(--scb-textfield-trailing-reserved)}md-icon+.ripple-wrapper>.scb-textfield{padding-left:var(--scb-textfield-leading-padding)}.scb-textfield-icon{position:absolute;left:var(--scb-textfield-leading-inset);top:50%;transform:translateY(-50%);pointer-events:none;font-size:var(--scb-textfield-leading-icon-size);z-index:2}.scb-textfield:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--md-sys-color-primary);border:1px solid var(--md-sys-color-primary)}.ripple-wrapper,.scb-textfield-wrapper{position:relative;width:100%}md-focus-ring.input-ring,md-ripple{border-radius:var(--scb-textfield-radius);position:absolute;inset:0;pointer-events:none}md-focus-ring.input-ring{display:none;z-index:3}.ripple-wrapper[data-kb-focus=true] md-focus-ring.input-ring{display:block}md-ripple{z-index:0;--md-ripple-hover-color:transparent;--md-ripple-hover-opacity:0}input[type=search]::-webkit-search-cancel-button{appearance:none;display:none}.scb-textfield-clear,.scb-textfield-error-icon{position:absolute;right:var(--scb-textfield-trailing-inset);top:50%;transform:translateY(-50%);z-index:2}.scb-textfield-error-icon{pointer-events:none;font-size:var(--scb-textfield-trailing-icon-size);color:var(--md-sys-color-error)}.scb-textfield.has-error-icon{padding-right:calc(var(--scb-textfield-trailing-inset) + var(--scb-textfield-trailing-icon-size) + var(--scb-textfield-trailing-gap))}.scb-textfield-clear{width:var(--scb-textfield-trailing-icon-size);height:var(--scb-textfield-trailing-icon-size);padding:0;margin:0;border:0;background:0 0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--md-sys-color-on-surface)}:host([error]) .scb-textfield-clear{right:calc(var(--scb-textfield-trailing-inset) + var(--scb-textfield-trailing-icon-size) + var(--spacing-2))}.scb-textfield-clear:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.scb-textfield-clear svg{width:100%;height:100%;display:block}.scb-textfield-datepicker-button{position:absolute;right:var(--scb-textfield-trailing-inset);top:50%;transform:translateY(-50%);z-index:4}`],v);function _(){const t=l(s,this,u).call(this,this.spacing),e=l(s,this,u).call(this,this.spacingTop)??t,i=l(s,this,u).call(this,this.spacingBottom)??t,c=l(s,this,u).call(this,this.spacingLeft),d=l(s,this,u).call(this,this.spacingRight);e?this.style.setProperty("--scb-textfield-spacing-block-start",e):this.style.removeProperty("--scb-textfield-spacing-block-start"),i?this.style.setProperty("--scb-textfield-spacing-block-end",i):this.style.removeProperty("--scb-textfield-spacing-block-end"),c?this.style.setProperty("--scb-textfield-spacing-inline-start",c):this.style.removeProperty("--scb-textfield-spacing-inline-start"),d?this.style.setProperty("--scb-textfield-spacing-inline-end",d):this.style.removeProperty("--scb-textfield-spacing-inline-end")}function u(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}function m(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!=="file"){this._internals.setFormValue(this.value);return}const t=this.files;if(!t?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(t[0]);return}const e=new FormData,i=this.name.trim()||"file";for(const c of Array.from(t))e.append(i,c);this._internals.setFormValue(e)}function f(t=!1){const e=this.shadowRoot?.querySelector(".scb-textfield");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))return!0;const i=this._invalidInputMessage();let c="",d="customError";if(e.setCustomValidity(""),this.disabled)c="";else if(this._customValidationMessage)c=this._customValidationMessage,d="customError",e.setCustomValidity(c);else if(this.required&&!e.value)c=this.errorText||this._requiredMessage(),d="valueMissing",e.setCustomValidity(c);else if(!e.validity.valid){const y=e.validity;d=["badInput","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"].find($=>y[$])??"customError",c=this.errorText||e.validationMessage||i,this.errorText&&e.setCustomValidity(this.errorText)}const p=t?e.reportValidity():e.checkValidity(),b=p?"":this._customValidationMessage||this.errorText||c||e.validationMessage||i,h=this.error,g=this._validationMessage;return this._validationMessage=b,this.error=this.disabled?!1:b?this._hasValidationBeenReported||h:h&&!this._hasValidationBeenReported&&!g,this._internals&&(p?this._internals.setValidity({}):this._internals.setValidity({[d]:!0},b,e)),(h!==this.error||g!==this._validationMessage)&&this.requestUpdate(),p}function z(){const t=this.shadowRoot?.querySelector(".scb-textfield");t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&this._boundField!==t&&(l(s,this,k).call(this),this._boundField=t,this.type!=="time"&&t.addEventListener("input",this._onFieldInput),t.addEventListener("change",this._onFieldChange),t.addEventListener("select",this._onFieldSelect),t.addEventListener("focus",this._onFieldFocus),t.addEventListener("blur",this._onFieldBlur))}function k(){const t=this._boundField;t&&(t.removeEventListener("input",this._onFieldInput),t.removeEventListener("change",this._onFieldChange),t.removeEventListener("select",this._onFieldSelect),t.removeEventListener("focus",this._onFieldFocus),t.removeEventListener("blur",this._onFieldBlur),this._boundField=null)}function C(){this._showDatepicker=!1;const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value="",t.setCustomValidity("")),this.value="",this.error=!1,this._internals){const e=this.disabled?null:"";this._internals.setFormValue(e),this._internals.setValidity({})}}function x(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}a([n({type:String,reflect:!0})],r.prototype,"type",void 0);a([n({type:String})],r.prototype,"lang",void 0);a([n({type:String})],r.prototype,"label",void 0);a([n({type:String,attribute:"supporting-text"})],r.prototype,"supportingText",void 0);a([n({type:String,attribute:"help-text"})],r.prototype,"helpText",void 0);a([n({type:String,attribute:"help-label"})],r.prototype,"helpLabel",void 0);a([n({type:String,attribute:"clear-label"})],r.prototype,"clearLabel",void 0);a([n({type:String,attribute:"date-button-label"})],r.prototype,"dateButtonLabel",void 0);a([n({type:String,attribute:"error-text"})],r.prototype,"errorText",void 0);a([n({type:String,attribute:"leading-icon"})],r.prototype,"leadingIcon",void 0);a([n({type:String})],r.prototype,"name",void 0);a([n({type:String})],r.prototype,"pattern",void 0);a([n({type:String})],r.prototype,"accept",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"multiple",void 0);a([n({type:String,attribute:"value"})],r.prototype,"value",void 0);a([n({type:String})],r.prototype,"underLabel",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"error",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"required",void 0);a([n({type:String,reflect:!0})],r.prototype,"size",void 0);a([n({type:String,reflect:!0})],r.prototype,"spacing",void 0);a([n({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);a([n({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);a([n({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);a([n({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);a([S()],r.prototype,"_showDatepicker",void 0);r=a([E("scb-textfield")],r);
244
+ )}:host([size='large']){--scb-fields-text-font-weight-current:var(--scb-fields-text-large-font-weight, var(--scb-fields-text-large-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-large-letter-spacing, var(--scb-fields-text-large-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-large-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-large-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-large-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-large-font-weight, var(--scb-fields-label-large-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-large-letter-spacing, var(--scb-fields-label-large-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-large-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-large-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-large-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-large-font-weight, var(--scb-fields-supporting-large-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-large-letter-spacing, var(--scb-fields-supporting-large-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-large-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-large-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-large-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-large-font-weight, var(--scb-fields-option-text-large-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-large-letter-spacing, var(--scb-fields-option-text-large-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-large-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-large-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-large-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-large, var(--spacing-5));--scb-textfield-padding-y:var(--scb-fields-padding-block-large, var(--spacing-4, 12px));--scb-textfield-min-height:var(--scb-fields-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-textfield-radius:var(--scb-fields-surface-radius-large, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-large, var(--spacing-4));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-large, var(--icon-size-medium, 24px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-large, var(--spacing-4));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-large, var(--spacing-4));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-large, var(--icon-size-medium, 24px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-large, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)))}:host([size='medium']){--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-medium, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-medium, var(--spacing-2, 4px));--scb-textfield-min-height:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-textfield-radius:var(--scb-fields-surface-radius-medium, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-medium, var(--spacing-5));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-medium, var(--spacing-3));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-medium, var(--icon-size-small, 20px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-medium, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)))}:host([size='small']){--scb-fields-text-font-weight-current:var(--scb-fields-text-small-font-weight, var(--scb-fields-text-small-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-small-letter-spacing, var(--scb-fields-text-small-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-small-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-small-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-small-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-small-font-weight, var(--scb-fields-label-small-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-small-letter-spacing, var(--scb-fields-label-small-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-small-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-small-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-small-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-small-font-weight, var(--scb-fields-supporting-small-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-small-letter-spacing, var(--scb-fields-supporting-small-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-small-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-small-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-small-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-small-font-weight, var(--scb-fields-option-text-small-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-small-letter-spacing, var(--scb-fields-option-text-small-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-small-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-small-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-small-font, var(--scb-fields-option-text-font));--scb-textfield-padding-x:var(--scb-fields-padding-inline-small, var(--spacing-4));--scb-textfield-padding-y:var(--scb-fields-padding-block-small, var(--spacing-1));--scb-textfield-min-height:var(--scb-fields-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-textfield-radius:var(--scb-fields-surface-radius-small, var(--radius-small, 8px));--scb-textfield-leading-inset:var(--scb-fields-icon-inset-small, var(--spacing-3));--scb-textfield-leading-icon-size:var(--scb-fields-icon-size-small, var(--icon-size-small, 20px));--scb-textfield-leading-gap:var(--scb-fields-leading-gap-small, var(--spacing-5));--scb-textfield-trailing-inset:var(--scb-fields-icon-inset-small, var(--spacing-3));--scb-textfield-trailing-icon-size:var(--scb-fields-icon-size-small, var(--icon-size-small, 20px));--scb-textfield-trailing-gap:var(--scb-fields-trailing-gap-small, var(--spacing-3));--scb-textfield-trailing-action-size:var(--scb-fields-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)))}:host([type='number']){--scb-textfield-max-width:var(--scb-textfield-number-max-width)}:host([type='datetime-local']),:host([type='text']){--scb-textfield-max-width:var(--scb-textfield-text-max-width)}:host([type='search']){--scb-textfield-max-width:var(--scb-textfield-search-max-width)}:host([type='email']){--scb-textfield-max-width:var(--scb-textfield-email-max-width)}:host([type='password']){--scb-textfield-max-width:var(--scb-textfield-password-max-width)}:host([type='tel']){--scb-textfield-max-width:var(--scb-textfield-tel-max-width)}:host([type='url']){--scb-textfield-max-width:var(--scb-textfield-url-max-width)}:host([type='textarea']){--scb-textfield-max-width:var(--scb-textfield-textarea-max-width)}:host([type='date']),:host([type='time']){--scb-textfield-max-width:var(--scb-textfield-text-max-width)}input[type=time]::-webkit-calendar-picker-indicator{display:none;background:0 0}:host{display:flex;flex-direction:column;max-width:var(--scb-textfield-max-width)}:host([error]) .scb-textfield-supporting-text{color:var(--md-sys-color-error)}:host([error]) .scb-textfield{border-color:var(--md-sys-color-error)}:host([error]) .scb-textfield:focus-visible{border-color:var(--md-sys-color-error);box-shadow:inset 0 0 0 2px var(--md-sys-color-error)}:host([disabled]){opacity:.38;cursor:default}.scb-textfield-label{display:block;font-family:var(--scb-textfield-label-font-family);font-size:var(--scb-textfield-label-font-size);font-weight:var(--scb-textfield-label-font-weight);line-height:var(--scb-textfield-label-line-height);letter-spacing:var(--scb-textfield-label-letter-spacing)}.scb-textfield-label-row{display:flex;align-items:center;gap:var(--scb-fields-label-help-gap, var(--spacing-1, 2px))}.scb-textfield-label-row--without-supporting{margin-bottom:var(--scb-textfield-label-gap)}.scb-textfield-help-tooltip{display:inline-flex;align-items:center;flex:0 0 auto;line-height:0}.scb-textfield-help-button{--scb-icon-button-container-size:var(--scb-control-size-tiny, var(--scale-06, 24px));--scb-icon-button-icon-size:var(--icon-size-extra-small, 16px)}.scb-textfield-label--without-supporting,.scb-textfield-supporting-text{margin-bottom:var(--scb-textfield-label-gap)}.scb-textfield-supporting-text{display:block;font-family:var(--scb-textfield-supporting-font-family);font-size:var(--scb-textfield-supporting-font-size);line-height:var(--scb-textfield-supporting-line-height);font-weight:var(--scb-textfield-supporting-font-weight);letter-spacing:var(--scb-textfield-supporting-letter-spacing);color:var(--md-sys-color-on-surface-variant)}.scb-textfield{padding:var(--scb-textfield-padding-y) var(--scb-textfield-padding-x);block-size:var(--scb-textfield-min-height);min-height:var(--scb-textfield-min-height);border:1px solid var(--md-sys-color-outline);border-radius:var(--scb-textfield-radius);font-size:var(--scb-textfield-font-size);font-family:var(--scb-textfield-font-family);line-height:var(--scb-textfield-line-height);font-weight:var(--scb-textfield-font-weight);letter-spacing:var(--scb-textfield-letter-spacing);width:100%;box-sizing:border-box;background-color:transparent;color:var(--md-sys-color-on-surface);position:relative;z-index:1}:host([type='date']) .scb-textfield,:host([type='search']) .scb-textfield{padding-right:var(--scb-textfield-trailing-reserved)}md-icon+.ripple-wrapper>.scb-textfield{padding-left:var(--scb-textfield-leading-padding)}.scb-textfield-icon{position:absolute;left:var(--scb-textfield-leading-inset);top:50%;transform:translateY(-50%);pointer-events:none;font-size:var(--scb-textfield-leading-icon-size);z-index:2}.scb-textfield:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--md-sys-color-primary);border:1px solid var(--md-sys-color-primary)}.ripple-wrapper,.scb-textfield-wrapper{position:relative;width:100%}md-focus-ring.input-ring,md-ripple{border-radius:var(--scb-textfield-radius);position:absolute;inset:0;pointer-events:none}md-focus-ring.input-ring{display:none;z-index:3}.ripple-wrapper[data-kb-focus=true] md-focus-ring.input-ring{display:block}md-ripple{z-index:0;--md-ripple-hover-color:transparent;--md-ripple-hover-opacity:0}input[type=search]::-webkit-search-cancel-button{appearance:none;display:none}.scb-textfield-clear,.scb-textfield-error-icon{position:absolute;right:var(--scb-textfield-trailing-inset);top:50%;transform:translateY(-50%);z-index:2}.scb-textfield-error-icon{pointer-events:none;font-size:var(--scb-textfield-trailing-icon-size);color:var(--md-sys-color-error)}.scb-textfield.has-error-icon{padding-right:calc(var(--scb-textfield-trailing-inset) + var(--scb-textfield-trailing-icon-size) + var(--scb-textfield-trailing-gap))}.scb-textfield-clear{width:var(--scb-textfield-trailing-icon-size);height:var(--scb-textfield-trailing-icon-size);padding:0;margin:0;border:0;background:0 0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--md-sys-color-on-surface)}:host([error]) .scb-textfield-clear{right:calc(var(--scb-textfield-trailing-inset) + var(--scb-textfield-trailing-icon-size) + var(--spacing-2))}.scb-textfield-clear:focus-visible{outline:2px solid var(--md-sys-color-primary);outline-offset:2px}.scb-textfield-clear svg{width:100%;height:100%;display:block}.scb-textfield-datepicker-button{position:absolute;right:var(--scb-textfield-trailing-inset);top:50%;transform:translateY(-50%);z-index:4}`],v);function _(){const t=l(s,this,u).call(this,this.spacing),e=l(s,this,u).call(this,this.spacingTop)??t,i=l(s,this,u).call(this,this.spacingBottom)??t,c=l(s,this,u).call(this,this.spacingLeft),d=l(s,this,u).call(this,this.spacingRight);e?this.style.setProperty("--scb-textfield-spacing-block-start",e):this.style.removeProperty("--scb-textfield-spacing-block-start"),i?this.style.setProperty("--scb-textfield-spacing-block-end",i):this.style.removeProperty("--scb-textfield-spacing-block-end"),c?this.style.setProperty("--scb-textfield-spacing-inline-start",c):this.style.removeProperty("--scb-textfield-spacing-inline-start"),d?this.style.setProperty("--scb-textfield-spacing-inline-end",d):this.style.removeProperty("--scb-textfield-spacing-inline-end")}function u(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}function m(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!=="file"){this._internals.setFormValue(this.value);return}const t=this.files;if(!t?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(t[0]);return}const e=new FormData,i=this.name.trim()||"file";for(const c of Array.from(t))e.append(i,c);this._internals.setFormValue(e)}function f(t=!1){const e=this.shadowRoot?.querySelector(".scb-textfield");if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))return!0;const i=this._invalidInputMessage();let c="",d="customError";if(e.setCustomValidity(""),this.disabled)c="";else if(this._customValidationMessage)c=this._customValidationMessage,d="customError",e.setCustomValidity(c);else if(this.required&&!e.value)c=this.errorText||this._requiredMessage(),d="valueMissing",e.setCustomValidity(c);else if(!e.validity.valid){const y=e.validity;d=["badInput","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"].find($=>y[$])??"customError",c=this.errorText||e.validationMessage||i,this.errorText&&e.setCustomValidity(this.errorText)}const p=t?e.reportValidity():e.checkValidity(),b=p?"":this._customValidationMessage||this.errorText||c||e.validationMessage||i,h=this.error,g=this._validationMessage;return this._validationMessage=b,this.error=this.disabled?!1:b?this._hasValidationBeenReported||h:h&&!this._hasValidationBeenReported&&!g,this._internals&&(p?this._internals.setValidity({}):this._internals.setValidity({[d]:!0},b,e)),(h!==this.error||g!==this._validationMessage)&&this.requestUpdate(),p}function z(){const t=this.shadowRoot?.querySelector(".scb-textfield");t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&this._boundField!==t&&(l(s,this,k).call(this),this._boundField=t,this.type!=="time"&&t.addEventListener("input",this._onFieldInput),t.addEventListener("change",this._onFieldChange),t.addEventListener("select",this._onFieldSelect),t.addEventListener("focus",this._onFieldFocus),t.addEventListener("blur",this._onFieldBlur))}function k(){const t=this._boundField;t&&(t.removeEventListener("input",this._onFieldInput),t.removeEventListener("change",this._onFieldChange),t.removeEventListener("select",this._onFieldSelect),t.removeEventListener("focus",this._onFieldFocus),t.removeEventListener("blur",this._onFieldBlur),this._boundField=null)}function C(){this._showDatepicker=!1;const t=this.shadowRoot?.querySelector(".scb-textfield");if(t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&(t.value="",t.setCustomValidity("")),this.value="",this.error=!1,this._internals){const e=this.disabled?null:"";this._internals.setFormValue(e),this._internals.setValidity({})}}function x(){const t=this.renderRoot?.querySelector(".ripple-wrapper");t&&(this._inputFocused&&this._kbShouldShowRing?t.setAttribute("data-kb-focus","true"):t.removeAttribute("data-kb-focus"))}a([n({type:String,reflect:!0})],r.prototype,"type",void 0);a([n({type:String})],r.prototype,"lang",void 0);a([n({type:String})],r.prototype,"label",void 0);a([n({type:String,attribute:"supporting-text"})],r.prototype,"supportingText",void 0);a([n({type:String,attribute:"help-text"})],r.prototype,"helpText",void 0);a([n({type:String,attribute:"help-label"})],r.prototype,"helpLabel",void 0);a([n({type:String,attribute:"clear-label"})],r.prototype,"clearLabel",void 0);a([n({type:String,attribute:"date-button-label"})],r.prototype,"dateButtonLabel",void 0);a([n({type:String,attribute:"error-text"})],r.prototype,"errorText",void 0);a([n({type:String,attribute:"leading-icon"})],r.prototype,"leadingIcon",void 0);a([n({type:String})],r.prototype,"name",void 0);a([n({type:String})],r.prototype,"pattern",void 0);a([n({type:String})],r.prototype,"accept",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"multiple",void 0);a([n({type:String,attribute:"value"})],r.prototype,"value",void 0);a([n({type:String})],r.prototype,"underLabel",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"error",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);a([n({type:Boolean,reflect:!0})],r.prototype,"required",void 0);a([n({type:String,reflect:!0})],r.prototype,"size",void 0);a([n({type:String,reflect:!0})],r.prototype,"spacing",void 0);a([n({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);a([n({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);a([n({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);a([n({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);a([S()],r.prototype,"_showDatepicker",void 0);r=a([V("scb-textfield")],r);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scb-wc",
3
- "version": "0.1.158",
3
+ "version": "0.1.160",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -474,5 +474,5 @@
474
474
  },
475
475
  "./mvc/*": "./mvc/*"
476
476
  },
477
- "buildHash": "43E342CD64E9AA94CC40FC02786BDE2A8E1EC94D4B28AD2ED7FB31BE4F96F292"
477
+ "buildHash": "ACD755585EDF7177353105FE97FBAB8D7D11482212DE1EF24E6B0BFC40AA77FD"
478
478
  }
@@ -16,7 +16,7 @@ export declare class ScbTextField extends LitElement {
16
16
  private _onFieldBlur;
17
17
  constructor();
18
18
  type: 'number' | 'email' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'textarea' | 'color' | 'date' | 'datetime-local' | 'file' | 'month' | 'time' | 'week';
19
- lang: 'sv' | 'en';
19
+ lang: string;
20
20
  label: string;
21
21
  supportingText: string;
22
22
  helpText: string;
@@ -90,6 +90,7 @@ export declare class ScbTextField extends LitElement {
90
90
  * Rensar värdet men triggar inte validering direkt.
91
91
  */
92
92
  private _onClearClick;
93
+ private get _resolvedLang();
93
94
  private _localizedDefaultLabel;
94
95
  private _invalidInputMessage;
95
96
  private _requiredMessage;
@@ -671,7 +671,7 @@ var u = class extends r {
671
671
  <scb-datepicker
672
672
  .selectedValue=${this.value}
673
673
  .open=${this._showDatepicker}
674
- .lang=${this.lang}
674
+ .lang=${this._resolvedLang}
675
675
  @date-selected=${this._onDateSelected}
676
676
  @datepicker-closed=${this._onDatepickerClosed}
677
677
  ></scb-datepicker>
@@ -714,7 +714,7 @@ var u = class extends r {
714
714
  variant="datetime-local"
715
715
  .selectedValue=${this.value}
716
716
  .open=${this._showDatepicker}
717
- .lang=${this.lang}
717
+ .lang=${this._resolvedLang}
718
718
  @date-selected=${this._onDateSelected}
719
719
  @datepicker-closed=${this._onDatepickerClosed}
720
720
  ></scb-datepicker>
@@ -880,14 +880,17 @@ var u = class extends r {
880
880
  let t = String(e).trim();
881
881
  if (t) return /^\d+$/.test(t) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(t, 10)))})` : t;
882
882
  }
883
+ get _resolvedLang() {
884
+ return String(this.lang ?? "").trim().toLowerCase().split(/[-_]/, 1)[0] === "en" ? "en" : "sv";
885
+ }
883
886
  _localizedDefaultLabel(e, t, n) {
884
- return this.lang === "en" && e === t ? n : e;
887
+ return this._resolvedLang === "en" && e === t ? n : e;
885
888
  }
886
889
  _invalidInputMessage() {
887
- return this.lang === "en" ? "Invalid input." : "Ogiltig inmatning.";
890
+ return this._resolvedLang === "en" ? "Invalid input." : "Ogiltig inmatning.";
888
891
  }
889
892
  _requiredMessage() {
890
- return this.lang === "en" ? "Fill in this field." : "Fyll i det här fältet.";
893
+ return this._resolvedLang === "en" ? "Fill in this field." : "Fyll i det här fältet.";
891
894
  }
892
895
  #n() {
893
896
  if (!this._internals) return;
package/scb-wc.bundle.js CHANGED
@@ -6404,7 +6404,7 @@
6404
6404
  <scb-datepicker
6405
6405
  .selectedValue=${this.value}
6406
6406
  .open=${this._showDatepicker}
6407
- .lang=${this.lang}
6407
+ .lang=${this._resolvedLang}
6408
6408
  @date-selected=${this._onDateSelected}
6409
6409
  @datepicker-closed=${this._onDatepickerClosed}
6410
6410
  ></scb-datepicker>
@@ -6447,7 +6447,7 @@
6447
6447
  variant="datetime-local"
6448
6448
  .selectedValue=${this.value}
6449
6449
  .open=${this._showDatepicker}
6450
- .lang=${this.lang}
6450
+ .lang=${this._resolvedLang}
6451
6451
  @date-selected=${this._onDateSelected}
6452
6452
  @datepicker-closed=${this._onDatepickerClosed}
6453
6453
  ></scb-datepicker>
@@ -6522,7 +6522,7 @@
6522
6522
  <md-focus-ring class="input-ring"></md-focus-ring>
6523
6523
  </div>
6524
6524
  </div>
6525
- `}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,this.#n(),this.#i(),this.#e()}updated(e){super.updated(e),this.toggleAttribute(`aria-disabled`,this.disabled),e.has(`size`)&&this._syncDensityForSize(),e.has(`lang`)&&this._hasValidationBeenReported&&this.#r(!1),this._internals&&(e.has(`value`)||e.has(`disabled`)||e.has(`multiple`))&&this.#n(),e.has(`type`)&&(this.#i(),this._hasRenderedOnce&&this.#o()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e(),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest(`form`),this._form&&(this._form.addEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener(`reset`,this._formResetHandler,!0)),window.addEventListener(`keydown`,this._onGlobalKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0)),this.#a(),window.removeEventListener(`keydown`,this._onGlobalKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,this.#r(!0)}checkValidity(){return this.#r(!1)}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#r(!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||``}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type===`file`?this.shadowRoot?.querySelector(`input[type="file"]`)?.files??null:null}formResetCallback(){this.value=this._initialValue;let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type===`file`?``:this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,this.#n(),this.#r(!1)}_onClearClick(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value=``,this.value=``,this._internals){let e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(``),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-textfield-spacing-block-start`,t):this.style.removeProperty(`--scb-textfield-spacing-block-start`),n?this.style.setProperty(`--scb-textfield-spacing-block-end`,n):this.style.removeProperty(`--scb-textfield-spacing-block-end`),r?this.style.setProperty(`--scb-textfield-spacing-inline-start`,r):this.style.removeProperty(`--scb-textfield-spacing-inline-start`),i?this.style.setProperty(`--scb-textfield-spacing-inline-end`,i):this.style.removeProperty(`--scb-textfield-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_localizedDefaultLabel(e,t,n){return this.lang===`en`&&e===t?n:e}_invalidInputMessage(){return this.lang===`en`?`Invalid input.`:`Ogiltig inmatning.`}_requiredMessage(){return this.lang===`en`?`Fill in this field.`:`Fyll i det här fältet.`}#n(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!==`file`){this._internals.setFormValue(this.value);return}let e=this.files;if(!e?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(e[0]);return}let t=new FormData,n=this.name.trim()||`file`;for(let r of Array.from(e))t.append(n,r);this._internals.setFormValue(t)}#r(e=!1){let t=this.shadowRoot?.querySelector(`.scb-textfield`);if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return!0;let n=this._invalidInputMessage(),r=``,i=`customError`;if(t.setCustomValidity(``),this.disabled)r=``;else if(this._customValidationMessage)r=this._customValidationMessage,i=`customError`,t.setCustomValidity(r);else if(this.required&&!t.value)r=this.errorText||this._requiredMessage(),i=`valueMissing`,t.setCustomValidity(r);else if(!t.validity.valid){let e=t.validity;i=[`badInput`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`].find(t=>e[t])??`customError`,r=this.errorText||t.validationMessage||n,this.errorText&&t.setCustomValidity(this.errorText)}let a=e?t.reportValidity():t.checkValidity(),o=a?``:this._customValidationMessage||this.errorText||r||t.validationMessage||n,s=this.error,c=this._validationMessage;return this._validationMessage=o,this.error=this.disabled?!1:o?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!c,this._internals&&(a?this._internals.setValidity({}):this._internals.setValidity({[i]:!0},o,t)),(s!==this.error||c!==this._validationMessage)&&this.requestUpdate(),a}#i(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&this._boundField!==e&&(this.#a(),this._boundField=e,this.type!==`time`&&e.addEventListener(`input`,this._onFieldInput),e.addEventListener(`change`,this._onFieldChange),e.addEventListener(`select`,this._onFieldSelect),e.addEventListener(`focus`,this._onFieldFocus),e.addEventListener(`blur`,this._onFieldBlur))}#a(){let e=this._boundField;e&&(e.removeEventListener(`input`,this._onFieldInput),e.removeEventListener(`change`,this._onFieldChange),e.removeEventListener(`select`,this._onFieldSelect),e.removeEventListener(`focus`,this._onFieldFocus),e.removeEventListener(`blur`,this._onFieldBlur),this._boundField=null)}#o(){this._showDatepicker=!1;let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=``,e.setCustomValidity(``)),this.value=``,this.error=!1,this._internals){let e=this.disabled?null:``;this._internals.setFormValue(e),this._internals.setValidity({})}}#s(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}};P([_({type:String,reflect:!0})],U.prototype,`type`,void 0),P([_({type:String})],U.prototype,`lang`,void 0),P([_({type:String})],U.prototype,`label`,void 0),P([_({type:String,attribute:`supporting-text`})],U.prototype,`supportingText`,void 0),P([_({type:String,attribute:`help-text`})],U.prototype,`helpText`,void 0),P([_({type:String,attribute:`help-label`})],U.prototype,`helpLabel`,void 0),P([_({type:String,attribute:`clear-label`})],U.prototype,`clearLabel`,void 0),P([_({type:String,attribute:`date-button-label`})],U.prototype,`dateButtonLabel`,void 0),P([_({type:String,attribute:`error-text`})],U.prototype,`errorText`,void 0),P([_({type:String,attribute:`leading-icon`})],U.prototype,`leadingIcon`,void 0),P([_({type:String})],U.prototype,`name`,void 0),P([_({type:String})],U.prototype,`pattern`,void 0),P([_({type:String})],U.prototype,`accept`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`multiple`,void 0),P([_({type:String,attribute:`value`})],U.prototype,`value`,void 0),P([_({type:String})],U.prototype,`underLabel`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`error`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`disabled`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`required`,void 0),P([_({type:String,reflect:!0})],U.prototype,`size`,void 0),P([_({type:String,reflect:!0})],U.prototype,`spacing`,void 0),P([_({type:String,attribute:`spacing-top`,reflect:!0})],U.prototype,`spacingTop`,void 0),P([_({type:String,attribute:`spacing-bottom`,reflect:!0})],U.prototype,`spacingBottom`,void 0),P([_({type:String,attribute:`spacing-left`,reflect:!0})],U.prototype,`spacingLeft`,void 0),P([_({type:String,attribute:`spacing-right`,reflect:!0})],U.prototype,`spacingRight`,void 0),P([v()],U.prototype,`_showDatepicker`,void 0),U=P([a(`scb-textfield`)],U),Lc(),w(),b(),D(),N(),F();var wu=class extends C{static{this.formAssociated=!0}constructor(){super(),this.name=``,this.orientation=`vertical`,this.disabled=!1,this.required=!1,this.error=!1,this.deselectable=!1,this.size=M[`scb-radio-group`].size,this.ariaLabel=null,this.supportingText=``,this.errorText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value=``,this._internals=null,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._supportingTextId=`scb-radio-group-supporting-${Math.random().toString(36).slice(2,11)}`,this.#e=()=>{let e=this.shadowRoot?.querySelector(`slot`);return e?e.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()===`scb-radio-button`):[]},this.#t=()=>{let e=this.#e();if(!e.length)return;let t=null;for(let n of e){let e=n;this.name&&n.setAttribute(`name`,this.name),this.disabled?n.setAttribute(`disabled`,``):n.removeAttribute(`disabled`),this.orientation===`horizontal`?n.setAttribute(`orientation`,`horizontal`):n.removeAttribute(`orientation`);let r=n.hasAttribute(`data-size-from-group`);this.deselectable?n.setAttribute(`deselectable`,``):n.removeAttribute(`deselectable`),this.size===`medium`?r&&(n.removeAttribute(`size`),n.removeAttribute(`data-size-from-group`)):(!n.hasAttribute(`size`)||r)&&(n.setAttribute(`size`,this.size),n.setAttribute(`data-size-from-group`,``));let i=e.value??n.getAttribute(`value`)??``,a=typeof e.checked==`boolean`?e.checked:n.hasAttribute(`checked`);if(this.value){let t=String(i)===this.value;t&&!a?e.checked=!0:!t&&a&&(e.checked=!1)}else a&&t===null&&(t=String(i))}!this.value&&t!==null&&(this.value=t)},this.#n=e=>{e.target!==this&&e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`)&&(e.stopImmediatePropagation(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})))},this.#r=e=>{if(e.target===this)return;let t=e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`);if(!t)return;e.stopImmediatePropagation();let n=t?.checked===!0,r=n?t?.value??t?.getAttribute?.(`value`)??e.target?.value??``:``;this.value=String(r??``);let i={value:String(r??``),checked:n,originalIsTrusted:e?.isTrusted===!0};this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scb-change`,{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbchange`,{detail:i,bubbles:!0,composed:!0}))},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
6525
+ `}firstUpdated(e){super.firstUpdated(e),this._initialValue=this.value,this.#n(),this.#i(),this.#e()}updated(e){super.updated(e),this.toggleAttribute(`aria-disabled`,this.disabled),e.has(`size`)&&this._syncDensityForSize(),e.has(`lang`)&&this._hasValidationBeenReported&&this.#r(!1),this._internals&&(e.has(`value`)||e.has(`disabled`)||e.has(`multiple`))&&this.#n(),e.has(`type`)&&(this.#i(),this._hasRenderedOnce&&this.#o()),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.#e(),this._hasRenderedOnce=!0}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._inputId=this.id||`scb-textfield-${Math.random().toString(36).substr(2,9)}`,this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form=this.closest(`form`),this._form&&(this._form.addEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler=()=>this.formResetCallback(),this._form.addEventListener(`reset`,this._formResetHandler,!0)),window.addEventListener(`keydown`,this._onGlobalKeydown,!0),window.addEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this._form&&this._formSubmitHandler&&(this._form.removeEventListener(`submit`,this._formSubmitHandler,!0),this._formResetHandler&&this._form.removeEventListener(`reset`,this._formResetHandler,!0)),this.#a(),window.removeEventListener(`keydown`,this._onGlobalKeydown,!0),window.removeEventListener(`pointerdown`,this._onGlobalPointerDown,!0)}reportValidity(){return this._hasValidationBeenReported=!0,this.#r(!0)}checkValidity(){return this.#r(!1)}setCustomValidity(e){this._customValidationMessage=String(e??``),this.#r(!1)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity??this._boundField?.validity}get validationMessage(){return this._internals?.validationMessage||this._validationMessage||this._boundField?.validationMessage||``}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}get files(){return this.type===`file`?this.shadowRoot?.querySelector(`input[type="file"]`)?.files??null:null}formResetCallback(){this.value=this._initialValue;let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=e instanceof HTMLInputElement&&e.type===`file`?``:this._initialValue),this.error=!1,this._hasValidationBeenReported=!1,this.#n(),this.#r(!1)}_onClearClick(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){if(e.value=``,this.value=``,this._internals){let e=this.disabled?null:this.value;this._internals.setFormValue(e),this._internals.setValidity({})}this.error=!1,e.setCustomValidity(``),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`onValueChanged`,{detail:{value:this.value},bubbles:!0,composed:!0})),e.focus()}}#e(){let e=this.#t(this.spacing),t=this.#t(this.spacingTop)??e,n=this.#t(this.spacingBottom)??e,r=this.#t(this.spacingLeft),i=this.#t(this.spacingRight);t?this.style.setProperty(`--scb-textfield-spacing-block-start`,t):this.style.removeProperty(`--scb-textfield-spacing-block-start`),n?this.style.setProperty(`--scb-textfield-spacing-block-end`,n):this.style.removeProperty(`--scb-textfield-spacing-block-end`),r?this.style.setProperty(`--scb-textfield-spacing-inline-start`,r):this.style.removeProperty(`--scb-textfield-spacing-inline-start`),i?this.style.setProperty(`--scb-textfield-spacing-inline-end`,i):this.style.removeProperty(`--scb-textfield-spacing-inline-end`)}#t(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}get _resolvedLang(){return String(this.lang??``).trim().toLowerCase().split(/[-_]/,1)[0]===`en`?`en`:`sv`}_localizedDefaultLabel(e,t,n){return this._resolvedLang===`en`&&e===t?n:e}_invalidInputMessage(){return this._resolvedLang===`en`?`Invalid input.`:`Ogiltig inmatning.`}_requiredMessage(){return this._resolvedLang===`en`?`Fill in this field.`:`Fyll i det här fältet.`}#n(){if(!this._internals)return;if(this.disabled){this._internals.setFormValue(null);return}if(this.type!==`file`){this._internals.setFormValue(this.value);return}let e=this.files;if(!e?.length){this._internals.setFormValue(null);return}if(!this.multiple){this._internals.setFormValue(e[0]);return}let t=new FormData,n=this.name.trim()||`file`;for(let r of Array.from(e))t.append(n,r);this._internals.setFormValue(t)}#r(e=!1){let t=this.shadowRoot?.querySelector(`.scb-textfield`);if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return!0;let n=this._invalidInputMessage(),r=``,i=`customError`;if(t.setCustomValidity(``),this.disabled)r=``;else if(this._customValidationMessage)r=this._customValidationMessage,i=`customError`,t.setCustomValidity(r);else if(this.required&&!t.value)r=this.errorText||this._requiredMessage(),i=`valueMissing`,t.setCustomValidity(r);else if(!t.validity.valid){let e=t.validity;i=[`badInput`,`patternMismatch`,`rangeOverflow`,`rangeUnderflow`,`stepMismatch`,`tooLong`,`tooShort`,`typeMismatch`,`valueMissing`].find(t=>e[t])??`customError`,r=this.errorText||t.validationMessage||n,this.errorText&&t.setCustomValidity(this.errorText)}let a=e?t.reportValidity():t.checkValidity(),o=a?``:this._customValidationMessage||this.errorText||r||t.validationMessage||n,s=this.error,c=this._validationMessage;return this._validationMessage=o,this.error=this.disabled?!1:o?this._hasValidationBeenReported||s:s&&!this._hasValidationBeenReported&&!c,this._internals&&(a?this._internals.setValidity({}):this._internals.setValidity({[i]:!0},o,t)),(s!==this.error||c!==this._validationMessage)&&this.requestUpdate(),a}#i(){let e=this.shadowRoot?.querySelector(`.scb-textfield`);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&this._boundField!==e&&(this.#a(),this._boundField=e,this.type!==`time`&&e.addEventListener(`input`,this._onFieldInput),e.addEventListener(`change`,this._onFieldChange),e.addEventListener(`select`,this._onFieldSelect),e.addEventListener(`focus`,this._onFieldFocus),e.addEventListener(`blur`,this._onFieldBlur))}#a(){let e=this._boundField;e&&(e.removeEventListener(`input`,this._onFieldInput),e.removeEventListener(`change`,this._onFieldChange),e.removeEventListener(`select`,this._onFieldSelect),e.removeEventListener(`focus`,this._onFieldFocus),e.removeEventListener(`blur`,this._onFieldBlur),this._boundField=null)}#o(){this._showDatepicker=!1;let e=this.shadowRoot?.querySelector(`.scb-textfield`);if(e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(e.value=``,e.setCustomValidity(``)),this.value=``,this.error=!1,this._internals){let e=this.disabled?null:``;this._internals.setFormValue(e),this._internals.setValidity({})}}#s(){let e=this.renderRoot?.querySelector(`.ripple-wrapper`);e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute(`data-kb-focus`,`true`):e.removeAttribute(`data-kb-focus`))}};P([_({type:String,reflect:!0})],U.prototype,`type`,void 0),P([_({type:String})],U.prototype,`lang`,void 0),P([_({type:String})],U.prototype,`label`,void 0),P([_({type:String,attribute:`supporting-text`})],U.prototype,`supportingText`,void 0),P([_({type:String,attribute:`help-text`})],U.prototype,`helpText`,void 0),P([_({type:String,attribute:`help-label`})],U.prototype,`helpLabel`,void 0),P([_({type:String,attribute:`clear-label`})],U.prototype,`clearLabel`,void 0),P([_({type:String,attribute:`date-button-label`})],U.prototype,`dateButtonLabel`,void 0),P([_({type:String,attribute:`error-text`})],U.prototype,`errorText`,void 0),P([_({type:String,attribute:`leading-icon`})],U.prototype,`leadingIcon`,void 0),P([_({type:String})],U.prototype,`name`,void 0),P([_({type:String})],U.prototype,`pattern`,void 0),P([_({type:String})],U.prototype,`accept`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`multiple`,void 0),P([_({type:String,attribute:`value`})],U.prototype,`value`,void 0),P([_({type:String})],U.prototype,`underLabel`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`error`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`disabled`,void 0),P([_({type:Boolean,reflect:!0})],U.prototype,`required`,void 0),P([_({type:String,reflect:!0})],U.prototype,`size`,void 0),P([_({type:String,reflect:!0})],U.prototype,`spacing`,void 0),P([_({type:String,attribute:`spacing-top`,reflect:!0})],U.prototype,`spacingTop`,void 0),P([_({type:String,attribute:`spacing-bottom`,reflect:!0})],U.prototype,`spacingBottom`,void 0),P([_({type:String,attribute:`spacing-left`,reflect:!0})],U.prototype,`spacingLeft`,void 0),P([_({type:String,attribute:`spacing-right`,reflect:!0})],U.prototype,`spacingRight`,void 0),P([v()],U.prototype,`_showDatepicker`,void 0),U=P([a(`scb-textfield`)],U),Lc(),w(),b(),D(),N(),F();var wu=class extends C{static{this.formAssociated=!0}constructor(){super(),this.name=``,this.orientation=`vertical`,this.disabled=!1,this.required=!1,this.error=!1,this.deselectable=!1,this.size=M[`scb-radio-group`].size,this.ariaLabel=null,this.supportingText=``,this.errorText=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value=``,this._internals=null,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue=``,this._customValidationMessage=``,this._validationMessage=``,this._hasValidationBeenReported=!1,this._supportingTextId=`scb-radio-group-supporting-${Math.random().toString(36).slice(2,11)}`,this.#e=()=>{let e=this.shadowRoot?.querySelector(`slot`);return e?e.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()===`scb-radio-button`):[]},this.#t=()=>{let e=this.#e();if(!e.length)return;let t=null;for(let n of e){let e=n;this.name&&n.setAttribute(`name`,this.name),this.disabled?n.setAttribute(`disabled`,``):n.removeAttribute(`disabled`),this.orientation===`horizontal`?n.setAttribute(`orientation`,`horizontal`):n.removeAttribute(`orientation`);let r=n.hasAttribute(`data-size-from-group`);this.deselectable?n.setAttribute(`deselectable`,``):n.removeAttribute(`deselectable`),this.size===`medium`?r&&(n.removeAttribute(`size`),n.removeAttribute(`data-size-from-group`)):(!n.hasAttribute(`size`)||r)&&(n.setAttribute(`size`,this.size),n.setAttribute(`data-size-from-group`,``));let i=e.value??n.getAttribute(`value`)??``,a=typeof e.checked==`boolean`?e.checked:n.hasAttribute(`checked`);if(this.value){let t=String(i)===this.value;t&&!a?e.checked=!0:!t&&a&&(e.checked=!1)}else a&&t===null&&(t=String(i))}!this.value&&t!==null&&(this.value=t)},this.#n=e=>{e.target!==this&&e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`)&&(e.stopImmediatePropagation(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})))},this.#r=e=>{if(e.target===this)return;let t=e.composedPath().find(e=>e?.tagName?.toLowerCase()===`scb-radio-button`);if(!t)return;e.stopImmediatePropagation();let n=t?.checked===!0,r=n?t?.value??t?.getAttribute?.(`value`)??e.target?.value??``:``;this.value=String(r??``);let i={value:String(r??``),checked:n,originalIsTrusted:e?.isTrusted===!0};this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scb-change`,{detail:i,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`scbchange`,{detail:i,bubbles:!0,composed:!0}))},`attachInternals`in this&&(this._internals=this.attachInternals())}static{this.styles=p`
6526
6526
  :host {
6527
6527
  display: block;
6528
6528