@iyulab/u-widgets 0.6.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/u-widgets-charts.d.ts +1 -1
- package/dist/u-widgets-charts.js +178 -157
- package/dist/u-widgets-charts.js.map +1 -1
- package/dist/u-widgets.js +303 -285
- package/dist/u-widgets.js.map +1 -1
- package/package.json +1 -1
package/dist/u-widgets.js
CHANGED
|
@@ -3,7 +3,7 @@ import { p as Nt, r as Ft } from "./formdown-BWJ6QGJs.js";
|
|
|
3
3
|
import { i as we } from "./infer-CNOiD2dS.js";
|
|
4
4
|
import { t as b, n as ye } from "./tokens-x1kDxgG8.js";
|
|
5
5
|
import { css as w, LitElement as y, nothing as l, html as o } from "lit";
|
|
6
|
-
import { property as
|
|
6
|
+
import { property as f, customElement as x, state as S } from "lit/decorators.js";
|
|
7
7
|
const xe = /* @__PURE__ */ new Set([
|
|
8
8
|
"text",
|
|
9
9
|
"email",
|
|
@@ -21,7 +21,7 @@ const xe = /* @__PURE__ */ new Set([
|
|
|
21
21
|
"range",
|
|
22
22
|
"radio",
|
|
23
23
|
"checkbox"
|
|
24
|
-
]),
|
|
24
|
+
]), le = 10, $e = /* @__PURE__ */ new Set([
|
|
25
25
|
"stat-group",
|
|
26
26
|
"table",
|
|
27
27
|
"list",
|
|
@@ -41,15 +41,15 @@ const xe = /* @__PURE__ */ new Set([
|
|
|
41
41
|
]), _e = /* @__PURE__ */ new Set(["metric", "gauge", "progress", "header", "code", "rating", "video"]);
|
|
42
42
|
function Y(e, t = 0) {
|
|
43
43
|
const a = [], r = [];
|
|
44
|
-
if (t >
|
|
45
|
-
return { valid: !1, errors: ["compose children exceed maximum nesting depth (" +
|
|
44
|
+
if (t > le)
|
|
45
|
+
return { valid: !1, errors: ["compose children exceed maximum nesting depth (" + le + ")"], warnings: r };
|
|
46
46
|
if (e == null || typeof e != "object")
|
|
47
47
|
return { valid: !1, errors: ["Spec must be a non-null object"], warnings: r };
|
|
48
48
|
const i = e;
|
|
49
49
|
if (typeof i.widget != "string" || i.widget.length === 0)
|
|
50
50
|
return a.push('Required field "widget" must be a non-empty string'), { valid: !1, errors: a, warnings: r };
|
|
51
51
|
const s = i.widget;
|
|
52
|
-
if (i.type !== void 0 && i.type !== "u-widget" && a.push('"type" must be "u-widget" if specified'), i.fields !== void 0 && i.formdown !== void 0 && a.push('"fields" and "formdown" are mutually exclusive'), i.data !== void 0 && ($e.has(s) && !Array.isArray(i.data) && a.push(`"${s}" expects "data" to be an array, got ${typeof i.data}`), _e.has(s) && (Array.isArray(i.data) || typeof i.data != "object") && a.push(`"${s}" expects "data" to be an object, got ${Array.isArray(i.data) ? "array" : typeof i.data}`)), s === "compose") {
|
|
52
|
+
if (t === 0 && i.type !== void 0 && i.type !== "u-widget" && a.push('"type" must be "u-widget" if specified'), i.fields !== void 0 && i.formdown !== void 0 && a.push('"fields" and "formdown" are mutually exclusive'), i.data !== void 0 && ($e.has(s) && !Array.isArray(i.data) && a.push(`"${s}" expects "data" to be an array, got ${typeof i.data}`), _e.has(s) && (Array.isArray(i.data) || typeof i.data != "object") && a.push(`"${s}" expects "data" to be an object, got ${Array.isArray(i.data) ? "array" : typeof i.data}`)), s === "compose") {
|
|
53
53
|
if (!Array.isArray(i.children))
|
|
54
54
|
a.push('"compose" widget requires a "children" array');
|
|
55
55
|
else
|
|
@@ -104,7 +104,7 @@ function ke(e) {
|
|
|
104
104
|
function Dt(e) {
|
|
105
105
|
return Y(e).valid;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const ce = ["B", "KB", "MB", "GB", "TB"], ze = /* @__PURE__ */ new Set([
|
|
108
108
|
"KRW",
|
|
109
109
|
"JPY",
|
|
110
110
|
"VND",
|
|
@@ -124,7 +124,7 @@ const se = ["B", "KB", "MB", "GB", "TB"], ze = /* @__PURE__ */ new Set([
|
|
|
124
124
|
"XOF",
|
|
125
125
|
"XPF"
|
|
126
126
|
]);
|
|
127
|
-
function
|
|
127
|
+
function he(e, t, a) {
|
|
128
128
|
if (e == null) return "";
|
|
129
129
|
const [r, i] = t?.split(":") ?? [];
|
|
130
130
|
switch (r) {
|
|
@@ -223,9 +223,9 @@ function Oe(e) {
|
|
|
223
223
|
if (isNaN(t)) return String(e);
|
|
224
224
|
const a = t < 0 ? "-" : "";
|
|
225
225
|
let r = Math.abs(t), i = 0;
|
|
226
|
-
for (; r >= 1024 && i <
|
|
226
|
+
for (; r >= 1024 && i < ce.length - 1; )
|
|
227
227
|
r /= 1024, i++;
|
|
228
|
-
return a + (i === 0 ? r : r.toFixed(1)) + " " +
|
|
228
|
+
return a + (i === 0 ? r : r.toFixed(1)) + " " + ce[i];
|
|
229
229
|
}
|
|
230
230
|
const Ee = [
|
|
231
231
|
"chart.bar",
|
|
@@ -298,7 +298,7 @@ function Le(e, t) {
|
|
|
298
298
|
}
|
|
299
299
|
return i[r];
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const K = {
|
|
302
302
|
// UI chrome
|
|
303
303
|
prev: "Prev",
|
|
304
304
|
next: "Next",
|
|
@@ -320,14 +320,14 @@ const R = {
|
|
|
320
320
|
invalidPattern: "{label} format is invalid"
|
|
321
321
|
}, L = /* @__PURE__ */ new Map();
|
|
322
322
|
function jt(e, t) {
|
|
323
|
-
L.set(e.toLowerCase(), { ...
|
|
323
|
+
L.set(e.toLowerCase(), { ...K, ...t });
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
if (!e) return
|
|
325
|
+
function me(e) {
|
|
326
|
+
if (!e) return K;
|
|
327
327
|
const t = e.toLowerCase();
|
|
328
328
|
if (L.has(t)) return L.get(t);
|
|
329
329
|
const a = t.split("-")[0];
|
|
330
|
-
return a !== t && L.has(a) ? L.get(a) :
|
|
330
|
+
return a !== t && L.has(a) ? L.get(a) : K;
|
|
331
331
|
}
|
|
332
332
|
function A(e, t) {
|
|
333
333
|
return e.replace(
|
|
@@ -336,30 +336,30 @@ function A(e, t) {
|
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
338
|
function Ot() {
|
|
339
|
-
return { ...
|
|
339
|
+
return { ...K };
|
|
340
340
|
}
|
|
341
|
-
let
|
|
341
|
+
let V;
|
|
342
342
|
function Et(e) {
|
|
343
|
-
|
|
343
|
+
V = e;
|
|
344
344
|
}
|
|
345
345
|
function Pt() {
|
|
346
|
-
return
|
|
346
|
+
return V;
|
|
347
347
|
}
|
|
348
348
|
function Ie(e) {
|
|
349
349
|
if (e) return e;
|
|
350
|
-
if (
|
|
350
|
+
if (V) return V;
|
|
351
351
|
if (typeof document < "u" && document.documentElement?.lang)
|
|
352
352
|
return document.documentElement.lang;
|
|
353
353
|
}
|
|
354
|
-
var Ne = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor,
|
|
354
|
+
var Ne = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, Z = (e, t, a, r) => {
|
|
355
355
|
for (var i = r > 1 ? void 0 : r ? Fe(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
356
356
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
357
357
|
return r && i && Ne(t, a, i), i;
|
|
358
358
|
};
|
|
359
|
-
function
|
|
359
|
+
function de(e, t) {
|
|
360
360
|
const a = e.value, r = e.format;
|
|
361
361
|
return {
|
|
362
|
-
value: r ?
|
|
362
|
+
value: r ? he(a, r, t) : a ?? 0,
|
|
363
363
|
label: e.label,
|
|
364
364
|
unit: e.unit,
|
|
365
365
|
prefix: e.prefix,
|
|
@@ -372,20 +372,20 @@ function ne(e, t) {
|
|
|
372
372
|
variant: e.variant
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
|
-
let
|
|
375
|
+
let I = class extends y {
|
|
376
376
|
constructor() {
|
|
377
|
-
super(...arguments), this.spec = null;
|
|
377
|
+
super(...arguments), this.spec = null, this.theme = null;
|
|
378
378
|
}
|
|
379
379
|
render() {
|
|
380
380
|
if (!this.spec?.data) return l;
|
|
381
381
|
const e = this.spec.options?.locale;
|
|
382
|
-
return this.spec.widget === "stat-group" ? this.renderStatGroup(e) : this.renderMetric(
|
|
382
|
+
return this.spec.widget === "stat-group" ? this.renderStatGroup(e) : this.renderMetric(de(this.spec.data, e));
|
|
383
383
|
}
|
|
384
384
|
renderStatGroup(e) {
|
|
385
385
|
const t = this.spec.data;
|
|
386
386
|
return Array.isArray(t) ? o`
|
|
387
387
|
<div class="stat-group" part="stat-group">
|
|
388
|
-
${t.map((a) => this.renderMetric(
|
|
388
|
+
${t.map((a) => this.renderMetric(de(a, e)))}
|
|
389
389
|
</div>
|
|
390
390
|
` : l;
|
|
391
391
|
}
|
|
@@ -406,11 +406,11 @@ let B = class extends y {
|
|
|
406
406
|
`;
|
|
407
407
|
}
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
I.styles = [b, w`
|
|
410
410
|
:host {
|
|
411
411
|
display: block;
|
|
412
412
|
font-family: system-ui, -apple-system, sans-serif;
|
|
413
|
-
container:
|
|
413
|
+
container: uw-metric / inline-size;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
/* ── metric (single) ── */
|
|
@@ -427,7 +427,7 @@ B.styles = [b, w`
|
|
|
427
427
|
color: var(--u-widget-text, #1a1a2e);
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
-
@container
|
|
430
|
+
@container uw-metric (max-width: 30rem) {
|
|
431
431
|
.metric-value {
|
|
432
432
|
font-size: 1.5rem;
|
|
433
433
|
}
|
|
@@ -494,7 +494,7 @@ B.styles = [b, w`
|
|
|
494
494
|
padding-left: 1.5rem;
|
|
495
495
|
}
|
|
496
496
|
|
|
497
|
-
@container
|
|
497
|
+
@container uw-metric (max-width: 30rem) {
|
|
498
498
|
.stat-group {
|
|
499
499
|
flex-direction: column;
|
|
500
500
|
gap: 1rem;
|
|
@@ -513,13 +513,16 @@ B.styles = [b, w`
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
`];
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
],
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
],
|
|
522
|
-
|
|
516
|
+
Z([
|
|
517
|
+
f({ type: Object })
|
|
518
|
+
], I.prototype, "spec", 2);
|
|
519
|
+
Z([
|
|
520
|
+
f({ type: String, reflect: !0 })
|
|
521
|
+
], I.prototype, "theme", 2);
|
|
522
|
+
I = Z([
|
|
523
|
+
x("uw-metric")
|
|
524
|
+
], I);
|
|
525
|
+
var Me = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, Q = (e, t, a, r) => {
|
|
523
526
|
for (var i = r > 1 ? void 0 : r ? Te(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
524
527
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
525
528
|
return r && i && Me(t, a, i), i;
|
|
@@ -537,16 +540,16 @@ const Ue = {
|
|
|
537
540
|
blue: "#2563eb",
|
|
538
541
|
gray: "#6b7280"
|
|
539
542
|
};
|
|
540
|
-
function
|
|
543
|
+
function pe(e) {
|
|
541
544
|
return Re[e] ?? e;
|
|
542
545
|
}
|
|
543
|
-
function
|
|
544
|
-
const s = (r - 90) * Math.PI / 180, n = (i - 90) * Math.PI / 180, d = e + a * Math.cos(s), c = t + a * Math.sin(s), p = e + a * Math.cos(n), g = t + a * Math.sin(n),
|
|
545
|
-
return `M ${d} ${c} A ${a} ${a} 0 ${
|
|
546
|
+
function ue(e, t, a, r, i) {
|
|
547
|
+
const s = (r - 90) * Math.PI / 180, n = (i - 90) * Math.PI / 180, d = e + a * Math.cos(s), c = t + a * Math.sin(s), p = e + a * Math.cos(n), g = t + a * Math.sin(n), m = i - r > 180 ? 1 : 0;
|
|
548
|
+
return `M ${d} ${c} A ${a} ${a} 0 ${m} 1 ${p} ${g}`;
|
|
546
549
|
}
|
|
547
|
-
let
|
|
550
|
+
let N = class extends y {
|
|
548
551
|
constructor() {
|
|
549
|
-
super(...arguments), this.spec = null;
|
|
552
|
+
super(...arguments), this.spec = null, this.theme = null;
|
|
550
553
|
}
|
|
551
554
|
render() {
|
|
552
555
|
return this.spec?.data ? this.spec.widget === "progress" ? this.renderProgress() : this.renderGauge() : l;
|
|
@@ -560,14 +563,14 @@ let W = class extends y {
|
|
|
560
563
|
return Number(e.value ?? 0);
|
|
561
564
|
}
|
|
562
565
|
renderGauge() {
|
|
563
|
-
const e = this.getOptions(), t = this.getValue(), a = e.max - e.min, r = a > 0 ? Math.max(0, Math.min(1, (t - e.min) / a)) : 0, i = this.getThresholdColor(t, e), s = 100, n = 100, d = 80, c = 150, p = 240, g = c + p * r,
|
|
566
|
+
const e = this.getOptions(), t = this.getValue(), a = e.max - e.min, r = a > 0 ? Math.max(0, Math.min(1, (t - e.min) / a)) : 0, i = this.getThresholdColor(t, e), s = 100, n = 100, d = 80, c = 150, p = 240, g = c + p * r, m = ue(s, n, d, c, c + p), u = r > 0 ? ue(s, n, d, c, g) : null, h = typeof this.spec.title == "string" ? this.spec.title : "Gauge", v = `${t}${e.unit}`;
|
|
564
567
|
return o`
|
|
565
568
|
<div class="gauge-container" part="gauge"
|
|
566
569
|
role="meter"
|
|
567
570
|
aria-valuenow=${t}
|
|
568
571
|
aria-valuemin=${e.min}
|
|
569
572
|
aria-valuemax=${e.max}
|
|
570
|
-
aria-label=${
|
|
573
|
+
aria-label=${h}
|
|
571
574
|
aria-valuetext=${v}
|
|
572
575
|
>
|
|
573
576
|
<div class="gauge-wrapper">
|
|
@@ -576,7 +579,7 @@ let W = class extends y {
|
|
|
576
579
|
${e.unit ? o`<div class="gauge-unit" part="unit">${e.unit}</div>` : l}
|
|
577
580
|
</div>
|
|
578
581
|
<svg class="gauge-svg" viewBox="0 0 200 195" role="presentation" aria-hidden="true">
|
|
579
|
-
<path class="gauge-track" d="${
|
|
582
|
+
<path class="gauge-track" d="${m}" fill="none" stroke-width="12" stroke-linecap="round"></path>
|
|
580
583
|
<path class="gauge-fill" d="${u ?? "M0 0"}" fill="none" stroke="${u ? i : "none"}" stroke-width="12" stroke-linecap="round"></path>
|
|
581
584
|
</svg>
|
|
582
585
|
</div>
|
|
@@ -615,15 +618,15 @@ let W = class extends y {
|
|
|
615
618
|
if (!t.thresholds?.length) return "var(--u-widget-primary, #4f46e5)";
|
|
616
619
|
const a = [...t.thresholds].sort((r, i) => r.to - i.to);
|
|
617
620
|
for (const r of a)
|
|
618
|
-
if (e <= r.to) return
|
|
619
|
-
return
|
|
621
|
+
if (e <= r.to) return pe(r.color);
|
|
622
|
+
return pe(a[a.length - 1].color);
|
|
620
623
|
}
|
|
621
624
|
};
|
|
622
|
-
|
|
625
|
+
N.styles = [b, w`
|
|
623
626
|
:host {
|
|
624
627
|
display: block;
|
|
625
628
|
font-family: system-ui, -apple-system, sans-serif;
|
|
626
|
-
container:
|
|
629
|
+
container: uw-gauge / inline-size;
|
|
627
630
|
}
|
|
628
631
|
|
|
629
632
|
.gauge-container {
|
|
@@ -698,7 +701,7 @@ W.styles = [b, w`
|
|
|
698
701
|
color: var(--u-widget-text-secondary, #64748b);
|
|
699
702
|
}
|
|
700
703
|
|
|
701
|
-
@container
|
|
704
|
+
@container uw-gauge (max-width: 10rem) {
|
|
702
705
|
.gauge-value {
|
|
703
706
|
font-size: 1.25rem;
|
|
704
707
|
}
|
|
@@ -716,20 +719,23 @@ W.styles = [b, w`
|
|
|
716
719
|
}
|
|
717
720
|
}
|
|
718
721
|
`];
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
],
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
],
|
|
722
|
+
Q([
|
|
723
|
+
f({ type: Object })
|
|
724
|
+
], N.prototype, "spec", 2);
|
|
725
|
+
Q([
|
|
726
|
+
f({ type: String, reflect: !0 })
|
|
727
|
+
], N.prototype, "theme", 2);
|
|
728
|
+
N = Q([
|
|
729
|
+
x("uw-gauge")
|
|
730
|
+
], N);
|
|
725
731
|
var qe = Object.defineProperty, Be = Object.getOwnPropertyDescriptor, C = (e, t, a, r) => {
|
|
726
732
|
for (var i = r > 1 ? void 0 : r ? Be(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
727
733
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
728
734
|
return r && i && qe(t, a, i), i;
|
|
729
735
|
};
|
|
730
|
-
let
|
|
736
|
+
let _ = class extends y {
|
|
731
737
|
constructor() {
|
|
732
|
-
super(...arguments), this.spec = null, this._sortField = null, this._sortDir = null, this._page = 0, this._searchQuery = "", this._focusedIdx = 0, this._onTableKeydown = (e) => {
|
|
738
|
+
super(...arguments), this.spec = null, this.theme = null, this._sortField = null, this._sortDir = null, this._page = 0, this._searchQuery = "", this._focusedIdx = 0, this._onTableKeydown = (e) => {
|
|
733
739
|
const a = e.target.closest("tr");
|
|
734
740
|
if (!a) return;
|
|
735
741
|
const r = a.parentElement;
|
|
@@ -793,10 +799,10 @@ let z = class extends y {
|
|
|
793
799
|
}
|
|
794
800
|
get _locale() {
|
|
795
801
|
const e = this.spec?.options?.locale;
|
|
796
|
-
return
|
|
802
|
+
return me(typeof e == "string" ? e : void 0);
|
|
797
803
|
}
|
|
798
804
|
renderTable() {
|
|
799
|
-
const e = this.spec.data, t = this.getColumns(e), a = this._locale, r = this.spec.options?.sortable !== !1, i = !!this.spec.options?.searchable, s = !!this.spec.options?.compact, n = Number(this.spec.options?.pageSize) || 0, d = this._searchQuery ? this.filterData(e, t) : e, c = this._sortField && this._sortDir ? this.sortData(d) : d, p = n > 0 ? Math.max(1, Math.ceil(c.length / n)) : 1, g = Math.min(this._page, p - 1),
|
|
805
|
+
const e = this.spec.data, t = this.getColumns(e), a = this._locale, r = this.spec.options?.sortable !== !1, i = !!this.spec.options?.searchable, s = !!this.spec.options?.compact, n = Number(this.spec.options?.pageSize) || 0, d = this._searchQuery ? this.filterData(e, t) : e, c = this._sortField && this._sortDir ? this.sortData(d) : d, p = n > 0 ? Math.max(1, Math.ceil(c.length / n)) : 1, g = Math.min(this._page, p - 1), m = n > 0 ? c.slice(g * n, (g + 1) * n) : c, u = i ? o`
|
|
800
806
|
<div class="search-box" part="search">
|
|
801
807
|
<input
|
|
802
808
|
class="search-input"
|
|
@@ -807,7 +813,7 @@ let z = class extends y {
|
|
|
807
813
|
@input=${this._onSearch}
|
|
808
814
|
/>
|
|
809
815
|
</div>
|
|
810
|
-
` : l,
|
|
816
|
+
` : l, h = n > 0 && p > 1 ? o`
|
|
811
817
|
<nav class="pagination" part="pagination" aria-label=${a.tablePagination}>
|
|
812
818
|
<button aria-label=${a.previousPage} ?disabled=${g === 0} @click=${() => this._onPageChange(g - 1)}>${a.prev}</button>
|
|
813
819
|
<span aria-live="polite">${g + 1} / ${p}</span>
|
|
@@ -837,18 +843,18 @@ let z = class extends y {
|
|
|
837
843
|
</tr>
|
|
838
844
|
</thead>
|
|
839
845
|
<tbody @keydown=${this._onTableKeydown}>
|
|
840
|
-
${
|
|
846
|
+
${m.map(
|
|
841
847
|
(v, $) => o`
|
|
842
848
|
<tr part="tr"
|
|
843
849
|
tabindex=${$ === this._focusedIdx ? "0" : "-1"}
|
|
844
850
|
@click=${() => this._onRowClick(v, n > 0 ? g * n + $ : $)}
|
|
845
|
-
@keydown=${(
|
|
846
|
-
(
|
|
851
|
+
@keydown=${(k) => {
|
|
852
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), this._onRowClick(v, n > 0 ? g * n + $ : $));
|
|
847
853
|
}}
|
|
848
854
|
>
|
|
849
855
|
${t.map(
|
|
850
|
-
(
|
|
851
|
-
>${
|
|
856
|
+
(k) => o`<td data-align=${k.align ?? "left"} part="td"
|
|
857
|
+
>${he(v[k.field], k.format, typeof this.spec.options?.locale == "string" ? this.spec.options.locale : void 0)}</td
|
|
852
858
|
>`
|
|
853
859
|
)}
|
|
854
860
|
</tr>
|
|
@@ -857,7 +863,7 @@ let z = class extends y {
|
|
|
857
863
|
</tbody>
|
|
858
864
|
</table>
|
|
859
865
|
</div>
|
|
860
|
-
${
|
|
866
|
+
${h}
|
|
861
867
|
</div>`;
|
|
862
868
|
}
|
|
863
869
|
_onPageChange(e) {
|
|
@@ -900,8 +906,8 @@ let z = class extends y {
|
|
|
900
906
|
<div class="list-item" part="list-item"
|
|
901
907
|
tabindex=${g === this._focusedIdx ? "0" : "-1"}
|
|
902
908
|
@click=${() => this._onRowClick(p, g)}
|
|
903
|
-
@keydown=${(
|
|
904
|
-
(
|
|
909
|
+
@keydown=${(m) => {
|
|
910
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), this._onRowClick(p, g));
|
|
905
911
|
}}
|
|
906
912
|
>
|
|
907
913
|
${n && p[n] ? o`<img class="list-avatar" src=${String(p[n])} alt="" part="avatar" />` : s ? o`<div class="list-icon" part="icon">${this.getIconLetter(p[s])}</div>` : l}
|
|
@@ -948,11 +954,11 @@ let z = class extends y {
|
|
|
948
954
|
return String(e ?? "").charAt(0).toUpperCase();
|
|
949
955
|
}
|
|
950
956
|
};
|
|
951
|
-
|
|
957
|
+
_.styles = [b, w`
|
|
952
958
|
:host {
|
|
953
959
|
display: block;
|
|
954
960
|
font-family: system-ui, -apple-system, sans-serif;
|
|
955
|
-
container:
|
|
961
|
+
container: uw-table / inline-size;
|
|
956
962
|
}
|
|
957
963
|
|
|
958
964
|
/* ── table ── */
|
|
@@ -1222,7 +1228,7 @@ z.styles = [b, w`
|
|
|
1222
1228
|
}
|
|
1223
1229
|
|
|
1224
1230
|
/* ── container-query responsive ── */
|
|
1225
|
-
@container
|
|
1231
|
+
@container uw-table (max-width: 30rem) {
|
|
1226
1232
|
table {
|
|
1227
1233
|
font-size: 0.75rem;
|
|
1228
1234
|
}
|
|
@@ -1258,34 +1264,37 @@ z.styles = [b, w`
|
|
|
1258
1264
|
}
|
|
1259
1265
|
`];
|
|
1260
1266
|
C([
|
|
1261
|
-
|
|
1262
|
-
],
|
|
1267
|
+
f({ type: Object })
|
|
1268
|
+
], _.prototype, "spec", 2);
|
|
1269
|
+
C([
|
|
1270
|
+
f({ type: String, reflect: !0 })
|
|
1271
|
+
], _.prototype, "theme", 2);
|
|
1263
1272
|
C([
|
|
1264
1273
|
S()
|
|
1265
|
-
],
|
|
1274
|
+
], _.prototype, "_sortField", 2);
|
|
1266
1275
|
C([
|
|
1267
1276
|
S()
|
|
1268
|
-
],
|
|
1277
|
+
], _.prototype, "_sortDir", 2);
|
|
1269
1278
|
C([
|
|
1270
1279
|
S()
|
|
1271
|
-
],
|
|
1280
|
+
], _.prototype, "_page", 2);
|
|
1272
1281
|
C([
|
|
1273
1282
|
S()
|
|
1274
|
-
],
|
|
1283
|
+
], _.prototype, "_searchQuery", 2);
|
|
1275
1284
|
C([
|
|
1276
1285
|
S()
|
|
1277
|
-
],
|
|
1278
|
-
|
|
1279
|
-
x("
|
|
1280
|
-
],
|
|
1281
|
-
var We = Object.defineProperty, He = Object.getOwnPropertyDescriptor,
|
|
1286
|
+
], _.prototype, "_focusedIdx", 2);
|
|
1287
|
+
_ = C([
|
|
1288
|
+
x("uw-table")
|
|
1289
|
+
], _);
|
|
1290
|
+
var We = Object.defineProperty, He = Object.getOwnPropertyDescriptor, H = (e, t, a, r) => {
|
|
1282
1291
|
for (var i = r > 1 ? void 0 : r ? He(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1283
1292
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
1284
1293
|
return r && i && We(t, a, i), i;
|
|
1285
1294
|
};
|
|
1286
|
-
let
|
|
1295
|
+
let D = class extends y {
|
|
1287
1296
|
constructor() {
|
|
1288
|
-
super(...arguments), this.spec = null, this._formData = {}, this._errors = {}, this._onFormSubmit = (e) => {
|
|
1297
|
+
super(...arguments), this.spec = null, this.theme = null, this._formData = {}, this._errors = {}, this._onFormSubmit = (e) => {
|
|
1289
1298
|
e.preventDefault();
|
|
1290
1299
|
const t = (this.spec?.actions ?? []).find((a) => a.action === "submit");
|
|
1291
1300
|
t ? this._onAction(t) : this._validate() && this._emitEvent({
|
|
@@ -1511,7 +1520,7 @@ let j = class extends y {
|
|
|
1511
1520
|
}
|
|
1512
1521
|
get _locale() {
|
|
1513
1522
|
const e = this.spec?.options?.locale;
|
|
1514
|
-
return
|
|
1523
|
+
return me(typeof e == "string" ? e : void 0);
|
|
1515
1524
|
}
|
|
1516
1525
|
_validate() {
|
|
1517
1526
|
const e = this.spec?.fields ?? [], t = {}, a = this._locale;
|
|
@@ -1575,11 +1584,11 @@ let j = class extends y {
|
|
|
1575
1584
|
);
|
|
1576
1585
|
}
|
|
1577
1586
|
};
|
|
1578
|
-
|
|
1587
|
+
D.styles = [b, w`
|
|
1579
1588
|
:host {
|
|
1580
1589
|
display: block;
|
|
1581
1590
|
font-family: system-ui, -apple-system, sans-serif;
|
|
1582
|
-
container:
|
|
1591
|
+
container: uw-form / inline-size;
|
|
1583
1592
|
}
|
|
1584
1593
|
|
|
1585
1594
|
.form-container {
|
|
@@ -1764,7 +1773,7 @@ j.styles = [b, w`
|
|
|
1764
1773
|
line-height: 1.5;
|
|
1765
1774
|
}
|
|
1766
1775
|
|
|
1767
|
-
@container
|
|
1776
|
+
@container uw-form (max-width: 20rem) {
|
|
1768
1777
|
.form-container {
|
|
1769
1778
|
gap: 12px;
|
|
1770
1779
|
}
|
|
@@ -1793,24 +1802,27 @@ j.styles = [b, w`
|
|
|
1793
1802
|
}
|
|
1794
1803
|
}
|
|
1795
1804
|
`];
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
],
|
|
1799
|
-
|
|
1805
|
+
H([
|
|
1806
|
+
f({ type: Object })
|
|
1807
|
+
], D.prototype, "spec", 2);
|
|
1808
|
+
H([
|
|
1809
|
+
f({ type: String, reflect: !0 })
|
|
1810
|
+
], D.prototype, "theme", 2);
|
|
1811
|
+
H([
|
|
1800
1812
|
S()
|
|
1801
|
-
],
|
|
1802
|
-
|
|
1813
|
+
], D.prototype, "_formData", 2);
|
|
1814
|
+
H([
|
|
1803
1815
|
S()
|
|
1804
|
-
],
|
|
1805
|
-
|
|
1806
|
-
x("
|
|
1807
|
-
],
|
|
1808
|
-
var Ke = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor,
|
|
1816
|
+
], D.prototype, "_errors", 2);
|
|
1817
|
+
D = H([
|
|
1818
|
+
x("uw-form")
|
|
1819
|
+
], D);
|
|
1820
|
+
var Ke = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, ee = (e, t, a, r) => {
|
|
1809
1821
|
for (var i = r > 1 ? void 0 : r ? Ve(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1810
1822
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
1811
1823
|
return r && i && Ke(t, a, i), i;
|
|
1812
1824
|
};
|
|
1813
|
-
let
|
|
1825
|
+
let F = class extends y {
|
|
1814
1826
|
constructor() {
|
|
1815
1827
|
super(...arguments), this.spec = null, this.theme = null;
|
|
1816
1828
|
}
|
|
@@ -1850,10 +1862,10 @@ let I = class extends y {
|
|
|
1850
1862
|
return r ? o`<div class=${d} style=${r} part="child">${n}</div>` : o`<div class=${d} part="child">${n}</div>`;
|
|
1851
1863
|
}
|
|
1852
1864
|
};
|
|
1853
|
-
|
|
1865
|
+
F.styles = [b, w`
|
|
1854
1866
|
:host {
|
|
1855
1867
|
display: block;
|
|
1856
|
-
container:
|
|
1868
|
+
container: uw-compose / inline-size;
|
|
1857
1869
|
}
|
|
1858
1870
|
|
|
1859
1871
|
.compose-container {
|
|
@@ -1941,7 +1953,7 @@ I.styles = [b, w`
|
|
|
1941
1953
|
}
|
|
1942
1954
|
|
|
1943
1955
|
/* ── container-query responsive ── */
|
|
1944
|
-
@container
|
|
1956
|
+
@container uw-compose (max-width: 30rem) {
|
|
1945
1957
|
.layout-row {
|
|
1946
1958
|
flex-direction: column;
|
|
1947
1959
|
}
|
|
@@ -1951,23 +1963,23 @@ I.styles = [b, w`
|
|
|
1951
1963
|
}
|
|
1952
1964
|
}
|
|
1953
1965
|
`];
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
],
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
],
|
|
1960
|
-
|
|
1961
|
-
x("
|
|
1962
|
-
],
|
|
1963
|
-
var Ge = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor,
|
|
1966
|
+
ee([
|
|
1967
|
+
f({ type: Object })
|
|
1968
|
+
], F.prototype, "spec", 2);
|
|
1969
|
+
ee([
|
|
1970
|
+
f({ type: String, reflect: !0 })
|
|
1971
|
+
], F.prototype, "theme", 2);
|
|
1972
|
+
F = ee([
|
|
1973
|
+
x("uw-compose")
|
|
1974
|
+
], F);
|
|
1975
|
+
var Ge = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, te = (e, t, a, r) => {
|
|
1964
1976
|
for (var i = r > 1 ? void 0 : r ? Xe(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1965
1977
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
1966
1978
|
return r && i && Ge(t, a, i), i;
|
|
1967
1979
|
};
|
|
1968
|
-
let
|
|
1980
|
+
let M = class extends y {
|
|
1969
1981
|
constructor() {
|
|
1970
|
-
super(...arguments), this.spec = null;
|
|
1982
|
+
super(...arguments), this.spec = null, this.theme = null;
|
|
1971
1983
|
}
|
|
1972
1984
|
render() {
|
|
1973
1985
|
if (!this.spec) return l;
|
|
@@ -2015,9 +2027,9 @@ let H = class extends y {
|
|
|
2015
2027
|
return t = t.replace(/^#### (.+)$/gm, "<h4>$1</h4>"), t = t.replace(/^### (.+)$/gm, "<h3>$1</h3>"), t = t.replace(/^## (.+)$/gm, "<h2>$1</h2>"), t = t.replace(/^# (.+)$/gm, "<h1>$1</h1>"), t = t.replace(/^---$/gm, "<hr>"), t = t.replace(/```[\s\S]*?```/g, (a) => `<pre><code>${a.slice(3, -3).replace(/^\w*\n/, "")}</code></pre>`), t = t.replace(
|
|
2016
2028
|
/^(\|.+\|)\n(\|[\s:|-]+\|)\n((?:\|.+\|\n?)+)/gm,
|
|
2017
2029
|
(a, r, i, s) => {
|
|
2018
|
-
const n = (u) => u.split("|").slice(1, -1).map((
|
|
2019
|
-
`).map(n), g = d.map((u,
|
|
2020
|
-
return `<table><thead><tr>${g}</tr></thead><tbody>${
|
|
2030
|
+
const n = (u) => u.split("|").slice(1, -1).map((h) => h.trim()), d = n(r), c = n(i).map((u) => u.startsWith(":") && u.endsWith(":") ? "center" : u.endsWith(":") ? "right" : "left"), p = s.trim().split(`
|
|
2031
|
+
`).map(n), g = d.map((u, h) => `<th scope="col" style="text-align:${c[h] ?? "left"}">${u}</th>`).join(""), m = p.map((u) => "<tr>" + u.map((h, v) => `<td style="text-align:${c[v] ?? "left"}">${h}</td>`).join("") + "</tr>").join("");
|
|
2032
|
+
return `<table><thead><tr>${g}</tr></thead><tbody>${m}</tbody></table>`;
|
|
2021
2033
|
}
|
|
2022
2034
|
), t = t.replace(/`([^`]+)`/g, "<code>$1</code>"), t = t.replace(/\*\*\*(.+?)\*\*\*/g, "<strong><em>$1</em></strong>"), t = t.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>"), t = t.replace(/\*(.+?)\*/g, "<em>$1</em>"), t = t.replace(
|
|
2023
2035
|
/\[([^\]]+)\]\(([^)]+)\)/g,
|
|
@@ -2033,11 +2045,11 @@ let H = class extends y {
|
|
|
2033
2045
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2034
2046
|
}
|
|
2035
2047
|
};
|
|
2036
|
-
|
|
2048
|
+
M.styles = [b, w`
|
|
2037
2049
|
:host {
|
|
2038
2050
|
display: block;
|
|
2039
2051
|
font-family: system-ui, -apple-system, sans-serif;
|
|
2040
|
-
container:
|
|
2052
|
+
container: uw-content / inline-size;
|
|
2041
2053
|
}
|
|
2042
2054
|
|
|
2043
2055
|
/* ── markdown ── */
|
|
@@ -2191,7 +2203,7 @@ H.styles = [b, w`
|
|
|
2191
2203
|
margin-bottom: 4px;
|
|
2192
2204
|
}
|
|
2193
2205
|
|
|
2194
|
-
@container
|
|
2206
|
+
@container uw-content (max-width: 20rem) {
|
|
2195
2207
|
.markdown {
|
|
2196
2208
|
font-size: 0.8125rem;
|
|
2197
2209
|
}
|
|
@@ -2210,20 +2222,23 @@ H.styles = [b, w`
|
|
|
2210
2222
|
}
|
|
2211
2223
|
}
|
|
2212
2224
|
`];
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
],
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
],
|
|
2219
|
-
|
|
2225
|
+
te([
|
|
2226
|
+
f({ type: Object })
|
|
2227
|
+
], M.prototype, "spec", 2);
|
|
2228
|
+
te([
|
|
2229
|
+
f({ type: String, reflect: !0 })
|
|
2230
|
+
], M.prototype, "theme", 2);
|
|
2231
|
+
M = te([
|
|
2232
|
+
x("uw-content")
|
|
2233
|
+
], M);
|
|
2234
|
+
var Je = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, re = (e, t, a, r) => {
|
|
2220
2235
|
for (var i = r > 1 ? void 0 : r ? Ye(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2221
2236
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
2222
2237
|
return r && i && Je(t, a, i), i;
|
|
2223
2238
|
};
|
|
2224
|
-
let
|
|
2239
|
+
let T = class extends y {
|
|
2225
2240
|
constructor() {
|
|
2226
|
-
super(...arguments), this.spec = null;
|
|
2241
|
+
super(...arguments), this.spec = null, this.theme = null;
|
|
2227
2242
|
}
|
|
2228
2243
|
render() {
|
|
2229
2244
|
if (!this.spec) return l;
|
|
@@ -2252,11 +2267,11 @@ let K = class extends y {
|
|
|
2252
2267
|
return e ? Array.isArray(e) ? e.filter((t) => t != null && typeof t == "object" && "key" in t && "value" in t).map((t) => [String(t.key), t.value]) : typeof e == "object" ? Object.entries(e) : [] : [];
|
|
2253
2268
|
}
|
|
2254
2269
|
};
|
|
2255
|
-
|
|
2270
|
+
T.styles = [b, w`
|
|
2256
2271
|
:host {
|
|
2257
2272
|
display: block;
|
|
2258
2273
|
font-family: system-ui, -apple-system, sans-serif;
|
|
2259
|
-
container:
|
|
2274
|
+
container: uw-kv / inline-size;
|
|
2260
2275
|
}
|
|
2261
2276
|
|
|
2262
2277
|
.kv-vertical {
|
|
@@ -2331,7 +2346,7 @@ K.styles = [b, w`
|
|
|
2331
2346
|
text-align: left;
|
|
2332
2347
|
}
|
|
2333
2348
|
|
|
2334
|
-
@container
|
|
2349
|
+
@container uw-kv (max-width: 20rem) {
|
|
2335
2350
|
.kv-horizontal {
|
|
2336
2351
|
flex-direction: column;
|
|
2337
2352
|
gap: 8px;
|
|
@@ -2346,12 +2361,15 @@ K.styles = [b, w`
|
|
|
2346
2361
|
}
|
|
2347
2362
|
}
|
|
2348
2363
|
`];
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
],
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
],
|
|
2364
|
+
re([
|
|
2365
|
+
f({ type: Object })
|
|
2366
|
+
], T.prototype, "spec", 2);
|
|
2367
|
+
re([
|
|
2368
|
+
f({ type: String, reflect: !0 })
|
|
2369
|
+
], T.prototype, "theme", 2);
|
|
2370
|
+
T = re([
|
|
2371
|
+
x("uw-kv")
|
|
2372
|
+
], T);
|
|
2355
2373
|
var Ze = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, G = (e, t, a, r) => {
|
|
2356
2374
|
for (var i = r > 1 ? void 0 : r ? Qe(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2357
2375
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
@@ -2398,20 +2416,20 @@ const et = {
|
|
|
2398
2416
|
jsonc: "json",
|
|
2399
2417
|
psql: "sql",
|
|
2400
2418
|
mysql: "sql"
|
|
2401
|
-
},
|
|
2419
|
+
}, ge = /* @__PURE__ */ new Map();
|
|
2402
2420
|
function at(e) {
|
|
2403
|
-
let t =
|
|
2421
|
+
let t = ge.get(e);
|
|
2404
2422
|
if (!t) {
|
|
2405
2423
|
const a = tt[e] || "";
|
|
2406
|
-
t = a ? new Set(a.split(" ")) : /* @__PURE__ */ new Set(),
|
|
2424
|
+
t = a ? new Set(a.split(" ")) : /* @__PURE__ */ new Set(), ge.set(e, t);
|
|
2407
2425
|
}
|
|
2408
2426
|
return t;
|
|
2409
2427
|
}
|
|
2410
|
-
function
|
|
2428
|
+
function z(e) {
|
|
2411
2429
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2412
2430
|
}
|
|
2413
|
-
function
|
|
2414
|
-
const a =
|
|
2431
|
+
function j(e, t) {
|
|
2432
|
+
const a = z(e);
|
|
2415
2433
|
return a.includes(`
|
|
2416
2434
|
`) ? a.split(`
|
|
2417
2435
|
`).map((r) => `<span class="hl-${t}">${r}</span>`).join(`
|
|
@@ -2432,7 +2450,7 @@ function ve(e, t, a) {
|
|
|
2432
2450
|
return e.length;
|
|
2433
2451
|
}
|
|
2434
2452
|
function it(e, t) {
|
|
2435
|
-
if (!t) return
|
|
2453
|
+
if (!t) return z(e);
|
|
2436
2454
|
const a = rt[t] || t;
|
|
2437
2455
|
if (a === "json") return st(e);
|
|
2438
2456
|
const r = at(a), i = et[a], s = i?.[0], n = i?.[1], d = a === "javascript" || a === "typescript";
|
|
@@ -2440,50 +2458,50 @@ function it(e, t) {
|
|
|
2440
2458
|
const g = e.length;
|
|
2441
2459
|
for (; p < g; ) {
|
|
2442
2460
|
if (n && e.startsWith(n[0], p)) {
|
|
2443
|
-
const u = e.indexOf(n[1], p + n[0].length),
|
|
2444
|
-
c +=
|
|
2461
|
+
const u = e.indexOf(n[1], p + n[0].length), h = u === -1 ? e.slice(p) : e.slice(p, u + n[1].length);
|
|
2462
|
+
c += j(h, "c"), p += h.length;
|
|
2445
2463
|
continue;
|
|
2446
2464
|
}
|
|
2447
2465
|
if (s && e.startsWith(s, p)) {
|
|
2448
2466
|
const u = e.indexOf(`
|
|
2449
|
-
`, p),
|
|
2450
|
-
c +=
|
|
2467
|
+
`, p), h = u === -1 ? e.slice(p) : e.slice(p, u);
|
|
2468
|
+
c += j(h, "c"), p += h.length;
|
|
2451
2469
|
continue;
|
|
2452
2470
|
}
|
|
2453
|
-
const
|
|
2454
|
-
if (
|
|
2455
|
-
const u = ve(e, p,
|
|
2456
|
-
c +=
|
|
2471
|
+
const m = e[p];
|
|
2472
|
+
if (m === '"' || m === "'" || m === "`" && d) {
|
|
2473
|
+
const u = ve(e, p, m);
|
|
2474
|
+
c += j(e.slice(p, u), "s"), p = u;
|
|
2457
2475
|
continue;
|
|
2458
2476
|
}
|
|
2459
|
-
if (/\d/.test(
|
|
2477
|
+
if (/\d/.test(m) && (p === 0 || !/[a-zA-Z_$]/.test(e[p - 1]))) {
|
|
2460
2478
|
let u = p + 1;
|
|
2461
2479
|
for (; u < g && /[0-9a-fA-FxXoObBeE._]/.test(e[u]); ) u++;
|
|
2462
|
-
c +=
|
|
2480
|
+
c += j(e.slice(p, u), "n"), p = u;
|
|
2463
2481
|
continue;
|
|
2464
2482
|
}
|
|
2465
|
-
if (/[a-zA-Z_$]/.test(
|
|
2483
|
+
if (/[a-zA-Z_$]/.test(m)) {
|
|
2466
2484
|
let u = p + 1;
|
|
2467
2485
|
for (; u < g && /[a-zA-Z0-9_$]/.test(e[u]); ) u++;
|
|
2468
|
-
const
|
|
2469
|
-
c += r.has(
|
|
2486
|
+
const h = e.slice(p, u);
|
|
2487
|
+
c += r.has(h) ? `<span class="hl-k">${z(h)}</span>` : z(h), p = u;
|
|
2470
2488
|
continue;
|
|
2471
2489
|
}
|
|
2472
|
-
if (a === "html" &&
|
|
2490
|
+
if (a === "html" && m === "<" && p + 1 < g && /[a-zA-Z/!]/.test(e[p + 1])) {
|
|
2473
2491
|
const u = e.indexOf(">", p);
|
|
2474
2492
|
if (u !== -1) {
|
|
2475
|
-
c += `<span class="hl-k">${
|
|
2493
|
+
c += `<span class="hl-k">${z(e.slice(p, u + 1))}</span>`, p = u + 1;
|
|
2476
2494
|
continue;
|
|
2477
2495
|
}
|
|
2478
2496
|
}
|
|
2479
|
-
if (a === "css" && /[a-z-]/.test(
|
|
2497
|
+
if (a === "css" && /[a-z-]/.test(m)) {
|
|
2480
2498
|
let u = p + 1;
|
|
2481
2499
|
for (; u < g && /[a-z-]/.test(e[u]); ) u++;
|
|
2482
|
-
const
|
|
2483
|
-
e.slice(u).trimStart()[0] === ":" ? c += `<span class="hl-k">${
|
|
2500
|
+
const h = e.slice(p, u);
|
|
2501
|
+
e.slice(u).trimStart()[0] === ":" ? c += `<span class="hl-k">${z(h)}</span>` : c += z(h), p = u;
|
|
2484
2502
|
continue;
|
|
2485
2503
|
}
|
|
2486
|
-
c +=
|
|
2504
|
+
c += z(m), p++;
|
|
2487
2505
|
}
|
|
2488
2506
|
return c;
|
|
2489
2507
|
}
|
|
@@ -2494,13 +2512,13 @@ function st(e) {
|
|
|
2494
2512
|
const i = e[a];
|
|
2495
2513
|
if (i === '"') {
|
|
2496
2514
|
const n = ve(e, a, '"'), d = e.slice(a, n), c = e.slice(n).trimStart();
|
|
2497
|
-
t +=
|
|
2515
|
+
t += j(d, c[0] === ":" ? "k" : "s"), a = n;
|
|
2498
2516
|
continue;
|
|
2499
2517
|
}
|
|
2500
2518
|
if (/[\d-]/.test(i) && (a === 0 || /[\s,:\[{]/.test(e[a - 1]))) {
|
|
2501
2519
|
let n = a + 1;
|
|
2502
2520
|
for (; n < r && /[0-9.eE+\-]/.test(e[n]); ) n++;
|
|
2503
|
-
t +=
|
|
2521
|
+
t += j(e.slice(a, n), "n"), a = n;
|
|
2504
2522
|
continue;
|
|
2505
2523
|
}
|
|
2506
2524
|
let s = !1;
|
|
@@ -2509,7 +2527,7 @@ function st(e) {
|
|
|
2509
2527
|
t += `<span class="hl-k">${n}</span>`, a += n.length, s = !0;
|
|
2510
2528
|
break;
|
|
2511
2529
|
}
|
|
2512
|
-
s || (t +=
|
|
2530
|
+
s || (t += z(i), a++);
|
|
2513
2531
|
}
|
|
2514
2532
|
return t;
|
|
2515
2533
|
}
|
|
@@ -2526,10 +2544,10 @@ let O = class extends y {
|
|
|
2526
2544
|
const a = String(e.language ?? "").toLowerCase(), r = this.spec.options ?? {}, i = r.lineNumbers !== !1, s = !!(r.wrap ?? !1), n = r.maxHeight ? String(r.maxHeight) : void 0, d = new Set(
|
|
2527
2545
|
Array.isArray(r.highlight) ? r.highlight : []
|
|
2528
2546
|
), g = it(t, a).split(`
|
|
2529
|
-
`).map((u,
|
|
2530
|
-
const v =
|
|
2531
|
-
return `<span class="line${$}">${
|
|
2532
|
-
}).join(""),
|
|
2547
|
+
`).map((u, h) => {
|
|
2548
|
+
const v = h + 1, $ = d.has(v) ? " line-hl" : "", k = i ? `<span class="line-no">${v}</span>` : "";
|
|
2549
|
+
return `<span class="line${$}">${k}${u || " "}</span>`;
|
|
2550
|
+
}).join(""), m = n ? `max-height: ${n}` : "";
|
|
2533
2551
|
return o`
|
|
2534
2552
|
<div class="code-block" part="code">
|
|
2535
2553
|
<div class="code-header" part="code-header">
|
|
@@ -2541,7 +2559,7 @@ let O = class extends y {
|
|
|
2541
2559
|
@click=${this._copyCode}
|
|
2542
2560
|
>${this._copied ? "Copied!" : "Copy"}</button>
|
|
2543
2561
|
</div>
|
|
2544
|
-
<div class="code-body" part="code-body" style=${
|
|
2562
|
+
<div class="code-body" part="code-body" style=${m}>
|
|
2545
2563
|
<pre data-wrap=${String(s)}><code .innerHTML=${g}></code></pre>
|
|
2546
2564
|
</div>
|
|
2547
2565
|
</div>
|
|
@@ -2564,7 +2582,7 @@ O.styles = [b, w`
|
|
|
2564
2582
|
:host {
|
|
2565
2583
|
display: block;
|
|
2566
2584
|
font-family: system-ui, -apple-system, sans-serif;
|
|
2567
|
-
container:
|
|
2585
|
+
container: uw-code / inline-size;
|
|
2568
2586
|
}
|
|
2569
2587
|
|
|
2570
2588
|
.code-block {
|
|
@@ -2657,30 +2675,30 @@ O.styles = [b, w`
|
|
|
2657
2675
|
:host([theme="dark"]) .hl-c { color: #64748b; }
|
|
2658
2676
|
:host([theme="dark"]) .hl-n { color: #fbbf24; }
|
|
2659
2677
|
|
|
2660
|
-
@container
|
|
2678
|
+
@container uw-code (max-width: 20rem) {
|
|
2661
2679
|
pre { font-size: 0.75rem; padding: 8px; }
|
|
2662
2680
|
.code-header { padding: 4px 8px; }
|
|
2663
2681
|
.line-no { width: 2.5ch; margin-right: 1ch; }
|
|
2664
2682
|
}
|
|
2665
2683
|
`];
|
|
2666
2684
|
G([
|
|
2667
|
-
|
|
2685
|
+
f({ type: Object })
|
|
2668
2686
|
], O.prototype, "spec", 2);
|
|
2669
2687
|
G([
|
|
2670
|
-
|
|
2688
|
+
f({ type: String, reflect: !0 })
|
|
2671
2689
|
], O.prototype, "theme", 2);
|
|
2672
2690
|
G([
|
|
2673
2691
|
S()
|
|
2674
2692
|
], O.prototype, "_copied", 2);
|
|
2675
2693
|
O = G([
|
|
2676
|
-
x("
|
|
2694
|
+
x("uw-code")
|
|
2677
2695
|
], O);
|
|
2678
|
-
var nt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor,
|
|
2696
|
+
var nt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, ae = (e, t, a, r) => {
|
|
2679
2697
|
for (var i = r > 1 ? void 0 : r ? ot(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2680
2698
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
2681
2699
|
return r && i && nt(t, a, i), i;
|
|
2682
2700
|
};
|
|
2683
|
-
let
|
|
2701
|
+
let U = class extends y {
|
|
2684
2702
|
constructor() {
|
|
2685
2703
|
super(...arguments), this.spec = null, this.theme = null;
|
|
2686
2704
|
}
|
|
@@ -2767,11 +2785,11 @@ let N = class extends y {
|
|
|
2767
2785
|
return [];
|
|
2768
2786
|
}
|
|
2769
2787
|
};
|
|
2770
|
-
|
|
2788
|
+
U.styles = [b, w`
|
|
2771
2789
|
:host {
|
|
2772
2790
|
display: block;
|
|
2773
2791
|
font-family: system-ui, -apple-system, sans-serif;
|
|
2774
|
-
container:
|
|
2792
|
+
container: uw-citation / inline-size;
|
|
2775
2793
|
}
|
|
2776
2794
|
|
|
2777
2795
|
.citations {
|
|
@@ -2859,21 +2877,21 @@ N.styles = [b, w`
|
|
|
2859
2877
|
.citations[data-compact] .cite-snippet,
|
|
2860
2878
|
.citations[data-compact] .cite-source { display: none; }
|
|
2861
2879
|
|
|
2862
|
-
@container
|
|
2880
|
+
@container uw-citation (max-width: 20rem) {
|
|
2863
2881
|
.cite-title { font-size: 0.8125rem; }
|
|
2864
2882
|
.cite-snippet { font-size: 0.75rem; }
|
|
2865
2883
|
}
|
|
2866
2884
|
`];
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
],
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
],
|
|
2873
|
-
|
|
2874
|
-
x("
|
|
2875
|
-
],
|
|
2876
|
-
var lt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor,
|
|
2885
|
+
ae([
|
|
2886
|
+
f({ type: Object })
|
|
2887
|
+
], U.prototype, "spec", 2);
|
|
2888
|
+
ae([
|
|
2889
|
+
f({ type: String, reflect: !0 })
|
|
2890
|
+
], U.prototype, "theme", 2);
|
|
2891
|
+
U = ae([
|
|
2892
|
+
x("uw-citation")
|
|
2893
|
+
], U);
|
|
2894
|
+
var lt = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, ie = (e, t, a, r) => {
|
|
2877
2895
|
for (var i = r > 1 ? void 0 : r ? ct(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2878
2896
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
2879
2897
|
return r && i && lt(t, a, i), i;
|
|
@@ -2890,7 +2908,7 @@ const dt = /* @__PURE__ */ new Set(["info", "success", "warning", "error", "neut
|
|
|
2890
2908
|
neutral: "○"
|
|
2891
2909
|
// ○
|
|
2892
2910
|
};
|
|
2893
|
-
let
|
|
2911
|
+
let R = class extends y {
|
|
2894
2912
|
constructor() {
|
|
2895
2913
|
super(...arguments), this.spec = null, this.theme = null;
|
|
2896
2914
|
}
|
|
@@ -2935,11 +2953,11 @@ let F = class extends y {
|
|
|
2935
2953
|
return dt.has(t) ? t : "info";
|
|
2936
2954
|
}
|
|
2937
2955
|
};
|
|
2938
|
-
|
|
2956
|
+
R.styles = [b, w`
|
|
2939
2957
|
:host {
|
|
2940
2958
|
display: block;
|
|
2941
2959
|
font-family: system-ui, -apple-system, sans-serif;
|
|
2942
|
-
container:
|
|
2960
|
+
container: uw-status / inline-size;
|
|
2943
2961
|
}
|
|
2944
2962
|
|
|
2945
2963
|
.status-list {
|
|
@@ -2995,27 +3013,27 @@ F.styles = [b, w`
|
|
|
2995
3013
|
color: var(--u-widget-text-secondary, #64748b);
|
|
2996
3014
|
}
|
|
2997
3015
|
|
|
2998
|
-
@container
|
|
3016
|
+
@container uw-status (max-width: 20rem) {
|
|
2999
3017
|
.status-list { gap: 8px 16px; }
|
|
3000
3018
|
.status-item { font-size: 0.8125rem; }
|
|
3001
3019
|
}
|
|
3002
3020
|
`];
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
],
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
],
|
|
3009
|
-
|
|
3010
|
-
x("
|
|
3011
|
-
],
|
|
3012
|
-
var ut = Object.defineProperty, gt = Object.getOwnPropertyDescriptor,
|
|
3021
|
+
ie([
|
|
3022
|
+
f({ type: Object })
|
|
3023
|
+
], R.prototype, "spec", 2);
|
|
3024
|
+
ie([
|
|
3025
|
+
f({ type: String, reflect: !0 })
|
|
3026
|
+
], R.prototype, "theme", 2);
|
|
3027
|
+
R = ie([
|
|
3028
|
+
x("uw-status")
|
|
3029
|
+
], R);
|
|
3030
|
+
var ut = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, se = (e, t, a, r) => {
|
|
3013
3031
|
for (var i = r > 1 ? void 0 : r ? gt(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3014
3032
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
3015
3033
|
return r && i && ut(t, a, i), i;
|
|
3016
3034
|
};
|
|
3017
3035
|
const ft = /* @__PURE__ */ new Set(["done", "active", "pending", "error"]);
|
|
3018
|
-
function
|
|
3036
|
+
function fe(e, t) {
|
|
3019
3037
|
if (t) return o`<span class="step-icon-text">${t}</span>`;
|
|
3020
3038
|
switch (e) {
|
|
3021
3039
|
case "done":
|
|
@@ -3028,7 +3046,7 @@ function de(e, t) {
|
|
|
3028
3046
|
return o`<svg class="step-svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4.47 4.47a.75.75 0 0 1 1.06 0L8 6.94l2.47-2.47a.75.75 0 1 1 1.06 1.06L9.06 8l2.47 2.47a.75.75 0 1 1-1.06 1.06L8 9.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L6.94 8 4.47 5.53a.75.75 0 0 1 0-1.06Z"/></svg>`;
|
|
3029
3047
|
}
|
|
3030
3048
|
}
|
|
3031
|
-
let
|
|
3049
|
+
let q = class extends y {
|
|
3032
3050
|
constructor() {
|
|
3033
3051
|
super(...arguments), this.spec = null, this.theme = null;
|
|
3034
3052
|
}
|
|
@@ -3046,7 +3064,7 @@ let M = class extends y {
|
|
|
3046
3064
|
${e.map((a) => o`
|
|
3047
3065
|
<div class="step-v" part="step" role="listitem" data-status=${a.status}>
|
|
3048
3066
|
<div class="step-track">
|
|
3049
|
-
<span class="step-icon" part="step-icon" aria-hidden="true">${
|
|
3067
|
+
<span class="step-icon" part="step-icon" aria-hidden="true">${fe(a.status, a.icon)}</span>
|
|
3050
3068
|
<div class="step-line"></div>
|
|
3051
3069
|
</div>
|
|
3052
3070
|
<div class="step-body">
|
|
@@ -3068,7 +3086,7 @@ let M = class extends y {
|
|
|
3068
3086
|
<div class="step-h" part="step" role="listitem" data-status=${a.status}>
|
|
3069
3087
|
<div class="step-h-top">
|
|
3070
3088
|
<div class="step-h-line" ?data-done=${i}></div>
|
|
3071
|
-
<span class="step-icon" part="step-icon" aria-hidden="true">${
|
|
3089
|
+
<span class="step-icon" part="step-icon" aria-hidden="true">${fe(a.status, a.icon)}</span>
|
|
3072
3090
|
<div class="step-h-line" ?data-done=${s}></div>
|
|
3073
3091
|
</div>
|
|
3074
3092
|
<div class="step-label" part="step-label">${a.label}</div>
|
|
@@ -3094,11 +3112,11 @@ let M = class extends y {
|
|
|
3094
3112
|
return ft.has(t) ? t : "pending";
|
|
3095
3113
|
}
|
|
3096
3114
|
};
|
|
3097
|
-
|
|
3115
|
+
q.styles = [b, w`
|
|
3098
3116
|
:host {
|
|
3099
3117
|
display: block;
|
|
3100
3118
|
font-family: system-ui, -apple-system, sans-serif;
|
|
3101
|
-
container:
|
|
3119
|
+
container: uw-steps / inline-size;
|
|
3102
3120
|
}
|
|
3103
3121
|
|
|
3104
3122
|
/* ── Vertical Layout ── */
|
|
@@ -3282,7 +3300,7 @@ M.styles = [b, w`
|
|
|
3282
3300
|
.steps-horizontal[data-compact] .step-icon { width: 20px; height: 20px; font-size: 0.625rem; }
|
|
3283
3301
|
.steps-horizontal[data-compact] .step-label { font-size: 0.6875rem; margin-top: 4px; }
|
|
3284
3302
|
|
|
3285
|
-
@container
|
|
3303
|
+
@container uw-steps (max-width: 20rem) {
|
|
3286
3304
|
.step-label { font-size: 0.8125rem; }
|
|
3287
3305
|
.step-desc { font-size: 0.75rem; }
|
|
3288
3306
|
|
|
@@ -3326,15 +3344,15 @@ M.styles = [b, w`
|
|
|
3326
3344
|
}
|
|
3327
3345
|
}
|
|
3328
3346
|
`];
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
],
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
],
|
|
3335
|
-
|
|
3336
|
-
x("
|
|
3337
|
-
],
|
|
3347
|
+
se([
|
|
3348
|
+
f({ type: Object })
|
|
3349
|
+
], q.prototype, "spec", 2);
|
|
3350
|
+
se([
|
|
3351
|
+
f({ type: String, reflect: !0 })
|
|
3352
|
+
], q.prototype, "theme", 2);
|
|
3353
|
+
q = se([
|
|
3354
|
+
x("uw-steps")
|
|
3355
|
+
], q);
|
|
3338
3356
|
var ht = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, X = (e, t, a, r) => {
|
|
3339
3357
|
for (var i = r > 1 ? void 0 : r ? mt(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3340
3358
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
@@ -3363,7 +3381,7 @@ let E = class extends y {
|
|
|
3363
3381
|
@mouseleave=${i ? () => {
|
|
3364
3382
|
this._hoverIdx = -1;
|
|
3365
3383
|
} : void 0}>
|
|
3366
|
-
${Array.from({ length: r }, (g,
|
|
3384
|
+
${Array.from({ length: r }, (g, m) => this._renderIcon(m, p, c, s, i))}
|
|
3367
3385
|
</div>
|
|
3368
3386
|
${!i && a > 0 ? o`<span class="rating-value" part="rating-value">${a}</span>` : l}
|
|
3369
3387
|
${d != null ? o`<span class="rating-count" part="rating-count">(${d})</span>` : l}
|
|
@@ -3430,7 +3448,7 @@ E.styles = [b, w`
|
|
|
3430
3448
|
:host {
|
|
3431
3449
|
display: block;
|
|
3432
3450
|
font-family: system-ui, -apple-system, sans-serif;
|
|
3433
|
-
container:
|
|
3451
|
+
container: uw-rating / inline-size;
|
|
3434
3452
|
}
|
|
3435
3453
|
|
|
3436
3454
|
.rating {
|
|
@@ -3527,29 +3545,29 @@ E.styles = [b, w`
|
|
|
3527
3545
|
color: var(--u-widget-primary, #4f46e5);
|
|
3528
3546
|
}
|
|
3529
3547
|
|
|
3530
|
-
@container
|
|
3548
|
+
@container uw-rating (max-width: 20rem) {
|
|
3531
3549
|
.rating-icon { font-size: 1rem; }
|
|
3532
3550
|
.rating-value { font-size: 0.8125rem; }
|
|
3533
3551
|
}
|
|
3534
3552
|
`];
|
|
3535
3553
|
X([
|
|
3536
|
-
|
|
3554
|
+
f({ type: Object })
|
|
3537
3555
|
], E.prototype, "spec", 2);
|
|
3538
3556
|
X([
|
|
3539
|
-
|
|
3557
|
+
f({ type: String, reflect: !0 })
|
|
3540
3558
|
], E.prototype, "theme", 2);
|
|
3541
3559
|
X([
|
|
3542
3560
|
S()
|
|
3543
3561
|
], E.prototype, "_hoverIdx", 2);
|
|
3544
3562
|
E = X([
|
|
3545
|
-
x("
|
|
3563
|
+
x("uw-rating")
|
|
3546
3564
|
], E);
|
|
3547
|
-
var bt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor,
|
|
3565
|
+
var bt = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, ne = (e, t, a, r) => {
|
|
3548
3566
|
for (var i = r > 1 ? void 0 : r ? wt(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3549
3567
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
3550
3568
|
return r && i && bt(t, a, i), i;
|
|
3551
3569
|
};
|
|
3552
|
-
let
|
|
3570
|
+
let B = class extends y {
|
|
3553
3571
|
constructor() {
|
|
3554
3572
|
super(...arguments), this.spec = null, this.theme = null;
|
|
3555
3573
|
}
|
|
@@ -3583,11 +3601,11 @@ let T = class extends y {
|
|
|
3583
3601
|
return /^(javascript|data|vbscript):/i.test(t) ? "" : e;
|
|
3584
3602
|
}
|
|
3585
3603
|
};
|
|
3586
|
-
|
|
3604
|
+
B.styles = [b, w`
|
|
3587
3605
|
:host {
|
|
3588
3606
|
display: block;
|
|
3589
3607
|
font-family: system-ui, -apple-system, sans-serif;
|
|
3590
|
-
container:
|
|
3608
|
+
container: uw-video / inline-size;
|
|
3591
3609
|
}
|
|
3592
3610
|
|
|
3593
3611
|
.video-container {
|
|
@@ -3606,7 +3624,7 @@ T.styles = [b, w`
|
|
|
3606
3624
|
color: var(--u-widget-text-secondary, #64748b);
|
|
3607
3625
|
}
|
|
3608
3626
|
|
|
3609
|
-
@container
|
|
3627
|
+
@container uw-video (max-width: 20rem) {
|
|
3610
3628
|
video {
|
|
3611
3629
|
border-radius: 4px;
|
|
3612
3630
|
}
|
|
@@ -3617,21 +3635,21 @@ T.styles = [b, w`
|
|
|
3617
3635
|
}
|
|
3618
3636
|
}
|
|
3619
3637
|
`];
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
],
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
],
|
|
3626
|
-
|
|
3627
|
-
x("
|
|
3628
|
-
],
|
|
3629
|
-
var yt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor,
|
|
3638
|
+
ne([
|
|
3639
|
+
f({ type: Object })
|
|
3640
|
+
], B.prototype, "spec", 2);
|
|
3641
|
+
ne([
|
|
3642
|
+
f({ type: String, reflect: !0 })
|
|
3643
|
+
], B.prototype, "theme", 2);
|
|
3644
|
+
B = ne([
|
|
3645
|
+
x("uw-video")
|
|
3646
|
+
], B);
|
|
3647
|
+
var yt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, oe = (e, t, a, r) => {
|
|
3630
3648
|
for (var i = r > 1 ? void 0 : r ? xt(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3631
3649
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
3632
3650
|
return r && i && yt(t, a, i), i;
|
|
3633
3651
|
};
|
|
3634
|
-
let
|
|
3652
|
+
let W = class extends y {
|
|
3635
3653
|
constructor() {
|
|
3636
3654
|
super(...arguments), this.spec = null, this.theme = null;
|
|
3637
3655
|
}
|
|
@@ -3672,11 +3690,11 @@ let U = class extends y {
|
|
|
3672
3690
|
return /^(javascript|data|vbscript):/i.test(t) ? "" : e;
|
|
3673
3691
|
}
|
|
3674
3692
|
};
|
|
3675
|
-
|
|
3693
|
+
W.styles = [b, w`
|
|
3676
3694
|
:host {
|
|
3677
3695
|
display: block;
|
|
3678
3696
|
font-family: system-ui, -apple-system, sans-serif;
|
|
3679
|
-
container:
|
|
3697
|
+
container: uw-gallery / inline-size;
|
|
3680
3698
|
}
|
|
3681
3699
|
|
|
3682
3700
|
.gallery-grid {
|
|
@@ -3704,21 +3722,21 @@ U.styles = [b, w`
|
|
|
3704
3722
|
background: var(--u-widget-surface, #f1f5f9);
|
|
3705
3723
|
}
|
|
3706
3724
|
|
|
3707
|
-
@container
|
|
3725
|
+
@container uw-gallery (max-width: 20rem) {
|
|
3708
3726
|
.gallery-grid {
|
|
3709
3727
|
grid-template-columns: 1fr !important;
|
|
3710
3728
|
}
|
|
3711
3729
|
}
|
|
3712
3730
|
`];
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
],
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
],
|
|
3719
|
-
|
|
3720
|
-
x("
|
|
3721
|
-
],
|
|
3731
|
+
oe([
|
|
3732
|
+
f({ type: Object })
|
|
3733
|
+
], W.prototype, "spec", 2);
|
|
3734
|
+
oe([
|
|
3735
|
+
f({ type: String, reflect: !0 })
|
|
3736
|
+
], W.prototype, "theme", 2);
|
|
3737
|
+
W = oe([
|
|
3738
|
+
x("uw-gallery")
|
|
3739
|
+
], W);
|
|
3722
3740
|
var $t = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, J = (e, t, a, r) => {
|
|
3723
3741
|
for (var i = r > 1 ? void 0 : r ? _t(t, a) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3724
3742
|
(n = e[s]) && (i = (r ? n(t, a, i) : n(i)) || i);
|
|
@@ -3764,51 +3782,51 @@ let P = class extends y {
|
|
|
3764
3782
|
switch (t) {
|
|
3765
3783
|
case "metric":
|
|
3766
3784
|
case "stat-group":
|
|
3767
|
-
c = o`<
|
|
3785
|
+
c = o`<uw-metric .spec=${r} theme=${s ?? l}></uw-metric>`;
|
|
3768
3786
|
break;
|
|
3769
3787
|
case "gauge":
|
|
3770
3788
|
case "progress":
|
|
3771
|
-
c = o`<
|
|
3789
|
+
c = o`<uw-gauge .spec=${r} theme=${s ?? l}></uw-gauge>`;
|
|
3772
3790
|
break;
|
|
3773
3791
|
case "table":
|
|
3774
3792
|
case "list":
|
|
3775
|
-
c = o`<
|
|
3793
|
+
c = o`<uw-table .spec=${r} theme=${s ?? l}></uw-table>`;
|
|
3776
3794
|
break;
|
|
3777
3795
|
case "form":
|
|
3778
3796
|
case "confirm":
|
|
3779
|
-
c = o`<
|
|
3797
|
+
c = o`<uw-form .spec=${r} theme=${s ?? l}></uw-form>`;
|
|
3780
3798
|
break;
|
|
3781
3799
|
case "compose":
|
|
3782
|
-
c = o`<
|
|
3800
|
+
c = o`<uw-compose .spec=${r} theme=${s ?? l}></uw-compose>`;
|
|
3783
3801
|
break;
|
|
3784
3802
|
case "markdown":
|
|
3785
3803
|
case "image":
|
|
3786
3804
|
case "callout":
|
|
3787
|
-
c = o`<
|
|
3805
|
+
c = o`<uw-content .spec=${r} theme=${s ?? l}></uw-content>`;
|
|
3788
3806
|
break;
|
|
3789
3807
|
case "kv":
|
|
3790
|
-
c = o`<
|
|
3808
|
+
c = o`<uw-kv .spec=${r} theme=${s ?? l}></uw-kv>`;
|
|
3791
3809
|
break;
|
|
3792
3810
|
case "code":
|
|
3793
|
-
c = o`<
|
|
3811
|
+
c = o`<uw-code .spec=${r} theme=${s ?? l}></uw-code>`;
|
|
3794
3812
|
break;
|
|
3795
3813
|
case "citation":
|
|
3796
|
-
c = o`<
|
|
3814
|
+
c = o`<uw-citation .spec=${r} theme=${s ?? l}></uw-citation>`;
|
|
3797
3815
|
break;
|
|
3798
3816
|
case "status":
|
|
3799
|
-
c = o`<
|
|
3817
|
+
c = o`<uw-status .spec=${r} theme=${s ?? l}></uw-status>`;
|
|
3800
3818
|
break;
|
|
3801
3819
|
case "steps":
|
|
3802
|
-
c = o`<
|
|
3820
|
+
c = o`<uw-steps .spec=${r} theme=${s ?? l}></uw-steps>`;
|
|
3803
3821
|
break;
|
|
3804
3822
|
case "rating":
|
|
3805
|
-
c = o`<
|
|
3823
|
+
c = o`<uw-rating .spec=${r} theme=${s ?? l}></uw-rating>`;
|
|
3806
3824
|
break;
|
|
3807
3825
|
case "video":
|
|
3808
|
-
c = o`<
|
|
3826
|
+
c = o`<uw-video .spec=${r} theme=${s ?? l}></uw-video>`;
|
|
3809
3827
|
break;
|
|
3810
3828
|
case "gallery":
|
|
3811
|
-
c = o`<
|
|
3829
|
+
c = o`<uw-gallery .spec=${r} theme=${s ?? l}></uw-gallery>`;
|
|
3812
3830
|
break;
|
|
3813
3831
|
case "actions":
|
|
3814
3832
|
c = this.renderActionsWidget(r);
|
|
@@ -3820,21 +3838,21 @@ let P = class extends y {
|
|
|
3820
3838
|
c = this.renderHeader(r);
|
|
3821
3839
|
break;
|
|
3822
3840
|
default:
|
|
3823
|
-
if (t.startsWith("chart.") && customElements.get("
|
|
3824
|
-
c = o`<
|
|
3841
|
+
if (t.startsWith("chart.") && customElements.get("uw-chart")) {
|
|
3842
|
+
c = o`<uw-chart .spec=${r} theme=${s ?? l}></uw-chart>`;
|
|
3825
3843
|
break;
|
|
3826
3844
|
}
|
|
3827
3845
|
return this.renderFallback(r);
|
|
3828
3846
|
}
|
|
3829
3847
|
const g = !(t === "header" || t === "actions" || t === "divider" || t === "compose") && r.title ? o`<div class="widget-title" part="title">${r.title}</div>` : l;
|
|
3830
3848
|
if (!!r.options?.card ? c = o`<div class="card-container" part="card">${g}${c}</div>` : g !== l && (c = o`${g}${c}`), d.length > 0) {
|
|
3831
|
-
const u = d.map((
|
|
3849
|
+
const u = d.map((h) => o`
|
|
3832
3850
|
<button
|
|
3833
|
-
data-style=${
|
|
3834
|
-
?disabled=${
|
|
3835
|
-
@click=${() => this._dispatchAction(r,
|
|
3851
|
+
data-style=${h.style ?? "default"}
|
|
3852
|
+
?disabled=${h.disabled}
|
|
3853
|
+
@click=${() => this._dispatchAction(r, h)}
|
|
3836
3854
|
part="action-btn"
|
|
3837
|
-
>${
|
|
3855
|
+
>${h.label}</button>
|
|
3838
3856
|
`);
|
|
3839
3857
|
return o`<div part="widget-container">${c}<div class="global-actions" part="actions">${u}</div></div>`;
|
|
3840
3858
|
}
|
|
@@ -4100,7 +4118,7 @@ P.styles = [
|
|
|
4100
4118
|
`
|
|
4101
4119
|
];
|
|
4102
4120
|
J([
|
|
4103
|
-
|
|
4121
|
+
f({
|
|
4104
4122
|
type: Object,
|
|
4105
4123
|
converter: {
|
|
4106
4124
|
fromAttribute(e) {
|
|
@@ -4115,10 +4133,10 @@ J([
|
|
|
4115
4133
|
})
|
|
4116
4134
|
], P.prototype, "spec", 2);
|
|
4117
4135
|
J([
|
|
4118
|
-
|
|
4136
|
+
f({ type: String, reflect: !0 })
|
|
4119
4137
|
], P.prototype, "theme", 2);
|
|
4120
4138
|
J([
|
|
4121
|
-
|
|
4139
|
+
f({ type: String, reflect: !0 })
|
|
4122
4140
|
], P.prototype, "locale", 2);
|
|
4123
4141
|
P = J([
|
|
4124
4142
|
x("u-widget")
|
|
@@ -4126,11 +4144,11 @@ P = J([
|
|
|
4126
4144
|
export {
|
|
4127
4145
|
P as UWidget,
|
|
4128
4146
|
A as formatTemplate,
|
|
4129
|
-
|
|
4147
|
+
he as formatValue,
|
|
4130
4148
|
Ot as getDefaultLocale,
|
|
4131
4149
|
Pt as getEffectiveLocale,
|
|
4132
4150
|
be as getFormdownParser,
|
|
4133
|
-
|
|
4151
|
+
me as getLocaleStrings,
|
|
4134
4152
|
we as infer,
|
|
4135
4153
|
Dt as isWidgetSpec,
|
|
4136
4154
|
ye as normalize,
|