mdui 2.0.0 → 2.0.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/LICENSE +21 -21
- package/custom-elements.json +1579 -1579
- package/html-data.zh-cn.json +242 -242
- package/mdui.esm.js +7 -7
- package/mdui.global.js +2 -2
- package/package.json +3 -3
- package/web-types.zh-cn.json +387 -387
package/mdui.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* mdui 2.0.
|
|
2
|
+
* mdui 2.0.1 (https://www.mdui.org)
|
|
3
3
|
* Copyright 2016-2023 zdhxiong <zdhxiong@gmail.com>
|
|
4
4
|
* Licensed under MIT
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--mdui-color-on-secondary-container
|
|
10
10
|
)}:host([variant=outlined][selected]){border:none;color:rgb(var(--mdui-color-inverse-on-surface));background-color:rgb(var(--mdui-color-inverse-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-inverse-on-surface)}:host([variant=filled][disabled]),:host([variant=outlined][disabled]),:host([variant=tonal][disabled]){background-color:rgba(var(--mdui-color-on-surface),.12);border-color:rgba(var(--mdui-color-on-surface),.12)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){color:rgba(var(--mdui-color-on-surface),.38)!important}:host([loading]) .button,:host([loading]) mdui-ripple{opacity:0}.button{float:left;width:100%}.icon,.selected-icon mdui-icon,::slotted(*){font-size:inherit}mdui-circular-progress{display:flex;position:absolute;top:calc(50% - 1.5rem / 2);left:calc(50% - 1.5rem / 2);width:1.5rem;height:1.5rem}:host([variant=filled]:not([disabled])) mdui-circular-progress{stroke:rgb(var(--mdui-color-on-primary))}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}`;e.ButtonIcon=class extends qi{constructor(){super(...arguments),this.variant="standard",this.selectable=!1,this.selected=!1,this.rippleRef=Ei(),this.hasSlotController=new jt(this,"[default]","selected-icon")}get rippleElement(){return this.rippleRef.value}onSelectedChange(){vi(this,"change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",(()=>{this.selectable&&!this.disabled&&(this.selected=!this.selected)}))}render(){return ct`<mdui-ripple ${Pi(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:"button",part:"button",content:this.renderIcon()}):this.disabled||this.loading?ct`<span part="button" class="button _a">${this.renderIcon()}</span>`:this.renderAnchor({className:"button",part:"button",content:this.renderIcon()})} ${this.renderLoading()}`}renderIcon(){const e=()=>this.hasSlotController.test("[default]")?ct`<slot></slot>`:this.icon?ct`<mdui-icon part="icon" class="icon" name="${this.icon}"></mdui-icon>`:Gt;return this.selected?(()=>this.hasSlotController.test("selected-icon")||this.selectedIcon?ct`<slot name="selected-icon" part="selected-icon" class="selected-icon"><mdui-icon name="${this.selectedIcon}"></mdui-icon></slot>`:e())():e()}},e.ButtonIcon.styles=[qi.styles,Gi],Re([Pt({reflect:!0})],e.ButtonIcon.prototype,"variant",void 0),Re([Pt({reflect:!0})],e.ButtonIcon.prototype,"icon",void 0),Re([Pt({reflect:!0,attribute:"selected-icon"})],e.ButtonIcon.prototype,"selectedIcon",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.ButtonIcon.prototype,"selectable",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.ButtonIcon.prototype,"selected",void 0),Re([fi("selected",!0)],e.ButtonIcon.prototype,"onSelectedChange",null),e.ButtonIcon=Re([Et("mdui-button-icon")],e.ButtonIcon);const Wi=Pe`:host{--shape-corner:var(--mdui-shape-corner-medium);position:relative;display:inline-block;overflow:hidden;border-radius:var(--shape-corner);-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([clickable]){cursor:pointer}:host([variant=elevated]){background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([variant=filled]){background-color:rgb(var(--mdui-color-surface-container-highest))}:host([variant=outlined]){background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline))}:host([variant=elevated][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=filled][hover]),:host([variant=outlined][hover]){box-shadow:var(--mdui-elevation-level1)}:host([variant=elevated][dragged]),:host([variant=filled][dragged]),:host([variant=outlined][dragged]){box-shadow:var(--mdui-elevation-level3)}:host([disabled]){opacity:.38;cursor:default;-webkit-user-select:none;user-select:none}:host([variant=elevated][disabled]){background-color:rgb(var(--mdui-color-surface-variant));box-shadow:var(--mdui-elevation-level0)}:host([variant=filled][disabled]){background-color:rgb(var(--mdui-color-surface));box-shadow:var(--mdui-elevation-level1)}:host([variant=outlined][disabled]){box-shadow:var(--mdui-elevation-level0);border-color:rgba(var(--mdui-color-outline),.32)}.link{position:relative;display:inline-block;width:100%;height:100%;color:inherit;font-size:inherit;letter-spacing:inherit;text-decoration:none;touch-action:manipulation;-webkit-user-drag:none}`;e.Card=class extends(_i(Ki(Fi(St)))){constructor(){super(...arguments),this.variant="elevated",this.clickable=!1,this.disabled=!1,this.rippleRef=Ei()}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled||!this.href&&!this.clickable}get focusElement(){return this}get focusDisabled(){return this.rippleDisabled}render(){return ct`<mdui-ripple ${Pi(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.href&&!this.disabled?this.renderAnchor({className:"link",content:ct`<slot></slot>`}):ct`<slot></slot>`}`}},e.Card.styles=[Wt,Wi],Re([Pt({reflect:!0})],e.Card.prototype,"variant",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Card.prototype,"clickable",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Card.prototype,"disabled",void 0),e.Card=Re([Et("mdui-card")],e.Card);const Yi=Vt(class extends Ht{constructor(e){if(super(e),e.type!==Ft&&e.type!==Ot&&e.type!==Nt)throw Error("The `live` directive is not allowed on child or event bindings");if(!Zt(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===dt||t===ht)return t;const i=e.element,o=e.name;if(e.type===Ft){if(t===i[o])return dt}else if(e.type===Nt){if(!!t===i.hasAttribute(o))return dt}else if(e.type===Ot&&i.getAttribute(o)===t+"")return dt;return((e,t=Qt)=>{e._$AH=t})(e),t}});function Xi(e="value"){return(t,i)=>{const o=t.constructor,r=o.prototype.attributeChangedCallback;o.prototype.attributeChangedCallback=function(t,n,s){var a;const d=o.getPropertyOptions(e);if(t===(c(d.attribute)?d.attribute:e)){const t=d.converter||ze,o=(l(t)?t:null!==(a=null==t?void 0:t.fromAttribute)&&void 0!==a?a:ze.fromAttribute)(s,d.type);this[e]!==o&&(this[i]=o)}r.call(this,t,n,s)}}}const Ji=Pe`:host{display:inline-block;width:1em;height:1em;line-height:1;font-size:1.5rem}`,Zi=e=>ct`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor">${Jt(e)}</svg>`;let Qi=class extends St{render(){return Zi('<path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"/>')}};Qi.styles=Ji,Qi=Re([Et("mdui-icon-check-box-outline-blank")],Qi);let eo=class extends St{render(){return Zi('<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>')}};eo.styles=Ji,eo=Re([Et("mdui-icon-check-box")],eo);let to=class extends St{render(){return Zi('<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"/>')}};to.styles=Ji,to=Re([Et("mdui-icon-indeterminate-check-box")],to);const io=Pe`:host{position:relative;display:inline-flex;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:.125rem;font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}label{display:inline-flex;align-items:center;width:100%;cursor:inherit;-webkit-user-select:none;user-select:none;touch-action:manipulation;zoom:1;-webkit-user-drag:none}input{position:absolute;padding:0;opacity:0;pointer-events:none;width:1.125rem;height:1.125rem;margin:0 0 0 .6875rem}.icon{display:flex;position:absolute;opacity:1;transform:scale(1);color:rgb(var(--mdui-color-on-surface));font-size:1.5rem;transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}.checked-icon,.indeterminate-icon{opacity:0;transform:scale(.5);transition-property:color,opacity,transform;transition-duration:var(--mdui-motion-duration-short4);transition-timing-function:var(--mdui-motion-easing-standard)}.icon .i,::slotted([slot=checked-icon]),::slotted([slot=indeterminate-icon]),::slotted([slot=unchecked-icon]){color:inherit;font-size:inherit}i{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%;width:2.5rem;min-width:2.5rem;height:2.5rem;--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}.label{display:flex;width:100%;padding-top:.625rem;padding-bottom:.625rem;color:rgb(var(--mdui-color-on-surface));transition:color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-standard)}:host([checked]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([checked]) .icon{color:rgb(var(--mdui-color-primary))}:host([checked]) .indeterminate-icon{opacity:0;transform:scale(.5)}:host([checked]) .checked-icon{opacity:1;transform:scale(1)}:host([indeterminate]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([indeterminate]) .icon{color:rgb(var(--mdui-color-primary))}:host([indeterminate]) .checked-icon{opacity:0;transform:scale(.5)}:host([indeterminate]) .indeterminate-icon{opacity:1;transform:scale(1)}:host([invalid]) i{--mdui-comp-ripple-state-layer-color:var(--mdui-color-error)}:host([invalid]) .icon{color:rgb(var(--mdui-color-error))}:host([invalid]) .label{color:rgb(var(--mdui-color-error))}:host([disabled]){cursor:default;pointer-events:none}:host([disabled]) .icon{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled]) .label{color:rgba(var(--mdui-color-on-surface),38%)}:host([disabled][checked]) .unchecked-icon,:host([disabled][indeterminate]) .unchecked-icon{opacity:0}`;e.Checkbox=class extends(Ki(Fi(St))){constructor(){super(...arguments),this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.indeterminate=!1,this.required=!1,this.name="",this.value="on",this.invalid=!1,this.inputRef=Ei(),this.rippleRef=Ei(),this.formController=new Li(this,{value:e=>e.checked?e.value:void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t})}get validity(){return this.inputRef.value.validity}get validationMessage(){return this.inputRef.value.validationMessage}get rippleElement(){return this.rippleRef.value}get rippleDisabled(){return this.disabled}get focusElement(){return this.inputRef.value}get focusDisabled(){return this.disabled}async onDisabledChange(){await this.updateComplete,this.invalid=!this.inputRef.value.checkValidity()}async onCheckedChange(){var e;await this.updateComplete;const t=this.formController.getForm();t&&(null===(e=Bi.get(t))||void 0===e?void 0:e.has(this))?(this.invalid=!1,Bi.get(t).delete(this)):this.invalid=!this.inputRef.value.checkValidity()}checkValidity(){const e=this.inputRef.value.checkValidity();return e||vi(this,"invalid",{bubbles:!1,cancelable:!0,composed:!1}),e}reportValidity(){if(this.invalid=!this.inputRef.value.reportValidity(),this.invalid){vi(this,"invalid",{bubbles:!1,cancelable:!0,composed:!1}).defaultPrevented&&(this.blur(),this.focus())}return!this.invalid}setCustomValidity(e){this.inputRef.value.setCustomValidity(e),this.invalid=!this.inputRef.value.checkValidity()}render(){return ct`<label><input ${Pi(this.inputRef)} type="checkbox" name="${_t(this.name)}" value="${_t(this.value)}" .indeterminate="${Yi(this.indeterminate)}" .disabled="${this.disabled}" .checked="${Yi(this.checked)}" .required="${this.required}" @change="${this.onChange}"> <i part="control"><mdui-ripple ${Pi(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple><slot name="unchecked-icon" part="unchecked-icon" class="icon unchecked-icon">${this.uncheckedIcon?ct`<mdui-icon name="${this.uncheckedIcon}" class="i"></mdui-icon>`:ct`<mdui-icon-check-box-outline-blank class="i"></mdui-icon-check-box-outline-blank>`}</slot><slot name="checked-icon" part="checked-icon" class="icon checked-icon">${this.checkedIcon?ct`<mdui-icon name="${this.checkedIcon}" class="i"></mdui-icon>`:ct`<mdui-icon-check-box class="i"></mdui-icon-check-box>`}</slot><slot name="indeterminate-icon" part="indeterminate-icon" class="icon indeterminate-icon">${this.indeterminateIcon?ct`<mdui-icon name="${this.indeterminateIcon}" class="i"></mdui-icon>`:ct`<mdui-icon-indeterminate-check-box class="i"></mdui-icon-indeterminate-check-box>`}</slot></i><slot part="label" class="label"></slot></label>`}onChange(){this.checked=this.inputRef.value.checked,this.indeterminate=!1,vi(this,"change")}},e.Checkbox.styles=[Wt,io],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Checkbox.prototype,"disabled",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Checkbox.prototype,"checked",void 0),Re([Xi("checked")],e.Checkbox.prototype,"defaultChecked",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Checkbox.prototype,"indeterminate",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Checkbox.prototype,"required",void 0),Re([Pt({reflect:!0})],e.Checkbox.prototype,"form",void 0),Re([Pt({reflect:!0})],e.Checkbox.prototype,"name",void 0),Re([Pt({reflect:!0})],e.Checkbox.prototype,"value",void 0),Re([Pt({reflect:!0,attribute:"unchecked-icon"})],e.Checkbox.prototype,"uncheckedIcon",void 0),Re([Pt({reflect:!0,attribute:"checked-icon"})],e.Checkbox.prototype,"checkedIcon",void 0),Re([Pt({reflect:!0,attribute:"indeterminate-icon"})],e.Checkbox.prototype,"indeterminateIcon",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Checkbox.prototype,"invalid",void 0),Re([fi("disabled",!0),fi("indeterminate",!0),fi("required",!0)],e.Checkbox.prototype,"onDisabledChange",null),Re([fi("checked",!0)],e.Checkbox.prototype,"onCheckedChange",null),e.Checkbox=Re([Et("mdui-checkbox")],e.Checkbox);let oo=class extends St{render(){return Zi('<path d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>')}};oo.styles=Ji,oo=Re([Et("mdui-icon-check")],oo);let ro=class extends St{render(){return Zi('<path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>')}};ro.styles=Ji,ro=Re([Et("mdui-icon-clear")],ro);const no=Pe`:host{--shape-corner:var(--mdui-shape-corner-small);position:relative;display:inline-block;overflow:hidden;border-radius:var(--shape-corner);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:box-shadow var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);height:2rem;background-color:rgb(var(--mdui-color-surface));border:.0625rem solid rgb(var(--mdui-color-outline));color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height);--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface-variant)}.button{padding-right:.4375rem;padding-left:.4375rem}:host([variant=input]) .button{padding-right:.1875rem;padding-left:.1875rem}:host([selected]) .button{padding-right:.5rem;padding-left:.5rem}:host([selected][variant=input]) .button{padding-right:.25rem;padding-left:.25rem}:host([elevated]) .button{padding-right:.5rem;padding-left:.5rem}:host([variant=assist]){color:rgb(var(--mdui-color-on-surface));--mdui-comp-ripple-state-layer-color:var(--mdui-color-on-surface)}:host([elevated]){border-width:0;background-color:rgb(var(--mdui-color-surface-container-low));box-shadow:var(--mdui-elevation-level1)}:host([selected]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));border-width:0;--mdui-comp-ripple-state-layer-color:var(
|
|
11
11
|
--mdui-color-on-secondary-container
|
|
12
|
-
)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){border-color:rgba(var(--mdui-color-on-surface),12%);color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([disabled][elevated]),:host([disabled][selected]){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([selected][hover]){box-shadow:var(--mdui-elevation-level1)}:host([elevated][hover]){color:rgb(var(--mdui-color-on-secondary-container));box-shadow:var(--mdui-elevation-level2)}:host([variant=filter][hover]),:host([variant=input][hover]),:host([variant=suggestion][hover]){color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=filter][focus-visible]),:host([variant=input][focus-visible]),:host([variant=suggestion][focus-visible]){border-color:rgb(var(--mdui-color-on-surface-variant))}:host([dragged]),:host([dragged][hover]){box-shadow:var(--mdui-elevation-level4)}.button{overflow:visible}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon,.selected-icon{display:inline-flex;font-size:1.28571429em;color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=assist]) .end-icon,:host([variant=assist]) .icon,:host([variant=assist]) .selected-icon{color:rgb(var(--mdui-color-primary))}:host([selected]) .end-icon,:host([selected]) .icon,:host([selected]) .selected-icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]) .end-icon,:host([disabled]) .icon,:host([disabled]) .selected-icon{opacity:.38;color:rgb(var(--mdui-color-on-surface))}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}:host([variant=input]) .has-icon .icon,:host([variant=input]) .has-icon .selected-icon,:host([variant=input]) .has-icon mdui-circular-progress{margin-left:.25rem}:host([variant=input]) .has-end-icon .end-icon{margin-right:.25rem}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}::slotted(mdui-avatar[slot=end-icon]),::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){width:1.5rem;height:1.5rem}:host([disabled]) ::slotted(mdui-avatar[slot=end-icon]),:host([disabled]) ::slotted(mdui-avatar[slot=icon]),:host([disabled]) ::slotted(mdui-avatar[slot=selected-icon]){opacity:.38}::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){margin-left:-.25rem;margin-right:-.125rem}::slotted(mdui-avatar[slot=end-icon]){margin-right:-.25rem;margin-left:-.125rem}.delete-icon{display:inline-flex;font-size:1.28571429em;transition:background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);border-radius:var(--mdui-shape-corner-full);margin-right:-.25rem;margin-left:-.25rem;padding:.25rem;color:rgb(var(--mdui-color-on-surface-variant))}.delete-icon:hover{background-color:rgba(var(--mdui-color-on-surface-variant),12%)}.has-end-icon .delete-icon{margin-left:.25rem}:host([variant=assiat]) .delete-icon{color:rgb(var(--mdui-color-primary))}:host([variant=input]) .delete-icon{margin-right:.0625rem}:host([disabled]) .delete-icon{color:rgba(var(--mdui-color-on-surface),38%)}.delete-icon .i,::slotted([slot=delete-icon]){font-size:inherit}::slotted(mdui-avatar[slot=delete-icon]){width:1.125rem;height:1.125rem}`;e.Chip=class extends qi{constructor(){super(),this.variant="assist",this.elevated=!1,this.selectable=!1,this.selected=!1,this.deletable=!1,this.rippleRef=Ei(),this.hasSlotController=new jt(this,"icon","selected-icon","end-icon"),this.onClick=this.onClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}get rippleElement(){return this.rippleRef.value}onSelectedChange(){vi(this,"change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}render(){const e=this.icon||this.hasSlotController.test("icon"),t=this.endIcon||this.hasSlotController.test("end-icon"),i=this.selectedIcon||["assist","filter"].includes(this.variant)||e||this.hasSlotController.test("selected-icon"),o=Mi({button:!0,"has-icon":this.loading||!this.selected&&e||this.selected&&i,"has-end-icon":t});return ct`<mdui-ripple ${Pi(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:o,part:"button",content:this.renderInner()}):this.disabled||this.loading?ct`<span part="button" class="${o} _a">${this.renderInner()}</span>`:this.renderAnchor({className:o,part:"button",content:this.renderInner()})}`}onClick(){this.disabled||this.loading||this.selectable&&(this.selected=!this.selected)}onKeyDown(e){this.disabled||this.loading||(this.selectable&&" "===e.key&&(e.preventDefault(),this.selected=!this.selected),this.deletable&&["Delete","Backspace"].includes(e.key)&&vi(this,"delete"))}onDelete(e){e.stopPropagation(),vi(this,"delete")}renderIcon(){if(this.loading)return this.renderLoading();const e=()=>this.icon?ct`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Gt;return this.selected?ct`<slot name="selected-icon" part="selected-icon" class="selected-icon">${(()=>this.selectedIcon?ct`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:"assist"===this.variant||"filter"===this.variant?ct`<mdui-icon-check class="i"></mdui-icon-check>`:e())()}</slot>`:ct`<slot name="icon" part="icon" class="icon">${e()}</slot>`}renderLabel(){return ct`<slot part="label" class="label"></slot>`}renderEndIcon(){return ct`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?ct`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:Gt}</slot>`}renderDeleteIcon(){return this.deletable?ct`<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon?ct`<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`:ct`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`:Gt}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon(),this.renderDeleteIcon()]}},e.Chip.styles=[qi.styles,no],Re([Pt({reflect:!0})],e.Chip.prototype,"variant",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"elevated",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"selectable",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"selected",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"deletable",void 0),Re([Pt({reflect:!0})],e.Chip.prototype,"icon",void 0),Re([Pt({reflect:!0,attribute:"selected-icon"})],e.Chip.prototype,"selectedIcon",void 0),Re([Pt({reflect:!0,attribute:"end-icon"})],e.Chip.prototype,"endIcon",void 0),Re([Pt({reflect:!0,attribute:"delete-icon"})],e.Chip.prototype,"deleteIcon",void 0),Re([fi("selected",!0)],e.Chip.prototype,"onSelectedChange",null),e.Chip=Re([Et("mdui-chip")],e.Chip);const so=Pe`:host{display:block}`;e.Collapse=class extends St{constructor(){super(...arguments),this.accordion=!1,this.disabled=!1,this.activeKeys=[],this.items=[]}onActiveKeysChange(){var e;this.value=this.accordion?null===(e=this.items.find((e=>this.activeKeys.includes(e.key))))||void 0===e?void 0:e.value:this.items.filter((e=>this.activeKeys.includes(e.key))).map((e=>e.value)),vi(this,"change")}onValueChange(){if(this.accordion){const e=this.value;if(e){const t=this.items.find((t=>t.value===e));this.activeKeys=t?[t.key]:[]}else this.activeKeys=[]}else{const e=this.value;e.length?this.activeKeys=this.items.filter((t=>e.includes(t.value))).map((e=>e.key)):this.activeKeys=[]}this.updateActive()}connectedCallback(){super.connectedCallback(),this.syncItems()}render(){return ct`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}syncItems(){this.items=P(this).find("mdui-collapse-item").get()}onClick(e){if(this.disabled)return;if(e.button)return;const t=e.target.closest("mdui-collapse-item");if(t.disabled)return;const i=e.composedPath();if((!t.trigger||i.find((e=>f(e)&&P(e).is(t.trigger))))&&i.find((e=>f(e)&&e.part.contains("header")))){if(this.accordion)this.activeKeys.includes(t.key)?this.activeKeys=[]:this.activeKeys=[t.key];else{const e=[...this.activeKeys];e.includes(t.key)?e.splice(e.indexOf(t.key),1):e.push(t.key),this.activeKeys=e}this.updateActive()}}onSlotChange(){this.syncItems(),this.updateActive()}updateActive(){this.items.forEach((e=>e.active=this.activeKeys.includes(e.key)))}},e.Collapse.styles=[Wt,so],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Collapse.prototype,"accordion",void 0),Re([Pt()],e.Collapse.prototype,"value",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Collapse.prototype,"disabled",void 0),Re([Mt()],e.Collapse.prototype,"activeKeys",void 0),Re([fi("activeKeys",!0)],e.Collapse.prototype,"onActiveKeysChange",null),Re([fi("value")],e.Collapse.prototype,"onValueChange",null),e.Collapse=Re([Et("mdui-collapse")],e.Collapse);const ao=Pe`:host{display:flex;flex-direction:column}.header{display:block}.body{display:block;overflow:hidden;transition:height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-emphasized)}.body.opened{overflow:visible}:host([active]) .body{transition-duration:var(--mdui-motion-duration-medium4)}`;function lo(e,t,i){return e?t():null==i?void 0:i()}function co(e,t,i){return e?new Promise((o=>{if(i.duration===1/0)throw new Error("Promise-based animations must be finite.");d(i.duration)&&isNaN(i.duration)&&(i.duration=0),""===i.easing&&(i.easing="linear");const r=e.animate(t,i);r.addEventListener("cancel",o,{once:!0}),r.addEventListener("finish",o,{once:!0})})):Promise.resolve()}function ho(e){return e?Promise.all(e.getAnimations().map((e=>new Promise((t=>{const i=requestAnimationFrame(t);e.addEventListener("cancel",(()=>i),{once:!0}),e.addEventListener("finish",(()=>i),{once:!0}),e.cancel()}))))):Promise.resolve()}function uo(e){const t=s(),i=e.tagName.toLowerCase();return"-1"!==e.getAttribute("tabindex")&&(!e.hasAttribute("disabled")&&((!e.hasAttribute("aria-disabled")||"false"===e.getAttribute("aria-disabled"))&&(!("input"===i&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&(null!==e.offsetParent&&("hidden"!==t.getComputedStyle(e).visibility&&(!("audio"!==i&&"video"!==i||!e.hasAttribute("controls"))||(!!e.hasAttribute("tabindex")||(!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||["button","input","select","textarea","a","audio","video","summary"].includes(i)))))))))}e.CollapseItem=class extends St{constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.state="closed",this.key=yi(),this.bodyRef=Ei()}onActiveChange(){this.hasUpdated?(this.state=this.active?"open":"close",vi(this,this.state),this.updateBodyHeight()):this.state=this.active?"opened":"closed"}firstUpdated(e){super.firstUpdated(e),P(this.bodyRef.value).on("transitionend",(e=>{e.target===this.bodyRef.value&&(this.state=this.active?"opened":"closed",vi(this,this.state),this.updateBodyHeight())})),this.updateBodyHeight()}render(){return ct`<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${Ni({opened:"opened"===this.state})}" ${Pi(this.bodyRef)}></slot>`}updateBodyHeight(){const e=this.bodyRef.value.scrollHeight;"close"===this.state&&(P(this.bodyRef.value).height(e),this.bodyRef.value.clientLeft),P(this.bodyRef.value).height("opened"===this.state?"auto":"open"===this.state?e:0)}},e.CollapseItem.styles=[Wt,ao],Re([Pt({reflect:!0})],e.CollapseItem.prototype,"value",void 0),Re([Pt({reflect:!0})],e.CollapseItem.prototype,"header",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.CollapseItem.prototype,"disabled",void 0),Re([Pt()],e.CollapseItem.prototype,"trigger",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.CollapseItem.prototype,"active",void 0),Re([Mt()],e.CollapseItem.prototype,"state",void 0),Re([fi("active")],e.CollapseItem.prototype,"onActiveChange",null),e.CollapseItem=Re([Et("mdui-collapse-item")],e.CollapseItem);let po=[];class mo{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){po.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){po=po.filter((e=>e!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return po[po.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=function(e){var t,i;const o=[];return function e(t){t instanceof HTMLElement&&(o.push(t),null!==t.shadowRoot&&"open"===t.shadowRoot.mode&&e(t.shadowRoot)),[...t.children].forEach((t=>e(t)))}(e),{start:null!==(t=o.find((e=>uo(e))))&&void 0!==t?t:null,end:null!==(i=o.reverse().find((e=>uo(e))))&&void 0!==i?i:null}}(this.element),i="forward"===this.tabDirection?e:t;"function"==typeof(null==i?void 0:i.focus)&&i.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){"Tab"===e.key&&e.shiftKey&&(this.tabDirection="backward"),requestAnimationFrame((()=>this.checkFocus()))}handleKeyUp(){this.tabDirection="forward"}}const vo=(e,t)=>{const i=`--mdui-motion-easing-${t}`;return P(e).css(i).trim()},fo=(e,t)=>{const i=`--mdui-motion-duration-${t}`;return parseFloat(P(e).css(i).trim())},go=new Set,bo="mdui-lock-screen",yo=(e,t)=>{const i=r();go.add(e),P(t||i.body).addClass(bo)},wo=(e,t)=>{const i=r();go.delete(e),0===go.size&&P(t||i.body).removeClass(bo)},ko=Pe`:host{--shape-corner:var(--mdui-shape-corner-extra-large);--z-index:2300;position:fixed;z-index:var(--z-index);display:none;align-items:center;justify-content:center;inset:0;padding:3rem}::slotted(mdui-top-app-bar[slot=header]){position:absolute;border-top-left-radius:var(--mdui-shape-corner-extra-large);border-top-right-radius:var(--mdui-shape-corner-extra-large);background-color:rgb(var(--mdui-color-surface-container-high))}:host([fullscreen]){--shape-corner:var(--mdui-shape-corner-none);padding:0}:host([fullscreen]) ::slotted(mdui-top-app-bar[slot=header]){border-top-left-radius:var(--mdui-shape-corner-none);border-top-right-radius:var(--mdui-shape-corner-none)}.overlay{position:fixed;inset:0;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{position:relative;display:flex;flex-direction:column;max-height:100%;border-radius:var(--shape-corner);outline:0;transform-origin:top;min-width:17.5rem;max-width:35rem;padding:1.5rem;background-color:rgb(var(--mdui-color-surface-container-high));box-shadow:var(--mdui-elevation-level3)}:host([fullscreen]) .panel{width:100%;max-width:100%;height:100%;max-height:100%;box-shadow:var(--mdui-elevation-level0)}.header{display:flex;flex-direction:column}.has-icon .header{align-items:center}.icon{display:flex;color:rgb(var(--mdui-color-secondary));font-size:1.5rem}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}.headline{display:flex;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.icon+.headline{padding-top:1rem}.body{overflow:auto}.header+.body{margin-top:1rem}.description{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([fullscreen]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description.has-default .description{margin-bottom:1rem}.action{display:flex;justify-content:flex-end;padding-top:1.5rem}.action::slotted(:not(:first-child)){margin-left:.5rem}:host([stacked-actions]) .action{flex-direction:column;align-items:end}:host([stacked-actions]) .action::slotted(:not(:first-child)){margin-left:0;margin-top:.5rem}`;e.Dialog=class extends St{constructor(){super(...arguments),this.open=!1,this.fullscreen=!1,this.closeOnEsc=!1,this.closeOnOverlayClick=!1,this.stackedActions=!1,this.overlayRef=Ei(),this.panelRef=Ei(),this.bodyRef=Ei(),this.hasSlotController=new jt(this,"header","icon","headline","description","action","[default]")}async onOpenChange(){var e;const t=this.hasUpdated;t||await this.updateComplete;const i=Array.from(this.panelRef.value.querySelectorAll(".header, .body, .actions")),o=vo(this,"linear"),r=vo(this,"emphasized-decelerate"),n=vo(this,"emphasized-accelerate");if(this.open){if(t){if(vi(this,"open",{cancelable:!0}).defaultPrevented)return}this.style.display="flex";const n=null!==(e=this.topAppBarElements)&&void 0!==e?e:[];if(n.length){const e=n[0];e.scrollTarget||(e.scrollTarget=this.bodyRef.value),this.bodyRef.value.style.marginTop="0"}this.originalTrigger=document.activeElement,this.modalHelper.activate(),yo(this),await Promise.all([ho(this.overlayRef.value),ho(this.panelRef.value),...i.map((e=>ho(e)))]),requestAnimationFrame((()=>{const e=this.querySelector("[autofocus]");e?e.focus({preventScroll:!0}):this.panelRef.value.focus({preventScroll:!0})}));const s=fo(this,"medium4");return await Promise.all([co(this.overlayRef.value,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:t?s:0,easing:o}),co(this.panelRef.value,[{transform:"translateY(-1.875rem) scaleY(0)"},{transform:"translateY(0) scaleY(1)"}],{duration:t?s:0,easing:r}),co(this.panelRef.value,[{opacity:0},{opacity:1,offset:.1},{opacity:1}],{duration:t?s:0,easing:o}),...i.map((e=>co(e,[{opacity:0},{opacity:0,offset:.2},{opacity:1,offset:.8},{opacity:1}],{duration:t?s:0,easing:o})))]),void(t&&vi(this,"opened"))}if(!this.open&&t){if(vi(this,"close",{cancelable:!0}).defaultPrevented)return;this.modalHelper.deactivate(),await Promise.all([ho(this.overlayRef.value),ho(this.panelRef.value),...i.map((e=>ho(e)))]);const e=fo(this,"short4");await Promise.all([co(this.overlayRef.value,[{opacity:1},{opacity:0}],{duration:e,easing:o}),co(this.panelRef.value,[{transform:"translateY(0) scaleY(1)"},{transform:"translateY(-1.875rem) scaleY(0.6)"}],{duration:e,easing:n}),co(this.panelRef.value,[{opacity:1},{opacity:1,offset:.75},{opacity:0}],{duration:e,easing:o}),...i.map((t=>co(t,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:e,easing:o})))]),this.style.display="none",wo(this);const t=this.originalTrigger;return"function"==typeof(null==t?void 0:t.focus)&&setTimeout((()=>t.focus())),void vi(this,"closed")}}connectedCallback(){super.connectedCallback(),this.modalHelper=new mo(this),this.addEventListener("keydown",(e=>{this.open&&this.closeOnEsc&&"Escape"===e.key&&(e.stopPropagation(),this.open=!1)}))}disconnectedCallback(){super.disconnectedCallback(),wo(this)}render(){const e=this.hasSlotController.test("action"),t=this.hasSlotController.test("[default]"),i=!!this.icon||this.hasSlotController.test("icon"),o=!!this.headline||this.hasSlotController.test("headline"),r=!!this.description||this.hasSlotController.test("description"),n=i||o||this.hasSlotController.test("header"),s=r||t;return ct`<div ${Pi(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${Pi(this.panelRef)} part="panel" class="panel ${Ni({"has-icon":i,"has-description":r,"has-default":t})}" tabindex="0">${lo(n,(()=>ct`<slot name="header" part="header" class="header">${lo(i,(()=>this.renderIcon()))} ${lo(o,(()=>this.renderHeadline()))}</slot>`))} ${lo(s,(()=>ct`<div ${Pi(this.bodyRef)} part="body" class="body">${lo(r,(()=>this.renderDescription()))}<slot></slot></div>`))} ${lo(e,(()=>ct`<slot name="action" part="action" class="action"></slot>`))}</div>`}onOverlayClick(){vi(this,"overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}renderIcon(){return ct`<slot name="icon" part="icon" class="icon">${this.icon?ct`<mdui-icon name="${this.icon}"></mdui-icon>`:Gt}</slot>`}renderHeadline(){return ct`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`}renderDescription(){return ct`<slot name="description" part="description" class="description">${this.description}</slot>`}},e.Dialog.styles=[Wt,ko],Re([Pt({reflect:!0})],e.Dialog.prototype,"icon",void 0),Re([Pt({reflect:!0})],e.Dialog.prototype,"headline",void 0),Re([Pt({reflect:!0})],e.Dialog.prototype,"description",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dialog.prototype,"open",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dialog.prototype,"fullscreen",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"close-on-esc"})],e.Dialog.prototype,"closeOnEsc",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"close-on-overlay-click"})],e.Dialog.prototype,"closeOnOverlayClick",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"stacked-actions"})],e.Dialog.prototype,"stackedActions",void 0),Re([Lt({slot:"header",selector:"mdui-top-app-bar",flatten:!0})],e.Dialog.prototype,"topAppBarElements",void 0),Re([fi("open")],e.Dialog.prototype,"onOpenChange",null),e.Dialog=Re([Et("mdui-dialog")],e.Dialog);const Co=Pe`:host{display:block;height:.0625rem;background-color:rgb(var(--mdui-color-surface-variant))}:host([inset]){margin-left:1rem}:host([middle]){margin-left:1rem;margin-right:1rem}:host([vertical]){height:100%;width:.0625rem}`;e.Divider=class extends St{constructor(){super(...arguments),this.vertical=!1,this.inset=!1,this.middle=!1}render(){return ct``}},e.Divider.styles=[Wt,Co],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"vertical",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"inset",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"middle",void 0),e.Divider=Re([Et("mdui-divider")],e.Divider);const xo=Pe`:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;e.Dropdown=class extends St{constructor(){super(),this.open=!1,this.disabled=!1,this.trigger="click",this.placement="auto",this.stayOpenOnClick=!1,this.openDelay=150,this.closeDelay=150,this.openOnPointer=!1,this.panelRef=Ei(),this.onDocumentClick=this.onDocumentClick.bind(this),this.onDocumentKeydown=this.onDocumentKeydown.bind(this),this.onWindowScroll=this.onWindowScroll.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onClick=this.onClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onPanelClick=this.onPanelClick.bind(this)}get triggerSlot(){return this.triggerSlots[0]}get panelSlot(){return this.panelSlots[0]}async onPositionChange(){this.open&&this.updatePositioner()}async onOpenChange(){var e,t,i,o;const r=this.hasUpdated,n=vo(this,"linear"),s=vo(this,"emphasized-decelerate"),a=vo(this,"emphasized-accelerate");if(this.open){if(r||await this.updateComplete,r){if(vi(this,"open",{cancelable:!0}).defaultPrevented)return}"function"==typeof(null===(e=this.panelSlot)||void 0===e?void 0:e.focus)&&this.panelSlot.focus();const t=fo(this,"medium4");return await ho(this.panelRef.value),this.panelRef.value.hidden=!1,this.updatePositioner(),await Promise.all([co(this.panelRef.value,[{transform:`${this.getCssScaleName()}(0.45)`},{transform:`${this.getCssScaleName()}(1)`}],{duration:r?t:0,easing:s}),co(this.panelRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:r?t:0,easing:n})]),void(r&&vi(this,"opened"))}if(!this.open&&r){if(vi(this,"close",{cancelable:!0}).defaultPrevented)return;this.hasTrigger("focus")||"function"!=typeof(null===(t=this.triggerSlot)||void 0===t?void 0:t.focus)||!this.contains(document.activeElement)&&!this.contains(null!==(o=null===(i=document.activeElement)||void 0===i?void 0:i.assignedSlot)&&void 0!==o?o:null)||this.triggerSlot.focus();const e=fo(this,"short4");await ho(this.panelRef.value),await Promise.all([co(this.panelRef.value,[{transform:`${this.getCssScaleName()}(1)`},{transform:`${this.getCssScaleName()}(0.45)`}],{duration:e,easing:a}),co(this.panelRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:e,easing:n})]),this.panelRef.value&&(this.panelRef.value.hidden=!0),vi(this,"closed")}}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),document.addEventListener("keydown",this.onDocumentKeydown),window.addEventListener("scroll",this.onWindowScroll),this.updateComplete.then((()=>{this.observeResize=Ci(this.triggerSlot,(()=>{this.updatePositioner()}))}))}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),window.removeEventListener("scroll",this.onWindowScroll),null===(e=this.observeResize)||void 0===e||e.unobserve()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("mouseleave",this.onMouseLeave),this.triggerSlot.addEventListener("focus",this.onFocus),this.triggerSlot.addEventListener("click",this.onClick),this.triggerSlot.addEventListener("contextmenu",this.onContextMenu),this.triggerSlot.addEventListener("mouseenter",this.onMouseEnter),P(this.panelRef.value).on("click",this.onPanelClick)}render(){return ct`<slot name="trigger" part="trigger" class="trigger"></slot><slot ${Pi(this.panelRef)} part="panel" class="panel" hidden></slot>`}getCssScaleName(){return"horizontal"===this.animateDirection?"scaleX":"scaleY"}onDocumentClick(e){if(this.disabled||!this.open)return;const t=e.composedPath();t.includes(this)||(this.open=!1),this.hasTrigger("contextmenu")&&!this.hasTrigger("click")&&t.includes(this.triggerSlot)&&(this.open=!1)}onDocumentKeydown(e){var t;!this.disabled&&this.open&&("Escape"!==e.key?"Tab"===e.key&&(this.hasTrigger("focus")||"function"!=typeof(null===(t=this.triggerSlot)||void 0===t?void 0:t.focus)||e.preventDefault(),this.open=!1):this.open=!1)}onWindowScroll(){window.requestAnimationFrame((()=>this.onPositionChange()))}hasTrigger(e){return this.trigger.split(" ").includes(e)}onFocus(){this.disabled||this.open||!this.hasTrigger("focus")||(this.open=!0)}onClick(e){this.disabled||e.button||!this.hasTrigger("click")||this.open&&(this.hasTrigger("hover")||this.hasTrigger("focus"))||(this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!this.open)}onPanelClick(e){const t=e;this.disabled||this.stayOpenOnClick||!P(t.target).is("mdui-menu-item")||(this.open=!1)}onContextMenu(e){!this.disabled&&this.hasTrigger("contextmenu")&&(e.preventDefault(),this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!0)}onMouseEnter(){!this.disabled&&this.hasTrigger("hover")&&(window.clearTimeout(this.closeTimeout),this.openDelay?this.openTimeout=window.setTimeout((()=>{this.open=!0}),this.openDelay):this.open=!0)}onMouseLeave(){!this.disabled&&this.hasTrigger("hover")&&(window.clearTimeout(this.openTimeout),this.closeTimeout=window.setTimeout((()=>{this.open=!1}),this.closeDelay||50))}updatePositioner(){var e;const t=P(this.panelRef.value),i=P(window),o=this.panelSlots,r=Math.max(...null!==(e=null==o?void 0:o.map((e=>e.offsetWidth)))&&void 0!==e?e:[]),n=null==o?void 0:o.map((e=>e.offsetHeight)).reduce(((e,t)=>e+t)),s=this.triggerSlot.getBoundingClientRect(),a=this.openOnPointer?{top:this.pointerOffsetY+s.top,left:this.pointerOffsetX+s.left,width:0,height:0}:s;let l,c,d,h,u=this.placement;if("auto"===u){const e=i.width(),t=i.height();let o,s;o=t-a.top-a.height>n+8?"bottom":a.top>n+8?"top":e-a.left-a.width>r+8?"right":a.left>r+8?"left":"bottom",s=["top","bottom"].includes(o)?e-a.left>r+8?"start":a.left+a.width/2>r/2+8&&e-a.left-a.width/2>r/2+8?void 0:a.left+a.width>r+8?"end":"start":t-a.top>n+8?"start":a.top+a.height/2>n/2+8&&t-a.top-a.height/2>n/2+8?void 0:a.top+a.height>n+8?"end":"start",u=s?[o,s].join("-"):o}const[p,m]=u.split("-");switch(this.animateDirection=["top","bottom"].includes(p)?"vertical":"horizontal",p){case"top":c="bottom",d=a.top-n;break;case"bottom":c="top",d=a.top+a.height;break;default:switch(c="center",m){case"start":d=a.top;break;case"end":d=a.top+a.height-n;break;default:d=a.top+a.height/2-n/2}}switch(p){case"left":l="right",h=a.left-r;break;case"right":l="left",h=a.left+a.width;break;default:switch(l="center",m){case"start":h=a.left;break;case"end":h=a.left+a.width-r;break;default:h=a.left+a.width/2-r/2}}t.css({top:d,left:h,transformOrigin:[l,c].join(" ")})}},e.Dropdown.styles=[Wt,xo],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dropdown.prototype,"open",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dropdown.prototype,"disabled",void 0),Re([Pt({reflect:!0})],e.Dropdown.prototype,"trigger",void 0),Re([Pt({reflect:!0})],e.Dropdown.prototype,"placement",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"stay-open-on-click"})],e.Dropdown.prototype,"stayOpenOnClick",void 0),Re([Pt({type:Number,reflect:!0,attribute:"open-delay"})],e.Dropdown.prototype,"openDelay",void 0),Re([Pt({type:Number,reflect:!0,attribute:"close-delay"})],e.Dropdown.prototype,"closeDelay",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"open-on-pointer"})],e.Dropdown.prototype,"openOnPointer",void 0),Re([Lt({slot:"trigger",flatten:!0})],e.Dropdown.prototype,"triggerSlots",void 0),Re([Lt({flatten:!0})],e.Dropdown.prototype,"panelSlots",void 0),Re([fi("placement",!0),fi("openOnPointer",!0)],e.Dropdown.prototype,"onPositionChange",null),Re([fi("open")],e.Dropdown.prototype,"onOpenChange",null),e.Dropdown=Re([Et("mdui-dropdown")],e.Dropdown);const $o=(e=0)=>new Promise((t=>setTimeout(t,e))),Ro=Pe`:host{--shape-corner-small:var(--mdui-shape-corner-small);--shape-corner-normal:var(--mdui-shape-corner-large);--shape-corner-large:var(--mdui-shape-corner-extra-large);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner-normal);cursor:pointer;-webkit-tap-highlight-color:transparent;transition-property:box-shadow;transition-timing-function:var(--mdui-motion-easing-emphasized);transition-duration:var(--mdui-motion-duration-medium4);width:3.5rem;height:3.5rem;box-shadow:var(--mdui-elevation-level3);font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{padding:0 1rem}:host([size=small]) .button{padding:0 .5rem}:host([size=large]) .button{padding:0 1.875rem}:host([lowered]){box-shadow:var(--mdui-elevation-level1)}:host([focus-visible]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][focus-visible]){box-shadow:var(--mdui-elevation-level1)}:host([pressed]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][pressed]){box-shadow:var(--mdui-elevation-level1)}:host([hover]){box-shadow:var(--mdui-elevation-level4)}:host([lowered][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=primary]){color:rgb(var(--mdui-color-on-primary-container));background-color:rgb(var(--mdui-color-primary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
12
|
+
)}:host([disabled]),:host([loading]){cursor:default;pointer-events:none}:host([disabled]){border-color:rgba(var(--mdui-color-on-surface),12%);color:rgba(var(--mdui-color-on-surface),38%);box-shadow:var(--mdui-elevation-level0)}:host([disabled][elevated]),:host([disabled][selected]){background-color:rgba(var(--mdui-color-on-surface),12%)}:host([selected][hover]){box-shadow:var(--mdui-elevation-level1)}:host([elevated][hover]){color:rgb(var(--mdui-color-on-secondary-container));box-shadow:var(--mdui-elevation-level2)}:host([variant=filter][hover]),:host([variant=input][hover]),:host([variant=suggestion][hover]){color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=filter][focus-visible]),:host([variant=input][focus-visible]),:host([variant=suggestion][focus-visible]){border-color:rgb(var(--mdui-color-on-surface-variant))}:host([dragged]),:host([dragged][hover]){box-shadow:var(--mdui-elevation-level4)}.button{overflow:visible}.label{display:inline-flex;padding-right:.5rem;padding-left:.5rem}.end-icon,.icon,.selected-icon{display:inline-flex;font-size:1.28571429em;color:rgb(var(--mdui-color-on-surface-variant))}:host([variant=assist]) .end-icon,:host([variant=assist]) .icon,:host([variant=assist]) .selected-icon{color:rgb(var(--mdui-color-primary))}:host([selected]) .end-icon,:host([selected]) .icon,:host([selected]) .selected-icon{color:rgb(var(--mdui-color-on-secondary-container))}:host([disabled]) .end-icon,:host([disabled]) .icon,:host([disabled]) .selected-icon{opacity:.38;color:rgb(var(--mdui-color-on-surface))}.end-icon .i,.icon .i,.selected-icon .i,::slotted([slot=end-icon]),::slotted([slot=icon]),::slotted([slot=selected-icon]){font-size:inherit}:host([variant=input]) .has-icon .icon,:host([variant=input]) .has-icon .selected-icon,:host([variant=input]) .has-icon mdui-circular-progress{margin-left:.25rem}:host([variant=input]) .has-end-icon .end-icon{margin-right:.25rem}mdui-circular-progress{display:inline-flex;width:1.125rem;height:1.125rem}:host([disabled]) mdui-circular-progress{stroke:rgba(var(--mdui-color-on-surface),38%)}::slotted(mdui-avatar[slot=end-icon]),::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){width:1.5rem;height:1.5rem}:host([disabled]) ::slotted(mdui-avatar[slot=end-icon]),:host([disabled]) ::slotted(mdui-avatar[slot=icon]),:host([disabled]) ::slotted(mdui-avatar[slot=selected-icon]){opacity:.38}::slotted(mdui-avatar[slot=icon]),::slotted(mdui-avatar[slot=selected-icon]){margin-left:-.25rem;margin-right:-.125rem}::slotted(mdui-avatar[slot=end-icon]){margin-right:-.25rem;margin-left:-.125rem}.delete-icon{display:inline-flex;font-size:1.28571429em;transition:background-color var(--mdui-motion-duration-short4) var(--mdui-motion-easing-linear);border-radius:var(--mdui-shape-corner-full);margin-right:-.25rem;margin-left:-.25rem;padding:.25rem;color:rgb(var(--mdui-color-on-surface-variant))}.delete-icon:hover{background-color:rgba(var(--mdui-color-on-surface-variant),12%)}.has-end-icon .delete-icon{margin-left:.25rem}:host([variant=assiat]) .delete-icon{color:rgb(var(--mdui-color-primary))}:host([variant=input]) .delete-icon{margin-right:.0625rem}:host([disabled]) .delete-icon{color:rgba(var(--mdui-color-on-surface),38%)}.delete-icon .i,::slotted([slot=delete-icon]){font-size:inherit}::slotted(mdui-avatar[slot=delete-icon]){width:1.125rem;height:1.125rem}`;e.Chip=class extends qi{constructor(){super(),this.variant="assist",this.elevated=!1,this.selectable=!1,this.selected=!1,this.deletable=!1,this.rippleRef=Ei(),this.hasSlotController=new jt(this,"icon","selected-icon","end-icon"),this.onClick=this.onClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this)}get rippleElement(){return this.rippleRef.value}onSelectedChange(){vi(this,"change")}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}render(){const e=this.icon||this.hasSlotController.test("icon"),t=this.endIcon||this.hasSlotController.test("end-icon"),i=this.selectedIcon||["assist","filter"].includes(this.variant)||e||this.hasSlotController.test("selected-icon"),o=Mi({button:!0,"has-icon":this.loading||!this.selected&&e||this.selected&&i,"has-end-icon":t});return ct`<mdui-ripple ${Pi(this.rippleRef)} .noRipple="${this.noRipple}"></mdui-ripple>${this.isButton()?this.renderButton({className:o,part:"button",content:this.renderInner()}):this.disabled||this.loading?ct`<span part="button" class="${o} _a">${this.renderInner()}</span>`:this.renderAnchor({className:o,part:"button",content:this.renderInner()})}`}onClick(){this.disabled||this.loading||this.selectable&&(this.selected=!this.selected)}onKeyDown(e){this.disabled||this.loading||(this.selectable&&" "===e.key&&(e.preventDefault(),this.selected=!this.selected),this.deletable&&["Delete","Backspace"].includes(e.key)&&vi(this,"delete"))}onDelete(e){e.stopPropagation(),vi(this,"delete")}renderIcon(){if(this.loading)return this.renderLoading();const e=()=>this.icon?ct`<mdui-icon name="${this.icon}" class="i"></mdui-icon>`:Gt;return this.selected?ct`<slot name="selected-icon" part="selected-icon" class="selected-icon">${(()=>this.selectedIcon?ct`<mdui-icon name="${this.selectedIcon}" class="i"></mdui-icon>`:"assist"===this.variant||"filter"===this.variant?ct`<mdui-icon-check class="i"></mdui-icon-check>`:e())()}</slot>`:ct`<slot name="icon" part="icon" class="icon">${e()}</slot>`}renderLabel(){return ct`<slot part="label" class="label"></slot>`}renderEndIcon(){return ct`<slot name="end-icon" part="end-icon" class="end-icon">${this.endIcon?ct`<mdui-icon name="${this.endIcon}" class="i"></mdui-icon>`:Gt}</slot>`}renderDeleteIcon(){return this.deletable?ct`<slot name="delete-icon" part="delete-icon" class="delete-icon" @click="${this.onDelete}">${this.deleteIcon?ct`<mdui-icon name="${this.deleteIcon}" class="i"></mdui-icon>`:ct`<mdui-icon-clear class="i"></mdui-icon-clear>`}</slot>`:Gt}renderInner(){return[this.renderIcon(),this.renderLabel(),this.renderEndIcon(),this.renderDeleteIcon()]}},e.Chip.styles=[qi.styles,no],Re([Pt({reflect:!0})],e.Chip.prototype,"variant",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"elevated",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"selectable",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"selected",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Chip.prototype,"deletable",void 0),Re([Pt({reflect:!0})],e.Chip.prototype,"icon",void 0),Re([Pt({reflect:!0,attribute:"selected-icon"})],e.Chip.prototype,"selectedIcon",void 0),Re([Pt({reflect:!0,attribute:"end-icon"})],e.Chip.prototype,"endIcon",void 0),Re([Pt({reflect:!0,attribute:"delete-icon"})],e.Chip.prototype,"deleteIcon",void 0),Re([fi("selected",!0)],e.Chip.prototype,"onSelectedChange",null),e.Chip=Re([Et("mdui-chip")],e.Chip);const so=Pe`:host{display:block}`;e.Collapse=class extends St{constructor(){super(...arguments),this.accordion=!1,this.disabled=!1,this.activeKeys=[],this.items=[]}onActiveKeysChange(){var e;this.value=this.accordion?null===(e=this.items.find((e=>this.activeKeys.includes(e.key))))||void 0===e?void 0:e.value:this.items.filter((e=>this.activeKeys.includes(e.key))).map((e=>e.value)),vi(this,"change")}onValueChange(){if(this.accordion){const e=this.value;if(e){const t=this.items.find((t=>t.value===e));this.activeKeys=t?[t.key]:[]}else this.activeKeys=[]}else{const e=this.value;e.length?this.activeKeys=this.items.filter((t=>e.includes(t.value))).map((e=>e.key)):this.activeKeys=[]}this.updateActive()}connectedCallback(){super.connectedCallback(),this.syncItems()}render(){return ct`<slot @slotchange="${this.onSlotChange}" @click="${this.onClick}"></slot>`}syncItems(){this.items=P(this).find("mdui-collapse-item").get()}onClick(e){if(this.disabled)return;if(e.button)return;const t=e.target.closest("mdui-collapse-item");if(t.disabled)return;const i=e.composedPath();if((!t.trigger||i.find((e=>f(e)&&P(e).is(t.trigger))))&&i.find((e=>f(e)&&e.part.contains("header")))){if(this.accordion)this.activeKeys.includes(t.key)?this.activeKeys=[]:this.activeKeys=[t.key];else{const e=[...this.activeKeys];e.includes(t.key)?e.splice(e.indexOf(t.key),1):e.push(t.key),this.activeKeys=e}this.updateActive()}}onSlotChange(){this.syncItems(),this.updateActive()}updateActive(){this.items.forEach((e=>e.active=this.activeKeys.includes(e.key)))}},e.Collapse.styles=[Wt,so],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Collapse.prototype,"accordion",void 0),Re([Pt()],e.Collapse.prototype,"value",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Collapse.prototype,"disabled",void 0),Re([Mt()],e.Collapse.prototype,"activeKeys",void 0),Re([fi("activeKeys",!0)],e.Collapse.prototype,"onActiveKeysChange",null),Re([fi("value")],e.Collapse.prototype,"onValueChange",null),e.Collapse=Re([Et("mdui-collapse")],e.Collapse);const ao=Pe`:host{display:flex;flex-direction:column}.header{display:block}.body{display:block;overflow:hidden;transition:height var(--mdui-motion-duration-short4) var(--mdui-motion-easing-emphasized)}.body.opened{overflow:visible}:host([active]) .body{transition-duration:var(--mdui-motion-duration-medium4)}`;function lo(e,t,i){return e?t():null==i?void 0:i()}function co(e,t,i){return e?new Promise((o=>{if(i.duration===1/0)throw new Error("Promise-based animations must be finite.");d(i.duration)&&isNaN(i.duration)&&(i.duration=0),""===i.easing&&(i.easing="linear");const r=e.animate(t,i);r.addEventListener("cancel",o,{once:!0}),r.addEventListener("finish",o,{once:!0})})):Promise.resolve()}function ho(e){return e?Promise.all(e.getAnimations().map((e=>new Promise((t=>{const i=requestAnimationFrame(t);e.addEventListener("cancel",(()=>i),{once:!0}),e.addEventListener("finish",(()=>i),{once:!0}),e.cancel()}))))):Promise.resolve()}function uo(e){const t=s(),i=e.tagName.toLowerCase();return"-1"!==e.getAttribute("tabindex")&&(!e.hasAttribute("disabled")&&((!e.hasAttribute("aria-disabled")||"false"===e.getAttribute("aria-disabled"))&&(!("input"===i&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&(null!==e.offsetParent&&("hidden"!==t.getComputedStyle(e).visibility&&(!("audio"!==i&&"video"!==i||!e.hasAttribute("controls"))||(!!e.hasAttribute("tabindex")||(!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||["button","input","select","textarea","a","audio","video","summary"].includes(i)))))))))}e.CollapseItem=class extends St{constructor(){super(...arguments),this.disabled=!1,this.active=!1,this.state="closed",this.key=yi(),this.bodyRef=Ei()}onActiveChange(){this.hasUpdated?(this.state=this.active?"open":"close",vi(this,this.state),this.updateBodyHeight()):this.state=this.active?"opened":"closed"}firstUpdated(e){super.firstUpdated(e),P(this.bodyRef.value).on("transitionend",(e=>{e.target===this.bodyRef.value&&(this.state=this.active?"opened":"closed",vi(this,this.state),this.updateBodyHeight())})),this.updateBodyHeight()}render(){return ct`<slot name="header" part="header" class="header">${this.header}</slot><slot part="body" class="body ${Ni({opened:"opened"===this.state})}" ${Pi(this.bodyRef)}></slot>`}updateBodyHeight(){const e=this.bodyRef.value.scrollHeight;"close"===this.state&&(P(this.bodyRef.value).height(e),this.bodyRef.value.clientLeft),P(this.bodyRef.value).height("opened"===this.state?"auto":"open"===this.state?e:0)}},e.CollapseItem.styles=[Wt,ao],Re([Pt({reflect:!0})],e.CollapseItem.prototype,"value",void 0),Re([Pt({reflect:!0})],e.CollapseItem.prototype,"header",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.CollapseItem.prototype,"disabled",void 0),Re([Pt()],e.CollapseItem.prototype,"trigger",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.CollapseItem.prototype,"active",void 0),Re([Mt()],e.CollapseItem.prototype,"state",void 0),Re([fi("active")],e.CollapseItem.prototype,"onActiveChange",null),e.CollapseItem=Re([Et("mdui-collapse-item")],e.CollapseItem);let po=[];class mo{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){po.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){po=po.filter((e=>e!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return po[po.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=function(e){var t,i;const o=[];return function e(t){t instanceof HTMLElement&&(o.push(t),null!==t.shadowRoot&&"open"===t.shadowRoot.mode&&e(t.shadowRoot)),[...t.children].forEach((t=>e(t)))}(e),{start:null!==(t=o.find((e=>uo(e))))&&void 0!==t?t:null,end:null!==(i=o.reverse().find((e=>uo(e))))&&void 0!==i?i:null}}(this.element),i="forward"===this.tabDirection?e:t;"function"==typeof(null==i?void 0:i.focus)&&i.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){"Tab"===e.key&&e.shiftKey&&(this.tabDirection="backward"),requestAnimationFrame((()=>this.checkFocus()))}handleKeyUp(){this.tabDirection="forward"}}const vo=(e,t)=>{const i=`--mdui-motion-easing-${t}`;return P(e).css(i).trim()},fo=(e,t)=>{const i=`--mdui-motion-duration-${t}`,o=P(e).css(i).trim().toLowerCase();return o.endsWith("ms")?parseFloat(o):1e3*parseFloat(o)},go=new Set,bo="mdui-lock-screen",yo=(e,t)=>{const i=r();go.add(e),P(t||i.body).addClass(bo)},wo=(e,t)=>{const i=r();go.delete(e),0===go.size&&P(t||i.body).removeClass(bo)},ko=Pe`:host{--shape-corner:var(--mdui-shape-corner-extra-large);--z-index:2300;position:fixed;z-index:var(--z-index);display:none;align-items:center;justify-content:center;inset:0;padding:3rem}::slotted(mdui-top-app-bar[slot=header]){position:absolute;border-top-left-radius:var(--mdui-shape-corner-extra-large);border-top-right-radius:var(--mdui-shape-corner-extra-large);background-color:rgb(var(--mdui-color-surface-container-high))}:host([fullscreen]){--shape-corner:var(--mdui-shape-corner-none);padding:0}:host([fullscreen]) ::slotted(mdui-top-app-bar[slot=header]){border-top-left-radius:var(--mdui-shape-corner-none);border-top-right-radius:var(--mdui-shape-corner-none)}.overlay{position:fixed;inset:0;background-color:rgba(var(--mdui-color-scrim),.4)}.panel{position:relative;display:flex;flex-direction:column;max-height:100%;border-radius:var(--shape-corner);outline:0;transform-origin:top;min-width:17.5rem;max-width:35rem;padding:1.5rem;background-color:rgb(var(--mdui-color-surface-container-high));box-shadow:var(--mdui-elevation-level3)}:host([fullscreen]) .panel{width:100%;max-width:100%;height:100%;max-height:100%;box-shadow:var(--mdui-elevation-level0)}.header{display:flex;flex-direction:column}.has-icon .header{align-items:center}.icon{display:flex;color:rgb(var(--mdui-color-secondary));font-size:1.5rem}.icon mdui-icon,::slotted([slot=icon]){font-size:inherit}.headline{display:flex;color:rgb(var(--mdui-color-on-surface));font-size:var(--mdui-typescale-headline-small-size);font-weight:var(--mdui-typescale-headline-small-weight);letter-spacing:var(--mdui-typescale-headline-small-tracking);line-height:var(--mdui-typescale-headline-small-line-height)}.icon+.headline{padding-top:1rem}.body{overflow:auto}.header+.body{margin-top:1rem}.description{display:flex;color:rgb(var(--mdui-color-on-surface-variant));font-size:var(--mdui-typescale-body-medium-size);font-weight:var(--mdui-typescale-body-medium-weight);letter-spacing:var(--mdui-typescale-body-medium-tracking);line-height:var(--mdui-typescale-body-medium-line-height)}:host([fullscreen]) .description{color:rgb(var(--mdui-color-on-surface))}.has-description.has-default .description{margin-bottom:1rem}.action{display:flex;justify-content:flex-end;padding-top:1.5rem}.action::slotted(:not(:first-child)){margin-left:.5rem}:host([stacked-actions]) .action{flex-direction:column;align-items:end}:host([stacked-actions]) .action::slotted(:not(:first-child)){margin-left:0;margin-top:.5rem}`;e.Dialog=class extends St{constructor(){super(...arguments),this.open=!1,this.fullscreen=!1,this.closeOnEsc=!1,this.closeOnOverlayClick=!1,this.stackedActions=!1,this.overlayRef=Ei(),this.panelRef=Ei(),this.bodyRef=Ei(),this.hasSlotController=new jt(this,"header","icon","headline","description","action","[default]")}async onOpenChange(){var e;const t=this.hasUpdated;t||await this.updateComplete;const i=Array.from(this.panelRef.value.querySelectorAll(".header, .body, .actions")),o=vo(this,"linear"),r=vo(this,"emphasized-decelerate"),n=vo(this,"emphasized-accelerate");if(this.open){if(t){if(vi(this,"open",{cancelable:!0}).defaultPrevented)return}this.style.display="flex";const n=null!==(e=this.topAppBarElements)&&void 0!==e?e:[];if(n.length){const e=n[0];e.scrollTarget||(e.scrollTarget=this.bodyRef.value),this.bodyRef.value.style.marginTop="0"}this.originalTrigger=document.activeElement,this.modalHelper.activate(),yo(this),await Promise.all([ho(this.overlayRef.value),ho(this.panelRef.value),...i.map((e=>ho(e)))]),requestAnimationFrame((()=>{const e=this.querySelector("[autofocus]");e?e.focus({preventScroll:!0}):this.panelRef.value.focus({preventScroll:!0})}));const s=fo(this,"medium4");return await Promise.all([co(this.overlayRef.value,[{opacity:0},{opacity:1,offset:.3},{opacity:1}],{duration:t?s:0,easing:o}),co(this.panelRef.value,[{transform:"translateY(-1.875rem) scaleY(0)"},{transform:"translateY(0) scaleY(1)"}],{duration:t?s:0,easing:r}),co(this.panelRef.value,[{opacity:0},{opacity:1,offset:.1},{opacity:1}],{duration:t?s:0,easing:o}),...i.map((e=>co(e,[{opacity:0},{opacity:0,offset:.2},{opacity:1,offset:.8},{opacity:1}],{duration:t?s:0,easing:o})))]),void(t&&vi(this,"opened"))}if(!this.open&&t){if(vi(this,"close",{cancelable:!0}).defaultPrevented)return;this.modalHelper.deactivate(),await Promise.all([ho(this.overlayRef.value),ho(this.panelRef.value),...i.map((e=>ho(e)))]);const e=fo(this,"short4");await Promise.all([co(this.overlayRef.value,[{opacity:1},{opacity:0}],{duration:e,easing:o}),co(this.panelRef.value,[{transform:"translateY(0) scaleY(1)"},{transform:"translateY(-1.875rem) scaleY(0.6)"}],{duration:e,easing:n}),co(this.panelRef.value,[{opacity:1},{opacity:1,offset:.75},{opacity:0}],{duration:e,easing:o}),...i.map((t=>co(t,[{opacity:1},{opacity:0,offset:.75},{opacity:0}],{duration:e,easing:o})))]),this.style.display="none",wo(this);const t=this.originalTrigger;return"function"==typeof(null==t?void 0:t.focus)&&setTimeout((()=>t.focus())),void vi(this,"closed")}}connectedCallback(){super.connectedCallback(),this.modalHelper=new mo(this),this.addEventListener("keydown",(e=>{this.open&&this.closeOnEsc&&"Escape"===e.key&&(e.stopPropagation(),this.open=!1)}))}disconnectedCallback(){super.disconnectedCallback(),wo(this)}render(){const e=this.hasSlotController.test("action"),t=this.hasSlotController.test("[default]"),i=!!this.icon||this.hasSlotController.test("icon"),o=!!this.headline||this.hasSlotController.test("headline"),r=!!this.description||this.hasSlotController.test("description"),n=i||o||this.hasSlotController.test("header"),s=r||t;return ct`<div ${Pi(this.overlayRef)} part="overlay" class="overlay" @click="${this.onOverlayClick}" tabindex="-1"></div><div ${Pi(this.panelRef)} part="panel" class="panel ${Ni({"has-icon":i,"has-description":r,"has-default":t})}" tabindex="0">${lo(n,(()=>ct`<slot name="header" part="header" class="header">${lo(i,(()=>this.renderIcon()))} ${lo(o,(()=>this.renderHeadline()))}</slot>`))} ${lo(s,(()=>ct`<div ${Pi(this.bodyRef)} part="body" class="body">${lo(r,(()=>this.renderDescription()))}<slot></slot></div>`))} ${lo(e,(()=>ct`<slot name="action" part="action" class="action"></slot>`))}</div>`}onOverlayClick(){vi(this,"overlay-click"),this.closeOnOverlayClick&&(this.open=!1)}renderIcon(){return ct`<slot name="icon" part="icon" class="icon">${this.icon?ct`<mdui-icon name="${this.icon}"></mdui-icon>`:Gt}</slot>`}renderHeadline(){return ct`<slot name="headline" part="headline" class="headline">${this.headline}</slot>`}renderDescription(){return ct`<slot name="description" part="description" class="description">${this.description}</slot>`}},e.Dialog.styles=[Wt,ko],Re([Pt({reflect:!0})],e.Dialog.prototype,"icon",void 0),Re([Pt({reflect:!0})],e.Dialog.prototype,"headline",void 0),Re([Pt({reflect:!0})],e.Dialog.prototype,"description",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dialog.prototype,"open",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dialog.prototype,"fullscreen",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"close-on-esc"})],e.Dialog.prototype,"closeOnEsc",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"close-on-overlay-click"})],e.Dialog.prototype,"closeOnOverlayClick",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"stacked-actions"})],e.Dialog.prototype,"stackedActions",void 0),Re([Lt({slot:"header",selector:"mdui-top-app-bar",flatten:!0})],e.Dialog.prototype,"topAppBarElements",void 0),Re([fi("open")],e.Dialog.prototype,"onOpenChange",null),e.Dialog=Re([Et("mdui-dialog")],e.Dialog);const Co=Pe`:host{display:block;height:.0625rem;background-color:rgb(var(--mdui-color-surface-variant))}:host([inset]){margin-left:1rem}:host([middle]){margin-left:1rem;margin-right:1rem}:host([vertical]){height:100%;width:.0625rem}`;e.Divider=class extends St{constructor(){super(...arguments),this.vertical=!1,this.inset=!1,this.middle=!1}render(){return ct``}},e.Divider.styles=[Wt,Co],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"vertical",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"inset",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Divider.prototype,"middle",void 0),e.Divider=Re([Et("mdui-divider")],e.Divider);const xo=Pe`:host{--z-index:2100;display:contents}.panel{display:block;position:fixed;z-index:var(--z-index)}`;e.Dropdown=class extends St{constructor(){super(),this.open=!1,this.disabled=!1,this.trigger="click",this.placement="auto",this.stayOpenOnClick=!1,this.openDelay=150,this.closeDelay=150,this.openOnPointer=!1,this.panelRef=Ei(),this.onDocumentClick=this.onDocumentClick.bind(this),this.onDocumentKeydown=this.onDocumentKeydown.bind(this),this.onWindowScroll=this.onWindowScroll.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onFocus=this.onFocus.bind(this),this.onClick=this.onClick.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onMouseEnter=this.onMouseEnter.bind(this),this.onPanelClick=this.onPanelClick.bind(this)}get triggerSlot(){return this.triggerSlots[0]}get panelSlot(){return this.panelSlots[0]}async onPositionChange(){this.open&&this.updatePositioner()}async onOpenChange(){var e,t,i,o;const r=this.hasUpdated,n=vo(this,"linear"),s=vo(this,"emphasized-decelerate"),a=vo(this,"emphasized-accelerate");if(this.open){if(r||await this.updateComplete,r){if(vi(this,"open",{cancelable:!0}).defaultPrevented)return}"function"==typeof(null===(e=this.panelSlot)||void 0===e?void 0:e.focus)&&this.panelSlot.focus();const t=fo(this,"medium4");return await ho(this.panelRef.value),this.panelRef.value.hidden=!1,this.updatePositioner(),await Promise.all([co(this.panelRef.value,[{transform:`${this.getCssScaleName()}(0.45)`},{transform:`${this.getCssScaleName()}(1)`}],{duration:r?t:0,easing:s}),co(this.panelRef.value,[{opacity:0},{opacity:1,offset:.125},{opacity:1}],{duration:r?t:0,easing:n})]),void(r&&vi(this,"opened"))}if(!this.open&&r){if(vi(this,"close",{cancelable:!0}).defaultPrevented)return;this.hasTrigger("focus")||"function"!=typeof(null===(t=this.triggerSlot)||void 0===t?void 0:t.focus)||!this.contains(document.activeElement)&&!this.contains(null!==(o=null===(i=document.activeElement)||void 0===i?void 0:i.assignedSlot)&&void 0!==o?o:null)||this.triggerSlot.focus();const e=fo(this,"short4");await ho(this.panelRef.value),await Promise.all([co(this.panelRef.value,[{transform:`${this.getCssScaleName()}(1)`},{transform:`${this.getCssScaleName()}(0.45)`}],{duration:e,easing:a}),co(this.panelRef.value,[{opacity:1},{opacity:1,offset:.875},{opacity:0}],{duration:e,easing:n})]),this.panelRef.value&&(this.panelRef.value.hidden=!0),vi(this,"closed")}}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this.onDocumentClick),document.addEventListener("keydown",this.onDocumentKeydown),window.addEventListener("scroll",this.onWindowScroll),this.updateComplete.then((()=>{this.observeResize=Ci(this.triggerSlot,(()=>{this.updatePositioner()}))}))}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("pointerdown",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),window.removeEventListener("scroll",this.onWindowScroll),null===(e=this.observeResize)||void 0===e||e.unobserve()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("mouseleave",this.onMouseLeave),this.triggerSlot.addEventListener("focus",this.onFocus),this.triggerSlot.addEventListener("click",this.onClick),this.triggerSlot.addEventListener("contextmenu",this.onContextMenu),this.triggerSlot.addEventListener("mouseenter",this.onMouseEnter),P(this.panelRef.value).on("click",this.onPanelClick)}render(){return ct`<slot name="trigger" part="trigger" class="trigger"></slot><slot ${Pi(this.panelRef)} part="panel" class="panel" hidden></slot>`}getCssScaleName(){return"horizontal"===this.animateDirection?"scaleX":"scaleY"}onDocumentClick(e){if(this.disabled||!this.open)return;const t=e.composedPath();t.includes(this)||(this.open=!1),this.hasTrigger("contextmenu")&&!this.hasTrigger("click")&&t.includes(this.triggerSlot)&&(this.open=!1)}onDocumentKeydown(e){var t;!this.disabled&&this.open&&("Escape"!==e.key?"Tab"===e.key&&(this.hasTrigger("focus")||"function"!=typeof(null===(t=this.triggerSlot)||void 0===t?void 0:t.focus)||e.preventDefault(),this.open=!1):this.open=!1)}onWindowScroll(){window.requestAnimationFrame((()=>this.onPositionChange()))}hasTrigger(e){return this.trigger.split(" ").includes(e)}onFocus(){this.disabled||this.open||!this.hasTrigger("focus")||(this.open=!0)}onClick(e){this.disabled||e.button||!this.hasTrigger("click")||this.open&&(this.hasTrigger("hover")||this.hasTrigger("focus"))||(this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!this.open)}onPanelClick(e){const t=e;this.disabled||this.stayOpenOnClick||!P(t.target).is("mdui-menu-item")||(this.open=!1)}onContextMenu(e){!this.disabled&&this.hasTrigger("contextmenu")&&(e.preventDefault(),this.pointerOffsetX=e.offsetX,this.pointerOffsetY=e.offsetY,this.open=!0)}onMouseEnter(){!this.disabled&&this.hasTrigger("hover")&&(window.clearTimeout(this.closeTimeout),this.openDelay?this.openTimeout=window.setTimeout((()=>{this.open=!0}),this.openDelay):this.open=!0)}onMouseLeave(){!this.disabled&&this.hasTrigger("hover")&&(window.clearTimeout(this.openTimeout),this.closeTimeout=window.setTimeout((()=>{this.open=!1}),this.closeDelay||50))}updatePositioner(){var e;const t=P(this.panelRef.value),i=P(window),o=this.panelSlots,r=Math.max(...null!==(e=null==o?void 0:o.map((e=>e.offsetWidth)))&&void 0!==e?e:[]),n=null==o?void 0:o.map((e=>e.offsetHeight)).reduce(((e,t)=>e+t)),s=this.triggerSlot.getBoundingClientRect(),a=this.openOnPointer?{top:this.pointerOffsetY+s.top,left:this.pointerOffsetX+s.left,width:0,height:0}:s;let l,c,d,h,u=this.placement;if("auto"===u){const e=i.width(),t=i.height();let o,s;o=t-a.top-a.height>n+8?"bottom":a.top>n+8?"top":e-a.left-a.width>r+8?"right":a.left>r+8?"left":"bottom",s=["top","bottom"].includes(o)?e-a.left>r+8?"start":a.left+a.width/2>r/2+8&&e-a.left-a.width/2>r/2+8?void 0:a.left+a.width>r+8?"end":"start":t-a.top>n+8?"start":a.top+a.height/2>n/2+8&&t-a.top-a.height/2>n/2+8?void 0:a.top+a.height>n+8?"end":"start",u=s?[o,s].join("-"):o}const[p,m]=u.split("-");switch(this.animateDirection=["top","bottom"].includes(p)?"vertical":"horizontal",p){case"top":c="bottom",d=a.top-n;break;case"bottom":c="top",d=a.top+a.height;break;default:switch(c="center",m){case"start":d=a.top;break;case"end":d=a.top+a.height-n;break;default:d=a.top+a.height/2-n/2}}switch(p){case"left":l="right",h=a.left-r;break;case"right":l="left",h=a.left+a.width;break;default:switch(l="center",m){case"start":h=a.left;break;case"end":h=a.left+a.width-r;break;default:h=a.left+a.width/2-r/2}}t.css({top:d,left:h,transformOrigin:[l,c].join(" ")})}},e.Dropdown.styles=[Wt,xo],Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dropdown.prototype,"open",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi})],e.Dropdown.prototype,"disabled",void 0),Re([Pt({reflect:!0})],e.Dropdown.prototype,"trigger",void 0),Re([Pt({reflect:!0})],e.Dropdown.prototype,"placement",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"stay-open-on-click"})],e.Dropdown.prototype,"stayOpenOnClick",void 0),Re([Pt({type:Number,reflect:!0,attribute:"open-delay"})],e.Dropdown.prototype,"openDelay",void 0),Re([Pt({type:Number,reflect:!0,attribute:"close-delay"})],e.Dropdown.prototype,"closeDelay",void 0),Re([Pt({type:Boolean,reflect:!0,converter:mi,attribute:"open-on-pointer"})],e.Dropdown.prototype,"openOnPointer",void 0),Re([Lt({slot:"trigger",flatten:!0})],e.Dropdown.prototype,"triggerSlots",void 0),Re([Lt({flatten:!0})],e.Dropdown.prototype,"panelSlots",void 0),Re([fi("placement",!0),fi("openOnPointer",!0)],e.Dropdown.prototype,"onPositionChange",null),Re([fi("open")],e.Dropdown.prototype,"onOpenChange",null),e.Dropdown=Re([Et("mdui-dropdown")],e.Dropdown);const $o=(e=0)=>new Promise((t=>setTimeout(t,e))),Ro=Pe`:host{--shape-corner-small:var(--mdui-shape-corner-small);--shape-corner-normal:var(--mdui-shape-corner-large);--shape-corner-large:var(--mdui-shape-corner-extra-large);position:relative;display:inline-block;overflow:hidden;text-align:center;border-radius:var(--shape-corner-normal);cursor:pointer;-webkit-tap-highlight-color:transparent;transition-property:box-shadow;transition-timing-function:var(--mdui-motion-easing-emphasized);transition-duration:var(--mdui-motion-duration-medium4);width:3.5rem;height:3.5rem;box-shadow:var(--mdui-elevation-level3);font-size:var(--mdui-typescale-label-large-size);font-weight:var(--mdui-typescale-label-large-weight);letter-spacing:var(--mdui-typescale-label-large-tracking);line-height:var(--mdui-typescale-label-large-line-height)}.button{padding:0 1rem}:host([size=small]) .button{padding:0 .5rem}:host([size=large]) .button{padding:0 1.875rem}:host([lowered]){box-shadow:var(--mdui-elevation-level1)}:host([focus-visible]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][focus-visible]){box-shadow:var(--mdui-elevation-level1)}:host([pressed]){box-shadow:var(--mdui-elevation-level3)}:host([lowered][pressed]){box-shadow:var(--mdui-elevation-level1)}:host([hover]){box-shadow:var(--mdui-elevation-level4)}:host([lowered][hover]){box-shadow:var(--mdui-elevation-level2)}:host([variant=primary]){color:rgb(var(--mdui-color-on-primary-container));background-color:rgb(var(--mdui-color-primary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
13
13
|
--mdui-color-on-primary-container
|
|
14
14
|
)}:host([variant=surface]){color:rgb(var(--mdui-color-primary));background-color:rgb(var(--mdui-color-surface-container-high));--mdui-comp-ripple-state-layer-color:var(--mdui-color-primary)}:host([variant=surface][lowered]){background-color:rgb(var(--mdui-color-surface-container-low))}:host([variant=secondary]){color:rgb(var(--mdui-color-on-secondary-container));background-color:rgb(var(--mdui-color-secondary-container));--mdui-comp-ripple-state-layer-color:var(
|
|
15
15
|
--mdui-color-on-secondary-container
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "实现 material you 设计规范的 Web Components 组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "mdui.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"lit": "^2.7.5",
|
|
55
55
|
"ssr-window": "^4.0.2",
|
|
56
56
|
"tslib": "^2.6.0",
|
|
57
|
-
"@mdui/shared": "1.0.
|
|
58
|
-
"@mdui/jq": "3.0.0"
|
|
57
|
+
"@mdui/shared": "^1.0.1",
|
|
58
|
+
"@mdui/jq": "^3.0.0"
|
|
59
59
|
}
|
|
60
60
|
}
|