@m3e/progress-indicator 1.1.2 → 1.1.4
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/README.md +18 -12
- package/dist/css-custom-data.json +41 -1
- package/dist/custom-elements.json +521 -42
- package/dist/html-custom-data.json +12 -12
- package/dist/index.js +880 -134
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +81 -20
- package/dist/index.min.js.map +1 -1
- package/dist/src/CircularProgressIndicatorElement.d.ts +15 -24
- package/dist/src/CircularProgressIndicatorElement.d.ts.map +1 -1
- package/dist/src/LinearProgressIndicatorElement.d.ts +11 -11
- package/dist/src/LinearProgressIndicatorElement.d.ts.map +1 -1
- package/dist/src/ProgressElementIndicatorBase.d.ts +6 -0
- package/dist/src/ProgressElementIndicatorBase.d.ts.map +1 -1
- package/dist/src/ProgressIndicatorVariant.d.ts +3 -0
- package/dist/src/ProgressIndicatorVariant.d.ts.map +1 -0
- package/package.json +2 -2
- package/NOTICE.md +0 -8
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2025 matraic
|
|
4
4
|
* See LICENSE file in the project root for full license text.
|
|
5
5
|
*/
|
|
6
|
-
import { LitElement, css, html } from 'lit';
|
|
7
|
-
import { AttachInternals, Role, DesignToken, safeStyleMap } from '@m3e/core';
|
|
6
|
+
import { LitElement, css, html, nothing, svg } from 'lit';
|
|
7
|
+
import { AttachInternals, Role, DesignToken, ResizeController, AnimationLoopController, resolveFragmentUrl, safeStyleMap } from '@m3e/core';
|
|
8
8
|
|
|
9
9
|
/******************************************************************************
|
|
10
10
|
Copyright (c) Microsoft Corporation.
|
|
@@ -50,7 +50,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
50
50
|
* Copyright 2017 Google LLC
|
|
51
51
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
52
|
*/
|
|
53
|
-
const t$
|
|
53
|
+
const t$3 = t => (e, o) => {
|
|
54
54
|
void 0 !== o ? o.addInitializer(() => {
|
|
55
55
|
customElements.define(t, e);
|
|
56
56
|
}) : customElements.define(t, e);
|
|
@@ -61,21 +61,21 @@ const t$1 = t => (e, o) => {
|
|
|
61
61
|
* Copyright 2019 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
63
|
*/
|
|
64
|
-
const t = globalThis,
|
|
65
|
-
e$
|
|
66
|
-
s = Symbol(),
|
|
67
|
-
o$
|
|
68
|
-
let n$
|
|
64
|
+
const t$2 = globalThis,
|
|
65
|
+
e$4 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
66
|
+
s$1 = Symbol(),
|
|
67
|
+
o$4 = new WeakMap();
|
|
68
|
+
let n$3 = class n {
|
|
69
69
|
constructor(t, e, o) {
|
|
70
|
-
if (this._$cssResult$ = true, o !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
70
|
+
if (this._$cssResult$ = true, o !== s$1) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
71
71
|
this.cssText = t, this.t = e;
|
|
72
72
|
}
|
|
73
73
|
get styleSheet() {
|
|
74
74
|
let t = this.o;
|
|
75
75
|
const s = this.t;
|
|
76
|
-
if (e$
|
|
76
|
+
if (e$4 && void 0 === t) {
|
|
77
77
|
const e = void 0 !== s && 1 === s.length;
|
|
78
|
-
e && (t = o$
|
|
78
|
+
e && (t = o$4.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$4.set(s, t));
|
|
79
79
|
}
|
|
80
80
|
return t;
|
|
81
81
|
}
|
|
@@ -83,18 +83,18 @@ let n$2 = class n {
|
|
|
83
83
|
return this.cssText;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
const r$
|
|
87
|
-
S = (s, o) => {
|
|
88
|
-
if (e$
|
|
86
|
+
const r$3 = t => new n$3("string" == typeof t ? t : t + "", void 0, s$1),
|
|
87
|
+
S$1 = (s, o) => {
|
|
88
|
+
if (e$4) s.adoptedStyleSheets = o.map(t => t instanceof CSSStyleSheet ? t : t.styleSheet);else for (const e of o) {
|
|
89
89
|
const o = document.createElement("style"),
|
|
90
|
-
n = t.litNonce;
|
|
90
|
+
n = t$2.litNonce;
|
|
91
91
|
void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
c$
|
|
94
|
+
c$2 = e$4 ? t => t : t => t instanceof CSSStyleSheet ? (t => {
|
|
95
95
|
let e = "";
|
|
96
96
|
for (const s of t.cssRules) e += s.cssText;
|
|
97
|
-
return r$
|
|
97
|
+
return r$3(e);
|
|
98
98
|
})(t) : t;
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -103,23 +103,23 @@ const r$2 = t => new n$2("string" == typeof t ? t : t + "", void 0, s),
|
|
|
103
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
104
|
*/
|
|
105
105
|
const {
|
|
106
|
-
is: i,
|
|
107
|
-
defineProperty: e,
|
|
108
|
-
getOwnPropertyDescriptor: h,
|
|
109
|
-
getOwnPropertyNames: r$
|
|
110
|
-
getOwnPropertySymbols: o$
|
|
111
|
-
getPrototypeOf: n$
|
|
106
|
+
is: i$2,
|
|
107
|
+
defineProperty: e$3,
|
|
108
|
+
getOwnPropertyDescriptor: h$1,
|
|
109
|
+
getOwnPropertyNames: r$2,
|
|
110
|
+
getOwnPropertySymbols: o$3,
|
|
111
|
+
getPrototypeOf: n$2
|
|
112
112
|
} = Object,
|
|
113
|
-
a = globalThis,
|
|
114
|
-
c = a.trustedTypes,
|
|
115
|
-
l = c ? c.emptyScript : "",
|
|
116
|
-
p = a.reactiveElementPolyfillSupport,
|
|
117
|
-
d = (t, s) => t,
|
|
118
|
-
u = {
|
|
113
|
+
a$1 = globalThis,
|
|
114
|
+
c$1 = a$1.trustedTypes,
|
|
115
|
+
l$1 = c$1 ? c$1.emptyScript : "",
|
|
116
|
+
p$1 = a$1.reactiveElementPolyfillSupport,
|
|
117
|
+
d$1 = (t, s) => t,
|
|
118
|
+
u$1 = {
|
|
119
119
|
toAttribute(t, s) {
|
|
120
120
|
switch (s) {
|
|
121
121
|
case Boolean:
|
|
122
|
-
t = t ? l : null;
|
|
122
|
+
t = t ? l$1 : null;
|
|
123
123
|
break;
|
|
124
124
|
case Object:
|
|
125
125
|
case Array:
|
|
@@ -147,16 +147,16 @@ const {
|
|
|
147
147
|
return i;
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
|
-
f = (t, s) => !i(t, s),
|
|
150
|
+
f$1 = (t, s) => !i$2(t, s),
|
|
151
151
|
b = {
|
|
152
152
|
attribute: true,
|
|
153
153
|
type: String,
|
|
154
|
-
converter: u,
|
|
154
|
+
converter: u$1,
|
|
155
155
|
reflect: false,
|
|
156
156
|
useDefault: false,
|
|
157
|
-
hasChanged: f
|
|
157
|
+
hasChanged: f$1
|
|
158
158
|
};
|
|
159
|
-
Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap();
|
|
159
|
+
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
|
|
160
160
|
class y extends HTMLElement {
|
|
161
161
|
static addInitializer(t) {
|
|
162
162
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -168,14 +168,14 @@ class y extends HTMLElement {
|
|
|
168
168
|
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) {
|
|
169
169
|
const i = Symbol(),
|
|
170
170
|
h = this.getPropertyDescriptor(t, i, s);
|
|
171
|
-
void 0 !== h && e(this.prototype, t, h);
|
|
171
|
+
void 0 !== h && e$3(this.prototype, t, h);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
static getPropertyDescriptor(t, s, i) {
|
|
175
175
|
const {
|
|
176
176
|
get: e,
|
|
177
177
|
set: r
|
|
178
|
-
} = h(this.prototype, t) ?? {
|
|
178
|
+
} = h$1(this.prototype, t) ?? {
|
|
179
179
|
get() {
|
|
180
180
|
return this[s];
|
|
181
181
|
},
|
|
@@ -197,15 +197,15 @@ class y extends HTMLElement {
|
|
|
197
197
|
return this.elementProperties.get(t) ?? b;
|
|
198
198
|
}
|
|
199
199
|
static _$Ei() {
|
|
200
|
-
if (this.hasOwnProperty(d("elementProperties"))) return;
|
|
201
|
-
const t = n$
|
|
200
|
+
if (this.hasOwnProperty(d$1("elementProperties"))) return;
|
|
201
|
+
const t = n$2(this);
|
|
202
202
|
t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
203
203
|
}
|
|
204
204
|
static finalize() {
|
|
205
|
-
if (this.hasOwnProperty(d("finalized"))) return;
|
|
206
|
-
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
|
|
205
|
+
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
206
|
+
if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
207
207
|
const t = this.properties,
|
|
208
|
-
s = [...r$
|
|
208
|
+
s = [...r$2(t), ...o$3(t)];
|
|
209
209
|
for (const i of s) this.createProperty(i, t[i]);
|
|
210
210
|
}
|
|
211
211
|
const t = this[Symbol.metadata];
|
|
@@ -224,8 +224,8 @@ class y extends HTMLElement {
|
|
|
224
224
|
const i = [];
|
|
225
225
|
if (Array.isArray(s)) {
|
|
226
226
|
const e = new Set(s.flat(1 / 0).reverse());
|
|
227
|
-
for (const s of e) i.unshift(c$
|
|
228
|
-
} else void 0 !== s && i.push(c$
|
|
227
|
+
for (const s of e) i.unshift(c$2(s));
|
|
228
|
+
} else void 0 !== s && i.push(c$2(s));
|
|
229
229
|
return i;
|
|
230
230
|
}
|
|
231
231
|
static _$Eu(t, s) {
|
|
@@ -252,7 +252,7 @@ class y extends HTMLElement {
|
|
|
252
252
|
}
|
|
253
253
|
createRenderRoot() {
|
|
254
254
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
255
|
-
return S(t, this.constructor.elementStyles), t;
|
|
255
|
+
return S$1(t, this.constructor.elementStyles), t;
|
|
256
256
|
}
|
|
257
257
|
connectedCallback() {
|
|
258
258
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(t => t.hostConnected?.());
|
|
@@ -268,7 +268,7 @@ class y extends HTMLElement {
|
|
|
268
268
|
const i = this.constructor.elementProperties.get(t),
|
|
269
269
|
e = this.constructor._$Eu(t, i);
|
|
270
270
|
if (void 0 !== e && true === i.reflect) {
|
|
271
|
-
const h = (void 0 !== i.converter?.toAttribute ? i.converter : u).toAttribute(s, i.type);
|
|
271
|
+
const h = (void 0 !== i.converter?.toAttribute ? i.converter : u$1).toAttribute(s, i.type);
|
|
272
272
|
this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -279,7 +279,7 @@ class y extends HTMLElement {
|
|
|
279
279
|
const t = i.getPropertyOptions(e),
|
|
280
280
|
h = "function" == typeof t.converter ? {
|
|
281
281
|
fromAttribute: t.converter
|
|
282
|
-
} : void 0 !== t.converter?.fromAttribute ? t.converter : u;
|
|
282
|
+
} : void 0 !== t.converter?.fromAttribute ? t.converter : u$1;
|
|
283
283
|
this._$Em = e;
|
|
284
284
|
const r = h.fromAttribute(s, t.type);
|
|
285
285
|
this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
|
|
@@ -289,7 +289,7 @@ class y extends HTMLElement {
|
|
|
289
289
|
if (void 0 !== t) {
|
|
290
290
|
const e = this.constructor,
|
|
291
291
|
h = this[t];
|
|
292
|
-
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;
|
|
292
|
+
if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f$1)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i)))) return;
|
|
293
293
|
this.C(t, s, i);
|
|
294
294
|
}
|
|
295
295
|
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
@@ -363,23 +363,23 @@ class y extends HTMLElement {
|
|
|
363
363
|
}
|
|
364
364
|
y.elementStyles = [], y.shadowRootOptions = {
|
|
365
365
|
mode: "open"
|
|
366
|
-
}, y[d("elementProperties")] = new Map(), y[d("finalized")] = new Map(), p?.({
|
|
366
|
+
}, y[d$1("elementProperties")] = new Map(), y[d$1("finalized")] = new Map(), p$1?.({
|
|
367
367
|
ReactiveElement: y
|
|
368
|
-
}), (a.reactiveElementVersions ??= []).push("2.1.1");
|
|
368
|
+
}), (a$1.reactiveElementVersions ??= []).push("2.1.1");
|
|
369
369
|
|
|
370
370
|
/**
|
|
371
371
|
* @license
|
|
372
372
|
* Copyright 2017 Google LLC
|
|
373
373
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
374
374
|
*/
|
|
375
|
-
const o = {
|
|
375
|
+
const o$2 = {
|
|
376
376
|
attribute: true,
|
|
377
377
|
type: String,
|
|
378
|
-
converter: u,
|
|
378
|
+
converter: u$1,
|
|
379
379
|
reflect: false,
|
|
380
|
-
hasChanged: f
|
|
380
|
+
hasChanged: f$1
|
|
381
381
|
},
|
|
382
|
-
r = (t = o, e, r) => {
|
|
382
|
+
r$1 = (t = o$2, e, r) => {
|
|
383
383
|
const {
|
|
384
384
|
kind: n,
|
|
385
385
|
metadata: i
|
|
@@ -410,13 +410,367 @@ const o = {
|
|
|
410
410
|
}
|
|
411
411
|
throw Error("Unsupported decorator location: " + n);
|
|
412
412
|
};
|
|
413
|
-
function n(t) {
|
|
414
|
-
return (e, o) => "object" == typeof o ? r(t, e, o) : ((t, e, o) => {
|
|
413
|
+
function n$1(t) {
|
|
414
|
+
return (e, o) => "object" == typeof o ? r$1(t, e, o) : ((t, e, o) => {
|
|
415
415
|
const r = e.hasOwnProperty(o);
|
|
416
416
|
return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
|
|
417
417
|
})(t, e, o);
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
/**
|
|
421
|
+
* @license
|
|
422
|
+
* Copyright 2017 Google LLC
|
|
423
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
424
|
+
*/
|
|
425
|
+
const t$1 = globalThis,
|
|
426
|
+
i$1 = t$1.trustedTypes,
|
|
427
|
+
s = i$1 ? i$1.createPolicy("lit-html", {
|
|
428
|
+
createHTML: t => t
|
|
429
|
+
}) : void 0,
|
|
430
|
+
e$2 = "$lit$",
|
|
431
|
+
h = `lit$${Math.random().toFixed(9).slice(2)}$`,
|
|
432
|
+
o$1 = "?" + h,
|
|
433
|
+
n = `<${o$1}>`,
|
|
434
|
+
r = document,
|
|
435
|
+
l = () => r.createComment(""),
|
|
436
|
+
c = t => null === t || "object" != typeof t && "function" != typeof t,
|
|
437
|
+
a = Array.isArray,
|
|
438
|
+
u = t => a(t) || "function" == typeof t?.[Symbol.iterator],
|
|
439
|
+
d = "[ \t\n\f\r]",
|
|
440
|
+
f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
441
|
+
v = /-->/g,
|
|
442
|
+
_ = />/g,
|
|
443
|
+
m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
444
|
+
p = /'/g,
|
|
445
|
+
g = /"/g,
|
|
446
|
+
$ = /^(?:script|style|textarea|title)$/i,
|
|
447
|
+
T = Symbol.for("lit-noChange"),
|
|
448
|
+
E = Symbol.for("lit-nothing"),
|
|
449
|
+
A = new WeakMap(),
|
|
450
|
+
C = r.createTreeWalker(r, 129);
|
|
451
|
+
function P(t, i) {
|
|
452
|
+
if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
453
|
+
return void 0 !== s ? s.createHTML(i) : i;
|
|
454
|
+
}
|
|
455
|
+
const V = (t, i) => {
|
|
456
|
+
const s = t.length - 1,
|
|
457
|
+
o = [];
|
|
458
|
+
let r,
|
|
459
|
+
l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "",
|
|
460
|
+
c = f;
|
|
461
|
+
for (let i = 0; i < s; i++) {
|
|
462
|
+
const s = t[i];
|
|
463
|
+
let a,
|
|
464
|
+
u,
|
|
465
|
+
d = -1,
|
|
466
|
+
y = 0;
|
|
467
|
+
for (; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);) y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r ?? f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
|
|
468
|
+
const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
|
|
469
|
+
l += c === f ? s + n : d >= 0 ? (o.push(a), s.slice(0, d) + e$2 + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
|
|
470
|
+
}
|
|
471
|
+
return [P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), o];
|
|
472
|
+
};
|
|
473
|
+
class N {
|
|
474
|
+
constructor({
|
|
475
|
+
strings: t,
|
|
476
|
+
_$litType$: s
|
|
477
|
+
}, n) {
|
|
478
|
+
let r;
|
|
479
|
+
this.parts = [];
|
|
480
|
+
let c = 0,
|
|
481
|
+
a = 0;
|
|
482
|
+
const u = t.length - 1,
|
|
483
|
+
d = this.parts,
|
|
484
|
+
[f, v] = V(t, s);
|
|
485
|
+
if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
|
|
486
|
+
const t = this.el.content.firstChild;
|
|
487
|
+
t.replaceWith(...t.childNodes);
|
|
488
|
+
}
|
|
489
|
+
for (; null !== (r = C.nextNode()) && d.length < u;) {
|
|
490
|
+
if (1 === r.nodeType) {
|
|
491
|
+
if (r.hasAttributes()) for (const t of r.getAttributeNames()) if (t.endsWith(e$2)) {
|
|
492
|
+
const i = v[a++],
|
|
493
|
+
s = r.getAttribute(t).split(h),
|
|
494
|
+
e = /([.?@])?(.*)/.exec(i);
|
|
495
|
+
d.push({
|
|
496
|
+
type: 1,
|
|
497
|
+
index: c,
|
|
498
|
+
name: e[2],
|
|
499
|
+
strings: s,
|
|
500
|
+
ctor: "." === e[1] ? H : "?" === e[1] ? I : "@" === e[1] ? L : k
|
|
501
|
+
}), r.removeAttribute(t);
|
|
502
|
+
} else t.startsWith(h) && (d.push({
|
|
503
|
+
type: 6,
|
|
504
|
+
index: c
|
|
505
|
+
}), r.removeAttribute(t));
|
|
506
|
+
if ($.test(r.tagName)) {
|
|
507
|
+
const t = r.textContent.split(h),
|
|
508
|
+
s = t.length - 1;
|
|
509
|
+
if (s > 0) {
|
|
510
|
+
r.textContent = i$1 ? i$1.emptyScript : "";
|
|
511
|
+
for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
|
|
512
|
+
type: 2,
|
|
513
|
+
index: ++c
|
|
514
|
+
});
|
|
515
|
+
r.append(t[s], l());
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
} else if (8 === r.nodeType) if (r.data === o$1) d.push({
|
|
519
|
+
type: 2,
|
|
520
|
+
index: c
|
|
521
|
+
});else {
|
|
522
|
+
let t = -1;
|
|
523
|
+
for (; -1 !== (t = r.data.indexOf(h, t + 1));) d.push({
|
|
524
|
+
type: 7,
|
|
525
|
+
index: c
|
|
526
|
+
}), t += h.length - 1;
|
|
527
|
+
}
|
|
528
|
+
c++;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
static createElement(t, i) {
|
|
532
|
+
const s = r.createElement("template");
|
|
533
|
+
return s.innerHTML = t, s;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function S(t, i, s = t, e) {
|
|
537
|
+
if (i === T) return i;
|
|
538
|
+
let h = void 0 !== e ? s._$Co?.[e] : s._$Cl;
|
|
539
|
+
const o = c(i) ? void 0 : i._$litDirective$;
|
|
540
|
+
return h?.constructor !== o && (h?._$AO?.(false), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? (s._$Co ??= [])[e] = h : s._$Cl = h), void 0 !== h && (i = S(t, h._$AS(t, i.values), h, e)), i;
|
|
541
|
+
}
|
|
542
|
+
class M {
|
|
543
|
+
constructor(t, i) {
|
|
544
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
|
|
545
|
+
}
|
|
546
|
+
get parentNode() {
|
|
547
|
+
return this._$AM.parentNode;
|
|
548
|
+
}
|
|
549
|
+
get _$AU() {
|
|
550
|
+
return this._$AM._$AU;
|
|
551
|
+
}
|
|
552
|
+
u(t) {
|
|
553
|
+
const {
|
|
554
|
+
el: {
|
|
555
|
+
content: i
|
|
556
|
+
},
|
|
557
|
+
parts: s
|
|
558
|
+
} = this._$AD,
|
|
559
|
+
e = (t?.creationScope ?? r).importNode(i, true);
|
|
560
|
+
C.currentNode = e;
|
|
561
|
+
let h = C.nextNode(),
|
|
562
|
+
o = 0,
|
|
563
|
+
n = 0,
|
|
564
|
+
l = s[0];
|
|
565
|
+
for (; void 0 !== l;) {
|
|
566
|
+
if (o === l.index) {
|
|
567
|
+
let i;
|
|
568
|
+
2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
|
|
569
|
+
}
|
|
570
|
+
o !== l?.index && (h = C.nextNode(), o++);
|
|
571
|
+
}
|
|
572
|
+
return C.currentNode = r, e;
|
|
573
|
+
}
|
|
574
|
+
p(t) {
|
|
575
|
+
let i = 0;
|
|
576
|
+
for (const s of this._$AV) void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
class R {
|
|
580
|
+
get _$AU() {
|
|
581
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
582
|
+
}
|
|
583
|
+
constructor(t, i, s, e) {
|
|
584
|
+
this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
|
|
585
|
+
}
|
|
586
|
+
get parentNode() {
|
|
587
|
+
let t = this._$AA.parentNode;
|
|
588
|
+
const i = this._$AM;
|
|
589
|
+
return void 0 !== i && 11 === t?.nodeType && (t = i.parentNode), t;
|
|
590
|
+
}
|
|
591
|
+
get startNode() {
|
|
592
|
+
return this._$AA;
|
|
593
|
+
}
|
|
594
|
+
get endNode() {
|
|
595
|
+
return this._$AB;
|
|
596
|
+
}
|
|
597
|
+
_$AI(t, i = this) {
|
|
598
|
+
t = S(this, t, i), c(t) ? t === E || null == t || "" === t ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : u(t) ? this.k(t) : this._(t);
|
|
599
|
+
}
|
|
600
|
+
O(t) {
|
|
601
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
602
|
+
}
|
|
603
|
+
T(t) {
|
|
604
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
605
|
+
}
|
|
606
|
+
_(t) {
|
|
607
|
+
this._$AH !== E && c(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r.createTextNode(t)), this._$AH = t;
|
|
608
|
+
}
|
|
609
|
+
$(t) {
|
|
610
|
+
const {
|
|
611
|
+
values: i,
|
|
612
|
+
_$litType$: s
|
|
613
|
+
} = t,
|
|
614
|
+
e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
|
|
615
|
+
if (this._$AH?._$AD === e) this._$AH.p(i);else {
|
|
616
|
+
const t = new M(e, this),
|
|
617
|
+
s = t.u(this.options);
|
|
618
|
+
t.p(i), this.T(s), this._$AH = t;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
_$AC(t) {
|
|
622
|
+
let i = A.get(t.strings);
|
|
623
|
+
return void 0 === i && A.set(t.strings, i = new N(t)), i;
|
|
624
|
+
}
|
|
625
|
+
k(t) {
|
|
626
|
+
a(this._$AH) || (this._$AH = [], this._$AR());
|
|
627
|
+
const i = this._$AH;
|
|
628
|
+
let s,
|
|
629
|
+
e = 0;
|
|
630
|
+
for (const h of t) e === i.length ? i.push(s = new R(this.O(l()), this.O(l()), this, this.options)) : s = i[e], s._$AI(h), e++;
|
|
631
|
+
e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
|
|
632
|
+
}
|
|
633
|
+
_$AR(t = this._$AA.nextSibling, i) {
|
|
634
|
+
for (this._$AP?.(false, true, i); t !== this._$AB;) {
|
|
635
|
+
const i = t.nextSibling;
|
|
636
|
+
t.remove(), t = i;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
setConnected(t) {
|
|
640
|
+
void 0 === this._$AM && (this._$Cv = t, this._$AP?.(t));
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
class k {
|
|
644
|
+
get tagName() {
|
|
645
|
+
return this.element.tagName;
|
|
646
|
+
}
|
|
647
|
+
get _$AU() {
|
|
648
|
+
return this._$AM._$AU;
|
|
649
|
+
}
|
|
650
|
+
constructor(t, i, s, e, h) {
|
|
651
|
+
this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = E;
|
|
652
|
+
}
|
|
653
|
+
_$AI(t, i = this, s, e) {
|
|
654
|
+
const h = this.strings;
|
|
655
|
+
let o = false;
|
|
656
|
+
if (void 0 === h) t = S(this, t, i, 0), o = !c(t) || t !== this._$AH && t !== T, o && (this._$AH = t);else {
|
|
657
|
+
const e = t;
|
|
658
|
+
let n, r;
|
|
659
|
+
for (t = h[0], n = 0; n < h.length - 1; n++) r = S(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
|
|
660
|
+
}
|
|
661
|
+
o && !e && this.j(t);
|
|
662
|
+
}
|
|
663
|
+
j(t) {
|
|
664
|
+
t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
class H extends k {
|
|
668
|
+
constructor() {
|
|
669
|
+
super(...arguments), this.type = 3;
|
|
670
|
+
}
|
|
671
|
+
j(t) {
|
|
672
|
+
this.element[this.name] = t === E ? void 0 : t;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
class I extends k {
|
|
676
|
+
constructor() {
|
|
677
|
+
super(...arguments), this.type = 4;
|
|
678
|
+
}
|
|
679
|
+
j(t) {
|
|
680
|
+
this.element.toggleAttribute(this.name, !!t && t !== E);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
class L extends k {
|
|
684
|
+
constructor(t, i, s, e, h) {
|
|
685
|
+
super(t, i, s, e, h), this.type = 5;
|
|
686
|
+
}
|
|
687
|
+
_$AI(t, i = this) {
|
|
688
|
+
if ((t = S(this, t, i, 0) ?? E) === T) return;
|
|
689
|
+
const s = this._$AH,
|
|
690
|
+
e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
|
|
691
|
+
h = t !== E && (s === E || e);
|
|
692
|
+
e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
693
|
+
}
|
|
694
|
+
handleEvent(t) {
|
|
695
|
+
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
class z {
|
|
699
|
+
constructor(t, i, s) {
|
|
700
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
|
|
701
|
+
}
|
|
702
|
+
get _$AU() {
|
|
703
|
+
return this._$AM._$AU;
|
|
704
|
+
}
|
|
705
|
+
_$AI(t) {
|
|
706
|
+
S(this, t);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
const j = t$1.litHtmlPolyfillSupport;
|
|
710
|
+
j?.(N, R), (t$1.litHtmlVersions ??= []).push("3.3.1");
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* @license
|
|
714
|
+
* Copyright 2017 Google LLC
|
|
715
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
716
|
+
*/
|
|
717
|
+
const t = {
|
|
718
|
+
ATTRIBUTE: 1},
|
|
719
|
+
e$1 = t => (...e) => ({
|
|
720
|
+
_$litDirective$: t,
|
|
721
|
+
values: e
|
|
722
|
+
});
|
|
723
|
+
class i {
|
|
724
|
+
constructor(t) {}
|
|
725
|
+
get _$AU() {
|
|
726
|
+
return this._$AM._$AU;
|
|
727
|
+
}
|
|
728
|
+
_$AT(t, e, i) {
|
|
729
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
730
|
+
}
|
|
731
|
+
_$AS(t, e) {
|
|
732
|
+
return this.update(t, e);
|
|
733
|
+
}
|
|
734
|
+
update(t, e) {
|
|
735
|
+
return this.render(...e);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* @license
|
|
741
|
+
* Copyright 2018 Google LLC
|
|
742
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
743
|
+
*/
|
|
744
|
+
const e = e$1(class extends i {
|
|
745
|
+
constructor(t$1) {
|
|
746
|
+
if (super(t$1), t$1.type !== t.ATTRIBUTE || "class" !== t$1.name || t$1.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
747
|
+
}
|
|
748
|
+
render(t) {
|
|
749
|
+
return " " + Object.keys(t).filter(s => t[s]).join(" ") + " ";
|
|
750
|
+
}
|
|
751
|
+
update(s, [i]) {
|
|
752
|
+
if (void 0 === this.st) {
|
|
753
|
+
this.st = new Set(), void 0 !== s.strings && (this.nt = new Set(s.strings.join(" ").split(/\s/).filter(t => "" !== t)));
|
|
754
|
+
for (const t in i) i[t] && !this.nt?.has(t) && this.st.add(t);
|
|
755
|
+
return this.render(i);
|
|
756
|
+
}
|
|
757
|
+
const r = s.element.classList;
|
|
758
|
+
for (const t of this.st) t in i || (r.remove(t), this.st.delete(t));
|
|
759
|
+
for (const t in i) {
|
|
760
|
+
const s = !!i[t];
|
|
761
|
+
s === this.st.has(t) || this.nt?.has(t) || (s ? (r.add(t), this.st.add(t)) : (r.remove(t), this.st.delete(t)));
|
|
762
|
+
}
|
|
763
|
+
return T;
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* @license
|
|
769
|
+
* Copyright 2018 Google LLC
|
|
770
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
771
|
+
*/
|
|
772
|
+
const o = o => o ?? E;
|
|
773
|
+
|
|
420
774
|
/** A base implementation for an element used to convey progress. This class must be inherited. */
|
|
421
775
|
class ProgressElementIndicatorBase extends AttachInternals(Role(LitElement, "progressbar"), true) {
|
|
422
776
|
constructor() {
|
|
@@ -431,6 +785,11 @@ class ProgressElementIndicatorBase extends AttachInternals(Role(LitElement, "pro
|
|
|
431
785
|
* @default 100
|
|
432
786
|
*/
|
|
433
787
|
this.max = 100;
|
|
788
|
+
/**
|
|
789
|
+
* The appearance of the indicator.
|
|
790
|
+
* @default "flat"
|
|
791
|
+
*/
|
|
792
|
+
this.variant = "flat";
|
|
434
793
|
}
|
|
435
794
|
/** @inheritdoc */
|
|
436
795
|
connectedCallback() {
|
|
@@ -450,25 +809,20 @@ class ProgressElementIndicatorBase extends AttachInternals(Role(LitElement, "pro
|
|
|
450
809
|
}
|
|
451
810
|
/** The styles of the element. */
|
|
452
811
|
ProgressElementIndicatorBase.styles = css`@media (forced-colors: active) { :host { --m3e-progress-indicator-color: CanvasText; --m3e-progress-indicator-track-color: Canvas; } }`;
|
|
453
|
-
__decorate([n({
|
|
812
|
+
__decorate([n$1({
|
|
454
813
|
type: Number,
|
|
455
814
|
reflect: true
|
|
456
815
|
})], ProgressElementIndicatorBase.prototype, "value", void 0);
|
|
457
|
-
__decorate([n({
|
|
816
|
+
__decorate([n$1({
|
|
458
817
|
type: Number
|
|
459
818
|
})], ProgressElementIndicatorBase.prototype, "max", void 0);
|
|
819
|
+
__decorate([n$1({
|
|
820
|
+
reflect: true
|
|
821
|
+
})], ProgressElementIndicatorBase.prototype, "variant", void 0);
|
|
460
822
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
*
|
|
465
|
-
* @license MIT
|
|
466
|
-
* Copyright (c) 2025 Google LLC
|
|
467
|
-
* See LICENSE file in the project root for full license text.
|
|
468
|
-
*/
|
|
469
|
-
var _M3eCircularProgressIndicatorElement_diameter, _M3eCircularProgressIndicatorElement_strokeWidth;
|
|
470
|
-
const DEFAULT_DIAMETER = 40;
|
|
471
|
-
const DEFAULT_STROKE_WIDTH = 10;
|
|
823
|
+
var _M3eCircularProgressIndicatorElement_instances, _M3eCircularProgressIndicatorElement_maskId, _M3eCircularProgressIndicatorElement_diameter, _M3eCircularProgressIndicatorElement_strokeWidth, _M3eCircularProgressIndicatorElement_amplitude, _M3eCircularProgressIndicatorElement_wavelength, _M3eCircularProgressIndicatorElement_spinnerActiveTrack, _M3eCircularProgressIndicatorElement_spinnerTrack, _M3eCircularProgressIndicatorElement_resizeController, _M3eCircularProgressIndicatorElement_indeterminateWavyAnimationLoop, _M3eCircularProgressIndicatorElement_renderFlatIndicator, _M3eCircularProgressIndicatorElement_renderWavyIndicator, _M3eCircularProgressIndicatorElement_renderResizeObservedElements, _M3eCircularProgressIndicatorElement_renderContent, _M3eCircularProgressIndicatorElement_updateDiameterAndStroke, _M3eCircularProgressIndicatorElement_updateAmplitudeAndWavelength, _M3eCircularProgressIndicatorElement_updateWavyIndeterminateSpinner, _M3eCircularProgressIndicatorElement_computeWavyIndeterminateSweep, _M3eCircularProgressIndicatorElement_sizeToDegrees, _M3eCircularProgressIndicatorElement_degreesToRadians, _M3eCircularProgressIndicatorElement_polarToCartesian, _M3eCircularProgressIndicatorElement_computeCircle, _M3eCircularProgressIndicatorElement_drawArc, _M3eCircularProgressIndicatorElement_drawWavyArc;
|
|
824
|
+
var M3eCircularProgressIndicatorElement_1;
|
|
825
|
+
const WAVY_INDETERMINATE_DURATION = 1.575;
|
|
472
826
|
/**
|
|
473
827
|
* A circular indicator of progress and activity.
|
|
474
828
|
*
|
|
@@ -494,81 +848,365 @@ const DEFAULT_STROKE_WIDTH = 10;
|
|
|
494
848
|
*
|
|
495
849
|
* @slot - Renders the content inside the progress indicator.
|
|
496
850
|
*
|
|
497
|
-
* @attr diameter - The diameter, in pixels, of the progress spinner.
|
|
498
851
|
* @attr indeterminate - Whether to show something is happening without conveying progress.
|
|
499
852
|
* @attr max - The maximum progress value.
|
|
500
|
-
* @attr stroke-width - The stroke width, in pixels, of the progress spinner.
|
|
501
853
|
* @attr value - A fractional value, between 0 and `max`, indicating progress.
|
|
854
|
+
* @attr variant - The appearance of the indicator.
|
|
502
855
|
*
|
|
503
|
-
* @cssprop --m3e-progress-indicator-
|
|
856
|
+
* @cssprop --m3e-circular-flat-progress-indicator-diameter - Diameter of the `flat` variant.
|
|
857
|
+
* @cssprop --m3e-circular-wavy-progress-indicator-diameter - Diameter of the `wavy` variant.
|
|
858
|
+
* @cssprop --m3e-circular-wavy-progress-indicator-amplitude - Amplitude of the `wavy` variant.
|
|
859
|
+
* @cssprop --m3e-circular-wavy-progress-indicator-wavelength - Wavelength of the `wavy` variant.
|
|
860
|
+
* @cssprop --m3e-circular-progress-indicator-thickness - Thickness of the progress indicator.
|
|
861
|
+
* @cssprop --m3e-progress-indicator-track-color - Track color of the progress indicator (background).
|
|
504
862
|
* @cssprop --m3e-progress-indicator-color - Color of the progress indicator (foreground).
|
|
505
863
|
*/
|
|
506
|
-
let M3eCircularProgressIndicatorElement = class M3eCircularProgressIndicatorElement extends ProgressElementIndicatorBase {
|
|
864
|
+
let M3eCircularProgressIndicatorElement = M3eCircularProgressIndicatorElement_1 = class M3eCircularProgressIndicatorElement extends ProgressElementIndicatorBase {
|
|
507
865
|
constructor() {
|
|
508
866
|
super(...arguments);
|
|
867
|
+
_M3eCircularProgressIndicatorElement_instances.add(this);
|
|
868
|
+
/** @private */
|
|
869
|
+
_M3eCircularProgressIndicatorElement_maskId.set(this, `m3e-circular-progress-mask-${M3eCircularProgressIndicatorElement_1.__nextMaskId++}`);
|
|
870
|
+
/** @private */
|
|
871
|
+
_M3eCircularProgressIndicatorElement_diameter.set(this, 0);
|
|
872
|
+
/** @private */
|
|
873
|
+
_M3eCircularProgressIndicatorElement_strokeWidth.set(this, 0);
|
|
874
|
+
/** @private */
|
|
875
|
+
_M3eCircularProgressIndicatorElement_amplitude.set(this, 0);
|
|
509
876
|
/** @private */
|
|
510
|
-
|
|
877
|
+
_M3eCircularProgressIndicatorElement_wavelength.set(this, 0);
|
|
511
878
|
/** @private */
|
|
512
|
-
|
|
879
|
+
_M3eCircularProgressIndicatorElement_spinnerActiveTrack.set(this, void 0);
|
|
880
|
+
/** @private */
|
|
881
|
+
_M3eCircularProgressIndicatorElement_spinnerTrack.set(this, void 0);
|
|
882
|
+
/** @private */
|
|
883
|
+
_M3eCircularProgressIndicatorElement_resizeController.set(this, new ResizeController(this, {
|
|
884
|
+
skipInitial: true,
|
|
885
|
+
target: null,
|
|
886
|
+
callback: () => {
|
|
887
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_updateDiameterAndStroke).call(this);
|
|
888
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_updateAmplitudeAndWavelength).call(this);
|
|
889
|
+
}
|
|
890
|
+
}));
|
|
891
|
+
/** @private */
|
|
892
|
+
_M3eCircularProgressIndicatorElement_indeterminateWavyAnimationLoop.set(this, new AnimationLoopController(this, (_, t) => __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_updateWavyIndeterminateSpinner).call(this, t)));
|
|
513
893
|
/**
|
|
514
894
|
* Whether to show something is happening without conveying progress.
|
|
515
895
|
* @default false
|
|
516
896
|
*/
|
|
517
897
|
this.indeterminate = false;
|
|
518
898
|
}
|
|
519
|
-
/**
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
set diameter(value) {
|
|
527
|
-
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_diameter, value, "f");
|
|
528
|
-
this.style.setProperty("--_diameter", `${value}`);
|
|
899
|
+
/** @inheritdoc */
|
|
900
|
+
update(changedProperties) {
|
|
901
|
+
super.update(changedProperties);
|
|
902
|
+
if (changedProperties.has("indeterminate")) {
|
|
903
|
+
this.ariaValueNow = this.indeterminate ? null : `${this.value}`;
|
|
904
|
+
}
|
|
529
905
|
}
|
|
530
|
-
/**
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
906
|
+
/** @inheritdoc */
|
|
907
|
+
firstUpdated(_changedProperties) {
|
|
908
|
+
super.firstUpdated(_changedProperties);
|
|
909
|
+
const diameterAndStroke = this.shadowRoot?.querySelector(".diameter-and-stroke");
|
|
910
|
+
if (diameterAndStroke) {
|
|
911
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_updateDiameterAndStroke).call(this);
|
|
912
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_resizeController, "f").observe(diameterAndStroke);
|
|
913
|
+
}
|
|
914
|
+
const amplitudeAndWavelength = this.shadowRoot?.querySelector(".amplitude-and-wavelength");
|
|
915
|
+
if (amplitudeAndWavelength) {
|
|
916
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_updateDiameterAndStroke).call(this);
|
|
917
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_resizeController, "f").observe(amplitudeAndWavelength);
|
|
918
|
+
}
|
|
536
919
|
}
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
920
|
+
/** @inheritdoc */
|
|
921
|
+
updated(_changedProperties) {
|
|
922
|
+
super.updated(_changedProperties);
|
|
923
|
+
if (_changedProperties.has("indeterminate")) {
|
|
924
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_spinnerActiveTrack, this.shadowRoot?.querySelector(".spinner.active-track"), "f");
|
|
925
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_spinnerTrack, this.shadowRoot?.querySelector(".spinner.track"), "f");
|
|
926
|
+
if (this.indeterminate) {
|
|
927
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_indeterminateWavyAnimationLoop, "f").start();
|
|
928
|
+
} else {
|
|
929
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_indeterminateWavyAnimationLoop, "f").stop();
|
|
930
|
+
}
|
|
931
|
+
}
|
|
540
932
|
}
|
|
541
933
|
/** @inheritdoc */
|
|
542
934
|
render() {
|
|
543
|
-
return
|
|
935
|
+
return this.variant === "wavy" ? __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderWavyIndicator).call(this) : __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderFlatIndicator).call(this);
|
|
544
936
|
}
|
|
545
937
|
};
|
|
938
|
+
_M3eCircularProgressIndicatorElement_maskId = new WeakMap();
|
|
546
939
|
_M3eCircularProgressIndicatorElement_diameter = new WeakMap();
|
|
547
940
|
_M3eCircularProgressIndicatorElement_strokeWidth = new WeakMap();
|
|
941
|
+
_M3eCircularProgressIndicatorElement_amplitude = new WeakMap();
|
|
942
|
+
_M3eCircularProgressIndicatorElement_wavelength = new WeakMap();
|
|
943
|
+
_M3eCircularProgressIndicatorElement_spinnerActiveTrack = new WeakMap();
|
|
944
|
+
_M3eCircularProgressIndicatorElement_spinnerTrack = new WeakMap();
|
|
945
|
+
_M3eCircularProgressIndicatorElement_resizeController = new WeakMap();
|
|
946
|
+
_M3eCircularProgressIndicatorElement_indeterminateWavyAnimationLoop = new WeakMap();
|
|
947
|
+
_M3eCircularProgressIndicatorElement_instances = new WeakSet();
|
|
948
|
+
_M3eCircularProgressIndicatorElement_renderFlatIndicator = function _M3eCircularProgressIndicatorElement_renderFlatIndicator() {
|
|
949
|
+
if (this.indeterminate) {
|
|
950
|
+
const left = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
951
|
+
startAngle: -45,
|
|
952
|
+
endAngle: 90 + __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")
|
|
953
|
+
});
|
|
954
|
+
const right = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
955
|
+
startAngle: -__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f"),
|
|
956
|
+
endAngle: 135
|
|
957
|
+
});
|
|
958
|
+
return html`<div class="progress" aria-hidden="true"><div class="spinner"><div class="left"><svg viewBox="${left.viewBox}" class="circle"><path class="active-track" d="${left.path}" stroke="currentColor" stroke-width="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}" fill="none" stroke-linecap="round"/></svg></div><div class="right"><svg viewBox="${right.viewBox}" class="circle"><path class="active-track" d="${right.path}" stroke="currentColor" stroke-width="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}" fill="none" stroke-linecap="round"/></svg></div></div></div>${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderResizeObservedElements).call(this)}`;
|
|
959
|
+
}
|
|
960
|
+
const minDegrees = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") * 2, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f"));
|
|
961
|
+
let degrees = this.value / this.max * 360;
|
|
962
|
+
if (degrees > 0) {
|
|
963
|
+
degrees = Math.max(0, minDegrees, degrees);
|
|
964
|
+
}
|
|
965
|
+
const active = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
966
|
+
gap: degrees < 360 ? __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") : 0,
|
|
967
|
+
endAngle: degrees
|
|
968
|
+
});
|
|
969
|
+
const inactive = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
970
|
+
gap: degrees > 0 ? __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") : 0,
|
|
971
|
+
startAngle: degrees,
|
|
972
|
+
endAngle: 360
|
|
973
|
+
});
|
|
974
|
+
return html`<div class="progress" aria-hidden="true"><svg viewBox="${active.viewBox}">${degrees > 0 ? svg`<path
|
|
975
|
+
class="active-track"
|
|
976
|
+
d="${active.path}"
|
|
977
|
+
stroke="currentColor"
|
|
978
|
+
stroke-width=${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}
|
|
979
|
+
fill="none"
|
|
980
|
+
stroke-linecap="round"
|
|
981
|
+
/>` : nothing} ${360 - degrees >= minDegrees ? svg`<path
|
|
982
|
+
class="track"
|
|
983
|
+
d="${inactive.path}"
|
|
984
|
+
stroke="currentColor"
|
|
985
|
+
stroke-width=${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}
|
|
986
|
+
fill="none"
|
|
987
|
+
stroke-linecap="round"
|
|
988
|
+
/>` : nothing}</svg></div>${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderResizeObservedElements).call(this)}${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderContent).call(this)}`;
|
|
989
|
+
};
|
|
990
|
+
_M3eCircularProgressIndicatorElement_renderWavyIndicator = function _M3eCircularProgressIndicatorElement_renderWavyIndicator() {
|
|
991
|
+
if (this.indeterminate) {
|
|
992
|
+
return html`<div class="progress" aria-hidden="true"><svg viewBox="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawWavyArc).call(this, {
|
|
993
|
+
endAngle: 20
|
|
994
|
+
}).viewBox}"><path class="spinner active-track" stroke="currentColor" stroke-width="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path class="spinner track" stroke="currentColor" stroke-width="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}" fill="none" stroke-linecap="round"/></svg></div>${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderResizeObservedElements).call(this)}`;
|
|
995
|
+
}
|
|
996
|
+
const minDegrees = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") * 2, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f"));
|
|
997
|
+
let degrees = this.value / this.max * 360;
|
|
998
|
+
if (degrees > 0) {
|
|
999
|
+
degrees = Math.max(0, minDegrees, degrees);
|
|
1000
|
+
}
|
|
1001
|
+
const amplitude = degrees <= minDegrees + minDegrees / 2 || degrees == 360 ? 0 : __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f");
|
|
1002
|
+
const activeArc = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
1003
|
+
gap: degrees < 360 ? __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") : 0,
|
|
1004
|
+
endAngle: degrees
|
|
1005
|
+
});
|
|
1006
|
+
const active = amplitude == 0 ? activeArc : __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawWavyArc).call(this, {
|
|
1007
|
+
endAngle: 360,
|
|
1008
|
+
amplitude
|
|
1009
|
+
});
|
|
1010
|
+
const inactive = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
1011
|
+
gap: degrees > 0 ? __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") : 0,
|
|
1012
|
+
startAngle: degrees,
|
|
1013
|
+
endAngle: 360
|
|
1014
|
+
});
|
|
1015
|
+
const padding = amplitude > 0 ? amplitude + __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") / 2 : __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f");
|
|
1016
|
+
return html`<svg class="progress" viewBox="${inactive.viewBox}" aria-hidden="true">${degrees > 0 ? svg`${amplitude > 0 ? svg`<defs>
|
|
1017
|
+
<mask id="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_maskId, "f")}">
|
|
1018
|
+
<path
|
|
1019
|
+
d="${activeArc.path}"
|
|
1020
|
+
stroke="white"
|
|
1021
|
+
stroke-width="${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") + padding}"
|
|
1022
|
+
fill="none"
|
|
1023
|
+
stroke-linecap="round"
|
|
1024
|
+
/>
|
|
1025
|
+
</mask>
|
|
1026
|
+
</defs>` : nothing}
|
|
1027
|
+
<g class="active-track" mask="${o(amplitude > 0 ? resolveFragmentUrl(__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_maskId, "f")) : undefined)}">
|
|
1028
|
+
<path
|
|
1029
|
+
class="${e({
|
|
1030
|
+
wave: amplitude > 0
|
|
1031
|
+
})}"
|
|
1032
|
+
d="${active.path}"
|
|
1033
|
+
stroke="currentColor"
|
|
1034
|
+
stroke-width=${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}
|
|
1035
|
+
stroke-linecap="round"
|
|
1036
|
+
stroke-linejoin="round"
|
|
1037
|
+
fill="none"
|
|
1038
|
+
/>
|
|
1039
|
+
</g>` : nothing} ${360 - degrees >= minDegrees ? svg`<path
|
|
1040
|
+
class="track"
|
|
1041
|
+
d="${inactive.path}"
|
|
1042
|
+
stroke="currentColor"
|
|
1043
|
+
stroke-width=${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")}
|
|
1044
|
+
fill="none"
|
|
1045
|
+
stroke-linecap="round"
|
|
1046
|
+
/>` : nothing}</svg> ${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderResizeObservedElements).call(this)}${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_renderContent).call(this)}`;
|
|
1047
|
+
};
|
|
1048
|
+
_M3eCircularProgressIndicatorElement_renderResizeObservedElements = function _M3eCircularProgressIndicatorElement_renderResizeObservedElements() {
|
|
1049
|
+
return html`<div class="diameter-and-stroke" aria-hidden="true"></div><div class="amplitude-and-wavelength" aria-hidden="true"></div>`;
|
|
1050
|
+
};
|
|
1051
|
+
_M3eCircularProgressIndicatorElement_renderContent = function _M3eCircularProgressIndicatorElement_renderContent() {
|
|
1052
|
+
return html`<div class="content" aria-hidden="true"><slot></slot></div>`;
|
|
1053
|
+
};
|
|
1054
|
+
_M3eCircularProgressIndicatorElement_updateDiameterAndStroke = function _M3eCircularProgressIndicatorElement_updateDiameterAndStroke() {
|
|
1055
|
+
const element = this.shadowRoot?.querySelector(".diameter-and-stroke");
|
|
1056
|
+
if (element) {
|
|
1057
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_diameter, element.clientWidth, "f");
|
|
1058
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_strokeWidth, element.clientHeight, "f");
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
_M3eCircularProgressIndicatorElement_updateAmplitudeAndWavelength = function _M3eCircularProgressIndicatorElement_updateAmplitudeAndWavelength() {
|
|
1062
|
+
const element = this.shadowRoot?.querySelector(".amplitude-and-wavelength");
|
|
1063
|
+
if (element) {
|
|
1064
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_amplitude, element.clientWidth, "f");
|
|
1065
|
+
__classPrivateFieldSet(this, _M3eCircularProgressIndicatorElement_wavelength, element.clientHeight, "f");
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
_M3eCircularProgressIndicatorElement_updateWavyIndeterminateSpinner = function _M3eCircularProgressIndicatorElement_updateWavyIndeterminateSpinner(t) {
|
|
1069
|
+
if (__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f") === 0 || __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_wavelength, "f") === 0) return;
|
|
1070
|
+
const sweep = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_computeWavyIndeterminateSweep).call(this, t);
|
|
1071
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_spinnerActiveTrack, "f")?.setAttribute("d", __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawWavyArc).call(this, {
|
|
1072
|
+
endAngle: sweep
|
|
1073
|
+
}).path);
|
|
1074
|
+
__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_spinnerTrack, "f")?.setAttribute("d", __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_drawArc).call(this, {
|
|
1075
|
+
gap: __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f"), __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f")),
|
|
1076
|
+
startAngle: sweep
|
|
1077
|
+
}).path);
|
|
1078
|
+
};
|
|
1079
|
+
_M3eCircularProgressIndicatorElement_computeWavyIndeterminateSweep = function _M3eCircularProgressIndicatorElement_computeWavyIndeterminateSweep(t) {
|
|
1080
|
+
const sweepPadding = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f")) * 2;
|
|
1081
|
+
const minSweep = 18 + sweepPadding;
|
|
1082
|
+
const maxSweep = 280 - sweepPadding;
|
|
1083
|
+
const duration = WAVY_INDETERMINATE_DURATION;
|
|
1084
|
+
const holdMin = duration;
|
|
1085
|
+
const growTime = duration;
|
|
1086
|
+
const holdMax = duration;
|
|
1087
|
+
const shrinkTime = duration;
|
|
1088
|
+
const cycle = holdMin + growTime + holdMax + shrinkTime;
|
|
1089
|
+
const u = t % cycle;
|
|
1090
|
+
if (u < holdMin) {
|
|
1091
|
+
return minSweep;
|
|
1092
|
+
}
|
|
1093
|
+
if (u < holdMin + growTime) {
|
|
1094
|
+
const p = (u - holdMin) / growTime;
|
|
1095
|
+
return minSweep + (maxSweep - minSweep) * (p * p * (3 - 2 * p));
|
|
1096
|
+
}
|
|
1097
|
+
if (u < holdMin + growTime + holdMax) {
|
|
1098
|
+
return maxSweep;
|
|
1099
|
+
}
|
|
1100
|
+
const p = (u - (holdMin + growTime + holdMax)) / shrinkTime;
|
|
1101
|
+
return maxSweep - (maxSweep - minSweep) * (p * p * (3 - 2 * p));
|
|
1102
|
+
};
|
|
1103
|
+
_M3eCircularProgressIndicatorElement_sizeToDegrees = function _M3eCircularProgressIndicatorElement_sizeToDegrees(size, padding = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f")) {
|
|
1104
|
+
return size * (360 / (2 * Math.PI * __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_computeCircle).call(this, padding).r));
|
|
1105
|
+
};
|
|
1106
|
+
_M3eCircularProgressIndicatorElement_degreesToRadians = function _M3eCircularProgressIndicatorElement_degreesToRadians(degrees) {
|
|
1107
|
+
return (degrees - 90) * (Math.PI / 180);
|
|
1108
|
+
};
|
|
1109
|
+
_M3eCircularProgressIndicatorElement_polarToCartesian = function _M3eCircularProgressIndicatorElement_polarToCartesian(circle, degrees) {
|
|
1110
|
+
const rad = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_degreesToRadians).call(this, degrees);
|
|
1111
|
+
return {
|
|
1112
|
+
x: circle.cx + circle.r * Math.cos(rad),
|
|
1113
|
+
y: circle.cy + circle.r * Math.sin(rad)
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
_M3eCircularProgressIndicatorElement_computeCircle = function _M3eCircularProgressIndicatorElement_computeCircle(padding) {
|
|
1117
|
+
padding = padding + __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") / 2;
|
|
1118
|
+
const r = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") / 2;
|
|
1119
|
+
const cx = r + padding;
|
|
1120
|
+
const cy = r + padding;
|
|
1121
|
+
return {
|
|
1122
|
+
cx,
|
|
1123
|
+
cy,
|
|
1124
|
+
r,
|
|
1125
|
+
padding
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
_M3eCircularProgressIndicatorElement_drawArc = function _M3eCircularProgressIndicatorElement_drawArc({
|
|
1129
|
+
startAngle = 0,
|
|
1130
|
+
endAngle = 360,
|
|
1131
|
+
gap = 0,
|
|
1132
|
+
padding = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f")
|
|
1133
|
+
}) {
|
|
1134
|
+
if (__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") === 0 || __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") === 0) return {
|
|
1135
|
+
path: "",
|
|
1136
|
+
viewBox: "0 0 0 0"
|
|
1137
|
+
};
|
|
1138
|
+
const circle = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_computeCircle).call(this, padding);
|
|
1139
|
+
if (gap > 0) {
|
|
1140
|
+
startAngle += __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, gap, padding);
|
|
1141
|
+
endAngle -= __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, gap, padding);
|
|
1142
|
+
}
|
|
1143
|
+
if (endAngle - startAngle >= 360) {
|
|
1144
|
+
endAngle = startAngle + 359.999;
|
|
1145
|
+
}
|
|
1146
|
+
const start = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_polarToCartesian).call(this, circle, endAngle);
|
|
1147
|
+
const end = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_polarToCartesian).call(this, circle, startAngle);
|
|
1148
|
+
const path = `M ${start.x} ${start.y} A ${circle.r} ${circle.r} 0 ${endAngle - startAngle <= 180 ? "0" : "1"} 0 ${end.x} ${end.y}`;
|
|
1149
|
+
const viewBox = `0 0 ${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") + circle.padding * 2} ${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") + circle.padding * 2}`;
|
|
1150
|
+
return {
|
|
1151
|
+
path,
|
|
1152
|
+
viewBox
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
_M3eCircularProgressIndicatorElement_drawWavyArc = function _M3eCircularProgressIndicatorElement_drawWavyArc({
|
|
1156
|
+
startAngle = 0,
|
|
1157
|
+
endAngle = 360,
|
|
1158
|
+
gap = 0,
|
|
1159
|
+
padding = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f"),
|
|
1160
|
+
amplitude = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_amplitude, "f"),
|
|
1161
|
+
steps = 200
|
|
1162
|
+
}) {
|
|
1163
|
+
if (__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") === 0 || __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_strokeWidth, "f") === 0) return {
|
|
1164
|
+
path: "",
|
|
1165
|
+
viewBox: "0 0 0 0"
|
|
1166
|
+
};
|
|
1167
|
+
const circle = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_computeCircle).call(this, padding);
|
|
1168
|
+
if (gap > 0) {
|
|
1169
|
+
startAngle += __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, gap, padding);
|
|
1170
|
+
endAngle -= __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_sizeToDegrees).call(this, gap, padding);
|
|
1171
|
+
}
|
|
1172
|
+
const startRad = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_degreesToRadians).call(this, startAngle);
|
|
1173
|
+
let endRad = __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_instances, "m", _M3eCircularProgressIndicatorElement_degreesToRadians).call(this, endAngle);
|
|
1174
|
+
if (startAngle === endAngle) {
|
|
1175
|
+
endRad = startRad;
|
|
1176
|
+
} else if (endRad < startRad) {
|
|
1177
|
+
endRad += Math.PI * 2;
|
|
1178
|
+
}
|
|
1179
|
+
const totalAngle = endRad - startRad;
|
|
1180
|
+
const waveCount = 2 * Math.PI * circle.r / __classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_wavelength, "f");
|
|
1181
|
+
const phase = Math.PI / 2 * (waveCount - 1);
|
|
1182
|
+
const points = [];
|
|
1183
|
+
for (let i = 0; i <= steps; i++) {
|
|
1184
|
+
const t = steps === 0 ? 0 : i / steps;
|
|
1185
|
+
const angle = startRad + t * totalAngle;
|
|
1186
|
+
const wave = Math.sin(angle * waveCount + phase);
|
|
1187
|
+
const radius = circle.r - amplitude * wave;
|
|
1188
|
+
const x = radius * Math.cos(angle) + circle.cx;
|
|
1189
|
+
const y = radius * Math.sin(angle) + circle.cy;
|
|
1190
|
+
points.push([x, y]);
|
|
1191
|
+
}
|
|
1192
|
+
const path = points.length === 1 ? `M ${points[0][0]},${points[0][1]}` : `M ${points[0][0]},${points[0][1]} ` + points.slice(1).map(([x, y]) => `L ${x},${y}`).join(" ");
|
|
1193
|
+
const viewBox = `0 0 ${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") + circle.padding * 2} ${__classPrivateFieldGet(this, _M3eCircularProgressIndicatorElement_diameter, "f") + circle.padding * 2}`;
|
|
1194
|
+
return {
|
|
1195
|
+
path,
|
|
1196
|
+
viewBox
|
|
1197
|
+
};
|
|
1198
|
+
};
|
|
548
1199
|
/** The styles of the element. */
|
|
549
|
-
M3eCircularProgressIndicatorElement.styles = [ProgressElementIndicatorBase.styles, css`:host { display: inline-flex; vertical-align: middle;
|
|
550
|
-
|
|
1200
|
+
M3eCircularProgressIndicatorElement.styles = [ProgressElementIndicatorBase.styles, css`:host { display: inline-flex; vertical-align: middle; aspect-ratio: 1; position: relative; align-items: center; justify-content: center; contain: strict; } .progress { --_arc-duration: 1333ms; --_cycle-duration: calc(4 * var(--_arc-duration)); --_linear-rotate-duration: calc(var(--_arc-duration) * 360 / 306); --_indeterminate-easing: cubic-bezier(0.4, 0, 0.2, 1); } .active-track { transition: stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1); } :host([variant="flat"]) .progress { flex: 1; align-self: stretch; pointer-events: none; } .progress, .spinner, .left, .right, .content, .circle { position: absolute; inset: 0; } .content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } .diameter-and-stroke, .amplitude-and-wavelength { visibility: hidden; position: absolute; } .diameter-and-stroke { width: inherit; height: var(--m3e-circular-progress-indicator-thickness, 0.25rem); } .amplitude-and-wavelength { width: var(--m3e-circular-wavy-progress-indicator-amplitude, 0.1rem); height: var(--m3e-circular-wavy-progress-indicator-wavelength, 0.9375rem); } :host([variant="flat"]) { width: var(--m3e-circular-flat-progress-indicator-diameter, 2.5rem); } :host([variant="wavy"]) { width: var(--m3e-circular-wavy-progress-indicator-diameter, 3rem); } :host([variant="flat"][indeterminate]) { content-visibility: auto; } :host([variant="flat"][indeterminate]) .progress { animation: linear infinite linear-rotate; animation-duration: var(--_linear-rotate-duration); } :host([variant="flat"][indeterminate]) .spinner { animation: infinite both rotate-arc; animation-duration: var(--_cycle-duration); animation-timing-function: var(--_indeterminate-easing); } :host([variant="wavy"][indeterminate]) .spinner { transform-origin: 50% 50%; animation: wavy-spin ${WAVY_INDETERMINATE_DURATION}s linear infinite; } .left { clip-path: inset(0); inset: 0 50% 0 0; } .right { clip-path: inset(0); inset: 0 0 0 50%; } .circle { animation: expand-arc; animation-iteration-count: infinite; animation-fill-mode: both; animation-duration: var(--_arc-duration), var(--_cycle-duration); animation-timing-function: var(--_indeterminate-easing); } .left .circle { rotate: 135deg; inset: 0 -100% 0 0; } .right .circle { rotate: 100deg; inset: 0 0 0 -100%; animation-delay: calc(-0.5 * var(--_arc-duration)), 0ms; } .track { color: var(--m3e-progress-indicator-track-color, ${DesignToken.color.secondaryContainer}); } .active-track { color: var(--m3e-progress-indicator-color, ${DesignToken.color.primary}); } .wave { animation: spin-reverse 8s linear infinite; transform-origin: 50% 50%; } @keyframes expand-arc { 0% { transform: rotate(265deg); } 50% { transform: rotate(130deg); } 100% { transform: rotate(265deg); } } @keyframes rotate-arc { 12.5% { transform: rotate(135deg); } 25% { transform: rotate(270deg); } 37.5% { transform: rotate(405deg); } 50% { transform: rotate(540deg); } 62.5% { transform: rotate(675deg); } 75% { transform: rotate(810deg); } 87.5% { transform: rotate(945deg); } 100% { transform: rotate(1080deg); } } @keyframes linear-rotate { to { transform: rotate(360deg); } } @keyframes spin-reverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes wavy-spin { 0% { transform: rotate(0deg); } 10% { transform: rotate(90deg); } 100% { transform: rotate(360deg); } } @media (forced-colors: active) { :host([variant="flat"]) circle { fill: Canvas; } :host([variant="flat"]) .circle { border-color: var(--m3e-progress-indicator-color, ${DesignToken.color.primary}) var(--m3e-progress-indicator-color, ${DesignToken.color.primary}) Canvas Canvas; } } @media (forced-colors: active) { .progress { --m3e-progress-indicator-track-color: GrayText; --m3e-progress-indicator-color: CanvasText; } }`];
|
|
1201
|
+
/** @private */
|
|
1202
|
+
M3eCircularProgressIndicatorElement.__nextMaskId = 0;
|
|
1203
|
+
__decorate([n$1({
|
|
551
1204
|
type: Boolean,
|
|
552
1205
|
reflect: true
|
|
553
1206
|
})], M3eCircularProgressIndicatorElement.prototype, "indeterminate", void 0);
|
|
554
|
-
__decorate([
|
|
555
|
-
type: Number
|
|
556
|
-
})], M3eCircularProgressIndicatorElement.prototype, "diameter", null);
|
|
557
|
-
__decorate([n({
|
|
558
|
-
attribute: "stroke-width",
|
|
559
|
-
type: Number
|
|
560
|
-
})], M3eCircularProgressIndicatorElement.prototype, "strokeWidth", null);
|
|
561
|
-
M3eCircularProgressIndicatorElement = __decorate([t$1("m3e-circular-progress-indicator")], M3eCircularProgressIndicatorElement);
|
|
1207
|
+
M3eCircularProgressIndicatorElement = M3eCircularProgressIndicatorElement_1 = __decorate([t$3("m3e-circular-progress-indicator")], M3eCircularProgressIndicatorElement);
|
|
562
1208
|
|
|
563
|
-
|
|
564
|
-
* Adapted from Angular Material Progress Bar
|
|
565
|
-
* Source: https://github.com/angular/components/blob/main/src/material/progress-bar/progress-bar.ts
|
|
566
|
-
*
|
|
567
|
-
* @license MIT
|
|
568
|
-
* Copyright (c) 2025 Google LLC
|
|
569
|
-
* See LICENSE file in the project root for full license text.
|
|
570
|
-
*/
|
|
571
|
-
var _M3eLinearProgressIndicatorElement_patternId, _M3eLinearProgressIndicatorElement_patternFill;
|
|
1209
|
+
var _M3eLinearProgressIndicatorElement_instances, _M3eLinearProgressIndicatorElement_maskId, _M3eLinearProgressIndicatorElement_strokeWidth, _M3eLinearProgressIndicatorElement_amplitude, _M3eLinearProgressIndicatorElement_wavelength, _M3eLinearProgressIndicatorElement_resizeController, _M3eLinearProgressIndicatorElement_renderWave, _M3eLinearProgressIndicatorElement_renderResizeObservedElements, _M3eLinearProgressIndicatorElement_updateStroke, _M3eLinearProgressIndicatorElement_updateAmplitudeAndWavelength, _M3eLinearProgressIndicatorElement_drawWavyPath;
|
|
572
1210
|
var M3eLinearProgressIndicatorElement_1;
|
|
573
1211
|
/**
|
|
574
1212
|
* A horizontal bar for indicating progress and activity.
|
|
@@ -597,19 +1235,37 @@ var M3eLinearProgressIndicatorElement_1;
|
|
|
597
1235
|
* @attr max - The maximum progress value.
|
|
598
1236
|
* @attr mode - The mode of the progress bar.
|
|
599
1237
|
* @attr value - A fractional value, between 0 and `max`, indicating progress.
|
|
1238
|
+
* @attr variant - The appearance of the indicator.
|
|
600
1239
|
*
|
|
601
1240
|
* @cssprop --m3e-linear-progress-indicator-thickness - Thickness (height) of the progress bar.
|
|
602
1241
|
* @cssprop --m3e-linear-progress-indicator-shape - Border radius of the progress bar.
|
|
603
1242
|
* @cssprop --m3e-progress-indicator-track-color - Track color of the progress bar (background/buffer).
|
|
604
1243
|
* @cssprop --m3e-progress-indicator-color - Color of the progress indicator (foreground).
|
|
1244
|
+
* @cssprop --m3e-linear-wavy-progress-indicator-amplitude - Amplitude of the `wavy` variant.
|
|
1245
|
+
* @cssprop --m3e-linear-wavy-progress-indicator-wavelength - Wavelength of the `wavy` variant.
|
|
1246
|
+
* @cssprop --m3e-linear-wavy-indeterminate-progress-indicator-wavelength - Wavelength of the indeterminate/query `wavy` variant.
|
|
605
1247
|
*/
|
|
606
1248
|
let M3eLinearProgressIndicatorElement = M3eLinearProgressIndicatorElement_1 = class M3eLinearProgressIndicatorElement extends ProgressElementIndicatorBase {
|
|
607
1249
|
constructor() {
|
|
608
1250
|
super(...arguments);
|
|
1251
|
+
_M3eLinearProgressIndicatorElement_instances.add(this);
|
|
1252
|
+
/** @private */
|
|
1253
|
+
_M3eLinearProgressIndicatorElement_maskId.set(this, `m3e-linear-progress-mask-${M3eLinearProgressIndicatorElement_1.__nextMaskId++}`);
|
|
1254
|
+
/** @private */
|
|
1255
|
+
_M3eLinearProgressIndicatorElement_strokeWidth.set(this, 0);
|
|
1256
|
+
/** @private */
|
|
1257
|
+
_M3eLinearProgressIndicatorElement_amplitude.set(this, 0);
|
|
609
1258
|
/** @private */
|
|
610
|
-
|
|
1259
|
+
_M3eLinearProgressIndicatorElement_wavelength.set(this, 0);
|
|
611
1260
|
/** @private */
|
|
612
|
-
|
|
1261
|
+
_M3eLinearProgressIndicatorElement_resizeController.set(this, new ResizeController(this, {
|
|
1262
|
+
skipInitial: true,
|
|
1263
|
+
target: null,
|
|
1264
|
+
callback: () => {
|
|
1265
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_updateStroke).call(this);
|
|
1266
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_updateAmplitudeAndWavelength).call(this);
|
|
1267
|
+
}
|
|
1268
|
+
}));
|
|
613
1269
|
/**
|
|
614
1270
|
* The mode of the progress bar.
|
|
615
1271
|
* @default "determinate"
|
|
@@ -622,38 +1278,128 @@ let M3eLinearProgressIndicatorElement = M3eLinearProgressIndicatorElement_1 = cl
|
|
|
622
1278
|
this.bufferValue = 0;
|
|
623
1279
|
}
|
|
624
1280
|
/** @inheritdoc */
|
|
625
|
-
|
|
626
|
-
super.
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
|
|
1281
|
+
firstUpdated(_changedProperties) {
|
|
1282
|
+
super.firstUpdated(_changedProperties);
|
|
1283
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_updateStroke).call(this);
|
|
1284
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_updateAmplitudeAndWavelength).call(this);
|
|
1285
|
+
const stroke = this.shadowRoot?.querySelector(".stroke");
|
|
1286
|
+
if (stroke) {
|
|
1287
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_resizeController, "f").observe(stroke);
|
|
1288
|
+
}
|
|
1289
|
+
const amplitudeAndWavelength = this.shadowRoot?.querySelector(".amplitude-and-wavelength");
|
|
1290
|
+
if (amplitudeAndWavelength) {
|
|
1291
|
+
__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_resizeController, "f").observe(amplitudeAndWavelength);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
/** @inheritdoc */
|
|
1295
|
+
update(changedProperties) {
|
|
1296
|
+
super.update(changedProperties);
|
|
1297
|
+
if (changedProperties.has("mode")) {
|
|
1298
|
+
this.ariaValueNow = this.mode === "indeterminate" || this.mode === "query" ? null : `${this.value}`;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
/** @inheritdoc */
|
|
1302
|
+
updated(_changedProperties) {
|
|
1303
|
+
super.updated(_changedProperties);
|
|
1304
|
+
if (_changedProperties.has("value") || _changedProperties.has("bufferValue") || _changedProperties.has("max")) {
|
|
1305
|
+
const progress = this.shadowRoot?.querySelector(".progress");
|
|
1306
|
+
progress?.style.setProperty("--_value", `${this.value / this.max * 100}%`);
|
|
1307
|
+
progress?.style.setProperty("--_buffer-value", `${this.bufferValue / this.max * 100}%`);
|
|
1308
|
+
}
|
|
632
1309
|
}
|
|
633
1310
|
/** @inheritdoc */
|
|
634
1311
|
render() {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
1312
|
+
const clampedValue = Math.max(0, Math.min(this.value, this.max));
|
|
1313
|
+
const activeWidth = clampedValue / this.max * this.clientWidth;
|
|
1314
|
+
const waveWidth = this.mode === "indeterminate" || this.mode === "query" ? this.clientWidth : activeWidth + __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_wavelength, "f") * 3;
|
|
1315
|
+
const wave = this.variant === "wavy" && __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f") > 0 && __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_amplitude, "f") > 0 && __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_wavelength, "f") > 0 ? __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_drawWavyPath).call(this, waveWidth) : undefined;
|
|
1316
|
+
return html`<div class="progress" aria-hidden="true" style="${safeStyleMap({
|
|
1317
|
+
"--_translate-x": `-${activeWidth}px`
|
|
1318
|
+
})}">${!wave ? html`<div class="track"></div>` : nothing} ${(this.mode === "determinate" || this.mode === "buffer") && this.value <= 0 ? nothing : html`<div class="primary">${wave && (this.mode === "determinate" || this.mode === "buffer") ? __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_renderWave).call(this, waveWidth, wave.height, wave.viewBox, wave.path) : nothing}</div>${this.mode === "determinate" || this.mode === "buffer" ? html`<div class="gap"></div>` : nothing}`} ${this.mode !== "buffer" || this.bufferValue > 0 ? html`<div class="secondary"></div>` : nothing} ${this.mode === "buffer" && this.bufferValue > 0 ? html`<div class="gap"></div>` : nothing} ${this.mode === "buffer" ? html`<div class="buffer"></div>` : nothing} ${(this.mode === "determinate" || this.mode === "buffer") && this.value > 0 ? html`<div class="gap"></div><div class="stop"></div>` : nothing} ${wave && !(this.mode === "determinate" || this.mode === "buffer") ? __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_renderWave).call(this, waveWidth, wave.height, wave.viewBox, wave.path) : nothing}</div>${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_instances, "m", _M3eLinearProgressIndicatorElement_renderResizeObservedElements).call(this)}`;
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
_M3eLinearProgressIndicatorElement_maskId = new WeakMap();
|
|
1322
|
+
_M3eLinearProgressIndicatorElement_strokeWidth = new WeakMap();
|
|
1323
|
+
_M3eLinearProgressIndicatorElement_amplitude = new WeakMap();
|
|
1324
|
+
_M3eLinearProgressIndicatorElement_wavelength = new WeakMap();
|
|
1325
|
+
_M3eLinearProgressIndicatorElement_resizeController = new WeakMap();
|
|
1326
|
+
_M3eLinearProgressIndicatorElement_instances = new WeakSet();
|
|
1327
|
+
_M3eLinearProgressIndicatorElement_renderWave = function _M3eLinearProgressIndicatorElement_renderWave(width, height, viewBox, path) {
|
|
1328
|
+
const masked = this.mode === "indeterminate" || this.mode === "query";
|
|
1329
|
+
if (!masked && this.value / this.max === 1) {
|
|
1330
|
+
return html`<div class="complete"></div>`;
|
|
1331
|
+
}
|
|
1332
|
+
return html`<svg class="wave" width="${width}" height="${height}" viewBox="${viewBox}" preserveAspectRatio="none">${masked ? svg`
|
|
1333
|
+
<mask id="${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_maskId, "f")}" maskUnits="userSpaceOnUse">
|
|
1334
|
+
<rect width="${width}" height="${height}" fill="black" />
|
|
1335
|
+
<rect class="primary" height="${height}" fill="white" />
|
|
1336
|
+
<rect class="secondary" height="${height}" fill="white" />
|
|
1337
|
+
</mask>
|
|
1338
|
+
<mask id="${`${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_maskId, "f")}-inverse`}" maskUnits="userSpaceOnUse">
|
|
1339
|
+
<rect width="${width}" height="${height}" fill="white" />
|
|
1340
|
+
<rect class="primary" height="${height}" fill="black" />
|
|
1341
|
+
<rect class="secondary" height="${height}" fill="black" />
|
|
1342
|
+
</mask>
|
|
1343
|
+
<g mask="${resolveFragmentUrl(__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_maskId, "f"))}">
|
|
1344
|
+
<path d="${path}" stroke="currentColor" stroke-width=${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f")} fill="none" stroke-linecap="round" />
|
|
1345
|
+
</g>
|
|
1346
|
+
<g mask="${resolveFragmentUrl(`${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_maskId, "f")}-inverse`)}">
|
|
1347
|
+
<rect class="track" width="100%" height="${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f")}" fill="currentColor" />
|
|
1348
|
+
</g>` : svg`<path d="${path}" stroke="currentColor" stroke-width=${__classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f")} fill="none" stroke-linecap="round" />`}</svg>`;
|
|
1349
|
+
};
|
|
1350
|
+
_M3eLinearProgressIndicatorElement_renderResizeObservedElements = function _M3eLinearProgressIndicatorElement_renderResizeObservedElements() {
|
|
1351
|
+
return html`<div class="stroke" aria-hidden="true"></div><div class="amplitude-and-wavelength" aria-hidden="true"></div>`;
|
|
1352
|
+
};
|
|
1353
|
+
_M3eLinearProgressIndicatorElement_updateStroke = function _M3eLinearProgressIndicatorElement_updateStroke() {
|
|
1354
|
+
const element = this.shadowRoot?.querySelector(".stroke");
|
|
1355
|
+
if (element) {
|
|
1356
|
+
__classPrivateFieldSet(this, _M3eLinearProgressIndicatorElement_strokeWidth, element.clientHeight, "f");
|
|
640
1357
|
}
|
|
641
1358
|
};
|
|
642
|
-
|
|
643
|
-
|
|
1359
|
+
_M3eLinearProgressIndicatorElement_updateAmplitudeAndWavelength = function _M3eLinearProgressIndicatorElement_updateAmplitudeAndWavelength() {
|
|
1360
|
+
const element = this.shadowRoot?.querySelector(".amplitude-and-wavelength");
|
|
1361
|
+
if (element) {
|
|
1362
|
+
__classPrivateFieldSet(this, _M3eLinearProgressIndicatorElement_amplitude, element.clientHeight, "f");
|
|
1363
|
+
__classPrivateFieldSet(this, _M3eLinearProgressIndicatorElement_wavelength, element.clientWidth, "f");
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
_M3eLinearProgressIndicatorElement_drawWavyPath = function _M3eLinearProgressIndicatorElement_drawWavyPath(width, phase = 0) {
|
|
1367
|
+
const amplitude = __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_amplitude, "f") + __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f") / 2;
|
|
1368
|
+
const y = amplitude;
|
|
1369
|
+
const path = [];
|
|
1370
|
+
const step = __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_wavelength, "f") / 2;
|
|
1371
|
+
let x = 0;
|
|
1372
|
+
path.push(`M ${x},${y}`);
|
|
1373
|
+
while (x <= width) {
|
|
1374
|
+
const endX = x + step;
|
|
1375
|
+
const endY = y + amplitude * Math.sin(2 * Math.PI * endX / __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_wavelength, "f") + phase);
|
|
1376
|
+
const cpX = x + step / 2;
|
|
1377
|
+
const cpY = y + amplitude * Math.sin(2 * Math.PI * (x + step / 2) / __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_wavelength, "f") + phase);
|
|
1378
|
+
path.push(`Q ${cpX},${cpY} ${endX},${endY}`);
|
|
1379
|
+
x += step;
|
|
1380
|
+
}
|
|
1381
|
+
const padding = 1;
|
|
1382
|
+
const viewBox = `0 ${-padding} ${width} ${amplitude * 2 + padding * 2}`;
|
|
1383
|
+
return {
|
|
1384
|
+
path: path.join(" "),
|
|
1385
|
+
viewBox,
|
|
1386
|
+
height: __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_strokeWidth, "f") + __classPrivateFieldGet(this, _M3eLinearProgressIndicatorElement_amplitude, "f") * 2,
|
|
1387
|
+
padding
|
|
1388
|
+
};
|
|
1389
|
+
};
|
|
644
1390
|
/** The styles of the element. */
|
|
645
|
-
M3eLinearProgressIndicatorElement.styles = [ProgressElementIndicatorBase.styles, css`:host { display: block; height: var(--m3e-linear-progress-indicator-
|
|
1391
|
+
M3eLinearProgressIndicatorElement.styles = [ProgressElementIndicatorBase.styles, css`:host { display: block; position: relative; } .progress { width: 100%; height: 100%; position: relative; align-items: center; border-radius: var(--m3e-linear-progress-indicator-shape, ${DesignToken.shape.corner.extraSmall}); } .stroke, .amplitude-and-wavelength { visibility: hidden; position: absolute; } .stroke { width: 100%; height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); } .amplitude-and-wavelength { height: var(--m3e-linear-wavy-progress-indicator-amplitude, 0.1875rem); width: var(--m3e-linear-wavy-progress-indicator-wavelength, 2.5rem); } :host([mode="indeterminate"]) .amplitude-and-wavelength, :host([mode="query"]) .amplitude-and-wavelength { width: var(--m3e-linear-wavy-indeterminate-progress-indicator-wavelength, 1.5rem); } .primary, .secondary, .stop { height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); border-radius: inherit; } .stop { aspect-ratio: 1; flex: none; } :host([variant="flat"]) { height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); } :host([variant="wavy"]) { height: calc( var(--m3e-linear-progress-indicator-thickness, 0.25rem) + calc(var(--m3e-linear-wavy-progress-indicator-amplitude, 0.1875rem) * 2) ); } :host([variant="wavy"]) .primary, :host([variant="wavy"]) .secondary { position: relative; height: 100%; overflow: hidden; } :host([variant="wavy"]) .complete { position: absolute; margin: auto; top: calc(50% - calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) / 2)); left: 0; right: 0; height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); border-radius: inherit; } :host([variant="wavy"]) .secondary { height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); } .wave { position: absolute; display: block; } .primary .wave, .secondary .wave { margin-inline-start: calc(0px - var(--m3e-linear-wavy-progress-indicator-wavelength, 2.5rem)); } :host([variant="wavy"][mode="determinate"]) .primary path, :host([variant="wavy"][mode="buffer"]) .primary path { animation: wave-slide 1.5s linear infinite; } @keyframes wave-slide { from { transform: translateX(0); } to { transform: translateX(calc(0px - var(--m3e-linear-wavy-progress-indicator-wavelength, 2.5rem))); } } :host([mode="determinate"]) .progress, :host([mode="buffer"]) .progress { display: flex; overflow: hidden; } :host([mode="determinate"]) .primary, :host([mode="buffer"]) .primary { width: var(--_value, 0px); flex: none; } :host([mode="determinate"]) .gap, :host([mode="buffer"]) .gap { flex-basis: var(--m3e-linear-progress-indicator-thickness, 0.25rem); flex-shrink: 1; } :host([mode="determinate"]) .secondary, :host([mode="buffer"]) .buffer { flex: 1 1 auto; } :host([mode="buffer"]) .buffer { flex-shrink: 5; height: 100%; width: 100%; background-color: var(--m3e-progress-indicator-track-color, ${DesignToken.color.secondaryContainer}); mask-image: radial-gradient( circle, black 0, black calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) / 2), transparent calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) / 2) ); mask-size: calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) * 2) 100%; mask-repeat: repeat; animation: buffer 250ms linear infinite; } :host(:dir(rtl)[mode="buffer"]) .buffer { transform: scaleX(-1); } @keyframes buffer { from { mask-position: 0 0; } to { mask-position: calc(-1 * calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) * 2)) 0; } } :host([mode="buffer"]) .secondary { width: var(--_buffer-value, 0px); flex: none; } :host([mode="indeterminate"]) .primary, :host([mode="query"]) .primary { position: absolute; top: 0; height: 100%; border-radius: inherit; animation: indeterminate-primary 2.1s infinite linear; } :host([variant="wavy"][mode="indeterminate"]) .primary, :host([variant="wavy"][mode="query"]) .primary { animation-name: wavy-indeterminate-primary; } :host([mode="indeterminate"]) .secondary, :host([mode="query"]) .secondary { position: absolute; top: 0; height: 100%; border-radius: inherit; animation: indeterminate-secondary 2.1s infinite linear; animation-delay: 1.15s; animation-fill-mode: backwards; } :host([variant="wavy"][mode="indeterminate"]) .secondary, :host([variant="wavy"][mode="query"]) .secondary { animation-name: wavy-indeterminate-secondary; } :host([mode="indeterminate"]) .progress, :host([mode="query"]) .progress { overflow: hidden; position: relative; } :host(:not(:dir(rtl))[mode="query"]) .progress, :host(:dir(rtl)[mode="indeterminate"]) .progress { transform: scaleX(-1); } :host([variant="flat"]) .primary, :host([variant="flat"][mode="indeterminate"]) .secondary, :host([variant="flat"][mode="query"]) .secondary, :host([variant="wavy"]) .complete, .stop { background-color: var(--m3e-progress-indicator-color, ${DesignToken.color.primary}); } :host([variant="wavy"]) .progress { color: var(--m3e-progress-indicator-color, ${DesignToken.color.primary}); } :host([mode="determinate"]) .secondary, :host([mode="buffer"]) .secondary, :host([variant="flat"][mode="indeterminate"]) .track, :host([variant="flat"][mode="query"]) .track { background-color: var(--m3e-progress-indicator-track-color, ${DesignToken.color.secondaryContainer}); } :host([variant="wavy"][mode="indeterminate"]) .track, :host([variant="wavy"][mode="query"]) .track { color: var(--m3e-progress-indicator-track-color, ${DesignToken.color.secondaryContainer}); } :host([variant="wavy"][mode="indeterminate"]) .track, :host([variant="wavy"][mode="query"]) .track { y: calc(50% - calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) / 2)); border-radius: inherit; } :host([variant="flat"][mode="indeterminate"]) .track, :host([variant="flat"][mode="query"]) .track { position: absolute; margin: auto; top: calc(50% - calc(var(--m3e-linear-progress-indicator-thickness, 0.25rem) / 2)); left: 0; right: 0; height: var(--m3e-linear-progress-indicator-thickness, 0.25rem); border-radius: inherit; } @keyframes indeterminate-primary { 0% { left: -145.167%; width: 8%; } 20% { left: -113.333%; width: 48%; } 60% { left: 56.333%; width: 78%; } 100% { left: 100%; width: 8%; } } @keyframes indeterminate-secondary { 0% { left: -54.888%; width: 8%; } 20% { left: -20%; width: 48%; } 60% { left: 60%; width: 78%; } 100% { left: 160%; width: 8%; } } @keyframes wavy-indeterminate-primary { 0% { transform: translateX(-145.167%); width: 8%; } 20% { transform: translateX(-113.333%); width: 48%; } 60% { transform: translateX(56.333%); width: 78%; } 100% { transform: translateX(100%); width: 8%; } } @keyframes wavy-indeterminate-secondary { 0% { transform: translateX(-54.888%); width: 8%; } 20% { transform: translateX(-20%); width: 48%; } 60% { transform: translateX(60%); width: 78%; } 100% { transform: translateX(160%); width: 8%; } } @media (forced-colors: active) { .progress { --m3e-progress-indicator-track-color: GrayText; --m3e-progress-indicator-color: CanvasText; } }`];
|
|
646
1392
|
/** @private */
|
|
647
|
-
M3eLinearProgressIndicatorElement.
|
|
648
|
-
__decorate([n({
|
|
1393
|
+
M3eLinearProgressIndicatorElement.__nextMaskId = 0;
|
|
1394
|
+
__decorate([n$1({
|
|
649
1395
|
reflect: true
|
|
650
1396
|
})], M3eLinearProgressIndicatorElement.prototype, "mode", void 0);
|
|
651
|
-
__decorate([n({
|
|
1397
|
+
__decorate([n$1({
|
|
652
1398
|
attribute: "buffer-value",
|
|
653
1399
|
type: Number,
|
|
654
1400
|
reflect: true
|
|
655
1401
|
})], M3eLinearProgressIndicatorElement.prototype, "bufferValue", void 0);
|
|
656
|
-
M3eLinearProgressIndicatorElement = M3eLinearProgressIndicatorElement_1 = __decorate([t$
|
|
1402
|
+
M3eLinearProgressIndicatorElement = M3eLinearProgressIndicatorElement_1 = __decorate([t$3("m3e-linear-progress-indicator")], M3eLinearProgressIndicatorElement);
|
|
657
1403
|
|
|
658
1404
|
export { M3eCircularProgressIndicatorElement, M3eLinearProgressIndicatorElement, ProgressElementIndicatorBase };
|
|
659
1405
|
//# sourceMappingURL=index.js.map
|