@dynamicforms/vue-forms 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamicforms-vue-forms.js +535 -539
- package/dist/dynamicforms-vue-forms.js.map +1 -1
- package/dist/dynamicforms-vue-forms.umd.cjs +2 -2
- package/dist/dynamicforms-vue-forms.umd.cjs.map +1 -1
- package/dist/index.d.cts +603 -0
- package/dist/index.d.ts +103 -93
- package/package.json +14 -5
- package/readme.md +133 -43
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var q = (i, s,
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var de = Object.defineProperty, ge = Object.defineProperties;
|
|
2
|
+
var fe = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var P = Object.getOwnPropertySymbols;
|
|
4
|
+
var J = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var q = (i, s, e) => s in i ? de(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, y = (i, s) => {
|
|
6
|
+
for (var e in s || (s = {}))
|
|
7
|
+
J.call(s, e) && q(i, e, s[e]);
|
|
8
|
+
if (P)
|
|
9
|
+
for (var e of P(s))
|
|
10
|
+
K.call(s, e) && q(i, e, s[e]);
|
|
11
11
|
return i;
|
|
12
|
-
}, R = (i, s) =>
|
|
12
|
+
}, R = (i, s) => ge(i, fe(s));
|
|
13
13
|
var I = (i, s) => {
|
|
14
|
-
var
|
|
15
|
-
for (var
|
|
16
|
-
|
|
17
|
-
if (i != null &&
|
|
18
|
-
for (var
|
|
19
|
-
s.indexOf(
|
|
20
|
-
return
|
|
14
|
+
var e = {};
|
|
15
|
+
for (var t in i)
|
|
16
|
+
J.call(i, t) && s.indexOf(t) < 0 && (e[t] = i[t]);
|
|
17
|
+
if (i != null && P)
|
|
18
|
+
for (var t of P(i))
|
|
19
|
+
s.indexOf(t) < 0 && K.call(i, t) && (e[t] = i[t]);
|
|
20
|
+
return e;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
import { isEqual as k, isBoolean as
|
|
24
|
-
import { unref as g, computed as
|
|
25
|
-
var
|
|
26
|
-
const
|
|
22
|
+
var o = (i, s, e) => q(i, typeof s != "symbol" ? s + "" : s, e);
|
|
23
|
+
import { isEqual as k, isBoolean as pe, isString as V, isEmpty as H, truncate as be, isArray as te, isObject as se } from "lodash-es";
|
|
24
|
+
import { unref as g, computed as me, reactive as ve, defineComponent as ye, resolveComponent as Z, openBlock as xe, createBlock as Ee, h as S } from "vue";
|
|
25
|
+
var F = /* @__PURE__ */ ((i) => (i[i.SUPPRESS = 1] = "SUPPRESS", i[i.HIDDEN = 5] = "HIDDEN", i[i.INVISIBLE = 8] = "INVISIBLE", i[i.FULL = 10] = "FULL", i))(F || {});
|
|
26
|
+
const ee = 10;
|
|
27
27
|
((i) => {
|
|
28
28
|
function s(n) {
|
|
29
|
-
return n.toUpperCase() === "SUPPRESS" ? 1 : n.toUpperCase() === "HIDDEN" ? 5 : n.toUpperCase() === "INVISIBLE" ? 8 :
|
|
29
|
+
return n.toUpperCase() === "SUPPRESS" ? 1 : n.toUpperCase() === "HIDDEN" ? 5 : n.toUpperCase() === "INVISIBLE" ? 8 : ee;
|
|
30
30
|
}
|
|
31
31
|
i.fromString = s;
|
|
32
|
-
function
|
|
32
|
+
function e(n) {
|
|
33
33
|
const r = typeof n == "number" ? n : i.fromString(n);
|
|
34
|
-
return Object.values(i).includes(r) ? r :
|
|
34
|
+
return Object.values(i).includes(r) ? r : ee;
|
|
35
35
|
}
|
|
36
|
-
i.fromAny =
|
|
37
|
-
function
|
|
36
|
+
i.fromAny = e;
|
|
37
|
+
function t(n) {
|
|
38
38
|
const r = typeof n == "number" ? n : i.fromString(n);
|
|
39
39
|
return Object.values(i).includes(r);
|
|
40
40
|
}
|
|
41
|
-
i.isDefined =
|
|
42
|
-
})(
|
|
43
|
-
Object.freeze(
|
|
44
|
-
const
|
|
41
|
+
i.isDefined = t;
|
|
42
|
+
})(F || (F = {}));
|
|
43
|
+
Object.freeze(F);
|
|
44
|
+
const C = F;
|
|
45
45
|
class b {
|
|
46
46
|
constructor(s) {
|
|
47
|
-
|
|
47
|
+
o(this, "executorFn");
|
|
48
48
|
this.executorFn = s;
|
|
49
49
|
}
|
|
50
50
|
static get classIdentifier() {
|
|
@@ -53,8 +53,8 @@ class b {
|
|
|
53
53
|
get classIdentifier() {
|
|
54
54
|
return this.constructor.classIdentifier;
|
|
55
55
|
}
|
|
56
|
-
execute(s,
|
|
57
|
-
return this.executorFn(s,
|
|
56
|
+
execute(s, e, ...t) {
|
|
57
|
+
return this.executorFn(s, e, ...t);
|
|
58
58
|
}
|
|
59
59
|
get eager() {
|
|
60
60
|
return !1;
|
|
@@ -67,24 +67,24 @@ class b {
|
|
|
67
67
|
}
|
|
68
68
|
class Q extends Error {
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
class
|
|
70
|
+
const ne = /* @__PURE__ */ Symbol("ValueChangedAction");
|
|
71
|
+
class m extends b {
|
|
72
72
|
constructor(s) {
|
|
73
73
|
super(s);
|
|
74
74
|
}
|
|
75
75
|
static get classIdentifier() {
|
|
76
|
-
return
|
|
76
|
+
return ne;
|
|
77
77
|
}
|
|
78
|
-
execute(s,
|
|
79
|
-
return super.execute(s,
|
|
78
|
+
execute(s, e, t, n) {
|
|
79
|
+
return super.execute(s, e, t, n);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
class
|
|
83
|
-
constructor(
|
|
84
|
-
super(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.plugins = n, this.options =
|
|
82
|
+
class j extends String {
|
|
83
|
+
constructor(e, t, n) {
|
|
84
|
+
super(e);
|
|
85
|
+
o(this, "plugins");
|
|
86
|
+
o(this, "options");
|
|
87
|
+
this.plugins = n, this.options = t;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
function W(i) {
|
|
@@ -108,12 +108,12 @@ class X {
|
|
|
108
108
|
return "";
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
class
|
|
112
|
-
constructor(
|
|
111
|
+
class _e extends X {
|
|
112
|
+
constructor(e, t = "") {
|
|
113
113
|
super();
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.text =
|
|
114
|
+
o(this, "text");
|
|
115
|
+
o(this, "classes");
|
|
116
|
+
this.text = e, this.classes = t;
|
|
117
117
|
}
|
|
118
118
|
get componentName() {
|
|
119
119
|
return "template";
|
|
@@ -126,20 +126,20 @@ class Ct extends X {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
class p extends X {
|
|
129
|
-
constructor(
|
|
129
|
+
constructor(e, t = "") {
|
|
130
130
|
super();
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.classes =
|
|
131
|
+
o(this, "classes");
|
|
132
|
+
o(this, "text");
|
|
133
|
+
o(this, "textType");
|
|
134
|
+
this.classes = t, this.text = e, this.textType = me(() => this.getTextType);
|
|
135
135
|
}
|
|
136
136
|
get resolvedText() {
|
|
137
|
-
const
|
|
138
|
-
return U(
|
|
137
|
+
const e = g(this.text);
|
|
138
|
+
return U(e) ? e() : e;
|
|
139
139
|
}
|
|
140
140
|
get getTextType() {
|
|
141
|
-
const
|
|
142
|
-
return
|
|
141
|
+
const e = this.resolvedText;
|
|
142
|
+
return e ? e instanceof j ? "md" : W(e) ? "component" : "string" : "string";
|
|
143
143
|
}
|
|
144
144
|
get componentName() {
|
|
145
145
|
switch (g(this.textType)) {
|
|
@@ -158,8 +158,8 @@ class p extends X {
|
|
|
158
158
|
case "string":
|
|
159
159
|
return {};
|
|
160
160
|
case "md": {
|
|
161
|
-
const
|
|
162
|
-
return { source:
|
|
161
|
+
const e = this.resolvedText;
|
|
162
|
+
return { source: e.toString(), options: e.options, plugins: e.plugins };
|
|
163
163
|
}
|
|
164
164
|
case "component":
|
|
165
165
|
return this.resolvedText.componentProps || {};
|
|
@@ -181,158 +181,156 @@ class p extends X {
|
|
|
181
181
|
return this.classes;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
class
|
|
184
|
+
class Ve extends p {
|
|
185
185
|
}
|
|
186
|
-
const
|
|
187
|
-
class f extends
|
|
186
|
+
const Ce = /* @__PURE__ */ Symbol("Validator");
|
|
187
|
+
class f extends m {
|
|
188
188
|
/**
|
|
189
189
|
* Creates a new validator
|
|
190
190
|
* @param validationFn Function that validates the field value and returns errors or null
|
|
191
191
|
*/
|
|
192
|
-
constructor(
|
|
193
|
-
super((n, r, a,
|
|
194
|
-
const c =
|
|
192
|
+
constructor(e) {
|
|
193
|
+
super((n, r, a, l) => {
|
|
194
|
+
const c = e(a, l, n) || [], u = (h) => {
|
|
195
195
|
var A;
|
|
196
196
|
h == null || h.forEach(
|
|
197
|
-
(
|
|
197
|
+
(E) => Object.defineProperty(E, "source", { value: this.source, enumerable: !1, configurable: !1 })
|
|
198
198
|
);
|
|
199
|
-
for (let
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
|
|
199
|
+
for (let E = n.errors.length - 1; E >= 0; E--) {
|
|
200
|
+
const L = n.errors[E];
|
|
201
|
+
if (L.source === this.source) {
|
|
202
|
+
const O = (A = h == null ? void 0 : h.findIndex(($) => k($, L))) != null ? A : -1;
|
|
203
|
+
O >= 0 ? h == null || h.splice(O, 1) : n.errors.splice(E, 1);
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
h && h.length > 0 && n.errors.push(...h), n.validate();
|
|
207
207
|
};
|
|
208
|
-
return c instanceof Promise ? (n.
|
|
209
|
-
n.validatingCount = Math.max(0, n.validatingCount - 1), n.validating = n.validatingCount > 0;
|
|
210
|
-
})) : u(c), r(n, a, o);
|
|
208
|
+
return c instanceof Promise ? (n.beginValidating(), c.then((h) => u(h)).finally(() => n.endValidating())) : u(c), r(n, a, l);
|
|
211
209
|
});
|
|
212
|
-
|
|
210
|
+
o(this, "source");
|
|
213
211
|
this.source = Symbol(this.constructor.name);
|
|
214
212
|
}
|
|
215
213
|
static get classIdentifier() {
|
|
216
|
-
return
|
|
214
|
+
return Ce;
|
|
217
215
|
}
|
|
218
216
|
get eager() {
|
|
219
217
|
return !0;
|
|
220
218
|
}
|
|
221
|
-
replacePlaceholdersFunction(
|
|
219
|
+
replacePlaceholdersFunction(e, t) {
|
|
222
220
|
return () => {
|
|
223
|
-
let n = g(
|
|
221
|
+
let n = g(e);
|
|
224
222
|
for (; U(n); )
|
|
225
|
-
n = g(this.replacePlaceholders(n(),
|
|
223
|
+
n = g(this.replacePlaceholders(n(), t));
|
|
226
224
|
return n;
|
|
227
225
|
};
|
|
228
226
|
}
|
|
229
|
-
replacePlaceholders(
|
|
230
|
-
if (U(
|
|
231
|
-
if (W(
|
|
232
|
-
let n = g(
|
|
233
|
-
return Object.keys(
|
|
234
|
-
n = n.replaceAll(`{${r}}`,
|
|
235
|
-
}),
|
|
227
|
+
replacePlaceholders(e, t) {
|
|
228
|
+
if (U(e)) return this.replacePlaceholdersFunction(e, t);
|
|
229
|
+
if (W(e)) return e;
|
|
230
|
+
let n = g(e);
|
|
231
|
+
return Object.keys(t).forEach((r) => {
|
|
232
|
+
n = n.replaceAll(`{${r}}`, t[r]);
|
|
233
|
+
}), e instanceof j ? new j(n.toString(), e.options, e.plugins) : n;
|
|
236
234
|
}
|
|
237
235
|
}
|
|
238
|
-
class
|
|
236
|
+
class N extends Map {
|
|
239
237
|
constructor() {
|
|
240
238
|
super(...arguments);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
register(
|
|
245
|
-
if (!(
|
|
246
|
-
this.registeredActions.push(
|
|
247
|
-
const
|
|
248
|
-
function r(a, ...
|
|
249
|
-
return
|
|
239
|
+
o(this, "eagerActions", /* @__PURE__ */ new Set());
|
|
240
|
+
o(this, "registeredActions", []);
|
|
241
|
+
}
|
|
242
|
+
register(e) {
|
|
243
|
+
if (!(e instanceof b)) throw new Error("Invalid action type");
|
|
244
|
+
this.registeredActions.push(e);
|
|
245
|
+
const t = e.classIdentifier, n = this.get(t) || (() => null);
|
|
246
|
+
function r(a, ...l) {
|
|
247
|
+
return e.execute(a, n, ...l);
|
|
250
248
|
}
|
|
251
|
-
this.set(
|
|
249
|
+
this.set(t, r), e.eager && this.eagerActions.add(e.classIdentifier);
|
|
252
250
|
}
|
|
253
|
-
trigger(
|
|
254
|
-
const r =
|
|
255
|
-
r ===
|
|
251
|
+
trigger(e, t, ...n) {
|
|
252
|
+
const r = e.classIdentifier;
|
|
253
|
+
r === ne && this.triggerEager(t, ...n);
|
|
256
254
|
const a = this.get(r);
|
|
257
255
|
try {
|
|
258
|
-
if (a) return a(
|
|
259
|
-
} catch (
|
|
260
|
-
if (!(
|
|
256
|
+
if (a) return a(t, ...n);
|
|
257
|
+
} catch (l) {
|
|
258
|
+
if (!(l instanceof Q)) throw l;
|
|
261
259
|
}
|
|
262
260
|
return null;
|
|
263
261
|
}
|
|
264
|
-
triggerEager(
|
|
262
|
+
triggerEager(e, ...t) {
|
|
265
263
|
for (const n of this.eagerActions) {
|
|
266
264
|
const r = this.get(n);
|
|
267
265
|
try {
|
|
268
|
-
r && r(
|
|
266
|
+
r && r(e, ...t);
|
|
269
267
|
} catch (a) {
|
|
270
268
|
if (!(a instanceof Q)) throw a;
|
|
271
269
|
}
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
clone() {
|
|
275
|
-
const
|
|
276
|
-
return this.registeredActions.forEach((
|
|
273
|
+
const e = new N();
|
|
274
|
+
return this.registeredActions.forEach((t) => e.register(t)), e;
|
|
277
275
|
}
|
|
278
276
|
cloneWithoutValidators() {
|
|
279
|
-
const
|
|
280
|
-
return this.registeredActions.forEach((
|
|
281
|
-
|
|
282
|
-
}),
|
|
277
|
+
const e = new N();
|
|
278
|
+
return this.registeredActions.forEach((t) => {
|
|
279
|
+
t instanceof f ? t.unregister() : e.register(t);
|
|
280
|
+
}), e;
|
|
283
281
|
}
|
|
284
282
|
}
|
|
285
|
-
const
|
|
286
|
-
class B extends
|
|
287
|
-
constructor(
|
|
288
|
-
const n = (r, a,
|
|
289
|
-
const u =
|
|
283
|
+
const Ae = /* @__PURE__ */ Symbol("ConditionalStatementAction");
|
|
284
|
+
class B extends m {
|
|
285
|
+
constructor(e, t) {
|
|
286
|
+
const n = (r, a, l, c) => {
|
|
287
|
+
const u = e.evaluate();
|
|
290
288
|
if (u !== this.lastResult) {
|
|
291
289
|
for (const h of this.boundFields)
|
|
292
|
-
|
|
290
|
+
t(h, u, this.lastResult);
|
|
293
291
|
this.lastResult = u;
|
|
294
292
|
}
|
|
295
|
-
return a(r,
|
|
293
|
+
return a(r, l, c);
|
|
296
294
|
};
|
|
297
295
|
super(n);
|
|
298
|
-
|
|
296
|
+
o(this, "lastResult");
|
|
299
297
|
// boundField tracks the fields this action is bound to. so that it may perform the executorFn on them and not on the
|
|
300
298
|
// ValueChangedAction fields that will call the actionExecutor
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
o(this, "boundFields", /* @__PURE__ */ new Set());
|
|
300
|
+
e.collectFields().forEach((r) => r.registerAction(new m(n)));
|
|
303
301
|
}
|
|
304
302
|
static get classIdentifier() {
|
|
305
|
-
return
|
|
303
|
+
return Ae;
|
|
306
304
|
}
|
|
307
305
|
get eager() {
|
|
308
306
|
return !0;
|
|
309
307
|
}
|
|
310
|
-
boundToField(
|
|
311
|
-
this.boundFields.add(
|
|
308
|
+
boundToField(e) {
|
|
309
|
+
this.boundFields.add(e);
|
|
312
310
|
}
|
|
313
311
|
}
|
|
314
|
-
class
|
|
312
|
+
class Ie extends B {
|
|
315
313
|
constructor(s) {
|
|
316
|
-
super(s, (
|
|
317
|
-
|
|
314
|
+
super(s, (e, t) => {
|
|
315
|
+
e.visibility = t ? C.FULL : C.SUPPRESS;
|
|
318
316
|
});
|
|
319
317
|
}
|
|
320
318
|
}
|
|
321
|
-
class
|
|
319
|
+
class Se extends B {
|
|
322
320
|
constructor(s) {
|
|
323
|
-
super(s, (
|
|
324
|
-
|
|
321
|
+
super(s, (e, t) => {
|
|
322
|
+
e.enabled = t;
|
|
325
323
|
});
|
|
326
324
|
}
|
|
327
325
|
}
|
|
328
|
-
class
|
|
329
|
-
constructor(s,
|
|
330
|
-
super(s, (
|
|
331
|
-
n && (
|
|
326
|
+
class we extends B {
|
|
327
|
+
constructor(s, e) {
|
|
328
|
+
super(s, (t, n) => {
|
|
329
|
+
n && (t.value = e);
|
|
332
330
|
});
|
|
333
331
|
}
|
|
334
332
|
}
|
|
335
|
-
var
|
|
333
|
+
var T = /* @__PURE__ */ ((i) => (i[i.NOT = 0] = "NOT", i[i.OR = 1] = "OR", i[i.AND = 2] = "AND", i[i.XOR = 3] = "XOR", i[i.NAND = 4] = "NAND", i[i.NOR = 5] = "NOR", i[i.EQUALS = -1] = "EQUALS", i[i.NOT_EQUALS = -2] = "NOT_EQUALS", i[i.GT = -3] = "GT", i[i.LT = -4] = "LT", i[i.GE = -5] = "GE", i[i.LE = -6] = "LE", i[i.IN = -7] = "IN", i[i.NOT_IN = -8] = "NOT_IN", i[i.INCLUDES = -9] = "INCLUDES", i[i.NOT_INCLUDES = -10] = "NOT_INCLUDES", i))(T || {});
|
|
336
334
|
((i) => {
|
|
337
335
|
function s(r) {
|
|
338
336
|
const a = r.toLowerCase();
|
|
@@ -355,118 +353,134 @@ var L = /* @__PURE__ */ ((i) => (i[i.NOT = 0] = "NOT", i[i.OR = 1] = "OR", i[i.A
|
|
|
355
353
|
throw new Error(`Unrecognised operator ${a}`);
|
|
356
354
|
}
|
|
357
355
|
i.fromString = s;
|
|
358
|
-
function
|
|
356
|
+
function e(r) {
|
|
359
357
|
const a = typeof r == "number" ? r : i.fromString(r);
|
|
360
358
|
if (Object.values(i).includes(a)) return a;
|
|
361
359
|
throw new Error(`Unrecognised operator ${r}`);
|
|
362
360
|
}
|
|
363
|
-
i.fromAny =
|
|
364
|
-
function
|
|
361
|
+
i.fromAny = e;
|
|
362
|
+
function t(r) {
|
|
365
363
|
const a = typeof r == "number" ? r : i.fromString(r);
|
|
366
364
|
return Object.values(i).includes(a);
|
|
367
365
|
}
|
|
368
|
-
i.isDefined =
|
|
366
|
+
i.isDefined = t;
|
|
369
367
|
function n(r) {
|
|
370
368
|
return r >= 0;
|
|
371
369
|
}
|
|
372
370
|
i.isLogicOperator = n;
|
|
373
|
-
})(
|
|
374
|
-
Object.freeze(
|
|
375
|
-
const d =
|
|
376
|
-
class
|
|
371
|
+
})(T || (T = {}));
|
|
372
|
+
Object.freeze(T);
|
|
373
|
+
const d = T, Fe = /* @__PURE__ */ Symbol("EnabledChangingAction");
|
|
374
|
+
class ie extends b {
|
|
377
375
|
constructor(s) {
|
|
378
376
|
super(s);
|
|
379
377
|
}
|
|
380
378
|
static get classIdentifier() {
|
|
381
|
-
return
|
|
379
|
+
return Fe;
|
|
382
380
|
}
|
|
383
|
-
execute(s,
|
|
384
|
-
return super.execute(s,
|
|
381
|
+
execute(s, e, t, n) {
|
|
382
|
+
return super.execute(s, e, t, n);
|
|
385
383
|
}
|
|
386
384
|
}
|
|
387
|
-
const
|
|
388
|
-
class
|
|
385
|
+
const je = /* @__PURE__ */ Symbol("EnabledChangedAction");
|
|
386
|
+
class re extends b {
|
|
389
387
|
constructor(s) {
|
|
390
388
|
super(s);
|
|
391
389
|
}
|
|
392
390
|
static get classIdentifier() {
|
|
393
|
-
return
|
|
391
|
+
return je;
|
|
394
392
|
}
|
|
395
|
-
execute(s,
|
|
396
|
-
return super.execute(s,
|
|
393
|
+
execute(s, e, t, n) {
|
|
394
|
+
return super.execute(s, e, t, n);
|
|
397
395
|
}
|
|
398
396
|
}
|
|
399
|
-
const
|
|
400
|
-
class
|
|
397
|
+
const Ne = /* @__PURE__ */ Symbol("ValidChangedAction");
|
|
398
|
+
class ae extends b {
|
|
401
399
|
constructor(s) {
|
|
402
400
|
super(s);
|
|
403
401
|
}
|
|
404
402
|
static get classIdentifier() {
|
|
405
|
-
return
|
|
403
|
+
return Ne;
|
|
406
404
|
}
|
|
407
|
-
execute(s,
|
|
408
|
-
return super.execute(s,
|
|
405
|
+
execute(s, e, t, n) {
|
|
406
|
+
return super.execute(s, e, t, n);
|
|
409
407
|
}
|
|
410
408
|
}
|
|
411
|
-
const
|
|
412
|
-
class
|
|
409
|
+
const Te = /* @__PURE__ */ Symbol("VisibilityChangingAction");
|
|
410
|
+
class le extends b {
|
|
413
411
|
constructor(s) {
|
|
414
412
|
super(s);
|
|
415
413
|
}
|
|
416
414
|
static get classIdentifier() {
|
|
417
|
-
return
|
|
415
|
+
return Te;
|
|
418
416
|
}
|
|
419
|
-
execute(s,
|
|
420
|
-
return super.execute(s,
|
|
417
|
+
execute(s, e, t, n) {
|
|
418
|
+
return super.execute(s, e, t, n);
|
|
421
419
|
}
|
|
422
420
|
}
|
|
423
|
-
const
|
|
424
|
-
class
|
|
421
|
+
const Le = /* @__PURE__ */ Symbol("VisibilityChangedAction");
|
|
422
|
+
class oe extends b {
|
|
425
423
|
constructor(s) {
|
|
426
424
|
super(s);
|
|
427
425
|
}
|
|
428
426
|
static get classIdentifier() {
|
|
429
|
-
return
|
|
427
|
+
return Le;
|
|
430
428
|
}
|
|
431
|
-
execute(s,
|
|
432
|
-
return super.execute(s,
|
|
429
|
+
execute(s, e, t, n) {
|
|
430
|
+
return super.execute(s, e, t, n);
|
|
433
431
|
}
|
|
434
432
|
}
|
|
435
|
-
class
|
|
433
|
+
class x {
|
|
434
|
+
/**
|
|
435
|
+
* A field is a Vue reactive proxy from construction onwards: the base constructor returns the proxy, and a
|
|
436
|
+
* derived class's `this` is whatever super() returned, so every subclass constructor, field initializer and
|
|
437
|
+
* method sees the proxy. Consequence: plain `field.property = value` is tracked, with no wrapper in between.
|
|
438
|
+
*/
|
|
436
439
|
constructor() {
|
|
437
|
-
l(this, "reactiveValue", G(() => this.value));
|
|
438
440
|
// contains original field value as was provided at creation
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
l(this, "_valid", !0);
|
|
441
|
+
o(this, "validatingCount", 0);
|
|
442
|
+
o(this, "_valid", !0);
|
|
442
443
|
// is current value valid as per FE and BE validators?
|
|
443
|
-
|
|
444
|
+
o(this, "errors", []);
|
|
444
445
|
// when member of a Group, fieldName specifies the name of this field
|
|
445
|
-
|
|
446
|
+
o(this, "actions", new N());
|
|
446
447
|
// default property handlers
|
|
447
|
-
|
|
448
|
-
|
|
448
|
+
o(this, "_visibility", C.FULL);
|
|
449
|
+
o(this, "_enabled", !0);
|
|
450
|
+
return ve(this);
|
|
451
|
+
}
|
|
452
|
+
/** true while at least one asynchronous validator is still running for this field */
|
|
453
|
+
get validating() {
|
|
454
|
+
return this.validatingCount > 0;
|
|
455
|
+
}
|
|
456
|
+
/** announces the start of one asynchronous validation run; validators pair it with endValidating */
|
|
457
|
+
beginValidating() {
|
|
458
|
+
this.validatingCount++;
|
|
459
|
+
}
|
|
460
|
+
/** announces the end of one asynchronous validation run */
|
|
461
|
+
endValidating() {
|
|
462
|
+
this.validatingCount = Math.max(0, this.validatingCount - 1);
|
|
449
463
|
}
|
|
450
464
|
get visibility() {
|
|
451
465
|
return this._visibility;
|
|
452
466
|
}
|
|
453
467
|
set visibility(s) {
|
|
454
|
-
const
|
|
455
|
-
if (!
|
|
456
|
-
this._visibility =
|
|
468
|
+
const e = this._visibility, t = this.actions.trigger(le, this, s, e);
|
|
469
|
+
if (!C.isDefined(t != null ? t : s)) throw new Error("visibility must be a DisplayMode constant");
|
|
470
|
+
this._visibility = C.fromAny(t != null ? t : s), this.actions.trigger(oe, this, this._visibility, e);
|
|
457
471
|
}
|
|
458
472
|
get enabled() {
|
|
459
473
|
return this._enabled;
|
|
460
474
|
}
|
|
461
475
|
set enabled(s) {
|
|
462
|
-
const
|
|
463
|
-
if (!
|
|
464
|
-
this._enabled =
|
|
476
|
+
const e = this._enabled, t = this.actions.trigger(ie, this, s, e);
|
|
477
|
+
if (!pe(t != null ? t : s)) throw new Error("Enabled value must be boolean");
|
|
478
|
+
this._enabled = t != null ? t : s, this.actions.trigger(re, this, this._enabled, e);
|
|
465
479
|
}
|
|
466
480
|
validate(s = !1) {
|
|
467
481
|
s && this.actions.triggerEager(this, this.value, this.value);
|
|
468
|
-
const
|
|
469
|
-
this._valid = this.valid, this._valid !==
|
|
482
|
+
const e = this._valid;
|
|
483
|
+
this._valid = this.valid, this._valid !== e && this.actions.trigger(ae, this, this.valid, e);
|
|
470
484
|
}
|
|
471
485
|
get valid() {
|
|
472
486
|
return this.errors.length === 0;
|
|
@@ -478,70 +492,69 @@ class y {
|
|
|
478
492
|
return !k(this.value, this.originalValue);
|
|
479
493
|
}
|
|
480
494
|
registerAction(s) {
|
|
481
|
-
|
|
482
|
-
return this.actions.register(t), t.boundToField(this), t.eager && this.actions.trigger(Object.getPrototypeOf(s).constructor, this, this.value, this.originalValue), this;
|
|
495
|
+
return this.actions.register(s), s.boundToField(this), s.eager && this.actions.trigger(Object.getPrototypeOf(s).constructor, this, this.value, this.originalValue), this;
|
|
483
496
|
}
|
|
484
|
-
triggerAction(s, ...
|
|
485
|
-
return this.actions.trigger(s, this, ...
|
|
497
|
+
triggerAction(s, ...e) {
|
|
498
|
+
return this.actions.trigger(s, this, ...e);
|
|
486
499
|
}
|
|
487
500
|
clearValidators() {
|
|
488
501
|
this.actions = this.actions.cloneWithoutValidators(), this.errors = [], this._valid = !0;
|
|
489
502
|
}
|
|
490
503
|
}
|
|
491
|
-
function
|
|
504
|
+
function Oe(i, s) {
|
|
492
505
|
return i ? !s : s;
|
|
493
506
|
}
|
|
494
|
-
class
|
|
495
|
-
constructor(s,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
this.operand1 = s, this.operator =
|
|
507
|
+
class w {
|
|
508
|
+
constructor(s, e, t) {
|
|
509
|
+
o(this, "operand1");
|
|
510
|
+
o(this, "operator");
|
|
511
|
+
o(this, "operand2");
|
|
512
|
+
this.operand1 = s, this.operator = e, this.operand2 = t;
|
|
500
513
|
}
|
|
501
514
|
get operand1Value() {
|
|
502
|
-
return this.operand1 instanceof
|
|
515
|
+
return this.operand1 instanceof w ? this.operand1.evaluate() : this.operand1 instanceof x ? g(this.operand1.value) : this.operand1;
|
|
503
516
|
}
|
|
504
517
|
get operand2Value() {
|
|
505
|
-
return this.operand2 instanceof
|
|
518
|
+
return this.operand2 instanceof w ? this.operand2.evaluate() : this.operand2 instanceof x ? g(this.operand2.value) : this.operand2;
|
|
506
519
|
}
|
|
507
520
|
evaluate() {
|
|
508
|
-
var
|
|
509
|
-
const s = this.operand1Value,
|
|
521
|
+
var t, n, r, a;
|
|
522
|
+
const s = this.operand1Value, e = this.operand2Value;
|
|
510
523
|
switch (this.operator) {
|
|
511
524
|
// logical operators
|
|
512
525
|
case d.AND:
|
|
513
|
-
return s &&
|
|
526
|
+
return s && e;
|
|
514
527
|
case d.OR:
|
|
515
|
-
return s ||
|
|
528
|
+
return s || e;
|
|
516
529
|
case d.NAND:
|
|
517
|
-
return !(s &&
|
|
530
|
+
return !(s && e);
|
|
518
531
|
case d.NOR:
|
|
519
|
-
return !(s ||
|
|
532
|
+
return !(s || e);
|
|
520
533
|
case d.XOR:
|
|
521
|
-
return
|
|
534
|
+
return Oe(s, e);
|
|
522
535
|
case d.NOT:
|
|
523
536
|
return !s;
|
|
524
537
|
// comparison operators
|
|
525
538
|
case d.EQUALS:
|
|
526
|
-
return s ==
|
|
539
|
+
return s == e;
|
|
527
540
|
case d.NOT_EQUALS:
|
|
528
|
-
return s !=
|
|
541
|
+
return s != e;
|
|
529
542
|
case d.LT:
|
|
530
|
-
return s <
|
|
543
|
+
return s < e;
|
|
531
544
|
case d.LE:
|
|
532
|
-
return s <=
|
|
545
|
+
return s <= e;
|
|
533
546
|
case d.GE:
|
|
534
|
-
return s >=
|
|
547
|
+
return s >= e;
|
|
535
548
|
case d.GT:
|
|
536
|
-
return s >
|
|
549
|
+
return s > e;
|
|
537
550
|
case d.IN:
|
|
538
|
-
return (n = (
|
|
551
|
+
return (n = (t = e == null ? void 0 : e.includes) == null ? void 0 : t.call(e, s)) != null ? n : !1;
|
|
539
552
|
case d.NOT_IN:
|
|
540
|
-
return !((a = (r =
|
|
553
|
+
return !((a = (r = e == null ? void 0 : e.includes) == null ? void 0 : r.call(e, s)) == null || a);
|
|
541
554
|
case d.INCLUDES:
|
|
542
|
-
return
|
|
555
|
+
return V(s) && V(e) && s.indexOf(e) >= 0;
|
|
543
556
|
case d.NOT_INCLUDES:
|
|
544
|
-
return !(
|
|
557
|
+
return !(V(s) && V(e) && s.indexOf(e) >= 0);
|
|
545
558
|
default:
|
|
546
559
|
throw new Error(`Operator not implemented ${this.operator}`);
|
|
547
560
|
}
|
|
@@ -552,123 +565,113 @@ class F {
|
|
|
552
565
|
*/
|
|
553
566
|
collectFields() {
|
|
554
567
|
const s = /* @__PURE__ */ new Set();
|
|
555
|
-
function t
|
|
556
|
-
|
|
568
|
+
function e(t) {
|
|
569
|
+
t instanceof x ? s.add(t) : t instanceof w && t.collectFields().forEach((r) => s.add(r));
|
|
557
570
|
}
|
|
558
|
-
return
|
|
571
|
+
return e(this.operand1), e(this.operand2), s;
|
|
559
572
|
}
|
|
560
573
|
}
|
|
561
|
-
const
|
|
562
|
-
class
|
|
574
|
+
const Pe = /* @__PURE__ */ Symbol("ExecuteAction");
|
|
575
|
+
class ce extends b {
|
|
563
576
|
constructor(s) {
|
|
564
577
|
super(s);
|
|
565
578
|
}
|
|
566
579
|
static get classIdentifier() {
|
|
567
|
-
return
|
|
580
|
+
return Pe;
|
|
568
581
|
}
|
|
569
|
-
execute(s,
|
|
570
|
-
return super.execute(s,
|
|
582
|
+
execute(s, e, t) {
|
|
583
|
+
return super.execute(s, e, t);
|
|
571
584
|
}
|
|
572
585
|
}
|
|
573
|
-
const
|
|
586
|
+
const Re = /* @__PURE__ */ Symbol("ListItemAddedAction");
|
|
574
587
|
class z extends b {
|
|
575
588
|
constructor(s) {
|
|
576
589
|
super(s);
|
|
577
590
|
}
|
|
578
591
|
static get classIdentifier() {
|
|
579
|
-
return
|
|
592
|
+
return Re;
|
|
580
593
|
}
|
|
581
|
-
execute(s,
|
|
582
|
-
return super.execute(s,
|
|
594
|
+
execute(s, e, t, n) {
|
|
595
|
+
return super.execute(s, e, t, n);
|
|
583
596
|
}
|
|
584
597
|
}
|
|
585
|
-
const
|
|
586
|
-
class
|
|
598
|
+
const Ue = /* @__PURE__ */ Symbol("ListItemRemovedAction");
|
|
599
|
+
class ue extends b {
|
|
587
600
|
constructor(s) {
|
|
588
601
|
super(s);
|
|
589
602
|
}
|
|
590
603
|
static get classIdentifier() {
|
|
591
|
-
return
|
|
604
|
+
return Ue;
|
|
592
605
|
}
|
|
593
|
-
execute(s,
|
|
594
|
-
return super.execute(s,
|
|
606
|
+
execute(s, e, t, n) {
|
|
607
|
+
return super.execute(s, e, t, n);
|
|
595
608
|
}
|
|
596
609
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
constructor(t) {
|
|
610
|
+
class D extends x {
|
|
611
|
+
constructor(e) {
|
|
600
612
|
super();
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const e = this.constructor.name;
|
|
605
|
-
throw new TypeError(`Don't use constructor to instantiate ${e}. Use ${e}.create<T>`);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
init(t) {
|
|
609
|
-
if (t) {
|
|
610
|
-
const e = t, { value: n, validators: r, actions: a } = e, o = I(e, ["value", "validators", "actions"]);
|
|
611
|
-
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this, o), this._value = n != null ? n : this.originalValue, this.originalValue === void 0 && (this.originalValue = this._value);
|
|
612
|
-
}
|
|
613
|
-
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
613
|
+
o(this, "_value");
|
|
614
|
+
o(this, "_touched", !1);
|
|
615
|
+
this.init(e);
|
|
614
616
|
}
|
|
615
617
|
/**
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
618
|
+
* Applies the constructor parameters. It is a hook so that a subclass needing different parameter handling
|
|
619
|
+
* overrides one method instead of redeclaring the constructor - Action does exactly that.
|
|
620
|
+
*
|
|
621
|
+
* It is called from this constructor, so it runs before a subclass's own class field initializers, which
|
|
622
|
+
* only run once super() returns. An override must therefore work off its parameters alone: members the
|
|
623
|
+
* subclass initializes read as undefined inside it, and anything it writes to such a member is overwritten
|
|
624
|
+
* the moment the initializer runs.
|
|
619
625
|
*/
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
626
|
+
init(e) {
|
|
627
|
+
if (e) {
|
|
628
|
+
const t = e, { value: n, validators: r, actions: a } = t, l = I(t, ["value", "validators", "actions"]);
|
|
629
|
+
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this, l), this._value = n != null ? n : this.originalValue, this.originalValue === void 0 && (this.originalValue = this._value);
|
|
630
|
+
}
|
|
631
|
+
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
623
632
|
}
|
|
624
633
|
get value() {
|
|
625
634
|
return this._value;
|
|
626
635
|
}
|
|
627
|
-
set value(
|
|
628
|
-
const
|
|
629
|
-
!this.enabled ||
|
|
636
|
+
set value(e) {
|
|
637
|
+
const t = this._value;
|
|
638
|
+
!this.enabled || t === e || (this._value = e, this.actions.trigger(m, this, this._value, t), this.parent && this.parent.notifyValueChanged(), this.validate());
|
|
630
639
|
}
|
|
631
640
|
get touched() {
|
|
632
641
|
return this._touched;
|
|
633
642
|
}
|
|
634
|
-
set touched(
|
|
635
|
-
this._touched =
|
|
643
|
+
set touched(e) {
|
|
644
|
+
this._touched = e;
|
|
636
645
|
}
|
|
637
|
-
clone(
|
|
638
|
-
var
|
|
639
|
-
const
|
|
640
|
-
value: (
|
|
641
|
-
},
|
|
642
|
-
enabled: (
|
|
643
|
-
visibility: (
|
|
646
|
+
clone(e) {
|
|
647
|
+
var r, a, l;
|
|
648
|
+
const t = this.constructor, n = new t(R(y({
|
|
649
|
+
value: (r = e == null ? void 0 : e.value) != null ? r : this.value
|
|
650
|
+
}, e && "originalValue" in e ? { originalValue: e.originalValue } : {}), {
|
|
651
|
+
enabled: (a = e == null ? void 0 : e.enabled) != null ? a : this.enabled,
|
|
652
|
+
visibility: (l = e == null ? void 0 : e.visibility) != null ? l : this.visibility
|
|
644
653
|
}));
|
|
645
|
-
return
|
|
654
|
+
return n.actions = this.actions.clone(), n.actions.triggerEager(n, n.value, n.originalValue), n;
|
|
646
655
|
}
|
|
647
656
|
}
|
|
648
|
-
const
|
|
649
|
-
new
|
|
657
|
+
const ke = new D({ value: "EmptyField" }).registerAction(
|
|
658
|
+
new m(() => {
|
|
650
659
|
console.warn("Working with EmptyField! This should not happen");
|
|
651
660
|
})
|
|
652
661
|
);
|
|
653
662
|
function M(i, s) {
|
|
654
663
|
return (i == null ? void 0 : i.label) == null && (i == null ? void 0 : i.icon) == null ? s : i;
|
|
655
664
|
}
|
|
656
|
-
class
|
|
657
|
-
constructor(s) {
|
|
658
|
-
super(s), this._value = { label: void 0, icon: void 0 };
|
|
659
|
-
}
|
|
665
|
+
class Be extends D {
|
|
660
666
|
init(s) {
|
|
661
|
-
if (s) {
|
|
662
|
-
const
|
|
663
|
-
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this,
|
|
664
|
-
const c = M(
|
|
665
|
-
this._value = M(c, u), this.originalValue = M(u, c);
|
|
667
|
+
if (this._value = { label: void 0, icon: void 0 }, s) {
|
|
668
|
+
const e = s, { value: t, originalValue: n, validators: r, actions: a } = e, l = I(e, ["value", "originalValue", "validators", "actions"]);
|
|
669
|
+
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this, l);
|
|
670
|
+
const c = M(t, this._value), u = Object.freeze({ label: n == null ? void 0 : n.label, icon: n == null ? void 0 : n.icon });
|
|
671
|
+
this._value = M(c, y({}, u)), this.originalValue = M(u, c);
|
|
666
672
|
}
|
|
667
673
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
668
674
|
}
|
|
669
|
-
static create(s) {
|
|
670
|
-
return super.create(s);
|
|
671
|
-
}
|
|
672
675
|
get icon() {
|
|
673
676
|
return this.value.icon;
|
|
674
677
|
}
|
|
@@ -682,17 +685,17 @@ class Dt extends D {
|
|
|
682
685
|
this.value.label = s;
|
|
683
686
|
}
|
|
684
687
|
execute(s) {
|
|
685
|
-
this.actions.trigger(
|
|
688
|
+
this.actions.trigger(ce, this, s);
|
|
686
689
|
}
|
|
687
690
|
}
|
|
688
|
-
const
|
|
691
|
+
const De = /* @__PURE__ */ ye({
|
|
689
692
|
__name: "messages-widget",
|
|
690
693
|
props: {
|
|
691
694
|
message: {},
|
|
692
695
|
classes: {}
|
|
693
696
|
},
|
|
694
697
|
setup(i) {
|
|
695
|
-
const s = i,
|
|
698
|
+
const s = i, e = Z("vue-markdown"), t = /* @__PURE__ */ new Set([
|
|
696
699
|
"div",
|
|
697
700
|
"span",
|
|
698
701
|
"p",
|
|
@@ -757,18 +760,18 @@ const $t = /* @__PURE__ */ xt({
|
|
|
757
760
|
r.push(S("div", { class: [s.classes, a.extraClasses] }, a.componentBody));
|
|
758
761
|
break;
|
|
759
762
|
case "vue-markdown":
|
|
760
|
-
if (typeof
|
|
763
|
+
if (typeof e == "string")
|
|
761
764
|
console.warn(
|
|
762
765
|
"You are using markdown for messages-widget, but you haven't registered a vue-markdown component"
|
|
763
766
|
), r.push(S("div", { class: [s.classes, a.extraClasses] }, a.componentBindings.source));
|
|
764
767
|
else {
|
|
765
|
-
const
|
|
768
|
+
const l = a.componentBindings;
|
|
766
769
|
r.push(
|
|
767
|
-
S(
|
|
770
|
+
S(e, {
|
|
768
771
|
class: [s.classes, a.extraClasses, "df-messages-widget-markdown"],
|
|
769
|
-
source:
|
|
770
|
-
options:
|
|
771
|
-
plugins:
|
|
772
|
+
source: l.source,
|
|
773
|
+
options: l.options,
|
|
774
|
+
plugins: l.plugins
|
|
772
775
|
})
|
|
773
776
|
);
|
|
774
777
|
}
|
|
@@ -776,8 +779,8 @@ const $t = /* @__PURE__ */ xt({
|
|
|
776
779
|
default:
|
|
777
780
|
r.push(
|
|
778
781
|
S(
|
|
779
|
-
|
|
780
|
-
|
|
782
|
+
t.has(a.componentName.toLowerCase()) ? a.componentName : Z(a.componentName),
|
|
783
|
+
y(y({
|
|
781
784
|
class: [s.classes, a.extraClasses]
|
|
782
785
|
}, a.componentBindings), a.componentBody ? { innerHTML: a.componentBody } : {})
|
|
783
786
|
)
|
|
@@ -786,66 +789,59 @@ const $t = /* @__PURE__ */ xt({
|
|
|
786
789
|
}
|
|
787
790
|
}), r;
|
|
788
791
|
};
|
|
789
|
-
return (r, a) => (
|
|
792
|
+
return (r, a) => (xe(), Ee(n));
|
|
790
793
|
}
|
|
791
794
|
});
|
|
792
|
-
class
|
|
793
|
-
constructor(
|
|
795
|
+
class _ extends x {
|
|
796
|
+
constructor(e, t) {
|
|
794
797
|
super();
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
if (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
[...a || [], ...o || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
798
|
+
o(this, "_fields");
|
|
799
|
+
o(this, "_value", null);
|
|
800
|
+
o(this, "suppressNotifyValueChanged", !1);
|
|
801
|
+
if (!_.isValidFields(e)) throw new Error("Invalid fields object provided");
|
|
802
|
+
if (this._fields = /* @__PURE__ */ Object.create(null), Object.entries(e).forEach(([r, a]) => this.addField(r, a)), t) {
|
|
803
|
+
const n = t, { value: r, validators: a, actions: l } = n, c = I(n, ["value", "validators", "actions"]);
|
|
804
|
+
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
803
805
|
}
|
|
804
806
|
this.originalValue === void 0 && (this.originalValue = this.value), this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
805
807
|
}
|
|
806
|
-
addField(
|
|
807
|
-
if (this.
|
|
808
|
-
throw new Error(`Field ${
|
|
809
|
-
Object.defineProperty(
|
|
810
|
-
get() {
|
|
811
|
-
return e;
|
|
812
|
-
},
|
|
813
|
-
configurable: !1,
|
|
814
|
-
enumerable: !0
|
|
815
|
-
});
|
|
808
|
+
addField(e, t) {
|
|
809
|
+
if (Object.hasOwn(this._fields, e))
|
|
810
|
+
throw new Error(`Field ${e} is already in this form`);
|
|
811
|
+
Object.defineProperty(t, "parent", { get: () => this, configurable: !1, enumerable: !1 }), Object.defineProperty(t, "fieldName", { get: () => e, configurable: !1, enumerable: !1 }), Object.defineProperty(this._fields, e, { get: () => t, configurable: !1, enumerable: !0 });
|
|
816
812
|
}
|
|
817
|
-
static isValidFields(
|
|
818
|
-
function
|
|
819
|
-
return n instanceof
|
|
813
|
+
static isValidFields(e) {
|
|
814
|
+
function t(n) {
|
|
815
|
+
return n instanceof x;
|
|
820
816
|
}
|
|
821
|
-
return typeof
|
|
817
|
+
return typeof e == "object" && e !== null && Object.entries(e).every(([, n]) => t(n));
|
|
822
818
|
}
|
|
823
|
-
static createFromFormData(
|
|
824
|
-
if (
|
|
819
|
+
static createFromFormData(e) {
|
|
820
|
+
if (e instanceof x)
|
|
825
821
|
throw new Error("data is already a Form structure, should be a simple object");
|
|
826
|
-
return new
|
|
827
|
-
|
|
822
|
+
return new _(
|
|
823
|
+
e == null ? {} : Object.fromEntries(Object.entries(e).map(([t, n]) => [t, new D({ value: n })]))
|
|
828
824
|
);
|
|
829
825
|
}
|
|
830
|
-
field(
|
|
831
|
-
var
|
|
832
|
-
return (
|
|
826
|
+
field(e) {
|
|
827
|
+
var t;
|
|
828
|
+
return (t = this._fields[e]) != null ? t : null;
|
|
833
829
|
}
|
|
834
830
|
get fields() {
|
|
835
831
|
return this._fields;
|
|
836
832
|
}
|
|
837
833
|
get value() {
|
|
838
|
-
const
|
|
839
|
-
return Object.entries(this._fields).forEach(([
|
|
834
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
835
|
+
return Object.entries(this._fields).forEach(([t, n]) => {
|
|
840
836
|
const r = n.value;
|
|
841
|
-
(n.enabled || n instanceof
|
|
842
|
-
}), H(
|
|
837
|
+
(n.enabled || n instanceof _ && !H(r)) && (e[t] = r);
|
|
838
|
+
}), H(e) ? null : y({}, e);
|
|
843
839
|
}
|
|
844
|
-
set value(
|
|
840
|
+
set value(e) {
|
|
845
841
|
this.suppressNotifyValueChanged = !0;
|
|
846
842
|
try {
|
|
847
|
-
Object.entries(this._fields).forEach(([
|
|
848
|
-
(
|
|
843
|
+
Object.entries(this._fields).forEach(([t, n]) => {
|
|
844
|
+
(e == null || Object.hasOwn(e, t)) && (n.value = e == null ? null : e[t]);
|
|
849
845
|
});
|
|
850
846
|
} finally {
|
|
851
847
|
this.suppressNotifyValueChanged = !1;
|
|
@@ -853,358 +849,358 @@ class E extends y {
|
|
|
853
849
|
this.notifyValueChanged(), this.validate();
|
|
854
850
|
}
|
|
855
851
|
get touched() {
|
|
856
|
-
return Object.values(this._fields).some((
|
|
852
|
+
return Object.values(this._fields).some((e) => e.touched);
|
|
857
853
|
}
|
|
858
|
-
set touched(
|
|
859
|
-
Object.values(this._fields).forEach((
|
|
860
|
-
|
|
854
|
+
set touched(e) {
|
|
855
|
+
Object.values(this._fields).forEach((t) => {
|
|
856
|
+
t.touched = e;
|
|
861
857
|
});
|
|
862
858
|
}
|
|
863
859
|
get fullValue() {
|
|
864
|
-
const
|
|
865
|
-
return Object.entries(this._fields).forEach(([
|
|
866
|
-
t
|
|
867
|
-
}),
|
|
860
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
861
|
+
return Object.entries(this._fields).forEach(([t, n]) => {
|
|
862
|
+
e[t] = n.fullValue;
|
|
863
|
+
}), y({}, e);
|
|
868
864
|
}
|
|
869
865
|
notifyValueChanged() {
|
|
870
866
|
if (this.suppressNotifyValueChanged) return;
|
|
871
|
-
const
|
|
872
|
-
if (!k(
|
|
873
|
-
const
|
|
874
|
-
this._value =
|
|
867
|
+
const e = this.value;
|
|
868
|
+
if (!k(e, this._value)) {
|
|
869
|
+
const t = this._value;
|
|
870
|
+
this._value = e, this.actions.trigger(m, this, e, t), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
875
871
|
}
|
|
876
872
|
}
|
|
877
873
|
get valid() {
|
|
878
|
-
return super.valid && Object.values(this._fields).every((
|
|
874
|
+
return super.valid && Object.values(this._fields).every((e) => e.valid);
|
|
879
875
|
}
|
|
880
|
-
validate(
|
|
881
|
-
|
|
876
|
+
validate(e = !1) {
|
|
877
|
+
e && Object.values(this._fields).forEach((t) => t.validate(!0)), super.validate(e);
|
|
882
878
|
}
|
|
883
|
-
clone(
|
|
884
|
-
var r, a,
|
|
885
|
-
const
|
|
879
|
+
clone(e) {
|
|
880
|
+
var r, a, l;
|
|
881
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
886
882
|
Object.entries(this._fields).forEach(([c, u]) => {
|
|
887
|
-
|
|
883
|
+
t[c] = u.clone();
|
|
888
884
|
});
|
|
889
|
-
const n = new
|
|
890
|
-
value: (r =
|
|
891
|
-
},
|
|
892
|
-
enabled: (a =
|
|
893
|
-
visibility: (
|
|
885
|
+
const n = new _(t, R(y({
|
|
886
|
+
value: (r = e == null ? void 0 : e.value) != null ? r : this.value
|
|
887
|
+
}, e && "originalValue" in e ? { originalValue: e.originalValue } : {}), {
|
|
888
|
+
enabled: (a = e == null ? void 0 : e.enabled) != null ? a : this.enabled,
|
|
889
|
+
visibility: (l = e == null ? void 0 : e.visibility) != null ? l : this.visibility
|
|
894
890
|
}));
|
|
895
891
|
return n.actions = this.actions.clone(), n.actions.triggerEager(n, n.value, n.originalValue), n;
|
|
896
892
|
}
|
|
897
893
|
}
|
|
898
|
-
class
|
|
899
|
-
constructor(
|
|
894
|
+
class G extends x {
|
|
895
|
+
constructor(e, t) {
|
|
900
896
|
super();
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
if (this._itemTemplate =
|
|
905
|
-
const n =
|
|
906
|
-
[...a || [], ...
|
|
897
|
+
o(this, "_value", null);
|
|
898
|
+
o(this, "_itemTemplate");
|
|
899
|
+
o(this, "_previousValue");
|
|
900
|
+
if (this._itemTemplate = e, t) {
|
|
901
|
+
const n = t, { value: r, validators: a, actions: l } = n, c = I(n, ["value", "validators", "actions"]);
|
|
902
|
+
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), r && this.setValueInternal(r);
|
|
907
903
|
}
|
|
908
904
|
this.originalValue === void 0 && (this.originalValue = this.value), this._previousValue = this.value, this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
909
905
|
}
|
|
910
|
-
processSetValueItem(
|
|
911
|
-
let
|
|
912
|
-
return
|
|
906
|
+
processSetValueItem(e) {
|
|
907
|
+
let t;
|
|
908
|
+
return e instanceof _ ? t = e : this._itemTemplate ? t = this._itemTemplate.clone({ value: e }) : t = _.createFromFormData(e), Object.defineProperty(t, "parent", { get: () => this, configurable: !1, enumerable: !1 }), t;
|
|
913
909
|
}
|
|
914
|
-
setValueInternal(
|
|
915
|
-
Array.isArray(
|
|
910
|
+
setValueInternal(e) {
|
|
911
|
+
Array.isArray(e) && (this._value = e.map((t) => this.processSetValueItem(t)));
|
|
916
912
|
}
|
|
917
913
|
get value() {
|
|
918
|
-
var
|
|
919
|
-
const
|
|
920
|
-
return H(
|
|
914
|
+
var t;
|
|
915
|
+
const e = (t = this._value) == null ? void 0 : t.map((n) => n.value);
|
|
916
|
+
return H(e) ? null : e;
|
|
921
917
|
}
|
|
922
|
-
set value(
|
|
923
|
-
const
|
|
924
|
-
this.setValueInternal(
|
|
918
|
+
set value(e) {
|
|
919
|
+
const t = this.value;
|
|
920
|
+
this.setValueInternal(e), this.actions.trigger(m, this, this.value, t), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
925
921
|
}
|
|
926
922
|
get touched() {
|
|
927
|
-
var t;
|
|
928
|
-
return ((t = this._value) == null ? void 0 : t.some((e) => e.touched)) || !1;
|
|
929
|
-
}
|
|
930
|
-
set touched(t) {
|
|
931
923
|
var e;
|
|
932
|
-
(e = this._value) == null
|
|
933
|
-
|
|
924
|
+
return ((e = this._value) == null ? void 0 : e.some((t) => t.touched)) || !1;
|
|
925
|
+
}
|
|
926
|
+
set touched(e) {
|
|
927
|
+
var t;
|
|
928
|
+
(t = this._value) == null || t.forEach((n) => {
|
|
929
|
+
n.touched = e;
|
|
934
930
|
});
|
|
935
931
|
}
|
|
936
|
-
clone(
|
|
937
|
-
var n, r, a,
|
|
938
|
-
const
|
|
939
|
-
value: [...(r =
|
|
940
|
-
},
|
|
941
|
-
enabled: (
|
|
942
|
-
visibility: (
|
|
932
|
+
clone(e) {
|
|
933
|
+
var n, r, a, l, c;
|
|
934
|
+
const t = new G((n = this._itemTemplate) == null ? void 0 : n.clone(), R(y({
|
|
935
|
+
value: [...(a = (r = e == null ? void 0 : e.value) != null ? r : this.value) != null ? a : []]
|
|
936
|
+
}, e && "originalValue" in e ? { originalValue: e.originalValue } : {}), {
|
|
937
|
+
enabled: (l = e == null ? void 0 : e.enabled) != null ? l : this.enabled,
|
|
938
|
+
visibility: (c = e == null ? void 0 : e.visibility) != null ? c : this.visibility
|
|
943
939
|
}));
|
|
944
|
-
return
|
|
940
|
+
return t.actions = this.actions.clone(), t.actions.triggerEager(t, t.value, t.originalValue), t;
|
|
945
941
|
}
|
|
946
942
|
notifyValueChanged() {
|
|
947
|
-
const
|
|
948
|
-
if (!k(
|
|
949
|
-
const
|
|
950
|
-
this._previousValue =
|
|
943
|
+
const e = this.value;
|
|
944
|
+
if (!k(e, this._previousValue)) {
|
|
945
|
+
const t = this._previousValue;
|
|
946
|
+
this._previousValue = e, this.actions.trigger(m, this, e, t), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
951
947
|
}
|
|
952
948
|
}
|
|
953
949
|
get valid() {
|
|
954
|
-
var
|
|
955
|
-
return super.valid && ((
|
|
950
|
+
var e, t;
|
|
951
|
+
return super.valid && ((t = (e = this._value) == null ? void 0 : e.every((n) => n.valid)) != null ? t : !0);
|
|
956
952
|
}
|
|
957
|
-
validate(
|
|
958
|
-
var
|
|
959
|
-
|
|
953
|
+
validate(e = !1) {
|
|
954
|
+
var t;
|
|
955
|
+
e && ((t = this._value) == null || t.forEach((n) => n.validate(!0))), super.validate(e);
|
|
960
956
|
}
|
|
961
|
-
get(
|
|
962
|
-
return this._value != null ? this._value[
|
|
957
|
+
get(e) {
|
|
958
|
+
return this._value != null ? this._value[e] : void 0;
|
|
963
959
|
}
|
|
964
|
-
push(
|
|
965
|
-
var
|
|
966
|
-
return this.insert(
|
|
960
|
+
push(e) {
|
|
961
|
+
var t, n;
|
|
962
|
+
return this.insert(e, (n = (t = this._value) == null ? void 0 : t.length) != null ? n : 0) + 1;
|
|
967
963
|
}
|
|
968
964
|
pop() {
|
|
969
|
-
var
|
|
970
|
-
return this.remove(((
|
|
965
|
+
var e, t;
|
|
966
|
+
return this.remove(((t = (e = this._value) == null ? void 0 : e.length) != null ? t : 0) - 1);
|
|
971
967
|
}
|
|
972
|
-
remove(
|
|
968
|
+
remove(e) {
|
|
973
969
|
var n;
|
|
974
|
-
if (this._value == null ||
|
|
975
|
-
let
|
|
976
|
-
return
|
|
970
|
+
if (this._value == null || e < 0 || this._value.length <= e) return;
|
|
971
|
+
let t = (n = this._value.splice(e, 1)) == null ? void 0 : n[0];
|
|
972
|
+
return t && (t = t.clone(), this.actions.trigger(ue, this, t, e), this.notifyValueChanged()), t;
|
|
977
973
|
}
|
|
978
|
-
insert(
|
|
979
|
-
for (this._value == null && (this._value = []); this._value.length <
|
|
974
|
+
insert(e, t) {
|
|
975
|
+
for (this._value == null && (this._value = []); this._value.length < t; ) {
|
|
980
976
|
const r = this.processSetValueItem(null), a = this._value.push(r);
|
|
981
977
|
this.actions.trigger(z, this, r, a);
|
|
982
978
|
}
|
|
983
|
-
const n = this.processSetValueItem(
|
|
984
|
-
return this._value.splice(
|
|
979
|
+
const n = this.processSetValueItem(e);
|
|
980
|
+
return this._value.splice(t, 0, n), this.actions.trigger(z, this, n, t), this.notifyValueChanged(), t;
|
|
985
981
|
}
|
|
986
982
|
clear() {
|
|
987
983
|
this._value = null, this.notifyValueChanged();
|
|
988
984
|
}
|
|
989
985
|
}
|
|
990
|
-
const
|
|
991
|
-
function
|
|
992
|
-
return
|
|
986
|
+
const he = { useMarkdownInValidators: !0 };
|
|
987
|
+
function $e() {
|
|
988
|
+
return he;
|
|
993
989
|
}
|
|
994
|
-
function
|
|
995
|
-
Object.assign(
|
|
990
|
+
function qe(i) {
|
|
991
|
+
Object.assign(he, i);
|
|
996
992
|
}
|
|
997
|
-
const
|
|
993
|
+
const it = {
|
|
998
994
|
install(i, s) {
|
|
999
|
-
s &&
|
|
995
|
+
s && qe(s);
|
|
1000
996
|
}
|
|
1001
997
|
};
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
998
|
+
function v(i) {
|
|
999
|
+
return $e().useMarkdownInValidators ? new j(i) : i.replace(/[*_~`]/g, "").replace(/!\[(.*?)\]\(.*?\)/g, "$1").replace(/\[(.*?)\]\((.*?)\)/g, "$1").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, `
|
|
1004
1000
|
`);
|
|
1005
1001
|
}
|
|
1006
|
-
class
|
|
1007
|
-
constructor(
|
|
1008
|
-
let r = !1, a,
|
|
1009
|
-
super((u, h, A) => (a = u,
|
|
1010
|
-
new
|
|
1011
|
-
|
|
1002
|
+
class Me extends f {
|
|
1003
|
+
constructor(e, t, n) {
|
|
1004
|
+
let r = !1, a, l;
|
|
1005
|
+
super((u, h, A) => (a = u, l = h, r || (r = !0, this.otherField.registerAction(
|
|
1006
|
+
new m((E, L, O, $) => {
|
|
1007
|
+
L(E, O, $), this.unregistered || this.execute(A, () => null, a, l);
|
|
1012
1008
|
})
|
|
1013
1009
|
)), this.isValidComparison(g(u), g(this.otherField.value)) ? null : [
|
|
1014
1010
|
new p(
|
|
1015
1011
|
this.replacePlaceholders(n, { newValue: u, oldValue: h, field: A, otherField: this.otherField })
|
|
1016
1012
|
)
|
|
1017
1013
|
]));
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
this.otherField =
|
|
1014
|
+
o(this, "otherField");
|
|
1015
|
+
o(this, "isValidComparison");
|
|
1016
|
+
o(this, "unregistered", !1);
|
|
1017
|
+
this.otherField = e, this.isValidComparison = t;
|
|
1022
1018
|
}
|
|
1023
1019
|
unregister() {
|
|
1024
1020
|
this.unregistered = !0;
|
|
1025
1021
|
}
|
|
1026
1022
|
}
|
|
1027
|
-
class
|
|
1028
|
-
constructor(s,
|
|
1029
|
-
const
|
|
1023
|
+
class He extends f {
|
|
1024
|
+
constructor(s, e) {
|
|
1025
|
+
const t = e || v("Must be one of [**{allowedAsText}**]");
|
|
1030
1026
|
let n = s.join(", ");
|
|
1031
|
-
n.length > 60 && (n =
|
|
1027
|
+
n.length > 60 && (n = be(n, {
|
|
1032
1028
|
length: 40,
|
|
1033
1029
|
separator: ", ",
|
|
1034
1030
|
omission: `... (${s.length} items total)`
|
|
1035
1031
|
}));
|
|
1036
|
-
const r = (a,
|
|
1032
|
+
const r = (a, l, c) => s.includes(g(a)) ? null : [
|
|
1037
1033
|
new p(
|
|
1038
|
-
this.replacePlaceholders(
|
|
1034
|
+
this.replacePlaceholders(t, { newValue: a, oldValue: l, field: c, allowedValues: s, allowedAsText: n })
|
|
1039
1035
|
)
|
|
1040
1036
|
];
|
|
1041
1037
|
super(r);
|
|
1042
1038
|
}
|
|
1043
1039
|
}
|
|
1044
|
-
function
|
|
1045
|
-
return i == null ? 0 :
|
|
1040
|
+
function Qe(i) {
|
|
1041
|
+
return i == null ? 0 : te(i) || V(i) ? i.length : se(i) && Object.getPrototypeOf(i) === Object.prototype ? Object.keys(i).length : String(i).length;
|
|
1046
1042
|
}
|
|
1047
|
-
class
|
|
1043
|
+
class ze extends f {
|
|
1048
1044
|
constructor(s) {
|
|
1049
|
-
const
|
|
1050
|
-
super(
|
|
1045
|
+
const e = s || v("Please enter a value"), t = (n, r, a) => Qe(g(n)) === 0 ? [new p(this.replacePlaceholders(e, { newValue: n, oldValue: r, field: a }))] : null;
|
|
1046
|
+
super(t);
|
|
1051
1047
|
}
|
|
1052
1048
|
}
|
|
1053
|
-
class
|
|
1054
|
-
constructor(s,
|
|
1055
|
-
const
|
|
1056
|
-
new p(this.replacePlaceholders(
|
|
1049
|
+
class We extends f {
|
|
1050
|
+
constructor(s, e) {
|
|
1051
|
+
const t = e || v("Value must be larger or equal to **{minValue}**"), n = (r, a, l) => r < s || r === void 0 ? [
|
|
1052
|
+
new p(this.replacePlaceholders(t, { newValue: r, oldValue: a, field: l, minValue: s }))
|
|
1057
1053
|
] : null;
|
|
1058
1054
|
super(n);
|
|
1059
1055
|
}
|
|
1060
1056
|
}
|
|
1061
|
-
class
|
|
1062
|
-
constructor(s,
|
|
1063
|
-
const
|
|
1064
|
-
new p(this.replacePlaceholders(
|
|
1057
|
+
class Xe extends f {
|
|
1058
|
+
constructor(s, e) {
|
|
1059
|
+
const t = e || v("Value must be less than or equal to **{maxValue}**"), n = (r, a, l) => r > s || r === void 0 ? [
|
|
1060
|
+
new p(this.replacePlaceholders(t, { newValue: r, oldValue: a, field: l, maxValue: s }))
|
|
1065
1061
|
] : null;
|
|
1066
1062
|
super(n);
|
|
1067
1063
|
}
|
|
1068
1064
|
}
|
|
1069
|
-
class
|
|
1070
|
-
constructor(s,
|
|
1071
|
-
const n =
|
|
1065
|
+
class Ge extends f {
|
|
1066
|
+
constructor(s, e, t) {
|
|
1067
|
+
const n = t || v("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < s || a > e || a === void 0 ? [
|
|
1072
1068
|
new p(
|
|
1073
|
-
this.replacePlaceholders(n, { newValue: a, oldValue:
|
|
1069
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minValue: s, maxValue: e })
|
|
1074
1070
|
)
|
|
1075
1071
|
] : null;
|
|
1076
1072
|
super(r);
|
|
1077
1073
|
}
|
|
1078
1074
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return i == null ? 0 :
|
|
1075
|
+
function Y(i) {
|
|
1076
|
+
return i == null ? 0 : te(i) || V(i) ? i.length : se(i) && Object.getPrototypeOf(i) === Object.prototype ? Object.keys(i).length : String(i).length;
|
|
1081
1077
|
}
|
|
1082
|
-
class
|
|
1083
|
-
constructor(s,
|
|
1084
|
-
const
|
|
1085
|
-
new p(this.replacePlaceholders(
|
|
1078
|
+
class Ye extends f {
|
|
1079
|
+
constructor(s, e) {
|
|
1080
|
+
const t = e || v("Length must be larger or equal to **{minLength}**"), n = (r, a, l) => Y(r) < s ? [
|
|
1081
|
+
new p(this.replacePlaceholders(t, { newValue: r, oldValue: a, field: l, minLength: s }))
|
|
1086
1082
|
] : null;
|
|
1087
1083
|
super(n);
|
|
1088
1084
|
}
|
|
1089
1085
|
}
|
|
1090
|
-
class
|
|
1091
|
-
constructor(s,
|
|
1092
|
-
const
|
|
1093
|
-
new p(this.replacePlaceholders(
|
|
1086
|
+
class Je extends f {
|
|
1087
|
+
constructor(s, e) {
|
|
1088
|
+
const t = e || v("Length must be less than or equal to **{maxLength}**"), n = (r, a, l) => Y(r) > s ? [
|
|
1089
|
+
new p(this.replacePlaceholders(t, { newValue: r, oldValue: a, field: l, maxLength: s }))
|
|
1094
1090
|
] : null;
|
|
1095
1091
|
super(n);
|
|
1096
1092
|
}
|
|
1097
1093
|
}
|
|
1098
|
-
class
|
|
1099
|
-
constructor(s,
|
|
1100
|
-
const n =
|
|
1101
|
-
const u =
|
|
1102
|
-
return u < s || u >
|
|
1094
|
+
class Ke extends f {
|
|
1095
|
+
constructor(s, e, t) {
|
|
1096
|
+
const n = t || v("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
|
|
1097
|
+
const u = Y(a);
|
|
1098
|
+
return u < s || u > e ? [
|
|
1103
1099
|
new p(
|
|
1104
|
-
this.replacePlaceholders(n, { newValue: a, oldValue:
|
|
1100
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minLength: s, maxLength: e })
|
|
1105
1101
|
)
|
|
1106
1102
|
] : null;
|
|
1107
1103
|
};
|
|
1108
1104
|
super(r);
|
|
1109
1105
|
}
|
|
1110
1106
|
}
|
|
1111
|
-
class
|
|
1112
|
-
constructor(s,
|
|
1113
|
-
const
|
|
1114
|
-
new p(this.replacePlaceholders(
|
|
1107
|
+
class Ze extends f {
|
|
1108
|
+
constructor(s, e) {
|
|
1109
|
+
const t = e || v('Value must match pattern "**{pattern}**"'), n = (r, a, l) => s.test(String(g(r))) ? null : [
|
|
1110
|
+
new p(this.replacePlaceholders(t, { newValue: r, oldValue: a, field: l, pattern: s }))
|
|
1115
1111
|
];
|
|
1116
1112
|
super(n);
|
|
1117
1113
|
}
|
|
1118
1114
|
}
|
|
1119
|
-
const
|
|
1115
|
+
const et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1120
1116
|
__proto__: null,
|
|
1121
|
-
CompareTo:
|
|
1122
|
-
InAllowedValues:
|
|
1123
|
-
LengthInRange:
|
|
1124
|
-
MaxLength:
|
|
1125
|
-
MaxValue:
|
|
1126
|
-
MinLength:
|
|
1127
|
-
MinValue:
|
|
1128
|
-
Pattern:
|
|
1129
|
-
Required:
|
|
1117
|
+
CompareTo: Me,
|
|
1118
|
+
InAllowedValues: He,
|
|
1119
|
+
LengthInRange: Ke,
|
|
1120
|
+
MaxLength: Je,
|
|
1121
|
+
MaxValue: Xe,
|
|
1122
|
+
MinLength: Ye,
|
|
1123
|
+
MinValue: We,
|
|
1124
|
+
Pattern: Ze,
|
|
1125
|
+
Required: ze,
|
|
1130
1126
|
Validator: f,
|
|
1131
|
-
ValueInRange:
|
|
1132
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1127
|
+
ValueInRange: Ge
|
|
1128
|
+
}, Symbol.toStringTag, { value: "Module" })), rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1133
1129
|
__proto__: null,
|
|
1134
1130
|
AbortEventHandlingException: Q,
|
|
1135
|
-
Action:
|
|
1136
|
-
ActionsMap:
|
|
1137
|
-
ConditionalEnabledAction:
|
|
1131
|
+
Action: Be,
|
|
1132
|
+
ActionsMap: N,
|
|
1133
|
+
ConditionalEnabledAction: Se,
|
|
1138
1134
|
ConditionalStatementAction: B,
|
|
1139
|
-
ConditionalValueAction:
|
|
1140
|
-
ConditionalVisibilityAction:
|
|
1141
|
-
DisplayMode:
|
|
1142
|
-
EmptyField:
|
|
1143
|
-
EnabledChangedAction:
|
|
1144
|
-
EnabledChangingAction:
|
|
1145
|
-
ExecuteAction:
|
|
1135
|
+
ConditionalValueAction: we,
|
|
1136
|
+
ConditionalVisibilityAction: Ie,
|
|
1137
|
+
DisplayMode: C,
|
|
1138
|
+
EmptyField: ke,
|
|
1139
|
+
EnabledChangedAction: re,
|
|
1140
|
+
EnabledChangingAction: ie,
|
|
1141
|
+
ExecuteAction: ce,
|
|
1146
1142
|
Field: D,
|
|
1147
1143
|
FieldActionBase: b,
|
|
1148
|
-
FieldBase:
|
|
1149
|
-
Group:
|
|
1150
|
-
List:
|
|
1144
|
+
FieldBase: x,
|
|
1145
|
+
Group: _,
|
|
1146
|
+
List: G,
|
|
1151
1147
|
ListItemAddedAction: z,
|
|
1152
|
-
ListItemRemovedAction:
|
|
1153
|
-
MdString:
|
|
1154
|
-
MessagesWidget:
|
|
1148
|
+
ListItemRemovedAction: ue,
|
|
1149
|
+
MdString: j,
|
|
1150
|
+
MessagesWidget: De,
|
|
1155
1151
|
Operator: d,
|
|
1156
|
-
RenderableValue:
|
|
1157
|
-
Statement:
|
|
1158
|
-
ValidChangedAction:
|
|
1152
|
+
RenderableValue: Ve,
|
|
1153
|
+
Statement: w,
|
|
1154
|
+
ValidChangedAction: ae,
|
|
1159
1155
|
ValidationError: X,
|
|
1160
1156
|
ValidationErrorRenderContent: p,
|
|
1161
|
-
ValidationErrorText:
|
|
1157
|
+
ValidationErrorText: _e,
|
|
1162
1158
|
Validator: f,
|
|
1163
|
-
Validators:
|
|
1164
|
-
ValueChangedAction:
|
|
1165
|
-
VisibilityChangedAction:
|
|
1166
|
-
VisibilityChangingAction:
|
|
1167
|
-
buildErrorMessage:
|
|
1159
|
+
Validators: et,
|
|
1160
|
+
ValueChangedAction: m,
|
|
1161
|
+
VisibilityChangedAction: oe,
|
|
1162
|
+
VisibilityChangingAction: le,
|
|
1163
|
+
buildErrorMessage: v,
|
|
1168
1164
|
isCallableFunction: U,
|
|
1169
1165
|
isSimpleComponentDef: W
|
|
1170
1166
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1171
1167
|
export {
|
|
1172
1168
|
Q as AbortEventHandlingException,
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1169
|
+
Be as Action,
|
|
1170
|
+
N as ActionsMap,
|
|
1171
|
+
Se as ConditionalEnabledAction,
|
|
1176
1172
|
B as ConditionalStatementAction,
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1173
|
+
we as ConditionalValueAction,
|
|
1174
|
+
Ie as ConditionalVisibilityAction,
|
|
1175
|
+
C as DisplayMode,
|
|
1176
|
+
ke as EmptyField,
|
|
1177
|
+
re as EnabledChangedAction,
|
|
1178
|
+
ie as EnabledChangingAction,
|
|
1179
|
+
ce as ExecuteAction,
|
|
1184
1180
|
D as Field,
|
|
1185
1181
|
b as FieldActionBase,
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1182
|
+
x as FieldBase,
|
|
1183
|
+
_ as Group,
|
|
1184
|
+
G as List,
|
|
1189
1185
|
z as ListItemAddedAction,
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1186
|
+
ue as ListItemRemovedAction,
|
|
1187
|
+
j as MdString,
|
|
1188
|
+
De as MessagesWidget,
|
|
1193
1189
|
d as Operator,
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1190
|
+
Ve as RenderableValue,
|
|
1191
|
+
w as Statement,
|
|
1192
|
+
ae as ValidChangedAction,
|
|
1197
1193
|
X as ValidationError,
|
|
1198
1194
|
p as ValidationErrorRenderContent,
|
|
1199
|
-
|
|
1195
|
+
_e as ValidationErrorText,
|
|
1200
1196
|
f as Validator,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1197
|
+
et as Validators,
|
|
1198
|
+
m as ValueChangedAction,
|
|
1199
|
+
oe as VisibilityChangedAction,
|
|
1200
|
+
le as VisibilityChangingAction,
|
|
1201
|
+
v as buildErrorMessage,
|
|
1202
|
+
rt as default,
|
|
1203
|
+
it as forms,
|
|
1208
1204
|
U as isCallableFunction,
|
|
1209
1205
|
W as isSimpleComponentDef
|
|
1210
1206
|
};
|