@solid-design-system/components 1.35.1 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/es/checkbox-group.js +1 -1
- package/dist/components/es/checkbox.js +1 -1
- package/dist/components/es/form.js +1 -1
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/option.js +1 -1
- package/dist/components/es/radio-button.js +1 -0
- package/dist/components/es/radio-group.js +1 -1
- package/dist/components/es/radio.js +1 -1
- package/dist/components/es/select.js +2 -2
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +1 -1
- package/dist/components/es/switch.js +1 -1
- package/dist/components/es/textarea.js +1 -1
- package/dist/components/umd/solid-components.js +19 -19
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/checkbox/checkbox.d.ts +2 -0
- package/dist/package/components/checkbox/checkbox.js +23 -6
- package/dist/package/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/package/components/input/input.d.ts +3 -0
- package/dist/package/components/input/input.js +20 -19
- package/dist/package/components/option/option.js +0 -2
- package/dist/package/components/radio/radio.js +3 -3
- package/dist/package/components/radio-button/radio-button.d.ts +25 -0
- package/dist/package/components/radio-button/radio-button.js +118 -0
- package/dist/package/components/radio-group/radio-group.d.ts +4 -3
- package/dist/package/components/radio-group/radio-group.js +26 -26
- package/dist/package/components/select/select.d.ts +3 -3
- package/dist/package/components/select/select.js +18 -23
- package/dist/package/components/switch/switch.d.ts +2 -0
- package/dist/package/components/switch/switch.js +15 -7
- package/dist/package/components/textarea/textarea.d.ts +3 -0
- package/dist/package/components/textarea/textarea.js +30 -24
- package/dist/package/internal/form.d.ts +3 -1
- package/dist/package/internal/form.js +38 -10
- package/dist/package/internal/solid-element.d.ts +2 -0
- package/dist/package/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +20 -18
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -0
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/select.js +2 -2
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +3 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +27 -10
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +6 -6
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +4 -1
- package/dist/versioned-package/components/input/input.js +23 -22
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -4
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +5 -5
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +25 -0
- package/dist/versioned-package/components/radio-button/radio-button.js +118 -0
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +6 -5
- package/dist/versioned-package/components/radio-group/radio-group.js +39 -39
- package/dist/versioned-package/components/select/select.d.ts +7 -7
- package/dist/versioned-package/components/select/select.js +44 -49
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/switch/switch.d.ts +3 -1
- package/dist/versioned-package/components/switch/switch.js +17 -9
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +4 -1
- package/dist/versioned-package/components/textarea/textarea.js +32 -26
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.d.ts +3 -1
- package/dist/versioned-package/internal/form.js +40 -12
- package/dist/versioned-package/internal/solid-element.d.ts +2 -0
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +20 -18
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +107 -33
- package/dist/web-types.json +177 -18
- package/package.json +5 -4
- package/dist/components/es/form-control.styles.js +0 -1
- package/dist/package/styles/form-control.styles.d.ts +0 -2
- package/dist/package/styles/form-control.styles.js +0 -5
- package/dist/versioned-components/es/form-control.styles.js +0 -1
- package/dist/versioned-package/styles/form-control.styles.d.ts +0 -2
- package/dist/versioned-package/styles/form-control.styles.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as t,x as e,i as s,n as o}from"./solid-element.js";import{c as i}from"./register-custom-element.js";import{H as l}from"./slot.js";import{w as r}from"./watch.js";import{c as a}from"./component.styles.js";import{t as n}from"./classix.js";import"./solid-components2.js";import"./state.js";import"./request.js";import"./request2.js";import"./directive.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var i,l=o>1?void 0:o?h(e,s):e,r=t.length-1;r>=0;r--)(i=t[r])&&(l=(o?i(e,s,l):i(l))||l);return o&&l&&c(e,s,l),l};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"label"),this.label="",this.size="lg",this.orientation="vertical"}getAllCheckboxes(){return[...this.querySelectorAll("sd-checkbox")]}async syncCheckboxElements(){const t=this.getAllCheckboxes();await Promise.all(t.map((async t=>{await t.updateComplete,t.size=this.size}))),t.some((t=>t.checked))||(t[0].tabIndex=0)}syncCheckboxes(){customElements.get("sd-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-checkbox").then((()=>this.syncCheckboxes()))}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){const t=this.hasSlotController.test("label"),s=!!this.label||t,o=e`<slot @slotchange="${this.syncCheckboxes}"></slot>`;return e`<fieldset part="form-control" class="${n("border-0 p-0 m-0",{sm:"text-sm",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label"><label part="form-control-label" id="label" class="${n("mb-2 p-0 font-bold leading-normal text-black",s?"flex":"hidden")}" aria-hidden="${
|
|
1
|
+
import"./icon.js";import{S as t,x as e,i as s,n as o}from"./solid-element.js";import{c as i}from"./register-custom-element.js";import{H as l}from"./slot.js";import{w as r}from"./watch.js";import{c as a}from"./component.styles.js";import{t as n}from"./classix.js";import"./solid-components2.js";import"./state.js";import"./request.js";import"./request2.js";import"./directive.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var i,l=o>1?void 0:o?h(e,s):e,r=t.length-1;r>=0;r--)(i=t[r])&&(l=(o?i(e,s,l):i(l))||l);return o&&l&&c(e,s,l),l};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"label"),this.label="",this.size="lg",this.orientation="vertical"}getAllCheckboxes(){return[...this.querySelectorAll("sd-checkbox")]}async syncCheckboxElements(){const t=this.getAllCheckboxes();await Promise.all(t.map((async t=>{await t.updateComplete,t.size=this.size}))),t.some((t=>t.checked))||(t[0].tabIndex=0)}syncCheckboxes(){customElements.get("sd-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-checkbox").then((()=>this.syncCheckboxes()))}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){const t=this.hasSlotController.test("label"),s=!!this.label||t,o=e`<slot @slotchange="${this.syncCheckboxes}"></slot>`;return e`<fieldset part="form-control" class="${n("border-0 p-0 m-0",{sm:"text-sm",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label"><label part="form-control-label" id="label" class="${n("mb-2 p-0 font-bold leading-normal text-black",s?"flex":"hidden")}" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${n({vertical:"flex flex-col",horizontal:"flex flex-row"}[this.orientation])}">${o}</div></fieldset>`}};m.styles=[a,t.styles,s`:host{display:block}:host([orientation=vertical]) ::slotted(sd-checkbox){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-checkbox:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-checkbox){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-checkbox){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}`],d([o()],m.prototype,"label",2),d([o({reflect:!0})],m.prototype,"size",2),d([o({reflect:!0})],m.prototype,"orientation",2),d([r("size",{waitUntilFirstUpdate:!0})],m.prototype,"handleSizeChange",1),d([r("invalid",{waitUntilFirstUpdate:!0})],m.prototype,"handleInvalid",1),m=d([i("sd-checkbox-group")],m);export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as e,x as t,i,n as r}from"./solid-element.js";import{c as s}from"./register-custom-element.js";import{d as o}from"./default-value.js";import{F as l}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{
|
|
1
|
+
import"./icon.js";import{S as e,x as t,i,n as r}from"./solid-element.js";import{c as s}from"./register-custom-element.js";import{d as o}from"./default-value.js";import{F as l}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{r as d}from"./state.js";import{e as h}from"./query.js";import{w as c}from"./watch.js";import{t as p}from"./classix.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./directive.js";import"./component.styles.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(e,t,i,r)=>{for(var s,o=r>1?void 0:r?m(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(o=(r?s(t,i,o):s(o))||o);return r&&o&&u(t,i,o),o};let f=class extends e{constructor(){super(...arguments),this.formControlController=new l(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.title="",this.name="",this.size="lg",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return t`<label part="base" class="${p("sd-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed",{sm:"text-sm",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${a(this.value)}" .indeterminate="${n(this.indeterminate)}" .checked="${n(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${p("relative flex flex-initial items-center justify-center border rounded-sm h-4 w-4\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",{sm:"mt-[2px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}">${this.checked?t`<sd-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-hook"></sd-icon>`:""} ${!this.checked&&this.indeterminate?t`<sd-icon part="indeterminate-icon" class="text-white w-3 h-3" library="system" name="status-minus"></sd-icon>`:""} </span><span part="label" id="label" class="${p("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};f.styles=[e.styles,i`:host{display:block}:host(:focus-visible){outline-width:0}:host([required]) #label::after{content:' *'}`],b([h('input[type="checkbox"]')],f.prototype,"input",2),b([h("#invalid-message")],f.prototype,"invalidMessage",2),b([r()],f.prototype,"title",2),b([r()],f.prototype,"name",2),b([r()],f.prototype,"value",2),b([r({reflect:!0})],f.prototype,"size",2),b([r({type:Boolean,reflect:!0})],f.prototype,"disabled",2),b([r({type:Boolean,reflect:!0})],f.prototype,"checked",2),b([r({type:Boolean,reflect:!0})],f.prototype,"indeterminate",2),b([o("checked")],f.prototype,"defaultChecked",2),b([r({reflect:!0})],f.prototype,"form",2),b([r({type:Boolean,reflect:!0})],f.prototype,"required",2),b([d()],f.prototype,"showInvalidStyle",2),b([c("disabled",{waitUntilFirstUpdate:!0})],f.prototype,"handleDisabledChange",1),b([c(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],f.prototype,"handleStateChange",1),f=b([s("sd-checkbox")],f);export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{x as t}from"./solid-element.js";const e=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap;class a{constructor(t,i){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),s=this.options.value(this.host),o="sd-button"===this.host.tagName.toLowerCase();!e&&!o&&"string"==typeof i&&i.length>0&&typeof s<"u"&&(Array.isArray(s)?s.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,s.toString()))},this.handleFormSubmit=t=>{var i,s;const o=this.options.disabled(this.host),a=this.options.reportValidity;if(this.form&&!this.form.noValidate&&(null==(i=e.get(this.form))||i.forEach((t=>{this.setUserInteracted(t,!0)}))),this.form&&!this.form.noValidate&&!o&&!a(this.host)){t.preventDefault(),t.stopImmediatePropagation();const e=null==(s=this.form)?void 0:s.querySelectorAll("[data-invalid]");Array.from(e).filter((t=>"sd-radio-group"===t.tagName.toLowerCase())).forEach((t=>{var e,i;null==(i=null==(e=t.shadowRoot)?void 0:e.querySelector("input"))||i.dispatchEvent(new Event("invalid"))})),null!=e&&e.length&&e[0].focus()}},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),o.set(this.host,[])},this.handleInteraction=t=>{const e=o.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");if(i)return e.getElementById(i)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sd-input"],...i}}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),o.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),o.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){var t;const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&(this.setValidity(null==(t=this.host)?void 0:t.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,e.has(this.form)?e.get(this.form).add(this.host):e.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),i.has(this.form)||(i.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&(null==(t=e.get(this.form))||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),i.has(this.form)&&(this.form.reportValidity=i.get(this.form),i.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){s.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){return this.form??null}renderInvalidMessage(){return t`<div id="invalid-message" class="text-error text-sm mt-2 text-left" part="error-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var e;const i=this.host,o=!!s.get(i),a=!!i.required;null!=(e=this.form)&&e.noValidate?(i.removeAttribute("data-required"),i.removeAttribute("data-optional"),i.removeAttribute("data-invalid"),i.removeAttribute("data-valid"),i.removeAttribute("data-user-invalid"),i.removeAttribute("data-user-valid")):(i.toggleAttribute("data-required",a),i.toggleAttribute("data-optional",!a),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&o),i.toggleAttribute("data-user-valid",t&&o))}updateValidity(){const t=this.host;this.setValidity(null==t?void 0:t.validity.valid)}emitInvalidEvent(t){null==t||t.preventDefault();const e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}}const r=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),h=Object.freeze({...r,valid:!1,valueMissing:!0}),n=Object.freeze({...r,valid:!1,customError:!0});export{a as F,h as a,n as c,r as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as t,x as e,i as s,n as i}from"./solid-element.js";import{c as l}from"./register-custom-element.js";import{d as o}from"./default-value.js";import{F as a}from"./form.js";import{H as r}from"./slot.js";import{o as n}from"./if-defined.js";import{l as p}from"./live.js";import{L as h}from"./solid-components2.js";import{r as d}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as m}from"./component.styles.js";import{t as y}from"./classix.js";import{f as b}from"./form-control.styles.js";import"./request.js";import"./request2.js";import"./directive.js";var f,v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,x=(t,e,s,i)=>{for(var l,o=i>1?void 0:i?g(e,s):e,a=t.length-1;a>=0;a--)(l=t[a])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&v(e,s,o),o};const w=!(null==(f=navigator.userAgentData)?void 0:f.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let $=class extends t{constructor(){super(...arguments),this.formControlController=new a(this),this.hasSlotController=new r(this,"help-text","label","left","right","message","placeholder"),this.localize=new h(this),this.hasFocus=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(){this.formControlController.setValidity(!1)}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),s=this.hasSlotController.test("help-text"),i=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),l=this.hasSlotController.test("right"),o=!!this.label||!!t,a=!!this.helpText||!!s,r=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),h=this.required||!!this.pattern||!!this.minlength||!!this.maxlength,d=h&&!this.checkValidity(),u=h&&this.checkValidity(),c=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&d?"activeInvalid":this.hasFocus&&u?"activeValid":this.hasFocus?"active":d?"invalid":u?"valid":"default",m="sm"===this.size?"text-sm":"text-base",b={disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[c],f={disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[c],v=this.disabled?"text-neutral-500":"text-primary",g={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],x={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return e`<div part="form-control" class="${y("form-control",o&&"form-control--has-label",this.disabled&&"pointer-events-none")}"><label part="form-control-label" id="label" class="${y("form-control-label mb-2",o?"has-label inline-block":"hidden",m)}" for="input" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="form-control-input relative w-full"><div part="border" class="${y("absolute w-full h-full pointer-events-none border rounded-default transition-all",f)}"></div><div part="base" class="${y("px-4 flex flex-row items-center rounded-default transition-all","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly&&"bg-neutral-100",d&&"form-control-input--invalid",b,!this.value&&"input--empty",this.noSpinButtons&&"input--no-spin-buttons",w&&"input--is-firefox")}">${i?e`<slot name="left" part="left" class="${y("inline-flex","sm"===this.size?"mr-1":"mr-2",v,x)}"></slot>`:""} <input part="input" id="input" class="${y("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",m)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${p(this.value)}" autocapitalize="${n("password"===this.type?"off":this.autocapitalize)}" autocomplete="${n("password"===this.type?"off":this.autocomplete)}" autocorrect="${n("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${r?e`<button part="clear-button" class="${y("flex justify-center ",g)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${y("text-neutral-500",x)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?e`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?e`<slot name="show-password-icon"><sd-icon class="${y(v,g,x)}" library="system" name="eye"></sd-icon></slot>`:e`<slot name="hide-password-icon"><sd-icon class="${y(v,g,x)}" library="system" name="eye-crossed-out"></sd-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||w?"":e`<sd-icon class="${y(v,g,x)}" library="system" name="calendar"></sd-icon>`} ${"time"===this.type?e`<sd-icon class="${y(v,g,x)}" library="system" name="clock"></sd-icon>`:""} ${d?e`<sd-icon class="${y("text-error",g,x)}" library="system" name="risk"></sd-icon>`:""} ${u?e`<sd-icon class="${y("text-success",g,x)}" library="system" name="confirm"></sd-icon>`:""} ${l?e`<slot name="right" part="right" class="${y("inline-flex",v,g,x)}"></slot>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${y("text-sm text-neutral-700",a?"block":"hidden")}" aria-hidden="${a?"false":"true"}">${this.helpText}</slot></div>`}};$.styles=[m,b,t.styles,s`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label.has-label::after{content:'*';margin-left:var(--sd-spacing-0-5,.125rem)}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}`],x([u("#input")],$.prototype,"input",2),x([d()],$.prototype,"hasFocus",2),x([i({reflect:!0})],$.prototype,"type",2),x([i({reflect:!0})],$.prototype,"size",2),x([i()],$.prototype,"inputmode",2),x([i()],$.prototype,"value",2),x([o()],$.prototype,"defaultValue",2),x([i()],$.prototype,"placeholder",2),x([i()],$.prototype,"label",2),x([i({attribute:"help-text"})],$.prototype,"helpText",2),x([i({type:Boolean})],$.prototype,"clearable",2),x([i({type:Boolean,reflect:!0})],$.prototype,"disabled",2),x([i({type:Boolean,reflect:!0})],$.prototype,"readonly",2),x([i({attribute:"password-toggle",type:Boolean})],$.prototype,"passwordToggle",2),x([i({attribute:"password-visible",type:Boolean})],$.prototype,"passwordVisible",2),x([i({attribute:"no-spin-buttons",type:Boolean})],$.prototype,"noSpinButtons",2),x([i({type:Number})],$.prototype,"minlength",2),x([i({type:Number})],$.prototype,"maxlength",2),x([i({type:Number})],$.prototype,"min",2),x([i({type:Number})],$.prototype,"max",2),x([i({reflect:!0})],$.prototype,"form",2),x([i()],$.prototype,"name",2),x([i()],$.prototype,"title",2),x([i({type:Boolean,reflect:!0})],$.prototype,"required",2),x([i()],$.prototype,"pattern",2),x([i()],$.prototype,"step",2),x([i()],$.prototype,"autocapitalize",2),x([i()],$.prototype,"autocorrect",2),x([i()],$.prototype,"autocomplete",2),x([i({type:Boolean})],$.prototype,"autofocus",2),x([i()],$.prototype,"enterkeyhint",2),x([i({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],$.prototype,"spellcheck",2),x([c("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"handleDisabledChange",1),x([c("step",{waitUntilFirstUpdate:!0})],$.prototype,"handleStepChange",1),x([c("value",{waitUntilFirstUpdate:!0})],$.prototype,"handleValueChange",1),$=x([l("sd-input")],$);export{$ as default};
|
|
1
|
+
import"./icon.js";import{S as t,x as e,i as s,n as i}from"./solid-element.js";import{c as l}from"./register-custom-element.js";import{d as a}from"./default-value.js";import{F as o}from"./form.js";import{H as r}from"./slot.js";import{o as n}from"./if-defined.js";import{l as p}from"./live.js";import{L as h}from"./solid-components2.js";import{r as d}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as m}from"./component.styles.js";import{t as y}from"./classix.js";import"./request.js";import"./request2.js";import"./directive.js";var b,v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=(t,e,s,i)=>{for(var l,a=i>1?void 0:i?f(e,s):e,o=t.length-1;o>=0;o--)(l=t[o])&&(a=(i?l(e,s,a):l(a))||a);return i&&a&&v(e,s,a),a};const w=!(null==(b=navigator.userAgentData)?void 0:b.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let x=class extends t{constructor(){super(...arguments),this.formControlController=new o(this),this.hasSlotController=new r(this,"help-text","label","left","right","message","placeholder"),this.localize=new h(this),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),s=this.hasSlotController.test("help-text"),i=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),l=this.hasSlotController.test("right"),a=!!this.label||!!t,o=!!this.helpText||!!s,r=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),h=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.showValidStyle?"valid":"default",d="sm"===this.size?"text-sm":"text-base",u={disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[h],c={disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[h],m=this.disabled?"text-neutral-500":"text-primary",b={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],v={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return e`<div part="form-control" class="${y(this.disabled&&"pointer-events-none")}"><label part="form-control-label" id="label" class="${y("mb-2",a?"inline-block":"hidden",d)}" for="input" aria-hidden="${a?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full"><div part="border" class="${y("absolute w-full h-full pointer-events-none border rounded-default",c)}"></div><div part="base" class="${y("px-4 flex flex-row items-center rounded-default transition-all bg-white","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly&&"bg-neutral-100",u)}">${i?e`<slot name="left" part="left" class="${y("inline-flex","sm"===this.size?"mr-1":"mr-2",m,v)}"></slot>`:""} <input part="input" id="input" class="${y("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",d)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${p(this.value)}" autocapitalize="${n("password"===this.type?"off":this.autocapitalize)}" autocomplete="${n("password"===this.type?"off":this.autocomplete)}" autocorrect="${n("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${r?e`<button part="clear-button" class="${y("flex justify-center ",b)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${y("text-neutral-500",v)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?e`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?e`<slot name="show-password-icon"><sd-icon class="${y(m,b,v)}" library="system" name="eye"></sd-icon></slot>`:e`<slot name="hide-password-icon"><sd-icon class="${y(m,b,v)}" library="system" name="eye-crossed-out"></sd-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||w?"":e`<sd-icon class="${y(m,b,v)}" library="system" name="calendar"></sd-icon>`} ${"time"===this.type?e`<sd-icon class="${y(m,b,v)}" library="system" name="clock"></sd-icon>`:""} ${this.showInvalidStyle?e`<sd-icon class="${y("text-error",b,v)}" library="system" name="risk"></sd-icon>`:""} ${this.showValidStyle?e`<sd-icon class="${y("text-success",b,v)}" library="system" name="confirm"></sd-icon>`:""} ${l?e`<slot name="right" part="right" class="${y("inline-flex",m,b,v)}"></slot>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${y("text-sm text-neutral-700",o?"block":"hidden")}" aria-hidden="${!o}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};x.styles=[m,t.styles,s`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label::after{content:' *'}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}`],g([u("#input")],x.prototype,"input",2),g([u("#invalid-message")],x.prototype,"invalidMessage",2),g([d()],x.prototype,"hasFocus",2),g([d()],x.prototype,"showValidStyle",2),g([d()],x.prototype,"showInvalidStyle",2),g([i({reflect:!0})],x.prototype,"type",2),g([i({reflect:!0})],x.prototype,"size",2),g([i()],x.prototype,"inputmode",2),g([i()],x.prototype,"value",2),g([a()],x.prototype,"defaultValue",2),g([i()],x.prototype,"placeholder",2),g([i()],x.prototype,"label",2),g([i({attribute:"help-text"})],x.prototype,"helpText",2),g([i({type:Boolean})],x.prototype,"clearable",2),g([i({type:Boolean,reflect:!0})],x.prototype,"disabled",2),g([i({type:Boolean,reflect:!0})],x.prototype,"readonly",2),g([i({attribute:"password-toggle",type:Boolean})],x.prototype,"passwordToggle",2),g([i({attribute:"password-visible",type:Boolean})],x.prototype,"passwordVisible",2),g([i({attribute:"no-spin-buttons",type:Boolean})],x.prototype,"noSpinButtons",2),g([i({type:Number})],x.prototype,"minlength",2),g([i({type:Number})],x.prototype,"maxlength",2),g([i({type:Number})],x.prototype,"min",2),g([i({type:Number})],x.prototype,"max",2),g([i({reflect:!0})],x.prototype,"form",2),g([i()],x.prototype,"name",2),g([i()],x.prototype,"title",2),g([i({type:Boolean,reflect:!0})],x.prototype,"required",2),g([i()],x.prototype,"pattern",2),g([i()],x.prototype,"step",2),g([i()],x.prototype,"autocapitalize",2),g([i()],x.prototype,"autocorrect",2),g([i()],x.prototype,"autocomplete",2),g([i({type:Boolean})],x.prototype,"autofocus",2),g([i()],x.prototype,"enterkeyhint",2),g([i({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],x.prototype,"spellcheck",2),g([c("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1),g([c("step",{waitUntilFirstUpdate:!0})],x.prototype,"handleStepChange",1),g([c("value",{waitUntilFirstUpdate:!0})],x.prototype,"handleValueChange",1),x=g([l("sd-input")],x);export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as e,x as t,i as s,n as l}from"./solid-element.js";import{c as
|
|
1
|
+
import"./icon.js";import{S as e,x as t,i as s,n as l}from"./solid-element.js";import{c as a}from"./register-custom-element.js";import{H as o}from"./slot.js";import{L as r}from"./solid-components2.js";import{r as i}from"./state.js";import{e as n}from"./query.js";import{w as h}from"./watch.js";import{c}from"./component.styles.js";import{t as d}from"./classix.js";import"./request.js";import"./request2.js";import"./directive.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,b=(e,t,s,l)=>{for(var a,o=l>1?void 0:l?u(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(l?a(t,s,o):a(o))||o);return l&&o&&p(t,s,o),o};let m=class extends e{constructor(){super(...arguments),this.hasSlotController=new o(this,"default","left","right"),this.localize=new r(this),this.current=!1,this.selected=!1,this.hasHover=!1,this.size="lg",this.checkbox=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){const e=this.getTextLabel();typeof this.cachedTextLabel>"u"?this.cachedTextLabel=e:e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){return(this.textContent??"").trim()}render(){this.hasSlotController.test("default");const e=this.hasSlotController.test("left"),s=this.hasSlotController.test("right");return t`<div part="base" class="${d("px-4 flex items-center w-full transition-all text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-500 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${d("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150 border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?t`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${d("relative flex flex-initial items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"border-neutral-800")}">${this.selected?t`<sd-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-hook"></sd-icon>`:""}</span>`:""} ${e?t`<slot name="left" part="left" class="inline-flex mr-2"></slot>`:""}<slot part="label" class="inline-block flex-grow" @slotchange="${this.handleDefaultSlotChange}"></slot>${s?t`<slot name="right" part="right" class="inline-flex ml-2"></slot>`:""}</div>`}};m.styles=[c,e.styles,s`:host{position:relative;display:block;width:100%;outline:2px solid transparent!important;outline-offset:2px!important}`],b([n('[part="base"]')],m.prototype,"defaultSlot",2),b([i()],m.prototype,"current",2),b([i()],m.prototype,"selected",2),b([i()],m.prototype,"hasHover",2),b([l({reflect:!0})],m.prototype,"size",2),b([l({type:Boolean,reflect:!0})],m.prototype,"checkbox",2),b([l({type:Boolean,reflect:!0})],m.prototype,"disabled",2),b([l({reflect:!0})],m.prototype,"value",2),b([h("disabled")],m.prototype,"handleDisabledChange",1),b([h("selected")],m.prototype,"handleSelectedChange",1),b([h("value")],m.prototype,"handleValueChange",1),m=b([a("sd-option")],m);export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as t,x as e,i as s,n as r}from"./solid-element.js";import{c as o}from"./register-custom-element.js";import{H as i}from"./slot.js";import{o as a}from"./if-defined.js";import{r as n}from"./state.js";import{e as d}from"./query.js";import{w as l}from"./watch.js";import{c as u}from"./component.styles.js";import{t as h}from"./classix.js";var c=Object.defineProperty,b=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?b(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&c(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new i(this,"[default]","icon"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="lg"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),s=this.hasSlotController.test("icon"),r=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${h("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",s&&"button--has-icon flex gap-2",r)}" aria-disabled="${this.disabled}" type="button" value="${a(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${h(s&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!s}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,u,s`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-button-group__button--first:not(.sd-button-group__button--last)) button{border-top-right-radius:var(--sd-border-radius-none,0);border-bottom-right-radius:var(--sd-border-radius-none,0)}:host(.sd-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-button-group__button--last:not(.sd-button-group__button--first)) button{border-top-left-radius:var(--sd-border-radius-none,0);border-bottom-left-radius:var(--sd-border-radius-none,0)}:host(.sd-button-group__button:not(.sd-button-group__button--first)){margin-inline-start:-1px}:host(.sd-button-group__button--hover){z-index:10}:host(.sd-button-group__button--focus),:host(.sd-button-group__button[checked]){z-index:20}`],p([d(".button")],m.prototype,"input",2),p([d(".hidden-input")],m.prototype,"hiddenInput",2),p([n()],m.prototype,"hasFocus",2),p([r({type:Boolean,reflect:!0})],m.prototype,"checked",2),p([r()],m.prototype,"value",2),p([r({type:Boolean,reflect:!0})],m.prototype,"disabled",2),p([r({reflect:!0})],m.prototype,"size",2),p([l("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),m=p([o("sd-radio-button")],m);export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as t,n as e,S as o,x as s}from"./solid-element.js";import{c as i}from"./register-custom-element.js";import{F as a,c as l,a as r,v as n}from"./form.js";import{H as d}from"./slot.js";import{r as h}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as p}from"./component.styles.js";import{t as m}from"./classix.js";const
|
|
1
|
+
import{i as t,n as e,S as o,x as s}from"./solid-element.js";import{c as i}from"./register-custom-element.js";import{F as a,c as l,a as r,v as n}from"./form.js";import{H as d}from"./slot.js";import{r as h}from"./state.js";import{e as u}from"./query.js";import{w as c}from"./watch.js";import{c as p}from"./component.styles.js";import{t as m}from"./classix.js";import g from"./radio.js";import"./icon.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./directive.js";const b=t`${p}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?v(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&f(e,o,a),a};let C=class extends o{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=w(t.target);null==e||e.classList.add("sd-button-group__button--focus")}handleBlur(t){const e=w(t.target);null==e||e.classList.remove("sd-button-group__button--focus")}handleMouseOver(t){const e=w(t.target);null==e||e.classList.add("sd-button-group__button--hover")}handleMouseOut(t){const e=w(t.target);null==e||e.classList.remove("sd-button-group__button--hover")}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),s=w(e);null!==s&&(s.classList.add("sd-button-group__button"),s.classList.toggle("sd-button-group__button--first",0===o),s.classList.toggle("sd-button-group__button--inner",o>0&&o<t.length-1),s.classList.toggle("sd-button-group__button--last",o===t.length-1),s.classList.toggle("sd-button-group__button--radio","sd-radio-button"===s.tagName.toLowerCase()))}))}render(){return s`<slot part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};function w(t){const e="sd-button, sd-radio-button";return t.closest(e)??t.querySelector(e)}C.styles=b,y([u("slot")],C.prototype,"defaultSlot",2),y([h()],C.prototype,"disableRole",2),y([e()],C.prototype,"label",2),C=y([i("sd-button-group")],C);var x=Object.defineProperty,R=Object.getOwnPropertyDescriptor,k=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?R(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&x(e,o,a),a};let I=class extends o{constructor(){super(...arguments),this.formControlController=new a(this),this.hasSlotController=new d(this,"label","error-text"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.showInvalidStyle=!1,this.label="",this.boldLabel=!1,this.name="option",this.value="",this.size="lg",this.form="",this.required=!1,this.orientation="vertical"}get validity(){const t=this.required&&!this.value;return""!==this.customValidityMessage?l:t?r:n}get validationMessage(){const t=this.required&&!this.value;return""!==this.customValidityMessage?this.customValidityMessage:t?this.validationInput.validationMessage:""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sd-radio, sd-radio-button")]}handleRadioClick(t){const e=t.target.closest("sd-radio, sd-radio-button"),o=this.getAllRadios(),s=this.value;e.disabled||(this.value=e.value,o.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("sd-change"),this.emit("sd-input")))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),o=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,i=this.value;let a=e.indexOf(o)+s;a<0&&(a=e.length-1),a>e.length-1&&(a=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[a].value,e[a].checked=!0,this.hasButtonGroup?e[a].shadowRoot.querySelector("button").focus():(e[a].tabIndex=0,e[a].focus()),this.value!==i&&(this.emit("sd-change"),this.emit("sd-input")),t.preventDefault()}focus(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}async syncRadioElements(){var t,e;const o=this.getAllRadios();if(await Promise.all(o.map((async t=>{await t.updateComplete,t.checked=t.value===this.value,t.size=this.size,t instanceof g&&(t.invalid=this.showInvalidStyle)}))),this.hasButtonGroup=o.some((t=>"sd-radio-button"===t.tagName.toLowerCase())),!o.some((t=>t.checked)))if(this.hasButtonGroup){const e=null==(t=o[0].shadowRoot)?void 0:t.querySelector("button");e&&(e.tabIndex=0)}else o[0].tabIndex=0;if(this.hasButtonGroup){const t=null==(e=this.shadowRoot)?void 0:e.querySelector("sd-button-group");t&&(t.disableRole=!0)}}syncRadios(){customElements.get("sd-radio")&&customElements.get("sd-radio-button")?this.syncRadioElements():(customElements.get("sd-radio")?this.syncRadioElements():customElements.whenDefined("sd-radio").then((()=>this.syncRadios())),customElements.get("sd-radio-button")?this.syncRadioElements():customElements.whenDefined("sd-radio-button").then((()=>this.syncRadios())))}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value)),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleInvalidChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&(this.updateCheckedRadio(),this.reportValidity())}checkValidity(){const t=this.required&&!this.value,e=""!==this.customValidityMessage;return!t&&!e||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const t=this.validity.valid;return this.formControlController.setValidity(t),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),t||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout((()=>this.validationInput.hidden=!0),1e4)),t}setCustomValidity(t=""){this.customValidityMessage=t,this.validationInput.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=!!this.label||!!t,o=s`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;return s`<fieldset part="form-control" class="${m("border-0 p-0 m-0 flex flex-col",{sm:"text-sm",lg:"text-base"}[this.size])}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="${m("mb-2 p-0 leading-normal text-black text-left",!e&&"hidden",this.boldLabel&&"font-bold")}" @click="${this.focus}" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${m("flex",{vertical:"flex-col",horizontal:"flex-row"}[this.orientation])}"><div class="sr-only"><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${this.hasButtonGroup?s`<sd-button-group part="button-group" exportparts="base:button-group__base" role="presentation">${o}</sd-button-group>`:o}</div></fieldset>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-button-group":C},I.styles=[p,o.styles,t`:host{display:block}:host([orientation=vertical]) ::slotted(sd-radio){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-radio:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-radio){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-radio){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([required]) #label::after{content:' *'}`],k([u("slot:not([name])")],I.prototype,"defaultSlot",2),k([u("#validation-input")],I.prototype,"validationInput",2),k([u("#invalid-message")],I.prototype,"invalidMessage",2),k([h()],I.prototype,"hasButtonGroup",2),k([h()],I.prototype,"defaultValue",2),k([h()],I.prototype,"showInvalidStyle",2),k([e()],I.prototype,"label",2),k([e({type:Boolean,reflect:!0})],I.prototype,"boldLabel",2),k([e()],I.prototype,"name",2),k([e({reflect:!0})],I.prototype,"value",2),k([e({reflect:!0})],I.prototype,"size",2),k([e({reflect:!0})],I.prototype,"form",2),k([e({type:Boolean,reflect:!0})],I.prototype,"required",2),k([e({reflect:!0})],I.prototype,"orientation",2),k([c("size",{waitUntilFirstUpdate:!0})],I.prototype,"handleSizeChange",1),k([c("showInvalidStyle",{waitUntilFirstUpdate:!0})],I.prototype,"handleInvalidChange",1),k([c("value")],I.prototype,"handleValueChange",1),I=k([i("sd-radio-group")],I);export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as e,x as t,i as s,n as i}from"./solid-element.js";import{c as r}from"./register-custom-element.js";import{r as o}from"./state.js";import{w as l}from"./watch.js";import{t as a}from"./classix.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./directive.js";import"./component.styles.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,t,s,i)=>{for(var r,o=i>1?void 0:i?d(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&n(t,s,o),o};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.invalid=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${a("sd-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",this.disabled&&"hover:cursor-not-allowed",{sm:"small-size text-sm",lg:"text-base"}[this.size])}"><span part="${this.checked?"control--checked":"control--unchecked"}" class="${a("flex-initial shrink-0 relative inline-flex items-center justify-center border rounded-full bg-white h-4 w-4",
|
|
1
|
+
import"./icon.js";import{S as e,x as t,i as s,n as i}from"./solid-element.js";import{c as r}from"./register-custom-element.js";import{r as o}from"./state.js";import{w as l}from"./watch.js";import{t as a}from"./classix.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./directive.js";import"./component.styles.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,t,s,i)=>{for(var r,o=i>1?void 0:i?d(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(o=(i?r(t,s,o):r(o))||o);return i&&o&&n(t,s,o),o};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.invalid=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${a("sd-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",this.disabled&&"hover:cursor-not-allowed",{sm:"small-size text-sm",lg:"text-base"}[this.size])}"><span part="${this.checked?"control--checked":"control--unchecked"}" class="${a("flex-initial shrink-0 relative inline-flex items-center justify-center border rounded-full bg-white h-4 w-4",this.disabled?"border-neutral-500":this.invalid?"border-error hover:border-error-400 group-hover:border-error-400":this.checked?"border-accent hover:border-accent-550 group-hover:border-accent-550":"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200")}">${this.checked?t`<span part="checked" class="${a("rounded-full inline-flex text-white border bg-accent h-2.5 w-2.5",this.disabled?"bg-neutral-500":this.invalid?"bg-error hover:bg-error-400 group-hover:bg-error-400":this.checked?"bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"bg-neutral-800")}"></span>`:""}</span><slot part="label" class="${a("ml-2 select-none inline-block",this.disabled?"text-neutral-500":this.invalid?"text-error":"text-black")}"></slot></span>`}};c.styles=[e.styles,s`:host{display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:rgb(var(--sd-color-primary,0 53 142) / 1)}`],h([o()],c.prototype,"checked",2),h([o()],c.prototype,"hasFocus",2),h([i({reflect:!0})],c.prototype,"size",2),h([i({type:Boolean,reflect:!0})],c.prototype,"invalid",2),h([i({type:Boolean,reflect:!0})],c.prototype,"disabled",2),h([i()],c.prototype,"value",2),h([l("checked")],c.prototype,"handleCheckedChange",1),h([l("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",1),c=h([r("sd-radio")],c);export{c as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a}from"./solid-element.js";import{c as
|
|
1
|
+
import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a}from"./solid-element.js";import{c as n}from"./register-custom-element.js";import{d as r}from"./default-value.js";import{F as h}from"./form.js";import{g as p,s as d}from"./animation-registry.js";import{H as c}from"./slot.js";import{L as u}from"./solid-components2.js";import{r as m}from"./state.js";import{e as b}from"./query.js";import{o as y}from"./query-assigned-elements.js";import{s as f}from"./scroll.js";import{o as v,S as g}from"./icon.js";import{w as x}from"./watch.js";import{c as w}from"./component.styles.js";import{t as C}from"./classix.js";import O from"./popup.js";import S from"./tag.js";import"./request.js";import"./request2.js";import"./directive.js";import"./static.js";import"./if-defined.js";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?k(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&$(e,s,l),l};let I=class extends i{constructor(){super(...arguments),this.formControlController=new h(this,{assumeInteractionOn:["sd-blur","sd-input"]}),this.hasSlotController=new c(this,"help-text","label"),this.localize=new u(this),this.typeToSelectString="",this.hasFocus=!1,this.hasHover=!1,this.displayLabel="",this.selectedOptions=[],this.showValidStyle=!1,this.showInvalidStyle=!1,this.defaultValue="",this.open=!1,this.size="lg",this.label="",this.placeholder=this.localize.term("selectDefaultPlaceholder"),this.helpText="",this.placement="bottom",this.currentPlacement=this.placement,this.clearable=!1,this.disabled=!1,this.multiple=!1,this.useTags=!1,this.maxOptionsVisible=3,this.form="",this.name="",this.value="",this.required=!1,this.hoist=!1,this.getTag=t=>o`<sd-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
2
|
base:tag__base,
|
|
3
3
|
content:tag__content,
|
|
4
4
|
removable-indicator:tag__removable-indicator,
|
|
5
|
-
" size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}updated(){this.hasAttribute("data-user-valid")&&this.checkValidity()&&(this.isValid=!0),this.hasAttribute("data-user-invalid")&&!this.checkValidity()&&(this.isInvalid=!0)}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-option")]}getFirstOption(){return this.querySelector("sd-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?v(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&f(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.isInvalid?"activeInvalid":this.hasFocus&&this.isValid?"activeValid":this.hasFocus||this.open?"active":this.isInvalid?"invalid":this.isValid?"valid":"default",r=this.disabled?"cursor-not-allowed":"cursor-pointer",n={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${O("form-control relative text-left",r,"sm"===this.size?"text-sm":"text-base",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a],this.open&&"z-10")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label" class="${O(this.disabled&&"text-black")}">${this.label}</slot></label><div part="form-control-input" class="${O("relative w-full bg-white")}"><div part="border" class="${O("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${O("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10"><div part="combobox" class="${O("relative w-full px-4 flex flex-row items-center rounded-default",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${O("appearance-none outline-none flex-grow bg-transparent",r,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${O("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",r)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${O("select__clear flex justify-center",n)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${O("text-neutral-500",h)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.isInvalid?o`<sd-icon class="${O("text-error",n,h)}" library="system" name="risk"></sd-icon>`:""} ${this.isValid?o`<sd-icon class="${O("text-success",n,h)}" library="system" name="confirm"></sd-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${O("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",h)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${O("bg-white px-2 py-3 relative","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>`}};T.dependencies={"sd-icon":g,"sd-popup":$,"sd-tag":S},T.styles=[w,C,i.styles,l`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-popup::part(popup){overflow-y:scroll}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],I([y({selector:"sd-option"})],T.prototype,"_optionsInDefaultSlot",2),I([b("sd-popup")],T.prototype,"popup",2),I([b('[part="combobox"]')],T.prototype,"combobox",2),I([b('[part="display-input"]')],T.prototype,"displayInput",2),I([b(".value-input")],T.prototype,"valueInput",2),I([b('[part="listbox"]')],T.prototype,"listbox",2),I([m()],T.prototype,"hasFocus",2),I([m()],T.prototype,"hasHover",2),I([m()],T.prototype,"displayLabel",2),I([m()],T.prototype,"currentOption",2),I([m()],T.prototype,"selectedOptions",2),I([m()],T.prototype,"isValid",2),I([m()],T.prototype,"isInvalid",2),I([n()],T.prototype,"defaultValue",2),I([a({type:Boolean,reflect:!0})],T.prototype,"open",2),I([a({reflect:!0})],T.prototype,"size",2),I([a()],T.prototype,"label",2),I([a()],T.prototype,"placeholder",2),I([a({attribute:"help-text"})],T.prototype,"helpText",2),I([a({reflect:!0})],T.prototype,"placement",2),I([m()],T.prototype,"currentPlacement",2),I([a({type:Boolean})],T.prototype,"clearable",2),I([a({type:Boolean,reflect:!0})],T.prototype,"disabled",2),I([a({type:Boolean,reflect:!0})],T.prototype,"multiple",2),I([a({type:Boolean,reflect:!0})],T.prototype,"useTags",2),I([a({attribute:"max-options-visible",type:Number})],T.prototype,"maxOptionsVisible",2),I([a({reflect:!0})],T.prototype,"form",2),I([a()],T.prototype,"name",2),I([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],T.prototype,"value",2),I([a({type:Boolean,reflect:!0})],T.prototype,"required",2),I([a({type:Boolean})],T.prototype,"hoist",2),I([a()],T.prototype,"getTag",2),I([x("useTags",{waitUntilFirstUpdate:!0})],T.prototype,"handleUseTagsChange",1),I([x("disabled",{waitUntilFirstUpdate:!0})],T.prototype,"handleDisabledChange",1),I([x("open",{waitUntilFirstUpdate:!0})],T.prototype,"handleOpenChange",1),I([x("size",{waitUntilFirstUpdate:!0})],T.prototype,"applySizeToOptions",1),I([x("value",{waitUntilFirstUpdate:!0})],T.prototype,"handleValueChange",1),T=I([r("sd-select")],T),d("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{T as default};
|
|
5
|
+
" size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-option")]}getFirstOption(){return this.querySelector("sd-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?v(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&f(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.showValidStyle?"valid":"default",n=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${C("relative text-left",n,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${C("relative w-full bg-white",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a])}"><div part="border" class="${C("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${C("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10"><div part="combobox" class="${C("relative w-full px-4 flex flex-row items-center rounded-default",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${C("appearance-none outline-none flex-grow bg-transparent",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${C("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${C("select__clear flex justify-center",r)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${C("text-neutral-500",h)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-icon class="${C("text-error",r,h)}" library="system" name="risk"></sd-icon>`:""} ${this.showValidStyle?o`<sd-icon class="${C("text-success",r,h)}" library="system" name="confirm"></sd-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${C("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",h)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${C("bg-white px-2 py-3 relative","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-icon":g,"sd-popup":O,"sd-tag":S},I.styles=[w,i.styles,l`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-popup::part(popup){overflow-y:scroll}sd-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([y({selector:"sd-option"})],I.prototype,"_optionsInDefaultSlot",2),D([b("sd-popup")],I.prototype,"popup",2),D([b('[part="combobox"]')],I.prototype,"combobox",2),D([b('[part="display-input"]')],I.prototype,"displayInput",2),D([b(".value-input")],I.prototype,"valueInput",2),D([b('[part="listbox"]')],I.prototype,"listbox",2),D([b("#invalid-message")],I.prototype,"invalidMessage",2),D([m()],I.prototype,"hasFocus",2),D([m()],I.prototype,"hasHover",2),D([m()],I.prototype,"displayLabel",2),D([m()],I.prototype,"currentOption",2),D([m()],I.prototype,"selectedOptions",2),D([m()],I.prototype,"showValidStyle",2),D([m()],I.prototype,"showInvalidStyle",2),D([r()],I.prototype,"defaultValue",2),D([a({type:Boolean,reflect:!0})],I.prototype,"open",2),D([a({reflect:!0})],I.prototype,"size",2),D([a()],I.prototype,"label",2),D([a()],I.prototype,"placeholder",2),D([a({attribute:"help-text"})],I.prototype,"helpText",2),D([a({reflect:!0})],I.prototype,"placement",2),D([m()],I.prototype,"currentPlacement",2),D([a({type:Boolean})],I.prototype,"clearable",2),D([a({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([a({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([a({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([a({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([a({reflect:!0})],I.prototype,"form",2),D([a()],I.prototype,"name",2),D([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([a({type:Boolean,reflect:!0})],I.prototype,"required",2),D([a({type:Boolean})],I.prototype,"hoist",2),D([a()],I.prototype,"getTag",2),D([x("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([x("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([x("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([x("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([x("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([n("sd-select")],I),d("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={calendar:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21 2H3a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1ZM6 4v1.667a1 1 0 0 0 2 0V4h8v1.667a1 1 0 0 0 2 0V4h2v4H4V4h2ZM4 20V10h16v10H4Z"/>\n <path d="m7.603 13.263.597.81.31-.25c.31-.25.593-.49.733-.63h.017c-.017.333-.033 1.14-.033 1.647V18h1.223v-6.03H9.353l-1.75 1.293ZM14.667 11.867c-1.543 0-2.26 1-2.26 3.163 0 1.9.667 3.063 2.217 3.063s2.193-1.18 2.193-3.13c-.017-2.063-.743-3.097-2.15-3.097v.001Zm-.044 5.333c-.647 0-1-.76-1-2.28 0-1.44.353-2.173 1-2.173s1 .743 1 2.233c0 1.49-.387 2.227-1.017 2.227l.017-.007Z"/>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',clock:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M13 11.587V8a1 1 0 0 0-2 0v4c0 .07.007.138.021.203l-.001-.006a.855.855 0 0 0 .029.093l-.002-.006c0 .033 0 .067.03.1a.709.709 0 0 0 .055.103l-.002-.003.037.07c.04.057.081.107.127.153l2.827 2.83a1.002 1.002 0 0 0 1.417-1.417L13 11.587Z"/>\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n </svg>\n ',close:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n ',"closing-round":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n <path d="M16.373 7.627a1 1 0 0 0-1.414 0l-2.96 2.96-2.96-2.96a1 1 0 0 0-1.413 1.414l-.001-.001 2.96 2.96-2.96 2.96a1 1 0 0 0 1.414 1.414l2.96-2.96 2.96 2.96a1 1 0 0 0 1.414-1.414L13.413 12l2.96-2.96a1 1 0 0 0 0-1.414v.001Z"/>\n </svg>',confirm:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.528 2.167a1 1 0 0 0-1.384.277l-.002.004-11.333 17-5.127-5.153a1 1 0 0 0-1.413 1.414l-.001-.001 6 6a.997.997 0 0 0 .707.293h.1c.307-.032.57-.199.731-.44l.002-.004 12-18a1 1 0 0 0-.276-1.388l-.004-.002Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n </svg>\n ',"eye-crossed-out":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M3 22a1 1 0 0 1-.707-1.707l18-18a1 1 0 0 1 1.414 1.414l-18 18A.991.991 0 0 1 3 22Z"/>\n </svg>\n ',"info-circle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>',"status-hook":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">\n <path fill="currentColor" d="m9.947 1.138-.005.008-.001.003-5.56 8.34-2.434-2.447-.004-.004a.648.648 0 0 0-1.093.475c0 .172.066.328.175.444l.003.004 3 2.999c.117.117.28.19.46.19h.065c.2-.021.37-.13.475-.286l.005-.008.001-.002 5.994-8.992a.65.65 0 0 0-.18-.902l-.007-.005-.002-.002a.65.65 0 0 0-.892.185Z"/>\n </svg>\n ',"status-minus":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n <path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>\n </svg>\n ',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n ',risk:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.893 2.553a1.002 1.002 0 0 0-1.784-.006L2.106 20.553A1 1 0 0 0 3 22h18a1 1 0 0 0 .891-1.452l.003.006-9.001-18.001ZM4.617 20 12 5.237 19.383 20H4.617Z"/>\n <path d="M11 10.667V15a1 1 0 0 0 2 0v-4.333a1 1 0 0 0-2 0ZM13 18a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>\n </svg>\n ',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>\n ',"confirm-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M15.843 7.473a.999.999 0 0 0-1.367.329l-.002.004-3.667 6.223-1.757-1.753a1 1 0 0 0-1.413 1.414l-.001-.001 2.667 2.667a.997.997 0 0 0 .695.31h.128c.314-.042.578-.223.731-.479l.003-.005 4.333-7.333a1 1 0 0 0-.345-1.374l-.005-.003v.001Z"/></svg>',warning:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.893 2.55295C12.725 2.22395 12.388 2.00195 12 2.00195C11.612 2.00195 11.275 2.22295 11.109 2.54695L2.10598 20.553C2.03998 20.683 2.00098 20.837 2.00098 21C2.00098 21.552 2.44798 21.999 2.99998 22H21C21.552 21.999 21.999 21.552 21.999 21C21.999 20.837 21.96 20.683 21.891 20.548L21.894 20.554L12.893 2.55295ZM4.61698 20L12 5.23695L19.383 20H4.61698Z"/><path d="M11 10.667V15C11 15.552 11.448 16 12 16C12.552 16 13 15.552 13 15V10.667C13 10.115 12.552 9.66695 12 9.66695C11.448 9.66695 11 10.115 11 10.667Z"/><path d="M13 18C13 18.552 12.552 19 12 19C11.448 19 11 18.552 11 18C11 17.448 11.448 17 12 17C12.552 17 13 17.448 13 18Z"/></svg>',"exclamation-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 17C13 17.552 12.552 18 12 18C11.448 18 11 17.552 11 17C11 16.448 11.448 16 12 16C12.552 16 13 16.448 13 17Z"/><path d="M12 6C11.448 6 11 6.448 11 7V13C11 13.552 11.448 14 12 14C12.552 14 13 13.552 13 13V7C13 6.448 12.552 6 12 6Z"/><path d="M12 2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12C22 6.477 17.523 2 12 2ZM12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4C16.418 4 20 7.582 20 12C20 16.418 16.418 20 12 20Z"/></svg>'},o={name:"system",resolver:o=>o in t?`data:image/svg+xml,${encodeURIComponent(t[o])}`:"",mutator:t=>t.setAttribute("fill","currentColor")},e=Object.freeze(Object.defineProperty({__proto__:null,default:o,icons:t},Symbol.toStringTag,{value:"Module"}));let n=[o],s=[];function r(t){s.push(t)}function a(t){s=s.filter((o=>o!==t))}function i(t){return n.find((o=>o.name===t))}function l(t,o){c(t),n.push({name:t,resolver:o.resolver,mutator:o.mutator}),s.forEach((o=>{o.library===t&&o.setIcon()}))}function c(t){n=n.filter((o=>o.name!==t))}const p=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:i,registerIconLibrary:l,unregisterIconLibrary:c,unwatchIcon:a,watchIcon:r},Symbol.toStringTag,{value:"Module"})),m=new Set,d=new MutationObserver(u),g=new Map;let h,v=document.documentElement.dir||"ltr",w=document.documentElement.lang||navigator.language;function u(){v=document.documentElement.dir||"ltr",w=document.documentElement.lang||navigator.language,[...m.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let C=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){m.add(this.host)}hostDisconnected(){m.delete(this.host)}dir(){return`${this.host.dir||v}`.toLowerCase()}lang(){return`${this.host.lang||w}`.toLowerCase()}getTranslationData(t){var o,e;const n=new Intl.Locale(t.replace(/_/g,"-")),s=null==n?void 0:n.language.toLowerCase(),r=null!==(e=null===(o=null==n?void 0:n.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==e?e:"";return{locale:n,language:s,region:r,primary:g.get(`${s}-${r}`),secondary:g.get(s)}}exists(t,o){var e;const{primary:n,secondary:s}=this.getTranslationData(null!==(e=o.lang)&&void 0!==e?e:this.lang());return o=Object.assign({includeFallback:!1},o),!!(n&&n[t]||s&&s[t]||o.includeFallback&&h&&h[t])}term(t,...o){const{primary:e,secondary:n}=this.getTranslationData(this.lang());let s;if(e&&e[t])s=e[t];else if(n&&n[t])s=n[t];else{if(!h||!h[t])return console.error(`No translation found for: ${String(t)}`),String(t);s=h[t]}return"function"==typeof s?s(...o):s}date(t,o){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),o).format(t)}number(t,o){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),o).format(t)}relativeTime(t,o,e){return new Intl.RelativeTimeFormat(this.lang(),e).format(t,o)}};!function(...t){t.map((t=>{const o=t.$code.toLowerCase();g.has(o)?g.set(o,Object.assign(Object.assign({},g.get(o)),t)):g.set(o,t),h||(h=t)})),u()}({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:t=>0===t?"":`Options Selected (${t})`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",selectDefaultPlaceholder:"Please select",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(t,o)=>`Go to slide ${t} of ${o}`,slideNum:t=>`Slide ${t}`});class Z extends C{}const x=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/checkbox-group/checkbox-group.ts":()=>import("./checkbox-group.js"),"./components/checkbox/checkbox.ts":()=>import("./checkbox.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/header/header.ts":()=>import("./header.js"),"./components/icon/icon.ts":()=>import("./icon.js").then((t=>t.i)),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>e)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>p)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/input/input.ts":()=>import("./input.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/notification/notification.ts":()=>import("./notification.js"),"./components/option/option.ts":()=>import("./option.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/select/select.ts":()=>import("./select.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/switch/switch.ts":()=>import("./switch.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/textarea/textarea.ts":()=>import("./textarea.js"),"./components/tooltip/tooltip.ts":()=>import("./tooltip.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(x).forEach((t=>{x[t]()}));export{Z as L,c as a,i as g,l as r,a as u,r as w};
|
|
1
|
+
const t={calendar:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21 2H3a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1ZM6 4v1.667a1 1 0 0 0 2 0V4h8v1.667a1 1 0 0 0 2 0V4h2v4H4V4h2ZM4 20V10h16v10H4Z"/>\n <path d="m7.603 13.263.597.81.31-.25c.31-.25.593-.49.733-.63h.017c-.017.333-.033 1.14-.033 1.647V18h1.223v-6.03H9.353l-1.75 1.293ZM14.667 11.867c-1.543 0-2.26 1-2.26 3.163 0 1.9.667 3.063 2.217 3.063s2.193-1.18 2.193-3.13c-.017-2.063-.743-3.097-2.15-3.097v.001Zm-.044 5.333c-.647 0-1-.76-1-2.28 0-1.44.353-2.173 1-2.173s1 .743 1 2.233c0 1.49-.387 2.227-1.017 2.227l.017-.007Z"/>\n </svg>\n ',"chevron-down":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M20.257 6.333l-8.257 9.173-8.257-9.173c-0.181-0.181-0.431-0.292-0.707-0.292-0.552 0-1 0.448-1 1 0 0.238 0.083 0.456 0.222 0.628l-0.001-0.002 9 10c0.184 0.204 0.449 0.331 0.743 0.331s0.56-0.127 0.743-0.33l0.001-0.001 9-10c0.137-0.17 0.22-0.388 0.22-0.626 0-0.552-0.448-1-1-1-0.276 0-0.526 0.112-0.707 0.293v0z"></path>\n </svg>\n ',"chevron-up":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.743 6.333c-0.188-0.195-0.452-0.316-0.743-0.316s-0.555 0.121-0.743 0.315l-0 0-9 10c-0.137 0.17-0.22 0.388-0.22 0.626 0 0.552 0.448 1 1 1 0.276 0 0.526-0.112 0.707-0.293v0l8.257-9.173 8.257 9.173c0.181 0.181 0.431 0.292 0.707 0.292 0.552 0 1-0.448 1-1 0-0.238-0.083-0.456-0.222-0.628l0.001 0.002z"></path>\n </svg>\n ',clock:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M13 11.587V8a1 1 0 0 0-2 0v4c0 .07.007.138.021.203l-.001-.006a.855.855 0 0 0 .029.093l-.002-.006c0 .033 0 .067.03.1a.709.709 0 0 0 .055.103l-.002-.003.037.07c.04.057.081.107.127.153l2.827 2.83a1.002 1.002 0 0 0 1.417-1.417L13 11.587Z"/>\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n </svg>\n ',close:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>\n </svg>\n ',"closing-round":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/>\n <path d="M16.373 7.627a1 1 0 0 0-1.414 0l-2.96 2.96-2.96-2.96a1 1 0 0 0-1.413 1.414l-.001-.001 2.96 2.96-2.96 2.96a1 1 0 0 0 1.414 1.414l2.96-2.96 2.96 2.96a1 1 0 0 0 1.414-1.414L13.413 12l2.96-2.96a1 1 0 0 0 0-1.414v.001Z"/>\n </svg>',confirm:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M21.528 2.167a1 1 0 0 0-1.384.277l-.002.004-11.333 17-5.127-5.153a1 1 0 0 0-1.413 1.414l-.001-.001 6 6a.997.997 0 0 0 .707.293h.1c.307-.032.57-.199.731-.44l.002-.004 12-18a1 1 0 0 0-.276-1.388l-.004-.002Z"/>\n </svg>\n ',eye:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n </svg>\n ',"eye-crossed-out":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 16.107A4.11 4.11 0 0 1 7.893 12 4.11 4.11 0 0 1 12 7.893 4.11 4.11 0 0 1 16.107 12 4.11 4.11 0 0 1 12 16.107Zm0-6.21a2.107 2.107 0 1 0 0 4.213 2.107 2.107 0 0 0 0-4.213Z"/>\n <path d="M12 18.96c-5.263 0-10-5.68-10-6.96 0-1.28 4.737-6.96 10-6.96S22 10.72 22 12c0 1.28-4.737 6.96-10 6.96ZM4.1 12c.76 1.197 4.07 4.96 7.9 4.96s7.14-3.767 7.9-4.96c-.76-1.197-4.07-4.96-7.9-4.96S4.86 10.807 4.1 12Z"/>\n <path d="M3 22a1 1 0 0 1-.707-1.707l18-18a1 1 0 0 1 1.414 1.414l-18 18A.991.991 0 0 1 3 22Z"/>\n </svg>\n ',"info-circle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>',"status-hook":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">\n <path fill="currentColor" d="m9.947 1.138-.005.008-.001.003-5.56 8.34-2.434-2.447-.004-.004a.648.648 0 0 0-1.093.475c0 .172.066.328.175.444l.003.004 3 2.999c.117.117.28.19.46.19h.065c.2-.021.37-.13.475-.286l.005-.008.001-.002 5.994-8.992a.65.65 0 0 0-.18-.902l-.007-.005-.002-.002a.65.65 0 0 0-.892.185Z"/>\n </svg>\n ',"status-minus":'\n <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">\n <path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>\n </svg>\n ',pause:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M9 22a.99997.99997 0 0 0 1-1V3a1.00003 1.00003 0 0 0-1-1H5a1.00003 1.00003 0 0 0-1 1v18a.99997.99997 0 0 0 1 1h4ZM6 4h2v16H6V4ZM19 22c.2652 0 .5196-.1054.7071-.2929A1.0001 1.0001 0 0 0 20 21V3a.99997.99997 0 0 0-1-1h-4a.99997.99997 0 0 0-1 1v18c0 .2652.1054.5196.2929.7071S14.7348 22 15 22h4ZM16 4h2v16h-2V4Z"/>\n </svg>\n ',risk:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12.893 2.553a1.002 1.002 0 0 0-1.784-.006L2.106 20.553A1 1 0 0 0 3 22h18a1 1 0 0 0 .891-1.452l.003.006-9.001-18.001ZM4.617 20 12 5.237 19.383 20H4.617Z"/>\n <path d="M11 10.667V15a1 1 0 0 0 2 0v-4.333a1 1 0 0 0-2 0ZM13 18a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"/>\n </svg>\n ',start:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">\n <path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>\n </svg>\n ',"confirm-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M15.843 7.473a.999.999 0 0 0-1.367.329l-.002.004-3.667 6.223-1.757-1.753a1 1 0 0 0-1.413 1.414l-.001-.001 2.667 2.667a.997.997 0 0 0 .695.31h.128c.314-.042.578-.223.731-.479l.003-.005 4.333-7.333a1 1 0 0 0-.345-1.374l-.005-.003v.001Z"/></svg>',warning:'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.893 2.55295C12.725 2.22395 12.388 2.00195 12 2.00195C11.612 2.00195 11.275 2.22295 11.109 2.54695L2.10598 20.553C2.03998 20.683 2.00098 20.837 2.00098 21C2.00098 21.552 2.44798 21.999 2.99998 22H21C21.552 21.999 21.999 21.552 21.999 21C21.999 20.837 21.96 20.683 21.891 20.548L21.894 20.554L12.893 2.55295ZM4.61698 20L12 5.23695L19.383 20H4.61698Z"/><path d="M11 10.667V15C11 15.552 11.448 16 12 16C12.552 16 13 15.552 13 15V10.667C13 10.115 12.552 9.66695 12 9.66695C11.448 9.66695 11 10.115 11 10.667Z"/><path d="M13 18C13 18.552 12.552 19 12 19C11.448 19 11 18.552 11 18C11 17.448 11.448 17 12 17C12.552 17 13 17.448 13 18Z"/></svg>',"exclamation-circle":'\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 17C13 17.552 12.552 18 12 18C11.448 18 11 17.552 11 17C11 16.448 11.448 16 12 16C12.552 16 13 16.448 13 17Z"/><path d="M12 6C11.448 6 11 6.448 11 7V13C11 13.552 11.448 14 12 14C12.552 14 13 13.552 13 13V7C13 6.448 12.552 6 12 6Z"/><path d="M12 2C6.477 2 2 6.477 2 12C2 17.523 6.477 22 12 22C17.523 22 22 17.523 22 12C22 6.477 17.523 2 12 2ZM12 20C7.582 20 4 16.418 4 12C4 7.582 7.582 4 12 4C16.418 4 20 7.582 20 12C20 16.418 16.418 20 12 20Z"/></svg>'},o={name:"system",resolver:o=>o in t?`data:image/svg+xml,${encodeURIComponent(t[o])}`:"",mutator:t=>t.setAttribute("fill","currentColor")},e=Object.freeze(Object.defineProperty({__proto__:null,default:o,icons:t},Symbol.toStringTag,{value:"Module"}));let n=[o],s=[];function r(t){s.push(t)}function a(t){s=s.filter((o=>o!==t))}function i(t){return n.find((o=>o.name===t))}function l(t,o){c(t),n.push({name:t,resolver:o.resolver,mutator:o.mutator}),s.forEach((o=>{o.library===t&&o.setIcon()}))}function c(t){n=n.filter((o=>o.name!==t))}const p=Object.freeze(Object.defineProperty({__proto__:null,getIconLibrary:i,registerIconLibrary:l,unregisterIconLibrary:c,unwatchIcon:a,watchIcon:r},Symbol.toStringTag,{value:"Module"})),m=new Set,d=new MutationObserver(w),g=new Map;let h,v=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language;function w(){v=document.documentElement.dir||"ltr",u=document.documentElement.lang||navigator.language,[...m.keys()].map((t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()}))}d.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]});let C=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){m.add(this.host)}hostDisconnected(){m.delete(this.host)}dir(){return`${this.host.dir||v}`.toLowerCase()}lang(){return`${this.host.lang||u}`.toLowerCase()}getTranslationData(t){var o,e;const n=new Intl.Locale(t.replace(/_/g,"-")),s=null==n?void 0:n.language.toLowerCase(),r=null!==(e=null===(o=null==n?void 0:n.region)||void 0===o?void 0:o.toLowerCase())&&void 0!==e?e:"";return{locale:n,language:s,region:r,primary:g.get(`${s}-${r}`),secondary:g.get(s)}}exists(t,o){var e;const{primary:n,secondary:s}=this.getTranslationData(null!==(e=o.lang)&&void 0!==e?e:this.lang());return o=Object.assign({includeFallback:!1},o),!!(n&&n[t]||s&&s[t]||o.includeFallback&&h&&h[t])}term(t,...o){const{primary:e,secondary:n}=this.getTranslationData(this.lang());let s;if(e&&e[t])s=e[t];else if(n&&n[t])s=n[t];else{if(!h||!h[t])return console.error(`No translation found for: ${String(t)}`),String(t);s=h[t]}return"function"==typeof s?s(...o):s}date(t,o){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),o).format(t)}number(t,o){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),o).format(t)}relativeTime(t,o,e){return new Intl.RelativeTimeFormat(this.lang(),e).format(t,o)}};!function(...t){t.map((t=>{const o=t.$code.toLowerCase();g.has(o)?g.set(o,Object.assign(Object.assign({},g.get(o)),t)):g.set(o,t),h||(h=t)})),w()}({$code:"en",$name:"English",$dir:"ltr",clearEntry:"Clear entry",close:"Close",copy:"Copy",numOptionsSelected:t=>0===t?"":`Options Selected (${t})`,currentValue:"Current value",hidePassword:"Hide password",loading:"Loading",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",selectDefaultPlaceholder:"Please select",showPassword:"Show password",toggleColorFormat:"Toggle color format",carousel:"Carousel",nextSlide:"Next slide",previousSlide:"Previous slide",goToSlide:(t,o)=>`Go to slide ${t} of ${o}`,slideNum:t=>`Slide ${t}`});class Z extends C{}const x=Object.assign({"./components/accordion-group/accordion-group.ts":()=>import("./accordion-group.js"),"./components/accordion/accordion.ts":()=>import("./accordion.js"),"./components/badge/badge.ts":()=>import("./badge.js"),"./components/brandshape/brandshape.ts":()=>import("./brandshape.js"),"./components/button/button.ts":()=>import("./button.js"),"./components/carousel-item/carousel-item.ts":()=>import("./carousel-item.js"),"./components/carousel/autoplay-controller.ts":()=>import("./autoplay-controller.js"),"./components/carousel/carousel.ts":()=>import("./carousel.js"),"./components/carousel/scroll-controller.ts":()=>import("./scroll-controller.js"),"./components/checkbox-group/checkbox-group.ts":()=>import("./checkbox-group.js"),"./components/checkbox/checkbox.ts":()=>import("./checkbox.js"),"./components/divider/divider.ts":()=>import("./divider.js"),"./components/drawer/drawer.ts":()=>import("./drawer.js"),"./components/dropdown/dropdown.ts":()=>import("./dropdown.js"),"./components/header/header.ts":()=>import("./header.js"),"./components/icon/icon.ts":()=>import("./icon.js").then((t=>t.i)),"./components/icon/library.system.ts":()=>Promise.resolve().then((()=>e)),"./components/icon/library.ts":()=>Promise.resolve().then((()=>p)),"./components/icon/request.ts":()=>import("./request.js"),"./components/include/include.ts":()=>import("./include.js"),"./components/include/request.ts":()=>import("./request2.js"),"./components/input/input.ts":()=>import("./input.js"),"./components/link/link.ts":()=>import("./link.js"),"./components/navigation-item/navigation-item.ts":()=>import("./navigation-item.js"),"./components/notification/notification.ts":()=>import("./notification.js"),"./components/option/option.ts":()=>import("./option.js"),"./components/popup/popup.ts":()=>import("./popup.js"),"./components/radio-button/radio-button.ts":()=>import("./radio-button.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.js"),"./components/select/select.ts":()=>import("./select.js"),"./components/spinner/spinner.ts":()=>import("./spinner.js"),"./components/switch/switch.ts":()=>import("./switch.js"),"./components/tag/tag.ts":()=>import("./tag.js"),"./components/teaser/teaser.ts":()=>import("./teaser.js"),"./components/textarea/textarea.ts":()=>import("./textarea.js"),"./components/tooltip/tooltip.ts":()=>import("./tooltip.js"),"./components/video/video.ts":()=>import("./video.js")});Object.keys(x).forEach((t=>{x[t]()}));export{Z as L,c as a,i as g,l as r,a as u,r as w};
|