@m3e/app-bar 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 +541 -393
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -192
- package/dist/index.min.js.map +1 -1
- package/package.json +2 -16
package/dist/index.js
CHANGED
|
@@ -19,26 +19,24 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
19
19
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
20
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
21
|
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
-
***************************************************************************** */
|
|
23
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var e = new Error(message);
|
|
41
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
24
|
+
|
|
25
|
+
function __decorate(decorators, target, key, desc) {
|
|
26
|
+
var c = arguments.length,
|
|
27
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
28
|
+
d;
|
|
29
|
+
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;
|
|
30
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
+
}
|
|
32
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
33
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
34
|
+
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");
|
|
35
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
36
|
+
}
|
|
37
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
38
|
+
var e = new Error(message);
|
|
39
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
/**
|
|
@@ -46,151 +44,455 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
46
44
|
* Copyright 2017 Google LLC
|
|
47
45
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
46
|
*/
|
|
49
|
-
const t$1=t=>(e,o)=>
|
|
47
|
+
const t$1 = t => (e, o) => {
|
|
48
|
+
void 0 !== o ? o.addInitializer(() => {
|
|
49
|
+
customElements.define(t, e);
|
|
50
|
+
}) : customElements.define(t, e);
|
|
51
|
+
};
|
|
50
52
|
|
|
51
53
|
/**
|
|
52
54
|
* @license
|
|
53
55
|
* Copyright 2019 Google LLC
|
|
54
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
57
|
*/
|
|
56
|
-
const t
|
|
58
|
+
const t = globalThis,
|
|
59
|
+
e$3 = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
60
|
+
s = Symbol(),
|
|
61
|
+
o$2 = new WeakMap();
|
|
62
|
+
let n$2 = class n {
|
|
63
|
+
constructor(t, e, o) {
|
|
64
|
+
if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
65
|
+
this.cssText = t, this.t = e;
|
|
66
|
+
}
|
|
67
|
+
get styleSheet() {
|
|
68
|
+
let t = this.o;
|
|
69
|
+
const s = this.t;
|
|
70
|
+
if (e$3 && void 0 === t) {
|
|
71
|
+
const e = void 0 !== s && 1 === s.length;
|
|
72
|
+
e && (t = o$2.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$2.set(s, t));
|
|
73
|
+
}
|
|
74
|
+
return t;
|
|
75
|
+
}
|
|
76
|
+
toString() {
|
|
77
|
+
return this.cssText;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
|
|
81
|
+
S = (s, o) => {
|
|
82
|
+
if (e$3) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
|
|
83
|
+
const o = document.createElement("style"),
|
|
84
|
+
n = t.litNonce;
|
|
85
|
+
void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
c$1 = e$3 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
|
|
89
|
+
let e = "";
|
|
90
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
91
|
+
return r$2(e);
|
|
92
|
+
})(t) : t;
|
|
57
93
|
|
|
58
94
|
/**
|
|
59
95
|
* @license
|
|
60
96
|
* Copyright 2017 Google LLC
|
|
61
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
62
|
-
*/
|
|
98
|
+
*/
|
|
99
|
+
const {
|
|
100
|
+
is: i,
|
|
101
|
+
defineProperty: e$2,
|
|
102
|
+
getOwnPropertyDescriptor: h,
|
|
103
|
+
getOwnPropertyNames: r$1,
|
|
104
|
+
getOwnPropertySymbols: o$1,
|
|
105
|
+
getPrototypeOf: n$1
|
|
106
|
+
} = Object,
|
|
107
|
+
a = globalThis,
|
|
108
|
+
c = a.trustedTypes,
|
|
109
|
+
l = c ? c.emptyScript : "",
|
|
110
|
+
p = a.reactiveElementPolyfillSupport,
|
|
111
|
+
d = (t, s) => t,
|
|
112
|
+
u = {
|
|
113
|
+
toAttribute(t, s) {
|
|
114
|
+
switch (s) {
|
|
115
|
+
case Boolean:
|
|
116
|
+
t = t ? l : null;
|
|
117
|
+
break;
|
|
118
|
+
case Object:
|
|
119
|
+
case Array:
|
|
120
|
+
t = null == t ? t : JSON.stringify(t);
|
|
121
|
+
}
|
|
122
|
+
return t;
|
|
123
|
+
},
|
|
124
|
+
fromAttribute(t, s) {
|
|
125
|
+
let i = t;
|
|
126
|
+
switch (s) {
|
|
127
|
+
case Boolean:
|
|
128
|
+
i = null !== t;
|
|
129
|
+
break;
|
|
130
|
+
case Number:
|
|
131
|
+
i = null === t ? null : Number(t);
|
|
132
|
+
break;
|
|
133
|
+
case Object:
|
|
134
|
+
case Array:
|
|
135
|
+
try {
|
|
136
|
+
i = JSON.parse(t);
|
|
137
|
+
} catch (t) {
|
|
138
|
+
i = null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return i;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
f = (t, s) => !i(t, s),
|
|
145
|
+
b = {
|
|
146
|
+
attribute: true,
|
|
147
|
+
type: String,
|
|
148
|
+
converter: u,
|
|
149
|
+
reflect: false,
|
|
150
|
+
useDefault: false,
|
|
151
|
+
hasChanged: f
|
|
152
|
+
};
|
|
153
|
+
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
|
|
154
|
+
class y extends HTMLElement {
|
|
155
|
+
static addInitializer(t) {
|
|
156
|
+
this._$Ei(), (this.l ??= []).push(t);
|
|
157
|
+
}
|
|
158
|
+
static get observedAttributes() {
|
|
159
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
160
|
+
}
|
|
161
|
+
static createProperty(t, s = b) {
|
|
162
|
+
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) {
|
|
163
|
+
const i = Symbol(),
|
|
164
|
+
h = this.getPropertyDescriptor(t, i, s);
|
|
165
|
+
void 0 !== h && e$2(this.prototype, t, h);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
static getPropertyDescriptor(t, s, i) {
|
|
169
|
+
const {
|
|
170
|
+
get: e,
|
|
171
|
+
set: r
|
|
172
|
+
} = h(this.prototype, t) ?? {
|
|
173
|
+
get() {
|
|
174
|
+
return this[s];
|
|
175
|
+
},
|
|
176
|
+
set(t) {
|
|
177
|
+
this[s] = t;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
return {
|
|
181
|
+
get: e,
|
|
182
|
+
set(s) {
|
|
183
|
+
const h = e?.call(this);
|
|
184
|
+
r?.call(this, s), this.requestUpdate(t, h, i);
|
|
185
|
+
},
|
|
186
|
+
configurable: true,
|
|
187
|
+
enumerable: true
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
static getPropertyOptions(t) {
|
|
191
|
+
return this.elementProperties.get(t) ?? b;
|
|
192
|
+
}
|
|
193
|
+
static _$Ei() {
|
|
194
|
+
if (this.hasOwnProperty(d("elementProperties"))) return;
|
|
195
|
+
const t = n$1(this);
|
|
196
|
+
t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
197
|
+
}
|
|
198
|
+
static finalize() {
|
|
199
|
+
if (this.hasOwnProperty(d("finalized"))) return;
|
|
200
|
+
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
201
|
+
const t = this.properties,
|
|
202
|
+
s = [...r$1(t), ...o$1(t)];
|
|
203
|
+
for (const i of s) this.createProperty(i, t[i]);
|
|
204
|
+
}
|
|
205
|
+
const t = this[Symbol.metadata];
|
|
206
|
+
if (null !== t) {
|
|
207
|
+
const s = litPropertyMetadata.get(t);
|
|
208
|
+
if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
|
|
209
|
+
}
|
|
210
|
+
this._$Eh = new Map();
|
|
211
|
+
for (const [t, s] of this.elementProperties) {
|
|
212
|
+
const i = this._$Eu(t, s);
|
|
213
|
+
void 0 !== i && this._$Eh.set(i, t);
|
|
214
|
+
}
|
|
215
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
216
|
+
}
|
|
217
|
+
static finalizeStyles(s) {
|
|
218
|
+
const i = [];
|
|
219
|
+
if (Array.isArray(s)) {
|
|
220
|
+
const e = new Set(s.flat(1 / 0).reverse());
|
|
221
|
+
for (const s of e) i.unshift(c$1(s));
|
|
222
|
+
} else void 0 !== s && i.push(c$1(s));
|
|
223
|
+
return i;
|
|
224
|
+
}
|
|
225
|
+
static _$Eu(t, s) {
|
|
226
|
+
const i = s.attribute;
|
|
227
|
+
return false === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
|
|
228
|
+
}
|
|
229
|
+
constructor() {
|
|
230
|
+
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
231
|
+
}
|
|
232
|
+
_$Ev() {
|
|
233
|
+
this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
|
|
234
|
+
}
|
|
235
|
+
addController(t) {
|
|
236
|
+
(this._$EO ??= new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && t.hostConnected?.();
|
|
237
|
+
}
|
|
238
|
+
removeController(t) {
|
|
239
|
+
this._$EO?.delete(t);
|
|
240
|
+
}
|
|
241
|
+
_$E_() {
|
|
242
|
+
const t = new Map(),
|
|
243
|
+
s = this.constructor.elementProperties;
|
|
244
|
+
for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
245
|
+
t.size > 0 && (this._$Ep = t);
|
|
246
|
+
}
|
|
247
|
+
createRenderRoot() {
|
|
248
|
+
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
249
|
+
return S(t, this.constructor.elementStyles), t;
|
|
250
|
+
}
|
|
251
|
+
connectedCallback() {
|
|
252
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
|
|
253
|
+
}
|
|
254
|
+
enableUpdating(t) {}
|
|
255
|
+
disconnectedCallback() {
|
|
256
|
+
this._$EO?.forEach(t => t.hostDisconnected?.());
|
|
257
|
+
}
|
|
258
|
+
attributeChangedCallback(t, s, i) {
|
|
259
|
+
this._$AK(t, i);
|
|
260
|
+
}
|
|
261
|
+
_$ET(t, s) {
|
|
262
|
+
const i = this.constructor.elementProperties.get(t),
|
|
263
|
+
e = this.constructor._$Eu(t, i);
|
|
264
|
+
if (void 0 !== e && true === i.reflect) {
|
|
265
|
+
const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
|
|
266
|
+
this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
_$AK(t, s) {
|
|
270
|
+
const i = this.constructor,
|
|
271
|
+
e = i._$Eh.get(t);
|
|
272
|
+
if (void 0 !== e && this._$Em !== e) {
|
|
273
|
+
const t = i.getPropertyOptions(e),
|
|
274
|
+
h = "function" == typeof t.converter ? {
|
|
275
|
+
fromAttribute: t.converter
|
|
276
|
+
} : void 0 !== t.converter?.fromAttribute ? t.converter : u;
|
|
277
|
+
this._$Em = e;
|
|
278
|
+
const r = h.fromAttribute(s, t.type);
|
|
279
|
+
this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
requestUpdate(t, s, i) {
|
|
283
|
+
if (void 0 !== t) {
|
|
284
|
+
const e = this.constructor,
|
|
285
|
+
h = this[t];
|
|
286
|
+
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;
|
|
287
|
+
this.C(t, s, i);
|
|
288
|
+
}
|
|
289
|
+
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
290
|
+
}
|
|
291
|
+
C(t, s, {
|
|
292
|
+
useDefault: i,
|
|
293
|
+
reflect: e,
|
|
294
|
+
wrapped: h
|
|
295
|
+
}, r) {
|
|
296
|
+
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));
|
|
297
|
+
}
|
|
298
|
+
async _$EP() {
|
|
299
|
+
this.isUpdatePending = true;
|
|
300
|
+
try {
|
|
301
|
+
await this._$ES;
|
|
302
|
+
} catch (t) {
|
|
303
|
+
Promise.reject(t);
|
|
304
|
+
}
|
|
305
|
+
const t = this.scheduleUpdate();
|
|
306
|
+
return null != t && (await t), !this.isUpdatePending;
|
|
307
|
+
}
|
|
308
|
+
scheduleUpdate() {
|
|
309
|
+
return this.performUpdate();
|
|
310
|
+
}
|
|
311
|
+
performUpdate() {
|
|
312
|
+
if (!this.isUpdatePending) return;
|
|
313
|
+
if (!this.hasUpdated) {
|
|
314
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
315
|
+
for (const [t, s] of this._$Ep) this[t] = s;
|
|
316
|
+
this._$Ep = void 0;
|
|
317
|
+
}
|
|
318
|
+
const t = this.constructor.elementProperties;
|
|
319
|
+
if (t.size > 0) for (const [s, i] of t) {
|
|
320
|
+
const {
|
|
321
|
+
wrapped: t
|
|
322
|
+
} = i,
|
|
323
|
+
e = this[s];
|
|
324
|
+
true !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
let t = false;
|
|
328
|
+
const s = this._$AL;
|
|
329
|
+
try {
|
|
330
|
+
t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach(t => t.hostUpdate?.()), this.update(s)) : this._$EM();
|
|
331
|
+
} catch (s) {
|
|
332
|
+
throw t = false, this._$EM(), s;
|
|
333
|
+
}
|
|
334
|
+
t && this._$AE(s);
|
|
335
|
+
}
|
|
336
|
+
willUpdate(t) {}
|
|
337
|
+
_$AE(t) {
|
|
338
|
+
this._$EO?.forEach(t => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
|
|
339
|
+
}
|
|
340
|
+
_$EM() {
|
|
341
|
+
this._$AL = new Map(), this.isUpdatePending = false;
|
|
342
|
+
}
|
|
343
|
+
get updateComplete() {
|
|
344
|
+
return this.getUpdateComplete();
|
|
345
|
+
}
|
|
346
|
+
getUpdateComplete() {
|
|
347
|
+
return this._$ES;
|
|
348
|
+
}
|
|
349
|
+
shouldUpdate(t) {
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
update(t) {
|
|
353
|
+
this._$Eq &&= this._$Eq.forEach(t => this._$ET(t, this[t])), this._$EM();
|
|
354
|
+
}
|
|
355
|
+
updated(t) {}
|
|
356
|
+
firstUpdated(t) {}
|
|
357
|
+
}
|
|
358
|
+
y.elementStyles = [], y.shadowRootOptions = {
|
|
359
|
+
mode: "open"
|
|
360
|
+
}, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
|
|
361
|
+
ReactiveElement: y
|
|
362
|
+
}), (a.reactiveElementVersions ??= []).push("2.1.1");
|
|
63
363
|
|
|
64
364
|
/**
|
|
65
365
|
* @license
|
|
66
366
|
* Copyright 2017 Google LLC
|
|
67
367
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
-
*/
|
|
368
|
+
*/
|
|
369
|
+
const o = {
|
|
370
|
+
attribute: true,
|
|
371
|
+
type: String,
|
|
372
|
+
converter: u,
|
|
373
|
+
reflect: false,
|
|
374
|
+
hasChanged: f
|
|
375
|
+
},
|
|
376
|
+
r = (t = o, e, r) => {
|
|
377
|
+
const {
|
|
378
|
+
kind: n,
|
|
379
|
+
metadata: i
|
|
380
|
+
} = r;
|
|
381
|
+
let s = globalThis.litPropertyMetadata.get(i);
|
|
382
|
+
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) {
|
|
383
|
+
const {
|
|
384
|
+
name: o
|
|
385
|
+
} = r;
|
|
386
|
+
return {
|
|
387
|
+
set(r) {
|
|
388
|
+
const n = e.get.call(this);
|
|
389
|
+
e.set.call(this, r), this.requestUpdate(o, n, t);
|
|
390
|
+
},
|
|
391
|
+
init(e) {
|
|
392
|
+
return void 0 !== e && this.C(o, void 0, t, e), e;
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
if ("setter" === n) {
|
|
397
|
+
const {
|
|
398
|
+
name: o
|
|
399
|
+
} = r;
|
|
400
|
+
return function (r) {
|
|
401
|
+
const n = this[o];
|
|
402
|
+
e.call(this, r), this.requestUpdate(o, n, t);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
throw Error("Unsupported decorator location: " + n);
|
|
406
|
+
};
|
|
407
|
+
function n(t) {
|
|
408
|
+
return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
|
|
409
|
+
const r = e.hasOwnProperty(o);
|
|
410
|
+
return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
|
|
411
|
+
})(t, e, o);
|
|
412
|
+
}
|
|
69
413
|
|
|
70
414
|
/**
|
|
71
415
|
* @license
|
|
72
416
|
* Copyright 2017 Google LLC
|
|
73
417
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
74
418
|
*/
|
|
75
|
-
const e$1=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
|
|
419
|
+
const e$1 = (e, t, c) => (c.configurable = true, c.enumerable = true, Reflect.decorate && "object" != typeof t && Object.defineProperty(e, t, c), c);
|
|
76
420
|
|
|
77
421
|
/**
|
|
78
422
|
* @license
|
|
79
423
|
* Copyright 2017 Google LLC
|
|
80
424
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
-
*/
|
|
425
|
+
*/
|
|
426
|
+
function e(e, r) {
|
|
427
|
+
return (n, s, i) => {
|
|
428
|
+
const o = t => t.renderRoot?.querySelector(e) ?? null;
|
|
429
|
+
return e$1(n, s, {
|
|
430
|
+
get() {
|
|
431
|
+
return o(this);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
}
|
|
82
436
|
|
|
83
437
|
/**
|
|
84
438
|
* Component design tokens that control the `M3eAppBarElement` for all size variants.
|
|
85
439
|
* @internal
|
|
86
440
|
*/
|
|
87
441
|
const AppBarSizeToken = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
442
|
+
small: {
|
|
443
|
+
containerHeight: unsafeCSS(`var(--m3e-app-bar-small-container-height, 4rem)`),
|
|
444
|
+
titleTextFontSize: unsafeCSS(`var(--m3e-app-bar-small-title-text-font-size, ${DesignToken.typescale.standard.title.large.fontSize})`),
|
|
445
|
+
titleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-small-title-text-font-weight, ${DesignToken.typescale.standard.title.large.fontWeight})`),
|
|
446
|
+
titleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-small-title-text-line-height, ${DesignToken.typescale.standard.title.large.lineHeight})`),
|
|
447
|
+
titleTextTracking: unsafeCSS(`var(--m3e-app-bar-small-subtitle-text-tracking, ${DesignToken.typescale.standard.title.large.tracking})`),
|
|
448
|
+
subtitleTextFontSize: unsafeCSS(`var(--m3e-app-bar-small-subtitle-text-font-size, ${DesignToken.typescale.standard.label.medium.fontSize})`),
|
|
449
|
+
subtitleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-small-subtitle-text-font-weight, ${DesignToken.typescale.standard.label.medium.fontWeight})`),
|
|
450
|
+
subtitleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-small-subtitle-text-line-height, ${DesignToken.typescale.standard.label.medium.lineHeight})`),
|
|
451
|
+
subtitleTextTracking: unsafeCSS(`var(--m3e-app-bar-small-subtitle-text-tracking, ${DesignToken.typescale.standard.label.medium.tracking})`),
|
|
452
|
+
headingPaddingLeft: unsafeCSS(`var(--m3e-app-bar-small-heading-padding-left, 0.25rem)`),
|
|
453
|
+
headingPaddingRight: unsafeCSS(`var(--m3e-app-bar-small-heading-padding-right, 0.25rem)`)
|
|
454
|
+
},
|
|
455
|
+
medium: {
|
|
456
|
+
containerHeight: unsafeCSS(`var(--m3e-app-bar-medium-container-height, 7rem)`),
|
|
457
|
+
containerHeightWithSubtitle: unsafeCSS(`var(--m3e-app-bar-medium-container-height-with-subtitle, 8.5rem)`),
|
|
458
|
+
titleTextFontSize: unsafeCSS(`var(--m3e-app-bar-medium-title-text-font-size, ${DesignToken.typescale.standard.headline.medium.fontSize})`),
|
|
459
|
+
titleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-medium-title-text-font-weight, ${DesignToken.typescale.standard.headline.medium.fontWeight})`),
|
|
460
|
+
titleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-medium-title-text-line-height, ${DesignToken.typescale.standard.headline.medium.lineHeight})`),
|
|
461
|
+
titleTextTracking: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-text-tracking, ${DesignToken.typescale.standard.headline.medium.tracking})`),
|
|
462
|
+
subtitleTextFontSize: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-text-font-size, ${DesignToken.typescale.standard.title.small.fontSize})`),
|
|
463
|
+
subtitleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-text-font-weight, ${DesignToken.typescale.standard.title.small.fontWeight})`),
|
|
464
|
+
subtitleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-text-line-height, ${DesignToken.typescale.standard.title.small.lineHeight})`),
|
|
465
|
+
subtitleTextTracking: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-text-tracking, ${DesignToken.typescale.standard.title.small.tracking})`),
|
|
466
|
+
headingPaddingLeft: unsafeCSS(`var(--m3e-app-bar-medium-heading-padding-left, 1rem)`),
|
|
467
|
+
headingPaddingRight: unsafeCSS(`var(--m3e-app-bar-medium-heading-padding-right, 0.25rem)`),
|
|
468
|
+
paddingTop: unsafeCSS(`var(--m3e-app-bar-medium-padding-top, 0.5rem)`),
|
|
469
|
+
paddingBottom: unsafeCSS(`var(--m3e-app-bar-medium-padding-bottom, 0.75rem)`),
|
|
470
|
+
titleMaxLines: unsafeCSS(`var(--m3e-app-bar-medium-title-max-lines, 2)`),
|
|
471
|
+
subtitleMaxLines: unsafeCSS(`var(--m3e-app-bar-medium-subtitle-max-lines, 1)`)
|
|
472
|
+
},
|
|
473
|
+
large: {
|
|
474
|
+
containerHeight: unsafeCSS(`var(--m3e-app-bar-large-container-height, 7.5rem)`),
|
|
475
|
+
containerHeightWithSubtitle: unsafeCSS(`var(--m3e-app-bar-large-container-height-with-subtitle, 9.5rem)`),
|
|
476
|
+
titleTextFontSize: unsafeCSS(`var(--m3e-app-bar-large-title-text-font-size, ${DesignToken.typescale.standard.display.small.fontSize})`),
|
|
477
|
+
titleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-large-title-text-font-weight, ${DesignToken.typescale.standard.display.small.fontWeight})`),
|
|
478
|
+
titleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-large-title-text-line-height, ${DesignToken.typescale.standard.display.small.lineHeight})`),
|
|
479
|
+
titleTextTracking: unsafeCSS(`var(--m3e-app-bar-large-subtitle-text-tracking, ${DesignToken.typescale.standard.display.small.tracking})`),
|
|
480
|
+
subtitleTextFontSize: unsafeCSS(`var(--m3e-app-bar-large-subtitle-text-font-size, ${DesignToken.typescale.standard.title.medium.fontSize})`),
|
|
481
|
+
subtitleTextFontWeight: unsafeCSS(`var(--m3e-app-bar-large-subtitle-text-font-weight, ${DesignToken.typescale.standard.title.medium.fontWeight})`),
|
|
482
|
+
subtitleTextLineHeight: unsafeCSS(`var(--m3e-app-bar-large-subtitle-text-line-height, ${DesignToken.typescale.standard.title.medium.lineHeight})`),
|
|
483
|
+
subtitleTextTracking: unsafeCSS(`var(--m3e-app-bar-large-subtitle-text-tracking, ${DesignToken.typescale.standard.title.medium.tracking})`),
|
|
484
|
+
headingPaddingLeft: unsafeCSS(`var(--m3e-app-bar-large-heading-padding-left, 1rem)`),
|
|
485
|
+
headingPaddingRight: unsafeCSS(`var(--m3e-app-bar-large-heading-padding-right, 0.25rem)`),
|
|
486
|
+
paddingTop: unsafeCSS(`var(--m3e-app-bar-large-padding-top, 0.5rem)`),
|
|
487
|
+
paddingBottom: unsafeCSS(`var(--m3e-app-bar-large-padding-bottom, 0.75rem)`),
|
|
488
|
+
titleMaxLines: unsafeCSS(`var(--m3e-app-bar-large-title-max-lines, 2)`),
|
|
489
|
+
subtitleMaxLines: unsafeCSS(`var(--m3e-app-bar-large-subtitle-max-lines, 1)`)
|
|
490
|
+
}
|
|
137
491
|
};
|
|
138
492
|
|
|
139
493
|
/** @private */
|
|
140
494
|
function appBarStyle(size) {
|
|
141
|
-
|
|
142
|
-
:host([size="${unsafeCSS(size)}"]) .base:not(.-with-subtitle) {
|
|
143
|
-
min-height: ${AppBarSizeToken[size].containerHeight};
|
|
144
|
-
}
|
|
145
|
-
:host([size="${unsafeCSS(size)}"]) .base.-with-subtitle {
|
|
146
|
-
min-height: ${AppBarSizeToken[size].containerHeightWithSubtitle ?? AppBarSizeToken[size].containerHeight};
|
|
147
|
-
}
|
|
148
|
-
:host([size="${unsafeCSS(size)}"]) .title {
|
|
149
|
-
font-size: ${AppBarSizeToken[size].titleTextFontSize};
|
|
150
|
-
font-weight: ${AppBarSizeToken[size].titleTextFontWeight};
|
|
151
|
-
line-height: ${AppBarSizeToken[size].titleTextLineHeight};
|
|
152
|
-
letter-spacing: ${AppBarSizeToken[size].titleTextTracking};
|
|
153
|
-
}
|
|
154
|
-
:host([size="${unsafeCSS(size)}"]) .subtitle {
|
|
155
|
-
font-size: ${AppBarSizeToken[size].subtitleTextFontSize};
|
|
156
|
-
font-weight: ${AppBarSizeToken[size].subtitleTextFontWeight};
|
|
157
|
-
line-height: ${AppBarSizeToken[size].subtitleTextLineHeight};
|
|
158
|
-
letter-spacing: ${AppBarSizeToken[size].subtitleTextTracking};
|
|
159
|
-
}
|
|
160
|
-
:host(:not([centered])[size="${unsafeCSS(size)}"]) .label {
|
|
161
|
-
padding-inline-start: ${AppBarSizeToken[size].headingPaddingLeft};
|
|
162
|
-
padding-inline-end: ${AppBarSizeToken[size].headingPaddingRight};
|
|
163
|
-
}
|
|
164
|
-
:host([centered][size="${unsafeCSS(size)}"]) .label {
|
|
165
|
-
padding-inline: ${AppBarSizeToken[size].headingPaddingLeft};
|
|
166
|
-
}
|
|
167
|
-
:host([size="${unsafeCSS(size)}"]) .base {
|
|
168
|
-
padding-block-start: ${AppBarSizeToken[size].paddingTop ?? unsafeCSS("unset")};
|
|
169
|
-
padding-block-end: ${AppBarSizeToken[size].paddingBottom ?? unsafeCSS("unset")};
|
|
170
|
-
}
|
|
171
|
-
${AppBarSizeToken[size].titleMaxLines
|
|
172
|
-
? css `
|
|
173
|
-
:host([size="${unsafeCSS(size)}"]) .title {
|
|
174
|
-
display: -webkit-box;
|
|
175
|
-
-webkit-line-clamp: ${AppBarSizeToken[size].titleMaxLines};
|
|
176
|
-
-webkit-box-orient: vertical;
|
|
177
|
-
overflow: hidden;
|
|
178
|
-
line-clamp: ${AppBarSizeToken[size].titleMaxLines};
|
|
179
|
-
}
|
|
180
|
-
`
|
|
181
|
-
: css ``}
|
|
182
|
-
${AppBarSizeToken[size].subtitleMaxLines
|
|
183
|
-
? css `
|
|
184
|
-
:host([size="${unsafeCSS(size)}"]) .subtitle {
|
|
185
|
-
display: -webkit-box;
|
|
186
|
-
-webkit-line-clamp: ${AppBarSizeToken[size].subtitleMaxLines};
|
|
187
|
-
-webkit-box-orient: vertical;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
line-clamp: ${AppBarSizeToken[size].subtitleMaxLines};
|
|
190
|
-
}
|
|
191
|
-
`
|
|
192
|
-
: css ``}
|
|
193
|
-
`;
|
|
495
|
+
return css`:host([size="${unsafeCSS(size)}"]) .base:not(.-with-subtitle) { min-height: ${AppBarSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"]) .base.-with-subtitle { min-height: ${AppBarSizeToken[size].containerHeightWithSubtitle ?? AppBarSizeToken[size].containerHeight}; } :host([size="${unsafeCSS(size)}"]) .title { font-size: ${AppBarSizeToken[size].titleTextFontSize}; font-weight: ${AppBarSizeToken[size].titleTextFontWeight}; line-height: ${AppBarSizeToken[size].titleTextLineHeight}; letter-spacing: ${AppBarSizeToken[size].titleTextTracking}; } :host([size="${unsafeCSS(size)}"]) .subtitle { font-size: ${AppBarSizeToken[size].subtitleTextFontSize}; font-weight: ${AppBarSizeToken[size].subtitleTextFontWeight}; line-height: ${AppBarSizeToken[size].subtitleTextLineHeight}; letter-spacing: ${AppBarSizeToken[size].subtitleTextTracking}; } :host(:not([centered])[size="${unsafeCSS(size)}"]) .label { padding-inline-start: ${AppBarSizeToken[size].headingPaddingLeft}; padding-inline-end: ${AppBarSizeToken[size].headingPaddingRight}; } :host([centered][size="${unsafeCSS(size)}"]) .label { padding-inline: ${AppBarSizeToken[size].headingPaddingLeft}; } :host([size="${unsafeCSS(size)}"]) .base { padding-block-start: ${AppBarSizeToken[size].paddingTop ?? unsafeCSS("unset")}; padding-block-end: ${AppBarSizeToken[size].paddingBottom ?? unsafeCSS("unset")}; } ${AppBarSizeToken[size].titleMaxLines ? css`:host([size="${unsafeCSS(size)}"]) .title { display: -webkit-box; -webkit-line-clamp: ${AppBarSizeToken[size].titleMaxLines}; -webkit-box-orient: vertical; overflow: hidden; line-clamp: ${AppBarSizeToken[size].titleMaxLines}; }` : css``} ${AppBarSizeToken[size].subtitleMaxLines ? css`:host([size="${unsafeCSS(size)}"]) .subtitle { display: -webkit-box; -webkit-line-clamp: ${AppBarSizeToken[size].subtitleMaxLines}; -webkit-box-orient: vertical; overflow: hidden; line-clamp: ${AppBarSizeToken[size].subtitleMaxLines}; }` : css``}`;
|
|
194
496
|
}
|
|
195
497
|
/**
|
|
196
498
|
* Size variant styles for `M3eAppBarElement`.
|
|
@@ -203,129 +505,22 @@ const AppBarSizeStyle = [appBarStyle("small"), appBarStyle("medium"), appBarStyl
|
|
|
203
505
|
* @internal
|
|
204
506
|
*/
|
|
205
507
|
const AppBarToken = {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
508
|
+
containerColor: unsafeCSS(`var(--m3e-app-bar-container-color, ${DesignToken.color.surface})`),
|
|
509
|
+
containerColorOnScroll: unsafeCSS(`var(--m3e-app-bar-container-color-on-scroll, ${DesignToken.color.surfaceContainer})`),
|
|
510
|
+
containerElevation: unsafeCSS(`var(--m3e-app-bar-container-elevation, ${DesignToken.elevation.level0})`),
|
|
511
|
+
containerElevationOnScroll: unsafeCSS(`var(--m3e-app-bar-container-elevation-on-scroll, ${DesignToken.elevation.level1})`),
|
|
512
|
+
titleTextColor: unsafeCSS(`var(--m3e-app-bar-title-text-color, ${DesignToken.color.onSurface})`),
|
|
513
|
+
subtitleTextColor: unsafeCSS(`var(--m3e-app-bar-subtitle-text-color, ${DesignToken.color.onSurfaceVariant})`),
|
|
514
|
+
paddingLeft: unsafeCSS(`var(--m3e-app-bar-padding-left, 0.25rem)`),
|
|
515
|
+
paddingRight: unsafeCSS(`var(--m3e-app-bar-padding-right, 0.25rem)`)
|
|
214
516
|
};
|
|
215
517
|
|
|
216
518
|
/**
|
|
217
519
|
* Baseline styles for `M3eAppBarElement`.
|
|
218
520
|
* @internal
|
|
219
521
|
*/
|
|
220
|
-
const AppBarStyle = css `
|
|
221
|
-
|
|
222
|
-
display: block;
|
|
223
|
-
flex: none;
|
|
224
|
-
}
|
|
225
|
-
:host([size="small"]) .base,
|
|
226
|
-
:host(:not([size="small"]):not([centered])) .heading {
|
|
227
|
-
padding-inline-start: ${AppBarToken.paddingLeft};
|
|
228
|
-
padding-inline-end: ${AppBarToken.paddingRight};
|
|
229
|
-
}
|
|
230
|
-
.base {
|
|
231
|
-
box-sizing: border-box;
|
|
232
|
-
display: flex;
|
|
233
|
-
transition: ${unsafeCSS(`background-color ${DesignToken.motion.duration.medium1} ${DesignToken.motion.easing.standard},
|
|
234
|
-
box-shadow ${DesignToken.motion.duration.medium1} ${DesignToken.motion.easing.standard}`)};
|
|
235
|
-
}
|
|
236
|
-
.base:not(.-on-scroll) {
|
|
237
|
-
background-color: ${AppBarToken.containerColor};
|
|
238
|
-
box-shadow: ${AppBarToken.containerElevation};
|
|
239
|
-
}
|
|
240
|
-
.base.-on-scroll {
|
|
241
|
-
background-color: ${AppBarToken.containerColorOnScroll};
|
|
242
|
-
box-shadow: ${AppBarToken.containerElevationOnScroll};
|
|
243
|
-
}
|
|
244
|
-
.leading-icon,
|
|
245
|
-
.trailing-icon {
|
|
246
|
-
display: flex;
|
|
247
|
-
flex: none;
|
|
248
|
-
align-items: center;
|
|
249
|
-
}
|
|
250
|
-
.leading-icon {
|
|
251
|
-
min-width: var(--_leading-icon-min-width);
|
|
252
|
-
}
|
|
253
|
-
.trailing-icon {
|
|
254
|
-
min-width: var(--_trailing-icon-min-width);
|
|
255
|
-
}
|
|
256
|
-
.heading {
|
|
257
|
-
display: flex;
|
|
258
|
-
align-items: center;
|
|
259
|
-
}
|
|
260
|
-
:host([size="small"]) .heading {
|
|
261
|
-
flex: 1 1 auto;
|
|
262
|
-
}
|
|
263
|
-
.spacer {
|
|
264
|
-
flex: 1 1 auto;
|
|
265
|
-
}
|
|
266
|
-
.label {
|
|
267
|
-
display: flex;
|
|
268
|
-
flex-direction: column;
|
|
269
|
-
flex: none;
|
|
270
|
-
}
|
|
271
|
-
.title {
|
|
272
|
-
color: ${AppBarToken.titleTextColor};
|
|
273
|
-
}
|
|
274
|
-
.subtitle {
|
|
275
|
-
color: ${AppBarToken.subtitleTextColor};
|
|
276
|
-
}
|
|
277
|
-
.base:not(.-with-title) .title,
|
|
278
|
-
.base:not(.-with-subtitle) .subtitle,
|
|
279
|
-
.base:not(.-with-title):not(.-with-subtitle) .label,
|
|
280
|
-
.base:not(.-with-trailing-icon) .trailing-icon {
|
|
281
|
-
display: none;
|
|
282
|
-
}
|
|
283
|
-
:host([size="small"]) .base {
|
|
284
|
-
align-items: center;
|
|
285
|
-
}
|
|
286
|
-
:host([size="small"]) .heading {
|
|
287
|
-
min-width: 0;
|
|
288
|
-
}
|
|
289
|
-
:host([size="small"]) .label {
|
|
290
|
-
flex: 1 1 auto;
|
|
291
|
-
min-width: 0;
|
|
292
|
-
}
|
|
293
|
-
:host([size="small"]) .title,
|
|
294
|
-
:host([size="small"]) .subtitle {
|
|
295
|
-
display: block;
|
|
296
|
-
white-space: nowrap;
|
|
297
|
-
overflow: hidden;
|
|
298
|
-
text-overflow: ellipsis;
|
|
299
|
-
}
|
|
300
|
-
:host(:not([size="small"])) .base {
|
|
301
|
-
flex-direction: column;
|
|
302
|
-
}
|
|
303
|
-
:host([centered]) .title,
|
|
304
|
-
:host([centered]) .subtitle {
|
|
305
|
-
text-align: center;
|
|
306
|
-
}
|
|
307
|
-
@media (prefers-reduced-motion) {
|
|
308
|
-
.base {
|
|
309
|
-
transition: none;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
@media (forced-colors: active) {
|
|
313
|
-
.base {
|
|
314
|
-
transition: none;
|
|
315
|
-
}
|
|
316
|
-
.base:not(.-on-scroll),
|
|
317
|
-
.base.-on-scroll {
|
|
318
|
-
background-color: Canvas;
|
|
319
|
-
box-shadow: unset;
|
|
320
|
-
}
|
|
321
|
-
.title {
|
|
322
|
-
color: CanvasText;
|
|
323
|
-
}
|
|
324
|
-
.subtitle {
|
|
325
|
-
color: FieldText;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
`;
|
|
522
|
+
const AppBarStyle = css`:host { display: block; flex: none; } :host([size="small"]) .base, :host(:not([size="small"]):not([centered])) .heading { padding-inline-start: ${AppBarToken.paddingLeft}; padding-inline-end: ${AppBarToken.paddingRight}; } .base { box-sizing: border-box; display: flex; transition: ${unsafeCSS(`background-color ${DesignToken.motion.duration.medium1} ${DesignToken.motion.easing.standard},
|
|
523
|
+
box-shadow ${DesignToken.motion.duration.medium1} ${DesignToken.motion.easing.standard}`)}; } .base:not(.-on-scroll) { background-color: ${AppBarToken.containerColor}; box-shadow: ${AppBarToken.containerElevation}; } .base.-on-scroll { background-color: ${AppBarToken.containerColorOnScroll}; box-shadow: ${AppBarToken.containerElevationOnScroll}; } .leading-icon, .trailing-icon { display: flex; flex: none; align-items: center; } .leading-icon { min-width: var(--_leading-icon-min-width); } .trailing-icon { min-width: var(--_trailing-icon-min-width); } .heading { display: flex; align-items: center; } :host([size="small"]) .heading { flex: 1 1 auto; } .spacer { flex: 1 1 auto; } .label { display: flex; flex-direction: column; flex: none; } .title { color: ${AppBarToken.titleTextColor}; } .subtitle { color: ${AppBarToken.subtitleTextColor}; } .base:not(.-with-title) .title, .base:not(.-with-subtitle) .subtitle, .base:not(.-with-title):not(.-with-subtitle) .label, .base:not(.-with-trailing-icon) .trailing-icon { display: none; } :host([size="small"]) .base { align-items: center; } :host([size="small"]) .heading { min-width: 0; } :host([size="small"]) .label { flex: 1 1 auto; min-width: 0; } :host([size="small"]) .title, :host([size="small"]) .subtitle { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } :host(:not([size="small"])) .base { flex-direction: column; } :host([centered]) .title, :host([centered]) .subtitle { text-align: center; } @media (prefers-reduced-motion) { .base { transition: none; } } @media (forced-colors: active) { .base { transition: none; } .base:not(.-on-scroll), .base.-on-scroll { background-color: Canvas; box-shadow: unset; } .title { color: CanvasText; } .subtitle { color: FieldText; } }`;
|
|
329
524
|
|
|
330
525
|
var _M3eAppBarElement_instances, _M3eAppBarElement_scrollHandler, _M3eAppBarElement_frameLoadHandler, _M3eAppBarElement_handleTitleSlotChange, _M3eAppBarElement_handleSubtitleSlotChange, _M3eAppBarElement_handleLeadingIconSlotChange, _M3eAppBarElement_handleTrailingIconsSlotChange, _M3eAppBarElement_clearCentered, _M3eAppBarElement_computeCentered, _M3eAppBarElement_handleFrameLoad, _M3eAppBarElement_getFrameScrollTop;
|
|
331
526
|
/**
|
|
@@ -430,182 +625,135 @@ var _M3eAppBarElement_instances, _M3eAppBarElement_scrollHandler, _M3eAppBarElem
|
|
|
430
625
|
* @cssprop --m3e-app-bar-large-subtitle-max-lines - Maximum number of lines for the large app bar subtitle.
|
|
431
626
|
*/
|
|
432
627
|
let M3eAppBarElement = class M3eAppBarElement extends HtmlFor(Role(LitElement, "banner")) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
628
|
+
constructor() {
|
|
629
|
+
super(...arguments);
|
|
630
|
+
_M3eAppBarElement_instances.add(this);
|
|
631
|
+
/** @private */
|
|
632
|
+
_M3eAppBarElement_scrollHandler.set(this, e => this._updateScroll(e));
|
|
633
|
+
/** @private */
|
|
634
|
+
_M3eAppBarElement_frameLoadHandler.set(this, () => __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleFrameLoad).call(this));
|
|
635
|
+
/**
|
|
636
|
+
* Whether the title and subtitle are centered.
|
|
637
|
+
* @default false
|
|
638
|
+
*/
|
|
639
|
+
this.centered = false;
|
|
640
|
+
/**
|
|
641
|
+
* The size of the bar.
|
|
642
|
+
* @default "small"
|
|
643
|
+
*/
|
|
644
|
+
this.size = "small";
|
|
645
|
+
}
|
|
646
|
+
/** @inheritdoc */
|
|
647
|
+
attach(control) {
|
|
648
|
+
super.attach(control);
|
|
649
|
+
if (control instanceof HTMLIFrameElement) {
|
|
650
|
+
control.addEventListener("load", __classPrivateFieldGet(this, _M3eAppBarElement_frameLoadHandler, "f"));
|
|
651
|
+
__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleFrameLoad).call(this);
|
|
652
|
+
} else {
|
|
653
|
+
control.addEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
448
654
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
control.addEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
458
|
-
}
|
|
655
|
+
}
|
|
656
|
+
/** @inheritdoc */
|
|
657
|
+
detach() {
|
|
658
|
+
if (this.control instanceof HTMLIFrameElement) {
|
|
659
|
+
this.control.removeEventListener("load", __classPrivateFieldGet(this, _M3eAppBarElement_frameLoadHandler, "f"));
|
|
660
|
+
this.control.contentDocument?.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
459
661
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
if (this.control instanceof HTMLIFrameElement) {
|
|
463
|
-
this.control.removeEventListener("load", __classPrivateFieldGet(this, _M3eAppBarElement_frameLoadHandler, "f"));
|
|
464
|
-
this.control.contentDocument?.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
465
|
-
}
|
|
466
|
-
if (this.control) {
|
|
467
|
-
this.control.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
468
|
-
}
|
|
469
|
-
super.detach();
|
|
662
|
+
if (this.control) {
|
|
663
|
+
this.control.removeEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
470
664
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
665
|
+
super.detach();
|
|
666
|
+
}
|
|
667
|
+
/** @inheritdoc */
|
|
668
|
+
updated(_changedProperties) {
|
|
669
|
+
super.updated(_changedProperties);
|
|
670
|
+
if (_changedProperties.has("centered") || _changedProperties.has("size")) {
|
|
671
|
+
if (this.centered && this.size === "small") {
|
|
672
|
+
__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_computeCentered).call(this);
|
|
673
|
+
} else {
|
|
674
|
+
__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_clearCentered).call(this);
|
|
675
|
+
}
|
|
482
676
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
<div class="heading">
|
|
492
|
-
<div class="label">
|
|
493
|
-
<div class="title">
|
|
494
|
-
<slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot>
|
|
495
|
-
</div>
|
|
496
|
-
<div class="subtitle">
|
|
497
|
-
<slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot>
|
|
498
|
-
</div>
|
|
499
|
-
</div>
|
|
500
|
-
</div>
|
|
501
|
-
<div class="trailing-icon">
|
|
502
|
-
<slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"></slot>
|
|
503
|
-
</div>
|
|
504
|
-
</div>`;
|
|
505
|
-
default:
|
|
506
|
-
return html `<div class="base">
|
|
507
|
-
<div class="heading">
|
|
508
|
-
<div class="leading-icon">
|
|
509
|
-
<slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleLeadingIconSlotChange)}"></slot>
|
|
510
|
-
</div>
|
|
511
|
-
<div class="spacer"></div>
|
|
512
|
-
<div class="trailing-icon">
|
|
513
|
-
<slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"></slot>
|
|
514
|
-
</div>
|
|
515
|
-
</div>
|
|
516
|
-
<div class="spacer"></div>
|
|
517
|
-
<div class="label">
|
|
518
|
-
<div class="title">
|
|
519
|
-
<slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot>
|
|
520
|
-
</div>
|
|
521
|
-
<div class="subtitle">
|
|
522
|
-
<slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot>
|
|
523
|
-
</div>
|
|
524
|
-
</div>
|
|
525
|
-
</div>`;
|
|
526
|
-
}
|
|
677
|
+
}
|
|
678
|
+
/** @inheritdoc */
|
|
679
|
+
render() {
|
|
680
|
+
switch (this.size) {
|
|
681
|
+
case "small":
|
|
682
|
+
return html`<div class="base"><div class="leading-icon"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleLeadingIconSlotChange)}"></slot></div><div class="heading"><div class="label"><div class="title"><slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot></div><div class="subtitle"><slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot></div></div></div><div class="trailing-icon"><slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"></slot></div></div>`;
|
|
683
|
+
default:
|
|
684
|
+
return html`<div class="base"><div class="heading"><div class="leading-icon"><slot name="leading-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleLeadingIconSlotChange)}"></slot></div><div class="spacer"></div><div class="trailing-icon"><slot name="trailing-icon" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTrailingIconsSlotChange)}"></slot></div></div><div class="spacer"></div><div class="label"><div class="title"><slot name="title" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleTitleSlotChange)}"></slot></div><div class="subtitle"><slot name="subtitle" @slotchange="${__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_handleSubtitleSlotChange)}"></slot></div></div></div>`;
|
|
527
685
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
this._base?.classList.toggle("-on-scroll", scrollTop > 0);
|
|
686
|
+
}
|
|
687
|
+
/** @private */
|
|
688
|
+
_updateScroll(e) {
|
|
689
|
+
let scrollTop = 0;
|
|
690
|
+
if (this.control instanceof HTMLIFrameElement) {
|
|
691
|
+
scrollTop = __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_getFrameScrollTop).call(this, this.control);
|
|
692
|
+
} else if (e.target instanceof HTMLElement) {
|
|
693
|
+
scrollTop = e.target.scrollTop;
|
|
538
694
|
}
|
|
695
|
+
this._base?.classList.toggle("-on-scroll", scrollTop > 0);
|
|
696
|
+
}
|
|
539
697
|
};
|
|
540
698
|
_M3eAppBarElement_scrollHandler = new WeakMap();
|
|
541
699
|
_M3eAppBarElement_frameLoadHandler = new WeakMap();
|
|
542
700
|
_M3eAppBarElement_instances = new WeakSet();
|
|
543
701
|
_M3eAppBarElement_handleTitleSlotChange = function _M3eAppBarElement_handleTitleSlotChange(e) {
|
|
544
|
-
|
|
702
|
+
this._base?.classList.toggle("-with-title", hasAssignedNodes(e.target));
|
|
545
703
|
};
|
|
546
704
|
_M3eAppBarElement_handleSubtitleSlotChange = function _M3eAppBarElement_handleSubtitleSlotChange(e) {
|
|
547
|
-
|
|
705
|
+
this._base?.classList.toggle("-with-subtitle", hasAssignedNodes(e.target));
|
|
548
706
|
};
|
|
549
707
|
_M3eAppBarElement_handleLeadingIconSlotChange = function _M3eAppBarElement_handleLeadingIconSlotChange(e) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
708
|
+
this._base?.classList.toggle("-with-leading-icon", hasAssignedNodes(e.target));
|
|
709
|
+
if (this.centered && this.size === "small") {
|
|
710
|
+
setTimeout(() => __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_computeCentered).call(this), 40);
|
|
711
|
+
}
|
|
554
712
|
};
|
|
555
713
|
_M3eAppBarElement_handleTrailingIconsSlotChange = function _M3eAppBarElement_handleTrailingIconsSlotChange(e) {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
714
|
+
this._base?.classList.toggle("-with-trailing-icon", hasAssignedNodes(e.target));
|
|
715
|
+
if (this.centered && this.size === "small") {
|
|
716
|
+
setTimeout(() => __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_computeCentered).call(this), 40);
|
|
717
|
+
}
|
|
560
718
|
};
|
|
561
719
|
_M3eAppBarElement_clearCentered = function _M3eAppBarElement_clearCentered() {
|
|
562
|
-
|
|
563
|
-
|
|
720
|
+
this._base?.style.removeProperty("--_leading-icon-min-width");
|
|
721
|
+
this._base?.style.removeProperty("--_trailing-icon-min-width");
|
|
564
722
|
};
|
|
565
723
|
_M3eAppBarElement_computeCentered = function _M3eAppBarElement_computeCentered() {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}
|
|
724
|
+
__classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_clearCentered).call(this);
|
|
725
|
+
const leadingWidth = this._leadingIcon?.getBoundingClientRect().width ?? 0;
|
|
726
|
+
const trailingWidth = this._trailingIcon?.getBoundingClientRect().width ?? 0;
|
|
727
|
+
if (leadingWidth < trailingWidth) {
|
|
728
|
+
this._base?.style.setProperty("--_leading-icon-min-width", `${trailingWidth}px`);
|
|
729
|
+
} else if (leadingWidth > trailingWidth) {
|
|
730
|
+
this._base?.style.setProperty("--_trailing-icon-min-width", `${leadingWidth}px`);
|
|
731
|
+
}
|
|
575
732
|
};
|
|
576
733
|
_M3eAppBarElement_handleFrameLoad = function _M3eAppBarElement_handleFrameLoad() {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
734
|
+
if (this.control instanceof HTMLIFrameElement) {
|
|
735
|
+
this.control.contentDocument?.addEventListener("scroll", __classPrivateFieldGet(this, _M3eAppBarElement_scrollHandler, "f"));
|
|
736
|
+
this._base?.classList.toggle("-on-scroll", __classPrivateFieldGet(this, _M3eAppBarElement_instances, "m", _M3eAppBarElement_getFrameScrollTop).call(this, this.control) > 0);
|
|
737
|
+
}
|
|
581
738
|
};
|
|
582
739
|
_M3eAppBarElement_getFrameScrollTop = function _M3eAppBarElement_getFrameScrollTop(frame) {
|
|
583
|
-
|
|
584
|
-
|
|
740
|
+
// Both document element (<html>) and body are tested for scroll top, taking the maximum.
|
|
741
|
+
return Math.max(frame.contentDocument?.documentElement?.scrollTop ?? 0, frame.contentDocument?.body?.scrollTop ?? 0);
|
|
585
742
|
};
|
|
586
743
|
/** The styles of the element. */
|
|
587
744
|
M3eAppBarElement.styles = [AppBarStyle, AppBarSizeStyle];
|
|
588
|
-
__decorate([
|
|
589
|
-
|
|
590
|
-
], M3eAppBarElement.prototype, "
|
|
591
|
-
__decorate([
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
__decorate([
|
|
601
|
-
n({ reflect: true })
|
|
602
|
-
], M3eAppBarElement.prototype, "size", void 0);
|
|
603
|
-
__decorate([
|
|
604
|
-
debounce(40)
|
|
605
|
-
], M3eAppBarElement.prototype, "_updateScroll", null);
|
|
606
|
-
M3eAppBarElement = __decorate([
|
|
607
|
-
t$1("m3e-app-bar")
|
|
608
|
-
], M3eAppBarElement);
|
|
745
|
+
__decorate([e(".base")], M3eAppBarElement.prototype, "_base", void 0);
|
|
746
|
+
__decorate([e(".leading-icon")], M3eAppBarElement.prototype, "_leadingIcon", void 0);
|
|
747
|
+
__decorate([e(".trailing-icon")], M3eAppBarElement.prototype, "_trailingIcon", void 0);
|
|
748
|
+
__decorate([n({
|
|
749
|
+
type: Boolean,
|
|
750
|
+
reflect: true
|
|
751
|
+
})], M3eAppBarElement.prototype, "centered", void 0);
|
|
752
|
+
__decorate([n({
|
|
753
|
+
reflect: true
|
|
754
|
+
})], M3eAppBarElement.prototype, "size", void 0);
|
|
755
|
+
__decorate([debounce(40)], M3eAppBarElement.prototype, "_updateScroll", null);
|
|
756
|
+
M3eAppBarElement = __decorate([t$1("m3e-app-bar")], M3eAppBarElement);
|
|
609
757
|
|
|
610
758
|
export { M3eAppBarElement };
|
|
611
759
|
//# sourceMappingURL=index.js.map
|