@solid-design-system/components 1.31.0 → 1.32.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.js +1 -1
- package/dist/components/es/default-value.js +1 -0
- package/dist/components/es/drawer.js +1 -1
- package/dist/components/es/dropdown.js +1 -1
- package/dist/components/es/form-control.styles.js +1 -0
- package/dist/components/es/icon.js +3 -4
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/live.js +3 -3
- package/dist/components/es/option.js +1 -0
- package/dist/components/es/popup.js +1 -1
- package/dist/components/es/scroll.js +1 -0
- package/dist/components/es/select.js +5 -0
- 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/tabbable.js +1 -1
- package/dist/components/es/tag.js +1 -1
- package/dist/components/umd/solid-components.js +25 -22
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/option/option.d.ts +30 -0
- package/dist/package/components/option/option.js +145 -0
- package/dist/package/components/popup/popup.d.ts +3 -0
- package/dist/package/components/popup/popup.js +17 -0
- package/dist/package/components/select/select.d.ts +101 -0
- package/dist/package/components/select/select.js +700 -0
- package/dist/package/components/tag/tag.d.ts +1 -0
- package/dist/package/components/tag/tag.js +5 -3
- package/dist/package/solid-components.d.ts +2 -0
- package/dist/package/solid-components.js +22 -18
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/package/translations/en.js +3 -4
- package/dist/package/utilities/localize.d.ts +1 -0
- 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/default-value.js +1 -0
- 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-control.styles.js +1 -0
- 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 +3 -4
- 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/live.js +3 -3
- 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 -0
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/scroll.js +1 -0
- package/dist/versioned-components/es/select.js +5 -0
- 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/tabbable.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/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 +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +4 -4
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- 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 +1 -1
- package/dist/versioned-package/components/input/input.js +4 -4
- 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 +30 -0
- package/dist/versioned-package/components/option/option.js +145 -0
- package/dist/versioned-package/components/popup/popup.d.ts +4 -1
- package/dist/versioned-package/components/popup/popup.js +18 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +14 -14
- package/dist/versioned-package/components/select/select.d.ts +101 -0
- package/dist/versioned-package/components/select/select.js +700 -0
- 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 +1 -1
- package/dist/versioned-package/components/switch/switch.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +2 -1
- package/dist/versioned-package/components/tag/tag.js +6 -4
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- 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.js +2 -2
- package/dist/versioned-package/solid-components.d.ts +2 -0
- package/dist/versioned-package/solid-components.js +22 -18
- package/dist/versioned-package/styles/form-control.styles.js +1 -1
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-package/translations/en.js +3 -4
- package/dist/versioned-package/utilities/localize.d.ts +1 -0
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +346 -32
- package/dist/web-types.json +790 -82
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{x as e,i as t}from"./lit-element.js";import{c as i}from"./register-custom-element.js";import{
|
|
1
|
+
import"./icon.js";import{x as e,i as t}from"./lit-element.js";import{c as i}from"./register-custom-element.js";import{d as r}from"./default-value.js";import{F as s}from"./form.js";import{o}from"./if-defined.js";import{l}from"./live.js";import{S as a,n}from"./solid-element.js";import{e as d}from"./query.js";import{w as c}from"./watch.js";import{t as h}from"./classix.js";import"./solid-components2.js";import"./state.js";import"./request.js";import"./request2.js";import"./directive.js";import"./component.styles.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,m=(e,t,i,r)=>{for(var s,o=r>1?void 0:r?u(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&&p(t,i,o),o};let b=class extends a{constructor(){super(...arguments),this.formControlController=new s(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}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)}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(){return e`<label part="base" class="${h("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="${o(this.value)}" .indeterminate="${l(this.indeterminate)}" .checked="${l(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="${h("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],(this.disabled&&this.indeterminate||this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled&&"border-neutral-500")||(this.checked||this.indeterminate)&&"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550"||"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white")}">${this.checked?e`<sd-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-hook"></sd-icon>`:""} ${!this.checked&&this.indeterminate?e`<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="${h("select-none inline-block ml-2 text-black",this.disabled?"text-neutral-500":"text-neutral-800")}"><slot></slot></span></label>`}};b.styles=[a.styles,t`:host{display:block}:host(:focus-visible){outline:0}:host([required]) #label::after{content:' *'}:host([data-user-invalid]) #label{color:rgb(var(--sd-color-error,204 25 55))}:host([data-user-invalid]) #control{border-color:rgb(var(--sd-color-error,204 25 55))}:host([data-user-invalid]):host([indeterminate]) #control{background-color:rgb(var(--sd-color-error,204 25 55))}`],m([d('input[type="checkbox"]')],b.prototype,"input",2),m([n()],b.prototype,"title",2),m([n()],b.prototype,"name",2),m([n()],b.prototype,"value",2),m([n({reflect:!0})],b.prototype,"size",2),m([n({type:Boolean,reflect:!0})],b.prototype,"disabled",2),m([n({type:Boolean,reflect:!0})],b.prototype,"checked",2),m([n({type:Boolean,reflect:!0})],b.prototype,"indeterminate",2),m([r("checked")],b.prototype,"defaultChecked",2),m([n({reflect:!0})],b.prototype,"form",2),m([n({type:Boolean,reflect:!0})],b.prototype,"required",2),m([c("disabled",{waitUntilFirstUpdate:!0})],b.prototype,"handleDisabledChange",1),m([c(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],b.prototype,"handleStateChange",1),b=m([i("sd-checkbox")],b);export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as t}from"./lit-element.js";const o=(o="value")=>(e,r)=>{const i=e.constructor,n=i.prototype.attributeChangedCallback;i.prototype.attributeChangedCallback=function(e,a,s){const c=i.getPropertyOptions(o);if(e===("string"==typeof c.attribute?c.attribute:o)){const e=c.converter||t,i=("function"==typeof e?e:(null==e?void 0:e.fromAttribute)??t.fromAttribute)(s,c.type);this[o]!==i&&(this[r]=i)}n.call(this,e,a,s)}};export{o as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./button.js";import"./icon.js";import{a as e,s as t,w as s}from"./event.js";import{x as i,i as
|
|
1
|
+
import"./button.js";import"./icon.js";import{a as e,s as t,w as s}from"./event.js";import{x as i,i as o}from"./lit-element.js";import{c as a}from"./register-custom-element.js";import{g as r,s as n}from"./animation-registry.js";import{H as l}from"./slot.js";import{o as d}from"./if-defined.js";import{L as h}from"./solid-components2.js";import{l as c,u as p}from"./scroll.js";import{S as m,n as u}from"./solid-element.js";import{e as y}from"./query.js";import{w as f}from"./watch.js";import{c as w}from"./component.styles.js";import{t as v}from"./classix.js";import{g as b}from"./tabbable.js";import"./spinner.js";import"./form.js";import"./static.js";import"./state.js";import"./query-assigned-elements.js";import"./request.js";import"./request2.js";import"./directive.js";function k(e){return e.charAt(0).toUpperCase()+e.slice(1)}let g=[];class j{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){g.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){g=g.filter((e=>e!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return g[g.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=b(this.element),s="forward"===this.tabDirection?e:t;"function"==typeof(null==s?void 0:s.focus)&&s.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){"Tab"===e.key&&e.shiftKey&&(this.tabDirection="backward",requestAnimationFrame((()=>this.checkFocus())))}handleKeyUp(){this.tabDirection="forward"}}var x=Object.defineProperty,K=Object.getOwnPropertyDescriptor,D=(e,t,s,i)=>{for(var o,a=i>1?void 0:i?K(t,s):t,r=e.length-1;r>=0;r--)(o=e[r])&&(a=(i?o(t,s,a):o(a))||a);return i&&a&&x(t,s,a),a};let C=class extends m{constructor(){super(...arguments),this.hasSlotController=new l(this,"footer"),this.localize=new h(this),this.modal=new j(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),c(this)))}disconnectedCallback(){super.disconnectedCallback(),p(this)}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=r(this,"drawer.denyClose",{dir:this.localize.dir()});e(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),c(this));const s=this.querySelector("[autofocus]");s&&s.removeAttribute("autofocus"),await Promise.all([t(this.drawer),t(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame((()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(s?s.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),s&&s.setAttribute("autofocus","")}));const i=r(this,`drawer.show${k(this.placement)}`,{dir:this.localize.dir()}),o=r(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([e(this.panel,i.keyframes,i.options),e(this.overlay,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),p(this)),await Promise.all([t(this.drawer),t(this.overlay)]);const s=r(this,`drawer.hide${k(this.placement)}`,{dir:this.localize.dir()}),i=r(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([e(this.overlay,i.keyframes,i.options).then((()=>{this.overlay.hidden=!0})),e(this.panel,s.keyframes,s.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),c(this)),this.open&&this.contained&&(this.modal.deactivate(),p(this))}async show(){if(!this.open)return this.open=!0,s(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,s(this,"sd-after-hide")}render(){return i`<div part="base" class="${v("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${v("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${v("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${d(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":i`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-icon name="close" library="system"></sd-icon></sd-button></div></header>`}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${v(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></div>`}};C.styles=[m.styles,o`${w}:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{width:0;height:0}`],D([y("[part=base]")],C.prototype,"drawer",2),D([y("[part=panel]")],C.prototype,"panel",2),D([y("[part=overlay]")],C.prototype,"overlay",2),D([u({type:Boolean,reflect:!0})],C.prototype,"open",2),D([u({attribute:"label",reflect:!0})],C.prototype,"label",2),D([u({reflect:!0})],C.prototype,"placement",2),D([u({type:Boolean,reflect:!0})],C.prototype,"contained",2),D([u({attribute:"no-header",type:Boolean})],C.prototype,"noHeader",2),D([f("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),D([f("contained",{waitUntilFirstUpdate:!0})],C.prototype,"handleNoModalChange",1),C=D([a("sd-drawer")],C),n("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),n("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),n("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),n("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),n("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),n("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),n("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./popup.js";import{w as e,s as t,a as n}from"./event.js";import{x as i,i as o}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{g as a,s as r}from"./animation-registry.js";import{
|
|
1
|
+
import"./popup.js";import{w as e,s as t,a as n}from"./event.js";import{x as i,i as o}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{g as a,s as r}from"./animation-registry.js";import{g as p}from"./tabbable.js";import{L as d}from"./solid-components2.js";import{S as h,n as l}from"./solid-element.js";import{e as c}from"./query.js";import{s as u}from"./scroll.js";import{w as m}from"./watch.js";import{c as g}from"./component.styles.js";import{t as y}from"./classix.js";var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,v=(e,t,n,i)=>{for(var o,s=i>1?void 0:i?w(t,n):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&f(t,n,s),s};let b=class extends h{constructor(){super(...arguments),this.localize=new d(this),this.open=!1,this.rounded=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.noAutoSize=!1,this.noFlip=!1,this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sd-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if("Tab"===e.key){if(this.open&&"sd-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e,t,n;const i=(null==(e=this.containingElement)?void 0:e.getRootNode())instanceof ShadowRoot?null==(n=null==(t=document.activeElement)?void 0:t.shadowRoot)?void 0:n.activeElement:document.activeElement;(!this.containingElement||(null==i?void 0:i.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){const t=e.target;u(t,this.panel)}handlePanelSelect(e){const t=e.target;!this.stayOpenOnSelect&&"sd-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const n=t.defaultSlot.assignedElements({flatten:!0}),i=n[0],o=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),n.length>0&&requestAnimationFrame((()=>{("ArrowDown"===e.key||"Home"===e.key)&&(t.setCurrentItem(i),i.focus()),("ArrowUp"===e.key||"End"===e.key)&&(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>p(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sd-button":case"sd-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,e(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,e(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await t(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:i}=a(this,"dropdown.show",{dir:this.localize.dir()});await n(this.popup.popup,e,i),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:e,options:i}=a(this,"dropdown.hide",{dir:this.localize.dir()});await n(this.popup.popup,e,i),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return i`<sd-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${y("shadow bg-white",this.open?"block pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-popup>`}};b.styles=[h.styles,g,o`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],v([c("#dropdown")],b.prototype,"popup",2),v([c("[part=trigger]")],b.prototype,"trigger",2),v([c("[part=panel]")],b.prototype,"panel",2),v([l({type:Boolean,reflect:!0})],b.prototype,"open",2),v([l({type:Boolean,reflect:!0})],b.prototype,"rounded",2),v([l({reflect:!0})],b.prototype,"placement",2),v([l({type:Boolean,reflect:!0})],b.prototype,"disabled",2),v([l({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],b.prototype,"stayOpenOnSelect",2),v([l({attribute:!1})],b.prototype,"containingElement",2),v([l({type:Number})],b.prototype,"distance",2),v([l({type:Number})],b.prototype,"skidding",2),v([l({type:Boolean,reflect:!0,attribute:"no-auto-size"})],b.prototype,"noAutoSize",2),v([l({type:Boolean,reflect:!0,attribute:"no-flip"})],b.prototype,"noFlip",2),v([l({type:Boolean})],b.prototype,"hoist",2),v([m("open",{waitUntilFirstUpdate:!0})],b.prototype,"handleOpenChange",1),b=v([s("sd-dropdown")],b),r("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),r("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as o}from"./lit-element.js";const l=o`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-input-label-color);margin-bottom:var(--sd-spacing-3x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--sd-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--sd-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--sd-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--sd-input-required-content);margin-inline-start:var(--sd-input-required-content-offset);color:var(--sd-input-required-content-color)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--sd-input-help-text-color);margin-top:var(--sd-spacing-3x-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--sd-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--sd-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--sd-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text{margin-top:var(--sd-spacing-2x-small)}`;export{l as f};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import{T as t,w as e,x as r,i as s}from"./lit-element.js";import{c as i}from"./register-custom-element.js";import{w as o,u as a,g as l}from"./solid-components2.js";import{S as n,n as c}from"./solid-element.js";import{r as h}from"./state.js";import{requestIcon as p}from"./request.js";import{
|
|
1
|
+
import{T as t,w as e,x as r,i as s}from"./lit-element.js";import{c as i}from"./register-custom-element.js";import{w as o,u as a,g as l}from"./solid-components2.js";import{S as n,n as c}from"./solid-element.js";import{r as h}from"./state.js";import{requestIcon as p}from"./request.js";import{e as d,i as m,t as u}from"./directive.js";import{w as b}from"./watch.js";import{c as g}from"./component.styles.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/class
|
|
6
|
+
*/class v extends m{constructor(e){if(super(e),this.et=t,e.type!==u.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===t||null==r)return this.vt=void 0,this.et=r;if(r===e)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.et)return this.vt;this.et=r;const s=[r];return s.raw=s,this.vt={_$litType$:this.constructor.resultType,strings:s,values:[]}}}v.directiveName="unsafeHTML",v.resultType=1;const y=d(v);
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/
|
|
12
|
-
class y extends g{}y.directiveName="unsafeSVG",y.resultType=2;const f=u(y);var w=Object.defineProperty,j=Object.getOwnPropertyDescriptor,x=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?j(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&w(e,r,o),o};let C,k=class extends n{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),o(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),a(this)}getUrl(){const t=l(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=l(this.library),r=this.getUrl();if(C||(C=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=C.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return r`${f(this.svg)}`}};k.styles=[b,s`:host{display:inline-block;width:1em;height:1em;box-sizing:content-box!important}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity,1))}// text-primary :host([color=white]) svg{color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity,1))}`],x([h()],k.prototype,"svg",2),x([c({reflect:!0})],k.prototype,"name",2),x([c()],k.prototype,"src",2),x([c()],k.prototype,"label",2),x([c({reflect:!0})],k.prototype,"library",2),x([c({reflect:!0})],k.prototype,"color",2),x([v("label")],k.prototype,"handleLabelChange",1),x([v(["name","src","library"])],k.prototype,"setIcon",1),k=x([i("sd-icon")],k);export{k as default};
|
|
11
|
+
*/class f extends v{}f.directiveName="unsafeSVG",f.resultType=2;const w=d(f);var j=Object.defineProperty,x=Object.getOwnPropertyDescriptor,C=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?x(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&j(e,r,o),o};let T,k=class extends n{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),o(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),a(this)}getUrl(){const t=l(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=l(this.library),r=this.getUrl();if(T||(T=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=T.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return r`${w(this.svg)}`}};k.styles=[g,s`:host{display:inline-block;width:1em;height:1em;box-sizing:content-box!important}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity,1))}// text-primary :host([color=white]) svg{color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity,1))}`],C([h()],k.prototype,"svg",2),C([c({reflect:!0})],k.prototype,"name",2),C([c()],k.prototype,"src",2),C([c()],k.prototype,"label",2),C([c({reflect:!0})],k.prototype,"library",2),C([c({reflect:!0})],k.prototype,"color",2),C([b("label")],k.prototype,"handleLabelChange",1),C([b(["name","src","library"])],k.prototype,"setIcon",1),k=C([i("sd-icon")],k);const A=Object.freeze(Object.defineProperty({__proto__:null,get default(){return k}},Symbol.toStringTag,{value:"Module"}));export{k as S,A as i,y as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{i as t,x as e}from"./lit-element.js";import{c as o}from"./register-custom-element.js";import{l as s,d as i}from"./live.js";import{F as l}from"./form.js";import{H as r}from"./slot.js";import{o as a}from"./if-defined.js";import{L as n}from"./solid-components2.js";import{S as p,n as h}from"./solid-element.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";const b=t`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-input-label-color);margin-bottom:var(--sd-spacing-3x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--sd-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--sd-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--sd-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--sd-input-required-content);margin-inline-start:var(--sd-input-required-content-offset);color:var(--sd-input-required-content-color)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--sd-input-help-text-color);margin-top:var(--sd-spacing-3x-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--sd-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--sd-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--sd-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text{margin-top:var(--sd-spacing-2x-small)}`;var f,v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,x=(t,e,o,s)=>{for(var i,l=s>1?void 0:s?g(e,o):e,r=t.length-1;r>=0;r--)(i=t[r])&&(l=(s?i(e,o,l):i(l))||l);return s&&l&&v(e,o,l),l};const w=!(null==(f=navigator.userAgentData)?void 0:f.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let $=class extends p{constructor(){super(...arguments),this.formControlController=new l(this),this.hasSlotController=new r(this,"help-text","label","left","right","message","placeholder"),this.localize=new n(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,o="none"){this.input.setSelectionRange(t,e,o)}setRangeText(t,e,o,s){this.input.setRangeText(t,e,o,s),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"),o=this.hasSlotController.test("help-text"),i=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),l=this.hasSlotController.test("right"),r=!!this.label||!!t,n=!!this.helpText||!!o,p=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",r&&"form-control--has-label",this.disabled&&"pointer-events-none")}"><label part="form-control-label" class="${y("form-control-label mb-2",r?"inline-block":"hidden",m)}" for="input" aria-hidden="${r?"false":"true"}"><slot name="label">${this.label}${this.required?"*":""}</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="${a(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${a(this.placeholder)}" minlength="${a(this.minlength)}" maxlength="${a(this.maxlength)}" min="${a(this.min)}" max="${a(this.max)}" step="${a(this.step)}" .value="${s(this.value)}" autocapitalize="${a("password"===this.type?"off":this.autocapitalize)}" autocomplete="${a("password"===this.type?"off":this.autocomplete)}" autocorrect="${a("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${a(this.pattern)}" enterkeyhint="${a(this.enterkeyhint)}" inputmode="${a(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${p?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",n?"block":"hidden")}" aria-hidden="${n?"false":"true"}">${this.helpText}</slot></div>`}};$.styles=[m,b,p.styles,t`:host{box-sizing:border-box;position:relative;display:inline-block;text-align:left;width:100%}:host([vertical]){display:block}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=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}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}input[type=date]::-webkit-calendar-picker-indicator{display:none}input[type=datetime-local]::-webkit-calendar-picker-indicator{display:none}`],x([u("#input")],$.prototype,"input",2),x([d()],$.prototype,"hasFocus",2),x([h({reflect:!0})],$.prototype,"type",2),x([h({reflect:!0})],$.prototype,"size",2),x([h()],$.prototype,"inputmode",2),x([h()],$.prototype,"value",2),x([i()],$.prototype,"defaultValue",2),x([h()],$.prototype,"placeholder",2),x([h()],$.prototype,"label",2),x([h({attribute:"help-text"})],$.prototype,"helpText",2),x([h({type:Boolean})],$.prototype,"clearable",2),x([h({type:Boolean,reflect:!0})],$.prototype,"disabled",2),x([h({type:Boolean,reflect:!0})],$.prototype,"readonly",2),x([h({attribute:"password-toggle",type:Boolean})],$.prototype,"passwordToggle",2),x([h({attribute:"password-visible",type:Boolean})],$.prototype,"passwordVisible",2),x([h({attribute:"no-spin-buttons",type:Boolean})],$.prototype,"noSpinButtons",2),x([h({type:Number})],$.prototype,"minlength",2),x([h({type:Number})],$.prototype,"maxlength",2),x([h({type:Number})],$.prototype,"min",2),x([h({type:Number})],$.prototype,"max",2),x([h({reflect:!0})],$.prototype,"form",2),x([h()],$.prototype,"name",2),x([h()],$.prototype,"title",2),x([h({type:Boolean,reflect:!0})],$.prototype,"required",2),x([h()],$.prototype,"pattern",2),x([h()],$.prototype,"step",2),x([h()],$.prototype,"autocapitalize",2),x([h()],$.prototype,"autocorrect",2),x([h()],$.prototype,"autocomplete",2),x([h({type:Boolean})],$.prototype,"autofocus",2),x([h()],$.prototype,"enterkeyhint",2),x([h({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([o("sd-input")],$);export{$ as default};
|
|
1
|
+
import"./icon.js";import{x as t,i as e}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{d as i}from"./default-value.js";import{F as o}from"./form.js";import{H as l}from"./slot.js";import{o as a}from"./if-defined.js";import{l as r}from"./live.js";import{L as n}from"./solid-components2.js";import{S as p,n as h}from"./solid-element.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 o,l=i>1?void 0:i?g(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&&v(e,s,l),l};const w=!(null==(f=navigator.userAgentData)?void 0:f.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let $=class extends p{constructor(){super(...arguments),this.formControlController=new o(this),this.hasSlotController=new l(this,"help-text","label","left","right","message","placeholder"),this.localize=new n(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 e=this.hasSlotController.test("label"),s=this.hasSlotController.test("help-text"),i=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),o=this.hasSlotController.test("right"),l=!!this.label||!!e,n=!!this.helpText||!!s,p=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 t`<div part="form-control" class="${y("form-control",l&&"form-control--has-label",this.disabled&&"pointer-events-none")}"><label part="form-control-label" class="${y("form-control-label mb-2",l?"inline-block":"hidden",m)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}${this.required?"*":""}</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?t`<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="${a(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${a(this.placeholder)}" minlength="${a(this.minlength)}" maxlength="${a(this.maxlength)}" min="${a(this.min)}" max="${a(this.max)}" step="${a(this.step)}" .value="${r(this.value)}" autocapitalize="${a("password"===this.type?"off":this.autocapitalize)}" autocomplete="${a("password"===this.type?"off":this.autocomplete)}" autocorrect="${a("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${a(this.pattern)}" enterkeyhint="${a(this.enterkeyhint)}" inputmode="${a(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${p?t`<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?t`<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?t`<slot name="show-password-icon"><sd-icon class="${y(v,g,x)}" library="system" name="eye"></sd-icon></slot>`:t`<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?"":t`<sd-icon class="${y(v,g,x)}" library="system" name="calendar"></sd-icon>`} ${"time"===this.type?t`<sd-icon class="${y(v,g,x)}" library="system" name="clock"></sd-icon>`:""} ${d?t`<sd-icon class="${y("text-error",g,x)}" library="system" name="risk"></sd-icon>`:""} ${u?t`<sd-icon class="${y("text-success",g,x)}" library="system" name="confirm"></sd-icon>`:""} ${o?t`<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",n?"block":"hidden")}" aria-hidden="${n?"false":"true"}">${this.helpText}</slot></div>`}};$.styles=[m,b,p.styles,e`:host{box-sizing:border-box;position:relative;display:inline-block;text-align:left;width:100%}:host([vertical]){display:block}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=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}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}input[type=date]::-webkit-calendar-picker-indicator{display:none}input[type=datetime-local]::-webkit-calendar-picker-indicator{display:none}`],x([u("#input")],$.prototype,"input",2),x([d()],$.prototype,"hasFocus",2),x([h({reflect:!0})],$.prototype,"type",2),x([h({reflect:!0})],$.prototype,"size",2),x([h()],$.prototype,"inputmode",2),x([h()],$.prototype,"value",2),x([i()],$.prototype,"defaultValue",2),x([h()],$.prototype,"placeholder",2),x([h()],$.prototype,"label",2),x([h({attribute:"help-text"})],$.prototype,"helpText",2),x([h({type:Boolean})],$.prototype,"clearable",2),x([h({type:Boolean,reflect:!0})],$.prototype,"disabled",2),x([h({type:Boolean,reflect:!0})],$.prototype,"readonly",2),x([h({attribute:"password-toggle",type:Boolean})],$.prototype,"passwordToggle",2),x([h({attribute:"password-visible",type:Boolean})],$.prototype,"passwordVisible",2),x([h({attribute:"no-spin-buttons",type:Boolean})],$.prototype,"noSpinButtons",2),x([h({type:Number})],$.prototype,"minlength",2),x([h({type:Number})],$.prototype,"maxlength",2),x([h({type:Number})],$.prototype,"min",2),x([h({type:Number})],$.prototype,"max",2),x([h({reflect:!0})],$.prototype,"form",2),x([h()],$.prototype,"name",2),x([h()],$.prototype,"title",2),x([h({type:Boolean,reflect:!0})],$.prototype,"required",2),x([h()],$.prototype,"pattern",2),x([h()],$.prototype,"step",2),x([h()],$.prototype,"autocapitalize",2),x([h()],$.prototype,"autocorrect",2),x([h()],$.prototype,"autocomplete",2),x([h({type:Boolean})],$.prototype,"autofocus",2),x([h()],$.prototype,"enterkeyhint",2),x([h({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([s("sd-input")],$);export{$ as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{w as e,T as t}from"./lit-element.js";import{e as r,i,t as n}from"./directive.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2020 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
|
|
6
|
+
*/const s={},o=r(class extends i{constructor(e){if(super(e),e.type!==n.PROPERTY&&e.type!==n.ATTRIBUTE&&e.type!==n.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(e=>void 0===e.strings)(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(r,[i]){if(i===e||i===t)return i;const o=r.element,T=r.name;if(r.type===n.PROPERTY){if(i===o[T])return e}else if(r.type===n.BOOLEAN_ATTRIBUTE){if(!!i===o.hasAttribute(T))return e}else if(r.type===n.ATTRIBUTE&&o.getAttribute(T)===i+"")return e;return((e,t=s)=>{e._$AH=t;
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2020 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/})(
|
|
11
|
+
*/})(r),i}});export{o as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./icon.js";import{x as e,i as t}from"./lit-element.js";import{c as s}from"./register-custom-element.js";import{H as l}from"./slot.js";import{L as o}from"./solid-components2.js";import{S as r,n as a}from"./solid-element.js";import{r as i}from"./state.js";import{e as n}from"./query.js";import{w as c}from"./watch.js";import{c as h}from"./component.styles.js";import{t as d}from"./classix.js";import{f as p}from"./form-control.styles.js";import"./request.js";import"./request2.js";import"./directive.js";var u=Object.defineProperty,b=Object.getOwnPropertyDescriptor,m=(e,t,s,l)=>{for(var o,r=l>1?void 0:l?b(t,s):t,a=e.length-1;a>=0;a--)(o=e[a])&&(r=(l?o(t,s,r):o(r))||r);return l&&r&&u(t,s,r),r};let f=class extends r{constructor(){super(...arguments),this.hasSlotController=new l(this,"default","left","right"),this.localize=new o(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 t=this.hasSlotController.test("left"),s=this.hasSlotController.test("right");return e`<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?e`<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?e`<sd-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-hook"></sd-icon>`:""}</span>`:""} ${t?e`<slot name="left" part="left" class="inline-flex mr-2"></slot>`:""}<slot part="label" class="inline-block flex-grow" @slotchange="${this.handleDefaultSlotChange}"></slot>${s?e`<slot name="right" part="right" class="inline-flex ml-2"></slot>`:""}</div>`}};f.styles=[h,p,r.styles,t`:host{outline:0!important;display:block;position:relative;width:100%}`],m([n('[part="base"]')],f.prototype,"defaultSlot",2),m([i()],f.prototype,"current",2),m([i()],f.prototype,"selected",2),m([i()],f.prototype,"hasHover",2),m([a({reflect:!0})],f.prototype,"size",2),m([a({type:Boolean,reflect:!0})],f.prototype,"checkbox",2),m([a({type:Boolean,reflect:!0})],f.prototype,"disabled",2),m([a({reflect:!0})],f.prototype,"value",2),m([c("disabled")],f.prototype,"handleDisabledChange",1),m([c("selected")],f.prototype,"handleSelectedChange",1),m([c("value")],f.prototype,"handleValueChange",1),f=m([s("sd-option")],f);export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as t,i as e}from"./lit-element.js";import{c as n}from"./register-custom-element.js";import{S as o,n as i}from"./solid-element.js";import{e as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,p=Math.floor,h=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function T(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let u;switch(l){case"top":u={x:f,y:o.y-i.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:p};break;case"left":u={x:o.x-i.width,y:p};break;default:u={x:o.x,y:o.y}}switch(w(e)){case"start":u[a]-=h*(n&&c?-1:1);break;case"end":u[a]+=h*(n&&c?-1:1)}return u}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=y(e,t),d=R(u),m=s[h?"floating"===p?"reference":"floating":p],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===p?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const A=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,p=y(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&"number"==typeof d&&(u="end"===s?-1*d:d),l?{x:u*f,y:h*c}:{x:h*c,y:u*f}}(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},k=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await L(e,s),p=g(n),h=w(n),u="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===p||"bottom"===p?(b=p,v=h===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=p,b="end"===h?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(u){const t=d-f.left-f.right;S=h||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=h||z?l(P,t):t}if(z&&!h){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);u?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const T=await i.getDimensions(r.floating);return d!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function O(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function C(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof C(t).Node}function B(t){return t instanceof Element||t instanceof C(t).Element}function $(t){return t instanceof HTMLElement||t instanceof C(t).HTMLElement}function j(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof C(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(O(t))}function W(t){const e=M(),n=q(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function M(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(O(t))}function q(t){return C(t).getComputedStyle(t)}function I(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if("html"===O(t))return t;const e=t.assignedSlot||t.parentNode||j(t)&&t.host||F(t);return j(e)?e.host:e}function Y(t){const e=X(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&H(e)?e:Y(e)}function _(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=Y(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),a=C(i);return r?e.concat(a,a.visualViewport||[],H(i)?i:[],a.frameElement&&n?_(a.frameElement):[]):e.concat(i,_(i,[],n))}function G(t){const e=q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=$(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function J(t){return B(t)?t:t.contextElement}function K(t){const e=J(t);if(!$(e))return h(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=G(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Q=h(0);function U(t){const e=C(t);return M()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Q}function Z(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=J(t);let a=h(1);e&&(o?B(o)&&(a=K(o)):a=K(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==C(t))&&e}(r,n,o)?U(r):h(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(r){const t=C(r),e=o&&B(o)?C(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=K(n),e=n.getBoundingClientRect(),o=q(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,p*=t.y,l+=i,c+=r,n=C(n).frameElement}}return S({width:f,height:p,x:l,y:c})}function tt(t){return Z(F(t)).left+I(t).scrollLeft}function et(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=C(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=M();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=F(t),n=I(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===q(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(F(t));else if(B(e))o=function(t,e){const n=Z(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=$(t)?K(t):h(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=U(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function nt(t,e){const n=X(t);return!(n===e||!B(n)||V(n))&&("fixed"===q(n).position||nt(n,e))}function ot(t,e){const n=e.get(t);if(n)return n;let o=_(t,[],!1).filter((t=>B(t)&&"body"!==O(t))),i=null;const r="fixed"===q(t).position;let a=r?X(t):t;for(;B(a)&&!V(a);){const e=q(a),n=W(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&nt(t,a))?o=o.filter((t=>t!==a)):i=e,a=X(a)}return e.set(t,o),o}function it(t,e,n){const o=$(e),i=F(e),r="fixed"===n,a=Z(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=h(0);if(o||!o&&!r)if(("body"!==O(e)||H(i))&&(s=I(e)),o){const t=Z(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=tt(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function rt(t,e){return $(t)&&"fixed"!==q(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=C(t);if(!$(t))return n;let o=rt(t,e);for(;o&&N(o)&&"static"===q(o).position;)o=rt(o,e);return o&&("html"===O(o)||"body"===O(o)&&"static"===q(o).position&&!W(o))?n:o||function(t){let e=X(t);for(;$(e)&&!V(e);){if(W(e))return e;e=X(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=$(n),r=F(n);if(n===r)return e;let a={scrollLeft:0,scrollTop:0},s=h(1);const l=h(0);if((i||!i&&"fixed"!==o)&&(("body"!==O(n)||H(r))&&(a=I(n)),$(n))){const t=Z(n);s=K(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?ot(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=et(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),et(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||at,r=this.getDimensions;return{reference:it(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return G(t)},getScale:K,isElement:B,isRTL:function(t){return"rtl"===q(t).direction}};var lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,ft=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ct(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&<(e,n,r),r};let pt=class extends o{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start()}disconnectedCallback(){this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,h=J(t),u=i||r?[...h?_(h):[],..._(e)]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=h&&s?function(t,e){let n,o=null;const i=F(t);function r(){clearTimeout(n),o&&o.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:h,top:u,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-p(u)+"px "+-p(i.clientWidth-(h+d))+"px "+-p(i.clientHeight-(u+m))+"px "+-p(h)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(h,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===h&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{y&&y.observe(e)}))),n()})),h&&!f&&y.observe(h),y.observe(e));let g,w=f?Z(t):null;return f&&function e(){const o=Z(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),d&&d(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[A({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(k({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...b}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=g(i),R=g(s)===s,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),T=h||(R||!m?[z(s)]:function(t){const e=z(t);return[E(t),e,E(e)]}(s));!h&&"none"!==d&&T.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,m,d,S));const A=[s,...T],k=await L(e,b),O=[];let C=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&O.push(k[x]),p){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(i,a,S);O.push(k[t[0]],k[t[1]])}if(C=[...C,{placement:i,overflows:O}],!O.every((t=>t<=0))){var F,D;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=A[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(D=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(u){case"bestFit":{var B;const t=null==(B=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await L(e,l),p=x(g(i)),h=b(p);let u=c[h],d=c[p];if(r){const t="y"===h?"bottom":"right";u=m(u+f["y"===h?"top":"left"],u,u-f[t])}if(a){const t="y"===p?"bottom":"right";d=m(d+f["y"===p?"top":"left"],d,d-f[t])}const w=s.fn({...e,[h]:u,[p]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(k({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:f,padding:p=0}=y(t,e)||{};if(null==f)return{};const h=R(p),u={x:n,y:o},d=P(i),g=v(d),b=await a.getDimensions(f),x="y"===d,E=x?"top":"left",z=x?"bottom":"right",S=x?"clientHeight":"clientWidth",T=r.reference[g]+r.reference[d]-u[d]-r.floating[g],L=u[d]-r.reference[d],A=await(null==a.getOffsetParent?void 0:a.getOffsetParent(f));let k=A?A[S]:0;(!k||!await(null==a.isElement?void 0:a.isElement(A)))&&(k=s.floating[S]||r.floating[g]);const O=T/2-L/2,C=k/2-b[g]/2-1,F=l(h[E],C),D=l(h[z],C),B=F,$=k-b[g]-D,j=k/2-b[g]/2+O,H=m(B,j,$),N=!c.arrow&&null!=w(i)&&j!=H&&r.reference[g]/2-(j<B?F:D)-b[g]/2<0,W=N?j<B?j-B:j-$:0;return{[d]:u[d]+W,data:{[d]:H,centerOffset:j-H-W,...N&&{alignmentOffset:W}},reset:N}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:st,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=T(c,o,l),h=o,u={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:p,initialPlacement:o,placement:h,strategy:i,middlewareData:u,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,p=g??p,u={...u,[r]:{...u[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:p}=T(c,h,l))),n=-1)}return{x:f,y:p,placement:h,strategy:i,middlewareData:u}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return t`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?t`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[o.styles,a,e`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ft([r('[part="popup"]')],pt.prototype,"popup",2),ft([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ft([i()],pt.prototype,"anchor",2),ft([i({type:Boolean,reflect:!0})],pt.prototype,"active",2),ft([i({reflect:!0})],pt.prototype,"placement",2),ft([i({reflect:!0})],pt.prototype,"strategy",2),ft([i({type:Number})],pt.prototype,"distance",2),ft([i({type:Number})],pt.prototype,"skidding",2),ft([i({type:Boolean})],pt.prototype,"arrow",2),ft([i({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ft([i({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ft([i({type:Boolean})],pt.prototype,"flip",2),ft([i({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ft([i({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ft([i({type:Object})],pt.prototype,"flipBoundary",2),ft([i({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ft([i({type:Boolean})],pt.prototype,"shift",2),ft([i({type:Object})],pt.prototype,"shiftBoundary",2),ft([i({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ft([i({attribute:"auto-size"})],pt.prototype,"autoSize",2),ft([i()],pt.prototype,"sync",2),ft([i({type:Object})],pt.prototype,"autoSizeBoundary",2),ft([i({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ft([n("sd-popup")],pt);export{pt as default};
|
|
1
|
+
import{x as t,i as e}from"./lit-element.js";import{c as n}from"./register-custom-element.js";import{S as o,n as i}from"./solid-element.js";import{e as r}from"./query.js";import{c as a}from"./component.styles.js";import{t as s}from"./classix.js";const l=Math.min,c=Math.max,f=Math.round,p=Math.floor,u=t=>({x:t,y:t}),h={left:"right",right:"left",bottom:"top",top:"bottom"},d={start:"end",end:"start"};function m(t,e,n){return c(t,l(e,n))}function y(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function w(t){return t.split("-")[1]}function b(t){return"x"===t?"y":"x"}function v(t){return"y"===t?"height":"width"}function x(t){return["top","bottom"].includes(g(t))?"y":"x"}function P(t){return b(x(t))}function E(t){return t.replace(/start|end/g,(t=>d[t]))}function z(t){return t.replace(/left|right|bottom|top/g,(t=>h[t]))}function R(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function S(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function T(t,e,n){let{reference:o,floating:i}=t;const r=x(e),a=P(e),s=v(a),l=g(e),c="y"===r,f=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,u=o[s]/2-i[s]/2;let h;switch(l){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-i.width,y:p};break;default:h={x:o.x,y:o.y}}switch(w(e)){case"start":h[a]-=u*(n&&c?-1:1);break;case"end":h[a]+=u*(n&&c?-1:1)}return h}async function L(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=y(e,t),d=R(h),m=s[u?"floating"===p?"reference":"floating":p],g=S(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),w="floating"===p?{...a.floating,x:o,y:i}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},x=S(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+d.top)/v.y,bottom:(x.bottom-g.bottom+d.bottom)/v.y,left:(g.left-x.left+d.left)/v.x,right:(x.right-g.right+d.right)/v.x}}const O=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=g(n),s=w(n),l="y"===x(n),c=["left","top"].includes(a)?-1:1,f=r&&l?-1:1,p=y(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:d}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return s&&"number"==typeof d&&(h="end"===s?-1*d:d),l?{x:h*f,y:u*c}:{x:u*c,y:h*f}}(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},A=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:a=(()=>{}),...s}=y(t,e),f=await L(e,s),p=g(n),u=w(n),h="y"===x(n),{width:d,height:m}=o.floating;let b,v;"top"===p||"bottom"===p?(b=p,v=u===(await(null==i.isRTL?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(v=p,b="end"===u?"top":"bottom");const P=m-f[b],E=d-f[v],z=!e.middlewareData.shift;let R=P,S=E;if(h){const t=d-f.left-f.right;S=u||z?l(E,t):t}else{const t=m-f.top-f.bottom;R=u||z?l(P,t):t}if(z&&!u){const t=c(f.left,0),e=c(f.right,0),n=c(f.top,0),o=c(f.bottom,0);h?S=d-2*(0!==t||0!==e?t+e:c(f.left,f.right)):R=m-2*(0!==n||0!==o?n+o:c(f.top,f.bottom))}await a({...e,availableWidth:S,availableHeight:R});const T=await i.getDimensions(r.floating);return d!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function k(t){return D(t)?(t.nodeName||"").toLowerCase():"#document"}function C(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(D(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function D(t){return t instanceof Node||t instanceof C(t).Node}function B(t){return t instanceof Element||t instanceof C(t).Element}function $(t){return t instanceof HTMLElement||t instanceof C(t).HTMLElement}function j(t){return!(typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof C(t).ShadowRoot)}function H(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function N(t){return["table","td","th"].includes(k(t))}function M(t){const e=W(),n=q(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function W(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function V(t){return["html","body","#document"].includes(k(t))}function q(t){return C(t).getComputedStyle(t)}function I(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if("html"===k(t))return t;const e=t.assignedSlot||t.parentNode||j(t)&&t.host||F(t);return j(e)?e.host:e}function Y(t){const e=X(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:$(e)&&H(e)?e:Y(e)}function _(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=Y(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),a=C(i);return r?e.concat(a,a.visualViewport||[],H(i)?i:[],a.frameElement&&n?_(a.frameElement):[]):e.concat(i,_(i,[],n))}function G(t){const e=q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=$(t),r=i?t.offsetWidth:n,a=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function J(t){return B(t)?t:t.contextElement}function K(t){const e=J(t);if(!$(e))return u(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=G(e);let a=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Q=u(0);function U(t){const e=C(t);return W()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Q}function Z(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=J(t);let a=u(1);e&&(o?B(o)&&(a=K(o)):a=K(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==C(t))&&e}(r,n,o)?U(r):u(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,f=i.width/a.x,p=i.height/a.y;if(r){const t=C(r),e=o&&B(o)?C(o):o;let n=t.frameElement;for(;n&&o&&e!==t;){const t=K(n),e=n.getBoundingClientRect(),o=q(n),i=e.left+(n.clientLeft+parseFloat(o.paddingLeft))*t.x,r=e.top+(n.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,p*=t.y,l+=i,c+=r,n=C(n).frameElement}}return S({width:f,height:p,x:l,y:c})}function tt(t){return Z(F(t)).left+I(t).scrollLeft}function et(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=C(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const t=W();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:r,height:a,x:s,y:l}}(t,n);else if("document"===e)o=function(t){const e=F(t),n=I(t),o=t.ownerDocument.body,i=c(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=c(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+tt(t);const s=-n.scrollTop;return"rtl"===q(o).direction&&(a+=c(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(F(t));else if(B(e))o=function(t,e){const n=Z(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=$(t)?K(t):u(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=U(t);o={...e,x:e.x-n.x,y:e.y-n.y}}return S(o)}function nt(t,e){const n=X(t);return!(n===e||!B(n)||V(n))&&("fixed"===q(n).position||nt(n,e))}function ot(t,e){const n=e.get(t);if(n)return n;let o=_(t,[],!1).filter((t=>B(t)&&"body"!==k(t))),i=null;const r="fixed"===q(t).position;let a=r?X(t):t;for(;B(a)&&!V(a);){const e=q(a),n=M(a);!n&&"fixed"===e.position&&(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&["absolute","fixed"].includes(i.position)||H(a)&&!n&&nt(t,a))?o=o.filter((t=>t!==a)):i=e,a=X(a)}return e.set(t,o),o}function it(t,e,n){const o=$(e),i=F(e),r="fixed"===n,a=Z(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const l=u(0);if(o||!o&&!r)if(("body"!==k(e)||H(i))&&(s=I(e)),o){const t=Z(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=tt(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function rt(t,e){return $(t)&&"fixed"!==q(t).position?e?e(t):t.offsetParent:null}function at(t,e){const n=C(t);if(!$(t))return n;let o=rt(t,e);for(;o&&N(o)&&"static"===q(o).position;)o=rt(o,e);return o&&("html"===k(o)||"body"===k(o)&&"static"===q(o).position&&!M(o))?n:o||function(t){let e=X(t);for(;$(e)&&!V(e);){if(M(e))return e;e=X(e)}return null}(t)||n}const st={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=$(n),r=F(n);if(n===r)return e;let a={scrollLeft:0,scrollTop:0},s=u(1);const l=u(0);if((i||!i&&"fixed"!==o)&&(("body"!==k(n)||H(r))&&(a=I(n)),$(n))){const t=Z(n);s=K(n),l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?ot(e,this._c):[].concat(n),o],a=r[0],s=r.reduce(((t,n)=>{const o=et(e,n,i);return t.top=c(o.top,t.top),t.right=l(o.right,t.right),t.bottom=l(o.bottom,t.bottom),t.left=c(o.left,t.left),t}),et(e,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:at,getElementRects:async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||at,r=this.getDimensions;return{reference:it(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return G(t)},getScale:K,isElement:B,isRTL:function(t){return"rtl"===q(t).direction}};var lt=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,ft=(t,e,n,o)=>{for(var i,r=o>1?void 0:o?ct(e,n):e,a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o?i(e,n,r):i(r))||r);return o&&r&<(e,n,r),r};let pt=class extends o{constructor(){super(...arguments),this.active=!1,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver((t=>this.handleCurrentPlacementChange(t))),this.mutationObserver.observe(this,{attributes:!0})}handleCurrentPlacementChange(t){return t.forEach((t=>{if("data-current-placement"===t.attributeName){const t=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:t})}}))}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=function(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,u=J(t),h=i||r?[...u?_(u):[],..._(e)]:[];h.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const d=u&&s?function(t,e){let n,o=null;const i=F(t);function r(){clearTimeout(n),o&&o.disconnect(),o=null}return function a(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const{left:u,top:h,width:d,height:m}=t.getBoundingClientRect();if(s||e(),!d||!m)return;const y={rootMargin:-p(h)+"px "+-p(i.clientWidth-(u+d))+"px "+-p(i.clientHeight-(h+m))+"px "+-p(u)+"px",threshold:c(0,l(1,f))||1};let g=!0;function w(t){const e=t[0].intersectionRatio;if(e!==f){if(!g)return a();e?a(!1,e):n=setTimeout((()=>{a(!1,1e-7)}),100)}g=!1}try{o=new IntersectionObserver(w,{...y,root:i.ownerDocument})}catch{o=new IntersectionObserver(w,y)}o.observe(t)}(!0),r}(u,n):null;let m=-1,y=null;a&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===u&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{y&&y.observe(e)}))),n()})),u&&!f&&y.observe(u),y.observe(e));let g,w=f?Z(t):null;return f&&function e(){const o=Z(t);w&&(o.x!==w.x||o.y!==w.y||o.width!==w.width||o.height!==w.height)&&n(),w=o,g=requestAnimationFrame(e)}(),n(),()=>{h.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),d&&d(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(g)}}(this.anchorEl,this.popup,(()=>{this.reposition()})))}async stop(){return new Promise((t=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame((()=>t()))):t()}))}reposition(){if(!this.active||!this.anchorEl)return;const t=[O({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?t.push(A({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,n="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=n?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&t.push(function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:m=!0,...b}=y(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=g(i),R=g(s)===s,S=await(null==l.isRTL?void 0:l.isRTL(c.floating)),T=u||(R||!m?[z(s)]:function(t){const e=z(t);return[E(t),e,E(e)]}(s));!u&&"none"!==d&&T.push(...function(t,e,n,o){const i=w(t);let r=function(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:a;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map((t=>t+"-"+i)),e&&(r=r.concat(r.map(E)))),r}(s,m,d,S));const O=[s,...T],A=await L(e,b),k=[];let C=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&k.push(A[x]),p){const t=function(t,e,n){void 0===n&&(n=!1);const o=w(t),i=P(t),r=v(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=z(a)),[a,z(a)]}(i,a,S);k.push(A[t[0]],A[t[1]])}if(C=[...C,{placement:i,overflows:k}],!k.every((t=>t<=0))){var F,D;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=O[t];if(e)return{data:{index:t,overflows:C},reset:{placement:e}};let n=null==(D=C.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:D.placement;if(!n)switch(h){case"bestFit":{var B;const t=null==(B=C.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=y(t,e),c={x:n,y:o},f=await L(e,l),p=x(g(i)),u=b(p);let h=c[u],d=c[p];if(r){const t="y"===u?"bottom":"right";h=m(h+f["y"===u?"top":"left"],h,h-f[t])}if(a){const t="y"===p?"bottom":"right";d=m(d+f["y"===p?"top":"left"],d,d-f[t])}const w=s.fn({...e,[u]:h,[p]:d});return{...w,data:{x:w.x-n,y:w.y-o}}}}}({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?t.push(A({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push((t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:a,elements:s,middlewareData:c}=e,{element:f,padding:p=0}=y(t,e)||{};if(null==f)return{};const u=R(p),h={x:n,y:o},d=P(i),g=v(d),b=await a.getDimensions(f),x="y"===d,E=x?"top":"left",z=x?"bottom":"right",S=x?"clientHeight":"clientWidth",T=r.reference[g]+r.reference[d]-h[d]-r.floating[g],L=h[d]-r.reference[d],O=await(null==a.getOffsetParent?void 0:a.getOffsetParent(f));let A=O?O[S]:0;(!A||!await(null==a.isElement?void 0:a.isElement(O)))&&(A=s.floating[S]||r.floating[g]);const k=T/2-L/2,C=A/2-b[g]/2-1,F=l(u[E],C),D=l(u[z],C),B=F,$=A-b[g]-D,j=A/2-b[g]/2+k,H=m(B,j,$),N=!c.arrow&&null!=w(i)&&j!=H&&r.reference[g]/2-(j<B?F:D)-b[g]/2<0,M=N?j<B?j-B:j-$:0;return{[d]:h[d]+M,data:{[d]:H,centerOffset:j-H-M,...N&&{alignmentOffset:M}},reset:N}}}))({element:this.arrowEl,padding:this.arrowPadding})),((t,e,n)=>{const o=new Map,i={platform:st,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:p}=T(c,o,l),u=o,h={},d=0;for(let n=0;n<s.length;n++){const{name:r,fn:m}=s[n],{x:y,y:g,data:w,reset:b}=await m({x:f,y:p,initialPlacement:o,placement:u,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:t,floating:e}});f=y??f,p=g??p,h={...h,[r]:{...h[r],...w}},b&&d<=50&&(d++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:p}=T(c,u,l))),n=-1)}return{x:f,y:p,placement:u,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})})(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.strategy}).then((({x:t,y:e,middlewareData:n,placement:o})=>{const i="rtl"===getComputedStyle(this).direction,r={top:"bottom",right:"left",bottom:"top",left:"right"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=n.arrow.x,e=n.arrow.y;let o="",a="",s="",l="";if("start"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",a=i?n:"",l=i?"":n}else if("end"===this.arrowPlacement){const n="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";a=i?"":n,l=i?n:"",s="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:a,bottom:s,left:l,[r]:"calc(var(--arrow-size-diagonal) * -1)"})}})),this.emit("sd-reposition")}render(){return t`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${s("isolate","fixed"!==this.strategy?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?t`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};pt.styles=[o.styles,a,e`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size) * 0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-width:var(--auto-size-available-width,none);max-height:var(--auto-size-available-height,none)}[part=arrow]{width:calc(var(--arrow-size-diagonal) * 2);height:calc(var(--arrow-size-diagonal) * 2);background:var(--arrow-color)}`],ft([r('[part="popup"]')],pt.prototype,"popup",2),ft([r('[part="arrow"]')],pt.prototype,"arrowEl",2),ft([i()],pt.prototype,"anchor",2),ft([i({type:Boolean,reflect:!0})],pt.prototype,"active",2),ft([i({reflect:!0})],pt.prototype,"placement",2),ft([i({reflect:!0})],pt.prototype,"strategy",2),ft([i({type:Number})],pt.prototype,"distance",2),ft([i({type:Number})],pt.prototype,"skidding",2),ft([i({type:Boolean})],pt.prototype,"arrow",2),ft([i({attribute:"arrow-placement"})],pt.prototype,"arrowPlacement",2),ft([i({attribute:"arrow-padding",type:Number})],pt.prototype,"arrowPadding",2),ft([i({type:Boolean})],pt.prototype,"flip",2),ft([i({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map((t=>t.trim())).filter((t=>""!==t)),toAttribute:t=>t.join(" ")}})],pt.prototype,"flipFallbackPlacements",2),ft([i({attribute:"flip-fallback-strategy"})],pt.prototype,"flipFallbackStrategy",2),ft([i({type:Object})],pt.prototype,"flipBoundary",2),ft([i({attribute:"flip-padding",type:Number})],pt.prototype,"flipPadding",2),ft([i({type:Boolean})],pt.prototype,"shift",2),ft([i({type:Object})],pt.prototype,"shiftBoundary",2),ft([i({attribute:"shift-padding",type:Number})],pt.prototype,"shiftPadding",2),ft([i({attribute:"auto-size"})],pt.prototype,"autoSize",2),ft([i()],pt.prototype,"sync",2),ft([i({type:Object})],pt.prototype,"autoSizeBoundary",2),ft([i({attribute:"auto-size-padding",type:Number})],pt.prototype,"autoSizePadding",2),pt=ft([n("sd-popup")],pt);export{pt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=new Set;function o(o){if(t.add(o),!document.body.classList.contains("sd-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}();document.body.classList.add("sd-scroll-lock"),document.body.style.setProperty("--sd-scroll-lock-size",`${t}px`)}}function e(o){t.delete(o),0===t.size&&(document.body.classList.remove("sd-scroll-lock"),document.body.style.removeProperty("--sd-scrollbar-width"))}function l(t,o,e="vertical",l="smooth"){const c=function(t,o){return{top:Math.round(t.getBoundingClientRect().top-o.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-o.getBoundingClientRect().left)}}(t,o),n=c.top+o.scrollTop,s=c.left+o.scrollLeft,i=o.scrollLeft,r=o.scrollLeft+o.offsetWidth,d=o.scrollTop,f=o.scrollTop+o.offsetHeight;("horizontal"===e||"both"===e)&&(s<i?o.scrollTo({left:s,behavior:l}):s+t.clientWidth>r&&o.scrollTo({left:s-o.offsetWidth+t.clientWidth,behavior:l})),("vertical"===e||"both"===e)&&(n<d?o.scrollTo({top:n,behavior:l}):n+t.clientHeight>f&&o.scrollTo({top:n-o.offsetHeight+t.clientHeight,behavior:l}))}export{o as l,l as s,e as u};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{s as t,a as e,w as s}from"./event.js";import{x as i,i as o}from"./lit-element.js";import{c as l}from"./register-custom-element.js";import{d as a}from"./default-value.js";import{F as n}from"./form.js";import{g as r,s as h}from"./animation-registry.js";import{H as p}from"./slot.js";import{L as d}from"./solid-components2.js";import{S as c,n as u}from"./solid-element.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 O}from"./classix.js";import{f as C}from"./form-control.styles.js";import $ 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 k=Object.defineProperty,D=Object.getOwnPropertyDescriptor,I=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?D(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&&k(e,s,l),l};let T=class extends c{constructor(){super(...arguments),this.formControlController=new n(this,{assumeInteractionOn:["sd-blur","sd-input"]}),this.hasSlotController=new p(this,"help-text","label"),this.localize=new d(this),this.typeToSelectString="",this.hasFocus=!1,this.hasHover=!1,this.displayLabel="",this.selectedOptions=[],this.isValid=!1,this.isInvalid=!1,this.defaultValue="",this.open=!1,this.size="lg",this.label="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=>i`<sd-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
2
|
+
base:tag__base,
|
|
3
|
+
content:tag__content,
|
|
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 i`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?v(s):s}</div>`}return e===this.maxOptionsVisible?i`<sd-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-tag>`:i``}))}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}=r(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}=r(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,o=!!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",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 i`<div part="form-control" class="${O("form-control relative text-left",n,"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",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?i`<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",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?i`<button part="clear-button" class="${O("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="${O("text-neutral-500",h)}" library="system" name="closing-round"></sd-icon></slot></button>`:""} ${this.isInvalid?i`<sd-icon class="${O("text-error",r,h)}" library="system" name="risk"></sd-icon>`:""} ${this.isValid?i`<sd-icon class="${O("text-success",r,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="${o?"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,c.styles,o`:host{display:block;position:relative;width:100%}:host([required]) #label::after{content:' *'}sd-popup::part(popup){overflow-y:scroll}sd-tag::part(base){border-radius:4px;padding-left:4px;padding-right:4px}sd-tag[size=lg]::part(base){padding-left:8px;padding-right:8px}sd-tag[disabled=false]::part(base):hover{background-color:rgb(var(--sd-color-primary-100,236 240 249) / 1)}`],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([a()],T.prototype,"defaultValue",2),I([u({type:Boolean,reflect:!0})],T.prototype,"open",2),I([u({reflect:!0})],T.prototype,"size",2),I([u()],T.prototype,"label",2),I([u()],T.prototype,"placeholder",2),I([u({attribute:"help-text"})],T.prototype,"helpText",2),I([u({reflect:!0})],T.prototype,"placement",2),I([m()],T.prototype,"currentPlacement",2),I([u({type:Boolean})],T.prototype,"clearable",2),I([u({type:Boolean,reflect:!0})],T.prototype,"disabled",2),I([u({type:Boolean,reflect:!0})],T.prototype,"multiple",2),I([u({type:Boolean,reflect:!0})],T.prototype,"useTags",2),I([u({attribute:"max-options-visible",type:Number})],T.prototype,"maxOptionsVisible",2),I([u({reflect:!0})],T.prototype,"form",2),I([u()],T.prototype,"name",2),I([u({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],T.prototype,"value",2),I([u({type:Boolean,reflect:!0})],T.prototype,"required",2),I([u({type:Boolean})],T.prototype,"hoist",2),I([u()],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([l("sd-select")],T),h("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),h("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{T 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(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?"No options selected":1===t?"1 option selected":`${t} options selected`,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",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"),"./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.styles.ts":()=>import("./include.styles.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/popup/popup.ts":()=>import("./popup.js"),"./components/radio-group/radio-group.ts":()=>import("./radio-group.js"),"./components/radio/radio.ts":()=>import("./radio.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/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.styles.ts":()=>import("./include.styles.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/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};
|