@umbraco-ui/uui 1.10.0 → 1.10.1
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 +2 -2
- package/dist/uui.min.js.map +1 -1
- package/package.json +5 -5
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}`],Se([l({reflect:!0})],n.UUIColorSliderElement.prototype,"type",2),Se([l()],n.UUIColorSliderElement.prototype,"color",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"min",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"max",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"precision",2),Se([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"vertical",2),Se([l()],n.UUIColorSliderElement.prototype,"value",2),Se([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"disabled",2),n.UUIColorSliderElement=Se([m("uui-color-slider")],n.UUIColorSliderElement);var rh=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,ci=(i,e,t,r)=>{for(var o=r>1?void 0:r?nh(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&&rh(e,t,o),o};n.UUIColorSwatchElement=class extends me("label",Ut(si(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})">${Bi}</div></div>${this._renderWithLabel()}</button>`}_renderWithLabel(){return this.showLabel?u`<div class="color-swatch__label"><strong>${this.renderLabel()}</strong> ${this.value}</div>`:I}},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}`],ci([l()],n.UUIColorSwatchElement.prototype,"value",1),ci([l()],n.UUIColorSwatchElement.prototype,"color",1),ci([l({type:Boolean,reflect:!0})],n.UUIColorSwatchElement.prototype,"disabled",2),ci([l({type:Boolean,attribute:"show-label",reflect:!0})],n.UUIColorSwatchElement.prototype,"showLabel",2),n.UUIColorSwatchElement=ci([m("uui-color-swatch")],n.UUIColorSwatchElement);let At=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};At.CHANGE="change";var sh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,Ji=(i,e,t,r)=>{for(var o=r>1?void 0:r?ah(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&&sh(e,t,o),o};n.UUIColorSwatchesElement=class extends me("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 At(At.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 At(At.CHANGE))))},this.addEventListener(je.SELECTED,this._onSelected),this.addEventListener(je.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}`],Ji([l()],n.UUIColorSwatchesElement.prototype,"value",2),Ji([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Ji([Ne({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"swatches",2),n.UUIColorSwatchesElement=Ji([m("uui-color-swatches")],n.UUIColorSwatchesElement);let he=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};he.CHANGE="change",he.INNER_SLOT_CHANGE="inner-slot-change";var lh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Zs=i=>{throw TypeError(i)},Ve=(i,e,t,r)=>{for(var o=r>1?void 0:r?uh(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&&lh(e,t,o),o},ch=(i,e,t)=>e.has(i)||Zs("Cannot "+t),hh=(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),Qs=(i,e,t)=>(ch(i,e,"access private method"),t),eo,pr;n.UUIComboboxListElement=class extends v{constructor(){super(...arguments),hh(this,eo),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Qs(this,eo,pr).call(this),this._updateSelection(),this.dispatchEvent(new he(he.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 he(he.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new he(he.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(je.SELECTED,this._onSelected),this.addEventListener(je.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(je.SELECTED,this._onSelected),this.removeEventListener(je.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,Qs(this,eo,pr).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u`<slot @slotchange="${this._onSlotChange}"></slot>`}},eo=new WeakSet,pr=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}`],Ve([l()],n.UUIComboboxListElement.prototype,"value",1),Ve([l({type:String})],n.UUIComboboxListElement.prototype,"displayValue",2),Ve([l({attribute:!1})],n.UUIComboboxListElement.prototype,"for",1),Ve([Ne({flatten:!0,selector:"uui-combobox-list-option:not([disabled])"})],n.UUIComboboxListElement.prototype,"_options",2),Ve([Ne({flatten:!0,selector:"uui-combobox-list-option[active]"})],n.UUIComboboxListElement.prototype,"_activeOptions",2),Ve([y()],n.UUIComboboxListElement.prototype,"_value",2),Ve([y()],n.UUIComboboxListElement.prototype,"_activeElementValue",2),n.UUIComboboxListElement=Ve([m("uui-combobox-list")],n.UUIComboboxListElement);var dh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,Ot=(i,e,t,r)=>{for(var o=r>1?void 0:r?ph(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&&dh(e,t,o),o};n.UUIComboboxListOptionElement=class extends Ut(si(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)}`],Ot([y()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),Ot([y()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),Ot([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),Ot([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),Ot([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=Ot([m("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let te=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};te.SEARCH="search",te.CHANGE="change";var bh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Js=i=>{throw TypeError(i)},ee=(i,e,t,r)=>{for(var o=r>1?void 0:r?mh(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&&bh(e,t,o),o},br=(i,e,t)=>e.has(i)||Js("Cannot "+t),C=(i,e,t)=>(br(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>e.has(i)?Js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ea=(i,e,t,r)=>(br(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mr=(i,e,t)=>(br(i,e,"access private method"),t),de,zt,hi,di,to,io,oo,gr,vr,fr,yr,ro,Lt,wr,no,so,_r,ao;n.UUIComboboxElement=class extends ge(v,""){constructor(){super(...arguments),W(this,di),this.closeLabel="Close",this.disabled=!1,this.readonly=!1,W(this,de),W(this,zt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,W(this,hi,()=>{this._isPhone=C(this,zt).matches}),W(this,io,()=>requestAnimationFrame(()=>this._input.focus())),W(this,oo,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||C(this,Lt).call(this)})),W(this,gr,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new te(te.SEARCH)),C(this,ro).call(this)}),W(this,vr,()=>{this.value&&this.value!==C(this,de)?.value&&mr(this,di,to).call(this,this.value)}),W(this,fr,()=>{this.value=C(this,de)?.value||"",this.search=this.value?this.search:"",C(this,Lt).call(this),this.dispatchEvent(new te(te.CHANGE))}),W(this,yr,()=>{this.readonly||(this.open=!this.open)}),W(this,ro,()=>{this.open||this.readonly||(this.open=!0)}),W(this,Lt,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new te(te.SEARCH)))}),W(this,wr,e=>{this.open===!1&&e.key==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation()),(e.key==="ArrowUp"||e.key==="ArrowDown")&&C(this,ro).call(this),(e.key==="Escape"||e.key==="Enter")&&C(this,Lt).call(this)}),W(this,no,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 te(te.SEARCH)),this.dispatchEvent(new te(te.CHANGE)))}),W(this,so,()=>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="${C(this,yr)}" @input="${C(this,gr)}" @keydown="${C(this,wr)}"><slot name="input-prepend" slot="prepend"></slot>${C(this,_r).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>`),W(this,_r,()=>this.disabled||this.readonly?I:this.value||this.search?u`<uui-button id="clear-button" @click="${C(this,no)}" @keydown="${C(this,no)}" label="clear" slot="append" compact="compact" style="height:100%"><uui-icon name="remove" .fallback="${tr.strings[0]}"></uui-icon></uui-button>`:""),W(this,ao,()=>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"&&mr(this,di,to).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",C(this,oo)),this.addEventListener("mousedown",C(this,io)),ea(this,zt,window.matchMedia("(max-width: 600px)")),C(this,hi).call(this),C(this,zt).addEventListener("change",C(this,hi)),E(this,"uui-icon"),E(this,"uui-input"),E(this,"uui-button"),E(this,"uui-combobox-list"),E(this,"uui-scroll-container"),E(this,"uui-popover-container"),E(this,"uui-symbol-expand")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",C(this,oo)),this.removeEventListener("mousedown",C(this,io)),C(this,zt).removeEventListener("change",C(this,hi))}async firstUpdated(){const e=this._comboboxListElements?.[0];e&&(ea(this,de,e),C(this,de).for=this,C(this,de).addEventListener(he.CHANGE,C(this,fr)),C(this,de).addEventListener(he.INNER_SLOT_CHANGE,C(this,vr)),await this.updateComplete,mr(this,di,to).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="${C(this,Lt)}">${this.closeLabel}</uui-button>${C(this,so).call(this)} ${C(this,ao).call(this)}</div>`:u`${C(this,so).call(this)}<uui-popover-container id="combobox-popover" popover="manual" placement="bottom-end">${C(this,ao).call(this)}</uui-popover-container>`}},de=new WeakMap,zt=new WeakMap,hi=new WeakMap,di=new WeakSet,to=function(i){C(this,de)&&(C(this,de).value=i,requestAnimationFrame(()=>this._displayValue=C(this,de).displayValue||""))},io=new WeakMap,oo=new WeakMap,gr=new WeakMap,vr=new WeakMap,fr=new WeakMap,yr=new WeakMap,ro=new WeakMap,Lt=new WeakMap,wr=new WeakMap,no=new WeakMap,so=new WeakMap,_r=new WeakMap,ao=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}`],ee([l({attribute:"value",reflect:!0})],n.UUIComboboxElement.prototype,"value",1),ee([l({type:String})],n.UUIComboboxElement.prototype,"search",1),ee([l({type:Boolean})],n.UUIComboboxElement.prototype,"open",1),ee([l({type:String})],n.UUIComboboxElement.prototype,"closeLabel",2),ee([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"disabled",2),ee([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"readonly",2),ee([A("#combobox-input")],n.UUIComboboxElement.prototype,"_input",2),ee([A("#combobox-popover")],n.UUIComboboxElement.prototype,"_comboboxPopoverElement",2),ee([Ne({flatten:!0,selector:"uui-combobox-list"})],n.UUIComboboxElement.prototype,"_comboboxListElements",2),ee([y()],n.UUIComboboxElement.prototype,"_displayValue",2),ee([y()],n.UUIComboboxElement.prototype,"_search",2),ee([y()],n.UUIComboboxElement.prototype,"_isPhone",2),ee([y()],n.UUIComboboxElement.prototype,"_isOpen",2),n.UUIComboboxElement=ee([m("uui-combobox")],n.UUIComboboxElement);var gh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,Ur=(i,e,t,r)=>{for(var o=r>1?void 0:r?vh(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&&gh(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)}`],Ur([l({type:String})],n.UUIDialogLayoutElement.prototype,"headline",2),Ur([y()],n.UUIDialogLayoutElement.prototype,"_headlineSlotHasContent",2),n.UUIDialogLayoutElement=Ur([m("uui-dialog-layout")],n.UUIDialogLayoutElement);var fh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,wh=(i,e,t,r)=>{for(var o=r>1?void 0:r?yh(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&&fh(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=wh([m("uui-dialog")],n.UUIDialogElement);var _h=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,ta=(i,e,t,r)=>{for(var o=r>1?void 0:r?Uh(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&&_h(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)}`],ta([l({type:Boolean,reflect:!0})],n.UUISymbolFileDropzoneElement.prototype,"error",2),n.UUISymbolFileDropzoneElement=ta([m("uui-symbol-file-dropzone")],n.UUISymbolFileDropzoneElement);let Mt=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};Mt.CHANGE="change";var $h=Object.defineProperty,Eh=Object.getOwnPropertyDescriptor,Tt=(i,e,t,r)=>{for(var o=r>1?void 0:r?Eh(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&&$h(e,t,o),o};n.UUIFileDropzoneElement=class extends me("",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,h)=>{a.readEntries(async d=>{if(!d.length){c();return}for(const f of d)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()},h)});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 Mt(Mt.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 Mt(Mt.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}`],Tt([A("#input")],n.UUIFileDropzoneElement.prototype,"_input",2),Tt([A("#dropzone")],n.UUIFileDropzoneElement.prototype,"_dropzone",2),Tt([l({type:String})],n.UUIFileDropzoneElement.prototype,"accept",1),Tt([l({type:Boolean,reflect:!0,attribute:"disallow-folder-upload"})],n.UUIFileDropzoneElement.prototype,"disallowFolderUpload",2),Tt([l({type:Boolean})],n.UUIFileDropzoneElement.prototype,"multiple",2),n.UUIFileDropzoneElement=Tt([m("uui-file-dropzone")],n.UUIFileDropzoneElement);let kh=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 Ih=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,fe=(i,e,t,r)=>{for(var o=r>1?void 0:r?xh(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&&Ih(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(),E(this,"uui-symbol-file-thumbnail"),E(this,"uui-symbol-folder"),E(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`${kh.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}`],fe([y()],n.UUIFilePreviewElement.prototype,"_name",2),fe([y()],n.UUIFilePreviewElement.prototype,"_url",2),fe([y()],n.UUIFilePreviewElement.prototype,"_extension",2),fe([y()],n.UUIFilePreviewElement.prototype,"_src",2),fe([y()],n.UUIFilePreviewElement.prototype,"_size",2),fe([y()],n.UUIFilePreviewElement.prototype,"_isDirectory",2),fe([y()],n.UUIFilePreviewElement.prototype,"_file",2),fe([y()],n.UUIFilePreviewElement.prototype,"_isImage",2),fe([l({attribute:!1})],n.UUIFilePreviewElement.prototype,"file",1),n.UUIFilePreviewElement=fe([m("uui-file-preview")],n.UUIFilePreviewElement);var Ch=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,lo=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sh(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&&Ch(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(),E(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}`],lo([l({type:String})],n.UUIFormLayoutItemElement.prototype,"description",2),lo([y()],n.UUIFormLayoutItemElement.prototype,"_labelSlotHasContent",2),lo([y()],n.UUIFormLayoutItemElement.prototype,"_descriptionSlotHasContent",2),n.UUIFormLayoutItemElement=lo([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}`],Se([l({reflect:!0})],n.UUIColorSliderElement.prototype,"type",2),Se([l()],n.UUIColorSliderElement.prototype,"color",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"min",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"max",2),Se([l({type:Number})],n.UUIColorSliderElement.prototype,"precision",2),Se([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"vertical",2),Se([l()],n.UUIColorSliderElement.prototype,"value",2),Se([l({type:Boolean,reflect:!0})],n.UUIColorSliderElement.prototype,"disabled",2),n.UUIColorSliderElement=Se([m("uui-color-slider")],n.UUIColorSliderElement);var rh=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,ci=(i,e,t,r)=>{for(var o=r>1?void 0:r?nh(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&&rh(e,t,o),o};n.UUIColorSwatchElement=class extends me("label",Ut(si(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})">${Bi}</div></div>${this._renderWithLabel()}</button>`}_renderWithLabel(){return this.showLabel?u`<div class="color-swatch__label"><strong>${this.renderLabel()}</strong> ${this.value}</div>`:I}},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}`],ci([l()],n.UUIColorSwatchElement.prototype,"value",1),ci([l()],n.UUIColorSwatchElement.prototype,"color",1),ci([l({type:Boolean,reflect:!0})],n.UUIColorSwatchElement.prototype,"disabled",2),ci([l({type:Boolean,attribute:"show-label",reflect:!0})],n.UUIColorSwatchElement.prototype,"showLabel",2),n.UUIColorSwatchElement=ci([m("uui-color-swatch")],n.UUIColorSwatchElement);let At=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};At.CHANGE="change";var sh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,Ji=(i,e,t,r)=>{for(var o=r>1?void 0:r?ah(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&&sh(e,t,o),o};n.UUIColorSwatchesElement=class extends me("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 At(At.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 At(At.CHANGE))))},this.addEventListener(je.SELECTED,this._onSelected),this.addEventListener(je.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}`],Ji([l()],n.UUIColorSwatchesElement.prototype,"value",2),Ji([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Ji([Ne({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"swatches",2),n.UUIColorSwatchesElement=Ji([m("uui-color-swatches")],n.UUIColorSwatchesElement);let he=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};he.CHANGE="change",he.INNER_SLOT_CHANGE="inner-slot-change";var lh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Zs=i=>{throw TypeError(i)},Ve=(i,e,t,r)=>{for(var o=r>1?void 0:r?uh(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&&lh(e,t,o),o},ch=(i,e,t)=>e.has(i)||Zs("Cannot "+t),hh=(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),Qs=(i,e,t)=>(ch(i,e,"access private method"),t),eo,pr;n.UUIComboboxListElement=class extends v{constructor(){super(...arguments),hh(this,eo),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Qs(this,eo,pr).call(this),this._updateSelection(),this.dispatchEvent(new he(he.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 he(he.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new he(he.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(je.SELECTED,this._onSelected),this.addEventListener(je.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(je.SELECTED,this._onSelected),this.removeEventListener(je.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,Qs(this,eo,pr).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u`<slot @slotchange="${this._onSlotChange}"></slot>`}},eo=new WeakSet,pr=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}`],Ve([l()],n.UUIComboboxListElement.prototype,"value",1),Ve([l({type:String})],n.UUIComboboxListElement.prototype,"displayValue",2),Ve([l({attribute:!1})],n.UUIComboboxListElement.prototype,"for",1),Ve([Ne({flatten:!0,selector:"uui-combobox-list-option:not([disabled])"})],n.UUIComboboxListElement.prototype,"_options",2),Ve([Ne({flatten:!0,selector:"uui-combobox-list-option[active]"})],n.UUIComboboxListElement.prototype,"_activeOptions",2),Ve([y()],n.UUIComboboxListElement.prototype,"_value",2),Ve([y()],n.UUIComboboxListElement.prototype,"_activeElementValue",2),n.UUIComboboxListElement=Ve([m("uui-combobox-list")],n.UUIComboboxListElement);var dh=Object.defineProperty,ph=Object.getOwnPropertyDescriptor,Ot=(i,e,t,r)=>{for(var o=r>1?void 0:r?ph(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&&dh(e,t,o),o};n.UUIComboboxListOptionElement=class extends Ut(si(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)}`],Ot([y()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),Ot([y()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),Ot([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),Ot([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),Ot([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=Ot([m("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let te=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};te.SEARCH="search",te.CHANGE="change";var bh=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,Js=i=>{throw TypeError(i)},ee=(i,e,t,r)=>{for(var o=r>1?void 0:r?mh(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&&bh(e,t,o),o},br=(i,e,t)=>e.has(i)||Js("Cannot "+t),C=(i,e,t)=>(br(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>e.has(i)?Js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),ea=(i,e,t,r)=>(br(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),mr=(i,e,t)=>(br(i,e,"access private method"),t),de,zt,hi,di,to,io,oo,gr,vr,fr,yr,ro,Lt,wr,no,so,_r,ao;n.UUIComboboxElement=class extends ge(v,""){constructor(){super(...arguments),W(this,di),this.closeLabel="Close",this.disabled=!1,this.readonly=!1,W(this,de),W(this,zt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,W(this,hi,()=>{this._isPhone=C(this,zt).matches}),W(this,io,()=>requestAnimationFrame(()=>this._input.focus())),W(this,oo,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||C(this,Lt).call(this)})),W(this,gr,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new te(te.SEARCH)),C(this,ro).call(this)}),W(this,vr,()=>{this.value&&this.value!==C(this,de)?.value&&mr(this,di,to).call(this,this.value)}),W(this,fr,()=>{this.value=C(this,de)?.value||"",this.search=this.value?this.search:"",C(this,Lt).call(this),this.dispatchEvent(new te(te.CHANGE))}),W(this,yr,()=>{this.readonly||(this.open=!this.open)}),W(this,ro,()=>{this.open||this.readonly||(this.open=!0)}),W(this,Lt,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new te(te.SEARCH)))}),W(this,wr,e=>{this.open===!1&&e.key==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation()),(e.key==="ArrowUp"||e.key==="ArrowDown")&&C(this,ro).call(this),(e.key==="Escape"||e.key==="Enter")&&C(this,Lt).call(this)}),W(this,no,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 te(te.SEARCH)),this.dispatchEvent(new te(te.CHANGE)))}),W(this,so,()=>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="${C(this,yr)}" @input="${C(this,gr)}" @keydown="${C(this,wr)}"><slot name="input-prepend" slot="prepend"></slot>${C(this,_r).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>`),W(this,_r,()=>this.disabled||this.readonly?I:this.value||this.search?u`<uui-button id="clear-button" @click="${C(this,no)}" @keydown="${C(this,no)}" label="clear" slot="append" compact="compact" style="height:100%"><uui-icon name="remove" .fallback="${tr.strings[0]}"></uui-icon></uui-button>`:""),W(this,ao,()=>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"&&mr(this,di,to).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",C(this,oo)),this.addEventListener("mousedown",C(this,io)),ea(this,zt,window.matchMedia("(max-width: 600px)")),C(this,hi).call(this),C(this,zt).addEventListener("change",C(this,hi)),E(this,"uui-icon"),E(this,"uui-input"),E(this,"uui-button"),E(this,"uui-combobox-list"),E(this,"uui-scroll-container"),E(this,"uui-popover-container"),E(this,"uui-symbol-expand")}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",C(this,oo)),this.removeEventListener("mousedown",C(this,io)),C(this,zt).removeEventListener("change",C(this,hi))}async firstUpdated(){const e=this._comboboxListElements?.[0];e&&(ea(this,de,e),C(this,de).for=this,C(this,de).addEventListener(he.CHANGE,C(this,fr)),C(this,de).addEventListener(he.INNER_SLOT_CHANGE,C(this,vr)),await this.updateComplete,mr(this,di,to).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="${C(this,Lt)}">${this.closeLabel}</uui-button>${C(this,so).call(this)} ${C(this,ao).call(this)}</div>`:u`${C(this,so).call(this)}<uui-popover-container id="combobox-popover" popover="manual" placement="bottom-end">${C(this,ao).call(this)}</uui-popover-container>`}},de=new WeakMap,zt=new WeakMap,hi=new WeakMap,di=new WeakSet,to=function(i){C(this,de)&&(C(this,de).value=i,requestAnimationFrame(()=>this._displayValue=C(this,de).displayValue||""))},io=new WeakMap,oo=new WeakMap,gr=new WeakMap,vr=new WeakMap,fr=new WeakMap,yr=new WeakMap,ro=new WeakMap,Lt=new WeakMap,wr=new WeakMap,no=new WeakMap,so=new WeakMap,_r=new WeakMap,ao=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}`],ee([l({attribute:"value",reflect:!0})],n.UUIComboboxElement.prototype,"value",1),ee([l({type:String})],n.UUIComboboxElement.prototype,"search",1),ee([l({type:Boolean})],n.UUIComboboxElement.prototype,"open",1),ee([l({type:String})],n.UUIComboboxElement.prototype,"closeLabel",2),ee([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"disabled",2),ee([l({type:Boolean,reflect:!0})],n.UUIComboboxElement.prototype,"readonly",2),ee([A("#combobox-input")],n.UUIComboboxElement.prototype,"_input",2),ee([A("#combobox-popover")],n.UUIComboboxElement.prototype,"_comboboxPopoverElement",2),ee([Ne({flatten:!0,selector:"uui-combobox-list"})],n.UUIComboboxElement.prototype,"_comboboxListElements",2),ee([y()],n.UUIComboboxElement.prototype,"_displayValue",2),ee([y()],n.UUIComboboxElement.prototype,"_search",2),ee([y()],n.UUIComboboxElement.prototype,"_isPhone",2),ee([y()],n.UUIComboboxElement.prototype,"_isOpen",2),n.UUIComboboxElement=ee([m("uui-combobox")],n.UUIComboboxElement);var gh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,Ur=(i,e,t,r)=>{for(var o=r>1?void 0:r?vh(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&&gh(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)}`],Ur([l({type:String})],n.UUIDialogLayoutElement.prototype,"headline",2),Ur([y()],n.UUIDialogLayoutElement.prototype,"_headlineSlotHasContent",2),n.UUIDialogLayoutElement=Ur([m("uui-dialog-layout")],n.UUIDialogLayoutElement);var fh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,wh=(i,e,t,r)=>{for(var o=r>1?void 0:r?yh(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&&fh(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=wh([m("uui-dialog")],n.UUIDialogElement);var _h=Object.defineProperty,Uh=Object.getOwnPropertyDescriptor,ta=(i,e,t,r)=>{for(var o=r>1?void 0:r?Uh(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&&_h(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)}`],ta([l({type:Boolean,reflect:!0})],n.UUISymbolFileDropzoneElement.prototype,"error",2),n.UUISymbolFileDropzoneElement=ta([m("uui-symbol-file-dropzone")],n.UUISymbolFileDropzoneElement);let Mt=class extends L{constructor(e,t={}){super(e,{bubbles:!0,...t})}};Mt.CHANGE="change";var $h=Object.defineProperty,Eh=Object.getOwnPropertyDescriptor,Tt=(i,e,t,r)=>{for(var o=r>1?void 0:r?Eh(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&&$h(e,t,o),o};n.UUIFileDropzoneElement=class extends me("",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")continue;const a=this._getEntry(s);if(a)if(a.isDirectory){if(!this.disallowFolderUpload&&this.multiple){const c=await this._mkdir(a);r.push(c)}}else{const c=s.getAsFile();if(!c)continue;this._isAccepted(c)&&o.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,h)=>{a.readEntries(async d=>{if(!d.length){c();return}for(const f of d)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()},h)});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 Mt(Mt.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 Mt(Mt.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}`],Tt([A("#input")],n.UUIFileDropzoneElement.prototype,"_input",2),Tt([A("#dropzone")],n.UUIFileDropzoneElement.prototype,"_dropzone",2),Tt([l({type:String})],n.UUIFileDropzoneElement.prototype,"accept",1),Tt([l({type:Boolean,reflect:!0,attribute:"disallow-folder-upload"})],n.UUIFileDropzoneElement.prototype,"disallowFolderUpload",2),Tt([l({type:Boolean})],n.UUIFileDropzoneElement.prototype,"multiple",2),n.UUIFileDropzoneElement=Tt([m("uui-file-dropzone")],n.UUIFileDropzoneElement);let kh=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 Ih=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,fe=(i,e,t,r)=>{for(var o=r>1?void 0:r?xh(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&&Ih(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(),E(this,"uui-symbol-file-thumbnail"),E(this,"uui-symbol-folder"),E(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`${kh.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}`],fe([y()],n.UUIFilePreviewElement.prototype,"_name",2),fe([y()],n.UUIFilePreviewElement.prototype,"_url",2),fe([y()],n.UUIFilePreviewElement.prototype,"_extension",2),fe([y()],n.UUIFilePreviewElement.prototype,"_src",2),fe([y()],n.UUIFilePreviewElement.prototype,"_size",2),fe([y()],n.UUIFilePreviewElement.prototype,"_isDirectory",2),fe([y()],n.UUIFilePreviewElement.prototype,"_file",2),fe([y()],n.UUIFilePreviewElement.prototype,"_isImage",2),fe([l({attribute:!1})],n.UUIFilePreviewElement.prototype,"file",1),n.UUIFilePreviewElement=fe([m("uui-file-preview")],n.UUIFilePreviewElement);var Ch=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,lo=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sh(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&&Ch(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(),E(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}`],lo([l({type:String})],n.UUIFormLayoutItemElement.prototype,"description",2),lo([y()],n.UUIFormLayoutItemElement.prototype,"_labelSlotHasContent",2),lo([y()],n.UUIFormLayoutItemElement.prototype,"_descriptionSlotHasContent",2),n.UUIFormLayoutItemElement=lo([m("uui-form-layout-item")],n.UUIFormLayoutItemElement);/**
|
|
310
310
|
* @license
|
|
311
311
|
* Copyright 2017 Google LLC
|
|
312
312
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -847,7 +847,7 @@
|
|
|
847
847
|
fill: var(--uui-color-border-emphasis,#a1a1a1);
|
|
848
848
|
}
|
|
849
849
|
|
|
850
|
-
input:focus ~ #track
|
|
850
|
+
input:focus ~ #track #thumb {
|
|
851
851
|
outline: calc(2px * var(--uui-show-focus-outline, 1)) solid
|
|
852
852
|
var(--uui-color-focus,#3879ff);
|
|
853
853
|
}
|