@cal.macconnachie/web-components 0.0.20 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/components/{auth.js → auth-form.js} +689 -805
- package/dist/components/base-button.js +894 -0
- package/dist/components/base-card.js +879 -0
- package/dist/components/base-date-picker.js +1458 -0
- package/dist/components/base-datetime-picker.js +1697 -0
- package/dist/components/base-drawer.js +1300 -0
- package/dist/components/base-input.js +883 -0
- package/dist/components/base-select.js +1076 -0
- package/dist/components/base-tab.js +653 -0
- package/dist/components/base-tabs.js +1246 -0
- package/dist/components/base-textarea.js +921 -0
- package/dist/components/base-time-picker.js +1141 -0
- package/dist/components/favicon.ico +0 -0
- package/dist/components/index.d.ts +399 -33
- package/dist/components/quantity-select.js +859 -0
- package/dist/components/theme-toggle.js +185 -165
- package/dist/favicon.ico +0 -0
- package/dist/index.d.ts +399 -33
- package/dist/index.js +7365 -2352
- package/dist/stylesheets/main.css +1 -1
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
1
|
+
const U = globalThis, L = U.ShadowRoot && (U.ShadyCSS === void 0 || U.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, B = Symbol(), G = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let it = class {
|
|
3
3
|
constructor(t, e, s) {
|
|
4
|
-
if (this._$cssResult$ = !0, s !==
|
|
4
|
+
if (this._$cssResult$ = !0, s !== B) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
5
5
|
this.cssText = t, this.t = e;
|
|
6
6
|
}
|
|
7
7
|
get styleSheet() {
|
|
@@ -9,7 +9,7 @@ let st = class {
|
|
|
9
9
|
const e = this.t;
|
|
10
10
|
if (L && t === void 0) {
|
|
11
11
|
const s = e !== void 0 && e.length === 1;
|
|
12
|
-
s && (t =
|
|
12
|
+
s && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && G.set(e, t));
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
@@ -17,28 +17,28 @@ let st = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = r.length === 1 ? r[0] : t.reduce(((s, i,
|
|
22
|
-
if (
|
|
23
|
-
if (typeof
|
|
24
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
25
|
-
})(i) + r[
|
|
26
|
-
return new
|
|
27
|
-
},
|
|
20
|
+
const lt = (r) => new it(typeof r == "string" ? r : r + "", void 0, B), ct = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce(((s, i, n) => s + ((o) => {
|
|
22
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
|
+
if (typeof o == "number") return o;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(i) + r[n + 1]), r[0]);
|
|
26
|
+
return new it(e, r, B);
|
|
27
|
+
}, dt = (r, t) => {
|
|
28
28
|
if (L) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
29
29
|
else for (const e of t) {
|
|
30
|
-
const s = document.createElement("style"), i =
|
|
30
|
+
const s = document.createElement("style"), i = U.litNonce;
|
|
31
31
|
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
|
|
32
32
|
}
|
|
33
33
|
}, J = L ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return lt(e);
|
|
37
37
|
})(r) : r;
|
|
38
|
-
const { is:
|
|
38
|
+
const { is: pt, defineProperty: ut, getOwnPropertyDescriptor: mt, getOwnPropertyNames: $t, getOwnPropertySymbols: gt, getPrototypeOf: ft } = Object, z = globalThis, Z = z.trustedTypes, _t = Z ? Z.emptyScript : "", bt = z.reactiveElementPolyfillSupport, S = (r, t) => r, M = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
40
40
|
case Boolean:
|
|
41
|
-
r = r ?
|
|
41
|
+
r = r ? _t : null;
|
|
42
42
|
break;
|
|
43
43
|
case Object:
|
|
44
44
|
case Array:
|
|
@@ -63,8 +63,8 @@ const { is: ct, defineProperty: dt, getOwnPropertyDescriptor: pt, getOwnProperty
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return e;
|
|
66
|
-
} },
|
|
67
|
-
Symbol.metadata ??= Symbol("metadata"),
|
|
66
|
+
} }, I = (r, t) => !pt(r, t), F = { attribute: !0, type: String, converter: M, reflect: !1, useDefault: !1, hasChanged: I };
|
|
67
|
+
Symbol.metadata ??= Symbol("metadata"), z.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
68
|
let b = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
@@ -75,32 +75,32 @@ let b = class extends HTMLElement {
|
|
|
75
75
|
static createProperty(t, e = F) {
|
|
76
76
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
77
|
const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
|
|
78
|
-
i !== void 0 &&
|
|
78
|
+
i !== void 0 && ut(this.prototype, t, i);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: i, set:
|
|
82
|
+
const { get: i, set: n } = mt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
|
-
}, set(
|
|
85
|
-
this[e] =
|
|
84
|
+
}, set(o) {
|
|
85
|
+
this[e] = o;
|
|
86
86
|
} };
|
|
87
|
-
return { get: i, set(
|
|
87
|
+
return { get: i, set(o) {
|
|
88
88
|
const h = i?.call(this);
|
|
89
|
-
|
|
89
|
+
n?.call(this, o), this.requestUpdate(t, h, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
93
93
|
return this.elementProperties.get(t) ?? F;
|
|
94
94
|
}
|
|
95
95
|
static _$Ei() {
|
|
96
|
-
if (this.hasOwnProperty(
|
|
97
|
-
const t =
|
|
96
|
+
if (this.hasOwnProperty(S("elementProperties"))) return;
|
|
97
|
+
const t = ft(this);
|
|
98
98
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
99
99
|
}
|
|
100
100
|
static finalize() {
|
|
101
|
-
if (this.hasOwnProperty(
|
|
102
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
103
|
-
const e = this.properties, s = [
|
|
101
|
+
if (this.hasOwnProperty(S("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(S("properties"))) {
|
|
103
|
+
const e = this.properties, s = [...$t(e), ...gt(e)];
|
|
104
104
|
for (const i of s) this.createProperty(i, e[i]);
|
|
105
105
|
}
|
|
106
106
|
const t = this[Symbol.metadata];
|
|
@@ -146,7 +146,7 @@ let b = class extends HTMLElement {
|
|
|
146
146
|
}
|
|
147
147
|
createRenderRoot() {
|
|
148
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
149
|
-
return
|
|
149
|
+
return dt(t, this.constructor.elementStyles), t;
|
|
150
150
|
}
|
|
151
151
|
connectedCallback() {
|
|
152
152
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
@@ -162,29 +162,29 @@ let b = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
164
164
|
if (i !== void 0 && s.reflect === !0) {
|
|
165
|
-
const
|
|
166
|
-
this._$Em = t,
|
|
165
|
+
const n = (s.converter?.toAttribute !== void 0 ? s.converter : M).toAttribute(e, s.type);
|
|
166
|
+
this._$Em = t, n == null ? this.removeAttribute(i) : this.setAttribute(i, n), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
171
171
|
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
-
const
|
|
172
|
+
const n = s.getPropertyOptions(i), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : M;
|
|
173
173
|
this._$Em = i;
|
|
174
|
-
const h =
|
|
174
|
+
const h = o.fromAttribute(e, n.type);
|
|
175
175
|
this[i] = h ?? this._$Ej?.get(i) ?? h, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
requestUpdate(t, e, s) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
|
-
const i = this.constructor,
|
|
181
|
-
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ??
|
|
180
|
+
const i = this.constructor, n = this[t];
|
|
181
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? I)(n, e) || s.useDefault && s.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect: i, wrapped:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
186
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let b = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [i,
|
|
206
|
+
for (const [i, n] of this._$Ep) this[i] = n;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [i,
|
|
211
|
-
const { wrapped:
|
|
212
|
-
|
|
210
|
+
if (s.size > 0) for (const [i, n] of s) {
|
|
211
|
+
const { wrapped: o } = n, h = this[i];
|
|
212
|
+
o !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, n, h);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,70 +246,70 @@ let b = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[
|
|
250
|
-
const V = globalThis,
|
|
251
|
-
\f\r]`,
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
253
|
-
function
|
|
249
|
+
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[S("elementProperties")] = /* @__PURE__ */ new Map(), b[S("finalized")] = /* @__PURE__ */ new Map(), bt?.({ ReactiveElement: b }), (z.reactiveElementVersions ??= []).push("2.1.1");
|
|
250
|
+
const V = globalThis, H = V.trustedTypes, Q = H ? H.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, rt = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, nt = "?" + $, yt = `<${nt}>`, _ = document, C = () => _.createComment(""), P = (r) => r === null || typeof r != "object" && typeof r != "function", q = Array.isArray, vt = (r) => q(r) || typeof r?.[Symbol.iterator] == "function", D = `[
|
|
251
|
+
\f\r]`, E = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, g = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, ot = /^(?:script|style|textarea|title)$/i, At = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), j = At(1), y = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), f = _.createTreeWalker(_, 129);
|
|
253
|
+
function at(r, t) {
|
|
254
254
|
if (!q(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
|
-
return
|
|
255
|
+
return Q !== void 0 ? Q.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Et = (r, t) => {
|
|
258
258
|
const e = r.length - 1, s = [];
|
|
259
|
-
let i,
|
|
259
|
+
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = E;
|
|
260
260
|
for (let h = 0; h < e; h++) {
|
|
261
261
|
const a = r[h];
|
|
262
262
|
let c, p, l = -1, u = 0;
|
|
263
|
-
for (; u < a.length && (
|
|
264
|
-
const
|
|
265
|
-
|
|
263
|
+
for (; u < a.length && (o.lastIndex = u, p = o.exec(a), p !== null); ) u = o.lastIndex, o === E ? p[1] === "!--" ? o = X : p[1] !== void 0 ? o = Y : p[2] !== void 0 ? (ot.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = g) : p[3] !== void 0 && (o = g) : o === g ? p[0] === ">" ? (o = i ?? E, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? g : p[3] === '"' ? et : tt) : o === et || o === tt ? o = g : o === X || o === Y ? o = E : (o = g, i = void 0);
|
|
264
|
+
const m = o === g && r[h + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
n += o === E ? a + yt : l >= 0 ? (s.push(c), a.slice(0, l) + rt + a.slice(l) + $ + m) : a + $ + (l === -2 ? h : m);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [at(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
269
|
class k {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
271
|
let i;
|
|
272
272
|
this.parts = [];
|
|
273
|
-
let
|
|
274
|
-
const h = t.length - 1, a = this.parts, [c, p] =
|
|
275
|
-
if (this.el = k.createElement(c, s),
|
|
273
|
+
let n = 0, o = 0;
|
|
274
|
+
const h = t.length - 1, a = this.parts, [c, p] = Et(t, e);
|
|
275
|
+
if (this.el = k.createElement(c, s), f.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const l = this.el.content.firstChild;
|
|
277
277
|
l.replaceWith(...l.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (i =
|
|
279
|
+
for (; (i = f.nextNode()) !== null && a.length < h; ) {
|
|
280
280
|
if (i.nodeType === 1) {
|
|
281
|
-
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(
|
|
282
|
-
const u = p[
|
|
283
|
-
a.push({ type: 1, index:
|
|
284
|
-
} else l.startsWith(
|
|
281
|
+
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(rt)) {
|
|
282
|
+
const u = p[o++], m = i.getAttribute(l).split($), O = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
a.push({ type: 1, index: n, name: O[2], strings: m, ctor: O[1] === "." ? wt : O[1] === "?" ? Ct : O[1] === "@" ? Pt : N }), i.removeAttribute(l);
|
|
284
|
+
} else l.startsWith($) && (a.push({ type: 6, index: n }), i.removeAttribute(l));
|
|
285
285
|
if (ot.test(i.tagName)) {
|
|
286
|
-
const l = i.textContent.split(
|
|
286
|
+
const l = i.textContent.split($), u = l.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
|
-
i.textContent =
|
|
289
|
-
for (let
|
|
290
|
-
i.append(l[u],
|
|
288
|
+
i.textContent = H ? H.emptyScript : "";
|
|
289
|
+
for (let m = 0; m < u; m++) i.append(l[m], C()), f.nextNode(), a.push({ type: 2, index: ++n });
|
|
290
|
+
i.append(l[u], C());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (i.nodeType === 8) if (i.data ===
|
|
293
|
+
} else if (i.nodeType === 8) if (i.data === nt) a.push({ type: 2, index: n });
|
|
294
294
|
else {
|
|
295
295
|
let l = -1;
|
|
296
|
-
for (; (l = i.data.indexOf(
|
|
296
|
+
for (; (l = i.data.indexOf($, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += $.length - 1;
|
|
297
297
|
}
|
|
298
|
-
|
|
298
|
+
n++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
302
|
-
const s =
|
|
302
|
+
const s = _.createElement("template");
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
if (t ===
|
|
306
|
+
function v(r, t, e = r, s) {
|
|
307
|
+
if (t === y) return t;
|
|
308
308
|
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
-
const
|
|
310
|
-
return i?.constructor !==
|
|
309
|
+
const n = P(t) ? void 0 : t._$litDirective$;
|
|
310
|
+
return i?.constructor !== n && (i?._$AO?.(!1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = v(r, i._$AS(r, t.values), i, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class St {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -320,24 +320,24 @@ class At {
|
|
|
320
320
|
return this._$AM._$AU;
|
|
321
321
|
}
|
|
322
322
|
u(t) {
|
|
323
|
-
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ??
|
|
324
|
-
|
|
325
|
-
let
|
|
323
|
+
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? _).importNode(e, !0);
|
|
324
|
+
f.currentNode = i;
|
|
325
|
+
let n = f.nextNode(), o = 0, h = 0, a = s[0];
|
|
326
326
|
for (; a !== void 0; ) {
|
|
327
|
-
if (
|
|
327
|
+
if (o === a.index) {
|
|
328
328
|
let c;
|
|
329
|
-
a.type === 2 ? c = new
|
|
329
|
+
a.type === 2 ? c = new x(n, n.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (c = new kt(n, this, t)), this._$AV.push(c), a = s[++h];
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
o !== a?.index && (n = f.nextNode(), o++);
|
|
332
332
|
}
|
|
333
|
-
return
|
|
333
|
+
return f.currentNode = _, i;
|
|
334
334
|
}
|
|
335
335
|
p(t) {
|
|
336
336
|
let e = 0;
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class x {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class O {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = v(this, t, e), P(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== y && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : vt(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -365,25 +365,25 @@ class O {
|
|
|
365
365
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
366
366
|
}
|
|
367
367
|
_(t) {
|
|
368
|
-
this._$AH !== d &&
|
|
368
|
+
this._$AH !== d && P(this._$AH) ? this._$AA.nextSibling.data = t : this.T(_.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(
|
|
371
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(at(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const n = new St(i, this), o = n.u(this.options);
|
|
375
|
+
n.p(e), this.T(o), this._$AH = n;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
|
-
let e =
|
|
380
|
-
return e === void 0 &&
|
|
379
|
+
let e = st.get(t.strings);
|
|
380
|
+
return e === void 0 && st.set(t.strings, e = new k(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
383
|
q(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, i = 0;
|
|
386
|
-
for (const
|
|
386
|
+
for (const n of t) i === e.length ? e.push(s = new x(this.O(C()), this.O(C()), this, this.options)) : s = e[i], s._$AI(n), i++;
|
|
387
387
|
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -396,32 +396,32 @@ class O {
|
|
|
396
396
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
class
|
|
399
|
+
class N {
|
|
400
400
|
get tagName() {
|
|
401
401
|
return this.element.tagName;
|
|
402
402
|
}
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s, i,
|
|
407
|
-
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options =
|
|
406
|
+
constructor(t, e, s, i, n) {
|
|
407
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
|
408
408
|
}
|
|
409
409
|
_$AI(t, e = this, s, i) {
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
if (
|
|
410
|
+
const n = this.strings;
|
|
411
|
+
let o = !1;
|
|
412
|
+
if (n === void 0) t = v(this, t, e, 0), o = !P(t) || t !== this._$AH && t !== y, o && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
414
|
const h = t;
|
|
415
415
|
let a, c;
|
|
416
|
-
for (t =
|
|
416
|
+
for (t = n[0], a = 0; a < n.length - 1; a++) c = v(this, h[s + a], e, a), c === y && (c = this._$AH[a]), o ||= !P(c) || c !== this._$AH[a], c === d ? t = d : t !== d && (t += (c ?? "") + n[a + 1]), this._$AH[a] = c;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
o && !i && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
class
|
|
424
|
+
class wt extends N {
|
|
425
425
|
constructor() {
|
|
426
426
|
super(...arguments), this.type = 3;
|
|
427
427
|
}
|
|
@@ -429,7 +429,7 @@ class Et extends R {
|
|
|
429
429
|
this.element[this.name] = t === d ? void 0 : t;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
class
|
|
432
|
+
class Ct extends N {
|
|
433
433
|
constructor() {
|
|
434
434
|
super(...arguments), this.type = 4;
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ class St extends R {
|
|
|
437
437
|
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
class
|
|
441
|
-
constructor(t, e, s, i,
|
|
442
|
-
super(t, e, s, i,
|
|
440
|
+
class Pt extends N {
|
|
441
|
+
constructor(t, e, s, i, n) {
|
|
442
|
+
super(t, e, s, i, n), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
|
|
447
|
-
i && this.element.removeEventListener(this.name, this, s),
|
|
445
|
+
if ((t = v(this, t, e, 0) ?? d) === y) return;
|
|
446
|
+
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
|
|
447
|
+
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class kt {
|
|
454
454
|
constructor(t, e, s) {
|
|
455
455
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
|
|
456
456
|
}
|
|
@@ -458,22 +458,22 @@ class Ct {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
v(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const
|
|
464
|
+
const xt = V.litHtmlPolyfillSupport;
|
|
465
|
+
xt?.(k, x), (V.litHtmlVersions ??= []).push("3.3.1");
|
|
466
|
+
const Tt = (r, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let i = s._$litPart$;
|
|
469
469
|
if (i === void 0) {
|
|
470
|
-
const
|
|
471
|
-
s._$litPart$ = i = new
|
|
470
|
+
const n = e?.renderBefore ?? null;
|
|
471
|
+
s._$litPart$ = i = new x(t.insertBefore(C(), n), n, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return i._$AI(r), i;
|
|
474
474
|
};
|
|
475
475
|
const W = globalThis;
|
|
476
|
-
class
|
|
476
|
+
class w extends b {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -483,7 +483,7 @@ class C extends b {
|
|
|
483
483
|
}
|
|
484
484
|
update(t) {
|
|
485
485
|
const e = this.render();
|
|
486
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
486
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Tt(e, this.renderRoot, this.renderOptions);
|
|
487
487
|
}
|
|
488
488
|
connectedCallback() {
|
|
489
489
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -492,61 +492,68 @@ class C extends b {
|
|
|
492
492
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
493
493
|
}
|
|
494
494
|
render() {
|
|
495
|
-
return
|
|
495
|
+
return y;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
498
|
+
w._$litElement$ = !0, w.finalized = !0, W.litElementHydrateSupport?.({ LitElement: w });
|
|
499
|
+
const Ot = W.litElementPolyfillSupport;
|
|
500
|
+
Ot?.({ LitElement: w });
|
|
501
501
|
(W.litElementVersions ??= []).push("4.2.1");
|
|
502
|
-
const
|
|
502
|
+
const Ut = (r) => (t, e) => {
|
|
503
503
|
e !== void 0 ? e.addInitializer((() => {
|
|
504
504
|
customElements.define(r, t);
|
|
505
505
|
})) : customElements.define(r, t);
|
|
506
506
|
};
|
|
507
|
-
const
|
|
507
|
+
const Mt = { attribute: !0, type: String, converter: M, reflect: !1, hasChanged: I }, Ht = (r = Mt, t, e) => {
|
|
508
508
|
const { kind: s, metadata: i } = e;
|
|
509
|
-
let
|
|
510
|
-
if (
|
|
511
|
-
const { name:
|
|
509
|
+
let n = globalThis.litPropertyMetadata.get(i);
|
|
510
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
|
|
511
|
+
const { name: o } = e;
|
|
512
512
|
return { set(h) {
|
|
513
513
|
const a = t.get.call(this);
|
|
514
|
-
t.set.call(this, h), this.requestUpdate(
|
|
514
|
+
t.set.call(this, h), this.requestUpdate(o, a, r);
|
|
515
515
|
}, init(h) {
|
|
516
|
-
return h !== void 0 && this.C(
|
|
516
|
+
return h !== void 0 && this.C(o, void 0, r, h), h;
|
|
517
517
|
} };
|
|
518
518
|
}
|
|
519
519
|
if (s === "setter") {
|
|
520
|
-
const { name:
|
|
520
|
+
const { name: o } = e;
|
|
521
521
|
return function(h) {
|
|
522
|
-
const a = this[
|
|
523
|
-
t.call(this, h), this.requestUpdate(
|
|
522
|
+
const a = this[o];
|
|
523
|
+
t.call(this, h), this.requestUpdate(o, a, r);
|
|
524
524
|
};
|
|
525
525
|
}
|
|
526
526
|
throw Error("Unsupported decorator location: " + s);
|
|
527
527
|
};
|
|
528
|
-
function
|
|
529
|
-
return (t, e) => typeof e == "object" ?
|
|
530
|
-
const
|
|
531
|
-
return i.constructor.createProperty(
|
|
528
|
+
function T(r) {
|
|
529
|
+
return (t, e) => typeof e == "object" ? Ht(r, t, e) : ((s, i, n) => {
|
|
530
|
+
const o = i.hasOwnProperty(n);
|
|
531
|
+
return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
|
|
532
532
|
})(r, t, e);
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
return
|
|
534
|
+
function zt(r) {
|
|
535
|
+
return T({ ...r, state: !0, attribute: !1 });
|
|
536
536
|
}
|
|
537
|
-
var
|
|
538
|
-
for (var i =
|
|
539
|
-
(
|
|
540
|
-
return
|
|
537
|
+
var Nt = Object.defineProperty, ht = (r, t, e, s) => {
|
|
538
|
+
for (var i = void 0, n = r.length - 1, o; n >= 0; n--)
|
|
539
|
+
(o = r[n]) && (i = o(t, e, i) || i);
|
|
540
|
+
return i && Nt(t, e, i), i;
|
|
541
541
|
};
|
|
542
|
-
|
|
542
|
+
class K extends w {
|
|
543
543
|
constructor() {
|
|
544
|
-
super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.
|
|
544
|
+
super(...arguments), this.theme = "light", this.storageKey = "theme-preference", this.boundThemeChangeHandler = this.handleGlobalThemeChange.bind(this);
|
|
545
545
|
}
|
|
546
546
|
connectedCallback() {
|
|
547
547
|
super.connectedCallback();
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const t = document.documentElement.getAttribute("data-theme"), e = localStorage.getItem(this.storageKey), s = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
549
|
+
t ? this.theme = t : e ? (this.theme = e, this.applyTheme()) : s ? (this.theme = "dark", this.applyTheme()) : this.applyTheme(), window.addEventListener("theme-changed", this.boundThemeChangeHandler);
|
|
550
|
+
}
|
|
551
|
+
disconnectedCallback() {
|
|
552
|
+
window.removeEventListener("theme-changed", this.boundThemeChangeHandler), super.disconnectedCallback();
|
|
553
|
+
}
|
|
554
|
+
handleGlobalThemeChange(t) {
|
|
555
|
+
const e = t;
|
|
556
|
+
e.target !== this && e.detail.theme !== this.theme && (this.theme = e.detail.theme);
|
|
550
557
|
}
|
|
551
558
|
applyTheme() {
|
|
552
559
|
document.documentElement.setAttribute("data-theme", this.theme), localStorage.setItem(this.storageKey, this.theme), this.dispatchEvent(
|
|
@@ -557,8 +564,27 @@ let g = class extends C {
|
|
|
557
564
|
})
|
|
558
565
|
);
|
|
559
566
|
}
|
|
567
|
+
}
|
|
568
|
+
ht([
|
|
569
|
+
T({ type: String, attribute: "data-theme", reflect: !0 })
|
|
570
|
+
], K.prototype, "theme");
|
|
571
|
+
ht([
|
|
572
|
+
T({ type: String, attribute: "storage-key" })
|
|
573
|
+
], K.prototype, "storageKey");
|
|
574
|
+
var Rt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, R = (r, t, e, s) => {
|
|
575
|
+
for (var i = s > 1 ? void 0 : s ? Dt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
|
576
|
+
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
|
|
577
|
+
return s && i && Rt(t, e, i), i;
|
|
578
|
+
};
|
|
579
|
+
let A = class extends K {
|
|
580
|
+
constructor() {
|
|
581
|
+
super(...arguments), this.size = "sm", this.variant = "ghost", this.isDark = !1;
|
|
582
|
+
}
|
|
583
|
+
connectedCallback() {
|
|
584
|
+
super.connectedCallback(), this.isDark = this.theme === "dark";
|
|
585
|
+
}
|
|
560
586
|
toggleTheme() {
|
|
561
|
-
this.theme = this.isDark ? "light" : "dark", this.isDark = !this.isDark,
|
|
587
|
+
this.theme = this.isDark ? "light" : "dark", this.isDark = !this.isDark, super.applyTheme();
|
|
562
588
|
}
|
|
563
589
|
getSizeClass() {
|
|
564
590
|
const r = {
|
|
@@ -614,7 +640,7 @@ let g = class extends C {
|
|
|
614
640
|
`;
|
|
615
641
|
}
|
|
616
642
|
};
|
|
617
|
-
|
|
643
|
+
A.styles = ct`
|
|
618
644
|
:host {
|
|
619
645
|
display: inline-block;
|
|
620
646
|
}
|
|
@@ -764,24 +790,18 @@ g.styles = ht`
|
|
|
764
790
|
}
|
|
765
791
|
}
|
|
766
792
|
`;
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
],
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
],
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
],
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
],
|
|
779
|
-
E([
|
|
780
|
-
Mt()
|
|
781
|
-
], g.prototype, "isDark", 2);
|
|
782
|
-
g = E([
|
|
783
|
-
Ot("theme-toggle")
|
|
784
|
-
], g);
|
|
793
|
+
R([
|
|
794
|
+
T({ type: String, attribute: "size" })
|
|
795
|
+
], A.prototype, "size", 2);
|
|
796
|
+
R([
|
|
797
|
+
T({ type: String, attribute: "variant" })
|
|
798
|
+
], A.prototype, "variant", 2);
|
|
799
|
+
R([
|
|
800
|
+
zt()
|
|
801
|
+
], A.prototype, "isDark", 2);
|
|
802
|
+
A = R([
|
|
803
|
+
Ut("theme-toggle")
|
|
804
|
+
], A);
|
|
785
805
|
export {
|
|
786
|
-
|
|
806
|
+
A as ThemeToggle
|
|
787
807
|
};
|