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