@dynamicforms/vue-forms 0.4.4 → 0.4.5
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.
|
@@ -2,46 +2,46 @@ var gt = Object.defineProperty, ft = Object.defineProperties;
|
|
|
2
2
|
var pt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var R = Object.getOwnPropertySymbols;
|
|
4
4
|
var J = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var $ = (
|
|
5
|
+
var $ = (i, s, t) => s in i ? gt(i, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[s] = t, A = (i, s) => {
|
|
6
6
|
for (var t in s || (s = {}))
|
|
7
|
-
J.call(s, t) && $(
|
|
7
|
+
J.call(s, t) && $(i, t, s[t]);
|
|
8
8
|
if (R)
|
|
9
9
|
for (var t of R(s))
|
|
10
|
-
K.call(s, t) && $(
|
|
11
|
-
return
|
|
12
|
-
}, I = (
|
|
13
|
-
var S = (
|
|
10
|
+
K.call(s, t) && $(i, t, s[t]);
|
|
11
|
+
return i;
|
|
12
|
+
}, I = (i, s) => ft(i, pt(s));
|
|
13
|
+
var S = (i, s) => {
|
|
14
14
|
var t = {};
|
|
15
|
-
for (var e in
|
|
16
|
-
J.call(
|
|
17
|
-
if (
|
|
18
|
-
for (var e of R(
|
|
19
|
-
s.indexOf(e) < 0 && K.call(
|
|
15
|
+
for (var e in i)
|
|
16
|
+
J.call(i, e) && s.indexOf(e) < 0 && (t[e] = i[e]);
|
|
17
|
+
if (i != null && R)
|
|
18
|
+
for (var e of R(i))
|
|
19
|
+
s.indexOf(e) < 0 && K.call(i, e) && (t[e] = i[e]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var o = (
|
|
23
|
-
import { isEqual as U, isBoolean as bt, isString as
|
|
22
|
+
var o = (i, s, t) => $(i, typeof s != "symbol" ? s + "" : s, t);
|
|
23
|
+
import { isEqual as U, isBoolean as bt, isString as _, isEmpty as M, truncate as mt, isArray as st, isObject as it } from "lodash-es";
|
|
24
24
|
import { unref as g, computed as z, reactive as vt, defineComponent as yt, resolveComponent as Z, createBlock as xt, openBlock as Et, h as w } from "vue";
|
|
25
|
-
var N = /* @__PURE__ */ ((
|
|
25
|
+
var N = /* @__PURE__ */ ((i) => (i[i.SUPPRESS = 1] = "SUPPRESS", i[i.HIDDEN = 5] = "HIDDEN", i[i.INVISIBLE = 8] = "INVISIBLE", i[i.FULL = 10] = "FULL", i))(N || {});
|
|
26
26
|
const tt = 10;
|
|
27
|
-
((
|
|
28
|
-
function s(
|
|
29
|
-
return
|
|
27
|
+
((i) => {
|
|
28
|
+
function s(n) {
|
|
29
|
+
return n.toUpperCase() === "SUPPRESS" ? 1 : n.toUpperCase() === "HIDDEN" ? 5 : n.toUpperCase() === "INVISIBLE" ? 8 : tt;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
function t(
|
|
33
|
-
const r = typeof
|
|
34
|
-
return Object.values(
|
|
31
|
+
i.fromString = s;
|
|
32
|
+
function t(n) {
|
|
33
|
+
const r = typeof n == "number" ? n : i.fromString(n);
|
|
34
|
+
return Object.values(i).includes(r) ? r : tt;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
function e(
|
|
38
|
-
const r = typeof
|
|
39
|
-
return Object.values(
|
|
36
|
+
i.fromAny = t;
|
|
37
|
+
function e(n) {
|
|
38
|
+
const r = typeof n == "number" ? n : i.fromString(n);
|
|
39
|
+
return Object.values(i).includes(r);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
i.isDefined = e;
|
|
42
42
|
})(N || (N = {}));
|
|
43
43
|
Object.freeze(N);
|
|
44
|
-
const
|
|
44
|
+
const C = N;
|
|
45
45
|
class b {
|
|
46
46
|
constructor(s) {
|
|
47
47
|
o(this, "executorFn");
|
|
@@ -69,7 +69,7 @@ class b {
|
|
|
69
69
|
}
|
|
70
70
|
class H extends Error {
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const nt = Symbol("ValueChangedAction");
|
|
73
73
|
class m extends b {
|
|
74
74
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
75
75
|
constructor(s) {
|
|
@@ -77,16 +77,16 @@ class m extends b {
|
|
|
77
77
|
}
|
|
78
78
|
// eslint-disable-next-line class-methods-use-this
|
|
79
79
|
static get classIdentifier() {
|
|
80
|
-
return
|
|
80
|
+
return nt;
|
|
81
81
|
}
|
|
82
|
-
execute(s, t, e,
|
|
83
|
-
return super.execute(s, t, e,
|
|
82
|
+
execute(s, t, e, n) {
|
|
83
|
+
return super.execute(s, t, e, n);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
class L extends String {
|
|
87
87
|
}
|
|
88
|
-
function G(
|
|
89
|
-
const s = g(
|
|
88
|
+
function G(i) {
|
|
89
|
+
const s = g(i);
|
|
90
90
|
return typeof s == "object" && "componentName" in s;
|
|
91
91
|
}
|
|
92
92
|
class W {
|
|
@@ -103,7 +103,7 @@ class W {
|
|
|
103
103
|
return "";
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
class
|
|
106
|
+
class _t extends W {
|
|
107
107
|
constructor(s, t = "") {
|
|
108
108
|
super(), this.text = s, this.classes = t;
|
|
109
109
|
}
|
|
@@ -166,7 +166,7 @@ class p extends W {
|
|
|
166
166
|
return this.classes;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
class
|
|
169
|
+
class Ct extends p {
|
|
170
170
|
}
|
|
171
171
|
const Vt = Symbol("Validator");
|
|
172
172
|
class f extends m {
|
|
@@ -175,24 +175,24 @@ class f extends m {
|
|
|
175
175
|
* @param validationFn Function that validates the field value and returns errors or null
|
|
176
176
|
*/
|
|
177
177
|
constructor(t) {
|
|
178
|
-
super((
|
|
179
|
-
const c = t(a, l,
|
|
178
|
+
super((n, r, a, l) => {
|
|
179
|
+
const c = t(a, l, n) || [], u = (h) => {
|
|
180
180
|
var V;
|
|
181
181
|
h == null || h.forEach(
|
|
182
182
|
(x) => Object.defineProperty(x, "source", { value: this.source, enumerable: !1, configurable: !1 })
|
|
183
183
|
);
|
|
184
|
-
for (let x =
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
|
|
184
|
+
for (let x = n.errors.length - 1; x >= 0; x--) {
|
|
185
|
+
const O = n.errors[x];
|
|
186
|
+
if (O.source === this.source) {
|
|
187
|
+
const P = (V = h == null ? void 0 : h.findIndex((B) => U(B, O))) != null ? V : -1;
|
|
188
|
+
P >= 0 ? h == null || h.splice(P, 1) : n.errors.splice(x, 1);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
h && h.length > 0 &&
|
|
191
|
+
h && h.length > 0 && n.errors.push(...h), n.validate();
|
|
192
192
|
};
|
|
193
|
-
return c instanceof Promise ? (
|
|
194
|
-
|
|
195
|
-
})) : u(c), r(
|
|
193
|
+
return c instanceof Promise ? (n.validating = ++n.validatingCount > 0, c.then((h) => u(h)).finally(() => {
|
|
194
|
+
n.validatingCount = Math.max(0, n.validatingCount - 1), n.validating = n.validatingCount > 0;
|
|
195
|
+
})) : u(c), r(n, a, l);
|
|
196
196
|
});
|
|
197
197
|
o(this, "source");
|
|
198
198
|
this.source = Symbol(this.constructor.name);
|
|
@@ -208,13 +208,13 @@ class f extends m {
|
|
|
208
208
|
// eslint-disable-next-line class-methods-use-this
|
|
209
209
|
replacePlaceholders(t, e) {
|
|
210
210
|
if (G(t)) return t;
|
|
211
|
-
let
|
|
211
|
+
let n = t;
|
|
212
212
|
return Object.keys(e).forEach((r) => {
|
|
213
|
-
|
|
214
|
-
}), t instanceof L ? new L(
|
|
213
|
+
n = n.replaceAll(`{${r}}`, e[r]);
|
|
214
|
+
}), t instanceof L ? new L(n) : n;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
class
|
|
217
|
+
class j extends Map {
|
|
218
218
|
constructor() {
|
|
219
219
|
super(...arguments);
|
|
220
220
|
o(this, "eagerActions", /* @__PURE__ */ new Set());
|
|
@@ -223,26 +223,26 @@ class T extends Map {
|
|
|
223
223
|
register(t) {
|
|
224
224
|
if (!(t instanceof b)) throw new Error("Invalid action type");
|
|
225
225
|
this.registeredActions.push(t);
|
|
226
|
-
const e = t.classIdentifier,
|
|
226
|
+
const e = t.classIdentifier, n = this.get(e) || (() => null);
|
|
227
227
|
function r(a, ...l) {
|
|
228
|
-
return t.execute(a,
|
|
228
|
+
return t.execute(a, n, ...l);
|
|
229
229
|
}
|
|
230
230
|
this.set(e, r), t.eager && this.eagerActions.add(t.classIdentifier);
|
|
231
231
|
}
|
|
232
|
-
trigger(t, e, ...
|
|
232
|
+
trigger(t, e, ...n) {
|
|
233
233
|
const r = t.classIdentifier;
|
|
234
|
-
r ===
|
|
234
|
+
r === nt && this.triggerEager(e, ...n);
|
|
235
235
|
const a = this.get(r);
|
|
236
236
|
try {
|
|
237
|
-
if (a) return a(e, ...
|
|
237
|
+
if (a) return a(e, ...n);
|
|
238
238
|
} catch (l) {
|
|
239
239
|
if (!(l instanceof H)) throw l;
|
|
240
240
|
}
|
|
241
241
|
return null;
|
|
242
242
|
}
|
|
243
243
|
triggerEager(t, ...e) {
|
|
244
|
-
for (const
|
|
245
|
-
const r = this.get(
|
|
244
|
+
for (const n of this.eagerActions) {
|
|
245
|
+
const r = this.get(n);
|
|
246
246
|
try {
|
|
247
247
|
r && r(t, ...e);
|
|
248
248
|
} catch (a) {
|
|
@@ -251,11 +251,11 @@ class T extends Map {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
clone() {
|
|
254
|
-
const t = new
|
|
254
|
+
const t = new j();
|
|
255
255
|
return this.registeredActions.forEach((e) => t.register(e)), t;
|
|
256
256
|
}
|
|
257
257
|
cloneWithoutValidators() {
|
|
258
|
-
const t = new
|
|
258
|
+
const t = new j();
|
|
259
259
|
return this.registeredActions.forEach((e) => {
|
|
260
260
|
e instanceof f ? e.unregister() : t.register(e);
|
|
261
261
|
}), t;
|
|
@@ -264,7 +264,7 @@ class T extends Map {
|
|
|
264
264
|
const At = Symbol("ConditionalStatementAction");
|
|
265
265
|
class k extends m {
|
|
266
266
|
constructor(t, e) {
|
|
267
|
-
const
|
|
267
|
+
const n = (r, a, l, c) => {
|
|
268
268
|
const u = t.evaluate();
|
|
269
269
|
if (u !== this.lastResult) {
|
|
270
270
|
for (const h of this.boundFields)
|
|
@@ -273,12 +273,12 @@ class k extends m {
|
|
|
273
273
|
}
|
|
274
274
|
return a(r, l, c);
|
|
275
275
|
};
|
|
276
|
-
super(
|
|
276
|
+
super(n);
|
|
277
277
|
o(this, "lastResult");
|
|
278
278
|
// boundField tracks the fields this action is bound to. so that it may perform the executorFn on them and not on the
|
|
279
279
|
// ValueChangedAction fields that will call the actionExecutor
|
|
280
280
|
o(this, "boundFields", /* @__PURE__ */ new Set());
|
|
281
|
-
t.collectFields().forEach((r) => r.registerAction(new m(
|
|
281
|
+
t.collectFields().forEach((r) => r.registerAction(new m(n)));
|
|
282
282
|
}
|
|
283
283
|
// eslint-disable-next-line class-methods-use-this
|
|
284
284
|
static get classIdentifier() {
|
|
@@ -295,7 +295,7 @@ class k extends m {
|
|
|
295
295
|
class It extends k {
|
|
296
296
|
constructor(s) {
|
|
297
297
|
super(s, (t, e) => {
|
|
298
|
-
t.visibility = e ?
|
|
298
|
+
t.visibility = e ? C.FULL : C.SUPPRESS;
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -308,13 +308,13 @@ class St extends k {
|
|
|
308
308
|
}
|
|
309
309
|
class wt extends k {
|
|
310
310
|
constructor(s, t) {
|
|
311
|
-
super(s, (e,
|
|
312
|
-
|
|
311
|
+
super(s, (e, n) => {
|
|
312
|
+
n && (e.value = t);
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
((
|
|
316
|
+
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 || {});
|
|
317
|
+
((i) => {
|
|
318
318
|
function s(r) {
|
|
319
319
|
const a = r.toLowerCase();
|
|
320
320
|
if (a === "not") return 0;
|
|
@@ -335,25 +335,25 @@ var j = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.A
|
|
|
335
335
|
if (["not_includes", "not-includes", "not includes"].includes(a)) return -10;
|
|
336
336
|
throw new Error(`Unrecognised operator ${a}`);
|
|
337
337
|
}
|
|
338
|
-
|
|
338
|
+
i.fromString = s;
|
|
339
339
|
function t(r) {
|
|
340
|
-
const a = typeof r == "number" ? r :
|
|
341
|
-
if (Object.values(
|
|
340
|
+
const a = typeof r == "number" ? r : i.fromString(r);
|
|
341
|
+
if (Object.values(i).includes(a)) return a;
|
|
342
342
|
throw new Error(`Unrecognised operator ${r}`);
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
i.fromAny = t;
|
|
345
345
|
function e(r) {
|
|
346
|
-
const a = typeof r == "number" ? r :
|
|
347
|
-
return Object.values(
|
|
346
|
+
const a = typeof r == "number" ? r : i.fromString(r);
|
|
347
|
+
return Object.values(i).includes(a);
|
|
348
348
|
}
|
|
349
|
-
|
|
350
|
-
function
|
|
349
|
+
i.isDefined = e;
|
|
350
|
+
function n(r) {
|
|
351
351
|
return r >= 0;
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
})(
|
|
355
|
-
Object.freeze(
|
|
356
|
-
const d =
|
|
353
|
+
i.isLogicOperator = n;
|
|
354
|
+
})(T || (T = {}));
|
|
355
|
+
Object.freeze(T);
|
|
356
|
+
const d = T, Ft = Symbol("EnabledChangingAction");
|
|
357
357
|
class rt extends b {
|
|
358
358
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
359
359
|
constructor(s) {
|
|
@@ -363,8 +363,8 @@ class rt extends b {
|
|
|
363
363
|
static get classIdentifier() {
|
|
364
364
|
return Ft;
|
|
365
365
|
}
|
|
366
|
-
execute(s, t, e,
|
|
367
|
-
return super.execute(s, t, e,
|
|
366
|
+
execute(s, t, e, n) {
|
|
367
|
+
return super.execute(s, t, e, n);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
const Nt = Symbol("EnabledChangedAction");
|
|
@@ -377,8 +377,8 @@ class at extends b {
|
|
|
377
377
|
static get classIdentifier() {
|
|
378
378
|
return Nt;
|
|
379
379
|
}
|
|
380
|
-
execute(s, t, e,
|
|
381
|
-
return super.execute(s, t, e,
|
|
380
|
+
execute(s, t, e, n) {
|
|
381
|
+
return super.execute(s, t, e, n);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
const Lt = Symbol("ValidChangedAction");
|
|
@@ -391,11 +391,11 @@ class lt extends b {
|
|
|
391
391
|
static get classIdentifier() {
|
|
392
392
|
return Lt;
|
|
393
393
|
}
|
|
394
|
-
execute(s, t, e,
|
|
395
|
-
return super.execute(s, t, e,
|
|
394
|
+
execute(s, t, e, n) {
|
|
395
|
+
return super.execute(s, t, e, n);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const jt = Symbol("VisibilityChangingAction");
|
|
399
399
|
class ot extends b {
|
|
400
400
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
401
401
|
constructor(s) {
|
|
@@ -403,13 +403,13 @@ class ot extends b {
|
|
|
403
403
|
}
|
|
404
404
|
// eslint-disable-next-line class-methods-use-this
|
|
405
405
|
static get classIdentifier() {
|
|
406
|
-
return
|
|
406
|
+
return jt;
|
|
407
407
|
}
|
|
408
|
-
execute(s, t, e,
|
|
409
|
-
return super.execute(s, t, e,
|
|
408
|
+
execute(s, t, e, n) {
|
|
409
|
+
return super.execute(s, t, e, n);
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
const
|
|
412
|
+
const Tt = Symbol("VisibilityChangedAction");
|
|
413
413
|
class ct extends b {
|
|
414
414
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
415
415
|
constructor(s) {
|
|
@@ -417,10 +417,10 @@ class ct extends b {
|
|
|
417
417
|
}
|
|
418
418
|
// eslint-disable-next-line class-methods-use-this
|
|
419
419
|
static get classIdentifier() {
|
|
420
|
-
return
|
|
420
|
+
return Tt;
|
|
421
421
|
}
|
|
422
|
-
execute(s, t, e,
|
|
423
|
-
return super.execute(s, t, e,
|
|
422
|
+
execute(s, t, e, n) {
|
|
423
|
+
return super.execute(s, t, e, n);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
class y {
|
|
@@ -433,9 +433,9 @@ class y {
|
|
|
433
433
|
// is current value valid as per FE and BE validators?
|
|
434
434
|
o(this, "errors", []);
|
|
435
435
|
// when member of a Group, fieldName specifies the name of this field
|
|
436
|
-
o(this, "actions", new
|
|
436
|
+
o(this, "actions", new j());
|
|
437
437
|
// default property handlers
|
|
438
|
-
o(this, "_visibility",
|
|
438
|
+
o(this, "_visibility", C.FULL);
|
|
439
439
|
o(this, "_enabled", !0);
|
|
440
440
|
}
|
|
441
441
|
get visibility() {
|
|
@@ -443,8 +443,8 @@ class y {
|
|
|
443
443
|
}
|
|
444
444
|
set visibility(s) {
|
|
445
445
|
const t = this._visibility, e = this.actions.trigger(ot, this, s, t);
|
|
446
|
-
if (!
|
|
447
|
-
this._visibility =
|
|
446
|
+
if (!C.isDefined(e != null ? e : s)) throw new Error("visibility must be a DisplayMode constant");
|
|
447
|
+
this._visibility = C.fromAny(e != null ? e : s), this.actions.trigger(ct, this, this._visibility, t);
|
|
448
448
|
}
|
|
449
449
|
get enabled() {
|
|
450
450
|
return this._enabled;
|
|
@@ -479,8 +479,8 @@ class y {
|
|
|
479
479
|
this.actions = this.actions.cloneWithoutValidators(), this.errors = [], this._valid = !0;
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
function
|
|
483
|
-
return
|
|
482
|
+
function Ot(i, s) {
|
|
483
|
+
return i ? !s : s;
|
|
484
484
|
}
|
|
485
485
|
class F {
|
|
486
486
|
constructor(s, t, e) {
|
|
@@ -496,7 +496,7 @@ class F {
|
|
|
496
496
|
return this.operand2 instanceof F ? this.operand2.evaluate() : this.operand2 instanceof y ? g(this.operand2.value) : this.operand2;
|
|
497
497
|
}
|
|
498
498
|
evaluate() {
|
|
499
|
-
var e,
|
|
499
|
+
var e, n, r, a;
|
|
500
500
|
const s = this.operand1Value, t = this.operand2Value;
|
|
501
501
|
switch (this.operator) {
|
|
502
502
|
case d.AND:
|
|
@@ -508,7 +508,7 @@ class F {
|
|
|
508
508
|
case d.NOR:
|
|
509
509
|
return !(s || t);
|
|
510
510
|
case d.XOR:
|
|
511
|
-
return
|
|
511
|
+
return Ot(s, t);
|
|
512
512
|
case d.NOT:
|
|
513
513
|
return !s;
|
|
514
514
|
case d.EQUALS:
|
|
@@ -524,13 +524,13 @@ class F {
|
|
|
524
524
|
case d.GT:
|
|
525
525
|
return s > t;
|
|
526
526
|
case d.IN:
|
|
527
|
-
return (
|
|
527
|
+
return (n = (e = t == null ? void 0 : t.includes) == null ? void 0 : e.call(t, s)) != null ? n : !1;
|
|
528
528
|
case d.NOT_IN:
|
|
529
529
|
return !((a = (r = t == null ? void 0 : t.includes) == null ? void 0 : r.call(t, s)) == null || a);
|
|
530
530
|
case d.INCLUDES:
|
|
531
|
-
return
|
|
531
|
+
return _(s) && _(t) && s.indexOf(t) >= 0;
|
|
532
532
|
case d.NOT_INCLUDES:
|
|
533
|
-
return !(
|
|
533
|
+
return !(_(s) && _(t) && s.indexOf(t) >= 0);
|
|
534
534
|
default:
|
|
535
535
|
throw new Error(`Operator not implemented ${this.operator}`);
|
|
536
536
|
}
|
|
@@ -547,7 +547,7 @@ class F {
|
|
|
547
547
|
return t(this.operand1), t(this.operand2), s;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
550
|
+
const Pt = Symbol("ExecuteAction");
|
|
551
551
|
class ut extends b {
|
|
552
552
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
553
553
|
constructor(s) {
|
|
@@ -555,7 +555,7 @@ class ut extends b {
|
|
|
555
555
|
}
|
|
556
556
|
// eslint-disable-next-line class-methods-use-this
|
|
557
557
|
static get classIdentifier() {
|
|
558
|
-
return
|
|
558
|
+
return Pt;
|
|
559
559
|
}
|
|
560
560
|
execute(s, t, e) {
|
|
561
561
|
return super.execute(s, t, e);
|
|
@@ -571,8 +571,8 @@ class Q extends b {
|
|
|
571
571
|
static get classIdentifier() {
|
|
572
572
|
return Rt;
|
|
573
573
|
}
|
|
574
|
-
execute(s, t, e,
|
|
575
|
-
return super.execute(s, t, e,
|
|
574
|
+
execute(s, t, e, n) {
|
|
575
|
+
return super.execute(s, t, e, n);
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
const Ut = Symbol("ListItemRemovedAction");
|
|
@@ -585,8 +585,8 @@ class ht extends b {
|
|
|
585
585
|
static get classIdentifier() {
|
|
586
586
|
return Ut;
|
|
587
587
|
}
|
|
588
|
-
execute(s, t, e,
|
|
589
|
-
return super.execute(s, t, e,
|
|
588
|
+
execute(s, t, e, n) {
|
|
589
|
+
return super.execute(s, t, e, n);
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
const et = Symbol("FieldConstructorGuard");
|
|
@@ -594,6 +594,7 @@ class D extends y {
|
|
|
594
594
|
constructor(t) {
|
|
595
595
|
super();
|
|
596
596
|
o(this, "_value");
|
|
597
|
+
o(this, "_touched", !1);
|
|
597
598
|
if (t !== et) {
|
|
598
599
|
const e = this.constructor.name;
|
|
599
600
|
throw new TypeError(`Don't use constructor to instantiate ${e}. Use ${e}.create<T>`);
|
|
@@ -601,8 +602,8 @@ class D extends y {
|
|
|
601
602
|
}
|
|
602
603
|
init(t) {
|
|
603
604
|
if (t) {
|
|
604
|
-
const e = t, { value:
|
|
605
|
-
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this, l), this._value =
|
|
605
|
+
const e = t, { value: n, validators: r, actions: a } = e, l = S(e, ["value", "validators", "actions"]);
|
|
606
|
+
[...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);
|
|
606
607
|
}
|
|
607
608
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
608
609
|
}
|
|
@@ -622,10 +623,16 @@ class D extends y {
|
|
|
622
623
|
const e = this._value;
|
|
623
624
|
!this.enabled || e === t || (this._value = t, this.actions.trigger(m, this, this._value, e), this.parent && this.parent.notifyValueChanged(), this.validate());
|
|
624
625
|
}
|
|
626
|
+
get touched() {
|
|
627
|
+
return this._touched;
|
|
628
|
+
}
|
|
629
|
+
set touched(t) {
|
|
630
|
+
this._touched = t;
|
|
631
|
+
}
|
|
625
632
|
clone(t) {
|
|
626
|
-
var
|
|
633
|
+
var n, r, a;
|
|
627
634
|
const e = this.constructor.create(I(A({
|
|
628
|
-
value: (
|
|
635
|
+
value: (n = t == null ? void 0 : t.value) != null ? n : this.value
|
|
629
636
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
630
637
|
enabled: (r = t == null ? void 0 : t.enabled) != null ? r : this.enabled,
|
|
631
638
|
visibility: (a = t == null ? void 0 : t.visibility) != null ? a : this.visibility
|
|
@@ -638,8 +645,8 @@ const kt = D.create({ value: "EmptyField" }).registerAction(new m(
|
|
|
638
645
|
console.warn("Working with EmptyField! This should not happen");
|
|
639
646
|
}
|
|
640
647
|
));
|
|
641
|
-
function q(
|
|
642
|
-
return (
|
|
648
|
+
function q(i, s) {
|
|
649
|
+
return (i == null ? void 0 : i.label) == null && (i == null ? void 0 : i.icon) == null ? s : i;
|
|
643
650
|
}
|
|
644
651
|
class Dt extends D {
|
|
645
652
|
constructor(s) {
|
|
@@ -647,9 +654,9 @@ class Dt extends D {
|
|
|
647
654
|
}
|
|
648
655
|
init(s) {
|
|
649
656
|
if (s) {
|
|
650
|
-
const t = s, { value: e, originalValue:
|
|
657
|
+
const t = s, { value: e, originalValue: n, validators: r, actions: a } = t, l = S(t, ["value", "originalValue", "validators", "actions"]);
|
|
651
658
|
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this, l);
|
|
652
|
-
const c = q(e, this._value), u = Object.freeze({ label:
|
|
659
|
+
const c = q(e, this._value), u = Object.freeze({ label: n == null ? void 0 : n.label, icon: n == null ? void 0 : n.icon });
|
|
653
660
|
this._value = q(c, u), this.originalValue = q(u, c);
|
|
654
661
|
}
|
|
655
662
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -679,8 +686,8 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
679
686
|
message: {},
|
|
680
687
|
classes: { default: "text-error" }
|
|
681
688
|
},
|
|
682
|
-
setup(
|
|
683
|
-
const s =
|
|
689
|
+
setup(i) {
|
|
690
|
+
const s = i, t = Z("vue-markdown"), e = /* @__PURE__ */ new Set([
|
|
684
691
|
"div",
|
|
685
692
|
"span",
|
|
686
693
|
"p",
|
|
@@ -736,7 +743,7 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
736
743
|
"dl",
|
|
737
744
|
"dt",
|
|
738
745
|
"dd"
|
|
739
|
-
]),
|
|
746
|
+
]), n = () => {
|
|
740
747
|
if (typeof s.message == "string") return w("span", { class: s.classes }, s.message);
|
|
741
748
|
const r = [];
|
|
742
749
|
return s.message.forEach((a) => {
|
|
@@ -769,7 +776,7 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
769
776
|
}
|
|
770
777
|
}), r;
|
|
771
778
|
};
|
|
772
|
-
return (r, a) => (Et(), xt(
|
|
779
|
+
return (r, a) => (Et(), xt(n));
|
|
773
780
|
}
|
|
774
781
|
});
|
|
775
782
|
class E extends y {
|
|
@@ -781,7 +788,7 @@ class E extends y {
|
|
|
781
788
|
o(this, "suppressNotifyValueChanged", !1);
|
|
782
789
|
if (!E.isValidFields(t)) throw new Error("Invalid fields object provided");
|
|
783
790
|
if (this._fields = {}, Object.entries(t).forEach(([r, a]) => this.addField(r, a)), e) {
|
|
784
|
-
const
|
|
791
|
+
const n = e, { value: r, validators: a, actions: l } = n, c = S(n, ["value", "validators", "actions"]);
|
|
785
792
|
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
786
793
|
}
|
|
787
794
|
this.originalValue === void 0 && (this.originalValue = this.value), this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -798,17 +805,17 @@ class E extends y {
|
|
|
798
805
|
);
|
|
799
806
|
}
|
|
800
807
|
static isValidFields(t) {
|
|
801
|
-
function e(
|
|
802
|
-
return
|
|
808
|
+
function e(n) {
|
|
809
|
+
return n instanceof y;
|
|
803
810
|
}
|
|
804
|
-
return typeof t == "object" && t !== null && Object.entries(t).every(([,
|
|
811
|
+
return typeof t == "object" && t !== null && Object.entries(t).every(([, n]) => e(n));
|
|
805
812
|
}
|
|
806
813
|
static createFromFormData(t) {
|
|
807
814
|
if (t instanceof y)
|
|
808
815
|
throw new Error("data is already a Form structure, should be a simple object");
|
|
809
816
|
return new E(
|
|
810
817
|
t == null ? {} : Object.fromEntries(
|
|
811
|
-
Object.entries(t).map(([e,
|
|
818
|
+
Object.entries(t).map(([e, n]) => [e, D.create({ value: n })])
|
|
812
819
|
)
|
|
813
820
|
);
|
|
814
821
|
}
|
|
@@ -821,26 +828,34 @@ class E extends y {
|
|
|
821
828
|
}
|
|
822
829
|
get value() {
|
|
823
830
|
const t = {};
|
|
824
|
-
return Object.entries(this._fields).forEach(([e,
|
|
825
|
-
const r =
|
|
826
|
-
(
|
|
831
|
+
return Object.entries(this._fields).forEach(([e, n]) => {
|
|
832
|
+
const r = n.value;
|
|
833
|
+
(n.enabled || n instanceof E && !M(r)) && (t[e] = r);
|
|
827
834
|
}), M(t) ? null : t;
|
|
828
835
|
}
|
|
829
836
|
set value(t) {
|
|
830
837
|
this.suppressNotifyValueChanged = !0;
|
|
831
838
|
try {
|
|
832
|
-
Object.entries(this._fields).forEach(([e,
|
|
833
|
-
(t == null || e in t) && (
|
|
839
|
+
Object.entries(this._fields).forEach(([e, n]) => {
|
|
840
|
+
(t == null || e in t) && (n.value = t == null ? null : t[e]);
|
|
834
841
|
});
|
|
835
842
|
} finally {
|
|
836
843
|
this.suppressNotifyValueChanged = !1;
|
|
837
844
|
}
|
|
838
845
|
this.notifyValueChanged(), this.validate();
|
|
839
846
|
}
|
|
847
|
+
get touched() {
|
|
848
|
+
return Object.values(this._fields).some((t) => t.touched);
|
|
849
|
+
}
|
|
850
|
+
set touched(t) {
|
|
851
|
+
Object.values(this._fields).forEach((e) => {
|
|
852
|
+
e.touched = t;
|
|
853
|
+
});
|
|
854
|
+
}
|
|
840
855
|
get fullValue() {
|
|
841
856
|
const t = {};
|
|
842
|
-
return Object.entries(this._fields).forEach(([e,
|
|
843
|
-
t[e] =
|
|
857
|
+
return Object.entries(this._fields).forEach(([e, n]) => {
|
|
858
|
+
t[e] = n.fullValue;
|
|
844
859
|
}), t;
|
|
845
860
|
}
|
|
846
861
|
notifyValueChanged() {
|
|
@@ -863,13 +878,13 @@ class E extends y {
|
|
|
863
878
|
Object.entries(this._fields).forEach(([c, u]) => {
|
|
864
879
|
e[c] = u.clone();
|
|
865
880
|
});
|
|
866
|
-
const
|
|
881
|
+
const n = new E(e, I(A({
|
|
867
882
|
value: (r = t == null ? void 0 : t.value) != null ? r : this.value
|
|
868
883
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
869
884
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
870
885
|
visibility: (l = t == null ? void 0 : t.visibility) != null ? l : this.visibility
|
|
871
886
|
}));
|
|
872
|
-
return
|
|
887
|
+
return n.actions = this.actions.clone(), n.actions.triggerEager(n, n.value, n.originalValue), n;
|
|
873
888
|
}
|
|
874
889
|
}
|
|
875
890
|
class X extends y {
|
|
@@ -879,7 +894,7 @@ class X extends y {
|
|
|
879
894
|
o(this, "_itemTemplate");
|
|
880
895
|
o(this, "_previousValue");
|
|
881
896
|
if (this._itemTemplate = t, e) {
|
|
882
|
-
const
|
|
897
|
+
const n = e, { value: r, validators: a, actions: l } = n, c = S(n, ["value", "validators", "actions"]);
|
|
883
898
|
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), r && this.setValueInternal(r);
|
|
884
899
|
}
|
|
885
900
|
this.originalValue === void 0 && (this.originalValue = this.value), this._previousValue = this.value, this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -893,16 +908,26 @@ class X extends y {
|
|
|
893
908
|
}
|
|
894
909
|
get value() {
|
|
895
910
|
var e;
|
|
896
|
-
const t = (e = this._value) == null ? void 0 : e.map((
|
|
911
|
+
const t = (e = this._value) == null ? void 0 : e.map((n) => n.value);
|
|
897
912
|
return M(t) ? null : t;
|
|
898
913
|
}
|
|
899
914
|
set value(t) {
|
|
900
915
|
const e = this.value;
|
|
901
916
|
this.setValueInternal(t), this.actions.trigger(m, this, this.value, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
902
917
|
}
|
|
918
|
+
get touched() {
|
|
919
|
+
var t;
|
|
920
|
+
return ((t = this._value) == null ? void 0 : t.some((e) => e.touched)) || !1;
|
|
921
|
+
}
|
|
922
|
+
set touched(t) {
|
|
923
|
+
var e;
|
|
924
|
+
(e = this._value) == null || e.forEach((n) => {
|
|
925
|
+
n.touched = t;
|
|
926
|
+
});
|
|
927
|
+
}
|
|
903
928
|
clone(t) {
|
|
904
|
-
var
|
|
905
|
-
const e = new X((
|
|
929
|
+
var n, r, a, l;
|
|
930
|
+
const e = new X((n = this._itemTemplate) == null ? void 0 : n.clone(), I(A({
|
|
906
931
|
value: [...(r = t == null ? void 0 : t.value) != null ? r : this.value]
|
|
907
932
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
908
933
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
@@ -919,27 +944,27 @@ class X extends y {
|
|
|
919
944
|
}
|
|
920
945
|
get valid() {
|
|
921
946
|
var t, e;
|
|
922
|
-
return super.valid && ((e = (t = this._value) == null ? void 0 : t.every((
|
|
947
|
+
return super.valid && ((e = (t = this._value) == null ? void 0 : t.every((n) => n.valid)) != null ? e : !0);
|
|
923
948
|
}
|
|
924
949
|
validate(t = !1) {
|
|
925
950
|
var e;
|
|
926
|
-
t && ((e = this._value) == null || e.forEach((
|
|
951
|
+
t && ((e = this._value) == null || e.forEach((n) => n.validate(!0))), super.validate(t);
|
|
927
952
|
}
|
|
928
953
|
get(t) {
|
|
929
954
|
return this._value != null ? this._value[t] : void 0;
|
|
930
955
|
}
|
|
931
956
|
push(t) {
|
|
932
|
-
var e,
|
|
933
|
-
return this.insert(t, (
|
|
957
|
+
var e, n;
|
|
958
|
+
return this.insert(t, (n = (e = this._value) == null ? void 0 : e.length) != null ? n : 0) + 1;
|
|
934
959
|
}
|
|
935
960
|
pop() {
|
|
936
961
|
var t, e;
|
|
937
962
|
return this.remove(((e = (t = this._value) == null ? void 0 : t.length) != null ? e : 0) - 1);
|
|
938
963
|
}
|
|
939
964
|
remove(t) {
|
|
940
|
-
var
|
|
965
|
+
var n;
|
|
941
966
|
if (this._value == null || t < 0 || this._value.length <= t) return;
|
|
942
|
-
let e = (
|
|
967
|
+
let e = (n = this._value.splice(t, 1)) == null ? void 0 : n[0];
|
|
943
968
|
return e && (e = e.clone(), this.actions.trigger(ht, this, e, t), this.notifyValueChanged()), e;
|
|
944
969
|
}
|
|
945
970
|
insert(t, e) {
|
|
@@ -947,8 +972,8 @@ class X extends y {
|
|
|
947
972
|
const r = this.processSetValueItem(null), a = this._value.push(r);
|
|
948
973
|
this.actions.trigger(Q, this, r, a);
|
|
949
974
|
}
|
|
950
|
-
const
|
|
951
|
-
return this._value.splice(e, 0,
|
|
975
|
+
const n = this.processSetValueItem(t);
|
|
976
|
+
return this._value.splice(e, 0, n), this.actions.trigger(Q, this, n, e), this.notifyValueChanged(), e;
|
|
952
977
|
}
|
|
953
978
|
clear() {
|
|
954
979
|
this._value = null, this.notifyValueChanged();
|
|
@@ -958,26 +983,26 @@ const dt = { useMarkdownInValidators: !0 };
|
|
|
958
983
|
function $t() {
|
|
959
984
|
return dt;
|
|
960
985
|
}
|
|
961
|
-
function qt(
|
|
962
|
-
Object.assign(dt,
|
|
986
|
+
function qt(i) {
|
|
987
|
+
Object.assign(dt, i);
|
|
963
988
|
}
|
|
964
|
-
const
|
|
965
|
-
install(
|
|
989
|
+
const ne = {
|
|
990
|
+
install(i, s) {
|
|
966
991
|
s && qt(s);
|
|
967
992
|
}
|
|
968
993
|
};
|
|
969
|
-
function v(
|
|
970
|
-
return $t().useMarkdownInValidators ? new L(
|
|
994
|
+
function v(i) {
|
|
995
|
+
return $t().useMarkdownInValidators ? new L(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, `
|
|
971
996
|
`);
|
|
972
997
|
}
|
|
973
998
|
class Mt extends f {
|
|
974
|
-
constructor(t, e,
|
|
999
|
+
constructor(t, e, n) {
|
|
975
1000
|
let r = !1, a, l;
|
|
976
|
-
super((u, h, V) => (a = u, l = h, r || (r = !0, this.otherField.registerAction(new m((x,
|
|
977
|
-
|
|
1001
|
+
super((u, h, V) => (a = u, l = h, r || (r = !0, this.otherField.registerAction(new m((x, O, P, B) => {
|
|
1002
|
+
O(x, P, B), this.unregistered || this.execute(V, () => null, a, l);
|
|
978
1003
|
}))), this.isValidComparison(g(u), g(this.otherField.value)) ? null : [
|
|
979
1004
|
new p(
|
|
980
|
-
this.replacePlaceholders(
|
|
1005
|
+
this.replacePlaceholders(n, { newValue: u, oldValue: h, field: V, otherField: this.otherField })
|
|
981
1006
|
)
|
|
982
1007
|
]));
|
|
983
1008
|
o(this, "unregistered", !1);
|
|
@@ -990,83 +1015,83 @@ class Mt extends f {
|
|
|
990
1015
|
class Ht extends f {
|
|
991
1016
|
constructor(s, t) {
|
|
992
1017
|
const e = t || v("Must be one of [**{allowedAsText}**]");
|
|
993
|
-
let
|
|
994
|
-
|
|
1018
|
+
let n = s.join(", ");
|
|
1019
|
+
n.length > 60 && (n = mt(n, {
|
|
995
1020
|
length: 40,
|
|
996
1021
|
separator: ", ",
|
|
997
1022
|
omission: `... (${s.length} items total)`
|
|
998
1023
|
}));
|
|
999
1024
|
const r = (a, l, c) => s.includes(g(a)) ? null : [
|
|
1000
1025
|
new p(
|
|
1001
|
-
this.replacePlaceholders(e, { newValue: a, oldValue: l, field: c, allowedValues: s, allowedAsText:
|
|
1026
|
+
this.replacePlaceholders(e, { newValue: a, oldValue: l, field: c, allowedValues: s, allowedAsText: n })
|
|
1002
1027
|
)
|
|
1003
1028
|
];
|
|
1004
1029
|
super(r);
|
|
1005
1030
|
}
|
|
1006
1031
|
}
|
|
1007
|
-
function Qt(
|
|
1008
|
-
return
|
|
1032
|
+
function Qt(i) {
|
|
1033
|
+
return i == null ? 0 : st(i) || _(i) ? i.length : it(i) && Object.getPrototypeOf(i) === Object.prototype ? Object.keys(i).length : String(i).length;
|
|
1009
1034
|
}
|
|
1010
1035
|
class zt extends f {
|
|
1011
1036
|
constructor(s) {
|
|
1012
|
-
const t = s || v("Please enter a value"), e = (
|
|
1013
|
-
this.replacePlaceholders(t, { newValue:
|
|
1037
|
+
const t = s || v("Please enter a value"), e = (n, r, a) => Qt(g(n)) === 0 ? [new p(
|
|
1038
|
+
this.replacePlaceholders(t, { newValue: n, oldValue: r, field: a })
|
|
1014
1039
|
)] : null;
|
|
1015
1040
|
super(e);
|
|
1016
1041
|
}
|
|
1017
1042
|
}
|
|
1018
1043
|
class Gt extends f {
|
|
1019
1044
|
constructor(s, t) {
|
|
1020
|
-
const e = t || v("Value must be larger or equal to **{minValue}**"),
|
|
1045
|
+
const e = t || v("Value must be larger or equal to **{minValue}**"), n = (r, a, l) => r < s || r === void 0 ? [
|
|
1021
1046
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: s }))
|
|
1022
1047
|
] : null;
|
|
1023
|
-
super(
|
|
1048
|
+
super(n);
|
|
1024
1049
|
}
|
|
1025
1050
|
}
|
|
1026
1051
|
class Wt extends f {
|
|
1027
1052
|
constructor(s, t) {
|
|
1028
|
-
const e = t || v("Value must be less than or equal to **{maxValue}**"),
|
|
1053
|
+
const e = t || v("Value must be less than or equal to **{maxValue}**"), n = (r, a, l) => r > s || r === void 0 ? [
|
|
1029
1054
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: s }))
|
|
1030
1055
|
] : null;
|
|
1031
|
-
super(
|
|
1056
|
+
super(n);
|
|
1032
1057
|
}
|
|
1033
1058
|
}
|
|
1034
1059
|
class Xt extends f {
|
|
1035
1060
|
constructor(s, t, e) {
|
|
1036
|
-
const
|
|
1061
|
+
const n = e || v("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < s || a > t || a === void 0 ? [
|
|
1037
1062
|
new p(
|
|
1038
|
-
this.replacePlaceholders(
|
|
1063
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minValue: s, maxValue: t })
|
|
1039
1064
|
)
|
|
1040
1065
|
] : null;
|
|
1041
1066
|
super(r);
|
|
1042
1067
|
}
|
|
1043
1068
|
}
|
|
1044
|
-
function Y(
|
|
1045
|
-
return
|
|
1069
|
+
function Y(i) {
|
|
1070
|
+
return i == null ? 0 : st(i) || _(i) ? i.length : it(i) && Object.getPrototypeOf(i) === Object.prototype ? Object.keys(i).length : String(i).length;
|
|
1046
1071
|
}
|
|
1047
1072
|
class Yt extends f {
|
|
1048
1073
|
constructor(s, t) {
|
|
1049
|
-
const e = t || v("Length must be larger or equal to **{minLength}**"),
|
|
1074
|
+
const e = t || v("Length must be larger or equal to **{minLength}**"), n = (r, a, l) => Y(r) < s ? [
|
|
1050
1075
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: s }))
|
|
1051
1076
|
] : null;
|
|
1052
|
-
super(
|
|
1077
|
+
super(n);
|
|
1053
1078
|
}
|
|
1054
1079
|
}
|
|
1055
1080
|
class Jt extends f {
|
|
1056
1081
|
constructor(s, t) {
|
|
1057
|
-
const e = t || v("Length must be less than or equal to **{maxLength}**"),
|
|
1082
|
+
const e = t || v("Length must be less than or equal to **{maxLength}**"), n = (r, a, l) => Y(r) > s ? [
|
|
1058
1083
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: s }))
|
|
1059
1084
|
] : null;
|
|
1060
|
-
super(
|
|
1085
|
+
super(n);
|
|
1061
1086
|
}
|
|
1062
1087
|
}
|
|
1063
1088
|
class Kt extends f {
|
|
1064
1089
|
constructor(s, t, e) {
|
|
1065
|
-
const
|
|
1090
|
+
const n = e || v("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
|
|
1066
1091
|
const u = Y(a);
|
|
1067
1092
|
return u < s || u > t ? [
|
|
1068
1093
|
new p(
|
|
1069
|
-
this.replacePlaceholders(
|
|
1094
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minLength: s, maxLength: t })
|
|
1070
1095
|
)
|
|
1071
1096
|
] : null;
|
|
1072
1097
|
};
|
|
@@ -1075,10 +1100,10 @@ class Kt extends f {
|
|
|
1075
1100
|
}
|
|
1076
1101
|
class Zt extends f {
|
|
1077
1102
|
constructor(s, t) {
|
|
1078
|
-
const e = t || v('Value must match pattern "**{pattern}**"'),
|
|
1103
|
+
const e = t || v('Value must match pattern "**{pattern}**"'), n = (r, a, l) => s.test(String(g(r))) ? null : [
|
|
1079
1104
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: s }))
|
|
1080
1105
|
];
|
|
1081
|
-
super(
|
|
1106
|
+
super(n);
|
|
1082
1107
|
}
|
|
1083
1108
|
}
|
|
1084
1109
|
const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1098,12 +1123,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1098
1123
|
__proto__: null,
|
|
1099
1124
|
AbortEventHandlingException: H,
|
|
1100
1125
|
Action: Dt,
|
|
1101
|
-
ActionsMap:
|
|
1126
|
+
ActionsMap: j,
|
|
1102
1127
|
ConditionalEnabledAction: St,
|
|
1103
1128
|
ConditionalStatementAction: k,
|
|
1104
1129
|
ConditionalValueAction: wt,
|
|
1105
1130
|
ConditionalVisibilityAction: It,
|
|
1106
|
-
DisplayMode:
|
|
1131
|
+
DisplayMode: C,
|
|
1107
1132
|
EmptyField: kt,
|
|
1108
1133
|
EnabledChangedAction: at,
|
|
1109
1134
|
EnabledChangingAction: rt,
|
|
@@ -1118,12 +1143,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1118
1143
|
MdString: L,
|
|
1119
1144
|
MessagesWidget: Bt,
|
|
1120
1145
|
Operator: d,
|
|
1121
|
-
RenderableValue:
|
|
1146
|
+
RenderableValue: Ct,
|
|
1122
1147
|
Statement: F,
|
|
1123
1148
|
ValidChangedAction: lt,
|
|
1124
1149
|
ValidationError: W,
|
|
1125
1150
|
ValidationErrorRenderContent: p,
|
|
1126
|
-
ValidationErrorText:
|
|
1151
|
+
ValidationErrorText: _t,
|
|
1127
1152
|
Validator: f,
|
|
1128
1153
|
Validators: te,
|
|
1129
1154
|
ValueChangedAction: m,
|
|
@@ -1135,12 +1160,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1135
1160
|
export {
|
|
1136
1161
|
H as AbortEventHandlingException,
|
|
1137
1162
|
Dt as Action,
|
|
1138
|
-
|
|
1163
|
+
j as ActionsMap,
|
|
1139
1164
|
St as ConditionalEnabledAction,
|
|
1140
1165
|
k as ConditionalStatementAction,
|
|
1141
1166
|
wt as ConditionalValueAction,
|
|
1142
1167
|
It as ConditionalVisibilityAction,
|
|
1143
|
-
|
|
1168
|
+
C as DisplayMode,
|
|
1144
1169
|
kt as EmptyField,
|
|
1145
1170
|
at as EnabledChangedAction,
|
|
1146
1171
|
rt as EnabledChangingAction,
|
|
@@ -1155,12 +1180,12 @@ export {
|
|
|
1155
1180
|
L as MdString,
|
|
1156
1181
|
Bt as MessagesWidget,
|
|
1157
1182
|
d as Operator,
|
|
1158
|
-
|
|
1183
|
+
Ct as RenderableValue,
|
|
1159
1184
|
F as Statement,
|
|
1160
1185
|
lt as ValidChangedAction,
|
|
1161
1186
|
W as ValidationError,
|
|
1162
1187
|
p as ValidationErrorRenderContent,
|
|
1163
|
-
|
|
1188
|
+
_t as ValidationErrorText,
|
|
1164
1189
|
f as Validator,
|
|
1165
1190
|
te as Validators,
|
|
1166
1191
|
m as ValueChangedAction,
|
|
@@ -1168,7 +1193,7 @@ export {
|
|
|
1168
1193
|
ot as VisibilityChangingAction,
|
|
1169
1194
|
v as buildErrorMessage,
|
|
1170
1195
|
re as default,
|
|
1171
|
-
|
|
1196
|
+
ne as forms,
|
|
1172
1197
|
G as isSimpleComponentDef
|
|
1173
1198
|
};
|
|
1174
1199
|
//# sourceMappingURL=dynamicforms-vue-forms.js.map
|