@iyulab/u-widgets 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -0
- package/dist/tokens-SjA7YdRs.js +213 -0
- package/dist/tokens-SjA7YdRs.js.map +1 -0
- package/dist/u-widgets-charts.js +230 -200
- package/dist/u-widgets-charts.js.map +1 -1
- package/dist/u-widgets-tools.js +9 -7
- package/dist/u-widgets-tools.js.map +1 -1
- package/dist/u-widgets.js +281 -404
- package/dist/u-widgets.js.map +1 -1
- package/package.json +1 -1
- package/dist/tokens-x1kDxgG8.js +0 -78
- package/dist/tokens-x1kDxgG8.js.map +0 -1
package/dist/u-widgets.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { p as
|
|
3
|
-
import { i as
|
|
4
|
-
import { t as b, n as
|
|
1
|
+
import { g as ve } from "./formdown-BWJ6QGJs.js";
|
|
2
|
+
import { p as jt, r as Ct } from "./formdown-BWJ6QGJs.js";
|
|
3
|
+
import { i as be } from "./infer-CNOiD2dS.js";
|
|
4
|
+
import { t as b, f as he, n as we } from "./tokens-SjA7YdRs.js";
|
|
5
5
|
import { css as w, LitElement as y, nothing as l, html as o } from "lit";
|
|
6
|
-
import { property as
|
|
7
|
-
const
|
|
6
|
+
import { property as h, customElement as x, state as S } from "lit/decorators.js";
|
|
7
|
+
const ye = /* @__PURE__ */ new Set([
|
|
8
8
|
"text",
|
|
9
9
|
"email",
|
|
10
10
|
"password",
|
|
@@ -21,7 +21,7 @@ const xe = /* @__PURE__ */ new Set([
|
|
|
21
21
|
"range",
|
|
22
22
|
"radio",
|
|
23
23
|
"checkbox"
|
|
24
|
-
]), le = 10,
|
|
24
|
+
]), le = 10, xe = /* @__PURE__ */ new Set([
|
|
25
25
|
"stat-group",
|
|
26
26
|
"table",
|
|
27
27
|
"list",
|
|
@@ -38,8 +38,8 @@ const xe = /* @__PURE__ */ new Set([
|
|
|
38
38
|
"chart.funnel",
|
|
39
39
|
"chart.waterfall",
|
|
40
40
|
"chart.treemap"
|
|
41
|
-
]),
|
|
42
|
-
function
|
|
41
|
+
]), $e = /* @__PURE__ */ new Set(["metric", "gauge", "progress", "header", "code", "rating", "video"]);
|
|
42
|
+
function Z(e, t = 0) {
|
|
43
43
|
const i = [], r = [];
|
|
44
44
|
if (t > le)
|
|
45
45
|
return { valid: !1, errors: ["compose children exceed maximum nesting depth (" + le + ")"], warnings: r };
|
|
@@ -49,7 +49,7 @@ function Y(e, t = 0) {
|
|
|
49
49
|
if (typeof a.widget != "string" || a.widget.length === 0)
|
|
50
50
|
return i.push('Required field "widget" must be a non-empty string'), { valid: !1, errors: i, warnings: r };
|
|
51
51
|
const s = a.widget;
|
|
52
|
-
if (t === 0 && a.type !== void 0 && a.type !== "u-widget" && i.push('"type" must be "u-widget" if specified'), a.fields !== void 0 && a.formdown !== void 0 && i.push('"fields" and "formdown" are mutually exclusive'), a.data !== void 0 && (
|
|
52
|
+
if (t === 0 && a.type !== void 0 && a.type !== "u-widget" && i.push('"type" must be "u-widget" if specified'), a.fields !== void 0 && a.formdown !== void 0 && i.push('"fields" and "formdown" are mutually exclusive'), a.data !== void 0 && (xe.has(s) && !Array.isArray(a.data) && i.push(`"${s}" expects "data" to be an array, got ${typeof a.data}`), $e.has(s) && (Array.isArray(a.data) || typeof a.data != "object") && i.push(`"${s}" expects "data" to be an object, got ${Array.isArray(a.data) ? "array" : typeof a.data}`)), s === "compose") {
|
|
53
53
|
if (!Array.isArray(a.children))
|
|
54
54
|
i.push('"compose" widget requires a "children" array');
|
|
55
55
|
else
|
|
@@ -58,7 +58,7 @@ function Y(e, t = 0) {
|
|
|
58
58
|
if (d == null || typeof d != "object" || typeof d.widget != "string")
|
|
59
59
|
i.push(`children[${n}] must be an object with a "widget" field`);
|
|
60
60
|
else {
|
|
61
|
-
const c =
|
|
61
|
+
const c = Z(d, t + 1);
|
|
62
62
|
c.valid || i.push(...c.errors.map((p) => `children[${n}]: ${p}`)), r.push(...c.warnings.map((p) => `children[${n}]: ${p}`));
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -70,11 +70,11 @@ function Y(e, t = 0) {
|
|
|
70
70
|
if (Array.isArray(a.fields))
|
|
71
71
|
for (let n = 0; n < a.fields.length; n++) {
|
|
72
72
|
const d = a.fields[n];
|
|
73
|
-
d == null || typeof d != "object" || typeof d.field != "string" ? i.push(`fields[${n}] must have a "field" string property`) : d.type != null && !
|
|
73
|
+
d == null || typeof d != "object" || typeof d.field != "string" ? i.push(`fields[${n}] must have a "field" string property`) : d.type != null && !ye.has(d.type) && r.push(`fields[${n}].type "${d.type}" is not a recognized field type`);
|
|
74
74
|
}
|
|
75
75
|
if (typeof a.formdown == "string" && a.formdown.length > 0 && !a.fields)
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
ve()(a.formdown);
|
|
78
78
|
} catch {
|
|
79
79
|
r.push("formdown string could not be parsed — check syntax");
|
|
80
80
|
}
|
|
@@ -84,7 +84,7 @@ function Y(e, t = 0) {
|
|
|
84
84
|
(d == null || typeof d != "object" || typeof d.label != "string" || typeof d.action != "string") && i.push(`actions[${n}] must have "label" and "action" string properties`);
|
|
85
85
|
}
|
|
86
86
|
if (a.mapping && typeof a.mapping == "object" && a.data) {
|
|
87
|
-
const n = a.mapping, d =
|
|
87
|
+
const n = a.mapping, d = _e(a.data);
|
|
88
88
|
if (d)
|
|
89
89
|
for (const c of ["x", "y", "label", "value", "color", "size", "axis", "primary", "secondary", "icon", "avatar", "trailing"]) {
|
|
90
90
|
const p = n[c];
|
|
@@ -95,139 +95,16 @@ function Y(e, t = 0) {
|
|
|
95
95
|
}
|
|
96
96
|
return { valid: i.length === 0, errors: i, warnings: r };
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function _e(e) {
|
|
99
99
|
if (Array.isArray(e) && e.length > 0 && e[0] && typeof e[0] == "object")
|
|
100
100
|
return new Set(Object.keys(e[0]));
|
|
101
101
|
if (e && typeof e == "object" && !Array.isArray(e))
|
|
102
102
|
return new Set(Object.keys(e));
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
104
|
+
function xt(e) {
|
|
105
|
+
return Z(e).valid;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
108
|
-
"KRW",
|
|
109
|
-
"JPY",
|
|
110
|
-
"VND",
|
|
111
|
-
"IDR",
|
|
112
|
-
"BIF",
|
|
113
|
-
"CLP",
|
|
114
|
-
"GNF",
|
|
115
|
-
"ISK",
|
|
116
|
-
"KMF",
|
|
117
|
-
"MGA",
|
|
118
|
-
"PYG",
|
|
119
|
-
"RWF",
|
|
120
|
-
"UGX",
|
|
121
|
-
"UYI",
|
|
122
|
-
"VUV",
|
|
123
|
-
"XAF",
|
|
124
|
-
"XOF",
|
|
125
|
-
"XPF"
|
|
126
|
-
]);
|
|
127
|
-
function he(e, t, i) {
|
|
128
|
-
if (e == null) return "";
|
|
129
|
-
const [r, a] = t?.split(":") ?? [];
|
|
130
|
-
switch (r) {
|
|
131
|
-
case "number":
|
|
132
|
-
return Se(e, i);
|
|
133
|
-
case "currency":
|
|
134
|
-
return Ae(e, a, i);
|
|
135
|
-
case "percent":
|
|
136
|
-
return Ce(e, i);
|
|
137
|
-
case "date":
|
|
138
|
-
return De(e, i);
|
|
139
|
-
case "datetime":
|
|
140
|
-
return je(e, i);
|
|
141
|
-
case "bytes":
|
|
142
|
-
return Oe(e);
|
|
143
|
-
default:
|
|
144
|
-
return String(e);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function Se(e, t) {
|
|
148
|
-
const i = Number(e);
|
|
149
|
-
return isNaN(i) ? String(e) : new Intl.NumberFormat(t).format(i);
|
|
150
|
-
}
|
|
151
|
-
function Ae(e, t, i) {
|
|
152
|
-
const r = Number(e);
|
|
153
|
-
if (isNaN(r)) return String(e);
|
|
154
|
-
const a = t || "USD";
|
|
155
|
-
try {
|
|
156
|
-
const s = ze.has(a.toUpperCase());
|
|
157
|
-
return new Intl.NumberFormat(i, {
|
|
158
|
-
style: "currency",
|
|
159
|
-
currency: a,
|
|
160
|
-
...s && {
|
|
161
|
-
minimumFractionDigits: 0,
|
|
162
|
-
maximumFractionDigits: 0
|
|
163
|
-
}
|
|
164
|
-
}).format(r);
|
|
165
|
-
} catch {
|
|
166
|
-
return new Intl.NumberFormat(i, {
|
|
167
|
-
style: "currency",
|
|
168
|
-
currency: "USD"
|
|
169
|
-
}).format(r);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function Ce(e, t) {
|
|
173
|
-
const i = Number(e);
|
|
174
|
-
if (isNaN(i)) return String(e);
|
|
175
|
-
if (t)
|
|
176
|
-
try {
|
|
177
|
-
return new Intl.NumberFormat(t, {
|
|
178
|
-
style: "percent",
|
|
179
|
-
maximumFractionDigits: 2
|
|
180
|
-
}).format(i / 100);
|
|
181
|
-
} catch {
|
|
182
|
-
}
|
|
183
|
-
return i + "%";
|
|
184
|
-
}
|
|
185
|
-
function De(e, t) {
|
|
186
|
-
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}/.test(e)) {
|
|
187
|
-
if (t)
|
|
188
|
-
try {
|
|
189
|
-
const i = new Date(e);
|
|
190
|
-
if (!isNaN(i.getTime()))
|
|
191
|
-
return new Intl.DateTimeFormat(t, {
|
|
192
|
-
year: "numeric",
|
|
193
|
-
month: "2-digit",
|
|
194
|
-
day: "2-digit"
|
|
195
|
-
}).format(i);
|
|
196
|
-
} catch {
|
|
197
|
-
}
|
|
198
|
-
return e.slice(0, 10);
|
|
199
|
-
}
|
|
200
|
-
return String(e);
|
|
201
|
-
}
|
|
202
|
-
function je(e, t) {
|
|
203
|
-
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}/.test(e)) {
|
|
204
|
-
if (t)
|
|
205
|
-
try {
|
|
206
|
-
const i = new Date(e);
|
|
207
|
-
if (!isNaN(i.getTime()))
|
|
208
|
-
return new Intl.DateTimeFormat(t, {
|
|
209
|
-
year: "numeric",
|
|
210
|
-
month: "2-digit",
|
|
211
|
-
day: "2-digit",
|
|
212
|
-
hour: "2-digit",
|
|
213
|
-
minute: "2-digit"
|
|
214
|
-
}).format(i);
|
|
215
|
-
} catch {
|
|
216
|
-
}
|
|
217
|
-
return e.slice(0, 16).replace("T", " ");
|
|
218
|
-
}
|
|
219
|
-
return String(e);
|
|
220
|
-
}
|
|
221
|
-
function Oe(e) {
|
|
222
|
-
const t = Number(e);
|
|
223
|
-
if (isNaN(t)) return String(e);
|
|
224
|
-
const i = t < 0 ? "-" : "";
|
|
225
|
-
let r = Math.abs(t), a = 0;
|
|
226
|
-
for (; r >= 1024 && a < ce.length - 1; )
|
|
227
|
-
r /= 1024, a++;
|
|
228
|
-
return i + (a === 0 ? r : r.toFixed(1)) + " " + ce[a];
|
|
229
|
-
}
|
|
230
|
-
const Ee = [
|
|
107
|
+
const ke = [
|
|
231
108
|
"chart.bar",
|
|
232
109
|
"chart.line",
|
|
233
110
|
"chart.area",
|
|
@@ -263,19 +140,19 @@ const Ee = [
|
|
|
263
140
|
"divider",
|
|
264
141
|
"header"
|
|
265
142
|
];
|
|
266
|
-
function
|
|
143
|
+
function ze(e) {
|
|
267
144
|
if (!e) return;
|
|
268
145
|
const t = e.toLowerCase();
|
|
269
146
|
let i, r = 1 / 0;
|
|
270
|
-
for (const s of
|
|
271
|
-
const n =
|
|
147
|
+
for (const s of ke) {
|
|
148
|
+
const n = Se(t, s);
|
|
272
149
|
n < r && (r = n, i = s);
|
|
273
150
|
}
|
|
274
151
|
const a = Math.min(3, Math.floor(t.length / 2));
|
|
275
152
|
if (r <= a && r > 0)
|
|
276
153
|
return i;
|
|
277
154
|
}
|
|
278
|
-
function
|
|
155
|
+
function Se(e, t) {
|
|
279
156
|
const i = e.length, r = t.length;
|
|
280
157
|
if (i === 0) return r;
|
|
281
158
|
if (r === 0) return i;
|
|
@@ -319,10 +196,10 @@ const K = {
|
|
|
319
196
|
invalidUrl: "{label} must be a valid URL",
|
|
320
197
|
invalidPattern: "{label} format is invalid"
|
|
321
198
|
}, L = /* @__PURE__ */ new Map();
|
|
322
|
-
function
|
|
199
|
+
function $t(e, t) {
|
|
323
200
|
L.set(e.toLowerCase(), { ...K, ...t });
|
|
324
201
|
}
|
|
325
|
-
function
|
|
202
|
+
function fe(e) {
|
|
326
203
|
if (!e) return K;
|
|
327
204
|
const t = e.toLowerCase();
|
|
328
205
|
if (L.has(t)) return L.get(t);
|
|
@@ -335,28 +212,28 @@ function A(e, t) {
|
|
|
335
212
|
(i, r) => t[r] != null ? String(t[r]) : `{${r}}`
|
|
336
213
|
);
|
|
337
214
|
}
|
|
338
|
-
function
|
|
215
|
+
function _t() {
|
|
339
216
|
return { ...K };
|
|
340
217
|
}
|
|
341
218
|
let V;
|
|
342
|
-
function
|
|
219
|
+
function kt(e) {
|
|
343
220
|
V = e;
|
|
344
221
|
}
|
|
345
|
-
function
|
|
222
|
+
function zt() {
|
|
346
223
|
return V;
|
|
347
224
|
}
|
|
348
|
-
function
|
|
225
|
+
function Ae(e) {
|
|
349
226
|
if (e) return e;
|
|
350
227
|
if (V) return V;
|
|
351
228
|
if (typeof document < "u" && document.documentElement?.lang)
|
|
352
229
|
return document.documentElement.lang;
|
|
353
230
|
}
|
|
354
|
-
var
|
|
355
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
231
|
+
var je = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, X = (e, t, i, r) => {
|
|
232
|
+
for (var a = r > 1 ? void 0 : r ? Ce(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
356
233
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
357
|
-
return r && a &&
|
|
234
|
+
return r && a && je(t, i, a), a;
|
|
358
235
|
};
|
|
359
|
-
function
|
|
236
|
+
function ce(e, t) {
|
|
360
237
|
const i = e.value, r = e.format;
|
|
361
238
|
return {
|
|
362
239
|
value: r ? he(i, r, t) : i ?? 0,
|
|
@@ -379,13 +256,13 @@ let I = class extends y {
|
|
|
379
256
|
render() {
|
|
380
257
|
if (!this.spec?.data) return l;
|
|
381
258
|
const e = this.spec.options?.locale;
|
|
382
|
-
return this.spec.widget === "stat-group" ? this.renderStatGroup(e) : this.renderMetric(
|
|
259
|
+
return this.spec.widget === "stat-group" ? this.renderStatGroup(e) : this.renderMetric(ce(this.spec.data, e));
|
|
383
260
|
}
|
|
384
261
|
renderStatGroup(e) {
|
|
385
262
|
const t = this.spec.data;
|
|
386
263
|
return Array.isArray(t) ? o`
|
|
387
264
|
<div class="stat-group" part="stat-group">
|
|
388
|
-
${t.map((i) => this.renderMetric(
|
|
265
|
+
${t.map((i) => this.renderMetric(ce(i, e)))}
|
|
389
266
|
</div>
|
|
390
267
|
` : l;
|
|
391
268
|
}
|
|
@@ -473,7 +350,7 @@ I.styles = [b, w`
|
|
|
473
350
|
.metric[data-variant="success"] .metric-value { color: var(--u-widget-positive, #16a34a); }
|
|
474
351
|
.metric[data-variant="danger"] .metric-value { color: var(--u-widget-negative, #dc2626); }
|
|
475
352
|
.metric[data-variant="warning"] .metric-value { color: var(--u-widget-warning, #d97706); }
|
|
476
|
-
.metric[data-variant="info"] .metric-value { color: var(--u-widget-primary, #
|
|
353
|
+
.metric[data-variant="info"] .metric-value { color: var(--u-widget-primary, #4f46e5); }
|
|
477
354
|
.metric[data-variant="neutral"] .metric-value { color: var(--u-widget-text-secondary, #64748b); }
|
|
478
355
|
|
|
479
356
|
/* ── stat-group ── */
|
|
@@ -513,27 +390,27 @@ I.styles = [b, w`
|
|
|
513
390
|
}
|
|
514
391
|
}
|
|
515
392
|
`];
|
|
516
|
-
|
|
517
|
-
|
|
393
|
+
X([
|
|
394
|
+
h({ type: Object })
|
|
518
395
|
], I.prototype, "spec", 2);
|
|
519
|
-
|
|
520
|
-
|
|
396
|
+
X([
|
|
397
|
+
h({ type: String, reflect: !0 })
|
|
521
398
|
], I.prototype, "theme", 2);
|
|
522
|
-
I =
|
|
399
|
+
I = X([
|
|
523
400
|
x("uw-metric")
|
|
524
401
|
], I);
|
|
525
|
-
var
|
|
526
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
402
|
+
var Oe = Object.defineProperty, De = Object.getOwnPropertyDescriptor, Y = (e, t, i, r) => {
|
|
403
|
+
for (var a = r > 1 ? void 0 : r ? De(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
527
404
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
528
|
-
return r && a &&
|
|
405
|
+
return r && a && Oe(t, i, a), a;
|
|
529
406
|
};
|
|
530
|
-
const
|
|
407
|
+
const Ee = {
|
|
531
408
|
min: 0,
|
|
532
409
|
max: 100,
|
|
533
410
|
unit: "",
|
|
534
411
|
subtitle: "",
|
|
535
412
|
thresholds: []
|
|
536
|
-
},
|
|
413
|
+
}, Pe = {
|
|
537
414
|
green: "#16a34a",
|
|
538
415
|
yellow: "#eab308",
|
|
539
416
|
orange: "#f97316",
|
|
@@ -541,14 +418,14 @@ const Ue = {
|
|
|
541
418
|
blue: "#2563eb",
|
|
542
419
|
gray: "#6b7280"
|
|
543
420
|
};
|
|
544
|
-
function
|
|
545
|
-
return
|
|
421
|
+
function de(e) {
|
|
422
|
+
return Pe[e] ?? e;
|
|
546
423
|
}
|
|
547
|
-
function
|
|
424
|
+
function pe(e, t, i, r, a) {
|
|
548
425
|
const s = (r - 90) * Math.PI / 180, n = (a - 90) * Math.PI / 180, d = e + i * Math.cos(s), c = t + i * Math.sin(s), p = e + i * Math.cos(n), g = t + i * Math.sin(n), m = a - r > 180 ? 1 : 0;
|
|
549
426
|
return `M ${d} ${c} A ${i} ${i} 0 ${m} 1 ${p} ${g}`;
|
|
550
427
|
}
|
|
551
|
-
let
|
|
428
|
+
let M = class extends y {
|
|
552
429
|
constructor() {
|
|
553
430
|
super(...arguments), this.spec = null, this.theme = null;
|
|
554
431
|
}
|
|
@@ -557,7 +434,7 @@ let N = class extends y {
|
|
|
557
434
|
}
|
|
558
435
|
getOptions() {
|
|
559
436
|
const e = this.spec.options ?? {};
|
|
560
|
-
return { ...
|
|
437
|
+
return { ...Ee, ...e };
|
|
561
438
|
}
|
|
562
439
|
getValue() {
|
|
563
440
|
const e = this.spec.data;
|
|
@@ -572,7 +449,7 @@ let N = class extends y {
|
|
|
572
449
|
return i[i.length - 1].label ?? "";
|
|
573
450
|
}
|
|
574
451
|
renderGauge() {
|
|
575
|
-
const e = this.getOptions(), t = this.getValue(), i = e.max - e.min, r = i > 0 ? Math.max(0, Math.min(1, (t - e.min) / i)) : 0, a = this.getThresholdColor(t, e), s = this.getActiveLabel(t, e), n = 100, d = 100, c = 80, p = 150, g = 240, m = p + g * r, u =
|
|
452
|
+
const e = this.getOptions(), t = this.getValue(), i = e.max - e.min, r = i > 0 ? Math.max(0, Math.min(1, (t - e.min) / i)) : 0, a = this.getThresholdColor(t, e), s = this.getActiveLabel(t, e), n = 100, d = 100, c = 80, p = 150, g = 240, m = p + g * r, u = pe(n, d, c, p, p + g), f = r > 0 ? pe(n, d, c, p, m) : null, v = typeof this.spec.title == "string" ? this.spec.title : "Gauge", $ = s ? `${t}${e.unit} ${s}` : `${t}${e.unit}`;
|
|
576
453
|
return o`
|
|
577
454
|
<div class="gauge-container" part="gauge"
|
|
578
455
|
role="meter"
|
|
@@ -590,7 +467,7 @@ let N = class extends y {
|
|
|
590
467
|
</div>
|
|
591
468
|
<svg class="gauge-svg" viewBox="0 0 200 195" role="presentation" aria-hidden="true">
|
|
592
469
|
<path class="gauge-track" d="${u}" fill="none" stroke-width="12" stroke-linecap="round"></path>
|
|
593
|
-
<path class="gauge-fill" d="${
|
|
470
|
+
<path class="gauge-fill" d="${f ?? "M0 0"}" fill="none" stroke="${f ? a : "none"}" stroke-width="12" stroke-linecap="round"></path>
|
|
594
471
|
</svg>
|
|
595
472
|
</div>
|
|
596
473
|
</div>
|
|
@@ -628,11 +505,11 @@ let N = class extends y {
|
|
|
628
505
|
if (!t.thresholds?.length) return "var(--u-widget-primary, #4f46e5)";
|
|
629
506
|
const i = [...t.thresholds].sort((r, a) => r.to - a.to);
|
|
630
507
|
for (const r of i)
|
|
631
|
-
if (e <= r.to) return
|
|
632
|
-
return
|
|
508
|
+
if (e <= r.to) return de(r.color);
|
|
509
|
+
return de(i[i.length - 1].color);
|
|
633
510
|
}
|
|
634
511
|
};
|
|
635
|
-
|
|
512
|
+
M.styles = [b, w`
|
|
636
513
|
:host {
|
|
637
514
|
display: block;
|
|
638
515
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -745,19 +622,19 @@ N.styles = [b, w`
|
|
|
745
622
|
}
|
|
746
623
|
}
|
|
747
624
|
`];
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
],
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
],
|
|
754
|
-
|
|
625
|
+
Y([
|
|
626
|
+
h({ type: Object })
|
|
627
|
+
], M.prototype, "spec", 2);
|
|
628
|
+
Y([
|
|
629
|
+
h({ type: String, reflect: !0 })
|
|
630
|
+
], M.prototype, "theme", 2);
|
|
631
|
+
M = Y([
|
|
755
632
|
x("uw-gauge")
|
|
756
|
-
],
|
|
757
|
-
var
|
|
758
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
633
|
+
], M);
|
|
634
|
+
var Le = Object.defineProperty, Ie = Object.getOwnPropertyDescriptor, j = (e, t, i, r) => {
|
|
635
|
+
for (var a = r > 1 ? void 0 : r ? Ie(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
759
636
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
760
|
-
return r && a &&
|
|
637
|
+
return r && a && Le(t, i, a), a;
|
|
761
638
|
};
|
|
762
639
|
let _ = class extends y {
|
|
763
640
|
constructor() {
|
|
@@ -825,7 +702,7 @@ let _ = class extends y {
|
|
|
825
702
|
}
|
|
826
703
|
get _locale() {
|
|
827
704
|
const e = this.spec?.options?.locale;
|
|
828
|
-
return
|
|
705
|
+
return fe(typeof e == "string" ? e : void 0);
|
|
829
706
|
}
|
|
830
707
|
renderTable() {
|
|
831
708
|
const e = this.spec.data, t = this.getColumns(e), i = this._locale, r = this.spec.options?.sortable !== !1, a = !!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 = a ? o`
|
|
@@ -839,7 +716,7 @@ let _ = class extends y {
|
|
|
839
716
|
@input=${this._onSearch}
|
|
840
717
|
/>
|
|
841
718
|
</div>
|
|
842
|
-
` : l,
|
|
719
|
+
` : l, f = n > 0 && p > 1 ? o`
|
|
843
720
|
<nav class="pagination" part="pagination" aria-label=${i.tablePagination}>
|
|
844
721
|
<button aria-label=${i.previousPage} ?disabled=${g === 0} @click=${() => this._onPageChange(g - 1)}>${i.prev}</button>
|
|
845
722
|
<span aria-live="polite">${g + 1} / ${p}</span>
|
|
@@ -889,7 +766,7 @@ let _ = class extends y {
|
|
|
889
766
|
</tbody>
|
|
890
767
|
</table>
|
|
891
768
|
</div>
|
|
892
|
-
${
|
|
769
|
+
${f}
|
|
893
770
|
</div>`;
|
|
894
771
|
}
|
|
895
772
|
_onPageChange(e) {
|
|
@@ -1289,36 +1166,36 @@ _.styles = [b, w`
|
|
|
1289
1166
|
}
|
|
1290
1167
|
}
|
|
1291
1168
|
`];
|
|
1292
|
-
|
|
1293
|
-
|
|
1169
|
+
j([
|
|
1170
|
+
h({ type: Object })
|
|
1294
1171
|
], _.prototype, "spec", 2);
|
|
1295
|
-
|
|
1296
|
-
|
|
1172
|
+
j([
|
|
1173
|
+
h({ type: String, reflect: !0 })
|
|
1297
1174
|
], _.prototype, "theme", 2);
|
|
1298
|
-
|
|
1175
|
+
j([
|
|
1299
1176
|
S()
|
|
1300
1177
|
], _.prototype, "_sortField", 2);
|
|
1301
|
-
|
|
1178
|
+
j([
|
|
1302
1179
|
S()
|
|
1303
1180
|
], _.prototype, "_sortDir", 2);
|
|
1304
|
-
|
|
1181
|
+
j([
|
|
1305
1182
|
S()
|
|
1306
1183
|
], _.prototype, "_page", 2);
|
|
1307
|
-
|
|
1184
|
+
j([
|
|
1308
1185
|
S()
|
|
1309
1186
|
], _.prototype, "_searchQuery", 2);
|
|
1310
|
-
|
|
1187
|
+
j([
|
|
1311
1188
|
S()
|
|
1312
1189
|
], _.prototype, "_focusedIdx", 2);
|
|
1313
|
-
_ =
|
|
1190
|
+
_ = j([
|
|
1314
1191
|
x("uw-table")
|
|
1315
1192
|
], _);
|
|
1316
|
-
var
|
|
1317
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
1193
|
+
var Me = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, H = (e, t, i, r) => {
|
|
1194
|
+
for (var a = r > 1 ? void 0 : r ? Te(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1318
1195
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
1319
|
-
return r && a &&
|
|
1196
|
+
return r && a && Me(t, i, a), a;
|
|
1320
1197
|
};
|
|
1321
|
-
let
|
|
1198
|
+
let C = class extends y {
|
|
1322
1199
|
constructor() {
|
|
1323
1200
|
super(...arguments), this.spec = null, this.theme = null, this._formData = {}, this._errors = {}, this._onFormSubmit = (e) => {
|
|
1324
1201
|
e.preventDefault();
|
|
@@ -1546,7 +1423,7 @@ let D = class extends y {
|
|
|
1546
1423
|
}
|
|
1547
1424
|
get _locale() {
|
|
1548
1425
|
const e = this.spec?.options?.locale;
|
|
1549
|
-
return
|
|
1426
|
+
return fe(typeof e == "string" ? e : void 0);
|
|
1550
1427
|
}
|
|
1551
1428
|
_validate() {
|
|
1552
1429
|
const e = this.spec?.fields ?? [], t = {}, i = this._locale;
|
|
@@ -1610,7 +1487,7 @@ let D = class extends y {
|
|
|
1610
1487
|
);
|
|
1611
1488
|
}
|
|
1612
1489
|
};
|
|
1613
|
-
|
|
1490
|
+
C.styles = [b, w`
|
|
1614
1491
|
:host {
|
|
1615
1492
|
display: block;
|
|
1616
1493
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -1829,26 +1706,26 @@ D.styles = [b, w`
|
|
|
1829
1706
|
}
|
|
1830
1707
|
`];
|
|
1831
1708
|
H([
|
|
1832
|
-
|
|
1833
|
-
],
|
|
1709
|
+
h({ type: Object })
|
|
1710
|
+
], C.prototype, "spec", 2);
|
|
1834
1711
|
H([
|
|
1835
|
-
|
|
1836
|
-
],
|
|
1712
|
+
h({ type: String, reflect: !0 })
|
|
1713
|
+
], C.prototype, "theme", 2);
|
|
1837
1714
|
H([
|
|
1838
1715
|
S()
|
|
1839
|
-
],
|
|
1716
|
+
], C.prototype, "_formData", 2);
|
|
1840
1717
|
H([
|
|
1841
1718
|
S()
|
|
1842
|
-
],
|
|
1843
|
-
|
|
1719
|
+
], C.prototype, "_errors", 2);
|
|
1720
|
+
C = H([
|
|
1844
1721
|
x("uw-form")
|
|
1845
|
-
],
|
|
1846
|
-
var
|
|
1847
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
1722
|
+
], C);
|
|
1723
|
+
var Ne = Object.defineProperty, Fe = Object.getOwnPropertyDescriptor, ee = (e, t, i, r) => {
|
|
1724
|
+
for (var a = r > 1 ? void 0 : r ? Fe(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1848
1725
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
1849
|
-
return r && a &&
|
|
1726
|
+
return r && a && Ne(t, i, a), a;
|
|
1850
1727
|
};
|
|
1851
|
-
let
|
|
1728
|
+
let T = class extends y {
|
|
1852
1729
|
constructor() {
|
|
1853
1730
|
super(...arguments), this.spec = null, this.theme = null;
|
|
1854
1731
|
}
|
|
@@ -1888,7 +1765,7 @@ let F = class extends y {
|
|
|
1888
1765
|
return r ? o`<div class=${d} style=${r} part="child">${n}</div>` : o`<div class=${d} part="child">${n}</div>`;
|
|
1889
1766
|
}
|
|
1890
1767
|
};
|
|
1891
|
-
|
|
1768
|
+
T.styles = [b, w`
|
|
1892
1769
|
:host {
|
|
1893
1770
|
display: block;
|
|
1894
1771
|
container: uw-compose / inline-size;
|
|
@@ -1990,20 +1867,20 @@ F.styles = [b, w`
|
|
|
1990
1867
|
}
|
|
1991
1868
|
`];
|
|
1992
1869
|
ee([
|
|
1993
|
-
|
|
1994
|
-
],
|
|
1870
|
+
h({ type: Object })
|
|
1871
|
+
], T.prototype, "spec", 2);
|
|
1995
1872
|
ee([
|
|
1996
|
-
|
|
1997
|
-
],
|
|
1998
|
-
|
|
1873
|
+
h({ type: String, reflect: !0 })
|
|
1874
|
+
], T.prototype, "theme", 2);
|
|
1875
|
+
T = ee([
|
|
1999
1876
|
x("uw-compose")
|
|
2000
|
-
],
|
|
2001
|
-
var
|
|
2002
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
1877
|
+
], T);
|
|
1878
|
+
var Ue = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, te = (e, t, i, r) => {
|
|
1879
|
+
for (var a = r > 1 ? void 0 : r ? Re(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2003
1880
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
2004
|
-
return r && a &&
|
|
1881
|
+
return r && a && Ue(t, i, a), a;
|
|
2005
1882
|
};
|
|
2006
|
-
let
|
|
1883
|
+
let N = class extends y {
|
|
2007
1884
|
constructor() {
|
|
2008
1885
|
super(...arguments), this.spec = null, this.theme = null;
|
|
2009
1886
|
}
|
|
@@ -2053,8 +1930,8 @@ let M = class extends y {
|
|
|
2053
1930
|
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, (i) => `<pre><code>${i.slice(3, -3).replace(/^\w*\n/, "")}</code></pre>`), t = t.replace(
|
|
2054
1931
|
/^(\|.+\|)\n(\|[\s:|-]+\|)\n((?:\|.+\|\n?)+)/gm,
|
|
2055
1932
|
(i, r, a, s) => {
|
|
2056
|
-
const n = (u) => u.split("|").slice(1, -1).map((
|
|
2057
|
-
`).map(n), g = d.map((u,
|
|
1933
|
+
const n = (u) => u.split("|").slice(1, -1).map((f) => f.trim()), d = n(r), c = n(a).map((u) => u.startsWith(":") && u.endsWith(":") ? "center" : u.endsWith(":") ? "right" : "left"), p = s.trim().split(`
|
|
1934
|
+
`).map(n), g = d.map((u, f) => `<th scope="col" style="text-align:${c[f] ?? "left"}">${u}</th>`).join(""), m = p.map((u) => "<tr>" + u.map((f, v) => `<td style="text-align:${c[v] ?? "left"}">${f}</td>`).join("") + "</tr>").join("");
|
|
2058
1935
|
return `<table><thead><tr>${g}</tr></thead><tbody>${m}</tbody></table>`;
|
|
2059
1936
|
}
|
|
2060
1937
|
), 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(
|
|
@@ -2071,7 +1948,7 @@ let M = class extends y {
|
|
|
2071
1948
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2072
1949
|
}
|
|
2073
1950
|
};
|
|
2074
|
-
|
|
1951
|
+
N.styles = [b, w`
|
|
2075
1952
|
:host {
|
|
2076
1953
|
display: block;
|
|
2077
1954
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -2201,26 +2078,26 @@ M.styles = [b, w`
|
|
|
2201
2078
|
}
|
|
2202
2079
|
|
|
2203
2080
|
.callout-info {
|
|
2204
|
-
background: color-mix(in srgb, var(--u-widget-primary, #
|
|
2205
|
-
border-left-color: var(--u-widget-primary, #
|
|
2081
|
+
background: color-mix(in srgb, var(--u-widget-primary, #4f46e5) 12%, var(--u-widget-bg, #fff));
|
|
2082
|
+
border-left-color: var(--u-widget-primary, #4f46e5);
|
|
2206
2083
|
color: var(--u-widget-text, #1a1a2e);
|
|
2207
2084
|
}
|
|
2208
2085
|
|
|
2209
2086
|
.callout-warning {
|
|
2210
|
-
background: color-mix(in srgb, var(--u-widget-warning, #
|
|
2211
|
-
border-left-color: var(--u-widget-warning, #
|
|
2087
|
+
background: color-mix(in srgb, var(--u-widget-warning, #d97706) 12%, var(--u-widget-bg, #fff));
|
|
2088
|
+
border-left-color: var(--u-widget-warning, #d97706);
|
|
2212
2089
|
color: var(--u-widget-text, #1a1a2e);
|
|
2213
2090
|
}
|
|
2214
2091
|
|
|
2215
2092
|
.callout-error {
|
|
2216
|
-
background: color-mix(in srgb, var(--u-widget-negative, #
|
|
2217
|
-
border-left-color: var(--u-widget-negative, #
|
|
2093
|
+
background: color-mix(in srgb, var(--u-widget-negative, #dc2626) 12%, var(--u-widget-bg, #fff));
|
|
2094
|
+
border-left-color: var(--u-widget-negative, #dc2626);
|
|
2218
2095
|
color: var(--u-widget-text, #1a1a2e);
|
|
2219
2096
|
}
|
|
2220
2097
|
|
|
2221
2098
|
.callout-success {
|
|
2222
|
-
background: color-mix(in srgb, var(--u-widget-positive, #
|
|
2223
|
-
border-left-color: var(--u-widget-positive, #
|
|
2099
|
+
background: color-mix(in srgb, var(--u-widget-positive, #16a34a) 12%, var(--u-widget-bg, #fff));
|
|
2100
|
+
border-left-color: var(--u-widget-positive, #16a34a);
|
|
2224
2101
|
color: var(--u-widget-text, #1a1a2e);
|
|
2225
2102
|
}
|
|
2226
2103
|
|
|
@@ -2249,20 +2126,20 @@ M.styles = [b, w`
|
|
|
2249
2126
|
}
|
|
2250
2127
|
`];
|
|
2251
2128
|
te([
|
|
2252
|
-
|
|
2253
|
-
],
|
|
2129
|
+
h({ type: Object })
|
|
2130
|
+
], N.prototype, "spec", 2);
|
|
2254
2131
|
te([
|
|
2255
|
-
|
|
2256
|
-
],
|
|
2257
|
-
|
|
2132
|
+
h({ type: String, reflect: !0 })
|
|
2133
|
+
], N.prototype, "theme", 2);
|
|
2134
|
+
N = te([
|
|
2258
2135
|
x("uw-content")
|
|
2259
|
-
],
|
|
2260
|
-
var
|
|
2261
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
2136
|
+
], N);
|
|
2137
|
+
var qe = Object.defineProperty, We = Object.getOwnPropertyDescriptor, re = (e, t, i, r) => {
|
|
2138
|
+
for (var a = r > 1 ? void 0 : r ? We(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2262
2139
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
2263
|
-
return r && a &&
|
|
2140
|
+
return r && a && qe(t, i, a), a;
|
|
2264
2141
|
};
|
|
2265
|
-
let
|
|
2142
|
+
let F = class extends y {
|
|
2266
2143
|
constructor() {
|
|
2267
2144
|
super(...arguments), this.spec = null, this.theme = null;
|
|
2268
2145
|
}
|
|
@@ -2293,7 +2170,7 @@ let T = class extends y {
|
|
|
2293
2170
|
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) : [] : [];
|
|
2294
2171
|
}
|
|
2295
2172
|
};
|
|
2296
|
-
|
|
2173
|
+
F.styles = [b, w`
|
|
2297
2174
|
:host {
|
|
2298
2175
|
display: block;
|
|
2299
2176
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -2388,20 +2265,20 @@ T.styles = [b, w`
|
|
|
2388
2265
|
}
|
|
2389
2266
|
`];
|
|
2390
2267
|
re([
|
|
2391
|
-
|
|
2392
|
-
],
|
|
2268
|
+
h({ type: Object })
|
|
2269
|
+
], F.prototype, "spec", 2);
|
|
2393
2270
|
re([
|
|
2394
|
-
|
|
2395
|
-
],
|
|
2396
|
-
|
|
2271
|
+
h({ type: String, reflect: !0 })
|
|
2272
|
+
], F.prototype, "theme", 2);
|
|
2273
|
+
F = re([
|
|
2397
2274
|
x("uw-kv")
|
|
2398
|
-
],
|
|
2399
|
-
var
|
|
2400
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
2275
|
+
], F);
|
|
2276
|
+
var Be = Object.defineProperty, He = Object.getOwnPropertyDescriptor, G = (e, t, i, r) => {
|
|
2277
|
+
for (var a = r > 1 ? void 0 : r ? He(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2401
2278
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
2402
|
-
return r && a &&
|
|
2279
|
+
return r && a && Be(t, i, a), a;
|
|
2403
2280
|
};
|
|
2404
|
-
const
|
|
2281
|
+
const Ke = {
|
|
2405
2282
|
javascript: ["//", ["/*", "*/"]],
|
|
2406
2283
|
typescript: ["//", ["/*", "*/"]],
|
|
2407
2284
|
python: ["#"],
|
|
@@ -2413,7 +2290,7 @@ const et = {
|
|
|
2413
2290
|
bash: ["#"],
|
|
2414
2291
|
css: [void 0, ["/*", "*/"]],
|
|
2415
2292
|
html: [void 0, ["<!--", "-->"]]
|
|
2416
|
-
},
|
|
2293
|
+
}, Ve = {
|
|
2417
2294
|
javascript: "async await break case catch class const continue default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",
|
|
2418
2295
|
typescript: "abstract any as async await boolean break case catch class const continue declare default delete do else enum export extends false finally for from function if implements import in instanceof interface is keyof let namespace never new null number of override private protected public readonly return static string super switch this throw true try type typeof undefined var void while with yield",
|
|
2419
2296
|
python: "False None True and as assert async await break class continue def del elif else except finally for from global if import in is lambda nonlocal not or pass raise return try while with yield",
|
|
@@ -2423,7 +2300,7 @@ const et = {
|
|
|
2423
2300
|
rust: "as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self static struct super trait true type unsafe use where while",
|
|
2424
2301
|
sql: "ALL ALTER AND AS ASC BETWEEN BY CASE CREATE DELETE DESC DISTINCT DROP ELSE END EXISTS FALSE FROM GROUP HAVING IF IN INDEX INSERT INTO IS JOIN LEFT LIKE LIMIT NOT NULL ON OR ORDER PRIMARY SELECT SET TABLE THEN TRUE UNION UPDATE VALUES WHERE",
|
|
2425
2302
|
bash: "break case do done elif else esac fi for function if in local read return select then until while"
|
|
2426
|
-
},
|
|
2303
|
+
}, Ge = {
|
|
2427
2304
|
js: "javascript",
|
|
2428
2305
|
ts: "typescript",
|
|
2429
2306
|
py: "python",
|
|
@@ -2442,26 +2319,26 @@ const et = {
|
|
|
2442
2319
|
jsonc: "json",
|
|
2443
2320
|
psql: "sql",
|
|
2444
2321
|
mysql: "sql"
|
|
2445
|
-
},
|
|
2446
|
-
function
|
|
2447
|
-
let t =
|
|
2322
|
+
}, ue = /* @__PURE__ */ new Map();
|
|
2323
|
+
function Je(e) {
|
|
2324
|
+
let t = ue.get(e);
|
|
2448
2325
|
if (!t) {
|
|
2449
|
-
const i =
|
|
2450
|
-
t = i ? new Set(i.split(" ")) : /* @__PURE__ */ new Set(),
|
|
2326
|
+
const i = Ve[e] || "";
|
|
2327
|
+
t = i ? new Set(i.split(" ")) : /* @__PURE__ */ new Set(), ue.set(e, t);
|
|
2451
2328
|
}
|
|
2452
2329
|
return t;
|
|
2453
2330
|
}
|
|
2454
2331
|
function z(e) {
|
|
2455
2332
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2456
2333
|
}
|
|
2457
|
-
function
|
|
2334
|
+
function O(e, t) {
|
|
2458
2335
|
const i = z(e);
|
|
2459
2336
|
return i.includes(`
|
|
2460
2337
|
`) ? i.split(`
|
|
2461
2338
|
`).map((r) => `<span class="hl-${t}">${r}</span>`).join(`
|
|
2462
2339
|
`) : `<span class="hl-${t}">${i}</span>`;
|
|
2463
2340
|
}
|
|
2464
|
-
function
|
|
2341
|
+
function me(e, t, i) {
|
|
2465
2342
|
let r = t + 1;
|
|
2466
2343
|
for (; r < e.length; ) {
|
|
2467
2344
|
if (e[r] === "\\") {
|
|
@@ -2475,42 +2352,42 @@ function ve(e, t, i) {
|
|
|
2475
2352
|
}
|
|
2476
2353
|
return e.length;
|
|
2477
2354
|
}
|
|
2478
|
-
function
|
|
2355
|
+
function Qe(e, t) {
|
|
2479
2356
|
if (!t) return z(e);
|
|
2480
|
-
const i =
|
|
2481
|
-
if (i === "json") return
|
|
2482
|
-
const r =
|
|
2357
|
+
const i = Ge[t] || t;
|
|
2358
|
+
if (i === "json") return Ze(e);
|
|
2359
|
+
const r = Je(i), a = Ke[i], s = a?.[0], n = a?.[1], d = i === "javascript" || i === "typescript";
|
|
2483
2360
|
let c = "", p = 0;
|
|
2484
2361
|
const g = e.length;
|
|
2485
2362
|
for (; p < g; ) {
|
|
2486
2363
|
if (n && e.startsWith(n[0], p)) {
|
|
2487
|
-
const u = e.indexOf(n[1], p + n[0].length),
|
|
2488
|
-
c +=
|
|
2364
|
+
const u = e.indexOf(n[1], p + n[0].length), f = u === -1 ? e.slice(p) : e.slice(p, u + n[1].length);
|
|
2365
|
+
c += O(f, "c"), p += f.length;
|
|
2489
2366
|
continue;
|
|
2490
2367
|
}
|
|
2491
2368
|
if (s && e.startsWith(s, p)) {
|
|
2492
2369
|
const u = e.indexOf(`
|
|
2493
|
-
`, p),
|
|
2494
|
-
c +=
|
|
2370
|
+
`, p), f = u === -1 ? e.slice(p) : e.slice(p, u);
|
|
2371
|
+
c += O(f, "c"), p += f.length;
|
|
2495
2372
|
continue;
|
|
2496
2373
|
}
|
|
2497
2374
|
const m = e[p];
|
|
2498
2375
|
if (m === '"' || m === "'" || m === "`" && d) {
|
|
2499
|
-
const u =
|
|
2500
|
-
c +=
|
|
2376
|
+
const u = me(e, p, m);
|
|
2377
|
+
c += O(e.slice(p, u), "s"), p = u;
|
|
2501
2378
|
continue;
|
|
2502
2379
|
}
|
|
2503
2380
|
if (/\d/.test(m) && (p === 0 || !/[a-zA-Z_$]/.test(e[p - 1]))) {
|
|
2504
2381
|
let u = p + 1;
|
|
2505
2382
|
for (; u < g && /[0-9a-fA-FxXoObBeE._]/.test(e[u]); ) u++;
|
|
2506
|
-
c +=
|
|
2383
|
+
c += O(e.slice(p, u), "n"), p = u;
|
|
2507
2384
|
continue;
|
|
2508
2385
|
}
|
|
2509
2386
|
if (/[a-zA-Z_$]/.test(m)) {
|
|
2510
2387
|
let u = p + 1;
|
|
2511
2388
|
for (; u < g && /[a-zA-Z0-9_$]/.test(e[u]); ) u++;
|
|
2512
|
-
const
|
|
2513
|
-
c += r.has(
|
|
2389
|
+
const f = e.slice(p, u);
|
|
2390
|
+
c += r.has(f) ? `<span class="hl-k">${z(f)}</span>` : z(f), p = u;
|
|
2514
2391
|
continue;
|
|
2515
2392
|
}
|
|
2516
2393
|
if (i === "html" && m === "<" && p + 1 < g && /[a-zA-Z/!]/.test(e[p + 1])) {
|
|
@@ -2523,28 +2400,28 @@ function at(e, t) {
|
|
|
2523
2400
|
if (i === "css" && /[a-z-]/.test(m)) {
|
|
2524
2401
|
let u = p + 1;
|
|
2525
2402
|
for (; u < g && /[a-z-]/.test(e[u]); ) u++;
|
|
2526
|
-
const
|
|
2527
|
-
e.slice(u).trimStart()[0] === ":" ? c += `<span class="hl-k">${z(
|
|
2403
|
+
const f = e.slice(p, u);
|
|
2404
|
+
e.slice(u).trimStart()[0] === ":" ? c += `<span class="hl-k">${z(f)}</span>` : c += z(f), p = u;
|
|
2528
2405
|
continue;
|
|
2529
2406
|
}
|
|
2530
2407
|
c += z(m), p++;
|
|
2531
2408
|
}
|
|
2532
2409
|
return c;
|
|
2533
2410
|
}
|
|
2534
|
-
function
|
|
2411
|
+
function Ze(e) {
|
|
2535
2412
|
let t = "", i = 0;
|
|
2536
2413
|
const r = e.length;
|
|
2537
2414
|
for (; i < r; ) {
|
|
2538
2415
|
const a = e[i];
|
|
2539
2416
|
if (a === '"') {
|
|
2540
|
-
const n =
|
|
2541
|
-
t +=
|
|
2417
|
+
const n = me(e, i, '"'), d = e.slice(i, n), c = e.slice(n).trimStart();
|
|
2418
|
+
t += O(d, c[0] === ":" ? "k" : "s"), i = n;
|
|
2542
2419
|
continue;
|
|
2543
2420
|
}
|
|
2544
2421
|
if (/[\d-]/.test(a) && (i === 0 || /[\s,:\[{]/.test(e[i - 1]))) {
|
|
2545
2422
|
let n = i + 1;
|
|
2546
2423
|
for (; n < r && /[0-9.eE+\-]/.test(e[n]); ) n++;
|
|
2547
|
-
t +=
|
|
2424
|
+
t += O(e.slice(i, n), "n"), i = n;
|
|
2548
2425
|
continue;
|
|
2549
2426
|
}
|
|
2550
2427
|
let s = !1;
|
|
@@ -2557,7 +2434,7 @@ function st(e) {
|
|
|
2557
2434
|
}
|
|
2558
2435
|
return t;
|
|
2559
2436
|
}
|
|
2560
|
-
let
|
|
2437
|
+
let D = class extends y {
|
|
2561
2438
|
constructor() {
|
|
2562
2439
|
super(...arguments), this.spec = null, this.theme = null, this._copied = !1;
|
|
2563
2440
|
}
|
|
@@ -2569,9 +2446,9 @@ let O = class extends y {
|
|
|
2569
2446
|
if (!t) return l;
|
|
2570
2447
|
const i = String(e.language ?? "").toLowerCase(), r = this.spec.options ?? {}, a = r.lineNumbers !== !1, s = !!(r.wrap ?? !1), n = r.maxHeight ? String(r.maxHeight) : void 0, d = new Set(
|
|
2571
2448
|
Array.isArray(r.highlight) ? r.highlight : []
|
|
2572
|
-
), g =
|
|
2573
|
-
`).map((u,
|
|
2574
|
-
const v =
|
|
2449
|
+
), g = Qe(t, i).split(`
|
|
2450
|
+
`).map((u, f) => {
|
|
2451
|
+
const v = f + 1, $ = d.has(v) ? " line-hl" : "", k = a ? `<span class="line-no">${v}</span>` : "";
|
|
2575
2452
|
return `<span class="line${$}">${k}${u || " "}</span>`;
|
|
2576
2453
|
}).join(""), m = n ? `max-height: ${n}` : "";
|
|
2577
2454
|
return o`
|
|
@@ -2604,7 +2481,7 @@ let O = class extends y {
|
|
|
2604
2481
|
}
|
|
2605
2482
|
}
|
|
2606
2483
|
};
|
|
2607
|
-
|
|
2484
|
+
D.styles = [b, w`
|
|
2608
2485
|
:host {
|
|
2609
2486
|
display: block;
|
|
2610
2487
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -2708,21 +2585,21 @@ O.styles = [b, w`
|
|
|
2708
2585
|
}
|
|
2709
2586
|
`];
|
|
2710
2587
|
G([
|
|
2711
|
-
|
|
2712
|
-
],
|
|
2588
|
+
h({ type: Object })
|
|
2589
|
+
], D.prototype, "spec", 2);
|
|
2713
2590
|
G([
|
|
2714
|
-
|
|
2715
|
-
],
|
|
2591
|
+
h({ type: String, reflect: !0 })
|
|
2592
|
+
], D.prototype, "theme", 2);
|
|
2716
2593
|
G([
|
|
2717
2594
|
S()
|
|
2718
|
-
],
|
|
2719
|
-
|
|
2595
|
+
], D.prototype, "_copied", 2);
|
|
2596
|
+
D = G([
|
|
2720
2597
|
x("uw-code")
|
|
2721
|
-
],
|
|
2722
|
-
var
|
|
2723
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
2598
|
+
], D);
|
|
2599
|
+
var Xe = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, ae = (e, t, i, r) => {
|
|
2600
|
+
for (var a = r > 1 ? void 0 : r ? Ye(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2724
2601
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
2725
|
-
return r && a &&
|
|
2602
|
+
return r && a && Xe(t, i, a), a;
|
|
2726
2603
|
};
|
|
2727
2604
|
let U = class extends y {
|
|
2728
2605
|
constructor() {
|
|
@@ -2908,21 +2785,21 @@ U.styles = [b, w`
|
|
|
2908
2785
|
.cite-snippet { font-size: 0.75rem; }
|
|
2909
2786
|
}
|
|
2910
2787
|
`];
|
|
2911
|
-
|
|
2912
|
-
|
|
2788
|
+
ae([
|
|
2789
|
+
h({ type: Object })
|
|
2913
2790
|
], U.prototype, "spec", 2);
|
|
2914
|
-
|
|
2915
|
-
|
|
2791
|
+
ae([
|
|
2792
|
+
h({ type: String, reflect: !0 })
|
|
2916
2793
|
], U.prototype, "theme", 2);
|
|
2917
|
-
U =
|
|
2794
|
+
U = ae([
|
|
2918
2795
|
x("uw-citation")
|
|
2919
2796
|
], U);
|
|
2920
|
-
var
|
|
2921
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
2797
|
+
var et = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, ie = (e, t, i, r) => {
|
|
2798
|
+
for (var a = r > 1 ? void 0 : r ? tt(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
2922
2799
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
2923
|
-
return r && a &&
|
|
2800
|
+
return r && a && et(t, i, a), a;
|
|
2924
2801
|
};
|
|
2925
|
-
const
|
|
2802
|
+
const rt = /* @__PURE__ */ new Set(["info", "success", "warning", "error", "neutral"]), at = {
|
|
2926
2803
|
info: "●",
|
|
2927
2804
|
// ●
|
|
2928
2805
|
success: "✓",
|
|
@@ -2945,7 +2822,7 @@ let R = class extends y {
|
|
|
2945
2822
|
<div class="status-list" part="status" role="list" aria-label=${this.spec.title ?? "Status"}>
|
|
2946
2823
|
${e.map((t) => o`
|
|
2947
2824
|
<div class="status-item" part="status-item" role="listitem" data-level=${t.level}>
|
|
2948
|
-
<span class="status-icon" part="status-icon" aria-hidden="true">${
|
|
2825
|
+
<span class="status-icon" part="status-icon" aria-hidden="true">${at[t.level]}</span>
|
|
2949
2826
|
<span class="status-label" part="status-label">${t.label}</span>
|
|
2950
2827
|
<span class="status-value" part="status-value">${t.value}</span>
|
|
2951
2828
|
</div>
|
|
@@ -2976,7 +2853,7 @@ let R = class extends y {
|
|
|
2976
2853
|
}
|
|
2977
2854
|
_resolveLevel(e) {
|
|
2978
2855
|
const t = String(e ?? "info");
|
|
2979
|
-
return
|
|
2856
|
+
return rt.has(t) ? t : "info";
|
|
2980
2857
|
}
|
|
2981
2858
|
};
|
|
2982
2859
|
R.styles = [b, w`
|
|
@@ -3020,7 +2897,7 @@ R.styles = [b, w`
|
|
|
3020
2897
|
/* Level colors */
|
|
3021
2898
|
[data-level="info"] .status-icon,
|
|
3022
2899
|
[data-level="info"] .status-value {
|
|
3023
|
-
color: var(--u-widget-primary, #
|
|
2900
|
+
color: var(--u-widget-primary, #4f46e5);
|
|
3024
2901
|
}
|
|
3025
2902
|
[data-level="success"] .status-icon,
|
|
3026
2903
|
[data-level="success"] .status-value {
|
|
@@ -3028,7 +2905,7 @@ R.styles = [b, w`
|
|
|
3028
2905
|
}
|
|
3029
2906
|
[data-level="warning"] .status-icon,
|
|
3030
2907
|
[data-level="warning"] .status-value {
|
|
3031
|
-
color: var(--u-widget-warning, #
|
|
2908
|
+
color: var(--u-widget-warning, #d97706);
|
|
3032
2909
|
}
|
|
3033
2910
|
[data-level="error"] .status-icon,
|
|
3034
2911
|
[data-level="error"] .status-value {
|
|
@@ -3044,22 +2921,22 @@ R.styles = [b, w`
|
|
|
3044
2921
|
.status-item { font-size: 0.8125rem; }
|
|
3045
2922
|
}
|
|
3046
2923
|
`];
|
|
3047
|
-
|
|
3048
|
-
|
|
2924
|
+
ie([
|
|
2925
|
+
h({ type: Object })
|
|
3049
2926
|
], R.prototype, "spec", 2);
|
|
3050
|
-
|
|
3051
|
-
|
|
2927
|
+
ie([
|
|
2928
|
+
h({ type: String, reflect: !0 })
|
|
3052
2929
|
], R.prototype, "theme", 2);
|
|
3053
|
-
R =
|
|
2930
|
+
R = ie([
|
|
3054
2931
|
x("uw-status")
|
|
3055
2932
|
], R);
|
|
3056
|
-
var
|
|
3057
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
2933
|
+
var it = Object.defineProperty, st = Object.getOwnPropertyDescriptor, se = (e, t, i, r) => {
|
|
2934
|
+
for (var a = r > 1 ? void 0 : r ? st(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3058
2935
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
3059
|
-
return r && a &&
|
|
2936
|
+
return r && a && it(t, i, a), a;
|
|
3060
2937
|
};
|
|
3061
|
-
const
|
|
3062
|
-
function
|
|
2938
|
+
const nt = /* @__PURE__ */ new Set(["done", "active", "pending", "error"]);
|
|
2939
|
+
function ge(e, t) {
|
|
3063
2940
|
if (t) return o`<span class="step-icon-text">${t}</span>`;
|
|
3064
2941
|
switch (e) {
|
|
3065
2942
|
case "done":
|
|
@@ -3090,7 +2967,7 @@ let q = class extends y {
|
|
|
3090
2967
|
${e.map((i) => o`
|
|
3091
2968
|
<div class="step-v" part="step" role="listitem" data-status=${i.status}>
|
|
3092
2969
|
<div class="step-track">
|
|
3093
|
-
<span class="step-icon" part="step-icon" aria-hidden="true">${
|
|
2970
|
+
<span class="step-icon" part="step-icon" aria-hidden="true">${ge(i.status, i.icon)}</span>
|
|
3094
2971
|
<div class="step-line"></div>
|
|
3095
2972
|
</div>
|
|
3096
2973
|
<div class="step-body">
|
|
@@ -3112,7 +2989,7 @@ let q = class extends y {
|
|
|
3112
2989
|
<div class="step-h" part="step" role="listitem" data-status=${i.status}>
|
|
3113
2990
|
<div class="step-h-top">
|
|
3114
2991
|
<div class="step-h-line" ?data-done=${a}></div>
|
|
3115
|
-
<span class="step-icon" part="step-icon" aria-hidden="true">${
|
|
2992
|
+
<span class="step-icon" part="step-icon" aria-hidden="true">${ge(i.status, i.icon)}</span>
|
|
3116
2993
|
<div class="step-h-line" ?data-done=${s}></div>
|
|
3117
2994
|
</div>
|
|
3118
2995
|
<div class="step-label" part="step-label">${i.label}</div>
|
|
@@ -3135,7 +3012,7 @@ let q = class extends y {
|
|
|
3135
3012
|
}
|
|
3136
3013
|
_resolveStatus(e) {
|
|
3137
3014
|
const t = String(e ?? "pending");
|
|
3138
|
-
return
|
|
3015
|
+
return nt.has(t) ? t : "pending";
|
|
3139
3016
|
}
|
|
3140
3017
|
};
|
|
3141
3018
|
q.styles = [b, w`
|
|
@@ -3371,20 +3248,20 @@ q.styles = [b, w`
|
|
|
3371
3248
|
}
|
|
3372
3249
|
`];
|
|
3373
3250
|
se([
|
|
3374
|
-
|
|
3251
|
+
h({ type: Object })
|
|
3375
3252
|
], q.prototype, "spec", 2);
|
|
3376
3253
|
se([
|
|
3377
|
-
|
|
3254
|
+
h({ type: String, reflect: !0 })
|
|
3378
3255
|
], q.prototype, "theme", 2);
|
|
3379
3256
|
q = se([
|
|
3380
3257
|
x("uw-steps")
|
|
3381
3258
|
], q);
|
|
3382
|
-
var
|
|
3383
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
3259
|
+
var ot = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, J = (e, t, i, r) => {
|
|
3260
|
+
for (var a = r > 1 ? void 0 : r ? lt(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3384
3261
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
3385
|
-
return r && a &&
|
|
3262
|
+
return r && a && ot(t, i, a), a;
|
|
3386
3263
|
};
|
|
3387
|
-
const
|
|
3264
|
+
const ct = {
|
|
3388
3265
|
star: ["☆", "★", "★"],
|
|
3389
3266
|
// ☆, ★, ★
|
|
3390
3267
|
heart: ["♡", "♥", "♥"],
|
|
@@ -3398,7 +3275,7 @@ let E = class extends y {
|
|
|
3398
3275
|
}
|
|
3399
3276
|
render() {
|
|
3400
3277
|
if (!this.spec) return l;
|
|
3401
|
-
const e = this.spec.data ?? {}, t = this.spec.options ?? {}, i = typeof e.value == "number" ? e.value : 0, r = typeof t.max == "number" ? t.max : typeof e.max == "number" ? e.max : 5, a = !!(t.interactive ?? !1), s = this._resolveIcon(t.icon), n = typeof t.label == "string" ? t.label : void 0, d = typeof e.count == "number" ? e.count : void 0, c =
|
|
3278
|
+
const e = this.spec.data ?? {}, t = this.spec.options ?? {}, i = typeof e.value == "number" ? e.value : 0, r = typeof t.max == "number" ? t.max : typeof e.max == "number" ? e.max : 5, a = !!(t.interactive ?? !1), s = this._resolveIcon(t.icon), n = typeof t.label == "string" ? t.label : void 0, d = typeof e.count == "number" ? e.count : void 0, c = ct[s], p = this._hoverIdx >= 0 ? this._hoverIdx + 1 : i;
|
|
3402
3279
|
return o`
|
|
3403
3280
|
<div class="rating" part="rating" role=${a ? "radiogroup" : "img"}
|
|
3404
3281
|
aria-label=${this.spec.title ?? n ?? `Rating: ${i} out of ${r}`}>
|
|
@@ -3576,24 +3453,24 @@ E.styles = [b, w`
|
|
|
3576
3453
|
.rating-value { font-size: 0.8125rem; }
|
|
3577
3454
|
}
|
|
3578
3455
|
`];
|
|
3579
|
-
|
|
3580
|
-
|
|
3456
|
+
J([
|
|
3457
|
+
h({ type: Object })
|
|
3581
3458
|
], E.prototype, "spec", 2);
|
|
3582
|
-
|
|
3583
|
-
|
|
3459
|
+
J([
|
|
3460
|
+
h({ type: String, reflect: !0 })
|
|
3584
3461
|
], E.prototype, "theme", 2);
|
|
3585
|
-
|
|
3462
|
+
J([
|
|
3586
3463
|
S()
|
|
3587
3464
|
], E.prototype, "_hoverIdx", 2);
|
|
3588
|
-
E =
|
|
3465
|
+
E = J([
|
|
3589
3466
|
x("uw-rating")
|
|
3590
3467
|
], E);
|
|
3591
|
-
var
|
|
3592
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
3468
|
+
var dt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, ne = (e, t, i, r) => {
|
|
3469
|
+
for (var a = r > 1 ? void 0 : r ? pt(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3593
3470
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
3594
|
-
return r && a &&
|
|
3471
|
+
return r && a && dt(t, i, a), a;
|
|
3595
3472
|
};
|
|
3596
|
-
let
|
|
3473
|
+
let W = class extends y {
|
|
3597
3474
|
constructor() {
|
|
3598
3475
|
super(...arguments), this.spec = null, this.theme = null;
|
|
3599
3476
|
}
|
|
@@ -3627,7 +3504,7 @@ let B = class extends y {
|
|
|
3627
3504
|
return /^(javascript|data|vbscript):/i.test(t) ? "" : e;
|
|
3628
3505
|
}
|
|
3629
3506
|
};
|
|
3630
|
-
|
|
3507
|
+
W.styles = [b, w`
|
|
3631
3508
|
:host {
|
|
3632
3509
|
display: block;
|
|
3633
3510
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -3662,20 +3539,20 @@ B.styles = [b, w`
|
|
|
3662
3539
|
}
|
|
3663
3540
|
`];
|
|
3664
3541
|
ne([
|
|
3665
|
-
|
|
3666
|
-
],
|
|
3542
|
+
h({ type: Object })
|
|
3543
|
+
], W.prototype, "spec", 2);
|
|
3667
3544
|
ne([
|
|
3668
|
-
|
|
3669
|
-
],
|
|
3670
|
-
|
|
3545
|
+
h({ type: String, reflect: !0 })
|
|
3546
|
+
], W.prototype, "theme", 2);
|
|
3547
|
+
W = ne([
|
|
3671
3548
|
x("uw-video")
|
|
3672
|
-
],
|
|
3673
|
-
var
|
|
3674
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
3549
|
+
], W);
|
|
3550
|
+
var ut = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, oe = (e, t, i, r) => {
|
|
3551
|
+
for (var a = r > 1 ? void 0 : r ? gt(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3675
3552
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
3676
|
-
return r && a &&
|
|
3553
|
+
return r && a && ut(t, i, a), a;
|
|
3677
3554
|
};
|
|
3678
|
-
let
|
|
3555
|
+
let B = class extends y {
|
|
3679
3556
|
constructor() {
|
|
3680
3557
|
super(...arguments), this.spec = null, this.theme = null;
|
|
3681
3558
|
}
|
|
@@ -3716,7 +3593,7 @@ let W = class extends y {
|
|
|
3716
3593
|
return /^(javascript|data|vbscript):/i.test(t) ? "" : e;
|
|
3717
3594
|
}
|
|
3718
3595
|
};
|
|
3719
|
-
|
|
3596
|
+
B.styles = [b, w`
|
|
3720
3597
|
:host {
|
|
3721
3598
|
display: block;
|
|
3722
3599
|
font-family: system-ui, -apple-system, sans-serif;
|
|
@@ -3755,18 +3632,18 @@ W.styles = [b, w`
|
|
|
3755
3632
|
}
|
|
3756
3633
|
`];
|
|
3757
3634
|
oe([
|
|
3758
|
-
|
|
3759
|
-
],
|
|
3635
|
+
h({ type: Object })
|
|
3636
|
+
], B.prototype, "spec", 2);
|
|
3760
3637
|
oe([
|
|
3761
|
-
|
|
3762
|
-
],
|
|
3763
|
-
|
|
3638
|
+
h({ type: String, reflect: !0 })
|
|
3639
|
+
], B.prototype, "theme", 2);
|
|
3640
|
+
B = oe([
|
|
3764
3641
|
x("uw-gallery")
|
|
3765
|
-
],
|
|
3766
|
-
var
|
|
3767
|
-
for (var a = r > 1 ? void 0 : r ?
|
|
3642
|
+
], B);
|
|
3643
|
+
var ht = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, Q = (e, t, i, r) => {
|
|
3644
|
+
for (var a = r > 1 ? void 0 : r ? ft(t, i) : t, s = e.length - 1, n; s >= 0; s--)
|
|
3768
3645
|
(n = e[s]) && (a = (r ? n(t, i, a) : n(a)) || a);
|
|
3769
|
-
return r && a &&
|
|
3646
|
+
return r && a && ht(t, i, a), a;
|
|
3770
3647
|
};
|
|
3771
3648
|
let P = class extends y {
|
|
3772
3649
|
constructor() {
|
|
@@ -3789,16 +3666,16 @@ let P = class extends y {
|
|
|
3789
3666
|
render() {
|
|
3790
3667
|
if (!this.spec)
|
|
3791
3668
|
return o`<slot></slot>`;
|
|
3792
|
-
const e =
|
|
3669
|
+
const e = Z(this.spec);
|
|
3793
3670
|
if (!e.valid)
|
|
3794
3671
|
return this.renderError(e.errors);
|
|
3795
|
-
const t =
|
|
3672
|
+
const t = we(this.spec);
|
|
3796
3673
|
return this.renderWidget(t);
|
|
3797
3674
|
}
|
|
3798
3675
|
renderWidget(e) {
|
|
3799
|
-
const t = e.widget, i = e.mapping ??
|
|
3676
|
+
const t = e.widget, i = e.mapping ?? be(t, e.data);
|
|
3800
3677
|
let r = i ? { ...e, mapping: i } : e;
|
|
3801
|
-
const a =
|
|
3678
|
+
const a = Ae(this.locale);
|
|
3802
3679
|
a && !r.options?.locale && (r = {
|
|
3803
3680
|
...r,
|
|
3804
3681
|
options: { ...r.options, locale: a }
|
|
@@ -3872,13 +3749,13 @@ let P = class extends y {
|
|
|
3872
3749
|
}
|
|
3873
3750
|
const g = !(t === "header" || t === "actions" || t === "divider" || t === "compose") && r.title ? o`<div class="widget-title" part="title">${r.title}</div>` : l;
|
|
3874
3751
|
if (!!r.options?.card ? c = o`<div class="card-container" part="card">${g}${c}</div>` : g !== l && (c = o`${g}${c}`), d.length > 0) {
|
|
3875
|
-
const u = d.map((
|
|
3752
|
+
const u = d.map((f) => o`
|
|
3876
3753
|
<button
|
|
3877
|
-
data-style=${
|
|
3878
|
-
?disabled=${
|
|
3879
|
-
@click=${() => this._dispatchAction(r,
|
|
3754
|
+
data-style=${f.style ?? "default"}
|
|
3755
|
+
?disabled=${f.disabled}
|
|
3756
|
+
@click=${() => this._dispatchAction(r, f)}
|
|
3880
3757
|
part="action-btn"
|
|
3881
|
-
>${
|
|
3758
|
+
>${f.label}</button>
|
|
3882
3759
|
`);
|
|
3883
3760
|
return o`<div part="widget-container">${c}<div class="global-actions" part="actions">${u}</div></div>`;
|
|
3884
3761
|
}
|
|
@@ -3941,7 +3818,7 @@ let P = class extends y {
|
|
|
3941
3818
|
);
|
|
3942
3819
|
}
|
|
3943
3820
|
renderFallback(e) {
|
|
3944
|
-
const t =
|
|
3821
|
+
const t = ze(e.widget);
|
|
3945
3822
|
return o`
|
|
3946
3823
|
<div class="fallback-card" part="fallback">
|
|
3947
3824
|
<div class="fallback-label">${e.title ?? `Unknown widget: ${e.widget}`}</div>
|
|
@@ -3975,12 +3852,12 @@ P.styles = [
|
|
|
3975
3852
|
.error-card {
|
|
3976
3853
|
padding: 10px 14px;
|
|
3977
3854
|
border-radius: 6px;
|
|
3978
|
-
border: 1px solid var(--u-widget-negative, #
|
|
3979
|
-
background: color-mix(in srgb, var(--u-widget-negative, #
|
|
3855
|
+
border: 1px solid var(--u-widget-negative, #dc2626);
|
|
3856
|
+
background: color-mix(in srgb, var(--u-widget-negative, #dc2626) 8%, var(--u-widget-bg, #fff));
|
|
3980
3857
|
font-size: 0.8125rem;
|
|
3981
3858
|
}
|
|
3982
3859
|
|
|
3983
|
-
.error-header { font-weight: 600; color: var(--u-widget-negative, #
|
|
3860
|
+
.error-header { font-weight: 600; color: var(--u-widget-negative, #dc2626); margin-bottom: 4px; }
|
|
3984
3861
|
.error-list { margin: 0; padding-left: 20px; color: var(--u-widget-text-secondary, #64748b); }
|
|
3985
3862
|
|
|
3986
3863
|
.fallback-card {
|
|
@@ -4143,8 +4020,8 @@ P.styles = [
|
|
|
4143
4020
|
}
|
|
4144
4021
|
`
|
|
4145
4022
|
];
|
|
4146
|
-
|
|
4147
|
-
|
|
4023
|
+
Q([
|
|
4024
|
+
h({
|
|
4148
4025
|
type: Object,
|
|
4149
4026
|
converter: {
|
|
4150
4027
|
fromAttribute(e) {
|
|
@@ -4158,32 +4035,32 @@ J([
|
|
|
4158
4035
|
}
|
|
4159
4036
|
})
|
|
4160
4037
|
], P.prototype, "spec", 2);
|
|
4161
|
-
|
|
4162
|
-
|
|
4038
|
+
Q([
|
|
4039
|
+
h({ type: String, reflect: !0 })
|
|
4163
4040
|
], P.prototype, "theme", 2);
|
|
4164
|
-
|
|
4165
|
-
|
|
4041
|
+
Q([
|
|
4042
|
+
h({ type: String, reflect: !0 })
|
|
4166
4043
|
], P.prototype, "locale", 2);
|
|
4167
|
-
P =
|
|
4044
|
+
P = Q([
|
|
4168
4045
|
x("u-widget")
|
|
4169
4046
|
], P);
|
|
4170
4047
|
export {
|
|
4171
4048
|
P as UWidget,
|
|
4172
4049
|
A as formatTemplate,
|
|
4173
4050
|
he as formatValue,
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4051
|
+
_t as getDefaultLocale,
|
|
4052
|
+
zt as getEffectiveLocale,
|
|
4053
|
+
ve as getFormdownParser,
|
|
4054
|
+
fe as getLocaleStrings,
|
|
4055
|
+
be as infer,
|
|
4056
|
+
xt as isWidgetSpec,
|
|
4057
|
+
we as normalize,
|
|
4058
|
+
jt as parseFormdown,
|
|
4059
|
+
Ct as registerFormdownParser,
|
|
4060
|
+
$t as registerLocale,
|
|
4061
|
+
Ae as resolveLocale,
|
|
4062
|
+
kt as setDefaultLocale,
|
|
4063
|
+
ze as suggestWidget,
|
|
4064
|
+
Z as validate
|
|
4188
4065
|
};
|
|
4189
4066
|
//# sourceMappingURL=u-widgets.js.map
|