@m3e/dialog 1.0.6 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +919 -434
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +8 -169
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -17
package/dist/index.min.js
CHANGED
|
@@ -3,29 +3,29 @@
|
|
|
3
3
|
* Copyright (c) 2025 matraic
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
|
-
import{LitElement as t,html as e,css as
|
|
6
|
+
import{LitElement as t,html as e,css as i,nothing as s,unsafeCSS as o}from"lit";import{AttachInternals as n,EventAttribute as r,prefersReducedMotion as a,DesignToken as l,HtmlFor as h}from"@m3e/core";function c(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}function d(t,e,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)}function p(t,e,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(t,i):o?o.value=i:e.set(t,i),i}"function"==typeof SuppressedError&&SuppressedError;
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/
|
|
12
|
-
const u=t=>(e,
|
|
12
|
+
const u=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},m=globalThis,f=m.ShadowRoot&&(void 0===m.ShadyCSS||m.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$=Symbol(),g=new WeakMap;
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2019 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/let
|
|
17
|
+
*/let v=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==$)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=g.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&g.set(e,t))}return t}toString(){return this.cssText}};const y=f?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new v("string"==typeof t?t:t+"",void 0,$))(e)})(t):t,{is:_,defineProperty:b,getOwnPropertyDescriptor:A,getOwnPropertyNames:w,getOwnPropertySymbols:E,getPrototypeOf:S}=Object,C=globalThis,x=C.trustedTypes,P=x?x.emptyScript:"",k=C.reactiveElementPolyfillSupport,U=(t,e)=>t,M={toAttribute(t,e){switch(e){case Boolean:t=t?P:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},T=(t,e)=>!_(t,e),O={attribute:!0,type:String,converter:M,reflect:!1,useDefault:!1,hasChanged:T};
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;class H extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=O){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const
|
|
22
|
+
*/Symbol.metadata??=Symbol("metadata"),C.litPropertyMetadata??=new WeakMap;class H extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=O){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&b(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=A(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const n=s?.call(this);o?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??O}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;const t=S(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){const t=this.properties,e=[...w(t),...E(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(y(t))}else void 0!==t&&e.push(y(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(f)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),s=m.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:M).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:M;this._$Em=s;const n=o.fromAttribute(e,t.type);this[s]=n??this._$Ej?.get(s)??n,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??T)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==o||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}H.elementStyles=[],H.shadowRootOptions={mode:"open"},H[U("elementProperties")]=new Map,H[U("finalized")]=new Map,k?.({ReactiveElement:H}),(C.reactiveElementVersions??=[]).push("2.1.1");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:T},z=(t=N,e,
|
|
28
|
+
const N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:T},z=(t=N,e,i)=>{const{kind:s,metadata:o}=i;let n=globalThis.litPropertyMetadata.get(o);if(void 0===n&&globalThis.litPropertyMetadata.set(o,n=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function R(t){return(e,i)=>"object"==typeof i?z(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
@@ -36,177 +36,16 @@ const N={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:T},z=(t=N,e,
|
|
|
36
36
|
* Copyright 2017 Google LLC
|
|
37
37
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
38
38
|
*/
|
|
39
|
-
function j(t,e){return(e,s
|
|
40
|
-
:host {
|
|
41
|
-
display: contents;
|
|
42
|
-
}
|
|
43
|
-
`,c([R({attribute:"return-value"})],D.prototype,"returnValue",void 0),D=c([u("m3e-dialog-action")],D);
|
|
39
|
+
function j(t,e){return(e,i,s)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i))(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}var L;let D=class extends(n(t)){constructor(){super(...arguments),this.returnValue="",L.set(this,t=>{t.defaultPrevented||this.closest("m3e-dialog")?.hide(this.returnValue)})}connectedCallback(){super.connectedCallback(),this.parentElement?.addEventListener("click",d(this,L,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.parentElement?.removeEventListener("click",d(this,L,"f"))}render(){return e`<slot></slot>`}};L=new WeakMap,D.styles=i`:host { display: contents; }`,c([R({attribute:"return-value"})],D.prototype,"returnValue",void 0),D=c([u("m3e-dialog-action")],D);
|
|
44
40
|
/**
|
|
45
41
|
* @license
|
|
46
42
|
* Copyright 2017 Google LLC
|
|
47
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
44
|
*/
|
|
49
|
-
const V=globalThis,W=V.trustedTypes,B=W?W.createPolicy("lit-html",{createHTML:t=>t}):void 0,I="$lit$",q=`lit$${Math.random().toFixed(9).slice(2)}$`,Y="?"+q,F=`<${Y}>`,K=document,Z=()=>K.createComment(""),J=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,Q="[ \t\n\f\r]",X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,st=RegExp(`>|${Q}(?:([^\\s"'>=/]+)(${Q}*=${Q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),it=/'/g,ot=/"/g,nt=/^(?:script|style|textarea|title)$/i,rt=Symbol.for("lit-noChange"),at=Symbol.for("lit-nothing"),lt=new WeakMap,ht=K.createTreeWalker(K,129);function ct(t,e){if(!G(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==B?B.createHTML(e):e}const dt=(t,e)=>{const s=t.length-1,i=[];let o,n=2===e?"<svg>":3===e?"<math>":"",r=X;for(let e=0;e<s;e++){const s=t[e];let a,l,h=-1,c=0;for(;c<s.length&&(r.lastIndex=c,l=r.exec(s),null!==l);)c=r.lastIndex,r===X?"!--"===l[1]?r=tt:void 0!==l[1]?r=et:void 0!==l[2]?(nt.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=st):void 0!==l[3]&&(r=st):r===st?">"===l[0]?(r=o??X,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?st:'"'===l[3]?ot:it):r===ot||r===it?r=st:r===tt||r===et?r=X:(r=st,o=void 0);const d=r===st&&t[e+1].startsWith("/>")?" ":"";n+=r===X?s+F:h>=0?(i.push(a),s.slice(0,h)+I+s.slice(h)+q+d):s+q+(-2===h?e:d)}return[ct(t,n+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class pt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=dt(t,e);if(this.el=pt.createElement(l,s),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ht.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(I)){const e=h[n++],s=i.getAttribute(t).split(q),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:r[2],strings:s,ctor:"."===r[1]?gt:"?"===r[1]?yt:"@"===r[1]?vt:$t}),i.removeAttribute(t)}else t.startsWith(q)&&(a.push({type:6,index:o}),i.removeAttribute(t));if(nt.test(i.tagName)){const t=i.textContent.split(q),e=t.length-1;if(e>0){i.textContent=W?W.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],Z()),ht.nextNode(),a.push({type:2,index:++o});i.append(t[e],Z())}}}else if(8===i.nodeType)if(i.data===Y)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=i.data.indexOf(q,t+1));)a.push({type:7,index:o}),t+=q.length-1}o++}}static createElement(t,e){const s=K.createElement("template");return s.innerHTML=t,s}}function ut(t,e,s=t,i){if(e===rt)return e;let o=void 0!==i?s._$Co?.[i]:s._$Cl;const n=J(e)?void 0:e._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=o:s._$Cl=o),void 0!==o&&(e=ut(t,o._$AS(t,e.values),o,i)),e}class mt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??K).importNode(e,!0);ht.currentNode=i;let o=ht.nextNode(),n=0,r=0,a=s[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new ft(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new _t(o,this,t)),this._$AV.push(e),a=s[++r]}n!==a?.index&&(o=ht.nextNode(),n++)}return ht.currentNode=K,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=at,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ut(this,t,e),J(t)?t===at||null==t||""===t?(this._$AH!==at&&this._$AR(),this._$AH=at):t!==this._$AH&&t!==rt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>G(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==at&&J(this._$AH)?this._$AA.nextSibling.data=t:this.T(K.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=pt.createElement(ct(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new mt(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=lt.get(t.strings);return void 0===e&<.set(t.strings,e=new pt(t)),e}k(t){G(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new ft(this.O(Z()),this.O(Z()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class $t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=at,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=at}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(void 0===o)t=ut(this,t,e,0),n=!J(t)||t!==this._$AH&&t!==rt,n&&(this._$AH=t);else{const i=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=ut(this,i[s+r],e,r),a===rt&&(a=this._$AH[r]),n||=!J(a)||a!==this._$AH[r],a===at?t=at:t!==at&&(t+=(a??"")+o[r+1]),this._$AH[r]=a}n&&!i&&this.j(t)}j(t){t===at?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===at?void 0:t}}class yt extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==at)}}class vt extends $t{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=ut(this,t,e,0)??at)===rt)return;const s=this._$AH,i=t===at&&s!==at||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==at&&(s===at||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class _t{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){ut(this,t)}}const bt=V.litHtmlPolyfillSupport;bt?.(pt,ft),(V.litHtmlVersions??=[]).push("3.3.1");var At,wt,Et,St,Ct,xt,Pt,kt,Ut,Mt,Tt;let Ot=Tt=class extends(r(t,"opening","opened","cancel","closing","closed")){constructor(){super(...arguments),At.add(this),wt.set(this,Tt.__nextId++),Et.set(this,!1),St.set(this,!1),this._hasActions=!1,this.alert=!1,this.dismissible=!1,this.disableClose=!1,this.noFocusTrap=!1,this.closeLabel="Close",this.returnValue=""}get open(){return d(this,Et,"f")}set open(t){t!==d(this,Et,"f")&&(p(this,Et,t,"f"),d(this,Et,"f")?this.show():this.hide())}async show(){if(await this.updateComplete,this._base.open)return;if(!this.dispatchEvent(new Event("opening",{cancelable:!0})))return void(this.open=!1);this._base.showModal(),this._content.scrollTop=0;const t=this.querySelector("[autofocus]");t&&(a()?t.focus():this._base.addEventListener("transitionend",()=>t.focus(),{once:!0})),this.dispatchEvent(new Event("opened"))}async hide(t=this.returnValue){if(!this.isConnected)return void(this.open=!1);if(await this.updateComplete,!this._base.open)return void(this.open=!1);const e=this.returnValue;this.returnValue=t,this.dispatchEvent(new Event("closing",{cancelable:!0}))?(this.open=!1,this._base.close(t),this.dispatchEvent(new Event("closed"))):this.returnValue=e}render(){return e`<dialog
|
|
50
|
-
class="base"
|
|
51
|
-
role="${(t=>t??at)(this.alert?"alertdialog":void 0)}"
|
|
52
|
-
aria-labelledby="m3e-dialog-${d(this,wt,"f")}-header"
|
|
53
|
-
.returnValue="${this.returnValue}"
|
|
54
|
-
@close="${d(this,At,"m",xt)}"
|
|
55
|
-
@cancel="${d(this,At,"m",Pt)}"
|
|
56
|
-
@click="${d(this,At,"m",kt)}"
|
|
57
|
-
@keydown="${d(this,At,"m",Ut)}"
|
|
58
|
-
>
|
|
59
|
-
<m3e-elevation level="3"></m3e-elevation>
|
|
60
|
-
<m3e-focus-trap ?disabled="${this.noFocusTrap}">
|
|
61
|
-
<div class="header">
|
|
62
|
-
<slot name="header" id="m3e-dialog-${d(this,wt,"f")}-header"></slot>
|
|
63
|
-
${d(this,At,"m",Ct).call(this)}
|
|
64
|
-
</div>
|
|
65
|
-
<m3e-scroll-container class="content" dividers="${this._hasActions?"above-below":"above"}">
|
|
66
|
-
<slot></slot>
|
|
67
|
-
</m3e-scroll-container>
|
|
68
|
-
<slot name="actions" @slotchange="${d(this,At,"m",Mt)}"></slot>
|
|
69
|
-
</m3e-focus-trap>
|
|
70
|
-
</dialog>`}};var Ht;wt=new WeakMap,Et=new WeakMap,St=new WeakMap,At=new WeakSet,Ct=function(){return this.dismissible?e`<m3e-icon-button aria-label="${this.closeLabel}" class="close" @click="${this.hide}">
|
|
71
|
-
<slot name="close-icon">
|
|
72
|
-
<svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor">
|
|
73
|
-
<path
|
|
74
|
-
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"
|
|
75
|
-
/>
|
|
76
|
-
</svg>
|
|
77
|
-
</slot>
|
|
78
|
-
</m3e-icon-button>`:i},xt=function(){d(this,St,"f")&&(p(this,St,!0,"f"),this._base?.dispatchEvent(new Event("cancel",{cancelable:!0})))},Pt=function(t){t.target===this._base&&(p(this,St,!1,"f"),t.preventDefault(),this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.hide())},kt=function(t){this.disableClose||t.target!==this._base||this.hide()},Ut=function(t){"Escape"!==t.key||t.shiftKey||t.ctrlKey||(t.preventDefault(),this.disableClose||this.hide())},Mt=function(t){this._hasActions=t.target.assignedNodes({flatten:!0}).length>0,this.classList.toggle("-has-actions",this._hasActions)},Ot.styles=s`
|
|
79
|
-
:host {
|
|
80
|
-
display: contents;
|
|
81
|
-
}
|
|
82
|
-
.base {
|
|
83
|
-
font: inherit;
|
|
84
|
-
border: unset;
|
|
85
|
-
outline: unset;
|
|
86
|
-
padding: unset;
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
position: fixed;
|
|
90
|
-
overflow: visible;
|
|
91
|
-
border-radius: var(--m3e-dialog-shape, ${l.shape.corner.extraLarge});
|
|
92
|
-
min-width: var(--m3e-dialog-min-width, 17.5rem);
|
|
93
|
-
max-width: var(--m3e-dialog-max-width, 35rem);
|
|
94
|
-
color: var(--m3e-dialog-color, ${l.color.onSurface});
|
|
95
|
-
background-color: var(--m3e-dialog-container-color, ${l.color.surfaceContainerHigh});
|
|
96
|
-
visibility: hidden;
|
|
97
|
-
opacity: 0;
|
|
98
|
-
transform-origin: top;
|
|
99
|
-
transform: translateY(-3.125rem) scaleY(0.8);
|
|
100
|
-
}
|
|
101
|
-
.base::backdrop {
|
|
102
|
-
background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent);
|
|
103
|
-
margin-right: -20px;
|
|
104
|
-
}
|
|
105
|
-
.base:not([open]) {
|
|
106
|
-
visibility: hidden;
|
|
107
|
-
opacity: 0;
|
|
108
|
-
transform: translateY(-3.125rem) scaleY(0.8);
|
|
109
|
-
transition: ${o(`opacity ${l.motion.duration.short3} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.short3} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete`)};
|
|
110
|
-
}
|
|
111
|
-
.base[open] {
|
|
112
|
-
visibility: visible;
|
|
113
|
-
opacity: 1;
|
|
114
|
-
transform: translateY(0) scaleY(1);
|
|
115
|
-
transition: ${o(`opacity ${l.motion.duration.long2} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.long2} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete`)};
|
|
116
|
-
}
|
|
117
|
-
.base:not([open])::backdrop {
|
|
118
|
-
transition: ${o(`background-color ${l.motion.duration.short3} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete`)};
|
|
119
|
-
}
|
|
120
|
-
.base[open]::backdrop {
|
|
121
|
-
background-color: color-mix(
|
|
122
|
-
in srgb,
|
|
123
|
-
var(--m3e-dialog-scrim-color, ${l.color.scrim}) var(--m3e-dialog-scrim-opacity, 32%),
|
|
124
|
-
transparent
|
|
125
|
-
);
|
|
126
|
-
transition: ${o(`background-color ${l.motion.duration.long2} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete`)};
|
|
127
|
-
}
|
|
128
|
-
@starting-style {
|
|
129
|
-
.base[open] {
|
|
130
|
-
opacity: 0;
|
|
131
|
-
transform: translateY(-3.125rem) scaleY(0.8);
|
|
132
|
-
}
|
|
133
|
-
.base[open]::backdrop {
|
|
134
|
-
background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
.header {
|
|
138
|
-
flex: none;
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
padding: 1.5rem 1.5rem 1rem 1.5rem;
|
|
142
|
-
background-color: var(--m3e-dialog-header-container-color, transparent);
|
|
143
|
-
}
|
|
144
|
-
::slotted([slot="header"]) {
|
|
145
|
-
margin: unset;
|
|
146
|
-
flex: 1 1 auto;
|
|
147
|
-
color: var(--m3e-dialog-header-color, inherit);
|
|
148
|
-
font-size: var(--m3e-dialog-header-font-size, ${l.typescale.standard.headline.small.fontSize});
|
|
149
|
-
font-weight: var(--m3e-dialog-header-font-weight, ${l.typescale.standard.headline.small.fontWeight});
|
|
150
|
-
line-height: var(--m3e-dialog-header-line-height, ${l.typescale.standard.headline.small.lineHeight});
|
|
151
|
-
letter-spacing: var(--m3e-dialog-header-tracking, ${l.typescale.standard.headline.small.tracking});
|
|
152
|
-
}
|
|
153
|
-
.content {
|
|
154
|
-
padding-inline: 1.5rem;
|
|
155
|
-
color: var(--m3e-dialog-content-color, ${l.color.onSurfaceVariant});
|
|
156
|
-
font-size: var(--m3e-dialog-content-font-size, ${l.typescale.standard.body.medium.fontSize});
|
|
157
|
-
font-weight: var(--m3e-dialog-content-font-weight, ${l.typescale.standard.body.medium.fontWeight});
|
|
158
|
-
line-height: var(--m3e-dialog-content-line-height, ${l.typescale.standard.body.medium.lineHeight});
|
|
159
|
-
letter-spacing: var(--m3e-dialog-content-tracking, ${l.typescale.standard.body.medium.tracking});
|
|
160
|
-
}
|
|
161
|
-
::slotted([slot="actions"]) {
|
|
162
|
-
flex: none;
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
min-height: 1.5rem;
|
|
166
|
-
padding: 1.5rem;
|
|
167
|
-
column-gap: 0.5rem;
|
|
168
|
-
}
|
|
169
|
-
::slotted([slot="actions"][end]) {
|
|
170
|
-
justify-content: flex-end;
|
|
171
|
-
}
|
|
172
|
-
:host(:not(.-has-actions)) .content {
|
|
173
|
-
margin-bottom: 1.5rem;
|
|
174
|
-
}
|
|
175
|
-
.close {
|
|
176
|
-
margin-left: 0.5rem;
|
|
177
|
-
}
|
|
178
|
-
::slotted([slot="close-icon"]),
|
|
179
|
-
.close-icon {
|
|
180
|
-
width: 1em;
|
|
181
|
-
font-size: var(--m3e-icon-button-icon-size, 1.5rem) !important;
|
|
182
|
-
}
|
|
183
|
-
@media (forced-colors: active) {
|
|
184
|
-
.base:not([open])::backdrop,
|
|
185
|
-
.base[open]::backdrop {
|
|
186
|
-
transition: none;
|
|
187
|
-
}
|
|
188
|
-
.base {
|
|
189
|
-
border-style: solid;
|
|
190
|
-
border-width: 1px;
|
|
191
|
-
border-color: CanvasText;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
@media (prefers-reduced-motion) {
|
|
195
|
-
.base:not([open]),
|
|
196
|
-
.base[open],
|
|
197
|
-
.base:not([open])::backdrop,
|
|
198
|
-
.base[open]::backdrop {
|
|
199
|
-
transition: none;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
`,Ot.__nextId=0,c([function(t){return R({...t,state:!0,attribute:!1})}
|
|
45
|
+
const W=globalThis,V=W.trustedTypes,B=V?V.createPolicy("lit-html",{createHTML:t=>t}):void 0,I="$lit$",q=`lit$${Math.random().toFixed(9).slice(2)}$`,Y="?"+q,F=`<${Y}>`,K=document,Z=()=>K.createComment(""),J=t=>null===t||"object"!=typeof t&&"function"!=typeof t,G=Array.isArray,Q="[ \t\n\f\r]",X=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,et=/>/g,it=RegExp(`>|${Q}(?:([^\\s"'>=/]+)(${Q}*=${Q}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),st=/'/g,ot=/"/g,nt=/^(?:script|style|textarea|title)$/i,rt=Symbol.for("lit-noChange"),at=Symbol.for("lit-nothing"),lt=new WeakMap,ht=K.createTreeWalker(K,129);function ct(t,e){if(!G(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==B?B.createHTML(e):e}const dt=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"<svg>":3===e?"<math>":"",r=X;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===X?"!--"===l[1]?r=tt:void 0!==l[1]?r=et:void 0!==l[2]?(nt.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=it):void 0!==l[3]&&(r=it):r===it?">"===l[0]?(r=o??X,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?it:'"'===l[3]?ot:st):r===ot||r===st?r=it:r===tt||r===et?r=X:(r=it,o=void 0);const d=r===it&&t[e+1].startsWith("/>")?" ":"";n+=r===X?i+F:h>=0?(s.push(a),i.slice(0,h)+I+i.slice(h)+q+d):i+q+(-2===h?e:d)}return[ct(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class pt{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=dt(t,e);if(this.el=pt.createElement(l,i),ht.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=ht.nextNode())&&a.length<r;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(I)){const e=h[n++],i=s.getAttribute(t).split(q),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:o,name:r[2],strings:i,ctor:"."===r[1]?gt:"?"===r[1]?vt:"@"===r[1]?yt:$t}),s.removeAttribute(t)}else t.startsWith(q)&&(a.push({type:6,index:o}),s.removeAttribute(t));if(nt.test(s.tagName)){const t=s.textContent.split(q),e=t.length-1;if(e>0){s.textContent=V?V.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],Z()),ht.nextNode(),a.push({type:2,index:++o});s.append(t[e],Z())}}}else if(8===s.nodeType)if(s.data===Y)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(q,t+1));)a.push({type:7,index:o}),t+=q.length-1}o++}}static createElement(t,e){const i=K.createElement("template");return i.innerHTML=t,i}}function ut(t,e,i=t,s){if(e===rt)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const n=J(e)?void 0:e._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=ut(t,o._$AS(t,e.values),o,s)),e}class mt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??K).importNode(e,!0);ht.currentNode=s;let o=ht.nextNode(),n=0,r=0,a=i[0];for(;void 0!==a;){if(n===a.index){let e;2===a.type?e=new ft(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new _t(o,this,t)),this._$AV.push(e),a=i[++r]}n!==a?.index&&(o=ht.nextNode(),n++)}return ht.currentNode=K,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=at,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=ut(this,t,e),J(t)?t===at||null==t||""===t?(this._$AH!==at&&this._$AR(),this._$AH=at):t!==this._$AH&&t!==rt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>G(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==at&&J(this._$AH)?this._$AA.nextSibling.data=t:this.T(K.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=pt.createElement(ct(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new mt(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=lt.get(t.strings);return void 0===e&<.set(t.strings,e=new pt(t)),e}k(t){G(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new ft(this.O(Z()),this.O(Z()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class $t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=at,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=at}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=ut(this,t,e,0),n=!J(t)||t!==this._$AH&&t!==rt,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=ut(this,s[i+r],e,r),a===rt&&(a=this._$AH[r]),n||=!J(a)||a!==this._$AH[r],a===at?t=at:t!==at&&(t+=(a??"")+o[r+1]),this._$AH[r]=a}n&&!s&&this.j(t)}j(t){t===at?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class gt extends $t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===at?void 0:t}}class vt extends $t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==at)}}class yt extends $t{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=ut(this,t,e,0)??at)===rt)return;const i=this._$AH,s=t===at&&i!==at||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==at&&(i===at||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class _t{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){ut(this,t)}}const bt=W.litHtmlPolyfillSupport;bt?.(pt,ft),(W.litHtmlVersions??=[]).push("3.3.1");var At,wt,Et,St,Ct,xt,Pt,kt,Ut,Mt,Tt;let Ot=Tt=class extends(r(t,"opening","opened","cancel","closing","closed")){constructor(){super(...arguments),At.add(this),wt.set(this,Tt.__nextId++),Et.set(this,!1),St.set(this,!1),this._hasActions=!1,this.alert=!1,this.dismissible=!1,this.disableClose=!1,this.noFocusTrap=!1,this.closeLabel="Close",this.returnValue=""}get open(){return d(this,Et,"f")}set open(t){t!==d(this,Et,"f")&&(p(this,Et,t,"f"),d(this,Et,"f")?this.show():this.hide())}async show(){if(await this.updateComplete,this._base.open)return;if(!this.dispatchEvent(new Event("opening",{cancelable:!0})))return void(this.open=!1);this._base.showModal(),this._content.scrollTop=0;const t=this.querySelector("[autofocus]");t&&(a()?t.focus():this._base.addEventListener("transitionend",()=>t.focus(),{once:!0})),this.dispatchEvent(new Event("opened"))}async hide(t=this.returnValue){if(!this.isConnected)return void(this.open=!1);if(await this.updateComplete,!this._base.open)return void(this.open=!1);const e=this.returnValue;this.returnValue=t,this.dispatchEvent(new Event("closing",{cancelable:!0}))?(this.open=!1,this._base.close(t),this.dispatchEvent(new Event("closed"))):this.returnValue=e}render(){return e`<dialog class="base" role="${(t=>t??at)(this.alert?"alertdialog":void 0)}" aria-labelledby="m3e-dialog-${d(this,wt,"f")}-header" .returnvalue="${this.returnValue}" @close="${d(this,At,"m",xt)}" @cancel="${d(this,At,"m",Pt)}" @click="${d(this,At,"m",kt)}" @keydown="${d(this,At,"m",Ut)}"><m3e-elevation level="3"></m3e-elevation><m3e-focus-trap ?disabled="${this.noFocusTrap}"><div class="header"><slot name="header" id="m3e-dialog-${d(this,wt,"f")}-header"></slot>${d(this,At,"m",Ct).call(this)}</div><m3e-scroll-container class="content" dividers="${this._hasActions?"above-below":"above"}"><slot></slot></m3e-scroll-container><slot name="actions" @slotchange="${d(this,At,"m",Mt)}"></slot></m3e-focus-trap></dialog>`}};var Ht;wt=new WeakMap,Et=new WeakMap,St=new WeakMap,At=new WeakSet,Ct=function(){return this.dismissible?e`<m3e-icon-button aria-label="${this.closeLabel}" class="close" @click="${this.hide}"><slot name="close-icon"><svg class="close-icon" viewBox="0 -960 960 960" fill="currentColor"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg></slot></m3e-icon-button>`:s},xt=function(){d(this,St,"f")&&(p(this,St,!0,"f"),this._base?.dispatchEvent(new Event("cancel",{cancelable:!0})))},Pt=function(t){t.target===this._base&&(p(this,St,!1,"f"),t.preventDefault(),this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.hide())},kt=function(t){this.disableClose||t.target!==this._base||this.hide()},Ut=function(t){"Escape"!==t.key||t.shiftKey||t.ctrlKey||(t.preventDefault(),this.disableClose||this.hide())},Mt=function(t){this._hasActions=t.target.assignedNodes({flatten:!0}).length>0,this.classList.toggle("-has-actions",this._hasActions)},Ot.styles=i`:host { display: contents; } .base { font: inherit; border: unset; outline: unset; padding: unset; display: flex; flex-direction: column; position: fixed; overflow: visible; border-radius: var(--m3e-dialog-shape, ${l.shape.corner.extraLarge}); min-width: var(--m3e-dialog-min-width, 17.5rem); max-width: var(--m3e-dialog-max-width, 35rem); color: var(--m3e-dialog-color, ${l.color.onSurface}); background-color: var(--m3e-dialog-container-color, ${l.color.surfaceContainerHigh}); visibility: hidden; opacity: 0; transform-origin: top; transform: translateY(-3.125rem) scaleY(0.8); } .base::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent); margin-inline-end: -20px; } .base:not([open]) { visibility: hidden; opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); transition: ${o(`opacity ${l.motion.duration.short3} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.short3} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.emphasized} allow-discrete`)}; } .base[open] { visibility: visible; opacity: 1; transform: translateY(0) scaleY(1); transition: ${o(`opacity ${l.motion.duration.long2} ${l.motion.easing.emphasized}, \n transform ${l.motion.duration.long2} ${l.motion.easing.emphasized},\n overlay ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.emphasized} allow-discrete`)}; } .base:not([open])::backdrop { transition: ${o(`background-color ${l.motion.duration.short3} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.short3} ${l.motion.easing.standard} allow-discrete`)}; } .base[open]::backdrop { background-color: color-mix( in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) var(--m3e-dialog-scrim-opacity, 32%), transparent ); transition: ${o(`background-color ${l.motion.duration.long2} ${l.motion.easing.standard}, \n overlay ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete,\n visibility ${l.motion.duration.long2} ${l.motion.easing.standard} allow-discrete`)}; } @starting-style { .base[open] { opacity: 0; transform: translateY(-3.125rem) scaleY(0.8); } .base[open]::backdrop { background-color: color-mix(in srgb, var(--m3e-dialog-scrim-color, ${l.color.scrim}) 0%, transparent); } } .header { flex: none; display: flex; align-items: center; padding: 1.5rem 1.5rem 1rem 1.5rem; background-color: var(--m3e-dialog-header-container-color, transparent); } ::slotted([slot="header"]) { margin: unset; flex: 1 1 auto; color: var(--m3e-dialog-header-color, inherit); font-size: var(--m3e-dialog-header-font-size, ${l.typescale.standard.headline.small.fontSize}); font-weight: var(--m3e-dialog-header-font-weight, ${l.typescale.standard.headline.small.fontWeight}); line-height: var(--m3e-dialog-header-line-height, ${l.typescale.standard.headline.small.lineHeight}); letter-spacing: var(--m3e-dialog-header-tracking, ${l.typescale.standard.headline.small.tracking}); } .content { padding-inline: 1.5rem; color: var(--m3e-dialog-content-color, ${l.color.onSurfaceVariant}); font-size: var(--m3e-dialog-content-font-size, ${l.typescale.standard.body.medium.fontSize}); font-weight: var(--m3e-dialog-content-font-weight, ${l.typescale.standard.body.medium.fontWeight}); line-height: var(--m3e-dialog-content-line-height, ${l.typescale.standard.body.medium.lineHeight}); letter-spacing: var(--m3e-dialog-content-tracking, ${l.typescale.standard.body.medium.tracking}); } ::slotted([slot="actions"]) { flex: none; display: flex; align-items: center; min-height: 1.5rem; padding: 1.5rem; column-gap: 0.5rem; } ::slotted([slot="actions"][end]) { justify-content: flex-end; } :host(:not(.-has-actions)) .content { margin-bottom: 1.5rem; } .close { margin-inline-start: 0.5rem; } ::slotted([slot="close-icon"]), .close-icon { width: 1em; font-size: var(--m3e-icon-button-icon-size, 1.5rem) !important; } @media (forced-colors: active) { .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } .base { border-style: solid; border-width: 1px; border-color: CanvasText; } } @media (prefers-reduced-motion) { .base:not([open]), .base[open], .base:not([open])::backdrop, .base[open]::backdrop { transition: none; } }`,Ot.__nextId=0,c([function(t){return R({...t,state:!0,attribute:!1})}
|
|
203
46
|
/**
|
|
204
47
|
* @license
|
|
205
48
|
* Copyright 2017 Google LLC
|
|
206
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
207
|
-
*/()],Ot.prototype,"_hasActions",void 0),c([j(".base")],Ot.prototype,"_base",void 0),c([j(".content")],Ot.prototype,"_content",void 0),c([R({type:Boolean})],Ot.prototype,"alert",void 0),c([R({type:Boolean,reflect:!0})],Ot.prototype,"open",null),c([R({type:Boolean})],Ot.prototype,"dismissible",void 0),c([R({attribute:"disable-close",type:Boolean})],Ot.prototype,"disableClose",void 0),c([R({attribute:"no-focus-trap",type:Boolean})],Ot.prototype,"noFocusTrap",void 0),c([R({attribute:"close-label"})],Ot.prototype,"closeLabel",void 0),Ot=Tt=c([u("m3e-dialog")],Ot);let Nt=class extends(h(n(t))){constructor(){super(...arguments),Ht.set(this,t=>{!t.defaultPrevented&&this.control instanceof Ot&&this.control.show()})}connectedCallback(){super.connectedCallback(),this.parentElement&&(this.parentElement.addEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup="dialog")}disconnectedCallback(){super.disconnectedCallback(),this.parentElement&&(this.parentElement.removeEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup=null)}render(){return e`<slot></slot>`}};Ht=new WeakMap,Nt.styles=
|
|
208
|
-
:host {
|
|
209
|
-
display: contents;
|
|
210
|
-
}
|
|
211
|
-
`,Nt=c([u("m3e-dialog-trigger")],Nt);export{D as M3eDialogActionElement,Ot as M3eDialogElement,Nt as M3eDialogTriggerElement};
|
|
50
|
+
*/()],Ot.prototype,"_hasActions",void 0),c([j(".base")],Ot.prototype,"_base",void 0),c([j(".content")],Ot.prototype,"_content",void 0),c([R({type:Boolean})],Ot.prototype,"alert",void 0),c([R({type:Boolean,reflect:!0})],Ot.prototype,"open",null),c([R({type:Boolean})],Ot.prototype,"dismissible",void 0),c([R({attribute:"disable-close",type:Boolean})],Ot.prototype,"disableClose",void 0),c([R({attribute:"no-focus-trap",type:Boolean})],Ot.prototype,"noFocusTrap",void 0),c([R({attribute:"close-label"})],Ot.prototype,"closeLabel",void 0),Ot=Tt=c([u("m3e-dialog")],Ot);let Nt=class extends(h(n(t))){constructor(){super(...arguments),Ht.set(this,t=>{!t.defaultPrevented&&this.control instanceof Ot&&this.control.show()})}connectedCallback(){super.connectedCallback(),this.parentElement&&(this.parentElement.addEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup="dialog")}disconnectedCallback(){super.disconnectedCallback(),this.parentElement&&(this.parentElement.removeEventListener("click",d(this,Ht,"f")),this.parentElement.ariaHasPopup=null)}render(){return e`<slot></slot>`}};Ht=new WeakMap,Nt.styles=i`:host { display: contents; }`,Nt=c([u("m3e-dialog-trigger")],Nt);export{D as M3eDialogActionElement,Ot as M3eDialogElement,Nt as M3eDialogTriggerElement};
|
|
212
51
|
//# sourceMappingURL=index.min.js.map
|