@dynamicforms/vue-forms 0.4.3 → 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,40 +166,40 @@ class p extends W {
|
|
|
166
166
|
return this.classes;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
class
|
|
169
|
+
class Ct extends p {
|
|
170
170
|
}
|
|
171
|
-
const
|
|
171
|
+
const Vt = Symbol("Validator");
|
|
172
172
|
class f extends m {
|
|
173
173
|
/**
|
|
174
174
|
* Creates a new validator
|
|
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,
|
|
180
|
-
var
|
|
178
|
+
super((n, r, a, l) => {
|
|
179
|
+
const c = t(a, l, n) || [], u = (h) => {
|
|
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);
|
|
199
199
|
}
|
|
200
200
|
// eslint-disable-next-line class-methods-use-this
|
|
201
201
|
static get classIdentifier() {
|
|
202
|
-
return
|
|
202
|
+
return Vt;
|
|
203
203
|
}
|
|
204
204
|
// eslint-disable-next-line class-methods-use-this
|
|
205
205
|
get eager() {
|
|
@@ -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;
|
|
@@ -454,9 +454,10 @@ class y {
|
|
|
454
454
|
if (!bt(e != null ? e : s)) throw new Error("Enabled value must be boolean");
|
|
455
455
|
this._enabled = e != null ? e : s, this.actions.trigger(at, this, this._enabled, t);
|
|
456
456
|
}
|
|
457
|
-
validate() {
|
|
458
|
-
|
|
459
|
-
|
|
457
|
+
validate(s = !1) {
|
|
458
|
+
s && this.actions.triggerEager(this, this.value, this.value);
|
|
459
|
+
const t = this._valid;
|
|
460
|
+
this._valid = this.valid, this._valid !== t && this.actions.trigger(lt, this, this.valid, t);
|
|
460
461
|
}
|
|
461
462
|
get valid() {
|
|
462
463
|
return this.errors.length === 0;
|
|
@@ -478,8 +479,8 @@ class y {
|
|
|
478
479
|
this.actions = this.actions.cloneWithoutValidators(), this.errors = [], this._valid = !0;
|
|
479
480
|
}
|
|
480
481
|
}
|
|
481
|
-
function
|
|
482
|
-
return
|
|
482
|
+
function Ot(i, s) {
|
|
483
|
+
return i ? !s : s;
|
|
483
484
|
}
|
|
484
485
|
class F {
|
|
485
486
|
constructor(s, t, e) {
|
|
@@ -495,7 +496,7 @@ class F {
|
|
|
495
496
|
return this.operand2 instanceof F ? this.operand2.evaluate() : this.operand2 instanceof y ? g(this.operand2.value) : this.operand2;
|
|
496
497
|
}
|
|
497
498
|
evaluate() {
|
|
498
|
-
var e,
|
|
499
|
+
var e, n, r, a;
|
|
499
500
|
const s = this.operand1Value, t = this.operand2Value;
|
|
500
501
|
switch (this.operator) {
|
|
501
502
|
case d.AND:
|
|
@@ -507,7 +508,7 @@ class F {
|
|
|
507
508
|
case d.NOR:
|
|
508
509
|
return !(s || t);
|
|
509
510
|
case d.XOR:
|
|
510
|
-
return
|
|
511
|
+
return Ot(s, t);
|
|
511
512
|
case d.NOT:
|
|
512
513
|
return !s;
|
|
513
514
|
case d.EQUALS:
|
|
@@ -523,13 +524,13 @@ class F {
|
|
|
523
524
|
case d.GT:
|
|
524
525
|
return s > t;
|
|
525
526
|
case d.IN:
|
|
526
|
-
return (
|
|
527
|
+
return (n = (e = t == null ? void 0 : t.includes) == null ? void 0 : e.call(t, s)) != null ? n : !1;
|
|
527
528
|
case d.NOT_IN:
|
|
528
529
|
return !((a = (r = t == null ? void 0 : t.includes) == null ? void 0 : r.call(t, s)) == null || a);
|
|
529
530
|
case d.INCLUDES:
|
|
530
|
-
return
|
|
531
|
+
return _(s) && _(t) && s.indexOf(t) >= 0;
|
|
531
532
|
case d.NOT_INCLUDES:
|
|
532
|
-
return !(
|
|
533
|
+
return !(_(s) && _(t) && s.indexOf(t) >= 0);
|
|
533
534
|
default:
|
|
534
535
|
throw new Error(`Operator not implemented ${this.operator}`);
|
|
535
536
|
}
|
|
@@ -546,7 +547,7 @@ class F {
|
|
|
546
547
|
return t(this.operand1), t(this.operand2), s;
|
|
547
548
|
}
|
|
548
549
|
}
|
|
549
|
-
const
|
|
550
|
+
const Pt = Symbol("ExecuteAction");
|
|
550
551
|
class ut extends b {
|
|
551
552
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
552
553
|
constructor(s) {
|
|
@@ -554,7 +555,7 @@ class ut extends b {
|
|
|
554
555
|
}
|
|
555
556
|
// eslint-disable-next-line class-methods-use-this
|
|
556
557
|
static get classIdentifier() {
|
|
557
|
-
return
|
|
558
|
+
return Pt;
|
|
558
559
|
}
|
|
559
560
|
execute(s, t, e) {
|
|
560
561
|
return super.execute(s, t, e);
|
|
@@ -570,8 +571,8 @@ class Q extends b {
|
|
|
570
571
|
static get classIdentifier() {
|
|
571
572
|
return Rt;
|
|
572
573
|
}
|
|
573
|
-
execute(s, t, e,
|
|
574
|
-
return super.execute(s, t, e,
|
|
574
|
+
execute(s, t, e, n) {
|
|
575
|
+
return super.execute(s, t, e, n);
|
|
575
576
|
}
|
|
576
577
|
}
|
|
577
578
|
const Ut = Symbol("ListItemRemovedAction");
|
|
@@ -584,8 +585,8 @@ class ht extends b {
|
|
|
584
585
|
static get classIdentifier() {
|
|
585
586
|
return Ut;
|
|
586
587
|
}
|
|
587
|
-
execute(s, t, e,
|
|
588
|
-
return super.execute(s, t, e,
|
|
588
|
+
execute(s, t, e, n) {
|
|
589
|
+
return super.execute(s, t, e, n);
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
const et = Symbol("FieldConstructorGuard");
|
|
@@ -593,6 +594,7 @@ class D extends y {
|
|
|
593
594
|
constructor(t) {
|
|
594
595
|
super();
|
|
595
596
|
o(this, "_value");
|
|
597
|
+
o(this, "_touched", !1);
|
|
596
598
|
if (t !== et) {
|
|
597
599
|
const e = this.constructor.name;
|
|
598
600
|
throw new TypeError(`Don't use constructor to instantiate ${e}. Use ${e}.create<T>`);
|
|
@@ -600,8 +602,8 @@ class D extends y {
|
|
|
600
602
|
}
|
|
601
603
|
init(t) {
|
|
602
604
|
if (t) {
|
|
603
|
-
const e = t, { value:
|
|
604
|
-
[...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);
|
|
605
607
|
}
|
|
606
608
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
607
609
|
}
|
|
@@ -621,10 +623,16 @@ class D extends y {
|
|
|
621
623
|
const e = this._value;
|
|
622
624
|
!this.enabled || e === t || (this._value = t, this.actions.trigger(m, this, this._value, e), this.parent && this.parent.notifyValueChanged(), this.validate());
|
|
623
625
|
}
|
|
626
|
+
get touched() {
|
|
627
|
+
return this._touched;
|
|
628
|
+
}
|
|
629
|
+
set touched(t) {
|
|
630
|
+
this._touched = t;
|
|
631
|
+
}
|
|
624
632
|
clone(t) {
|
|
625
|
-
var
|
|
633
|
+
var n, r, a;
|
|
626
634
|
const e = this.constructor.create(I(A({
|
|
627
|
-
value: (
|
|
635
|
+
value: (n = t == null ? void 0 : t.value) != null ? n : this.value
|
|
628
636
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
629
637
|
enabled: (r = t == null ? void 0 : t.enabled) != null ? r : this.enabled,
|
|
630
638
|
visibility: (a = t == null ? void 0 : t.visibility) != null ? a : this.visibility
|
|
@@ -637,8 +645,8 @@ const kt = D.create({ value: "EmptyField" }).registerAction(new m(
|
|
|
637
645
|
console.warn("Working with EmptyField! This should not happen");
|
|
638
646
|
}
|
|
639
647
|
));
|
|
640
|
-
function q(
|
|
641
|
-
return (
|
|
648
|
+
function q(i, s) {
|
|
649
|
+
return (i == null ? void 0 : i.label) == null && (i == null ? void 0 : i.icon) == null ? s : i;
|
|
642
650
|
}
|
|
643
651
|
class Dt extends D {
|
|
644
652
|
constructor(s) {
|
|
@@ -646,9 +654,9 @@ class Dt extends D {
|
|
|
646
654
|
}
|
|
647
655
|
init(s) {
|
|
648
656
|
if (s) {
|
|
649
|
-
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"]);
|
|
650
658
|
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this, l);
|
|
651
|
-
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 });
|
|
652
660
|
this._value = q(c, u), this.originalValue = q(u, c);
|
|
653
661
|
}
|
|
654
662
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -678,8 +686,8 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
678
686
|
message: {},
|
|
679
687
|
classes: { default: "text-error" }
|
|
680
688
|
},
|
|
681
|
-
setup(
|
|
682
|
-
const s =
|
|
689
|
+
setup(i) {
|
|
690
|
+
const s = i, t = Z("vue-markdown"), e = /* @__PURE__ */ new Set([
|
|
683
691
|
"div",
|
|
684
692
|
"span",
|
|
685
693
|
"p",
|
|
@@ -735,7 +743,7 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
735
743
|
"dl",
|
|
736
744
|
"dt",
|
|
737
745
|
"dd"
|
|
738
|
-
]),
|
|
746
|
+
]), n = () => {
|
|
739
747
|
if (typeof s.message == "string") return w("span", { class: s.classes }, s.message);
|
|
740
748
|
const r = [];
|
|
741
749
|
return s.message.forEach((a) => {
|
|
@@ -768,7 +776,7 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
768
776
|
}
|
|
769
777
|
}), r;
|
|
770
778
|
};
|
|
771
|
-
return (r, a) => (Et(), xt(
|
|
779
|
+
return (r, a) => (Et(), xt(n));
|
|
772
780
|
}
|
|
773
781
|
});
|
|
774
782
|
class E extends y {
|
|
@@ -780,7 +788,7 @@ class E extends y {
|
|
|
780
788
|
o(this, "suppressNotifyValueChanged", !1);
|
|
781
789
|
if (!E.isValidFields(t)) throw new Error("Invalid fields object provided");
|
|
782
790
|
if (this._fields = {}, Object.entries(t).forEach(([r, a]) => this.addField(r, a)), e) {
|
|
783
|
-
const
|
|
791
|
+
const n = e, { value: r, validators: a, actions: l } = n, c = S(n, ["value", "validators", "actions"]);
|
|
784
792
|
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
785
793
|
}
|
|
786
794
|
this.originalValue === void 0 && (this.originalValue = this.value), this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -797,17 +805,17 @@ class E extends y {
|
|
|
797
805
|
);
|
|
798
806
|
}
|
|
799
807
|
static isValidFields(t) {
|
|
800
|
-
function e(
|
|
801
|
-
return
|
|
808
|
+
function e(n) {
|
|
809
|
+
return n instanceof y;
|
|
802
810
|
}
|
|
803
|
-
return typeof t == "object" && t !== null && Object.entries(t).every(([,
|
|
811
|
+
return typeof t == "object" && t !== null && Object.entries(t).every(([, n]) => e(n));
|
|
804
812
|
}
|
|
805
813
|
static createFromFormData(t) {
|
|
806
814
|
if (t instanceof y)
|
|
807
815
|
throw new Error("data is already a Form structure, should be a simple object");
|
|
808
816
|
return new E(
|
|
809
817
|
t == null ? {} : Object.fromEntries(
|
|
810
|
-
Object.entries(t).map(([e,
|
|
818
|
+
Object.entries(t).map(([e, n]) => [e, D.create({ value: n })])
|
|
811
819
|
)
|
|
812
820
|
);
|
|
813
821
|
}
|
|
@@ -820,26 +828,34 @@ class E extends y {
|
|
|
820
828
|
}
|
|
821
829
|
get value() {
|
|
822
830
|
const t = {};
|
|
823
|
-
return Object.entries(this._fields).forEach(([e,
|
|
824
|
-
const r =
|
|
825
|
-
(
|
|
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);
|
|
826
834
|
}), M(t) ? null : t;
|
|
827
835
|
}
|
|
828
836
|
set value(t) {
|
|
829
837
|
this.suppressNotifyValueChanged = !0;
|
|
830
838
|
try {
|
|
831
|
-
Object.entries(this._fields).forEach(([e,
|
|
832
|
-
(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]);
|
|
833
841
|
});
|
|
834
842
|
} finally {
|
|
835
843
|
this.suppressNotifyValueChanged = !1;
|
|
836
844
|
}
|
|
837
845
|
this.notifyValueChanged(), this.validate();
|
|
838
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
|
+
}
|
|
839
855
|
get fullValue() {
|
|
840
856
|
const t = {};
|
|
841
|
-
return Object.entries(this._fields).forEach(([e,
|
|
842
|
-
t[e] =
|
|
857
|
+
return Object.entries(this._fields).forEach(([e, n]) => {
|
|
858
|
+
t[e] = n.fullValue;
|
|
843
859
|
}), t;
|
|
844
860
|
}
|
|
845
861
|
notifyValueChanged() {
|
|
@@ -853,19 +869,22 @@ class E extends y {
|
|
|
853
869
|
get valid() {
|
|
854
870
|
return super.valid && Object.values(this._fields).every((t) => t.valid);
|
|
855
871
|
}
|
|
872
|
+
validate(t = !1) {
|
|
873
|
+
t && Object.values(this._fields).forEach((e) => e.validate(!0)), super.validate(t);
|
|
874
|
+
}
|
|
856
875
|
clone(t) {
|
|
857
876
|
var r, a, l;
|
|
858
877
|
const e = {};
|
|
859
878
|
Object.entries(this._fields).forEach(([c, u]) => {
|
|
860
879
|
e[c] = u.clone();
|
|
861
880
|
});
|
|
862
|
-
const
|
|
881
|
+
const n = new E(e, I(A({
|
|
863
882
|
value: (r = t == null ? void 0 : t.value) != null ? r : this.value
|
|
864
883
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
865
884
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
866
885
|
visibility: (l = t == null ? void 0 : t.visibility) != null ? l : this.visibility
|
|
867
886
|
}));
|
|
868
|
-
return
|
|
887
|
+
return n.actions = this.actions.clone(), n.actions.triggerEager(n, n.value, n.originalValue), n;
|
|
869
888
|
}
|
|
870
889
|
}
|
|
871
890
|
class X extends y {
|
|
@@ -875,7 +894,7 @@ class X extends y {
|
|
|
875
894
|
o(this, "_itemTemplate");
|
|
876
895
|
o(this, "_previousValue");
|
|
877
896
|
if (this._itemTemplate = t, e) {
|
|
878
|
-
const
|
|
897
|
+
const n = e, { value: r, validators: a, actions: l } = n, c = S(n, ["value", "validators", "actions"]);
|
|
879
898
|
[...a || [], ...l || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), r && this.setValueInternal(r);
|
|
880
899
|
}
|
|
881
900
|
this.originalValue === void 0 && (this.originalValue = this.value), this._previousValue = this.value, this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -889,16 +908,26 @@ class X extends y {
|
|
|
889
908
|
}
|
|
890
909
|
get value() {
|
|
891
910
|
var e;
|
|
892
|
-
const t = (e = this._value) == null ? void 0 : e.map((
|
|
911
|
+
const t = (e = this._value) == null ? void 0 : e.map((n) => n.value);
|
|
893
912
|
return M(t) ? null : t;
|
|
894
913
|
}
|
|
895
914
|
set value(t) {
|
|
896
915
|
const e = this.value;
|
|
897
916
|
this.setValueInternal(t), this.actions.trigger(m, this, this.value, e), this.parent && this.parent.notifyValueChanged(), this.validate();
|
|
898
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
|
+
}
|
|
899
928
|
clone(t) {
|
|
900
|
-
var
|
|
901
|
-
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({
|
|
902
931
|
value: [...(r = t == null ? void 0 : t.value) != null ? r : this.value]
|
|
903
932
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
904
933
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
@@ -915,23 +944,27 @@ class X extends y {
|
|
|
915
944
|
}
|
|
916
945
|
get valid() {
|
|
917
946
|
var t, e;
|
|
918
|
-
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);
|
|
948
|
+
}
|
|
949
|
+
validate(t = !1) {
|
|
950
|
+
var e;
|
|
951
|
+
t && ((e = this._value) == null || e.forEach((n) => n.validate(!0))), super.validate(t);
|
|
919
952
|
}
|
|
920
953
|
get(t) {
|
|
921
954
|
return this._value != null ? this._value[t] : void 0;
|
|
922
955
|
}
|
|
923
956
|
push(t) {
|
|
924
|
-
var e,
|
|
925
|
-
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;
|
|
926
959
|
}
|
|
927
960
|
pop() {
|
|
928
961
|
var t, e;
|
|
929
962
|
return this.remove(((e = (t = this._value) == null ? void 0 : t.length) != null ? e : 0) - 1);
|
|
930
963
|
}
|
|
931
964
|
remove(t) {
|
|
932
|
-
var
|
|
965
|
+
var n;
|
|
933
966
|
if (this._value == null || t < 0 || this._value.length <= t) return;
|
|
934
|
-
let e = (
|
|
967
|
+
let e = (n = this._value.splice(t, 1)) == null ? void 0 : n[0];
|
|
935
968
|
return e && (e = e.clone(), this.actions.trigger(ht, this, e, t), this.notifyValueChanged()), e;
|
|
936
969
|
}
|
|
937
970
|
insert(t, e) {
|
|
@@ -939,8 +972,8 @@ class X extends y {
|
|
|
939
972
|
const r = this.processSetValueItem(null), a = this._value.push(r);
|
|
940
973
|
this.actions.trigger(Q, this, r, a);
|
|
941
974
|
}
|
|
942
|
-
const
|
|
943
|
-
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;
|
|
944
977
|
}
|
|
945
978
|
clear() {
|
|
946
979
|
this._value = null, this.notifyValueChanged();
|
|
@@ -950,26 +983,26 @@ const dt = { useMarkdownInValidators: !0 };
|
|
|
950
983
|
function $t() {
|
|
951
984
|
return dt;
|
|
952
985
|
}
|
|
953
|
-
function qt(
|
|
954
|
-
Object.assign(dt,
|
|
986
|
+
function qt(i) {
|
|
987
|
+
Object.assign(dt, i);
|
|
955
988
|
}
|
|
956
|
-
const
|
|
957
|
-
install(
|
|
989
|
+
const ne = {
|
|
990
|
+
install(i, s) {
|
|
958
991
|
s && qt(s);
|
|
959
992
|
}
|
|
960
993
|
};
|
|
961
|
-
function v(
|
|
962
|
-
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, `
|
|
963
996
|
`);
|
|
964
997
|
}
|
|
965
998
|
class Mt extends f {
|
|
966
|
-
constructor(t, e,
|
|
999
|
+
constructor(t, e, n) {
|
|
967
1000
|
let r = !1, a, l;
|
|
968
|
-
super((u, h,
|
|
969
|
-
|
|
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);
|
|
970
1003
|
}))), this.isValidComparison(g(u), g(this.otherField.value)) ? null : [
|
|
971
1004
|
new p(
|
|
972
|
-
this.replacePlaceholders(
|
|
1005
|
+
this.replacePlaceholders(n, { newValue: u, oldValue: h, field: V, otherField: this.otherField })
|
|
973
1006
|
)
|
|
974
1007
|
]));
|
|
975
1008
|
o(this, "unregistered", !1);
|
|
@@ -982,83 +1015,83 @@ class Mt extends f {
|
|
|
982
1015
|
class Ht extends f {
|
|
983
1016
|
constructor(s, t) {
|
|
984
1017
|
const e = t || v("Must be one of [**{allowedAsText}**]");
|
|
985
|
-
let
|
|
986
|
-
|
|
1018
|
+
let n = s.join(", ");
|
|
1019
|
+
n.length > 60 && (n = mt(n, {
|
|
987
1020
|
length: 40,
|
|
988
1021
|
separator: ", ",
|
|
989
1022
|
omission: `... (${s.length} items total)`
|
|
990
1023
|
}));
|
|
991
1024
|
const r = (a, l, c) => s.includes(g(a)) ? null : [
|
|
992
1025
|
new p(
|
|
993
|
-
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 })
|
|
994
1027
|
)
|
|
995
1028
|
];
|
|
996
1029
|
super(r);
|
|
997
1030
|
}
|
|
998
1031
|
}
|
|
999
|
-
function Qt(
|
|
1000
|
-
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;
|
|
1001
1034
|
}
|
|
1002
1035
|
class zt extends f {
|
|
1003
1036
|
constructor(s) {
|
|
1004
|
-
const t = s || v("Please enter a value"), e = (
|
|
1005
|
-
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 })
|
|
1006
1039
|
)] : null;
|
|
1007
1040
|
super(e);
|
|
1008
1041
|
}
|
|
1009
1042
|
}
|
|
1010
1043
|
class Gt extends f {
|
|
1011
1044
|
constructor(s, t) {
|
|
1012
|
-
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 ? [
|
|
1013
1046
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: s }))
|
|
1014
1047
|
] : null;
|
|
1015
|
-
super(
|
|
1048
|
+
super(n);
|
|
1016
1049
|
}
|
|
1017
1050
|
}
|
|
1018
1051
|
class Wt extends f {
|
|
1019
1052
|
constructor(s, t) {
|
|
1020
|
-
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 ? [
|
|
1021
1054
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: s }))
|
|
1022
1055
|
] : null;
|
|
1023
|
-
super(
|
|
1056
|
+
super(n);
|
|
1024
1057
|
}
|
|
1025
1058
|
}
|
|
1026
1059
|
class Xt extends f {
|
|
1027
1060
|
constructor(s, t, e) {
|
|
1028
|
-
const
|
|
1061
|
+
const n = e || v("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < s || a > t || a === void 0 ? [
|
|
1029
1062
|
new p(
|
|
1030
|
-
this.replacePlaceholders(
|
|
1063
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minValue: s, maxValue: t })
|
|
1031
1064
|
)
|
|
1032
1065
|
] : null;
|
|
1033
1066
|
super(r);
|
|
1034
1067
|
}
|
|
1035
1068
|
}
|
|
1036
|
-
function Y(
|
|
1037
|
-
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;
|
|
1038
1071
|
}
|
|
1039
1072
|
class Yt extends f {
|
|
1040
1073
|
constructor(s, t) {
|
|
1041
|
-
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 ? [
|
|
1042
1075
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: s }))
|
|
1043
1076
|
] : null;
|
|
1044
|
-
super(
|
|
1077
|
+
super(n);
|
|
1045
1078
|
}
|
|
1046
1079
|
}
|
|
1047
1080
|
class Jt extends f {
|
|
1048
1081
|
constructor(s, t) {
|
|
1049
|
-
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 ? [
|
|
1050
1083
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: s }))
|
|
1051
1084
|
] : null;
|
|
1052
|
-
super(
|
|
1085
|
+
super(n);
|
|
1053
1086
|
}
|
|
1054
1087
|
}
|
|
1055
1088
|
class Kt extends f {
|
|
1056
1089
|
constructor(s, t, e) {
|
|
1057
|
-
const
|
|
1090
|
+
const n = e || v("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
|
|
1058
1091
|
const u = Y(a);
|
|
1059
1092
|
return u < s || u > t ? [
|
|
1060
1093
|
new p(
|
|
1061
|
-
this.replacePlaceholders(
|
|
1094
|
+
this.replacePlaceholders(n, { newValue: a, oldValue: l, field: c, minLength: s, maxLength: t })
|
|
1062
1095
|
)
|
|
1063
1096
|
] : null;
|
|
1064
1097
|
};
|
|
@@ -1067,10 +1100,10 @@ class Kt extends f {
|
|
|
1067
1100
|
}
|
|
1068
1101
|
class Zt extends f {
|
|
1069
1102
|
constructor(s, t) {
|
|
1070
|
-
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 : [
|
|
1071
1104
|
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: s }))
|
|
1072
1105
|
];
|
|
1073
|
-
super(
|
|
1106
|
+
super(n);
|
|
1074
1107
|
}
|
|
1075
1108
|
}
|
|
1076
1109
|
const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1090,12 +1123,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1090
1123
|
__proto__: null,
|
|
1091
1124
|
AbortEventHandlingException: H,
|
|
1092
1125
|
Action: Dt,
|
|
1093
|
-
ActionsMap:
|
|
1126
|
+
ActionsMap: j,
|
|
1094
1127
|
ConditionalEnabledAction: St,
|
|
1095
1128
|
ConditionalStatementAction: k,
|
|
1096
1129
|
ConditionalValueAction: wt,
|
|
1097
1130
|
ConditionalVisibilityAction: It,
|
|
1098
|
-
DisplayMode:
|
|
1131
|
+
DisplayMode: C,
|
|
1099
1132
|
EmptyField: kt,
|
|
1100
1133
|
EnabledChangedAction: at,
|
|
1101
1134
|
EnabledChangingAction: rt,
|
|
@@ -1110,12 +1143,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1110
1143
|
MdString: L,
|
|
1111
1144
|
MessagesWidget: Bt,
|
|
1112
1145
|
Operator: d,
|
|
1113
|
-
RenderableValue:
|
|
1146
|
+
RenderableValue: Ct,
|
|
1114
1147
|
Statement: F,
|
|
1115
1148
|
ValidChangedAction: lt,
|
|
1116
1149
|
ValidationError: W,
|
|
1117
1150
|
ValidationErrorRenderContent: p,
|
|
1118
|
-
ValidationErrorText:
|
|
1151
|
+
ValidationErrorText: _t,
|
|
1119
1152
|
Validator: f,
|
|
1120
1153
|
Validators: te,
|
|
1121
1154
|
ValueChangedAction: m,
|
|
@@ -1127,12 +1160,12 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1127
1160
|
export {
|
|
1128
1161
|
H as AbortEventHandlingException,
|
|
1129
1162
|
Dt as Action,
|
|
1130
|
-
|
|
1163
|
+
j as ActionsMap,
|
|
1131
1164
|
St as ConditionalEnabledAction,
|
|
1132
1165
|
k as ConditionalStatementAction,
|
|
1133
1166
|
wt as ConditionalValueAction,
|
|
1134
1167
|
It as ConditionalVisibilityAction,
|
|
1135
|
-
|
|
1168
|
+
C as DisplayMode,
|
|
1136
1169
|
kt as EmptyField,
|
|
1137
1170
|
at as EnabledChangedAction,
|
|
1138
1171
|
rt as EnabledChangingAction,
|
|
@@ -1147,12 +1180,12 @@ export {
|
|
|
1147
1180
|
L as MdString,
|
|
1148
1181
|
Bt as MessagesWidget,
|
|
1149
1182
|
d as Operator,
|
|
1150
|
-
|
|
1183
|
+
Ct as RenderableValue,
|
|
1151
1184
|
F as Statement,
|
|
1152
1185
|
lt as ValidChangedAction,
|
|
1153
1186
|
W as ValidationError,
|
|
1154
1187
|
p as ValidationErrorRenderContent,
|
|
1155
|
-
|
|
1188
|
+
_t as ValidationErrorText,
|
|
1156
1189
|
f as Validator,
|
|
1157
1190
|
te as Validators,
|
|
1158
1191
|
m as ValueChangedAction,
|
|
@@ -1160,7 +1193,7 @@ export {
|
|
|
1160
1193
|
ot as VisibilityChangingAction,
|
|
1161
1194
|
v as buildErrorMessage,
|
|
1162
1195
|
re as default,
|
|
1163
|
-
|
|
1196
|
+
ne as forms,
|
|
1164
1197
|
G as isSimpleComponentDef
|
|
1165
1198
|
};
|
|
1166
1199
|
//# sourceMappingURL=dynamicforms-vue-forms.js.map
|