@umbraco-ui/uui 1.17.2 → 1.17.3

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 CHANGED
@@ -303,7 +303,7 @@
303
303
  style=${this._labelSlotHasContent?"":"display: none"}
304
304
  name=${i||""}
305
305
  @slotchange=${this.labelSlotChanged}></slot>
306
- `}}return ea([l({type:String})],t.prototype,"label"),ea([$()],t.prototype,"_labelSlotHasContent"),t};var Cc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,ta=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sc(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&&Cc(e,t,o),o};const Ac=i=>{class e extends i{constructor(...r){super(...r),this._selectable=!1,this.deselectable=!0,this.selected=!1,this.#e=this,this.#i=o=>{o.code!=="Space"&&o.code!=="Enter"||o.composedPath().indexOf(this.#e)===0&&this.#t(o)},this.#t=o=>{if((this._selectable||this.deselectable&&this.selected)===!1)return;const s=o.composedPath();this.#e===this&&s.some(a=>{const c=a.tagName;return c==="A"||c==="BUTTON"||c==="INPUT"||c==="TEXTAREA"||c==="SELECT"})||s.indexOf(this.#e)!==-1&&(o.type==="keydown"&&o.preventDefault(),this.#r())},this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#i)}get selectable(){return this._selectable}set selectable(r){const o=this._selectable;o!==r&&(this._selectable=r,this.#e===this&&this.#e.setAttribute("tabindex",`${r?"0":"-1"}`),this.requestUpdate("selectable",o))}#e;get selectableTarget(){return this.#e}set selectableTarget(r){const o=this.#e;o.removeAttribute("tabindex"),o.removeEventListener("click",this.#t),o.removeEventListener("keydown",this.#i),this.#e=r,this.#e===this&&this.#e.setAttribute("tabindex",this._selectable?"0":"-1"),r.addEventListener("click",this.#t),r.addEventListener("keydown",this.#i)}#i;#t;#r(){this.selectable&&(this.deselectable===!1?this.#o():this.selected?this.#n():this.#o())}#o(){if(!this.selectable)return;const r=new Ei(Ei.SELECTED);this.dispatchEvent(r),!r.defaultPrevented&&(this.selected=!0)}#n(){if(!this.deselectable)return;const r=new Ei(Ei.DESELECTED);this.dispatchEvent(r),!r.defaultPrevented&&(this.selected=!1)}}return ta([l({type:Boolean,reflect:!0})],e.prototype,"selectable",1),ta([l({type:Boolean,reflect:!0})],e.prototype,"selected",2),e};var Pc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,Oc=(i,e,t,r)=>{for(var o=zc(e,t),s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(e,t,o)||o);return o&&Pc(e,t,o),o};const Lc=i=>{class e extends i{constructor(){super(...arguments),this._selectOnly=!1}get selectOnly(){return this._selectOnly}set selectOnly(r){const o=this._selectOnly;this._selectOnly=r,this.requestUpdate("selectOnly",o)}}return Oc([l({type:Boolean,reflect:!0,attribute:"select-only"})],e.prototype,"selectOnly"),e};var Mc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,mt=(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&&Mc(e,t,o),o};const Nc=["customError","valueMissing","badInput","typeMismatch","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort"],Bc=(i,e)=>{class t extends i{constructor(...o){super(...o),this.name="",this.#e={},this._pristine=!1,this.required=!1,this.requiredMessage="This field is required",this.error=!1,this.errorMessage="This field is invalid",this.#i=e,this.#t=null,this.#r=[],this.#o=[],this.#s=()=>{this.pristine=!1},this._internals=this.attachInternals(),this.pristine=!0,this.addValidator("valueMissing",()=>this.requiredMessage,()=>this.hasAttribute("required")&&this.hasValue()===!1),this.addValidator("customError",()=>this.errorMessage,()=>this.error),this.addEventListener("blur",()=>{this.pristine=!1,this.checkValidity()})}static{this.formAssociated=!0}get value(){return this.#i}set value(o){const s=this.#i;this.#i=o,"ElementInternals"in window&&"setFormValue"in window.ElementInternals.prototype&&this._internals.setFormValue(this.#i??null),this.requestUpdate("value",s)}#e;set pristine(o){this._pristine!==o&&(this._pristine=o,o?this.setAttribute("pristine",""):this.removeAttribute("pristine"),this.#a())}get pristine(){return this._pristine}#i;#t;#r;#o;hasValue(){return this.value!==this.getDefaultValue()}focusFirstInvalidElement(){const o=this.#o.find(s=>s.validity.valid===!1);o?"focusFirstInvalidElement"in o?o.focusFirstInvalidElement():o.focus():this.focus()}disconnectedCallback(){super.disconnectedCallback(),this.#n()}#n(){this.#t&&this.#t.removeEventListener("submit",this.#s)}addValidator(o,s,a){const c={flagKey:o,getMessageMethod:s,checkMethod:a,weight:Nc.indexOf(o)};return this.#r.push(c),this.#r.sort((h,d)=>h.weight>d.weight?1:d.weight>h.weight?-1:0),c}removeValidator(o){const s=this.#r.indexOf(o);s!==-1&&this.#r.splice(s,1)}addFormControlElement(o){this.#o.push(o),o.addEventListener(bt.INVALID,()=>{this._runValidators()}),o.addEventListener(bt.VALID,()=>{this._runValidators()}),this._pristine===!1&&(o.checkValidity(),this._runValidators())}setCustomValidity(o){this._customValidityObject&&this.removeValidator(this._customValidityObject),o!=null&&o!==""&&(this._customValidityObject=this.addValidator("customError",()=>o,()=>!0)),this._runValidators()}_runValidators(){this.#e={};let o,s;this.#r.some(c=>c.checkMethod()?(this.#e[c.flagKey]=!0,o=c.getMessageMethod(),!0):!1),o||this.#o.some(c=>{let h;for(h in c.validity)if(h!=="valid"&&c.validity[h])return this.#e[h]=!0,o=c.validationMessage,s??=c,!0;return!1});const a=Object.values(this.#e).includes(!0);this.#e.valid=!a,this._internals.setValidity(this.#e,o,s??this.getFormElement()??void 0),this.#a()}#a(){this._pristine!==!0&&(this.#e.valid?this.dispatchEvent(new bt(bt.VALID)):this.dispatchEvent(new bt(bt.INVALID)))}updated(o){super.updated(o),this._runValidators()}#s;submit(){this.#t?.requestSubmit()}formAssociatedCallback(){this.#n(),this.#t=this._internals.form,this.#t&&(this.#t.hasAttribute("submit-invalid")&&(this.pristine=!1),this.#t.addEventListener("submit",this.#s))}formResetCallback(){this.pristine=!0,this.value=this.getInitialValue()??this.getDefaultValue()}getDefaultValue(){return e}getInitialValue(){return this.getAttribute("value")}checkValidity(){this.pristine=!1,this._runValidators();for(const o in this.#o)if(this.#o[o].checkValidity()===!1)return!1;return this._internals?.checkValidity()}get validity(){return this.#e}get validationMessage(){return this._internals?.validationMessage}}return mt([l({type:String})],t.prototype,"name",2),mt([l()],t.prototype,"value",1),mt([l({type:Boolean,reflect:!0,attribute:"pristine"})],t.prototype,"pristine",1),mt([l({type:Boolean,reflect:!0})],t.prototype,"required",2),mt([l({type:String,attribute:"required-message"})],t.prototype,"requiredMessage",2),mt([l({type:Boolean,reflect:!0})],t.prototype,"error",2),mt([l({type:String,attribute:"error-message"})],t.prototype,"errorMessage",2),t};let ia=class{constructor(e,t){this._callback=e,this._timerId=null,this._remaining=null,this._onComplete=()=>{this._remaining=null,this._callback()},this.setDuration(t)}setDuration(e){this._duration=e,this._timerId!==null&&this.restart()}start(){this._timerId===null&&this.resume()}restart(){this._remaining=this._duration,this.resume()}pause(){this._timerId!==null&&(window.clearTimeout(this._timerId),this._timerId=null,this._remaining!==null&&(this._remaining-=Date.now()-this._startTime))}resume(){this._timerId!==null&&window.clearTimeout(this._timerId),this._remaining===null&&(this._remaining=this._duration),this._startTime=Date.now(),this._timerId=window.setTimeout(this._onComplete,this._remaining)}destroy(){this.pause()}};const Dc=ia,Vc=(i,e,t=`This element has to be present for ${i.nodeName} to work appropriate.`)=>{customElements.get(e)||console.warn(`%c ${i.nodeName} requires ${e} element to be registered!`,"font-weight: bold;",t,i)},Hc=(i,e)=>{function t(o){const s=i.getBoundingClientRect(),a=i.ownerDocument.defaultView,c=s.left+a.scrollX,h=s.top+a.scrollY;let d;if("TouchEvent"in window&&o instanceof TouchEvent)d=o.touches[0];else if(o instanceof MouseEvent)d=o;else return;const m=d.pageX-c,v=d.pageY-h;e?.onMove&&e.onMove(m,v)}function r(){document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r),e?.onStop&&e.onStop()}document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",r),e?.initialEvent&&t(e.initialEvent)},jc=(i,e,t)=>Math.min(Math.max(i,e),t),Rc=(i,e,t)=>t+e-i,Fc=i=>{const e=Math.round(i).toString(16);return e.length===1?`0${e}`:e},oa=(i,e,t)=>{let r=i;for(;r!==null;){const o=r instanceof HTMLElement&&r.hasAttribute(e)&&r.getAttribute(e)===t,s=r.querySelector(`[${e}="${t}"]`)!==null;if(o)return r;if(s)return r.querySelector(`[${e}="${t}"]`);r=r.parentElement||r.parentNode||r.host||null}return null};function Gc(i){return i?i.assignedNodes({flatten:!0}).length>0:!1}var Wc=Object.defineProperty,qc=(i,e,t,r)=>{for(var o=void 0,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(e,t,o)||o);return o&&Wc(e,t,o),o};const Kc=i=>{class e extends i{constructor(...r){super(...r),this.#e=!1,this._togglePopover=()=>{if(!this.popoverContainerElement)return;const o=oa(this,"id",this.popoverContainerElement);o&&(this.#e?o.hidePopover():o.showPopover())},this.#i=o=>{requestAnimationFrame(()=>{this.#e=o.detail.newState==="open"})},this.addEventListener("uui-popover-before-toggle",this.#i)}#e;#i}return qc([l({type:String,attribute:"popovertarget"})],e.prototype,"popoverContainerElement"),e};function Xc(i,e){return t=>{if(!(i.indexOf("-")>0)){console.error(`${i} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}window.customElements.get(i)||window.customElements.define(i,t,e)}}const Yc=["default","primary","secondary","outline","placeholder"],Zc=["default","positive","warning","danger","invalid"],Jc=["h1","h2","h3","h4","h5","h6"];var Qc="1.17.2";const ra=Qc;globalThis.__uuiVersions??=[],globalThis.__uuiVersions.push(ra);const Dr=globalThis.__uuiVersions;if(Dr.length>1){const i=[...new Set(Dr)];i.length>1?console.warn(`Multiple versions of Umbraco UI detected: ${i.join(", ")}. This is not supported and may cause issues.`):console.warn(`Multiple instances of Umbraco UI v${Dr[0]} loaded. This may indicate duplicate bundles.`)}function p(i,e){return t=>{if(!(i.indexOf("-")>0)){console.error(`${i} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}window.customElements.get(i)||window.customElements.define(i,t,e)}}var eh=(i,e,t,r)=>{for(var o=e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(o)||o);return o};n.UUIButtonGroupElement=class extends g{render(){return u`<slot></slot>`}},n.UUIButtonGroupElement.styles=[b`
306
+ `}}return ea([l({type:String})],t.prototype,"label"),ea([$()],t.prototype,"_labelSlotHasContent"),t};var Cc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,ta=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sc(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&&Cc(e,t,o),o};const Ac=i=>{class e extends i{constructor(...r){super(...r),this._selectable=!1,this.deselectable=!0,this.selected=!1,this.#e=this,this.#i=o=>{o.code!=="Space"&&o.code!=="Enter"||o.composedPath().indexOf(this.#e)===0&&this.#t(o)},this.#t=o=>{if((this._selectable||this.deselectable&&this.selected)===!1)return;const s=o.composedPath();this.#e===this&&s.some(a=>{const c=a.tagName;return c==="A"||c==="BUTTON"||c==="INPUT"||c==="TEXTAREA"||c==="SELECT"})||s.indexOf(this.#e)!==-1&&(o.type==="keydown"&&o.preventDefault(),this.#r())},this.addEventListener("click",this.#t),this.addEventListener("keydown",this.#i)}get selectable(){return this._selectable}set selectable(r){const o=this._selectable;o!==r&&(this._selectable=r,this.#e===this&&this.#e.setAttribute("tabindex",`${r?"0":"-1"}`),this.requestUpdate("selectable",o))}#e;get selectableTarget(){return this.#e}set selectableTarget(r){const o=this.#e;o.removeAttribute("tabindex"),o.removeEventListener("click",this.#t),o.removeEventListener("keydown",this.#i),this.#e=r,this.#e===this&&this.#e.setAttribute("tabindex",this._selectable?"0":"-1"),r.addEventListener("click",this.#t),r.addEventListener("keydown",this.#i)}#i;#t;#r(){this.selectable&&(this.deselectable===!1?this.#o():this.selected?this.#n():this.#o())}#o(){if(!this.selectable)return;const r=new Ei(Ei.SELECTED);this.dispatchEvent(r),!r.defaultPrevented&&(this.selected=!0)}#n(){if(!this.deselectable)return;const r=new Ei(Ei.DESELECTED);this.dispatchEvent(r),!r.defaultPrevented&&(this.selected=!1)}}return ta([l({type:Boolean,reflect:!0})],e.prototype,"selectable",1),ta([l({type:Boolean,reflect:!0})],e.prototype,"selected",2),e};var Pc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,Oc=(i,e,t,r)=>{for(var o=zc(e,t),s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(e,t,o)||o);return o&&Pc(e,t,o),o};const Lc=i=>{class e extends i{constructor(){super(...arguments),this._selectOnly=!1}get selectOnly(){return this._selectOnly}set selectOnly(r){const o=this._selectOnly;this._selectOnly=r,this.requestUpdate("selectOnly",o)}}return Oc([l({type:Boolean,reflect:!0,attribute:"select-only"})],e.prototype,"selectOnly"),e};var Mc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,mt=(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&&Mc(e,t,o),o};const Nc=["customError","valueMissing","badInput","typeMismatch","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort"],Bc=(i,e)=>{class t extends i{constructor(...o){super(...o),this.name="",this.#e={},this._pristine=!1,this.required=!1,this.requiredMessage="This field is required",this.error=!1,this.errorMessage="This field is invalid",this.#i=e,this.#t=null,this.#r=[],this.#o=[],this.#s=()=>{this.pristine=!1},this._internals=this.attachInternals(),this.pristine=!0,this.addValidator("valueMissing",()=>this.requiredMessage,()=>this.hasAttribute("required")&&this.hasValue()===!1),this.addValidator("customError",()=>this.errorMessage,()=>this.error),this.addEventListener("blur",()=>{this.pristine=!1,this.checkValidity()})}static{this.formAssociated=!0}get value(){return this.#i}set value(o){const s=this.#i;this.#i=o,"ElementInternals"in window&&"setFormValue"in window.ElementInternals.prototype&&this._internals.setFormValue(this.#i??null),this.requestUpdate("value",s)}#e;set pristine(o){this._pristine!==o&&(this._pristine=o,o?this.setAttribute("pristine",""):this.removeAttribute("pristine"),this.#a())}get pristine(){return this._pristine}#i;#t;#r;#o;hasValue(){return this.value!==this.getDefaultValue()}focusFirstInvalidElement(){const o=this.#o.find(s=>s.validity.valid===!1);o?"focusFirstInvalidElement"in o?o.focusFirstInvalidElement():o.focus():this.focus()}disconnectedCallback(){super.disconnectedCallback(),this.#n()}#n(){this.#t&&this.#t.removeEventListener("submit",this.#s)}addValidator(o,s,a){const c={flagKey:o,getMessageMethod:s,checkMethod:a,weight:Nc.indexOf(o)};return this.#r.push(c),this.#r.sort((h,d)=>h.weight>d.weight?1:d.weight>h.weight?-1:0),c}removeValidator(o){const s=this.#r.indexOf(o);s!==-1&&this.#r.splice(s,1)}addFormControlElement(o){this.#o.push(o),o.addEventListener(bt.INVALID,()=>{this._runValidators()}),o.addEventListener(bt.VALID,()=>{this._runValidators()}),this._pristine===!1&&(o.checkValidity(),this._runValidators())}setCustomValidity(o){this._customValidityObject&&this.removeValidator(this._customValidityObject),o!=null&&o!==""&&(this._customValidityObject=this.addValidator("customError",()=>o,()=>!0)),this._runValidators()}_runValidators(){this.#e={};let o,s;this.#r.some(c=>c.checkMethod()?(this.#e[c.flagKey]=!0,o=c.getMessageMethod(),!0):!1),o||this.#o.some(c=>{let h;for(h in c.validity)if(h!=="valid"&&c.validity[h])return this.#e[h]=!0,o=c.validationMessage,s??=c,!0;return!1});const a=Object.values(this.#e).includes(!0);this.#e.valid=!a,this._internals.setValidity(this.#e,o,s??this.getFormElement()??void 0),this.#a()}#a(){this._pristine!==!0&&(this.#e.valid?this.dispatchEvent(new bt(bt.VALID)):this.dispatchEvent(new bt(bt.INVALID)))}updated(o){super.updated(o),this._runValidators()}#s;submit(){this.#t?.requestSubmit()}formAssociatedCallback(){this.#n(),this.#t=this._internals.form,this.#t&&(this.#t.hasAttribute("submit-invalid")&&(this.pristine=!1),this.#t.addEventListener("submit",this.#s))}formResetCallback(){this.pristine=!0,this.value=this.getInitialValue()??this.getDefaultValue()}getDefaultValue(){return e}getInitialValue(){return this.getAttribute("value")}checkValidity(){this.pristine=!1,this._runValidators();for(const o in this.#o)if(this.#o[o].checkValidity()===!1)return!1;return this._internals?.checkValidity()}get validity(){return this.#e}get validationMessage(){return this._internals?.validationMessage}}return mt([l({type:String})],t.prototype,"name",2),mt([l()],t.prototype,"value",1),mt([l({type:Boolean,reflect:!0,attribute:"pristine"})],t.prototype,"pristine",1),mt([l({type:Boolean,reflect:!0})],t.prototype,"required",2),mt([l({type:String,attribute:"required-message"})],t.prototype,"requiredMessage",2),mt([l({type:Boolean,reflect:!0})],t.prototype,"error",2),mt([l({type:String,attribute:"error-message"})],t.prototype,"errorMessage",2),t};let ia=class{constructor(e,t){this._callback=e,this._timerId=null,this._remaining=null,this._onComplete=()=>{this._remaining=null,this._callback()},this.setDuration(t)}setDuration(e){this._duration=e,this._timerId!==null&&this.restart()}start(){this._timerId===null&&this.resume()}restart(){this._remaining=this._duration,this.resume()}pause(){this._timerId!==null&&(window.clearTimeout(this._timerId),this._timerId=null,this._remaining!==null&&(this._remaining-=Date.now()-this._startTime))}resume(){this._timerId!==null&&window.clearTimeout(this._timerId),this._remaining===null&&(this._remaining=this._duration),this._startTime=Date.now(),this._timerId=window.setTimeout(this._onComplete,this._remaining)}destroy(){this.pause()}};const Dc=ia,Vc=(i,e,t=`This element has to be present for ${i.nodeName} to work appropriate.`)=>{customElements.get(e)||console.warn(`%c ${i.nodeName} requires ${e} element to be registered!`,"font-weight: bold;",t,i)},Hc=(i,e)=>{function t(o){const s=i.getBoundingClientRect(),a=i.ownerDocument.defaultView,c=s.left+a.scrollX,h=s.top+a.scrollY;let d;if("TouchEvent"in window&&o instanceof TouchEvent)d=o.touches[0];else if(o instanceof MouseEvent)d=o;else return;const m=d.pageX-c,v=d.pageY-h;e?.onMove&&e.onMove(m,v)}function r(){document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r),e?.onStop&&e.onStop()}document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",r),e?.initialEvent&&t(e.initialEvent)},jc=(i,e,t)=>Math.min(Math.max(i,e),t),Rc=(i,e,t)=>t+e-i,Fc=i=>{const e=Math.round(i).toString(16);return e.length===1?`0${e}`:e},oa=(i,e,t)=>{let r=i;for(;r!==null;){const o=r instanceof HTMLElement&&r.hasAttribute(e)&&r.getAttribute(e)===t,s=r.querySelector(`[${e}="${t}"]`)!==null;if(o)return r;if(s)return r.querySelector(`[${e}="${t}"]`);r=r.parentElement||r.parentNode||r.host||null}return null};function Gc(i){return i?i.assignedNodes({flatten:!0}).length>0:!1}var Wc=Object.defineProperty,qc=(i,e,t,r)=>{for(var o=void 0,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(e,t,o)||o);return o&&Wc(e,t,o),o};const Kc=i=>{class e extends i{constructor(...r){super(...r),this.#e=!1,this._togglePopover=()=>{if(!this.popoverContainerElement)return;const o=oa(this,"id",this.popoverContainerElement);o&&(this.#e?o.hidePopover():o.showPopover())},this.#i=o=>{requestAnimationFrame(()=>{this.#e=o.detail.newState==="open"})},this.addEventListener("uui-popover-before-toggle",this.#i)}#e;#i}return qc([l({type:String,attribute:"popovertarget"})],e.prototype,"popoverContainerElement"),e};function Xc(i,e){return t=>{if(!(i.indexOf("-")>0)){console.error(`${i} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}window.customElements.get(i)||window.customElements.define(i,t,e)}}const Yc=["default","primary","secondary","outline","placeholder"],Zc=["default","positive","warning","danger","invalid"],Jc=["h1","h2","h3","h4","h5","h6"];var Qc="1.17.3";const ra=Qc;globalThis.__uuiVersions??=[],globalThis.__uuiVersions.push(ra);const Dr=globalThis.__uuiVersions;if(Dr.length>1){const i=[...new Set(Dr)];i.length>1?console.warn(`Multiple versions of Umbraco UI detected: ${i.join(", ")}. This is not supported and may cause issues.`):console.warn(`Multiple instances of Umbraco UI v${Dr[0]} loaded. This may indicate duplicate bundles.`)}function p(i,e){return t=>{if(!(i.indexOf("-")>0)){console.error(`${i} is not a valid custom element name. A custom element name should consist of at least two words separated by a hyphen.`);return}window.customElements.get(i)||window.customElements.define(i,t,e)}}var eh=(i,e,t,r)=>{for(var o=e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=a(o)||o);return o};n.UUIButtonGroupElement=class extends g{render(){return u`<slot></slot>`}},n.UUIButtonGroupElement.styles=[b`
307
307
  :host {
308
308
  display: inline-flex;
309
309
  align-items: stretch;
@@ -3225,7 +3225,7 @@
3225
3225
  flex-wrap: wrap;
3226
3226
  gap: 0.4rem;
3227
3227
  }
3228
- `],Fi([l()],n.UUIColorSwatchesElement.prototype,"value",2),Fi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Fi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"readonly",2),Fi([Pe({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"_swatches",2),n.UUIColorSwatchesElement=Fi([p("uui-color-swatches")],n.UUIColorSwatchesElement);let me=class extends z{static{this.CHANGE="change"}static{this.INNER_SLOT_CHANGE="inner-slot-change"}constructor(e,t={}){super(e,{bubbles:!0,...t})}};var Up=Object.defineProperty,kp=Object.getOwnPropertyDescriptor,Sl=i=>{throw TypeError(i)},tt=(i,e,t,r)=>{for(var o=r>1?void 0:r?kp(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&&Up(e,t,o),o},Ep=(i,e,t)=>e.has(i)||Sl("Cannot "+t),xp=(i,e,t)=>e.has(i)?Sl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Al=(i,e,t)=>(Ep(i,e,"access private method"),t),Do,Cn;n.UUIComboboxListElement=class extends g{constructor(){super(...arguments),xp(this,Do),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Al(this,Do,Cn).call(this),this._updateSelection(),this.dispatchEvent(new me(me.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 me(me.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new me(me.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.code){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"Space":{e.preventDefault(),e.stopPropagation(),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(Vt.SELECTED,this._onSelected),this.addEventListener(Vt.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(Vt.SELECTED,this._onSelected),this.removeEventListener(Vt.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,Al(this,Do,Cn).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u` <slot @slotchange=${this._onSlotChange}></slot> `}},Do=new WeakSet,Cn=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`
3228
+ `],Fi([l()],n.UUIColorSwatchesElement.prototype,"value",2),Fi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"disabled",2),Fi([l({type:Boolean,reflect:!0})],n.UUIColorSwatchesElement.prototype,"readonly",2),Fi([Pe({selector:"uui-color-swatch"})],n.UUIColorSwatchesElement.prototype,"_swatches",2),n.UUIColorSwatchesElement=Fi([p("uui-color-swatches")],n.UUIColorSwatchesElement);let me=class extends z{static{this.CHANGE="change"}static{this.INNER_SLOT_CHANGE="inner-slot-change"}constructor(e,t={}){super(e,{bubbles:!0,...t})}};var Up=Object.defineProperty,kp=Object.getOwnPropertyDescriptor,Sl=i=>{throw TypeError(i)},tt=(i,e,t,r)=>{for(var o=r>1?void 0:r?kp(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&&Up(e,t,o),o},Ep=(i,e,t)=>e.has(i)||Sl("Cannot "+t),xp=(i,e,t)=>e.has(i)?Sl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Al=(i,e,t)=>(Ep(i,e,"access private method"),t),Do,Cn;n.UUIComboboxListElement=class extends g{constructor(){super(...arguments),xp(this,Do),this.displayValue="",this._value="",this._activeElementValue=null,this._onSlotChange=()=>{Al(this,Do,Cn).call(this),this._updateSelection(),this.dispatchEvent(new me(me.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 me(me.CHANGE))},this._onDeselected=e=>{const t=e.composedPath()[0];this._selectedElement===t&&(this.value="",this.displayValue="",this.dispatchEvent(new me(me.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.code){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(Vt.SELECTED,this._onSelected),this.addEventListener(Vt.DESELECTED,this._onDeselected)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._onKeyDown),this.removeEventListener(Vt.SELECTED,this._onSelected),this.removeEventListener(Vt.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,Al(this,Do,Cn).call(this),t&&t.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}render(){return u` <slot @slotchange=${this._onSlotChange}></slot> `}},Do=new WeakSet,Cn=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`
3229
3229
  :host {
3230
3230
  display: flex;
3231
3231
  flex-direction: column;
@@ -3313,7 +3313,7 @@
3313
3313
  color: var(--uui-color-disabled-contrast,#c4c4c4);
3314
3314
  background-color: var(--uui-color-disabled,#f3f3f5);
3315
3315
  }
3316
- `],Jt([$()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),Jt([$()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),Jt([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),Jt([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),Jt([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=Jt([p("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let ve=class extends z{static{this.SEARCH="search"}static{this.CHANGE="change"}constructor(e,t={}){super(e,{bubbles:!0,...t})}};var Sp=Object.defineProperty,Ap=Object.getOwnPropertyDescriptor,Pl=i=>{throw TypeError(i)},q=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ap(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&&Sp(e,t,o),o},Sn=(i,e,t)=>e.has(i)||Pl("Cannot "+t),E=(i,e,t)=>(Sn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>e.has(i)?Pl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zl=(i,e,t,r)=>(Sn(i,e,"write to private field"),e.set(i,t),t),Vo=(i,e,t)=>(Sn(i,e,"access private method"),t),J,Qt,ei,Ol,Gi,Ho,jo,Ro,An,Fo,Go,Pn,Wi,ti,zn,Wo,qo,On,Ko;n.UUIComboboxElement=class extends we(g,""){constructor(){super(...arguments),W(this,ei),this.closeLabel="Close",this.disabled=!1,this.hideExpandSymbol=!1,this.readonly=!1,this.placeholder="",W(this,J),W(this,Qt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,W(this,Gi,()=>{this._isPhone=E(this,Qt).matches}),W(this,jo,()=>requestAnimationFrame(()=>this._input.focus())),W(this,Ro,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||E(this,ti).call(this)})),W(this,An,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new ve(ve.SEARCH)),E(this,Wi).call(this)}),W(this,Fo,()=>{this.value&&this.value!==E(this,J)?.value&&Vo(this,ei,Ho).call(this)}),W(this,Go,()=>{this.value=E(this,J)?.value||"",this.search=this.value?this.search:"",E(this,ti).call(this),this.dispatchEvent(new ve(ve.CHANGE))}),W(this,Pn,()=>{this.readonly||(this.open=!this.open)}),W(this,Wi,()=>{this.open||this.readonly||(this.open=!0)}),W(this,ti,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new ve(ve.SEARCH)))}),W(this,zn,e=>{if(this.open===!1&&e.code==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation()),(e.code==="ArrowUp"||e.code==="ArrowDown")&&E(this,Wi).call(this),e.code==="Space"){if(this._isOpen)return;e.preventDefault(),e.stopImmediatePropagation(),E(this,Wi).call(this)}e.code==="Escape"&&E(this,ti).call(this)}),W(this,Wo,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 ve(ve.SEARCH)),this.dispatchEvent(new ve(ve.CHANGE)))}),W(this,qo,()=>u`<uui-input
3316
+ `],Jt([$()],n.UUIComboboxListOptionElement.prototype,"_disabled",2),Jt([$()],n.UUIComboboxListOptionElement.prototype,"_displayValue",2),Jt([l({type:String})],n.UUIComboboxListOptionElement.prototype,"value",1),Jt([l({type:String,attribute:"display-value"})],n.UUIComboboxListOptionElement.prototype,"displayValue",1),Jt([l({type:Boolean,reflect:!0})],n.UUIComboboxListOptionElement.prototype,"disabled",1),n.UUIComboboxListOptionElement=Jt([p("uui-combobox-list-option")],n.UUIComboboxListOptionElement);let ve=class extends z{static{this.SEARCH="search"}static{this.CHANGE="change"}constructor(e,t={}){super(e,{bubbles:!0,...t})}};var Sp=Object.defineProperty,Ap=Object.getOwnPropertyDescriptor,Pl=i=>{throw TypeError(i)},q=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ap(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&&Sp(e,t,o),o},Sn=(i,e,t)=>e.has(i)||Pl("Cannot "+t),E=(i,e,t)=>(Sn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(i,e,t)=>e.has(i)?Pl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),zl=(i,e,t,r)=>(Sn(i,e,"write to private field"),e.set(i,t),t),Vo=(i,e,t)=>(Sn(i,e,"access private method"),t),J,Qt,ei,Ol,Gi,Ho,jo,Ro,An,Fo,Go,Pn,Wi,ti,zn,Wo,qo,On,Ko;n.UUIComboboxElement=class extends we(g,""){constructor(){super(...arguments),W(this,ei),this.closeLabel="Close",this.disabled=!1,this.hideExpandSymbol=!1,this.readonly=!1,this.placeholder="",W(this,J),W(this,Qt),this._displayValue="",this._search="",this._isPhone=!1,this._isOpen=!1,W(this,Gi,()=>{this._isPhone=E(this,Qt).matches}),W(this,jo,()=>requestAnimationFrame(()=>this._input.focus())),W(this,Ro,()=>requestAnimationFrame(()=>{this.shadowRoot?.activeElement||E(this,ti).call(this)})),W(this,An,e=>{e.preventDefault(),e.stopImmediatePropagation(),this.search=e.target.value,this.dispatchEvent(new ve(ve.SEARCH)),E(this,Wi).call(this)}),W(this,Fo,()=>{this.value&&this.value!==E(this,J)?.value&&Vo(this,ei,Ho).call(this)}),W(this,Go,()=>{this.value=E(this,J)?.value||"",this.search=this.value?this.search:"",E(this,ti).call(this),this.dispatchEvent(new ve(ve.CHANGE))}),W(this,Pn,()=>{this.readonly||(this.open=!this.open)}),W(this,Wi,()=>{this.open||this.readonly||(this.open=!0)}),W(this,ti,()=>{this.open&&(this.open=!1,this.search="",this._input.value=this._displayValue,this.dispatchEvent(new ve(ve.SEARCH)))}),W(this,zn,e=>{this.open===!1&&e.code==="Enter"&&(e.preventDefault(),e.stopImmediatePropagation(),E(this,Wi).call(this)),(e.code==="ArrowUp"||e.code==="ArrowDown")&&E(this,Wi).call(this),e.code==="Escape"&&E(this,ti).call(this)}),W(this,Wo,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 ve(ve.SEARCH)),this.dispatchEvent(new ve(ve.CHANGE)))}),W(this,qo,()=>u`<uui-input
3317
3317
  slot="trigger"
3318
3318
  id="combobox-input"
3319
3319
  label="combobox-input"