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