bank20baht-ui 0.12.1 → 0.12.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/components/primitives/baht-datepicker.js +17 -14
- package/dist/components/primitives/baht-line-chart.d.ts +3 -3
- package/dist/components/primitives/baht-line-chart.js +17 -17
- package/dist/components/primitives/baht-modal.js +4 -4
- package/dist/components/primitives/baht-swipe-row.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/pattern-safety.d.ts +24 -0
- package/dist/core/pattern-safety.js +78 -0
- package/dist/core/validators.js +38 -35
- package/dist/css/components.css +9 -0
- package/dist/custom-elements.json +1 -1
- package/dist/engine.js +41 -39
- package/dist/index.js +184 -182
- package/dist/tokens.css +9 -0
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { html as y } from "lit";
|
|
|
2
2
|
import { customElement as g } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined as D } from "lit/directives/if-defined.js";
|
|
4
4
|
import { BahtFieldBase as w } from "../field-base.js";
|
|
5
|
-
import { formatIsoDateTime as u, formatIsoDate as
|
|
5
|
+
import { formatIsoDateTime as u, formatIsoDate as h, dateModeOf as c, parseIsoDate as l, isoDaysOf as k, parseIsoDateTime as v, parseDisabledEntry as C } from "../../core/dates.js";
|
|
6
6
|
import { t as p } from "../../core/i18n.js";
|
|
7
7
|
import { renderIcon as _ } from "./icons.js";
|
|
8
8
|
var I = Object.getOwnPropertyDescriptor, B = (t, e, a, s) => {
|
|
@@ -12,7 +12,12 @@ var I = Object.getOwnPropertyDescriptor, B = (t, e, a, s) => {
|
|
|
12
12
|
};
|
|
13
13
|
let f, O;
|
|
14
14
|
function x() {
|
|
15
|
-
return O ?? (O = import("flatpickr").then(
|
|
15
|
+
return O ?? (O = import("flatpickr").then(
|
|
16
|
+
(t) => f = t.default,
|
|
17
|
+
(t) => {
|
|
18
|
+
console.warn("[bahtui] <baht-datepicker> needs the `flatpickr` peer dependency", t);
|
|
19
|
+
}
|
|
20
|
+
));
|
|
16
21
|
}
|
|
17
22
|
let m = class extends w {
|
|
18
23
|
constructor() {
|
|
@@ -56,10 +61,8 @@ let m = class extends w {
|
|
|
56
61
|
}
|
|
57
62
|
if (((s = this.fp) == null ? void 0 : s.input) !== e || t.has("field") || t.has("disabled") || t.has("readonly")) {
|
|
58
63
|
if (this.teardown(), !f) {
|
|
59
|
-
this.pendingLoad ?? (this.pendingLoad = x().
|
|
60
|
-
|
|
61
|
-
}).then(() => {
|
|
62
|
-
this.pendingLoad = void 0, this.isConnected && this.requestUpdate();
|
|
64
|
+
this.pendingLoad ?? (this.pendingLoad = x().then((i) => {
|
|
65
|
+
this.pendingLoad = void 0, i && this.isConnected && this.requestUpdate();
|
|
63
66
|
}));
|
|
64
67
|
return;
|
|
65
68
|
}
|
|
@@ -81,11 +84,11 @@ let m = class extends w {
|
|
|
81
84
|
/** Value-equality for the picker's own selection (minute-precise with `enable_time`). */
|
|
82
85
|
sameInstants(t, e) {
|
|
83
86
|
if (t.length !== e.length) return !1;
|
|
84
|
-
const a = this.field.enable_time ? u :
|
|
87
|
+
const a = this.field.enable_time ? u : h;
|
|
85
88
|
return t.every((s, i) => a(s) === a(e[i]));
|
|
86
89
|
}
|
|
87
90
|
options() {
|
|
88
|
-
const t = this.field, e =
|
|
91
|
+
const t = this.field, e = c(t), a = l(t.min), s = l(t.max), i = b(t);
|
|
89
92
|
return {
|
|
90
93
|
static: !0,
|
|
91
94
|
disableMobile: !0,
|
|
@@ -142,7 +145,7 @@ let m = class extends w {
|
|
|
142
145
|
const t = this.fp;
|
|
143
146
|
if (!t || !this.todayAllowed()) return;
|
|
144
147
|
const e = this.field.enable_time ? E(/* @__PURE__ */ new Date()) : o(/* @__PURE__ */ new Date());
|
|
145
|
-
switch (
|
|
148
|
+
switch (c(this.field)) {
|
|
146
149
|
case "range":
|
|
147
150
|
t.setDate([e, e], !0);
|
|
148
151
|
break;
|
|
@@ -164,13 +167,13 @@ let m = class extends w {
|
|
|
164
167
|
* a host may not always have a time to feed back (an edited record that
|
|
165
168
|
* predates this field, for one). */
|
|
166
169
|
datesOf(t) {
|
|
167
|
-
const e = (a) => (this.field.enable_time ?
|
|
170
|
+
const e = (a) => (this.field.enable_time ? v(a) : null) ?? l(a);
|
|
168
171
|
return k(t).map(e).filter((a) => a !== null);
|
|
169
172
|
}
|
|
170
173
|
/** flatpickr's selection -> the value shape of the field's mode. */
|
|
171
174
|
toValue(t) {
|
|
172
|
-
const e = this.field.enable_time ? u :
|
|
173
|
-
switch (
|
|
175
|
+
const e = this.field.enable_time ? u : h, a = t.map(e);
|
|
176
|
+
switch (c(this.field)) {
|
|
174
177
|
case "range":
|
|
175
178
|
return a.length === 2 ? [a[0], a[1]] : null;
|
|
176
179
|
case "multiple":
|
|
@@ -190,7 +193,7 @@ function E(t) {
|
|
|
190
193
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes());
|
|
191
194
|
}
|
|
192
195
|
function F(t, e) {
|
|
193
|
-
return
|
|
196
|
+
return h(t) === h(e);
|
|
194
197
|
}
|
|
195
198
|
function L(t, e) {
|
|
196
199
|
if (t instanceof Date) return F(t, e);
|
|
@@ -204,7 +207,7 @@ function L(t, e) {
|
|
|
204
207
|
function b(t) {
|
|
205
208
|
const e = [];
|
|
206
209
|
for (const s of t.disabled_dates ?? []) {
|
|
207
|
-
const i =
|
|
210
|
+
const i = C(s);
|
|
208
211
|
i && e.push(i[0].getTime() === i[1].getTime() ? i[0] : { from: i[0], to: i[1] });
|
|
209
212
|
}
|
|
210
213
|
const a = t.disabled_weekdays;
|
|
@@ -26,9 +26,9 @@ export declare class BahtLineChart extends BahtChartBase {
|
|
|
26
26
|
/** Accessible summary; falls back to a generated sentence. */
|
|
27
27
|
label: string;
|
|
28
28
|
/**
|
|
29
|
-
* Drawing width in SVG units. It follows the host
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Drawing width in SVG units. It follows the host, so one unit is one CSS
|
|
30
|
+
* pixel and tick text keeps its real size: not shrunk on a phone, not blown
|
|
31
|
+
* up in a wide card (a capped drawing stretched to 1050px set 11px ticks at 18px).
|
|
32
32
|
*/
|
|
33
33
|
private width;
|
|
34
34
|
private resizeObserver;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { html as _, nothing as y, svg as l } from "lit";
|
|
2
|
-
import { property as x, state as
|
|
2
|
+
import { property as x, state as E, customElement as H } from "lit/decorators.js";
|
|
3
3
|
import { hasDom as k, arr as L } from "../base.js";
|
|
4
|
-
import { BahtChartBase as
|
|
5
|
-
var
|
|
6
|
-
for (var d = r > 1 ? void 0 : r ?
|
|
4
|
+
import { BahtChartBase as N, niceTicks as W, linearScale as O, chartColor as g, renderTableTwin as q } from "./charts.js";
|
|
5
|
+
var R = Object.defineProperty, U = Object.getOwnPropertyDescriptor, c = (o, s, $, r) => {
|
|
6
|
+
for (var d = r > 1 ? void 0 : r ? U(s, $) : s, f = o.length - 1, b; f >= 0; f--)
|
|
7
7
|
(b = o[f]) && (d = (r ? b(s, $, d) : b(d)) || d);
|
|
8
|
-
return r && d &&
|
|
8
|
+
return r && d && R(s, $, d), d;
|
|
9
9
|
};
|
|
10
|
-
const
|
|
11
|
-
let h = class extends
|
|
10
|
+
const V = 640, X = 280, A = 260, I = 56, a = { top: 14, right: 72, bottom: 30, left: 60 };
|
|
11
|
+
let h = class extends N {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(...arguments), this.series = [], this.categories = [], this.area = !1, this.markers = [], this.forecast = 0, this.baseline = null, this.labelValues = "ends", this.label = "", this.width =
|
|
13
|
+
super(...arguments), this.series = [], this.categories = [], this.area = !1, this.markers = [], this.forecast = 0, this.baseline = null, this.labelValues = "ends", this.label = "", this.width = V, this.crosshairAt = null;
|
|
14
14
|
}
|
|
15
15
|
connectedCallback() {
|
|
16
16
|
super.connectedCallback(), !(!k() || typeof ResizeObserver > "u") && (this.resizeObserver = new ResizeObserver(() => {
|
|
@@ -31,7 +31,7 @@ let h = class extends W {
|
|
|
31
31
|
if (!k() || !this.isConnected) return;
|
|
32
32
|
const o = this.clientWidth;
|
|
33
33
|
if (o <= 0) return;
|
|
34
|
-
const s = Math.
|
|
34
|
+
const s = Math.max(X, Math.round(o));
|
|
35
35
|
s !== this.width && (this.width = s);
|
|
36
36
|
}
|
|
37
37
|
get plot() {
|
|
@@ -44,20 +44,20 @@ let h = class extends W {
|
|
|
44
44
|
}), { series: s, categories: $ } = o;
|
|
45
45
|
if (s.length === 0)
|
|
46
46
|
return _`<div class=${this.rootClass("baht-line-chart")}>${this.renderEmpty()}</div>`;
|
|
47
|
-
const r = Math.max(...s.map((t) => t.values.length)), d = s.flatMap((t) => t.values).filter((t) => Number.isFinite(t)), f = Math.max(0, ...d, ...this.markers.map((t) => t.value)), b =
|
|
47
|
+
const r = Math.max(...s.map((t) => t.values.length)), d = s.flatMap((t) => t.values).filter((t) => Number.isFinite(t)), f = Math.max(0, ...d, ...this.markers.map((t) => t.value)), b = W(f, 4), T = b[b.length - 1] ?? 1, { w: v, h: F } = this.plot, p = O([0, Math.max(1, r - 1)], [a.left, a.left + v]), i = O([0, T], [a.top + F, a.top]), M = Math.max(0, r - 1 - Math.max(0, this.forecast)), w = (t, e, n) => t.slice(e, n + 1).map((u, m) => `${m === 0 ? "M" : "L"}${p(e + m).toFixed(2)},${i(u).toFixed(2)}`).join(" "), P = s.map((t, e) => ({
|
|
48
48
|
i: e,
|
|
49
49
|
name: t.name,
|
|
50
50
|
value: t.values[t.values.length - 1] ?? 0,
|
|
51
51
|
yPos: i(t.values[t.values.length - 1] ?? 0),
|
|
52
52
|
color: g(e, t.color)
|
|
53
|
-
})), C = [...P].sort((t, e) => t.yPos - e.yPos),
|
|
53
|
+
})), C = [...P].sort((t, e) => t.yPos - e.yPos), z = C.some((t, e) => e > 0 && t.yPos - C[e - 1].yPos < 15), B = this.labelValues === "ends" && !z, j = Math.max(1, Math.ceil(r / Math.max(2, Math.min(8, Math.floor(v / I))))), D = this.label || `Line chart, ${s.length} series over ${r} points. ${s.map((t, e) => `${t.name}: ${this.fmt(P[e].value)} at the end`).join(". ")}`;
|
|
54
54
|
return _`<div class=${this.rootClass("baht-line-chart")}>
|
|
55
55
|
<svg
|
|
56
56
|
class="baht-chart-svg"
|
|
57
57
|
viewBox="0 0 ${this.width} ${A}"
|
|
58
58
|
preserveAspectRatio="xMidYMid meet"
|
|
59
59
|
role="img"
|
|
60
|
-
aria-label=${
|
|
60
|
+
aria-label=${D}
|
|
61
61
|
>
|
|
62
62
|
${b.map(
|
|
63
63
|
(t) => l`
|
|
@@ -91,13 +91,13 @@ let h = class extends W {
|
|
|
91
91
|
cy=${i(t.values[t.values.length - 1] ?? 0).toFixed(2)} r="4" fill=${n}/>`
|
|
92
92
|
), u;
|
|
93
93
|
})}
|
|
94
|
-
${
|
|
94
|
+
${B ? P.map(
|
|
95
95
|
(t) => l`
|
|
96
96
|
<text class="baht-chart-end-label" x=${p(r - 1) + 10} y=${(t.yPos + 4).toFixed(2)}
|
|
97
97
|
text-anchor="start">${this.fmt(t.value)}</text>`
|
|
98
98
|
) : y}
|
|
99
99
|
${$.map(
|
|
100
|
-
(t, e) => e %
|
|
100
|
+
(t, e) => e % j === 0 ? l`<text class="baht-chart-tick" x=${p(e).toFixed(2)} y=${A - 10} text-anchor="middle">${t}</text>` : y
|
|
101
101
|
)}
|
|
102
102
|
${Array.from({ length: r }, (t, e) => {
|
|
103
103
|
const n = v / Math.max(1, r - 1), u = `${$[e] ?? `Point ${e + 1}`}: ${s.map((m) => `${m.name} ${this.fmt(m.values[e] ?? 0)}`).join(", ")}`;
|
|
@@ -125,7 +125,7 @@ let h = class extends W {
|
|
|
125
125
|
s.map((t, e) => ({ label: t.name, color: g(e, t.color) })),
|
|
126
126
|
"line"
|
|
127
127
|
)}
|
|
128
|
-
${this.showTable ?
|
|
128
|
+
${this.showTable ? q(
|
|
129
129
|
this.label || "Line chart data",
|
|
130
130
|
["Point", ...s.map((t) => t.name)],
|
|
131
131
|
Array.from({ length: r }, (t, e) => [
|
|
@@ -167,10 +167,10 @@ c([
|
|
|
167
167
|
x()
|
|
168
168
|
], h.prototype, "label", 2);
|
|
169
169
|
c([
|
|
170
|
-
|
|
170
|
+
E()
|
|
171
171
|
], h.prototype, "width", 2);
|
|
172
172
|
h = c([
|
|
173
|
-
|
|
173
|
+
H("baht-line-chart")
|
|
174
174
|
], h);
|
|
175
175
|
export {
|
|
176
176
|
h as BahtLineChart
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nothing as r, html as h } from "lit";
|
|
2
2
|
import { property as c, query as m, state as f, customElement as b } from "lit/decorators.js";
|
|
3
|
-
import { boolOff as
|
|
3
|
+
import { boolOff as v, BahtElement as y, hasDom as p, adoptLightChildren as u } from "../base.js";
|
|
4
4
|
import { afterExit as g } from "../motion.js";
|
|
5
5
|
import { t as $ } from "../../core/i18n.js";
|
|
6
6
|
import { renderIllustration as k } from "./illustrations.js";
|
|
@@ -13,10 +13,10 @@ const E = {
|
|
|
13
13
|
fromAttribute: (t) => t !== null && t !== "false",
|
|
14
14
|
toAttribute: (t) => t ? "" : null
|
|
15
15
|
};
|
|
16
|
-
let s = class extends
|
|
16
|
+
let s = class extends y {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments), this.open = !1, this.heading = "", this.description = "", this.showClose = !0, this.placement = "center", this.closeOnScrim = !1, this.closing = !1, this.closeToken = 0, this.previousFocus = null, this.onKeydown = (t) => {
|
|
19
|
-
!this.open || s.openStack.at(-1) !== this || (t.key === "Escape" ? this.requestClose("escape") : t.key === "Tab" && this.trapFocus(t));
|
|
19
|
+
!this.open || s.openStack.at(-1) !== this || (t.key === "Escape" ? t.defaultPrevented || this.requestClose("escape") : t.key === "Tab" && this.trapFocus(t));
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
get titleId() {
|
|
@@ -126,7 +126,7 @@ l([
|
|
|
126
126
|
c()
|
|
127
127
|
], s.prototype, "description", 2);
|
|
128
128
|
l([
|
|
129
|
-
c({ attribute: "show-close", converter:
|
|
129
|
+
c({ attribute: "show-close", converter: v })
|
|
130
130
|
], s.prototype, "showClose", 2);
|
|
131
131
|
l([
|
|
132
132
|
c()
|
|
@@ -31,7 +31,7 @@ let a = class extends g {
|
|
|
31
31
|
return c() ? ((t = this.querySelector(".baht-swipe-row-actions")) == null ? void 0 : t.offsetWidth) ?? 0 : 0;
|
|
32
32
|
}
|
|
33
33
|
onPointerdown(t) {
|
|
34
|
-
!this.hasActions || t.button !== 0 || (this.start = {
|
|
34
|
+
!this.hasActions || t.button !== 0 || (this.swallowClick = !1, this.start = {
|
|
35
35
|
id: t.pointerId,
|
|
36
36
|
x: t.clientX,
|
|
37
37
|
y: t.clientY,
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './types.js';
|
|
|
2
2
|
export { defaultValue } from './defaults.js';
|
|
3
3
|
export { approvalFields } from './approval.js';
|
|
4
4
|
export { validateField, normalizeTagsValue } from './validators.js';
|
|
5
|
+
export { isUnsafePattern } from './pattern-safety.js';
|
|
5
6
|
export { resolveViewFields } from './views.js';
|
|
6
7
|
export { applyFlags, flagEnabled } from './flags.js';
|
|
7
8
|
export { getCatalog, setCatalog, setLocale, t } from './i18n.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReDoS guard for `pattern` validators (CLAUDE.md engine invariant: patterns
|
|
3
|
+
* nesting unbounded quantifiers are rejected). A small tokenizer turns the
|
|
4
|
+
* source into groups/alternatives/quantified items, then flags any group
|
|
5
|
+
* repeated more than twice whose body can be split between iterations in
|
|
6
|
+
* more than one way — the shape that makes a backtracking engine go
|
|
7
|
+
* exponential (or high-degree polynomial for a large bounded repeat):
|
|
8
|
+
*
|
|
9
|
+
* - every mandatory item of an alternative is itself unbounded:
|
|
10
|
+
* `(a+)+`, `((a+))+`, `(?<n>a+)+`, `(\w+\s?)+`, `(x+x+)+`, `(a*)*`
|
|
11
|
+
* - one alternative is unbounded on its own: `(a+|b)+`
|
|
12
|
+
* - two alternatives are spelled the same: `(a|a)+`
|
|
13
|
+
*
|
|
14
|
+
* A mandatory bounded atom (`(-[a-z]+)*`, `(abc+)+`) anchors each iteration
|
|
15
|
+
* and is accepted. Overlap between *different* alternatives (`(a|ab)+`) is
|
|
16
|
+
* not detected; patterns are builder-authored, so the goal is catching the
|
|
17
|
+
* classic authoring mistakes at save time and before the client compiles.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* True when `source` backtracks catastrophically on hostile input (see module
|
|
21
|
+
* doc). Sources that do not compile return false — callers report those as
|
|
22
|
+
* invalid separately.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isUnsafePattern(source: string): boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
class o {
|
|
2
|
+
constructor(s) {
|
|
3
|
+
this.src = s, this.i = 0;
|
|
4
|
+
}
|
|
5
|
+
parseAlts() {
|
|
6
|
+
const s = [];
|
|
7
|
+
let e = this.i, i = [];
|
|
8
|
+
for (; this.i < this.src.length && this.src[this.i] !== ")"; ) {
|
|
9
|
+
if (this.src[this.i] === "|") {
|
|
10
|
+
s.push({ items: i, source: this.src.slice(e, this.i) }), this.i++, e = this.i, i = [];
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
i.push(this.quantify(this.atom()));
|
|
14
|
+
}
|
|
15
|
+
return s.push({ items: i, source: this.src.slice(e, this.i) }), s;
|
|
16
|
+
}
|
|
17
|
+
atom() {
|
|
18
|
+
const s = this.src[this.i++];
|
|
19
|
+
if (s === "\\") {
|
|
20
|
+
const e = this.src[this.i++];
|
|
21
|
+
return { min: 1, max: 1, zeroWidth: e === "b" || e === "B" };
|
|
22
|
+
}
|
|
23
|
+
return s === "[" ? (this.skipClass(), { min: 1, max: 1, zeroWidth: !1 }) : s === "(" ? this.group() : { min: 1, max: 1, zeroWidth: s === "^" || s === "$" };
|
|
24
|
+
}
|
|
25
|
+
skipClass() {
|
|
26
|
+
for (this.src[this.i] === "^" && this.i++, this.src[this.i] === "]" && this.i++; this.i < this.src.length && this.src[this.i] !== "]"; )
|
|
27
|
+
this.i += this.src[this.i] === "\\" ? 2 : 1;
|
|
28
|
+
this.i++;
|
|
29
|
+
}
|
|
30
|
+
group() {
|
|
31
|
+
let s = !1;
|
|
32
|
+
if (this.src[this.i] === "?") {
|
|
33
|
+
const i = this.src.slice(this.i + 1);
|
|
34
|
+
/^(?:[=!]|<[=!])/.test(i) ? (s = !0, this.i += i.startsWith("<") ? 3 : 2) : i.startsWith(":") ? this.i += 2 : i.startsWith("<") && (this.i = this.src.indexOf(">", this.i) + 1);
|
|
35
|
+
}
|
|
36
|
+
const e = this.parseAlts();
|
|
37
|
+
return this.i++, { min: 1, max: 1, zeroWidth: s, alts: e };
|
|
38
|
+
}
|
|
39
|
+
quantify(s) {
|
|
40
|
+
const e = this.src[this.i];
|
|
41
|
+
let i;
|
|
42
|
+
if (e === "*" ? i = [0, 1 / 0] : e === "+" ? i = [1, 1 / 0] : e === "?" && (i = [0, 1]), i)
|
|
43
|
+
this.i++;
|
|
44
|
+
else {
|
|
45
|
+
const r = /^\{(\d+)(,(\d*))?\}/.exec(this.src.slice(this.i));
|
|
46
|
+
if (!r) return s;
|
|
47
|
+
this.i += r[0].length;
|
|
48
|
+
const h = Number(r[1]);
|
|
49
|
+
i = [h, r[2] === void 0 ? h : r[3] === "" ? 1 / 0 : Number(r[3])];
|
|
50
|
+
}
|
|
51
|
+
return this.src[this.i] === "?" && this.i++, { ...s, min: s.min * i[0], max: s.max * i[1] };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function n(t) {
|
|
55
|
+
var s;
|
|
56
|
+
return t.zeroWidth ? !1 : t.max === 1 / 0 ? !0 : ((s = t.alts) == null ? void 0 : s.some(c)) ?? !1;
|
|
57
|
+
}
|
|
58
|
+
function c(t) {
|
|
59
|
+
const s = t.items.filter((i) => !i.zeroWidth), e = s.filter((i) => i.min > 0);
|
|
60
|
+
return e.length === 0 ? s.some(n) : e.every(n);
|
|
61
|
+
}
|
|
62
|
+
function l(t) {
|
|
63
|
+
return new Set(t.map((s) => s.source)).size < t.length;
|
|
64
|
+
}
|
|
65
|
+
function a(t) {
|
|
66
|
+
return t.alts ? t.max > 2 && (t.alts.some(c) || l(t.alts)) ? !0 : t.alts.some((s) => s.items.some(a)) : !1;
|
|
67
|
+
}
|
|
68
|
+
function u(t) {
|
|
69
|
+
try {
|
|
70
|
+
new RegExp(t);
|
|
71
|
+
} catch {
|
|
72
|
+
return !1;
|
|
73
|
+
}
|
|
74
|
+
return new o(t).parseAlts().some((i) => i.items.some(a));
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
u as isUnsafePattern
|
|
78
|
+
};
|
package/dist/core/validators.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defaultValue as
|
|
1
|
+
import { defaultValue as x } from "./defaults.js";
|
|
2
2
|
import { compareValues as k } from "./engine/conditions.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isUnsafePattern as _ } from "./pattern-safety.js";
|
|
4
|
+
import { isoDaysOf as L, dateModeOf as b, rangeInteriorDays as A, isDateDisabled as d } from "./dates.js";
|
|
4
5
|
import { t as u } from "./i18n.js";
|
|
5
6
|
const E = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
6
7
|
function y(e) {
|
|
@@ -10,8 +11,8 @@ function C(e) {
|
|
|
10
11
|
const t = [...e.validators ?? []], n = (o) => t.some((r) => r.type === o);
|
|
11
12
|
return e.required && !n("required") && t.push({ type: "required" }), e.max_length !== void 0 && !n("maxLength") && t.push({ type: "maxLength", value: e.max_length }), e.min_length !== void 0 && !n("minLength") && t.push({ type: "minLength", value: e.min_length }), e.min !== void 0 && !n("min") && t.push({ type: "min", value: e.min }), e.max !== void 0 && !n("max") && t.push({ type: "max", value: e.max }), e.type === "email" && !n("email") && t.push({ type: "email" }), t;
|
|
12
13
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
14
|
+
const $ = (e) => Array.isArray(e) ? e : [e];
|
|
15
|
+
function f(e, t) {
|
|
15
16
|
return (n, o) => {
|
|
16
17
|
const r = Number(n.value);
|
|
17
18
|
return Number.isNaN(r) ? (console.warn(
|
|
@@ -19,33 +20,33 @@ function l(e, t) {
|
|
|
19
20
|
), null) : typeof o != "string" ? null : (e === "minLength" ? o.length < r : o.length > r) ? n.message ?? u(e, { n: n.value }) : null;
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return (t, n) =>
|
|
23
|
+
function h(e) {
|
|
24
|
+
return (t, n) => $(n).some((r) => {
|
|
24
25
|
const s = k(r, t.value);
|
|
25
26
|
return s !== null && (e === "min" ? s < 0 : s > 0);
|
|
26
27
|
}) ? t.message ?? u(e, { n: t.value }) : null;
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
+
const q = {
|
|
29
30
|
eq: (e) => e === 0,
|
|
30
31
|
ne: (e) => e !== 0,
|
|
31
32
|
gt: (e) => e > 0,
|
|
32
33
|
gte: (e) => e >= 0,
|
|
33
34
|
lt: (e) => e < 0,
|
|
34
35
|
lte: (e) => e <= 0
|
|
35
|
-
},
|
|
36
|
+
}, O = (e, t, n, o) => {
|
|
36
37
|
const r = o == null ? void 0 : o[e.field ?? ""];
|
|
37
38
|
if (r === void 0 || y(r)) return null;
|
|
38
39
|
const s = k(t, r);
|
|
39
40
|
if (s === null) return null;
|
|
40
41
|
const i = e.op ?? "eq";
|
|
41
|
-
if (
|
|
42
|
+
if (q[i](s)) return null;
|
|
42
43
|
const a = `compare${i[0].toUpperCase()}${i.slice(1)}`;
|
|
43
44
|
return e.message ?? u(a, { other: e.field });
|
|
44
45
|
}, R = (e, t) => {
|
|
45
46
|
if (typeof t != "string") return null;
|
|
46
|
-
const n =
|
|
47
|
+
const n = M(String(e.value));
|
|
47
48
|
return n ? n.test(t) ? null : e.message ?? u("pattern") : null;
|
|
48
|
-
},
|
|
49
|
+
}, N = (e, t, n) => {
|
|
49
50
|
var s;
|
|
50
51
|
const o = (s = n == null ? void 0 : n.validators) == null ? void 0 : s[e.fn ?? ""];
|
|
51
52
|
if (!o)
|
|
@@ -54,20 +55,20 @@ const $ = {
|
|
|
54
55
|
return r === null ? null : e.message ?? r;
|
|
55
56
|
}, v = {
|
|
56
57
|
required: (e, t) => y(t) ? e.message ?? u("required") : null,
|
|
57
|
-
minLength:
|
|
58
|
-
maxLength:
|
|
59
|
-
min:
|
|
60
|
-
max:
|
|
58
|
+
minLength: f("minLength", "min_length"),
|
|
59
|
+
maxLength: f("maxLength", "max_length"),
|
|
60
|
+
min: h("min"),
|
|
61
|
+
max: h("max"),
|
|
61
62
|
pattern: R,
|
|
62
63
|
email: (e, t) => typeof t == "string" && !E.test(t) ? e.message ?? u("email") : null,
|
|
63
|
-
compare:
|
|
64
|
-
custom:
|
|
64
|
+
compare: O,
|
|
65
|
+
custom: N
|
|
65
66
|
};
|
|
66
|
-
function
|
|
67
|
+
function D(e, t, n, o) {
|
|
67
68
|
return v[e.type](e, t, n, o);
|
|
68
69
|
}
|
|
69
70
|
const g = /* @__PURE__ */ new Map();
|
|
70
|
-
function
|
|
71
|
+
function M(e) {
|
|
71
72
|
let t = g.get(e);
|
|
72
73
|
if (t === void 0) {
|
|
73
74
|
try {
|
|
@@ -75,11 +76,13 @@ function D(e) {
|
|
|
75
76
|
} catch {
|
|
76
77
|
console.warn(`[bahtui] invalid pattern ${JSON.stringify(e)} — skipped`), t = null;
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
+
t && _(e) && (console.warn(
|
|
80
|
+
`[bahtui] unsafe pattern ${JSON.stringify(e)} (nested unbounded quantifiers) — skipped`
|
|
81
|
+
), t = null), g.set(e, t);
|
|
79
82
|
}
|
|
80
83
|
return t;
|
|
81
84
|
}
|
|
82
|
-
function
|
|
85
|
+
function P(e, t) {
|
|
83
86
|
if (!Array.isArray(e)) return [];
|
|
84
87
|
const n = T(t), o = /* @__PURE__ */ new Set(), r = [];
|
|
85
88
|
for (const s of e) {
|
|
@@ -106,19 +109,19 @@ function V(e, t) {
|
|
|
106
109
|
return t.some((r) => r.length > o) && n.push({ key: e.key, message: u("tagTooLong", { n: o }) }), n;
|
|
107
110
|
}
|
|
108
111
|
function z(e, t, n, o, r) {
|
|
109
|
-
const s = [], i = e.type === "tags" ?
|
|
112
|
+
const s = [], i = e.type === "tags" ? P(t) : t, a = C(e), c = y(i);
|
|
110
113
|
for (const m of a) {
|
|
111
114
|
if (m.type !== "required" && c) continue;
|
|
112
|
-
const p =
|
|
115
|
+
const p = D(m, i, n, o);
|
|
113
116
|
p !== null && s.push({ key: e.key, message: p });
|
|
114
117
|
}
|
|
115
|
-
return e.type === "repeater" && s.push(...
|
|
118
|
+
return e.type === "repeater" && s.push(...J(e, i, n, r)), e.type === "file" && s.push(...I(e, i)), e.type === "date" && !c && s.push(...S(e, i)), e.type === "tags" && s.push(...V(e, i)), s;
|
|
116
119
|
}
|
|
117
|
-
function
|
|
120
|
+
function S(e, t) {
|
|
118
121
|
var o, r;
|
|
119
122
|
if (!((o = e.disabled_dates) != null && o.length) && !((r = e.disabled_weekdays) != null && r.length)) return [];
|
|
120
|
-
const n =
|
|
121
|
-
return
|
|
123
|
+
const n = L(t);
|
|
124
|
+
return b(e) === "range" && n.length === 2 && n.push(...A(n[0], n[1])), n.some((s) => d(e, s)) ? [{ key: e.key, message: u("dateDisabled") }] : [];
|
|
122
125
|
}
|
|
123
126
|
function W(e) {
|
|
124
127
|
return e !== null && typeof e == "object" && typeof e.url == "string" && typeof e.size == "number" && typeof e.name == "string";
|
|
@@ -135,7 +138,7 @@ function I(e, t) {
|
|
|
135
138
|
e.max_size !== void 0 && r.size > e.max_size && o.push({ key: e.key, message: u("fileTooLarge") }), e.accept && !j(e.accept, r.name, r.type ?? "") && o.push({ key: e.key, message: u("fileTypeNotAllowed") });
|
|
136
139
|
return o;
|
|
137
140
|
}
|
|
138
|
-
function
|
|
141
|
+
function J(e, t, n, o) {
|
|
139
142
|
if (t != null && !Array.isArray(t))
|
|
140
143
|
return [{ key: e.key, message: u("pattern") }];
|
|
141
144
|
const r = Array.isArray(t) ? t : [], s = [];
|
|
@@ -149,25 +152,25 @@ function S(e, t, n, o) {
|
|
|
149
152
|
}
|
|
150
153
|
const i = [...e.fields ?? []].sort((a, c) => a.order - c.order).filter((a) => a.type !== "label" && a.type !== "section" && a.type !== "repeater");
|
|
151
154
|
return r.forEach((a, c) => {
|
|
152
|
-
s.push(...
|
|
155
|
+
s.push(...U(e, i, a, c, n, o));
|
|
153
156
|
}), s;
|
|
154
157
|
}
|
|
155
|
-
function
|
|
158
|
+
function U(e, t, n, o, r, s) {
|
|
156
159
|
const i = n !== null && typeof n == "object" && !Array.isArray(n) ? n : {}, a = {};
|
|
157
160
|
for (const m of t)
|
|
158
|
-
a[m.key] = Object.hasOwn(i, m.key) ? i[m.key] :
|
|
161
|
+
a[m.key] = Object.hasOwn(i, m.key) ? i[m.key] : x(m);
|
|
159
162
|
const c = [];
|
|
160
163
|
for (const m of t) {
|
|
161
164
|
const p = s == null ? void 0 : s[`${e.key}[${o}].${m.key}`];
|
|
162
165
|
if (p && !p.visible) continue;
|
|
163
|
-
const
|
|
164
|
-
for (const
|
|
165
|
-
c.push({ key: `${e.key}[${o}].${
|
|
166
|
+
const w = p && p.required !== !!m.required ? { ...m, required: p.required } : m;
|
|
167
|
+
for (const l of z(w, a[m.key], r, a))
|
|
168
|
+
c.push({ key: `${e.key}[${o}].${l.key}`, message: l.message });
|
|
166
169
|
}
|
|
167
170
|
return c;
|
|
168
171
|
}
|
|
169
172
|
export {
|
|
170
|
-
|
|
173
|
+
P as normalizeTagsValue,
|
|
171
174
|
T as optionKeyLookup,
|
|
172
175
|
z as validateField
|
|
173
176
|
};
|
package/dist/css/components.css
CHANGED
|
@@ -29,6 +29,15 @@
|
|
|
29
29
|
.baht-field--w-full {
|
|
30
30
|
flex-basis: 100%;
|
|
31
31
|
}
|
|
32
|
+
/* Phone: a half- or quarter-width field is too narrow to read (a datepicker
|
|
33
|
+
cut "19:02" to "19:0"), so every field takes the whole row. */
|
|
34
|
+
@media (max-width: 480px) {
|
|
35
|
+
.baht-field--w-1-4,
|
|
36
|
+
.baht-field--w-1-2,
|
|
37
|
+
.baht-field--w-3-4 {
|
|
38
|
+
flex-basis: 100%;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
32
41
|
.baht-field--hidden {
|
|
33
42
|
display: none;
|
|
34
43
|
}
|
|
@@ -10143,7 +10143,7 @@
|
|
|
10143
10143
|
"name": "width",
|
|
10144
10144
|
"privacy": "private",
|
|
10145
10145
|
"default": "640",
|
|
10146
|
-
"description": "Drawing width in SVG units. It follows the host
|
|
10146
|
+
"description": "Drawing width in SVG units. It follows the host, so one unit is one CSS\npixel and tick text keeps its real size: not shrunk on a phone, not blown\nup in a wide card (a capped drawing stretched to 1050px set 11px ticks at 18px).",
|
|
10147
10147
|
"type": {
|
|
10148
10148
|
"text": "number"
|
|
10149
10149
|
}
|
package/dist/engine.js
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
import { defaultValue as r } from "./core/defaults.js";
|
|
2
2
|
import { approvalFields as t } from "./core/approval.js";
|
|
3
3
|
import { normalizeTagsValue as p, validateField as s } from "./core/validators.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
4
|
+
import { isUnsafePattern as m } from "./core/pattern-safety.js";
|
|
5
|
+
import { resolveViewFields as x } from "./core/views.js";
|
|
6
|
+
import { applyFlags as n, flagEnabled as c } from "./core/flags.js";
|
|
7
|
+
import { getCatalog as g, setCatalog as u, setLocale as v, t as C } from "./core/i18n.js";
|
|
8
|
+
import { evaluate as R } from "./core/engine/evaluate.js";
|
|
9
|
+
import { resolveNext as P, walkPath as S } from "./core/engine/graph.js";
|
|
10
|
+
import { conditionRowRefs as V, evalCondition as w, parseRowRef as y, readRef as F } from "./core/engine/conditions.js";
|
|
11
|
+
import { evalValueExpr as b } from "./core/engine/expressions.js";
|
|
12
|
+
import { MAX_SCRIPT_DEPTH as A, createScriptContext as L, hasScripts as z, runScripts as M } from "./core/engine/scripts.js";
|
|
13
|
+
import { displayValue as k } from "./core/display.js";
|
|
14
|
+
import { LEGACY_KEY_MAP as H, normalizeLegacySchema as K } from "./core/legacy.js";
|
|
15
|
+
import { formatIsoDate as U, formatIsoDateTime as X, isDateDisabled as j, parseDisabledEntry as q, parseIsoDate as B, parseIsoDateTime as J } from "./core/dates.js";
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
H as LEGACY_KEY_MAP,
|
|
18
|
+
A as MAX_SCRIPT_DEPTH,
|
|
19
|
+
n as applyFlags,
|
|
19
20
|
t as approvalFields,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
V as conditionRowRefs,
|
|
22
|
+
L as createScriptContext,
|
|
22
23
|
r as defaultValue,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
k as displayValue,
|
|
25
|
+
w as evalCondition,
|
|
26
|
+
b as evalValueExpr,
|
|
27
|
+
R as evaluate,
|
|
28
|
+
c as flagEnabled,
|
|
29
|
+
U as formatIsoDate,
|
|
30
|
+
X as formatIsoDateTime,
|
|
31
|
+
g as getCatalog,
|
|
32
|
+
z as hasScripts,
|
|
33
|
+
j as isDateDisabled,
|
|
34
|
+
m as isUnsafePattern,
|
|
35
|
+
K as normalizeLegacySchema,
|
|
34
36
|
p as normalizeTagsValue,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
q as parseDisabledEntry,
|
|
38
|
+
B as parseIsoDate,
|
|
39
|
+
J as parseIsoDateTime,
|
|
40
|
+
y as parseRowRef,
|
|
41
|
+
F as readRef,
|
|
42
|
+
P as resolveNext,
|
|
43
|
+
x as resolveViewFields,
|
|
44
|
+
M as runScripts,
|
|
45
|
+
u as setCatalog,
|
|
46
|
+
v as setLocale,
|
|
47
|
+
C as t,
|
|
46
48
|
s as validateField,
|
|
47
|
-
|
|
49
|
+
S as walkPath
|
|
48
50
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,191 +1,193 @@
|
|
|
1
1
|
import { defaultValue as o } from "./core/defaults.js";
|
|
2
2
|
import { approvalFields as a } from "./core/approval.js";
|
|
3
3
|
import { normalizeTagsValue as m, validateField as f } from "./core/validators.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
4
|
+
import { isUnsafePattern as h } from "./core/pattern-safety.js";
|
|
5
|
+
import { resolveViewFields as l } from "./core/views.js";
|
|
6
|
+
import { applyFlags as s, flagEnabled as n } from "./core/flags.js";
|
|
7
|
+
import { getCatalog as c, setCatalog as S, setLocale as T, t as g } from "./core/i18n.js";
|
|
8
|
+
import { evaluate as C } from "./core/engine/evaluate.js";
|
|
9
|
+
import { resolveNext as D, walkPath as E } from "./core/engine/graph.js";
|
|
10
|
+
import { conditionRowRefs as v, evalCondition as F, parseRowRef as I, readRef as P } from "./core/engine/conditions.js";
|
|
11
|
+
import { evalValueExpr as b } from "./core/engine/expressions.js";
|
|
12
|
+
import { MAX_SCRIPT_DEPTH as A, createScriptContext as L, hasScripts as _, runScripts as M } from "./core/engine/scripts.js";
|
|
13
|
+
import { displayValue as N } from "./core/display.js";
|
|
14
|
+
import { LEGACY_KEY_MAP as H, normalizeLegacySchema as Y } from "./core/legacy.js";
|
|
15
|
+
import { formatIsoDate as G, formatIsoDateTime as K, isDateDisabled as U, parseDisabledEntry as q, parseIsoDate as W, parseIsoDateTime as X } from "./core/dates.js";
|
|
16
|
+
import { BahtButton as J } from "./components/primitives/baht-button.js";
|
|
17
|
+
import { isIconName as Z, renderIcon as $ } from "./components/primitives/icons.js";
|
|
18
|
+
import { BahtBadge as tr } from "./components/primitives/baht-badge.js";
|
|
19
|
+
import { BahtAvatar as er } from "./components/primitives/baht-avatar.js";
|
|
20
|
+
import { BahtCode as pr } from "./components/primitives/baht-code.js";
|
|
21
|
+
import { BahtTable as fr } from "./components/primitives/baht-table.js";
|
|
22
|
+
import { BahtList as hr } from "./components/primitives/baht-list.js";
|
|
23
|
+
import { BahtPagination as lr } from "./components/primitives/baht-pagination.js";
|
|
24
|
+
import { BahtModal as sr } from "./components/primitives/baht-modal.js";
|
|
25
|
+
import { BahtToast as dr } from "./components/primitives/baht-toast.js";
|
|
26
|
+
import { BahtTooltip as Sr } from "./components/primitives/baht-tooltip.js";
|
|
27
|
+
import { BahtAlert as gr } from "./components/primitives/baht-alert.js";
|
|
28
|
+
import { BahtRating as Cr } from "./components/primitives/baht-rating.js";
|
|
29
|
+
import { BahtRange as Dr } from "./components/primitives/baht-range.js";
|
|
30
|
+
import { BahtOtp as kr } from "./components/primitives/baht-otp.js";
|
|
31
|
+
import { BahtFilter as Fr } from "./components/primitives/baht-filter.js";
|
|
32
|
+
import { BahtSwipeRow as Pr } from "./components/primitives/baht-swipe-row.js";
|
|
33
|
+
import { BahtSkeleton as br } from "./components/primitives/baht-skeleton.js";
|
|
34
|
+
import { BahtProgress as Ar } from "./components/primitives/baht-progress.js";
|
|
35
|
+
import { BahtProgressRing as _r } from "./components/primitives/baht-progress-ring.js";
|
|
36
|
+
import { BahtSpinner as Vr } from "./components/primitives/baht-spinner.js";
|
|
37
|
+
import { BahtLoadingOverlay as Or } from "./components/primitives/baht-loading-overlay.js";
|
|
38
|
+
import { BahtCard as Yr } from "./components/primitives/baht-card.js";
|
|
39
|
+
import { BahtFieldset as Gr } from "./components/primitives/baht-fieldset.js";
|
|
40
|
+
import { BahtTimeline as Ur } from "./components/primitives/baht-timeline.js";
|
|
41
|
+
import { BahtAccordion as Wr } from "./components/primitives/baht-accordion.js";
|
|
42
|
+
import { BahtLink as jr } from "./components/primitives/baht-link.js";
|
|
43
|
+
import { BahtBreadcrumbs as Qr } from "./components/primitives/baht-breadcrumbs.js";
|
|
44
|
+
import { BahtInput as $r } from "./components/primitives/baht-input.js";
|
|
45
|
+
import { BahtTextarea as tt } from "./components/primitives/baht-textarea.js";
|
|
46
|
+
import { BahtNumber as et } from "./components/primitives/baht-number.js";
|
|
47
|
+
import { BahtCurrency as pt } from "./components/primitives/baht-currency.js";
|
|
48
|
+
import { BahtSelect as ft } from "./components/primitives/baht-select.js";
|
|
49
|
+
import { BahtMultiselect as ht } from "./components/primitives/baht-multiselect.js";
|
|
50
|
+
import { BahtTags as lt } from "./components/primitives/baht-tags.js";
|
|
51
|
+
import { BahtCheckbox as st } from "./components/primitives/baht-checkbox.js";
|
|
52
|
+
import { BahtRadio as dt } from "./components/primitives/baht-radio.js";
|
|
53
|
+
import { BahtToggle as St } from "./components/primitives/baht-toggle.js";
|
|
54
|
+
import { BahtDatepicker as gt } from "./components/primitives/baht-datepicker.js";
|
|
55
|
+
import { BahtFile as Ct } from "./components/primitives/baht-file.js";
|
|
56
|
+
import { BahtUpload as Dt } from "./components/primitives/baht-upload.js";
|
|
57
|
+
import { BahtText as kt } from "./components/primitives/baht-text.js";
|
|
58
|
+
import { BahtSection as Ft } from "./components/primitives/baht-section.js";
|
|
59
|
+
import { BahtStatChart as Pt } from "./components/primitives/baht-stat-chart.js";
|
|
60
|
+
import { BahtStat as bt } from "./components/primitives/baht-stat.js";
|
|
61
|
+
import { BahtSparkline as At } from "./components/primitives/baht-sparkline.js";
|
|
62
|
+
import { BahtDonutChart as _t } from "./components/primitives/baht-donut-chart.js";
|
|
63
|
+
import { BahtBarChart as Vt } from "./components/primitives/baht-bar-chart.js";
|
|
64
|
+
import { BahtLineChart as Ot } from "./components/primitives/baht-line-chart.js";
|
|
65
|
+
import { BahtHeatmap as Yt } from "./components/primitives/baht-heatmap.js";
|
|
66
|
+
import { BahtMeter as Gt } from "./components/primitives/baht-meter.js";
|
|
67
|
+
import { BahtChartBase as Ut, chartColor as qt, chartSeqColor as Wt, foldOther as Xt, formatValue as jt, linearScale as Jt, niceTicks as Qt, renderTableTwin as Zt } from "./components/primitives/charts.js";
|
|
68
|
+
import { BahtEmptyState as ro } from "./components/primitives/baht-empty-state.js";
|
|
69
|
+
import { BahtErrorState as oo } from "./components/primitives/baht-error-state.js";
|
|
70
|
+
import { BahtKeyvalueEditor as ao } from "./components/primitives/baht-keyvalue-editor.js";
|
|
71
|
+
import { BahtReferencePicker as mo } from "./components/primitives/baht-reference-picker.js";
|
|
72
|
+
import { BahtTypeahead as xo } from "./components/primitives/baht-typeahead.js";
|
|
73
|
+
import { BahtRepeater as Bo } from "./components/primitives/baht-repeater.js";
|
|
74
|
+
import { BahtSteps as io } from "./components/primitives/baht-steps.js";
|
|
75
|
+
import { TAG_FOR_TYPE as no } from "./components/primitives/tag-map.js";
|
|
76
|
+
import { isIllustrationName as So, renderIllustration as To } from "./components/primitives/illustrations.js";
|
|
77
|
+
import { BahtFieldBase as uo } from "./components/field-base.js";
|
|
78
|
+
import { BahtElement as Ro, SSR_STASH as Do, adoptLightChildren as Eo, hasDom as ko, hasSsrMarkup as vo } from "./components/base.js";
|
|
79
|
+
import { BahtForm as Io } from "./components/baht-form.js";
|
|
80
|
+
import { BahtWorkflow as yo } from "./components/baht-workflow.js";
|
|
80
81
|
export {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
82
|
+
Wr as BahtAccordion,
|
|
83
|
+
gr as BahtAlert,
|
|
84
|
+
er as BahtAvatar,
|
|
85
|
+
tr as BahtBadge,
|
|
86
|
+
Vt as BahtBarChart,
|
|
87
|
+
Qr as BahtBreadcrumbs,
|
|
88
|
+
J as BahtButton,
|
|
89
|
+
Yr as BahtCard,
|
|
90
|
+
Ut as BahtChartBase,
|
|
91
|
+
st as BahtCheckbox,
|
|
92
|
+
pr as BahtCode,
|
|
93
|
+
pt as BahtCurrency,
|
|
94
|
+
gt as BahtDatepicker,
|
|
95
|
+
_t as BahtDonutChart,
|
|
96
|
+
Ro as BahtElement,
|
|
97
|
+
ro as BahtEmptyState,
|
|
98
|
+
oo as BahtErrorState,
|
|
99
|
+
uo as BahtFieldBase,
|
|
100
|
+
Gr as BahtFieldset,
|
|
101
|
+
Ct as BahtFile,
|
|
102
|
+
Fr as BahtFilter,
|
|
103
|
+
Io as BahtForm,
|
|
104
|
+
Yt as BahtHeatmap,
|
|
105
|
+
$r as BahtInput,
|
|
106
|
+
ao as BahtKeyvalueEditor,
|
|
107
|
+
Ot as BahtLineChart,
|
|
108
|
+
jr as BahtLink,
|
|
109
|
+
hr as BahtList,
|
|
110
|
+
Or as BahtLoadingOverlay,
|
|
111
|
+
Gt as BahtMeter,
|
|
112
|
+
sr as BahtModal,
|
|
113
|
+
ht as BahtMultiselect,
|
|
114
|
+
et as BahtNumber,
|
|
115
|
+
kr as BahtOtp,
|
|
116
|
+
lr as BahtPagination,
|
|
117
|
+
Ar as BahtProgress,
|
|
118
|
+
_r as BahtProgressRing,
|
|
119
|
+
dt as BahtRadio,
|
|
120
|
+
Dr as BahtRange,
|
|
121
|
+
Cr as BahtRating,
|
|
122
|
+
mo as BahtReferencePicker,
|
|
123
|
+
Bo as BahtRepeater,
|
|
124
|
+
Ft as BahtSection,
|
|
125
|
+
ft as BahtSelect,
|
|
126
|
+
br as BahtSkeleton,
|
|
127
|
+
At as BahtSparkline,
|
|
128
|
+
Vr as BahtSpinner,
|
|
129
|
+
bt as BahtStat,
|
|
130
|
+
Pt as BahtStatChart,
|
|
131
|
+
io as BahtSteps,
|
|
132
|
+
Pr as BahtSwipeRow,
|
|
133
|
+
fr as BahtTable,
|
|
134
|
+
lt as BahtTags,
|
|
135
|
+
kt as BahtText,
|
|
136
|
+
tt as BahtTextarea,
|
|
137
|
+
Ur as BahtTimeline,
|
|
138
|
+
dr as BahtToast,
|
|
139
|
+
St as BahtToggle,
|
|
140
|
+
Sr as BahtTooltip,
|
|
141
|
+
xo as BahtTypeahead,
|
|
142
|
+
Dt as BahtUpload,
|
|
143
|
+
yo as BahtWorkflow,
|
|
144
|
+
H as LEGACY_KEY_MAP,
|
|
145
|
+
A as MAX_SCRIPT_DEPTH,
|
|
146
|
+
Do as SSR_STASH,
|
|
147
|
+
no as TAG_FOR_TYPE,
|
|
148
|
+
Eo as adoptLightChildren,
|
|
149
|
+
s as applyFlags,
|
|
149
150
|
a as approvalFields,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
qt as chartColor,
|
|
152
|
+
Wt as chartSeqColor,
|
|
153
|
+
v as conditionRowRefs,
|
|
154
|
+
L as createScriptContext,
|
|
154
155
|
o as defaultValue,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
156
|
+
N as displayValue,
|
|
157
|
+
F as evalCondition,
|
|
158
|
+
b as evalValueExpr,
|
|
159
|
+
C as evaluate,
|
|
160
|
+
n as flagEnabled,
|
|
161
|
+
Xt as foldOther,
|
|
162
|
+
G as formatIsoDate,
|
|
163
|
+
K as formatIsoDateTime,
|
|
164
|
+
jt as formatValue,
|
|
165
|
+
c as getCatalog,
|
|
166
|
+
ko as hasDom,
|
|
167
|
+
_ as hasScripts,
|
|
168
|
+
vo as hasSsrMarkup,
|
|
169
|
+
U as isDateDisabled,
|
|
170
|
+
Z as isIconName,
|
|
171
|
+
So as isIllustrationName,
|
|
172
|
+
h as isUnsafePattern,
|
|
173
|
+
Jt as linearScale,
|
|
174
|
+
Qt as niceTicks,
|
|
175
|
+
Y as normalizeLegacySchema,
|
|
174
176
|
m as normalizeTagsValue,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
177
|
+
q as parseDisabledEntry,
|
|
178
|
+
W as parseIsoDate,
|
|
179
|
+
X as parseIsoDateTime,
|
|
180
|
+
I as parseRowRef,
|
|
181
|
+
P as readRef,
|
|
182
|
+
$ as renderIcon,
|
|
183
|
+
To as renderIllustration,
|
|
184
|
+
Zt as renderTableTwin,
|
|
185
|
+
D as resolveNext,
|
|
186
|
+
l as resolveViewFields,
|
|
187
|
+
M as runScripts,
|
|
188
|
+
S as setCatalog,
|
|
189
|
+
T as setLocale,
|
|
190
|
+
g as t,
|
|
189
191
|
f as validateField,
|
|
190
|
-
|
|
192
|
+
E as walkPath
|
|
191
193
|
};
|
package/dist/tokens.css
CHANGED
|
@@ -463,6 +463,15 @@
|
|
|
463
463
|
.baht-field--w-full {
|
|
464
464
|
flex-basis: 100%;
|
|
465
465
|
}
|
|
466
|
+
/* Phone: a half- or quarter-width field is too narrow to read (a datepicker
|
|
467
|
+
cut "19:02" to "19:0"), so every field takes the whole row. */
|
|
468
|
+
@media (max-width: 480px) {
|
|
469
|
+
.baht-field--w-1-4,
|
|
470
|
+
.baht-field--w-1-2,
|
|
471
|
+
.baht-field--w-3-4 {
|
|
472
|
+
flex-basis: 100%;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
466
475
|
.baht-field--hidden {
|
|
467
476
|
display: none;
|
|
468
477
|
}
|
package/dist/web-types.json
CHANGED