@golemui/gui-lit 1.0.1 → 1.0.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/CHANGELOG.md +8 -0
- package/{abstract-calendar-BoqKPRmS.js → abstract-calendar-D0-077XJ.js} +18 -18
- package/{calendar-DTYKVYc3.js → calendar-BclCC9VJ.js} +26 -26
- package/{calendar.element-MubSE1bx.js → calendar.element-DcnTyvfg.js} +1 -1
- package/{currency.element-YyL4TeL0.js → currency.element-5GSakkxF.js} +65 -59
- package/{date-DTYg8sog.js → date-CDUlLuYy.js} +50 -45
- package/{date-input-BeQvyfln.js → date-input-DCdGWRio.js} +8 -8
- package/{date-picker.element-DabW_-0-.js → date-picker.element-k7AJFQ5W.js} +8 -6
- package/{date.element-BtVJSIRk.js → date.element-BZO0UQez.js} +1 -1
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-CyJbVAA5.js} +23 -24
- package/index.js +69 -69
- package/index.umd.cjs +150 -146
- package/{markdown.element-CNp4wbg9.js → markdown.element-p-kC47D7.js} +22 -21
- package/{number.element-B6TsvHMK.js → number.element-CBr47IiY.js} +20 -18
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/{range-calendar-9skwbwlB.js → range-calendar-CBINu84w.js} +54 -54
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-_1bHW_c1.js} +1 -1
- package/{range-date-input-Uy8134vi.js → range-date-input-BYXzqnr1.js} +26 -26
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-BqzAF0O3.js} +1 -1
- package/{range-date-picker.element-CuKIBkIO.js → range-date-picker.element-BCBefgvY.js} +2 -2
- package/{textarea.element-Cu9ZW3K4.js → textarea.element-HThYqdR_.js} +5 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InputWidgetAdapter as h, formContext as u, inputContext as c } from "@golemui/lit";
|
|
2
2
|
import { a as m, b as g, c as C } from "./templates-Dk1jxLwS.js";
|
|
3
|
-
import "./date-input-
|
|
4
|
-
import "./calendar-
|
|
3
|
+
import "./date-input-DCdGWRio.js";
|
|
4
|
+
import "./calendar-BclCC9VJ.js";
|
|
5
5
|
import { consume as D, provide as $ } from "@lit/context";
|
|
6
|
-
import { LitElement as
|
|
6
|
+
import { LitElement as f, html as p, nothing as v } from "lit";
|
|
7
7
|
import { property as b, query as o, state as y, customElement as I } from "lit/decorators.js";
|
|
8
8
|
import "rxjs";
|
|
9
9
|
import { classMap as O } from "lit/directives/class-map.js";
|
|
@@ -12,7 +12,7 @@ var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, n = (e, t, a
|
|
|
12
12
|
(l = e[d]) && (r = (i ? l(t, a, r) : l(r)) || r);
|
|
13
13
|
return i && r && w(t, a, r), r;
|
|
14
14
|
};
|
|
15
|
-
let s = class extends
|
|
15
|
+
let s = class extends f {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), this.adapter = new h(), this.isCalendarOpen = !1, this.subscriptions = [], this.onFocusOut = (e) => {
|
|
18
18
|
if (!this.isCalendarOpen) return;
|
|
@@ -62,7 +62,7 @@ let s = class extends v {
|
|
|
62
62
|
.localeId=${this.adapter.templateData.lang}
|
|
63
63
|
@blur=${this.onBlurCalendar}
|
|
64
64
|
@change=${this.onCalendarChange}
|
|
65
|
-
></gui-calendar>` :
|
|
65
|
+
></gui-calendar>` : v;
|
|
66
66
|
return p`
|
|
67
67
|
${g(this.widget.uid, {
|
|
68
68
|
...this.adapter.templateData,
|
|
@@ -129,7 +129,9 @@ let s = class extends v {
|
|
|
129
129
|
t.target === t.currentTarget && (t?.key === "Enter" || t?.key === " ") && (this.isCalendarOpen = !this.isCalendarOpen, this.requestUpdate());
|
|
130
130
|
}
|
|
131
131
|
toggleCalendar(e) {
|
|
132
|
-
const t = e.target
|
|
132
|
+
const t = e.target;
|
|
133
|
+
if (t.closest(".gui-calendar__day-button")) return;
|
|
134
|
+
const a = t.closest(".gui-date-input__part"), i = t.closest("gui-calendar");
|
|
133
135
|
a || i ? this.openCalendar() : (this.isCalendarOpen = !this.isCalendarOpen, this.requestUpdate());
|
|
134
136
|
}
|
|
135
137
|
openCalendar() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputWidgetAdapter as l, formContext as n, inputContext as u } from "@golemui/lit";
|
|
2
2
|
import { a as h } from "./templates-Dk1jxLwS.js";
|
|
3
|
-
import "./date-input-
|
|
3
|
+
import "./date-input-DCdGWRio.js";
|
|
4
4
|
import { consume as c, provide as m } from "@lit/context";
|
|
5
5
|
import { LitElement as f, html as b } from "lit";
|
|
6
6
|
import { property as g, customElement as D } from "lit/decorators.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { InputWidgetAdapter as v, formContext as w, inputContext as y } from "@golemui/lit";
|
|
2
2
|
import { consume as F, provide as C } from "@lit/context";
|
|
3
|
-
import { LitElement as x, nothing as m, html as
|
|
3
|
+
import { LitElement as x, nothing as m, html as g } from "lit";
|
|
4
4
|
import { property as D, state as c, query as I, customElement as L } from "lit/decorators.js";
|
|
5
5
|
import { Subject as R, debounceTime as V } from "rxjs";
|
|
6
6
|
import { d as k } from "./list-D1oKnH89.js";
|
|
7
7
|
import "./errors-QjKhr6mA.js";
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
(
|
|
11
|
-
return s &&
|
|
8
|
+
var j = Object.defineProperty, O = Object.getOwnPropertyDescriptor, l = (e, t, i, s) => {
|
|
9
|
+
for (var r = s > 1 ? void 0 : s ? O(t, i) : t, o = e.length - 1, h; o >= 0; o--)
|
|
10
|
+
(h = e[o]) && (r = (s ? h(t, i, r) : h(r)) || r);
|
|
11
|
+
return s && r && j(t, i, r), r;
|
|
12
12
|
};
|
|
13
13
|
let a = class extends x {
|
|
14
14
|
constructor() {
|
|
@@ -83,15 +83,14 @@ let a = class extends x {
|
|
|
83
83
|
if (this.adapter.filterChanged(e), e && !i) {
|
|
84
84
|
this._isFiltering = !0, this._isListVisible = !0;
|
|
85
85
|
const s = t.searchFields ?? [t.labelField, t.valueField].filter(
|
|
86
|
-
(
|
|
87
|
-
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return n ? r.filter((p) => s.includes(p)).reduce(u, !1) : r.reduce(u, !1);
|
|
86
|
+
(n) => !!n
|
|
87
|
+
), r = s.length > 0, h = (t.items || []).filter((n) => {
|
|
88
|
+
if (n === null || typeof n != "object")
|
|
89
|
+
return n != null && n.toString().toLowerCase().includes(e.toLowerCase());
|
|
90
|
+
const _ = Object.keys(n), u = (p, f) => p || n[f].toString().toLowerCase().includes(e.toLowerCase());
|
|
91
|
+
return r ? _.filter((p) => s.includes(p)).reduce(u, !1) : _.reduce(u, !1);
|
|
93
92
|
});
|
|
94
|
-
this._filteredItems = [...
|
|
93
|
+
this._filteredItems = [...h];
|
|
95
94
|
} else
|
|
96
95
|
this._isFiltering = !1, this._filteredItems = [...t.items];
|
|
97
96
|
}
|
|
@@ -109,8 +108,8 @@ let a = class extends x {
|
|
|
109
108
|
const e = this.adapter.templateData, t = e.touched && e.errors && e.errors.length > 0, i = this._listItems.slice(this._range.start, this._range.end), s = this.adapter.getItemRenderer(
|
|
110
109
|
e.itemRenderer,
|
|
111
110
|
k
|
|
112
|
-
),
|
|
113
|
-
return
|
|
111
|
+
), o = this._selectedItem?.template !== null && typeof this._selectedItem?.template == "object" ? e.labelField ?? "label" : null, h = o ? this._selectedItem?.template[o] : this._selectedItem?.template, n = !!this.widget.on?.filter;
|
|
112
|
+
return g`
|
|
114
113
|
<gui-label
|
|
115
114
|
.targetElement=${[this._listRef, this._inputRef]}
|
|
116
115
|
.uid=${this.widget.uid}
|
|
@@ -128,7 +127,7 @@ let a = class extends x {
|
|
|
128
127
|
id=${this.widget.uid}
|
|
129
128
|
data-cy=${`${this.widget.uid}_textinput`}
|
|
130
129
|
class="gui-widget-input"
|
|
131
|
-
.value=${
|
|
130
|
+
.value=${h ?? e.value ?? ""}
|
|
132
131
|
?required=${e.validator?.required}
|
|
133
132
|
?disabled=${e.disabled}
|
|
134
133
|
?readonly=${e.readonly}
|
|
@@ -153,7 +152,7 @@ let a = class extends x {
|
|
|
153
152
|
.uid=${this.widget.uid}
|
|
154
153
|
.value=${e.value ?? ""}
|
|
155
154
|
.valueField=${e.valueField}
|
|
156
|
-
.items=${this._isFiltering && !
|
|
155
|
+
.items=${this._isFiltering && !n ? this._filteredItems : e.items}
|
|
157
156
|
.itemHeight=${e.itemHeight}
|
|
158
157
|
.height=${e.height}
|
|
159
158
|
?required=${e.validator?.required}
|
|
@@ -168,9 +167,9 @@ let a = class extends x {
|
|
|
168
167
|
@blur=${this._onBlur}
|
|
169
168
|
@change=${this._onValueChange}
|
|
170
169
|
>
|
|
171
|
-
${i.map((
|
|
172
|
-
const u = this._range.start +
|
|
173
|
-
return
|
|
170
|
+
${i.map((d, _) => {
|
|
171
|
+
const u = this._range.start + _, p = e.value === d.value, f = this._focusedIndex === u, b = e.labelField ?? "label", $ = d.template !== null && typeof d.template == "object" && b && !e.itemRenderer ? d.template[b] : d.template;
|
|
172
|
+
return g`
|
|
174
173
|
<div
|
|
175
174
|
role="option"
|
|
176
175
|
tabindex="-1"
|
|
@@ -178,15 +177,15 @@ let a = class extends x {
|
|
|
178
177
|
id="${this.widget.uid}-item-${u}"
|
|
179
178
|
style="height: ${e.itemHeight || 40}px"
|
|
180
179
|
aria-selected=${p ? "true" : "false"}
|
|
181
|
-
@click=${() => this._onClickItem(
|
|
180
|
+
@click=${() => this._onClickItem(d, u)}
|
|
182
181
|
>
|
|
183
182
|
${s({
|
|
184
183
|
template: $,
|
|
185
|
-
value:
|
|
184
|
+
value: d.value,
|
|
186
185
|
index: u,
|
|
187
186
|
selected: p,
|
|
188
187
|
disabled: !!e.disabled,
|
|
189
|
-
focused:
|
|
188
|
+
focused: f
|
|
190
189
|
})}
|
|
191
190
|
</div>
|
|
192
191
|
`;
|
|
@@ -194,7 +193,7 @@ let a = class extends x {
|
|
|
194
193
|
</gui-list>
|
|
195
194
|
</div>
|
|
196
195
|
|
|
197
|
-
${t ?
|
|
196
|
+
${t ? g`<gui-errors
|
|
198
197
|
.uid=${this.widget.uid}
|
|
199
198
|
.errors=${e.errors}
|
|
200
199
|
.touched=${e.touched}
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { filterTap as zt, standardValidate as Ge, isStandardValidateSuccess as K
|
|
|
2
2
|
import "@golemui/gui-shared";
|
|
3
3
|
import "@golemui/lit";
|
|
4
4
|
import { LitElement as Et, html as $t } from "lit";
|
|
5
|
-
import { property as
|
|
5
|
+
import { property as he, query as Ot, customElement as Zt } from "lit/decorators.js";
|
|
6
6
|
const qe = {
|
|
7
7
|
LAYOUTS: "LAYOUTS",
|
|
8
8
|
DISPLAYS: "DISPLAYS"
|
|
@@ -98,8 +98,8 @@ function y(e) {
|
|
|
98
98
|
on: z,
|
|
99
99
|
states: P,
|
|
100
100
|
include: B,
|
|
101
|
-
exclude:
|
|
102
|
-
validator:
|
|
101
|
+
exclude: ke,
|
|
102
|
+
validator: we,
|
|
103
103
|
...C
|
|
104
104
|
} = e;
|
|
105
105
|
return C;
|
|
@@ -643,7 +643,7 @@ class Bt {
|
|
|
643
643
|
return s && (i.on = o), i;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
const
|
|
646
|
+
const fe = new Bt();
|
|
647
647
|
function Yt(e) {
|
|
648
648
|
const {
|
|
649
649
|
uid: t,
|
|
@@ -676,7 +676,7 @@ h({
|
|
|
676
676
|
itemType: "ACTIONS",
|
|
677
677
|
entryShape: "bare",
|
|
678
678
|
mapToWidget: Yt,
|
|
679
|
-
afterMerge: (e, t) =>
|
|
679
|
+
afterMerge: (e, t) => fe.extractOnClickFromMergeResult(
|
|
680
680
|
e,
|
|
681
681
|
t.eventRegistry,
|
|
682
682
|
t.eventIdGenerator
|
|
@@ -724,7 +724,7 @@ h({
|
|
|
724
724
|
buildCustomWidget: Kt,
|
|
725
725
|
getChildren: qt
|
|
726
726
|
});
|
|
727
|
-
function
|
|
727
|
+
function ue(e) {
|
|
728
728
|
return {
|
|
729
729
|
errors: void 0,
|
|
730
730
|
touched: void 0,
|
|
@@ -750,7 +750,7 @@ function Ht(e, t) {
|
|
|
750
750
|
type: "renderer",
|
|
751
751
|
...r.include != null ? { include: r.include } : {},
|
|
752
752
|
...r.exclude != null ? { exclude: r.exclude } : {},
|
|
753
|
-
props: { render: r.render(
|
|
753
|
+
props: { render: r.render(ue(o)) }
|
|
754
754
|
}));
|
|
755
755
|
}
|
|
756
756
|
const n = e.fn;
|
|
@@ -762,7 +762,7 @@ function Ht(e, t) {
|
|
|
762
762
|
type: "renderer",
|
|
763
763
|
...o.include != null ? { include: o.include } : {},
|
|
764
764
|
...o.exclude != null ? { exclude: o.exclude } : {},
|
|
765
|
-
props: { render: o.render(
|
|
765
|
+
props: { render: o.render(ue(r)) }
|
|
766
766
|
};
|
|
767
767
|
});
|
|
768
768
|
}
|
|
@@ -917,7 +917,7 @@ h({
|
|
|
917
917
|
props: { ...z, ...P }
|
|
918
918
|
};
|
|
919
919
|
},
|
|
920
|
-
afterMerge: (e, t) =>
|
|
920
|
+
afterMerge: (e, t) => fe.extractOnClickFromMergeResult(
|
|
921
921
|
e,
|
|
922
922
|
t.eventRegistry,
|
|
923
923
|
t.eventIdGenerator
|
|
@@ -1335,11 +1335,11 @@ class Tn {
|
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
1337
1337
|
processItem(t, n, r, o, s, i, a, u, c) {
|
|
1338
|
-
const p = n, d = X(n), f = d.parseEntry(t), z = this.buildBaseDef(f), P = this.buildDecoratorForMatching(z, p, r), B = this.resolver.resolve(P, o),
|
|
1338
|
+
const p = n, d = X(n), f = d.parseEntry(t), z = this.buildBaseDef(f), P = this.buildDecoratorForMatching(z, p, r), B = this.resolver.resolve(P, o), ke = B.leafSelectors.filter((T) => T.targetState != null), we = {
|
|
1339
1339
|
leafSelectors: B.leafSelectors.filter((T) => T.targetState == null),
|
|
1340
1340
|
sensibleDefaults: B.sensibleDefaults
|
|
1341
1341
|
};
|
|
1342
|
-
let C = this.merger.merge(z, p,
|
|
1342
|
+
let C = this.merger.merge(z, p, we);
|
|
1343
1343
|
d.afterMerge && (C = d.afterMerge(C, {
|
|
1344
1344
|
eventRegistry: s,
|
|
1345
1345
|
formConfig: i,
|
|
@@ -1349,9 +1349,9 @@ class Tn {
|
|
|
1349
1349
|
s,
|
|
1350
1350
|
a
|
|
1351
1351
|
);
|
|
1352
|
-
const { cleanedResult:
|
|
1352
|
+
const { cleanedResult: Te, stateData: se } = this.stateExpansion.extractFromMergeResult(
|
|
1353
1353
|
C,
|
|
1354
|
-
|
|
1354
|
+
ke
|
|
1355
1355
|
);
|
|
1356
1356
|
let O;
|
|
1357
1357
|
if (d.buildCustomWidget) {
|
|
@@ -1364,9 +1364,9 @@ class Tn {
|
|
|
1364
1364
|
u,
|
|
1365
1365
|
c
|
|
1366
1366
|
);
|
|
1367
|
-
O = this.buildCustomWidget(d,
|
|
1367
|
+
O = this.buildCustomWidget(d, Te, T);
|
|
1368
1368
|
} else
|
|
1369
|
-
O = this.mapper.mapToWidget(
|
|
1369
|
+
O = this.mapper.mapToWidget(Te, p);
|
|
1370
1370
|
if (typeof O != "function") {
|
|
1371
1371
|
const T = O;
|
|
1372
1372
|
T.uid || (T.path && !c.has(T.path) ? (T.uid = T.path, c.add(T.path)) : T.uid = `dx_${u.value++}`);
|
|
@@ -1417,7 +1417,7 @@ class Tn {
|
|
|
1417
1417
|
buildBaseDef(t) {
|
|
1418
1418
|
const n = t.baseDef;
|
|
1419
1419
|
return typeof n == "function" ? (r) => {
|
|
1420
|
-
const
|
|
1420
|
+
const o = ue(r), s = n(o);
|
|
1421
1421
|
return t.path != null ? { ...s, path: t.path } : s;
|
|
1422
1422
|
} : t.path != null ? { ...n, path: t.path } : n;
|
|
1423
1423
|
}
|
|
@@ -1517,7 +1517,7 @@ const Sn = new Tn(
|
|
|
1517
1517
|
ln,
|
|
1518
1518
|
hn,
|
|
1519
1519
|
gn,
|
|
1520
|
-
|
|
1520
|
+
fe,
|
|
1521
1521
|
kn
|
|
1522
1522
|
), zn = new An(yn, Sn);
|
|
1523
1523
|
function tt(e) {
|
|
@@ -1614,13 +1614,13 @@ const Zn = {};
|
|
|
1614
1614
|
function I(e) {
|
|
1615
1615
|
return Zn;
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function ce(e, t) {
|
|
1618
1618
|
return typeof t == "bigint" ? t.toString() : t;
|
|
1619
1619
|
}
|
|
1620
|
-
function
|
|
1620
|
+
function ge(e) {
|
|
1621
1621
|
return e == null;
|
|
1622
1622
|
}
|
|
1623
|
-
function
|
|
1623
|
+
function be(e) {
|
|
1624
1624
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
1625
1625
|
return e.slice(t, n);
|
|
1626
1626
|
}
|
|
@@ -1657,7 +1657,7 @@ const rt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
1657
1657
|
function Oe(e) {
|
|
1658
1658
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1659
1659
|
}
|
|
1660
|
-
function
|
|
1660
|
+
function le(e) {
|
|
1661
1661
|
if (Oe(e) === !1)
|
|
1662
1662
|
return !1;
|
|
1663
1663
|
const t = e.constructor;
|
|
@@ -1667,9 +1667,9 @@ function ce(e) {
|
|
|
1667
1667
|
return !(Oe(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
|
|
1668
1668
|
}
|
|
1669
1669
|
function ot(e) {
|
|
1670
|
-
return
|
|
1670
|
+
return le(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function ye(e) {
|
|
1673
1673
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1674
1674
|
}
|
|
1675
1675
|
function st(e, t, n) {
|
|
@@ -1721,7 +1721,7 @@ function L(e, t, n) {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function _e(e) {
|
|
1725
1725
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
1726
1726
|
}
|
|
1727
1727
|
function U(...e) {
|
|
@@ -1740,7 +1740,7 @@ const it = (e, t) => {
|
|
|
1740
1740
|
}), Object.defineProperty(e, "issues", {
|
|
1741
1741
|
value: t,
|
|
1742
1742
|
enumerable: !1
|
|
1743
|
-
}), e.message = JSON.stringify(t,
|
|
1743
|
+
}), e.message = JSON.stringify(t, ce, 2), Object.defineProperty(e, "toString", {
|
|
1744
1744
|
value: () => e.message,
|
|
1745
1745
|
enumerable: !1
|
|
1746
1746
|
});
|
|
@@ -1935,7 +1935,7 @@ const tr = (e) => {
|
|
|
1935
1935
|
var n;
|
|
1936
1936
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1937
1937
|
const o = r.value;
|
|
1938
|
-
return !
|
|
1938
|
+
return !ge(o) && o.length !== void 0;
|
|
1939
1939
|
}), e._zod.onattach.push((r) => {
|
|
1940
1940
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1941
1941
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -1943,7 +1943,7 @@ const tr = (e) => {
|
|
|
1943
1943
|
const o = r.value;
|
|
1944
1944
|
if (o.length <= t.maximum)
|
|
1945
1945
|
return;
|
|
1946
|
-
const i =
|
|
1946
|
+
const i = _e(o);
|
|
1947
1947
|
r.issues.push({
|
|
1948
1948
|
origin: i,
|
|
1949
1949
|
code: "too_big",
|
|
@@ -1958,7 +1958,7 @@ const tr = (e) => {
|
|
|
1958
1958
|
var n;
|
|
1959
1959
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1960
1960
|
const o = r.value;
|
|
1961
|
-
return !
|
|
1961
|
+
return !ge(o) && o.length !== void 0;
|
|
1962
1962
|
}), e._zod.onattach.push((r) => {
|
|
1963
1963
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1964
1964
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -1966,7 +1966,7 @@ const tr = (e) => {
|
|
|
1966
1966
|
const o = r.value;
|
|
1967
1967
|
if (o.length >= t.minimum)
|
|
1968
1968
|
return;
|
|
1969
|
-
const i =
|
|
1969
|
+
const i = _e(o);
|
|
1970
1970
|
r.issues.push({
|
|
1971
1971
|
origin: i,
|
|
1972
1972
|
code: "too_small",
|
|
@@ -1981,7 +1981,7 @@ const tr = (e) => {
|
|
|
1981
1981
|
var n;
|
|
1982
1982
|
S.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
1983
1983
|
const o = r.value;
|
|
1984
|
-
return !
|
|
1984
|
+
return !ge(o) && o.length !== void 0;
|
|
1985
1985
|
}), e._zod.onattach.push((r) => {
|
|
1986
1986
|
const o = r._zod.bag;
|
|
1987
1987
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -1989,7 +1989,7 @@ const tr = (e) => {
|
|
|
1989
1989
|
const o = r.value, s = o.length;
|
|
1990
1990
|
if (s === t.length)
|
|
1991
1991
|
return;
|
|
1992
|
-
const i =
|
|
1992
|
+
const i = _e(o), a = s > t.length;
|
|
1993
1993
|
r.issues.push({
|
|
1994
1994
|
origin: i,
|
|
1995
1995
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -2035,7 +2035,7 @@ const tr = (e) => {
|
|
|
2035
2035
|
t.pattern ?? (t.pattern = ir), ne.init(e, t);
|
|
2036
2036
|
}), gr = /* @__PURE__ */ l("$ZodCheckIncludes", (e, t) => {
|
|
2037
2037
|
S.init(e, t);
|
|
2038
|
-
const n =
|
|
2038
|
+
const n = ye(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
2039
2039
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
2040
2040
|
const s = o._zod.bag;
|
|
2041
2041
|
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
|
|
@@ -2052,7 +2052,7 @@ const tr = (e) => {
|
|
|
2052
2052
|
};
|
|
2053
2053
|
}), br = /* @__PURE__ */ l("$ZodCheckStartsWith", (e, t) => {
|
|
2054
2054
|
S.init(e, t);
|
|
2055
|
-
const n = new RegExp(`^${
|
|
2055
|
+
const n = new RegExp(`^${ye(t.prefix)}.*`);
|
|
2056
2056
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2057
2057
|
const o = r._zod.bag;
|
|
2058
2058
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2069,7 +2069,7 @@ const tr = (e) => {
|
|
|
2069
2069
|
};
|
|
2070
2070
|
}), yr = /* @__PURE__ */ l("$ZodCheckEndsWith", (e, t) => {
|
|
2071
2071
|
S.init(e, t);
|
|
2072
|
-
const n = new RegExp(`.*${
|
|
2072
|
+
const n = new RegExp(`.*${ye(t.suffix)}$`);
|
|
2073
2073
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
2074
2074
|
const o = r._zod.bag;
|
|
2075
2075
|
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
|
|
@@ -2166,7 +2166,7 @@ const tr = (e) => {
|
|
|
2166
2166
|
vendor: "zod",
|
|
2167
2167
|
version: 1
|
|
2168
2168
|
};
|
|
2169
|
-
}),
|
|
2169
|
+
}), ve = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
2170
2170
|
_.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? tr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
2171
2171
|
if (t.coerce)
|
|
2172
2172
|
try {
|
|
@@ -2181,7 +2181,7 @@ const tr = (e) => {
|
|
|
2181
2181
|
}), n;
|
|
2182
2182
|
};
|
|
2183
2183
|
}), E = /* @__PURE__ */ l("$ZodStringFormat", (e, t) => {
|
|
2184
|
-
ne.init(e, t),
|
|
2184
|
+
ne.init(e, t), ve.init(e, t);
|
|
2185
2185
|
}), kr = /* @__PURE__ */ l("$ZodUUID", (e, t) => {
|
|
2186
2186
|
if (t.version) {
|
|
2187
2187
|
const r = {
|
|
@@ -2351,7 +2351,7 @@ const Lr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
2351
2351
|
}), g(e._zod, "pattern", () => {
|
|
2352
2352
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
2353
2353
|
const o = t.options.map((s) => s._zod.pattern);
|
|
2354
|
-
return new RegExp(`^(${o.map((s) =>
|
|
2354
|
+
return new RegExp(`^(${o.map((s) => be(s.source)).join("|")})$`);
|
|
2355
2355
|
}
|
|
2356
2356
|
});
|
|
2357
2357
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -2381,15 +2381,15 @@ const Lr = /* @__PURE__ */ l("$ZodUnion", (e, t) => {
|
|
|
2381
2381
|
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([u, c]) => Ie(n, u, c)) : Ie(n, s, i);
|
|
2382
2382
|
};
|
|
2383
2383
|
});
|
|
2384
|
-
function
|
|
2384
|
+
function pe(e, t) {
|
|
2385
2385
|
if (e === t)
|
|
2386
2386
|
return { valid: !0, data: e };
|
|
2387
2387
|
if (e instanceof Date && t instanceof Date && +e == +t)
|
|
2388
2388
|
return { valid: !0, data: e };
|
|
2389
|
-
if (
|
|
2389
|
+
if (le(e) && le(t)) {
|
|
2390
2390
|
const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
|
|
2391
2391
|
for (const s of r) {
|
|
2392
|
-
const i =
|
|
2392
|
+
const i = pe(e[s], t[s]);
|
|
2393
2393
|
if (!i.valid)
|
|
2394
2394
|
return {
|
|
2395
2395
|
valid: !1,
|
|
@@ -2404,7 +2404,7 @@ function le(e, t) {
|
|
|
2404
2404
|
return { valid: !1, mergeErrorPath: [] };
|
|
2405
2405
|
const n = [];
|
|
2406
2406
|
for (let r = 0; r < e.length; r++) {
|
|
2407
|
-
const o = e[r], s = t[r], i =
|
|
2407
|
+
const o = e[r], s = t[r], i = pe(o, s);
|
|
2408
2408
|
if (!i.valid)
|
|
2409
2409
|
return {
|
|
2410
2410
|
valid: !1,
|
|
@@ -2419,7 +2419,7 @@ function le(e, t) {
|
|
|
2419
2419
|
function Ie(e, t, n) {
|
|
2420
2420
|
if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), M(e))
|
|
2421
2421
|
return e;
|
|
2422
|
-
const r =
|
|
2422
|
+
const r = pe(t.value, n.value);
|
|
2423
2423
|
if (!r.valid)
|
|
2424
2424
|
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
|
|
2425
2425
|
return e.value = r.data, e;
|
|
@@ -2442,7 +2442,7 @@ function Le(e, t) {
|
|
|
2442
2442
|
const ft = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
2443
2443
|
_.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), g(e._zod, "pattern", () => {
|
|
2444
2444
|
const n = t.innerType._zod.pattern;
|
|
2445
|
-
return n ? new RegExp(`^(${
|
|
2445
|
+
return n ? new RegExp(`^(${be(n.source)})?$`) : void 0;
|
|
2446
2446
|
}), e._zod.parse = (n, r) => {
|
|
2447
2447
|
if (t.innerType._zod.optin === "optional") {
|
|
2448
2448
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -2453,7 +2453,7 @@ const ft = /* @__PURE__ */ l("$ZodOptional", (e, t) => {
|
|
|
2453
2453
|
}), Nr = /* @__PURE__ */ l("$ZodNullable", (e, t) => {
|
|
2454
2454
|
_.init(e, t), g(e._zod, "optin", () => t.innerType._zod.optin), g(e._zod, "optout", () => t.innerType._zod.optout), g(e._zod, "pattern", () => {
|
|
2455
2455
|
const n = t.innerType._zod.pattern;
|
|
2456
|
-
return n ? new RegExp(`^(${
|
|
2456
|
+
return n ? new RegExp(`^(${be(n.source)}|null)$`) : void 0;
|
|
2457
2457
|
}), g(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
2458
2458
|
}), xr = /* @__PURE__ */ l("$ZodDefault", (e, t) => {
|
|
2459
2459
|
_.init(e, t), e._zod.optin = "optional", g(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
@@ -2894,13 +2894,13 @@ const Zo = (e, t) => {
|
|
|
2894
2894
|
},
|
|
2895
2895
|
addIssue: {
|
|
2896
2896
|
value: (n) => {
|
|
2897
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2897
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, ce, 2);
|
|
2898
2898
|
}
|
|
2899
2899
|
// enumerable: false,
|
|
2900
2900
|
},
|
|
2901
2901
|
addIssues: {
|
|
2902
2902
|
value: (n) => {
|
|
2903
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2903
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, ce, 2);
|
|
2904
2904
|
}
|
|
2905
2905
|
// enumerable: false,
|
|
2906
2906
|
},
|
|
@@ -2932,7 +2932,7 @@ const Zo = (e, t) => {
|
|
|
2932
2932
|
const r = e.clone();
|
|
2933
2933
|
return K.add(r, n[0]), r;
|
|
2934
2934
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), jo = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
2935
|
-
|
|
2935
|
+
ve.init(e, t), A.init(e, t);
|
|
2936
2936
|
const n = e._zod.bag;
|
|
2937
2937
|
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(yt(...r)), e.includes = (...r) => e.check(lo(...r)), e.startsWith = (...r) => e.check(po(...r)), e.endsWith = (...r) => e.check(mo(...r)), e.min = (...r) => e.check(x(...r)), e.max = (...r) => e.check(re(...r)), e.length = (...r) => e.check(bt(...r)), e.nonempty = (...r) => e.check(x(1, ...r)), e.lowercase = (r) => e.check(uo(r)), e.uppercase = (r) => e.check(co(r)), e.trim = () => e.check(fo()), e.normalize = (...r) => e.check(ho(...r)), e.toLowerCase = () => e.check(go()), e.toUpperCase = () => e.check(bo()), e.slugify = () => e.check(yo());
|
|
2938
2938
|
}), oe = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
@@ -3090,7 +3090,7 @@ const D = /* @__PURE__ */ l("ZodMiniType", (e, t) => {
|
|
|
3090
3090
|
// { parent: true }
|
|
3091
3091
|
), e.clone = (n, r) => st(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e));
|
|
3092
3092
|
}), kt = /* @__PURE__ */ l("ZodMiniString", (e, t) => {
|
|
3093
|
-
|
|
3093
|
+
ve.init(e, t), D.init(e, t);
|
|
3094
3094
|
});
|
|
3095
3095
|
function je(e) {
|
|
3096
3096
|
return Yr(kt, e);
|
|
@@ -3154,7 +3154,7 @@ function Be(e) {
|
|
|
3154
3154
|
const Os = /* @__PURE__ */ l("ZodMiniAny", (e, t) => {
|
|
3155
3155
|
Ir.init(e, t), D.init(e, t);
|
|
3156
3156
|
});
|
|
3157
|
-
function
|
|
3157
|
+
function de() {
|
|
3158
3158
|
return so(Os);
|
|
3159
3159
|
}
|
|
3160
3160
|
const Zs = /* @__PURE__ */ l("ZodMiniArray", (e, t) => {
|
|
@@ -3185,7 +3185,7 @@ function k(e, t = {}) {
|
|
|
3185
3185
|
function Tt(e) {
|
|
3186
3186
|
return vt(e);
|
|
3187
3187
|
}
|
|
3188
|
-
const
|
|
3188
|
+
const me = {
|
|
3189
3189
|
email: { schema: fs() },
|
|
3190
3190
|
hostname: { schema: Ss() },
|
|
3191
3191
|
ipv4: { schema: ks() },
|
|
@@ -3196,7 +3196,7 @@ const de = {
|
|
|
3196
3196
|
time: { schema: Eo() },
|
|
3197
3197
|
"date-time": { schema: To() },
|
|
3198
3198
|
duration: { schema: Oo() }
|
|
3199
|
-
}, Ls = Object.keys(
|
|
3199
|
+
}, Ls = Object.keys(me), Ds = (e) => (t, n) => {
|
|
3200
3200
|
switch (t.type) {
|
|
3201
3201
|
case "string":
|
|
3202
3202
|
return Ms(t, n);
|
|
@@ -3260,11 +3260,11 @@ function Ms(e, t) {
|
|
|
3260
3260
|
o = o.check(
|
|
3261
3261
|
s ? Tt((i, a) => {
|
|
3262
3262
|
const u = Ge(
|
|
3263
|
-
|
|
3263
|
+
me[n.format].schema,
|
|
3264
3264
|
i
|
|
3265
3265
|
);
|
|
3266
3266
|
Ke(u) || a.addIssue({ code: "custom", path: [], message: s });
|
|
3267
|
-
}) :
|
|
3267
|
+
}) : me[n.format].schema
|
|
3268
3268
|
);
|
|
3269
3269
|
} else
|
|
3270
3270
|
console.error(`The string validation format "${n.format}" is not supported`);
|
|
@@ -3328,7 +3328,7 @@ function Rs(e, t) {
|
|
|
3328
3328
|
function Fs(e, t) {
|
|
3329
3329
|
return j(e, (n) => {
|
|
3330
3330
|
const r = b(n.messages?.invalid, t);
|
|
3331
|
-
let o = r ? Ye(
|
|
3331
|
+
let o = r ? Ye(de(), r) : Ye(de());
|
|
3332
3332
|
if (n.required === !0) {
|
|
3333
3333
|
const s = b(n.messages?.required, t) ?? "This field is required";
|
|
3334
3334
|
o = o.check(k((i) => i.length > 0, { error: s }));
|
|
@@ -3350,7 +3350,7 @@ function Fs(e, t) {
|
|
|
3350
3350
|
}
|
|
3351
3351
|
function Ws(e, t) {
|
|
3352
3352
|
return j(e, (n) => {
|
|
3353
|
-
let r =
|
|
3353
|
+
let r = de();
|
|
3354
3354
|
return zt(
|
|
3355
3355
|
Object.keys(n),
|
|
3356
3356
|
// filter non-custom validator keys
|
|
@@ -3385,22 +3385,22 @@ const Us = {
|
|
|
3385
3385
|
// ACTION
|
|
3386
3386
|
button: async () => (await import("./button.element-3a7rRHbA.js")).ButtonElement,
|
|
3387
3387
|
// INPUTS
|
|
3388
|
-
calendar: async () => (await import("./calendar.element-
|
|
3389
|
-
rangeCalendar: async () => (await import("./range-calendar.element-
|
|
3390
|
-
rangeDateInput: async () => (await import("./range-date-input.element-
|
|
3391
|
-
rangeDatePicker: async () => (await import("./range-date-picker.element-
|
|
3392
|
-
currency: async () => (await import("./currency.element-
|
|
3393
|
-
dateInput: async () => (await import("./date.element-
|
|
3394
|
-
datePicker: async () => (await import("./date-picker.element-
|
|
3395
|
-
dropdown: async () => (await import("./dropdown.element-
|
|
3388
|
+
calendar: async () => (await import("./calendar.element-DcnTyvfg.js")).CalendarElement,
|
|
3389
|
+
rangeCalendar: async () => (await import("./range-calendar.element-_1bHW_c1.js")).RangeCalendarElement,
|
|
3390
|
+
rangeDateInput: async () => (await import("./range-date-input.element-BqzAF0O3.js")).RangeDateInputElement,
|
|
3391
|
+
rangeDatePicker: async () => (await import("./range-date-picker.element-BCBefgvY.js")).RangeDatePickerElement,
|
|
3392
|
+
currency: async () => (await import("./currency.element-5GSakkxF.js")).CurrencyElement,
|
|
3393
|
+
dateInput: async () => (await import("./date.element-BZO0UQez.js")).DateElement,
|
|
3394
|
+
datePicker: async () => (await import("./date-picker.element-k7AJFQ5W.js")).DatePickerElement,
|
|
3395
|
+
dropdown: async () => (await import("./dropdown.element-CyJbVAA5.js")).DropdownElement,
|
|
3396
3396
|
list: async () => (await import("./list.element-Co3V3Cn5.js")).ListElement,
|
|
3397
|
-
markdown: async () => (await import("./markdown.element-
|
|
3397
|
+
markdown: async () => (await import("./markdown.element-p-kC47D7.js")).MarkdownElement,
|
|
3398
3398
|
password: async () => (await import("./password.element-n-R9RbkB.js")).PasswordElement,
|
|
3399
3399
|
textinput: async () => (await import("./textinput.element-CkXNzMUg.js")).TextinputElement,
|
|
3400
|
-
textarea: async () => (await import("./textarea.element-
|
|
3400
|
+
textarea: async () => (await import("./textarea.element-HThYqdR_.js")).TextareaElement,
|
|
3401
3401
|
toggle: async () => (await import("./toggle.element-C1kCw5H8.js")).ToggleElement,
|
|
3402
3402
|
checkbox: async () => (await import("./checkbox.element-CVskoXEc.js")).CheckboxElement,
|
|
3403
|
-
number: async () => (await import("./number.element-
|
|
3403
|
+
number: async () => (await import("./number.element-CBr47IiY.js")).NumberElement,
|
|
3404
3404
|
radiogroup: async () => (await import("./radiogroup.element-CeQn623u.js")).RadiogroupElement,
|
|
3405
3405
|
select: async () => (await import("./select.element-jcDF1h-g.js")).SelectElement,
|
|
3406
3406
|
tags: async () => (await import("./tags.element-CX3vQL8L.js")).TagsElement,
|
|
@@ -3468,13 +3468,13 @@ let R = class extends Et {
|
|
|
3468
3468
|
}
|
|
3469
3469
|
};
|
|
3470
3470
|
V([
|
|
3471
|
-
|
|
3471
|
+
he({ attribute: !1 })
|
|
3472
3472
|
], R.prototype, "config", 2);
|
|
3473
3473
|
V([
|
|
3474
|
-
|
|
3474
|
+
he({ type: String })
|
|
3475
3475
|
], R.prototype, "autocomplete", 2);
|
|
3476
3476
|
V([
|
|
3477
|
-
|
|
3477
|
+
he({ attribute: !1 })
|
|
3478
3478
|
], R.prototype, "formHealthBoundary", 2);
|
|
3479
3479
|
V([
|
|
3480
3480
|
Ot("gui-core-form")
|