@umbraco-ui/uui 1.8.0-rc.0 → 1.8.0-rc.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/custom-elements.json +4 -0
- package/dist/uui.min.js +2 -3
- package/dist/uui.min.js.map +1 -1
- package/package.json +4 -4
package/custom-elements.json
CHANGED
|
@@ -259,6 +259,10 @@
|
|
|
259
259
|
{
|
|
260
260
|
"name": "--uui-box-border-radius",
|
|
261
261
|
"description": "overwrite the box border-radius, default is var(--uui-border-radius)"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "--uui-box-border-color",
|
|
265
|
+
"description": "overwrites the box border colorm default is var(--uui-color-divider-standalone)"
|
|
262
266
|
}
|
|
263
267
|
]
|
|
264
268
|
},
|
package/dist/uui.min.js
CHANGED
|
@@ -232,8 +232,7 @@
|
|
|
232
232
|
:host {
|
|
233
233
|
display: block;
|
|
234
234
|
border: var(--uui-box-border-width, 0) solid
|
|
235
|
-
var(--uui-color-divider-standalone,#e9e9eb);
|
|
236
|
-
|
|
235
|
+
var(--uui-box-border-color, var(--uui-color-divider-standalone,#e9e9eb));
|
|
237
236
|
box-shadow: var(--uui-box-box-shadow, var(--uui-shadow-depth-1,0 1px 3px rgba(0,0,0,0.12) , 0 1px 2px rgba(0,0,0,0.24)));
|
|
238
237
|
border-radius: var(--uui-box-border-radius, var(--uui-border-radius,3px));
|
|
239
238
|
background-color: var(--uui-color-surface,#fff);
|
|
@@ -321,7 +320,7 @@
|
|
|
321
320
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
322
321
|
*/const Qt=(i,e)=>{var t,r;const o=i._$AN;if(o===void 0)return!1;for(const s of o)(r=(t=s)._$AO)===null||r===void 0||r.call(t,e,!1),Qt(s,e);return!0},qi=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while(t?.size===0)},ta=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),vd(e)}};function md(i){this._$AN!==void 0?(qi(this),this._$AM=i,ta(this)):this._$AM=i}function gd(i,e=!1,t=0){const r=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)Qt(r[s],!1),qi(r[s]);else r!=null&&(Qt(r,!1),qi(r));else Qt(this,i)}const vd=i=>{var e,t,r,o;i.type==ee.CHILD&&((e=(r=i)._$AP)!==null&&e!==void 0||(r._$AP=gd),(t=(o=i)._$AQ)!==null&&t!==void 0||(o._$AQ=md))};let fd=class extends dt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),ta(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,o;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)===null||r===void 0||r.call(this):(o=this.disconnected)===null||o===void 0||o.call(this)),t&&(Qt(this,e),qi(this))}setValue(e){if(Ts(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};const $r=new WeakMap,kr=ht(class extends fd{render(i){return $}update(i,[e]){var t;const r=e!==this.G;return r&&this.G!==void 0&&this.ot(void 0),(r||this.rt!==this.lt)&&(this.G=e,this.dt=(t=i.options)===null||t===void 0?void 0:t.host,this.ot(this.lt=i.element)),$}ot(i){var e;if(typeof this.G=="function"){const t=(e=this.dt)!==null&&e!==void 0?e:globalThis;let r=$r.get(t);r===void 0&&(r=new WeakMap,$r.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.dt,void 0),r.set(this.G,i),i!==void 0&&this.G.call(this.dt,i)}else this.G.value=i}get rt(){var i,e,t;return typeof this.G=="function"?(e=$r.get((i=this.dt)!==null&&i!==void 0?i:globalThis))===null||e===void 0?void 0:e.get(this.G):(t=this.G)===null||t===void 0?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});let we=class extends P{};we.SHOW_CHILDREN="show-children",we.HIDE_CHILDREN="hide-children",we.CLICK_LABEL="click-label";var yd=Object.defineProperty,wd=Object.getOwnPropertyDescriptor,_e=(i,e,t,r)=>{for(var o=r>1?void 0:r?wd(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&&yd(e,t,o),o};n.UUIMenuItemElement=class extends yi(at(Rt(re("label",v)))){constructor(){super(...arguments),this.disabled=!1,this.showChildren=!1,this.hasChildren=!1,this.loading=!1,this.iconSlotHasContent=!1,this._labelButtonChanged=e=>{this.selectableTarget=e||this},this._iconSlotChanged=e=>{this.iconSlotHasContent=e.target.assignedNodes({flatten:!0}).length>0},this._onCaretClicked=()=>{const e=this.showChildren?we.HIDE_CHILDREN:we.SHOW_CHILDREN,t=new we(e,{cancelable:!0});this.dispatchEvent(t),!t.defaultPrevented&&(this.showChildren=!this.showChildren)},this._onLabelClicked=()=>{const e=new we(we.CLICK_LABEL);this.dispatchEvent(e)}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","menu"),U(this,"uui-symbol-expand"),U(this,"uui-loader-bar")}_renderLabelInside(){return u`<slot name="icon" id="icon" style="${this.iconSlotHasContent?"":"display: none;"}" @slotchange="${this._iconSlotChanged}"></slot>${this.renderLabel()}<slot name="badge" id="badge"></slot>`}_renderLabelAsAnchor(){return this.disabled?u`<span id="label-button" ${kr(this._labelButtonChanged)}>${this._renderLabelInside()}</span>`:u`<a id="label-button" ${kr(this._labelButtonChanged)} href="${E(this.href)}" target="${E(this.target||void 0)}" rel="${E(this.target==="_blank"?"noopener noreferrer":void 0)}" @click="${this._onLabelClicked}" ?disabled="${this.disabled}" aria-label="${this.label}">${this._renderLabelInside()}</a>`}_renderLabelAsButton(){return u`<button id="label-button" ${kr(this._labelButtonChanged)} @click="${this._onLabelClicked}" ?disabled="${this.disabled}" aria-label="${this.label}">${this._renderLabelInside()}</button>`}render(){return u`<div id="menu-item" aria-label="menuitem" role="menuitem">${this.hasChildren?u`<button id="caret-button" @click="${this._onCaretClicked}"><uui-symbol-expand ?open="${this.showChildren}"></uui-symbol-expand></button>`:""} ${this.href?this._renderLabelAsAnchor():this._renderLabelAsButton()}<div id="label-button-background"></div>${this.selectOnly===!1?u`<slot id="actions-container" name="actions"></slot>`:""} ${this.loading?u`<uui-loader-bar id="loader"></uui-loader-bar>`:""}</div>${this.showChildren?u`<slot></slot>`:""}`}},n.UUIMenuItemElement.styles=[b`:host{box-sizing:border-box;display:block;--uui-menu-item-child-indent:calc(var(--uui-menu-item-indent, 0) + 1);user-select:none;--flat-structure-reversed:calc(
|
|
323
322
|
1 - var(--uui-menu-item-flat-structure, 0)
|
|
324
|
-
)}#menu-item{position:relative;padding-left:calc(var(--uui-menu-item-indent,0) * var(--uui-size-4,12px));display:grid;grid-template-columns:calc(var(--flat-structure-reversed) * var(--uui-size-8,24px)) 1fr;grid-template-rows:1fr;white-space:nowrap}:host(:not([active],[selected],[disabled])) #menu-item #caret-button:hover,:host(:not([active],[selected],[disabled],[select-mode=highlight])) #menu-item #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-hover,var(--uui-color-surface-emphasis,#fafafa))}:host(:not([active],[selected])) #menu-item #caret-button:hover,:host(:not([active],[selected],[disabled])) #menu-item #label-button:hover{color:var(--uui-menu-item-color-hover,var(--uui-color-interactive-emphasis,#3544b1))}:host([active]) #caret-button,:host([active]) #label-button{color:var(--uui-menu-item-color-active,var(--uui-color-current-contrast,#1b264f))}:host([active]) #label-button-background{background-color:var(--uui-menu-item-background-color-active,var(--uui-color-current,#f5c1bc))}:host([active]) #caret-button:hover,:host([active]) #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-active-hover,var(--uui-color-current-emphasis,#f8d6d3))}:host([disabled]) #menu-item{color:var(--uui-menu-item-color-disabled,var(--uui-color-disabled-contrast,#c4c4c4));background-color:var(--uui-menu-item-background-color-disabled,var(--uui-color-disabled,#f3f3f5))}:host([selected]:not([select-mode=highlight],[disabled])) #caret-button,:host([selected]:not([select-mode=highlight],[disabled])) #label-button{color:var(--uui-menu-item-color-selected,var(--uui-color-selected-contrast,#fff))}:host([selected]:not([select-mode=highlight],[disabled])) #label-button-background{background-color:var(--uui-menu-item-background-color-selected,var(--uui-color-selected,#3544b1))}:host([selected]:not([select-mode=highlight],[disabled])) #caret-button:hover,:host([selected]:not([select-mode=highlight],[disabled])) #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-selected-hover,var(--uui-color-selected-emphasis,#4656c8))}:host([select-mode=highlight]:not([disabled],[active],[selectable])) #menu-item #label-button:hover~#label-button-background{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight,var(--uui-color-surface-emphasis,#fafafa))}:host([select-mode=highlight][active]:not([disabled])) #menu-item #label-button-background{border-radius:var(--uui-border-radius,3px)}:host([select-mode=highlight][active][selected]:not([disabled])) #menu-item #label-button:hover~#label-button-background{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight-active-selected,var(--uui-color-current-emphasis,#f8d6d3))}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #caret-button,:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button{color:var(--uui-menu-item-color-highlight-selected,var(--uui-color-interactive,#1b264f))}:host([select-mode=highlight][selectable][selected]:not([disabled])) #menu-item #label-button:hover{color:var(--uui-menu-item-background-color-highlight-selectable-selected,var(--uui-color-interactive-emphasis,#3544b1))}:host([selected][selectable][select-mode=highlight]:not([active])) #menu-item #caret-button:hover{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight-selectable-selected,var(--uui-color-surface-emphasis,#fafafa));color:var(--uui-menu-item-color-highlight-selectable-selected,var(--uui-color-interactive-emphasis,#3544b1))}:host([select-mode=highlight]:not([disabled])) #menu-item #label-button-background::after{border-radius:var(--uui-border-radius,3px);position:absolute;content:'';inset:1px;border:2px solid var(--uui-menu-item-border-color-highlight,var(--uui-color-selected,#3544b1));opacity:0}:host([select-mode=highlight][selectable][selected]:not([disabled])) #menu-item #caret-button:hover::after{border-top-left-radius:var(--uui-border-radius,3px);border-bottom-left-radius:var(--uui-border-radius,3px);position:absolute;content:'';inset:1px 0 1px 1px;border:2px solid var(--uui-menu-item-border-color-highlight,var(--uui-color-selected,#3544b1));border-right:none}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button-background::after{opacity:1}:host([select-mode=highlight][selectable]:not([disabled])) #menu-item #label-button:hover~#label-button-background::after{opacity:.33}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button:hover~#label-button-background::after{opacity:.66}:host([disabled]) #label-button{cursor:default}button{display:inline-flex;align-items:center;font-family:inherit;font-size:inherit;padding:0;text-align:left;border:none;color:inherit;background-color:transparent;cursor:pointer;min-height:var(--uui-size-12,36px);z-index:1}#label-button{position:relative;flex-grow:1;grid-column-start:2;white-space:nowrap;overflow:hidden;padding-right:var(--uui-size-space-3,9px);padding-left:calc(var(--uui-menu-item-flat-structure) * var(--uui-size-space-3,9px));display:inline-flex;align-items:center;text-decoration:none;color:currentColor;min-height:var(--uui-size-12,36px);z-index:1}#label-button .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}span#label-button{pointer-events:none}#caret-button{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--uui-color-interactive,#1b264f)}#label-button-background{position:absolute;top:0;left:0;right:0;bottom:0}#actions-container{opacity:0;transition:opacity 120ms;grid-column-start:3}:host(:not([disabled])) #menu-item:focus #actions-container,:host(:not([disabled])) #menu-item:focus-within #actions-container,:host(:not([disabled])) #menu-item:hover #actions-container{opacity:1}#loader{position:absolute;width:100%;bottom:0}#icon{display:inline-flex;font-size:16px;margin-right:var(--uui-size-2,6px)}#badge{font-size:12px;--uui-badge-position:relative;--uui-badge-position:auto;display:block;margin-left:6px}:host([select-mode=highlight]) #label-button:focus-visible{outline:0;overflow:initial}:host([select-mode=highlight]) #label-button:focus-visible::after{content:'';border-radius:calc(var(--uui-border-radius,3px) - 1px);position:absolute;inset:3px 3px 3px -5px;border:2px solid var(--uui-color-focus,#3879ff)}:host([select-mode=highlight]) #caret-button:focus-visible{outline:0;overflow:initial}:host([select-mode=highlight]) #caret-button:focus-visible::after{content:'';position:absolute;inset:3px;border-radius:calc(var(--uui-border-radius,3px) - 1px);border:2px solid var(--uui-color-focus,#3879ff)}slot:not([name]){position:relative;display:block;width:100%}slot:not([name]){--uui-menu-item-indent:var(--uui-menu-item-child-indent)}slot[name=actions]{display:flex;align-items:center;--uui-button-height:calc(var(--uui-size-base-unit) * 4);margin-right:var(--uui-size-base-unit)}`],_e([l({type:Boolean,reflect:!0})],n.UUIMenuItemElement.prototype,"disabled",2),_e([l({type:Boolean,reflect:!0,attribute:"show-children"})],n.UUIMenuItemElement.prototype,"showChildren",2),_e([l({type:Boolean,attribute:"has-children"})],n.UUIMenuItemElement.prototype,"hasChildren",2),_e([l({type:Boolean,attribute:"loading"})],n.UUIMenuItemElement.prototype,"loading",2),_e([l({type:String})],n.UUIMenuItemElement.prototype,"href",2),_e([l({type:String})],n.UUIMenuItemElement.prototype,"target",2),_e([l({type:String,attribute:"select-mode",reflect:!0})],n.UUIMenuItemElement.prototype,"selectMode",2),_e([f()],n.UUIMenuItemElement.prototype,"iconSlotHasContent",2),n.UUIMenuItemElement=_e([m("uui-menu-item")],n.UUIMenuItemElement);var _d=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,Ut=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ud(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&&_d(e,t,o),o};const Ke="uui:modal-close";let K=class extends v{constructor(){super(...arguments),this.isOpen=!1,this.isClosing=!1,this.index=0,this.uniqueIndex=0,this._transitionDuration=250,this.open=e=>{e?.preventDefault(),e?.stopImmediatePropagation();const t=new CustomEvent("open",{cancelable:!0});this.dispatchEvent(t),!t.defaultPrevented&&this._openModal()},this.close=e=>{e?.preventDefault(),e?.stopImmediatePropagation();const t=new CustomEvent(Ke,{cancelable:!0});this.dispatchEvent(t),!t.defaultPrevented&&this._closeModal()}}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=e,this.style.setProperty("--uui-modal-transition-duration",this._transitionDuration+"ms")}firstUpdated(e){super.firstUpdated(e),this.isClosing||this.open()}_openModal(){this.isOpen=!0,this._dialogElement?.showModal(),this._dialogElement?.addEventListener("cancel",this.close)}_closeModal(){this.isClosing=!0,this.isOpen=!1,this._dialogElement?.close(),this.dispatchEvent(new CustomEvent("close-end")),this.remove()}};K.styles=[b`dialog{display:block;margin:0;padding:0;max-width:unset;max-height:unset;border:none}dialog::backdrop{background:0 0;opacity:0}dialog::after{content:'';position:absolute;inset:0;background-color:var(--uui-modal-color-backdrop,rgba(0,0,0,.5));pointer-events:none;opacity:1;transition:opacity var(--uui-modal-transition-duration,250ms);z-index:1}:host([index='0']) dialog::after{opacity:0}`],Ut([C("dialog")],K.prototype,"_dialogElement",2),Ut([l({type:Boolean,reflect:!0,attribute:"is-open"})],K.prototype,"isOpen",2),Ut([l({type:Boolean,reflect:!0,attribute:"is-closing"})],K.prototype,"isClosing",2),Ut([l({type:Number,reflect:!0})],K.prototype,"index",2),Ut([l({type:Number,reflect:!0,attribute:"unique-index"})],K.prototype,"uniqueIndex",2),Ut([l({type:Number,attribute:"transition-duration"})],K.prototype,"transitionDuration",1);var Ed=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,ia=(i,e,t,r)=>{for(var o=r>1?void 0:r?$d(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&&Ed(e,t,o),o},oa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ra=(i,e,t)=>(oa(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kd=(i,e,t)=>(oa(i,e,"access private method"),t),Ki,Ir,xr,sa;n.UUIModalSidebarElement=class extends K{constructor(){super(),na(this,Ki),na(this,xr),this.size="full",this.addEventListener(Ke,kd(this,xr,sa).bind(this))}firstUpdated(e){super.firstUpdated(e),this.style.setProperty("--uui-modal-offset",-ra(this,Ki,Ir)+"px")}updated(e){super.updated(e),this.uniqueIndex>10?this.setAttribute("hide",""):this.removeAttribute("hide")}render(){return u`<dialog><slot></slot></dialog>`}},Ki=new WeakSet,Ir=function(){return this._dialogElement?.getBoundingClientRect().width??0},xr=new WeakSet,sa=function(i){i.preventDefault(),!this.isClosing&&(this.isClosing=!0,this.style.setProperty("--uui-modal-offset",-ra(this,Ki,Ir)+"px"),setTimeout(()=>{this._closeModal()},this.transitionDuration))},n.UUIModalSidebarElement.styles=[...K.styles,b`:host{--uui-modal-sidebar-left-gap:24px}@media (min-width:600px){:host{--uui-modal-sidebar-left-gap:64px}}dialog{height:100%;width:100%;box-sizing:border-box;max-width:calc(100% - var(--uui-modal-sidebar-left-gap));margin-left:auto;right:var(--uui-modal-offset);transition:right var(--uui-modal-transition-duration,250ms)}:host([index='0']) dialog{box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22))}:host(:not([index='0'])) dialog{outline:1px solid rgba(0,0,0,.1)}:host([hide]) dialog{display:none}:host([size=large]) dialog{max-width:min(1200px,calc(100% - var(--uui-modal-sidebar-left-gap)))}:host([size=medium]) dialog{max-width:min(800px,calc(100% - var(--uui-modal-sidebar-left-gap)))}:host([size=small]) dialog{max-width:min(400px,calc(100% - var(--uui-modal-sidebar-left-gap)))}`],ia([l({reflect:!0})],n.UUIModalSidebarElement.prototype,"size",2),n.UUIModalSidebarElement=ia([m("uui-modal-sidebar")],n.UUIModalSidebarElement);var Id=Object.defineProperty,xd=Object.getOwnPropertyDescriptor,Et=(i,e,t,r)=>{for(var o=r>1?void 0:r?xd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Id(e,t,o),o},aa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jt=(i,e,t)=>(aa(i,e,"read from private field"),t?t.call(i):e.get(i)),Xi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yi=(i,e,t)=>(aa(i,e,"access private method"),t),Cr,$t,Zi,Sr,Qi,Pr;n.UUIModalContainerElement=class extends v{constructor(){super(),Xi(this,Zi),Xi(this,Qi),this.sidebarGap=64,this.transitionDurationMS=250,Xi(this,Cr,()=>{const e=this._modals??[];if(this._modals=this.modalSlot?.assignedElements({flatten:!0}).filter(t=>t instanceof K)??[],e.filter(t=>this._modals.indexOf(t)===-1).forEach(t=>t.removeEventListener(Ke,Jt(this,$t))),this._modals.filter(t=>e.indexOf(t)===-1).forEach(t=>t.addEventListener(Ke,Jt(this,$t))),this._sidebars=this._modals.filter(t=>t instanceof n.UUIModalSidebarElement),this._modals.length===0){this.removeAttribute("backdrop");return}Yi(this,Zi,Sr).call(this),Yi(this,Qi,Pr).call(this)}),Xi(this,$t,e=>{if(e.stopImmediatePropagation(),e.target?.removeEventListener(Ke,Jt(this,$t)),!this._modals||this._modals.length<=1){this.removeAttribute("backdrop");return}Yi(this,Zi,Sr).call(this),Yi(this,Qi,Pr).call(this)}),this.addEventListener(Ke,Jt(this,$t))}firstUpdated(e){super.firstUpdated(e),this.style.setProperty("--uui-modal-transition-duration",this.transitionDurationMS+"ms")}render(){return u`<slot @slotchange="${Jt(this,Cr)}"></slot>`}},Cr=new WeakMap,$t=new WeakMap,Zi=new WeakSet,Sr=function(){this.setAttribute("backdrop","");const i=this._modals?.filter(e=>!e.isClosing).reverse()??[];i?.forEach((e,t)=>{e.index=t,e.transitionDuration=this.transitionDurationMS}),i?.forEach(e=>{const t=i?.filter(r=>r.constructor.name===e.constructor.name);e.uniqueIndex=t?.indexOf(e)??0})},Qi=new WeakSet,Pr=function(){requestAnimationFrame(()=>{let i=0;const e=this._sidebars?.filter(t=>!t.isClosing).reverse()??[];for(let t=0;t<e.length;t++){const r=e[t],o=e[t+1],s=i;if(r.updateComplete.then(()=>{r.style.setProperty("--uui-modal-offset",s+"px")}),o?.hasAttribute("hide"))break;const a=r.shadowRoot?.querySelector("dialog")?.getBoundingClientRect().width??0,h=o?.shadowRoot?.querySelector("dialog")?.getBoundingClientRect().width??0,c=a+i+this.sidebarGap-h;i=c>0?c:0}})},n.UUIModalContainerElement.styles=b`:host{position:fixed;--uui-modal-color-backdrop:rgba(0, 0, 0, 0.5)}:host::after{content:'';position:fixed;inset:0;background-color:var(--uui-modal-color-backdrop,rgba(0,0,0,.5));opacity:0;pointer-events:none;transition:opacity var(--uui-modal-transition-duration,250ms)}:host([backdrop])::after{opacity:1}`,Et([C("slot")],n.UUIModalContainerElement.prototype,"modalSlot",2),Et([f()],n.UUIModalContainerElement.prototype,"_modals",2),Et([f()],n.UUIModalContainerElement.prototype,"_sidebars",2),Et([l({type:Number})],n.UUIModalContainerElement.prototype,"sidebarGap",2),Et([l({type:Number})],n.UUIModalContainerElement.prototype,"transitionDurationMS",2),n.UUIModalContainerElement=Et([m("uui-modal-container")],n.UUIModalContainerElement);var Cd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Pd=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sd(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&&Cd(e,t,o),o};n.UUIModalDialogElement=class extends K{render(){return u`<dialog><slot></slot></dialog>`}},n.UUIModalDialogElement.styles=[...K.styles,b`dialog{margin:auto;max-width:100%;max-height:100%;border-radius:12px}:host([index='0']) dialog{box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22))}:host(:not([index='0'])) dialog{outline:1px solid rgba(0,0,0,.1)}`],n.UUIModalDialogElement=Pd([m("uui-modal-dialog")],n.UUIModalDialogElement);let ze=class extends P{constructor(e,t={}){super(e,{bubbles:!0,...t})}};ze.CHANGE="change";var Ad=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,Ue=(i,e,t,r)=>{for(var o=r>1?void 0:r?Od(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Ad(e,t,o),o};const zd=45,Ar=(i,e,t)=>Math.min(Math.max(i,e),t),Td=(i,e)=>Array.from({length:e-i+1},(t,r)=>i+r);n.UUIPaginationElement=class extends v{constructor(){super(...arguments),this._observer=new ResizeObserver(this._calculateRange.bind(this)),this.label="",this.ariaLabel="",this._total=100,this._range=0,this._visiblePages=[],this._current=1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","navigation"),this._visiblePages=this._generateVisiblePages(this.current),U(this,"uui-button"),U(this,"uui-button-group")}disconnectedCallback(){this._observer.disconnect()}firstUpdated(){this._observer.observe(this._pagesGroup),this.updateLabel(),this._calculateRange()}willUpdate(e){(e.has("current")||e.has("label"))&&this.updateLabel()}updateLabel(){this.ariaLabel=`${this.label||"Pagination navigation"}. Current page: ${this.current}.`}_calculateRange(){const e=this.offsetWidth,t=Array.from(this._navButtons).reduce((o,s)=>o+s.getBoundingClientRect().width,0),r=(e-t)/zd/2;this._range=Math.max(1,Math.floor(r)),this._visiblePages=this._generateVisiblePages(this.current)}_generateVisiblePages(e){const t=e<this._range?1:e<this.total-this._range?e-this._range:this.total-this._range*2,r=e<=this._range?this._range*2+1:e<this.total-this._range?e+this._range:this.total;return Td(Ar(t,1,this.total),Ar(r,1,this.total))}get total(){return this._total}set total(e){this._total=e,this._visiblePages=this._generateVisiblePages(this._current),this.requestUpdate("total",e)}get current(){return this._current}set current(e){const t=this._current;this._current=Ar(e,1,this.total),this._visiblePages=this._generateVisiblePages(this._current),this.requestUpdate("current",t)}goToNextPage(){this.current++,this.dispatchEvent(new ze(ze.CHANGE))}goToPreviousPage(){this.current--,this.dispatchEvent(new ze(ze.CHANGE))}goToPage(e){this.current=e,this.dispatchEvent(new ze(ze.CHANGE))}focusActivePage(){requestAnimationFrame(()=>{const e=this.renderRoot.querySelector(".active");e&&e.focus()})}renderFirst(){return u`<uui-button compact="compact" look="outline" class="nav" role="listitem" label="Go to first page" ?disabled="${this._current===1}" @click="${()=>this.goToPage(1)}">First</uui-button>`}renderPrevious(){return u`<uui-button compact="compact" look="outline" class="nav" role="listitem" label="Go to previous page" ?disabled="${this._current===1}" @click="${this.goToPreviousPage}">Previous</uui-button>`}renderNext(){return u`<uui-button compact="compact" look="outline" role="listitem" class="nav" label="Go to next page" ?disabled="${this._current===this.total}" @click="${this.goToNextPage}">Next</uui-button>`}renderLast(){return u`<uui-button compact="compact" look="outline" role="listitem" class="nav" label="Go to last page" ?disabled="${this.total===this._current}" @click="${()=>this.goToPage(this.total)}">Last</uui-button>`}renderDots(){return u`<uui-button compact="compact" look="outline" role="listitem" tabindex="-1" class="dots" label="More pages">...</uui-button>`}renderPage(e){return u`<uui-button compact="compact" look="outline" role="listitem" label="Go to page ${e}" class="${"page"+(e===this._current?" active":"")}" tabindex="${e===this._current?"-1":""}" @click="${()=>{e!==this._current&&(this.goToPage(e),this.focusActivePage())}}">${e}</uui-button>`}renderNavigationLeft(){return u`${this.renderFirst()} ${this.renderPrevious()} ${this._visiblePages.includes(1)?"":this.renderDots()}`}renderNavigationRight(){return u`${this._visiblePages.includes(this.total)?"":this.renderDots()} ${this.renderNext()} ${this.renderLast()}`}render(){return u`<uui-button-group role="list" id="pages">${this.renderNavigationLeft()} ${this._visiblePages.map(e=>this.renderPage(e))} ${this.renderNavigationRight()}</uui-button-group>`}},n.UUIPaginationElement.styles=[b`uui-button-group{width:100%}uui-button{--uui-button-border-color:var(--uui-color-border-standalone,#c2c2c2);--uui-button-border-color-hover:var(--uui-color-interactive-emphasis,#3544b1);--uui-button-border-color-disabled:var(--uui-color-border-standalone,#c2c2c2)}.page{min-width:36px;max-width:72px}.page.active{--uui-button-background-color:var(--uui-color-current,#f5c1bc)}.nav{min-width:72px}.dots{pointer-events:none}.active{pointer-events:none}`],Ue([Wa("uui-button.nav")],n.UUIPaginationElement.prototype,"_navButtons",2),Ue([C("#pages")],n.UUIPaginationElement.prototype,"_pagesGroup",2),Ue([l()],n.UUIPaginationElement.prototype,"label",2),Ue([l({reflect:!0,attribute:"aria-label"})],n.UUIPaginationElement.prototype,"ariaLabel",2),Ue([l({type:Number})],n.UUIPaginationElement.prototype,"total",1),Ue([f()],n.UUIPaginationElement.prototype,"_range",2),Ue([f()],n.UUIPaginationElement.prototype,"_visiblePages",2),Ue([l({type:Number})],n.UUIPaginationElement.prototype,"current",1),n.UUIPaginationElement=Ue([m("uui-pagination")],n.UUIPaginationElement);let Or=class extends P{};Or.CLOSE="close";var Ld=Object.defineProperty,Md=Object.getOwnPropertyDescriptor,ei=(i,e,t,r)=>{for(var o=r>1?void 0:r?Md(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&&Ld(e,t,o),o};function Ji(i,e,t){return i<e?e:i>t?t:i}n.UUIPopoverElement=class extends v{constructor(){super(...arguments),this.scrollEventHandler=this._updatePlacement.bind(this),this._open=!1,this._placement="bottom-start",this._currentPlacement=null,this._scrollParents=[],this.margin=0,this._onTriggerSlotChanged=e=>{this._trigger=e.target.assignedElements({flatten:!0})[0]},this._intersectionCallback=e=>{e.forEach(t=>{t.isIntersecting===!1&&(this._startScrollListener(),this._updatePlacement())})},this._onKeyUp=e=>{if(e.key==="Escape"){this._triggerPopoverClose();return}},this._onDocumentClick=e=>{e.composedPath().includes(this)||this._triggerPopoverClose()}}get placement(){return this._placement}set placement(e){const t=this._placement;this._placement=e||"bottom-start",this._currentPlacement=null,this._updatePlacement(),this.requestUpdate("placement",t)}get open(){return this._open}set open(e){const t=this._open;this._open=e,e?this._openPopover():this._closePopover(),this.requestUpdate("open",t)}connectedCallback(){super.connectedCallback(),this._getScrollParents()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("scroll",this.scrollEventHandler),this.intersectionObserver&&(this.intersectionObserver.disconnect(),delete this.intersectionObserver),this._scrollParents=[]}_openPopover(){this.containerElement&&(this.containerElement.style.opacity="0",document.addEventListener("mousedown",this._onDocumentClick),document.addEventListener("keyup",this._onKeyUp),this._currentPlacement=null,requestAnimationFrame(()=>{this._updatePlacement(),this._createIntersectionObserver(),this.containerElement.style.opacity="1"}))}_closePopover(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),delete this.intersectionObserver),document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("keyup",this._onKeyUp),this._currentPlacement=null}_triggerPopoverClose(){const e=new Or(Or.CLOSE,{cancelable:!0});this.dispatchEvent(e),!e.defaultPrevented&&(this.open=!1)}_getScrollParents(){const e=this.shadowRoot.host;let t=getComputedStyle(e);if(t.position==="fixed")return;const r=t.position==="absolute",o=/(auto|scroll)/;let s=e;for(;s=s.parentElement;)if(t=getComputedStyle(s),!(r&&t.position==="static")&&(o.test(t.overflow+t.overflowY+t.overflowX)&&this._scrollParents.push(s),t.position==="fixed"))return;this._scrollParents.push(document.body)}_createIntersectionObserver(){if(this.intersectionObserver)return;const e={root:null,rootMargin:"0px",threshold:1};this.intersectionObserver=new IntersectionObserver(this._intersectionCallback,e),this.intersectionObserver.observe(this.containerElement)}_startScrollListener(){this._scrollParents.forEach(e=>{e.addEventListener("scroll",this.scrollEventHandler)}),document.addEventListener("scroll",this.scrollEventHandler)}_stopScrollListener(){this._scrollParents.forEach(e=>{e.removeEventListener("scroll",this.scrollEventHandler)}),document.removeEventListener("scroll",this.scrollEventHandler)}_updatePlacement(){if(!this.shadowRoot)return;const e=this.containerElement;if(!e)return;const t=this.containerElement?.getBoundingClientRect(),r=this._trigger?.getBoundingClientRect();if(r!=null&&t!=null){const o=this._scrollParents.map(be=>be.getBoundingClientRect());this._currentPlacement=this._currentPlacement||this._placement,this._placement!=="auto"&&(this._currentPlacement=this._managePlacementFlip(this._currentPlacement,t,o));let s=this._currentPlacement.indexOf("top")!==-1,a=this._currentPlacement.indexOf("bottom")!==-1,h=this._currentPlacement.indexOf("left")!==-1,c=this._currentPlacement.indexOf("right")!==-1;const d=this._currentPlacement.indexOf("-start")!==-1,y=this._currentPlacement.indexOf("-end")!==-1;let p=.5,g=.5,w=.5,k=.5,S=0,F=0;if(this.placement==="auto"){const be=this._scrollParents[0],hi=be.clientWidth,tt=be.clientHeight,Nt=r.x-t.width,Dt=hi-(r.x+r.width)-t.width,an=r.y-t.height,bo=tt-(r.y+r.height)-t.height;let mo=.5,go=.5;const Db=Math.max(Nt,Dt);let La=Math.max(an,bo);bo>an&&bo>this.margin&&(La+=9999),Db>La?(Nt>Dt?(mo=0,h=!0):(mo=1,c=!0),S=this.margin):(an>bo?(go=0,s=!0):(go=1,a=!0),F=this.margin),p=mo,g=go,w=1-mo,k=1-go}else s&&(k=1,g=0),a&&(k=0,g=1),(s||a)&&(F=this.margin,d&&(w=0,p=0),y&&(w=1,p=1)),h&&(w=1,p=0),c&&(w=0,p=1),(h||c)&&(S=this.margin,d&&(k=0,g=0),y&&(k=1,g=1));const Ie=-t.width*w+r.width*p-S*(w*2-1),xe=-t.height*k+r.height*g-F*(k*2-1);let Je=Ie,et=xe;s||a?(this._scrollParents.forEach((be,hi)=>{const tt=be===document.body?0:o[hi].x,Nt=-r.x+tt,Dt=be.clientWidth-r.x-r.width+Ie+tt-(t.width-r.width)*(1-p);Je=Ji(Je,Nt,Dt)}),Je=Ji(Je,-t.width,r.width)):(h||c)&&(this._scrollParents.forEach((be,hi)=>{const tt=be===document.body?0:o[hi].y,Nt=-r.y+tt,Dt=be.clientHeight-r.y-r.height+xe+tt-(t.height-r.height)*(1-g);et=Ji(et,Nt,Dt)}),et=Ji(et,-t.height,r.height)),(this._positionX!==Je||this._positionY!==et)&&(this._positionX=Je,this._positionY=et,Ie===Je&&xe===et&&this._stopScrollListener(),e.style.left=`${this._positionX}px`,e.style.top=`${this._positionY}px`)}}_managePlacementFlip(e,t,r){const o=e.split("-"),s=o[0],a=o[1]||null;let h;return this._scrollParents.some((c,d)=>{const y=c===document.body?0:r[d].x,p=c===document.body?0:r[d].y;return s==="top"&&t.y-2<=p?(h="bottom",!0):s==="bottom"&&t.y+t.height+2>=c.clientHeight+p?(h="top",!0):s==="left"&&t.x-2<=y?(h="right",!0):s==="right"&&t.x+t.width+2>=c.clientWidth+y?(h="left",!0):!1}),h?(this._startScrollListener(),h+(a?`-${a}`:"")):e}render(){return u`<slot id="trigger" name="trigger" @slotchange="${this._onTriggerSlotChanged}"></slot><div id="container">${this._open?u`<slot name="popover"></slot>`:""}</div>`}},n.UUIPopoverElement.styles=[b`:host{position:relative;display:inline-block;width:100%}#container{position:absolute;width:100%;z-index:var(--uui-popover-z-index,1)}slot[name=popover]{display:block}#trigger{position:relative;width:100%}slot[name=trigger]::slotted(uui-button){--uui-button-border-radius:var(
|
|
323
|
+
)}#menu-item{position:relative;padding-left:calc(var(--uui-menu-item-indent,0) * var(--uui-size-4,12px));display:grid;grid-template-columns:calc(var(--flat-structure-reversed) * var(--uui-size-8,24px)) 1fr;grid-template-rows:1fr;white-space:nowrap}:host(:not([active],[selected],[disabled])) #menu-item #caret-button:hover,:host(:not([active],[selected],[disabled],[select-mode=highlight])) #menu-item #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-hover,var(--uui-color-surface-emphasis,#fafafa))}:host(:not([active],[selected])) #menu-item #caret-button:hover,:host(:not([active],[selected],[disabled])) #menu-item #label-button:hover{color:var(--uui-menu-item-color-hover,var(--uui-color-interactive-emphasis,#3544b1))}:host([active]) #caret-button,:host([active]) #label-button{color:var(--uui-menu-item-color-active,var(--uui-color-current-contrast,#1b264f))}:host([active]) #label-button-background{background-color:var(--uui-menu-item-background-color-active,var(--uui-color-current,#f5c1bc))}:host([active]) #caret-button:hover,:host([active]) #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-active-hover,var(--uui-color-current-emphasis,#f8d6d3))}:host([disabled]) #menu-item{color:var(--uui-menu-item-color-disabled,var(--uui-color-disabled-contrast,#c4c4c4));background-color:var(--uui-menu-item-background-color-disabled,var(--uui-color-disabled,#f3f3f5))}:host([selected]:not([select-mode=highlight],[disabled])) #caret-button,:host([selected]:not([select-mode=highlight],[disabled])) #label-button{color:var(--uui-menu-item-color-selected,var(--uui-color-selected-contrast,#fff))}:host([selected]:not([select-mode=highlight],[disabled])) #label-button-background{background-color:var(--uui-menu-item-background-color-selected,var(--uui-color-selected,#3544b1))}:host([selected]:not([select-mode=highlight],[disabled])) #caret-button:hover,:host([selected]:not([select-mode=highlight],[disabled])) #label-button:hover~#label-button-background{background-color:var(--uui-menu-item-background-color-selected-hover,var(--uui-color-selected-emphasis,#4656c8))}:host([select-mode=highlight]:not([disabled],[active],[selectable])) #menu-item #label-button:hover~#label-button-background{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight,var(--uui-color-surface-emphasis,#fafafa))}:host([select-mode=highlight][active]:not([disabled])) #menu-item #label-button-background{border-radius:var(--uui-border-radius,3px)}:host([select-mode=highlight][active][selected]:not([disabled])) #menu-item #label-button:hover~#label-button-background{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight-active-selected,var(--uui-color-current-emphasis,#f8d6d3))}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #caret-button,:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button{color:var(--uui-menu-item-color-highlight-selected,var(--uui-color-interactive,#1b264f))}:host([select-mode=highlight][selectable][selected]:not([disabled])) #menu-item #label-button:hover{color:var(--uui-menu-item-background-color-highlight-selectable-selected,var(--uui-color-interactive-emphasis,#3544b1))}:host([selected][selectable][select-mode=highlight]:not([active])) #menu-item #caret-button:hover{border-radius:var(--uui-border-radius,3px);background-color:var(--uui-menu-item-background-color-highlight-selectable-selected,var(--uui-color-surface-emphasis,#fafafa));color:var(--uui-menu-item-color-highlight-selectable-selected,var(--uui-color-interactive-emphasis,#3544b1))}:host([select-mode=highlight]:not([disabled])) #menu-item #label-button-background::after{border-radius:var(--uui-border-radius,3px);position:absolute;content:'';inset:1px;border:2px solid var(--uui-menu-item-border-color-highlight,var(--uui-color-selected,#3544b1));opacity:0}:host([select-mode=highlight][selectable][selected]:not([disabled])) #menu-item #caret-button:hover::after{border-top-left-radius:var(--uui-border-radius,3px);border-bottom-left-radius:var(--uui-border-radius,3px);position:absolute;content:'';inset:1px 0 1px 1px;border:2px solid var(--uui-menu-item-border-color-highlight,var(--uui-color-selected,#3544b1));border-right:none}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button-background::after{opacity:1}:host([select-mode=highlight][selectable]:not([disabled])) #menu-item #label-button:hover~#label-button-background::after{opacity:.33}:host([select-mode=highlight][selected]:not([disabled])) #menu-item #label-button:hover~#label-button-background::after{opacity:.66}:host([disabled]) #label-button{cursor:default}button{display:inline-flex;align-items:center;font-family:inherit;font-size:inherit;padding:0;text-align:left;border:none;color:inherit;background-color:transparent;cursor:pointer;min-height:var(--uui-size-12,36px);z-index:1}#label-button{position:relative;flex-grow:1;grid-column-start:2;white-space:nowrap;overflow:hidden;padding-right:var(--uui-size-space-3,9px);padding-left:calc(var(--uui-menu-item-flat-structure) * var(--uui-size-space-3,9px));display:inline-flex;align-items:center;text-decoration:none;color:currentColor;min-height:var(--uui-size-12,36px);z-index:1;font-weight:inherit}#label-button .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}span#label-button{pointer-events:none}#caret-button{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--uui-color-interactive,#1b264f)}#label-button-background{position:absolute;top:0;left:0;right:0;bottom:0;border-radius:var(--uui-menu-item-border-radius,0)}#actions-container{opacity:0;transition:opacity 120ms;grid-column-start:3}:host(:not([disabled])) #menu-item:focus #actions-container,:host(:not([disabled])) #menu-item:focus-within #actions-container,:host(:not([disabled])) #menu-item:hover #actions-container{opacity:1}#loader{position:absolute;width:100%;bottom:0}#icon{display:inline-flex;font-size:16px;margin-right:var(--uui-size-2,6px)}#badge{font-size:12px;--uui-badge-position:relative;--uui-badge-position:auto;display:block;margin-left:6px}:host([select-mode=highlight]) #label-button:focus-visible{outline:0;overflow:initial}:host([select-mode=highlight]) #label-button:focus-visible::after{content:'';border-radius:calc(var(--uui-border-radius,3px) - 1px);position:absolute;inset:3px 3px 3px -5px;border:2px solid var(--uui-color-focus,#3879ff)}:host([select-mode=highlight]) #caret-button:focus-visible{outline:0;overflow:initial}:host([select-mode=highlight]) #caret-button:focus-visible::after{content:'';position:absolute;inset:3px;border-radius:calc(var(--uui-border-radius,3px) - 1px);border:2px solid var(--uui-color-focus,#3879ff)}slot:not([name]){position:relative;display:block;width:100%}slot:not([name]){--uui-menu-item-indent:var(--uui-menu-item-child-indent)}slot[name=actions]{display:flex;align-items:center;--uui-button-height:calc(var(--uui-size-base-unit) * 4);margin-right:var(--uui-size-base-unit)}`],_e([l({type:Boolean,reflect:!0})],n.UUIMenuItemElement.prototype,"disabled",2),_e([l({type:Boolean,reflect:!0,attribute:"show-children"})],n.UUIMenuItemElement.prototype,"showChildren",2),_e([l({type:Boolean,attribute:"has-children"})],n.UUIMenuItemElement.prototype,"hasChildren",2),_e([l({type:Boolean,attribute:"loading"})],n.UUIMenuItemElement.prototype,"loading",2),_e([l({type:String})],n.UUIMenuItemElement.prototype,"href",2),_e([l({type:String})],n.UUIMenuItemElement.prototype,"target",2),_e([l({type:String,attribute:"select-mode",reflect:!0})],n.UUIMenuItemElement.prototype,"selectMode",2),_e([f()],n.UUIMenuItemElement.prototype,"iconSlotHasContent",2),n.UUIMenuItemElement=_e([m("uui-menu-item")],n.UUIMenuItemElement);var _d=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,Ut=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ud(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&&_d(e,t,o),o};const Ke="uui:modal-close";let K=class extends v{constructor(){super(...arguments),this.isOpen=!1,this.isClosing=!1,this.index=0,this.uniqueIndex=0,this._transitionDuration=250,this.open=e=>{e?.preventDefault(),e?.stopImmediatePropagation();const t=new CustomEvent("open",{cancelable:!0});this.dispatchEvent(t),!t.defaultPrevented&&this._openModal()},this.close=e=>{e?.preventDefault(),e?.stopImmediatePropagation();const t=new CustomEvent(Ke,{cancelable:!0});this.dispatchEvent(t),!t.defaultPrevented&&this._closeModal()}}get transitionDuration(){return this._transitionDuration}set transitionDuration(e){this._transitionDuration=e,this.style.setProperty("--uui-modal-transition-duration",this._transitionDuration+"ms")}firstUpdated(e){super.firstUpdated(e),this.isClosing||this.open()}_openModal(){this.isOpen=!0,this._dialogElement?.showModal(),this._dialogElement?.addEventListener("cancel",this.close)}_closeModal(){this.isClosing=!0,this.isOpen=!1,this._dialogElement?.close(),this.dispatchEvent(new CustomEvent("close-end")),this.remove()}};K.styles=[b`dialog{display:block;margin:0;padding:0;max-width:unset;max-height:unset;border:none}dialog::backdrop{background:0 0;opacity:0}dialog::after{content:'';position:absolute;inset:0;background-color:var(--uui-modal-color-backdrop,rgba(0,0,0,.5));pointer-events:none;opacity:1;transition:opacity var(--uui-modal-transition-duration,250ms);z-index:1}:host([index='0']) dialog::after{opacity:0}`],Ut([C("dialog")],K.prototype,"_dialogElement",2),Ut([l({type:Boolean,reflect:!0,attribute:"is-open"})],K.prototype,"isOpen",2),Ut([l({type:Boolean,reflect:!0,attribute:"is-closing"})],K.prototype,"isClosing",2),Ut([l({type:Number,reflect:!0})],K.prototype,"index",2),Ut([l({type:Number,reflect:!0,attribute:"unique-index"})],K.prototype,"uniqueIndex",2),Ut([l({type:Number,attribute:"transition-duration"})],K.prototype,"transitionDuration",1);var Ed=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,ia=(i,e,t,r)=>{for(var o=r>1?void 0:r?$d(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&&Ed(e,t,o),o},oa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ra=(i,e,t)=>(oa(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},kd=(i,e,t)=>(oa(i,e,"access private method"),t),Ki,Ir,xr,sa;n.UUIModalSidebarElement=class extends K{constructor(){super(),na(this,Ki),na(this,xr),this.size="full",this.addEventListener(Ke,kd(this,xr,sa).bind(this))}firstUpdated(e){super.firstUpdated(e),this.style.setProperty("--uui-modal-offset",-ra(this,Ki,Ir)+"px")}updated(e){super.updated(e),this.uniqueIndex>10?this.setAttribute("hide",""):this.removeAttribute("hide")}render(){return u`<dialog><slot></slot></dialog>`}},Ki=new WeakSet,Ir=function(){return this._dialogElement?.getBoundingClientRect().width??0},xr=new WeakSet,sa=function(i){i.preventDefault(),!this.isClosing&&(this.isClosing=!0,this.style.setProperty("--uui-modal-offset",-ra(this,Ki,Ir)+"px"),setTimeout(()=>{this._closeModal()},this.transitionDuration))},n.UUIModalSidebarElement.styles=[...K.styles,b`:host{--uui-modal-sidebar-left-gap:24px}@media (min-width:600px){:host{--uui-modal-sidebar-left-gap:64px}}dialog{height:100%;width:100%;box-sizing:border-box;max-width:calc(100% - var(--uui-modal-sidebar-left-gap));margin-left:auto;right:var(--uui-modal-offset);transition:right var(--uui-modal-transition-duration,250ms)}:host([index='0']) dialog{box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22))}:host(:not([index='0'])) dialog{outline:1px solid rgba(0,0,0,.1)}:host([hide]) dialog{display:none}:host([size=large]) dialog{max-width:min(1200px,calc(100% - var(--uui-modal-sidebar-left-gap)))}:host([size=medium]) dialog{max-width:min(800px,calc(100% - var(--uui-modal-sidebar-left-gap)))}:host([size=small]) dialog{max-width:min(400px,calc(100% - var(--uui-modal-sidebar-left-gap)))}`],ia([l({reflect:!0})],n.UUIModalSidebarElement.prototype,"size",2),n.UUIModalSidebarElement=ia([m("uui-modal-sidebar")],n.UUIModalSidebarElement);var Id=Object.defineProperty,xd=Object.getOwnPropertyDescriptor,Et=(i,e,t,r)=>{for(var o=r>1?void 0:r?xd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Id(e,t,o),o},aa=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Jt=(i,e,t)=>(aa(i,e,"read from private field"),t?t.call(i):e.get(i)),Xi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yi=(i,e,t)=>(aa(i,e,"access private method"),t),Cr,$t,Zi,Sr,Qi,Pr;n.UUIModalContainerElement=class extends v{constructor(){super(),Xi(this,Zi),Xi(this,Qi),this.sidebarGap=64,this.transitionDurationMS=250,Xi(this,Cr,()=>{const e=this._modals??[];if(this._modals=this.modalSlot?.assignedElements({flatten:!0}).filter(t=>t instanceof K)??[],e.filter(t=>this._modals.indexOf(t)===-1).forEach(t=>t.removeEventListener(Ke,Jt(this,$t))),this._modals.filter(t=>e.indexOf(t)===-1).forEach(t=>t.addEventListener(Ke,Jt(this,$t))),this._sidebars=this._modals.filter(t=>t instanceof n.UUIModalSidebarElement),this._modals.length===0){this.removeAttribute("backdrop");return}Yi(this,Zi,Sr).call(this),Yi(this,Qi,Pr).call(this)}),Xi(this,$t,e=>{if(e.stopImmediatePropagation(),e.target?.removeEventListener(Ke,Jt(this,$t)),!this._modals||this._modals.length<=1){this.removeAttribute("backdrop");return}Yi(this,Zi,Sr).call(this),Yi(this,Qi,Pr).call(this)}),this.addEventListener(Ke,Jt(this,$t))}firstUpdated(e){super.firstUpdated(e),this.style.setProperty("--uui-modal-transition-duration",this.transitionDurationMS+"ms")}render(){return u`<slot @slotchange="${Jt(this,Cr)}"></slot>`}},Cr=new WeakMap,$t=new WeakMap,Zi=new WeakSet,Sr=function(){this.setAttribute("backdrop","");const i=this._modals?.filter(e=>!e.isClosing).reverse()??[];i?.forEach((e,t)=>{e.index=t,e.transitionDuration=this.transitionDurationMS}),i?.forEach(e=>{const t=i?.filter(r=>r.constructor.name===e.constructor.name);e.uniqueIndex=t?.indexOf(e)??0})},Qi=new WeakSet,Pr=function(){requestAnimationFrame(()=>{let i=0;const e=this._sidebars?.filter(t=>!t.isClosing).reverse()??[];for(let t=0;t<e.length;t++){const r=e[t],o=e[t+1],s=i;if(r.updateComplete.then(()=>{r.style.setProperty("--uui-modal-offset",s+"px")}),o?.hasAttribute("hide"))break;const a=r.shadowRoot?.querySelector("dialog")?.getBoundingClientRect().width??0,h=o?.shadowRoot?.querySelector("dialog")?.getBoundingClientRect().width??0,c=a+i+this.sidebarGap-h;i=c>0?c:0}})},n.UUIModalContainerElement.styles=b`:host{position:fixed;--uui-modal-color-backdrop:rgba(0, 0, 0, 0.5)}:host::after{content:'';position:fixed;inset:0;background-color:var(--uui-modal-color-backdrop,rgba(0,0,0,.5));opacity:0;pointer-events:none;transition:opacity var(--uui-modal-transition-duration,250ms)}:host([backdrop])::after{opacity:1}`,Et([C("slot")],n.UUIModalContainerElement.prototype,"modalSlot",2),Et([f()],n.UUIModalContainerElement.prototype,"_modals",2),Et([f()],n.UUIModalContainerElement.prototype,"_sidebars",2),Et([l({type:Number})],n.UUIModalContainerElement.prototype,"sidebarGap",2),Et([l({type:Number})],n.UUIModalContainerElement.prototype,"transitionDurationMS",2),n.UUIModalContainerElement=Et([m("uui-modal-container")],n.UUIModalContainerElement);var Cd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Pd=(i,e,t,r)=>{for(var o=r>1?void 0:r?Sd(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&&Cd(e,t,o),o};n.UUIModalDialogElement=class extends K{render(){return u`<dialog><slot></slot></dialog>`}},n.UUIModalDialogElement.styles=[...K.styles,b`dialog{margin:auto;max-width:100%;max-height:100%;border-radius:12px}:host([index='0']) dialog{box-shadow:var(--uui-shadow-depth-5,0 19px 38px rgba(0,0,0,.3) ,0 15px 12px rgba(0,0,0,.22))}:host(:not([index='0'])) dialog{outline:1px solid rgba(0,0,0,.1)}`],n.UUIModalDialogElement=Pd([m("uui-modal-dialog")],n.UUIModalDialogElement);let ze=class extends P{constructor(e,t={}){super(e,{bubbles:!0,...t})}};ze.CHANGE="change";var Ad=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,Ue=(i,e,t,r)=>{for(var o=r>1?void 0:r?Od(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&Ad(e,t,o),o};const zd=45,Ar=(i,e,t)=>Math.min(Math.max(i,e),t),Td=(i,e)=>Array.from({length:e-i+1},(t,r)=>i+r);n.UUIPaginationElement=class extends v{constructor(){super(...arguments),this._observer=new ResizeObserver(this._calculateRange.bind(this)),this.label="",this.ariaLabel="",this._total=100,this._range=0,this._visiblePages=[],this._current=1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","navigation"),this._visiblePages=this._generateVisiblePages(this.current),U(this,"uui-button"),U(this,"uui-button-group")}disconnectedCallback(){this._observer.disconnect()}firstUpdated(){this._observer.observe(this._pagesGroup),this.updateLabel(),this._calculateRange()}willUpdate(e){(e.has("current")||e.has("label"))&&this.updateLabel()}updateLabel(){this.ariaLabel=`${this.label||"Pagination navigation"}. Current page: ${this.current}.`}_calculateRange(){const e=this.offsetWidth,t=Array.from(this._navButtons).reduce((o,s)=>o+s.getBoundingClientRect().width,0),r=(e-t)/zd/2;this._range=Math.max(1,Math.floor(r)),this._visiblePages=this._generateVisiblePages(this.current)}_generateVisiblePages(e){const t=e<this._range?1:e<this.total-this._range?e-this._range:this.total-this._range*2,r=e<=this._range?this._range*2+1:e<this.total-this._range?e+this._range:this.total;return Td(Ar(t,1,this.total),Ar(r,1,this.total))}get total(){return this._total}set total(e){this._total=e,this._visiblePages=this._generateVisiblePages(this._current),this.requestUpdate("total",e)}get current(){return this._current}set current(e){const t=this._current;this._current=Ar(e,1,this.total),this._visiblePages=this._generateVisiblePages(this._current),this.requestUpdate("current",t)}goToNextPage(){this.current++,this.dispatchEvent(new ze(ze.CHANGE))}goToPreviousPage(){this.current--,this.dispatchEvent(new ze(ze.CHANGE))}goToPage(e){this.current=e,this.dispatchEvent(new ze(ze.CHANGE))}focusActivePage(){requestAnimationFrame(()=>{const e=this.renderRoot.querySelector(".active");e&&e.focus()})}renderFirst(){return u`<uui-button compact="compact" look="outline" class="nav" role="listitem" label="Go to first page" ?disabled="${this._current===1}" @click="${()=>this.goToPage(1)}">First</uui-button>`}renderPrevious(){return u`<uui-button compact="compact" look="outline" class="nav" role="listitem" label="Go to previous page" ?disabled="${this._current===1}" @click="${this.goToPreviousPage}">Previous</uui-button>`}renderNext(){return u`<uui-button compact="compact" look="outline" role="listitem" class="nav" label="Go to next page" ?disabled="${this._current===this.total}" @click="${this.goToNextPage}">Next</uui-button>`}renderLast(){return u`<uui-button compact="compact" look="outline" role="listitem" class="nav" label="Go to last page" ?disabled="${this.total===this._current}" @click="${()=>this.goToPage(this.total)}">Last</uui-button>`}renderDots(){return u`<uui-button compact="compact" look="outline" role="listitem" tabindex="-1" class="dots" label="More pages">...</uui-button>`}renderPage(e){return u`<uui-button compact="compact" look="outline" role="listitem" label="Go to page ${e}" class="${"page"+(e===this._current?" active":"")}" tabindex="${e===this._current?"-1":""}" @click="${()=>{e!==this._current&&(this.goToPage(e),this.focusActivePage())}}">${e}</uui-button>`}renderNavigationLeft(){return u`${this.renderFirst()} ${this.renderPrevious()} ${this._visiblePages.includes(1)?"":this.renderDots()}`}renderNavigationRight(){return u`${this._visiblePages.includes(this.total)?"":this.renderDots()} ${this.renderNext()} ${this.renderLast()}`}render(){return u`<uui-button-group role="list" id="pages">${this.renderNavigationLeft()} ${this._visiblePages.map(e=>this.renderPage(e))} ${this.renderNavigationRight()}</uui-button-group>`}},n.UUIPaginationElement.styles=[b`uui-button-group{width:100%}uui-button{--uui-button-border-color:var(--uui-color-border-standalone,#c2c2c2);--uui-button-border-color-hover:var(--uui-color-interactive-emphasis,#3544b1);--uui-button-border-color-disabled:var(--uui-color-border-standalone,#c2c2c2)}.page{min-width:36px;max-width:72px}.page.active{--uui-button-background-color:var(--uui-color-current,#f5c1bc)}.nav{min-width:72px}.dots{pointer-events:none}.active{pointer-events:none}`],Ue([Wa("uui-button.nav")],n.UUIPaginationElement.prototype,"_navButtons",2),Ue([C("#pages")],n.UUIPaginationElement.prototype,"_pagesGroup",2),Ue([l()],n.UUIPaginationElement.prototype,"label",2),Ue([l({reflect:!0,attribute:"aria-label"})],n.UUIPaginationElement.prototype,"ariaLabel",2),Ue([l({type:Number})],n.UUIPaginationElement.prototype,"total",1),Ue([f()],n.UUIPaginationElement.prototype,"_range",2),Ue([f()],n.UUIPaginationElement.prototype,"_visiblePages",2),Ue([l({type:Number})],n.UUIPaginationElement.prototype,"current",1),n.UUIPaginationElement=Ue([m("uui-pagination")],n.UUIPaginationElement);let Or=class extends P{};Or.CLOSE="close";var Ld=Object.defineProperty,Md=Object.getOwnPropertyDescriptor,ei=(i,e,t,r)=>{for(var o=r>1?void 0:r?Md(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&&Ld(e,t,o),o};function Ji(i,e,t){return i<e?e:i>t?t:i}n.UUIPopoverElement=class extends v{constructor(){super(...arguments),this.scrollEventHandler=this._updatePlacement.bind(this),this._open=!1,this._placement="bottom-start",this._currentPlacement=null,this._scrollParents=[],this.margin=0,this._onTriggerSlotChanged=e=>{this._trigger=e.target.assignedElements({flatten:!0})[0]},this._intersectionCallback=e=>{e.forEach(t=>{t.isIntersecting===!1&&(this._startScrollListener(),this._updatePlacement())})},this._onKeyUp=e=>{if(e.key==="Escape"){this._triggerPopoverClose();return}},this._onDocumentClick=e=>{e.composedPath().includes(this)||this._triggerPopoverClose()}}get placement(){return this._placement}set placement(e){const t=this._placement;this._placement=e||"bottom-start",this._currentPlacement=null,this._updatePlacement(),this.requestUpdate("placement",t)}get open(){return this._open}set open(e){const t=this._open;this._open=e,e?this._openPopover():this._closePopover(),this.requestUpdate("open",t)}connectedCallback(){super.connectedCallback(),this._getScrollParents()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("scroll",this.scrollEventHandler),this.intersectionObserver&&(this.intersectionObserver.disconnect(),delete this.intersectionObserver),this._scrollParents=[]}_openPopover(){this.containerElement&&(this.containerElement.style.opacity="0",document.addEventListener("mousedown",this._onDocumentClick),document.addEventListener("keyup",this._onKeyUp),this._currentPlacement=null,requestAnimationFrame(()=>{this._updatePlacement(),this._createIntersectionObserver(),this.containerElement.style.opacity="1"}))}_closePopover(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),delete this.intersectionObserver),document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("keyup",this._onKeyUp),this._currentPlacement=null}_triggerPopoverClose(){const e=new Or(Or.CLOSE,{cancelable:!0});this.dispatchEvent(e),!e.defaultPrevented&&(this.open=!1)}_getScrollParents(){const e=this.shadowRoot.host;let t=getComputedStyle(e);if(t.position==="fixed")return;const r=t.position==="absolute",o=/(auto|scroll)/;let s=e;for(;s=s.parentElement;)if(t=getComputedStyle(s),!(r&&t.position==="static")&&(o.test(t.overflow+t.overflowY+t.overflowX)&&this._scrollParents.push(s),t.position==="fixed"))return;this._scrollParents.push(document.body)}_createIntersectionObserver(){if(this.intersectionObserver)return;const e={root:null,rootMargin:"0px",threshold:1};this.intersectionObserver=new IntersectionObserver(this._intersectionCallback,e),this.intersectionObserver.observe(this.containerElement)}_startScrollListener(){this._scrollParents.forEach(e=>{e.addEventListener("scroll",this.scrollEventHandler)}),document.addEventListener("scroll",this.scrollEventHandler)}_stopScrollListener(){this._scrollParents.forEach(e=>{e.removeEventListener("scroll",this.scrollEventHandler)}),document.removeEventListener("scroll",this.scrollEventHandler)}_updatePlacement(){if(!this.shadowRoot)return;const e=this.containerElement;if(!e)return;const t=this.containerElement?.getBoundingClientRect(),r=this._trigger?.getBoundingClientRect();if(r!=null&&t!=null){const o=this._scrollParents.map(be=>be.getBoundingClientRect());this._currentPlacement=this._currentPlacement||this._placement,this._placement!=="auto"&&(this._currentPlacement=this._managePlacementFlip(this._currentPlacement,t,o));let s=this._currentPlacement.indexOf("top")!==-1,a=this._currentPlacement.indexOf("bottom")!==-1,h=this._currentPlacement.indexOf("left")!==-1,c=this._currentPlacement.indexOf("right")!==-1;const d=this._currentPlacement.indexOf("-start")!==-1,y=this._currentPlacement.indexOf("-end")!==-1;let p=.5,g=.5,w=.5,k=.5,S=0,F=0;if(this.placement==="auto"){const be=this._scrollParents[0],hi=be.clientWidth,tt=be.clientHeight,Nt=r.x-t.width,Dt=hi-(r.x+r.width)-t.width,an=r.y-t.height,bo=tt-(r.y+r.height)-t.height;let mo=.5,go=.5;const Db=Math.max(Nt,Dt);let La=Math.max(an,bo);bo>an&&bo>this.margin&&(La+=9999),Db>La?(Nt>Dt?(mo=0,h=!0):(mo=1,c=!0),S=this.margin):(an>bo?(go=0,s=!0):(go=1,a=!0),F=this.margin),p=mo,g=go,w=1-mo,k=1-go}else s&&(k=1,g=0),a&&(k=0,g=1),(s||a)&&(F=this.margin,d&&(w=0,p=0),y&&(w=1,p=1)),h&&(w=1,p=0),c&&(w=0,p=1),(h||c)&&(S=this.margin,d&&(k=0,g=0),y&&(k=1,g=1));const Ie=-t.width*w+r.width*p-S*(w*2-1),xe=-t.height*k+r.height*g-F*(k*2-1);let Je=Ie,et=xe;s||a?(this._scrollParents.forEach((be,hi)=>{const tt=be===document.body?0:o[hi].x,Nt=-r.x+tt,Dt=be.clientWidth-r.x-r.width+Ie+tt-(t.width-r.width)*(1-p);Je=Ji(Je,Nt,Dt)}),Je=Ji(Je,-t.width,r.width)):(h||c)&&(this._scrollParents.forEach((be,hi)=>{const tt=be===document.body?0:o[hi].y,Nt=-r.y+tt,Dt=be.clientHeight-r.y-r.height+xe+tt-(t.height-r.height)*(1-g);et=Ji(et,Nt,Dt)}),et=Ji(et,-t.height,r.height)),(this._positionX!==Je||this._positionY!==et)&&(this._positionX=Je,this._positionY=et,Ie===Je&&xe===et&&this._stopScrollListener(),e.style.left=`${this._positionX}px`,e.style.top=`${this._positionY}px`)}}_managePlacementFlip(e,t,r){const o=e.split("-"),s=o[0],a=o[1]||null;let h;return this._scrollParents.some((c,d)=>{const y=c===document.body?0:r[d].x,p=c===document.body?0:r[d].y;return s==="top"&&t.y-2<=p?(h="bottom",!0):s==="bottom"&&t.y+t.height+2>=c.clientHeight+p?(h="top",!0):s==="left"&&t.x-2<=y?(h="right",!0):s==="right"&&t.x+t.width+2>=c.clientWidth+y?(h="left",!0):!1}),h?(this._startScrollListener(),h+(a?`-${a}`:"")):e}render(){return u`<slot id="trigger" name="trigger" @slotchange="${this._onTriggerSlotChanged}"></slot><div id="container">${this._open?u`<slot name="popover"></slot>`:""}</div>`}},n.UUIPopoverElement.styles=[b`:host{position:relative;display:inline-block;width:100%}#container{position:absolute;width:100%;z-index:var(--uui-popover-z-index,1)}slot[name=popover]{display:block}#trigger{position:relative;width:100%}slot[name=trigger]::slotted(uui-button){--uui-button-border-radius:var(
|
|
325
324
|
--uui-popover-toggle-slot-button-border-radius
|
|
326
325
|
);--uui-button-merge-border-left:var(
|
|
327
326
|
--uui-popover-toggle-slot-button-merge-border-left
|