bank20baht-ui 0.4.1 → 0.4.3
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/chunks/{baht-workflow-CkbvfwES.js → baht-workflow-DR5MA2SS.js} +1407 -1306
- package/dist/components/primitives/baht-bar-chart.d.ts +25 -0
- package/dist/components/primitives/baht-meter.d.ts +8 -1
- package/dist/components/primitives/baht-stat.d.ts +4 -1
- package/dist/custom-elements.json +179 -4
- package/dist/index.js +1 -1
- package/dist/react.d.ts +1 -0
- package/dist/ssr.js +1 -1
- package/dist/tokens.css +68 -2
- package/dist/vscode.html-custom-data.json +11 -1
- package/dist/web-types.json +23 -3
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { nothing as h, html as
|
|
2
|
-
import { property as
|
|
3
|
-
import { B as
|
|
1
|
+
import { nothing as h, html as l, svg as N } from "lit";
|
|
2
|
+
import { property as n, customElement as b, state as y, query as Mt } from "lit/decorators.js";
|
|
3
|
+
import { B as g, b as he, h as T, a as X } from "./base-CajA2aCO.js";
|
|
4
4
|
import { t as m } from "./i18n-BcPL9_Jh.js";
|
|
5
|
-
import { n as $e, k as
|
|
5
|
+
import { n as $e, k as Nt, o as ds, i as zt, p as us, d as ae, a as rs, m as Ae, v as Le, c as bs, g as fs, l as ms } from "./display-DQRcvsn7.js";
|
|
6
6
|
import { repeat as Ce } from "lit/directives/repeat.js";
|
|
7
|
-
import { html as
|
|
8
|
-
import { c as vs, r as
|
|
9
|
-
import { live as
|
|
10
|
-
import { ifDefined as
|
|
7
|
+
import { html as se, unsafeStatic as os } from "lit/static-html.js";
|
|
8
|
+
import { c as vs, r as W } from "./baht-toast-CD1WrOYr.js";
|
|
9
|
+
import { live as lt } from "lit/directives/live.js";
|
|
10
|
+
import { ifDefined as q } from "lit/directives/if-defined.js";
|
|
11
11
|
import $s from "flatpickr";
|
|
12
|
-
var ys = Object.defineProperty, gs = Object.getOwnPropertyDescriptor,
|
|
12
|
+
var ys = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ce = (t, e, i, a) => {
|
|
13
13
|
for (var s = a > 1 ? void 0 : a ? gs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
14
14
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
15
15
|
return a && s && ys(e, i, s), s;
|
|
16
16
|
};
|
|
17
|
-
let
|
|
17
|
+
let Vt = class extends g {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.tone = "neutral", this.label = "", this.dot = null;
|
|
20
20
|
}
|
|
@@ -23,55 +23,55 @@ let zt = class extends y {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
const t = this.tone === "neutral" ? "" : ` baht-badge--${this.tone}`;
|
|
26
|
-
return
|
|
27
|
-
${this.showDot ?
|
|
26
|
+
return l`<span class="baht-badge${t}">
|
|
27
|
+
${this.showDot ? l`<span class="baht-badge-dot" aria-hidden="true"></span>` : h}${this.label}
|
|
28
28
|
</span>`;
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
],
|
|
40
|
-
|
|
31
|
+
ce([
|
|
32
|
+
n()
|
|
33
|
+
], Vt.prototype, "tone", 2);
|
|
34
|
+
ce([
|
|
35
|
+
n()
|
|
36
|
+
], Vt.prototype, "label", 2);
|
|
37
|
+
ce([
|
|
38
|
+
n({ attribute: !1 })
|
|
39
|
+
], Vt.prototype, "dot", 2);
|
|
40
|
+
Vt = ce([
|
|
41
41
|
b("baht-badge")
|
|
42
|
-
],
|
|
43
|
-
var ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor,
|
|
42
|
+
], Vt);
|
|
43
|
+
var ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ie = (t, e, i, a) => {
|
|
44
44
|
for (var s = a > 1 ? void 0 : a ? xs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
45
45
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
46
46
|
return a && s && ws(e, i, s), s;
|
|
47
47
|
};
|
|
48
|
-
let
|
|
48
|
+
let ie = class extends g {
|
|
49
49
|
constructor() {
|
|
50
50
|
super(...arguments), this.variant = "inline", this.code = "";
|
|
51
51
|
}
|
|
52
52
|
firstUpdated() {
|
|
53
53
|
const t = this.renderRoot.querySelector(this.variant === "block" ? "pre" : "code");
|
|
54
|
-
t &&
|
|
54
|
+
t && he(this, t);
|
|
55
55
|
}
|
|
56
56
|
render() {
|
|
57
|
-
return this.variant === "block" ?
|
|
57
|
+
return this.variant === "block" ? l`<pre class="baht-code baht-code--block" tabindex="0">${this.code}</pre>` : l`<code class="baht-code">${this.code}</code>`;
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
],
|
|
66
|
-
|
|
60
|
+
Ie([
|
|
61
|
+
n()
|
|
62
|
+
], ie.prototype, "variant", 2);
|
|
63
|
+
Ie([
|
|
64
|
+
n()
|
|
65
|
+
], ie.prototype, "code", 2);
|
|
66
|
+
ie = Ie([
|
|
67
67
|
b("baht-code")
|
|
68
|
-
],
|
|
69
|
-
var _s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor,
|
|
68
|
+
], ie);
|
|
69
|
+
var _s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, gt = (t, e, i, a) => {
|
|
70
70
|
for (var s = a > 1 ? void 0 : a ? ks(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
71
71
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
72
72
|
return a && s && _s(e, i, s), s;
|
|
73
73
|
};
|
|
74
|
-
let ht = class extends
|
|
74
|
+
let ht = class extends g {
|
|
75
75
|
constructor() {
|
|
76
76
|
super(...arguments), this.page = 1, this.totalPages = 1, this.variant = "numbered", this.siblings = 1, this.hasNext = !1, this.hasPrev = !1;
|
|
77
77
|
}
|
|
@@ -107,15 +107,15 @@ let ht = class extends y {
|
|
|
107
107
|
}
|
|
108
108
|
render() {
|
|
109
109
|
if (this.variant === "cursor")
|
|
110
|
-
return
|
|
110
|
+
return l`<nav class="baht-pagination baht-pagination--cursor" aria-label="Pagination">
|
|
111
111
|
<button type="button" ?disabled=${!this.hasPrev} @click=${() => this.goCursor("prev")}><span aria-hidden="true">« </span>Prev</button>
|
|
112
112
|
<button type="button" ?disabled=${!this.hasNext} @click=${() => this.goCursor("next")}>Next<span aria-hidden="true"> »</span></button>
|
|
113
113
|
</nav>`;
|
|
114
114
|
const t = this.page <= 1, e = this.page >= this.totalPages;
|
|
115
|
-
return
|
|
115
|
+
return l`<nav class="baht-pagination" aria-label="Pagination">
|
|
116
116
|
<button type="button" aria-label="Previous page" ?disabled=${t} @click=${() => this.go(this.page - 1)}><span aria-hidden="true">«</span></button>
|
|
117
|
-
${this.variant === "compact" ?
|
|
118
|
-
(i) => i === null ?
|
|
117
|
+
${this.variant === "compact" ? l`<span class="baht-pagination-label">Page ${this.page} of ${this.totalPages}</span>` : this.pageItems.map(
|
|
118
|
+
(i) => i === null ? l`<span class="baht-pagination-ellipsis" aria-hidden="true">…</span>` : l`<button
|
|
119
119
|
type="button"
|
|
120
120
|
aria-current=${i === this.page ? "page" : h}
|
|
121
121
|
aria-label="Page ${i}"
|
|
@@ -126,25 +126,25 @@ let ht = class extends y {
|
|
|
126
126
|
</nav>`;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
gt([
|
|
130
|
+
n({ type: Number })
|
|
131
131
|
], ht.prototype, "page", 2);
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
gt([
|
|
133
|
+
n({ type: Number, attribute: "total-pages" })
|
|
134
134
|
], ht.prototype, "totalPages", 2);
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
gt([
|
|
136
|
+
n()
|
|
137
137
|
], ht.prototype, "variant", 2);
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
gt([
|
|
139
|
+
n({ type: Number })
|
|
140
140
|
], ht.prototype, "siblings", 2);
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
gt([
|
|
142
|
+
n({ type: Boolean, attribute: "has-next" })
|
|
143
143
|
], ht.prototype, "hasNext", 2);
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
gt([
|
|
145
|
+
n({ type: Boolean, attribute: "has-prev" })
|
|
146
146
|
], ht.prototype, "hasPrev", 2);
|
|
147
|
-
ht =
|
|
147
|
+
ht = gt([
|
|
148
148
|
b("baht-pagination")
|
|
149
149
|
], ht);
|
|
150
150
|
var Ps = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, O = (t, e, i, a) => {
|
|
@@ -152,8 +152,8 @@ var Ps = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, O = (t, e,
|
|
|
152
152
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
153
153
|
return a && s && Ps(e, i, s), s;
|
|
154
154
|
};
|
|
155
|
-
const Cs = " › ", ye = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date),
|
|
156
|
-
let k = class extends
|
|
155
|
+
const Cs = " › ", ye = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date), ee = (t) => t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
156
|
+
let k = class extends g {
|
|
157
157
|
constructor() {
|
|
158
158
|
super(...arguments), this.items = [], this.columns = {}, this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "No records yet.", this.showIndex = !0, this.indexOffset = 0, this.skeletonRows = 10, this.rowKey = "", this.clickable = !0, this.renderers = {}, this.visibleColumns = [], this.columnPicker = !0, this.page = 1, this.totalPages = 1, this.cursorMode = !1, this.hasNext = !1, this.hasPrev = !1, this.pickerOpen = !1, this.pickedColumns = null, this.draftColumns = [], this.pickAvail = [], this.pickSel = [], this.expanded = [], this.pickerPreviousFocus = null, this.onPickerKeydown = (t) => {
|
|
159
159
|
t.key === "Escape" ? this.closePicker() : t.key === "Tab" && this.trapPickerFocus(t);
|
|
@@ -178,7 +178,7 @@ let k = class extends y {
|
|
|
178
178
|
r != null && r.contains(s) ? t.shiftKey && s === i ? (a.focus(), t.preventDefault()) : !t.shiftKey && s === a && (i.focus(), t.preventDefault()) : (i.focus(), t.preventDefault());
|
|
179
179
|
}
|
|
180
180
|
disconnectedCallback() {
|
|
181
|
-
super.disconnectedCallback(),
|
|
181
|
+
super.disconnectedCallback(), T() && document.removeEventListener("keydown", this.onPickerKeydown);
|
|
182
182
|
}
|
|
183
183
|
willUpdate(t) {
|
|
184
184
|
t.has("visibleColumns") && !t.has("columns") && (this.pickedColumns = null);
|
|
@@ -192,9 +192,9 @@ let k = class extends y {
|
|
|
192
192
|
const e = {};
|
|
193
193
|
for (const [i, a] of Object.entries(t))
|
|
194
194
|
e[i] = ye(a) ? {
|
|
195
|
-
label:
|
|
196
|
-
fields: Object.fromEntries(Object.keys(a).map((s) => [s,
|
|
197
|
-
} :
|
|
195
|
+
label: ee(i),
|
|
196
|
+
fields: Object.fromEntries(Object.keys(a).map((s) => [s, ee(s)]))
|
|
197
|
+
} : ee(i);
|
|
198
198
|
return e;
|
|
199
199
|
}
|
|
200
200
|
/** Walk a dotted key through the spec; undefined when no such column exists. */
|
|
@@ -233,7 +233,7 @@ let k = class extends y {
|
|
|
233
233
|
for (const a of t.split(".")) {
|
|
234
234
|
const s = i == null ? void 0 : i[a];
|
|
235
235
|
if (s === void 0) {
|
|
236
|
-
e.push(
|
|
236
|
+
e.push(ee(a)), i = void 0;
|
|
237
237
|
continue;
|
|
238
238
|
}
|
|
239
239
|
e.push(typeof s == "string" ? s : s.label), i = typeof s == "string" ? void 0 : s.fields;
|
|
@@ -251,7 +251,7 @@ let k = class extends y {
|
|
|
251
251
|
}
|
|
252
252
|
// ---- picker -----------------------------------------------------------
|
|
253
253
|
openPicker() {
|
|
254
|
-
this.draftColumns = this.columnKeys.slice(), this.pickAvail = [], this.pickSel = [], this.pickerOpen = !0, this.pickerPreviousFocus = document.activeElement,
|
|
254
|
+
this.draftColumns = this.columnKeys.slice(), this.pickAvail = [], this.pickSel = [], this.pickerOpen = !0, this.pickerPreviousFocus = document.activeElement, T() && document.addEventListener("keydown", this.onPickerKeydown), this.updateComplete.then(() => {
|
|
255
255
|
var t;
|
|
256
256
|
this.pickerOpen && ((t = this.pickerFocusables()[0]) == null || t.focus());
|
|
257
257
|
});
|
|
@@ -259,7 +259,7 @@ let k = class extends y {
|
|
|
259
259
|
closePicker() {
|
|
260
260
|
var e;
|
|
261
261
|
if (!this.pickerOpen) return;
|
|
262
|
-
this.pickerOpen = !1,
|
|
262
|
+
this.pickerOpen = !1, T() && document.removeEventListener("keydown", this.onPickerKeydown);
|
|
263
263
|
const t = this.pickerPreviousFocus;
|
|
264
264
|
this.pickerPreviousFocus = null, t != null && t.isConnected && ((e = t.focus) == null || e.call(t));
|
|
265
265
|
}
|
|
@@ -319,27 +319,27 @@ let k = class extends y {
|
|
|
319
319
|
}
|
|
320
320
|
renderBody(t) {
|
|
321
321
|
const e = t.length + (this.showIndex ? 1 : 0);
|
|
322
|
-
return this.loading ?
|
|
322
|
+
return this.loading ? l`${Array.from(
|
|
323
323
|
{ length: this.skeletonRows },
|
|
324
|
-
(i, a) =>
|
|
325
|
-
${this.showIndex ?
|
|
326
|
-
${t.map(() =>
|
|
324
|
+
(i, a) => l`<tr>
|
|
325
|
+
${this.showIndex ? l`<td class="baht-table-index">${this.indexOffset + a + 1}</td>` : h}
|
|
326
|
+
${t.map(() => l`<td><span class="baht-skeleton" style="height:16px;"></span></td>`)}
|
|
327
327
|
</tr>`
|
|
328
|
-
)}` : this.error ?
|
|
329
|
-
(i, a) =>
|
|
328
|
+
)}` : this.error ? l`<tr><td colspan=${e}><div class="baht-table-state baht-table-state--error" role="alert">${this.errorMessage}</div></td></tr>` : this.items.length === 0 ? l`<tr><td colspan=${e}><div class="baht-table-state">${this.emptyMessage}</div></td></tr>` : l`${this.items.map(
|
|
329
|
+
(i, a) => l`<tr
|
|
330
330
|
tabindex=${this.clickable ? "0" : h}
|
|
331
331
|
@click=${() => this.emitRow(i, a)}
|
|
332
332
|
@keydown=${(s) => {
|
|
333
333
|
s.key !== "Enter" && s.key !== " " || (s.preventDefault(), this.emitRow(i, a));
|
|
334
334
|
}}
|
|
335
335
|
>
|
|
336
|
-
${this.showIndex ?
|
|
337
|
-
${t.map((s) =>
|
|
336
|
+
${this.showIndex ? l`<td class="baht-table-index">${this.indexOffset + a + 1}</td>` : h}
|
|
337
|
+
${t.map((s) => l`<td data-col=${s}>${this.cell(i, s)}</td>`)}
|
|
338
338
|
</tr>`
|
|
339
339
|
)}`;
|
|
340
340
|
}
|
|
341
341
|
renderColumnToggle() {
|
|
342
|
-
return
|
|
342
|
+
return l`<div class="baht-table-picker">
|
|
343
343
|
<button
|
|
344
344
|
type="button"
|
|
345
345
|
class="baht-table-picker-toggle"
|
|
@@ -356,15 +356,15 @@ let k = class extends y {
|
|
|
356
356
|
*/
|
|
357
357
|
renderAvailRow(t, e) {
|
|
358
358
|
const i = this.specAt(t), a = (i == null ? void 0 : i.fields) !== void 0, s = this.expanded.includes(t), r = this.draftColumns.includes(t);
|
|
359
|
-
return
|
|
359
|
+
return l`<li class="baht-table-picker-node" style="--baht-picker-depth:${e}">
|
|
360
360
|
<div class="baht-table-picker-row">
|
|
361
|
-
${a ?
|
|
361
|
+
${a ? l`<button
|
|
362
362
|
type="button"
|
|
363
363
|
class="baht-table-picker-expand"
|
|
364
364
|
aria-label=${s ? `Collapse ${i == null ? void 0 : i.label}` : `Expand ${i == null ? void 0 : i.label}`}
|
|
365
365
|
aria-expanded=${s ? "true" : "false"}
|
|
366
366
|
@click=${() => this.toggleExpanded(t)}
|
|
367
|
-
>${s ? "▾" : "▸"}</button>` :
|
|
367
|
+
>${s ? "▾" : "▸"}</button>` : l`<span class="baht-table-picker-expand baht-table-picker-expand--leaf"></span>`}
|
|
368
368
|
<button
|
|
369
369
|
type="button"
|
|
370
370
|
class="baht-table-picker-option"
|
|
@@ -374,14 +374,14 @@ let k = class extends y {
|
|
|
374
374
|
@click=${() => this.toggleAvail(t)}
|
|
375
375
|
>${e === 0 ? this.labelFor(t) : (i == null ? void 0 : i.label) ?? t}</button>
|
|
376
376
|
</div>
|
|
377
|
-
${a && s ?
|
|
377
|
+
${a && s ? l`<ul class="baht-table-picker-tree">
|
|
378
378
|
${this.childrenOf(t).map((o) => this.renderAvailRow(o, e + 1))}
|
|
379
379
|
</ul>` : h}
|
|
380
380
|
</li>`;
|
|
381
381
|
}
|
|
382
382
|
renderColumnModal() {
|
|
383
383
|
const t = this.allColumnKeys, e = this.allPaths().filter((a) => !this.draftColumns.includes(a)).length, i = (a) => (s) => a(k.selectedValues(s));
|
|
384
|
-
return
|
|
384
|
+
return l`<div
|
|
385
385
|
class="baht-table-picker-scrim"
|
|
386
386
|
@click=${(a) => a.target === a.currentTarget && this.closePicker()}
|
|
387
387
|
>
|
|
@@ -407,7 +407,7 @@ let k = class extends y {
|
|
|
407
407
|
<div class="baht-table-picker-collabel">Selected (${this.draftColumns.length})</div>
|
|
408
408
|
<select multiple size="10" class="baht-table-picker-select" aria-label="Selected columns" @change=${i((a) => this.pickSel = a)}>
|
|
409
409
|
${this.draftColumns.map(
|
|
410
|
-
(a) =>
|
|
410
|
+
(a) => l`<option value=${a} ?selected=${this.pickSel.includes(a)}>${this.labelFor(a)}</option>`
|
|
411
411
|
)}
|
|
412
412
|
</select>
|
|
413
413
|
</div>
|
|
@@ -424,7 +424,7 @@ let k = class extends y {
|
|
|
424
424
|
}
|
|
425
425
|
render() {
|
|
426
426
|
const t = this.columnKeys;
|
|
427
|
-
return
|
|
427
|
+
return l`<div
|
|
428
428
|
class="baht-table-wrap"
|
|
429
429
|
tabindex=${this.clickable ? h : "0"}
|
|
430
430
|
aria-busy=${this.loading ? "true" : h}
|
|
@@ -434,19 +434,19 @@ let k = class extends y {
|
|
|
434
434
|
<table class="baht-table">
|
|
435
435
|
<thead>
|
|
436
436
|
<tr>
|
|
437
|
-
${this.showIndex ?
|
|
438
|
-
${t.map((e) =>
|
|
437
|
+
${this.showIndex ? l`<th scope="col" class="baht-table-index">No.</th>` : h}
|
|
438
|
+
${t.map((e) => l`<th scope="col" data-col=${e}>${this.labelFor(e)}</th>`)}
|
|
439
439
|
</tr>
|
|
440
440
|
</thead>
|
|
441
441
|
<tbody>${this.renderBody(t)}</tbody>
|
|
442
442
|
</table>
|
|
443
|
-
${this.cursorMode ?
|
|
443
|
+
${this.cursorMode ? l`<div class="baht-table-footer">
|
|
444
444
|
<baht-pagination
|
|
445
445
|
variant="cursor"
|
|
446
446
|
?has-next=${this.hasNext}
|
|
447
447
|
?has-prev=${this.hasPrev}
|
|
448
448
|
></baht-pagination>
|
|
449
|
-
</div>` : this.totalPages > 1 ?
|
|
449
|
+
</div>` : this.totalPages > 1 ? l`<div class="baht-table-footer">
|
|
450
450
|
<baht-pagination
|
|
451
451
|
variant="compact"
|
|
452
452
|
page=${this.page}
|
|
@@ -457,79 +457,79 @@ let k = class extends y {
|
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
459
|
O([
|
|
460
|
-
|
|
460
|
+
n({ attribute: !1 })
|
|
461
461
|
], k.prototype, "items", 2);
|
|
462
462
|
O([
|
|
463
|
-
|
|
463
|
+
n({ attribute: !1 })
|
|
464
464
|
], k.prototype, "columns", 2);
|
|
465
465
|
O([
|
|
466
|
-
|
|
466
|
+
n({ type: Boolean })
|
|
467
467
|
], k.prototype, "loading", 2);
|
|
468
468
|
O([
|
|
469
|
-
|
|
469
|
+
n({ type: Boolean })
|
|
470
470
|
], k.prototype, "error", 2);
|
|
471
471
|
O([
|
|
472
|
-
|
|
472
|
+
n({ attribute: "error-message" })
|
|
473
473
|
], k.prototype, "errorMessage", 2);
|
|
474
474
|
O([
|
|
475
|
-
|
|
475
|
+
n({ attribute: "empty-message" })
|
|
476
476
|
], k.prototype, "emptyMessage", 2);
|
|
477
477
|
O([
|
|
478
|
-
|
|
478
|
+
n({ type: Boolean, attribute: "show-index" })
|
|
479
479
|
], k.prototype, "showIndex", 2);
|
|
480
480
|
O([
|
|
481
|
-
|
|
481
|
+
n({ type: Number, attribute: "index-offset" })
|
|
482
482
|
], k.prototype, "indexOffset", 2);
|
|
483
483
|
O([
|
|
484
|
-
|
|
484
|
+
n({ type: Number, attribute: "skeleton-rows" })
|
|
485
485
|
], k.prototype, "skeletonRows", 2);
|
|
486
486
|
O([
|
|
487
|
-
|
|
487
|
+
n({ attribute: "row-key" })
|
|
488
488
|
], k.prototype, "rowKey", 2);
|
|
489
489
|
O([
|
|
490
|
-
|
|
490
|
+
n({ type: Boolean })
|
|
491
491
|
], k.prototype, "clickable", 2);
|
|
492
492
|
O([
|
|
493
|
-
|
|
493
|
+
n({ attribute: !1 })
|
|
494
494
|
], k.prototype, "renderers", 2);
|
|
495
495
|
O([
|
|
496
|
-
|
|
496
|
+
n({ attribute: !1 })
|
|
497
497
|
], k.prototype, "visibleColumns", 2);
|
|
498
498
|
O([
|
|
499
|
-
|
|
499
|
+
n({ type: Boolean, attribute: "column-picker" })
|
|
500
500
|
], k.prototype, "columnPicker", 2);
|
|
501
501
|
O([
|
|
502
|
-
|
|
502
|
+
n({ type: Number })
|
|
503
503
|
], k.prototype, "page", 2);
|
|
504
504
|
O([
|
|
505
|
-
|
|
505
|
+
n({ type: Number, attribute: "total-pages" })
|
|
506
506
|
], k.prototype, "totalPages", 2);
|
|
507
507
|
O([
|
|
508
|
-
|
|
508
|
+
n({ type: Boolean, attribute: "cursor-mode" })
|
|
509
509
|
], k.prototype, "cursorMode", 2);
|
|
510
510
|
O([
|
|
511
|
-
|
|
511
|
+
n({ type: Boolean, attribute: "has-next" })
|
|
512
512
|
], k.prototype, "hasNext", 2);
|
|
513
513
|
O([
|
|
514
|
-
|
|
514
|
+
n({ type: Boolean, attribute: "has-prev" })
|
|
515
515
|
], k.prototype, "hasPrev", 2);
|
|
516
516
|
O([
|
|
517
|
-
|
|
517
|
+
y()
|
|
518
518
|
], k.prototype, "pickerOpen", 2);
|
|
519
519
|
O([
|
|
520
|
-
|
|
520
|
+
y()
|
|
521
521
|
], k.prototype, "pickedColumns", 2);
|
|
522
522
|
O([
|
|
523
|
-
|
|
523
|
+
y()
|
|
524
524
|
], k.prototype, "draftColumns", 2);
|
|
525
525
|
O([
|
|
526
|
-
|
|
526
|
+
y()
|
|
527
527
|
], k.prototype, "pickAvail", 2);
|
|
528
528
|
O([
|
|
529
|
-
|
|
529
|
+
y()
|
|
530
530
|
], k.prototype, "pickSel", 2);
|
|
531
531
|
O([
|
|
532
|
-
|
|
532
|
+
y()
|
|
533
533
|
], k.prototype, "expanded", 2);
|
|
534
534
|
k = O([
|
|
535
535
|
b("baht-table")
|
|
@@ -539,7 +539,7 @@ var Ds = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, ut = (t, e
|
|
|
539
539
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
540
540
|
return a && s && Ds(e, i, s), s;
|
|
541
541
|
};
|
|
542
|
-
let
|
|
542
|
+
let rt = class extends g {
|
|
543
543
|
constructor() {
|
|
544
544
|
super(...arguments), this.items = [], this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "Nothing here yet.", this.skeletonRows = 5, this.clickable = !0;
|
|
545
545
|
}
|
|
@@ -553,16 +553,16 @@ let it = class extends y {
|
|
|
553
553
|
);
|
|
554
554
|
}
|
|
555
555
|
renderRows() {
|
|
556
|
-
return this.loading ?
|
|
556
|
+
return this.loading ? l`${Array.from(
|
|
557
557
|
{ length: this.skeletonRows },
|
|
558
|
-
() =>
|
|
558
|
+
() => l`<div class="baht-list-item">
|
|
559
559
|
<div class="baht-list-main">
|
|
560
560
|
<span class="baht-skeleton baht-skeleton--text" style="width:40%; margin-bottom:6px;"></span>
|
|
561
561
|
<span class="baht-skeleton baht-skeleton--text" style="width:65%;"></span>
|
|
562
562
|
</div>
|
|
563
563
|
</div>`
|
|
564
|
-
)}` : this.error ?
|
|
565
|
-
(t, e) =>
|
|
564
|
+
)}` : this.error ? l`<div class="baht-list-state baht-list-state--error" role="alert">${this.errorMessage}</div>` : this.items.length === 0 ? l`<div class="baht-list-state">${this.emptyMessage}</div>` : l`${this.items.map(
|
|
565
|
+
(t, e) => l`<div
|
|
566
566
|
class="baht-list-item"
|
|
567
567
|
role="listitem"
|
|
568
568
|
tabindex=${this.clickable ? "0" : h}
|
|
@@ -573,48 +573,48 @@ let it = class extends y {
|
|
|
573
573
|
>
|
|
574
574
|
<div class="baht-list-main">
|
|
575
575
|
<div class="baht-list-title">${t.title}</div>
|
|
576
|
-
${t.subtitle ?
|
|
576
|
+
${t.subtitle ? l`<div class="baht-list-subtitle">${t.subtitle}</div>` : h}
|
|
577
577
|
</div>
|
|
578
|
-
${t.badge ?
|
|
579
|
-
${t.meta ?
|
|
578
|
+
${t.badge ? l`<baht-badge tone=${t.badgeTone ?? "neutral"} label=${t.badge}></baht-badge>` : h}
|
|
579
|
+
${t.meta ? l`<span class="baht-list-meta">${t.meta}</span>` : h}
|
|
580
580
|
</div>`
|
|
581
581
|
)}`;
|
|
582
582
|
}
|
|
583
583
|
render() {
|
|
584
584
|
const t = !this.loading && !this.error && this.items.length > 0;
|
|
585
|
-
return
|
|
585
|
+
return l`<div class="baht-list" role=${t ? "list" : h}>${this.renderRows()}</div>`;
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
588
|
ut([
|
|
589
|
-
|
|
590
|
-
],
|
|
589
|
+
n({ attribute: !1 })
|
|
590
|
+
], rt.prototype, "items", 2);
|
|
591
591
|
ut([
|
|
592
|
-
|
|
593
|
-
],
|
|
592
|
+
n({ type: Boolean })
|
|
593
|
+
], rt.prototype, "loading", 2);
|
|
594
594
|
ut([
|
|
595
|
-
|
|
596
|
-
],
|
|
595
|
+
n({ type: Boolean })
|
|
596
|
+
], rt.prototype, "error", 2);
|
|
597
597
|
ut([
|
|
598
|
-
|
|
599
|
-
],
|
|
598
|
+
n({ attribute: "error-message" })
|
|
599
|
+
], rt.prototype, "errorMessage", 2);
|
|
600
600
|
ut([
|
|
601
|
-
|
|
602
|
-
],
|
|
601
|
+
n({ attribute: "empty-message" })
|
|
602
|
+
], rt.prototype, "emptyMessage", 2);
|
|
603
603
|
ut([
|
|
604
|
-
|
|
605
|
-
],
|
|
604
|
+
n({ type: Number, attribute: "skeleton-rows" })
|
|
605
|
+
], rt.prototype, "skeletonRows", 2);
|
|
606
606
|
ut([
|
|
607
|
-
|
|
608
|
-
],
|
|
609
|
-
|
|
607
|
+
n({ type: Boolean })
|
|
608
|
+
], rt.prototype, "clickable", 2);
|
|
609
|
+
rt = ut([
|
|
610
610
|
b("baht-list")
|
|
611
|
-
],
|
|
612
|
-
var Es = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor,
|
|
611
|
+
], rt);
|
|
612
|
+
var Es = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Jt = (t, e, i, a) => {
|
|
613
613
|
for (var s = a > 1 ? void 0 : a ? Bs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
614
614
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
615
615
|
return a && s && Es(e, i, s), s;
|
|
616
616
|
};
|
|
617
|
-
let
|
|
617
|
+
let Pt = class extends g {
|
|
618
618
|
constructor() {
|
|
619
619
|
super(...arguments), this.text = "", this.position = "top", this.dismissed = !1;
|
|
620
620
|
}
|
|
@@ -633,7 +633,7 @@ let kt = class extends y {
|
|
|
633
633
|
t ? (t.setAttribute("aria-describedby", this.tooltipId), this.anchorEl.removeAttribute("tabindex"), this.anchorEl.removeAttribute("aria-describedby")) : (this.anchorEl.setAttribute("tabindex", "0"), this.anchorEl.setAttribute("aria-describedby", this.tooltipId));
|
|
634
634
|
}
|
|
635
635
|
firstUpdated() {
|
|
636
|
-
|
|
636
|
+
he(this, this.anchorEl), this.wireDescribedBy(), setTimeout(() => this.isConnected && this.wireDescribedBy(), 0);
|
|
637
637
|
}
|
|
638
638
|
onKeydown(t) {
|
|
639
639
|
t.key === "Escape" && (this.dismissed = !0);
|
|
@@ -642,7 +642,7 @@ let kt = class extends y {
|
|
|
642
642
|
this.dismissed = !1;
|
|
643
643
|
}
|
|
644
644
|
render() {
|
|
645
|
-
return
|
|
645
|
+
return l`<span
|
|
646
646
|
class="baht-tooltip-host${this.dismissed ? " baht-tooltip-host--dismissed" : ""}"
|
|
647
647
|
@keydown=${this.onKeydown}
|
|
648
648
|
@mouseleave=${this.rearm}
|
|
@@ -653,27 +653,27 @@ let kt = class extends y {
|
|
|
653
653
|
</span>`;
|
|
654
654
|
}
|
|
655
655
|
};
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
],
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
],
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
],
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
],
|
|
668
|
-
|
|
656
|
+
Jt([
|
|
657
|
+
n()
|
|
658
|
+
], Pt.prototype, "text", 2);
|
|
659
|
+
Jt([
|
|
660
|
+
n()
|
|
661
|
+
], Pt.prototype, "position", 2);
|
|
662
|
+
Jt([
|
|
663
|
+
Mt(".baht-tooltip-anchor")
|
|
664
|
+
], Pt.prototype, "anchorEl", 2);
|
|
665
|
+
Jt([
|
|
666
|
+
y()
|
|
667
|
+
], Pt.prototype, "dismissed", 2);
|
|
668
|
+
Pt = Jt([
|
|
669
669
|
b("baht-tooltip")
|
|
670
|
-
],
|
|
671
|
-
var
|
|
672
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
670
|
+
], Pt);
|
|
671
|
+
var Ms = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, It = (t, e, i, a) => {
|
|
672
|
+
for (var s = a > 1 ? void 0 : a ? Is(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
673
673
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
674
|
-
return a && s &&
|
|
674
|
+
return a && s && Ms(e, i, s), s;
|
|
675
675
|
};
|
|
676
|
-
let
|
|
676
|
+
let mt = class extends g {
|
|
677
677
|
constructor() {
|
|
678
678
|
super(...arguments), this.tone = "info", this.heading = "", this.message = "", this.dismissible = !1, this.dismissed = !1, this.generation = 0;
|
|
679
679
|
}
|
|
@@ -692,39 +692,39 @@ let ft = class extends y {
|
|
|
692
692
|
i.classList.add("baht-alert--leaving"), vs(i, e);
|
|
693
693
|
}
|
|
694
694
|
render() {
|
|
695
|
-
return this.dismissed ? h :
|
|
695
|
+
return this.dismissed ? h : l`<div class="baht-alert baht-alert--${this.tone}" role="alert">
|
|
696
696
|
<div class="baht-alert-main">
|
|
697
|
-
${this.heading ?
|
|
698
|
-
${this.message ?
|
|
697
|
+
${this.heading ? l`<div class="baht-alert-title">${this.heading}</div>` : h}
|
|
698
|
+
${this.message ? l`<div class="baht-alert-message">${this.message}</div>` : h}
|
|
699
699
|
</div>
|
|
700
|
-
${this.dismissible ?
|
|
700
|
+
${this.dismissible ? l`<button type="button" class="baht-alert-dismiss" aria-label=${m("dismiss")} @click=${() => this.dismiss()}>×</button>` : h}
|
|
701
701
|
</div>`;
|
|
702
702
|
}
|
|
703
703
|
};
|
|
704
704
|
It([
|
|
705
|
-
|
|
706
|
-
],
|
|
705
|
+
n()
|
|
706
|
+
], mt.prototype, "tone", 2);
|
|
707
707
|
It([
|
|
708
|
-
|
|
709
|
-
],
|
|
708
|
+
n()
|
|
709
|
+
], mt.prototype, "heading", 2);
|
|
710
710
|
It([
|
|
711
|
-
|
|
712
|
-
],
|
|
711
|
+
n()
|
|
712
|
+
], mt.prototype, "message", 2);
|
|
713
713
|
It([
|
|
714
|
-
|
|
715
|
-
],
|
|
714
|
+
n({ type: Boolean })
|
|
715
|
+
], mt.prototype, "dismissible", 2);
|
|
716
716
|
It([
|
|
717
|
-
|
|
718
|
-
],
|
|
719
|
-
|
|
717
|
+
y()
|
|
718
|
+
], mt.prototype, "dismissed", 2);
|
|
719
|
+
mt = It([
|
|
720
720
|
b("baht-alert")
|
|
721
|
-
],
|
|
722
|
-
var
|
|
723
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
721
|
+
], mt);
|
|
722
|
+
var js = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, jt = (t, e, i, a) => {
|
|
723
|
+
for (var s = a > 1 ? void 0 : a ? Ss(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
724
724
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
725
|
-
return a && s &&
|
|
725
|
+
return a && s && js(e, i, s), s;
|
|
726
726
|
};
|
|
727
|
-
let
|
|
727
|
+
let vt = class extends g {
|
|
728
728
|
constructor() {
|
|
729
729
|
super(...arguments), this.value = 0, this.max = 5, this.readonly = !1, this.label = "Rating", this.hover = 0;
|
|
730
730
|
}
|
|
@@ -753,7 +753,7 @@ let mt = class extends y {
|
|
|
753
753
|
}
|
|
754
754
|
render() {
|
|
755
755
|
const t = this.hover || this.value;
|
|
756
|
-
return
|
|
756
|
+
return l`<div
|
|
757
757
|
class="baht-rating"
|
|
758
758
|
role="radiogroup"
|
|
759
759
|
aria-label=${this.label}
|
|
@@ -761,7 +761,7 @@ let mt = class extends y {
|
|
|
761
761
|
>
|
|
762
762
|
${Array.from({ length: this.max }, (e, i) => {
|
|
763
763
|
const a = i + 1, s = this.value || 1;
|
|
764
|
-
return
|
|
764
|
+
return l`<button
|
|
765
765
|
type="button"
|
|
766
766
|
class=${a <= t ? "baht-rating--on" : ""}
|
|
767
767
|
role="radio"
|
|
@@ -778,29 +778,29 @@ let mt = class extends y {
|
|
|
778
778
|
}
|
|
779
779
|
};
|
|
780
780
|
jt([
|
|
781
|
-
|
|
782
|
-
],
|
|
781
|
+
n({ type: Number })
|
|
782
|
+
], vt.prototype, "value", 2);
|
|
783
783
|
jt([
|
|
784
|
-
|
|
785
|
-
],
|
|
784
|
+
n({ type: Number })
|
|
785
|
+
], vt.prototype, "max", 2);
|
|
786
786
|
jt([
|
|
787
|
-
|
|
788
|
-
],
|
|
787
|
+
n({ type: Boolean })
|
|
788
|
+
], vt.prototype, "readonly", 2);
|
|
789
789
|
jt([
|
|
790
|
-
|
|
791
|
-
],
|
|
790
|
+
n()
|
|
791
|
+
], vt.prototype, "label", 2);
|
|
792
792
|
jt([
|
|
793
|
-
|
|
794
|
-
],
|
|
795
|
-
|
|
793
|
+
y()
|
|
794
|
+
], vt.prototype, "hover", 2);
|
|
795
|
+
vt = jt([
|
|
796
796
|
b("baht-rating")
|
|
797
|
-
],
|
|
797
|
+
], vt);
|
|
798
798
|
var Ts = Object.defineProperty, As = Object.getOwnPropertyDescriptor, bt = (t, e, i, a) => {
|
|
799
799
|
for (var s = a > 1 ? void 0 : a ? As(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
800
800
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
801
801
|
return a && s && Ts(e, i, s), s;
|
|
802
802
|
};
|
|
803
|
-
let
|
|
803
|
+
let ot = class extends g {
|
|
804
804
|
constructor() {
|
|
805
805
|
super(...arguments), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.label = "", this.disabled = !1, this.showValue = !0;
|
|
806
806
|
}
|
|
@@ -814,55 +814,55 @@ let rt = class extends y {
|
|
|
814
814
|
);
|
|
815
815
|
}
|
|
816
816
|
render() {
|
|
817
|
-
return
|
|
818
|
-
${this.label ?
|
|
817
|
+
return l`<div class="baht-range">
|
|
818
|
+
${this.label ? l`<label class="baht-label" for=${this.inputId}>${this.label}</label>` : h}
|
|
819
819
|
<div class="baht-range-row">
|
|
820
820
|
<input
|
|
821
821
|
type="range"
|
|
822
822
|
id=${this.inputId}
|
|
823
823
|
aria-label=${this.label ? h : "Value"}
|
|
824
|
-
.value=${
|
|
824
|
+
.value=${lt(String(this.value))}
|
|
825
825
|
min=${this.min}
|
|
826
826
|
max=${this.max}
|
|
827
827
|
step=${this.step}
|
|
828
828
|
?disabled=${this.disabled}
|
|
829
829
|
@input=${(t) => this.onInput(t)}
|
|
830
830
|
/>
|
|
831
|
-
${this.showValue ?
|
|
831
|
+
${this.showValue ? l`<span class="baht-range-value">${this.value}</span>` : h}
|
|
832
832
|
</div>
|
|
833
833
|
</div>`;
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
bt([
|
|
837
|
-
|
|
838
|
-
],
|
|
837
|
+
n({ type: Number })
|
|
838
|
+
], ot.prototype, "value", 2);
|
|
839
839
|
bt([
|
|
840
|
-
|
|
841
|
-
],
|
|
840
|
+
n({ type: Number })
|
|
841
|
+
], ot.prototype, "min", 2);
|
|
842
842
|
bt([
|
|
843
|
-
|
|
844
|
-
],
|
|
843
|
+
n({ type: Number })
|
|
844
|
+
], ot.prototype, "max", 2);
|
|
845
845
|
bt([
|
|
846
|
-
|
|
847
|
-
],
|
|
846
|
+
n({ type: Number })
|
|
847
|
+
], ot.prototype, "step", 2);
|
|
848
848
|
bt([
|
|
849
|
-
|
|
850
|
-
],
|
|
849
|
+
n()
|
|
850
|
+
], ot.prototype, "label", 2);
|
|
851
851
|
bt([
|
|
852
|
-
|
|
853
|
-
],
|
|
852
|
+
n({ type: Boolean })
|
|
853
|
+
], ot.prototype, "disabled", 2);
|
|
854
854
|
bt([
|
|
855
|
-
|
|
856
|
-
],
|
|
857
|
-
|
|
855
|
+
n({ type: Boolean, attribute: "show-value" })
|
|
856
|
+
], ot.prototype, "showValue", 2);
|
|
857
|
+
ot = bt([
|
|
858
858
|
b("baht-range")
|
|
859
|
-
],
|
|
859
|
+
], ot);
|
|
860
860
|
var Ls = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, St = (t, e, i, a) => {
|
|
861
861
|
for (var s = a > 1 ? void 0 : a ? Ns(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
862
862
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
863
863
|
return a && s && Ls(e, i, s), s;
|
|
864
864
|
};
|
|
865
|
-
let
|
|
865
|
+
let $t = class extends g {
|
|
866
866
|
constructor() {
|
|
867
867
|
super(...arguments), this.length = 6, this.value = "", this.disabled = !1, this.mode = "numeric", this.label = "One-time code", this._chars = [], this._lastValue = "", this._wasFull = !1;
|
|
868
868
|
}
|
|
@@ -929,9 +929,9 @@ let vt = class extends y {
|
|
|
929
929
|
this.commit(), (s = this.inputs()[Math.min(i, this.length - 1)]) == null || s.focus();
|
|
930
930
|
}
|
|
931
931
|
render() {
|
|
932
|
-
return
|
|
932
|
+
return l`<div class="baht-otp" role="group" aria-label=${this.label} @paste=${(t) => this.onPaste(t)}>
|
|
933
933
|
${this._chars.map(
|
|
934
|
-
(t, e) =>
|
|
934
|
+
(t, e) => l`<input
|
|
935
935
|
type="text"
|
|
936
936
|
inputmode=${this.mode === "numeric" ? "numeric" : "text"}
|
|
937
937
|
maxlength="1"
|
|
@@ -947,29 +947,29 @@ let vt = class extends y {
|
|
|
947
947
|
}
|
|
948
948
|
};
|
|
949
949
|
St([
|
|
950
|
-
|
|
951
|
-
],
|
|
950
|
+
n({ type: Number })
|
|
951
|
+
], $t.prototype, "length", 2);
|
|
952
952
|
St([
|
|
953
|
-
|
|
954
|
-
],
|
|
953
|
+
n()
|
|
954
|
+
], $t.prototype, "value", 2);
|
|
955
955
|
St([
|
|
956
|
-
|
|
957
|
-
],
|
|
956
|
+
n({ type: Boolean })
|
|
957
|
+
], $t.prototype, "disabled", 2);
|
|
958
958
|
St([
|
|
959
|
-
|
|
960
|
-
],
|
|
959
|
+
n()
|
|
960
|
+
], $t.prototype, "mode", 2);
|
|
961
961
|
St([
|
|
962
|
-
|
|
963
|
-
],
|
|
964
|
-
|
|
962
|
+
n()
|
|
963
|
+
], $t.prototype, "label", 2);
|
|
964
|
+
$t = St([
|
|
965
965
|
b("baht-otp")
|
|
966
|
-
],
|
|
967
|
-
var qs = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor,
|
|
966
|
+
], $t);
|
|
967
|
+
var qs = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, Tt = (t, e, i, a) => {
|
|
968
968
|
for (var s = a > 1 ? void 0 : a ? Rs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
969
969
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
970
970
|
return a && s && qs(e, i, s), s;
|
|
971
971
|
};
|
|
972
|
-
let
|
|
972
|
+
let yt = class extends g {
|
|
973
973
|
constructor() {
|
|
974
974
|
super(...arguments), this.options = [], this.selected = [], this.multiple = !0, this.disabled = !1, this.label = "Filters";
|
|
975
975
|
}
|
|
@@ -981,9 +981,9 @@ let $t = class extends y {
|
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
983
|
render() {
|
|
984
|
-
return
|
|
984
|
+
return l`<div class="baht-filter" role="group" aria-label=${this.label}>
|
|
985
985
|
${this.options.map(
|
|
986
|
-
(t) =>
|
|
986
|
+
(t) => l`<button
|
|
987
987
|
type="button"
|
|
988
988
|
aria-pressed=${this.selected.includes(t.key)}
|
|
989
989
|
?disabled=${this.disabled}
|
|
@@ -993,66 +993,66 @@ let $t = class extends y {
|
|
|
993
993
|
</div>`;
|
|
994
994
|
}
|
|
995
995
|
};
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
],
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
],
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
],
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
],
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
],
|
|
1011
|
-
|
|
996
|
+
Tt([
|
|
997
|
+
n({ attribute: !1 })
|
|
998
|
+
], yt.prototype, "options", 2);
|
|
999
|
+
Tt([
|
|
1000
|
+
n({ attribute: !1 })
|
|
1001
|
+
], yt.prototype, "selected", 2);
|
|
1002
|
+
Tt([
|
|
1003
|
+
n({ type: Boolean })
|
|
1004
|
+
], yt.prototype, "multiple", 2);
|
|
1005
|
+
Tt([
|
|
1006
|
+
n({ type: Boolean })
|
|
1007
|
+
], yt.prototype, "disabled", 2);
|
|
1008
|
+
Tt([
|
|
1009
|
+
n()
|
|
1010
|
+
], yt.prototype, "label", 2);
|
|
1011
|
+
yt = Tt([
|
|
1012
1012
|
b("baht-filter")
|
|
1013
|
-
],
|
|
1014
|
-
var zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor,
|
|
1013
|
+
], yt);
|
|
1014
|
+
var zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, pe = (t, e, i, a) => {
|
|
1015
1015
|
for (var s = a > 1 ? void 0 : a ? Vs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1016
1016
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1017
1017
|
return a && s && zs(e, i, s), s;
|
|
1018
1018
|
};
|
|
1019
|
-
let
|
|
1019
|
+
let Kt = class extends g {
|
|
1020
1020
|
constructor() {
|
|
1021
1021
|
super(...arguments), this.variant = "rect", this.width = "100%", this.height = "";
|
|
1022
1022
|
}
|
|
1023
1023
|
render() {
|
|
1024
1024
|
const t = this.height || (this.variant === "text" ? "1em" : "20px"), e = this.variant === "rect" ? "" : ` baht-skeleton--${this.variant}`;
|
|
1025
|
-
return
|
|
1025
|
+
return l`<span
|
|
1026
1026
|
class="baht-skeleton${e}"
|
|
1027
1027
|
style="width:${this.width}; height:${t};"
|
|
1028
1028
|
aria-hidden="true"
|
|
1029
1029
|
></span>`;
|
|
1030
1030
|
}
|
|
1031
1031
|
};
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
],
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
],
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
],
|
|
1041
|
-
|
|
1032
|
+
pe([
|
|
1033
|
+
n()
|
|
1034
|
+
], Kt.prototype, "variant", 2);
|
|
1035
|
+
pe([
|
|
1036
|
+
n()
|
|
1037
|
+
], Kt.prototype, "width", 2);
|
|
1038
|
+
pe([
|
|
1039
|
+
n()
|
|
1040
|
+
], Kt.prototype, "height", 2);
|
|
1041
|
+
Kt = pe([
|
|
1042
1042
|
b("baht-skeleton")
|
|
1043
|
-
],
|
|
1044
|
-
var Ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor,
|
|
1043
|
+
], Kt);
|
|
1044
|
+
var Ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Xt = (t, e, i, a) => {
|
|
1045
1045
|
for (var s = a > 1 ? void 0 : a ? Us(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1046
1046
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1047
1047
|
return a && s && Ks(e, i, s), s;
|
|
1048
1048
|
};
|
|
1049
|
-
let
|
|
1049
|
+
let Ot = class extends g {
|
|
1050
1050
|
constructor() {
|
|
1051
1051
|
super(...arguments), this.value = null, this.tone = "primary", this.showLabel = !1, this.label = "Progress";
|
|
1052
1052
|
}
|
|
1053
1053
|
render() {
|
|
1054
1054
|
const t = this.value == null || Number.isNaN(this.value), e = t ? 0 : Math.min(100, Math.max(0, this.value)), i = this.tone === "primary" ? "" : ` baht-progress--${this.tone}`;
|
|
1055
|
-
return
|
|
1055
|
+
return l`<div>
|
|
1056
1056
|
<div
|
|
1057
1057
|
class="baht-progress${i}${t ? " baht-progress--indeterminate" : ""}"
|
|
1058
1058
|
role="progressbar"
|
|
@@ -1063,137 +1063,137 @@ let Pt = class extends y {
|
|
|
1063
1063
|
>
|
|
1064
1064
|
<div class="baht-progress-bar" style=${t ? h : `width:${e}%`}></div>
|
|
1065
1065
|
</div>
|
|
1066
|
-
${this.showLabel && !t ?
|
|
1066
|
+
${this.showLabel && !t ? l`<div class="baht-progress-label">${e}%</div>` : h}
|
|
1067
1067
|
</div>`;
|
|
1068
1068
|
}
|
|
1069
1069
|
};
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
],
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
],
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
],
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
],
|
|
1082
|
-
|
|
1070
|
+
Xt([
|
|
1071
|
+
n({ type: Number })
|
|
1072
|
+
], Ot.prototype, "value", 2);
|
|
1073
|
+
Xt([
|
|
1074
|
+
n()
|
|
1075
|
+
], Ot.prototype, "tone", 2);
|
|
1076
|
+
Xt([
|
|
1077
|
+
n({ type: Boolean, attribute: "show-label" })
|
|
1078
|
+
], Ot.prototype, "showLabel", 2);
|
|
1079
|
+
Xt([
|
|
1080
|
+
n()
|
|
1081
|
+
], Ot.prototype, "label", 2);
|
|
1082
|
+
Ot = Xt([
|
|
1083
1083
|
b("baht-progress")
|
|
1084
|
-
],
|
|
1085
|
-
var Hs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor,
|
|
1084
|
+
], Ot);
|
|
1085
|
+
var Hs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, je = (t, e, i, a) => {
|
|
1086
1086
|
for (var s = a > 1 ? void 0 : a ? Gs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1087
1087
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1088
1088
|
return a && s && Hs(e, i, s), s;
|
|
1089
1089
|
};
|
|
1090
|
-
let
|
|
1090
|
+
let re = class extends g {
|
|
1091
1091
|
constructor() {
|
|
1092
1092
|
super(...arguments), this.size = "md", this.label = "Loading";
|
|
1093
1093
|
}
|
|
1094
1094
|
render() {
|
|
1095
1095
|
const t = this.size === "md" ? "" : ` baht-spinner--${this.size}`;
|
|
1096
|
-
return
|
|
1096
|
+
return l`<span class="baht-spinner${t}" role="status" aria-label=${this.label}></span>`;
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
],
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
],
|
|
1105
|
-
|
|
1099
|
+
je([
|
|
1100
|
+
n()
|
|
1101
|
+
], re.prototype, "size", 2);
|
|
1102
|
+
je([
|
|
1103
|
+
n()
|
|
1104
|
+
], re.prototype, "label", 2);
|
|
1105
|
+
re = je([
|
|
1106
1106
|
b("baht-spinner")
|
|
1107
|
-
],
|
|
1107
|
+
], re);
|
|
1108
1108
|
var Ws = Object.defineProperty, Js = Object.getOwnPropertyDescriptor, Yt = (t, e, i, a) => {
|
|
1109
1109
|
for (var s = a > 1 ? void 0 : a ? Js(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1110
1110
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1111
1111
|
return a && s && Ws(e, i, s), s;
|
|
1112
1112
|
};
|
|
1113
|
-
let
|
|
1113
|
+
let Ct = class extends g {
|
|
1114
1114
|
constructor() {
|
|
1115
1115
|
super(...arguments), this.heading = "", this.subtitle = "", this.hero = !1;
|
|
1116
1116
|
}
|
|
1117
1117
|
firstUpdated() {
|
|
1118
|
-
|
|
1118
|
+
he(this, this.bodyEl);
|
|
1119
1119
|
}
|
|
1120
1120
|
render() {
|
|
1121
|
-
return
|
|
1122
|
-
${this.heading ?
|
|
1123
|
-
${this.subtitle ?
|
|
1121
|
+
return l`<div class="baht-card${this.hero ? " baht-card--hero" : ""}">
|
|
1122
|
+
${this.heading ? l`<div class="baht-card-title">${this.heading}</div>` : h}
|
|
1123
|
+
${this.subtitle ? l`<div class="baht-card-subtitle">${this.subtitle}</div>` : h}
|
|
1124
1124
|
<div class="baht-card-body"></div>
|
|
1125
1125
|
</div>`;
|
|
1126
1126
|
}
|
|
1127
1127
|
};
|
|
1128
1128
|
Yt([
|
|
1129
|
-
|
|
1130
|
-
],
|
|
1129
|
+
n()
|
|
1130
|
+
], Ct.prototype, "heading", 2);
|
|
1131
1131
|
Yt([
|
|
1132
|
-
|
|
1133
|
-
],
|
|
1132
|
+
n()
|
|
1133
|
+
], Ct.prototype, "subtitle", 2);
|
|
1134
1134
|
Yt([
|
|
1135
|
-
|
|
1136
|
-
],
|
|
1135
|
+
n({ type: Boolean })
|
|
1136
|
+
], Ct.prototype, "hero", 2);
|
|
1137
1137
|
Yt([
|
|
1138
|
-
|
|
1139
|
-
],
|
|
1140
|
-
|
|
1138
|
+
Mt(".baht-card-body")
|
|
1139
|
+
], Ct.prototype, "bodyEl", 2);
|
|
1140
|
+
Ct = Yt([
|
|
1141
1141
|
b("baht-card")
|
|
1142
|
-
],
|
|
1143
|
-
var
|
|
1144
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
1142
|
+
], Ct);
|
|
1143
|
+
var Xs = Object.defineProperty, Ys = Object.getOwnPropertyDescriptor, de = (t, e, i, a) => {
|
|
1144
|
+
for (var s = a > 1 ? void 0 : a ? Ys(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1145
1145
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1146
|
-
return a && s &&
|
|
1146
|
+
return a && s && Xs(e, i, s), s;
|
|
1147
1147
|
};
|
|
1148
|
-
let
|
|
1148
|
+
let Ut = class extends g {
|
|
1149
1149
|
constructor() {
|
|
1150
1150
|
super(...arguments), this.legend = "", this.disabled = !1;
|
|
1151
1151
|
}
|
|
1152
1152
|
firstUpdated() {
|
|
1153
|
-
|
|
1153
|
+
he(this, this.bodyEl);
|
|
1154
1154
|
}
|
|
1155
1155
|
render() {
|
|
1156
|
-
return
|
|
1157
|
-
${this.legend ?
|
|
1156
|
+
return l`<fieldset class="baht-fieldset" ?disabled=${this.disabled}>
|
|
1157
|
+
${this.legend ? l`<legend>${this.legend}</legend>` : h}
|
|
1158
1158
|
<div class="baht-fieldset-body"></div>
|
|
1159
1159
|
</fieldset>`;
|
|
1160
1160
|
}
|
|
1161
1161
|
};
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
],
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
],
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
],
|
|
1171
|
-
|
|
1162
|
+
de([
|
|
1163
|
+
n()
|
|
1164
|
+
], Ut.prototype, "legend", 2);
|
|
1165
|
+
de([
|
|
1166
|
+
n({ type: Boolean })
|
|
1167
|
+
], Ut.prototype, "disabled", 2);
|
|
1168
|
+
de([
|
|
1169
|
+
Mt(".baht-fieldset-body")
|
|
1170
|
+
], Ut.prototype, "bodyEl", 2);
|
|
1171
|
+
Ut = de([
|
|
1172
1172
|
b("baht-fieldset")
|
|
1173
|
-
],
|
|
1173
|
+
], Ut);
|
|
1174
1174
|
var Zs = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, ls = (t, e, i, a) => {
|
|
1175
1175
|
for (var s = a > 1 ? void 0 : a ? Qs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1176
1176
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1177
1177
|
return a && s && Zs(e, i, s), s;
|
|
1178
1178
|
};
|
|
1179
|
-
let De = class extends
|
|
1179
|
+
let De = class extends g {
|
|
1180
1180
|
constructor() {
|
|
1181
1181
|
super(...arguments), this.items = [];
|
|
1182
1182
|
}
|
|
1183
1183
|
render() {
|
|
1184
|
-
return
|
|
1184
|
+
return l`<div class="baht-timeline" role="list">
|
|
1185
1185
|
${this.items.map(
|
|
1186
|
-
(t, e) =>
|
|
1186
|
+
(t, e) => l`<div class="baht-timeline-item" role="listitem">
|
|
1187
1187
|
<div class="baht-timeline-rail">
|
|
1188
1188
|
<span class="baht-timeline-dot${t.tone && t.tone !== "primary" ? ` baht-timeline-dot--${t.tone}` : ""}"></span>
|
|
1189
|
-
${e < this.items.length - 1 ?
|
|
1189
|
+
${e < this.items.length - 1 ? l`<span class="baht-timeline-line"></span>` : h}
|
|
1190
1190
|
</div>
|
|
1191
1191
|
<div class="baht-timeline-main">
|
|
1192
1192
|
<div class="baht-timeline-title">
|
|
1193
1193
|
${t.title}
|
|
1194
|
-
${t.time ?
|
|
1194
|
+
${t.time ? l`<span class="baht-timeline-time"> · ${t.time}</span>` : h}
|
|
1195
1195
|
</div>
|
|
1196
|
-
${t.description ?
|
|
1196
|
+
${t.description ? l`<div class="baht-timeline-desc">${t.description}</div>` : h}
|
|
1197
1197
|
</div>
|
|
1198
1198
|
</div>`
|
|
1199
1199
|
)}
|
|
@@ -1201,17 +1201,17 @@ let De = class extends y {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
};
|
|
1203
1203
|
ls([
|
|
1204
|
-
|
|
1204
|
+
n({ attribute: !1 })
|
|
1205
1205
|
], De.prototype, "items", 2);
|
|
1206
1206
|
De = ls([
|
|
1207
1207
|
b("baht-timeline")
|
|
1208
1208
|
], De);
|
|
1209
|
-
var ta = Object.defineProperty, ea = Object.getOwnPropertyDescriptor,
|
|
1209
|
+
var ta = Object.defineProperty, ea = Object.getOwnPropertyDescriptor, ue = (t, e, i, a) => {
|
|
1210
1210
|
for (var s = a > 1 ? void 0 : a ? ea(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1211
1211
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1212
1212
|
return a && s && ta(e, i, s), s;
|
|
1213
1213
|
};
|
|
1214
|
-
let
|
|
1214
|
+
let Dt = class extends g {
|
|
1215
1215
|
constructor() {
|
|
1216
1216
|
super(...arguments), this.items = [], this.multiple = !1, this.openSet = /* @__PURE__ */ new Set(), this.itemsFingerprint = "";
|
|
1217
1217
|
}
|
|
@@ -1220,7 +1220,7 @@ let Ct = class extends y {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
willUpdate(t) {
|
|
1222
1222
|
if (t.has("items")) {
|
|
1223
|
-
const e =
|
|
1223
|
+
const e = Dt.fingerprint(this.items);
|
|
1224
1224
|
e !== this.itemsFingerprint && (this.itemsFingerprint = e, this.openSet = new Set(this.items.flatMap((i, a) => i.open ? [a] : [])));
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
@@ -1231,10 +1231,10 @@ let Ct = class extends y {
|
|
|
1231
1231
|
);
|
|
1232
1232
|
}
|
|
1233
1233
|
render() {
|
|
1234
|
-
return
|
|
1234
|
+
return l`<div class="baht-accordion">
|
|
1235
1235
|
${this.items.map((t, e) => {
|
|
1236
1236
|
const i = this.openSet.has(e), a = `baht-acc-${this.uid}-t-${e}`, s = `baht-acc-${this.uid}-p-${e}`;
|
|
1237
|
-
return
|
|
1237
|
+
return l`<div class="baht-accordion-item${i ? " baht-accordion-item--open" : ""}">
|
|
1238
1238
|
<button
|
|
1239
1239
|
type="button"
|
|
1240
1240
|
class="baht-accordion-trigger"
|
|
@@ -1246,63 +1246,63 @@ let Ct = class extends y {
|
|
|
1246
1246
|
<span>${t.title}</span>
|
|
1247
1247
|
<span class="baht-accordion-chevron" aria-hidden="true">▾</span>
|
|
1248
1248
|
</button>
|
|
1249
|
-
${i ?
|
|
1249
|
+
${i ? l`<div class="baht-accordion-content" id=${s} role="region" aria-labelledby=${a}>${t.content}</div>` : h}
|
|
1250
1250
|
</div>`;
|
|
1251
1251
|
})}
|
|
1252
1252
|
</div>`;
|
|
1253
1253
|
}
|
|
1254
1254
|
};
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
],
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
],
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
],
|
|
1264
|
-
|
|
1255
|
+
ue([
|
|
1256
|
+
n({ attribute: !1 })
|
|
1257
|
+
], Dt.prototype, "items", 2);
|
|
1258
|
+
ue([
|
|
1259
|
+
n({ type: Boolean })
|
|
1260
|
+
], Dt.prototype, "multiple", 2);
|
|
1261
|
+
ue([
|
|
1262
|
+
y()
|
|
1263
|
+
], Dt.prototype, "openSet", 2);
|
|
1264
|
+
Dt = ue([
|
|
1265
1265
|
b("baht-accordion")
|
|
1266
|
-
],
|
|
1267
|
-
var sa = Object.defineProperty, aa = Object.getOwnPropertyDescriptor,
|
|
1266
|
+
], Dt);
|
|
1267
|
+
var sa = Object.defineProperty, aa = Object.getOwnPropertyDescriptor, Zt = (t, e, i, a) => {
|
|
1268
1268
|
for (var s = a > 1 ? void 0 : a ? aa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1269
1269
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1270
1270
|
return a && s && sa(e, i, s), s;
|
|
1271
1271
|
};
|
|
1272
|
-
let
|
|
1272
|
+
let Ft = class extends g {
|
|
1273
1273
|
constructor() {
|
|
1274
1274
|
super(...arguments), this.href = "", this.label = "", this.external = !1, this.externalHint = "opens in new tab";
|
|
1275
1275
|
}
|
|
1276
1276
|
render() {
|
|
1277
|
-
return
|
|
1277
|
+
return l`<a
|
|
1278
1278
|
class="baht-link"
|
|
1279
1279
|
href=${this.href || h}
|
|
1280
1280
|
target=${this.external ? "_blank" : h}
|
|
1281
1281
|
rel=${this.external ? "noopener noreferrer" : h}
|
|
1282
|
-
>${this.label}${this.external ?
|
|
1282
|
+
>${this.label}${this.external ? l` <span class="baht-link-external" aria-hidden="true">↗</span><span class="baht-visually-hidden"> (${this.externalHint})</span>` : h}</a>`;
|
|
1283
1283
|
}
|
|
1284
1284
|
};
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
],
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
],
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
],
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
],
|
|
1297
|
-
|
|
1285
|
+
Zt([
|
|
1286
|
+
n()
|
|
1287
|
+
], Ft.prototype, "href", 2);
|
|
1288
|
+
Zt([
|
|
1289
|
+
n()
|
|
1290
|
+
], Ft.prototype, "label", 2);
|
|
1291
|
+
Zt([
|
|
1292
|
+
n({ type: Boolean })
|
|
1293
|
+
], Ft.prototype, "external", 2);
|
|
1294
|
+
Zt([
|
|
1295
|
+
n({ attribute: "external-hint" })
|
|
1296
|
+
], Ft.prototype, "externalHint", 2);
|
|
1297
|
+
Ft = Zt([
|
|
1298
1298
|
b("baht-link")
|
|
1299
|
-
],
|
|
1300
|
-
var ia = Object.defineProperty, ra = Object.getOwnPropertyDescriptor,
|
|
1299
|
+
], Ft);
|
|
1300
|
+
var ia = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, Se = (t, e, i, a) => {
|
|
1301
1301
|
for (var s = a > 1 ? void 0 : a ? ra(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1302
1302
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1303
1303
|
return a && s && ia(e, i, s), s;
|
|
1304
1304
|
};
|
|
1305
|
-
let
|
|
1305
|
+
let oe = class extends g {
|
|
1306
1306
|
constructor() {
|
|
1307
1307
|
super(...arguments), this.items = [], this.separator = "›";
|
|
1308
1308
|
}
|
|
@@ -1313,10 +1313,10 @@ let re = class extends y {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
render() {
|
|
1315
1315
|
const t = this.items.length - 1;
|
|
1316
|
-
return
|
|
1316
|
+
return l`<nav class="baht-breadcrumbs" aria-label="Breadcrumb">
|
|
1317
1317
|
${this.items.map((e, i) => {
|
|
1318
|
-
const a = i < t ?
|
|
1319
|
-
return i === t ?
|
|
1318
|
+
const a = i < t ? l`<span class="baht-breadcrumbs-sep" aria-hidden="true">${this.separator}</span>` : h;
|
|
1319
|
+
return i === t ? l`<span class="baht-breadcrumbs-current" aria-current="page">${e.label}</span>${a}` : e.href ? l`<a class="baht-link" href=${e.href}>${e.label}</a>${a}` : l`<a
|
|
1320
1320
|
class="baht-link"
|
|
1321
1321
|
href="#"
|
|
1322
1322
|
@click=${(s) => {
|
|
@@ -1327,30 +1327,30 @@ let re = class extends y {
|
|
|
1327
1327
|
</nav>`;
|
|
1328
1328
|
}
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
],
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
],
|
|
1336
|
-
|
|
1330
|
+
Se([
|
|
1331
|
+
n({ attribute: !1 })
|
|
1332
|
+
], oe.prototype, "items", 2);
|
|
1333
|
+
Se([
|
|
1334
|
+
n()
|
|
1335
|
+
], oe.prototype, "separator", 2);
|
|
1336
|
+
oe = Se([
|
|
1337
1337
|
b("baht-breadcrumbs")
|
|
1338
|
-
],
|
|
1338
|
+
], oe);
|
|
1339
1339
|
var oa = Object.getOwnPropertyDescriptor, la = (t, e, i, a) => {
|
|
1340
1340
|
for (var s = a > 1 ? void 0 : a ? oa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1341
1341
|
(o = t[r]) && (s = o(s) || s);
|
|
1342
1342
|
return s;
|
|
1343
1343
|
};
|
|
1344
|
-
let Ne = class extends
|
|
1344
|
+
let Ne = class extends X {
|
|
1345
1345
|
renderControl() {
|
|
1346
|
-
return
|
|
1346
|
+
return l`<input
|
|
1347
1347
|
class="baht-control baht-control--text"
|
|
1348
1348
|
id=${this.controlId}
|
|
1349
1349
|
type=${this.field.type === "email" ? "email" : this.field.type === "password" ? "password" : "text"}
|
|
1350
|
-
.value=${
|
|
1351
|
-
placeholder=${
|
|
1352
|
-
maxlength=${
|
|
1353
|
-
autocomplete=${
|
|
1350
|
+
.value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
|
|
1351
|
+
placeholder=${q(this.field.placeholder)}
|
|
1352
|
+
maxlength=${q(this.field.max_length)}
|
|
1353
|
+
autocomplete=${q(this.field.autocomplete)}
|
|
1354
1354
|
?disabled=${this.disabled}
|
|
1355
1355
|
?readonly=${this.readonly}
|
|
1356
1356
|
?required=${this.required}
|
|
@@ -1368,16 +1368,16 @@ var na = Object.getOwnPropertyDescriptor, ha = (t, e, i, a) => {
|
|
|
1368
1368
|
(o = t[r]) && (s = o(s) || s);
|
|
1369
1369
|
return s;
|
|
1370
1370
|
};
|
|
1371
|
-
let qe = class extends
|
|
1371
|
+
let qe = class extends X {
|
|
1372
1372
|
renderControl() {
|
|
1373
|
-
return
|
|
1373
|
+
return l`<textarea
|
|
1374
1374
|
class="baht-control baht-control--textarea"
|
|
1375
1375
|
id=${this.controlId}
|
|
1376
|
-
.value=${
|
|
1377
|
-
placeholder=${
|
|
1378
|
-
maxlength=${
|
|
1376
|
+
.value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
|
|
1377
|
+
placeholder=${q(this.field.placeholder)}
|
|
1378
|
+
maxlength=${q(this.field.max_length)}
|
|
1379
1379
|
rows=${this.field.rows ?? 3}
|
|
1380
|
-
autocomplete=${
|
|
1380
|
+
autocomplete=${q(this.field.autocomplete)}
|
|
1381
1381
|
?disabled=${this.disabled}
|
|
1382
1382
|
?readonly=${this.readonly}
|
|
1383
1383
|
?required=${this.required}
|
|
@@ -1395,17 +1395,17 @@ var ca = Object.getOwnPropertyDescriptor, pa = (t, e, i, a) => {
|
|
|
1395
1395
|
(o = t[r]) && (s = o(s) || s);
|
|
1396
1396
|
return s;
|
|
1397
1397
|
};
|
|
1398
|
-
let Re = class extends
|
|
1398
|
+
let Re = class extends X {
|
|
1399
1399
|
renderControl() {
|
|
1400
|
-
return
|
|
1400
|
+
return l`<input
|
|
1401
1401
|
class="baht-control baht-control--number"
|
|
1402
1402
|
id=${this.controlId}
|
|
1403
1403
|
type="number"
|
|
1404
|
-
.value=${
|
|
1405
|
-
placeholder=${
|
|
1406
|
-
min=${
|
|
1407
|
-
max=${
|
|
1408
|
-
step=${
|
|
1404
|
+
.value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
|
|
1405
|
+
placeholder=${q(this.field.placeholder)}
|
|
1406
|
+
min=${q(this.field.min)}
|
|
1407
|
+
max=${q(this.field.max)}
|
|
1408
|
+
step=${q(this.field.step)}
|
|
1409
1409
|
?disabled=${this.disabled}
|
|
1410
1410
|
?readonly=${this.readonly}
|
|
1411
1411
|
?required=${this.required}
|
|
@@ -1427,14 +1427,14 @@ var da = Object.defineProperty, ua = Object.getOwnPropertyDescriptor, Te = (t, e
|
|
|
1427
1427
|
return a && s && da(e, i, s), s;
|
|
1428
1428
|
};
|
|
1429
1429
|
const ba = 500;
|
|
1430
|
-
let
|
|
1430
|
+
let le = class extends X {
|
|
1431
1431
|
constructor() {
|
|
1432
1432
|
super(...arguments), this.open = !1, this.active = 0, this.typeBuffer = "", this.onDocMousedown = (t) => {
|
|
1433
1433
|
this.contains(t.target) || this.close();
|
|
1434
1434
|
};
|
|
1435
1435
|
}
|
|
1436
1436
|
disconnectedCallback() {
|
|
1437
|
-
super.disconnectedCallback(), clearTimeout(this.typeTimer),
|
|
1437
|
+
super.disconnectedCallback(), clearTimeout(this.typeTimer), T() && document.removeEventListener("mousedown", this.onDocMousedown);
|
|
1438
1438
|
}
|
|
1439
1439
|
get listId() {
|
|
1440
1440
|
return `${this.controlId}-list`;
|
|
@@ -1469,10 +1469,10 @@ let oe = class extends J {
|
|
|
1469
1469
|
(e = t == null ? void 0 : t.scrollIntoView) == null || e.call(t, { block: "nearest" });
|
|
1470
1470
|
}
|
|
1471
1471
|
openList() {
|
|
1472
|
-
!this.interactive || this.open || (this.active = this.selectedIndex, this.open = !0,
|
|
1472
|
+
!this.interactive || this.open || (this.active = this.selectedIndex, this.open = !0, T() && document.addEventListener("mousedown", this.onDocMousedown));
|
|
1473
1473
|
}
|
|
1474
1474
|
close() {
|
|
1475
|
-
this.open && (this.open = !1,
|
|
1475
|
+
this.open && (this.open = !1, T() && document.removeEventListener("mousedown", this.onDocMousedown));
|
|
1476
1476
|
}
|
|
1477
1477
|
toggle() {
|
|
1478
1478
|
this.open ? this.close() : this.openList();
|
|
@@ -1536,7 +1536,7 @@ let oe = class extends J {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
renderControl() {
|
|
1538
1538
|
const t = this.rows, e = this.selectedIndex, i = e === 0;
|
|
1539
|
-
return
|
|
1539
|
+
return l`<div class="baht-select${this.open ? " baht-select--open" : ""}">
|
|
1540
1540
|
<button
|
|
1541
1541
|
type="button"
|
|
1542
1542
|
class="baht-control baht-control--select baht-select-trigger${i ? " baht-select-trigger--placeholder" : ""}"
|
|
@@ -1567,7 +1567,7 @@ let oe = class extends J {
|
|
|
1567
1567
|
>
|
|
1568
1568
|
${t.map(
|
|
1569
1569
|
// eslint-disable-next-line lit-a11y/click-events-have-key-events -- keyboard lives on the combobox (aria-activedescendant pattern); options are never focused
|
|
1570
|
-
(a, s) =>
|
|
1570
|
+
(a, s) => l`<div
|
|
1571
1571
|
class="baht-listbox-option${s === this.active ? " baht-listbox-option--active" : ""}${s === 0 ? " baht-listbox-option--placeholder" : ""}"
|
|
1572
1572
|
id=${this.optionId(s)}
|
|
1573
1573
|
role="option"
|
|
@@ -1585,20 +1585,20 @@ let oe = class extends J {
|
|
|
1585
1585
|
}
|
|
1586
1586
|
};
|
|
1587
1587
|
Te([
|
|
1588
|
-
|
|
1589
|
-
],
|
|
1588
|
+
y()
|
|
1589
|
+
], le.prototype, "open", 2);
|
|
1590
1590
|
Te([
|
|
1591
|
-
|
|
1592
|
-
],
|
|
1593
|
-
|
|
1591
|
+
y()
|
|
1592
|
+
], le.prototype, "active", 2);
|
|
1593
|
+
le = Te([
|
|
1594
1594
|
b("baht-select")
|
|
1595
|
-
],
|
|
1595
|
+
], le);
|
|
1596
1596
|
var fa = Object.getOwnPropertyDescriptor, ma = (t, e, i, a) => {
|
|
1597
1597
|
for (var s = a > 1 ? void 0 : a ? fa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1598
1598
|
(o = t[r]) && (s = o(s) || s);
|
|
1599
1599
|
return s;
|
|
1600
1600
|
};
|
|
1601
|
-
let ze = class extends
|
|
1601
|
+
let ze = class extends X {
|
|
1602
1602
|
get selected() {
|
|
1603
1603
|
return Array.isArray(this.value) ? this.value : [];
|
|
1604
1604
|
}
|
|
@@ -1607,18 +1607,18 @@ let ze = class extends J {
|
|
|
1607
1607
|
this.emitInput(a.filter((s) => i.includes(s)));
|
|
1608
1608
|
}
|
|
1609
1609
|
renderControl() {
|
|
1610
|
-
return
|
|
1610
|
+
return l`<div
|
|
1611
1611
|
class="baht-control baht-control--multiselect"
|
|
1612
1612
|
role="group"
|
|
1613
1613
|
aria-labelledby=${this.field.label ? this.labelId : h}
|
|
1614
1614
|
aria-describedby=${this.describedBy}
|
|
1615
1615
|
>
|
|
1616
1616
|
${(this.field.options ?? []).map(
|
|
1617
|
-
(t) =>
|
|
1617
|
+
(t) => l`<label class="baht-option">
|
|
1618
1618
|
<input
|
|
1619
1619
|
type="checkbox"
|
|
1620
1620
|
value=${t.key}
|
|
1621
|
-
.checked=${
|
|
1621
|
+
.checked=${lt(this.selected.includes(t.key))}
|
|
1622
1622
|
?disabled=${this.disabled || this.readonly}
|
|
1623
1623
|
@change=${(e) => this.toggle(t.key, e.target.checked)}
|
|
1624
1624
|
/>
|
|
@@ -1636,17 +1636,17 @@ var va = Object.getOwnPropertyDescriptor, $a = (t, e, i, a) => {
|
|
|
1636
1636
|
(o = t[r]) && (s = o(s) || s);
|
|
1637
1637
|
return s;
|
|
1638
1638
|
};
|
|
1639
|
-
let Ve = class extends
|
|
1639
|
+
let Ve = class extends X {
|
|
1640
1640
|
/** Label sits beside the box, so suppress the block label. */
|
|
1641
1641
|
renderLabel() {
|
|
1642
1642
|
return h;
|
|
1643
1643
|
}
|
|
1644
1644
|
renderControl() {
|
|
1645
|
-
return
|
|
1645
|
+
return l`<label class="baht-control baht-control--checkbox baht-option">
|
|
1646
1646
|
<input
|
|
1647
1647
|
type="checkbox"
|
|
1648
1648
|
id=${this.controlId}
|
|
1649
|
-
.checked=${
|
|
1649
|
+
.checked=${lt(this.value === !0)}
|
|
1650
1650
|
?disabled=${this.disabled || this.readonly}
|
|
1651
1651
|
?required=${this.required}
|
|
1652
1652
|
aria-invalid=${this.invalid}
|
|
@@ -1654,7 +1654,7 @@ let Ve = class extends J {
|
|
|
1654
1654
|
@change=${(t) => this.emitInput(t.target.checked)}
|
|
1655
1655
|
/>
|
|
1656
1656
|
<span class="baht-label"
|
|
1657
|
-
>${this.field.label}${this.required ?
|
|
1657
|
+
>${this.field.label}${this.required ? l`<span class="baht-required-mark" aria-hidden="true">*</span>` : h}</span
|
|
1658
1658
|
>
|
|
1659
1659
|
</label>`;
|
|
1660
1660
|
}
|
|
@@ -1667,9 +1667,9 @@ var ya = Object.getOwnPropertyDescriptor, ga = (t, e, i, a) => {
|
|
|
1667
1667
|
(o = t[r]) && (s = o(s) || s);
|
|
1668
1668
|
return s;
|
|
1669
1669
|
};
|
|
1670
|
-
let Ke = class extends
|
|
1670
|
+
let Ke = class extends X {
|
|
1671
1671
|
renderControl() {
|
|
1672
|
-
return
|
|
1672
|
+
return l`<div
|
|
1673
1673
|
class="baht-control baht-control--radio"
|
|
1674
1674
|
role="radiogroup"
|
|
1675
1675
|
aria-labelledby=${this.field.label ? this.labelId : h}
|
|
@@ -1678,12 +1678,12 @@ let Ke = class extends J {
|
|
|
1678
1678
|
aria-describedby=${this.describedBy}
|
|
1679
1679
|
>
|
|
1680
1680
|
${(this.field.options ?? []).map(
|
|
1681
|
-
(t) =>
|
|
1681
|
+
(t) => l`<label class="baht-option">
|
|
1682
1682
|
<input
|
|
1683
1683
|
type="radio"
|
|
1684
1684
|
name=${this.controlId}
|
|
1685
1685
|
value=${t.key}
|
|
1686
|
-
.checked=${
|
|
1686
|
+
.checked=${lt(this.value === t.key)}
|
|
1687
1687
|
?disabled=${this.disabled || this.readonly}
|
|
1688
1688
|
@change=${() => this.emitInput(t.key)}
|
|
1689
1689
|
/>
|
|
@@ -1701,18 +1701,18 @@ var wa = Object.getOwnPropertyDescriptor, xa = (t, e, i, a) => {
|
|
|
1701
1701
|
(o = t[r]) && (s = o(s) || s);
|
|
1702
1702
|
return s;
|
|
1703
1703
|
};
|
|
1704
|
-
let Ue = class extends
|
|
1704
|
+
let Ue = class extends X {
|
|
1705
1705
|
renderLabel() {
|
|
1706
1706
|
return h;
|
|
1707
1707
|
}
|
|
1708
1708
|
renderControl() {
|
|
1709
|
-
return
|
|
1709
|
+
return l`<label class="baht-control baht-control--toggle baht-option">
|
|
1710
1710
|
<input
|
|
1711
1711
|
type="checkbox"
|
|
1712
1712
|
role="switch"
|
|
1713
1713
|
id=${this.controlId}
|
|
1714
1714
|
aria-checked=${this.value === !0 ? "true" : "false"}
|
|
1715
|
-
.checked=${
|
|
1715
|
+
.checked=${lt(this.value === !0)}
|
|
1716
1716
|
?disabled=${this.disabled || this.readonly}
|
|
1717
1717
|
?required=${this.required}
|
|
1718
1718
|
aria-invalid=${this.invalid}
|
|
@@ -1721,7 +1721,7 @@ let Ue = class extends J {
|
|
|
1721
1721
|
/>
|
|
1722
1722
|
<span class="baht-toggle-track"><span class="baht-toggle-thumb"></span></span>
|
|
1723
1723
|
<span class="baht-label"
|
|
1724
|
-
>${this.field.label}${this.required ?
|
|
1724
|
+
>${this.field.label}${this.required ? l`<span class="baht-required-mark" aria-hidden="true">*</span>` : h}</span
|
|
1725
1725
|
>
|
|
1726
1726
|
</label>`;
|
|
1727
1727
|
}
|
|
@@ -1734,17 +1734,17 @@ var _a = Object.getOwnPropertyDescriptor, ka = (t, e, i, a) => {
|
|
|
1734
1734
|
(o = t[r]) && (s = o(s) || s);
|
|
1735
1735
|
return s;
|
|
1736
1736
|
};
|
|
1737
|
-
let He = class extends
|
|
1737
|
+
let He = class extends X {
|
|
1738
1738
|
constructor() {
|
|
1739
1739
|
super(...arguments), this.lastEmitted = null;
|
|
1740
1740
|
}
|
|
1741
1741
|
renderControl() {
|
|
1742
|
-
return
|
|
1742
|
+
return l`<input
|
|
1743
1743
|
class="baht-control baht-control--date"
|
|
1744
1744
|
id=${this.controlId}
|
|
1745
1745
|
type="text"
|
|
1746
1746
|
autocomplete="off"
|
|
1747
|
-
placeholder=${
|
|
1747
|
+
placeholder=${q(this.field.placeholder)}
|
|
1748
1748
|
?disabled=${this.disabled}
|
|
1749
1749
|
?readonly=${this.readonly}
|
|
1750
1750
|
?required=${this.required}
|
|
@@ -1781,7 +1781,7 @@ let He = class extends J {
|
|
|
1781
1781
|
We(this.fp.selectedDates, t) || (t.length === 0 ? this.fp.clear(!1) : this.fp.setDate(t, !1));
|
|
1782
1782
|
}
|
|
1783
1783
|
options() {
|
|
1784
|
-
const t = this.field, e = $e(t), i =
|
|
1784
|
+
const t = this.field, e = $e(t), i = Nt(t.min), a = Nt(t.max);
|
|
1785
1785
|
return {
|
|
1786
1786
|
static: !0,
|
|
1787
1787
|
disableMobile: !0,
|
|
@@ -1824,15 +1824,15 @@ let He = class extends J {
|
|
|
1824
1824
|
t && (this.todayBtn && (this.todayBtn.disabled = !this.todayAllowed()), this.clearBtn && (this.clearBtn.disabled = t.selectedDates.length === 0));
|
|
1825
1825
|
}
|
|
1826
1826
|
todayAllowed() {
|
|
1827
|
-
const t =
|
|
1828
|
-
if (e && t <
|
|
1827
|
+
const t = kt(/* @__PURE__ */ new Date()), e = Nt(this.field.min), i = Nt(this.field.max);
|
|
1828
|
+
if (e && t < kt(e) || i && t > kt(i)) return !1;
|
|
1829
1829
|
for (const a of Je(this.field) ?? [])
|
|
1830
1830
|
if (a instanceof Date) {
|
|
1831
1831
|
if (Ge(a, t)) return !1;
|
|
1832
1832
|
} else if (typeof a == "function") {
|
|
1833
1833
|
if (a(t)) return !1;
|
|
1834
1834
|
} else if (typeof a == "object" && "from" in a) {
|
|
1835
|
-
const s =
|
|
1835
|
+
const s = kt(new Date(a.from)), r = kt(new Date(a.to));
|
|
1836
1836
|
if (t >= s && t <= r) return !1;
|
|
1837
1837
|
}
|
|
1838
1838
|
return !0;
|
|
@@ -1840,7 +1840,7 @@ let He = class extends J {
|
|
|
1840
1840
|
pickToday() {
|
|
1841
1841
|
const t = this.fp;
|
|
1842
1842
|
if (!t || !this.todayAllowed()) return;
|
|
1843
|
-
const e =
|
|
1843
|
+
const e = kt(/* @__PURE__ */ new Date());
|
|
1844
1844
|
switch ($e(this.field)) {
|
|
1845
1845
|
case "range":
|
|
1846
1846
|
t.setDate([e, e], !0);
|
|
@@ -1860,11 +1860,11 @@ let He = class extends J {
|
|
|
1860
1860
|
}
|
|
1861
1861
|
/** Host value (any mode) -> the Date list flatpickr works with. */
|
|
1862
1862
|
datesOf(t) {
|
|
1863
|
-
return ds(t).map(
|
|
1863
|
+
return ds(t).map(Nt).filter((e) => e !== null);
|
|
1864
1864
|
}
|
|
1865
1865
|
/** flatpickr's selection -> the value shape of the field's mode. */
|
|
1866
1866
|
toValue(t) {
|
|
1867
|
-
const e = t.map(
|
|
1867
|
+
const e = t.map(zt);
|
|
1868
1868
|
switch ($e(this.field)) {
|
|
1869
1869
|
case "range":
|
|
1870
1870
|
return e.length === 2 ? [e[0], e[1]] : null;
|
|
@@ -1878,14 +1878,14 @@ let He = class extends J {
|
|
|
1878
1878
|
He = ka([
|
|
1879
1879
|
b("baht-datepicker")
|
|
1880
1880
|
], He);
|
|
1881
|
-
function
|
|
1881
|
+
function kt(t) {
|
|
1882
1882
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
1883
1883
|
}
|
|
1884
1884
|
function Ge(t, e) {
|
|
1885
|
-
return
|
|
1885
|
+
return zt(t) === zt(e);
|
|
1886
1886
|
}
|
|
1887
1887
|
function We(t, e) {
|
|
1888
|
-
return t.length !== e.length ? !1 : t.every((i, a) =>
|
|
1888
|
+
return t.length !== e.length ? !1 : t.every((i, a) => zt(i) === zt(e[a]));
|
|
1889
1889
|
}
|
|
1890
1890
|
function Je(t) {
|
|
1891
1891
|
const e = [];
|
|
@@ -1896,23 +1896,23 @@ function Je(t) {
|
|
|
1896
1896
|
const i = t.disabled_weekdays;
|
|
1897
1897
|
return i != null && i.length && e.push((a) => i.includes(a.getDay())), e;
|
|
1898
1898
|
}
|
|
1899
|
-
var Pa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor,
|
|
1899
|
+
var Pa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Qt = (t, e, i, a) => {
|
|
1900
1900
|
for (var s = a > 1 ? void 0 : a ? Oa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
1901
1901
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
1902
1902
|
return a && s && Pa(e, i, s), s;
|
|
1903
1903
|
};
|
|
1904
|
-
function
|
|
1904
|
+
function Xe(t) {
|
|
1905
1905
|
return t !== null && typeof t == "object" && typeof t.url == "string";
|
|
1906
1906
|
}
|
|
1907
1907
|
function ge(t) {
|
|
1908
1908
|
return t >= 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : t >= 1024 ? `${Math.round(t / 1024)} KB` : `${t} B`;
|
|
1909
1909
|
}
|
|
1910
|
-
let
|
|
1910
|
+
let Et = class extends X {
|
|
1911
1911
|
constructor() {
|
|
1912
1912
|
super(...arguments), this.uploadingCount = 0, this.uploadError = null, this.rejectedNames = [];
|
|
1913
1913
|
}
|
|
1914
1914
|
get refs() {
|
|
1915
|
-
return Array.isArray(this.value) ? this.value.filter(
|
|
1915
|
+
return Array.isArray(this.value) ? this.value.filter(Xe) : Xe(this.value) ? [this.value] : [];
|
|
1916
1916
|
}
|
|
1917
1917
|
emitRefs(t) {
|
|
1918
1918
|
this.emitInput(this.field.multiple ? t : t[0] ?? null);
|
|
@@ -1958,7 +1958,7 @@ let Ft = class extends J {
|
|
|
1958
1958
|
t ? "baht-dropzone--disabled" : "",
|
|
1959
1959
|
this.invalid === "true" ? "baht-dropzone--invalid" : ""
|
|
1960
1960
|
].filter(Boolean).join(" ");
|
|
1961
|
-
return
|
|
1961
|
+
return l`<div
|
|
1962
1962
|
class=${i}
|
|
1963
1963
|
@dragover=${(a) => {
|
|
1964
1964
|
t || (a.preventDefault(), a.currentTarget.classList.add("baht-dropzone--over"));
|
|
@@ -1973,7 +1973,7 @@ let Ft = class extends J {
|
|
|
1973
1973
|
class="baht-control baht-control--file baht-dropzone-input"
|
|
1974
1974
|
id=${this.controlId}
|
|
1975
1975
|
type="file"
|
|
1976
|
-
accept=${
|
|
1976
|
+
accept=${q(this.field.accept)}
|
|
1977
1977
|
?multiple=${this.field.multiple}
|
|
1978
1978
|
?disabled=${t}
|
|
1979
1979
|
?required=${this.required}
|
|
@@ -1981,61 +1981,61 @@ let Ft = class extends J {
|
|
|
1981
1981
|
aria-describedby=${this.describedBy}
|
|
1982
1982
|
@change=${(a) => this.onPick(a)}
|
|
1983
1983
|
/>
|
|
1984
|
-
<span class="baht-dropzone-icon" aria-hidden="true">${
|
|
1984
|
+
<span class="baht-dropzone-icon" aria-hidden="true">${W("upload")}</span>
|
|
1985
1985
|
<span class="baht-dropzone-text">
|
|
1986
1986
|
<label class="baht-dropzone-action" for=${this.controlId}
|
|
1987
1987
|
>${this.field.multiple ? m("chooseFiles") : m("chooseFile")}</label
|
|
1988
1988
|
>
|
|
1989
1989
|
<span class="baht-dropzone-or">${m("orDropHere")}</span>
|
|
1990
1990
|
</span>
|
|
1991
|
-
${e ?
|
|
1991
|
+
${e ? l`<span class="baht-dropzone-hint">${e}</span>` : h}
|
|
1992
1992
|
</div>
|
|
1993
|
-
${this.uploadingCount > 0 ?
|
|
1994
|
-
${this.uploadError ?
|
|
1995
|
-
${this.rejectedNames.length > 0 ?
|
|
1993
|
+
${this.uploadingCount > 0 ? l`<p class="baht-file-status" role="status">${m("uploading")}</p>` : h}
|
|
1994
|
+
${this.uploadError ? l`<p class="baht-error" role="alert">${this.uploadError}</p>` : h}
|
|
1995
|
+
${this.rejectedNames.length > 0 ? l`<p class="baht-error baht-file-rejected" role="alert">
|
|
1996
1996
|
${m("fileRejectedTooLarge", { names: this.rejectedNames.join(", ") })}
|
|
1997
1997
|
</p>` : h}
|
|
1998
1998
|
${this.captured.map(
|
|
1999
|
-
(a) =>
|
|
1999
|
+
(a) => l`<span class="baht-file-chip">
|
|
2000
2000
|
<span class="baht-file-name">${a.name}</span>
|
|
2001
2001
|
<span class="baht-file-size">${ge(a.size)}</span>
|
|
2002
2002
|
</span>`
|
|
2003
2003
|
)}
|
|
2004
2004
|
${this.refs.map(
|
|
2005
|
-
(a) =>
|
|
2005
|
+
(a) => l`<span class="baht-file-chip">
|
|
2006
2006
|
<a href=${a.url} target="_blank" rel="noreferrer"
|
|
2007
2007
|
>${a.name}<span class="baht-visually-hidden"> (${m("opensInNewTab")})</span></a
|
|
2008
2008
|
>
|
|
2009
2009
|
<span class="baht-file-size">${ge(a.size)}</span>
|
|
2010
|
-
${this.disabled || this.readonly ? h :
|
|
2010
|
+
${this.disabled || this.readonly ? h : l`<button
|
|
2011
2011
|
type="button"
|
|
2012
2012
|
class="baht-file-remove"
|
|
2013
2013
|
aria-label=${m("removeFile")}
|
|
2014
2014
|
title=${m("removeFile")}
|
|
2015
2015
|
@click=${() => this.emitRefs(this.refs.filter((s) => s !== a))}
|
|
2016
2016
|
>
|
|
2017
|
-
${
|
|
2017
|
+
${W("close")}
|
|
2018
2018
|
</button>`}
|
|
2019
2019
|
</span>`
|
|
2020
2020
|
)}`;
|
|
2021
2021
|
}
|
|
2022
2022
|
};
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
],
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
],
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
],
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
],
|
|
2035
|
-
|
|
2023
|
+
Qt([
|
|
2024
|
+
n({ attribute: !1 })
|
|
2025
|
+
], Et.prototype, "uploader", 2);
|
|
2026
|
+
Qt([
|
|
2027
|
+
y()
|
|
2028
|
+
], Et.prototype, "uploadingCount", 2);
|
|
2029
|
+
Qt([
|
|
2030
|
+
y()
|
|
2031
|
+
], Et.prototype, "uploadError", 2);
|
|
2032
|
+
Qt([
|
|
2033
|
+
y()
|
|
2034
|
+
], Et.prototype, "rejectedNames", 2);
|
|
2035
|
+
Et = Qt([
|
|
2036
2036
|
b("baht-file")
|
|
2037
|
-
],
|
|
2038
|
-
var Ca = Object.defineProperty, Da = Object.getOwnPropertyDescriptor,
|
|
2037
|
+
], Et);
|
|
2038
|
+
var Ca = Object.defineProperty, Da = Object.getOwnPropertyDescriptor, M = (t, e, i, a) => {
|
|
2039
2039
|
for (var s = a > 1 ? void 0 : a ? Da(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2040
2040
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2041
2041
|
return a && s && Ca(e, i, s), s;
|
|
@@ -2068,7 +2068,7 @@ function Ba(t) {
|
|
|
2068
2068
|
function we(t) {
|
|
2069
2069
|
return t >= 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : t >= 1024 ? `${Math.round(t / 1024)} KB` : `${t} B`;
|
|
2070
2070
|
}
|
|
2071
|
-
let
|
|
2071
|
+
let F = class extends g {
|
|
2072
2072
|
constructor() {
|
|
2073
2073
|
super(...arguments), this.url = "", this.method = "POST", this.fieldName = "file", this.responseKey = "url", this.headers = {}, this.withCredentials = !1, this.value = null, this.label = "", this.hint = "", this.multiple = !1, this.disabled = !1, this.required = !1, this.error = null, this.pending = [], this.rejectedNames = [], this.dragging = !1, this.known = /* @__PURE__ */ new Map(), this.seq = 0;
|
|
2074
2074
|
}
|
|
@@ -2180,9 +2180,9 @@ let D = class extends y {
|
|
|
2180
2180
|
this.disabled ? "baht-dropzone--disabled" : "",
|
|
2181
2181
|
e ? "baht-dropzone--invalid" : ""
|
|
2182
2182
|
].filter(Boolean).join(" ");
|
|
2183
|
-
return
|
|
2184
|
-
${this.label ?
|
|
2185
|
-
>${this.label}${this.required ?
|
|
2183
|
+
return l`<div class="baht-field baht-field--upload">
|
|
2184
|
+
${this.label ? l`<label class="baht-label" for=${this.inputId}
|
|
2185
|
+
>${this.label}${this.required ? l`<span class="baht-required-mark" aria-hidden="true">*</span>` : h}</label
|
|
2186
2186
|
>` : h}
|
|
2187
2187
|
<div
|
|
2188
2188
|
class=${o}
|
|
@@ -2194,58 +2194,58 @@ let D = class extends y {
|
|
|
2194
2194
|
class="baht-dropzone-input"
|
|
2195
2195
|
id=${this.inputId}
|
|
2196
2196
|
type="file"
|
|
2197
|
-
accept=${
|
|
2197
|
+
accept=${q(this.accept)}
|
|
2198
2198
|
?multiple=${this.multiple}
|
|
2199
2199
|
?disabled=${this.disabled}
|
|
2200
2200
|
?required=${this.required}
|
|
2201
2201
|
aria-invalid=${e ? "true" : "false"}
|
|
2202
|
-
aria-describedby=${
|
|
2202
|
+
aria-describedby=${q(r)}
|
|
2203
2203
|
@change=${(c) => this.onPick(c)}
|
|
2204
2204
|
/>
|
|
2205
|
-
<span class="baht-dropzone-icon" aria-hidden="true">${
|
|
2205
|
+
<span class="baht-dropzone-icon" aria-hidden="true">${W("upload")}</span>
|
|
2206
2206
|
<span class="baht-dropzone-text">
|
|
2207
2207
|
<label class="baht-dropzone-action" for=${this.inputId}
|
|
2208
2208
|
>${this.multiple ? m("chooseFiles") : m("chooseFile")}</label
|
|
2209
2209
|
>
|
|
2210
2210
|
<span class="baht-dropzone-or">${m("orDropHere")}</span>
|
|
2211
2211
|
</span>
|
|
2212
|
-
${i ?
|
|
2212
|
+
${i ? l`<span class="baht-dropzone-hint" id=${q(a)}>${i}</span>` : h}
|
|
2213
2213
|
</div>
|
|
2214
2214
|
|
|
2215
|
-
${this.pending.length > 0 || this.urls.length > 0 ?
|
|
2215
|
+
${this.pending.length > 0 || this.urls.length > 0 ? l`<ul class="baht-upload-list" aria-live="polite" aria-busy=${t ? "true" : "false"}>
|
|
2216
2216
|
${this.urls.map((c) => this.renderStored(c))}
|
|
2217
2217
|
${this.pending.map((c) => this.renderPending(c))}
|
|
2218
2218
|
</ul>` : h}
|
|
2219
|
-
${this.rejectedNames.length > 0 ?
|
|
2219
|
+
${this.rejectedNames.length > 0 ? l`<p class="baht-error" role="alert">
|
|
2220
2220
|
${m("fileRejectedTooLarge", { names: this.rejectedNames.join(", ") })}
|
|
2221
2221
|
</p>` : h}
|
|
2222
|
-
${this.error ?
|
|
2222
|
+
${this.error ? l`<p class="baht-error" id=${q(s)} role="alert">${this.error}</p>` : h}
|
|
2223
2223
|
</div>`;
|
|
2224
2224
|
}
|
|
2225
2225
|
renderStored(t) {
|
|
2226
2226
|
const e = this.fileFor(t);
|
|
2227
|
-
return
|
|
2228
|
-
<span class="baht-file-chip-icon" aria-hidden="true">${
|
|
2227
|
+
return l`<li class="baht-file-chip baht-file-chip--done">
|
|
2228
|
+
<span class="baht-file-chip-icon" aria-hidden="true">${W("check")}</span>
|
|
2229
2229
|
<a class="baht-file-name" href=${t} target="_blank" rel="noreferrer"
|
|
2230
2230
|
>${e.name}<span class="baht-visually-hidden"> (${m("opensInNewTab")})</span></a
|
|
2231
2231
|
>
|
|
2232
|
-
${e.size > 0 ?
|
|
2233
|
-
${this.disabled ? h :
|
|
2232
|
+
${e.size > 0 ? l`<span class="baht-file-size">${we(e.size)}</span>` : h}
|
|
2233
|
+
${this.disabled ? h : l`<button
|
|
2234
2234
|
type="button"
|
|
2235
2235
|
class="baht-file-remove"
|
|
2236
2236
|
aria-label=${m("removeFile")}
|
|
2237
2237
|
title=${m("removeFile")}
|
|
2238
2238
|
@click=${() => this.emitValue(this.urls.filter((i) => i !== t))}
|
|
2239
2239
|
>
|
|
2240
|
-
${
|
|
2240
|
+
${W("close")}
|
|
2241
2241
|
</button>`}
|
|
2242
2242
|
</li>`;
|
|
2243
2243
|
}
|
|
2244
2244
|
renderPending(t) {
|
|
2245
|
-
return
|
|
2245
|
+
return l`<li class="baht-file-chip ${t.error ? "baht-file-chip--error" : "baht-file-chip--busy"}">
|
|
2246
2246
|
<span class="baht-file-name">${t.file.name}</span>
|
|
2247
2247
|
<span class="baht-file-size">${we(t.file.size)}</span>
|
|
2248
|
-
${t.error ?
|
|
2248
|
+
${t.error ? l`<span class="baht-file-status baht-file-status--error" role="alert">${t.error}</span>
|
|
2249
2249
|
<button type="button" class="baht-upload-retry" @click=${() => this.retry(t)}>
|
|
2250
2250
|
${m("retry")}
|
|
2251
2251
|
</button>
|
|
@@ -2256,8 +2256,8 @@ let D = class extends y {
|
|
|
2256
2256
|
title=${m("removeFile")}
|
|
2257
2257
|
@click=${() => this.dismiss(t)}
|
|
2258
2258
|
>
|
|
2259
|
-
${
|
|
2260
|
-
</button>` :
|
|
2259
|
+
${W("close")}
|
|
2260
|
+
</button>` : l`<span
|
|
2261
2261
|
class="baht-upload-bar"
|
|
2262
2262
|
role="progressbar"
|
|
2263
2263
|
aria-label=${m("uploading")}
|
|
@@ -2269,143 +2269,143 @@ let D = class extends y {
|
|
|
2269
2269
|
</li>`;
|
|
2270
2270
|
}
|
|
2271
2271
|
};
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
],
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
],
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
],
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
],
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
],
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
],
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
],
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
],
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
],
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
],
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
],
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
],
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
],
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
],
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
],
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
],
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
],
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
],
|
|
2326
|
-
|
|
2272
|
+
M([
|
|
2273
|
+
n()
|
|
2274
|
+
], F.prototype, "url", 2);
|
|
2275
|
+
M([
|
|
2276
|
+
n()
|
|
2277
|
+
], F.prototype, "method", 2);
|
|
2278
|
+
M([
|
|
2279
|
+
n({ attribute: "field-name" })
|
|
2280
|
+
], F.prototype, "fieldName", 2);
|
|
2281
|
+
M([
|
|
2282
|
+
n({ attribute: "response-key" })
|
|
2283
|
+
], F.prototype, "responseKey", 2);
|
|
2284
|
+
M([
|
|
2285
|
+
n({ attribute: !1 })
|
|
2286
|
+
], F.prototype, "headers", 2);
|
|
2287
|
+
M([
|
|
2288
|
+
n({ type: Boolean, attribute: "with-credentials" })
|
|
2289
|
+
], F.prototype, "withCredentials", 2);
|
|
2290
|
+
M([
|
|
2291
|
+
n({ attribute: !1 })
|
|
2292
|
+
], F.prototype, "value", 2);
|
|
2293
|
+
M([
|
|
2294
|
+
n()
|
|
2295
|
+
], F.prototype, "label", 2);
|
|
2296
|
+
M([
|
|
2297
|
+
n()
|
|
2298
|
+
], F.prototype, "hint", 2);
|
|
2299
|
+
M([
|
|
2300
|
+
n()
|
|
2301
|
+
], F.prototype, "accept", 2);
|
|
2302
|
+
M([
|
|
2303
|
+
n({ type: Boolean })
|
|
2304
|
+
], F.prototype, "multiple", 2);
|
|
2305
|
+
M([
|
|
2306
|
+
n({ type: Number, attribute: "max-size" })
|
|
2307
|
+
], F.prototype, "maxSize", 2);
|
|
2308
|
+
M([
|
|
2309
|
+
n({ type: Boolean })
|
|
2310
|
+
], F.prototype, "disabled", 2);
|
|
2311
|
+
M([
|
|
2312
|
+
n({ type: Boolean })
|
|
2313
|
+
], F.prototype, "required", 2);
|
|
2314
|
+
M([
|
|
2315
|
+
n()
|
|
2316
|
+
], F.prototype, "error", 2);
|
|
2317
|
+
M([
|
|
2318
|
+
y()
|
|
2319
|
+
], F.prototype, "pending", 2);
|
|
2320
|
+
M([
|
|
2321
|
+
y()
|
|
2322
|
+
], F.prototype, "rejectedNames", 2);
|
|
2323
|
+
M([
|
|
2324
|
+
y()
|
|
2325
|
+
], F.prototype, "dragging", 2);
|
|
2326
|
+
F = M([
|
|
2327
2327
|
b("baht-upload")
|
|
2328
|
-
],
|
|
2329
|
-
var
|
|
2330
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
2328
|
+
], F);
|
|
2329
|
+
var Ma = Object.defineProperty, Ia = Object.getOwnPropertyDescriptor, ns = (t, e, i, a) => {
|
|
2330
|
+
for (var s = a > 1 ? void 0 : a ? Ia(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2331
2331
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2332
|
-
return a && s &&
|
|
2332
|
+
return a && s && Ma(e, i, s), s;
|
|
2333
2333
|
};
|
|
2334
|
-
let Fe = class extends
|
|
2334
|
+
let Fe = class extends g {
|
|
2335
2335
|
render() {
|
|
2336
2336
|
if (!this.field) return h;
|
|
2337
2337
|
const t = this.field.variant ?? "body";
|
|
2338
|
-
return
|
|
2338
|
+
return l`<div class="baht-text baht-text--${t}">${this.field.text ?? this.field.label ?? ""}</div>`;
|
|
2339
2339
|
}
|
|
2340
2340
|
};
|
|
2341
2341
|
ns([
|
|
2342
|
-
|
|
2342
|
+
n({ attribute: !1 })
|
|
2343
2343
|
], Fe.prototype, "field", 2);
|
|
2344
2344
|
Fe = ns([
|
|
2345
2345
|
b("baht-text")
|
|
2346
2346
|
], Fe);
|
|
2347
|
-
var
|
|
2348
|
-
for (var s = a > 1 ? void 0 : a ?
|
|
2347
|
+
var ja = Object.defineProperty, Sa = Object.getOwnPropertyDescriptor, hs = (t, e, i, a) => {
|
|
2348
|
+
for (var s = a > 1 ? void 0 : a ? Sa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2349
2349
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2350
|
-
return a && s &&
|
|
2350
|
+
return a && s && ja(e, i, s), s;
|
|
2351
2351
|
};
|
|
2352
|
-
let Ee = class extends
|
|
2352
|
+
let Ee = class extends g {
|
|
2353
2353
|
render() {
|
|
2354
|
-
return this.field ?
|
|
2354
|
+
return this.field ? l`<div class="baht-section">
|
|
2355
2355
|
<span class="baht-section-label">${this.field.text ?? this.field.label ?? ""}</span>
|
|
2356
2356
|
</div>` : h;
|
|
2357
2357
|
}
|
|
2358
2358
|
};
|
|
2359
2359
|
hs([
|
|
2360
|
-
|
|
2360
|
+
n({ attribute: !1 })
|
|
2361
2361
|
], Ee.prototype, "field", 2);
|
|
2362
2362
|
Ee = hs([
|
|
2363
2363
|
b("baht-section")
|
|
2364
2364
|
], Ee);
|
|
2365
|
-
var Ta = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor,
|
|
2365
|
+
var Ta = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, be = (t, e, i, a) => {
|
|
2366
2366
|
for (var s = a > 1 ? void 0 : a ? Aa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2367
2367
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2368
2368
|
return a && s && Ta(e, i, s), s;
|
|
2369
2369
|
};
|
|
2370
|
-
let
|
|
2370
|
+
let Ht = class extends g {
|
|
2371
2371
|
constructor() {
|
|
2372
2372
|
super(...arguments), this.total = 0, this.label = "", this.color = "";
|
|
2373
2373
|
}
|
|
2374
2374
|
render() {
|
|
2375
|
-
return
|
|
2375
|
+
return l`<div class="baht-stat-chart">
|
|
2376
2376
|
<div
|
|
2377
2377
|
class="baht-stat-chart-total"
|
|
2378
2378
|
style=${this.color ? `color:${this.color}` : h}
|
|
2379
2379
|
>${this.total.toLocaleString("en-US")}</div>
|
|
2380
|
-
${this.label ?
|
|
2380
|
+
${this.label ? l`<div class="baht-stat-chart-label">${this.label}</div>` : h}
|
|
2381
2381
|
</div>`;
|
|
2382
2382
|
}
|
|
2383
2383
|
};
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
],
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
],
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
],
|
|
2393
|
-
|
|
2384
|
+
be([
|
|
2385
|
+
n({ type: Number })
|
|
2386
|
+
], Ht.prototype, "total", 2);
|
|
2387
|
+
be([
|
|
2388
|
+
n()
|
|
2389
|
+
], Ht.prototype, "label", 2);
|
|
2390
|
+
be([
|
|
2391
|
+
n()
|
|
2392
|
+
], Ht.prototype, "color", 2);
|
|
2393
|
+
Ht = be([
|
|
2394
2394
|
b("baht-stat-chart")
|
|
2395
|
-
],
|
|
2396
|
-
var La = Object.defineProperty,
|
|
2395
|
+
], Ht);
|
|
2396
|
+
var La = Object.defineProperty, At = (t, e, i, a) => {
|
|
2397
2397
|
for (var s = void 0, r = t.length - 1, o; r >= 0; r--)
|
|
2398
2398
|
(o = t[r]) && (s = o(e, i, s) || s);
|
|
2399
2399
|
return s && La(e, i, s), s;
|
|
2400
2400
|
};
|
|
2401
2401
|
const Na = 10;
|
|
2402
|
-
function
|
|
2402
|
+
function ft(t, e) {
|
|
2403
2403
|
return e && t === 0 ? e : `var(--baht-chart-${t % Na + 1})`;
|
|
2404
2404
|
}
|
|
2405
|
-
function
|
|
2405
|
+
function Ye(t, e = 5) {
|
|
2406
2406
|
return `var(--baht-chart-seq-${Math.min(e - 1, Math.max(0, t)) + 1})`;
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2408
|
+
function Rt(t, e = "number", i = "THB") {
|
|
2409
2409
|
if (!Number.isFinite(t)) return "—";
|
|
2410
2410
|
switch (e) {
|
|
2411
2411
|
case "currency":
|
|
@@ -2435,7 +2435,7 @@ function Be(t, e = 4) {
|
|
|
2435
2435
|
for (let c = 0; c <= r + s / 1e3; c += s) o.push(Number(c.toFixed(10)));
|
|
2436
2436
|
return o;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function ne(t, e) {
|
|
2439
2439
|
const [i, a] = t, [s, r] = e, o = a - i;
|
|
2440
2440
|
return !Number.isFinite(o) || o === 0 ? () => s : (c) => s + (c - i) / o * (r - s);
|
|
2441
2441
|
}
|
|
@@ -2444,21 +2444,21 @@ function qa(t, e, i = "Other") {
|
|
|
2444
2444
|
const a = t.slice(0, e - 1), s = t.slice(e - 1).reduce((r, o) => r + o.count, 0);
|
|
2445
2445
|
return [...a, { label: i, count: s }];
|
|
2446
2446
|
}
|
|
2447
|
-
function
|
|
2448
|
-
return
|
|
2447
|
+
function fe(t, e, i, a = "View as table") {
|
|
2448
|
+
return l`<details class="baht-chart-table">
|
|
2449
2449
|
<summary>${a}</summary>
|
|
2450
2450
|
<table>
|
|
2451
2451
|
<caption>${t}</caption>
|
|
2452
2452
|
<thead>
|
|
2453
2453
|
<tr>
|
|
2454
|
-
${e.map((s) =>
|
|
2454
|
+
${e.map((s) => l`<th scope="col">${s}</th>`)}
|
|
2455
2455
|
</tr>
|
|
2456
2456
|
</thead>
|
|
2457
2457
|
<tbody>
|
|
2458
2458
|
${i.map(
|
|
2459
|
-
(s) =>
|
|
2459
|
+
(s) => l`<tr>
|
|
2460
2460
|
${s.map(
|
|
2461
|
-
(r, o) => o === 0 ?
|
|
2461
|
+
(r, o) => o === 0 ? l`<th scope="row">${r}</th>` : l`<td class="baht-chart-num">${r}</td>`
|
|
2462
2462
|
)}
|
|
2463
2463
|
</tr>`
|
|
2464
2464
|
)}
|
|
@@ -2466,13 +2466,13 @@ function be(t, e, i, a = "View as table") {
|
|
|
2466
2466
|
</table>
|
|
2467
2467
|
</details>`;
|
|
2468
2468
|
}
|
|
2469
|
-
class
|
|
2469
|
+
class st extends g {
|
|
2470
2470
|
constructor() {
|
|
2471
2471
|
super(...arguments), this.emptyMessage = "No data to chart", this.loading = !1, this.showTable = !0, this.format = "number", this.currency = "THB", this.held = null;
|
|
2472
2472
|
}
|
|
2473
2473
|
/** Value → display text using this chart's `format` / `currency`. */
|
|
2474
2474
|
fmt(e) {
|
|
2475
|
-
return
|
|
2475
|
+
return Rt(e, this.format, this.currency);
|
|
2476
2476
|
}
|
|
2477
2477
|
/**
|
|
2478
2478
|
* The snapshot to draw. While `loading` is set the previous one is returned,
|
|
@@ -2487,7 +2487,7 @@ class tt extends y {
|
|
|
2487
2487
|
}
|
|
2488
2488
|
/** The single floating tooltip node; rendered by the template, never appended. */
|
|
2489
2489
|
renderTooltip() {
|
|
2490
|
-
return
|
|
2490
|
+
return l`<div class="baht-chart-tooltip" role="status" aria-live="polite" hidden></div>`;
|
|
2491
2491
|
}
|
|
2492
2492
|
/**
|
|
2493
2493
|
* Show `text` near the pointer (or, on keyboard focus, near the mark).
|
|
@@ -2495,7 +2495,7 @@ class tt extends y {
|
|
|
2495
2495
|
* untrusted data (interaction.md).
|
|
2496
2496
|
*/
|
|
2497
2497
|
showTip(e, i) {
|
|
2498
|
-
var
|
|
2498
|
+
var $;
|
|
2499
2499
|
const a = this.tipEl;
|
|
2500
2500
|
if (!a) return;
|
|
2501
2501
|
a.textContent = i, a.hidden = !1;
|
|
@@ -2506,7 +2506,7 @@ class tt extends y {
|
|
|
2506
2506
|
if (typeof o.clientX == "number" && (o.clientX !== 0 || o.clientY !== 0))
|
|
2507
2507
|
c = o.clientX - r.left, f = o.clientY - r.top;
|
|
2508
2508
|
else {
|
|
2509
|
-
const
|
|
2509
|
+
const w = e.currentTarget, p = ($ = w == null ? void 0 : w.getBoundingClientRect) == null ? void 0 : $.call(w);
|
|
2510
2510
|
c = p ? p.left + p.width / 2 - r.left : 0, f = p ? p.top - r.top : 0;
|
|
2511
2511
|
}
|
|
2512
2512
|
a.style.left = `${Math.round(c)}px`, a.style.top = `${Math.round(f)}px`;
|
|
@@ -2518,90 +2518,90 @@ class tt extends y {
|
|
|
2518
2518
|
}
|
|
2519
2519
|
/** The empty placeholder, or `nothing` when there is data. */
|
|
2520
2520
|
renderEmpty() {
|
|
2521
|
-
return
|
|
2521
|
+
return l`<div class="baht-chart-empty">${this.emptyMessage}</div>`;
|
|
2522
2522
|
}
|
|
2523
2523
|
/** Legend rows — only ever rendered for 2+ series (marks-and-anatomy.md). */
|
|
2524
2524
|
renderLegend(e, i = "rect") {
|
|
2525
|
-
return e.length < 2 ? h :
|
|
2525
|
+
return e.length < 2 ? h : l`<div class="baht-chart-legend">
|
|
2526
2526
|
${e.map(
|
|
2527
|
-
(a) =>
|
|
2527
|
+
(a) => l`<div class="baht-chart-legend-row">
|
|
2528
2528
|
<span
|
|
2529
2529
|
class="baht-chart-swatch${i === "line" ? " baht-chart-swatch--line" : ""}"
|
|
2530
2530
|
style="background:${a.color}"
|
|
2531
2531
|
aria-hidden="true"
|
|
2532
2532
|
></span>
|
|
2533
2533
|
<span class="baht-chart-legend-label">${a.label}</span>
|
|
2534
|
-
${a.value ?
|
|
2535
|
-
${a.share ?
|
|
2534
|
+
${a.value ? l`<span class="baht-chart-legend-count">${a.value}</span>` : h}
|
|
2535
|
+
${a.share ? l`<span class="baht-chart-legend-pct">${a.share}</span>` : h}
|
|
2536
2536
|
</div>`
|
|
2537
2537
|
)}
|
|
2538
2538
|
</div>`;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
],
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
],
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
],
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
],
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
],
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
],
|
|
2559
|
-
var Ra = Object.defineProperty, za = Object.getOwnPropertyDescriptor,
|
|
2541
|
+
At([
|
|
2542
|
+
n({ attribute: "empty-message" })
|
|
2543
|
+
], st.prototype, "emptyMessage");
|
|
2544
|
+
At([
|
|
2545
|
+
n({ type: Boolean, reflect: !0 })
|
|
2546
|
+
], st.prototype, "loading");
|
|
2547
|
+
At([
|
|
2548
|
+
n({ type: Boolean, attribute: "show-table" })
|
|
2549
|
+
], st.prototype, "showTable");
|
|
2550
|
+
At([
|
|
2551
|
+
n()
|
|
2552
|
+
], st.prototype, "format");
|
|
2553
|
+
At([
|
|
2554
|
+
n()
|
|
2555
|
+
], st.prototype, "currency");
|
|
2556
|
+
At([
|
|
2557
|
+
Mt(".baht-chart-tooltip")
|
|
2558
|
+
], st.prototype, "tipEl");
|
|
2559
|
+
var Ra = Object.defineProperty, za = Object.getOwnPropertyDescriptor, wt = (t, e, i, a) => {
|
|
2560
2560
|
for (var s = a > 1 ? void 0 : a ? za(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2561
2561
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2562
2562
|
return a && s && Ra(e, i, s), s;
|
|
2563
2563
|
};
|
|
2564
|
-
let ct = class extends
|
|
2564
|
+
let ct = class extends g {
|
|
2565
2565
|
constructor() {
|
|
2566
2566
|
super(...arguments), this.values = [], this.width = 96, this.height = 24, this.accentLast = !0, this.color = "", this.label = "";
|
|
2567
2567
|
}
|
|
2568
2568
|
render() {
|
|
2569
|
-
const t = (this.values ?? []).filter((
|
|
2569
|
+
const t = (this.values ?? []).filter((x) => Number.isFinite(x));
|
|
2570
2570
|
if (t.length < 2) return h;
|
|
2571
|
-
const e = Math.max(16, this.width), i = Math.max(8, this.height), a = 3, s = Math.min(...t), r = Math.max(...t), o =
|
|
2572
|
-
return
|
|
2571
|
+
const e = Math.max(16, this.width), i = Math.max(8, this.height), a = 3, s = Math.min(...t), r = Math.max(...t), o = ne([0, t.length - 1], [a, e - a]), c = ne([s, r === s ? s + 1 : r], [i - a, a]), f = t.map((x, u) => `${o(u).toFixed(2)},${c(x).toFixed(2)}`).join(" "), $ = o(t.length - 1), w = c(t[t.length - 1]), p = this.color || "var(--baht-chart-muted)", P = this.label || `Trend of ${t.length} points`;
|
|
2572
|
+
return l`<svg
|
|
2573
2573
|
class="baht-sparkline"
|
|
2574
2574
|
width=${e}
|
|
2575
2575
|
height=${i}
|
|
2576
2576
|
viewBox="0 0 ${e} ${i}"
|
|
2577
2577
|
role="img"
|
|
2578
|
-
aria-label=${
|
|
2578
|
+
aria-label=${P}
|
|
2579
2579
|
>
|
|
2580
|
-
${
|
|
2581
|
-
${this.accentLast ?
|
|
2580
|
+
${N`<polyline class="baht-sparkline-line" points=${f} fill="none" stroke=${p}/>`}
|
|
2581
|
+
${this.accentLast ? N`<circle class="baht-sparkline-dot" cx=${$.toFixed(2)} cy=${w.toFixed(2)} r="3"
|
|
2582
2582
|
fill="var(--baht-chart-1)"/>` : h}
|
|
2583
2583
|
</svg>`;
|
|
2584
2584
|
}
|
|
2585
2585
|
};
|
|
2586
|
-
|
|
2587
|
-
|
|
2586
|
+
wt([
|
|
2587
|
+
n({ type: Array })
|
|
2588
2588
|
], ct.prototype, "values", 2);
|
|
2589
|
-
|
|
2590
|
-
|
|
2589
|
+
wt([
|
|
2590
|
+
n({ type: Number })
|
|
2591
2591
|
], ct.prototype, "width", 2);
|
|
2592
|
-
|
|
2593
|
-
|
|
2592
|
+
wt([
|
|
2593
|
+
n({ type: Number })
|
|
2594
2594
|
], ct.prototype, "height", 2);
|
|
2595
|
-
|
|
2596
|
-
|
|
2595
|
+
wt([
|
|
2596
|
+
n({ type: Boolean, attribute: "accent-last" })
|
|
2597
2597
|
], ct.prototype, "accentLast", 2);
|
|
2598
|
-
|
|
2599
|
-
|
|
2598
|
+
wt([
|
|
2599
|
+
n()
|
|
2600
2600
|
], ct.prototype, "color", 2);
|
|
2601
|
-
|
|
2602
|
-
|
|
2601
|
+
wt([
|
|
2602
|
+
n()
|
|
2603
2603
|
], ct.prototype, "label", 2);
|
|
2604
|
-
ct =
|
|
2604
|
+
ct = wt([
|
|
2605
2605
|
b("baht-sparkline")
|
|
2606
2606
|
], ct);
|
|
2607
2607
|
var Va = Object.defineProperty, Ka = Object.getOwnPropertyDescriptor, Y = (t, e, i, a) => {
|
|
@@ -2609,7 +2609,7 @@ var Va = Object.defineProperty, Ka = Object.getOwnPropertyDescriptor, Y = (t, e,
|
|
|
2609
2609
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2610
2610
|
return a && s && Va(e, i, s), s;
|
|
2611
2611
|
};
|
|
2612
|
-
let
|
|
2612
|
+
let U = class extends g {
|
|
2613
2613
|
constructor() {
|
|
2614
2614
|
super(...arguments), this.label = "", this.value = 0, this.format = "number", this.currency = "THB", this.delta = null, this.deltaKind = "pct", this.deltaLabel = "", this.upIsGood = !0, this.trend = [], this.size = "md";
|
|
2615
2615
|
}
|
|
@@ -2624,20 +2624,21 @@ let K = class extends y {
|
|
|
2624
2624
|
}
|
|
2625
2625
|
get deltaText() {
|
|
2626
2626
|
const t = this.delta ?? 0, e = Math.abs(t);
|
|
2627
|
-
return this.deltaKind === "pct" ? `${
|
|
2627
|
+
return this.deltaKind === "pct" ? `${Rt(e / 100, "percent")}` : Rt(e, this.format, this.currency);
|
|
2628
2628
|
}
|
|
2629
2629
|
render() {
|
|
2630
2630
|
const t = this.delta != null && Number.isFinite(this.delta), e = this.tone, i = (this.delta ?? 0) > 0 ? "up" : (this.delta ?? 0) < 0 ? "down" : "flat";
|
|
2631
|
-
return
|
|
2632
|
-
${this.label ?
|
|
2633
|
-
<div class="baht-stat-value">${
|
|
2634
|
-
${t ?
|
|
2631
|
+
return l`<div class="baht-stat${this.size === "hero" ? " baht-stat--hero" : ""}">
|
|
2632
|
+
${this.label ? l`<div class="baht-stat-label">${this.label}</div>` : h}
|
|
2633
|
+
<div class="baht-stat-value">${Rt(this.value, this.format, this.currency)}</div>
|
|
2634
|
+
${t ? l`<div class="baht-stat-delta baht-stat-delta--${e}">
|
|
2635
2635
|
<span class="baht-stat-arrow" aria-hidden="true">${this.arrow}</span>
|
|
2636
2636
|
<span class="baht-stat-delta-value">${this.deltaText}</span>
|
|
2637
2637
|
<span class="baht-visually-hidden">${i}</span>
|
|
2638
|
-
${this.deltaLabel ?
|
|
2638
|
+
${this.deltaLabel ? l`<span class="baht-stat-delta-label">${this.deltaLabel}</span>` : h}
|
|
2639
2639
|
</div>` : h}
|
|
2640
|
-
${this.
|
|
2640
|
+
${!t && this.deltaLabel ? l`<div class="baht-stat-caption">${this.deltaLabel}</div>` : h}
|
|
2641
|
+
${this.trend.length > 1 ? l`<baht-sparkline
|
|
2641
2642
|
class="baht-stat-trend"
|
|
2642
2643
|
.values=${this.trend}
|
|
2643
2644
|
label=${`${this.label || "Value"} trend, ${this.trend.length} points`}
|
|
@@ -2646,70 +2647,70 @@ let K = class extends y {
|
|
|
2646
2647
|
}
|
|
2647
2648
|
};
|
|
2648
2649
|
Y([
|
|
2649
|
-
|
|
2650
|
-
],
|
|
2650
|
+
n()
|
|
2651
|
+
], U.prototype, "label", 2);
|
|
2651
2652
|
Y([
|
|
2652
|
-
|
|
2653
|
-
],
|
|
2653
|
+
n({ type: Number })
|
|
2654
|
+
], U.prototype, "value", 2);
|
|
2654
2655
|
Y([
|
|
2655
|
-
|
|
2656
|
-
],
|
|
2656
|
+
n()
|
|
2657
|
+
], U.prototype, "format", 2);
|
|
2657
2658
|
Y([
|
|
2658
|
-
|
|
2659
|
-
],
|
|
2659
|
+
n()
|
|
2660
|
+
], U.prototype, "currency", 2);
|
|
2660
2661
|
Y([
|
|
2661
|
-
|
|
2662
|
-
],
|
|
2662
|
+
n({ type: Number })
|
|
2663
|
+
], U.prototype, "delta", 2);
|
|
2663
2664
|
Y([
|
|
2664
|
-
|
|
2665
|
-
],
|
|
2665
|
+
n({ attribute: "delta-kind" })
|
|
2666
|
+
], U.prototype, "deltaKind", 2);
|
|
2666
2667
|
Y([
|
|
2667
|
-
|
|
2668
|
-
],
|
|
2668
|
+
n({ attribute: "delta-label" })
|
|
2669
|
+
], U.prototype, "deltaLabel", 2);
|
|
2669
2670
|
Y([
|
|
2670
|
-
|
|
2671
|
-
],
|
|
2671
|
+
n({ type: Boolean, attribute: "up-is-good" })
|
|
2672
|
+
], U.prototype, "upIsGood", 2);
|
|
2672
2673
|
Y([
|
|
2673
|
-
|
|
2674
|
-
],
|
|
2674
|
+
n({ type: Array })
|
|
2675
|
+
], U.prototype, "trend", 2);
|
|
2675
2676
|
Y([
|
|
2676
|
-
|
|
2677
|
-
],
|
|
2678
|
-
|
|
2677
|
+
n()
|
|
2678
|
+
], U.prototype, "size", 2);
|
|
2679
|
+
U = Y([
|
|
2679
2680
|
b("baht-stat")
|
|
2680
|
-
],
|
|
2681
|
-
var Ua = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor,
|
|
2681
|
+
], U);
|
|
2682
|
+
var Ua = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Lt = (t, e, i, a) => {
|
|
2682
2683
|
for (var s = a > 1 ? void 0 : a ? Ha(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2683
2684
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2684
2685
|
return a && s && Ua(e, i, s), s;
|
|
2685
2686
|
};
|
|
2686
2687
|
const Ze = 6;
|
|
2687
|
-
let
|
|
2688
|
+
let J = class extends st {
|
|
2688
2689
|
constructor() {
|
|
2689
2690
|
super(...arguments), this.groups = [], this.total = null, this.color = "", this.centerLabel = "records", this.otherLabel = "Other";
|
|
2690
2691
|
}
|
|
2691
2692
|
render() {
|
|
2692
2693
|
const t = this.hold(this.groups ?? []);
|
|
2693
2694
|
if (t.length === 0)
|
|
2694
|
-
return
|
|
2695
|
-
const e = qa(t, Ze, this.otherLabel), i = e.reduce((p,
|
|
2695
|
+
return l`<div class=${this.rootClass("baht-donut-chart")}>${this.renderEmpty()}</div>`;
|
|
2696
|
+
const e = qa(t, Ze, this.otherLabel), i = e.reduce((p, P) => p + P.count, 0) || 1, a = this.total ?? t.reduce((p, P) => p + P.count, 0), s = J.R, r = 2 * Math.PI * s, o = e.length > 1 ? J.GAP : 0, c = t.length > Ze;
|
|
2696
2697
|
let f = 0;
|
|
2697
|
-
const
|
|
2698
|
-
const
|
|
2698
|
+
const $ = e.map((p, P) => {
|
|
2699
|
+
const x = p.count / i, u = Math.max(0, x * r - o), v = {
|
|
2699
2700
|
...p,
|
|
2700
|
-
frac:
|
|
2701
|
-
dash: `${
|
|
2701
|
+
frac: x,
|
|
2702
|
+
dash: `${u} ${r - u}`,
|
|
2702
2703
|
offset: -f * r,
|
|
2703
2704
|
// the folded tail is grey — never a generated ninth hue
|
|
2704
|
-
color: c &&
|
|
2705
|
+
color: c && P === e.length - 1 ? "var(--baht-chart-muted)" : ft(P, this.color || void 0)
|
|
2705
2706
|
};
|
|
2706
|
-
return f +=
|
|
2707
|
-
}),
|
|
2708
|
-
return
|
|
2709
|
-
<svg width="160" height="160" viewBox="0 0 160 160" role="img" aria-label=${
|
|
2707
|
+
return f += x, v;
|
|
2708
|
+
}), w = `${a} ${this.centerLabel}: ${$.map((p) => `${p.label || "(empty)"} ${p.count} (${Math.round(p.frac * 100)}%)`).join(", ")}`;
|
|
2709
|
+
return l`<div class=${this.rootClass("baht-donut-chart")}>
|
|
2710
|
+
<svg width="160" height="160" viewBox="0 0 160 160" role="img" aria-label=${w}>
|
|
2710
2711
|
<g transform="translate(80,80) rotate(-90)">
|
|
2711
|
-
${
|
|
2712
|
-
(p) =>
|
|
2712
|
+
${$.map(
|
|
2713
|
+
(p) => N`<circle r=${s} cx="0" cy="0" fill="none" stroke=${p.color}
|
|
2713
2714
|
stroke-width="22" stroke-dasharray=${p.dash} stroke-dashoffset=${p.offset}/>`
|
|
2714
2715
|
)}
|
|
2715
2716
|
</g>
|
|
@@ -2717,8 +2718,8 @@ let G = class extends tt {
|
|
|
2717
2718
|
<text x="80" y="94" text-anchor="middle" class="baht-donut-chart-sub">${this.centerLabel}</text>
|
|
2718
2719
|
</svg>
|
|
2719
2720
|
<div class="baht-chart-legend">
|
|
2720
|
-
${
|
|
2721
|
-
(p) =>
|
|
2721
|
+
${$.map(
|
|
2722
|
+
(p) => l`<div class="baht-chart-legend-row">
|
|
2722
2723
|
<span class="baht-chart-swatch" style="background:${p.color}" aria-hidden="true"></span>
|
|
2723
2724
|
<span class="baht-chart-legend-label">${p.label || "(empty)"}</span>
|
|
2724
2725
|
<span class="baht-chart-legend-count">${this.fmt(p.count)}</span>
|
|
@@ -2726,10 +2727,10 @@ let G = class extends tt {
|
|
|
2726
2727
|
</div>`
|
|
2727
2728
|
)}
|
|
2728
2729
|
</div>
|
|
2729
|
-
${this.showTable ?
|
|
2730
|
+
${this.showTable ? fe(
|
|
2730
2731
|
`${a} ${this.centerLabel}`,
|
|
2731
2732
|
["Slice", "Value", "Share"],
|
|
2732
|
-
|
|
2733
|
+
$.map((p) => [
|
|
2733
2734
|
p.label || "(empty)",
|
|
2734
2735
|
this.fmt(p.count),
|
|
2735
2736
|
`${Math.round(p.frac * 100)}%`
|
|
@@ -2738,50 +2739,50 @@ let G = class extends tt {
|
|
|
2738
2739
|
</div>`;
|
|
2739
2740
|
}
|
|
2740
2741
|
};
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
],
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
],
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
],
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
],
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
],
|
|
2758
|
-
|
|
2742
|
+
J.R = 54;
|
|
2743
|
+
J.GAP = 2;
|
|
2744
|
+
Lt([
|
|
2745
|
+
n({ attribute: !1 })
|
|
2746
|
+
], J.prototype, "groups", 2);
|
|
2747
|
+
Lt([
|
|
2748
|
+
n({ type: Number })
|
|
2749
|
+
], J.prototype, "total", 2);
|
|
2750
|
+
Lt([
|
|
2751
|
+
n()
|
|
2752
|
+
], J.prototype, "color", 2);
|
|
2753
|
+
Lt([
|
|
2754
|
+
n({ attribute: "center-label" })
|
|
2755
|
+
], J.prototype, "centerLabel", 2);
|
|
2756
|
+
Lt([
|
|
2757
|
+
n({ attribute: "other-label" })
|
|
2758
|
+
], J.prototype, "otherLabel", 2);
|
|
2759
|
+
J = Lt([
|
|
2759
2760
|
b("baht-donut-chart")
|
|
2760
|
-
],
|
|
2761
|
+
], J);
|
|
2761
2762
|
var Ga = Object.defineProperty, Wa = Object.getOwnPropertyDescriptor, V = (t, e, i, a) => {
|
|
2762
2763
|
for (var s = a > 1 ? void 0 : a ? Wa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
2763
2764
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
2764
2765
|
return a && s && Ga(e, i, s), s;
|
|
2765
2766
|
};
|
|
2766
|
-
const Qe = 24, ts = 2, Ja = 56,
|
|
2767
|
-
let
|
|
2767
|
+
const Qe = 24, ts = 2, Ja = 56, Xa = 26;
|
|
2768
|
+
let z = class extends st {
|
|
2768
2769
|
constructor() {
|
|
2769
|
-
super(...arguments), this.groups = [], this.series = [], this.categories = [], this.orientation = "horizontal", this.stacked = !1, this.compare = [], this.markers = [], this.labelValues = "ends", this.emphasis = null, this.color = "", this.label = "", this.band = 0;
|
|
2770
|
+
super(...arguments), this.groups = [], this.series = [], this.categories = [], this.orientation = "horizontal", this.stacked = !1, this.compare = [], this.compareLabel = "Previous period", this.markers = [], this.labelValues = "ends", this.emphasis = null, this.color = "", this.label = "", this.band = 0;
|
|
2770
2771
|
}
|
|
2771
2772
|
connectedCallback() {
|
|
2772
|
-
super.connectedCallback(), !(!
|
|
2773
|
+
super.connectedCallback(), !(!T() || typeof ResizeObserver > "u") && (this.resizeObserver = new ResizeObserver(() => this.measure()), this.resizeObserver.observe(this));
|
|
2773
2774
|
}
|
|
2774
2775
|
disconnectedCallback() {
|
|
2775
2776
|
var t;
|
|
2776
2777
|
(t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, super.disconnectedCallback();
|
|
2777
2778
|
}
|
|
2778
2779
|
firstUpdated() {
|
|
2779
|
-
|
|
2780
|
+
T() && queueMicrotask(() => this.measure());
|
|
2780
2781
|
}
|
|
2781
2782
|
/** Host width → px per category. Never runs on the server (`hasDom` guard). */
|
|
2782
2783
|
measure() {
|
|
2783
2784
|
var r;
|
|
2784
|
-
if (!
|
|
2785
|
+
if (!T() || !this.isConnected || this.orientation !== "vertical") return;
|
|
2785
2786
|
const t = this.columnCount;
|
|
2786
2787
|
if (t === 0) return;
|
|
2787
2788
|
const e = ((r = this.getBoundingClientRect) == null ? void 0 : r.call(this).width) ?? 0;
|
|
@@ -2807,17 +2808,17 @@ let R = class extends tt {
|
|
|
2807
2808
|
}
|
|
2808
2809
|
colorFor(t, e, i) {
|
|
2809
2810
|
const a = this.model.series[t];
|
|
2810
|
-
return this.emphasis != null && !(i ? t === this.emphasis : e === this.emphasis) ? "var(--baht-chart-muted)" :
|
|
2811
|
+
return this.emphasis != null && !(i ? t === this.emphasis : e === this.emphasis) ? "var(--baht-chart-muted)" : ft(i ? t : 0, this.color || (a == null ? void 0 : a.color) || void 0);
|
|
2811
2812
|
}
|
|
2812
2813
|
render() {
|
|
2813
2814
|
const t = this.hold(this.model);
|
|
2814
|
-
return t.series.length === 0 ?
|
|
2815
|
+
return t.series.length === 0 ? l`<div class=${this.rootClass("baht-bar-chart")}>${this.renderEmpty()}</div>` : this.orientation === "vertical" ? this.renderVertical(t) : this.renderHorizontal(t);
|
|
2815
2816
|
}
|
|
2816
2817
|
/** Largest value a bar can reach: the raw max for `groups`, a clean tick otherwise. */
|
|
2817
2818
|
domainMax(t, e, i) {
|
|
2818
2819
|
const a = Math.max(...t.map((c) => c.values.length)), s = Array.from(
|
|
2819
2820
|
{ length: a },
|
|
2820
|
-
(c, f) => e ? t.reduce((
|
|
2821
|
+
(c, f) => e ? t.reduce(($, w) => $ + (w.values[f] ?? 0), 0) : Math.max(...t.map(($) => $.values[f] ?? 0))
|
|
2821
2822
|
), r = Math.max(
|
|
2822
2823
|
1,
|
|
2823
2824
|
...s,
|
|
@@ -2829,284 +2830,375 @@ let R = class extends tt {
|
|
|
2829
2830
|
return o[o.length - 1] ?? r;
|
|
2830
2831
|
}
|
|
2831
2832
|
tableTwin(t, e, i) {
|
|
2832
|
-
var
|
|
2833
|
+
var r;
|
|
2833
2834
|
if (!this.showTable) return h;
|
|
2834
|
-
const a = ["Category", ...t.map((
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2835
|
+
const a = ["Category", ...t.map((o) => o.name || "Value")];
|
|
2836
|
+
(r = this.compare) != null && r.length && a.push(this.compareLabel);
|
|
2837
|
+
const s = Array.from({ length: i }, (o, c) => {
|
|
2838
|
+
var $;
|
|
2839
|
+
const f = [
|
|
2840
|
+
e[c] || "(empty)",
|
|
2841
|
+
...t.map((w) => this.fmt(w.values[c] ?? 0))
|
|
2842
|
+
];
|
|
2843
|
+
return ($ = this.compare) != null && $.length && f.push(this.fmt(this.compare[c] ?? 0)), f;
|
|
2844
|
+
});
|
|
2845
|
+
for (const o of this.markers ?? [])
|
|
2846
|
+
s.push([
|
|
2847
|
+
`${o.label ?? "Target"}${o.category ? ` (${o.category})` : ""}`,
|
|
2848
|
+
this.fmt(o.value),
|
|
2849
|
+
...Array.from({ length: a.length - 2 }, () => "—")
|
|
2850
|
+
]);
|
|
2851
|
+
return fe(this.label || "Bar chart data", a, s);
|
|
2847
2852
|
}
|
|
2848
2853
|
/** Markers with no `category` span the chart; the rest ride their own row. */
|
|
2849
2854
|
markersFor(t) {
|
|
2850
2855
|
return (this.markers ?? []).filter((e) => !e.category || e.category === t);
|
|
2851
2856
|
}
|
|
2857
|
+
/** Markers that apply to every row / column. */
|
|
2858
|
+
get chartMarkers() {
|
|
2859
|
+
return (this.markers ?? []).filter((t) => !t.category);
|
|
2860
|
+
}
|
|
2861
|
+
/** Markers pinned to one category — they ride that row / column, not the chart. */
|
|
2862
|
+
categoryMarkers(t) {
|
|
2863
|
+
return (this.markers ?? []).filter((e) => e.category === t);
|
|
2864
|
+
}
|
|
2865
|
+
/** What a marker reads as: its own label, else its formatted value. */
|
|
2866
|
+
markerText(t) {
|
|
2867
|
+
return t.label ? `${t.label} ${this.fmt(t.value)}` : this.fmt(t.value);
|
|
2868
|
+
}
|
|
2869
|
+
/**
|
|
2870
|
+
* Marker lines, positioned along the value axis. The label is drawn separately
|
|
2871
|
+
* (`markerLabels`) as real text — a `title` attribute alone never reaches AT.
|
|
2872
|
+
*/
|
|
2852
2873
|
markerOverlay(t, e) {
|
|
2853
2874
|
return this.markersFor(e).map(
|
|
2854
|
-
(i) =>
|
|
2875
|
+
(i) => l`<span
|
|
2855
2876
|
class="baht-bar-chart-marker"
|
|
2856
2877
|
style=${`left:${Math.min(100, i.value / t * 100).toFixed(2)}%`}
|
|
2857
|
-
title=${i.label ?? this.fmt(i.value)}
|
|
2858
2878
|
aria-hidden="true"
|
|
2859
2879
|
></span>`
|
|
2860
2880
|
);
|
|
2861
2881
|
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Marker labels, sorted along the axis and thinned so neighbours never collide:
|
|
2884
|
+
* a dropped label keeps its line, and its value still reads in the table twin.
|
|
2885
|
+
* Thinning is scoped to the list it is given — chart-wide markers compete with
|
|
2886
|
+
* each other, a row's own markers only with that row's.
|
|
2887
|
+
*/
|
|
2888
|
+
place(t, e) {
|
|
2889
|
+
const i = [], a = [...t].sort((s, r) => s.value - r.value);
|
|
2890
|
+
for (const s of a) {
|
|
2891
|
+
const r = Math.min(100, Math.max(0, s.value / e * 100)), o = i[i.length - 1];
|
|
2892
|
+
o && r - o.pct < 12 || i.push({ m: s, pct: r });
|
|
2893
|
+
}
|
|
2894
|
+
return i;
|
|
2895
|
+
}
|
|
2896
|
+
/** Chart-wide marker labels — the strip above the rows / the end of the line. */
|
|
2897
|
+
placedMarkers(t) {
|
|
2898
|
+
return this.place(this.chartMarkers, t);
|
|
2899
|
+
}
|
|
2900
|
+
/** A row's own marker labels, drawn beside their line inside that row. */
|
|
2901
|
+
rowMarkerLabels(t, e) {
|
|
2902
|
+
return this.place(this.categoryMarkers(t), e).map(
|
|
2903
|
+
({ m: i, pct: a }) => l`<span
|
|
2904
|
+
class="baht-bar-chart-marker-label baht-bar-chart-marker-label--row"
|
|
2905
|
+
style=${`left:${a.toFixed(2)}%;transform:translateX(${a > 70 ? "calc(-100% - 4px)" : "4px"})`}
|
|
2906
|
+
>${this.markerText(i)}</span
|
|
2907
|
+
>`
|
|
2908
|
+
);
|
|
2909
|
+
}
|
|
2910
|
+
/** Legend rows: one per series, plus the muted `compare` key when it is set. */
|
|
2911
|
+
legendEntries(t) {
|
|
2912
|
+
const e = t.map((i, a) => ({
|
|
2913
|
+
label: i.name || "Value",
|
|
2914
|
+
color: ft(a, i.color)
|
|
2915
|
+
}));
|
|
2916
|
+
return (this.compare ?? []).length > 0 && e.push({ label: this.compareLabel, color: "var(--baht-chart-muted)" }), e;
|
|
2917
|
+
}
|
|
2862
2918
|
renderHorizontal(t) {
|
|
2863
|
-
const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((
|
|
2864
|
-
const
|
|
2865
|
-
value:
|
|
2866
|
-
color: this.colorFor(
|
|
2867
|
-
name:
|
|
2919
|
+
const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((P) => P.values.length)), o = this.domainMax(e, this.stacked, a), c = (this.compare ?? []).length > 0, f = (this.stacked ? 1 : e.length) + (c ? 1 : 0), $ = Math.min(Qe, Math.max(6, Math.floor(48 / f))), w = Array.from({ length: r }, (P, x) => {
|
|
2920
|
+
const u = i[x] || "(empty)", v = e.reduce((C, S) => C + (S.values[x] ?? 0), 0), D = `${u}: ${e.map((C) => `${C.name ? `${C.name} ` : ""}${this.fmt(C.values[x] ?? 0)}`).join(", ")}${c ? `, previous ${this.fmt(this.compare[x] ?? 0)}` : ""}`, K = e.map((C, S) => ({
|
|
2921
|
+
value: C.values[x] ?? 0,
|
|
2922
|
+
color: this.colorFor(S, x, s),
|
|
2923
|
+
name: C.name
|
|
2868
2924
|
}));
|
|
2869
|
-
return
|
|
2870
|
-
<span class="baht-bar-chart-label" title=${
|
|
2925
|
+
return l`<div class="baht-bar-chart-row">
|
|
2926
|
+
<span class="baht-bar-chart-label" title=${u}>${u}</span>
|
|
2871
2927
|
<div
|
|
2872
2928
|
class="baht-bar-chart-track${this.stacked ? " baht-bar-chart-track--stacked" : ""}"
|
|
2873
2929
|
tabindex="0"
|
|
2874
2930
|
role="button"
|
|
2875
|
-
aria-label=${
|
|
2876
|
-
@pointermove=${(
|
|
2931
|
+
aria-label=${D}
|
|
2932
|
+
@pointermove=${(C) => this.showTip(C, D)}
|
|
2877
2933
|
@pointerleave=${() => this.hideTip()}
|
|
2878
|
-
@focus=${(
|
|
2934
|
+
@focus=${(C) => this.showTip(C, D)}
|
|
2879
2935
|
@blur=${() => this.hideTip()}
|
|
2880
2936
|
>
|
|
2881
|
-
${this.markerOverlay(o,
|
|
2937
|
+
${this.markerOverlay(o, u)}
|
|
2938
|
+
${this.rowMarkerLabels(u, o)}
|
|
2882
2939
|
<div class="baht-bar-chart-bars">
|
|
2883
|
-
${this.stacked ?
|
|
2884
|
-
${
|
|
2885
|
-
(
|
|
2940
|
+
${this.stacked ? l`<div class="baht-bar-chart-stack" style=${`height:${$}px`}>
|
|
2941
|
+
${K.map(
|
|
2942
|
+
(C) => l`<div
|
|
2886
2943
|
class="baht-bar-chart-bar baht-bar-chart-bar--segment"
|
|
2887
|
-
style=${`width:${Math.max(0,
|
|
2944
|
+
style=${`width:${Math.max(0, C.value / o * 100)}%;background:${C.color}`}
|
|
2888
2945
|
></div>`
|
|
2889
2946
|
)}
|
|
2890
|
-
</div>` :
|
|
2891
|
-
(
|
|
2947
|
+
</div>` : K.map(
|
|
2948
|
+
(C) => l`<div
|
|
2892
2949
|
class="baht-bar-chart-bar"
|
|
2893
|
-
style=${`width:${Math.max(2,
|
|
2950
|
+
style=${`width:${Math.max(2, C.value / o * 100)}%;height:${$}px;background:${C.color}`}
|
|
2894
2951
|
></div>`
|
|
2895
2952
|
)}
|
|
2896
|
-
${c ?
|
|
2953
|
+
${c ? l`<div
|
|
2897
2954
|
class="baht-bar-chart-bar baht-bar-chart-bar--compare"
|
|
2898
|
-
style=${`width:${Math.max(2, (this.compare[
|
|
2955
|
+
style=${`width:${Math.max(2, (this.compare[x] ?? 0) / o * 100)}%;height:${Math.min(8, $)}px`}
|
|
2899
2956
|
></div>` : h}
|
|
2900
2957
|
</div>
|
|
2901
2958
|
</div>
|
|
2902
|
-
${this.labelValues === "ends" ?
|
|
2903
|
-
>${a ? e[0].values[
|
|
2959
|
+
${this.labelValues === "ends" ? l`<span class="baht-bar-chart-count"
|
|
2960
|
+
>${a ? e[0].values[x] ?? 0 : this.fmt(this.stacked ? v : e[0].values[x] ?? 0)}</span
|
|
2904
2961
|
>` : h}
|
|
2905
2962
|
</div>`;
|
|
2906
|
-
});
|
|
2907
|
-
return
|
|
2908
|
-
${
|
|
2963
|
+
}), p = this.placedMarkers(o);
|
|
2964
|
+
return l`<div class=${this.rootClass("baht-bar-chart")}>
|
|
2965
|
+
${p.length > 0 ? l`<div class="baht-bar-chart-row baht-bar-chart-row--markers">
|
|
2966
|
+
<span class="baht-bar-chart-label"></span>
|
|
2967
|
+
<div class="baht-bar-chart-markbar">
|
|
2968
|
+
${p.map(
|
|
2969
|
+
({ m: P, pct: x }) => l`<span
|
|
2970
|
+
class="baht-bar-chart-marker-label"
|
|
2971
|
+
style=${`left:${x.toFixed(2)}%;transform:translateX(${x > 88 ? "-100%" : x < 12 ? "0" : "-50%"})`}
|
|
2972
|
+
>${this.markerText(P)}</span
|
|
2973
|
+
>`
|
|
2974
|
+
)}
|
|
2975
|
+
</div>
|
|
2976
|
+
${this.labelValues === "ends" ? l`<span class="baht-bar-chart-count"></span>` : h}
|
|
2977
|
+
</div>` : h}
|
|
2978
|
+
${w}
|
|
2909
2979
|
${this.renderTooltip()}
|
|
2910
|
-
${this.renderLegend(
|
|
2980
|
+
${this.renderLegend(this.legendEntries(e))}
|
|
2911
2981
|
${this.tableTwin(e, i, r)}
|
|
2912
2982
|
</div>`;
|
|
2913
2983
|
}
|
|
2914
2984
|
renderVertical(t) {
|
|
2915
|
-
const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((
|
|
2916
|
-
|
|
2917
|
-
|
|
2985
|
+
const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((v) => v.values.length)), o = this.domainMax(e, this.stacked, a), c = Be(o, 4), f = (this.compare ?? []).length > 0, $ = (this.stacked ? 1 : e.length) + (f ? 1 : 0), w = this.band > 0 ? (this.band - ts) / $ : 48 / $, p = Math.min(Qe, Math.max(2, Math.floor(w))), P = this.band > 0 ? Math.max(1, Math.ceil(Xa / Math.max(1, this.band))) : Math.max(1, Math.ceil(r / 12)), x = (this.markers ?? []).map(
|
|
2986
|
+
(v) => `${this.markerText(v)}${v.category ? ` on ${v.category}` : ""}`
|
|
2987
|
+
), u = this.label || `Column chart, ${r} categories. ${i.map((v, D) => `${v} ${this.fmt(e[0].values[D] ?? 0)}`).join(", ")}${x.length ? `. Reference lines: ${x.join(", ")}` : ""}`;
|
|
2988
|
+
return l`<div class=${this.rootClass("baht-bar-chart baht-bar-chart--vertical")}>
|
|
2989
|
+
<div class="baht-bar-chart-plot" role="img" aria-label=${u}>
|
|
2918
2990
|
<div class="baht-bar-chart-yaxis" aria-hidden="true">
|
|
2919
|
-
${[...c].reverse().map((
|
|
2991
|
+
${[...c].reverse().map((v) => l`<span class="baht-chart-tick-text">${this.fmt(v)}</span>`)}
|
|
2920
2992
|
</div>
|
|
2921
2993
|
<div class="baht-bar-chart-grid">
|
|
2922
|
-
${
|
|
2923
|
-
(
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2994
|
+
${this.chartMarkers.map(
|
|
2995
|
+
(v) => l`<span
|
|
2996
|
+
class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
|
|
2997
|
+
style=${`bottom:${Math.min(100, v.value / o * 100).toFixed(2)}%`}
|
|
2998
|
+
aria-hidden="true"
|
|
2999
|
+
></span>`
|
|
3000
|
+
)}
|
|
3001
|
+
${this.placedMarkers(o).map(
|
|
3002
|
+
({ m: v, pct: D }) => l`<span
|
|
3003
|
+
class="baht-bar-chart-marker-label baht-bar-chart-marker-label--end"
|
|
3004
|
+
style=${`bottom:${D.toFixed(2)}%`}
|
|
3005
|
+
>${this.markerText(v)}</span
|
|
3006
|
+
>`
|
|
2929
3007
|
)}
|
|
2930
|
-
${[...c].reverse().map(() =>
|
|
3008
|
+
${[...c].reverse().map(() => l`<span class="baht-chart-grid-rule" aria-hidden="true"></span>`)}
|
|
2931
3009
|
<div class="baht-bar-chart-columns">
|
|
2932
|
-
${Array.from({ length: r }, (
|
|
2933
|
-
const
|
|
2934
|
-
return
|
|
3010
|
+
${Array.from({ length: r }, (v, D) => {
|
|
3011
|
+
const K = i[D] || "(empty)", C = `${K}: ${e.map((S) => `${S.name ? `${S.name} ` : ""}${this.fmt(S.values[D] ?? 0)}`).join(", ")}`;
|
|
3012
|
+
return l`<div
|
|
2935
3013
|
class="baht-bar-chart-column"
|
|
2936
3014
|
style=${this.band > 0 ? `flex:0 0 auto;width:${this.band}px` : h}
|
|
2937
3015
|
tabindex="0"
|
|
2938
3016
|
role="button"
|
|
2939
|
-
aria-label=${
|
|
2940
|
-
@pointermove=${(
|
|
3017
|
+
aria-label=${C}
|
|
3018
|
+
@pointermove=${(S) => this.showTip(S, C)}
|
|
2941
3019
|
@pointerleave=${() => this.hideTip()}
|
|
2942
|
-
@focus=${(
|
|
3020
|
+
@focus=${(S) => this.showTip(S, C)}
|
|
2943
3021
|
@blur=${() => this.hideTip()}
|
|
2944
3022
|
>
|
|
3023
|
+
${this.place(this.categoryMarkers(K), o).map(
|
|
3024
|
+
({ m: S, pct: d }) => l`<span
|
|
3025
|
+
class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
|
|
3026
|
+
style=${`bottom:${d.toFixed(2)}%`}
|
|
3027
|
+
aria-hidden="true"
|
|
3028
|
+
></span>${this.band === 0 || this.band >= 40 ? l`<span
|
|
3029
|
+
class="baht-bar-chart-marker-label baht-bar-chart-marker-label--column"
|
|
3030
|
+
style=${`bottom:${d.toFixed(2)}%`}
|
|
3031
|
+
>${this.markerText(S)}</span
|
|
3032
|
+
>` : h}`
|
|
3033
|
+
)}
|
|
2945
3034
|
<div class="baht-bar-chart-column-bars">
|
|
2946
3035
|
${e.map(
|
|
2947
|
-
(
|
|
3036
|
+
(S, d) => l`<div
|
|
2948
3037
|
class="baht-bar-chart-col"
|
|
2949
|
-
style=${`height:${Math.max(1, (
|
|
3038
|
+
style=${`height:${Math.max(1, (S.values[D] ?? 0) / o * 100)}%;width:${p}px;background:${this.colorFor(d, D, s)}`}
|
|
2950
3039
|
></div>`
|
|
2951
3040
|
)}
|
|
2952
|
-
${f ?
|
|
3041
|
+
${f ? l`<div
|
|
2953
3042
|
class="baht-bar-chart-col baht-bar-chart-col--compare"
|
|
2954
|
-
style=${`height:${Math.max(1, (this.compare[
|
|
3043
|
+
style=${`height:${Math.max(1, (this.compare[D] ?? 0) / o * 100)}%;width:${Math.min(8, p)}px`}
|
|
2955
3044
|
></div>` : h}
|
|
2956
3045
|
</div>
|
|
2957
|
-
${
|
|
3046
|
+
${D % P === 0 ? l`<span class="baht-bar-chart-xlabel">${K}</span>` : h}
|
|
2958
3047
|
</div>`;
|
|
2959
3048
|
})}
|
|
2960
3049
|
</div>
|
|
2961
3050
|
</div>
|
|
2962
3051
|
</div>
|
|
2963
3052
|
${this.renderTooltip()}
|
|
2964
|
-
${this.renderLegend(
|
|
3053
|
+
${this.renderLegend(this.legendEntries(e))}
|
|
2965
3054
|
${this.tableTwin(e, i, r)}
|
|
2966
3055
|
</div>`;
|
|
2967
3056
|
}
|
|
2968
3057
|
};
|
|
2969
3058
|
V([
|
|
2970
|
-
|
|
2971
|
-
],
|
|
3059
|
+
n({ attribute: !1 })
|
|
3060
|
+
], z.prototype, "groups", 2);
|
|
3061
|
+
V([
|
|
3062
|
+
n({ attribute: !1 })
|
|
3063
|
+
], z.prototype, "series", 2);
|
|
2972
3064
|
V([
|
|
2973
|
-
|
|
2974
|
-
],
|
|
3065
|
+
n({ attribute: !1 })
|
|
3066
|
+
], z.prototype, "categories", 2);
|
|
2975
3067
|
V([
|
|
2976
|
-
|
|
2977
|
-
],
|
|
3068
|
+
n()
|
|
3069
|
+
], z.prototype, "orientation", 2);
|
|
2978
3070
|
V([
|
|
2979
|
-
|
|
2980
|
-
],
|
|
3071
|
+
n({ type: Boolean })
|
|
3072
|
+
], z.prototype, "stacked", 2);
|
|
2981
3073
|
V([
|
|
2982
|
-
|
|
2983
|
-
],
|
|
3074
|
+
n({ attribute: !1 })
|
|
3075
|
+
], z.prototype, "compare", 2);
|
|
2984
3076
|
V([
|
|
2985
|
-
|
|
2986
|
-
],
|
|
3077
|
+
n({ attribute: "compare-label" })
|
|
3078
|
+
], z.prototype, "compareLabel", 2);
|
|
2987
3079
|
V([
|
|
2988
|
-
|
|
2989
|
-
],
|
|
3080
|
+
n({ attribute: !1 })
|
|
3081
|
+
], z.prototype, "markers", 2);
|
|
2990
3082
|
V([
|
|
2991
|
-
|
|
2992
|
-
],
|
|
3083
|
+
n({ attribute: "label-values" })
|
|
3084
|
+
], z.prototype, "labelValues", 2);
|
|
2993
3085
|
V([
|
|
2994
|
-
|
|
2995
|
-
],
|
|
3086
|
+
n({ type: Number })
|
|
3087
|
+
], z.prototype, "emphasis", 2);
|
|
2996
3088
|
V([
|
|
2997
|
-
|
|
2998
|
-
],
|
|
3089
|
+
n()
|
|
3090
|
+
], z.prototype, "color", 2);
|
|
2999
3091
|
V([
|
|
3000
|
-
|
|
3001
|
-
],
|
|
3092
|
+
n()
|
|
3093
|
+
], z.prototype, "label", 2);
|
|
3002
3094
|
V([
|
|
3003
|
-
|
|
3004
|
-
],
|
|
3005
|
-
|
|
3095
|
+
y()
|
|
3096
|
+
], z.prototype, "band", 2);
|
|
3097
|
+
z = V([
|
|
3006
3098
|
b("baht-bar-chart")
|
|
3007
|
-
],
|
|
3008
|
-
var
|
|
3099
|
+
], z);
|
|
3100
|
+
var Ya = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, nt = (t, e, i, a) => {
|
|
3009
3101
|
for (var s = a > 1 ? void 0 : a ? Za(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3010
3102
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3011
|
-
return a && s &&
|
|
3103
|
+
return a && s && Ya(e, i, s), s;
|
|
3012
3104
|
};
|
|
3013
|
-
const es = 640, xe = 260,
|
|
3014
|
-
let
|
|
3105
|
+
const es = 640, xe = 260, B = { top: 14, right: 72, bottom: 30, left: 60 };
|
|
3106
|
+
let et = class extends st {
|
|
3015
3107
|
constructor() {
|
|
3016
3108
|
super(...arguments), this.series = [], this.categories = [], this.area = !1, this.markers = [], this.forecast = 0, this.baseline = null, this.labelValues = "ends", this.label = "", this.crosshairAt = null;
|
|
3017
3109
|
}
|
|
3018
3110
|
get plot() {
|
|
3019
|
-
return { w: es -
|
|
3111
|
+
return { w: es - B.left - B.right, h: xe - B.top - B.bottom };
|
|
3020
3112
|
}
|
|
3021
3113
|
render() {
|
|
3022
3114
|
const t = this.hold({
|
|
3023
|
-
series: (this.series ?? []).filter((
|
|
3024
|
-
var
|
|
3025
|
-
return
|
|
3115
|
+
series: (this.series ?? []).filter((d) => {
|
|
3116
|
+
var _;
|
|
3117
|
+
return d && ((_ = d.values) == null ? void 0 : _.length);
|
|
3026
3118
|
}),
|
|
3027
3119
|
categories: this.categories ?? []
|
|
3028
3120
|
}), { series: e, categories: i } = t;
|
|
3029
3121
|
if (e.length === 0)
|
|
3030
|
-
return
|
|
3031
|
-
const a = Math.max(...e.map((
|
|
3032
|
-
i:
|
|
3033
|
-
name:
|
|
3034
|
-
value:
|
|
3035
|
-
yPos: p(
|
|
3036
|
-
color:
|
|
3037
|
-
})), v = [...
|
|
3038
|
-
return
|
|
3122
|
+
return l`<div class=${this.rootClass("baht-line-chart")}>${this.renderEmpty()}</div>`;
|
|
3123
|
+
const a = Math.max(...e.map((d) => d.values.length)), s = e.flatMap((d) => d.values).filter((d) => Number.isFinite(d)), r = Math.max(0, ...s, ...(this.markers ?? []).map((d) => d.value)), o = Be(r, 4), c = o[o.length - 1] ?? 1, { w: f, h: $ } = this.plot, w = ne([0, Math.max(1, a - 1)], [B.left, B.left + f]), p = ne([0, c], [B.top + $, B.top]), P = Math.max(0, a - 1 - Math.max(0, this.forecast)), x = (d, _, tt) => d.slice(_, tt + 1).map((at, it) => `${it === 0 ? "M" : "L"}${w(_ + it).toFixed(2)},${p(at).toFixed(2)}`).join(" "), u = e.map((d, _) => ({
|
|
3124
|
+
i: _,
|
|
3125
|
+
name: d.name,
|
|
3126
|
+
value: d.values[d.values.length - 1] ?? 0,
|
|
3127
|
+
yPos: p(d.values[d.values.length - 1] ?? 0),
|
|
3128
|
+
color: ft(_, d.color)
|
|
3129
|
+
})), v = [...u].sort((d, _) => d.yPos - _.yPos), D = v.some((d, _) => _ > 0 && d.yPos - v[_ - 1].yPos < 15), K = this.labelValues === "ends" && !D, C = Math.max(1, Math.ceil(a / 8)), S = this.label || `Line chart, ${e.length} series over ${a} points. ${e.map((d, _) => `${d.name}: ${this.fmt(u[_].value)} at the end`).join(". ")}`;
|
|
3130
|
+
return l`<div class=${this.rootClass("baht-line-chart")}>
|
|
3039
3131
|
<svg
|
|
3040
3132
|
class="baht-chart-svg"
|
|
3041
3133
|
viewBox="0 0 ${es} ${xe}"
|
|
3042
3134
|
preserveAspectRatio="xMidYMid meet"
|
|
3043
3135
|
role="img"
|
|
3044
|
-
aria-label=${
|
|
3136
|
+
aria-label=${S}
|
|
3045
3137
|
>
|
|
3046
3138
|
${o.map(
|
|
3047
|
-
(
|
|
3048
|
-
<line class="baht-chart-grid-line" x1=${
|
|
3049
|
-
y1=${p(
|
|
3050
|
-
<text class="baht-chart-tick" x=${
|
|
3051
|
-
text-anchor="end">${this.fmt(
|
|
3139
|
+
(d) => N`
|
|
3140
|
+
<line class="baht-chart-grid-line" x1=${B.left} x2=${B.left + f}
|
|
3141
|
+
y1=${p(d).toFixed(2)} y2=${p(d).toFixed(2)}/>
|
|
3142
|
+
<text class="baht-chart-tick" x=${B.left - 8} y=${(p(d) + 4).toFixed(2)}
|
|
3143
|
+
text-anchor="end">${this.fmt(d)}</text>`
|
|
3052
3144
|
)}
|
|
3053
3145
|
${this.baseline != null ? [
|
|
3054
|
-
|
|
3146
|
+
N`<line class="baht-chart-baseline" x1=${B.left} x2=${B.left + f}
|
|
3055
3147
|
y1=${p(this.baseline).toFixed(2)} y2=${p(this.baseline).toFixed(2)}/>`
|
|
3056
3148
|
] : []}
|
|
3057
3149
|
${(this.markers ?? []).map(
|
|
3058
|
-
(
|
|
3059
|
-
<line class="baht-chart-marker-line" x1=${
|
|
3060
|
-
y1=${p(
|
|
3061
|
-
<text class="baht-chart-marker-label" x=${
|
|
3062
|
-
text-anchor="end">${
|
|
3150
|
+
(d) => N`
|
|
3151
|
+
<line class="baht-chart-marker-line" x1=${B.left} x2=${B.left + f}
|
|
3152
|
+
y1=${p(d.value).toFixed(2)} y2=${p(d.value).toFixed(2)}/>
|
|
3153
|
+
<text class="baht-chart-marker-label" x=${B.left + f} y=${(p(d.value) - 5).toFixed(2)}
|
|
3154
|
+
text-anchor="end">${d.label ?? this.fmt(d.value)}</text>`
|
|
3063
3155
|
)}
|
|
3064
|
-
${this.area && e.length === 1 ?
|
|
3065
|
-
d=${`${
|
|
3066
|
-
${e.map((
|
|
3067
|
-
const
|
|
3068
|
-
|
|
3156
|
+
${this.area && e.length === 1 ? N`<path class="baht-chart-area" fill=${ft(0, e[0].color)}
|
|
3157
|
+
d=${`${x(e[0].values, 0, a - 1)} L${w(a - 1).toFixed(2)},${p(0).toFixed(2)} L${w(0).toFixed(2)},${p(0).toFixed(2)} Z`}/>` : h}
|
|
3158
|
+
${e.map((d, _) => {
|
|
3159
|
+
const tt = ft(_, d.color), at = [
|
|
3160
|
+
N`<path class="baht-chart-line" d=${x(d.values, 0, P)} stroke=${tt} fill="none"/>`
|
|
3069
3161
|
];
|
|
3070
|
-
return
|
|
3071
|
-
|
|
3072
|
-
stroke=${
|
|
3073
|
-
),
|
|
3074
|
-
|
|
3075
|
-
cy=${p(
|
|
3076
|
-
),
|
|
3162
|
+
return P < a - 1 && at.push(
|
|
3163
|
+
N`<path class="baht-chart-line baht-chart-line--forecast" d=${x(d.values, P, a - 1)}
|
|
3164
|
+
stroke=${tt} fill="none"/>`
|
|
3165
|
+
), at.push(
|
|
3166
|
+
N`<circle class="baht-chart-end-dot" cx=${w(a - 1).toFixed(2)}
|
|
3167
|
+
cy=${p(d.values[d.values.length - 1] ?? 0).toFixed(2)} r="4" fill=${tt}/>`
|
|
3168
|
+
), at;
|
|
3077
3169
|
})}
|
|
3078
|
-
${
|
|
3079
|
-
(
|
|
3080
|
-
<text class="baht-chart-end-label" x=${
|
|
3081
|
-
text-anchor="start">${this.fmt(
|
|
3170
|
+
${K ? u.map(
|
|
3171
|
+
(d) => N`
|
|
3172
|
+
<text class="baht-chart-end-label" x=${w(a - 1) + 10} y=${(d.yPos + 4).toFixed(2)}
|
|
3173
|
+
text-anchor="start">${this.fmt(d.value)}</text>`
|
|
3082
3174
|
) : h}
|
|
3083
3175
|
${i.map(
|
|
3084
|
-
(
|
|
3176
|
+
(d, _) => _ % C === 0 ? N`<text class="baht-chart-tick" x=${w(_).toFixed(2)} y=${xe - 10} text-anchor="middle">${d}</text>` : h
|
|
3085
3177
|
)}
|
|
3086
|
-
${Array.from({ length: a }, (
|
|
3087
|
-
const
|
|
3088
|
-
return
|
|
3089
|
-
width=${Math.max(24,
|
|
3090
|
-
aria-label=${
|
|
3091
|
-
@pointermove=${(
|
|
3178
|
+
${Array.from({ length: a }, (d, _) => {
|
|
3179
|
+
const tt = f / Math.max(1, a - 1), at = `${i[_] ?? `Point ${_ + 1}`}: ${e.map((it) => `${it.name} ${this.fmt(it.values[_] ?? 0)}`).join(", ")}`;
|
|
3180
|
+
return N`<rect class="baht-chart-hit" x=${(w(_) - tt / 2).toFixed(2)} y=${B.top}
|
|
3181
|
+
width=${Math.max(24, tt).toFixed(2)} height=${$} tabindex="0" role="button"
|
|
3182
|
+
aria-label=${at}
|
|
3183
|
+
@pointermove=${(it) => this.onHover(it, _, at)}
|
|
3092
3184
|
@pointerleave=${() => this.onLeave()}
|
|
3093
|
-
@focus=${(
|
|
3185
|
+
@focus=${(it) => this.onHover(it, _, at)}
|
|
3094
3186
|
@blur=${() => this.onLeave()}/>`;
|
|
3095
3187
|
})}
|
|
3096
|
-
${this.crosshairAt != null ?
|
|
3097
|
-
x2=${
|
|
3188
|
+
${this.crosshairAt != null ? N`<line class="baht-chart-crosshair" x1=${w(this.crosshairAt).toFixed(2)}
|
|
3189
|
+
x2=${w(this.crosshairAt).toFixed(2)} y1=${B.top} y2=${B.top + $}/>` : h}
|
|
3098
3190
|
</svg>
|
|
3099
3191
|
${this.renderTooltip()}
|
|
3100
3192
|
${this.renderLegend(
|
|
3101
|
-
e.map((
|
|
3193
|
+
e.map((d, _) => ({ label: d.name, color: ft(_, d.color) })),
|
|
3102
3194
|
"line"
|
|
3103
3195
|
)}
|
|
3104
|
-
${this.showTable ?
|
|
3196
|
+
${this.showTable ? fe(
|
|
3105
3197
|
this.label || "Line chart data",
|
|
3106
|
-
["Point", ...e.map((
|
|
3107
|
-
Array.from({ length: a }, (
|
|
3108
|
-
i[
|
|
3109
|
-
...e.map((
|
|
3198
|
+
["Point", ...e.map((d) => d.name)],
|
|
3199
|
+
Array.from({ length: a }, (d, _) => [
|
|
3200
|
+
i[_] ?? `Point ${_ + 1}`,
|
|
3201
|
+
...e.map((tt) => this.fmt(tt.values[_] ?? 0))
|
|
3110
3202
|
])
|
|
3111
3203
|
) : h}
|
|
3112
3204
|
</div>`;
|
|
@@ -3118,39 +3210,39 @@ let Q = class extends tt {
|
|
|
3118
3210
|
this.crosshairAt = null, this.requestUpdate(), this.hideTip();
|
|
3119
3211
|
}
|
|
3120
3212
|
};
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
],
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
],
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
],
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
],
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
],
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
],
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
],
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
],
|
|
3145
|
-
|
|
3213
|
+
nt([
|
|
3214
|
+
n({ attribute: !1 })
|
|
3215
|
+
], et.prototype, "series", 2);
|
|
3216
|
+
nt([
|
|
3217
|
+
n({ attribute: !1 })
|
|
3218
|
+
], et.prototype, "categories", 2);
|
|
3219
|
+
nt([
|
|
3220
|
+
n({ type: Boolean })
|
|
3221
|
+
], et.prototype, "area", 2);
|
|
3222
|
+
nt([
|
|
3223
|
+
n({ attribute: !1 })
|
|
3224
|
+
], et.prototype, "markers", 2);
|
|
3225
|
+
nt([
|
|
3226
|
+
n({ type: Number })
|
|
3227
|
+
], et.prototype, "forecast", 2);
|
|
3228
|
+
nt([
|
|
3229
|
+
n({ type: Number })
|
|
3230
|
+
], et.prototype, "baseline", 2);
|
|
3231
|
+
nt([
|
|
3232
|
+
n({ attribute: "label-values" })
|
|
3233
|
+
], et.prototype, "labelValues", 2);
|
|
3234
|
+
nt([
|
|
3235
|
+
n()
|
|
3236
|
+
], et.prototype, "label", 2);
|
|
3237
|
+
et = nt([
|
|
3146
3238
|
b("baht-line-chart")
|
|
3147
|
-
],
|
|
3148
|
-
var Qa = Object.defineProperty, ti = Object.getOwnPropertyDescriptor,
|
|
3239
|
+
], et);
|
|
3240
|
+
var Qa = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, xt = (t, e, i, a) => {
|
|
3149
3241
|
for (var s = a > 1 ? void 0 : a ? ti(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3150
3242
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3151
3243
|
return a && s && Qa(e, i, s), s;
|
|
3152
3244
|
};
|
|
3153
|
-
const _e = 22,
|
|
3245
|
+
const _e = 22, qt = 24, ss = 34, ke = 18, ei = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
3154
3246
|
function Pe(t) {
|
|
3155
3247
|
const e = /^(\d{4})-(\d{2})-(\d{2})/.exec(t ?? "");
|
|
3156
3248
|
return e ? new Date(Date.UTC(+e[1], +e[2] - 1, +e[3])) : null;
|
|
@@ -3158,7 +3250,7 @@ function Pe(t) {
|
|
|
3158
3250
|
function Oe(t) {
|
|
3159
3251
|
return t.toISOString().slice(0, 10);
|
|
3160
3252
|
}
|
|
3161
|
-
let pt = class extends
|
|
3253
|
+
let pt = class extends st {
|
|
3162
3254
|
constructor() {
|
|
3163
3255
|
super(...arguments), this.values = [], this.from = "", this.to = "", this.lessLabel = "Less", this.moreLabel = "More", this.label = "";
|
|
3164
3256
|
}
|
|
@@ -3169,34 +3261,34 @@ let pt = class extends tt {
|
|
|
3169
3261
|
render() {
|
|
3170
3262
|
const t = this.hold({ values: this.values ?? [], range: this.range }), e = t.range;
|
|
3171
3263
|
if (!e || t.values.length === 0)
|
|
3172
|
-
return
|
|
3173
|
-
const i = new Map(t.values.map((
|
|
3264
|
+
return l`<div class=${this.rootClass("baht-heatmap")}>${this.renderEmpty()}</div>`;
|
|
3265
|
+
const i = new Map(t.values.map((u) => [u.date.slice(0, 10), u.value])), a = [], s = new Date(e.start), r = (e.start.getUTCDay() + 6) % 7;
|
|
3174
3266
|
let o = 0;
|
|
3175
3267
|
for (; +s <= +e.end; ) {
|
|
3176
|
-
const
|
|
3177
|
-
a.push({ iso:
|
|
3268
|
+
const u = Oe(s), v = (s.getUTCDay() + 6) % 7, D = Math.floor((r + o) / 7);
|
|
3269
|
+
a.push({ iso: u, value: i.has(u) ? i.get(u) : null, col: D, row: v }), s.setUTCDate(s.getUTCDate() + 1), o += 1;
|
|
3178
3270
|
}
|
|
3179
|
-
const c = Math.max(1, ...a.map((
|
|
3180
|
-
return
|
|
3271
|
+
const c = Math.max(1, ...a.map((u) => u.col + 1)), f = ss + c * qt, $ = ke + 7 * qt + 4, w = Math.max(1, ...a.map((u) => u.value ?? 0)), p = (u) => Math.min(4, Math.max(0, Math.ceil(u / w * 5) - 1)), P = a.reduce((u, v) => u + (v.value ?? 0), 0), x = this.label || `Calendar heatmap, ${a.length} days from ${Oe(e.start)} to ${Oe(e.end)}, total ${this.fmt(P)}`;
|
|
3272
|
+
return l`<div class=${this.rootClass("baht-heatmap")}>
|
|
3181
3273
|
<svg
|
|
3182
3274
|
class="baht-chart-svg baht-heatmap-svg"
|
|
3183
3275
|
width=${f}
|
|
3184
|
-
height=${
|
|
3185
|
-
viewBox="0 0 ${f} ${
|
|
3276
|
+
height=${$}
|
|
3277
|
+
viewBox="0 0 ${f} ${$}"
|
|
3186
3278
|
preserveAspectRatio="xMinYMin meet"
|
|
3187
3279
|
role="img"
|
|
3188
|
-
aria-label=${
|
|
3280
|
+
aria-label=${x}
|
|
3189
3281
|
>
|
|
3190
3282
|
${ei.map(
|
|
3191
|
-
(
|
|
3283
|
+
(u, v) => v % 2 === 0 ? N`<text class="baht-chart-tick" x="0" y=${ke + v * qt + _e / 2 + 4}>${u}</text>` : h
|
|
3192
3284
|
)}
|
|
3193
|
-
${a.map((
|
|
3194
|
-
const v =
|
|
3195
|
-
return
|
|
3196
|
-
width=${_e} height=${_e} rx="3" fill=${
|
|
3197
|
-
@pointermove=${(
|
|
3285
|
+
${a.map((u) => {
|
|
3286
|
+
const v = u.value == null ? `${u.iso}: no activity` : `${u.iso}: ${this.fmt(u.value)}`, D = u.value == null || u.value <= 0 ? "var(--baht-chart-grid)" : Ye(p(u.value));
|
|
3287
|
+
return N`<rect class="baht-heatmap-cell" x=${ss + u.col * qt} y=${ke + u.row * qt}
|
|
3288
|
+
width=${_e} height=${_e} rx="3" fill=${D} tabindex="0" role="button" aria-label=${v}
|
|
3289
|
+
@pointermove=${(K) => this.showTip(K, v)}
|
|
3198
3290
|
@pointerleave=${() => this.hideTip()}
|
|
3199
|
-
@focus=${(
|
|
3291
|
+
@focus=${(K) => this.showTip(K, v)}
|
|
3200
3292
|
@blur=${() => this.hideTip()}/>`;
|
|
3201
3293
|
})}
|
|
3202
3294
|
</svg>
|
|
@@ -3204,73 +3296,79 @@ let pt = class extends tt {
|
|
|
3204
3296
|
<div class="baht-heatmap-scale">
|
|
3205
3297
|
<span class="baht-heatmap-scale-label">${this.lessLabel}</span>
|
|
3206
3298
|
${[0, 1, 2, 3, 4].map(
|
|
3207
|
-
(
|
|
3299
|
+
(u) => l`<span
|
|
3208
3300
|
class="baht-chart-swatch"
|
|
3209
|
-
style=${`background:${
|
|
3301
|
+
style=${`background:${Ye(u)}`}
|
|
3210
3302
|
aria-hidden="true"
|
|
3211
3303
|
></span>`
|
|
3212
3304
|
)}
|
|
3213
3305
|
<span class="baht-heatmap-scale-label">${this.moreLabel}</span>
|
|
3214
3306
|
</div>
|
|
3215
|
-
${this.showTable ?
|
|
3307
|
+
${this.showTable ? fe(
|
|
3216
3308
|
this.label || "Calendar heatmap data",
|
|
3217
3309
|
["Date", "Value"],
|
|
3218
|
-
a.map((
|
|
3310
|
+
a.map((u) => [u.iso, u.value == null ? "—" : this.fmt(u.value)])
|
|
3219
3311
|
) : h}
|
|
3220
3312
|
</div>`;
|
|
3221
3313
|
}
|
|
3222
3314
|
};
|
|
3223
|
-
|
|
3224
|
-
|
|
3315
|
+
xt([
|
|
3316
|
+
n({ attribute: !1 })
|
|
3225
3317
|
], pt.prototype, "values", 2);
|
|
3226
|
-
|
|
3227
|
-
|
|
3318
|
+
xt([
|
|
3319
|
+
n()
|
|
3228
3320
|
], pt.prototype, "from", 2);
|
|
3229
|
-
|
|
3230
|
-
|
|
3321
|
+
xt([
|
|
3322
|
+
n()
|
|
3231
3323
|
], pt.prototype, "to", 2);
|
|
3232
|
-
|
|
3233
|
-
|
|
3324
|
+
xt([
|
|
3325
|
+
n({ attribute: "less-label" })
|
|
3234
3326
|
], pt.prototype, "lessLabel", 2);
|
|
3235
|
-
|
|
3236
|
-
|
|
3327
|
+
xt([
|
|
3328
|
+
n({ attribute: "more-label" })
|
|
3237
3329
|
], pt.prototype, "moreLabel", 2);
|
|
3238
|
-
|
|
3239
|
-
|
|
3330
|
+
xt([
|
|
3331
|
+
n()
|
|
3240
3332
|
], pt.prototype, "label", 2);
|
|
3241
|
-
pt =
|
|
3333
|
+
pt = xt([
|
|
3242
3334
|
b("baht-heatmap")
|
|
3243
3335
|
], pt);
|
|
3244
|
-
var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor,
|
|
3336
|
+
var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Z = (t, e, i, a) => {
|
|
3245
3337
|
for (var s = a > 1 ? void 0 : a ? ai(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3246
3338
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3247
3339
|
return a && s && si(e, i, s), s;
|
|
3248
3340
|
};
|
|
3249
|
-
let
|
|
3341
|
+
let H = class extends g {
|
|
3250
3342
|
constructor() {
|
|
3251
|
-
super(...arguments), this.value = 0, this.max = 100, this.label = "", this.format = "number", this.currency = "THB", this.thresholds = { warning: 0.8, danger: 1 }, this.expected = null, this.overLabel = "Over budget", this.nearLabel = "Near limit";
|
|
3343
|
+
super(...arguments), this.value = 0, this.max = 100, this.label = "", this.format = "number", this.currency = "THB", this.thresholds = { warning: 0.8, danger: 1 }, this.expected = null, this.overLabel = "Over budget", this.atLabel = "At budget", this.nearLabel = "Near limit";
|
|
3252
3344
|
}
|
|
3253
3345
|
get fraction() {
|
|
3254
3346
|
const t = this.max || 1, e = this.value / t;
|
|
3255
3347
|
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
3256
3348
|
}
|
|
3257
|
-
/**
|
|
3349
|
+
/**
|
|
3350
|
+
* `ok` | `warning` | `danger`, from the fraction and the thresholds. `danger` is
|
|
3351
|
+
* strictly **above** its threshold: spending exactly the budget is not
|
|
3352
|
+
* overspending, so it reads as the warning tone with an "At budget" status.
|
|
3353
|
+
* `warning` stays inclusive (`>=`).
|
|
3354
|
+
*/
|
|
3258
3355
|
get severity() {
|
|
3259
3356
|
const { warning: t, danger: e } = this.thresholds ?? { warning: 0.8, danger: 1 }, i = this.fraction;
|
|
3260
|
-
return i
|
|
3357
|
+
return i > e ? "danger" : i >= t ? "warning" : "ok";
|
|
3261
3358
|
}
|
|
3262
3359
|
get statusText() {
|
|
3263
|
-
const t = this.severity;
|
|
3264
|
-
return
|
|
3360
|
+
const { danger: t } = this.thresholds ?? { danger: 1 }, e = this.severity;
|
|
3361
|
+
return e === "danger" ? this.overLabel : e === "warning" ? this.fraction >= t ? this.atLabel : this.nearLabel : "";
|
|
3265
3362
|
}
|
|
3266
3363
|
render() {
|
|
3267
|
-
|
|
3268
|
-
|
|
3364
|
+
var c;
|
|
3365
|
+
const t = this.severity, e = Math.min(100, this.fraction * 100), i = (f) => Rt(f, this.format, this.currency), a = this.expected != null && Number.isFinite(this.expected) && this.max ? Math.min(100, Math.max(0, this.expected / this.max * 100)) : null, s = `${i(this.value)} of ${i(this.max)}`, r = t === "warning" && this.fraction >= (((c = this.thresholds) == null ? void 0 : c.danger) ?? 1), o = t === "danger" ? "!" : r ? "=" : t === "warning" ? "△" : "";
|
|
3366
|
+
return l`<div class="baht-meter baht-meter--${t}">
|
|
3269
3367
|
<div class="baht-meter-head">
|
|
3270
|
-
${this.label ?
|
|
3368
|
+
${this.label ? l`<span class="baht-meter-label">${this.label}</span>` : h}
|
|
3271
3369
|
<span class="baht-meter-value">${s}</span>
|
|
3272
|
-
${this.statusText ?
|
|
3273
|
-
><span class="baht-meter-icon" aria-hidden="true">${
|
|
3370
|
+
${this.statusText ? l`<span class="baht-meter-status"
|
|
3371
|
+
><span class="baht-meter-icon" aria-hidden="true">${o}</span
|
|
3274
3372
|
>${this.statusText}</span
|
|
3275
3373
|
>` : h}
|
|
3276
3374
|
</div>
|
|
@@ -3284,81 +3382,84 @@ let W = class extends y {
|
|
|
3284
3382
|
aria-valuetext=${`${s}${this.statusText ? `, ${this.statusText}` : ""}`}
|
|
3285
3383
|
>
|
|
3286
3384
|
<div class="baht-meter-fill" style=${`width:${e.toFixed(2)}%`}></div>
|
|
3287
|
-
${a != null ?
|
|
3385
|
+
${a != null ? l`<span
|
|
3288
3386
|
class="baht-meter-expected"
|
|
3289
3387
|
style=${`left:${a.toFixed(2)}%`}
|
|
3290
3388
|
aria-hidden="true"
|
|
3291
3389
|
></span>` : h}
|
|
3292
3390
|
</div>
|
|
3293
|
-
${a != null ?
|
|
3391
|
+
${a != null ? l`<div class="baht-meter-pace">Expected by now ${i(this.expected)}</div>` : h}
|
|
3294
3392
|
</div>`;
|
|
3295
3393
|
}
|
|
3296
3394
|
};
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
],
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
],
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
],
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
],
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
],
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
],
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
],
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
],
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
],
|
|
3324
|
-
|
|
3395
|
+
Z([
|
|
3396
|
+
n({ type: Number })
|
|
3397
|
+
], H.prototype, "value", 2);
|
|
3398
|
+
Z([
|
|
3399
|
+
n({ type: Number })
|
|
3400
|
+
], H.prototype, "max", 2);
|
|
3401
|
+
Z([
|
|
3402
|
+
n()
|
|
3403
|
+
], H.prototype, "label", 2);
|
|
3404
|
+
Z([
|
|
3405
|
+
n()
|
|
3406
|
+
], H.prototype, "format", 2);
|
|
3407
|
+
Z([
|
|
3408
|
+
n()
|
|
3409
|
+
], H.prototype, "currency", 2);
|
|
3410
|
+
Z([
|
|
3411
|
+
n({ attribute: !1 })
|
|
3412
|
+
], H.prototype, "thresholds", 2);
|
|
3413
|
+
Z([
|
|
3414
|
+
n({ type: Number })
|
|
3415
|
+
], H.prototype, "expected", 2);
|
|
3416
|
+
Z([
|
|
3417
|
+
n({ attribute: "over-label" })
|
|
3418
|
+
], H.prototype, "overLabel", 2);
|
|
3419
|
+
Z([
|
|
3420
|
+
n({ attribute: "at-label" })
|
|
3421
|
+
], H.prototype, "atLabel", 2);
|
|
3422
|
+
Z([
|
|
3423
|
+
n({ attribute: "near-label" })
|
|
3424
|
+
], H.prototype, "nearLabel", 2);
|
|
3425
|
+
H = Z([
|
|
3325
3426
|
b("baht-meter")
|
|
3326
|
-
],
|
|
3327
|
-
var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor,
|
|
3427
|
+
], H);
|
|
3428
|
+
var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, me = (t, e, i, a) => {
|
|
3328
3429
|
for (var s = a > 1 ? void 0 : a ? ri(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3329
3430
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3330
3431
|
return a && s && ii(e, i, s), s;
|
|
3331
3432
|
};
|
|
3332
|
-
let
|
|
3433
|
+
let Gt = class extends g {
|
|
3333
3434
|
constructor() {
|
|
3334
3435
|
super(...arguments), this.icon = "🗂️", this.message = "Nothing to display", this.hint = "";
|
|
3335
3436
|
}
|
|
3336
3437
|
render() {
|
|
3337
|
-
return
|
|
3338
|
-
${this.icon ?
|
|
3438
|
+
return l`<div class="baht-empty-state">
|
|
3439
|
+
${this.icon ? l`<div class="baht-empty-state-icon" aria-hidden="true">${this.icon}</div>` : h}
|
|
3339
3440
|
<div class="baht-empty-state-message">${this.message}</div>
|
|
3340
|
-
${this.hint ?
|
|
3441
|
+
${this.hint ? l`<div class="baht-empty-state-hint">${this.hint}</div>` : h}
|
|
3341
3442
|
</div>`;
|
|
3342
3443
|
}
|
|
3343
3444
|
};
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
],
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
],
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
],
|
|
3353
|
-
|
|
3445
|
+
me([
|
|
3446
|
+
n()
|
|
3447
|
+
], Gt.prototype, "icon", 2);
|
|
3448
|
+
me([
|
|
3449
|
+
n()
|
|
3450
|
+
], Gt.prototype, "message", 2);
|
|
3451
|
+
me([
|
|
3452
|
+
n()
|
|
3453
|
+
], Gt.prototype, "hint", 2);
|
|
3454
|
+
Gt = me([
|
|
3354
3455
|
b("baht-empty-state")
|
|
3355
|
-
],
|
|
3356
|
-
var oi = Object.defineProperty, li = Object.getOwnPropertyDescriptor,
|
|
3456
|
+
], Gt);
|
|
3457
|
+
var oi = Object.defineProperty, li = Object.getOwnPropertyDescriptor, te = (t, e, i, a) => {
|
|
3357
3458
|
for (var s = a > 1 ? void 0 : a ? li(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3358
3459
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3359
3460
|
return a && s && oi(e, i, s), s;
|
|
3360
3461
|
};
|
|
3361
|
-
let
|
|
3462
|
+
let Bt = class extends g {
|
|
3362
3463
|
constructor() {
|
|
3363
3464
|
super(...arguments), this.icon = "⚠️", this.heading = "Something went wrong", this.message = "", this.retryLabel = "";
|
|
3364
3465
|
}
|
|
@@ -3366,35 +3467,35 @@ let Et = class extends y {
|
|
|
3366
3467
|
this.dispatchEvent(new CustomEvent("baht-retry", { bubbles: !0, composed: !0 }));
|
|
3367
3468
|
}
|
|
3368
3469
|
render() {
|
|
3369
|
-
return
|
|
3370
|
-
${this.icon ?
|
|
3470
|
+
return l`<div class="baht-error-state" role="alert">
|
|
3471
|
+
${this.icon ? l`<div class="baht-error-state-icon" aria-hidden="true">${this.icon}</div>` : h}
|
|
3371
3472
|
<div class="baht-error-state-heading">${this.heading}</div>
|
|
3372
|
-
${this.message ?
|
|
3373
|
-
${this.retryLabel ?
|
|
3473
|
+
${this.message ? l`<div class="baht-error-state-message">${this.message}</div>` : h}
|
|
3474
|
+
${this.retryLabel ? l`<baht-button size="sm" label=${this.retryLabel} @click=${this.onRetry}></baht-button>` : h}
|
|
3374
3475
|
</div>`;
|
|
3375
3476
|
}
|
|
3376
3477
|
};
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
],
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
],
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
],
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
],
|
|
3389
|
-
|
|
3478
|
+
te([
|
|
3479
|
+
n()
|
|
3480
|
+
], Bt.prototype, "icon", 2);
|
|
3481
|
+
te([
|
|
3482
|
+
n()
|
|
3483
|
+
], Bt.prototype, "heading", 2);
|
|
3484
|
+
te([
|
|
3485
|
+
n()
|
|
3486
|
+
], Bt.prototype, "message", 2);
|
|
3487
|
+
te([
|
|
3488
|
+
n({ attribute: "retry-label" })
|
|
3489
|
+
], Bt.prototype, "retryLabel", 2);
|
|
3490
|
+
Bt = te([
|
|
3390
3491
|
b("baht-error-state")
|
|
3391
|
-
],
|
|
3392
|
-
var ni = Object.defineProperty, hi = Object.getOwnPropertyDescriptor,
|
|
3492
|
+
], Bt);
|
|
3493
|
+
var ni = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, _t = (t, e, i, a) => {
|
|
3393
3494
|
for (var s = a > 1 ? void 0 : a ? hi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3394
3495
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3395
3496
|
return a && s && ni(e, i, s), s;
|
|
3396
3497
|
};
|
|
3397
|
-
let dt = class extends
|
|
3498
|
+
let dt = class extends g {
|
|
3398
3499
|
constructor() {
|
|
3399
3500
|
super(...arguments), this.value = {}, this.keyPlaceholder = "key", this.valuePlaceholder = "value", this.add_label = "Add row", this.disabled = !1, this.rows = [{ k: "", v: "" }], this.syncedJson = "";
|
|
3400
3501
|
}
|
|
@@ -3425,9 +3526,9 @@ let dt = class extends y {
|
|
|
3425
3526
|
this.rows = [...this.rows, { k: "", v: "" }];
|
|
3426
3527
|
}
|
|
3427
3528
|
render() {
|
|
3428
|
-
return
|
|
3529
|
+
return l`<div class="baht-keyvalue">
|
|
3429
3530
|
${this.rows.map(
|
|
3430
|
-
(t, e) =>
|
|
3531
|
+
(t, e) => l`<div class="baht-keyvalue-row">
|
|
3431
3532
|
<input
|
|
3432
3533
|
class="baht-control baht-keyvalue-key"
|
|
3433
3534
|
placeholder=${this.keyPlaceholder}
|
|
@@ -3451,7 +3552,7 @@ let dt = class extends y {
|
|
|
3451
3552
|
aria-label="Remove row ${e + 1}"
|
|
3452
3553
|
?disabled=${this.disabled}
|
|
3453
3554
|
@click=${() => this.commit(this.rows.filter((i, a) => a !== e))}
|
|
3454
|
-
>${
|
|
3555
|
+
>${W("close")}</button>
|
|
3455
3556
|
</div>`
|
|
3456
3557
|
)}
|
|
3457
3558
|
<button
|
|
@@ -3459,37 +3560,37 @@ let dt = class extends y {
|
|
|
3459
3560
|
class="baht-keyvalue-add"
|
|
3460
3561
|
?disabled=${this.disabled}
|
|
3461
3562
|
@click=${this.addRow}
|
|
3462
|
-
>${
|
|
3563
|
+
>${W("plus")}${this.add_label}</button>
|
|
3463
3564
|
</div>`;
|
|
3464
3565
|
}
|
|
3465
3566
|
};
|
|
3466
|
-
|
|
3467
|
-
|
|
3567
|
+
_t([
|
|
3568
|
+
n({ attribute: !1 })
|
|
3468
3569
|
], dt.prototype, "value", 2);
|
|
3469
|
-
|
|
3470
|
-
|
|
3570
|
+
_t([
|
|
3571
|
+
n({ attribute: "key-placeholder" })
|
|
3471
3572
|
], dt.prototype, "keyPlaceholder", 2);
|
|
3472
|
-
|
|
3473
|
-
|
|
3573
|
+
_t([
|
|
3574
|
+
n({ attribute: "value-placeholder" })
|
|
3474
3575
|
], dt.prototype, "valuePlaceholder", 2);
|
|
3475
|
-
|
|
3476
|
-
|
|
3576
|
+
_t([
|
|
3577
|
+
n({ attribute: "add-label" })
|
|
3477
3578
|
], dt.prototype, "add_label", 2);
|
|
3478
|
-
|
|
3479
|
-
|
|
3579
|
+
_t([
|
|
3580
|
+
n({ type: Boolean })
|
|
3480
3581
|
], dt.prototype, "disabled", 2);
|
|
3481
|
-
|
|
3482
|
-
|
|
3582
|
+
_t([
|
|
3583
|
+
y()
|
|
3483
3584
|
], dt.prototype, "rows", 2);
|
|
3484
|
-
dt =
|
|
3585
|
+
dt = _t([
|
|
3485
3586
|
b("baht-keyvalue-editor")
|
|
3486
3587
|
], dt);
|
|
3487
|
-
var ci = Object.defineProperty, pi = Object.getOwnPropertyDescriptor,
|
|
3588
|
+
var ci = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, L = (t, e, i, a) => {
|
|
3488
3589
|
for (var s = a > 1 ? void 0 : a ? pi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
3489
3590
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3490
3591
|
return a && s && ci(e, i, s), s;
|
|
3491
3592
|
};
|
|
3492
|
-
let j = class extends
|
|
3593
|
+
let j = class extends g {
|
|
3493
3594
|
constructor() {
|
|
3494
3595
|
super(...arguments), this.label = "Reference", this.value = "", this.display = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.href = "", this.lookupLabel = "Look up records", this.debounce = 200, this.fetcher = null, this.open = !1, this.term = "", this.options = [], this.loading = !1, this.activeIndex = -1, this.fetchSeq = 0, this.onDocMousedown = (t) => {
|
|
3495
3596
|
this.contains(t.target) || this.close();
|
|
@@ -3499,16 +3600,16 @@ let j = class extends y {
|
|
|
3499
3600
|
return `baht-refpicker-list-${this.uid}`;
|
|
3500
3601
|
}
|
|
3501
3602
|
disconnectedCallback() {
|
|
3502
|
-
super.disconnectedCallback(), clearTimeout(this.timer),
|
|
3603
|
+
super.disconnectedCallback(), clearTimeout(this.timer), T() && document.removeEventListener("mousedown", this.onDocMousedown);
|
|
3503
3604
|
}
|
|
3504
3605
|
openLookup() {
|
|
3505
|
-
this.disabled || this.open || (this.open = !0, this.term = "", this.activeIndex = -1,
|
|
3606
|
+
this.disabled || this.open || (this.open = !0, this.term = "", this.activeIndex = -1, T() && document.addEventListener("mousedown", this.onDocMousedown), this.search(""), this.updateComplete.then(() => {
|
|
3506
3607
|
var t;
|
|
3507
3608
|
return (t = this.inputEl) == null ? void 0 : t.focus();
|
|
3508
3609
|
}));
|
|
3509
3610
|
}
|
|
3510
3611
|
close() {
|
|
3511
|
-
this.open && (this.open = !1, this.loading = !1, clearTimeout(this.timer),
|
|
3612
|
+
this.open && (this.open = !1, this.loading = !1, clearTimeout(this.timer), T() && document.removeEventListener("mousedown", this.onDocMousedown));
|
|
3512
3613
|
}
|
|
3513
3614
|
search(t) {
|
|
3514
3615
|
clearTimeout(this.timer), this.timer = setTimeout(async () => {
|
|
@@ -3557,7 +3658,7 @@ let j = class extends y {
|
|
|
3557
3658
|
}
|
|
3558
3659
|
render() {
|
|
3559
3660
|
const t = this.open ? this.term : this.display || this.value;
|
|
3560
|
-
return
|
|
3661
|
+
return l`<div class="baht-refpicker${this.open ? " baht-refpicker--open" : ""}">
|
|
3561
3662
|
<div class="baht-refpicker-field">
|
|
3562
3663
|
<input
|
|
3563
3664
|
class="baht-control baht-refpicker-input"
|
|
@@ -3577,13 +3678,13 @@ let j = class extends y {
|
|
|
3577
3678
|
@input=${this.onInput}
|
|
3578
3679
|
@keydown=${this.onKeydown}
|
|
3579
3680
|
/>
|
|
3580
|
-
${this.value && !this.disabled ?
|
|
3681
|
+
${this.value && !this.disabled ? l`<button
|
|
3581
3682
|
type="button"
|
|
3582
3683
|
class="baht-refpicker-clear"
|
|
3583
3684
|
aria-label="Clear"
|
|
3584
3685
|
@mousedown=${(e) => e.preventDefault()}
|
|
3585
3686
|
@click=${() => this.clear()}
|
|
3586
|
-
>${
|
|
3687
|
+
>${W("close")}</button>` : h}
|
|
3587
3688
|
</div>
|
|
3588
3689
|
<button
|
|
3589
3690
|
type="button"
|
|
@@ -3592,13 +3693,13 @@ let j = class extends y {
|
|
|
3592
3693
|
title=${this.lookupLabel}
|
|
3593
3694
|
?disabled=${this.disabled}
|
|
3594
3695
|
@click=${() => this.open ? this.close() : this.openLookup()}
|
|
3595
|
-
>${
|
|
3596
|
-
${this.value && this.href ?
|
|
3696
|
+
>${W("search")}</button>
|
|
3697
|
+
${this.value && this.href ? l`<a
|
|
3597
3698
|
class="baht-refpicker-open"
|
|
3598
3699
|
href=${this.href}
|
|
3599
3700
|
aria-label="Open record"
|
|
3600
3701
|
title="Open record"
|
|
3601
|
-
>${
|
|
3702
|
+
>${W("external")}</a>` : h}
|
|
3602
3703
|
<div
|
|
3603
3704
|
class="baht-refpicker-list"
|
|
3604
3705
|
id=${this.listboxId}
|
|
@@ -3607,8 +3708,8 @@ let j = class extends y {
|
|
|
3607
3708
|
aria-busy=${this.loading ? "true" : h}
|
|
3608
3709
|
?hidden=${!this.open}
|
|
3609
3710
|
>
|
|
3610
|
-
${this.loading ?
|
|
3611
|
-
(e, i) =>
|
|
3711
|
+
${this.loading ? l`<div class="baht-refpicker-note" role="option" aria-disabled="true" aria-selected="false">Searching…</div>` : this.options.length === 0 ? l`<div class="baht-refpicker-note" role="option" aria-disabled="true" aria-selected="false">No matches</div>` : this.options.map(
|
|
3712
|
+
(e, i) => l`<button
|
|
3612
3713
|
type="button"
|
|
3613
3714
|
class="baht-refpicker-option${i === this.activeIndex ? " baht-refpicker-option--active" : ""}"
|
|
3614
3715
|
id="${this.listboxId}-${i}"
|
|
@@ -3618,62 +3719,62 @@ let j = class extends y {
|
|
|
3618
3719
|
@click=${() => this.pick(e)}
|
|
3619
3720
|
>
|
|
3620
3721
|
<span class="baht-refpicker-option-label">${e.label}</span>
|
|
3621
|
-
${e.sub ?
|
|
3722
|
+
${e.sub ? l`<span class="baht-refpicker-option-sub">${e.sub}</span>` : h}
|
|
3622
3723
|
</button>`
|
|
3623
3724
|
)}
|
|
3624
3725
|
</div>
|
|
3625
3726
|
</div>`;
|
|
3626
3727
|
}
|
|
3627
3728
|
};
|
|
3628
|
-
|
|
3629
|
-
|
|
3729
|
+
L([
|
|
3730
|
+
n()
|
|
3630
3731
|
], j.prototype, "label", 2);
|
|
3631
|
-
|
|
3632
|
-
|
|
3732
|
+
L([
|
|
3733
|
+
n()
|
|
3633
3734
|
], j.prototype, "value", 2);
|
|
3634
|
-
|
|
3635
|
-
|
|
3735
|
+
L([
|
|
3736
|
+
n()
|
|
3636
3737
|
], j.prototype, "display", 2);
|
|
3637
|
-
|
|
3638
|
-
|
|
3738
|
+
L([
|
|
3739
|
+
n()
|
|
3639
3740
|
], j.prototype, "placeholder", 2);
|
|
3640
|
-
|
|
3641
|
-
|
|
3741
|
+
L([
|
|
3742
|
+
n({ type: Boolean })
|
|
3642
3743
|
], j.prototype, "disabled", 2);
|
|
3643
|
-
|
|
3644
|
-
|
|
3744
|
+
L([
|
|
3745
|
+
n({ type: Boolean })
|
|
3645
3746
|
], j.prototype, "invalid", 2);
|
|
3646
|
-
|
|
3647
|
-
|
|
3747
|
+
L([
|
|
3748
|
+
n()
|
|
3648
3749
|
], j.prototype, "href", 2);
|
|
3649
|
-
|
|
3650
|
-
|
|
3750
|
+
L([
|
|
3751
|
+
n({ attribute: "lookup-label" })
|
|
3651
3752
|
], j.prototype, "lookupLabel", 2);
|
|
3652
|
-
|
|
3653
|
-
|
|
3753
|
+
L([
|
|
3754
|
+
n({ type: Number })
|
|
3654
3755
|
], j.prototype, "debounce", 2);
|
|
3655
|
-
|
|
3656
|
-
|
|
3756
|
+
L([
|
|
3757
|
+
n({ attribute: !1 })
|
|
3657
3758
|
], j.prototype, "fetcher", 2);
|
|
3658
|
-
|
|
3659
|
-
|
|
3759
|
+
L([
|
|
3760
|
+
y()
|
|
3660
3761
|
], j.prototype, "open", 2);
|
|
3661
|
-
|
|
3662
|
-
|
|
3762
|
+
L([
|
|
3763
|
+
y()
|
|
3663
3764
|
], j.prototype, "term", 2);
|
|
3664
|
-
|
|
3665
|
-
|
|
3765
|
+
L([
|
|
3766
|
+
y()
|
|
3666
3767
|
], j.prototype, "options", 2);
|
|
3667
|
-
|
|
3668
|
-
|
|
3768
|
+
L([
|
|
3769
|
+
y()
|
|
3669
3770
|
], j.prototype, "loading", 2);
|
|
3670
|
-
|
|
3671
|
-
|
|
3771
|
+
L([
|
|
3772
|
+
y()
|
|
3672
3773
|
], j.prototype, "activeIndex", 2);
|
|
3673
|
-
|
|
3674
|
-
|
|
3774
|
+
L([
|
|
3775
|
+
Mt("input")
|
|
3675
3776
|
], j.prototype, "inputEl", 2);
|
|
3676
|
-
j =
|
|
3777
|
+
j = L([
|
|
3677
3778
|
b("baht-reference-picker")
|
|
3678
3779
|
], j);
|
|
3679
3780
|
var di = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, I = (t, e, i, a) => {
|
|
@@ -3681,7 +3782,7 @@ var di = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, I = (t, e,
|
|
|
3681
3782
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
3682
3783
|
return a && s && di(e, i, s), s;
|
|
3683
3784
|
};
|
|
3684
|
-
let
|
|
3785
|
+
let E = class extends g {
|
|
3685
3786
|
constructor() {
|
|
3686
3787
|
super(...arguments), this.label = "Search", this.value = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.options = [], this.fetcher = null, this.debounce = 150, this.minChars = 1, this.maxItems = 8, this.freeText = !0, this.autocomplete = "off", this.term = "", this.open = !1, this.results = [], this.loading = !1, this.activeIndex = -1, this.fetchSeq = 0, this.picked = null, this.lastPicked = null, this.onDocMousedown = (t) => {
|
|
3687
3788
|
this.contains(t.target) || this.close();
|
|
@@ -3697,7 +3798,7 @@ let F = class extends y {
|
|
|
3697
3798
|
return `${this.listboxId}-${t}`;
|
|
3698
3799
|
}
|
|
3699
3800
|
disconnectedCallback() {
|
|
3700
|
-
super.disconnectedCallback(), clearTimeout(this.timer),
|
|
3801
|
+
super.disconnectedCallback(), clearTimeout(this.timer), T() && document.removeEventListener("mousedown", this.onDocMousedown);
|
|
3701
3802
|
}
|
|
3702
3803
|
willUpdate(t) {
|
|
3703
3804
|
super.willUpdate(t), t.has("value") && this.timer === void 0 && (this.term = this.value);
|
|
@@ -3744,10 +3845,10 @@ let F = class extends y {
|
|
|
3744
3845
|
this.activeIndex !== t && (this.activeIndex = t);
|
|
3745
3846
|
}
|
|
3746
3847
|
listen() {
|
|
3747
|
-
|
|
3848
|
+
T() && document.addEventListener("mousedown", this.onDocMousedown);
|
|
3748
3849
|
}
|
|
3749
3850
|
close() {
|
|
3750
|
-
|
|
3851
|
+
T() && document.removeEventListener("mousedown", this.onDocMousedown), this.open && (this.open = !1, this.activeIndex = -1);
|
|
3751
3852
|
}
|
|
3752
3853
|
// ---- events ------------------------------------------------------------
|
|
3753
3854
|
emitChange(t, e) {
|
|
@@ -3813,7 +3914,7 @@ let F = class extends y {
|
|
|
3813
3914
|
}
|
|
3814
3915
|
render() {
|
|
3815
3916
|
const t = this.open, e = !this.loading && this.results.length === 0;
|
|
3816
|
-
return
|
|
3917
|
+
return l`<div class="baht-typeahead${this.open ? " baht-typeahead--open" : ""}">
|
|
3817
3918
|
<input
|
|
3818
3919
|
class="baht-control baht-typeahead-input"
|
|
3819
3920
|
id=${this.inputId}
|
|
@@ -3827,7 +3928,7 @@ let F = class extends y {
|
|
|
3827
3928
|
aria-invalid=${this.invalid ? "true" : h}
|
|
3828
3929
|
autocomplete=${this.autocomplete}
|
|
3829
3930
|
placeholder=${this.placeholder || h}
|
|
3830
|
-
.value=${
|
|
3931
|
+
.value=${lt(this.term)}
|
|
3831
3932
|
?disabled=${this.disabled}
|
|
3832
3933
|
@input=${(i) => this.onInput(i)}
|
|
3833
3934
|
@keydown=${(i) => this.onKeydown(i)}
|
|
@@ -3841,9 +3942,9 @@ let F = class extends y {
|
|
|
3841
3942
|
aria-busy=${this.loading ? "true" : h}
|
|
3842
3943
|
?hidden=${!t}
|
|
3843
3944
|
>
|
|
3844
|
-
${this.loading ?
|
|
3945
|
+
${this.loading ? l`<div class="baht-listbox-note" role="option" aria-disabled="true" aria-selected="false">Searching…</div>` : e ? l`<div class="baht-listbox-note" role="option" aria-disabled="true" aria-selected="false">No matches</div>` : this.results.map(
|
|
3845
3946
|
// eslint-disable-next-line lit-a11y/click-events-have-key-events -- keyboard lives on the combobox input (aria-activedescendant pattern)
|
|
3846
|
-
(i, a) =>
|
|
3947
|
+
(i, a) => l`<div
|
|
3847
3948
|
class="baht-listbox-option${a === this.activeIndex ? " baht-listbox-option--active" : ""}"
|
|
3848
3949
|
id=${this.optionId(a)}
|
|
3849
3950
|
role="option"
|
|
@@ -3857,7 +3958,7 @@ let F = class extends y {
|
|
|
3857
3958
|
}}
|
|
3858
3959
|
>
|
|
3859
3960
|
<span class="baht-listbox-option-label">${i.label}</span>
|
|
3860
|
-
${i.sub ?
|
|
3961
|
+
${i.sub ? l`<span class="baht-listbox-option-sub">${i.sub}</span>` : h}
|
|
3861
3962
|
</div>`
|
|
3862
3963
|
)}
|
|
3863
3964
|
</div>
|
|
@@ -3865,62 +3966,62 @@ let F = class extends y {
|
|
|
3865
3966
|
}
|
|
3866
3967
|
};
|
|
3867
3968
|
I([
|
|
3868
|
-
|
|
3869
|
-
],
|
|
3969
|
+
n()
|
|
3970
|
+
], E.prototype, "label", 2);
|
|
3870
3971
|
I([
|
|
3871
|
-
|
|
3872
|
-
],
|
|
3972
|
+
n()
|
|
3973
|
+
], E.prototype, "value", 2);
|
|
3873
3974
|
I([
|
|
3874
|
-
|
|
3875
|
-
],
|
|
3975
|
+
n()
|
|
3976
|
+
], E.prototype, "placeholder", 2);
|
|
3876
3977
|
I([
|
|
3877
|
-
|
|
3878
|
-
],
|
|
3978
|
+
n({ type: Boolean })
|
|
3979
|
+
], E.prototype, "disabled", 2);
|
|
3879
3980
|
I([
|
|
3880
|
-
|
|
3881
|
-
],
|
|
3981
|
+
n({ type: Boolean })
|
|
3982
|
+
], E.prototype, "invalid", 2);
|
|
3882
3983
|
I([
|
|
3883
|
-
|
|
3884
|
-
],
|
|
3984
|
+
n({ attribute: !1 })
|
|
3985
|
+
], E.prototype, "options", 2);
|
|
3885
3986
|
I([
|
|
3886
|
-
|
|
3887
|
-
],
|
|
3987
|
+
n({ attribute: !1 })
|
|
3988
|
+
], E.prototype, "fetcher", 2);
|
|
3888
3989
|
I([
|
|
3889
|
-
|
|
3890
|
-
],
|
|
3990
|
+
n({ type: Number })
|
|
3991
|
+
], E.prototype, "debounce", 2);
|
|
3891
3992
|
I([
|
|
3892
|
-
|
|
3893
|
-
],
|
|
3993
|
+
n({ type: Number, attribute: "min-chars" })
|
|
3994
|
+
], E.prototype, "minChars", 2);
|
|
3894
3995
|
I([
|
|
3895
|
-
|
|
3896
|
-
],
|
|
3996
|
+
n({ type: Number, attribute: "max-items" })
|
|
3997
|
+
], E.prototype, "maxItems", 2);
|
|
3897
3998
|
I([
|
|
3898
|
-
|
|
3899
|
-
],
|
|
3999
|
+
n({ attribute: "free-text", converter: (t) => t !== "false" })
|
|
4000
|
+
], E.prototype, "freeText", 2);
|
|
3900
4001
|
I([
|
|
3901
|
-
|
|
3902
|
-
],
|
|
4002
|
+
n()
|
|
4003
|
+
], E.prototype, "autocomplete", 2);
|
|
3903
4004
|
I([
|
|
3904
|
-
|
|
3905
|
-
],
|
|
4005
|
+
y()
|
|
4006
|
+
], E.prototype, "term", 2);
|
|
3906
4007
|
I([
|
|
3907
|
-
|
|
3908
|
-
],
|
|
4008
|
+
y()
|
|
4009
|
+
], E.prototype, "open", 2);
|
|
3909
4010
|
I([
|
|
3910
|
-
|
|
3911
|
-
],
|
|
4011
|
+
y()
|
|
4012
|
+
], E.prototype, "results", 2);
|
|
3912
4013
|
I([
|
|
3913
|
-
|
|
3914
|
-
],
|
|
4014
|
+
y()
|
|
4015
|
+
], E.prototype, "loading", 2);
|
|
3915
4016
|
I([
|
|
3916
|
-
|
|
3917
|
-
],
|
|
4017
|
+
y()
|
|
4018
|
+
], E.prototype, "activeIndex", 2);
|
|
3918
4019
|
I([
|
|
3919
|
-
|
|
3920
|
-
],
|
|
3921
|
-
|
|
4020
|
+
Mt("input")
|
|
4021
|
+
], E.prototype, "inputEl", 2);
|
|
4022
|
+
E = I([
|
|
3922
4023
|
b("baht-typeahead")
|
|
3923
|
-
],
|
|
4024
|
+
], E);
|
|
3924
4025
|
const cs = {
|
|
3925
4026
|
text: "baht-input",
|
|
3926
4027
|
email: "baht-input",
|
|
@@ -3953,7 +4054,7 @@ function vi(t) {
|
|
|
3953
4054
|
let e = as.get(t);
|
|
3954
4055
|
return e || (e = os(t), as.set(t, e)), e;
|
|
3955
4056
|
}
|
|
3956
|
-
let
|
|
4057
|
+
let Me = class extends X {
|
|
3957
4058
|
constructor() {
|
|
3958
4059
|
super(...arguments), this.rowErrors = [];
|
|
3959
4060
|
}
|
|
@@ -3973,7 +4074,7 @@ let Ie = class extends J {
|
|
|
3973
4074
|
addRow() {
|
|
3974
4075
|
const t = {};
|
|
3975
4076
|
for (const e of this.subFields)
|
|
3976
|
-
e.type === "label" || e.type === "section" || (t[e.key] =
|
|
4077
|
+
e.type === "label" || e.type === "section" || (t[e.key] = ae(e));
|
|
3977
4078
|
this.emitInput([...this.rows, t]);
|
|
3978
4079
|
}
|
|
3979
4080
|
removeRow(t) {
|
|
@@ -3982,7 +4083,7 @@ let Ie = class extends J {
|
|
|
3982
4083
|
/** Pending keystrokes in any row land in the array before the host reads it. */
|
|
3983
4084
|
flushTyped() {
|
|
3984
4085
|
var t;
|
|
3985
|
-
if (!
|
|
4086
|
+
if (!T()) return super.flushTyped();
|
|
3986
4087
|
for (const e of this.querySelectorAll(".baht-repeater-row > .baht-field > *"))
|
|
3987
4088
|
(t = e.flushTyped) == null || t.call(e);
|
|
3988
4089
|
super.flushTyped();
|
|
@@ -4005,10 +4106,10 @@ let Ie = class extends J {
|
|
|
4005
4106
|
const { value: f } = c.detail;
|
|
4006
4107
|
this.patchRow(e, i.key, f);
|
|
4007
4108
|
};
|
|
4008
|
-
return
|
|
4009
|
-
${
|
|
4109
|
+
return l`<div class="baht-field ${r}" data-key=${i.key} data-type=${i.type}>
|
|
4110
|
+
${se`<${s}
|
|
4010
4111
|
.field=${i}
|
|
4011
|
-
.value=${Object.hasOwn(t, i.key) ? t[i.key] :
|
|
4112
|
+
.value=${Object.hasOwn(t, i.key) ? t[i.key] : ae(i)}
|
|
4012
4113
|
.disabled=${this.disabled}
|
|
4013
4114
|
.readonly=${this.readonly}
|
|
4014
4115
|
.required=${!!i.required}
|
|
@@ -4020,7 +4121,7 @@ let Ie = class extends J {
|
|
|
4020
4121
|
}
|
|
4021
4122
|
renderControl() {
|
|
4022
4123
|
const t = this.rows, e = !this.disabled && !this.readonly, i = this.field.max_rows !== void 0 && t.length >= this.field.max_rows;
|
|
4023
|
-
return
|
|
4124
|
+
return l`<div
|
|
4024
4125
|
class="baht-repeater"
|
|
4025
4126
|
id=${this.controlId}
|
|
4026
4127
|
role="group"
|
|
@@ -4030,7 +4131,7 @@ let Ie = class extends J {
|
|
|
4030
4131
|
${Ce(
|
|
4031
4132
|
t,
|
|
4032
4133
|
(a, s) => s,
|
|
4033
|
-
(a, s) =>
|
|
4134
|
+
(a, s) => l`<div
|
|
4034
4135
|
class="baht-repeater-row"
|
|
4035
4136
|
data-row=${s}
|
|
4036
4137
|
role="group"
|
|
@@ -4041,7 +4142,7 @@ let Ie = class extends J {
|
|
|
4041
4142
|
(r) => r.key,
|
|
4042
4143
|
(r) => this.renderSub(a, s, r)
|
|
4043
4144
|
)}
|
|
4044
|
-
${e ?
|
|
4145
|
+
${e ? l`<button
|
|
4045
4146
|
type="button"
|
|
4046
4147
|
class="baht-repeater-remove"
|
|
4047
4148
|
aria-label=${m("removeRowN", { n: s + 1 })}
|
|
@@ -4052,7 +4153,7 @@ let Ie = class extends J {
|
|
|
4052
4153
|
</button>` : h}
|
|
4053
4154
|
</div>`
|
|
4054
4155
|
)}
|
|
4055
|
-
${this.readonly ? h :
|
|
4156
|
+
${this.readonly ? h : l`<button
|
|
4056
4157
|
type="button"
|
|
4057
4158
|
class="baht-repeater-add"
|
|
4058
4159
|
?disabled=${this.disabled || i}
|
|
@@ -4064,53 +4165,53 @@ let Ie = class extends J {
|
|
|
4064
4165
|
}
|
|
4065
4166
|
};
|
|
4066
4167
|
ps([
|
|
4067
|
-
|
|
4068
|
-
],
|
|
4069
|
-
|
|
4168
|
+
n({ attribute: !1 })
|
|
4169
|
+
], Me.prototype, "rowErrors", 2);
|
|
4170
|
+
Me = ps([
|
|
4070
4171
|
b("baht-repeater")
|
|
4071
|
-
],
|
|
4072
|
-
var $i = Object.defineProperty, yi = Object.getOwnPropertyDescriptor,
|
|
4172
|
+
], Me);
|
|
4173
|
+
var $i = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, ve = (t, e, i, a) => {
|
|
4073
4174
|
for (var s = a > 1 ? void 0 : a ? yi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
4074
4175
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
4075
4176
|
return a && s && $i(e, i, s), s;
|
|
4076
4177
|
};
|
|
4077
|
-
let
|
|
4178
|
+
let Wt = class extends g {
|
|
4078
4179
|
constructor() {
|
|
4079
4180
|
super(...arguments), this.steps = [], this.current = 0, this.variant = "default";
|
|
4080
4181
|
}
|
|
4081
4182
|
render() {
|
|
4082
4183
|
const t = this.variant === "sidebar";
|
|
4083
|
-
return
|
|
4184
|
+
return l`<ol
|
|
4084
4185
|
class="baht-steps ${t ? "baht-steps--sidebar" : ""}"
|
|
4085
4186
|
aria-label=${m("step", { current: this.current + 1, total: this.steps.length })}
|
|
4086
4187
|
>
|
|
4087
4188
|
${this.steps.map((e, i) => {
|
|
4088
4189
|
const a = i < this.current ? "done" : i === this.current ? "current" : "todo";
|
|
4089
|
-
return
|
|
4190
|
+
return l`<li
|
|
4090
4191
|
class="baht-step baht-step--${a} ${t ? "baht-step--sidebar" : ""}"
|
|
4091
4192
|
aria-current=${a === "current" ? "step" : "false"}
|
|
4092
4193
|
>
|
|
4093
|
-
${t ? h :
|
|
4194
|
+
${t ? h : l`<span class="baht-step-marker" aria-hidden="true">${a === "done" ? "✓" : i + 1}</span>`}
|
|
4094
4195
|
<span class="baht-step-label">${e}</span>
|
|
4095
|
-
${a === "done" ?
|
|
4196
|
+
${a === "done" ? l`<span class="baht-visually-hidden"> (${m("stepDone")})</span>` : a === "current" ? l`<span class="baht-visually-hidden"> (${m("stepCurrent")})</span>` : h}
|
|
4096
4197
|
</li>`;
|
|
4097
4198
|
})}
|
|
4098
4199
|
</ol>`;
|
|
4099
4200
|
}
|
|
4100
4201
|
};
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
],
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
],
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
],
|
|
4110
|
-
|
|
4202
|
+
ve([
|
|
4203
|
+
n({ attribute: !1 })
|
|
4204
|
+
], Wt.prototype, "steps", 2);
|
|
4205
|
+
ve([
|
|
4206
|
+
n({ type: Number })
|
|
4207
|
+
], Wt.prototype, "current", 2);
|
|
4208
|
+
ve([
|
|
4209
|
+
n()
|
|
4210
|
+
], Wt.prototype, "variant", 2);
|
|
4211
|
+
Wt = ve([
|
|
4111
4212
|
b("baht-steps")
|
|
4112
|
-
],
|
|
4113
|
-
var gi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor,
|
|
4213
|
+
], Wt);
|
|
4214
|
+
var gi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, Q = (t, e, i, a) => {
|
|
4114
4215
|
for (var s = a > 1 ? void 0 : a ? wi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
4115
4216
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
4116
4217
|
return a && s && gi(e, i, s), s;
|
|
@@ -4125,7 +4226,7 @@ function _i(t) {
|
|
|
4125
4226
|
let e = is.get(t);
|
|
4126
4227
|
return e || (e = os(t), is.set(t, e)), e;
|
|
4127
4228
|
}
|
|
4128
|
-
let
|
|
4229
|
+
let G = class extends g {
|
|
4129
4230
|
constructor() {
|
|
4130
4231
|
super(...arguments), this.value = {}, this.registry = {}, this.options = {}, this.fieldStates = {}, this.flags = {}, this.readonly = !1, this.edits = {}, this.errors = [], this.dynamicOptions = /* @__PURE__ */ new Map(), this.optionsSnapshots = /* @__PURE__ */ new Map(), this.optionsEpoch = /* @__PURE__ */ new Map(), this.warnedViews = /* @__PURE__ */ new Set(), this.flagCache = {};
|
|
4131
4232
|
}
|
|
@@ -4178,7 +4279,7 @@ let U = class extends y {
|
|
|
4178
4279
|
for (; e.length > 0; ) {
|
|
4179
4280
|
const r = e.shift();
|
|
4180
4281
|
for (const o of ((a = this.effectiveForm) == null ? void 0 : a.fields) ?? [])
|
|
4181
|
-
!((s = o.options_deps) != null && s.includes(r)) || i.has(o.key) || (i.add(o.key), this.edits = { ...this.edits, [o.key]:
|
|
4282
|
+
!((s = o.options_deps) != null && s.includes(r)) || i.has(o.key) || (i.add(o.key), this.edits = { ...this.edits, [o.key]: ae(o) }, e.push(o.key));
|
|
4182
4283
|
}
|
|
4183
4284
|
}
|
|
4184
4285
|
get sortedFields() {
|
|
@@ -4196,13 +4297,13 @@ let U = class extends y {
|
|
|
4196
4297
|
};
|
|
4197
4298
|
}
|
|
4198
4299
|
valueFor(t) {
|
|
4199
|
-
return Object.hasOwn(this.edits, t.key) ? this.edits[t.key] : Object.hasOwn(this.value, t.key) ? this.value[t.key] :
|
|
4300
|
+
return Object.hasOwn(this.edits, t.key) ? this.edits[t.key] : Object.hasOwn(this.value, t.key) ? this.value[t.key] : ae(t);
|
|
4200
4301
|
}
|
|
4201
4302
|
// ---- public API (spec 01 §6) ----
|
|
4202
4303
|
/** Debounced keystrokes still in a control land in `edits` before anyone reads them. */
|
|
4203
4304
|
flushTyped() {
|
|
4204
4305
|
var t;
|
|
4205
|
-
if (
|
|
4306
|
+
if (T())
|
|
4206
4307
|
for (const e of this.querySelectorAll(":scope > .baht-form > .baht-field > *"))
|
|
4207
4308
|
(t = e.flushTyped) == null || t.call(e);
|
|
4208
4309
|
}
|
|
@@ -4265,60 +4366,60 @@ let U = class extends y {
|
|
|
4265
4366
|
this.errors = [...i, ...e];
|
|
4266
4367
|
}
|
|
4267
4368
|
renderField(t) {
|
|
4268
|
-
var
|
|
4369
|
+
var x, u;
|
|
4269
4370
|
const e = cs[t.type];
|
|
4270
4371
|
if (!e)
|
|
4271
4372
|
return console.warn(`[bahtui] unknown field type "${t.type}" — skipped`), h;
|
|
4272
|
-
const i = this.stateFor(t), a = xi[t.width ?? "full"] ?? "baht-field--w-full", s = ((
|
|
4373
|
+
const i = this.stateFor(t), a = xi[t.width ?? "full"] ?? "baht-field--w-full", s = ((x = this.errors.find((v) => v.key === t.key)) == null ? void 0 : x.message) ?? null;
|
|
4273
4374
|
if (this.readonly && t.type !== "label" && t.type !== "section")
|
|
4274
4375
|
return this.renderReadonlyField(t, a, i.visible);
|
|
4275
|
-
const r = t.options_from ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, o = this.valueFor(t), c = !i.enabled, f = this.readonly || i.readonly,
|
|
4276
|
-
let
|
|
4376
|
+
const r = t.options_from ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, o = this.valueFor(t), c = !i.enabled, f = this.readonly || i.readonly, $ = this.options.inputDebounce, w = (v) => this.onControlInput(t.key, v), p = _i(e);
|
|
4377
|
+
let P;
|
|
4277
4378
|
if (t.type === "repeater") {
|
|
4278
|
-
const v = this.errors.filter((
|
|
4279
|
-
|
|
4379
|
+
const v = this.errors.filter((D) => D.key.startsWith(`${t.key}[`));
|
|
4380
|
+
P = se`<${p}
|
|
4280
4381
|
.field=${r}
|
|
4281
4382
|
.value=${o}
|
|
4282
4383
|
.disabled=${c}
|
|
4283
4384
|
.readonly=${f}
|
|
4284
4385
|
.required=${i.required}
|
|
4285
4386
|
.error=${s}
|
|
4286
|
-
.debounce=${
|
|
4387
|
+
.debounce=${$}
|
|
4287
4388
|
.rowErrors=${v}
|
|
4288
|
-
@baht-input=${
|
|
4389
|
+
@baht-input=${w}
|
|
4289
4390
|
></${p}>`;
|
|
4290
4391
|
} else if (t.type === "file") {
|
|
4291
4392
|
let v;
|
|
4292
|
-
t.uploader && (v = (
|
|
4393
|
+
t.uploader && (v = (u = this.registry.uploaders) == null ? void 0 : u[t.uploader], v || console.warn(`[bahtui] unknown uploader "${t.uploader}" — capture only`)), P = se`<${p}
|
|
4293
4394
|
.field=${r}
|
|
4294
4395
|
.value=${o}
|
|
4295
4396
|
.disabled=${c}
|
|
4296
4397
|
.readonly=${f}
|
|
4297
4398
|
.required=${i.required}
|
|
4298
4399
|
.error=${s}
|
|
4299
|
-
.debounce=${
|
|
4400
|
+
.debounce=${$}
|
|
4300
4401
|
.uploader=${v}
|
|
4301
|
-
@baht-input=${
|
|
4402
|
+
@baht-input=${w}
|
|
4302
4403
|
></${p}>`;
|
|
4303
4404
|
} else
|
|
4304
|
-
|
|
4405
|
+
P = se`<${p}
|
|
4305
4406
|
.field=${r}
|
|
4306
4407
|
.value=${o}
|
|
4307
4408
|
.disabled=${c}
|
|
4308
4409
|
.readonly=${f}
|
|
4309
4410
|
.required=${i.required}
|
|
4310
4411
|
.error=${s}
|
|
4311
|
-
.debounce=${
|
|
4312
|
-
@baht-input=${
|
|
4412
|
+
.debounce=${$}
|
|
4413
|
+
@baht-input=${w}
|
|
4313
4414
|
></${p}>`;
|
|
4314
|
-
return
|
|
4415
|
+
return l`<div
|
|
4315
4416
|
class="baht-field ${a} ${i.visible ? "" : "baht-field--hidden"}"
|
|
4316
4417
|
data-key=${t.key}
|
|
4317
4418
|
data-type=${t.type}
|
|
4318
4419
|
data-testid="${this.form.form_id}.${t.key}"
|
|
4319
4420
|
@focusout=${() => this.onFieldBlur(t)}
|
|
4320
4421
|
>
|
|
4321
|
-
${
|
|
4422
|
+
${P}
|
|
4322
4423
|
</div>`;
|
|
4323
4424
|
}
|
|
4324
4425
|
/**
|
|
@@ -4331,13 +4432,13 @@ let U = class extends y {
|
|
|
4331
4432
|
i && this.onFieldInput(i, e);
|
|
4332
4433
|
}
|
|
4333
4434
|
renderReadonlyField(t, e, i) {
|
|
4334
|
-
const a = t.options_from ? this.dynamicOptions.get(t.key) ?? t.options ?? [] : t.options, s = bs(t, this.valueFor(t), a), r = s.kind === "empty" ?
|
|
4335
|
-
>${s.items.map((o) =>
|
|
4336
|
-
>` :
|
|
4435
|
+
const a = t.options_from ? this.dynamicOptions.get(t.key) ?? t.options ?? [] : t.options, s = bs(t, this.valueFor(t), a), r = s.kind === "empty" ? l`<span class="baht-readonly-value baht-readonly-value--empty">${m("emptyValue")}</span>` : s.kind === "text" ? l`<span class="baht-readonly-value">${s.text}</span>` : s.kind === "chips" ? l`<span class="baht-readonly-value baht-readonly-chips"
|
|
4436
|
+
>${s.items.map((o) => l`<span class="baht-readonly-chip">${o}</span>`)}</span
|
|
4437
|
+
>` : l`<div class="baht-readonly-rows">
|
|
4337
4438
|
${s.rows.map(
|
|
4338
|
-
(o) =>
|
|
4439
|
+
(o) => l`<div class="baht-readonly-row">
|
|
4339
4440
|
${o.map(
|
|
4340
|
-
(c) =>
|
|
4441
|
+
(c) => l`<span class="baht-readonly-cell"
|
|
4341
4442
|
><span class="baht-readonly-cell-label">${c.label}</span
|
|
4342
4443
|
><span class="baht-readonly-cell-value">${c.text}</span></span
|
|
4343
4444
|
>`
|
|
@@ -4345,18 +4446,18 @@ let U = class extends y {
|
|
|
4345
4446
|
</div>`
|
|
4346
4447
|
)}
|
|
4347
4448
|
</div>`;
|
|
4348
|
-
return
|
|
4449
|
+
return l`<div
|
|
4349
4450
|
class="baht-field ${e} baht-field--readonly ${i ? "" : "baht-field--hidden"}"
|
|
4350
4451
|
data-key=${t.key}
|
|
4351
4452
|
data-type=${t.type}
|
|
4352
4453
|
data-testid="${this.form.form_id}.${t.key}"
|
|
4353
4454
|
>
|
|
4354
|
-
${t.label ?
|
|
4455
|
+
${t.label ? l`<span class="baht-label">${t.label}</span>` : h}
|
|
4355
4456
|
${r}
|
|
4356
4457
|
</div>`;
|
|
4357
4458
|
}
|
|
4358
4459
|
render() {
|
|
4359
|
-
return
|
|
4460
|
+
return l`<div class="baht-form ${this.readonly ? "baht-form--readonly" : ""}">
|
|
4360
4461
|
${Ce(
|
|
4361
4462
|
this.sortedFields,
|
|
4362
4463
|
(t) => t.key,
|
|
@@ -4365,45 +4466,45 @@ let U = class extends y {
|
|
|
4365
4466
|
</div>`;
|
|
4366
4467
|
}
|
|
4367
4468
|
};
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
],
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
],
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
],
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
],
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
],
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
],
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
],
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
],
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
],
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
],
|
|
4398
|
-
|
|
4469
|
+
Q([
|
|
4470
|
+
n({ attribute: !1 })
|
|
4471
|
+
], G.prototype, "form", 2);
|
|
4472
|
+
Q([
|
|
4473
|
+
n({ attribute: !1 })
|
|
4474
|
+
], G.prototype, "value", 2);
|
|
4475
|
+
Q([
|
|
4476
|
+
n({ attribute: !1 })
|
|
4477
|
+
], G.prototype, "registry", 2);
|
|
4478
|
+
Q([
|
|
4479
|
+
n({ attribute: !1 })
|
|
4480
|
+
], G.prototype, "options", 2);
|
|
4481
|
+
Q([
|
|
4482
|
+
n({ attribute: !1 })
|
|
4483
|
+
], G.prototype, "fieldStates", 2);
|
|
4484
|
+
Q([
|
|
4485
|
+
n({ type: String })
|
|
4486
|
+
], G.prototype, "view", 2);
|
|
4487
|
+
Q([
|
|
4488
|
+
n({ attribute: !1 })
|
|
4489
|
+
], G.prototype, "flags", 2);
|
|
4490
|
+
Q([
|
|
4491
|
+
n({ type: Boolean })
|
|
4492
|
+
], G.prototype, "readonly", 2);
|
|
4493
|
+
Q([
|
|
4494
|
+
y()
|
|
4495
|
+
], G.prototype, "edits", 2);
|
|
4496
|
+
Q([
|
|
4497
|
+
y()
|
|
4498
|
+
], G.prototype, "errors", 2);
|
|
4499
|
+
G = Q([
|
|
4399
4500
|
b("baht-form")
|
|
4400
|
-
],
|
|
4401
|
-
var ki = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor,
|
|
4501
|
+
], G);
|
|
4502
|
+
var ki = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, R = (t, e, i, a) => {
|
|
4402
4503
|
for (var s = a > 1 ? void 0 : a ? Pi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
|
|
4403
4504
|
(o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
|
|
4404
4505
|
return a && s && ki(e, i, s), s;
|
|
4405
4506
|
};
|
|
4406
|
-
let
|
|
4507
|
+
let A = class extends g {
|
|
4407
4508
|
constructor() {
|
|
4408
4509
|
super(...arguments), this.value = {}, this.registry = {}, this.validateGate = !0, this.showBack = !0, this.flags = {}, this.showSteps = !1, this.stepsVariant = "default", this.data = {}, this.derived = null, this.current = null, this.approvalError = null, this.history = [], this.flagCache = {};
|
|
4409
4510
|
}
|
|
@@ -4538,7 +4639,7 @@ let M = class extends y {
|
|
|
4538
4639
|
}
|
|
4539
4640
|
this.emit("baht-reject", o);
|
|
4540
4641
|
const c = i.on_reject ?? { action: "end" };
|
|
4541
|
-
c.action === "goto" && this.visibleForms.some((
|
|
4642
|
+
c.action === "goto" && this.visibleForms.some(($) => $.form_name === c.form) ? this.gotoForm(c.form) : this.emit("baht-complete", { data: this.getData(), status: "rejected" });
|
|
4542
4643
|
}
|
|
4543
4644
|
/** Jump back to a visible form, truncating the history to that point. */
|
|
4544
4645
|
gotoForm(t) {
|
|
@@ -4585,10 +4686,10 @@ let M = class extends y {
|
|
|
4585
4686
|
renderApproval(t) {
|
|
4586
4687
|
var a, s;
|
|
4587
4688
|
const e = ((a = t.approval) == null ? void 0 : a.comment) ?? "optional", i = this.summary_forms(t);
|
|
4588
|
-
return
|
|
4689
|
+
return l`<div class="baht-approval">
|
|
4589
4690
|
<div class="baht-approval-summary">
|
|
4590
|
-
${i.length === 0 ?
|
|
4591
|
-
(r) =>
|
|
4691
|
+
${i.length === 0 ? l`<p class="baht-approval-empty">${m("nothingToReview")}</p>` : i.map(
|
|
4692
|
+
(r) => l`<section class="baht-approval-group">
|
|
4592
4693
|
<h4 class="baht-approval-group-title">${r.form_name}</h4>
|
|
4593
4694
|
<baht-form
|
|
4594
4695
|
readonly
|
|
@@ -4599,7 +4700,7 @@ let M = class extends y {
|
|
|
4599
4700
|
</section>`
|
|
4600
4701
|
)}
|
|
4601
4702
|
</div>
|
|
4602
|
-
${e !== "hidden" ?
|
|
4703
|
+
${e !== "hidden" ? l`<label class="baht-approval-comment">
|
|
4603
4704
|
<span class="baht-approval-comment-label">
|
|
4604
4705
|
${m("comment")}${e === "required" ? m("commentRequiredSuffix") : ""}
|
|
4605
4706
|
</span>
|
|
@@ -4611,15 +4712,15 @@ let M = class extends y {
|
|
|
4611
4712
|
@input=${(r) => this.onCommentInput(t.form_name, r.target.value)}
|
|
4612
4713
|
></textarea>
|
|
4613
4714
|
</label>` : h}
|
|
4614
|
-
${this.approvalError ?
|
|
4715
|
+
${this.approvalError ? l`<p class="baht-error" role="alert">${this.approvalError}</p>` : h}
|
|
4615
4716
|
</div>`;
|
|
4616
4717
|
}
|
|
4617
4718
|
render() {
|
|
4618
4719
|
var s, r;
|
|
4619
4720
|
const t = this.currentForm;
|
|
4620
|
-
if (!t) return
|
|
4721
|
+
if (!t) return l`<div class="baht-workflow"></div>`;
|
|
4621
4722
|
const e = t.kind === "approval", i = this.visibleForms, a = i.findIndex((o) => o.form_name === t.form_name);
|
|
4622
|
-
return
|
|
4723
|
+
return l`<div
|
|
4623
4724
|
class="baht-workflow"
|
|
4624
4725
|
data-step=${t.form_name}
|
|
4625
4726
|
data-testid="${this.workflow.workflow_id}.${t.form_name}"
|
|
@@ -4627,12 +4728,12 @@ let M = class extends y {
|
|
|
4627
4728
|
<div class="baht-visually-hidden" role="status">
|
|
4628
4729
|
${m("step", { current: a + 1, total: i.length })}
|
|
4629
4730
|
</div>
|
|
4630
|
-
${this.showSteps ?
|
|
4731
|
+
${this.showSteps ? l`<baht-steps
|
|
4631
4732
|
.steps=${i.map((o) => o.form_name)}
|
|
4632
4733
|
.current=${a}
|
|
4633
4734
|
.variant=${this.stepsVariant}
|
|
4634
4735
|
></baht-steps>` : h}
|
|
4635
|
-
${e ? this.renderApproval(t) :
|
|
4736
|
+
${e ? this.renderApproval(t) : l`<baht-form
|
|
4636
4737
|
.form=${t}
|
|
4637
4738
|
.value=${this.data[t.form_name] ?? {}}
|
|
4638
4739
|
.registry=${this.registry}
|
|
@@ -4641,13 +4742,13 @@ let M = class extends y {
|
|
|
4641
4742
|
@baht-change=${(o) => this.onFormChange(o)}
|
|
4642
4743
|
></baht-form>`}
|
|
4643
4744
|
<div class="baht-workflow-nav">
|
|
4644
|
-
${this.showBack && this.history.length > 0 ?
|
|
4745
|
+
${this.showBack && this.history.length > 0 ? l`<button type="button" class="baht-button baht-button--back"
|
|
4645
4746
|
data-testid="${this.workflow.workflow_id}.back"
|
|
4646
4747
|
@click=${() => this.back()}
|
|
4647
4748
|
>
|
|
4648
4749
|
${this.backLabel ?? m("back")}
|
|
4649
4750
|
</button>` : h}
|
|
4650
|
-
${e ?
|
|
4751
|
+
${e ? l`<button
|
|
4651
4752
|
type="button"
|
|
4652
4753
|
class="baht-button baht-button--reject"
|
|
4653
4754
|
data-testid="${this.workflow.workflow_id}.reject"
|
|
@@ -4662,7 +4763,7 @@ let M = class extends y {
|
|
|
4662
4763
|
@click=${() => this.decide("approved")}
|
|
4663
4764
|
>
|
|
4664
4765
|
${((r = t.approval) == null ? void 0 : r.approve_label) ?? m("approve")}
|
|
4665
|
-
</button>` :
|
|
4766
|
+
</button>` : l`<button type="button" class="baht-button baht-button--next"
|
|
4666
4767
|
data-testid="${this.workflow.workflow_id}.next"
|
|
4667
4768
|
@click=${() => this.next()}
|
|
4668
4769
|
>
|
|
@@ -4672,112 +4773,112 @@ let M = class extends y {
|
|
|
4672
4773
|
</div>`;
|
|
4673
4774
|
}
|
|
4674
4775
|
};
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
],
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
],
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
],
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
],
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
],
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
],
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
],
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
],
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
],
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
],
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
],
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
],
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
],
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
],
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
],
|
|
4720
|
-
|
|
4776
|
+
R([
|
|
4777
|
+
n({ attribute: !1 })
|
|
4778
|
+
], A.prototype, "workflow", 2);
|
|
4779
|
+
R([
|
|
4780
|
+
n({ attribute: !1 })
|
|
4781
|
+
], A.prototype, "value", 2);
|
|
4782
|
+
R([
|
|
4783
|
+
n({ attribute: !1 })
|
|
4784
|
+
], A.prototype, "registry", 2);
|
|
4785
|
+
R([
|
|
4786
|
+
n({ type: Boolean, attribute: "validate-gate" })
|
|
4787
|
+
], A.prototype, "validateGate", 2);
|
|
4788
|
+
R([
|
|
4789
|
+
n({ attribute: "next-label" })
|
|
4790
|
+
], A.prototype, "nextLabel", 2);
|
|
4791
|
+
R([
|
|
4792
|
+
n({ attribute: "submit-label" })
|
|
4793
|
+
], A.prototype, "submitLabel", 2);
|
|
4794
|
+
R([
|
|
4795
|
+
n({ attribute: "back-label" })
|
|
4796
|
+
], A.prototype, "backLabel", 2);
|
|
4797
|
+
R([
|
|
4798
|
+
n({ type: Boolean, attribute: "show-back" })
|
|
4799
|
+
], A.prototype, "showBack", 2);
|
|
4800
|
+
R([
|
|
4801
|
+
n({ attribute: !1 })
|
|
4802
|
+
], A.prototype, "flags", 2);
|
|
4803
|
+
R([
|
|
4804
|
+
n({ type: Boolean, attribute: "show-steps" })
|
|
4805
|
+
], A.prototype, "showSteps", 2);
|
|
4806
|
+
R([
|
|
4807
|
+
n({ attribute: "steps-variant" })
|
|
4808
|
+
], A.prototype, "stepsVariant", 2);
|
|
4809
|
+
R([
|
|
4810
|
+
y()
|
|
4811
|
+
], A.prototype, "data", 2);
|
|
4812
|
+
R([
|
|
4813
|
+
y()
|
|
4814
|
+
], A.prototype, "derived", 2);
|
|
4815
|
+
R([
|
|
4816
|
+
y()
|
|
4817
|
+
], A.prototype, "current", 2);
|
|
4818
|
+
R([
|
|
4819
|
+
y()
|
|
4820
|
+
], A.prototype, "approvalError", 2);
|
|
4821
|
+
A = R([
|
|
4721
4822
|
b("baht-workflow")
|
|
4722
|
-
],
|
|
4823
|
+
], A);
|
|
4723
4824
|
export {
|
|
4724
|
-
|
|
4825
|
+
Ye as $,
|
|
4725
4826
|
ht as A,
|
|
4726
|
-
|
|
4727
|
-
|
|
4827
|
+
Dt as B,
|
|
4828
|
+
Ot as C,
|
|
4728
4829
|
Ke as D,
|
|
4729
|
-
|
|
4730
|
-
|
|
4830
|
+
ot as E,
|
|
4831
|
+
vt as F,
|
|
4731
4832
|
j as G,
|
|
4732
|
-
|
|
4833
|
+
Me as H,
|
|
4733
4834
|
Ee as I,
|
|
4734
|
-
|
|
4735
|
-
|
|
4835
|
+
le as J,
|
|
4836
|
+
Kt as K,
|
|
4736
4837
|
ct as L,
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4838
|
+
re as M,
|
|
4839
|
+
U as N,
|
|
4840
|
+
Ht as O,
|
|
4841
|
+
Wt as P,
|
|
4741
4842
|
k as Q,
|
|
4742
4843
|
Fe as R,
|
|
4743
4844
|
qe as S,
|
|
4744
4845
|
De as T,
|
|
4745
4846
|
Ue as U,
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4847
|
+
Pt as V,
|
|
4848
|
+
E as W,
|
|
4849
|
+
F as X,
|
|
4850
|
+
A as Y,
|
|
4750
4851
|
cs as Z,
|
|
4751
|
-
|
|
4752
|
-
|
|
4852
|
+
ft as _,
|
|
4853
|
+
mt as a,
|
|
4753
4854
|
qa as a0,
|
|
4754
|
-
|
|
4755
|
-
|
|
4855
|
+
Rt as a1,
|
|
4856
|
+
ne as a2,
|
|
4756
4857
|
Be as a3,
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4858
|
+
fe as a4,
|
|
4859
|
+
Vt as b,
|
|
4860
|
+
z as c,
|
|
4861
|
+
oe as d,
|
|
4862
|
+
Ct as e,
|
|
4863
|
+
st as f,
|
|
4763
4864
|
Ve as g,
|
|
4764
|
-
|
|
4865
|
+
ie as h,
|
|
4765
4866
|
He as i,
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4867
|
+
J as j,
|
|
4868
|
+
Gt as k,
|
|
4869
|
+
Bt as l,
|
|
4870
|
+
Ut as m,
|
|
4871
|
+
Et as n,
|
|
4872
|
+
yt as o,
|
|
4873
|
+
G as p,
|
|
4773
4874
|
pt as q,
|
|
4774
4875
|
Ne as r,
|
|
4775
4876
|
dt as s,
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4877
|
+
et as t,
|
|
4878
|
+
Ft as u,
|
|
4879
|
+
rt as v,
|
|
4880
|
+
H as w,
|
|
4780
4881
|
ze as x,
|
|
4781
4882
|
Re as y,
|
|
4782
|
-
|
|
4883
|
+
$t as z
|
|
4783
4884
|
};
|