@getflip/swirl-components 0.512.0 → 0.513.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.
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as s,createEvent as t,h as i,Host as l,transformTag as c}from"@stencil/core/internal/client";import{c as r}from"./index2.js";import{q as a}from"./utils.js";import{d as o}from"./swirl-icon-check-small2.js";import{d as n}from"./swirl-icon-check-strong2.js";import{d as h}from"./swirl-icon-close2.js";import{d}from"./swirl-icon-drag-handle2.js";import{d as p}from"./swirl-icon-expand-less2.js";import{d as w}from"./swirl-icon-expand-more2.js";import{d as m}from"./swirl-icon-search2.js";import{d as u}from"./swirl-option-list2.js";import{d as f}from"./swirl-option-list-item2.js";import{d as b}from"./swirl-popover2.js";import{d as _}from"./swirl-popover-trigger2.js";import{d as v}from"./swirl-spinner2.js";import{d as g}from"./swirl-stack2.js";import{d as y}from"./swirl-tag2.js";import{d as k}from"./swirl-text2.js";import{d as x}from"./swirl-visually-hidden2.js";const E=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.searchChange=t(this,"searchChange",7),this.valueChange=t(this,"valueChange",7),this.allowDeselect=!0,this.emptyListLabel="No results found.",this.searchInputLabel="Search options",this.selectId=""+Math.round(1e6*Math.random()),this.options=[],this.typeaheadBuffer="",this.select=e=>{e.stopPropagation(),this.value=e.detail,this.multiSelect||this.swirlPopover.close()},this.unselectOption=e=>{this.allowDeselect&&(this.value=this.value.filter((s=>s!==e)))},this.onSlotChange=()=>{this.updateOptions()},this.onOpen=e=>{this.placement=e.detail.position?.placement,this.open=!0,this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.withSearch&&this.searchInput?this.searchInput.focus():this.optionList.querySelector('[tabIndex="0"]')?.focus()},this.onClose=()=>{this.searchInput&&(this.searchInput.value="",this.searchChange.emit("")),this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.open=!1,this.input.focus()},this.onKeyDown=e=>{if("Space"===e.code||"Enter"===e.code){if(e.target===this.searchInput)return;e.preventDefault(),this.swirlPopover.open(this.el)}else"ArrowDown"===e.code&&e.target===this.searchInput?this.optionList.querySelector('[tabIndex="0"]')?.focus():this.isTypeaheadKey(e)&&(e.preventDefault(),e.stopPropagation(),this.handleTypeahead(e.key))},this.onSearchInput=e=>{this.searchChange.emit(e.target.value)}}componentWillLoad(){queueMicrotask((()=>{this.updateOptions(),this.observeSlotChanges()}))}disconnectedCallback(){this.observer?.disconnect(),clearTimeout(this.typeaheadTimeout)}onWindowFocusIn(e){e.target===this.el.querySelector("input")&&e.stopImmediatePropagation()}onValueChange(e,s){e?.length===s?.length&&e?.every((e=>s?.includes(e)))||this.valueChange.emit(this.value)}observeSlotChanges(){this.observer=new MutationObserver((()=>{this.updateOptions()})),this.observer.observe(this.el,{childList:!0,subtree:!0})}updateOptions(){this.options=a(this.el,"swirl-option-list-item")}isTypeaheadKey(e){return e.target!==this.searchInput&&!(e.metaKey||e.ctrlKey||e.altKey)&&1===e.key.length&&" "!==e.key}handleTypeahead(e){const s=e.toLowerCase();if(clearTimeout(this.typeaheadTimeout),this.typeaheadBuffer.length>0&&[...this.typeaheadBuffer].every((e=>e===s)))this.typeaheadBuffer+=s,this.cycleTypeahead(s);else{const e=this.typeaheadBuffer.length>1&&1===new Set(this.typeaheadBuffer).size;this.typeaheadBuffer=e?s:this.typeaheadBuffer+s,this.prefixMatchTypeahead(this.typeaheadBuffer)||(this.typeaheadBuffer=s,this.prefixMatchTypeahead(this.typeaheadBuffer))}this.typeaheadTimeout=setTimeout((()=>{this.typeaheadBuffer=""}),500)}cycleTypeahead(e){const s=this.options.filter((e=>!e.disabled)).filter((s=>s.label?.toLowerCase().startsWith(e)));if(0===s.length)return;const t=this.getTypeaheadAnchorValue(),i=s.findIndex((e=>e.value===t));this.applyTypeaheadMatch(s[(i+1)%s.length])}prefixMatchTypeahead(e){const s=this.options.filter((e=>!e.disabled)).find((s=>s.label?.toLowerCase().startsWith(e)));return!!s&&(this.applyTypeaheadMatch(s),!0)}getTypeaheadAnchorValue(){if(this.open){const e=this.options.find((e=>e.querySelector('[role="option"][tabindex="0"]')));return e?.value}return this.value?.[this.value.length-1]}applyTypeaheadMatch(e){this.open&&this.optionList.focusItemWithValue(e.value)}getValueLabel(){return this.value?this.value?.map((e=>this.options.find((s=>s.value===e))?.label)).join(", "):""}render(){const e=this.getValueLabel(),s=!0===this.invalid||!1===this.invalid?this.invalid+"":void 0,t=this.el.closest("swirl-form-control"),c=this.standalone?[-8,0]:t?.inline||"outside"===t?.labelPosition?[0,-12]:[0,-16],a=r("select","select--placement-"+this.placement,{"select--disabled":this.disabled,"select--inline":this.inline,"select--multi":this.multiSelect,"select--search-loading":this.searchLoading,"select--standalone":this.standalone});return i(l,{key:"cd2ebc3f06c45bf23f700307898c17fcb43ac66c",onKeyDown:this.onKeyDown},i("div",{key:"25ebb41429381a9676347da1931a492d5b2b3c75",class:a},i("swirl-popover-trigger",{key:"77508033b1604f3ebd8de4051a40b5ace92c287e",swirlPopover:this.swirlPopover,setAriaAttributes:!1},i("swirl-stack",{key:"3bda3bbf226878ab6f5c04f736a4c117cb4f1f6e",class:"select__value-container"},this.standalone&&i("span",{key:"6b9246b4309c8a0b5214aa52f9f0949fe057b1e8","aria-hidden":"true",class:"select__resize-helper"},e),i("input",{key:"247f23ee5edd372768f95558cd9de57035910050","aria-describedby":this.swirlAriaDescribedby,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":s,class:"select__input",disabled:this.disabled,readOnly:!0,ref:e=>this.input=e,type:"text",value:e}))),i("span",{key:"0274bf2cdda4e4203aeb0a63997417f9e5494c00",class:"select__multi-select-values"},this.value?.map((e=>this.options.find((s=>s.value===e))))?.map((e=>i("swirl-tag",{"aria-hidden":"true",label:e?.label,onRemove:()=>this.unselectOption(e?.value),removable:!this.disabled&&this.allowDeselect&&!e?.disabled})))),i("span",{key:"5a3a2d8b00d2c4f5818edd8f3c6862d14b62596e",class:"select__indicator"},i(this.open?"swirl-icon-expand-less":"swirl-icon-expand-more",{size:this.standalone?20:24})),i("swirl-popover",{key:"7660cdecafd124f2e011691c8562f35cd91e77a7",animation:"scale-in-y",class:"select__popover",id:"select-options-"+this.selectId,label:this.label,offset:c,onPopoverClose:this.onClose,onPopoverOpen:this.onOpen,ref:e=>this.swirlPopover=e,useContainerWidth:!this.standalone&&"swirl-form-control"},this.withSearch&&i("div",{key:"fa4662e27d2bbed8eb5138f74e1ed9d8cb047e45",class:"select__search"},i("swirl-icon-search",{key:"1f7011fc3010813d78327e110460a42477b42c0f",class:"select__search-icon",size:20}),i("input",{key:"e678d46c74672bccf08739f25c6a6819e4ab77c1","aria-label":this.searchInputLabel,class:"select__search-input",onInput:this.onSearchInput,placeholder:this.searchPlaceholder,ref:e=>this.searchInput=e,type:"search"}),this.searchLoading&&i("swirl-spinner",{key:"ff17da88f9f0373538344e17295df43e49679d16",class:"select__search-spinner",size:"s"})),i("swirl-option-list",{key:"12a30f19bde3cc18776c3d0be1c78cbea1b122d8",class:"select__option-list",allowDeselect:this.allowDeselect,onValueChange:this.select,multiSelect:this.multiSelect,ref:e=>this.optionList=e,value:this.value},!this.searchLoading&&i("div",{key:"0f01d8805c9d319e6b580aed05fecb53154695f1","aria-disabled":"true",class:"select__empty-list-label",role:"option"},i("swirl-text",{key:"d1f0bcfb842c6f9cbf5b817082b75ccb2f7e59c2",color:"subdued",weight:"medium"},this.emptyListLabel)),i("slot",{key:"f849b8d08f0f1dd4853a7715750f8aedbf96f5c0",onSlotchange:this.onSlotChange})))))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return'.sc-swirl-select-h{display:block;width:100%}.sc-swirl-select-h *.sc-swirl-select{box-sizing:border-box}.select.sc-swirl-select{position:relative;display:flex;width:100%}.select.sc-swirl-select .sc-swirl-select::part(popover__content),.select.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:var(--s-space-16)}@media (min-width: 768px){.select.sc-swirl-select .sc-swirl-select::part(popover__scroll-container){padding-top:0}}.select--placement-top-start.sc-swirl-select .sc-swirl-select::part(popover__content),.select--placement-top-start.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:-2.25rem}.select--multi.sc-swirl-select .select__input.sc-swirl-select{position:absolute;width:100%;height:100%;pointer-events:none;opacity:0}.select--multi.sc-swirl-select .select__multi-select-values.sc-swirl-select{display:flex}.select--disabled.sc-swirl-select .select__input.sc-swirl-select{color:var(--s-text-disabled)}.select--disabled.sc-swirl-select .select__indicator.sc-swirl-select{color:var(--s-icon-disabled)}.select--inline.sc-swirl-select .select__indicator.sc-swirl-select{transform:translateY(-50%)}.select--standalone.sc-swirl-select{width:-moz-fit-content;width:fit-content}.select--standalone.sc-swirl-select .select__indicator.sc-swirl-select{position:relative;top:auto;right:auto;cursor:pointer;transform:none}.select--standalone.sc-swirl-select .select__input.sc-swirl-select{padding-right:var(--s-space-8);font-weight:var(--s-font-weight-medium);cursor:pointer}.select--standalone.sc-swirl-select .select__value-container.sc-swirl-select{width:-moz-min-content;width:min-content}.select--search-loading.sc-swirl-select .select__search-input.sc-swirl-select{padding-right:calc(var(--s-space-12) + 1.5rem + var(--s-space-8))}.select__resize-helper.sc-swirl-select{display:block;width:auto;height:0;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));padding-right:var(--s-space-8);font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;white-space:pre;white-space:pre;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__resize-helper.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__input.sc-swirl-select{display:block;overflow:hidden;width:100%;height:1.25rem;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));border:none;background-color:transparent;font:inherit;line-height:var(--s-line-height-base);text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:default}.select__input.sc-swirl-select:focus{outline:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__multi-select-values.sc-swirl-select{display:none;overflow:hidden;width:100%;min-height:1.25rem;padding-right:calc(1.5rem + var(--s-space-8));flex-wrap:wrap;flex-shrink:0;gap:var(--s-space-8)}.select__multi-select-values.sc-swirl-select .sc-swirl-select::part(tag),.select__multi-select-values.sc-swirl-select .sc-swirl-select [part~="tag"]{height:1.25rem;padding:0 var(--s-space-4)}.select__indicator.sc-swirl-select{position:absolute;top:50%;right:0;display:inline-flex;color:var(--s-icon-default);transform:translateY(calc(-50% - var(--s-space-8)));pointer-events:none}.select__search.sc-swirl-select{position:relative;display:flex;width:100%;padding:0.0625rem var(--s-space-8);border-bottom:0.0625rem solid var(--s-border-default)}@media (min-width: 768px){.select__search.sc-swirl-select{position:sticky;z-index:1;top:0;padding-top:var(--s-space-8);padding-right:0.0625rem;padding-left:0.0625rem}}.select__search-icon.sc-swirl-select{position:absolute;top:50%;left:calc(var(--s-space-8) * 2);display:inline-flex;color:var(--s-icon-default);transform:translateY(-50%)}@media (min-width: 768px){.select__search-icon.sc-swirl-select{left:var(--s-space-12);margin-top:var(--s-space-4);padding:0.0625rem}}.select__search-input.sc-swirl-select{width:100%;height:2.5rem;padding-right:var(--s-space-12);padding-left:calc(var(--s-space-12) + 1.25rem + var(--s-space-8));align-items:center;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.select__search-input.sc-swirl-select:focus:not(:focus-visible){outline:none}.select__search-input.sc-swirl-select:focus-visible{outline-color:var(--s-focus-default)}.select__search-input.sc-swirl-select::-moz-placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::-webkit-search-decoration,.select__search-input.sc-swirl-select::-webkit-search-cancel-button,.select__search-input.sc-swirl-select::-webkit-search-results-button,.select__search-input.sc-swirl-select::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__search-input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__popover.sc-swirl-select::part(popover__scroll-container),.select__popover.sc-swirl-select [part~="popover__scroll-container"]{padding:0;overflow:hidden;display:flex;flex-direction:column}.select__popover.sc-swirl-select .select__search.sc-swirl-select{flex-shrink:0}.select__popover.sc-swirl-select .select__option-list.sc-swirl-select{padding:var(--s-space-4);overflow:auto;min-height:0}.select__search-spinner.sc-swirl-select{position:absolute;top:50%;right:var(--s-space-12);display:inline-flex;transform:translateY(-50%)}@media (min-width: 768px){.select__search-spinner.sc-swirl-select{margin-top:var(--s-space-4)}}.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) 0}.select__empty-list-label.sc-swirl-select:not(:only-child){display:none}@media (min-width: 768px){.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) var(--s-space-8)}}'}},[262,"swirl-select",{allowDeselect:[4,"allow-deselect"],disabled:[4],emptyListLabel:[1,"empty-list-label"],inline:[4],invalid:[4],label:[1],multiSelect:[4,"multi-select"],required:[4],searchInputLabel:[1,"search-input-label"],searchLoading:[4,"search-loading"],searchPlaceholder:[1,"search-placeholder"],selectId:[1,"select-id"],standalone:[4],swirlAriaDescribedby:[1,"swirl-aria-describedby"],value:[1040],withSearch:[4,"with-search"],options:[32],open:[32],placement:[32]},[[8,"focusin","onWindowFocusIn"]],{value:[{onValueChange:0}]}]),j=E,z=function(){"undefined"!=typeof customElements&&["swirl-select","swirl-icon-check-small","swirl-icon-check-strong","swirl-icon-close","swirl-icon-drag-handle","swirl-icon-expand-less","swirl-icon-expand-more","swirl-icon-search","swirl-option-list","swirl-option-list-item","swirl-popover","swirl-popover-trigger","swirl-spinner","swirl-stack","swirl-tag","swirl-text","swirl-visually-hidden"].forEach((e=>{switch(e){case"swirl-select":customElements.get(c(e))||customElements.define(c(e),E);break;case"swirl-icon-check-small":customElements.get(c(e))||o();break;case"swirl-icon-check-strong":customElements.get(c(e))||n();break;case"swirl-icon-close":customElements.get(c(e))||h();break;case"swirl-icon-drag-handle":customElements.get(c(e))||d();break;case"swirl-icon-expand-less":customElements.get(c(e))||p();break;case"swirl-icon-expand-more":customElements.get(c(e))||w();break;case"swirl-icon-search":customElements.get(c(e))||m();break;case"swirl-option-list":customElements.get(c(e))||u();break;case"swirl-option-list-item":customElements.get(c(e))||f();break;case"swirl-popover":customElements.get(c(e))||b();break;case"swirl-popover-trigger":customElements.get(c(e))||_();break;case"swirl-spinner":customElements.get(c(e))||v();break;case"swirl-stack":customElements.get(c(e))||g();break;case"swirl-tag":customElements.get(c(e))||y();break;case"swirl-text":customElements.get(c(e))||k();break;case"swirl-visually-hidden":customElements.get(c(e))||x()}}))};export{j as SwirlSelect,z as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as s,createEvent as t,h as i,Host as l,transformTag as c}from"@stencil/core/internal/client";import{c as r}from"./index2.js";import{q as a}from"./utils.js";import{d as o}from"./swirl-icon-check-small2.js";import{d as n}from"./swirl-icon-check-strong2.js";import{d as h}from"./swirl-icon-close2.js";import{d as p}from"./swirl-icon-drag-handle2.js";import{d}from"./swirl-icon-expand-less2.js";import{d as w}from"./swirl-icon-expand-more2.js";import{d as m}from"./swirl-icon-search2.js";import{d as u}from"./swirl-option-list2.js";import{d as f}from"./swirl-option-list-item2.js";import{d as b}from"./swirl-popover2.js";import{d as _}from"./swirl-popover-trigger2.js";import{d as v}from"./swirl-spinner2.js";import{d as g}from"./swirl-stack2.js";import{d as y}from"./swirl-tag2.js";import{d as k}from"./swirl-text2.js";import{d as x}from"./swirl-visually-hidden2.js";const E=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.searchChange=t(this,"searchChange",7),this.valueChange=t(this,"valueChange",7),this.allowDeselect=!0,this.emptyListLabel="No results found.",this.searchInputLabel="Search options",this.selectId=""+Math.round(1e6*Math.random()),this.options=[],this.typeaheadBuffer="",this.select=e=>{e.stopPropagation(),this.value=e.detail,this.multiSelect||this.swirlPopover.close()},this.unselectOption=e=>{this.allowDeselect&&(this.value=this.value.filter((s=>s!==e)))},this.onSlotChange=()=>{this.updateOptions()},this.onOpen=e=>{this.placement=e.detail.position?.placement,this.open=!0,this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.withSearch&&this.searchInput?this.searchInput.focus():this.optionList.querySelector('[tabIndex="0"]')?.focus()},this.onClose=()=>{this.searchInput&&(this.searchInput.value="",this.searchChange.emit("")),this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.open=!1,this.input.focus()},this.onKeyDown=e=>{if("Space"===e.code||"Enter"===e.code){if(e.target===this.searchInput)return;e.preventDefault(),this.swirlPopover.open(this.el)}else"ArrowDown"===e.code&&e.target===this.searchInput?this.optionList.querySelector('[tabIndex="0"]')?.focus():this.isTypeaheadKey(e)&&(e.preventDefault(),e.stopPropagation(),this.handleTypeahead(e.key))},this.onSearchInput=e=>{this.searchChange.emit(e.target.value)}}componentWillLoad(){queueMicrotask((()=>{this.updateOptions(),this.observeSlotChanges()}))}disconnectedCallback(){this.observer?.disconnect(),clearTimeout(this.typeaheadTimeout)}onWindowFocusIn(e){e.target===this.el.querySelector("input")&&e.stopImmediatePropagation()}onValueChange(e,s){e?.length===s?.length&&e?.every((e=>s?.includes(e)))||this.valueChange.emit(this.value)}async selectSearchInput(){this.searchInput?.select()}async focusSearchInput(){this.searchInput?.focus()}observeSlotChanges(){this.observer=new MutationObserver((()=>{this.updateOptions()})),this.observer.observe(this.el,{childList:!0,subtree:!0})}updateOptions(){this.options=a(this.el,"swirl-option-list-item")}isTypeaheadKey(e){return e.target!==this.searchInput&&!(e.metaKey||e.ctrlKey||e.altKey)&&1===e.key.length&&" "!==e.key}handleTypeahead(e){const s=e.toLowerCase();if(clearTimeout(this.typeaheadTimeout),this.typeaheadBuffer.length>0&&[...this.typeaheadBuffer].every((e=>e===s)))this.typeaheadBuffer+=s,this.cycleTypeahead(s);else{const e=this.typeaheadBuffer.length>1&&1===new Set(this.typeaheadBuffer).size;this.typeaheadBuffer=e?s:this.typeaheadBuffer+s,this.prefixMatchTypeahead(this.typeaheadBuffer)||(this.typeaheadBuffer=s,this.prefixMatchTypeahead(this.typeaheadBuffer))}this.typeaheadTimeout=setTimeout((()=>{this.typeaheadBuffer=""}),500)}cycleTypeahead(e){const s=this.options.filter((e=>!e.disabled)).filter((s=>s.label?.toLowerCase().startsWith(e)));if(0===s.length)return;const t=this.getTypeaheadAnchorValue(),i=s.findIndex((e=>e.value===t));this.applyTypeaheadMatch(s[(i+1)%s.length])}prefixMatchTypeahead(e){const s=this.options.filter((e=>!e.disabled)).find((s=>s.label?.toLowerCase().startsWith(e)));return!!s&&(this.applyTypeaheadMatch(s),!0)}getTypeaheadAnchorValue(){if(this.open){const e=this.options.find((e=>e.querySelector('[role="option"][tabindex="0"]')));return e?.value}return this.value?.[this.value.length-1]}applyTypeaheadMatch(e){this.open&&this.optionList.focusItemWithValue(e.value)}getValueLabel(){return this.value?this.value?.map((e=>this.options.find((s=>s.value===e))?.label)).join(", "):""}render(){const e=this.getValueLabel(),s=!0===this.invalid||!1===this.invalid?this.invalid+"":void 0,t=this.el.closest("swirl-form-control"),c=this.standalone?[-8,0]:t?.inline||"outside"===t?.labelPosition?[0,-12]:[0,-16],a=r("select","select--placement-"+this.placement,{"select--disabled":this.disabled,"select--inline":this.inline,"select--multi":this.multiSelect,"select--search-loading":this.searchLoading,"select--standalone":this.standalone});return i(l,{key:"24c12aad133e4912ebee173c406a703ebc78dba7",onKeyDown:this.onKeyDown},i("div",{key:"6b6306e6be1dc2f1e6b4fa5da1f7bb2d98acaf92",class:a},i("swirl-popover-trigger",{key:"a9f5e065e929e2d32c0aefef51e085945be17c42",swirlPopover:this.swirlPopover,setAriaAttributes:!1},i("swirl-stack",{key:"56eac17595d3a515643e5a1548e09c1129708fee",class:"select__value-container"},this.standalone&&i("span",{key:"10a3b60701ee3a7dda18c8f1b3fc55ce4c071947","aria-hidden":"true",class:"select__resize-helper"},e),i("input",{key:"28c8837f0f2ba57675744f4595a1bf6959f76292","aria-describedby":this.swirlAriaDescribedby,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":s,class:"select__input",disabled:this.disabled,readOnly:!0,ref:e=>this.input=e,type:"text",value:e}))),i("span",{key:"748bbe9b5d231b03dd17dd519f2814d286ec8a79",class:"select__multi-select-values"},this.value?.map((e=>this.options.find((s=>s.value===e))))?.map((e=>i("swirl-tag",{"aria-hidden":"true",label:e?.label,onRemove:()=>this.unselectOption(e?.value),removable:!this.disabled&&this.allowDeselect&&!e?.disabled})))),i("span",{key:"a6b8a95b9c88d50e0010fcfdefd22b6aec555527",class:"select__indicator"},i(this.open?"swirl-icon-expand-less":"swirl-icon-expand-more",{size:this.standalone?20:24})),i("swirl-popover",{key:"99125dda23118d225200a589c5bdf8a62af579ff",animation:"scale-in-y",class:"select__popover",id:"select-options-"+this.selectId,label:this.label,offset:c,onPopoverClose:this.onClose,onPopoverOpen:this.onOpen,ref:e=>this.swirlPopover=e,useContainerWidth:!this.standalone&&"swirl-form-control"},this.withSearch&&i("div",{key:"958ff2011ae8762212a01fc530a46eb27d6080cf",class:"select__search"},i("swirl-icon-search",{key:"441fd22a7c27a6eba52717a926fe1d5968c333eb",class:"select__search-icon",size:20}),i("input",{key:"b3f4d99371fe4bc4295e0ecc2804cc4707e29078","aria-label":this.searchInputLabel,class:"select__search-input",onInput:this.onSearchInput,placeholder:this.searchPlaceholder,ref:e=>this.searchInput=e,type:"search"}),this.searchLoading&&i("swirl-spinner",{key:"98a9d7b50ef013cb43810878e61b69ebbd53d5d4",class:"select__search-spinner",size:"s"})),i("swirl-option-list",{key:"46f668d502a4b0bbaa2bd805c4c2f55e7db89be2",class:"select__option-list",allowDeselect:this.allowDeselect,onValueChange:this.select,multiSelect:this.multiSelect,ref:e=>this.optionList=e,value:this.value},!this.searchLoading&&i("div",{key:"55758715e87468c8e443764853bbcd9f6454e2f4","aria-disabled":"true",class:"select__empty-list-label",role:"option"},i("swirl-text",{key:"543a369827294b278816b1d37f29450ffb5c7d0a",color:"subdued",weight:"medium"},this.emptyListLabel)),i("slot",{key:"9959a6969c2e5ac08790561803552aebab5067dd",onSlotchange:this.onSlotChange})))))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return'.sc-swirl-select-h{display:block;width:100%}.sc-swirl-select-h *.sc-swirl-select{box-sizing:border-box}.select.sc-swirl-select{position:relative;display:flex;width:100%}.select.sc-swirl-select .sc-swirl-select::part(popover__content),.select.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:var(--s-space-16)}@media (min-width: 768px){.select.sc-swirl-select .sc-swirl-select::part(popover__scroll-container){padding-top:0}}.select--placement-top-start.sc-swirl-select .sc-swirl-select::part(popover__content),.select--placement-top-start.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:-2.25rem}.select--multi.sc-swirl-select .select__input.sc-swirl-select{position:absolute;width:100%;height:100%;pointer-events:none;opacity:0}.select--multi.sc-swirl-select .select__multi-select-values.sc-swirl-select{display:flex}.select--disabled.sc-swirl-select .select__input.sc-swirl-select{color:var(--s-text-disabled)}.select--disabled.sc-swirl-select .select__indicator.sc-swirl-select{color:var(--s-icon-disabled)}.select--inline.sc-swirl-select .select__indicator.sc-swirl-select{transform:translateY(-50%)}.select--standalone.sc-swirl-select{width:-moz-fit-content;width:fit-content}.select--standalone.sc-swirl-select .select__indicator.sc-swirl-select{position:relative;top:auto;right:auto;cursor:pointer;transform:none}.select--standalone.sc-swirl-select .select__input.sc-swirl-select{padding-right:var(--s-space-8);font-weight:var(--s-font-weight-medium);cursor:pointer}.select--standalone.sc-swirl-select .select__value-container.sc-swirl-select{width:-moz-min-content;width:min-content}.select--search-loading.sc-swirl-select .select__search-input.sc-swirl-select{padding-right:calc(var(--s-space-12) + 1.5rem + var(--s-space-8))}.select__resize-helper.sc-swirl-select{display:block;width:auto;height:0;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));padding-right:var(--s-space-8);font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;white-space:pre;white-space:pre;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__resize-helper.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__input.sc-swirl-select{display:block;overflow:hidden;width:100%;height:1.25rem;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));border:none;background-color:transparent;font:inherit;line-height:var(--s-line-height-base);text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:default}.select__input.sc-swirl-select:focus{outline:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__multi-select-values.sc-swirl-select{display:none;overflow:hidden;width:100%;min-height:1.25rem;padding-right:calc(1.5rem + var(--s-space-8));flex-wrap:wrap;flex-shrink:0;gap:var(--s-space-8)}.select__multi-select-values.sc-swirl-select .sc-swirl-select::part(tag),.select__multi-select-values.sc-swirl-select .sc-swirl-select [part~="tag"]{height:1.25rem;padding:0 var(--s-space-4)}.select__indicator.sc-swirl-select{position:absolute;top:50%;right:0;display:inline-flex;color:var(--s-icon-default);transform:translateY(calc(-50% - var(--s-space-8)));pointer-events:none}.select__search.sc-swirl-select{position:relative;display:flex;width:100%;padding:0.0625rem var(--s-space-8);border-bottom:0.0625rem solid var(--s-border-default)}@media (min-width: 768px){.select__search.sc-swirl-select{position:sticky;z-index:1;top:0;padding-top:var(--s-space-8);padding-right:0.0625rem;padding-left:0.0625rem}}.select__search-icon.sc-swirl-select{position:absolute;top:50%;left:calc(var(--s-space-8) * 2);display:inline-flex;color:var(--s-icon-default);transform:translateY(-50%)}@media (min-width: 768px){.select__search-icon.sc-swirl-select{left:var(--s-space-12);margin-top:var(--s-space-4);padding:0.0625rem}}.select__search-input.sc-swirl-select{width:100%;height:2.5rem;padding-right:var(--s-space-12);padding-left:calc(var(--s-space-12) + 1.25rem + var(--s-space-8));align-items:center;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.select__search-input.sc-swirl-select:focus:not(:focus-visible){outline:none}.select__search-input.sc-swirl-select:focus-visible{outline-color:var(--s-focus-default)}.select__search-input.sc-swirl-select::-moz-placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::-webkit-search-decoration,.select__search-input.sc-swirl-select::-webkit-search-cancel-button,.select__search-input.sc-swirl-select::-webkit-search-results-button,.select__search-input.sc-swirl-select::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__search-input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__popover.sc-swirl-select::part(popover__scroll-container),.select__popover.sc-swirl-select [part~="popover__scroll-container"]{padding:0;overflow:hidden;display:flex;flex-direction:column}.select__popover.sc-swirl-select .select__search.sc-swirl-select{flex-shrink:0}.select__popover.sc-swirl-select .select__option-list.sc-swirl-select{padding:var(--s-space-4);overflow:auto;min-height:0}.select__search-spinner.sc-swirl-select{position:absolute;top:50%;right:var(--s-space-12);display:inline-flex;transform:translateY(-50%)}@media (min-width: 768px){.select__search-spinner.sc-swirl-select{margin-top:var(--s-space-4)}}.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) 0}.select__empty-list-label.sc-swirl-select:not(:only-child){display:none}@media (min-width: 768px){.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) var(--s-space-8)}}'}},[262,"swirl-select",{allowDeselect:[4,"allow-deselect"],disabled:[4],emptyListLabel:[1,"empty-list-label"],inline:[4],invalid:[4],label:[1],multiSelect:[4,"multi-select"],required:[4],searchInputLabel:[1,"search-input-label"],searchLoading:[4,"search-loading"],searchPlaceholder:[1,"search-placeholder"],selectId:[1,"select-id"],standalone:[4],swirlAriaDescribedby:[1,"swirl-aria-describedby"],value:[1040],withSearch:[4,"with-search"],options:[32],open:[32],placement:[32],selectSearchInput:[64],focusSearchInput:[64]},[[8,"focusin","onWindowFocusIn"]],{value:[{onValueChange:0}]}]),j=E,z=function(){"undefined"!=typeof customElements&&["swirl-select","swirl-icon-check-small","swirl-icon-check-strong","swirl-icon-close","swirl-icon-drag-handle","swirl-icon-expand-less","swirl-icon-expand-more","swirl-icon-search","swirl-option-list","swirl-option-list-item","swirl-popover","swirl-popover-trigger","swirl-spinner","swirl-stack","swirl-tag","swirl-text","swirl-visually-hidden"].forEach((e=>{switch(e){case"swirl-select":customElements.get(c(e))||customElements.define(c(e),E);break;case"swirl-icon-check-small":customElements.get(c(e))||o();break;case"swirl-icon-check-strong":customElements.get(c(e))||n();break;case"swirl-icon-close":customElements.get(c(e))||h();break;case"swirl-icon-drag-handle":customElements.get(c(e))||p();break;case"swirl-icon-expand-less":customElements.get(c(e))||d();break;case"swirl-icon-expand-more":customElements.get(c(e))||w();break;case"swirl-icon-search":customElements.get(c(e))||m();break;case"swirl-option-list":customElements.get(c(e))||u();break;case"swirl-option-list-item":customElements.get(c(e))||f();break;case"swirl-popover":customElements.get(c(e))||b();break;case"swirl-popover-trigger":customElements.get(c(e))||_();break;case"swirl-spinner":customElements.get(c(e))||v();break;case"swirl-stack":customElements.get(c(e))||g();break;case"swirl-tag":customElements.get(c(e))||y();break;case"swirl-text":customElements.get(c(e))||k();break;case"swirl-visually-hidden":customElements.get(c(e))||x()}}))};export{j as SwirlSelect,z as defineCustomElement}