@m3e/drawer-container 1.0.6 → 1.1.0

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 CHANGED
@@ -21,33 +21,30 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
21
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
22
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
23
  PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
26
-
27
-
28
- function __decorate(decorators, target, key, desc) {
29
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
30
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32
- return c > 3 && r && Object.defineProperty(target, key, r), r;
33
- }
34
-
35
- function __classPrivateFieldGet(receiver, state, kind, f) {
36
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
37
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
38
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
39
- }
40
-
41
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
42
- if (kind === "m") throw new TypeError("Private method is not writable");
43
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
44
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
45
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
46
- }
47
-
48
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
49
- var e = new Error(message);
50
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
24
+ ***************************************************************************** */
25
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
26
+
27
+ function __decorate(decorators, target, key, desc) {
28
+ var c = arguments.length,
29
+ r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
30
+ d;
31
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
32
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33
+ }
34
+ function __classPrivateFieldGet(receiver, state, kind, f) {
35
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
36
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
37
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
38
+ }
39
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
40
+ if (kind === "m") throw new TypeError("Private method is not writable");
41
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
42
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
43
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
44
+ }
45
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
46
+ var e = new Error(message);
47
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
51
48
  };
52
49
 
53
50
  /**
@@ -55,215 +52,412 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
55
52
  * Copyright 2017 Google LLC
56
53
  * SPDX-License-Identifier: BSD-3-Clause
57
54
  */
58
- const t$1=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
55
+ const t$1 = t => (e, o) => {
56
+ void 0 !== o ? o.addInitializer(() => {
57
+ customElements.define(t, e);
58
+ }) : customElements.define(t, e);
59
+ };
59
60
 
60
61
  /**
61
62
  * @license
62
63
  * Copyright 2019 Google LLC
63
64
  * SPDX-License-Identifier: BSD-3-Clause
64
65
  */
65
- const t=globalThis,e$1=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o$2=new WeakMap;let n$2 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$1&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$2.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$2("string"==typeof t?t:t+"",void 0,s),S=(s,o)=>{if(e$1)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$1=e$1?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$3(e)})(t):t;
66
+ const t = globalThis,
67
+ e$1 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
68
+ s = Symbol(),
69
+ o$2 = new WeakMap();
70
+ let n$2 = class n {
71
+ constructor(t, e, o) {
72
+ if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
73
+ this.cssText = t, this.t = e;
74
+ }
75
+ get styleSheet() {
76
+ let t = this.o;
77
+ const s = this.t;
78
+ if (e$1 && void 0 === t) {
79
+ const e = void 0 !== s && 1 === s.length;
80
+ e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
81
+ }
82
+ return t;
83
+ }
84
+ toString() {
85
+ return this.cssText;
86
+ }
87
+ };
88
+ const r$3 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
89
+ S = (s, o) => {
90
+ if (e$1) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
91
+ const o = document.createElement("style"),
92
+ n = t.litNonce;
93
+ void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
94
+ }
95
+ },
96
+ c$1 = e$1 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
97
+ let e = "";
98
+ for (const s of t.cssRules) e += s.cssText;
99
+ return r$3(e);
100
+ })(t) : t;
66
101
 
67
102
  /**
68
103
  * @license
69
104
  * Copyright 2017 Google LLC
70
105
  * SPDX-License-Identifier: BSD-3-Clause
71
- */const{is:i,defineProperty:e,getOwnPropertyDescriptor:h,getOwnPropertyNames:r$2,getOwnPropertySymbols:o$1,getPrototypeOf:n$1}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){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}},f=(t,s)=>!i(t,s),b={attribute:true,type:String,converter:u,reflect:false,useDefault:false,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class y 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,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=n$1(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...r$2(t),...o$1(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$1(s));}else void 0!==s&&i.push(c$1(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,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,s=this.constructor.elementProperties;for(const i of s.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 S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;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,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map,y[d("finalized")]=new Map,p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.1");
106
+ */
107
+ const {
108
+ is: i,
109
+ defineProperty: e,
110
+ getOwnPropertyDescriptor: h,
111
+ getOwnPropertyNames: r$2,
112
+ getOwnPropertySymbols: o$1,
113
+ getPrototypeOf: n$1
114
+ } = Object,
115
+ a = globalThis,
116
+ c = a.trustedTypes,
117
+ l = c ? c.emptyScript : "",
118
+ p = a.reactiveElementPolyfillSupport,
119
+ d = (t, s) => t,
120
+ u = {
121
+ toAttribute(t, s) {
122
+ switch (s) {
123
+ case Boolean:
124
+ t = t ? l : null;
125
+ break;
126
+ case Object:
127
+ case Array:
128
+ t = null == t ? t : JSON.stringify(t);
129
+ }
130
+ return t;
131
+ },
132
+ fromAttribute(t, s) {
133
+ let i = t;
134
+ switch (s) {
135
+ case Boolean:
136
+ i = null !== t;
137
+ break;
138
+ case Number:
139
+ i = null === t ? null : Number(t);
140
+ break;
141
+ case Object:
142
+ case Array:
143
+ try {
144
+ i = JSON.parse(t);
145
+ } catch (t) {
146
+ i = null;
147
+ }
148
+ }
149
+ return i;
150
+ }
151
+ },
152
+ f = (t, s) => !i(t, s),
153
+ b = {
154
+ attribute: true,
155
+ type: String,
156
+ converter: u,
157
+ reflect: false,
158
+ useDefault: false,
159
+ hasChanged: f
160
+ };
161
+ Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
162
+ class y extends HTMLElement {
163
+ static addInitializer(t) {
164
+ this._$Ei(), (this.l ??= []).push(t);
165
+ }
166
+ static get observedAttributes() {
167
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
168
+ }
169
+ static createProperty(t, s = b) {
170
+ if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
171
+ const i = Symbol(),
172
+ h = this.getPropertyDescriptor(t, i, s);
173
+ void 0 !== h && e(this.prototype, t, h);
174
+ }
175
+ }
176
+ static getPropertyDescriptor(t, s, i) {
177
+ const {
178
+ get: e,
179
+ set: r
180
+ } = h(this.prototype, t) ?? {
181
+ get() {
182
+ return this[s];
183
+ },
184
+ set(t) {
185
+ this[s] = t;
186
+ }
187
+ };
188
+ return {
189
+ get: e,
190
+ set(s) {
191
+ const h = e?.call(this);
192
+ r?.call(this, s), this.requestUpdate(t, h, i);
193
+ },
194
+ configurable: true,
195
+ enumerable: true
196
+ };
197
+ }
198
+ static getPropertyOptions(t) {
199
+ return this.elementProperties.get(t) ?? b;
200
+ }
201
+ static _$Ei() {
202
+ if (this.hasOwnProperty(d("elementProperties"))) return;
203
+ const t = n$1(this);
204
+ t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
205
+ }
206
+ static finalize() {
207
+ if (this.hasOwnProperty(d("finalized"))) return;
208
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
209
+ const t = this.properties,
210
+ s = [...r$2(t), ...o$1(t)];
211
+ for (const i of s) this.createProperty(i, t[i]);
212
+ }
213
+ const t = this[Symbol.metadata];
214
+ if (null !== t) {
215
+ const s = litPropertyMetadata.get(t);
216
+ if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
217
+ }
218
+ this._$Eh = new Map();
219
+ for (const [t, s] of this.elementProperties) {
220
+ const i = this._$Eu(t, s);
221
+ void 0 !== i && this._$Eh.set(i, t);
222
+ }
223
+ this.elementStyles = this.finalizeStyles(this.styles);
224
+ }
225
+ static finalizeStyles(s) {
226
+ const i = [];
227
+ if (Array.isArray(s)) {
228
+ const e = new Set(s.flat(1 / 0).reverse());
229
+ for (const s of e) i.unshift(c$1(s));
230
+ } else void 0 !== s && i.push(c$1(s));
231
+ return i;
232
+ }
233
+ static _$Eu(t, s) {
234
+ const i = s.attribute;
235
+ return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
236
+ }
237
+ constructor() {
238
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
239
+ }
240
+ _$Ev() {
241
+ this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
242
+ }
243
+ addController(t) {
244
+ (this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
245
+ }
246
+ removeController(t) {
247
+ this._$EO?.delete(t);
248
+ }
249
+ _$E_() {
250
+ const t = new Map(),
251
+ s = this.constructor.elementProperties;
252
+ for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
253
+ t.size > 0 && (this._$Ep = t);
254
+ }
255
+ createRenderRoot() {
256
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
257
+ return S(t, this.constructor.elementStyles), t;
258
+ }
259
+ connectedCallback() {
260
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
261
+ }
262
+ enableUpdating(t) {}
263
+ disconnectedCallback() {
264
+ this._$EO?.forEach(t => t.hostDisconnected?.());
265
+ }
266
+ attributeChangedCallback(t, s, i) {
267
+ this._$AK(t, i);
268
+ }
269
+ _$ET(t, s) {
270
+ const i = this.constructor.elementProperties.get(t),
271
+ e = this.constructor._$Eu(t, i);
272
+ if (void 0 !== e && true === i.reflect) {
273
+ const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
274
+ this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
275
+ }
276
+ }
277
+ _$AK(t, s) {
278
+ const i = this.constructor,
279
+ e = i._$Eh.get(t);
280
+ if (void 0 !== e && this._$Em !== e) {
281
+ const t = i.getPropertyOptions(e),
282
+ h = "function" == typeof t.converter ? {
283
+ fromAttribute: t.converter
284
+ } : void 0 !== t.converter?.fromAttribute ? t.converter : u;
285
+ this._$Em = e;
286
+ const r = h.fromAttribute(s, t.type);
287
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
288
+ }
289
+ }
290
+ requestUpdate(t, s, i) {
291
+ if (void 0 !== t) {
292
+ const e = this.constructor,
293
+ h = this[t];
294
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
295
+ this.C(t, s, i);
296
+ }
297
+ false === this.isUpdatePending && (this._$ES = this._$EP());
298
+ }
299
+ C(t, s, {
300
+ useDefault: i,
301
+ reflect: e,
302
+ wrapped: h
303
+ }, r) {
304
+ i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), true !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), true === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
305
+ }
306
+ async _$EP() {
307
+ this.isUpdatePending = true;
308
+ try {
309
+ await this._$ES;
310
+ } catch (t) {
311
+ Promise.reject(t);
312
+ }
313
+ const t = this.scheduleUpdate();
314
+ return null != t && (await t), !this.isUpdatePending;
315
+ }
316
+ scheduleUpdate() {
317
+ return this.performUpdate();
318
+ }
319
+ performUpdate() {
320
+ if (!this.isUpdatePending) return;
321
+ if (!this.hasUpdated) {
322
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
323
+ for (const [t, s] of this._$Ep) this[t] = s;
324
+ this._$Ep = void 0;
325
+ }
326
+ const t = this.constructor.elementProperties;
327
+ if (t.size > 0) for (const [s, i] of t) {
328
+ const {
329
+ wrapped: t
330
+ } = i,
331
+ e = this[s];
332
+ true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
333
+ }
334
+ }
335
+ let t = false;
336
+ const s = this._$AL;
337
+ try {
338
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
339
+ } catch (s) {
340
+ throw t = false, this._$EM(), s;
341
+ }
342
+ t && this._$AE(s);
343
+ }
344
+ willUpdate(t) {}
345
+ _$AE(t) {
346
+ this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
347
+ }
348
+ _$EM() {
349
+ this._$AL = new Map(), this.isUpdatePending = false;
350
+ }
351
+ get updateComplete() {
352
+ return this.getUpdateComplete();
353
+ }
354
+ getUpdateComplete() {
355
+ return this._$ES;
356
+ }
357
+ shouldUpdate(t) {
358
+ return true;
359
+ }
360
+ update(t) {
361
+ this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
362
+ }
363
+ updated(t) {}
364
+ firstUpdated(t) {}
365
+ }
366
+ y.elementStyles = [], y.shadowRootOptions = {
367
+ mode: "open"
368
+ }, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
369
+ ReactiveElement: y
370
+ }), (a.reactiveElementVersions ??= []).push("2.1.1");
72
371
 
73
372
  /**
74
373
  * @license
75
374
  * Copyright 2017 Google LLC
76
375
  * SPDX-License-Identifier: BSD-3-Clause
77
- */const o={attribute:true,type:String,converter:u,reflect:false,hasChanged:f},r$1=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
376
+ */
377
+ const o = {
378
+ attribute: true,
379
+ type: String,
380
+ converter: u,
381
+ reflect: false,
382
+ hasChanged: f
383
+ },
384
+ r$1 = (t = o, e, r) => {
385
+ const {
386
+ kind: n,
387
+ metadata: i
388
+ } = r;
389
+ let s = globalThis.litPropertyMetadata.get(i);
390
+ if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = new Map()), "setter" === n && ((t = Object.create(t)).wrapped = true), s.set(r.name, t), "accessor" === n) {
391
+ const {
392
+ name: o
393
+ } = r;
394
+ return {
395
+ set(r) {
396
+ const n = e.get.call(this);
397
+ e.set.call(this, r), this.requestUpdate(o, n, t);
398
+ },
399
+ init(e) {
400
+ return void 0 !== e && this.C(o, void 0, t, e), e;
401
+ }
402
+ };
403
+ }
404
+ if ("setter" === n) {
405
+ const {
406
+ name: o
407
+ } = r;
408
+ return function (r) {
409
+ const n = this[o];
410
+ e.call(this, r), this.requestUpdate(o, n, t);
411
+ };
412
+ }
413
+ throw Error("Unsupported decorator location: " + n);
414
+ };
415
+ function n(t) {
416
+ return (e, o) => "object" == typeof o ? r$1(t, e, o) : ((t, e, o) => {
417
+ const r = e.hasOwnProperty(o);
418
+ return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
419
+ })(t, e, o);
420
+ }
78
421
 
79
422
  /**
80
423
  * @license
81
424
  * Copyright 2017 Google LLC
82
425
  * SPDX-License-Identifier: BSD-3-Clause
83
- */function r(r){return n({...r,state:true,attribute:false})}
426
+ */
427
+ function r(r) {
428
+ return n({
429
+ ...r,
430
+ state: true,
431
+ attribute: false
432
+ });
433
+ }
84
434
 
85
435
  /**
86
436
  * Component design tokens that control `M3eDrawerContainerElement`.
87
437
  * @internal
88
438
  */
89
439
  const DrawerContainerToken = {
90
- containerColor: unsafeCSS(`var(--m3e-drawer-container-color, ${DesignToken.color.surface})`),
91
- containerElevation: unsafeCSS(`var(--m3e-drawer-container-elevation, ${DesignToken.elevation.level0})`),
92
- containerWidth: unsafeCSS(`var(--m3e-drawer-container-width, 22.5rem)`),
93
- scrimOpacity: unsafeCSS("var(--m3e-drawer-container-scrim-opacity, 32%)"),
94
- cornerShape: unsafeCSS(`var(--m3e-modal-drawer-corner-shape, ${DesignToken.shape.corner.large})`),
95
- modalContainerColor: unsafeCSS(`var(--m3e-modal-drawer-container-color, ${DesignToken.color.surfaceContainerLow})`),
96
- modalContainerElevation: unsafeCSS(`var(--m3e-modal-drawer-elevation, ${DesignToken.elevation.level1})`),
97
- dividerColor: unsafeCSS(`var(--m3e-drawer-divider-color, ${DesignToken.color.outline})`),
98
- dividerThickness: unsafeCSS("var(--m3e-drawer-divider-thickness, 1px)"),
440
+ containerColor: unsafeCSS(`var(--m3e-drawer-container-color, ${DesignToken.color.surface})`),
441
+ containerElevation: unsafeCSS(`var(--m3e-drawer-container-elevation, ${DesignToken.elevation.level0})`),
442
+ containerWidth: unsafeCSS(`var(--m3e-drawer-container-width, 22.5rem)`),
443
+ scrimOpacity: unsafeCSS("var(--m3e-drawer-container-scrim-opacity, 32%)"),
444
+ cornerShape: unsafeCSS(`var(--m3e-modal-drawer-corner-shape, ${DesignToken.shape.corner.large})`),
445
+ modalContainerColor: unsafeCSS(`var(--m3e-modal-drawer-container-color, ${DesignToken.color.surfaceContainerLow})`),
446
+ modalContainerElevation: unsafeCSS(`var(--m3e-modal-drawer-elevation, ${DesignToken.elevation.level1})`),
447
+ dividerColor: unsafeCSS(`var(--m3e-drawer-divider-color, ${DesignToken.color.outline})`),
448
+ dividerThickness: unsafeCSS("var(--m3e-drawer-divider-thickness, 1px)")
99
449
  };
100
450
 
101
451
  /**
102
452
  * Styles for `M3eDrawerContainerElement`.
103
453
  * @internal
104
454
  */
105
- const DrawerContainerStyle = css `
106
- :host {
107
- display: flex;
108
- flex-direction: row;
109
- position: relative;
110
- overflow: hidden;
111
- flex: 1 1 auto;
112
- }
113
- .content {
114
- height: 100%;
115
- }
116
- ::slotted([slot="start"]),
117
- ::slotted([slot="end"]) {
118
- display: block;
119
- height: 100%;
120
- z-index: 3;
121
- outline: none;
122
- box-sizing: border-box;
123
- flex: none;
124
- width: ${DrawerContainerToken.containerWidth};
125
- background-color: ${DrawerContainerToken.containerColor};
126
- box-shadow: ${DrawerContainerToken.containerElevation};
127
- transition: ${unsafeCSS(`margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
128
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete,
129
- background-color ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
130
- box-shadow ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard}`)};
131
- }
132
- :host(.-start-over) ::slotted([slot="start"]) {
133
- position: absolute;
134
- top: 0;
135
- left: 0;
136
- }
137
- :host(.-end-over) ::slotted([slot="end"]) {
138
- position: absolute;
139
- top: 0;
140
- right: 0;
141
- }
142
- :host(:not([start])) ::slotted([slot="start"]) {
143
- visibility: hidden;
144
- margin-inline-start: calc(0px - ${DrawerContainerToken.containerWidth});
145
- }
146
- :host([start]) ::slotted([slot="start"]) {
147
- visibility: visible;
148
- margin-inline-start: 0;
149
- }
150
- :host(:not([end])) ::slotted([slot="end"]) {
151
- visibility: hidden;
152
- margin-inline-end: calc(0px - ${DrawerContainerToken.containerWidth});
153
- }
154
- :host([end]) ::slotted([slot="end"]) {
155
- margin-inline-end: 0;
156
- visibility: visible;
157
- }
158
- .content {
159
- flex: 1 1 auto;
160
- position: relative;
161
- height: 100%;
162
- }
163
- .scrim {
164
- display: block;
165
- position: absolute;
166
- left: 0;
167
- right: 0;
168
- top: 0;
169
- bottom: 0;
170
- z-index: 1;
171
- background-color: ${DesignToken.color.scrim};
172
- opacity: 0;
173
- visibility: hidden;
174
- transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
175
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`)};
176
- }
177
- @starting-style {
178
- .scrim {
179
- opacity: 0;
180
- }
181
- }
182
- :host(.-start-push[start]) .scrim,
183
- :host(.-end-push[end]) .scrim,
184
- :host(.-start-over[start]) .scrim,
185
- :host(.-end-over[end]) .scrim {
186
- visibility: visible;
187
- opacity: ${DrawerContainerToken.scrimOpacity};
188
- }
189
- :host(.-start-push) ::slotted([slot="start"]),
190
- :host(.-start-over) ::slotted([slot="start"]) {
191
- border-start-end-radius: ${DrawerContainerToken.cornerShape};
192
- border-end-end-radius: ${DrawerContainerToken.cornerShape};
193
- }
194
- :host(.-end-push) ::slotted([slot="end"]),
195
- :host(.-end-over) ::slotted([slot="end"]) {
196
- border-start-start-radius: ${DrawerContainerToken.cornerShape};
197
- border-end-start-radius: ${DrawerContainerToken.cornerShape};
198
- }
199
- :host(.-start-push) ::slotted([slot="start"]),
200
- :host(.-end-push) ::slotted([slot="end"]),
201
- :host(.-start-over) ::slotted([slot="start"]),
202
- :host(.-end-over) ::slotted([slot="end"]) {
203
- background-color: ${DrawerContainerToken.modalContainerColor};
204
- box-shadow: ${DrawerContainerToken.modalContainerElevation};
205
- }
206
- :host([start-divider]) ::slotted([slot="start"]) {
207
- border-inline-end-color: transparent;
208
- border-inline-end-width: ${DrawerContainerToken.dividerThickness};
209
- border-inline-end-style: solid;
210
- box-sizing: border-box;
211
- }
212
- :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) {
213
- border-inline-end-color: ${DrawerContainerToken.dividerColor};
214
- }
215
- :host([end-divider]) ::slotted([slot="end"]) {
216
- border-inline-start-color: transparent;
217
- border-inline-start-width: ${DrawerContainerToken.dividerThickness};
218
- border-inline-start-style: solid;
219
- box-sizing: border-box;
220
- }
221
- :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) {
222
- border-inline-start-color: ${DrawerContainerToken.dividerColor};
223
- }
224
- @media (forced-colors: active) {
225
- ::slotted([slot="start"]),
226
- ::slotted([slot="end"]) {
227
- background-color: Canvas;
228
- box-shadow: unset;
229
- transition: ${unsafeCSS(`margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
230
- visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`)};
231
- }
232
- :host(.-start-push) ::slotted([slot="start"]),
233
- :host(.-end-push) ::slotted([slot="end"]),
234
- :host(.-start-over) ::slotted([slot="start"]),
235
- :host(.-end-over) ::slotted([slot="end"]) {
236
- background-color: Canvas;
237
- box-shadow: unset;
238
- border-color: CanvasText;
239
- }
240
- ::slotted([slot="start"]),
241
- ::slotted([slot="end"]) {
242
- border-style: solid;
243
- border-color: Canvas;
244
- border-width: 1px;
245
- }
246
- ::slotted([slot="start"]) {
247
- border-inline-start-style: none;
248
- }
249
- ::slotted([slot="end"]) {
250
- border-inline-end-style: none;
251
- }
252
- :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) {
253
- border-inline-end-color: GrayText;
254
- }
255
- :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) {
256
- border-inline-start-color: GrayText;
257
- }
258
- }
259
- @media (prefers-reduced-motion) {
260
- ::slotted([slot="start"]),
261
- ::slotted([slot="end"]),
262
- .scrim {
263
- transition: none;
264
- }
265
- }
266
- `;
455
+ const DrawerContainerStyle = css`:host { display: flex; flex-direction: row; position: relative; overflow: hidden; flex: 1 1 auto; } .content { height: 100%; } ::slotted([slot="start"]), ::slotted([slot="end"]) { display: block; height: 100%; z-index: 3; outline: none; box-sizing: border-box; flex: none; width: ${DrawerContainerToken.containerWidth}; background-color: ${DrawerContainerToken.containerColor}; box-shadow: ${DrawerContainerToken.containerElevation}; transition: ${unsafeCSS(`margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
456
+ visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete,
457
+ background-color ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
458
+ box-shadow ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard}`)}; } :host(.-start-over) ::slotted([slot="start"]) { position: absolute; top: 0; inset-inline-start: 0; } :host(.-end-over) ::slotted([slot="end"]) { position: absolute; top: 0; inset-inline-end: 0; } :host(:not([start])) ::slotted([slot="start"]) { visibility: hidden; margin-inline-start: calc(0px - ${DrawerContainerToken.containerWidth}); } :host([start]) ::slotted([slot="start"]) { margin-inline-start: 0; } :host(:not([end])) ::slotted([slot="end"]) { visibility: hidden; margin-inline-end: calc(0px - ${DrawerContainerToken.containerWidth}); } :host([end]) ::slotted([slot="end"]) { margin-inline-end: 0; } .content { flex: 1 1 auto; position: relative; height: 100%; } .scrim { display: block; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 1; background-color: ${DesignToken.color.scrim}; opacity: 0; visibility: hidden; transition: ${unsafeCSS(`opacity ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
459
+ visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`)}; } @starting-style { .scrim { opacity: 0; } } :host(.-start-push[start]) .scrim, :host(.-end-push[end]) .scrim, :host(.-start-over[start]) .scrim, :host(.-end-over[end]) .scrim { opacity: ${DrawerContainerToken.scrimOpacity}; } :host(.-start-push) ::slotted([slot="start"]), :host(.-start-over) ::slotted([slot="start"]) { border-start-end-radius: ${DrawerContainerToken.cornerShape}; border-end-end-radius: ${DrawerContainerToken.cornerShape}; } :host(.-end-push) ::slotted([slot="end"]), :host(.-end-over) ::slotted([slot="end"]) { border-start-start-radius: ${DrawerContainerToken.cornerShape}; border-end-start-radius: ${DrawerContainerToken.cornerShape}; } :host(.-start-push) ::slotted([slot="start"]), :host(.-end-push) ::slotted([slot="end"]), :host(.-start-over) ::slotted([slot="start"]), :host(.-end-over) ::slotted([slot="end"]) { background-color: ${DrawerContainerToken.modalContainerColor}; box-shadow: ${DrawerContainerToken.modalContainerElevation}; } :host([start-divider]) ::slotted([slot="start"]) { border-inline-end-color: transparent; border-inline-end-width: ${DrawerContainerToken.dividerThickness}; border-inline-end-style: solid; box-sizing: border-box; } :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) { border-inline-end-color: ${DrawerContainerToken.dividerColor}; } :host([end-divider]) ::slotted([slot="end"]) { border-inline-start-color: transparent; border-inline-start-width: ${DrawerContainerToken.dividerThickness}; border-inline-start-style: solid; box-sizing: border-box; } :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) { border-inline-start-color: ${DrawerContainerToken.dividerColor}; } @media (forced-colors: active) { ::slotted([slot="start"]), ::slotted([slot="end"]) { background-color: Canvas; box-shadow: unset; transition: ${unsafeCSS(`margin ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard},
460
+ visibility ${DesignToken.motion.duration.medium4} ${DesignToken.motion.easing.standard} allow-discrete`)}; } :host(.-start-push) ::slotted([slot="start"]), :host(.-end-push) ::slotted([slot="end"]), :host(.-start-over) ::slotted([slot="start"]), :host(.-end-over) ::slotted([slot="end"]) { background-color: Canvas; box-shadow: unset; border-color: CanvasText; } ::slotted([slot="start"]), ::slotted([slot="end"]) { border-style: solid; border-color: Canvas; border-width: 1px; } ::slotted([slot="start"]) { border-inline-start-style: none; } ::slotted([slot="end"]) { border-inline-end-style: none; } :host([start-divider].-start-side[start]:not(.-end-push[end]):not(.-end-over[end])) ::slotted([slot="start"]) { border-inline-end-color: GrayText; } :host([end-divider].-end-side[end]:not(.-start-push[start]):not(.-start-over[start])) ::slotted([slot="end"]) { border-inline-start-color: GrayText; } } @media (prefers-reduced-motion) { ::slotted([slot="start"]), ::slotted([slot="end"]), .scrim { transition: none; } }`;
267
461
 
268
462
  var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointUnobserve, _M3eDrawerContainerElement_disableStartFocusTrap, _M3eDrawerContainerElement_disableEndFocusTrap, _M3eDrawerContainerElement_handleScrimClick, _M3eDrawerContainerElement_handleStartSlotChange, _M3eDrawerContainerElement_handleEndSlotChange, _M3eDrawerContainerElement_clearMode, _M3eDrawerContainerElement_updateMode;
269
463
  /**
@@ -318,190 +512,181 @@ var _M3eDrawerContainerElement_instances, _M3eDrawerContainerElement_breakpointU
318
512
  * @cssprop --m3e-drawer-divider-thickness - The thickness of the divider line.
319
513
  */
320
514
  let M3eDrawerContainerElement = class M3eDrawerContainerElement extends LitElement {
321
- constructor() {
322
- super(...arguments);
323
- _M3eDrawerContainerElement_instances.add(this);
324
- /** @private */ this._startMode = "side";
325
- /** @private */ this._endMode = "side";
326
- /** @private */ _M3eDrawerContainerElement_breakpointUnobserve.set(this, void 0);
327
- /** @private */ _M3eDrawerContainerElement_disableStartFocusTrap.set(this, false);
328
- /** @private */ _M3eDrawerContainerElement_disableEndFocusTrap.set(this, false);
329
- /**
330
- * Whether the start drawer is open.
331
- * @default false
332
- */
333
- this.start = false;
334
- /**
335
- * The behavior mode of the start drawer.
336
- * @default "side"
337
- */
338
- this.startMode = "side";
339
- /**
340
- * Whether to show a divider between the start drawer and content for `side` mode.
341
- * @default "side"
342
- */
343
- this.startDivider = false;
344
- /**
345
- * Whether the end drawer is open.
346
- * @default false
347
- */
348
- this.end = false;
349
- /**
350
- * The behavior mode of the end drawer.
351
- * @default "side"
352
- */
353
- this.endMode = "side";
354
- /**
355
- * Whether to show a divider between the end drawer and content for `side` mode.
356
- * @default "side"
357
- */
358
- this.endDivider = false;
359
- }
360
- /** @inheritdoc */
361
- disconnectedCallback() {
362
- super.disconnectedCallback();
363
- __classPrivateFieldGet(this, _M3eDrawerContainerElement_breakpointUnobserve, "f")?.call(this);
364
- __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_clearMode).call(this);
365
- }
366
- /** @inheritdoc */
367
- update(changedProperties) {
368
- super.update(changedProperties);
369
- if (changedProperties.has("startMode") || changedProperties.has("endMode")) {
370
- __classPrivateFieldGet(this, _M3eDrawerContainerElement_breakpointUnobserve, "f")?.call(this);
371
- if (this.startMode === "auto" || this.endMode === "auto") {
372
- __classPrivateFieldSet(this, _M3eDrawerContainerElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], (matches) => __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this, matches, true)), "f");
373
- }
374
- else {
375
- __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this);
376
- }
377
- }
378
- }
379
- /** @inheritdoc */
380
- render() {
381
- return html `<m3e-focus-trap ?disabled="${!this.start || this._startMode === "side" || __classPrivateFieldGet(this, _M3eDrawerContainerElement_disableStartFocusTrap, "f")}">
382
- <slot name="start" @slotchange="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleStartSlotChange)}"></slot>
383
- </m3e-focus-trap>
384
- <div
385
- class="content"
386
- .inert="${(this._startMode !== "side" || this._endMode !== "side") && (this.start || this.end)}"
387
- >
388
- <slot></slot>
389
- </div>
390
- <div class="scrim" @click="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleScrimClick)}"></div>
391
- <m3e-focus-trap ?disabled="${!this.end || this._endMode === "side" || __classPrivateFieldGet(this, _M3eDrawerContainerElement_disableEndFocusTrap, "f")}">
392
- <slot name="end" @slotchange="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleEndSlotChange)}"></slot>
393
- </m3e-focus-trap>`;
515
+ constructor() {
516
+ super(...arguments);
517
+ _M3eDrawerContainerElement_instances.add(this);
518
+ /** @private */
519
+ this._startMode = "side";
520
+ /** @private */
521
+ this._endMode = "side";
522
+ /** @private */
523
+ _M3eDrawerContainerElement_breakpointUnobserve.set(this, void 0);
524
+ /** @private */
525
+ _M3eDrawerContainerElement_disableStartFocusTrap.set(this, false);
526
+ /** @private */
527
+ _M3eDrawerContainerElement_disableEndFocusTrap.set(this, false);
528
+ /**
529
+ * Whether the start drawer is open.
530
+ * @default false
531
+ */
532
+ this.start = false;
533
+ /**
534
+ * The behavior mode of the start drawer.
535
+ * @default "side"
536
+ */
537
+ this.startMode = "side";
538
+ /**
539
+ * Whether to show a divider between the start drawer and content for `side` mode.
540
+ * @default "side"
541
+ */
542
+ this.startDivider = false;
543
+ /**
544
+ * Whether the end drawer is open.
545
+ * @default false
546
+ */
547
+ this.end = false;
548
+ /**
549
+ * The behavior mode of the end drawer.
550
+ * @default "side"
551
+ */
552
+ this.endMode = "side";
553
+ /**
554
+ * Whether to show a divider between the end drawer and content for `side` mode.
555
+ * @default "side"
556
+ */
557
+ this.endDivider = false;
558
+ }
559
+ /** @inheritdoc */
560
+ disconnectedCallback() {
561
+ super.disconnectedCallback();
562
+ __classPrivateFieldGet(this, _M3eDrawerContainerElement_breakpointUnobserve, "f")?.call(this);
563
+ __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_clearMode).call(this);
564
+ }
565
+ /** @inheritdoc */
566
+ update(changedProperties) {
567
+ super.update(changedProperties);
568
+ if (changedProperties.has("startMode") || changedProperties.has("endMode")) {
569
+ __classPrivateFieldGet(this, _M3eDrawerContainerElement_breakpointUnobserve, "f")?.call(this);
570
+ if (this.startMode === "auto" || this.endMode === "auto") {
571
+ __classPrivateFieldSet(this, _M3eDrawerContainerElement_breakpointUnobserve, M3eBreakpointObserver.observe([Breakpoint.XSmall, Breakpoint.Small], matches => __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this, matches, true)), "f");
572
+ } else {
573
+ __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_updateMode).call(this);
574
+ }
394
575
  }
576
+ }
577
+ /** @inheritdoc */
578
+ render() {
579
+ return html`<m3e-focus-trap ?disabled="${!this.start || this._startMode === "side" || __classPrivateFieldGet(this, _M3eDrawerContainerElement_disableStartFocusTrap, "f")}"><slot name="start" @slotchange="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleStartSlotChange)}"></slot></m3e-focus-trap><div class="content" .inert="${(this._startMode !== "side" || this._endMode !== "side") && (this.start || this.end)}"><slot></slot></div><div class="scrim" @click="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleScrimClick)}"></div><m3e-focus-trap ?disabled="${!this.end || this._endMode === "side" || __classPrivateFieldGet(this, _M3eDrawerContainerElement_disableEndFocusTrap, "f")}"><slot name="end" @slotchange="${__classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_handleEndSlotChange)}"></slot></m3e-focus-trap>`;
580
+ }
395
581
  };
396
582
  _M3eDrawerContainerElement_breakpointUnobserve = new WeakMap();
397
583
  _M3eDrawerContainerElement_disableStartFocusTrap = new WeakMap();
398
584
  _M3eDrawerContainerElement_disableEndFocusTrap = new WeakMap();
399
585
  _M3eDrawerContainerElement_instances = new WeakSet();
400
586
  _M3eDrawerContainerElement_handleScrimClick = function _M3eDrawerContainerElement_handleScrimClick() {
401
- if (this._startMode !== "side") {
402
- this.start = false;
403
- }
404
- if (this._endMode !== "side") {
405
- this.end = false;
406
- }
407
- this.dispatchEvent(new Event("change", { bubbles: true }));
587
+ if (this._startMode !== "side") {
588
+ this.start = false;
589
+ }
590
+ if (this._endMode !== "side") {
591
+ this.end = false;
592
+ }
593
+ this.dispatchEvent(new Event("change", {
594
+ bubbles: true
595
+ }));
408
596
  };
409
597
  _M3eDrawerContainerElement_handleStartSlotChange = function _M3eDrawerContainerElement_handleStartSlotChange(e) {
410
- __classPrivateFieldSet(this, _M3eDrawerContainerElement_disableStartFocusTrap, !hasAssignedNodes(e.target), "f");
598
+ __classPrivateFieldSet(this, _M3eDrawerContainerElement_disableStartFocusTrap, !hasAssignedNodes(e.target), "f");
411
599
  };
412
600
  _M3eDrawerContainerElement_handleEndSlotChange = function _M3eDrawerContainerElement_handleEndSlotChange(e) {
413
- __classPrivateFieldSet(this, _M3eDrawerContainerElement_disableEndFocusTrap, !hasAssignedNodes(e.target), "f");
601
+ __classPrivateFieldSet(this, _M3eDrawerContainerElement_disableEndFocusTrap, !hasAssignedNodes(e.target), "f");
414
602
  };
415
603
  _M3eDrawerContainerElement_clearMode = function _M3eDrawerContainerElement_clearMode() {
416
- this.classList.remove("-start-over");
417
- this.classList.remove("-start-push");
418
- this.classList.remove("-start-side");
419
- this.classList.remove("-end-over");
420
- this.classList.remove("-end-push");
421
- this.classList.remove("-end-side");
604
+ this.classList.remove("-start-over");
605
+ this.classList.remove("-start-push");
606
+ this.classList.remove("-start-side");
607
+ this.classList.remove("-end-over");
608
+ this.classList.remove("-end-push");
609
+ this.classList.remove("-end-side");
422
610
  };
423
611
  _M3eDrawerContainerElement_updateMode = function _M3eDrawerContainerElement_updateMode(breakpoints, autoClose = false) {
424
- let autoCloseStart = false, autoCloseEnd = false;
425
- if (this.startMode === "auto") {
426
- if (breakpoints?.get(Breakpoint.Medium)) {
427
- this._startMode = "side";
428
- }
429
- else if (breakpoints?.get(Breakpoint.Small)) {
430
- autoCloseStart = this._startMode === "side" && this.start;
431
- this._startMode = "push";
432
- }
433
- else if (breakpoints?.get(Breakpoint.XSmall)) {
434
- autoCloseStart = this._startMode !== "over" && this.start;
435
- this._startMode = "over";
436
- }
437
- else {
438
- this._startMode = "side";
439
- }
612
+ let autoCloseStart = false,
613
+ autoCloseEnd = false;
614
+ if (this.startMode === "auto") {
615
+ if (breakpoints?.get(Breakpoint.Medium)) {
616
+ this._startMode = "side";
617
+ } else if (breakpoints?.get(Breakpoint.Small)) {
618
+ autoCloseStart = this._startMode === "side" && this.start;
619
+ this._startMode = "push";
620
+ } else if (breakpoints?.get(Breakpoint.XSmall)) {
621
+ autoCloseStart = this._startMode !== "over" && this.start;
622
+ this._startMode = "over";
623
+ } else {
624
+ this._startMode = "side";
440
625
  }
441
- else {
442
- this._startMode = this.startMode;
626
+ } else {
627
+ this._startMode = this.startMode;
628
+ }
629
+ if (this.endMode === "auto") {
630
+ if (breakpoints?.get(Breakpoint.Medium)) {
631
+ this._endMode = "side";
632
+ } else if (breakpoints?.get(Breakpoint.Small)) {
633
+ autoCloseEnd = this._endMode === "side" && this.end;
634
+ this._endMode = "push";
635
+ } else if (breakpoints?.get(Breakpoint.XSmall)) {
636
+ autoCloseEnd = this._endMode !== "over" && this.end;
637
+ this._endMode = "over";
638
+ } else {
639
+ this._endMode = "side";
443
640
  }
444
- if (this.endMode === "auto") {
445
- if (breakpoints?.get(Breakpoint.Medium)) {
446
- this._endMode = "side";
447
- }
448
- else if (breakpoints?.get(Breakpoint.Small)) {
449
- autoCloseEnd = this._endMode === "side" && this.end;
450
- this._endMode = "push";
451
- }
452
- else if (breakpoints?.get(Breakpoint.XSmall)) {
453
- autoCloseEnd = this._endMode !== "over" && this.end;
454
- this._endMode = "over";
455
- }
456
- else {
457
- this._endMode = "side";
458
- }
641
+ } else {
642
+ this._endMode = this.endMode;
643
+ }
644
+ __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_clearMode).call(this);
645
+ this.classList.add(`-start-${this._startMode}`);
646
+ this.classList.add(`-end-${this._endMode}`);
647
+ if (autoClose && (autoCloseStart || autoCloseEnd)) {
648
+ if (autoCloseStart) {
649
+ this.start = false;
459
650
  }
460
- else {
461
- this._endMode = this.endMode;
462
- }
463
- __classPrivateFieldGet(this, _M3eDrawerContainerElement_instances, "m", _M3eDrawerContainerElement_clearMode).call(this);
464
- this.classList.add(`-start-${this._startMode}`);
465
- this.classList.add(`-end-${this._endMode}`);
466
- if (autoClose && (autoCloseStart || autoCloseEnd)) {
467
- if (autoCloseStart) {
468
- this.start = false;
469
- }
470
- if (autoCloseEnd) {
471
- this.end = false;
472
- }
473
- this.dispatchEvent(new Event("change", { bubbles: true }));
651
+ if (autoCloseEnd) {
652
+ this.end = false;
474
653
  }
654
+ this.dispatchEvent(new Event("change", {
655
+ bubbles: true
656
+ }));
657
+ }
475
658
  };
476
659
  /** The styles of the element. */
477
660
  M3eDrawerContainerElement.styles = DrawerContainerStyle;
478
- __decorate([
479
- r()
480
- ], M3eDrawerContainerElement.prototype, "_startMode", void 0);
481
- __decorate([
482
- r()
483
- ], M3eDrawerContainerElement.prototype, "_endMode", void 0);
484
- __decorate([
485
- n({ type: Boolean, reflect: true })
486
- ], M3eDrawerContainerElement.prototype, "start", void 0);
487
- __decorate([
488
- n({ attribute: "start-mode", reflect: true })
489
- ], M3eDrawerContainerElement.prototype, "startMode", void 0);
490
- __decorate([
491
- n({ attribute: "start-divider", type: Boolean, reflect: true })
492
- ], M3eDrawerContainerElement.prototype, "startDivider", void 0);
493
- __decorate([
494
- n({ type: Boolean, reflect: true })
495
- ], M3eDrawerContainerElement.prototype, "end", void 0);
496
- __decorate([
497
- n({ attribute: "end-mode", reflect: true })
498
- ], M3eDrawerContainerElement.prototype, "endMode", void 0);
499
- __decorate([
500
- n({ attribute: "end-divider", type: Boolean, reflect: true })
501
- ], M3eDrawerContainerElement.prototype, "endDivider", void 0);
502
- M3eDrawerContainerElement = __decorate([
503
- t$1("m3e-drawer-container")
504
- ], M3eDrawerContainerElement);
661
+ __decorate([r()], M3eDrawerContainerElement.prototype, "_startMode", void 0);
662
+ __decorate([r()], M3eDrawerContainerElement.prototype, "_endMode", void 0);
663
+ __decorate([n({
664
+ type: Boolean,
665
+ reflect: true
666
+ })], M3eDrawerContainerElement.prototype, "start", void 0);
667
+ __decorate([n({
668
+ attribute: "start-mode",
669
+ reflect: true
670
+ })], M3eDrawerContainerElement.prototype, "startMode", void 0);
671
+ __decorate([n({
672
+ attribute: "start-divider",
673
+ type: Boolean,
674
+ reflect: true
675
+ })], M3eDrawerContainerElement.prototype, "startDivider", void 0);
676
+ __decorate([n({
677
+ type: Boolean,
678
+ reflect: true
679
+ })], M3eDrawerContainerElement.prototype, "end", void 0);
680
+ __decorate([n({
681
+ attribute: "end-mode",
682
+ reflect: true
683
+ })], M3eDrawerContainerElement.prototype, "endMode", void 0);
684
+ __decorate([n({
685
+ attribute: "end-divider",
686
+ type: Boolean,
687
+ reflect: true
688
+ })], M3eDrawerContainerElement.prototype, "endDivider", void 0);
689
+ M3eDrawerContainerElement = __decorate([t$1("m3e-drawer-container")], M3eDrawerContainerElement);
505
690
 
506
691
  var _M3eDrawerToggleElement_instances, _M3eDrawerToggleElement_clickHandler, _M3eDrawerToggleElement_drawerContainerChangeHandler, _M3eDrawerToggleElement_handleClick, _M3eDrawerToggleElement_handleDrawerContainerChange, _M3eDrawerToggleElement_updateToggle;
507
692
  /**
@@ -529,110 +714,100 @@ var _M3eDrawerToggleElement_instances, _M3eDrawerToggleElement_clickHandler, _M3
529
714
  * @tag m3e-drawer-toggle
530
715
  */
531
716
  let M3eDrawerToggleElement = class M3eDrawerToggleElement extends HtmlFor(LitElement) {
532
- constructor() {
533
- super(...arguments);
534
- _M3eDrawerToggleElement_instances.add(this);
535
- /** @private */ _M3eDrawerToggleElement_clickHandler.set(this, (e) => __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_handleClick).call(this, e));
536
- /** @private */ _M3eDrawerToggleElement_drawerContainerChangeHandler.set(this, () => __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_handleDrawerContainerChange).call(this));
537
- }
538
- /** @inheritdoc */
539
- connectedCallback() {
540
- super.connectedCallback();
541
- this.parentElement?.addEventListener("click", __classPrivateFieldGet(this, _M3eDrawerToggleElement_clickHandler, "f"));
717
+ constructor() {
718
+ super(...arguments);
719
+ _M3eDrawerToggleElement_instances.add(this);
720
+ /** @private */
721
+ _M3eDrawerToggleElement_clickHandler.set(this, e => __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_handleClick).call(this, e));
722
+ /** @private */
723
+ _M3eDrawerToggleElement_drawerContainerChangeHandler.set(this, () => __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_handleDrawerContainerChange).call(this));
724
+ }
725
+ /** @inheritdoc */
726
+ connectedCallback() {
727
+ super.connectedCallback();
728
+ this.parentElement?.addEventListener("click", __classPrivateFieldGet(this, _M3eDrawerToggleElement_clickHandler, "f"));
729
+ }
730
+ /** @inheritdoc */
731
+ disconnectedCallback() {
732
+ super.disconnectedCallback();
733
+ this.parentElement?.removeEventListener("click", __classPrivateFieldGet(this, _M3eDrawerToggleElement_clickHandler, "f"));
734
+ }
735
+ /** @inheritdoc */
736
+ attach(control) {
737
+ super.attach(control);
738
+ if (this.htmlFor && this.parentElement) {
739
+ addAriaReferencedId(this.parentElement, "aria-controls", this.htmlFor);
542
740
  }
543
- /** @inheritdoc */
544
- disconnectedCallback() {
545
- super.disconnectedCallback();
546
- this.parentElement?.removeEventListener("click", __classPrivateFieldGet(this, _M3eDrawerToggleElement_clickHandler, "f"));
547
- }
548
- /** @inheritdoc */
549
- attach(control) {
550
- super.attach(control);
551
- if (this.htmlFor && this.parentElement) {
552
- addAriaReferencedId(this.parentElement, "aria-controls", this.htmlFor);
553
- }
554
- const container = control.closest("m3e-drawer-container");
555
- if (container) {
556
- container.addEventListener("change", __classPrivateFieldGet(this, _M3eDrawerToggleElement_drawerContainerChangeHandler, "f"));
557
- __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
558
- }
559
- }
560
- /** @inheritdoc */
561
- detach() {
562
- if (this.parentElement) {
563
- if (this.htmlFor) {
564
- removeAriaReferencedId(this.parentElement, "aria-controls", this.htmlFor);
565
- }
566
- this.parentElement.ariaExpanded = null;
567
- }
568
- this.control?.closest("m3e-drawer-container")?.removeEventListener("change", __classPrivateFieldGet(this, _M3eDrawerToggleElement_drawerContainerChangeHandler, "f"));
569
- super.detach();
741
+ const container = control.closest("m3e-drawer-container");
742
+ if (container) {
743
+ container.addEventListener("change", __classPrivateFieldGet(this, _M3eDrawerToggleElement_drawerContainerChangeHandler, "f"));
744
+ __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
570
745
  }
571
- /** @inheritdoc */
572
- render() {
573
- return html `<slot></slot>`;
746
+ }
747
+ /** @inheritdoc */
748
+ detach() {
749
+ if (this.parentElement) {
750
+ if (this.htmlFor) {
751
+ removeAriaReferencedId(this.parentElement, "aria-controls", this.htmlFor);
752
+ }
753
+ this.parentElement.ariaExpanded = null;
574
754
  }
755
+ this.control?.closest("m3e-drawer-container")?.removeEventListener("change", __classPrivateFieldGet(this, _M3eDrawerToggleElement_drawerContainerChangeHandler, "f"));
756
+ super.detach();
757
+ }
758
+ /** @inheritdoc */
759
+ render() {
760
+ return html`<slot></slot>`;
761
+ }
575
762
  };
576
763
  _M3eDrawerToggleElement_clickHandler = new WeakMap();
577
764
  _M3eDrawerToggleElement_drawerContainerChangeHandler = new WeakMap();
578
765
  _M3eDrawerToggleElement_instances = new WeakSet();
579
766
  _M3eDrawerToggleElement_handleClick = function _M3eDrawerToggleElement_handleClick(e) {
580
- if (!e.defaultPrevented && this.control && this.parentElement) {
581
- const container = this.control.closest("m3e-drawer-container");
582
- if (container) {
583
- if (this.control.slot === "start") {
584
- container.start = !container.start;
585
- }
586
- else if (this.control.slot === "end") {
587
- container.end = !container.end;
588
- }
589
- __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
590
- }
767
+ if (!e.defaultPrevented && this.control && this.parentElement) {
768
+ const container = this.control.closest("m3e-drawer-container");
769
+ if (container) {
770
+ if (this.control.slot === "start") {
771
+ container.start = !container.start;
772
+ } else if (this.control.slot === "end") {
773
+ container.end = !container.end;
774
+ }
775
+ __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
591
776
  }
777
+ }
592
778
  };
593
779
  _M3eDrawerToggleElement_handleDrawerContainerChange = function _M3eDrawerToggleElement_handleDrawerContainerChange() {
594
- if (this.control) {
595
- const container = this.control.closest("m3e-drawer-container");
596
- if (container) {
597
- __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
598
- }
780
+ if (this.control) {
781
+ const container = this.control.closest("m3e-drawer-container");
782
+ if (container) {
783
+ __classPrivateFieldGet(this, _M3eDrawerToggleElement_instances, "m", _M3eDrawerToggleElement_updateToggle).call(this, container);
599
784
  }
785
+ }
600
786
  };
601
- _M3eDrawerToggleElement_updateToggle =
602
- /** @private */
787
+ _M3eDrawerToggleElement_updateToggle = /** @private */
603
788
  async function _M3eDrawerToggleElement_updateToggle(container) {
604
- if (!this.parentElement || !this.control) {
605
- return;
606
- }
607
- let selected = false;
608
- if (this.control.slot === "start") {
609
- selected = container.start;
610
- }
611
- else if (this.control.slot === "end") {
612
- selected = container.end;
613
- }
614
- this.parentElement.ariaExpanded = `${selected}`;
615
- if (this.parentElement.hasAttribute("toggle")) {
616
- this.parentElement.toggleAttribute("selected", selected);
617
- }
618
- if (this.parentElement instanceof LitElement) {
619
- // Wait for update and remove aria-pressed due to use of aria-expanded.
620
- await this.parentElement.updateComplete;
621
- this.parentElement.ariaPressed = null;
622
- }
789
+ if (!this.parentElement || !this.control) {
790
+ return;
791
+ }
792
+ let selected = false;
793
+ if (this.control.slot === "start") {
794
+ selected = container.start;
795
+ } else if (this.control.slot === "end") {
796
+ selected = container.end;
797
+ }
798
+ this.parentElement.ariaExpanded = `${selected}`;
799
+ if (this.parentElement.hasAttribute("toggle")) {
800
+ this.parentElement.toggleAttribute("selected", selected);
801
+ }
802
+ if (this.parentElement instanceof LitElement) {
803
+ // Wait for update and remove aria-pressed due to use of aria-expanded.
804
+ await this.parentElement.updateComplete;
805
+ this.parentElement.ariaPressed = null;
806
+ }
623
807
  };
624
808
  /** The styles of the element. */
625
- M3eDrawerToggleElement.styles = css `
626
- :host {
627
- display: contents;
628
- }
629
- ::slotted(.material-icons) {
630
- font-size: inherit !important;
631
- }
632
- `;
633
- M3eDrawerToggleElement = __decorate([
634
- t$1("m3e-drawer-toggle")
635
- ], M3eDrawerToggleElement);
809
+ M3eDrawerToggleElement.styles = css`:host { display: contents; } ::slotted(.material-icons) { font-size: inherit !important; }`;
810
+ M3eDrawerToggleElement = __decorate([t$1("m3e-drawer-toggle")], M3eDrawerToggleElement);
636
811
 
637
812
  export { M3eDrawerContainerElement, M3eDrawerToggleElement };
638
813
  //# sourceMappingURL=index.js.map