@dynamicforms/vue-forms 0.3.2 → 0.3.4
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.
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var ht = Object.defineProperty, gt = Object.defineProperties;
|
|
2
|
+
var dt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
|
+
var W = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var B = (n, i, t) => i in n ? ht(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t, P = (n, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
|
|
7
|
+
W.call(i, t) && B(n, t, i[t]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var t of w(i))
|
|
10
|
+
J.call(i, t) && B(n, t, i[t]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, O = (n, i) => gt(n, dt(i));
|
|
13
|
+
var I = (n, i) => {
|
|
14
14
|
var t = {};
|
|
15
15
|
for (var e in n)
|
|
16
|
-
|
|
17
|
-
if (n != null &&
|
|
18
|
-
for (var e of
|
|
19
|
-
i.indexOf(e) < 0 &&
|
|
16
|
+
W.call(n, e) && i.indexOf(e) < 0 && (t[e] = n[e]);
|
|
17
|
+
if (n != null && w)
|
|
18
|
+
for (var e of w(n))
|
|
19
|
+
i.indexOf(e) < 0 && J.call(n, e) && (t[e] = n[e]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var o = (n, i, t) =>
|
|
23
|
-
import { isEqual as
|
|
24
|
-
import { unref as d, computed as et, reactive as
|
|
25
|
-
var
|
|
26
|
-
const
|
|
22
|
+
var o = (n, i, t) => B(n, typeof i != "symbol" ? i + "" : i, t);
|
|
23
|
+
import { isEqual as R, isBoolean as ft, isString as A, isEmpty as q, truncate as pt, isArray as Z, isObject as tt } from "lodash-es";
|
|
24
|
+
import { unref as d, computed as et, reactive as bt } from "vue";
|
|
25
|
+
var S = /* @__PURE__ */ ((n) => (n[n.SUPPRESS = 1] = "SUPPRESS", n[n.HIDDEN = 5] = "HIDDEN", n[n.INVISIBLE = 8] = "INVISIBLE", n[n.FULL = 10] = "FULL", n))(S || {});
|
|
26
|
+
const K = 10;
|
|
27
27
|
((n) => {
|
|
28
28
|
function i(s) {
|
|
29
|
-
return s.toUpperCase() === "SUPPRESS" ? 1 : s.toUpperCase() === "HIDDEN" ? 5 : s.toUpperCase() === "INVISIBLE" ? 8 :
|
|
29
|
+
return s.toUpperCase() === "SUPPRESS" ? 1 : s.toUpperCase() === "HIDDEN" ? 5 : s.toUpperCase() === "INVISIBLE" ? 8 : K;
|
|
30
30
|
}
|
|
31
31
|
n.fromString = i;
|
|
32
32
|
function t(s) {
|
|
33
33
|
const r = typeof s == "number" ? s : n.fromString(s);
|
|
34
|
-
return Object.values(n).includes(r) ? r :
|
|
34
|
+
return Object.values(n).includes(r) ? r : K;
|
|
35
35
|
}
|
|
36
36
|
n.fromAny = t;
|
|
37
37
|
function e(s) {
|
|
@@ -39,9 +39,9 @@ const Y = 10;
|
|
|
39
39
|
return Object.values(n).includes(r);
|
|
40
40
|
}
|
|
41
41
|
n.isDefined = e;
|
|
42
|
-
})(
|
|
43
|
-
Object.freeze(
|
|
44
|
-
const
|
|
42
|
+
})(S || (S = {}));
|
|
43
|
+
Object.freeze(S);
|
|
44
|
+
const V = S;
|
|
45
45
|
class p {
|
|
46
46
|
constructor(i) {
|
|
47
47
|
o(this, "executorFn");
|
|
@@ -67,29 +67,29 @@ class p {
|
|
|
67
67
|
unregister() {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
class
|
|
70
|
+
class M extends Error {
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
class
|
|
72
|
+
const it = Symbol("ValueChangedAction");
|
|
73
|
+
class v extends p {
|
|
74
74
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
75
75
|
constructor(i) {
|
|
76
76
|
super(i);
|
|
77
77
|
}
|
|
78
78
|
// eslint-disable-next-line class-methods-use-this
|
|
79
79
|
static get classIdentifier() {
|
|
80
|
-
return
|
|
80
|
+
return it;
|
|
81
81
|
}
|
|
82
82
|
execute(i, t, e, s) {
|
|
83
83
|
return super.execute(i, t, e, s);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
class
|
|
86
|
+
class F extends String {
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function z(n) {
|
|
89
89
|
const i = d(n);
|
|
90
90
|
return typeof i == "object" && "componentName" in i;
|
|
91
91
|
}
|
|
92
|
-
class
|
|
92
|
+
class G {
|
|
93
93
|
get componentName() {
|
|
94
94
|
return "Comment";
|
|
95
95
|
}
|
|
@@ -103,7 +103,7 @@ class X {
|
|
|
103
103
|
}
|
|
104
104
|
// eslint-disable-line class-methods-use-this
|
|
105
105
|
}
|
|
106
|
-
class vt extends
|
|
106
|
+
class vt extends G {
|
|
107
107
|
constructor(t) {
|
|
108
108
|
super();
|
|
109
109
|
o(this, "text");
|
|
@@ -117,7 +117,7 @@ class vt extends X {
|
|
|
117
117
|
return this.text;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class b extends G {
|
|
121
121
|
constructor(t) {
|
|
122
122
|
super();
|
|
123
123
|
o(this, "text");
|
|
@@ -126,7 +126,7 @@ class v extends X {
|
|
|
126
126
|
}
|
|
127
127
|
get getTextType() {
|
|
128
128
|
const t = d(this.text);
|
|
129
|
-
return t ? t instanceof
|
|
129
|
+
return t ? t instanceof F ? "md" : z(t) ? "component" : "string" : "string";
|
|
130
130
|
}
|
|
131
131
|
get componentName() {
|
|
132
132
|
switch (d(this.textType)) {
|
|
@@ -162,30 +162,30 @@ class v extends X {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
const mt = Symbol("Validator");
|
|
165
|
-
class f extends
|
|
165
|
+
class f extends v {
|
|
166
166
|
/**
|
|
167
167
|
* Creates a new validator
|
|
168
168
|
* @param validationFn Function that validates the field value and returns errors or null
|
|
169
169
|
*/
|
|
170
170
|
constructor(t) {
|
|
171
171
|
super((s, r, a, l) => {
|
|
172
|
-
const
|
|
173
|
-
var
|
|
172
|
+
const c = t(a, l, s) || [], u = (h) => {
|
|
173
|
+
var C;
|
|
174
174
|
h == null || h.forEach(
|
|
175
175
|
(x) => Object.defineProperty(x, "source", { value: this.source, enumerable: !1, configurable: !1 })
|
|
176
176
|
);
|
|
177
177
|
for (let x = s.errors.length - 1; x >= 0; x--) {
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
|
|
178
|
+
const T = s.errors[x];
|
|
179
|
+
if (T.source === this.source) {
|
|
180
|
+
const j = (C = h == null ? void 0 : h.findIndex(($) => R($, T))) != null ? C : -1;
|
|
181
|
+
j >= 0 ? h == null || h.splice(j, 1) : s.errors.splice(x, 1);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
h && h.length > 0 && s.errors.push(...h), s.validate();
|
|
185
185
|
};
|
|
186
|
-
return
|
|
186
|
+
return c instanceof Promise ? (s.validating = ++s.validatingCount > 0, c.then((h) => u(h)).finally(() => {
|
|
187
187
|
s.validatingCount = Math.max(0, s.validatingCount - 1), s.validating = s.validatingCount > 0;
|
|
188
|
-
})) : c
|
|
188
|
+
})) : u(c), r(s, a, l);
|
|
189
189
|
});
|
|
190
190
|
o(this, "source");
|
|
191
191
|
this.source = Symbol(this.constructor.name);
|
|
@@ -200,14 +200,14 @@ class f extends b {
|
|
|
200
200
|
}
|
|
201
201
|
// eslint-disable-next-line class-methods-use-this
|
|
202
202
|
replacePlaceholders(t, e) {
|
|
203
|
-
if (
|
|
203
|
+
if (z(t)) return t;
|
|
204
204
|
let s = t;
|
|
205
205
|
return Object.keys(e).forEach((r) => {
|
|
206
206
|
s = s.replaceAll(`{${r}}`, e[r]);
|
|
207
|
-
}), t instanceof
|
|
207
|
+
}), t instanceof F ? new F(s) : s;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
class
|
|
210
|
+
class N extends Map {
|
|
211
211
|
constructor() {
|
|
212
212
|
super(...arguments);
|
|
213
213
|
o(this, "eagerActions", /* @__PURE__ */ new Set());
|
|
@@ -224,12 +224,12 @@ class T extends Map {
|
|
|
224
224
|
}
|
|
225
225
|
trigger(t, e, ...s) {
|
|
226
226
|
const r = t.classIdentifier;
|
|
227
|
-
r ===
|
|
227
|
+
r === it && this.triggerEager(e, ...s);
|
|
228
228
|
const a = this.get(r);
|
|
229
229
|
try {
|
|
230
230
|
if (a) return a(e, ...s);
|
|
231
231
|
} catch (l) {
|
|
232
|
-
if (!(l instanceof
|
|
232
|
+
if (!(l instanceof M)) throw l;
|
|
233
233
|
}
|
|
234
234
|
return null;
|
|
235
235
|
}
|
|
@@ -239,39 +239,39 @@ class T extends Map {
|
|
|
239
239
|
try {
|
|
240
240
|
r && r(t, ...e);
|
|
241
241
|
} catch (a) {
|
|
242
|
-
if (!(a instanceof
|
|
242
|
+
if (!(a instanceof M)) throw a;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
clone() {
|
|
247
|
-
const t = new
|
|
247
|
+
const t = new N();
|
|
248
248
|
return this.registeredActions.forEach((e) => t.register(e)), t;
|
|
249
249
|
}
|
|
250
250
|
cloneWithoutValidators() {
|
|
251
|
-
const t = new
|
|
251
|
+
const t = new N();
|
|
252
252
|
return this.registeredActions.forEach((e) => {
|
|
253
253
|
e instanceof f ? e.unregister() : t.register(e);
|
|
254
254
|
}), t;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
const yt = Symbol("ConditionalStatementAction");
|
|
258
|
-
class
|
|
258
|
+
class U extends v {
|
|
259
259
|
constructor(t, e) {
|
|
260
|
-
const s = (r, a, l,
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
260
|
+
const s = (r, a, l, c) => {
|
|
261
|
+
const u = t.evaluate();
|
|
262
|
+
if (u !== this.lastResult) {
|
|
263
263
|
for (const h of this.boundFields)
|
|
264
|
-
e(h,
|
|
265
|
-
this.lastResult =
|
|
264
|
+
e(h, u, this.lastResult);
|
|
265
|
+
this.lastResult = u;
|
|
266
266
|
}
|
|
267
|
-
return a(r, l,
|
|
267
|
+
return a(r, l, c);
|
|
268
268
|
};
|
|
269
269
|
super(s);
|
|
270
270
|
o(this, "lastResult");
|
|
271
271
|
// boundField tracks the fields this action is bound to. so that it may perform the executorFn on them and not on the
|
|
272
272
|
// ValueChangedAction fields that will call the actionExecutor
|
|
273
273
|
o(this, "boundFields", /* @__PURE__ */ new Set());
|
|
274
|
-
t.collectFields().forEach((r) => r.registerAction(new
|
|
274
|
+
t.collectFields().forEach((r) => r.registerAction(new v(s)));
|
|
275
275
|
}
|
|
276
276
|
// eslint-disable-next-line class-methods-use-this
|
|
277
277
|
static get classIdentifier() {
|
|
@@ -285,28 +285,28 @@ class $ extends b {
|
|
|
285
285
|
this.boundFields.add(t);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
class xt extends
|
|
288
|
+
class xt extends U {
|
|
289
289
|
constructor(i) {
|
|
290
290
|
super(i, (t, e) => {
|
|
291
|
-
t.visibility = e ?
|
|
291
|
+
t.visibility = e ? V.FULL : V.SUPPRESS;
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
class Et extends
|
|
295
|
+
class Et extends U {
|
|
296
296
|
constructor(i) {
|
|
297
297
|
super(i, (t, e) => {
|
|
298
298
|
t.enabled = e;
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
class
|
|
302
|
+
class At extends U {
|
|
303
303
|
constructor(i, t) {
|
|
304
304
|
super(i, (e, s) => {
|
|
305
305
|
s && (e.value = t);
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
var
|
|
309
|
+
var L = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.AND = 2] = "AND", n[n.XOR = 3] = "XOR", n[n.NAND = 4] = "NAND", n[n.NOR = 5] = "NOR", n[n.EQUALS = -1] = "EQUALS", n[n.NOT_EQUALS = -2] = "NOT_EQUALS", n[n.GT = -3] = "GT", n[n.LT = -4] = "LT", n[n.GE = -5] = "GE", n[n.LE = -6] = "LE", n[n.IN = -7] = "IN", n[n.NOT_IN = -8] = "NOT_IN", n[n.INCLUDES = -9] = "INCLUDES", n[n.NOT_INCLUDES = -10] = "NOT_INCLUDES", n))(L || {});
|
|
310
310
|
((n) => {
|
|
311
311
|
function i(r) {
|
|
312
312
|
const a = r.toLowerCase();
|
|
@@ -344,52 +344,52 @@ var w = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.A
|
|
|
344
344
|
return r >= 0;
|
|
345
345
|
}
|
|
346
346
|
n.isLogicOperator = s;
|
|
347
|
-
})(
|
|
348
|
-
Object.freeze(
|
|
349
|
-
const g =
|
|
350
|
-
class
|
|
347
|
+
})(L || (L = {}));
|
|
348
|
+
Object.freeze(L);
|
|
349
|
+
const g = L, Vt = Symbol("EnabledChangingAction");
|
|
350
|
+
class nt extends p {
|
|
351
351
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
352
352
|
constructor(i) {
|
|
353
353
|
super(i);
|
|
354
354
|
}
|
|
355
355
|
// eslint-disable-next-line class-methods-use-this
|
|
356
356
|
static get classIdentifier() {
|
|
357
|
-
return
|
|
357
|
+
return Vt;
|
|
358
358
|
}
|
|
359
359
|
execute(i, t, e, s) {
|
|
360
360
|
return super.execute(i, t, e, s);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
class
|
|
363
|
+
const Ct = Symbol("EnabledChangedAction");
|
|
364
|
+
class st extends p {
|
|
365
365
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
366
366
|
constructor(i) {
|
|
367
367
|
super(i);
|
|
368
368
|
}
|
|
369
369
|
// eslint-disable-next-line class-methods-use-this
|
|
370
370
|
static get classIdentifier() {
|
|
371
|
-
return
|
|
371
|
+
return Ct;
|
|
372
372
|
}
|
|
373
373
|
execute(i, t, e, s) {
|
|
374
374
|
return super.execute(i, t, e, s);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
class
|
|
377
|
+
const It = Symbol("ValidChangedAction");
|
|
378
|
+
class rt extends p {
|
|
379
379
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
380
380
|
constructor(i) {
|
|
381
381
|
super(i);
|
|
382
382
|
}
|
|
383
383
|
// eslint-disable-next-line class-methods-use-this
|
|
384
384
|
static get classIdentifier() {
|
|
385
|
-
return
|
|
385
|
+
return It;
|
|
386
386
|
}
|
|
387
387
|
execute(i, t, e, s) {
|
|
388
388
|
return super.execute(i, t, e, s);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
const _t = Symbol("VisibilityChangingAction");
|
|
392
|
-
class
|
|
392
|
+
class at extends p {
|
|
393
393
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
394
394
|
constructor(i) {
|
|
395
395
|
super(i);
|
|
@@ -403,7 +403,7 @@ class lt extends p {
|
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
const St = Symbol("VisibilityChangedAction");
|
|
406
|
-
class
|
|
406
|
+
class lt extends p {
|
|
407
407
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
408
408
|
constructor(i) {
|
|
409
409
|
super(i);
|
|
@@ -416,7 +416,7 @@ class ot extends p {
|
|
|
416
416
|
return super.execute(i, t, e, s);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
class
|
|
419
|
+
class y {
|
|
420
420
|
constructor() {
|
|
421
421
|
o(this, "reactiveValue", et(() => this.value));
|
|
422
422
|
// contains original field value as was provided at creation
|
|
@@ -426,30 +426,30 @@ class m {
|
|
|
426
426
|
// is current value valid as per FE and BE validators?
|
|
427
427
|
o(this, "errors", []);
|
|
428
428
|
// when member of a Group, fieldName specifies the name of this field
|
|
429
|
-
o(this, "actions", new
|
|
429
|
+
o(this, "actions", new N());
|
|
430
430
|
// default property handlers
|
|
431
|
-
o(this, "_visibility",
|
|
431
|
+
o(this, "_visibility", V.FULL);
|
|
432
432
|
o(this, "_enabled", !0);
|
|
433
433
|
}
|
|
434
434
|
get visibility() {
|
|
435
435
|
return this._visibility;
|
|
436
436
|
}
|
|
437
437
|
set visibility(i) {
|
|
438
|
-
const t = this._visibility, e = this.actions.trigger(
|
|
439
|
-
if (!
|
|
440
|
-
this._visibility =
|
|
438
|
+
const t = this._visibility, e = this.actions.trigger(at, this, i, t);
|
|
439
|
+
if (!V.isDefined(e != null ? e : i)) throw new Error("visibility must be a DisplayMode constant");
|
|
440
|
+
this._visibility = V.fromAny(e != null ? e : i), this.actions.trigger(lt, this, this._visibility, t);
|
|
441
441
|
}
|
|
442
442
|
get enabled() {
|
|
443
443
|
return this._enabled;
|
|
444
444
|
}
|
|
445
445
|
set enabled(i) {
|
|
446
|
-
const t = this._enabled, e = this.actions.trigger(
|
|
447
|
-
if (!
|
|
448
|
-
this._enabled = e != null ? e : i, this.actions.trigger(
|
|
446
|
+
const t = this._enabled, e = this.actions.trigger(nt, this, i, t);
|
|
447
|
+
if (!ft(e != null ? e : i)) throw new Error("Enabled value must be boolean");
|
|
448
|
+
this._enabled = e != null ? e : i, this.actions.trigger(st, this, this._enabled, t);
|
|
449
449
|
}
|
|
450
450
|
validate() {
|
|
451
451
|
const i = this._valid;
|
|
452
|
-
this._valid = this.valid, this._valid !== i && this.actions.trigger(
|
|
452
|
+
this._valid = this.valid, this._valid !== i && this.actions.trigger(rt, this, this.valid, i);
|
|
453
453
|
}
|
|
454
454
|
get valid() {
|
|
455
455
|
return this.errors.length === 0;
|
|
@@ -458,7 +458,7 @@ class m {
|
|
|
458
458
|
return this.value;
|
|
459
459
|
}
|
|
460
460
|
get isChanged() {
|
|
461
|
-
return !
|
|
461
|
+
return !R(this.value, this.originalValue);
|
|
462
462
|
}
|
|
463
463
|
registerAction(i) {
|
|
464
464
|
const t = i;
|
|
@@ -474,7 +474,7 @@ class m {
|
|
|
474
474
|
function Ft(n, i) {
|
|
475
475
|
return n ? !i : i;
|
|
476
476
|
}
|
|
477
|
-
class
|
|
477
|
+
class _ {
|
|
478
478
|
constructor(i, t, e) {
|
|
479
479
|
o(this, "operand1");
|
|
480
480
|
o(this, "operator");
|
|
@@ -482,10 +482,10 @@ class N {
|
|
|
482
482
|
this.operand1 = i, this.operator = t, this.operand2 = e;
|
|
483
483
|
}
|
|
484
484
|
get operand1Value() {
|
|
485
|
-
return this.operand1 instanceof
|
|
485
|
+
return this.operand1 instanceof _ ? this.operand1.evaluate() : this.operand1 instanceof y ? d(this.operand1.value) : this.operand1;
|
|
486
486
|
}
|
|
487
487
|
get operand2Value() {
|
|
488
|
-
return this.operand2 instanceof
|
|
488
|
+
return this.operand2 instanceof _ ? this.operand2.evaluate() : this.operand2 instanceof y ? d(this.operand2.value) : this.operand2;
|
|
489
489
|
}
|
|
490
490
|
evaluate() {
|
|
491
491
|
var e, s, r, a;
|
|
@@ -534,13 +534,13 @@ class N {
|
|
|
534
534
|
collectFields() {
|
|
535
535
|
const i = /* @__PURE__ */ new Set();
|
|
536
536
|
function t(e) {
|
|
537
|
-
e instanceof
|
|
537
|
+
e instanceof y ? i.add(e) : e instanceof _ && e.collectFields().forEach((r) => i.add(r));
|
|
538
538
|
}
|
|
539
539
|
return t(this.operand1), t(this.operand2), i;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
const Nt = Symbol("ExecuteAction");
|
|
543
|
-
class
|
|
543
|
+
class ot extends p {
|
|
544
544
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
545
545
|
constructor(i) {
|
|
546
546
|
super(i);
|
|
@@ -554,7 +554,7 @@ class ut extends p {
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
const Lt = Symbol("ListItemAddedAction");
|
|
557
|
-
class
|
|
557
|
+
class Q extends p {
|
|
558
558
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
559
559
|
constructor(i) {
|
|
560
560
|
super(i);
|
|
@@ -567,7 +567,7 @@ class z extends p {
|
|
|
567
567
|
return super.execute(i, t, e, s);
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
const
|
|
570
|
+
const Tt = Symbol("ListItemRemovedAction");
|
|
571
571
|
class ct extends p {
|
|
572
572
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
573
573
|
constructor(i) {
|
|
@@ -575,76 +575,26 @@ class ct extends p {
|
|
|
575
575
|
}
|
|
576
576
|
// eslint-disable-next-line class-methods-use-this
|
|
577
577
|
static get classIdentifier() {
|
|
578
|
-
return
|
|
578
|
+
return Tt;
|
|
579
579
|
}
|
|
580
580
|
execute(i, t, e, s) {
|
|
581
581
|
return super.execute(i, t, e, s);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
class U extends m {
|
|
588
|
-
constructor() {
|
|
589
|
-
super();
|
|
590
|
-
o(this, "_value", { label: void 0, icon: void 0 });
|
|
591
|
-
}
|
|
592
|
-
init(t) {
|
|
593
|
-
if (t) {
|
|
594
|
-
const e = t, { value: s, originalValue: r, validators: a, actions: l } = e, u = F(e, ["value", "originalValue", "validators", "actions"]);
|
|
595
|
-
[...a || [], ...l || []].forEach((V) => this.registerAction(V)), Object.assign(this, u);
|
|
596
|
-
const c = q(s, this._value), h = Object.freeze({ label: r == null ? void 0 : r.label, icon: r == null ? void 0 : r.icon });
|
|
597
|
-
this._value = q(c, h), this.originalValue = q(h, c);
|
|
598
|
-
}
|
|
599
|
-
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
600
|
-
}
|
|
601
|
-
static create(t) {
|
|
602
|
-
const e = it(new U());
|
|
603
|
-
return e.init(t), e;
|
|
604
|
-
}
|
|
605
|
-
get value() {
|
|
606
|
-
return this._value;
|
|
607
|
-
}
|
|
608
|
-
set value(t) {
|
|
609
|
-
if (!this.enabled) return;
|
|
610
|
-
const e = this._value;
|
|
611
|
-
this._value = t, this.actions.trigger(b, this, t, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
612
|
-
}
|
|
613
|
-
get icon() {
|
|
614
|
-
return this.value.icon;
|
|
615
|
-
}
|
|
616
|
-
set icon(t) {
|
|
617
|
-
this.value.icon = t;
|
|
618
|
-
}
|
|
619
|
-
get label() {
|
|
620
|
-
return this.value.label;
|
|
621
|
-
}
|
|
622
|
-
set label(t) {
|
|
623
|
-
this.value.label = t;
|
|
624
|
-
}
|
|
625
|
-
clone(t) {
|
|
626
|
-
var s, r, a;
|
|
627
|
-
const e = U.create(S(_({
|
|
628
|
-
value: (s = t == null ? void 0 : t.value) != null ? s : this.value
|
|
629
|
-
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
630
|
-
enabled: (r = t == null ? void 0 : t.enabled) != null ? r : this.enabled,
|
|
631
|
-
visibility: (a = t == null ? void 0 : t.visibility) != null ? a : this.visibility
|
|
632
|
-
}));
|
|
633
|
-
return e.actions = this.actions.clone(), e.actions.triggerEager(e, e.value, e.originalValue), e;
|
|
634
|
-
}
|
|
635
|
-
execute(t) {
|
|
636
|
-
this.actions.trigger(ut, this, t);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
class C extends m {
|
|
640
|
-
constructor() {
|
|
584
|
+
const Y = Symbol("FieldConstructorGuard");
|
|
585
|
+
class D extends y {
|
|
586
|
+
constructor(t) {
|
|
641
587
|
super();
|
|
642
588
|
o(this, "_value");
|
|
589
|
+
if (t !== Y) {
|
|
590
|
+
const e = this.constructor.name;
|
|
591
|
+
throw new TypeError(`Don't use constructor to instantiate ${e}. Use ${e}.create<T>`);
|
|
592
|
+
}
|
|
643
593
|
}
|
|
644
594
|
init(t) {
|
|
645
595
|
if (t) {
|
|
646
|
-
const e = t, { value: s, validators: r, actions: a } = e, l =
|
|
647
|
-
[...r || [], ...a || []].forEach((
|
|
596
|
+
const e = t, { value: s, validators: r, actions: a } = e, l = I(e, ["value", "validators", "actions"]);
|
|
597
|
+
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this, l), this._value = s != null ? s : this.originalValue, this.originalValue === void 0 && (this.originalValue = this._value);
|
|
648
598
|
}
|
|
649
599
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
650
600
|
}
|
|
@@ -654,19 +604,19 @@ class C extends m {
|
|
|
654
604
|
* @returns Reactive Field instance
|
|
655
605
|
*/
|
|
656
606
|
static create(t) {
|
|
657
|
-
const e =
|
|
607
|
+
const e = bt(new this(Y));
|
|
658
608
|
return e.init(t), e;
|
|
659
609
|
}
|
|
660
610
|
get value() {
|
|
661
|
-
return
|
|
611
|
+
return this._value;
|
|
662
612
|
}
|
|
663
613
|
set value(t) {
|
|
664
614
|
const e = this._value;
|
|
665
|
-
!this.enabled || e === t || (this._value = t, this.actions.trigger(
|
|
615
|
+
!this.enabled || e === t || (this._value = t, this.actions.trigger(v, this, this._value, e), this.parent && this.parent.notifyValueChanged(), this.validate());
|
|
666
616
|
}
|
|
667
617
|
clone(t) {
|
|
668
618
|
var s, r, a;
|
|
669
|
-
const e =
|
|
619
|
+
const e = this.constructor.create(O(P({
|
|
670
620
|
value: (s = t == null ? void 0 : t.value) != null ? s : this.value
|
|
671
621
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
672
622
|
enabled: (r = t == null ? void 0 : t.enabled) != null ? r : this.enabled,
|
|
@@ -675,12 +625,47 @@ class C extends m {
|
|
|
675
625
|
return e.actions = this.actions.clone(), e.actions.triggerEager(e, e.value, e.originalValue), e;
|
|
676
626
|
}
|
|
677
627
|
}
|
|
678
|
-
const
|
|
628
|
+
const jt = D.create({ value: "EmptyField" }).registerAction(new v(
|
|
679
629
|
() => {
|
|
680
630
|
console.warn("Working with EmptyField! This should not happen");
|
|
681
631
|
}
|
|
682
632
|
));
|
|
683
|
-
|
|
633
|
+
function k(n, i) {
|
|
634
|
+
return (n == null ? void 0 : n.label) == null && (n == null ? void 0 : n.icon) == null ? i : n;
|
|
635
|
+
}
|
|
636
|
+
class wt extends D {
|
|
637
|
+
constructor(i) {
|
|
638
|
+
super(i), this._value = { label: void 0, icon: void 0 };
|
|
639
|
+
}
|
|
640
|
+
init(i) {
|
|
641
|
+
if (i) {
|
|
642
|
+
const t = i, { value: e, originalValue: s, validators: r, actions: a } = t, l = I(t, ["value", "originalValue", "validators", "actions"]);
|
|
643
|
+
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this, l);
|
|
644
|
+
const c = k(e, this._value), u = Object.freeze({ label: s == null ? void 0 : s.label, icon: s == null ? void 0 : s.icon });
|
|
645
|
+
this._value = k(c, u), this.originalValue = k(u, c);
|
|
646
|
+
}
|
|
647
|
+
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
648
|
+
}
|
|
649
|
+
static create(i) {
|
|
650
|
+
return super.create(i);
|
|
651
|
+
}
|
|
652
|
+
get icon() {
|
|
653
|
+
return this.value.icon;
|
|
654
|
+
}
|
|
655
|
+
set icon(i) {
|
|
656
|
+
this.value.icon = i;
|
|
657
|
+
}
|
|
658
|
+
get label() {
|
|
659
|
+
return this.value.label;
|
|
660
|
+
}
|
|
661
|
+
set label(i) {
|
|
662
|
+
this.value.label = i;
|
|
663
|
+
}
|
|
664
|
+
execute(i) {
|
|
665
|
+
this.actions.trigger(ot, this, i);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
class E extends y {
|
|
684
669
|
constructor(t, e) {
|
|
685
670
|
super();
|
|
686
671
|
o(this, "_fields");
|
|
@@ -688,8 +673,8 @@ class E extends m {
|
|
|
688
673
|
o(this, "suppressNotifyValueChanged", !1);
|
|
689
674
|
if (!E.isValidFields(t)) throw new Error("Invalid fields object provided");
|
|
690
675
|
if (this._fields = {}, Object.entries(t).forEach(([r, a]) => this.addField(r, a)), e) {
|
|
691
|
-
const s = e, { value: r, validators: a, actions: l } = s,
|
|
692
|
-
[...a || [], ...l || []].forEach((
|
|
676
|
+
const s = e, { value: r, validators: a, actions: l } = s, c = I(s, ["value", "validators", "actions"]);
|
|
677
|
+
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
693
678
|
}
|
|
694
679
|
this.originalValue === void 0 && (this.originalValue = this.value), this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
695
680
|
}
|
|
@@ -706,16 +691,16 @@ class E extends m {
|
|
|
706
691
|
}
|
|
707
692
|
static isValidFields(t) {
|
|
708
693
|
function e(s) {
|
|
709
|
-
return s instanceof
|
|
694
|
+
return s instanceof y;
|
|
710
695
|
}
|
|
711
696
|
return typeof t == "object" && t !== null && Object.entries(t).every(([, s]) => e(s));
|
|
712
697
|
}
|
|
713
698
|
static createFromFormData(t) {
|
|
714
|
-
if (t instanceof
|
|
699
|
+
if (t instanceof y)
|
|
715
700
|
throw new Error("data is already a Form structure, should be a simple object");
|
|
716
701
|
return new E(
|
|
717
702
|
t == null ? {} : Object.fromEntries(
|
|
718
|
-
Object.entries(t).map(([e, s]) => [e,
|
|
703
|
+
Object.entries(t).map(([e, s]) => [e, D.create({ value: s })])
|
|
719
704
|
)
|
|
720
705
|
);
|
|
721
706
|
}
|
|
@@ -730,8 +715,8 @@ class E extends m {
|
|
|
730
715
|
const t = {};
|
|
731
716
|
return Object.entries(this._fields).forEach(([e, s]) => {
|
|
732
717
|
const r = s.value;
|
|
733
|
-
(s.enabled || s instanceof E && !
|
|
734
|
-
}),
|
|
718
|
+
(s.enabled || s instanceof E && !q(r)) && (t[e] = r);
|
|
719
|
+
}), q(t) ? null : t;
|
|
735
720
|
}
|
|
736
721
|
set value(t) {
|
|
737
722
|
this.suppressNotifyValueChanged = !0;
|
|
@@ -753,9 +738,9 @@ class E extends m {
|
|
|
753
738
|
notifyValueChanged() {
|
|
754
739
|
if (this.suppressNotifyValueChanged) return;
|
|
755
740
|
const t = this.value;
|
|
756
|
-
if (!
|
|
741
|
+
if (!R(t, this._value)) {
|
|
757
742
|
const e = this._value;
|
|
758
|
-
this._value = t, this.actions.trigger(
|
|
743
|
+
this._value = t, this.actions.trigger(v, this, t, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
759
744
|
}
|
|
760
745
|
}
|
|
761
746
|
get valid() {
|
|
@@ -764,10 +749,10 @@ class E extends m {
|
|
|
764
749
|
clone(t) {
|
|
765
750
|
var r, a, l;
|
|
766
751
|
const e = {};
|
|
767
|
-
Object.entries(this._fields).forEach(([
|
|
768
|
-
e[
|
|
752
|
+
Object.entries(this._fields).forEach(([c, u]) => {
|
|
753
|
+
e[c] = u.clone();
|
|
769
754
|
});
|
|
770
|
-
const s = new E(e,
|
|
755
|
+
const s = new E(e, O(P({
|
|
771
756
|
value: (r = t == null ? void 0 : t.value) != null ? r : this.value
|
|
772
757
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
773
758
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
@@ -776,15 +761,15 @@ class E extends m {
|
|
|
776
761
|
return s.actions = this.actions.clone(), s.actions.triggerEager(s, s.value, s.originalValue), s;
|
|
777
762
|
}
|
|
778
763
|
}
|
|
779
|
-
class
|
|
764
|
+
class H extends y {
|
|
780
765
|
constructor(t, e) {
|
|
781
766
|
super();
|
|
782
767
|
o(this, "_value", null);
|
|
783
768
|
o(this, "_itemTemplate");
|
|
784
769
|
o(this, "_previousValue");
|
|
785
770
|
if (this._itemTemplate = t, e) {
|
|
786
|
-
const s = e, { value: r, validators: a, actions: l } = s,
|
|
787
|
-
[...a || [], ...l || []].forEach((
|
|
771
|
+
const s = e, { value: r, validators: a, actions: l } = s, c = I(s, ["value", "validators", "actions"]);
|
|
772
|
+
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), r && this.setValueInternal(r);
|
|
788
773
|
}
|
|
789
774
|
this.originalValue === void 0 && (this.originalValue = this.value), this._previousValue = this.value, this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
790
775
|
}
|
|
@@ -798,15 +783,15 @@ class G extends m {
|
|
|
798
783
|
get value() {
|
|
799
784
|
var e;
|
|
800
785
|
const t = (e = this._value) == null ? void 0 : e.map((s) => s.value);
|
|
801
|
-
return
|
|
786
|
+
return q(t) ? null : t;
|
|
802
787
|
}
|
|
803
788
|
set value(t) {
|
|
804
789
|
const e = this.value;
|
|
805
|
-
this.setValueInternal(t), this.actions.trigger(
|
|
790
|
+
this.setValueInternal(t), this.actions.trigger(v, this, this.value, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
806
791
|
}
|
|
807
792
|
clone(t) {
|
|
808
793
|
var s, r, a, l;
|
|
809
|
-
const e = new
|
|
794
|
+
const e = new H((s = this._itemTemplate) == null ? void 0 : s.clone(), O(P({
|
|
810
795
|
value: [...(r = t == null ? void 0 : t.value) != null ? r : this.value]
|
|
811
796
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
812
797
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
@@ -816,9 +801,9 @@ class G extends m {
|
|
|
816
801
|
}
|
|
817
802
|
notifyValueChanged() {
|
|
818
803
|
const t = this.value;
|
|
819
|
-
if (!
|
|
804
|
+
if (!R(t, this._previousValue)) {
|
|
820
805
|
const e = this._previousValue;
|
|
821
|
-
this._previousValue = t, this.actions.trigger(
|
|
806
|
+
this._previousValue = t, this.actions.trigger(v, this, t, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
822
807
|
}
|
|
823
808
|
}
|
|
824
809
|
get valid() {
|
|
@@ -845,39 +830,39 @@ class G extends m {
|
|
|
845
830
|
insert(t, e) {
|
|
846
831
|
for (this._value == null && (this._value = []); this._value.length < e; ) {
|
|
847
832
|
const r = this.processSetValueItem(null), a = this._value.push(r);
|
|
848
|
-
this.actions.trigger(
|
|
833
|
+
this.actions.trigger(Q, this, r, a);
|
|
849
834
|
}
|
|
850
835
|
const s = this.processSetValueItem(t);
|
|
851
|
-
return this._value.splice(e, 0, s), this.actions.trigger(
|
|
836
|
+
return this._value.splice(e, 0, s), this.actions.trigger(Q, this, s, e), this.notifyValueChanged(), e;
|
|
852
837
|
}
|
|
853
838
|
clear() {
|
|
854
839
|
this._value = null, this.notifyValueChanged();
|
|
855
840
|
}
|
|
856
841
|
}
|
|
857
|
-
const
|
|
858
|
-
function
|
|
859
|
-
return
|
|
842
|
+
const ut = { useMarkdownInValidators: !0 };
|
|
843
|
+
function Pt() {
|
|
844
|
+
return ut;
|
|
860
845
|
}
|
|
861
|
-
function
|
|
862
|
-
Object.assign(
|
|
846
|
+
function Ot(n) {
|
|
847
|
+
Object.assign(ut, n);
|
|
863
848
|
}
|
|
864
|
-
const
|
|
849
|
+
const Kt = {
|
|
865
850
|
install(n, i) {
|
|
866
|
-
i &&
|
|
851
|
+
i && Ot(i);
|
|
867
852
|
}
|
|
868
853
|
};
|
|
869
|
-
function
|
|
870
|
-
return
|
|
854
|
+
function m(n) {
|
|
855
|
+
return Pt().useMarkdownInValidators ? new F(n) : n.replace(/[*_~`]/g, "").replace(/\[.*?\]\((.*?)\)/g, "$1").replace(/!\[.*?\]\((.*?)\)/g, "").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, `
|
|
871
856
|
`);
|
|
872
857
|
}
|
|
873
|
-
class
|
|
858
|
+
class Rt extends f {
|
|
874
859
|
constructor(t, e, s) {
|
|
875
860
|
let r = !1, a, l;
|
|
876
|
-
super((
|
|
877
|
-
|
|
878
|
-
}))), this.isValidComparison(d(
|
|
879
|
-
new
|
|
880
|
-
this.replacePlaceholders(s, { newValue:
|
|
861
|
+
super((u, h, C) => (a = u, l = h, r || (r = !0, this.otherField.registerAction(new v((x, T, j, $) => {
|
|
862
|
+
T(x, j, $), this.unregistered || this.execute(C, () => null, a, l);
|
|
863
|
+
}))), this.isValidComparison(d(u), d(this.otherField.value)) ? null : [
|
|
864
|
+
new b(
|
|
865
|
+
this.replacePlaceholders(s, { newValue: u, oldValue: h, field: C, otherField: this.otherField })
|
|
881
866
|
)
|
|
882
867
|
]));
|
|
883
868
|
o(this, "unregistered", !1);
|
|
@@ -887,184 +872,184 @@ class Ot extends f {
|
|
|
887
872
|
this.unregistered = !0;
|
|
888
873
|
}
|
|
889
874
|
}
|
|
890
|
-
class
|
|
875
|
+
class Ut extends f {
|
|
891
876
|
constructor(i, t) {
|
|
892
|
-
const e = t ||
|
|
877
|
+
const e = t || m("Must be one of [**{allowedAsText}**]");
|
|
893
878
|
let s = i.join(", ");
|
|
894
879
|
s.length > 60 && (s = pt(s, {
|
|
895
880
|
length: 40,
|
|
896
881
|
separator: ", ",
|
|
897
882
|
omission: `... (${i.length} items total)`
|
|
898
883
|
}));
|
|
899
|
-
const r = (a, l,
|
|
900
|
-
new
|
|
901
|
-
this.replacePlaceholders(e, { newValue: a, oldValue: l, field:
|
|
884
|
+
const r = (a, l, c) => i.includes(d(a)) ? null : [
|
|
885
|
+
new b(
|
|
886
|
+
this.replacePlaceholders(e, { newValue: a, oldValue: l, field: c, allowedValues: i, allowedAsText: s })
|
|
902
887
|
)
|
|
903
888
|
];
|
|
904
889
|
super(r);
|
|
905
890
|
}
|
|
906
891
|
}
|
|
907
|
-
function
|
|
892
|
+
function Dt(n) {
|
|
908
893
|
return n == null ? 0 : Z(n) || A(n) ? n.length : tt(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
|
|
909
894
|
}
|
|
910
|
-
class
|
|
895
|
+
class $t extends f {
|
|
911
896
|
constructor(i) {
|
|
912
|
-
const t = i ||
|
|
897
|
+
const t = i || m("Please enter a value"), e = (s, r, a) => Dt(d(s)) === 0 ? [new b(
|
|
913
898
|
this.replacePlaceholders(t, { newValue: s, oldValue: r, field: a })
|
|
914
899
|
)] : null;
|
|
915
900
|
super(e);
|
|
916
901
|
}
|
|
917
902
|
}
|
|
918
|
-
class
|
|
903
|
+
class Bt extends f {
|
|
919
904
|
constructor(i, t) {
|
|
920
|
-
const e = t ||
|
|
921
|
-
new
|
|
905
|
+
const e = t || m("Value must be larger or equal to **{minValue}**"), s = (r, a, l) => r < i || r === void 0 ? [
|
|
906
|
+
new b(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: i }))
|
|
922
907
|
] : null;
|
|
923
908
|
super(s);
|
|
924
909
|
}
|
|
925
910
|
}
|
|
926
|
-
class
|
|
911
|
+
class kt extends f {
|
|
927
912
|
constructor(i, t) {
|
|
928
|
-
const e = t ||
|
|
929
|
-
new
|
|
913
|
+
const e = t || m("Value must be less than or equal to **{maxValue}**"), s = (r, a, l) => r > i || r === void 0 ? [
|
|
914
|
+
new b(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: i }))
|
|
930
915
|
] : null;
|
|
931
916
|
super(s);
|
|
932
917
|
}
|
|
933
918
|
}
|
|
934
|
-
class
|
|
919
|
+
class qt extends f {
|
|
935
920
|
constructor(i, t, e) {
|
|
936
|
-
const s = e ||
|
|
937
|
-
new
|
|
938
|
-
this.replacePlaceholders(s, { newValue: a, oldValue: l, field:
|
|
921
|
+
const s = e || m("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < i || a > t || a === void 0 ? [
|
|
922
|
+
new b(
|
|
923
|
+
this.replacePlaceholders(s, { newValue: a, oldValue: l, field: c, minValue: i, maxValue: t })
|
|
939
924
|
)
|
|
940
925
|
] : null;
|
|
941
926
|
super(r);
|
|
942
927
|
}
|
|
943
928
|
}
|
|
944
|
-
function
|
|
929
|
+
function X(n) {
|
|
945
930
|
return n == null ? 0 : Z(n) || A(n) ? n.length : tt(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
|
|
946
931
|
}
|
|
947
|
-
class
|
|
932
|
+
class Mt extends f {
|
|
948
933
|
constructor(i, t) {
|
|
949
|
-
const e = t ||
|
|
950
|
-
new
|
|
934
|
+
const e = t || m("Length must be larger or equal to **{minLength}**"), s = (r, a, l) => X(r) < i ? [
|
|
935
|
+
new b(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: i }))
|
|
951
936
|
] : null;
|
|
952
937
|
super(s);
|
|
953
938
|
}
|
|
954
939
|
}
|
|
955
|
-
class
|
|
940
|
+
class Qt extends f {
|
|
956
941
|
constructor(i, t) {
|
|
957
|
-
const e = t ||
|
|
958
|
-
new
|
|
942
|
+
const e = t || m("Length must be less than or equal to **{maxLength}**"), s = (r, a, l) => X(r) > i ? [
|
|
943
|
+
new b(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: i }))
|
|
959
944
|
] : null;
|
|
960
945
|
super(s);
|
|
961
946
|
}
|
|
962
947
|
}
|
|
963
|
-
class
|
|
948
|
+
class zt extends f {
|
|
964
949
|
constructor(i, t, e) {
|
|
965
|
-
const s = e ||
|
|
966
|
-
const
|
|
967
|
-
return
|
|
968
|
-
new
|
|
969
|
-
this.replacePlaceholders(s, { newValue: a, oldValue: l, field:
|
|
950
|
+
const s = e || m("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
|
|
951
|
+
const u = X(a);
|
|
952
|
+
return u < i || u > t ? [
|
|
953
|
+
new b(
|
|
954
|
+
this.replacePlaceholders(s, { newValue: a, oldValue: l, field: c, minLength: i, maxLength: t })
|
|
970
955
|
)
|
|
971
956
|
] : null;
|
|
972
957
|
};
|
|
973
958
|
super(r);
|
|
974
959
|
}
|
|
975
960
|
}
|
|
976
|
-
class
|
|
961
|
+
class Gt extends f {
|
|
977
962
|
constructor(i, t) {
|
|
978
|
-
const e = t ||
|
|
979
|
-
new
|
|
963
|
+
const e = t || m('Value must match pattern "**{pattern}**"'), s = (r, a, l) => i.test(String(d(r))) ? null : [
|
|
964
|
+
new b(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: i }))
|
|
980
965
|
];
|
|
981
966
|
super(s);
|
|
982
967
|
}
|
|
983
968
|
}
|
|
984
969
|
const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
985
970
|
__proto__: null,
|
|
986
|
-
CompareTo:
|
|
987
|
-
InAllowedValues:
|
|
988
|
-
LengthInRange:
|
|
989
|
-
MaxLength:
|
|
990
|
-
MaxValue:
|
|
991
|
-
MinLength:
|
|
992
|
-
MinValue:
|
|
993
|
-
Pattern:
|
|
994
|
-
Required:
|
|
971
|
+
CompareTo: Rt,
|
|
972
|
+
InAllowedValues: Ut,
|
|
973
|
+
LengthInRange: zt,
|
|
974
|
+
MaxLength: Qt,
|
|
975
|
+
MaxValue: kt,
|
|
976
|
+
MinLength: Mt,
|
|
977
|
+
MinValue: Bt,
|
|
978
|
+
Pattern: Gt,
|
|
979
|
+
Required: $t,
|
|
995
980
|
Validator: f,
|
|
996
|
-
ValueInRange:
|
|
997
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
981
|
+
ValueInRange: qt
|
|
982
|
+
}, Symbol.toStringTag, { value: "Module" })), Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
998
983
|
__proto__: null,
|
|
999
|
-
AbortEventHandlingException:
|
|
1000
|
-
Action:
|
|
1001
|
-
ActionsMap:
|
|
984
|
+
AbortEventHandlingException: M,
|
|
985
|
+
Action: wt,
|
|
986
|
+
ActionsMap: N,
|
|
1002
987
|
ConditionalEnabledAction: Et,
|
|
1003
|
-
ConditionalStatementAction:
|
|
1004
|
-
ConditionalValueAction:
|
|
988
|
+
ConditionalStatementAction: U,
|
|
989
|
+
ConditionalValueAction: At,
|
|
1005
990
|
ConditionalVisibilityAction: xt,
|
|
1006
|
-
DisplayMode:
|
|
1007
|
-
EmptyField:
|
|
1008
|
-
EnabledChangedAction:
|
|
1009
|
-
EnabledChangingAction:
|
|
1010
|
-
ExecuteAction:
|
|
1011
|
-
Field:
|
|
991
|
+
DisplayMode: V,
|
|
992
|
+
EmptyField: jt,
|
|
993
|
+
EnabledChangedAction: st,
|
|
994
|
+
EnabledChangingAction: nt,
|
|
995
|
+
ExecuteAction: ot,
|
|
996
|
+
Field: D,
|
|
1012
997
|
FieldActionBase: p,
|
|
1013
|
-
FieldBase:
|
|
998
|
+
FieldBase: y,
|
|
1014
999
|
Group: E,
|
|
1015
|
-
List:
|
|
1016
|
-
ListItemAddedAction:
|
|
1000
|
+
List: H,
|
|
1001
|
+
ListItemAddedAction: Q,
|
|
1017
1002
|
ListItemRemovedAction: ct,
|
|
1018
|
-
MdString:
|
|
1003
|
+
MdString: F,
|
|
1019
1004
|
Operator: g,
|
|
1020
|
-
Statement:
|
|
1021
|
-
ValidChangedAction:
|
|
1022
|
-
ValidationError:
|
|
1023
|
-
ValidationErrorRenderContent:
|
|
1005
|
+
Statement: _,
|
|
1006
|
+
ValidChangedAction: rt,
|
|
1007
|
+
ValidationError: G,
|
|
1008
|
+
ValidationErrorRenderContent: b,
|
|
1024
1009
|
ValidationErrorText: vt,
|
|
1025
1010
|
Validator: f,
|
|
1026
1011
|
Validators: Ht,
|
|
1027
|
-
ValueChangedAction:
|
|
1028
|
-
VisibilityChangedAction:
|
|
1029
|
-
VisibilityChangingAction:
|
|
1030
|
-
buildErrorMessage:
|
|
1031
|
-
isCustomModalContentComponentDef:
|
|
1012
|
+
ValueChangedAction: v,
|
|
1013
|
+
VisibilityChangedAction: lt,
|
|
1014
|
+
VisibilityChangingAction: at,
|
|
1015
|
+
buildErrorMessage: m,
|
|
1016
|
+
isCustomModalContentComponentDef: z
|
|
1032
1017
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1033
1018
|
export {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1019
|
+
M as AbortEventHandlingException,
|
|
1020
|
+
wt as Action,
|
|
1021
|
+
N as ActionsMap,
|
|
1037
1022
|
Et as ConditionalEnabledAction,
|
|
1038
|
-
|
|
1039
|
-
|
|
1023
|
+
U as ConditionalStatementAction,
|
|
1024
|
+
At as ConditionalValueAction,
|
|
1040
1025
|
xt as ConditionalVisibilityAction,
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1026
|
+
V as DisplayMode,
|
|
1027
|
+
jt as EmptyField,
|
|
1028
|
+
st as EnabledChangedAction,
|
|
1029
|
+
nt as EnabledChangingAction,
|
|
1030
|
+
ot as ExecuteAction,
|
|
1031
|
+
D as Field,
|
|
1047
1032
|
p as FieldActionBase,
|
|
1048
|
-
|
|
1033
|
+
y as FieldBase,
|
|
1049
1034
|
E as Group,
|
|
1050
|
-
|
|
1051
|
-
|
|
1035
|
+
H as List,
|
|
1036
|
+
Q as ListItemAddedAction,
|
|
1052
1037
|
ct as ListItemRemovedAction,
|
|
1053
|
-
|
|
1038
|
+
F as MdString,
|
|
1054
1039
|
g as Operator,
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1040
|
+
_ as Statement,
|
|
1041
|
+
rt as ValidChangedAction,
|
|
1042
|
+
G as ValidationError,
|
|
1043
|
+
b as ValidationErrorRenderContent,
|
|
1059
1044
|
vt as ValidationErrorText,
|
|
1060
1045
|
f as Validator,
|
|
1061
1046
|
Ht as Validators,
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1047
|
+
v as ValueChangedAction,
|
|
1048
|
+
lt as VisibilityChangedAction,
|
|
1049
|
+
at as VisibilityChangingAction,
|
|
1050
|
+
m as buildErrorMessage,
|
|
1051
|
+
Yt as default,
|
|
1052
|
+
Kt as forms,
|
|
1053
|
+
z as isCustomModalContentComponentDef
|
|
1069
1054
|
};
|
|
1070
1055
|
//# sourceMappingURL=dynamicforms-vue-forms.js.map
|