@umbraco-ui/uui 1.9.0-rc.1 → 1.9.0-rc.2
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/uui.min.js +1 -1
- package/dist/uui.min.js.map +1 -1
- package/package.json +4 -4
package/dist/uui.min.js
CHANGED
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
45deg,
|
|
307
307
|
var(--uui-palette-grey,#c4c4c4) 25%,
|
|
308
308
|
transparent 25%
|
|
309
|
-
),linear-gradient(45deg, transparent 75%, var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg, transparent 75%, var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg, var(--uui-palette-grey,#c4c4c4) 25%, transparent 25%);--uui-slider-background-size:10px 10px;--uui-slider-background-position:0 0,0 0,-5px -5px,5px 5px}#color-slider{position:relative;background-image:var(--uui-slider-background-image);background-size:var(--uui-slider-background-size);background-position:var(--uui-slider-background-position);border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);width:100%;height:var(--uui-slider-height)}:host([vertical]) #color-slider{width:var(--uui-slider-height);height:300px}:host([disabled]){cursor:not-allowed}:host([disabled]) #color-slider{user-select:none;pointer-events:none;opacity:.55}#color-slider__handle{position:absolute;top:calc(50% - var(--uui-slider-handle-size)/ 2);width:var(--uui-slider-handle-size);height:var(--uui-slider-handle-size);background-color:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,.25);margin-left:calc(var(--uui-slider-handle-size)/ -2);left:var(--current-value,0)}:host([vertical]) #color-slider__handle{left:unset;top:var(--current-value,100%);margin-left:-1px;margin-top:calc(var(--uui-slider-handle-size)/ -2)}::slotted(:first-child){border-radius:3px;position:absolute;top:0;left:0;width:100%;height:100%}#current-hue{border-radius:3px;position:absolute;inset:0}`],Ee([l({reflect:!0})],n.UUIColorSliderElement.prototype,"type",2),Ee([l()],n.UUIColorSliderElement.prototype,"color",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"min",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"max",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"precision",2),Ee([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"vertical",2),Ee([l()],n.UUIColorSliderElement.prototype,"value",2),Ee([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"disabled",2),n.UUIColorSliderElement=Ee([m("uui-color-slider")],n.UUIColorSliderElement);var Lc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,oi=(i,e,t,r)=>{for(var o=r>1?void 0:r?Tc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Lc(e,t,o),o};n.UUIColorSwatchElement=class extends le("label",mt(Qt(v))){constructor(){super(),this.disabled=!1,this.showLabel=!1,this.addEventListener("click",this._setAriaAttributes)}get value(){return this._value??""}set value(e){const t=this._value;this._value=e,this.requestUpdate("value",t)}get color(){return this._color}set color(e){const t=this._color;this._color=e,this.requestUpdate("color",t)}_setAriaAttributes(){this.selectable&&this.setAttribute("aria-checked",this.selected.toString())}firstUpdated(){this._setAriaAttributes()}willUpdate(e){e.has("disabled")&&this.selectable&&(this.selectable=!this.disabled,this.deselectable=!this.disabled),(e.has("selectable")||e.has("selected"))&&this._setAriaAttributes()}render(){return u`<button id="swatch" aria-label="${this.label}" aria-disabled="${this.disabled}" title="${this.label}"><div class="color-swatch color-swatch--transparent-bg"><div class="color-swatch__color" style="background-color:var(--uui-swatch-color,${this.color??this.value})"></div><div class="color-swatch__check" style="color:var(--uui-swatch-color,${this.color??this.value})">${zi}</div></div>${this._renderWithLabel()}</button>`}_renderWithLabel(){return this.showLabel?u`<div class="color-swatch__label"><strong>${this.renderLabel()}</strong> ${this.value}</div>`:k}},n.UUIColorSwatchElement.styles=[b`:host{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;transition:box-shadow .1s ease-out;flex-direction:column}*,:host(*){outline-color:var(--uui-color-focus,#3879ff);outline-offset:4px}:host(:focus-within:not([disabled])){outline:0}:host(:focus:not([disabled])) #swatch{outline-color:var(--uui-color-focus,#3879ff);outline-width:var(--uui-swatch-border-width,1px);outline-style:solid;outline-offset:var(--uui-swatch-border-width,1px)}:host([selectable]) #swatch{cursor:pointer}:host([disabled]){cursor:not-allowed;opacity:.5}#swatch{cursor:inherit;outline:0;background:0 0;border:none;padding:0;margin:0;text-align:left;border-radius:3px}:host(:not([selectable])) #swatch:focus{outline:0}:host([selectable]) #swatch::after{content:'';position:absolute;pointer-events:none;inset:calc(var(--uui-swatch-border-width,1px) * -1);width:calc(100% + calc(var(--uui-swatch-border-width,1px) * 2));height:calc(100% + calc(var(--uui-swatch-border-width,1px) * 2));box-sizing:border-box;border:var(--uui-swatch-border-width,2px) solid var(--uui-color-selected,#3544b1);border-radius:calc(var(--uui-border-radius,3px) + var(--uui-swatch-border-width,1px));transition:opacity .1s ease-out;opacity:0}:host([selectable]:not([disabled]):hover) #swatch::after{opacity:.33}:host([selectable][selected]:not([disabled]):hover) #swatch::after{opacity:.66}:host([selectable][selected]:not([disabled])) #swatch::after{opacity:1}.color-swatch{position:relative;width:var(--uui-swatch-size,25px);height:var(--uui-swatch-size,25px);border-radius:3px;display:flex;flex-direction:column;justify-content:center;align-items:center}:host([show-label]) .color-swatch{width:120px;height:50px}.color-swatch.color-swatch--transparent-bg{background-image:linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%);background-size:10px 10px;background-position:0 0,0 0,-5px -5px,5px 5px}.color-swatch__color{width:100%;height:100%;border:1px solid rgba(0,0,0,.125);border-radius:inherit;box-sizing:border-box}:host([show-label]) .color-swatch__color{border-radius:3px 3px 0 0}.color-swatch__check{position:absolute;vertical-align:middle;width:calc(var(--uui-swatch-size,25px)/ 2);height:calc(var(--uui-swatch-size,25px)/ 2);line-height:0;filter:invert(1) grayscale(1) contrast(9);pointer-events:none;opacity:0}:host([selected]) .color-swatch__check{opacity:1}.label,slot[name=label]::slotted(*){font-size:var(--uui-size-4,12px)}.color-swatch__label{max-width:120px;box-sizing:border-box;padding:var(--uui-size-space-1,3px) var(--uui-size-space-2,6px);line-height:1.5;display:flex;flex-direction:column;background:#fff;border:1px solid var(--uui-color-border,#d8d7d9);border-radius:0 0 3px 3px;font-size:var(--uui-size-4,12px)}.color-swatch__label strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}`],oi([l()],n.UUIColorSwatchElement.prototype,"value",1),oi([l()],n.UUIColorSwatchElement.prototype,"color",1),oi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchElement.prototype,"disabled",2),oi([l({type:Boolean,attribute:"show-label",reflect:!0})],n.UUIColorSwatchElement.prototype,"showLabel",2),n.UUIColorSwatchElement=oi([m("uui-color-swatch")],n.UUIColorSwatchElement);let Et=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};Et.CHANGE="change";var Mc=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,Gi=(i,e,t,r)=>{for(var o=r>1?void 0:r?Nc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Mc(e,t,o),o};n.UUIColorSwatchesElement=class extends le("label",v){constructor(){super(),this.value="",this.disabled=!1,this._onSelected=e=>{const t=e.target;this.swatches.includes(t)&&(this._selectedElement&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0),this._selectedElement=t,this._activeElement=this._selectedElement,this.value=this._selectedElement.value||"",this.dispatchEvent(new Et(Et.CHANGE)))},this._onDeselected=e=>{const t=e.target;this.swatches.includes(t)&&(this._activeElement===t&&(this._activeElement=void 0),this._selectedElement===t&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0,this.value="",this.dispatchEvent(new Et(Et.CHANGE))))},this.addEventListener(Le.SELECTED,this._onSelected),this.addEventListener(Le.DESELECTED,this._onDeselected)}get _activeElement(){return this.__activeElement}set _activeElement(e){this.__activeElement&&(this.__activeElement.active=!1),e&&(e.active=!0,this.__activeElement=e)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}willUpdate(e){e.has("label")&&this.setAttribute("aria-label",this.label)}_handleSlotChange(){!this.swatches||this.swatches.length===0||this.swatches.forEach(e=>{e.setAttribute("aria-checked","false"),e.setAttribute("role","radio"),this.disabled?e.setAttribute("disabled",""):e.setAttribute("selectable","selectable"),this.value!==""&&e.value===this.value&&(e.selected=!0,e.setAttribute("aria-checked","true"),this._selectedElement=e,this._activeElement=this._selectedElement)})}resetSelection(){this.swatches.forEach(e=>{e.selected=!1,e.active=!1,e.selectable=!e.disabled}),this._activeElement=void 0,this._selectedElement=void 0,this.value=""}render(){return u`<slot @slotchange="${this._handleSlotChange}"></slot>`}},n.UUIColorSwatchesElement.styles=[b`:host{display:flex;flex-wrap:wrap;gap:.4rem}`],Gi([l()],n.UUIColorSwatchesElement.prototype,"value",2),Gi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Gi([Oe({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"swatches",2),n.UUIColorSwatchesElement=Gi([m("uui-color-swatches")],n.UUIColorSwatchesElement);let ne=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};ne.CHANGE="change",ne.INNER_SLOT_CHANGE="inner-slot-change";var Dc=Object.defineProperty,Bc=Object.getOwnPropertyDescriptor,zs=i=>{throw TypeError(i)},Te=(i,e,t,r)=>{for(var o=r>1?void 0:r?Bc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Dc(e,t,o),o},jc=(i,e,t)=>e.has(i)||zs("Cannot "+t),Vc=(i,e,t)=>e.has(i)?zs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ls=(i,e,t)=>(jc(i,e,"access private method"),t),qi,ir;n.UUIComboboxListElement=class extends v{constructor(){super(...arguments),Vc(this,qi),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Ls(this,qi,ir).call(this),this._updateSelection(),this.dispatchEvent(new ne(ne.INNER_SLOT_CHANGE))},this._onSelected=e=>{this._selectedElement&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0),this._selectedElement=e.composedPath()[0],this.value=this._selectedElement.value||"",this.displayValue=this._selectedElement.displayValue||"",this.dispatchEvent(new ne(ne.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new ne(ne.CHANGE)))},this._moveIndex=e=>{const t=Math.min(Math.max(this._getActiveIndex+e,0),this._options.length-1);this._goToIndex(t)},this._onKeyDown=e=>{if(!(this._options.length<=0))switch(e.key){case"ArrowUp":e.preventDefault(),e.ctrlKey?this._moveIndex(-10):this._moveIndex(-1);break;case"ArrowDown":e.preventDefault(),e.ctrlKey?this._moveIndex(10):this._moveIndex(1);break;case"Home":{e.preventDefault(),this._goToIndex(0);break}case"Enter":{e.preventDefault(),this._getActiveElement?.click();break}case"End":{e.preventDefault(),this._goToIndex(this._options.length-1);break}}}}get value(){return this._value}set value(e){if(this._value===e)return;const t=this._value;this._value=e,this._updateSelection(),this.requestUpdate("value",t)}get for(){return this._for}set for(e){this._for&&this._for.removeEventListener("keydown",this._onKeyDown),this._for=e,this._for&&this._for.addEventListener("keydown",this._onKeyDown)}connectedCallback(){super.connectedCallback(),this._for||(this._for=this),this.addEventListener(Le.SELECTED,this._onSelected),this.addEventListener(Le.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(Le.SELECTED,this._onSelected),this.removeEventListener(Le.DESELECTED,this._onDeselected)}_updateSelection(){this.displayValue="";for(const e of this._options)e.value===this._value?(this.displayValue=e.displayValue||"",e.selected=!0):e.selected=!1}get _getActiveIndex(){return this._activeElementValue===null?-1:this._options.findIndex(e=>e.value===this._activeElementValue)}get _getActiveElement(){return this._activeElementValue===null?null:this._options.find(e=>e.value===this._activeElementValue)}_goToIndex(e){if(this._options.length===0)return;e=Math.min(Math.max(e,0),this._options.length-1);const t=this._options[e];this._activeElementValue=t.value,Ls(this,qi,ir).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u`<slot @slotchange="${this._onSlotChange}"></slot>`}},qi=new WeakSet,ir=function(){for(let e=0;e<this._activeOptions.length;e++)this._activeOptions[e].active=!1;const i=this._getActiveElement;i?i.active=!0:this._goToIndex(0)},n.UUIComboboxListElement.styles=[b`:host{display:flex;flex-direction:column;box-sizing:border-box}`],Te([l()],n.UUIComboboxListElement.prototype,"value",1),Te([l({type:String})],n.UUIComboboxListElement.prototype,"displayValue",2),Te([l({attribute:!1})],n.UUIComboboxListElement.prototype,"for",1),Te([Oe({flatten:!0,selector:"uui-combobox-list-option:not([disabled])"})],n.UUIComboboxListElement.prototype,"_options",2),Te([Oe({flatten:!0,selector:"uui-combobox-list-option[active]"})],n.UUIComboboxListElement.prototype,"_activeOptions",2),Te([y()],n.UUIComboboxListElement.prototype,"_value",2),Te([y()],n.UUIComboboxListElement.prototype,"_activeElementValue",2),n.UUIComboboxListElement=Te([m("uui-combobox-list")],n.UUIComboboxListElement);var Hc=Object.defineProperty,Rc=Object.getOwnPropertyDescriptor,$t=(i,e,t,r)=>{for(var o=r>1?void 0:r?Rc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Hc(e,t,o),o};n.UUIComboboxListOptionElement=class extends mt(Qt(v)){constructor(){super(),this._disabled=!1,this._displayValue="",this.selectable=!0,this.deselectable=!1}get value(){return this._value?this._value:this.textContent?.trim()||""}set value(e){const t=this._value;this._value=e,this.requestUpdate("value",t)}get displayValue(){return this._displayValue?this._displayValue:this.textContent?.trim()||""}set displayValue(e){const t=this._displayValue;this._displayValue=e,this.requestUpdate("displayValue",t)}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.selectable=!this._disabled,this.requestUpdate("disabled",t)}render(){return u`<slot></slot>`}},n.UUIComboboxListOptionElement.styles=[b`:host{position:relative;cursor:pointer;margin:0 4px;border-radius:var(--uui-border-radius,3px);outline:2px solid transparent;outline-offset:-2px;padding-left:4px}:host(:first-child){margin-top:6px}:host(:last-child){margin-bottom:6px}:host([selected]):host([active])::after{display:block;content:'';position:absolute;inset:0;outline:var(--uui-color-surface,#fff) solid 2px;outline-offset:-4px}:host(:hover){background-color:var(--uui-color-surface-emphasis,#fafafa);color:var(--uui-color-interactive-emphasis,#3544b1)}:host([disabled]){cursor:auto;color:var(--uui-color-disabled-contrast,#c4c4c4);background-color:var(--uui-color-disabled,#f3f3f5)}:host([disabled]:hover){background-color:var(--uui-color-disabled,#f3f3f5)}:host([active]){outline-color:var(--uui-color-focus,#3879ff)}:host([selected]){color:var(--uui-color-selected-contrast,#fff);background-color:var(--uui-color-selected,#3544b1)}:host([selected]:hover){color:var(--uui-color-selected-contrast,#fff);background-color:var(--uui-color-selected-emphasis,#4656c8)}:host([selected][disabled]){color:var(--uui-color-disabled-contrast,#c4c4c4);background-color:var(--uui-color-disabled,#f3f3f5)}`],$t([y()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),$t([y()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),$t([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),$t([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),$t([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=$t([m("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let X=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};X.SEARCH="search",X.CHANGE="change";var Fc=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,Ts=i=>{throw TypeError(i)},K=(i,e,t,r)=>{for(var o=r>1?void 0:r?Gc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Fc(e,t,o),o},or=(i,e,t)=>e.has(i)||Ts("Cannot "+t),x=(i,e,t)=>(or(i,e,"read from private field"),t?t.call(i):e.get(i)),V=(i,e,t)=>e.has(i)?Ts("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ms=(i,e,t,r)=>(or(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rr=(i,e,t)=>(or(i,e,"access private method"),t),se,kt,ri,ni,Wi,Ki,Xi,nr,sr,ar,lr,Yi,It,ur,Zi,Qi,cr,Ji;n.UUIComboboxElement=class extends ue(v,""){constructor(){super(...arguments),V(this,ni),this.closeLabel="Close",this.disabled=!1,this.readonly=!1,V(this,se),V(this,kt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,V(this,ri,()=>{this._isPhone=x(this,kt).matches}),V(this,Ki,()=>requestAnimationFrame(()=>this._input.focus())),V(this,Xi,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||x(this,It).call(this)})),V(this,nr,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new X(X.SEARCH)),x(this,Yi).call(this)}),V(this,sr,()=>{this.value&&this.value!==x(this,se)?.value&&rr(this,ni,Wi).call(this,this.value)}),V(this,ar,()=>{this.value=x(this,se)?.value||"",this.search=this.value?this.search:"",x(this,It).call(this),this.dispatchEvent(new X(X.CHANGE))}),V(this,lr,()=>{this.readonly||(this.open=!this.open)}),V(this,Yi,()=>{this.open||this.readonly||(this.open=!0)}),V(this,It,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new X(X.SEARCH)))}),V(this,ur,e=>{this.open===!1&&e.key==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation()),(e.key==="ArrowUp"||e.key==="ArrowDown")&&x(this,Yi).call(this),(e.key==="Escape"||e.key==="Enter")&&x(this,It).call(this)}),V(this,Zi,e=>{e.key&&e.key!=="Enter"||(e.preventDefault(),e.stopImmediatePropagation(),this.value="",this.search="",this._input.value=this._displayValue,this._input.focus(),this.dispatchEvent(new X(X.SEARCH)),this.dispatchEvent(new X(X.CHANGE)))}),V(this,Qi,()=>u`<uui-input slot="trigger" id="combobox-input" label="combobox-input" type="text" .value="${this._displayValue}" autocomplete="off" .disabled="${this.disabled}" .readonly="${this.readonly}" popovertarget="combobox-popover" @click="${x(this,lr)}" @input="${x(this,nr)}" @keydown="${x(this,ur)}"><slot name="input-prepend" slot="prepend"></slot>${x(this,cr).call(this)}<div id="expand-symbol-wrapper" slot="append"><uui-symbol-expand .open="${this._isOpen}"></uui-symbol-expand></div><slot name="input-append" slot="append"></slot></uui-input>`),V(this,cr,()=>this.disabled||this.readonly?k:this.value||this.search?u`<uui-button id="clear-button" @click="${x(this,Zi)}" @keydown="${x(this,Zi)}" label="clear" slot="append" compact="compact" style="height:100%"><uui-icon name="remove" .fallback="${Fo.strings[0]}"></uui-icon></uui-button>`:""),V(this,Ji,()=>u`<div id="dropdown"><uui-scroll-container tabindex="-1" id="scroll-container"><slot></slot></uui-scroll-container></div>`)}get value(){return super.value}set value(e){typeof e=="string"&&rr(this,ni,Wi).call(this,e),super.value=e}get search(){return this._search}set search(e){if(this.search===e)return;const t=this._search;this._search=e,this.requestUpdate("search",t)}get open(){return this._isOpen}set open(e){const t=e;this._isOpen=e;const r=this._comboboxPopoverElement;if(r)if(e){const o=this._input.offsetWidth;r.style.setProperty("--popover-width",`${o}px`),r.showPopover()}else r.hidePopover();this.requestUpdate("open",t)}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",x(this,Xi)),this.addEventListener("mousedown",x(this,Ki)),Ms(this,kt,window.matchMedia("(max-width: 600px)")),x(this,ri).call(this),x(this,kt).addEventListener("change",x(this,ri)),$(this,"uui-icon"),$(this,"uui-input"),$(this,"uui-button"),$(this,"uui-combobox-list"),$(this,"uui-scroll-container"),$(this,"uui-popover-container"),$(this,"uui-symbol-expand")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",x(this,Xi)),this.removeEventListener("mousedown",x(this,Ki)),x(this,kt).removeEventListener("change",x(this,ri))}async firstUpdated(){const e=this._comboboxListElements?.[0];e&&(Ms(this,se,e),x(this,se).for=this,x(this,se).addEventListener(ne.CHANGE,x(this,ar)),x(this,se).addEventListener(ne.INNER_SLOT_CHANGE,x(this,sr)),await this.updateComplete,rr(this,ni,Wi).call(this,this.value))}getFormElement(){return this._input}async focus(){await this.updateComplete,this._input.focus()}async blur(){await this.updateComplete,this._input.blur()}async click(){await this.updateComplete,this._input.click()}render(){return this._isPhone&&this.open?u`<div id="phone-wrapper"><uui-button label="close" look="primary" @click="${x(this,It)}">${this.closeLabel}</uui-button>${x(this,Qi).call(this)} ${x(this,Ji).call(this)}</div>`:u`${x(this,Qi).call(this)}<uui-popover-container id="combobox-popover" popover="manual" placement="bottom-end">${x(this,Ji).call(this)}</uui-popover-container>`}},se=new WeakMap,kt=new WeakMap,ri=new WeakMap,ni=new WeakSet,Wi=function(i){x(this,se)&&(x(this,se).value=i,requestAnimationFrame(()=>this._displayValue=x(this,se).displayValue||""))},Ki=new WeakMap,Xi=new WeakMap,nr=new WeakMap,sr=new WeakMap,ar=new WeakMap,lr=new WeakMap,Yi=new WeakMap,It=new WeakMap,ur=new WeakMap,Zi=new WeakMap,Qi=new WeakMap,cr=new WeakMap,Ji=new WeakMap,n.UUIComboboxElement.styles=[b`:host{display:inline-block}#combobox-input{width:100%;border-radius:var(--uui-size-1,3px)}#combobox-popover{width:var(--uui-dropdown-width,var(--popover-width,inherit))}#scroll-container{overflow-y:auto;width:100%;max-height:var(--uui-combobox-popover-max-height,500px)}#expand-symbol-wrapper{height:100%;padding-right:var(--uui-size-space-3,9px);display:flex;justify-content:center}#dropdown{overflow:hidden;z-index:-1;background-color:var(--uui-combobox-popover-background-color,var(--uui-color-surface,#fff));border:1px solid var(--uui-color-border,#d8d7d9);border-radius:var(--uui-border-radius,3px);width:100%;height:100%;box-sizing:border-box;box-shadow:var(--uui-shadow-depth-3,0 10px 20px rgba(0,0,0,.19) ,0 6px 6px rgba(0,0,0,.23))}:host([disabled]) #caret{fill:var(--uui-color-disabled-contrast,#c4c4c4)}#phone-wrapper{position:fixed;inset:0;display:flex;flex-direction:column;z-index:1;font-size:1.1em}#phone-wrapper #dropdown{display:flex}#phone-wrapper #combobox-input{height:var(--uui-size-16,48px)}#phone-wrapper>uui-button{height:var(--uui-size-14,42px);width:100%}#phone-wrapper #scroll-container{max-height:unset}`],K([l({attribute:"value",reflect:!0})],n.UUIComboboxElement.prototype,"value",1),K([l({type:String})],n.UUIComboboxElement.prototype,"search",1),K([l({type:Boolean})],n.UUIComboboxElement.prototype,"open",1),K([l({type:String})],n.UUIComboboxElement.prototype,"closeLabel",2),K([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"disabled",2),K([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"readonly",2),K([P("#combobox-input")],n.UUIComboboxElement.prototype,"_input",2),K([P("#combobox-popover")],n.UUIComboboxElement.prototype,"_comboboxPopoverElement",2),K([Oe({flatten:!0,selector:"uui-combobox-list"})],n.UUIComboboxElement.prototype,"_comboboxListElements",2),K([y()],n.UUIComboboxElement.prototype,"_displayValue",2),K([y()],n.UUIComboboxElement.prototype,"_search",2),K([y()],n.UUIComboboxElement.prototype,"_isPhone",2),K([y()],n.UUIComboboxElement.prototype,"_isOpen",2),n.UUIComboboxElement=K([m("uui-combobox")],n.UUIComboboxElement);var qc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,dr=(i,e,t,r)=>{for(var o=r>1?void 0:r?Wc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&qc(e,t,o),o};n.UUIDialogLayoutElement=class extends v{constructor(){super(...arguments),this.headline=null,this._headlineSlotHasContent=!1,this._headlineSlotChanged=e=>{this._headlineSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0}}renderHeadline(){return u`<h3 style="${this._headlineSlotHasContent||this.headline!==null?"":"display: none"}">${this.headline}<slot name="headline" @slotchange="${this._headlineSlotChanged}"></slot></h3>`}renderContent(){return u`<slot></slot>`}renderActions(){return u`<slot id="actions" name="actions"></slot>`}render(){return u`${this.renderHeadline()} ${this.renderContent()} ${this.renderActions()}`}},n.UUIDialogLayoutElement.styles=[b`:host{display:block;padding:var(--uui-size-10,30px) var(--uui-size-14,42px);color:var(--uui-color-text,#060606)}#actions{margin-top:var(--uui-size-8,24px);display:flex;justify-content:end;gap:var(--uui-size-4,12px)}`],dr([l({type:String})],n.UUIDialogLayoutElement.prototype,"headline",2),dr([y()],n.UUIDialogLayoutElement.prototype,"_headlineSlotHasContent",2),n.UUIDialogLayoutElement=dr([m("uui-dialog-layout")],n.UUIDialogLayoutElement);var Kc=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,Yc=(i,e,t,r)=>{for(var o=r>1?void 0:r?Xc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Kc(e,t,o),o};n.UUIDialogElement=class extends v{render(){return u`<slot></slot>`}},n.UUIDialogElement.styles=[b`:host{position:relative;display:block;max-width:580px;color:var(--uui-color-text,#060606);background-color:var(--uui-dialog-background-color,var(--uui-color-surface,#fff));box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22));border-radius:var(--uui-dialog-border-radius,calc(var(--uui-border-radius,3px) * 2))}`],n.UUIDialogElement=Yc([m("uui-dialog")],n.UUIDialogElement);var Zc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,Ns=(i,e,t,r)=>{for(var o=r>1?void 0:r?Qc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Zc(e,t,o),o};n.UUISymbolFileDropzoneElement=class extends v{constructor(){super(...arguments),this.error=!1}render(){return u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="upload-icon"><path d="${this.error?"M254.501 38.16c-120.308 0-217.838 97.53-217.838 217.838 0 120.31 97.53 217.838 217.838 217.838 120.31 0 217.838-97.528 217.838-217.838 0-120.308-97.528-217.838-217.838-217.838zm151.667 217.838c0 29.861-8.711 57.708-23.671 81.209L173.293 128.002c23.499-14.961 51.345-23.67 81.208-23.67 83.629.001 151.667 68.037 151.667 151.666zm-303.332 0c0-29.859 8.71-57.707 23.67-81.204l209.201 209.201c-23.498 14.96-51.346 23.671-81.206 23.671-83.632 0-151.665-68.04-151.665-151.668z":"M206.491 364.184h99.013V223.676h92.922L255.997 51.111 113.575 223.676h92.916zM85.043 398.311h341.912v62.578H85.043z"}"/></svg>`}},n.UUISymbolFileDropzoneElement.styles=[b`:host{display:flex;flex-direction:column;align-items:center;justify-content:center}#upload-icon{fill:var(--uui-color-default,#1b264f);width:100px;transition:fill .3s ease;position:relative;z-index:2}:host([error]) #upload-icon{fill:var(--uui-color-danger,#d42054)}`],Ns([l({type:Boolean,reflect:!0})],n.UUISymbolFileDropzoneElement.prototype,"error",2),n.UUISymbolFileDropzoneElement=Ns([m("uui-symbol-file-dropzone")],n.UUISymbolFileDropzoneElement);let xt=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};xt.CHANGE="change";var Jc=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,Ct=(i,e,t,r)=>{for(var o=r>1?void 0:r?ed(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Jc(e,t,o),o};n.UUIFileDropzoneElement=class extends le("",v){constructor(){super(),this._acceptedFileExtensions=[],this._acceptedMimeTypes=[],this._accept="",this.disallowFolderUpload=!1,this.multiple=!1,this.addEventListener("dragenter",this._onDragEnter,!1),this.addEventListener("dragleave",this._onDragLeave,!1),this.addEventListener("dragover",this._onDragOver,!1),this.addEventListener("drop",this._onDrop,!1)}set accept(e){if(e){const r=[],o=[];e.split(",").forEach(s=>{s=s.trim().toLowerCase(),/[a-z]+\/[a-z*]/s.test(s)?r.push(s):o.push(s.replace(/^\./,""))}),this._acceptedMimeTypes=r,this._acceptedFileExtensions=o}else this._acceptedMimeTypes=[],this._acceptedFileExtensions=[];const t=this._accept;this._accept=e,this.requestUpdate("accept",t)}get accept(){return this._accept}browse(){this._input.click()}async _getAllEntries(e){const t=[...e],r=[],o=[];for(const s of t)if(s?.kind==="file"){if(s.type){const a=s.getAsFile();if(!a)continue;this._isAccepted(a)&&o.push(a)}else if(!this.disallowFolderUpload){const a=this._getEntry(s);if(a){const c=await this._mkdir(a);r.push(c)}}}return{files:o,folders:r}}_getEntry(e){let t=null;return"webkitGetAsEntry"in e?t=e.webkitGetAsEntry():"getAsEntry"in e&&(t=e.getAsEntry()),t}async _mkdir(e){const t=e.createReader(),r=[],o=[],s=a=>new Promise((c,d)=>{a.readEntries(async h=>{if(!h.length){c();return}for(const f of h)if(f.isFile){const g=await this._getAsFile(f);this._isAccepted(g)&&o.push(g)}else if(f.isDirectory){const g=await this._mkdir(f);r.push(g)}s(a),c()},d)});return await s(t),{folderName:e.name,folders:r,files:o}}_isAccepted(e){if(this._acceptedFileExtensions.length===0&&this._acceptedMimeTypes.length===0)return!0;const t=e.type.toLowerCase(),r=e.name.split(".").pop();if(r&&this._acceptedFileExtensions.includes(r.toLowerCase()))return!0;for(const o in this._acceptedMimeTypes)if(t===o||o.endsWith("/*")&&t.startsWith(o.replace("/*","")))return!0;return!1}async _getAsFile(e){return new Promise((t,r)=>e.file(t,r))}async _onDrop(e){e.preventDefault(),this._dropzone.classList.remove("hover");const t=e.dataTransfer?.items;if(t){const r=await this._getAllEntries(t);this.multiple===!1&&r.files.length&&(r.files=[r.files[0]]),this._getAllEntries(t),this.dispatchEvent(new xt(xt.CHANGE,{detail:r}))}}_onDragOver(e){e.preventDefault()}_onDragEnter(e){this._dropzone.classList.add("hover"),e.preventDefault()}_onDragLeave(e){this._dropzone.classList.remove("hover"),e.preventDefault()}_onFileInputChange(){const e=this._input.files?Array.from(this._input.files):[];this.dispatchEvent(new xt(xt.CHANGE,{detail:{files:e}}))}render(){return u`<div id="dropzone"><uui-symbol-file-dropzone id="symbol"></uui-symbol-file-dropzone>${this.renderLabel()} <input @click="${e=>e.stopImmediatePropagation()}" id="input" type="file" accept="${this.accept}" ?multiple="${this.multiple}" @change="${this._onFileInputChange}" aria-label="${this.label}"><slot></slot></div>`}},n.UUIFileDropzoneElement.styles=[b`#dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;box-sizing:border-box;width:100%;height:100%;padding:var(--uui-size-4,12px);border:3px solid transparent;margin:-3px;backdrop-filter:blur(2px)}#dropzone.hover{border-color:var(--uui-color-default,#1b264f)}#dropzone.hover::before{content:'';position:absolute;inset:0;opacity:.2;border-color:var(--uui-color-default,#1b264f);background-color:var(--uui-color-default,#1b264f)}#symbol{color:var(--uui-color-default,#1b264f);max-width:100%;max-height:100%}#input{position:absolute;width:0;height:0;opacity:0;display:none}`],Ct([P("#input")],n.UUIFileDropzoneElement.prototype,"_input",2),Ct([P("#dropzone")],n.UUIFileDropzoneElement.prototype,"_dropzone",2),Ct([l({type:String})],n.UUIFileDropzoneElement.prototype,"accept",1),Ct([l({type:Boolean,reflect:!0,attribute:"disallow-folder-upload"})],n.UUIFileDropzoneElement.prototype,"disallowFolderUpload",2),Ct([l({type:Boolean})],n.UUIFileDropzoneElement.prototype,"multiple",2),n.UUIFileDropzoneElement=Ct([m("uui-file-dropzone")],n.UUIFileDropzoneElement);let td=class{static humanFileSize(e,t=!1,r=1){const o=t?1e3:1024;if(Math.abs(e)<o)return e+" B";const s=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let a=-1;const c=10**r;do e/=o,++a;while(Math.round(Math.abs(e)*c)/c>=o&&a<s.length-1);return e.toFixed(r)+" "+s[a]}};var id=Object.defineProperty,od=Object.getOwnPropertyDescriptor,de=(i,e,t,r)=>{for(var o=r>1?void 0:r?od(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&id(e,t,o),o};n.UUIFilePreviewElement=class extends v{constructor(){super(...arguments),this._name="",this._url="",this._extension="",this._src="",this._size=0,this._isDirectory=!1}get file(){return this._file}set file(e){const t=this._file;e instanceof File&&(this._name=e.name.split(".")[0],this._extension=e.name.split(".")[1],this._isDirectory=!1,this._size=e.size,this._isFileAnImage(e)&&(this._isImage=!0,this._getThumbnail(e).then(r=>{this._src=r})),this.requestUpdate("file",t))}connectedCallback(){super.connectedCallback(),$(this,"uui-symbol-file-thumbnail"),$(this,"uui-symbol-folder"),$(this,"uui-symbol-file")}_openSource(){window.open(this._url,"_blank")}_fileTypeTemplate(){return this._isDirectory?u`<uui-symbol-folder id="file-symbol"></uui-symbol-folder>`:this._isImage?u`<uui-symbol-file-thumbnail .src="${this._src}" .alt="${this._name}" id="file-symbol"></uui-symbol-file-thumbnail>`:u`<uui-symbol-file id="file-symbol" .type="${this._extension}"></uui-symbol-file>`}_renderLongName(){const e=this._name.substring(0,this._name.length-6),t=this._name.substring(this._name.length-6,this._name.length);return u`<span id="file-name" class="${this._url?"has-source":""}" @click="${()=>this._url?this._openSource():""}" @keydown="${()=>""}"><span id="file-name-start">${e}</span> <span id="file-name-end">${t}</span></span>`}_isFileAnImage(e){return e?e.type.split("/")[0]==="image":!1}async _getThumbnail(e){return await new Promise(t=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t(r.result)}})}render(){return u`<slot id="actions" name="actions"></slot>${this._fileTypeTemplate()}<div id="file-info">${this._renderLongName()} <span id="file-size">${this._size&&!this._isDirectory?u`${td.humanFileSize(this._size,!0)}`:""}</span></div>`}},n.UUIFilePreviewElement.styles=[b`:host{position:relative;display:grid;grid-template-rows:100px 50px;width:150px;height:150px;box-sizing:border-box;aspect-ratio:1;color:var(--uui-color-text,#060606)}:host(:hover) slot[name=actions]::slotted(*){opacity:1}slot[name=actions]::slotted(*){position:absolute;top:8px;right:8px;max-width:100%;height:32px;font-size:13px;opacity:0;z-index:1;transition:opacity 150ms}#file-symbol{aspect-ratio:1/1;margin:auto;max-width:100%;max-height:100%}#file-info{min-width:0;display:flex;text-align:center;flex-direction:column;font-size:1rem}#file-name{display:flex;justify-content:center}#file-name-start{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#file-name-end{white-space:nowrap}#file-size{opacity:.6}.has-source:hover{text-decoration:underline;cursor:pointer}`],de([y()],n.UUIFilePreviewElement.prototype,"_name",2),de([y()],n.UUIFilePreviewElement.prototype,"_url",2),de([y()],n.UUIFilePreviewElement.prototype,"_extension",2),de([y()],n.UUIFilePreviewElement.prototype,"_src",2),de([y()],n.UUIFilePreviewElement.prototype,"_size",2),de([y()],n.UUIFilePreviewElement.prototype,"_isDirectory",2),de([y()],n.UUIFilePreviewElement.prototype,"_file",2),de([y()],n.UUIFilePreviewElement.prototype,"_isImage",2),de([l({attribute:!1})],n.UUIFilePreviewElement.prototype,"file",1),n.UUIFilePreviewElement=de([m("uui-file-preview")],n.UUIFilePreviewElement);var rd=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,eo=(i,e,t,r)=>{for(var o=r>1?void 0:r?nd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&rd(e,t,o),o};n.UUIFormLayoutItemElement=class extends v{constructor(){super(...arguments),this.description=null,this._labelSlotHasContent=!1,this._labelSlotChanged=e=>{this._labelSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0},this._descriptionSlotHasContent=!1,this._descriptionSlotChanged=e=>{this._descriptionSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0}}connectedCallback(){super.connectedCallback(),$(this,"uui-form-validation-message")}render(){return u`<div id="label" style="${this._labelSlotHasContent?"":"display: none"}"><slot name="label" @slotchange="${this._labelSlotChanged}"></slot></div><div id="description" style="${this._descriptionSlotHasContent||this.description!==null?"":"display: none"}">${this.description}<slot name="description" @slotchange="${this._descriptionSlotChanged}"></slot></div><uui-form-validation-message><slot></slot><slot name="message" slot="message"></slot></uui-form-validation-message>`}},n.UUIFormLayoutItemElement.styles=[b`:host{position:relative;display:block;margin-top:var(--uui-size-space-5,18px);margin-bottom:var(--uui-size-space-5,18px)}#label{margin-top:-5px;margin-bottom:5px}#description{color:var(--uui-color-disabled-contrast,#c4c4c4);font-size:var(--uui-type-small-size,12px)}#label+#description{margin-top:-8px;min-height:8px}`],eo([l({type:String})],n.UUIFormLayoutItemElement.prototype,"description",2),eo([y()],n.UUIFormLayoutItemElement.prototype,"_labelSlotHasContent",2),eo([y()],n.UUIFormLayoutItemElement.prototype,"_descriptionSlotHasContent",2),n.UUIFormLayoutItemElement=eo([m("uui-form-layout-item")],n.UUIFormLayoutItemElement);/**
|
|
309
|
+
),linear-gradient(45deg, transparent 75%, var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg, transparent 75%, var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg, var(--uui-palette-grey,#c4c4c4) 25%, transparent 25%);--uui-slider-background-size:10px 10px;--uui-slider-background-position:0 0,0 0,-5px -5px,5px 5px}#color-slider{position:relative;background-image:var(--uui-slider-background-image);background-size:var(--uui-slider-background-size);background-position:var(--uui-slider-background-position);border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);width:100%;height:var(--uui-slider-height)}:host([vertical]) #color-slider{width:var(--uui-slider-height);height:300px}:host([disabled]){cursor:not-allowed}:host([disabled]) #color-slider{user-select:none;pointer-events:none;opacity:.55}#color-slider__handle{position:absolute;top:calc(50% - var(--uui-slider-handle-size)/ 2);width:var(--uui-slider-handle-size);height:var(--uui-slider-handle-size);background-color:#fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,.25);margin-left:calc(var(--uui-slider-handle-size)/ -2);left:var(--current-value,0)}:host([vertical]) #color-slider__handle{left:unset;top:var(--current-value,100%);margin-left:-1px;margin-top:calc(var(--uui-slider-handle-size)/ -2)}::slotted(:first-child){border-radius:3px;position:absolute;top:0;left:0;width:100%;height:100%}#current-hue{border-radius:3px;position:absolute;inset:0}`],Ee([l({reflect:!0})],n.UUIColorSliderElement.prototype,"type",2),Ee([l()],n.UUIColorSliderElement.prototype,"color",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"min",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"max",2),Ee([l({type:Number})],n.UUIColorSliderElement.prototype,"precision",2),Ee([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"vertical",2),Ee([l()],n.UUIColorSliderElement.prototype,"value",2),Ee([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"disabled",2),n.UUIColorSliderElement=Ee([m("uui-color-slider")],n.UUIColorSliderElement);var Lc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,oi=(i,e,t,r)=>{for(var o=r>1?void 0:r?Tc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Lc(e,t,o),o};n.UUIColorSwatchElement=class extends le("label",mt(Qt(v))){constructor(){super(),this.disabled=!1,this.showLabel=!1,this.addEventListener("click",this._setAriaAttributes)}get value(){return this._value??""}set value(e){const t=this._value;this._value=e,this.requestUpdate("value",t)}get color(){return this._color}set color(e){const t=this._color;this._color=e,this.requestUpdate("color",t)}_setAriaAttributes(){this.selectable&&this.setAttribute("aria-checked",this.selected.toString())}firstUpdated(){this._setAriaAttributes()}willUpdate(e){e.has("disabled")&&this.selectable&&(this.selectable=!this.disabled,this.deselectable=!this.disabled),(e.has("selectable")||e.has("selected"))&&this._setAriaAttributes()}render(){return u`<button id="swatch" aria-label="${this.label}" aria-disabled="${this.disabled}" title="${this.label}"><div class="color-swatch color-swatch--transparent-bg"><div class="color-swatch__color" style="background-color:var(--uui-swatch-color,${this.color??this.value})"></div><div class="color-swatch__check" style="color:var(--uui-swatch-color,${this.color??this.value})">${zi}</div></div>${this._renderWithLabel()}</button>`}_renderWithLabel(){return this.showLabel?u`<div class="color-swatch__label"><strong>${this.renderLabel()}</strong> ${this.value}</div>`:k}},n.UUIColorSwatchElement.styles=[b`:host{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;transition:box-shadow .1s ease-out;flex-direction:column}*,:host(*){outline-color:var(--uui-color-focus,#3879ff);outline-offset:4px}:host(:focus-within:not([disabled])){outline:0}:host(:focus:not([disabled])) #swatch{outline-color:var(--uui-color-focus,#3879ff);outline-width:var(--uui-swatch-border-width,1px);outline-style:solid;outline-offset:var(--uui-swatch-border-width,1px)}:host([selectable]) #swatch{cursor:pointer}:host([disabled]){cursor:not-allowed;opacity:.5}#swatch{cursor:inherit;outline:0;background:0 0;border:none;padding:0;margin:0;text-align:left;border-radius:3px}:host(:not([selectable])) #swatch:focus{outline:0}:host([selectable]) #swatch::after{content:'';position:absolute;pointer-events:none;inset:calc(var(--uui-swatch-border-width,1px) * -1);width:calc(100% + calc(var(--uui-swatch-border-width,1px) * 2));height:calc(100% + calc(var(--uui-swatch-border-width,1px) * 2));box-sizing:border-box;border:var(--uui-swatch-border-width,2px) solid var(--uui-color-selected,#3544b1);border-radius:calc(var(--uui-border-radius,3px) + var(--uui-swatch-border-width,1px));transition:opacity .1s ease-out;opacity:0}:host([selectable]:not([disabled]):hover) #swatch::after{opacity:.33}:host([selectable][selected]:not([disabled]):hover) #swatch::after{opacity:.66}:host([selectable][selected]:not([disabled])) #swatch::after{opacity:1}.color-swatch{position:relative;width:var(--uui-swatch-size,25px);height:var(--uui-swatch-size,25px);border-radius:3px;display:flex;flex-direction:column;justify-content:center;align-items:center}:host([show-label]) .color-swatch{width:120px;height:50px}.color-swatch.color-swatch--transparent-bg{background-image:linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%);background-size:10px 10px;background-position:0 0,0 0,-5px -5px,5px 5px}.color-swatch__color{width:100%;height:100%;border:1px solid rgba(0,0,0,.125);border-radius:inherit;box-sizing:border-box}:host([show-label]) .color-swatch__color{border-radius:3px 3px 0 0}.color-swatch__check{position:absolute;vertical-align:middle;width:calc(var(--uui-swatch-size,25px)/ 2);height:calc(var(--uui-swatch-size,25px)/ 2);line-height:0;filter:invert(1) grayscale(1) contrast(9);pointer-events:none;opacity:0}:host([selected]) .color-swatch__check{opacity:1}.label,slot[name=label]::slotted(*){font-size:var(--uui-size-4,12px)}.color-swatch__label{max-width:120px;box-sizing:border-box;padding:var(--uui-size-space-1,3px) var(--uui-size-space-2,6px);line-height:1.5;display:flex;flex-direction:column;background:#fff;border:1px solid var(--uui-color-border,#d8d7d9);border-radius:0 0 3px 3px;font-size:var(--uui-size-4,12px)}.color-swatch__label strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}`],oi([l()],n.UUIColorSwatchElement.prototype,"value",1),oi([l()],n.UUIColorSwatchElement.prototype,"color",1),oi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchElement.prototype,"disabled",2),oi([l({type:Boolean,attribute:"show-label",reflect:!0})],n.UUIColorSwatchElement.prototype,"showLabel",2),n.UUIColorSwatchElement=oi([m("uui-color-swatch")],n.UUIColorSwatchElement);let Et=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};Et.CHANGE="change";var Mc=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,Gi=(i,e,t,r)=>{for(var o=r>1?void 0:r?Nc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Mc(e,t,o),o};n.UUIColorSwatchesElement=class extends le("label",v){constructor(){super(),this.value="",this.disabled=!1,this._onSelected=e=>{const t=e.target;this.swatches.includes(t)&&(this._selectedElement&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0),this._selectedElement=t,this._activeElement=this._selectedElement,this.value=this._selectedElement.value||"",this.dispatchEvent(new Et(Et.CHANGE)))},this._onDeselected=e=>{const t=e.target;this.swatches.includes(t)&&(this._activeElement===t&&(this._activeElement=void 0),this._selectedElement===t&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0,this.value="",this.dispatchEvent(new Et(Et.CHANGE))))},this.addEventListener(Le.SELECTED,this._onSelected),this.addEventListener(Le.DESELECTED,this._onDeselected)}get _activeElement(){return this.__activeElement}set _activeElement(e){this.__activeElement&&(this.__activeElement.active=!1),e&&(e.active=!0,this.__activeElement=e)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","radiogroup"),this.setAttribute("aria-label",this.label)}willUpdate(e){e.has("label")&&this.setAttribute("aria-label",this.label)}_handleSlotChange(){!this.swatches||this.swatches.length===0||this.swatches.forEach(e=>{e.setAttribute("aria-checked","false"),e.setAttribute("role","radio"),this.disabled?e.setAttribute("disabled",""):e.setAttribute("selectable","selectable"),this.value!==""&&e.value===this.value&&(e.selected=!0,e.setAttribute("aria-checked","true"),this._selectedElement=e,this._activeElement=this._selectedElement)})}resetSelection(){this.swatches.forEach(e=>{e.selected=!1,e.active=!1,e.selectable=!e.disabled}),this._activeElement=void 0,this._selectedElement=void 0,this.value=""}render(){return u`<slot @slotchange="${this._handleSlotChange}"></slot>`}},n.UUIColorSwatchesElement.styles=[b`:host{display:flex;flex-wrap:wrap;gap:.4rem}`],Gi([l()],n.UUIColorSwatchesElement.prototype,"value",2),Gi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Gi([Oe({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"swatches",2),n.UUIColorSwatchesElement=Gi([m("uui-color-swatches")],n.UUIColorSwatchesElement);let ne=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};ne.CHANGE="change",ne.INNER_SLOT_CHANGE="inner-slot-change";var Dc=Object.defineProperty,Bc=Object.getOwnPropertyDescriptor,zs=i=>{throw TypeError(i)},Te=(i,e,t,r)=>{for(var o=r>1?void 0:r?Bc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Dc(e,t,o),o},jc=(i,e,t)=>e.has(i)||zs("Cannot "+t),Vc=(i,e,t)=>e.has(i)?zs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ls=(i,e,t)=>(jc(i,e,"access private method"),t),qi,ir;n.UUIComboboxListElement=class extends v{constructor(){super(...arguments),Vc(this,qi),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Ls(this,qi,ir).call(this),this._updateSelection(),this.dispatchEvent(new ne(ne.INNER_SLOT_CHANGE))},this._onSelected=e=>{this._selectedElement&&(this._selectedElement.selected=!1,this._selectedElement.active=!1,this._selectedElement=void 0),this._selectedElement=e.composedPath()[0],this.value=this._selectedElement.value||"",this.displayValue=this._selectedElement.displayValue||"",this.dispatchEvent(new ne(ne.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new ne(ne.CHANGE)))},this._moveIndex=e=>{const t=Math.min(Math.max(this._getActiveIndex+e,0),this._options.length-1);this._goToIndex(t)},this._onKeyDown=e=>{if(!(this._options.length<=0))switch(e.key){case"ArrowUp":e.preventDefault(),e.ctrlKey?this._moveIndex(-10):this._moveIndex(-1);break;case"ArrowDown":e.preventDefault(),e.ctrlKey?this._moveIndex(10):this._moveIndex(1);break;case"Home":{e.preventDefault(),this._goToIndex(0);break}case"Enter":{e.preventDefault(),this._getActiveElement?.click();break}case"End":{e.preventDefault(),this._goToIndex(this._options.length-1);break}}}}get value(){return this._value}set value(e){if(this._value===e)return;const t=this._value;this._value=e,this._updateSelection(),this.requestUpdate("value",t)}get for(){return this._for}set for(e){this._for&&this._for.removeEventListener("keydown",this._onKeyDown),this._for=e,this._for&&this._for.addEventListener("keydown",this._onKeyDown)}connectedCallback(){super.connectedCallback(),this._for||(this._for=this),this.addEventListener(Le.SELECTED,this._onSelected),this.addEventListener(Le.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(Le.SELECTED,this._onSelected),this.removeEventListener(Le.DESELECTED,this._onDeselected)}_updateSelection(){this.displayValue="";for(const e of this._options)e.value===this._value?(this.displayValue=e.displayValue||"",e.selected=!0):e.selected=!1}get _getActiveIndex(){return this._activeElementValue===null?-1:this._options.findIndex(e=>e.value===this._activeElementValue)}get _getActiveElement(){return this._activeElementValue===null?null:this._options.find(e=>e.value===this._activeElementValue)}_goToIndex(e){if(this._options.length===0)return;e=Math.min(Math.max(e,0),this._options.length-1);const t=this._options[e];this._activeElementValue=t.value,Ls(this,qi,ir).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u`<slot @slotchange="${this._onSlotChange}"></slot>`}},qi=new WeakSet,ir=function(){for(let e=0;e<this._activeOptions.length;e++)this._activeOptions[e].active=!1;const i=this._getActiveElement;i?i.active=!0:this._goToIndex(0)},n.UUIComboboxListElement.styles=[b`:host{display:flex;flex-direction:column;box-sizing:border-box}`],Te([l()],n.UUIComboboxListElement.prototype,"value",1),Te([l({type:String})],n.UUIComboboxListElement.prototype,"displayValue",2),Te([l({attribute:!1})],n.UUIComboboxListElement.prototype,"for",1),Te([Oe({flatten:!0,selector:"uui-combobox-list-option:not([disabled])"})],n.UUIComboboxListElement.prototype,"_options",2),Te([Oe({flatten:!0,selector:"uui-combobox-list-option[active]"})],n.UUIComboboxListElement.prototype,"_activeOptions",2),Te([y()],n.UUIComboboxListElement.prototype,"_value",2),Te([y()],n.UUIComboboxListElement.prototype,"_activeElementValue",2),n.UUIComboboxListElement=Te([m("uui-combobox-list")],n.UUIComboboxListElement);var Hc=Object.defineProperty,Rc=Object.getOwnPropertyDescriptor,$t=(i,e,t,r)=>{for(var o=r>1?void 0:r?Rc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Hc(e,t,o),o};n.UUIComboboxListOptionElement=class extends mt(Qt(v)){constructor(){super(),this._disabled=!1,this._displayValue="",this.selectable=!0,this.deselectable=!1}get value(){return this._value?this._value:this.textContent?.trim()||""}set value(e){const t=this._value;this._value=e,this.requestUpdate("value",t)}get displayValue(){return this._displayValue?this._displayValue:this.textContent?.trim()||""}set displayValue(e){const t=this._displayValue;this._displayValue=e,this.requestUpdate("displayValue",t)}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.selectable=!this._disabled,this.requestUpdate("disabled",t)}render(){return u`<slot></slot>`}},n.UUIComboboxListOptionElement.styles=[b`:host{position:relative;cursor:pointer;margin:0 4px;border-radius:var(--uui-border-radius,3px);outline:2px solid transparent;outline-offset:-2px;padding-left:4px}:host(:first-child){margin-top:6px}:host(:last-child){margin-bottom:6px}:host([selected]):host([active])::after{display:block;content:'';position:absolute;inset:0;outline:var(--uui-color-surface,#fff) solid 2px;outline-offset:-4px}:host(:hover){background-color:var(--uui-color-surface-emphasis,#fafafa);color:var(--uui-color-interactive-emphasis,#3544b1)}:host([disabled]){cursor:auto;color:var(--uui-color-disabled-contrast,#c4c4c4);background-color:var(--uui-color-disabled,#f3f3f5)}:host([disabled]:hover){background-color:var(--uui-color-disabled,#f3f3f5)}:host([active]){outline-color:var(--uui-color-focus,#3879ff)}:host([selected]){color:var(--uui-color-selected-contrast,#fff);background-color:var(--uui-color-selected,#3544b1)}:host([selected]:hover){color:var(--uui-color-selected-contrast,#fff);background-color:var(--uui-color-selected-emphasis,#4656c8)}:host([selected][disabled]){color:var(--uui-color-disabled-contrast,#c4c4c4);background-color:var(--uui-color-disabled,#f3f3f5)}`],$t([y()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),$t([y()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),$t([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),$t([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),$t([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=$t([m("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let X=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};X.SEARCH="search",X.CHANGE="change";var Fc=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,Ts=i=>{throw TypeError(i)},K=(i,e,t,r)=>{for(var o=r>1?void 0:r?Gc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Fc(e,t,o),o},or=(i,e,t)=>e.has(i)||Ts("Cannot "+t),x=(i,e,t)=>(or(i,e,"read from private field"),t?t.call(i):e.get(i)),V=(i,e,t)=>e.has(i)?Ts("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Ms=(i,e,t,r)=>(or(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),rr=(i,e,t)=>(or(i,e,"access private method"),t),se,kt,ri,ni,Wi,Ki,Xi,nr,sr,ar,lr,Yi,It,ur,Zi,Qi,cr,Ji;n.UUIComboboxElement=class extends ue(v,""){constructor(){super(...arguments),V(this,ni),this.closeLabel="Close",this.disabled=!1,this.readonly=!1,V(this,se),V(this,kt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,V(this,ri,()=>{this._isPhone=x(this,kt).matches}),V(this,Ki,()=>requestAnimationFrame(()=>this._input.focus())),V(this,Xi,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||x(this,It).call(this)})),V(this,nr,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new X(X.SEARCH)),x(this,Yi).call(this)}),V(this,sr,()=>{this.value&&this.value!==x(this,se)?.value&&rr(this,ni,Wi).call(this,this.value)}),V(this,ar,()=>{this.value=x(this,se)?.value||"",this.search=this.value?this.search:"",x(this,It).call(this),this.dispatchEvent(new X(X.CHANGE))}),V(this,lr,()=>{this.readonly||(this.open=!this.open)}),V(this,Yi,()=>{this.open||this.readonly||(this.open=!0)}),V(this,It,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new X(X.SEARCH)))}),V(this,ur,e=>{this.open===!1&&e.key==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation()),(e.key==="ArrowUp"||e.key==="ArrowDown")&&x(this,Yi).call(this),(e.key==="Escape"||e.key==="Enter")&&x(this,It).call(this)}),V(this,Zi,e=>{e.key&&e.key!=="Enter"||(e.preventDefault(),e.stopImmediatePropagation(),this.value="",this.search="",this._input.value=this._displayValue,this._input.focus(),this.dispatchEvent(new X(X.SEARCH)),this.dispatchEvent(new X(X.CHANGE)))}),V(this,Qi,()=>u`<uui-input slot="trigger" id="combobox-input" label="combobox-input" type="text" .value="${this._displayValue}" autocomplete="off" .disabled="${this.disabled}" .readonly="${this.readonly}" popovertarget="combobox-popover" @click="${x(this,lr)}" @input="${x(this,nr)}" @keydown="${x(this,ur)}"><slot name="input-prepend" slot="prepend"></slot>${x(this,cr).call(this)}<div id="expand-symbol-wrapper" slot="append"><uui-symbol-expand .open="${this._isOpen}"></uui-symbol-expand></div><slot name="input-append" slot="append"></slot></uui-input>`),V(this,cr,()=>this.disabled||this.readonly?k:this.value||this.search?u`<uui-button id="clear-button" @click="${x(this,Zi)}" @keydown="${x(this,Zi)}" label="clear" slot="append" compact="compact" style="height:100%"><uui-icon name="remove" .fallback="${Fo.strings[0]}"></uui-icon></uui-button>`:""),V(this,Ji,()=>u`<div id="dropdown"><uui-scroll-container tabindex="-1" id="scroll-container"><slot></slot></uui-scroll-container></div>`)}get value(){return super.value}set value(e){typeof e=="string"&&rr(this,ni,Wi).call(this,e),super.value=e}get search(){return this._search}set search(e){if(this.search===e)return;const t=this._search;this._search=e,this.requestUpdate("search",t)}get open(){return this._isOpen}set open(e){const t=e;this._isOpen=e;const r=this._comboboxPopoverElement;if(r)if(e){const o=this._input.offsetWidth;r.style.setProperty("--popover-width",`${o}px`),r.showPopover()}else r.hidePopover();this.requestUpdate("open",t)}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",x(this,Xi)),this.addEventListener("mousedown",x(this,Ki)),Ms(this,kt,window.matchMedia("(max-width: 600px)")),x(this,ri).call(this),x(this,kt).addEventListener("change",x(this,ri)),$(this,"uui-icon"),$(this,"uui-input"),$(this,"uui-button"),$(this,"uui-combobox-list"),$(this,"uui-scroll-container"),$(this,"uui-popover-container"),$(this,"uui-symbol-expand")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",x(this,Xi)),this.removeEventListener("mousedown",x(this,Ki)),x(this,kt).removeEventListener("change",x(this,ri))}async firstUpdated(){const e=this._comboboxListElements?.[0];e&&(Ms(this,se,e),x(this,se).for=this,x(this,se).addEventListener(ne.CHANGE,x(this,ar)),x(this,se).addEventListener(ne.INNER_SLOT_CHANGE,x(this,sr)),await this.updateComplete,rr(this,ni,Wi).call(this,this.value))}getFormElement(){return this._input}async focus(){await this.updateComplete,this._input.focus()}async blur(){await this.updateComplete,this._input.blur()}async click(){await this.updateComplete,this._input.click()}render(){return this._isPhone&&this.open?u`<div id="phone-wrapper"><uui-button label="close" look="primary" @click="${x(this,It)}">${this.closeLabel}</uui-button>${x(this,Qi).call(this)} ${x(this,Ji).call(this)}</div>`:u`${x(this,Qi).call(this)}<uui-popover-container id="combobox-popover" popover="manual" placement="bottom-end">${x(this,Ji).call(this)}</uui-popover-container>`}},se=new WeakMap,kt=new WeakMap,ri=new WeakMap,ni=new WeakSet,Wi=function(i){x(this,se)&&(x(this,se).value=i,requestAnimationFrame(()=>this._displayValue=x(this,se).displayValue||""))},Ki=new WeakMap,Xi=new WeakMap,nr=new WeakMap,sr=new WeakMap,ar=new WeakMap,lr=new WeakMap,Yi=new WeakMap,It=new WeakMap,ur=new WeakMap,Zi=new WeakMap,Qi=new WeakMap,cr=new WeakMap,Ji=new WeakMap,n.UUIComboboxElement.styles=[b`:host{display:inline-block}#combobox-input{width:100%;border-radius:var(--uui-size-1,3px)}#combobox-popover{width:var(--uui-dropdown-width,var(--popover-width,inherit))}#scroll-container{overflow-y:auto;width:100%;max-height:var(--uui-combobox-popover-max-height,500px)}#expand-symbol-wrapper{height:100%;padding-right:var(--uui-size-space-3,9px);display:flex;justify-content:center}#dropdown{overflow:hidden;z-index:-1;background-color:var(--uui-combobox-popover-background-color,var(--uui-color-surface,#fff));border:1px solid var(--uui-color-border,#d8d7d9);border-radius:var(--uui-border-radius,3px);width:100%;height:100%;box-sizing:border-box;box-shadow:var(--uui-shadow-depth-3,0 10px 20px rgba(0,0,0,.19) ,0 6px 6px rgba(0,0,0,.23))}:host([disabled]) #caret{fill:var(--uui-color-disabled-contrast,#c4c4c4)}#phone-wrapper{position:fixed;inset:0;display:flex;flex-direction:column;z-index:1;font-size:1.1em}#phone-wrapper #dropdown{display:flex}#phone-wrapper #combobox-input{height:var(--uui-size-16,48px)}#phone-wrapper>uui-button{height:var(--uui-size-14,42px);width:100%}#phone-wrapper #scroll-container{max-height:unset}`],K([l({attribute:"value",reflect:!0})],n.UUIComboboxElement.prototype,"value",1),K([l({type:String})],n.UUIComboboxElement.prototype,"search",1),K([l({type:Boolean})],n.UUIComboboxElement.prototype,"open",1),K([l({type:String})],n.UUIComboboxElement.prototype,"closeLabel",2),K([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"disabled",2),K([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"readonly",2),K([P("#combobox-input")],n.UUIComboboxElement.prototype,"_input",2),K([P("#combobox-popover")],n.UUIComboboxElement.prototype,"_comboboxPopoverElement",2),K([Oe({flatten:!0,selector:"uui-combobox-list"})],n.UUIComboboxElement.prototype,"_comboboxListElements",2),K([y()],n.UUIComboboxElement.prototype,"_displayValue",2),K([y()],n.UUIComboboxElement.prototype,"_search",2),K([y()],n.UUIComboboxElement.prototype,"_isPhone",2),K([y()],n.UUIComboboxElement.prototype,"_isOpen",2),n.UUIComboboxElement=K([m("uui-combobox")],n.UUIComboboxElement);var qc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,dr=(i,e,t,r)=>{for(var o=r>1?void 0:r?Wc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&qc(e,t,o),o};n.UUIDialogLayoutElement=class extends v{constructor(){super(...arguments),this.headline=null,this._headlineSlotHasContent=!1,this._headlineSlotChanged=e=>{this._headlineSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0}}renderHeadline(){return u`<h3 style="${this._headlineSlotHasContent||this.headline!==null?"":"display: none"}">${this.headline}<slot name="headline" @slotchange="${this._headlineSlotChanged}"></slot></h3>`}renderContent(){return u`<slot></slot>`}renderActions(){return u`<slot id="actions" name="actions"></slot>`}render(){return u`${this.renderHeadline()} ${this.renderContent()} ${this.renderActions()}`}},n.UUIDialogLayoutElement.styles=[b`:host{display:block;padding:var(--uui-size-10,30px) var(--uui-size-14,42px);color:var(--uui-color-text,#060606)}#actions{margin-top:var(--uui-size-8,24px);display:flex;justify-content:end;gap:var(--uui-size-4,12px)}`],dr([l({type:String})],n.UUIDialogLayoutElement.prototype,"headline",2),dr([y()],n.UUIDialogLayoutElement.prototype,"_headlineSlotHasContent",2),n.UUIDialogLayoutElement=dr([m("uui-dialog-layout")],n.UUIDialogLayoutElement);var Kc=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,Yc=(i,e,t,r)=>{for(var o=r>1?void 0:r?Xc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Kc(e,t,o),o};n.UUIDialogElement=class extends v{render(){return u`<slot></slot>`}},n.UUIDialogElement.styles=[b`:host{position:relative;display:block;max-width:580px;color:var(--uui-color-text,#060606);background-color:var(--uui-dialog-background-color,var(--uui-color-surface,#fff));box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22));border-radius:var(--uui-dialog-border-radius,calc(var(--uui-border-radius,3px) * 2))}`],n.UUIDialogElement=Yc([m("uui-dialog")],n.UUIDialogElement);var Zc=Object.defineProperty,Qc=Object.getOwnPropertyDescriptor,Ns=(i,e,t,r)=>{for(var o=r>1?void 0:r?Qc(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Zc(e,t,o),o};n.UUISymbolFileDropzoneElement=class extends v{constructor(){super(...arguments),this.error=!1}render(){return u`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="upload-icon"><path d="${this.error?"M254.501 38.16c-120.308 0-217.838 97.53-217.838 217.838 0 120.31 97.53 217.838 217.838 217.838 120.31 0 217.838-97.528 217.838-217.838 0-120.308-97.528-217.838-217.838-217.838zm151.667 217.838c0 29.861-8.711 57.708-23.671 81.209L173.293 128.002c23.499-14.961 51.345-23.67 81.208-23.67 83.629.001 151.667 68.037 151.667 151.666zm-303.332 0c0-29.859 8.71-57.707 23.67-81.204l209.201 209.201c-23.498 14.96-51.346 23.671-81.206 23.671-83.632 0-151.665-68.04-151.665-151.668z":"M206.491 364.184h99.013V223.676h92.922L255.997 51.111 113.575 223.676h92.916zM85.043 398.311h341.912v62.578H85.043z"}"/></svg>`}},n.UUISymbolFileDropzoneElement.styles=[b`:host{display:flex;flex-direction:column;align-items:center;justify-content:center}#upload-icon{fill:var(--uui-color-default,#1b264f);width:100px;transition:fill .3s ease;position:relative;z-index:2}:host([error]) #upload-icon{fill:var(--uui-color-danger,#d42054)}`],Ns([l({type:Boolean,reflect:!0})],n.UUISymbolFileDropzoneElement.prototype,"error",2),n.UUISymbolFileDropzoneElement=Ns([m("uui-symbol-file-dropzone")],n.UUISymbolFileDropzoneElement);let xt=class extends A{constructor(e,t={}){super(e,{bubbles:!0,...t})}};xt.CHANGE="change";var Jc=Object.defineProperty,ed=Object.getOwnPropertyDescriptor,Ct=(i,e,t,r)=>{for(var o=r>1?void 0:r?ed(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Jc(e,t,o),o};n.UUIFileDropzoneElement=class extends le("",v){constructor(){super(),this._acceptedFileExtensions=[],this._acceptedMimeTypes=[],this._accept="",this.disallowFolderUpload=!1,this.multiple=!1,this.addEventListener("dragenter",this._onDragEnter,!1),this.addEventListener("dragleave",this._onDragLeave,!1),this.addEventListener("dragover",this._onDragOver,!1),this.addEventListener("drop",this._onDrop,!1)}set accept(e){if(e){const r=[],o=[];e.split(",").forEach(s=>{s=s.trim().toLowerCase(),/[a-z]+\/[a-z*]/s.test(s)?r.push(s):o.push(s.replace(/^\./,""))}),this._acceptedMimeTypes=r,this._acceptedFileExtensions=o}else this._acceptedMimeTypes=[],this._acceptedFileExtensions=[];const t=this._accept;this._accept=e,this.requestUpdate("accept",t)}get accept(){return this._accept}browse(){this._input.click()}async _getAllEntries(e){const t=[...e],r=[],o=[];for(const s of t)if(s?.kind==="file"){if(s.type){const a=s.getAsFile();if(!a)continue;this._isAccepted(a)&&o.push(a)}else if(!this.disallowFolderUpload&&this.multiple){const a=this._getEntry(s);if(a){const c=await this._mkdir(a);r.push(c)}}}return{files:o,folders:r}}_getEntry(e){let t=null;return"webkitGetAsEntry"in e?t=e.webkitGetAsEntry():"getAsEntry"in e&&(t=e.getAsEntry()),t}async _mkdir(e){const t=e.createReader(),r=[],o=[],s=a=>new Promise((c,d)=>{a.readEntries(async h=>{if(!h.length){c();return}for(const f of h)if(f.isFile){const g=await this._getAsFile(f);this._isAccepted(g)&&o.push(g)}else if(f.isDirectory){const g=await this._mkdir(f);r.push(g)}await s(a),c()},d)});return await s(t),{folderName:e.name,folders:r,files:o}}_isAccepted(e){if(this._acceptedFileExtensions.length===0&&this._acceptedMimeTypes.length===0)return!0;const t=e.type.toLowerCase(),r=e.name.split(".").pop();if(r&&this._acceptedFileExtensions.includes(r.toLowerCase()))return!0;for(const o of this._acceptedMimeTypes)if(t===o||o.endsWith("/*")&&t.startsWith(o.replace("*","")))return!0;return!1}async _getAsFile(e){return new Promise((t,r)=>e.file(t,r))}async _onDrop(e){e.preventDefault(),this._dropzone.classList.remove("hover");const t=e.dataTransfer?.items;if(t){const r=await this._getAllEntries(t);if(this.multiple===!1&&r.files.length&&(r.files=[r.files[0]],r.folders=[]),!r.files.length&&!r.folders.length)return;this.dispatchEvent(new xt(xt.CHANGE,{detail:r}))}}_onDragOver(e){e.preventDefault()}_onDragEnter(e){this._dropzone.classList.add("hover"),e.preventDefault()}_onDragLeave(e){this._dropzone.classList.remove("hover"),e.preventDefault()}_onFileInputChange(){const e=this._input.files?Array.from(this._input.files):[];this.multiple===!1&&e.length>1&&e.splice(1,e.length-1);const t=e.filter(r=>this._isAccepted(r));t.length&&this.dispatchEvent(new xt(xt.CHANGE,{detail:{files:t,folders:[]}}))}render(){return u`<div id="dropzone"><uui-symbol-file-dropzone id="symbol"></uui-symbol-file-dropzone>${this.renderLabel()} <input @click="${e=>e.stopImmediatePropagation()}" id="input" type="file" accept="${this.accept}" ?multiple="${this.multiple}" @change="${this._onFileInputChange}" aria-label="${this.label}"><slot></slot></div>`}},n.UUIFileDropzoneElement.styles=[b`#dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;box-sizing:border-box;width:100%;height:100%;padding:var(--uui-size-4,12px);border:3px solid transparent;margin:-3px;backdrop-filter:blur(2px)}#dropzone.hover{border-color:var(--uui-color-default,#1b264f)}#dropzone.hover::before{content:'';position:absolute;inset:0;opacity:.2;border-color:var(--uui-color-default,#1b264f);background-color:var(--uui-color-default,#1b264f)}#symbol{color:var(--uui-color-default,#1b264f);max-width:100%;max-height:100%}#input{position:absolute;width:0;height:0;opacity:0;display:none}`],Ct([P("#input")],n.UUIFileDropzoneElement.prototype,"_input",2),Ct([P("#dropzone")],n.UUIFileDropzoneElement.prototype,"_dropzone",2),Ct([l({type:String})],n.UUIFileDropzoneElement.prototype,"accept",1),Ct([l({type:Boolean,reflect:!0,attribute:"disallow-folder-upload"})],n.UUIFileDropzoneElement.prototype,"disallowFolderUpload",2),Ct([l({type:Boolean})],n.UUIFileDropzoneElement.prototype,"multiple",2),n.UUIFileDropzoneElement=Ct([m("uui-file-dropzone")],n.UUIFileDropzoneElement);let td=class{static humanFileSize(e,t=!1,r=1){const o=t?1e3:1024;if(Math.abs(e)<o)return e+" B";const s=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let a=-1;const c=10**r;do e/=o,++a;while(Math.round(Math.abs(e)*c)/c>=o&&a<s.length-1);return e.toFixed(r)+" "+s[a]}};var id=Object.defineProperty,od=Object.getOwnPropertyDescriptor,de=(i,e,t,r)=>{for(var o=r>1?void 0:r?od(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&id(e,t,o),o};n.UUIFilePreviewElement=class extends v{constructor(){super(...arguments),this._name="",this._url="",this._extension="",this._src="",this._size=0,this._isDirectory=!1}get file(){return this._file}set file(e){const t=this._file;e instanceof File&&(this._name=e.name.split(".")[0],this._extension=e.name.split(".")[1],this._isDirectory=!1,this._size=e.size,this._isFileAnImage(e)&&(this._isImage=!0,this._getThumbnail(e).then(r=>{this._src=r})),this.requestUpdate("file",t))}connectedCallback(){super.connectedCallback(),$(this,"uui-symbol-file-thumbnail"),$(this,"uui-symbol-folder"),$(this,"uui-symbol-file")}_openSource(){window.open(this._url,"_blank")}_fileTypeTemplate(){return this._isDirectory?u`<uui-symbol-folder id="file-symbol"></uui-symbol-folder>`:this._isImage?u`<uui-symbol-file-thumbnail .src="${this._src}" .alt="${this._name}" id="file-symbol"></uui-symbol-file-thumbnail>`:u`<uui-symbol-file id="file-symbol" .type="${this._extension}"></uui-symbol-file>`}_renderLongName(){const e=this._name.substring(0,this._name.length-6),t=this._name.substring(this._name.length-6,this._name.length);return u`<span id="file-name" class="${this._url?"has-source":""}" @click="${()=>this._url?this._openSource():""}" @keydown="${()=>""}"><span id="file-name-start">${e}</span> <span id="file-name-end">${t}</span></span>`}_isFileAnImage(e){return e?e.type.split("/")[0]==="image":!1}async _getThumbnail(e){return await new Promise(t=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>{t(r.result)}})}render(){return u`<slot id="actions" name="actions"></slot>${this._fileTypeTemplate()}<div id="file-info">${this._renderLongName()} <span id="file-size">${this._size&&!this._isDirectory?u`${td.humanFileSize(this._size,!0)}`:""}</span></div>`}},n.UUIFilePreviewElement.styles=[b`:host{position:relative;display:grid;grid-template-rows:100px 50px;width:150px;height:150px;box-sizing:border-box;aspect-ratio:1;color:var(--uui-color-text,#060606)}:host(:hover) slot[name=actions]::slotted(*){opacity:1}slot[name=actions]::slotted(*){position:absolute;top:8px;right:8px;max-width:100%;height:32px;font-size:13px;opacity:0;z-index:1;transition:opacity 150ms}#file-symbol{aspect-ratio:1/1;margin:auto;max-width:100%;max-height:100%}#file-info{min-width:0;display:flex;text-align:center;flex-direction:column;font-size:1rem}#file-name{display:flex;justify-content:center}#file-name-start{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#file-name-end{white-space:nowrap}#file-size{opacity:.6}.has-source:hover{text-decoration:underline;cursor:pointer}`],de([y()],n.UUIFilePreviewElement.prototype,"_name",2),de([y()],n.UUIFilePreviewElement.prototype,"_url",2),de([y()],n.UUIFilePreviewElement.prototype,"_extension",2),de([y()],n.UUIFilePreviewElement.prototype,"_src",2),de([y()],n.UUIFilePreviewElement.prototype,"_size",2),de([y()],n.UUIFilePreviewElement.prototype,"_isDirectory",2),de([y()],n.UUIFilePreviewElement.prototype,"_file",2),de([y()],n.UUIFilePreviewElement.prototype,"_isImage",2),de([l({attribute:!1})],n.UUIFilePreviewElement.prototype,"file",1),n.UUIFilePreviewElement=de([m("uui-file-preview")],n.UUIFilePreviewElement);var rd=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,eo=(i,e,t,r)=>{for(var o=r>1?void 0:r?nd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&rd(e,t,o),o};n.UUIFormLayoutItemElement=class extends v{constructor(){super(...arguments),this.description=null,this._labelSlotHasContent=!1,this._labelSlotChanged=e=>{this._labelSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0},this._descriptionSlotHasContent=!1,this._descriptionSlotChanged=e=>{this._descriptionSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0}}connectedCallback(){super.connectedCallback(),$(this,"uui-form-validation-message")}render(){return u`<div id="label" style="${this._labelSlotHasContent?"":"display: none"}"><slot name="label" @slotchange="${this._labelSlotChanged}"></slot></div><div id="description" style="${this._descriptionSlotHasContent||this.description!==null?"":"display: none"}">${this.description}<slot name="description" @slotchange="${this._descriptionSlotChanged}"></slot></div><uui-form-validation-message><slot></slot><slot name="message" slot="message"></slot></uui-form-validation-message>`}},n.UUIFormLayoutItemElement.styles=[b`:host{position:relative;display:block;margin-top:var(--uui-size-space-5,18px);margin-bottom:var(--uui-size-space-5,18px)}#label{margin-top:-5px;margin-bottom:5px}#description{color:var(--uui-color-disabled-contrast,#c4c4c4);font-size:var(--uui-type-small-size,12px)}#label+#description{margin-top:-8px;min-height:8px}`],eo([l({type:String})],n.UUIFormLayoutItemElement.prototype,"description",2),eo([y()],n.UUIFormLayoutItemElement.prototype,"_labelSlotHasContent",2),eo([y()],n.UUIFormLayoutItemElement.prototype,"_descriptionSlotHasContent",2),n.UUIFormLayoutItemElement=eo([m("uui-form-layout-item")],n.UUIFormLayoutItemElement);/**
|
|
310
310
|
* @license
|
|
311
311
|
* Copyright 2017 Google LLC
|
|
312
312
|
* SPDX-License-Identifier: BSD-3-Clause
|