@dynamicforms/vue-forms 0.2.0 → 0.2.1

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.
@@ -37,7 +37,7 @@ var u = (n, i, t) => new Promise((e, s) => {
37
37
  l((t = t.apply(n, i)).next());
38
38
  });
39
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";
40
+ import { computed as lt, unref as S, reactive as U, ref as mt, isRef as vt } 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) => {
@@ -140,7 +140,7 @@ class ut extends Map {
140
140
  });
141
141
  }
142
142
  }
143
- const vt = Symbol("ConditionalStatementAction");
143
+ const xt = Symbol("ConditionalStatementAction");
144
144
  class $ extends g {
145
145
  constructor(t, e) {
146
146
  const s = (r, a, l, c) => u(this, null, function* () {
@@ -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 xt;
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 Et extends $ {
175
175
  constructor(i) {
176
176
  super(i, (t, e) => u(this, null, function* () {
177
177
  yield t.setVisibility(e ? x.FULL : x.SUPPRESS);
178
178
  }));
179
179
  }
180
180
  }
181
- class Et extends $ {
181
+ class It extends $ {
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 _t extends $ {
189
189
  constructor(i, t) {
190
190
  super(i, (e, s) => u(this, null, function* () {
191
191
  s && (yield e.setValue(t));
@@ -232,7 +232,7 @@ 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");
235
+ const f = T, St = Symbol("EnabledChangingAction");
236
236
  class k extends d {
237
237
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
238
238
  constructor(i) {
@@ -240,7 +240,7 @@ class k extends d {
240
240
  }
241
241
  // eslint-disable-next-line class-methods-use-this
242
242
  static get classIdentifier() {
243
- return _t;
243
+ return St;
244
244
  }
245
245
  execute(i, t, e, s) {
246
246
  return u(this, null, function* () {
@@ -248,7 +248,7 @@ class k extends d {
248
248
  });
249
249
  }
250
250
  }
251
- const St = Symbol("EnabledChangedAction");
251
+ const Ct = Symbol("EnabledChangedAction");
252
252
  class F extends d {
253
253
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
254
254
  constructor(i) {
@@ -256,7 +256,7 @@ class F extends d {
256
256
  }
257
257
  // eslint-disable-next-line class-methods-use-this
258
258
  static get classIdentifier() {
259
- return St;
259
+ return Ct;
260
260
  }
261
261
  execute(i, t, e, s) {
262
262
  return u(this, null, function* () {
@@ -264,7 +264,7 @@ class F extends d {
264
264
  });
265
265
  }
266
266
  }
267
- const Ct = Symbol("ValidChangedAction");
267
+ const Vt = Symbol("ValidChangedAction");
268
268
  class q extends d {
269
269
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
270
270
  constructor(i) {
@@ -272,7 +272,7 @@ class q extends d {
272
272
  }
273
273
  // eslint-disable-next-line class-methods-use-this
274
274
  static get classIdentifier() {
275
- return Ct;
275
+ return Vt;
276
276
  }
277
277
  execute(i, t, e, s) {
278
278
  return u(this, null, function* () {
@@ -280,7 +280,7 @@ class q extends d {
280
280
  });
281
281
  }
282
282
  }
283
- const Vt = Symbol("VisibilityChangingAction");
283
+ const At = Symbol("VisibilityChangingAction");
284
284
  class M extends d {
285
285
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
286
286
  constructor(i) {
@@ -288,7 +288,7 @@ class M extends d {
288
288
  }
289
289
  // eslint-disable-next-line class-methods-use-this
290
290
  static get classIdentifier() {
291
- return Vt;
291
+ return At;
292
292
  }
293
293
  execute(i, t, e, s) {
294
294
  return u(this, null, function* () {
@@ -296,7 +296,7 @@ class M extends d {
296
296
  });
297
297
  }
298
298
  }
299
- const At = Symbol("VisibilityChangedAction");
299
+ const Nt = Symbol("VisibilityChangedAction");
300
300
  class w extends d {
301
301
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
302
302
  constructor(i) {
@@ -304,7 +304,7 @@ class w extends d {
304
304
  }
305
305
  // eslint-disable-next-line class-methods-use-this
306
306
  static get classIdentifier() {
307
- return At;
307
+ return Nt;
308
308
  }
309
309
  execute(i, t, e, s) {
310
310
  return u(this, null, function* () {
@@ -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 jt(n, i) {
377
377
  return n ? !i : i;
378
378
  }
379
379
  class j {
@@ -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 jt(i, t);
406
406
  case f.NOT:
407
407
  return !i;
408
408
  case f.EQUALS:
@@ -441,7 +441,7 @@ class j {
441
441
  return t(this.operand1), t(this.operand2), i;
442
442
  }
443
443
  }
444
- const jt = Symbol("ExecuteAction");
444
+ const Lt = Symbol("ExecuteAction");
445
445
  class Q extends d {
446
446
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
447
447
  constructor(i) {
@@ -449,7 +449,7 @@ class Q extends d {
449
449
  }
450
450
  // eslint-disable-next-line class-methods-use-this
451
451
  static get classIdentifier() {
452
- return jt;
452
+ return Lt;
453
453
  }
454
454
  execute(i, t, e) {
455
455
  return u(this, null, function* () {
@@ -457,7 +457,7 @@ class Q extends d {
457
457
  });
458
458
  }
459
459
  }
460
- const Lt = Symbol("ListItemAddedAction");
460
+ const Tt = Symbol("ListItemAddedAction");
461
461
  class O extends d {
462
462
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
463
463
  constructor(i) {
@@ -465,7 +465,7 @@ class O extends d {
465
465
  }
466
466
  // eslint-disable-next-line class-methods-use-this
467
467
  static get classIdentifier() {
468
- return Lt;
468
+ return Tt;
469
469
  }
470
470
  execute(i, t, e, s) {
471
471
  return u(this, null, function* () {
@@ -473,7 +473,7 @@ class O extends d {
473
473
  });
474
474
  }
475
475
  }
476
- const Tt = Symbol("ListItemRemovedAction");
476
+ const Ft = Symbol("ListItemRemovedAction");
477
477
  class z extends d {
478
478
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
479
479
  constructor(i) {
@@ -481,7 +481,7 @@ class z extends d {
481
481
  }
482
482
  // eslint-disable-next-line class-methods-use-this
483
483
  static get classIdentifier() {
484
- return Tt;
484
+ return Ft;
485
485
  }
486
486
  execute(i, t, e, s) {
487
487
  return u(this, null, function* () {
@@ -591,7 +591,7 @@ class C extends p {
591
591
  }));
592
592
  }
593
593
  }
594
- const Ft = C.create({ value: "EmptyField" }).registerAction(new g(
594
+ const wt = 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
  })
@@ -785,15 +785,15 @@ class W extends p {
785
785
  }
786
786
  }
787
787
  const ot = { useMarkdownInValidators: !0 };
788
- function wt() {
788
+ function Ot() {
789
789
  return ot;
790
790
  }
791
- function Ot(n) {
791
+ function Pt(n) {
792
792
  Object.assign(ot, n);
793
793
  }
794
- const Kt = {
794
+ const Yt = {
795
795
  install(n, i) {
796
- i && Ot(i);
796
+ i && Pt(i);
797
797
  }
798
798
  };
799
799
  class J extends String {
@@ -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 Rt extends Y {
820
820
  constructor(t) {
821
821
  super();
822
822
  h(this, "text");
@@ -835,7 +835,7 @@ class y extends Y {
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 = vt(t) ? t : mt(t), this.textType = lt(() => this.getTextType);
839
839
  }
840
840
  get getTextType() {
841
841
  const t = this.text.value;
@@ -875,10 +875,10 @@ class y extends Y {
875
875
  }
876
876
  }
877
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, `
878
+ return Ot().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, `
879
879
  `);
880
880
  }
881
- const Rt = Symbol("Validator");
881
+ const Ut = Symbol("Validator");
882
882
  class v extends g {
883
883
  /**
884
884
  * Creates a new validator
@@ -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 Ut;
908
908
  }
909
909
  // eslint-disable-next-line class-methods-use-this
910
910
  get eager() {
@@ -919,7 +919,7 @@ class v extends g {
919
919
  }), s;
920
920
  }
921
921
  }
922
- class Ut extends v {
922
+ class Dt extends v {
923
923
  constructor(i, t) {
924
924
  const e = t || m("Must be one of [**{allowedAsText}**]");
925
925
  let s = i.join(", ");
@@ -936,18 +936,18 @@ class Ut extends v {
936
936
  super(r);
937
937
  }
938
938
  }
939
- function Dt(n) {
939
+ function Bt(n) {
940
940
  return n == null ? 0 : rt(n) || _(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 $t extends v {
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 || m("Please enter a value"), e = (s, r, a) => Bt(S(s)) === 0 ? [new y(
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 kt extends v {
951
951
  constructor(i, t) {
952
952
  const e = t || m("Value must be larger or equal to **{minValue}**"), s = (r, a, l) => r < i ? [
953
953
  new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minValue: i }))
@@ -955,7 +955,7 @@ class $t extends v {
955
955
  super(s);
956
956
  }
957
957
  }
958
- class kt extends v {
958
+ class qt extends v {
959
959
  constructor(i, t) {
960
960
  const e = t || m("Value must be less than or equal to **{maxValue}**"), s = (r, a, l) => r > i ? [
961
961
  new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxValue: i }))
@@ -963,7 +963,7 @@ class kt extends v {
963
963
  super(s);
964
964
  }
965
965
  }
966
- class qt extends v {
966
+ class Mt extends v {
967
967
  constructor(i, t, e) {
968
968
  const s = e || m("Value must be between **{minValue}** and **{maxValue}**"), r = (a, l, c) => a < i || a > t ? [
969
969
  new y(
@@ -976,7 +976,7 @@ class qt extends v {
976
976
  function Z(n) {
977
977
  return n == null ? 0 : rt(n) || _(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 v {
980
980
  constructor(i, t) {
981
981
  const e = t || m("Length must be larger or equal to **{minLength}**"), s = (r, a, l) => Z(r) < i ? [
982
982
  new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, minLength: i }))
@@ -984,7 +984,7 @@ class Mt extends v {
984
984
  super(s);
985
985
  }
986
986
  }
987
- class Qt extends v {
987
+ class zt extends v {
988
988
  constructor(i, t) {
989
989
  const e = t || m("Length must be less than or equal to **{maxLength}**"), s = (r, a, l) => Z(r) > i ? [
990
990
  new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, maxLength: i }))
@@ -992,7 +992,7 @@ class Qt extends v {
992
992
  super(s);
993
993
  }
994
994
  }
995
- class zt extends v {
995
+ class Ht extends v {
996
996
  constructor(i, t, e) {
997
997
  const s = e || m("Length must be between **{minLength}** and **{maxLength}**"), r = (a, l, c) => {
998
998
  const o = Z(a);
@@ -1005,7 +1005,7 @@ class zt extends v {
1005
1005
  super(r);
1006
1006
  }
1007
1007
  }
1008
- class Ht extends v {
1008
+ class Xt extends v {
1009
1009
  constructor(i, t) {
1010
1010
  const e = t || m('Value must match pattern "**{pattern}**"'), s = (r, a, l) => i.test(String(S(r))) ? null : [
1011
1011
  new y(this.replacePlaceholders(e, { newValue: r, oldValue: a, field: l, pattern: i }))
@@ -1013,28 +1013,28 @@ class Ht extends v {
1013
1013
  super(s);
1014
1014
  }
1015
1015
  }
1016
- const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1016
+ const Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1017
1017
  __proto__: null,
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({
1018
+ InAllowedValues: Dt,
1019
+ LengthInRange: Ht,
1020
+ MaxLength: zt,
1021
+ MaxValue: qt,
1022
+ MinLength: Qt,
1023
+ MinValue: kt,
1024
+ Pattern: Xt,
1025
+ Required: $t,
1026
+ ValueInRange: Mt
1027
+ }, Symbol.toStringTag, { value: "Module" })), Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1028
1028
  __proto__: null,
1029
1029
  AbortEventHandlingException: G,
1030
1030
  Action: D,
1031
1031
  ActionsMap: ut,
1032
- ConditionalEnabledAction: Et,
1032
+ ConditionalEnabledAction: It,
1033
1033
  ConditionalStatementAction: $,
1034
- ConditionalValueAction: It,
1035
- ConditionalVisibilityAction: xt,
1034
+ ConditionalValueAction: _t,
1035
+ ConditionalVisibilityAction: Et,
1036
1036
  DisplayMode: x,
1037
- EmptyField: Ft,
1037
+ EmptyField: wt,
1038
1038
  EnabledChangedAction: F,
1039
1039
  EnabledChangingAction: k,
1040
1040
  ExecuteAction: Q,
@@ -1051,9 +1051,9 @@ const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1051
1051
  ValidChangedAction: q,
1052
1052
  ValidationError: Y,
1053
1053
  ValidationErrorRenderContent: y,
1054
- ValidationErrorText: Pt,
1054
+ ValidationErrorText: Rt,
1055
1055
  Validator: v,
1056
- Validators: Xt,
1056
+ Validators: Gt,
1057
1057
  ValueChangedAction: g,
1058
1058
  VisibilityChangedAction: w,
1059
1059
  VisibilityChangingAction: M,
@@ -1064,12 +1064,12 @@ export {
1064
1064
  G as AbortEventHandlingException,
1065
1065
  D as Action,
1066
1066
  ut as ActionsMap,
1067
- Et as ConditionalEnabledAction,
1067
+ It as ConditionalEnabledAction,
1068
1068
  $ as ConditionalStatementAction,
1069
- It as ConditionalValueAction,
1070
- xt as ConditionalVisibilityAction,
1069
+ _t as ConditionalValueAction,
1070
+ Et as ConditionalVisibilityAction,
1071
1071
  x as DisplayMode,
1072
- Ft as EmptyField,
1072
+ wt as EmptyField,
1073
1073
  F as EnabledChangedAction,
1074
1074
  k as EnabledChangingAction,
1075
1075
  Q as ExecuteAction,
@@ -1086,15 +1086,15 @@ export {
1086
1086
  q as ValidChangedAction,
1087
1087
  Y as ValidationError,
1088
1088
  y as ValidationErrorRenderContent,
1089
- Pt as ValidationErrorText,
1089
+ Rt as ValidationErrorText,
1090
1090
  v as Validator,
1091
- Xt as Validators,
1091
+ Gt as Validators,
1092
1092
  g as ValueChangedAction,
1093
1093
  w as VisibilityChangedAction,
1094
1094
  M as VisibilityChangingAction,
1095
1095
  m as buildErrorMessage,
1096
- Yt as default,
1097
- Kt as forms,
1096
+ Zt as default,
1097
+ Yt as forms,
1098
1098
  K as isCustomModalContentComponentDef
1099
1099
  };
1100
1100
  //# sourceMappingURL=dynamicforms-vue-forms.js.map