@dynamicforms/vue-forms 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamicforms-vue-forms.js +264 -278
- package/dist/dynamicforms-vue-forms.js.map +1 -1
- package/dist/dynamicforms-vue-forms.umd.cjs +2 -2
- package/dist/dynamicforms-vue-forms.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/package.json +9 -18
- /package/dist/{style.css → dynamicforms-vue-forms.css} +0 -0
|
@@ -2,49 +2,49 @@ 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 $ = (n, s, t) => s in n ? gt(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t, A = (n, s) => {
|
|
6
6
|
for (var t in s || (s = {}))
|
|
7
|
-
J.call(s, t) && $(
|
|
7
|
+
J.call(s, t) && $(n, 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) && $(n, t, s[t]);
|
|
11
|
+
return n;
|
|
12
|
+
}, I = (n, s) => ft(n, pt(s));
|
|
13
|
+
var S = (n, 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 n)
|
|
16
|
+
J.call(n, e) && s.indexOf(e) < 0 && (t[e] = n[e]);
|
|
17
|
+
if (n != null && R)
|
|
18
|
+
for (var e of R(n))
|
|
19
|
+
s.indexOf(e) < 0 && K.call(n, e) && (t[e] = n[e]);
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
var
|
|
23
|
-
import { isEqual as U, isBoolean as bt, isString as _, isEmpty as M, truncate as mt, isArray as st, isObject as
|
|
22
|
+
var l = (n, s, t) => $(n, 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 nt } 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__ */ ((n) => (n[n.SUPPRESS = 1] = "SUPPRESS", n[n.HIDDEN = 5] = "HIDDEN", n[n.INVISIBLE = 8] = "INVISIBLE", n[n.FULL = 10] = "FULL", n))(N || {});
|
|
26
26
|
const tt = 10;
|
|
27
|
-
((
|
|
28
|
-
function s(
|
|
29
|
-
return
|
|
27
|
+
((n) => {
|
|
28
|
+
function s(i) {
|
|
29
|
+
return i.toUpperCase() === "SUPPRESS" ? 1 : i.toUpperCase() === "HIDDEN" ? 5 : i.toUpperCase() === "INVISIBLE" ? 8 : tt;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
function t(
|
|
33
|
-
const r = typeof
|
|
34
|
-
return Object.values(
|
|
31
|
+
n.fromString = s;
|
|
32
|
+
function t(i) {
|
|
33
|
+
const r = typeof i == "number" ? i : n.fromString(i);
|
|
34
|
+
return Object.values(n).includes(r) ? r : tt;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
function e(
|
|
38
|
-
const r = typeof
|
|
39
|
-
return Object.values(
|
|
36
|
+
n.fromAny = t;
|
|
37
|
+
function e(i) {
|
|
38
|
+
const r = typeof i == "number" ? i : n.fromString(i);
|
|
39
|
+
return Object.values(n).includes(r);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
n.isDefined = e;
|
|
42
42
|
})(N || (N = {}));
|
|
43
43
|
Object.freeze(N);
|
|
44
44
|
const C = N;
|
|
45
45
|
class b {
|
|
46
46
|
constructor(s) {
|
|
47
|
-
|
|
47
|
+
l(this, "executorFn");
|
|
48
48
|
this.executorFn = s;
|
|
49
49
|
}
|
|
50
50
|
static get classIdentifier() {
|
|
@@ -56,37 +56,39 @@ class b {
|
|
|
56
56
|
execute(s, t, ...e) {
|
|
57
57
|
return this.executorFn(s, t, ...e);
|
|
58
58
|
}
|
|
59
|
-
// eslint-disable-next-line class-methods-use-this
|
|
60
59
|
get eager() {
|
|
61
60
|
return !1;
|
|
62
61
|
}
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
63
|
boundToField(s) {
|
|
65
64
|
}
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, class-methods-use-this
|
|
67
65
|
unregister() {
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
class H extends Error {
|
|
71
69
|
}
|
|
72
|
-
const
|
|
70
|
+
const it = Symbol("ValueChangedAction");
|
|
73
71
|
class m extends b {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
75
72
|
constructor(s) {
|
|
76
73
|
super(s);
|
|
77
74
|
}
|
|
78
|
-
// eslint-disable-next-line class-methods-use-this
|
|
79
75
|
static get classIdentifier() {
|
|
80
|
-
return
|
|
76
|
+
return it;
|
|
81
77
|
}
|
|
82
|
-
execute(s, t, e,
|
|
83
|
-
return super.execute(s, t, e,
|
|
78
|
+
execute(s, t, e, i) {
|
|
79
|
+
return super.execute(s, t, e, i);
|
|
84
80
|
}
|
|
85
81
|
}
|
|
86
82
|
class L extends String {
|
|
83
|
+
constructor(t, e, i) {
|
|
84
|
+
super(t);
|
|
85
|
+
l(this, "plugins");
|
|
86
|
+
l(this, "options");
|
|
87
|
+
this.plugins = i, this.options = e;
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
|
-
function G(
|
|
89
|
-
const s = g(
|
|
90
|
+
function G(n) {
|
|
91
|
+
const s = g(n);
|
|
90
92
|
return typeof s == "object" && "componentName" in s;
|
|
91
93
|
}
|
|
92
94
|
class W {
|
|
@@ -120,8 +122,8 @@ class _t extends W {
|
|
|
120
122
|
class p extends W {
|
|
121
123
|
constructor(t, e = "") {
|
|
122
124
|
super();
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
l(this, "text");
|
|
126
|
+
l(this, "textType");
|
|
125
127
|
this.classes = e, this.text = t, this.textType = z(() => this.getTextType);
|
|
126
128
|
}
|
|
127
129
|
get getTextType() {
|
|
@@ -144,8 +146,10 @@ class p extends W {
|
|
|
144
146
|
switch (g(this.textType)) {
|
|
145
147
|
case "string":
|
|
146
148
|
return {};
|
|
147
|
-
case "md":
|
|
148
|
-
|
|
149
|
+
case "md": {
|
|
150
|
+
const t = this.text;
|
|
151
|
+
return { source: t.toString(), options: t.options, plugins: t.plugins };
|
|
152
|
+
}
|
|
149
153
|
case "component":
|
|
150
154
|
return g(this.text).componentProps || {};
|
|
151
155
|
default:
|
|
@@ -175,74 +179,71 @@ class f extends m {
|
|
|
175
179
|
* @param validationFn Function that validates the field value and returns errors or null
|
|
176
180
|
*/
|
|
177
181
|
constructor(t) {
|
|
178
|
-
super((
|
|
179
|
-
const c = t(a,
|
|
182
|
+
super((i, r, a, o) => {
|
|
183
|
+
const c = t(a, o, i) || [], u = (h) => {
|
|
180
184
|
var V;
|
|
181
185
|
h == null || h.forEach(
|
|
182
186
|
(x) => Object.defineProperty(x, "source", { value: this.source, enumerable: !1, configurable: !1 })
|
|
183
187
|
);
|
|
184
|
-
for (let x =
|
|
185
|
-
const O =
|
|
188
|
+
for (let x = i.errors.length - 1; x >= 0; x--) {
|
|
189
|
+
const O = i.errors[x];
|
|
186
190
|
if (O.source === this.source) {
|
|
187
|
-
const P = (V = h == null ? void 0 : h.findIndex((
|
|
188
|
-
P >= 0 ? h == null || h.splice(P, 1) :
|
|
191
|
+
const P = (V = h == null ? void 0 : h.findIndex((D) => U(D, O))) != null ? V : -1;
|
|
192
|
+
P >= 0 ? h == null || h.splice(P, 1) : i.errors.splice(x, 1);
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
|
-
h && h.length > 0 &&
|
|
195
|
+
h && h.length > 0 && i.errors.push(...h), i.validate();
|
|
192
196
|
};
|
|
193
|
-
return c instanceof Promise ? (
|
|
194
|
-
|
|
195
|
-
})) : u(c), r(
|
|
197
|
+
return c instanceof Promise ? (i.validating = ++i.validatingCount > 0, c.then((h) => u(h)).finally(() => {
|
|
198
|
+
i.validatingCount = Math.max(0, i.validatingCount - 1), i.validating = i.validatingCount > 0;
|
|
199
|
+
})) : u(c), r(i, a, o);
|
|
196
200
|
});
|
|
197
|
-
|
|
201
|
+
l(this, "source");
|
|
198
202
|
this.source = Symbol(this.constructor.name);
|
|
199
203
|
}
|
|
200
|
-
// eslint-disable-next-line class-methods-use-this
|
|
201
204
|
static get classIdentifier() {
|
|
202
205
|
return Vt;
|
|
203
206
|
}
|
|
204
|
-
// eslint-disable-next-line class-methods-use-this
|
|
205
207
|
get eager() {
|
|
206
208
|
return !0;
|
|
207
209
|
}
|
|
208
|
-
// eslint-disable-next-line class-methods-use-this
|
|
209
210
|
replacePlaceholders(t, e) {
|
|
210
211
|
if (G(t)) return t;
|
|
211
|
-
let
|
|
212
|
+
let i = t;
|
|
212
213
|
return Object.keys(e).forEach((r) => {
|
|
213
|
-
|
|
214
|
-
}), t instanceof L ? new L(
|
|
214
|
+
i = i.replaceAll(`{${r}}`, e[r]);
|
|
215
|
+
}), t instanceof L ? new L(i.toString(), t.options, t.plugins) : i;
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
218
|
class j extends Map {
|
|
218
219
|
constructor() {
|
|
219
220
|
super(...arguments);
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
l(this, "eagerActions", /* @__PURE__ */ new Set());
|
|
222
|
+
l(this, "registeredActions", []);
|
|
222
223
|
}
|
|
223
224
|
register(t) {
|
|
224
225
|
if (!(t instanceof b)) throw new Error("Invalid action type");
|
|
225
226
|
this.registeredActions.push(t);
|
|
226
|
-
const e = t.classIdentifier,
|
|
227
|
-
function r(a, ...
|
|
228
|
-
return t.execute(a,
|
|
227
|
+
const e = t.classIdentifier, i = this.get(e) || (() => null);
|
|
228
|
+
function r(a, ...o) {
|
|
229
|
+
return t.execute(a, i, ...o);
|
|
229
230
|
}
|
|
230
231
|
this.set(e, r), t.eager && this.eagerActions.add(t.classIdentifier);
|
|
231
232
|
}
|
|
232
|
-
trigger(t, e, ...
|
|
233
|
+
trigger(t, e, ...i) {
|
|
233
234
|
const r = t.classIdentifier;
|
|
234
|
-
r ===
|
|
235
|
+
r === it && this.triggerEager(e, ...i);
|
|
235
236
|
const a = this.get(r);
|
|
236
237
|
try {
|
|
237
|
-
if (a) return a(e, ...
|
|
238
|
-
} catch (
|
|
239
|
-
if (!(
|
|
238
|
+
if (a) return a(e, ...i);
|
|
239
|
+
} catch (o) {
|
|
240
|
+
if (!(o instanceof H)) throw o;
|
|
240
241
|
}
|
|
241
242
|
return null;
|
|
242
243
|
}
|
|
243
244
|
triggerEager(t, ...e) {
|
|
244
|
-
for (const
|
|
245
|
-
const r = this.get(
|
|
245
|
+
for (const i of this.eagerActions) {
|
|
246
|
+
const r = this.get(i);
|
|
246
247
|
try {
|
|
247
248
|
r && r(t, ...e);
|
|
248
249
|
} catch (a) {
|
|
@@ -264,27 +265,25 @@ class j extends Map {
|
|
|
264
265
|
const At = Symbol("ConditionalStatementAction");
|
|
265
266
|
class k extends m {
|
|
266
267
|
constructor(t, e) {
|
|
267
|
-
const
|
|
268
|
+
const i = (r, a, o, c) => {
|
|
268
269
|
const u = t.evaluate();
|
|
269
270
|
if (u !== this.lastResult) {
|
|
270
271
|
for (const h of this.boundFields)
|
|
271
272
|
e(h, u, this.lastResult);
|
|
272
273
|
this.lastResult = u;
|
|
273
274
|
}
|
|
274
|
-
return a(r,
|
|
275
|
+
return a(r, o, c);
|
|
275
276
|
};
|
|
276
|
-
super(
|
|
277
|
-
|
|
277
|
+
super(i);
|
|
278
|
+
l(this, "lastResult");
|
|
278
279
|
// boundField tracks the fields this action is bound to. so that it may perform the executorFn on them and not on the
|
|
279
280
|
// ValueChangedAction fields that will call the actionExecutor
|
|
280
|
-
|
|
281
|
-
t.collectFields().forEach((r) => r.registerAction(new m(
|
|
281
|
+
l(this, "boundFields", /* @__PURE__ */ new Set());
|
|
282
|
+
t.collectFields().forEach((r) => r.registerAction(new m(i)));
|
|
282
283
|
}
|
|
283
|
-
// eslint-disable-next-line class-methods-use-this
|
|
284
284
|
static get classIdentifier() {
|
|
285
285
|
return At;
|
|
286
286
|
}
|
|
287
|
-
// eslint-disable-next-line class-methods-use-this
|
|
288
287
|
get eager() {
|
|
289
288
|
return !0;
|
|
290
289
|
}
|
|
@@ -308,13 +307,13 @@ class St extends k {
|
|
|
308
307
|
}
|
|
309
308
|
class wt extends k {
|
|
310
309
|
constructor(s, t) {
|
|
311
|
-
super(s, (e,
|
|
312
|
-
|
|
310
|
+
super(s, (e, i) => {
|
|
311
|
+
i && (e.value = t);
|
|
313
312
|
});
|
|
314
313
|
}
|
|
315
314
|
}
|
|
316
|
-
var T = /* @__PURE__ */ ((
|
|
317
|
-
((
|
|
315
|
+
var T = /* @__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))(T || {});
|
|
316
|
+
((n) => {
|
|
318
317
|
function s(r) {
|
|
319
318
|
const a = r.toLowerCase();
|
|
320
319
|
if (a === "not") return 0;
|
|
@@ -335,114 +334,104 @@ var T = /* @__PURE__ */ ((i) => (i[i.NOT = 0] = "NOT", i[i.OR = 1] = "OR", i[i.A
|
|
|
335
334
|
if (["not_includes", "not-includes", "not includes"].includes(a)) return -10;
|
|
336
335
|
throw new Error(`Unrecognised operator ${a}`);
|
|
337
336
|
}
|
|
338
|
-
|
|
337
|
+
n.fromString = s;
|
|
339
338
|
function t(r) {
|
|
340
|
-
const a = typeof r == "number" ? r :
|
|
341
|
-
if (Object.values(
|
|
339
|
+
const a = typeof r == "number" ? r : n.fromString(r);
|
|
340
|
+
if (Object.values(n).includes(a)) return a;
|
|
342
341
|
throw new Error(`Unrecognised operator ${r}`);
|
|
343
342
|
}
|
|
344
|
-
|
|
343
|
+
n.fromAny = t;
|
|
345
344
|
function e(r) {
|
|
346
|
-
const a = typeof r == "number" ? r :
|
|
347
|
-
return Object.values(
|
|
345
|
+
const a = typeof r == "number" ? r : n.fromString(r);
|
|
346
|
+
return Object.values(n).includes(a);
|
|
348
347
|
}
|
|
349
|
-
|
|
350
|
-
function
|
|
348
|
+
n.isDefined = e;
|
|
349
|
+
function i(r) {
|
|
351
350
|
return r >= 0;
|
|
352
351
|
}
|
|
353
|
-
|
|
352
|
+
n.isLogicOperator = i;
|
|
354
353
|
})(T || (T = {}));
|
|
355
354
|
Object.freeze(T);
|
|
356
355
|
const d = T, Ft = Symbol("EnabledChangingAction");
|
|
357
356
|
class rt extends b {
|
|
358
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
359
357
|
constructor(s) {
|
|
360
358
|
super(s);
|
|
361
359
|
}
|
|
362
|
-
// eslint-disable-next-line class-methods-use-this
|
|
363
360
|
static get classIdentifier() {
|
|
364
361
|
return Ft;
|
|
365
362
|
}
|
|
366
|
-
execute(s, t, e,
|
|
367
|
-
return super.execute(s, t, e,
|
|
363
|
+
execute(s, t, e, i) {
|
|
364
|
+
return super.execute(s, t, e, i);
|
|
368
365
|
}
|
|
369
366
|
}
|
|
370
367
|
const Nt = Symbol("EnabledChangedAction");
|
|
371
368
|
class at extends b {
|
|
372
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
373
369
|
constructor(s) {
|
|
374
370
|
super(s);
|
|
375
371
|
}
|
|
376
|
-
// eslint-disable-next-line class-methods-use-this
|
|
377
372
|
static get classIdentifier() {
|
|
378
373
|
return Nt;
|
|
379
374
|
}
|
|
380
|
-
execute(s, t, e,
|
|
381
|
-
return super.execute(s, t, e,
|
|
375
|
+
execute(s, t, e, i) {
|
|
376
|
+
return super.execute(s, t, e, i);
|
|
382
377
|
}
|
|
383
378
|
}
|
|
384
379
|
const Lt = Symbol("ValidChangedAction");
|
|
385
|
-
class
|
|
386
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
380
|
+
class ot extends b {
|
|
387
381
|
constructor(s) {
|
|
388
382
|
super(s);
|
|
389
383
|
}
|
|
390
|
-
// eslint-disable-next-line class-methods-use-this
|
|
391
384
|
static get classIdentifier() {
|
|
392
385
|
return Lt;
|
|
393
386
|
}
|
|
394
|
-
execute(s, t, e,
|
|
395
|
-
return super.execute(s, t, e,
|
|
387
|
+
execute(s, t, e, i) {
|
|
388
|
+
return super.execute(s, t, e, i);
|
|
396
389
|
}
|
|
397
390
|
}
|
|
398
391
|
const jt = Symbol("VisibilityChangingAction");
|
|
399
|
-
class
|
|
400
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
392
|
+
class lt extends b {
|
|
401
393
|
constructor(s) {
|
|
402
394
|
super(s);
|
|
403
395
|
}
|
|
404
|
-
// eslint-disable-next-line class-methods-use-this
|
|
405
396
|
static get classIdentifier() {
|
|
406
397
|
return jt;
|
|
407
398
|
}
|
|
408
|
-
execute(s, t, e,
|
|
409
|
-
return super.execute(s, t, e,
|
|
399
|
+
execute(s, t, e, i) {
|
|
400
|
+
return super.execute(s, t, e, i);
|
|
410
401
|
}
|
|
411
402
|
}
|
|
412
403
|
const Tt = Symbol("VisibilityChangedAction");
|
|
413
404
|
class ct extends b {
|
|
414
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
415
405
|
constructor(s) {
|
|
416
406
|
super(s);
|
|
417
407
|
}
|
|
418
|
-
// eslint-disable-next-line class-methods-use-this
|
|
419
408
|
static get classIdentifier() {
|
|
420
409
|
return Tt;
|
|
421
410
|
}
|
|
422
|
-
execute(s, t, e,
|
|
423
|
-
return super.execute(s, t, e,
|
|
411
|
+
execute(s, t, e, i) {
|
|
412
|
+
return super.execute(s, t, e, i);
|
|
424
413
|
}
|
|
425
414
|
}
|
|
426
415
|
class y {
|
|
427
416
|
constructor() {
|
|
428
|
-
|
|
417
|
+
l(this, "reactiveValue", z(() => this.value));
|
|
429
418
|
// contains original field value as was provided at creation
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
419
|
+
l(this, "validatingCount", 0);
|
|
420
|
+
l(this, "validating", !1);
|
|
421
|
+
l(this, "_valid", !0);
|
|
433
422
|
// is current value valid as per FE and BE validators?
|
|
434
|
-
|
|
423
|
+
l(this, "errors", []);
|
|
435
424
|
// when member of a Group, fieldName specifies the name of this field
|
|
436
|
-
|
|
425
|
+
l(this, "actions", new j());
|
|
437
426
|
// default property handlers
|
|
438
|
-
|
|
439
|
-
|
|
427
|
+
l(this, "_visibility", C.FULL);
|
|
428
|
+
l(this, "_enabled", !0);
|
|
440
429
|
}
|
|
441
430
|
get visibility() {
|
|
442
431
|
return this._visibility;
|
|
443
432
|
}
|
|
444
433
|
set visibility(s) {
|
|
445
|
-
const t = this._visibility, e = this.actions.trigger(
|
|
434
|
+
const t = this._visibility, e = this.actions.trigger(lt, this, s, t);
|
|
446
435
|
if (!C.isDefined(e != null ? e : s)) throw new Error("visibility must be a DisplayMode constant");
|
|
447
436
|
this._visibility = C.fromAny(e != null ? e : s), this.actions.trigger(ct, this, this._visibility, t);
|
|
448
437
|
}
|
|
@@ -457,7 +446,7 @@ class y {
|
|
|
457
446
|
validate(s = !1) {
|
|
458
447
|
s && this.actions.triggerEager(this, this.value, this.value);
|
|
459
448
|
const t = this._valid;
|
|
460
|
-
this._valid = this.valid, this._valid !== t && this.actions.trigger(
|
|
449
|
+
this._valid = this.valid, this._valid !== t && this.actions.trigger(ot, this, this.valid, t);
|
|
461
450
|
}
|
|
462
451
|
get valid() {
|
|
463
452
|
return this.errors.length === 0;
|
|
@@ -479,14 +468,14 @@ class y {
|
|
|
479
468
|
this.actions = this.actions.cloneWithoutValidators(), this.errors = [], this._valid = !0;
|
|
480
469
|
}
|
|
481
470
|
}
|
|
482
|
-
function Ot(
|
|
483
|
-
return
|
|
471
|
+
function Ot(n, s) {
|
|
472
|
+
return n ? !s : s;
|
|
484
473
|
}
|
|
485
474
|
class F {
|
|
486
475
|
constructor(s, t, e) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
476
|
+
l(this, "operand1");
|
|
477
|
+
l(this, "operator");
|
|
478
|
+
l(this, "operand2");
|
|
490
479
|
this.operand1 = s, this.operator = t, this.operand2 = e;
|
|
491
480
|
}
|
|
492
481
|
get operand1Value() {
|
|
@@ -496,9 +485,10 @@ class F {
|
|
|
496
485
|
return this.operand2 instanceof F ? this.operand2.evaluate() : this.operand2 instanceof y ? g(this.operand2.value) : this.operand2;
|
|
497
486
|
}
|
|
498
487
|
evaluate() {
|
|
499
|
-
var e,
|
|
488
|
+
var e, i, r, a;
|
|
500
489
|
const s = this.operand1Value, t = this.operand2Value;
|
|
501
490
|
switch (this.operator) {
|
|
491
|
+
// logical operators
|
|
502
492
|
case d.AND:
|
|
503
493
|
return s && t;
|
|
504
494
|
case d.OR:
|
|
@@ -511,6 +501,7 @@ class F {
|
|
|
511
501
|
return Ot(s, t);
|
|
512
502
|
case d.NOT:
|
|
513
503
|
return !s;
|
|
504
|
+
// comparison operators
|
|
514
505
|
case d.EQUALS:
|
|
515
506
|
return s == t;
|
|
516
507
|
case d.NOT_EQUALS:
|
|
@@ -524,7 +515,7 @@ class F {
|
|
|
524
515
|
case d.GT:
|
|
525
516
|
return s > t;
|
|
526
517
|
case d.IN:
|
|
527
|
-
return (
|
|
518
|
+
return (i = (e = t == null ? void 0 : t.includes) == null ? void 0 : e.call(t, s)) != null ? i : !1;
|
|
528
519
|
case d.NOT_IN:
|
|
529
520
|
return !((a = (r = t == null ? void 0 : t.includes) == null ? void 0 : r.call(t, s)) == null || a);
|
|
530
521
|
case d.INCLUDES:
|
|
@@ -549,11 +540,9 @@ class F {
|
|
|
549
540
|
}
|
|
550
541
|
const Pt = Symbol("ExecuteAction");
|
|
551
542
|
class ut extends b {
|
|
552
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
553
543
|
constructor(s) {
|
|
554
544
|
super(s);
|
|
555
545
|
}
|
|
556
|
-
// eslint-disable-next-line class-methods-use-this
|
|
557
546
|
static get classIdentifier() {
|
|
558
547
|
return Pt;
|
|
559
548
|
}
|
|
@@ -563,38 +552,34 @@ class ut extends b {
|
|
|
563
552
|
}
|
|
564
553
|
const Rt = Symbol("ListItemAddedAction");
|
|
565
554
|
class Q extends b {
|
|
566
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
567
555
|
constructor(s) {
|
|
568
556
|
super(s);
|
|
569
557
|
}
|
|
570
|
-
// eslint-disable-next-line class-methods-use-this
|
|
571
558
|
static get classIdentifier() {
|
|
572
559
|
return Rt;
|
|
573
560
|
}
|
|
574
|
-
execute(s, t, e,
|
|
575
|
-
return super.execute(s, t, e,
|
|
561
|
+
execute(s, t, e, i) {
|
|
562
|
+
return super.execute(s, t, e, i);
|
|
576
563
|
}
|
|
577
564
|
}
|
|
578
565
|
const Ut = Symbol("ListItemRemovedAction");
|
|
579
566
|
class ht extends b {
|
|
580
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
581
567
|
constructor(s) {
|
|
582
568
|
super(s);
|
|
583
569
|
}
|
|
584
|
-
// eslint-disable-next-line class-methods-use-this
|
|
585
570
|
static get classIdentifier() {
|
|
586
571
|
return Ut;
|
|
587
572
|
}
|
|
588
|
-
execute(s, t, e,
|
|
589
|
-
return super.execute(s, t, e,
|
|
573
|
+
execute(s, t, e, i) {
|
|
574
|
+
return super.execute(s, t, e, i);
|
|
590
575
|
}
|
|
591
576
|
}
|
|
592
577
|
const et = Symbol("FieldConstructorGuard");
|
|
593
|
-
class
|
|
578
|
+
class B extends y {
|
|
594
579
|
constructor(t) {
|
|
595
580
|
super();
|
|
596
|
-
|
|
597
|
-
|
|
581
|
+
l(this, "_value");
|
|
582
|
+
l(this, "_touched", !1);
|
|
598
583
|
if (t !== et) {
|
|
599
584
|
const e = this.constructor.name;
|
|
600
585
|
throw new TypeError(`Don't use constructor to instantiate ${e}. Use ${e}.create<T>`);
|
|
@@ -602,8 +587,8 @@ class D extends y {
|
|
|
602
587
|
}
|
|
603
588
|
init(t) {
|
|
604
589
|
if (t) {
|
|
605
|
-
const e = t, { value:
|
|
606
|
-
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this,
|
|
590
|
+
const e = t, { value: i, validators: r, actions: a } = e, o = S(e, ["value", "validators", "actions"]);
|
|
591
|
+
[...r || [], ...a || []].forEach((c) => this.registerAction(c)), Object.assign(this, o), this._value = i != null ? i : this.originalValue, this.originalValue === void 0 && (this.originalValue = this._value);
|
|
607
592
|
}
|
|
608
593
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
609
594
|
}
|
|
@@ -630,9 +615,9 @@ class D extends y {
|
|
|
630
615
|
this._touched = t;
|
|
631
616
|
}
|
|
632
617
|
clone(t) {
|
|
633
|
-
var
|
|
618
|
+
var i, r, a;
|
|
634
619
|
const e = this.constructor.create(I(A({
|
|
635
|
-
value: (
|
|
620
|
+
value: (i = t == null ? void 0 : t.value) != null ? i : this.value
|
|
636
621
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
637
622
|
enabled: (r = t == null ? void 0 : t.enabled) != null ? r : this.enabled,
|
|
638
623
|
visibility: (a = t == null ? void 0 : t.visibility) != null ? a : this.visibility
|
|
@@ -640,23 +625,23 @@ class D extends y {
|
|
|
640
625
|
return e.actions = this.actions.clone(), e.actions.triggerEager(e, e.value, e.originalValue), e;
|
|
641
626
|
}
|
|
642
627
|
}
|
|
643
|
-
const kt =
|
|
644
|
-
() => {
|
|
628
|
+
const kt = B.create({ value: "EmptyField" }).registerAction(
|
|
629
|
+
new m(() => {
|
|
645
630
|
console.warn("Working with EmptyField! This should not happen");
|
|
646
|
-
}
|
|
647
|
-
)
|
|
648
|
-
function q(
|
|
649
|
-
return (
|
|
631
|
+
})
|
|
632
|
+
);
|
|
633
|
+
function q(n, s) {
|
|
634
|
+
return (n == null ? void 0 : n.label) == null && (n == null ? void 0 : n.icon) == null ? s : n;
|
|
650
635
|
}
|
|
651
|
-
class
|
|
636
|
+
class Bt extends B {
|
|
652
637
|
constructor(s) {
|
|
653
638
|
super(s), this._value = { label: void 0, icon: void 0 };
|
|
654
639
|
}
|
|
655
640
|
init(s) {
|
|
656
641
|
if (s) {
|
|
657
|
-
const t = s, { value: e, originalValue:
|
|
658
|
-
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this,
|
|
659
|
-
const c = q(e, this._value), u = Object.freeze({ label:
|
|
642
|
+
const t = s, { value: e, originalValue: i, validators: r, actions: a } = t, o = S(t, ["value", "originalValue", "validators", "actions"]);
|
|
643
|
+
[...r || [], ...a || []].forEach((h) => this.registerAction(h)), Object.assign(this, o);
|
|
644
|
+
const c = q(e, this._value), u = Object.freeze({ label: i == null ? void 0 : i.label, icon: i == null ? void 0 : i.icon });
|
|
660
645
|
this._value = q(c, u), this.originalValue = q(u, c);
|
|
661
646
|
}
|
|
662
647
|
this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
@@ -680,14 +665,14 @@ class Dt extends D {
|
|
|
680
665
|
this.actions.trigger(ut, this, s);
|
|
681
666
|
}
|
|
682
667
|
}
|
|
683
|
-
const
|
|
668
|
+
const Dt = /* @__PURE__ */ yt({
|
|
684
669
|
__name: "messages-widget",
|
|
685
670
|
props: {
|
|
686
671
|
message: {},
|
|
687
672
|
classes: { default: "text-error" }
|
|
688
673
|
},
|
|
689
|
-
setup(
|
|
690
|
-
const s =
|
|
674
|
+
setup(n) {
|
|
675
|
+
const s = n, t = Z("vue-markdown"), e = /* @__PURE__ */ new Set([
|
|
691
676
|
"div",
|
|
692
677
|
"span",
|
|
693
678
|
"p",
|
|
@@ -743,7 +728,7 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
743
728
|
"dl",
|
|
744
729
|
"dt",
|
|
745
730
|
"dd"
|
|
746
|
-
]),
|
|
731
|
+
]), i = () => {
|
|
747
732
|
if (typeof s.message == "string") return w("span", { class: s.classes }, s.message);
|
|
748
733
|
const r = [];
|
|
749
734
|
return s.message.forEach((a) => {
|
|
@@ -752,23 +737,26 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
752
737
|
r.push(w("div", { class: [s.classes, a.extraClasses] }, a.componentBody));
|
|
753
738
|
break;
|
|
754
739
|
case "vue-markdown":
|
|
755
|
-
typeof t == "string"
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
740
|
+
if (typeof t == "string")
|
|
741
|
+
console.warn(
|
|
742
|
+
"You are using markdown for messages-widget, but you haven't registered a vue-markdown component"
|
|
743
|
+
), r.push(w("div", { class: [s.classes, a.extraClasses] }, a.componentBindings.source));
|
|
744
|
+
else {
|
|
745
|
+
const o = a.componentBindings;
|
|
746
|
+
r.push(
|
|
747
|
+
w(t, {
|
|
748
|
+
class: [s.classes, a.extraClasses, "df-messages-widget-markdown"],
|
|
749
|
+
source: o.source,
|
|
750
|
+
options: o.options,
|
|
751
|
+
plugins: o.plugins
|
|
752
|
+
})
|
|
753
|
+
);
|
|
754
|
+
}
|
|
764
755
|
break;
|
|
765
756
|
default:
|
|
766
757
|
r.push(
|
|
767
758
|
w(
|
|
768
|
-
e.has(a.componentName.toLowerCase()) ? (
|
|
769
|
-
// only resolve if it's not a common html element
|
|
770
|
-
a.componentName
|
|
771
|
-
) : Z(a.componentName),
|
|
759
|
+
e.has(a.componentName.toLowerCase()) ? a.componentName : Z(a.componentName),
|
|
772
760
|
I(A({ class: [s.classes, a.extraClasses] }, a.componentBindings), { innerHTML: a.componentBody })
|
|
773
761
|
)
|
|
774
762
|
);
|
|
@@ -776,47 +764,45 @@ const Bt = /* @__PURE__ */ yt({
|
|
|
776
764
|
}
|
|
777
765
|
}), r;
|
|
778
766
|
};
|
|
779
|
-
return (r, a) => (Et(), xt(
|
|
767
|
+
return (r, a) => (Et(), xt(i));
|
|
780
768
|
}
|
|
781
769
|
});
|
|
782
770
|
class E extends y {
|
|
783
771
|
constructor(t, e) {
|
|
784
772
|
super();
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
773
|
+
l(this, "_fields");
|
|
774
|
+
l(this, "_value", null);
|
|
775
|
+
l(this, "reactiveValue", z(() => this.value));
|
|
776
|
+
l(this, "suppressNotifyValueChanged", !1);
|
|
789
777
|
if (!E.isValidFields(t)) throw new Error("Invalid fields object provided");
|
|
790
778
|
if (this._fields = {}, Object.entries(t).forEach(([r, a]) => this.addField(r, a)), e) {
|
|
791
|
-
const
|
|
792
|
-
[...a || [], ...
|
|
779
|
+
const i = e, { value: r, validators: a, actions: o } = i, c = S(i, ["value", "validators", "actions"]);
|
|
780
|
+
[...a || [], ...o || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), this.value = r != null ? r : this.originalValue;
|
|
793
781
|
}
|
|
794
782
|
this.originalValue === void 0 && (this.originalValue = this.value), this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
795
783
|
}
|
|
796
784
|
addField(t, e) {
|
|
797
785
|
if (this.fields[t] !== void 0)
|
|
798
786
|
throw new Error(`Field ${t} is already in this form`);
|
|
799
|
-
Object.defineProperty(e, "parent", { get: () => this, configurable: !1, enumerable: !1 }), Object.defineProperty(e, "fieldName", { get: () => t, configurable: !1, enumerable: !1 }), Object.defineProperty(
|
|
800
|
-
|
|
801
|
-
t,
|
|
802
|
-
{ get() {
|
|
787
|
+
Object.defineProperty(e, "parent", { get: () => this, configurable: !1, enumerable: !1 }), Object.defineProperty(e, "fieldName", { get: () => t, configurable: !1, enumerable: !1 }), Object.defineProperty(this._fields, t, {
|
|
788
|
+
get() {
|
|
803
789
|
return e;
|
|
804
|
-
},
|
|
805
|
-
|
|
790
|
+
},
|
|
791
|
+
configurable: !1,
|
|
792
|
+
enumerable: !0
|
|
793
|
+
});
|
|
806
794
|
}
|
|
807
795
|
static isValidFields(t) {
|
|
808
|
-
function e(
|
|
809
|
-
return
|
|
796
|
+
function e(i) {
|
|
797
|
+
return i instanceof y;
|
|
810
798
|
}
|
|
811
|
-
return typeof t == "object" && t !== null && Object.entries(t).every(([,
|
|
799
|
+
return typeof t == "object" && t !== null && Object.entries(t).every(([, i]) => e(i));
|
|
812
800
|
}
|
|
813
801
|
static createFromFormData(t) {
|
|
814
802
|
if (t instanceof y)
|
|
815
803
|
throw new Error("data is already a Form structure, should be a simple object");
|
|
816
804
|
return new E(
|
|
817
|
-
t == null ? {} : Object.fromEntries(
|
|
818
|
-
Object.entries(t).map(([e, n]) => [e, D.create({ value: n })])
|
|
819
|
-
)
|
|
805
|
+
t == null ? {} : Object.fromEntries(Object.entries(t).map(([e, i]) => [e, B.create({ value: i })]))
|
|
820
806
|
);
|
|
821
807
|
}
|
|
822
808
|
field(t) {
|
|
@@ -828,16 +814,16 @@ class E extends y {
|
|
|
828
814
|
}
|
|
829
815
|
get value() {
|
|
830
816
|
const t = {};
|
|
831
|
-
return Object.entries(this._fields).forEach(([e,
|
|
832
|
-
const r =
|
|
833
|
-
(
|
|
817
|
+
return Object.entries(this._fields).forEach(([e, i]) => {
|
|
818
|
+
const r = i.value;
|
|
819
|
+
(i.enabled || i instanceof E && !M(r)) && (t[e] = r);
|
|
834
820
|
}), M(t) ? null : t;
|
|
835
821
|
}
|
|
836
822
|
set value(t) {
|
|
837
823
|
this.suppressNotifyValueChanged = !0;
|
|
838
824
|
try {
|
|
839
|
-
Object.entries(this._fields).forEach(([e,
|
|
840
|
-
(t == null || e in t) && (
|
|
825
|
+
Object.entries(this._fields).forEach(([e, i]) => {
|
|
826
|
+
(t == null || e in t) && (i.value = t == null ? null : t[e]);
|
|
841
827
|
});
|
|
842
828
|
} finally {
|
|
843
829
|
this.suppressNotifyValueChanged = !1;
|
|
@@ -854,8 +840,8 @@ class E extends y {
|
|
|
854
840
|
}
|
|
855
841
|
get fullValue() {
|
|
856
842
|
const t = {};
|
|
857
|
-
return Object.entries(this._fields).forEach(([e,
|
|
858
|
-
t[e] =
|
|
843
|
+
return Object.entries(this._fields).forEach(([e, i]) => {
|
|
844
|
+
t[e] = i.fullValue;
|
|
859
845
|
}), t;
|
|
860
846
|
}
|
|
861
847
|
notifyValueChanged() {
|
|
@@ -873,29 +859,29 @@ class E extends y {
|
|
|
873
859
|
t && Object.values(this._fields).forEach((e) => e.validate(!0)), super.validate(t);
|
|
874
860
|
}
|
|
875
861
|
clone(t) {
|
|
876
|
-
var r, a,
|
|
862
|
+
var r, a, o;
|
|
877
863
|
const e = {};
|
|
878
864
|
Object.entries(this._fields).forEach(([c, u]) => {
|
|
879
865
|
e[c] = u.clone();
|
|
880
866
|
});
|
|
881
|
-
const
|
|
867
|
+
const i = new E(e, I(A({
|
|
882
868
|
value: (r = t == null ? void 0 : t.value) != null ? r : this.value
|
|
883
869
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
884
870
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
885
|
-
visibility: (
|
|
871
|
+
visibility: (o = t == null ? void 0 : t.visibility) != null ? o : this.visibility
|
|
886
872
|
}));
|
|
887
|
-
return
|
|
873
|
+
return i.actions = this.actions.clone(), i.actions.triggerEager(i, i.value, i.originalValue), i;
|
|
888
874
|
}
|
|
889
875
|
}
|
|
890
876
|
class X extends y {
|
|
891
877
|
constructor(t, e) {
|
|
892
878
|
super();
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
879
|
+
l(this, "_value", null);
|
|
880
|
+
l(this, "_itemTemplate");
|
|
881
|
+
l(this, "_previousValue");
|
|
896
882
|
if (this._itemTemplate = t, e) {
|
|
897
|
-
const
|
|
898
|
-
[...a || [], ...
|
|
883
|
+
const i = e, { value: r, validators: a, actions: o } = i, c = S(i, ["value", "validators", "actions"]);
|
|
884
|
+
[...a || [], ...o || []].forEach((u) => this.registerAction(u)), Object.assign(this, c), r && this.setValueInternal(r);
|
|
899
885
|
}
|
|
900
886
|
this.originalValue === void 0 && (this.originalValue = this.value), this._previousValue = this.value, this.actions.triggerEager(this, this.value, this.originalValue), this.validate();
|
|
901
887
|
}
|
|
@@ -908,7 +894,7 @@ class X extends y {
|
|
|
908
894
|
}
|
|
909
895
|
get value() {
|
|
910
896
|
var e;
|
|
911
|
-
const t = (e = this._value) == null ? void 0 : e.map((
|
|
897
|
+
const t = (e = this._value) == null ? void 0 : e.map((i) => i.value);
|
|
912
898
|
return M(t) ? null : t;
|
|
913
899
|
}
|
|
914
900
|
set value(t) {
|
|
@@ -921,17 +907,17 @@ class X extends y {
|
|
|
921
907
|
}
|
|
922
908
|
set touched(t) {
|
|
923
909
|
var e;
|
|
924
|
-
(e = this._value) == null || e.forEach((
|
|
925
|
-
|
|
910
|
+
(e = this._value) == null || e.forEach((i) => {
|
|
911
|
+
i.touched = t;
|
|
926
912
|
});
|
|
927
913
|
}
|
|
928
914
|
clone(t) {
|
|
929
|
-
var
|
|
930
|
-
const e = new X((
|
|
915
|
+
var i, r, a, o;
|
|
916
|
+
const e = new X((i = this._itemTemplate) == null ? void 0 : i.clone(), I(A({
|
|
931
917
|
value: [...(r = t == null ? void 0 : t.value) != null ? r : this.value]
|
|
932
918
|
}, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
|
|
933
919
|
enabled: (a = t == null ? void 0 : t.enabled) != null ? a : this.enabled,
|
|
934
|
-
visibility: (
|
|
920
|
+
visibility: (o = t == null ? void 0 : t.visibility) != null ? o : this.visibility
|
|
935
921
|
}));
|
|
936
922
|
return e.actions = this.actions.clone(), e.actions.triggerEager(e, e.value, e.originalValue), e;
|
|
937
923
|
}
|
|
@@ -944,27 +930,27 @@ class X extends y {
|
|
|
944
930
|
}
|
|
945
931
|
get valid() {
|
|
946
932
|
var t, e;
|
|
947
|
-
return super.valid && ((e = (t = this._value) == null ? void 0 : t.every((
|
|
933
|
+
return super.valid && ((e = (t = this._value) == null ? void 0 : t.every((i) => i.valid)) != null ? e : !0);
|
|
948
934
|
}
|
|
949
935
|
validate(t = !1) {
|
|
950
936
|
var e;
|
|
951
|
-
t && ((e = this._value) == null || e.forEach((
|
|
937
|
+
t && ((e = this._value) == null || e.forEach((i) => i.validate(!0))), super.validate(t);
|
|
952
938
|
}
|
|
953
939
|
get(t) {
|
|
954
940
|
return this._value != null ? this._value[t] : void 0;
|
|
955
941
|
}
|
|
956
942
|
push(t) {
|
|
957
|
-
var e,
|
|
958
|
-
return this.insert(t, (
|
|
943
|
+
var e, i;
|
|
944
|
+
return this.insert(t, (i = (e = this._value) == null ? void 0 : e.length) != null ? i : 0) + 1;
|
|
959
945
|
}
|
|
960
946
|
pop() {
|
|
961
947
|
var t, e;
|
|
962
948
|
return this.remove(((e = (t = this._value) == null ? void 0 : t.length) != null ? e : 0) - 1);
|
|
963
949
|
}
|
|
964
950
|
remove(t) {
|
|
965
|
-
var
|
|
951
|
+
var i;
|
|
966
952
|
if (this._value == null || t < 0 || this._value.length <= t) return;
|
|
967
|
-
let e = (
|
|
953
|
+
let e = (i = this._value.splice(t, 1)) == null ? void 0 : i[0];
|
|
968
954
|
return e && (e = e.clone(), this.actions.trigger(ht, this, e, t), this.notifyValueChanged()), e;
|
|
969
955
|
}
|
|
970
956
|
insert(t, e) {
|
|
@@ -972,8 +958,8 @@ class X extends y {
|
|
|
972
958
|
const r = this.processSetValueItem(null), a = this._value.push(r);
|
|
973
959
|
this.actions.trigger(Q, this, r, a);
|
|
974
960
|
}
|
|
975
|
-
const
|
|
976
|
-
return this._value.splice(e, 0,
|
|
961
|
+
const i = this.processSetValueItem(t);
|
|
962
|
+
return this._value.splice(e, 0, i), this.actions.trigger(Q, this, i, e), this.notifyValueChanged(), e;
|
|
977
963
|
}
|
|
978
964
|
clear() {
|
|
979
965
|
this._value = null, this.notifyValueChanged();
|
|
@@ -983,29 +969,31 @@ const dt = { useMarkdownInValidators: !0 };
|
|
|
983
969
|
function $t() {
|
|
984
970
|
return dt;
|
|
985
971
|
}
|
|
986
|
-
function qt(
|
|
987
|
-
Object.assign(dt,
|
|
972
|
+
function qt(n) {
|
|
973
|
+
Object.assign(dt, n);
|
|
988
974
|
}
|
|
989
|
-
const
|
|
990
|
-
install(
|
|
975
|
+
const ie = {
|
|
976
|
+
install(n, s) {
|
|
991
977
|
s && qt(s);
|
|
992
978
|
}
|
|
993
979
|
};
|
|
994
|
-
function v(
|
|
995
|
-
return $t().useMarkdownInValidators ? new L(
|
|
980
|
+
function v(n) {
|
|
981
|
+
return $t().useMarkdownInValidators ? new L(n) : n.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, `
|
|
996
982
|
`);
|
|
997
983
|
}
|
|
998
984
|
class Mt extends f {
|
|
999
|
-
constructor(t, e,
|
|
1000
|
-
let r = !1, a,
|
|
1001
|
-
super((u, h, V) => (a = u,
|
|
1002
|
-
|
|
1003
|
-
|
|
985
|
+
constructor(t, e, i) {
|
|
986
|
+
let r = !1, a, o;
|
|
987
|
+
super((u, h, V) => (a = u, o = h, r || (r = !0, this.otherField.registerAction(
|
|
988
|
+
new m((x, O, P, D) => {
|
|
989
|
+
O(x, P, D), this.unregistered || this.execute(V, () => null, a, o);
|
|
990
|
+
})
|
|
991
|
+
)), this.isValidComparison(g(u), g(this.otherField.value)) ? null : [
|
|
1004
992
|
new p(
|
|
1005
|
-
this.replacePlaceholders(
|
|
993
|
+
this.replacePlaceholders(i, { newValue: u, oldValue: h, field: V, otherField: this.otherField })
|
|
1006
994
|
)
|
|
1007
995
|
]));
|
|
1008
|
-
|
|
996
|
+
l(this, "unregistered", !1);
|
|
1009
997
|
this.otherField = t, this.isValidComparison = e;
|
|
1010
998
|
}
|
|
1011
999
|
unregister() {
|
|
@@ -1015,83 +1003,81 @@ class Mt extends f {
|
|
|
1015
1003
|
class Ht extends f {
|
|
1016
1004
|
constructor(s, t) {
|
|
1017
1005
|
const e = t || v("Must be one of [**{allowedAsText}**]");
|
|
1018
|
-
let
|
|
1019
|
-
|
|
1006
|
+
let i = s.join(", ");
|
|
1007
|
+
i.length > 60 && (i = mt(i, {
|
|
1020
1008
|
length: 40,
|
|
1021
1009
|
separator: ", ",
|
|
1022
1010
|
omission: `... (${s.length} items total)`
|
|
1023
1011
|
}));
|
|
1024
|
-
const r = (a,
|
|
1012
|
+
const r = (a, o, c) => s.includes(g(a)) ? null : [
|
|
1025
1013
|
new p(
|
|
1026
|
-
this.replacePlaceholders(e, { newValue: a, oldValue:
|
|
1014
|
+
this.replacePlaceholders(e, { newValue: a, oldValue: o, field: c, allowedValues: s, allowedAsText: i })
|
|
1027
1015
|
)
|
|
1028
1016
|
];
|
|
1029
1017
|
super(r);
|
|
1030
1018
|
}
|
|
1031
1019
|
}
|
|
1032
|
-
function Qt(
|
|
1033
|
-
return
|
|
1020
|
+
function Qt(n) {
|
|
1021
|
+
return n == null ? 0 : st(n) || _(n) ? n.length : nt(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
|
|
1034
1022
|
}
|
|
1035
1023
|
class zt extends f {
|
|
1036
1024
|
constructor(s) {
|
|
1037
|
-
const t = s || v("Please enter a value"), e = (
|
|
1038
|
-
this.replacePlaceholders(t, { newValue: n, oldValue: r, field: a })
|
|
1039
|
-
)] : null;
|
|
1025
|
+
const t = s || v("Please enter a value"), e = (i, r, a) => Qt(g(i)) === 0 ? [new p(this.replacePlaceholders(t, { newValue: i, oldValue: r, field: a }))] : null;
|
|
1040
1026
|
super(e);
|
|
1041
1027
|
}
|
|
1042
1028
|
}
|
|
1043
1029
|
class Gt extends f {
|
|
1044
1030
|
constructor(s, t) {
|
|
1045
|
-
const e = t || v("Value must be larger or equal to **{minValue}**"),
|
|
1046
|
-
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field:
|
|
1031
|
+
const e = t || v("Value must be larger or equal to **{minValue}**"), i = (r, a, o) => r < s || r === void 0 ? [
|
|
1032
|
+
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: o, minValue: s }))
|
|
1047
1033
|
] : null;
|
|
1048
|
-
super(
|
|
1034
|
+
super(i);
|
|
1049
1035
|
}
|
|
1050
1036
|
}
|
|
1051
1037
|
class Wt extends f {
|
|
1052
1038
|
constructor(s, t) {
|
|
1053
|
-
const e = t || v("Value must be less than or equal to **{maxValue}**"),
|
|
1054
|
-
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field:
|
|
1039
|
+
const e = t || v("Value must be less than or equal to **{maxValue}**"), i = (r, a, o) => r > s || r === void 0 ? [
|
|
1040
|
+
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: o, maxValue: s }))
|
|
1055
1041
|
] : null;
|
|
1056
|
-
super(
|
|
1042
|
+
super(i);
|
|
1057
1043
|
}
|
|
1058
1044
|
}
|
|
1059
1045
|
class Xt extends f {
|
|
1060
1046
|
constructor(s, t, e) {
|
|
1061
|
-
const
|
|
1047
|
+
const i = e || v("Value must be between **{minValue}** and **{maxValue}**"), r = (a, o, c) => a < s || a > t || a === void 0 ? [
|
|
1062
1048
|
new p(
|
|
1063
|
-
this.replacePlaceholders(
|
|
1049
|
+
this.replacePlaceholders(i, { newValue: a, oldValue: o, field: c, minValue: s, maxValue: t })
|
|
1064
1050
|
)
|
|
1065
1051
|
] : null;
|
|
1066
1052
|
super(r);
|
|
1067
1053
|
}
|
|
1068
1054
|
}
|
|
1069
|
-
function Y(
|
|
1070
|
-
return
|
|
1055
|
+
function Y(n) {
|
|
1056
|
+
return n == null ? 0 : st(n) || _(n) ? n.length : nt(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
|
|
1071
1057
|
}
|
|
1072
1058
|
class Yt extends f {
|
|
1073
1059
|
constructor(s, t) {
|
|
1074
|
-
const e = t || v("Length must be larger or equal to **{minLength}**"),
|
|
1075
|
-
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field:
|
|
1060
|
+
const e = t || v("Length must be larger or equal to **{minLength}**"), i = (r, a, o) => Y(r) < s ? [
|
|
1061
|
+
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: o, minLength: s }))
|
|
1076
1062
|
] : null;
|
|
1077
|
-
super(
|
|
1063
|
+
super(i);
|
|
1078
1064
|
}
|
|
1079
1065
|
}
|
|
1080
1066
|
class Jt extends f {
|
|
1081
1067
|
constructor(s, t) {
|
|
1082
|
-
const e = t || v("Length must be less than or equal to **{maxLength}**"),
|
|
1083
|
-
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field:
|
|
1068
|
+
const e = t || v("Length must be less than or equal to **{maxLength}**"), i = (r, a, o) => Y(r) > s ? [
|
|
1069
|
+
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: o, maxLength: s }))
|
|
1084
1070
|
] : null;
|
|
1085
|
-
super(
|
|
1071
|
+
super(i);
|
|
1086
1072
|
}
|
|
1087
1073
|
}
|
|
1088
1074
|
class Kt extends f {
|
|
1089
1075
|
constructor(s, t, e) {
|
|
1090
|
-
const
|
|
1076
|
+
const i = e || v("Length must be between **{minLength}** and **{maxLength}**"), r = (a, o, c) => {
|
|
1091
1077
|
const u = Y(a);
|
|
1092
1078
|
return u < s || u > t ? [
|
|
1093
1079
|
new p(
|
|
1094
|
-
this.replacePlaceholders(
|
|
1080
|
+
this.replacePlaceholders(i, { newValue: a, oldValue: o, field: c, minLength: s, maxLength: t })
|
|
1095
1081
|
)
|
|
1096
1082
|
] : null;
|
|
1097
1083
|
};
|
|
@@ -1100,10 +1086,10 @@ class Kt extends f {
|
|
|
1100
1086
|
}
|
|
1101
1087
|
class Zt extends f {
|
|
1102
1088
|
constructor(s, t) {
|
|
1103
|
-
const e = t || v('Value must match pattern "**{pattern}**"'),
|
|
1104
|
-
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field:
|
|
1089
|
+
const e = t || v('Value must match pattern "**{pattern}**"'), i = (r, a, o) => s.test(String(g(r))) ? null : [
|
|
1090
|
+
new p(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: o, pattern: s }))
|
|
1105
1091
|
];
|
|
1106
|
-
super(
|
|
1092
|
+
super(i);
|
|
1107
1093
|
}
|
|
1108
1094
|
}
|
|
1109
1095
|
const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1122,7 +1108,7 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1122
1108
|
}, Symbol.toStringTag, { value: "Module" })), re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1123
1109
|
__proto__: null,
|
|
1124
1110
|
AbortEventHandlingException: H,
|
|
1125
|
-
Action:
|
|
1111
|
+
Action: Bt,
|
|
1126
1112
|
ActionsMap: j,
|
|
1127
1113
|
ConditionalEnabledAction: St,
|
|
1128
1114
|
ConditionalStatementAction: k,
|
|
@@ -1133,7 +1119,7 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1133
1119
|
EnabledChangedAction: at,
|
|
1134
1120
|
EnabledChangingAction: rt,
|
|
1135
1121
|
ExecuteAction: ut,
|
|
1136
|
-
Field:
|
|
1122
|
+
Field: B,
|
|
1137
1123
|
FieldActionBase: b,
|
|
1138
1124
|
FieldBase: y,
|
|
1139
1125
|
Group: E,
|
|
@@ -1141,11 +1127,11 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1141
1127
|
ListItemAddedAction: Q,
|
|
1142
1128
|
ListItemRemovedAction: ht,
|
|
1143
1129
|
MdString: L,
|
|
1144
|
-
MessagesWidget:
|
|
1130
|
+
MessagesWidget: Dt,
|
|
1145
1131
|
Operator: d,
|
|
1146
1132
|
RenderableValue: Ct,
|
|
1147
1133
|
Statement: F,
|
|
1148
|
-
ValidChangedAction:
|
|
1134
|
+
ValidChangedAction: ot,
|
|
1149
1135
|
ValidationError: W,
|
|
1150
1136
|
ValidationErrorRenderContent: p,
|
|
1151
1137
|
ValidationErrorText: _t,
|
|
@@ -1153,13 +1139,13 @@ const te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1153
1139
|
Validators: te,
|
|
1154
1140
|
ValueChangedAction: m,
|
|
1155
1141
|
VisibilityChangedAction: ct,
|
|
1156
|
-
VisibilityChangingAction:
|
|
1142
|
+
VisibilityChangingAction: lt,
|
|
1157
1143
|
buildErrorMessage: v,
|
|
1158
1144
|
isSimpleComponentDef: G
|
|
1159
1145
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1160
1146
|
export {
|
|
1161
1147
|
H as AbortEventHandlingException,
|
|
1162
|
-
|
|
1148
|
+
Bt as Action,
|
|
1163
1149
|
j as ActionsMap,
|
|
1164
1150
|
St as ConditionalEnabledAction,
|
|
1165
1151
|
k as ConditionalStatementAction,
|
|
@@ -1170,7 +1156,7 @@ export {
|
|
|
1170
1156
|
at as EnabledChangedAction,
|
|
1171
1157
|
rt as EnabledChangingAction,
|
|
1172
1158
|
ut as ExecuteAction,
|
|
1173
|
-
|
|
1159
|
+
B as Field,
|
|
1174
1160
|
b as FieldActionBase,
|
|
1175
1161
|
y as FieldBase,
|
|
1176
1162
|
E as Group,
|
|
@@ -1178,11 +1164,11 @@ export {
|
|
|
1178
1164
|
Q as ListItemAddedAction,
|
|
1179
1165
|
ht as ListItemRemovedAction,
|
|
1180
1166
|
L as MdString,
|
|
1181
|
-
|
|
1167
|
+
Dt as MessagesWidget,
|
|
1182
1168
|
d as Operator,
|
|
1183
1169
|
Ct as RenderableValue,
|
|
1184
1170
|
F as Statement,
|
|
1185
|
-
|
|
1171
|
+
ot as ValidChangedAction,
|
|
1186
1172
|
W as ValidationError,
|
|
1187
1173
|
p as ValidationErrorRenderContent,
|
|
1188
1174
|
_t as ValidationErrorText,
|
|
@@ -1190,10 +1176,10 @@ export {
|
|
|
1190
1176
|
te as Validators,
|
|
1191
1177
|
m as ValueChangedAction,
|
|
1192
1178
|
ct as VisibilityChangedAction,
|
|
1193
|
-
|
|
1179
|
+
lt as VisibilityChangingAction,
|
|
1194
1180
|
v as buildErrorMessage,
|
|
1195
1181
|
re as default,
|
|
1196
|
-
|
|
1182
|
+
ie as forms,
|
|
1197
1183
|
G as isSimpleComponentDef
|
|
1198
1184
|
};
|
|
1199
1185
|
//# sourceMappingURL=dynamicforms-vue-forms.js.map
|