@dynamicforms/vue-forms 0.2.0 → 0.2.2

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,12 +1,12 @@
1
1
  var ft = Object.defineProperty, gt = Object.defineProperties;
2
2
  var dt = Object.getOwnPropertyDescriptors;
3
3
  var R = Object.getOwnPropertySymbols, bt = Object.getPrototypeOf, tt = Object.prototype.hasOwnProperty, et = Object.prototype.propertyIsEnumerable, pt = Reflect.get;
4
- var H = (n, i, t) => i in n ? ft(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t, V = (n, i) => {
4
+ var X = (n, i, t) => i in n ? ft(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t, V = (n, i) => {
5
5
  for (var t in i || (i = {}))
6
- tt.call(i, t) && H(n, t, i[t]);
6
+ tt.call(i, t) && X(n, t, i[t]);
7
7
  if (R)
8
8
  for (var t of R(i))
9
- et.call(i, t) && H(n, t, i[t]);
9
+ et.call(i, t) && X(n, t, i[t]);
10
10
  return n;
11
11
  }, A = (n, i) => gt(n, dt(i));
12
12
  var N = (n, i) => {
@@ -18,8 +18,8 @@ var N = (n, i) => {
18
18
  i.indexOf(e) < 0 && et.call(n, e) && (t[e] = n[e]);
19
19
  return t;
20
20
  };
21
- var h = (n, i, t) => H(n, typeof i != "symbol" ? i + "" : i, t);
22
- var b = (n, i, t) => pt(bt(n), t, i);
21
+ var h = (n, i, t) => X(n, typeof i != "symbol" ? i + "" : i, t);
22
+ var p = (n, i, t) => pt(bt(n), t, i);
23
23
  var u = (n, i, t) => new Promise((e, s) => {
24
24
  var r = (c) => {
25
25
  try {
@@ -36,8 +36,8 @@ var u = (n, i, t) => new Promise((e, s) => {
36
36
  }, l = (c) => c.done ? e(c.value) : Promise.resolve(c.value).then(r, a);
37
37
  l((t = t.apply(n, i)).next());
38
38
  });
39
- import { isBoolean as it, isEqual as B, isString as _, isEmpty as X, truncate as yt, isArray as rt, isObject as at } from "lodash-es";
40
- import { computed as lt, unref as S, reactive as U, toRef as mt } from "vue";
39
+ import { isBoolean as it, isEqual as $, isString as S, isEmpty as G, truncate as yt, isArray as rt, isObject as at } from "lodash-es";
40
+ import { computed as lt, unref as d, reactive as D } from "vue";
41
41
  var L = /* @__PURE__ */ ((n) => (n[n.SUPPRESS = 1] = "SUPPRESS", n[n.HIDDEN = 5] = "HIDDEN", n[n.INVISIBLE = 8] = "INVISIBLE", n[n.FULL = 10] = "FULL", n))(L || {});
42
42
  const nt = 10;
43
43
  ((n) => {
@@ -57,8 +57,8 @@ const nt = 10;
57
57
  n.isDefined = e;
58
58
  })(L || (L = {}));
59
59
  Object.freeze(L);
60
- const x = L;
61
- class d {
60
+ const E = L;
61
+ class b {
62
62
  constructor(i) {
63
63
  h(this, "executorFn");
64
64
  this.executorFn = i;
@@ -82,10 +82,10 @@ class d {
82
82
  boundToField(i) {
83
83
  }
84
84
  }
85
- class G extends Error {
85
+ class W extends Error {
86
86
  }
87
87
  const ct = Symbol("ValueChangedAction");
88
- class g extends d {
88
+ class g extends b {
89
89
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
90
90
  constructor(i) {
91
91
  super(i);
@@ -96,7 +96,7 @@ class g extends d {
96
96
  }
97
97
  execute(i, t, e, s) {
98
98
  return u(this, null, function* () {
99
- return b(g.prototype, this, "execute").call(this, i, t, e, s);
99
+ return p(g.prototype, this, "execute").call(this, i, t, e, s);
100
100
  });
101
101
  }
102
102
  }
@@ -106,7 +106,7 @@ class ut extends Map {
106
106
  h(this, "eagerActions", /* @__PURE__ */ new Set());
107
107
  }
108
108
  register(t) {
109
- if (!(t instanceof d))
109
+ if (!(t instanceof b))
110
110
  throw new Error("Invalid action type");
111
111
  const e = t.classIdentifier, s = this.get(e) || (() => null);
112
112
  function r(a, ...l) {
@@ -122,7 +122,7 @@ class ut extends Map {
122
122
  try {
123
123
  if (a) return yield a(e, ...s);
124
124
  } catch (l) {
125
- if (!(l instanceof G)) throw l;
125
+ if (!(l instanceof W)) throw l;
126
126
  }
127
127
  return null;
128
128
  });
@@ -134,20 +134,20 @@ class ut extends Map {
134
134
  try {
135
135
  r && (yield r(t, ...e));
136
136
  } catch (a) {
137
- if (!(a instanceof G)) throw a;
137
+ if (!(a instanceof W)) throw a;
138
138
  }
139
139
  }
140
140
  });
141
141
  }
142
142
  }
143
- const vt = Symbol("ConditionalStatementAction");
144
- class $ extends g {
143
+ const mt = Symbol("ConditionalStatementAction");
144
+ class k extends g {
145
145
  constructor(t, e) {
146
146
  const s = (r, a, l, c) => u(this, null, function* () {
147
147
  const o = t.evaluate();
148
148
  if (o !== this.lastResult) {
149
- for (const I of this.boundFields)
150
- yield e(I, o, this.lastResult);
149
+ for (const _ of this.boundFields)
150
+ yield e(_, o, this.lastResult);
151
151
  this.lastResult = o;
152
152
  }
153
153
  return a(r, l, c);
@@ -161,7 +161,7 @@ class $ extends g {
161
161
  }
162
162
  // eslint-disable-next-line class-methods-use-this
163
163
  static get classIdentifier() {
164
- return vt;
164
+ return mt;
165
165
  }
166
166
  // eslint-disable-next-line class-methods-use-this
167
167
  get eager() {
@@ -171,21 +171,21 @@ class $ extends g {
171
171
  this.boundFields.add(t);
172
172
  }
173
173
  }
174
- class xt extends $ {
174
+ class vt extends k {
175
175
  constructor(i) {
176
176
  super(i, (t, e) => u(this, null, function* () {
177
- yield t.setVisibility(e ? x.FULL : x.SUPPRESS);
177
+ yield t.setVisibility(e ? E.FULL : E.SUPPRESS);
178
178
  }));
179
179
  }
180
180
  }
181
- class Et extends $ {
181
+ class xt extends k {
182
182
  constructor(i) {
183
183
  super(i, (t, e) => u(this, null, function* () {
184
184
  yield t.setEnabled(e);
185
185
  }));
186
186
  }
187
187
  }
188
- class It extends $ {
188
+ class Et extends k {
189
189
  constructor(i, t) {
190
190
  super(i, (e, s) => u(this, null, function* () {
191
191
  s && (yield e.setValue(t));
@@ -232,87 +232,87 @@ var T = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.A
232
232
  n.isLogicOperator = s;
233
233
  })(T || (T = {}));
234
234
  Object.freeze(T);
235
- const f = T, _t = Symbol("EnabledChangingAction");
236
- class k extends d {
235
+ const f = T, It = Symbol("EnabledChangingAction");
236
+ class q extends b {
237
237
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
238
238
  constructor(i) {
239
239
  super(i);
240
240
  }
241
241
  // eslint-disable-next-line class-methods-use-this
242
242
  static get classIdentifier() {
243
- return _t;
243
+ return It;
244
244
  }
245
245
  execute(i, t, e, s) {
246
246
  return u(this, null, function* () {
247
- return b(k.prototype, this, "execute").call(this, i, t, e, s);
247
+ return p(q.prototype, this, "execute").call(this, i, t, e, s);
248
248
  });
249
249
  }
250
250
  }
251
- const St = Symbol("EnabledChangedAction");
252
- class F extends d {
251
+ const _t = Symbol("EnabledChangedAction");
252
+ class F extends b {
253
253
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
254
254
  constructor(i) {
255
255
  super(i);
256
256
  }
257
257
  // eslint-disable-next-line class-methods-use-this
258
258
  static get classIdentifier() {
259
- return St;
259
+ return _t;
260
260
  }
261
261
  execute(i, t, e, s) {
262
262
  return u(this, null, function* () {
263
- return b(F.prototype, this, "execute").call(this, i, t, e, s);
263
+ return p(F.prototype, this, "execute").call(this, i, t, e, s);
264
264
  });
265
265
  }
266
266
  }
267
- const Ct = Symbol("ValidChangedAction");
268
- class q extends d {
267
+ const St = Symbol("ValidChangedAction");
268
+ class M extends b {
269
269
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
270
270
  constructor(i) {
271
271
  super(i);
272
272
  }
273
273
  // eslint-disable-next-line class-methods-use-this
274
274
  static get classIdentifier() {
275
- return Ct;
275
+ return St;
276
276
  }
277
277
  execute(i, t, e, s) {
278
278
  return u(this, null, function* () {
279
- return b(q.prototype, this, "execute").call(this, i, t, e, s);
279
+ return p(M.prototype, this, "execute").call(this, i, t, e, s);
280
280
  });
281
281
  }
282
282
  }
283
- const Vt = Symbol("VisibilityChangingAction");
284
- class M extends d {
283
+ const Ct = Symbol("VisibilityChangingAction");
284
+ class Q extends b {
285
285
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
286
286
  constructor(i) {
287
287
  super(i);
288
288
  }
289
289
  // eslint-disable-next-line class-methods-use-this
290
290
  static get classIdentifier() {
291
- return Vt;
291
+ return Ct;
292
292
  }
293
293
  execute(i, t, e, s) {
294
294
  return u(this, null, function* () {
295
- return b(M.prototype, this, "execute").call(this, i, t, e, s);
295
+ return p(Q.prototype, this, "execute").call(this, i, t, e, s);
296
296
  });
297
297
  }
298
298
  }
299
- const At = Symbol("VisibilityChangedAction");
300
- class w extends d {
299
+ const Vt = Symbol("VisibilityChangedAction");
300
+ class w extends b {
301
301
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
302
302
  constructor(i) {
303
303
  super(i);
304
304
  }
305
305
  // eslint-disable-next-line class-methods-use-this
306
306
  static get classIdentifier() {
307
- return At;
307
+ return Vt;
308
308
  }
309
309
  execute(i, t, e, s) {
310
310
  return u(this, null, function* () {
311
- return b(w.prototype, this, "execute").call(this, i, t, e, s);
311
+ return p(w.prototype, this, "execute").call(this, i, t, e, s);
312
312
  });
313
313
  }
314
314
  }
315
- class p {
315
+ class y {
316
316
  constructor() {
317
317
  h(this, "reactiveValue", lt(() => this.value));
318
318
  // contains original field value as was provided at creation
@@ -322,7 +322,7 @@ class p {
322
322
  // when member of a Group, fieldName specifies the name of this field
323
323
  h(this, "actions", new ut());
324
324
  // default property handlers
325
- h(this, "_visibility", x.FULL);
325
+ h(this, "_visibility", E.FULL);
326
326
  h(this, "_enabled", !0);
327
327
  }
328
328
  get visibility() {
@@ -330,14 +330,14 @@ class p {
330
330
  }
331
331
  set visibility(i) {
332
332
  const t = this._visibility;
333
- if (!x.isDefined(i)) throw new Error("visibility must be a DisplayMode constant");
334
- this._visibility = x.fromAny(i), this.actions.trigger(w, this, this._visibility, t);
333
+ if (!E.isDefined(i)) throw new Error("visibility must be a DisplayMode constant");
334
+ this._visibility = E.fromAny(i), this.actions.trigger(w, this, this._visibility, t);
335
335
  }
336
336
  setVisibility(i) {
337
337
  return u(this, null, function* () {
338
- const t = this._visibility, e = yield this.actions.trigger(M, this, i, t);
339
- if (!x.isDefined(e != null ? e : i)) throw new Error("visibility must be a DisplayMode constant");
340
- this._visibility = x.fromAny(e != null ? e : i), yield this.actions.trigger(w, this, this._visibility, t);
338
+ const t = this._visibility, e = yield this.actions.trigger(Q, this, i, t);
339
+ if (!E.isDefined(e != null ? e : i)) throw new Error("visibility must be a DisplayMode constant");
340
+ this._visibility = E.fromAny(e != null ? e : i), yield this.actions.trigger(w, this, this._visibility, t);
341
341
  });
342
342
  }
343
343
  get enabled() {
@@ -350,20 +350,20 @@ class p {
350
350
  }
351
351
  setEnabled(i) {
352
352
  return u(this, null, function* () {
353
- const t = this._enabled, e = yield this.actions.trigger(k, this, i, t);
353
+ const t = this._enabled, e = yield this.actions.trigger(q, this, i, t);
354
354
  if (!it(e != null ? e : i)) throw new Error("Enabled value must be boolean");
355
355
  this._enabled = e != null ? e : i, yield this.actions.trigger(F, this, this._enabled, t);
356
356
  });
357
357
  }
358
358
  validate() {
359
359
  const i = this.valid;
360
- this.valid = this.errors.length === 0, this.valid !== i && this.actions.trigger(q, this, this.valid, i);
360
+ this.valid = this.errors.length === 0, this.valid !== i && this.actions.trigger(M, this, this.valid, i);
361
361
  }
362
362
  get fullValue() {
363
363
  return this.value;
364
364
  }
365
365
  get isChanged() {
366
- return !B(this.value, this.originalValue);
366
+ return !$(this.value, this.originalValue);
367
367
  }
368
368
  registerAction(i) {
369
369
  const t = i;
@@ -373,7 +373,7 @@ class p {
373
373
  return this.actions.trigger(i, this, ...t);
374
374
  }
375
375
  }
376
- function Nt(n, i) {
376
+ function At(n, i) {
377
377
  return n ? !i : i;
378
378
  }
379
379
  class j {
@@ -384,10 +384,10 @@ class j {
384
384
  this.operand1 = i, this.operator = t, this.operand2 = e;
385
385
  }
386
386
  get operand1Value() {
387
- return this.operand1 instanceof j ? this.operand1.evaluate() : this.operand1 instanceof p ? S(this.operand1.value) : this.operand1;
387
+ return this.operand1 instanceof j ? this.operand1.evaluate() : this.operand1 instanceof y ? d(this.operand1.value) : this.operand1;
388
388
  }
389
389
  get operand2Value() {
390
- return this.operand2 instanceof j ? this.operand2.evaluate() : this.operand2 instanceof p ? S(this.operand2.value) : this.operand2;
390
+ return this.operand2 instanceof j ? this.operand2.evaluate() : this.operand2 instanceof y ? d(this.operand2.value) : this.operand2;
391
391
  }
392
392
  evaluate() {
393
393
  var e, s, r, a;
@@ -402,7 +402,7 @@ class j {
402
402
  case f.NOR:
403
403
  return !(i || t);
404
404
  case f.XOR:
405
- return Nt(i, t);
405
+ return At(i, t);
406
406
  case f.NOT:
407
407
  return !i;
408
408
  case f.EQUALS:
@@ -422,9 +422,9 @@ class j {
422
422
  case f.NOT_IN:
423
423
  return !((a = (r = t == null ? void 0 : t.includes) == null ? void 0 : r.call(t, i)) == null || a);
424
424
  case f.INCLUDES:
425
- return _(i) && _(t) && i.indexOf(t) >= 0;
425
+ return S(i) && S(t) && i.indexOf(t) >= 0;
426
426
  case f.NOT_INCLUDES:
427
- return !(_(i) && _(t) && i.indexOf(t) >= 0);
427
+ return !(S(i) && S(t) && i.indexOf(t) >= 0);
428
428
  default:
429
429
  throw new Error(`Operator not implemented ${this.operator}`);
430
430
  }
@@ -436,77 +436,77 @@ class j {
436
436
  collectFields() {
437
437
  const i = /* @__PURE__ */ new Set();
438
438
  function t(e) {
439
- e instanceof p ? i.add(e) : e instanceof j && e.collectFields().forEach((r) => i.add(r));
439
+ e instanceof y ? i.add(e) : e instanceof j && e.collectFields().forEach((r) => i.add(r));
440
440
  }
441
441
  return t(this.operand1), t(this.operand2), i;
442
442
  }
443
443
  }
444
- const jt = Symbol("ExecuteAction");
445
- class Q extends d {
444
+ const Nt = Symbol("ExecuteAction");
445
+ class z extends b {
446
446
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
447
447
  constructor(i) {
448
448
  super(i);
449
449
  }
450
450
  // eslint-disable-next-line class-methods-use-this
451
451
  static get classIdentifier() {
452
- return jt;
452
+ return Nt;
453
453
  }
454
454
  execute(i, t, e) {
455
455
  return u(this, null, function* () {
456
- return b(Q.prototype, this, "execute").call(this, i, t, e);
456
+ return p(z.prototype, this, "execute").call(this, i, t, e);
457
457
  });
458
458
  }
459
459
  }
460
- const Lt = Symbol("ListItemAddedAction");
461
- class O extends d {
460
+ const jt = Symbol("ListItemAddedAction");
461
+ class O extends b {
462
462
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
463
463
  constructor(i) {
464
464
  super(i);
465
465
  }
466
466
  // eslint-disable-next-line class-methods-use-this
467
467
  static get classIdentifier() {
468
- return Lt;
468
+ return jt;
469
469
  }
470
470
  execute(i, t, e, s) {
471
471
  return u(this, null, function* () {
472
- return b(O.prototype, this, "execute").call(this, i, t, e, s);
472
+ return p(O.prototype, this, "execute").call(this, i, t, e, s);
473
473
  });
474
474
  }
475
475
  }
476
- const Tt = Symbol("ListItemRemovedAction");
477
- class z extends d {
476
+ const Lt = Symbol("ListItemRemovedAction");
477
+ class H extends b {
478
478
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
479
479
  constructor(i) {
480
480
  super(i);
481
481
  }
482
482
  // eslint-disable-next-line class-methods-use-this
483
483
  static get classIdentifier() {
484
- return Tt;
484
+ return Lt;
485
485
  }
486
486
  execute(i, t, e, s) {
487
487
  return u(this, null, function* () {
488
- return b(z.prototype, this, "execute").call(this, i, t, e, s);
488
+ return p(H.prototype, this, "execute").call(this, i, t, e, s);
489
489
  });
490
490
  }
491
491
  }
492
492
  function st(n, i) {
493
493
  return (n == null ? void 0 : n.label) == null && (n == null ? void 0 : n.icon) == null ? i : n;
494
494
  }
495
- class D extends p {
495
+ class B extends y {
496
496
  constructor(t) {
497
497
  super();
498
498
  h(this, "_value");
499
499
  if (t) {
500
500
  const e = t, { value: s, originalValue: r, validators: a, actions: l } = e, c = N(e, ["value", "originalValue", "validators", "actions"]);
501
- [...a || [], ...l || []].forEach((P) => this.registerAction(P)), Object.assign(this, c);
502
- const o = { label: s == null ? void 0 : s.label, icon: s == null ? void 0 : s.icon }, I = Object.freeze({ label: r == null ? void 0 : r.label, icon: r == null ? void 0 : r.icon });
503
- this._value = U(st(o, I)), this.originalValue = st(I, o);
501
+ [...a || [], ...l || []].forEach((U) => this.registerAction(U)), Object.assign(this, c);
502
+ const o = { label: s == null ? void 0 : s.label, icon: s == null ? void 0 : s.icon }, _ = Object.freeze({ label: r == null ? void 0 : r.label, icon: r == null ? void 0 : r.icon });
503
+ this._value = D(st(o, _)), this.originalValue = st(_, o);
504
504
  } else
505
- this._value = U({ label: void 0, icon: void 0 });
505
+ this._value = D({ label: void 0, icon: void 0 });
506
506
  this.actions.triggerEager(this, this.value, this.originalValue);
507
507
  }
508
508
  static create(t) {
509
- return U(new D(t));
509
+ return D(new B(t));
510
510
  }
511
511
  get value() {
512
512
  return this._value;
@@ -537,7 +537,7 @@ class D extends p {
537
537
  }
538
538
  clone(t) {
539
539
  var e, s, r, a;
540
- return D.create(A(V({
540
+ return B.create(A(V({
541
541
  value: (e = t == null ? void 0 : t.value) != null ? e : this.value
542
542
  }, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
543
543
  errors: [...(s = t == null ? void 0 : t.errors) != null ? s : this.errors],
@@ -546,10 +546,10 @@ class D extends p {
546
546
  }));
547
547
  }
548
548
  execute(t) {
549
- this.actions.trigger(Q, this, t);
549
+ this.actions.trigger(z, this, t);
550
550
  }
551
551
  }
552
- class C extends p {
552
+ class C extends y {
553
553
  constructor(t) {
554
554
  super();
555
555
  h(this, "_value");
@@ -565,7 +565,7 @@ class C extends p {
565
565
  * @returns Reactive Field instance
566
566
  */
567
567
  static create(t) {
568
- return U(new C(t));
568
+ return D(new C(t));
569
569
  }
570
570
  get value() {
571
571
  return this._value;
@@ -591,18 +591,18 @@ class C extends p {
591
591
  }));
592
592
  }
593
593
  }
594
- const Ft = C.create({ value: "EmptyField" }).registerAction(new g(
594
+ const Tt = C.create({ value: "EmptyField" }).registerAction(new g(
595
595
  () => u(void 0, null, function* () {
596
596
  console.warn("Working with EmptyField! This should not happen");
597
597
  })
598
598
  ));
599
- class E extends p {
599
+ class I extends y {
600
600
  constructor(t, e) {
601
601
  super();
602
602
  h(this, "_fields");
603
603
  h(this, "_value", null);
604
604
  h(this, "suppressNotifyValueChanged", !1);
605
- if (!E.isValidFields(t)) throw new Error("Invalid fields object provided");
605
+ if (!I.isValidFields(t)) throw new Error("Invalid fields object provided");
606
606
  if (this._fields = {}, Object.entries(t).forEach(([r, a]) => {
607
607
  Object.defineProperty(a, "parent", { get: () => this, configurable: !1, enumerable: !1 }), Object.defineProperty(a, "fieldName", { get: () => r, configurable: !1, enumerable: !1 }), Object.defineProperty(
608
608
  this._fields,
@@ -619,14 +619,14 @@ class E extends p {
619
619
  }
620
620
  static isValidFields(t) {
621
621
  function e(s) {
622
- return s instanceof p;
622
+ return s instanceof y;
623
623
  }
624
624
  return typeof t == "object" && t !== null && Object.entries(t).every(([, s]) => e(s));
625
625
  }
626
626
  static createFromFormData(t) {
627
- if (t instanceof p)
627
+ if (t instanceof y)
628
628
  throw new Error("data is already a Form structure, should be a simple object");
629
- return new E(
629
+ return new I(
630
630
  t == null ? {} : Object.fromEntries(
631
631
  Object.entries(t).map(([e, s]) => [e, C.create({ value: s })])
632
632
  )
@@ -643,8 +643,8 @@ class E extends p {
643
643
  const t = {};
644
644
  return Object.entries(this._fields).forEach(([e, s]) => {
645
645
  const r = s.value;
646
- (s.enabled || s instanceof E && !X(r)) && (t[e] = r);
647
- }), X(t) ? null : t;
646
+ (s.enabled || s instanceof I && !G(r)) && (t[e] = r);
647
+ }), G(t) ? null : t;
648
648
  }
649
649
  set value(t) {
650
650
  this.suppressNotifyValueChanged = !0;
@@ -684,7 +684,7 @@ class E extends p {
684
684
  return u(this, null, function* () {
685
685
  if (this.suppressNotifyValueChanged) return;
686
686
  const t = this.value;
687
- if (!B(t, this._value)) {
687
+ if (!$(t, this._value)) {
688
688
  const e = this._value;
689
689
  this._value = t, yield this.actions.trigger(g, this, t, e), this.parent && (yield this.parent.notifyValueChanged());
690
690
  }
@@ -695,7 +695,7 @@ class E extends p {
695
695
  const e = {};
696
696
  return Object.entries(this._fields).forEach(([c, o]) => {
697
697
  e[c] = o.clone();
698
- }), new E(e, A(V({
698
+ }), new I(e, A(V({
699
699
  value: (s = t == null ? void 0 : t.value) != null ? s : this.value
700
700
  }, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
701
701
  errors: [...(r = t == null ? void 0 : t.errors) != null ? r : []],
@@ -704,7 +704,7 @@ class E extends p {
704
704
  }));
705
705
  }
706
706
  }
707
- class W extends p {
707
+ class J extends y {
708
708
  constructor(t, e) {
709
709
  super();
710
710
  h(this, "_value", null);
@@ -718,7 +718,7 @@ class W extends p {
718
718
  }
719
719
  processSetValueItem(t) {
720
720
  let e;
721
- return t instanceof E ? e = t : this._itemTemplate ? e = this._itemTemplate.clone({ value: t }) : e = E.createFromFormData(t), Object.defineProperty(e, "parent", { get: () => this, configurable: !1, enumerable: !1 }), e;
721
+ return t instanceof I ? e = t : this._itemTemplate ? e = this._itemTemplate.clone({ value: t }) : e = I.createFromFormData(t), Object.defineProperty(e, "parent", { get: () => this, configurable: !1, enumerable: !1 }), e;
722
722
  }
723
723
  setValueInternal(t) {
724
724
  Array.isArray(t) && (this._value = t.map((e) => this.processSetValueItem(e)));
@@ -726,7 +726,7 @@ class W extends p {
726
726
  get value() {
727
727
  var e;
728
728
  const t = (e = this._value) == null ? void 0 : e.map((s) => s.value);
729
- return X(t) ? null : t;
729
+ return G(t) ? null : t;
730
730
  }
731
731
  set value(t) {
732
732
  const e = this.value;
@@ -740,7 +740,7 @@ class W extends p {
740
740
  }
741
741
  clone(t) {
742
742
  var e, s, r, a, l;
743
- return new W((e = this._itemTemplate) == null ? void 0 : e.clone(), A(V({
743
+ return new J((e = this._itemTemplate) == null ? void 0 : e.clone(), A(V({
744
744
  value: [...(s = t == null ? void 0 : t.value) != null ? s : this.value]
745
745
  }, t && "originalValue" in t ? { originalValue: t.originalValue } : {}), {
746
746
  errors: [...(r = t == null ? void 0 : t.errors) != null ? r : []],
@@ -750,7 +750,7 @@ class W extends p {
750
750
  }
751
751
  notifyValueChanged() {
752
752
  const t = this.value;
753
- if (!B(t, this._previousValue)) {
753
+ if (!$(t, this._previousValue)) {
754
754
  const e = this._previousValue;
755
755
  this._previousValue = t, this.actions.trigger(g, this, t, e), this.parent && this.parent.notifyValueChanged();
756
756
  }
@@ -770,7 +770,7 @@ class W extends p {
770
770
  var s;
771
771
  if (this._value == null || t < 0 || this._value.length <= t) return;
772
772
  let e = (s = this._value.splice(t, 1)) == null ? void 0 : s[0];
773
- return e && (e = e.clone(), this.actions.trigger(z, this, e, t), this.notifyValueChanged()), e;
773
+ return e && (e = e.clone(), this.actions.trigger(H, this, e, t), this.notifyValueChanged()), e;
774
774
  }
775
775
  insert(t, e) {
776
776
  for (this._value == null && (this._value = []); this._value.length < e; ) {
@@ -785,21 +785,21 @@ class W extends p {
785
785
  }
786
786
  }
787
787
  const ot = { useMarkdownInValidators: !0 };
788
- function wt() {
788
+ function Ft() {
789
789
  return ot;
790
790
  }
791
- function Ot(n) {
791
+ function wt(n) {
792
792
  Object.assign(ot, n);
793
793
  }
794
- const Kt = {
794
+ const Jt = {
795
795
  install(n, i) {
796
- i && Ot(i);
796
+ i && wt(i);
797
797
  }
798
798
  };
799
- class J extends String {
799
+ class P extends String {
800
800
  }
801
801
  function K(n) {
802
- const i = S(n);
802
+ const i = d(n);
803
803
  return typeof i == "object" && "componentName" in i;
804
804
  }
805
805
  class Y {
@@ -816,7 +816,7 @@ class Y {
816
816
  }
817
817
  // eslint-disable-line class-methods-use-this
818
818
  }
819
- class Pt extends Y {
819
+ class Ot extends Y {
820
820
  constructor(t) {
821
821
  super();
822
822
  h(this, "text");
@@ -830,56 +830,56 @@ class Pt extends Y {
830
830
  return this.text;
831
831
  }
832
832
  }
833
- class y extends Y {
833
+ class m extends Y {
834
834
  constructor(t) {
835
835
  super();
836
836
  h(this, "text");
837
837
  h(this, "textType");
838
- this.text = mt(t), this.textType = lt(() => this.getTextType);
838
+ this.text = t, this.textType = lt(() => this.getTextType);
839
839
  }
840
840
  get getTextType() {
841
- const t = this.text.value;
842
- return t ? t instanceof J ? "md" : K(t) ? "component" : "string" : "string";
841
+ const t = d(this.text);
842
+ return t ? t instanceof P ? "md" : K(t) ? "component" : "string" : "string";
843
843
  }
844
844
  get componentName() {
845
- switch (this.textType.value) {
845
+ switch (d(this.textType)) {
846
846
  case "string":
847
847
  return "template";
848
848
  case "md":
849
849
  return "vue-markdown";
850
850
  case "component":
851
- return this.text.value.componentName;
851
+ return d(this.text).componentName;
852
852
  default:
853
853
  return "template";
854
854
  }
855
855
  }
856
856
  get componentBindings() {
857
- switch (this.textType.value) {
857
+ switch (d(this.textType)) {
858
858
  case "string":
859
859
  return {};
860
860
  case "md":
861
- return { source: this.text };
861
+ return { source: this.text.toString() };
862
862
  case "component":
863
- return this.text.value.componentProps;
863
+ return d(this.text).componentProps;
864
864
  default:
865
865
  return {};
866
866
  }
867
867
  }
868
868
  get componentBody() {
869
- switch (this.textType.value) {
869
+ switch (d(this.textType)) {
870
870
  case "string":
871
- return this.text.value;
871
+ return d(this.text);
872
872
  default:
873
873
  return "";
874
874
  }
875
875
  }
876
876
  }
877
- function m(n) {
878
- return wt().useMarkdownInValidators ? new J(n) : n.replace(/[*_~`]/g, "").replace(/\[.*?\]\((.*?)\)/g, "$1").replace(/!\[.*?\]\((.*?)\)/g, "").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, `
877
+ function v(n) {
878
+ return Ft().useMarkdownInValidators ? new P(n) : n.replace(/[*_~`]/g, "").replace(/\[.*?\]\((.*?)\)/g, "$1").replace(/!\[.*?\]\((.*?)\)/g, "").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, `
879
879
  `);
880
880
  }
881
- const Rt = Symbol("Validator");
882
- class v extends g {
881
+ const Pt = Symbol("Validator");
882
+ class x extends g {
883
883
  /**
884
884
  * Creates a new validator
885
885
  * @param validationFn Function that validates the field value and returns errors or null
@@ -891,10 +891,10 @@ class v extends g {
891
891
  (o) => Object.defineProperty(o, "source", { value: this.source, enumerable: !1, configurable: !1 })
892
892
  );
893
893
  for (let o = s.errors.length - 1; o >= 0; o--) {
894
- const I = s.errors[o];
895
- if (I.source === this.source) {
896
- const P = c.findIndex((ht) => B(ht, I));
897
- P >= 0 ? c.splice(P, 1) : s.errors.splice(o, 1);
894
+ const _ = s.errors[o];
895
+ if (_.source === this.source) {
896
+ const U = c.findIndex((ht) => $(ht, _));
897
+ U >= 0 ? c.splice(U, 1) : s.errors.splice(o, 1);
898
898
  }
899
899
  }
900
900
  return c.length > 0 && s.errors.push(...c), s.validate(), r(s, a, l);
@@ -904,7 +904,7 @@ class v extends g {
904
904
  }
905
905
  // eslint-disable-next-line class-methods-use-this
906
906
  static get classIdentifier() {
907
- return Rt;
907
+ return Pt;
908
908
  }
909
909
  // eslint-disable-next-line class-methods-use-this
910
910
  get eager() {
@@ -916,57 +916,57 @@ class v extends g {
916
916
  let s = t;
917
917
  return Object.keys(e).forEach((r) => {
918
918
  s = s.replaceAll(`{${r}}`, e[r]);
919
- }), s;
919
+ }), t instanceof P ? new P(s) : s;
920
920
  }
921
921
  }
922
- class Ut extends v {
922
+ class Ut extends x {
923
923
  constructor(i, t) {
924
- const e = t || m("Must be one of [**{allowedAsText}**]");
924
+ const e = t || v("Must be one of [**{allowedAsText}**]");
925
925
  let s = i.join(", ");
926
926
  s.length > 60 && (s = yt(s, {
927
927
  length: 40,
928
928
  separator: ", ",
929
929
  omission: `... (${i.length} items total)`
930
930
  }));
931
- const r = (a, l, c) => i.includes(S(a)) ? null : [
932
- new y(
931
+ const r = (a, l, c) => i.includes(d(a)) ? null : [
932
+ new m(
933
933
  this.replacePlaceholders(e, { newValue: a, oldValue: l, field: c, allowedValues: i, allowedAsText: s })
934
934
  )
935
935
  ];
936
936
  super(r);
937
937
  }
938
938
  }
939
- function Dt(n) {
940
- return n == null ? 0 : rt(n) || _(n) ? n.length : at(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
939
+ function Rt(n) {
940
+ return n == null ? 0 : rt(n) || S(n) ? n.length : at(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
941
941
  }
942
- class Bt extends v {
942
+ class Dt extends x {
943
943
  constructor(i) {
944
- const t = i || m("Please enter a value"), e = (s, r, a) => Dt(S(s)) === 0 ? [new y(
944
+ const t = i || v("Please enter a value"), e = (s, r, a) => Rt(d(s)) === 0 ? [new m(
945
945
  this.replacePlaceholders(t, { newValue: s, oldValue: r, field: a })
946
946
  )] : null;
947
947
  super(e);
948
948
  }
949
949
  }
950
- class $t extends v {
950
+ class Bt extends x {
951
951
  constructor(i, t) {
952
- const e = t || m("Value must be larger or equal to **{minValue}**"), s = (r, a, l) => r < i ? [
953
- new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: i }))
952
+ const e = t || v("Value must be larger or equal to **{minValue}**"), s = (r, a, l) => r < i ? [
953
+ new m(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: i }))
954
954
  ] : null;
955
955
  super(s);
956
956
  }
957
957
  }
958
- class kt extends v {
958
+ class $t extends x {
959
959
  constructor(i, t) {
960
- const e = t || m("Value must be less than or equal to **{maxValue}**"), s = (r, a, l) => r > i ? [
961
- new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: i }))
960
+ const e = t || v("Value must be less than or equal to **{maxValue}**"), s = (r, a, l) => r > i ? [
961
+ new m(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: i }))
962
962
  ] : null;
963
963
  super(s);
964
964
  }
965
965
  }
966
- class qt extends v {
966
+ class kt extends x {
967
967
  constructor(i, t, e) {
968
- const s = e || m("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < i || a > t ? [
969
- new y(
968
+ const s = e || v("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < i || a > t ? [
969
+ new m(
970
970
  this.replacePlaceholders(s, { newValue: a, oldValue: l, field: c, minValue: i, maxValue: t })
971
971
  )
972
972
  ] : null;
@@ -974,30 +974,30 @@ class qt extends v {
974
974
  }
975
975
  }
976
976
  function Z(n) {
977
- return n == null ? 0 : rt(n) || _(n) ? n.length : at(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
977
+ return n == null ? 0 : rt(n) || S(n) ? n.length : at(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
978
978
  }
979
- class Mt extends v {
979
+ class qt extends x {
980
980
  constructor(i, t) {
981
- const e = t || m("Length must be larger or equal to **{minLength}**"), s = (r, a, l) => Z(r) < i ? [
982
- new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: i }))
981
+ const e = t || v("Length must be larger or equal to **{minLength}**"), s = (r, a, l) => Z(r) < i ? [
982
+ new m(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: i }))
983
983
  ] : null;
984
984
  super(s);
985
985
  }
986
986
  }
987
- class Qt extends v {
987
+ class Mt extends x {
988
988
  constructor(i, t) {
989
- const e = t || m("Length must be less than or equal to **{maxLength}**"), s = (r, a, l) => Z(r) > i ? [
990
- new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: i }))
989
+ const e = t || v("Length must be less than or equal to **{maxLength}**"), s = (r, a, l) => Z(r) > i ? [
990
+ new m(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: i }))
991
991
  ] : null;
992
992
  super(s);
993
993
  }
994
994
  }
995
- class zt extends v {
995
+ class Qt extends x {
996
996
  constructor(i, t, e) {
997
- const s = e || m("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
997
+ const s = e || v("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
998
998
  const o = Z(a);
999
999
  return o < i || o > t ? [
1000
- new y(
1000
+ new m(
1001
1001
  this.replacePlaceholders(s, { newValue: a, oldValue: l, field: c, minLength: i, maxLength: t })
1002
1002
  )
1003
1003
  ] : null;
@@ -1005,96 +1005,96 @@ class zt extends v {
1005
1005
  super(r);
1006
1006
  }
1007
1007
  }
1008
- class Ht extends v {
1008
+ class zt extends x {
1009
1009
  constructor(i, t) {
1010
- const e = t || m('Value must match pattern "**{pattern}**"'), s = (r, a, l) => i.test(String(S(r))) ? null : [
1011
- new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: i }))
1010
+ const e = t || v('Value must match pattern "**{pattern}**"'), s = (r, a, l) => i.test(String(d(r))) ? null : [
1011
+ new m(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: i }))
1012
1012
  ];
1013
1013
  super(s);
1014
1014
  }
1015
1015
  }
1016
- const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1016
+ const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1017
1017
  __proto__: null,
1018
1018
  InAllowedValues: Ut,
1019
- LengthInRange: zt,
1020
- MaxLength: Qt,
1021
- MaxValue: kt,
1022
- MinLength: Mt,
1023
- MinValue: $t,
1024
- Pattern: Ht,
1025
- Required: Bt,
1026
- ValueInRange: qt
1027
- }, Symbol.toStringTag, { value: "Module" })), Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1019
+ LengthInRange: Qt,
1020
+ MaxLength: Mt,
1021
+ MaxValue: $t,
1022
+ MinLength: qt,
1023
+ MinValue: Bt,
1024
+ Pattern: zt,
1025
+ Required: Dt,
1026
+ ValueInRange: kt
1027
+ }, Symbol.toStringTag, { value: "Module" })), Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1028
1028
  __proto__: null,
1029
- AbortEventHandlingException: G,
1030
- Action: D,
1029
+ AbortEventHandlingException: W,
1030
+ Action: B,
1031
1031
  ActionsMap: ut,
1032
- ConditionalEnabledAction: Et,
1033
- ConditionalStatementAction: $,
1034
- ConditionalValueAction: It,
1035
- ConditionalVisibilityAction: xt,
1036
- DisplayMode: x,
1037
- EmptyField: Ft,
1032
+ ConditionalEnabledAction: xt,
1033
+ ConditionalStatementAction: k,
1034
+ ConditionalValueAction: Et,
1035
+ ConditionalVisibilityAction: vt,
1036
+ DisplayMode: E,
1037
+ EmptyField: Tt,
1038
1038
  EnabledChangedAction: F,
1039
- EnabledChangingAction: k,
1040
- ExecuteAction: Q,
1039
+ EnabledChangingAction: q,
1040
+ ExecuteAction: z,
1041
1041
  Field: C,
1042
- FieldActionBase: d,
1043
- FieldBase: p,
1044
- Group: E,
1045
- List: W,
1042
+ FieldActionBase: b,
1043
+ FieldBase: y,
1044
+ Group: I,
1045
+ List: J,
1046
1046
  ListItemAddedAction: O,
1047
- ListItemRemovedAction: z,
1048
- MdString: J,
1047
+ ListItemRemovedAction: H,
1048
+ MdString: P,
1049
1049
  Operator: f,
1050
1050
  Statement: j,
1051
- ValidChangedAction: q,
1051
+ ValidChangedAction: M,
1052
1052
  ValidationError: Y,
1053
- ValidationErrorRenderContent: y,
1054
- ValidationErrorText: Pt,
1055
- Validator: v,
1056
- Validators: Xt,
1053
+ ValidationErrorRenderContent: m,
1054
+ ValidationErrorText: Ot,
1055
+ Validator: x,
1056
+ Validators: Ht,
1057
1057
  ValueChangedAction: g,
1058
1058
  VisibilityChangedAction: w,
1059
- VisibilityChangingAction: M,
1060
- buildErrorMessage: m,
1059
+ VisibilityChangingAction: Q,
1060
+ buildErrorMessage: v,
1061
1061
  isCustomModalContentComponentDef: K
1062
1062
  }, Symbol.toStringTag, { value: "Module" }));
1063
1063
  export {
1064
- G as AbortEventHandlingException,
1065
- D as Action,
1064
+ W as AbortEventHandlingException,
1065
+ B as Action,
1066
1066
  ut as ActionsMap,
1067
- Et as ConditionalEnabledAction,
1068
- $ as ConditionalStatementAction,
1069
- It as ConditionalValueAction,
1070
- xt as ConditionalVisibilityAction,
1071
- x as DisplayMode,
1072
- Ft as EmptyField,
1067
+ xt as ConditionalEnabledAction,
1068
+ k as ConditionalStatementAction,
1069
+ Et as ConditionalValueAction,
1070
+ vt as ConditionalVisibilityAction,
1071
+ E as DisplayMode,
1072
+ Tt as EmptyField,
1073
1073
  F as EnabledChangedAction,
1074
- k as EnabledChangingAction,
1075
- Q as ExecuteAction,
1074
+ q as EnabledChangingAction,
1075
+ z as ExecuteAction,
1076
1076
  C as Field,
1077
- d as FieldActionBase,
1078
- p as FieldBase,
1079
- E as Group,
1080
- W as List,
1077
+ b as FieldActionBase,
1078
+ y as FieldBase,
1079
+ I as Group,
1080
+ J as List,
1081
1081
  O as ListItemAddedAction,
1082
- z as ListItemRemovedAction,
1083
- J as MdString,
1082
+ H as ListItemRemovedAction,
1083
+ P as MdString,
1084
1084
  f as Operator,
1085
1085
  j as Statement,
1086
- q as ValidChangedAction,
1086
+ M as ValidChangedAction,
1087
1087
  Y as ValidationError,
1088
- y as ValidationErrorRenderContent,
1089
- Pt as ValidationErrorText,
1090
- v as Validator,
1091
- Xt as Validators,
1088
+ m as ValidationErrorRenderContent,
1089
+ Ot as ValidationErrorText,
1090
+ x as Validator,
1091
+ Ht as Validators,
1092
1092
  g as ValueChangedAction,
1093
1093
  w as VisibilityChangedAction,
1094
- M as VisibilityChangingAction,
1095
- m as buildErrorMessage,
1096
- Yt as default,
1097
- Kt as forms,
1094
+ Q as VisibilityChangingAction,
1095
+ v as buildErrorMessage,
1096
+ Kt as default,
1097
+ Jt as forms,
1098
1098
  K as isCustomModalContentComponentDef
1099
1099
  };
1100
1100
  //# sourceMappingURL=dynamicforms-vue-forms.js.map