@dynamicforms/vue-forms 3.0.0-alpha.2 → 3.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamicforms-vue-forms.js +259 -252
- package/dist/dynamicforms-vue-forms.js.map +1 -1
- package/dist/index.d.ts +21 -7
- package/package.json +3 -3
- package/readme.md +12 -9
|
@@ -376,36 +376,36 @@ function st() {
|
|
|
376
376
|
cachedItemsVersion: -1
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
var ct = Symbol("Action.executeHandlers"), lt = Symbol("List.reorderRows"), ut = Symbol("FieldBase.beginValidating"),
|
|
379
|
+
var ct = Symbol("Action.executeHandlers"), lt = Symbol("List.reorderRows"), ut = Symbol("FieldBase.beginValidating"), O = Symbol("FieldBase.errorPoliciesChanged"), dt = Symbol("FieldBase.removeErrorsOnSubmit"), k = Object.freeze([
|
|
380
380
|
"change",
|
|
381
381
|
"edit",
|
|
382
382
|
"submit",
|
|
383
383
|
"never"
|
|
384
|
-
]),
|
|
384
|
+
]), ft = Symbol("ErrorPolicy"), pt = Object.freeze({
|
|
385
385
|
validEffect: !0,
|
|
386
386
|
removeOn: "never"
|
|
387
|
-
}),
|
|
387
|
+
}), A = Object.freeze({ server: Object.freeze({
|
|
388
388
|
validEffect: !0,
|
|
389
389
|
removeOn: "edit"
|
|
390
|
-
}) }),
|
|
391
|
-
function
|
|
392
|
-
return
|
|
390
|
+
}) }), j = f(0), mt = 0;
|
|
391
|
+
function ht() {
|
|
392
|
+
return mt > 0;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
394
|
+
function gt() {
|
|
395
|
+
j.value;
|
|
396
396
|
}
|
|
397
|
-
var
|
|
398
|
-
function
|
|
399
|
-
if (typeof e != "object" || !e) throw TypeError(`${
|
|
397
|
+
var M = (e) => typeof e == "string" ? `'${e}'` : String(e);
|
|
398
|
+
function _t(e) {
|
|
399
|
+
if (typeof e != "object" || !e) throw TypeError(`${M(e)} is not an object of rules keyed by origin`);
|
|
400
400
|
Object.entries(e).forEach(([e, t]) => {
|
|
401
401
|
if (e === "validator") throw TypeError("'validator' has no rule: a validator replaces its own errors and they always count");
|
|
402
|
-
if (typeof t != "object" || !t) throw TypeError(`The rule for ${
|
|
403
|
-
if (typeof t.validEffect != "boolean") throw TypeError(`validEffect for ${
|
|
404
|
-
if (!
|
|
405
|
-
if (t.validEffect && t.removeOn === "submit") throw TypeError(`The rule for ${
|
|
402
|
+
if (typeof t != "object" || !t) throw TypeError(`The rule for ${M(e)} is not an object of validEffect and removeOn`);
|
|
403
|
+
if (typeof t.validEffect != "boolean") throw TypeError(`validEffect for ${M(e)} is ${M(t.validEffect)}, not a boolean`);
|
|
404
|
+
if (!k.includes(t.removeOn)) throw TypeError(`removeOn for ${M(e)} is ${M(t.removeOn)}, not one of ` + k.map(M).join(", "));
|
|
405
|
+
if (t.validEffect && t.removeOn === "submit") throw TypeError(`The rule for ${M(e)} combines validEffect: true with removeOn: 'submit': an error that makes the target invalid refuses the submit that would remove it`);
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function vt(e) {
|
|
409
409
|
let t = Object.create(null);
|
|
410
410
|
return Object.entries(e).forEach(([e, n]) => {
|
|
411
411
|
t[e] = Object.freeze({
|
|
@@ -414,62 +414,68 @@ function yt(e) {
|
|
|
414
414
|
});
|
|
415
415
|
}), Object.freeze(t);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
419
|
-
let t =
|
|
420
|
-
return
|
|
421
|
-
...
|
|
422
|
-
...
|
|
423
|
-
}),
|
|
424
|
-
|
|
417
|
+
function yt(e) {
|
|
418
|
+
_t(e);
|
|
419
|
+
let t = A;
|
|
420
|
+
return A = Object.freeze({
|
|
421
|
+
...A,
|
|
422
|
+
...vt(e)
|
|
423
|
+
}), j.value++, () => {
|
|
424
|
+
A = t, j.value++;
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
return
|
|
427
|
+
function bt(e) {
|
|
428
|
+
return A[e] ?? pt;
|
|
429
429
|
}
|
|
430
|
-
var
|
|
430
|
+
var N = class extends T {
|
|
431
431
|
policies;
|
|
432
432
|
constructor(e) {
|
|
433
|
-
|
|
433
|
+
_t(e), super((e, t, ...n) => t(e, ...n)), this.policies = vt(e);
|
|
434
434
|
}
|
|
435
435
|
static get classIdentifier() {
|
|
436
|
-
return
|
|
436
|
+
return ft;
|
|
437
437
|
}
|
|
438
438
|
boundToBinding(e) {
|
|
439
|
-
|
|
439
|
+
mt++, this.rulesChanged(e);
|
|
440
440
|
}
|
|
441
441
|
unregisterFrom(e) {
|
|
442
|
-
|
|
442
|
+
mt--, this.rulesChanged(e);
|
|
443
443
|
}
|
|
444
444
|
rulesChanged(e) {
|
|
445
|
-
|
|
445
|
+
j.value++, w(() => e[O]());
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
function
|
|
448
|
+
function xt(e, t) {
|
|
449
449
|
return e.policies[t];
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
if (!(e instanceof
|
|
451
|
+
function St(e, t) {
|
|
452
|
+
if (!(e instanceof N)) return;
|
|
453
453
|
let n = Object.keys(e.policies);
|
|
454
454
|
t.forEach((t) => {
|
|
455
|
-
if (t === e || !(t instanceof
|
|
456
|
-
let r = n.find((e) =>
|
|
457
|
-
if (r !== void 0) throw TypeError(`An ErrorPolicy for ${
|
|
455
|
+
if (t === e || !(t instanceof N)) return;
|
|
456
|
+
let r = n.find((e) => xt(t, e) !== void 0);
|
|
457
|
+
if (r !== void 0) throw TypeError(`An ErrorPolicy for ${M(r)} is already registered on this element`);
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region src/actions/value-changed-action.ts
|
|
462
|
-
var
|
|
462
|
+
var Ct = Symbol("ValueChangedAction"), P = class extends T {
|
|
463
463
|
constructor(e) {
|
|
464
464
|
super(e);
|
|
465
465
|
}
|
|
466
466
|
static get classIdentifier() {
|
|
467
|
-
return
|
|
467
|
+
return Ct;
|
|
468
468
|
}
|
|
469
469
|
execute(e, t, n, r) {
|
|
470
470
|
return super.execute(e, t, n, r);
|
|
471
471
|
}
|
|
472
|
-
},
|
|
472
|
+
}, wt = "vue-forms";
|
|
473
|
+
function F(e) {
|
|
474
|
+
return `${wt}.${e}`;
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/validators/validation-error.ts
|
|
478
|
+
var Tt = class {
|
|
473
479
|
code;
|
|
474
480
|
params;
|
|
475
481
|
detail;
|
|
@@ -487,7 +493,7 @@ var wt = Symbol("ValueChangedAction"), N = class extends T {
|
|
|
487
493
|
function Dt(e, t) {
|
|
488
494
|
return e.replace(/\{(\w+)\}/g, (e, n) => Object.hasOwn(t, n) ? String(t[n]) : e);
|
|
489
495
|
}
|
|
490
|
-
var
|
|
496
|
+
var I = class extends P {
|
|
491
497
|
source;
|
|
492
498
|
constructor(e) {
|
|
493
499
|
super((t, n, r, i) => {
|
|
@@ -512,7 +518,7 @@ var P = class extends N {
|
|
|
512
518
|
p.then((e) => {
|
|
513
519
|
u() && m(e);
|
|
514
520
|
}, (e) => {
|
|
515
|
-
u() && (m([new Tt("validation_failed", {}, "Validation could not be completed")]), console.error("Validation failed", e));
|
|
521
|
+
u() && (m([new Tt(F("validation_failed"), {}, "Validation could not be completed")]), console.error("Validation failed", e));
|
|
516
522
|
}).finally(() => {
|
|
517
523
|
a.abandon === f && (a.abandon = void 0), e();
|
|
518
524
|
}).catch((e) => console.error("Validation failed", e));
|
|
@@ -574,7 +580,7 @@ var P = class extends N {
|
|
|
574
580
|
}
|
|
575
581
|
register(t, n) {
|
|
576
582
|
if (!(t instanceof T)) throw Error("Invalid action type");
|
|
577
|
-
t.classIdentifier,
|
|
583
|
+
t.classIdentifier, St(t, this.actions);
|
|
578
584
|
let r = n ? this.actions.indexOf(n) : -1;
|
|
579
585
|
if (n && (n.classIdentifier !== t.classIdentifier || r < 0)) throw Error("Action to register before is not registered under the same identifier");
|
|
580
586
|
if (r >= 0) {
|
|
@@ -604,11 +610,11 @@ var P = class extends N {
|
|
|
604
610
|
return this.run(e.classIdentifier, !1, t, n);
|
|
605
611
|
}
|
|
606
612
|
triggerEager(e, ...t) {
|
|
607
|
-
let n = this.runEager((e) => !(e instanceof
|
|
608
|
-
this.runEager((e) => e instanceof
|
|
613
|
+
let n = this.runEager((e) => !(e instanceof I), e, t) ? [e.contribution, ...t.slice(1)] : t;
|
|
614
|
+
this.runEager((e) => e instanceof I, e, n);
|
|
609
615
|
}
|
|
610
616
|
triggerEagerRules(e, ...t) {
|
|
611
|
-
this.runEager((e) => !(e instanceof
|
|
617
|
+
this.runEager((e) => !(e instanceof I), e, t);
|
|
612
618
|
}
|
|
613
619
|
runEager(t, n, r) {
|
|
614
620
|
let i = !1, a = this.actions;
|
|
@@ -635,7 +641,7 @@ var P = class extends N {
|
|
|
635
641
|
return this.actions.filter((t) => t.classIdentifier === e);
|
|
636
642
|
}
|
|
637
643
|
get validators() {
|
|
638
|
-
return this.actions.filter((e) => e instanceof
|
|
644
|
+
return this.actions.filter((e) => e instanceof I);
|
|
639
645
|
}
|
|
640
646
|
bindTo(e) {
|
|
641
647
|
this.actions.forEach((t) => t.boundToBinding(e));
|
|
@@ -674,7 +680,7 @@ var P = class extends N {
|
|
|
674
680
|
};
|
|
675
681
|
//#endregion
|
|
676
682
|
//#region src/resolve.ts
|
|
677
|
-
function
|
|
683
|
+
function L(e) {
|
|
678
684
|
let t = e;
|
|
679
685
|
for (; t.fieldName !== void 0 && t.parent;) t = t.parent;
|
|
680
686
|
return t;
|
|
@@ -694,11 +700,11 @@ function jt(e, t) {
|
|
|
694
700
|
if (n) return n;
|
|
695
701
|
let r = t.parent;
|
|
696
702
|
for (; r;) {
|
|
697
|
-
let t = kt(
|
|
703
|
+
let t = kt(L(r), e);
|
|
698
704
|
if (t) return t;
|
|
699
705
|
r = r.parent;
|
|
700
706
|
}
|
|
701
|
-
return
|
|
707
|
+
return L(e) === L(t.declaration) ? void 0 : e;
|
|
702
708
|
}
|
|
703
709
|
function Mt(e, t) {
|
|
704
710
|
let n = jt(e, t);
|
|
@@ -739,13 +745,13 @@ var Pt = class {
|
|
|
739
745
|
n ? e.push(n) : this.refs.delete(t);
|
|
740
746
|
}), e;
|
|
741
747
|
}
|
|
742
|
-
}, Ft = Symbol("ConditionalStatementAction"),
|
|
748
|
+
}, Ft = Symbol("ConditionalStatementAction"), R = class extends P {
|
|
743
749
|
statement;
|
|
744
750
|
conditionalExecutor;
|
|
745
751
|
declarations = new Pt();
|
|
746
752
|
registrations = /* @__PURE__ */ new WeakSet();
|
|
747
753
|
constructor(e, t) {
|
|
748
|
-
super((e, t, n, r) => (this.applyIn(
|
|
754
|
+
super((e, t, n, r) => (this.applyIn(L(e)) || e.markRecordIncomplete(), t(e, n, r))), this.statement = e, this.conditionalExecutor = t, this.relay = new P((e, t, ...n) => (this.applyFrom(e), t(e, ...n))), this.relay[$e] = !0, this.relay[et] = () => {
|
|
749
755
|
this.bound && this.declarations.alive.length === 0 && this.stopListening();
|
|
750
756
|
}, this.listen();
|
|
751
757
|
}
|
|
@@ -794,29 +800,29 @@ var Pt = class {
|
|
|
794
800
|
}
|
|
795
801
|
applyFrom(e) {
|
|
796
802
|
let t = /* @__PURE__ */ new Set();
|
|
797
|
-
this.targetsIn(
|
|
803
|
+
this.targetsIn(L(e)).forEach((e) => t.add(L(e))), t.forEach((e) => this.applyIn(e));
|
|
798
804
|
}
|
|
799
|
-
}, It = class extends
|
|
805
|
+
}, It = class extends R {
|
|
800
806
|
constructor(e, t = "full", n = "suppress") {
|
|
801
807
|
super(e, (e, r) => {
|
|
802
808
|
e.visibility = r ? t : n;
|
|
803
809
|
});
|
|
804
810
|
}
|
|
805
|
-
}, Lt = class extends
|
|
811
|
+
}, Lt = class extends R {
|
|
806
812
|
constructor(e, t = "editable", n = "disabled") {
|
|
807
813
|
super(e, (e, r) => {
|
|
808
814
|
e.access = r ? t : n;
|
|
809
815
|
});
|
|
810
816
|
}
|
|
811
|
-
}, Rt = class extends
|
|
817
|
+
}, Rt = class extends R {
|
|
812
818
|
constructor(e, t) {
|
|
813
819
|
super(e, (e, n) => {
|
|
814
820
|
n && (e.value = t);
|
|
815
821
|
});
|
|
816
822
|
}
|
|
817
|
-
},
|
|
823
|
+
}, z = /* @__PURE__ */ function(e) {
|
|
818
824
|
return e[e.NOT = 0] = "NOT", e[e.OR = 1] = "OR", e[e.AND = 2] = "AND", e[e.XOR = 3] = "XOR", e[e.NAND = 4] = "NAND", e[e.NOR = 5] = "NOR", e[e.EQUALS = -1] = "EQUALS", e[e.NOT_EQUALS = -2] = "NOT_EQUALS", e[e.GT = -3] = "GT", e[e.LT = -4] = "LT", e[e.GE = -5] = "GE", e[e.LE = -6] = "LE", e[e.IN = -7] = "IN", e[e.NOT_IN = -8] = "NOT_IN", e[e.INCLUDES = -9] = "INCLUDES", e[e.NOT_INCLUDES = -10] = "NOT_INCLUDES", e;
|
|
819
|
-
}(
|
|
825
|
+
}(z || {});
|
|
820
826
|
(function(e) {
|
|
821
827
|
function t(e) {
|
|
822
828
|
let t = e.toLowerCase();
|
|
@@ -852,15 +858,15 @@ var Pt = class {
|
|
|
852
858
|
}
|
|
853
859
|
e.fromString = t;
|
|
854
860
|
function n(e) {
|
|
855
|
-
let t = typeof e == "number" ? e :
|
|
856
|
-
if (Object.values(
|
|
861
|
+
let t = typeof e == "number" ? e : z.fromString(e);
|
|
862
|
+
if (Object.values(z).includes(t)) return t;
|
|
857
863
|
throw Error(`Unrecognised operator ${e}`);
|
|
858
864
|
}
|
|
859
865
|
e.fromAny = n;
|
|
860
866
|
function r(e) {
|
|
861
|
-
if (typeof e == "number") return Object.values(
|
|
867
|
+
if (typeof e == "number") return Object.values(z).includes(e);
|
|
862
868
|
try {
|
|
863
|
-
return Object.values(
|
|
869
|
+
return Object.values(z).includes(z.fromString(e));
|
|
864
870
|
} catch {
|
|
865
871
|
return !1;
|
|
866
872
|
}
|
|
@@ -870,8 +876,8 @@ var Pt = class {
|
|
|
870
876
|
return e >= 0;
|
|
871
877
|
}
|
|
872
878
|
e.isLogicOperator = i;
|
|
873
|
-
})(
|
|
874
|
-
var
|
|
879
|
+
})(z ||= {}), Object.freeze(z);
|
|
880
|
+
var B = z, zt = Symbol("AccessChangingAction"), Bt = class extends T {
|
|
875
881
|
constructor(e) {
|
|
876
882
|
super(e);
|
|
877
883
|
}
|
|
@@ -968,11 +974,11 @@ function sn(e, t) {
|
|
|
968
974
|
}
|
|
969
975
|
return !1;
|
|
970
976
|
}
|
|
971
|
-
var
|
|
972
|
-
function
|
|
973
|
-
if (Object.hasOwn(e, "enabled")) throw TypeError(`enabled is read from access and cannot be assigned; state access instead: ${
|
|
977
|
+
var cn = (e) => typeof e == "string" ? `'${e}'` : String(e), ln = (e) => e.map(cn).join(", "), V = (e) => e.origin !== "validator", un = (e) => e === "disabled" ? "omit" : e === "disabled-null" ? "null" : "value";
|
|
978
|
+
function dn(e) {
|
|
979
|
+
if (Object.hasOwn(e, "enabled")) throw TypeError(`enabled is read from access and cannot be assigned; state access instead: ${ln(_)}`);
|
|
974
980
|
}
|
|
975
|
-
var
|
|
981
|
+
var fn = 0, H = null, U = class {
|
|
976
982
|
get __v_skip() {
|
|
977
983
|
return !0;
|
|
978
984
|
}
|
|
@@ -1028,7 +1034,7 @@ var un = 0, H = null, U = class {
|
|
|
1028
1034
|
}), t;
|
|
1029
1035
|
}
|
|
1030
1036
|
assignParams(e) {
|
|
1031
|
-
|
|
1037
|
+
dn(e);
|
|
1032
1038
|
let t = this.extendedOf(e);
|
|
1033
1039
|
Object.entries(e).forEach(([e, n]) => {
|
|
1034
1040
|
Object.hasOwn(t, e) || on.has(e) || (this[e] = n);
|
|
@@ -1080,19 +1086,19 @@ var un = 0, H = null, U = class {
|
|
|
1080
1086
|
}
|
|
1081
1087
|
noteErrorsBaseline() {
|
|
1082
1088
|
let e = this.#t;
|
|
1083
|
-
e.errorsBaseline !== D || !e.errors.some(
|
|
1089
|
+
e.errorsBaseline !== D || !e.errors.some(V) || (e.errorsBaseline = p(this.value));
|
|
1084
1090
|
}
|
|
1085
1091
|
ruleOf(e) {
|
|
1086
1092
|
for (let t of this.selfAndAbove()) {
|
|
1087
1093
|
let n = t.boundActions;
|
|
1088
|
-
if (!n?.willTrigger(
|
|
1089
|
-
let r = n.ofClass(
|
|
1094
|
+
if (!n?.willTrigger(N.classIdentifier)) continue;
|
|
1095
|
+
let r = n.ofClass(N.classIdentifier);
|
|
1090
1096
|
for (let t = r.length - 1; t >= 0; t--) {
|
|
1091
|
-
let n =
|
|
1097
|
+
let n = xt(r[t], e);
|
|
1092
1098
|
if (n) return n;
|
|
1093
1099
|
}
|
|
1094
1100
|
}
|
|
1095
|
-
return
|
|
1101
|
+
return bt(e);
|
|
1096
1102
|
}
|
|
1097
1103
|
selfAndAbove() {
|
|
1098
1104
|
let e = [this];
|
|
@@ -1100,15 +1106,15 @@ var un = 0, H = null, U = class {
|
|
|
1100
1106
|
return e;
|
|
1101
1107
|
}
|
|
1102
1108
|
ownErrorsValid(e) {
|
|
1103
|
-
return e.length === 0 || !e.some((e) => !
|
|
1109
|
+
return e.length === 0 || !e.some((e) => !V(e) || (gt(), this.ruleOf(e.origin).validEffect));
|
|
1104
1110
|
}
|
|
1105
1111
|
removeErrors(e) {
|
|
1106
1112
|
let t = this.#e.errors, n = !1;
|
|
1107
|
-
for (let r = t.length - 1; r >= 0; r--)
|
|
1108
|
-
return this.#t.errors.some(
|
|
1113
|
+
for (let r = t.length - 1; r >= 0; r--) V(t[r]) && e(this.ruleOf(t[r].origin)) && (t.splice(r, 1), n = !0);
|
|
1114
|
+
return this.#t.errors.some(V) || (this.#t.errorsBaseline = D), n;
|
|
1109
1115
|
}
|
|
1110
1116
|
editConcluded() {
|
|
1111
|
-
let e = this.selfAndAbove().filter((e) => e.#t.errors.some((t) =>
|
|
1117
|
+
let e = this.selfAndAbove().filter((e) => e.#t.errors.some((t) => V(t) && e.ruleOf(t.origin).removeOn === "edit"));
|
|
1112
1118
|
e.length !== 0 && w((t) => {
|
|
1113
1119
|
for (let n of e) {
|
|
1114
1120
|
let e = n.#t, r = e.errorsBaseline;
|
|
@@ -1120,18 +1126,18 @@ var un = 0, H = null, U = class {
|
|
|
1120
1126
|
}
|
|
1121
1127
|
});
|
|
1122
1128
|
}
|
|
1123
|
-
[
|
|
1129
|
+
[dt]() {
|
|
1124
1130
|
w((e) => {
|
|
1125
1131
|
let t = (n) => {
|
|
1126
|
-
n.#t.errors.some(
|
|
1132
|
+
n.#t.errors.some(V) && (e.touch(n), n.removeErrors((e) => e.removeOn === "submit") && e.markValidityDirty(n)), n.members.forEach(t);
|
|
1127
1133
|
};
|
|
1128
1134
|
t(this);
|
|
1129
1135
|
});
|
|
1130
1136
|
}
|
|
1131
|
-
[
|
|
1137
|
+
[O]() {
|
|
1132
1138
|
w((e) => {
|
|
1133
1139
|
let t = (n) => {
|
|
1134
|
-
n.#t.errors.some(
|
|
1140
|
+
n.#t.errors.some(V) && e.markValidityDirty(n), n.members.forEach(t);
|
|
1135
1141
|
};
|
|
1136
1142
|
t(this);
|
|
1137
1143
|
});
|
|
@@ -1158,12 +1164,12 @@ var un = 0, H = null, U = class {
|
|
|
1158
1164
|
return r(this), n;
|
|
1159
1165
|
}
|
|
1160
1166
|
markRecordIncomplete() {
|
|
1161
|
-
this._recordPending || (this._recordPending = !0,
|
|
1167
|
+
this._recordPending || (this._recordPending = !0, fn++);
|
|
1162
1168
|
}
|
|
1163
1169
|
completeRecords(e = this) {
|
|
1164
|
-
|
|
1170
|
+
fn !== 0 && w(() => {
|
|
1165
1171
|
let t = (e) => {
|
|
1166
|
-
e._recordPending && (e._recordPending = !1,
|
|
1172
|
+
e._recordPending && (e._recordPending = !1, fn--, e.rerunEagerActions()), e.members.forEach(t);
|
|
1167
1173
|
};
|
|
1168
1174
|
t(e);
|
|
1169
1175
|
});
|
|
@@ -1214,7 +1220,7 @@ var un = 0, H = null, U = class {
|
|
|
1214
1220
|
}
|
|
1215
1221
|
errorsAfterChange(e) {
|
|
1216
1222
|
let t = this.#t;
|
|
1217
|
-
t.errors.some(
|
|
1223
|
+
t.errors.some(V) && (e.touch(this), this.removeErrors((e) => e.removeOn === "change"), t.errorsBaseline === D && t.errors.some(V) && (t.errorsBaseline = tt));
|
|
1218
1224
|
}
|
|
1219
1225
|
constructed(e) {}
|
|
1220
1226
|
refreshPreviousValue() {
|
|
@@ -1230,7 +1236,7 @@ var un = 0, H = null, U = class {
|
|
|
1230
1236
|
for (let t = this.parent; t; t = t.parent) if (t === e) throw TypeError("A container cannot hold itself or a container above it");
|
|
1231
1237
|
n.touch(e), e.#e.fieldName = t;
|
|
1232
1238
|
let r = this.effectiveAccess === "editable" ? void 0 : e.effectiveAccessFromHere();
|
|
1233
|
-
e.#e.parent = this, r && e.revalidateWhereChanged(r),
|
|
1239
|
+
e.#e.parent = this, r && e.revalidateWhereChanged(r), ht() && e[O](), this.adoptChild(e), Be(n, e);
|
|
1234
1240
|
});
|
|
1235
1241
|
}
|
|
1236
1242
|
adoptChild(e) {
|
|
@@ -1246,7 +1252,7 @@ var un = 0, H = null, U = class {
|
|
|
1246
1252
|
let n = this.effectiveAccess === "editable" ? void 0 : e.effectiveAccessFromHere();
|
|
1247
1253
|
e.validating && this.childValidatingChanged(!1), t.whenRolledBack(() => {
|
|
1248
1254
|
e.validating && this.childValidatingChanged(!0);
|
|
1249
|
-
}), e.#e.parent = void 0, e.#e.fieldName = void 0, n && e.revalidateWhereChanged(n),
|
|
1255
|
+
}), e.#e.parent = void 0, e.#e.fieldName = void 0, n && e.revalidateWhereChanged(n), ht() && e[O](), t.markValidityDirty(this);
|
|
1250
1256
|
});
|
|
1251
1257
|
}
|
|
1252
1258
|
resetTo(e, t) {
|
|
@@ -1292,7 +1298,7 @@ var un = 0, H = null, U = class {
|
|
|
1292
1298
|
let r = this.boundActions?.trigger(Qt, this, e, t);
|
|
1293
1299
|
if (r instanceof E) return;
|
|
1294
1300
|
let i = r ?? e;
|
|
1295
|
-
if (!pe(i)) throw Error(`${
|
|
1301
|
+
if (!pe(i)) throw Error(`${cn(i)} is not a visibility: ${ln(de)}`);
|
|
1296
1302
|
i !== t && (n.touch(this), this.#t.announcedVisibility === void 0 && (this.#t.announcedVisibility = t), this.#e.visibility = i, n.markFlagsDirty(this));
|
|
1297
1303
|
});
|
|
1298
1304
|
}
|
|
@@ -1305,18 +1311,18 @@ var un = 0, H = null, U = class {
|
|
|
1305
1311
|
let r = this.boundActions?.trigger(Bt, this, e, t);
|
|
1306
1312
|
if (r instanceof E) return;
|
|
1307
1313
|
let i = r ?? e;
|
|
1308
|
-
if (!ue(i)) throw Error(`${
|
|
1314
|
+
if (!ue(i)) throw Error(`${cn(i)} is not an access: ${ln(_)}`);
|
|
1309
1315
|
if (i === t) return;
|
|
1310
1316
|
let a = this.enabled, o = i === "editable";
|
|
1311
1317
|
if (o !== a) {
|
|
1312
1318
|
let e = this.boundActions?.trigger(Kt, this, o, a);
|
|
1313
1319
|
if (e instanceof E) return;
|
|
1314
|
-
if (e != null && typeof e != "boolean") throw Error(`${
|
|
1320
|
+
if (e != null && typeof e != "boolean") throw Error(`${cn(e)} is not what an EnabledChangingAction answers with: a boolean`);
|
|
1315
1321
|
if (e === a) return;
|
|
1316
1322
|
}
|
|
1317
1323
|
n.touch(this);
|
|
1318
1324
|
let s = this.contribution, c = this.countsInContainer, l = this.effectiveAccessBelow();
|
|
1319
|
-
this.#e.access = i, this.revalidateWhereChanged(l), !this.composesValue &&
|
|
1325
|
+
this.#e.access = i, this.revalidateWhereChanged(l), !this.composesValue && un(t) !== un(i) && this.boundActions?.triggerEager(this, this.contribution, s), this.contributionChanged(n, c), this.#t.announcedAccess === void 0 && (this.#t.announcedAccess = t), n.markFlagsDirty(this);
|
|
1320
1326
|
});
|
|
1321
1327
|
}
|
|
1322
1328
|
get effectiveAccess() {
|
|
@@ -1348,7 +1354,7 @@ var un = 0, H = null, U = class {
|
|
|
1348
1354
|
}
|
|
1349
1355
|
revalidateWhereChanged(e) {
|
|
1350
1356
|
e.forEach((e, t) => {
|
|
1351
|
-
|
|
1357
|
+
un(t.effectiveAccess) !== un(e) && t.rerunEagerActions();
|
|
1352
1358
|
});
|
|
1353
1359
|
}
|
|
1354
1360
|
serializesAs(e) {
|
|
@@ -1395,9 +1401,9 @@ var un = 0, H = null, U = class {
|
|
|
1395
1401
|
let t = this.contribution, r = this.#t.validatedValue;
|
|
1396
1402
|
(n || !h(t, r)) && (e.touch(this), this.#t.validatedValue = t, i.triggerEager(this, t, r));
|
|
1397
1403
|
}
|
|
1398
|
-
if (!a || i?.willTrigger(
|
|
1404
|
+
if (!a || i?.willTrigger(Ct)) {
|
|
1399
1405
|
let t = this.holding, r = this.#t.announcedValue;
|
|
1400
|
-
(n || !o(t, r)) && (e.touch(this), this.#t.announcedValue = t, i?.trigger(
|
|
1406
|
+
(n || !o(t, r)) && (e.touch(this), this.#t.announcedValue = t, i?.trigger(P, this, t, r));
|
|
1401
1407
|
}
|
|
1402
1408
|
if (i?.willTrigger(Ut)) {
|
|
1403
1409
|
let t = this.contribution, n = this.#t.announcedContribution;
|
|
@@ -1406,7 +1412,7 @@ var un = 0, H = null, U = class {
|
|
|
1406
1412
|
}
|
|
1407
1413
|
recordAnnounced() {
|
|
1408
1414
|
let e = this.boundActions;
|
|
1409
|
-
(!this.composesValue || e?.willTrigger(
|
|
1415
|
+
(!this.composesValue || e?.willTrigger(Ct)) && (this.#t.announcedValue = this.holding), e?.willTrigger(Ut) && (this.#t.announcedContribution = this.contribution), this.composesValue && e?.hasEager && (this.#t.validatedValue = this.contribution), this.#t.errorsBaseline = D;
|
|
1410
1416
|
}
|
|
1411
1417
|
[Ke]() {
|
|
1412
1418
|
let e = this.#t, t = e.announcedAccess;
|
|
@@ -1444,7 +1450,7 @@ var un = 0, H = null, U = class {
|
|
|
1444
1450
|
return !h(this.value, this.originalValue);
|
|
1445
1451
|
}
|
|
1446
1452
|
boundFrom(e, t, n, r) {
|
|
1447
|
-
r &&
|
|
1453
|
+
r && dn(r), this.#t.declaration = e.declaration;
|
|
1448
1454
|
let i = {
|
|
1449
1455
|
...e.extra,
|
|
1450
1456
|
...r && this.extendedOf(r)
|
|
@@ -1518,10 +1524,10 @@ var un = 0, H = null, U = class {
|
|
|
1518
1524
|
};
|
|
1519
1525
|
//#endregion
|
|
1520
1526
|
//#region src/actions/conditional/statement.ts
|
|
1521
|
-
function
|
|
1527
|
+
function pn(e, t) {
|
|
1522
1528
|
return e ? !t : t;
|
|
1523
1529
|
}
|
|
1524
|
-
var
|
|
1530
|
+
var mn = class e {
|
|
1525
1531
|
operand1;
|
|
1526
1532
|
operator;
|
|
1527
1533
|
operand2;
|
|
@@ -1530,7 +1536,7 @@ var fn = class e {
|
|
|
1530
1536
|
if (typeof e == "function") throw TypeError(`Statement operand ${t} is a function: an operand is a field, a nested statement or a literal, and a function is none of them. An accessor states the field it answers with: group.field('name').`);
|
|
1531
1537
|
}
|
|
1532
1538
|
constructor(t, n, r) {
|
|
1533
|
-
e.validateOperand(t, 1), n !==
|
|
1539
|
+
e.validateOperand(t, 1), n !== B.NOT && e.validateOperand(r, 2), this.operand1 = t, this.operator = n, this.operand2 = r;
|
|
1534
1540
|
}
|
|
1535
1541
|
static valueOf(t, n) {
|
|
1536
1542
|
if (t instanceof e) return t.evaluate(n);
|
|
@@ -1549,22 +1555,22 @@ var fn = class e {
|
|
|
1549
1555
|
evaluate(t) {
|
|
1550
1556
|
let n = e.valueOf(this.operand1, t), r = e.valueOf(this.operand2, t);
|
|
1551
1557
|
switch (this.operator) {
|
|
1552
|
-
case
|
|
1553
|
-
case
|
|
1554
|
-
case
|
|
1555
|
-
case
|
|
1556
|
-
case
|
|
1557
|
-
case
|
|
1558
|
-
case
|
|
1559
|
-
case
|
|
1560
|
-
case
|
|
1561
|
-
case
|
|
1562
|
-
case
|
|
1563
|
-
case
|
|
1564
|
-
case
|
|
1565
|
-
case
|
|
1566
|
-
case
|
|
1567
|
-
case
|
|
1558
|
+
case B.AND: return !!(n && r);
|
|
1559
|
+
case B.OR: return !!(n || r);
|
|
1560
|
+
case B.NAND: return !(n && r);
|
|
1561
|
+
case B.NOR: return !(n || r);
|
|
1562
|
+
case B.XOR: return pn(!!n, !!r);
|
|
1563
|
+
case B.NOT: return !n;
|
|
1564
|
+
case B.EQUALS: return n == r;
|
|
1565
|
+
case B.NOT_EQUALS: return n != r;
|
|
1566
|
+
case B.LT: return n < r;
|
|
1567
|
+
case B.LE: return n <= r;
|
|
1568
|
+
case B.GE: return n >= r;
|
|
1569
|
+
case B.GT: return n > r;
|
|
1570
|
+
case B.IN: return !!r?.includes?.(n);
|
|
1571
|
+
case B.NOT_IN: return !r?.includes?.(n);
|
|
1572
|
+
case B.INCLUDES: return g(n) && g(r) && n.indexOf(r) >= 0;
|
|
1573
|
+
case B.NOT_INCLUDES: return !(g(n) && g(r) && n.indexOf(r) >= 0);
|
|
1568
1574
|
default: throw Error(`Operator not implemented ${this.operator}`);
|
|
1569
1575
|
}
|
|
1570
1576
|
}
|
|
@@ -1575,12 +1581,12 @@ var fn = class e {
|
|
|
1575
1581
|
}
|
|
1576
1582
|
return n(this.operand1), n(this.operand2), t;
|
|
1577
1583
|
}
|
|
1578
|
-
},
|
|
1584
|
+
}, hn = Symbol("ExecuteAction"), W = class extends T {
|
|
1579
1585
|
constructor(e) {
|
|
1580
1586
|
super(e);
|
|
1581
1587
|
}
|
|
1582
1588
|
static get classIdentifier() {
|
|
1583
|
-
return
|
|
1589
|
+
return hn;
|
|
1584
1590
|
}
|
|
1585
1591
|
execute(e, t, n) {
|
|
1586
1592
|
return super.execute(e, t, n);
|
|
@@ -1588,40 +1594,40 @@ var fn = class e {
|
|
|
1588
1594
|
canExecute(e) {
|
|
1589
1595
|
return !0;
|
|
1590
1596
|
}
|
|
1591
|
-
},
|
|
1597
|
+
}, gn = class extends W {
|
|
1592
1598
|
targetFor(e) {
|
|
1593
1599
|
let t = this.target;
|
|
1594
1600
|
return typeof t == "function" ? t(e) ?? void 0 : t;
|
|
1595
1601
|
}
|
|
1596
1602
|
};
|
|
1597
|
-
function
|
|
1603
|
+
function _n(e) {
|
|
1598
1604
|
return e.validating ? new Promise((t) => {
|
|
1599
1605
|
let n = ee(() => e.validating, (e) => {
|
|
1600
1606
|
e || (n(), t());
|
|
1601
1607
|
}, { flush: "sync" });
|
|
1602
1608
|
}) : Promise.resolve();
|
|
1603
1609
|
}
|
|
1604
|
-
var
|
|
1610
|
+
var vn = class extends E {}, yn = class extends vn {
|
|
1605
1611
|
constructor(e) {
|
|
1606
1612
|
super("the submit handler failed", { cause: e });
|
|
1607
1613
|
}
|
|
1608
|
-
},
|
|
1614
|
+
}, bn = class extends vn {
|
|
1609
1615
|
reason;
|
|
1610
1616
|
constructor(e) {
|
|
1611
1617
|
super(e === "invalid" ? "the submitted element is invalid" : "a submit of this action is already running"), this.reason = e;
|
|
1612
1618
|
}
|
|
1613
|
-
},
|
|
1619
|
+
}, xn = class extends gn {
|
|
1614
1620
|
target;
|
|
1615
1621
|
constructor(e, t, n = {}) {
|
|
1616
1622
|
super(async (e, r, i) => {
|
|
1617
1623
|
let a = this.state(e, () => ({ running: !1 }));
|
|
1618
|
-
if (a.running) throw new
|
|
1624
|
+
if (a.running) throw new bn("running");
|
|
1619
1625
|
a.running = !0;
|
|
1620
1626
|
try {
|
|
1621
1627
|
let a = this.targetFor(e);
|
|
1622
1628
|
if (!a) throw Error("SubmitAction: the target callback returned no element");
|
|
1623
|
-
if (await
|
|
1624
|
-
a[
|
|
1629
|
+
if (await _n(a), !a.valid) throw new bn("invalid");
|
|
1630
|
+
a[dt]();
|
|
1625
1631
|
let o = a.value, s, c = n.lock !== !1 && a.access === "editable";
|
|
1626
1632
|
c && (a.access = "readonly");
|
|
1627
1633
|
let l = c && a.access === "readonly";
|
|
@@ -1629,7 +1635,7 @@ var gn = class extends E {}, _n = class extends gn {
|
|
|
1629
1635
|
try {
|
|
1630
1636
|
s = await t(o, a);
|
|
1631
1637
|
} catch (e) {
|
|
1632
|
-
throw new
|
|
1638
|
+
throw new yn(e);
|
|
1633
1639
|
}
|
|
1634
1640
|
s !== void 0 && n.rebind !== !1 && a.rebind(s);
|
|
1635
1641
|
} finally {
|
|
@@ -1649,7 +1655,7 @@ var gn = class extends E {}, _n = class extends gn {
|
|
|
1649
1655
|
let t = this.targetFor(e);
|
|
1650
1656
|
return t !== void 0 && t.valid && !t.pending;
|
|
1651
1657
|
}
|
|
1652
|
-
},
|
|
1658
|
+
}, Sn = class extends gn {
|
|
1653
1659
|
target;
|
|
1654
1660
|
constructor(e) {
|
|
1655
1661
|
super((e, t, n) => {
|
|
@@ -1661,22 +1667,22 @@ var gn = class extends E {}, _n = class extends gn {
|
|
|
1661
1667
|
canExecute(e) {
|
|
1662
1668
|
return this.targetFor(e) !== void 0;
|
|
1663
1669
|
}
|
|
1664
|
-
},
|
|
1670
|
+
}, Cn = Symbol("ListItemAddedAction"), G = class extends T {
|
|
1665
1671
|
constructor(e) {
|
|
1666
1672
|
super(e);
|
|
1667
1673
|
}
|
|
1668
1674
|
static get classIdentifier() {
|
|
1669
|
-
return
|
|
1675
|
+
return Cn;
|
|
1670
1676
|
}
|
|
1671
1677
|
execute(e, t, n, r) {
|
|
1672
1678
|
return super.execute(e, t, n, r);
|
|
1673
1679
|
}
|
|
1674
|
-
},
|
|
1680
|
+
}, wn = Symbol("ListItemRemovedAction"), K = class extends T {
|
|
1675
1681
|
constructor(e) {
|
|
1676
1682
|
super(e);
|
|
1677
1683
|
}
|
|
1678
1684
|
static get classIdentifier() {
|
|
1679
|
-
return
|
|
1685
|
+
return wn;
|
|
1680
1686
|
}
|
|
1681
1687
|
execute(e, t, n, r) {
|
|
1682
1688
|
return super.execute(e, t, n, r);
|
|
@@ -1740,11 +1746,11 @@ var gn = class extends E {}, _n = class extends gn {
|
|
|
1740
1746
|
}));
|
|
1741
1747
|
return r.boundFrom(this, r.contribution, r.originalValue, t), r;
|
|
1742
1748
|
}
|
|
1743
|
-
},
|
|
1744
|
-
function
|
|
1749
|
+
}, Tn = /* @__PURE__ */ new WeakMap();
|
|
1750
|
+
function En(e) {
|
|
1745
1751
|
if (e != null) return Object.values(e).some((e) => e != null) ? e : void 0;
|
|
1746
1752
|
}
|
|
1747
|
-
var
|
|
1753
|
+
var Dn = class extends q {
|
|
1748
1754
|
get [Symbol.toStringTag]() {
|
|
1749
1755
|
return "Action";
|
|
1750
1756
|
}
|
|
@@ -1756,7 +1762,7 @@ var Tn = class extends q {
|
|
|
1756
1762
|
}, e) {
|
|
1757
1763
|
let { value: t, originalValue: n, validators: r, actions: i, ...a } = e;
|
|
1758
1764
|
this.registerInitialActions([...r || [], ...i || []]), this.assignParams(a);
|
|
1759
|
-
let o =
|
|
1765
|
+
let o = En(t), s = En(n);
|
|
1760
1766
|
o ? this._value = o : s && (this._value = { ...s }), s && (this.originalValue = Object.freeze({ ...s }));
|
|
1761
1767
|
}
|
|
1762
1768
|
this.constructed(e), this.originalValue === void 0 && (this.originalValue = this._value), this.recordAnnounced(), this.boundActions?.triggerEager(this, this.contribution, this.originalValue), this.validate();
|
|
@@ -1797,8 +1803,8 @@ var Tn = class extends q {
|
|
|
1797
1803
|
return this.boundActions?.ofClass(W.classIdentifier) ?? [];
|
|
1798
1804
|
}
|
|
1799
1805
|
get busyRuns() {
|
|
1800
|
-
let e =
|
|
1801
|
-
return e || (e = d(0),
|
|
1806
|
+
let e = Tn.get(this);
|
|
1807
|
+
return e || (e = d(0), Tn.set(this, e)), e;
|
|
1802
1808
|
}
|
|
1803
1809
|
get busy() {
|
|
1804
1810
|
return this.busyRuns.value > 0;
|
|
@@ -1812,7 +1818,7 @@ var Tn = class extends q {
|
|
|
1812
1818
|
t.value--;
|
|
1813
1819
|
}
|
|
1814
1820
|
}
|
|
1815
|
-
},
|
|
1821
|
+
}, On = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), J = class e extends U {
|
|
1816
1822
|
get [Symbol.toStringTag]() {
|
|
1817
1823
|
return "Container";
|
|
1818
1824
|
}
|
|
@@ -1851,7 +1857,7 @@ var Tn = class extends q {
|
|
|
1851
1857
|
return t.length > 0 && t.every((e) => this.childSerializesAs(e, "fullValue") === "omit") ? "omit" : super.serializesAs(e);
|
|
1852
1858
|
}
|
|
1853
1859
|
command(e) {
|
|
1854
|
-
let t = e === "confirm" ?
|
|
1860
|
+
let t = e === "confirm" ? xn : Sn, n = e === "confirm" ? "defaultConfirm" : "defaultReject", r = this.actionsBelow().filter((e) => e.action.visibility === "full"), i = [
|
|
1855
1861
|
r.filter(({ action: e }) => e[ct]().some((n) => n instanceof t && n.targetFor(e) === this)),
|
|
1856
1862
|
r.filter(({ action: e, depth: t }) => t === 0 && e[n]),
|
|
1857
1863
|
r.filter(({ action: e, depth: t }) => t > 0 && e[n])
|
|
@@ -1867,7 +1873,7 @@ var Tn = class extends q {
|
|
|
1867
1873
|
}
|
|
1868
1874
|
}
|
|
1869
1875
|
actionsBelow(t = 0) {
|
|
1870
|
-
return this.children.flatMap((n) => n instanceof
|
|
1876
|
+
return this.children.flatMap((n) => n instanceof Dn ? [{
|
|
1871
1877
|
action: n,
|
|
1872
1878
|
depth: t
|
|
1873
1879
|
}] : n instanceof e ? n.actionsBelow(t + 1) : []);
|
|
@@ -1882,12 +1888,12 @@ var Tn = class extends q {
|
|
|
1882
1888
|
return this.fullValue;
|
|
1883
1889
|
}
|
|
1884
1890
|
get validRead() {
|
|
1885
|
-
let e =
|
|
1886
|
-
return e || (e = l(() => this.ownErrorsValid(this.state.errors) && this.children.every((e) => e.valid || this.childSerializesAs(e, "value") === "omit")),
|
|
1891
|
+
let e = On.get(this);
|
|
1892
|
+
return e || (e = l(() => this.ownErrorsValid(this.state.errors) && this.children.every((e) => e.valid || this.childSerializesAs(e, "value") === "omit")), On.set(this, e)), e.value;
|
|
1887
1893
|
}
|
|
1888
1894
|
get busyRead() {
|
|
1889
|
-
let e =
|
|
1890
|
-
return e || (e = l(() => this.children.some((e) => e.busy)),
|
|
1895
|
+
let e = kn.get(this);
|
|
1896
|
+
return e || (e = l(() => this.children.some((e) => e.busy)), kn.set(this, e)), e.value;
|
|
1891
1897
|
}
|
|
1892
1898
|
childValidatingChanged(e) {
|
|
1893
1899
|
let t = this.validating;
|
|
@@ -1896,11 +1902,11 @@ var Tn = class extends q {
|
|
|
1896
1902
|
childValidityChanged(e) {
|
|
1897
1903
|
this.raw.invalidChildren += e ? -1 : 1;
|
|
1898
1904
|
}
|
|
1899
|
-
},
|
|
1900
|
-
function
|
|
1905
|
+
}, An = Object.freeze([]);
|
|
1906
|
+
function jn(e, t) {
|
|
1901
1907
|
if (!Number.isInteger(e)) throw RangeError(`List.${t}(): the index must be an integer, got ${e}`);
|
|
1902
1908
|
}
|
|
1903
|
-
var
|
|
1909
|
+
var Mn = class e extends J {
|
|
1904
1910
|
get [Symbol.toStringTag]() {
|
|
1905
1911
|
return "List";
|
|
1906
1912
|
}
|
|
@@ -1991,7 +1997,7 @@ var An = class e extends J {
|
|
|
1991
1997
|
case "null": t.push(null);
|
|
1992
1998
|
}
|
|
1993
1999
|
});
|
|
1994
|
-
let n = t.length ? Object.freeze(t) :
|
|
2000
|
+
let n = t.length ? Object.freeze(t) : An;
|
|
1995
2001
|
return this.raw.cachedValue = n, this.raw.cachedValueVersion = e, n;
|
|
1996
2002
|
}
|
|
1997
2003
|
set value(e) {
|
|
@@ -2046,7 +2052,7 @@ var An = class e extends J {
|
|
|
2046
2052
|
return this.remove((this.raw.rows?.length ?? 0) - 1);
|
|
2047
2053
|
}
|
|
2048
2054
|
remove(e) {
|
|
2049
|
-
|
|
2055
|
+
jn(e, "remove");
|
|
2050
2056
|
let t;
|
|
2051
2057
|
return w((n) => {
|
|
2052
2058
|
let r = this.raw.rows;
|
|
@@ -2061,7 +2067,7 @@ var An = class e extends J {
|
|
|
2061
2067
|
}), t;
|
|
2062
2068
|
}
|
|
2063
2069
|
insert(e, t) {
|
|
2064
|
-
|
|
2070
|
+
jn(t, "insert");
|
|
2065
2071
|
let n = 0;
|
|
2066
2072
|
return w((r) => {
|
|
2067
2073
|
r.touch(this);
|
|
@@ -2105,16 +2111,16 @@ var An = class e extends J {
|
|
|
2105
2111
|
rebind(e) {
|
|
2106
2112
|
return super.rebind(e);
|
|
2107
2113
|
}
|
|
2108
|
-
},
|
|
2109
|
-
function
|
|
2114
|
+
}, Nn = /* @__PURE__ */ new WeakSet();
|
|
2115
|
+
function Pn(e) {
|
|
2110
2116
|
if (e === "$" || e === "then" || e.startsWith("__v_")) throw TypeError(`A view cannot hold a member named ${e}: $ is the element the view stands for, and then and __v_* are read by the language and by Vue`);
|
|
2111
2117
|
}
|
|
2112
2118
|
//#endregion
|
|
2113
2119
|
//#region src/group.ts
|
|
2114
|
-
function
|
|
2115
|
-
return ae(e) ? Y.createFromFormData(e) : Array.isArray(e) ? new
|
|
2120
|
+
function Fn(e) {
|
|
2121
|
+
return ae(e) ? Y.createFromFormData(e) : Array.isArray(e) ? new Mn(void 0, { value: e }) : new q({ value: e });
|
|
2116
2122
|
}
|
|
2117
|
-
var
|
|
2123
|
+
var In = /* @__PURE__ */ new WeakSet(), Ln = Object.freeze({}), Rn = /* @__PURE__ */ new WeakMap(), zn = (e) => ({
|
|
2118
2124
|
get(t, n, r) {
|
|
2119
2125
|
return e(), Reflect.get(t, n, r);
|
|
2120
2126
|
},
|
|
@@ -2151,14 +2157,14 @@ var Pn = /* @__PURE__ */ new WeakSet(), Fn = Object.freeze({}), In = /* @__PURE_
|
|
|
2151
2157
|
if (super(ot()), !e.isValidFields(t)) throw Error("Invalid fields object provided");
|
|
2152
2158
|
this._fields = Object.create(null), w(() => {
|
|
2153
2159
|
let r = !1, i = !1;
|
|
2154
|
-
|
|
2160
|
+
In.add(this);
|
|
2155
2161
|
try {
|
|
2156
2162
|
if (Object.entries(t).forEach(([e, t]) => this.addField(e, t)), n) {
|
|
2157
2163
|
let { value: e, validators: t, actions: a, ...o } = n;
|
|
2158
2164
|
this.registerInitialActions([...t || [], ...a || []]), this.assignParams(o), e === void 0 ? this.originalValue !== void 0 && this.assignMembers(this.originalValue) : this.assignMembers(e), r = e !== void 0 || this.originalValue !== void 0, i = n.originalValue !== void 0 && e !== void 0;
|
|
2159
2165
|
}
|
|
2160
2166
|
} finally {
|
|
2161
|
-
|
|
2167
|
+
In.delete(this);
|
|
2162
2168
|
}
|
|
2163
2169
|
this.completeRecords(), this.constructed(n);
|
|
2164
2170
|
let a = this.value;
|
|
@@ -2182,7 +2188,7 @@ var Pn = /* @__PURE__ */ new WeakSet(), Fn = Object.freeze({}), In = /* @__PURE_
|
|
|
2182
2188
|
addField(t, n) {
|
|
2183
2189
|
return w((r) => {
|
|
2184
2190
|
if (Object.hasOwn(this._fields, t)) throw Error(`Field ${t} is already in this form`);
|
|
2185
|
-
|
|
2191
|
+
Nn.has(this) && Pn(t), this.takeChild(n, t), r.touch(this), e.setEntry(this._fields, t, n), r.whenRolledBack(() => e.dropEntry(this._fields, t)), this.state.fieldNames.push(t), In.has(this) || this.completeRecords(n), this.bumpValueVersion(), this.notifyValueChanged();
|
|
2186
2192
|
}), this;
|
|
2187
2193
|
}
|
|
2188
2194
|
removeField(t) {
|
|
@@ -2212,14 +2218,14 @@ var Pn = /* @__PURE__ */ new WeakSet(), Fn = Object.freeze({}), In = /* @__PURE_
|
|
|
2212
2218
|
}
|
|
2213
2219
|
static createFromFormData(t) {
|
|
2214
2220
|
if (t instanceof U) throw Error("data is already a Form structure, should be a simple object");
|
|
2215
|
-
return new e(t == null ? {} : Object.fromEntries(Object.entries(t).map(([e, t]) => [e,
|
|
2221
|
+
return new e(t == null ? {} : Object.fromEntries(Object.entries(t).map(([e, t]) => [e, Fn(t)])));
|
|
2216
2222
|
}
|
|
2217
2223
|
field(e) {
|
|
2218
2224
|
return this._fields[e] ?? null;
|
|
2219
2225
|
}
|
|
2220
2226
|
get fields() {
|
|
2221
|
-
let e =
|
|
2222
|
-
return e || (e = new Proxy(this._fields,
|
|
2227
|
+
let e = Rn.get(this);
|
|
2228
|
+
return e || (e = new Proxy(this._fields, zn(() => this.state.fieldNames.length)), Rn.set(this, e)), e;
|
|
2223
2229
|
}
|
|
2224
2230
|
get members() {
|
|
2225
2231
|
return this.raw.fieldNames.map((e) => this._fields[e]);
|
|
@@ -2239,7 +2245,7 @@ var Pn = /* @__PURE__ */ new WeakSet(), Fn = Object.freeze({}), In = /* @__PURE_
|
|
|
2239
2245
|
case "null": t[e] = null;
|
|
2240
2246
|
}
|
|
2241
2247
|
});
|
|
2242
|
-
let n = ne(t) ?
|
|
2248
|
+
let n = ne(t) ? Ln : Object.freeze({ ...t });
|
|
2243
2249
|
return this.raw.cachedValue = n, this.raw.cachedValueVersion = e, n;
|
|
2244
2250
|
}
|
|
2245
2251
|
assignMembers(e) {
|
|
@@ -2302,16 +2308,16 @@ var Pn = /* @__PURE__ */ new WeakSet(), Fn = Object.freeze({}), In = /* @__PURE_
|
|
|
2302
2308
|
};
|
|
2303
2309
|
//#endregion
|
|
2304
2310
|
//#region src/is-equal.ts
|
|
2305
|
-
function
|
|
2311
|
+
function Bn(e, t) {
|
|
2306
2312
|
let n = e instanceof U ? e.value : e, r = t instanceof U ? t.value : t;
|
|
2307
2313
|
return n === e && r === t ? void 0 : h(n, r);
|
|
2308
2314
|
}
|
|
2309
|
-
function
|
|
2310
|
-
return e instanceof U && t instanceof U ? h(e.value, t.value) : re(e, t,
|
|
2315
|
+
function Vn(e, t) {
|
|
2316
|
+
return e instanceof U && t instanceof U ? h(e.value, t.value) : re(e, t, Bn);
|
|
2311
2317
|
}
|
|
2312
2318
|
//#endregion
|
|
2313
2319
|
//#region src/validators/validator-compare-to.ts
|
|
2314
|
-
var
|
|
2320
|
+
var Hn = class extends I {
|
|
2315
2321
|
isValidComparison;
|
|
2316
2322
|
otherField;
|
|
2317
2323
|
registrations = /* @__PURE__ */ new WeakSet();
|
|
@@ -2325,14 +2331,14 @@ var Bn = class extends P {
|
|
|
2325
2331
|
if (!i) return r.markRecordIncomplete(), null;
|
|
2326
2332
|
this.listenOn(i);
|
|
2327
2333
|
let a = m(i.value);
|
|
2328
|
-
return this.isValidComparison(m(e), a) ? null : [this.errorFor(n, "compare_to", "Value does not match the comparison with {otherValue}", {
|
|
2334
|
+
return this.isValidComparison(m(e), a) ? null : [this.errorFor(n, F("compare_to"), "Value does not match the comparison with {otherValue}", {
|
|
2329
2335
|
newValue: e,
|
|
2330
2336
|
oldValue: t,
|
|
2331
2337
|
otherValue: a
|
|
2332
2338
|
})];
|
|
2333
|
-
}), this.isValidComparison = t, this.otherField = e, this.relay = new
|
|
2339
|
+
}), this.isValidComparison = t, this.otherField = e, this.relay = new P((e, t, n, r) => {
|
|
2334
2340
|
t(e, n, r);
|
|
2335
|
-
let i =
|
|
2341
|
+
let i = L(e);
|
|
2336
2342
|
this.declarations.alive.forEach((e) => Mt(e, i).forEach((e) => {
|
|
2337
2343
|
this.registrations.has(e) && this.execute(e, () => null, e.contribution, this.comparisonState(e).oldValue);
|
|
2338
2344
|
}));
|
|
@@ -2342,7 +2348,7 @@ var Bn = class extends P {
|
|
|
2342
2348
|
}
|
|
2343
2349
|
resolve(e) {
|
|
2344
2350
|
let t = this.otherField;
|
|
2345
|
-
return typeof t == "function" ? t(e) ?? void 0 : typeof t == "string" ? Nt(t, e) : jt(t,
|
|
2351
|
+
return typeof t == "function" ? t(e) ?? void 0 : typeof t == "string" ? Nt(t, e) : jt(t, L(e));
|
|
2346
2352
|
}
|
|
2347
2353
|
listenOn(e) {
|
|
2348
2354
|
this.listening.has(e.declaration) || (this.listening.add(e.declaration), e.registerAction(this.relay));
|
|
@@ -2384,7 +2390,7 @@ function X(e) {
|
|
|
2384
2390
|
function Z(e) {
|
|
2385
2391
|
return X(e) === 0 && (e == null || g(e) || te(e) || ie(e));
|
|
2386
2392
|
}
|
|
2387
|
-
function
|
|
2393
|
+
function Un(e, t) {
|
|
2388
2394
|
if (e instanceof Date && t instanceof Date) {
|
|
2389
2395
|
let n = e.getTime() - t.getTime();
|
|
2390
2396
|
return Number.isNaN(n) ? void 0 : n;
|
|
@@ -2394,7 +2400,7 @@ function Vn(e, t) {
|
|
|
2394
2400
|
}
|
|
2395
2401
|
//#endregion
|
|
2396
2402
|
//#region src/validators/validator-in-allowed-values.ts
|
|
2397
|
-
var
|
|
2403
|
+
var Wn = class extends I {
|
|
2398
2404
|
constructor(e, t) {
|
|
2399
2405
|
let n = () => {
|
|
2400
2406
|
let t = m(e);
|
|
@@ -2410,7 +2416,7 @@ var Hn = class extends P {
|
|
|
2410
2416
|
super((e, i) => {
|
|
2411
2417
|
if (Z(m(e))) return null;
|
|
2412
2418
|
let a = n();
|
|
2413
|
-
return a.includes(m(e)) ? null : [this.errorFor(t, "in_allowed_values", "Must be one of [{allowedAsText}]", {
|
|
2419
|
+
return a.includes(m(e)) ? null : [this.errorFor(t, F("in_allowed_values"), "Must be one of [{allowedAsText}]", {
|
|
2414
2420
|
newValue: e,
|
|
2415
2421
|
oldValue: i,
|
|
2416
2422
|
allowedValues: a,
|
|
@@ -2418,47 +2424,47 @@ var Hn = class extends P {
|
|
|
2418
2424
|
})];
|
|
2419
2425
|
});
|
|
2420
2426
|
}
|
|
2421
|
-
},
|
|
2427
|
+
}, Gn = class extends I {
|
|
2422
2428
|
constructor(e) {
|
|
2423
2429
|
let t = e?.trim ?? !0;
|
|
2424
2430
|
super((n, r) => {
|
|
2425
2431
|
let i = m(n);
|
|
2426
|
-
return X(t && g(i) ? i.trim() : i) === 0 ? [this.errorFor(e, "required", "Please enter a value", {
|
|
2432
|
+
return X(t && g(i) ? i.trim() : i) === 0 ? [this.errorFor(e, F("required"), "Please enter a value", {
|
|
2427
2433
|
newValue: n,
|
|
2428
2434
|
oldValue: r
|
|
2429
2435
|
})] : null;
|
|
2430
2436
|
});
|
|
2431
2437
|
}
|
|
2432
|
-
},
|
|
2438
|
+
}, Kn = class extends I {
|
|
2433
2439
|
constructor(e, t) {
|
|
2434
2440
|
super((n, r) => {
|
|
2435
2441
|
if (Z(n)) return null;
|
|
2436
|
-
let i =
|
|
2437
|
-
return i === void 0 || i < 0 ? [this.errorFor(t, "min_value", "Value must be larger or equal to {minValue}", {
|
|
2442
|
+
let i = Un(n, e);
|
|
2443
|
+
return i === void 0 || i < 0 ? [this.errorFor(t, F("min_value"), "Value must be larger or equal to {minValue}", {
|
|
2438
2444
|
newValue: n,
|
|
2439
2445
|
oldValue: r,
|
|
2440
2446
|
minValue: e
|
|
2441
2447
|
})] : null;
|
|
2442
2448
|
});
|
|
2443
2449
|
}
|
|
2444
|
-
},
|
|
2450
|
+
}, qn = class extends I {
|
|
2445
2451
|
constructor(e, t) {
|
|
2446
2452
|
super((n, r) => {
|
|
2447
2453
|
if (Z(n)) return null;
|
|
2448
|
-
let i =
|
|
2449
|
-
return i === void 0 || i > 0 ? [this.errorFor(t, "max_value", "Value must be less than or equal to {maxValue}", {
|
|
2454
|
+
let i = Un(n, e);
|
|
2455
|
+
return i === void 0 || i > 0 ? [this.errorFor(t, F("max_value"), "Value must be less than or equal to {maxValue}", {
|
|
2450
2456
|
newValue: n,
|
|
2451
2457
|
oldValue: r,
|
|
2452
2458
|
maxValue: e
|
|
2453
2459
|
})] : null;
|
|
2454
2460
|
});
|
|
2455
2461
|
}
|
|
2456
|
-
},
|
|
2462
|
+
}, Jn = class extends I {
|
|
2457
2463
|
constructor(e, t, n) {
|
|
2458
2464
|
super((r, i) => {
|
|
2459
2465
|
if (Z(r)) return null;
|
|
2460
|
-
let a =
|
|
2461
|
-
return a === void 0 || o === void 0 || a < 0 || o > 0 ? [this.errorFor(n, "value_in_range", "Value must be between {minValue} and {maxValue}", {
|
|
2466
|
+
let a = Un(r, e), o = Un(r, t);
|
|
2467
|
+
return a === void 0 || o === void 0 || a < 0 || o > 0 ? [this.errorFor(n, F("value_in_range"), "Value must be between {minValue} and {maxValue}", {
|
|
2462
2468
|
newValue: r,
|
|
2463
2469
|
oldValue: i,
|
|
2464
2470
|
minValue: e,
|
|
@@ -2466,28 +2472,28 @@ var Hn = class extends P {
|
|
|
2466
2472
|
})] : null;
|
|
2467
2473
|
});
|
|
2468
2474
|
}
|
|
2469
|
-
},
|
|
2475
|
+
}, Yn = class extends I {
|
|
2470
2476
|
constructor(e, t) {
|
|
2471
|
-
super((n, r) => Z(n) ? null : X(n) < e ? [this.errorFor(t, "min_length", "Length must be larger or equal to {minLength}", {
|
|
2477
|
+
super((n, r) => Z(n) ? null : X(n) < e ? [this.errorFor(t, F("min_length"), "Length must be larger or equal to {minLength}", {
|
|
2472
2478
|
newValue: n,
|
|
2473
2479
|
oldValue: r,
|
|
2474
2480
|
minLength: e
|
|
2475
2481
|
})] : null);
|
|
2476
2482
|
}
|
|
2477
|
-
},
|
|
2483
|
+
}, Xn = class extends I {
|
|
2478
2484
|
constructor(e, t) {
|
|
2479
|
-
super((n, r) => Z(n) ? null : X(n) > e ? [this.errorFor(t, "max_length", "Length must be less than or equal to {maxLength}", {
|
|
2485
|
+
super((n, r) => Z(n) ? null : X(n) > e ? [this.errorFor(t, F("max_length"), "Length must be less than or equal to {maxLength}", {
|
|
2480
2486
|
newValue: n,
|
|
2481
2487
|
oldValue: r,
|
|
2482
2488
|
maxLength: e
|
|
2483
2489
|
})] : null);
|
|
2484
2490
|
}
|
|
2485
|
-
},
|
|
2491
|
+
}, Zn = class extends I {
|
|
2486
2492
|
constructor(e, t, n) {
|
|
2487
2493
|
super((r, i) => {
|
|
2488
2494
|
if (Z(r)) return null;
|
|
2489
2495
|
let a = X(r);
|
|
2490
|
-
return a < e || a > t ? [this.errorFor(n, "length_in_range", "Length must be between {minLength} and {maxLength}", {
|
|
2496
|
+
return a < e || a > t ? [this.errorFor(n, F("length_in_range"), "Length must be between {minLength} and {maxLength}", {
|
|
2491
2497
|
newValue: r,
|
|
2492
2498
|
oldValue: i,
|
|
2493
2499
|
minLength: e,
|
|
@@ -2495,32 +2501,32 @@ var Hn = class extends P {
|
|
|
2495
2501
|
})] : null;
|
|
2496
2502
|
});
|
|
2497
2503
|
}
|
|
2498
|
-
},
|
|
2504
|
+
}, Qn = class extends I {
|
|
2499
2505
|
constructor(e, t) {
|
|
2500
2506
|
let n = /[gy]/.test(e.flags) ? new RegExp(e.source, e.flags.replace(/[gy]/g, "")) : e;
|
|
2501
2507
|
super((r, i) => {
|
|
2502
2508
|
let a = m(r);
|
|
2503
|
-
return Z(a) || n.test(String(a)) ? null : [this.errorFor(t, "pattern", "Value must match pattern \"{pattern}\"", {
|
|
2509
|
+
return Z(a) || n.test(String(a)) ? null : [this.errorFor(t, F("pattern"), "Value must match pattern \"{pattern}\"", {
|
|
2504
2510
|
newValue: r,
|
|
2505
2511
|
oldValue: i,
|
|
2506
2512
|
pattern: e
|
|
2507
2513
|
})];
|
|
2508
2514
|
});
|
|
2509
2515
|
}
|
|
2510
|
-
},
|
|
2511
|
-
CompareTo: () =>
|
|
2512
|
-
InAllowedValues: () =>
|
|
2513
|
-
LengthInRange: () =>
|
|
2514
|
-
MaxLength: () =>
|
|
2515
|
-
MaxValue: () =>
|
|
2516
|
-
MinLength: () =>
|
|
2517
|
-
MinValue: () =>
|
|
2518
|
-
Pattern: () =>
|
|
2519
|
-
Required: () =>
|
|
2520
|
-
Validator: () =>
|
|
2521
|
-
ValueInRange: () =>
|
|
2516
|
+
}, $n = /* @__PURE__ */ ce({
|
|
2517
|
+
CompareTo: () => Hn,
|
|
2518
|
+
InAllowedValues: () => Wn,
|
|
2519
|
+
LengthInRange: () => Zn,
|
|
2520
|
+
MaxLength: () => Xn,
|
|
2521
|
+
MaxValue: () => qn,
|
|
2522
|
+
MinLength: () => Yn,
|
|
2523
|
+
MinValue: () => Kn,
|
|
2524
|
+
Pattern: () => Qn,
|
|
2525
|
+
Required: () => Gn,
|
|
2526
|
+
Validator: () => I,
|
|
2527
|
+
ValueInRange: () => Jn,
|
|
2522
2528
|
isEmptyValue: () => Z
|
|
2523
|
-
}),
|
|
2529
|
+
}), er = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakMap(), nr = /* @__PURE__ */ new Set([
|
|
2524
2530
|
"push",
|
|
2525
2531
|
"pop",
|
|
2526
2532
|
"shift",
|
|
@@ -2531,23 +2537,23 @@ var Hn = class extends P {
|
|
|
2531
2537
|
"fill",
|
|
2532
2538
|
"copyWithin"
|
|
2533
2539
|
]);
|
|
2534
|
-
function
|
|
2540
|
+
function rr(e) {
|
|
2535
2541
|
return typeof e == "string" && /^(0|[1-9]\d*)$/.test(e);
|
|
2536
2542
|
}
|
|
2537
|
-
function
|
|
2543
|
+
function ir(e) {
|
|
2538
2544
|
let t = Math.trunc(Number(e));
|
|
2539
2545
|
return Number.isNaN(t) ? 0 : t;
|
|
2540
2546
|
}
|
|
2541
2547
|
function Q(e) {
|
|
2542
|
-
return typeof e == "object" && !!e &&
|
|
2548
|
+
return typeof e == "object" && !!e && tr.get(e) || e;
|
|
2543
2549
|
}
|
|
2544
2550
|
function $(e) {
|
|
2545
|
-
return e instanceof J ?
|
|
2551
|
+
return e instanceof J ? ur(e) : e.value;
|
|
2546
2552
|
}
|
|
2547
|
-
function
|
|
2553
|
+
function ar(e, t) {
|
|
2548
2554
|
e.value = Q(t) instanceof U ? Q(t).value : t;
|
|
2549
2555
|
}
|
|
2550
|
-
function
|
|
2556
|
+
function or(e) {
|
|
2551
2557
|
return e === "__v_skip" ? {
|
|
2552
2558
|
answered: !0,
|
|
2553
2559
|
value: !0
|
|
@@ -2556,11 +2562,11 @@ function ir(e) {
|
|
|
2556
2562
|
value: void 0
|
|
2557
2563
|
} : { answered: !1 };
|
|
2558
2564
|
}
|
|
2559
|
-
function
|
|
2565
|
+
function sr(e) {
|
|
2560
2566
|
let t = (t) => typeof t == "string" && t !== "$" ? e.field(t) ?? void 0 : void 0, n = () => Object.keys(e.fields);
|
|
2561
2567
|
return {
|
|
2562
2568
|
get(n, r) {
|
|
2563
|
-
let i =
|
|
2569
|
+
let i = or(r);
|
|
2564
2570
|
if (i.answered) return i.value;
|
|
2565
2571
|
if (r === "$") return e;
|
|
2566
2572
|
if (r === Symbol.toStringTag) return "View";
|
|
@@ -2571,7 +2577,7 @@ function ar(e) {
|
|
|
2571
2577
|
if (n === "$") throw TypeError("$ is the element a view stands for, and cannot be replaced");
|
|
2572
2578
|
let i = t(n);
|
|
2573
2579
|
if (!i) throw TypeError(`${String(n)} is not a member of this group - use $.addField() to add one`);
|
|
2574
|
-
return
|
|
2580
|
+
return ar(i, r), !0;
|
|
2575
2581
|
},
|
|
2576
2582
|
has(e, t) {
|
|
2577
2583
|
return t === "$" || typeof t == "string" && n().includes(t);
|
|
@@ -2595,7 +2601,7 @@ function ar(e) {
|
|
|
2595
2601
|
}
|
|
2596
2602
|
};
|
|
2597
2603
|
}
|
|
2598
|
-
function
|
|
2604
|
+
function cr(e) {
|
|
2599
2605
|
let t = () => e.items, n = (t) => Math.min(t, e.length), r = (e, t) => e < 0 ? Math.max(t + e, 0) : Math.min(e, t), i = (t) => C(() => {
|
|
2600
2606
|
e[lt](t);
|
|
2601
2607
|
}), a = {
|
|
@@ -2619,8 +2625,8 @@ function or(e) {
|
|
|
2619
2625
|
splice: (...i) => {
|
|
2620
2626
|
let [a, o, ...s] = i, c = [];
|
|
2621
2627
|
return C(() => {
|
|
2622
|
-
let l = t(), u = r(
|
|
2623
|
-
i.length === 1 ? d = l.length - u : i.length > 1 && (d = Math.max(0, Math.min(
|
|
2628
|
+
let l = t(), u = r(ir(a), l.length), d = 0;
|
|
2629
|
+
i.length === 1 ? d = l.length - u : i.length > 1 && (d = Math.max(0, Math.min(ir(o), l.length - u))), l.slice(u, u + d).forEach((t) => {
|
|
2624
2630
|
c.push($(t)), e.remove(e.items.indexOf(t));
|
|
2625
2631
|
});
|
|
2626
2632
|
let f = n(u);
|
|
@@ -2648,15 +2654,15 @@ function or(e) {
|
|
|
2648
2654
|
}, o;
|
|
2649
2655
|
return o = new Proxy([], {
|
|
2650
2656
|
get(n, r, i) {
|
|
2651
|
-
let o =
|
|
2657
|
+
let o = or(r);
|
|
2652
2658
|
if (o.answered) return o.value;
|
|
2653
2659
|
if (r === "$") return e;
|
|
2654
2660
|
if (r === "length") return t().length;
|
|
2655
|
-
if (
|
|
2661
|
+
if (rr(r)) {
|
|
2656
2662
|
let e = t()[Number(r)];
|
|
2657
2663
|
return e ? $(e) : void 0;
|
|
2658
2664
|
}
|
|
2659
|
-
return typeof r == "string" &&
|
|
2665
|
+
return typeof r == "string" && nr.has(r) ? a[r] : Reflect.get(n, r, i);
|
|
2660
2666
|
},
|
|
2661
2667
|
set(r, i, a) {
|
|
2662
2668
|
if (i === "$") throw TypeError("$ is the element a view stands for, and cannot be replaced");
|
|
@@ -2667,14 +2673,14 @@ function or(e) {
|
|
|
2667
2673
|
if (n > r.length) throw TypeError("a list view grows by push(), not by its length");
|
|
2668
2674
|
return C(() => r.slice(n).forEach((t) => e.remove(e.items.indexOf(t)))), !0;
|
|
2669
2675
|
}
|
|
2670
|
-
if (
|
|
2676
|
+
if (rr(i)) {
|
|
2671
2677
|
let r = Number(i), o = t();
|
|
2672
|
-
return r < o.length ?
|
|
2678
|
+
return r < o.length ? ar(o[r], a) : e.insert(Q(a), n(o.length) + (r - o.length)), !0;
|
|
2673
2679
|
}
|
|
2674
2680
|
throw TypeError(`${String(i)} cannot be set on a list view`);
|
|
2675
2681
|
},
|
|
2676
2682
|
has(e, n) {
|
|
2677
|
-
return n === "$" || n === "length" ? !0 :
|
|
2683
|
+
return n === "$" || n === "length" ? !0 : rr(n) ? Number(n) < t().length : Reflect.has(e, n);
|
|
2678
2684
|
},
|
|
2679
2685
|
ownKeys() {
|
|
2680
2686
|
return [...t().map((e, t) => String(t)), "length"];
|
|
@@ -2686,7 +2692,7 @@ function or(e) {
|
|
|
2686
2692
|
enumerable: !1,
|
|
2687
2693
|
configurable: !1
|
|
2688
2694
|
};
|
|
2689
|
-
if (!(!
|
|
2695
|
+
if (!(!rr(n) || Number(n) >= t().length)) return {
|
|
2690
2696
|
value: $(t()[Number(n)]),
|
|
2691
2697
|
writable: !0,
|
|
2692
2698
|
enumerable: !0,
|
|
@@ -2701,10 +2707,10 @@ function or(e) {
|
|
|
2701
2707
|
}
|
|
2702
2708
|
}), o;
|
|
2703
2709
|
}
|
|
2704
|
-
function
|
|
2710
|
+
function lr(e) {
|
|
2705
2711
|
return {
|
|
2706
2712
|
get(t, n) {
|
|
2707
|
-
let r =
|
|
2713
|
+
let r = or(n);
|
|
2708
2714
|
if (r.answered) return r.value;
|
|
2709
2715
|
if (n === "$") return e;
|
|
2710
2716
|
},
|
|
@@ -2719,50 +2725,51 @@ function sr(e) {
|
|
|
2719
2725
|
}
|
|
2720
2726
|
};
|
|
2721
2727
|
}
|
|
2722
|
-
function
|
|
2723
|
-
if (
|
|
2724
|
-
let t =
|
|
2728
|
+
function ur(e) {
|
|
2729
|
+
if (tr.has(e)) return e;
|
|
2730
|
+
let t = er.get(e);
|
|
2725
2731
|
if (t) return t;
|
|
2726
2732
|
let n;
|
|
2727
|
-
return e instanceof Y ? (Object.keys(e.fields).forEach(
|
|
2733
|
+
return e instanceof Y ? (Object.keys(e.fields).forEach(Pn), Nn.add(e), n = new Proxy({}, sr(e))) : n = e instanceof Mn ? cr(e) : new Proxy({}, lr(e)), er.set(e, n), tr.set(n, e), n;
|
|
2728
2734
|
}
|
|
2729
2735
|
//#endregion
|
|
2730
2736
|
//#region src/index.ts
|
|
2731
|
-
var
|
|
2737
|
+
var dr = /* @__PURE__ */ ce({
|
|
2732
2738
|
AbortEventHandlingException: () => E,
|
|
2733
2739
|
AccessChangedAction: () => Ht,
|
|
2734
2740
|
AccessChangingAction: () => Bt,
|
|
2735
|
-
Action: () =>
|
|
2741
|
+
Action: () => Dn,
|
|
2736
2742
|
ActionsMap: () => Ot,
|
|
2737
|
-
CommandException: () =>
|
|
2743
|
+
CommandException: () => vn,
|
|
2738
2744
|
ConditionalAccessAction: () => Lt,
|
|
2739
|
-
ConditionalStatementAction: () =>
|
|
2745
|
+
ConditionalStatementAction: () => R,
|
|
2740
2746
|
ConditionalValueAction: () => Rt,
|
|
2741
2747
|
ConditionalVisibilityAction: () => It,
|
|
2742
2748
|
Container: () => J,
|
|
2743
2749
|
ContributionChangedAction: () => Wt,
|
|
2750
|
+
ERROR_NAMESPACE: () => wt,
|
|
2744
2751
|
EnabledChangedAction: () => Jt,
|
|
2745
2752
|
EnabledChangingAction: () => Kt,
|
|
2746
|
-
ErrorPolicy: () =>
|
|
2753
|
+
ErrorPolicy: () => N,
|
|
2747
2754
|
ExecuteAction: () => W,
|
|
2748
2755
|
Field: () => q,
|
|
2749
2756
|
FieldActionBase: () => T,
|
|
2750
2757
|
FieldBase: () => U,
|
|
2751
2758
|
Group: () => Y,
|
|
2752
|
-
List: () =>
|
|
2759
|
+
List: () => Mn,
|
|
2753
2760
|
ListItemAddedAction: () => G,
|
|
2754
2761
|
ListItemRemovedAction: () => K,
|
|
2755
|
-
Operator: () =>
|
|
2756
|
-
RejectAction: () =>
|
|
2757
|
-
Statement: () =>
|
|
2758
|
-
SubmitAction: () =>
|
|
2759
|
-
SubmitFailedException: () =>
|
|
2760
|
-
SubmitRefusedException: () =>
|
|
2761
|
-
TargetedExecuteAction: () =>
|
|
2762
|
+
Operator: () => B,
|
|
2763
|
+
RejectAction: () => Sn,
|
|
2764
|
+
Statement: () => mn,
|
|
2765
|
+
SubmitAction: () => xn,
|
|
2766
|
+
SubmitFailedException: () => yn,
|
|
2767
|
+
SubmitRefusedException: () => bn,
|
|
2768
|
+
TargetedExecuteAction: () => gn,
|
|
2762
2769
|
ValidChangedAction: () => Xt,
|
|
2763
2770
|
ValidationError: () => Tt,
|
|
2764
|
-
Validators: () =>
|
|
2765
|
-
ValueChangedAction: () =>
|
|
2771
|
+
Validators: () => $n,
|
|
2772
|
+
ValueChangedAction: () => P,
|
|
2766
2773
|
VisibilityChangedAction: () => en,
|
|
2767
2774
|
VisibilityChangingAction: () => Qt,
|
|
2768
2775
|
accessValues: () => _,
|
|
@@ -2770,18 +2777,18 @@ var lr = /* @__PURE__ */ ce({
|
|
|
2770
2777
|
defaultAccess: () => le,
|
|
2771
2778
|
defaultVisibility: () => fe,
|
|
2772
2779
|
describeState: () => xe,
|
|
2773
|
-
errorRemovals: () =>
|
|
2780
|
+
errorRemovals: () => k,
|
|
2774
2781
|
hideState: () => Se,
|
|
2775
2782
|
installPlugin: () => Pe,
|
|
2776
2783
|
isAccess: () => ue,
|
|
2777
|
-
isEqual: () =>
|
|
2784
|
+
isEqual: () => Vn,
|
|
2778
2785
|
isVisibility: () => pe,
|
|
2779
|
-
setDefaultErrorPolicies: () =>
|
|
2786
|
+
setDefaultErrorPolicies: () => yt,
|
|
2780
2787
|
transaction: () => C,
|
|
2781
|
-
view: () =>
|
|
2788
|
+
view: () => ur,
|
|
2782
2789
|
visibilityValues: () => de
|
|
2783
2790
|
});
|
|
2784
2791
|
//#endregion
|
|
2785
|
-
export { E as AbortEventHandlingException, Ht as AccessChangedAction, Bt as AccessChangingAction,
|
|
2792
|
+
export { E as AbortEventHandlingException, Ht as AccessChangedAction, Bt as AccessChangingAction, Dn as Action, Ot as ActionsMap, vn as CommandException, Lt as ConditionalAccessAction, R as ConditionalStatementAction, Rt as ConditionalValueAction, It as ConditionalVisibilityAction, J as Container, Wt as ContributionChangedAction, wt as ERROR_NAMESPACE, Jt as EnabledChangedAction, Kt as EnabledChangingAction, N as ErrorPolicy, W as ExecuteAction, q as Field, T as FieldActionBase, U as FieldBase, Y as Group, Mn as List, G as ListItemAddedAction, K as ListItemRemovedAction, B as Operator, Sn as RejectAction, mn as Statement, xn as SubmitAction, yn as SubmitFailedException, bn as SubmitRefusedException, gn as TargetedExecuteAction, Xt as ValidChangedAction, Tt as ValidationError, $n as Validators, P as ValueChangedAction, en as VisibilityChangedAction, Qt as VisibilityChangingAction, _ as accessValues, Ce as configureDevtools, dr as default, le as defaultAccess, fe as defaultVisibility, xe as describeState, k as errorRemovals, Se as hideState, Pe as installPlugin, ue as isAccess, Vn as isEqual, pe as isVisibility, yt as setDefaultErrorPolicies, C as transaction, ur as view, de as visibilityValues };
|
|
2786
2793
|
|
|
2787
2794
|
//# sourceMappingURL=dynamicforms-vue-forms.js.map
|