@dynamicforms/vue-forms 0.17.0 → 0.17.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.
- package/dist/dynamicforms-vue-forms.js +138 -113
- package/dist/dynamicforms-vue-forms.js.map +1 -1
- package/dist/index.d.ts +20 -4
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { computed as K, unref as h, isRef as Vt, reactive as Ut, watch as $t, ref as Wt, defineComponent as qt, resolveComponent as lt, openBlock as zt, createBlock as Ht, h as
|
|
2
|
-
import { isEqual as
|
|
3
|
-
var
|
|
1
|
+
import { computed as K, unref as h, isRef as Vt, reactive as Ut, watch as $t, ref as Wt, defineComponent as qt, resolveComponent as lt, openBlock as zt, createBlock as Ht, h as R } from "vue";
|
|
2
|
+
import { isEqual as F, isEmpty as j, isBoolean as Qt, isString as C, truncate as Xt, isArray as yt, isObject as Et } from "lodash-es";
|
|
3
|
+
var I = /* @__PURE__ */ ((n) => (n[n.SUPPRESS = 1] = "SUPPRESS", n[n.HIDDEN = 5] = "HIDDEN", n[n.INVISIBLE = 8] = "INVISIBLE", n[n.FULL = 10] = "FULL", n))(I || {});
|
|
4
4
|
const Kt = 10, ut = new Set(
|
|
5
|
-
Object.values(
|
|
5
|
+
Object.values(I).filter((n) => typeof n == "number")
|
|
6
6
|
), Yt = new Set(
|
|
7
|
-
Object.values(
|
|
7
|
+
Object.values(I).filter((n) => typeof n == "string")
|
|
8
8
|
);
|
|
9
9
|
function z(n) {
|
|
10
10
|
const t = typeof n == "string" ? `'${n}'` : String(n);
|
|
@@ -33,9 +33,9 @@ function z(n) {
|
|
|
33
33
|
return typeof i == "number" ? ut.has(i) : typeof i == "string" ? Yt.has(i.toUpperCase()) : !1;
|
|
34
34
|
}
|
|
35
35
|
n.isDefined = s;
|
|
36
|
-
})(
|
|
37
|
-
Object.freeze(
|
|
38
|
-
const
|
|
36
|
+
})(I || (I = {}));
|
|
37
|
+
Object.freeze(I);
|
|
38
|
+
const O = I;
|
|
39
39
|
class m {
|
|
40
40
|
static get classIdentifier() {
|
|
41
41
|
throw new Error("classIdentifier must be declared");
|
|
@@ -86,10 +86,10 @@ class m {
|
|
|
86
86
|
unregisterFrom(t) {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class S extends Error {
|
|
90
90
|
}
|
|
91
91
|
const Ct = /* @__PURE__ */ Symbol("ValueChangedAction");
|
|
92
|
-
class
|
|
92
|
+
class P extends m {
|
|
93
93
|
constructor(t) {
|
|
94
94
|
super(t);
|
|
95
95
|
}
|
|
@@ -100,7 +100,7 @@ class T extends m {
|
|
|
100
100
|
return super.execute(t, e, s, i);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const k = /* @__PURE__ */ Symbol("Transaction.capture"), St = /* @__PURE__ */ Symbol("Transaction.restore"), xt = /* @__PURE__ */ Symbol("Transaction.announceValue"), At = /* @__PURE__ */ Symbol("Transaction.settleValidity");
|
|
104
104
|
function ct(n) {
|
|
105
105
|
let t = 0, e = n.parent;
|
|
106
106
|
for (; e; )
|
|
@@ -134,7 +134,7 @@ class Jt {
|
|
|
134
134
|
*/
|
|
135
135
|
touch(t) {
|
|
136
136
|
const e = this.participant(t);
|
|
137
|
-
e.snapshot || (e.snapshot = t[
|
|
137
|
+
e.snapshot || (e.snapshot = t[k]());
|
|
138
138
|
}
|
|
139
139
|
/** Enrols an element as one whose value the commit has to announce. `force` skips the comparison. */
|
|
140
140
|
markValueChanged(t, e) {
|
|
@@ -268,9 +268,9 @@ class Jt {
|
|
|
268
268
|
);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
let
|
|
271
|
+
let A, H;
|
|
272
272
|
function It() {
|
|
273
|
-
return
|
|
273
|
+
return A;
|
|
274
274
|
}
|
|
275
275
|
class Tt {
|
|
276
276
|
}
|
|
@@ -292,12 +292,12 @@ function ht(n) {
|
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
294
|
function J(n) {
|
|
295
|
-
if (
|
|
295
|
+
if (A) {
|
|
296
296
|
const s = n(H);
|
|
297
297
|
return ht(s), s;
|
|
298
298
|
}
|
|
299
299
|
const t = new Jt(), e = new Zt();
|
|
300
|
-
|
|
300
|
+
A = t, H = e;
|
|
301
301
|
try {
|
|
302
302
|
const s = n(e);
|
|
303
303
|
return ht(s), t.commit(), s;
|
|
@@ -305,11 +305,11 @@ function J(n) {
|
|
|
305
305
|
if (t.rollback(), s instanceof Tt) return;
|
|
306
306
|
throw s;
|
|
307
307
|
} finally {
|
|
308
|
-
|
|
308
|
+
A = void 0, H = void 0, e.close();
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
function u(n) {
|
|
312
|
-
return
|
|
312
|
+
return A ? n(A) : J(() => n(A));
|
|
313
313
|
}
|
|
314
314
|
const Ot = { useMarkdownInValidators: !0 };
|
|
315
315
|
function Gt() {
|
|
@@ -323,7 +323,7 @@ const Ue = {
|
|
|
323
323
|
t && te(t);
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
|
-
class
|
|
326
|
+
class N extends String {
|
|
327
327
|
plugins;
|
|
328
328
|
options;
|
|
329
329
|
constructor(t, e, s) {
|
|
@@ -334,7 +334,7 @@ function Z(n) {
|
|
|
334
334
|
const t = h(n);
|
|
335
335
|
return typeof t == "object" && t !== null && "componentName" in t;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function M(n) {
|
|
338
338
|
return typeof h(n) == "function";
|
|
339
339
|
}
|
|
340
340
|
class G {
|
|
@@ -358,7 +358,7 @@ class G {
|
|
|
358
358
|
* `ValidationErrorRenderContent` holds a Vue `computed`, and two of those are never structurally equal.
|
|
359
359
|
*/
|
|
360
360
|
sameAs(t) {
|
|
361
|
-
return Object.getPrototypeOf(this) === Object.getPrototypeOf(t) && this.code === t.code && this.componentName === t.componentName &&
|
|
361
|
+
return Object.getPrototypeOf(this) === Object.getPrototypeOf(t) && this.code === t.code && this.componentName === t.componentName && F(this.componentBody, t.componentBody) && F(this.componentBindings, t.componentBindings) && F(this.extraClasses, t.extraClasses);
|
|
362
362
|
}
|
|
363
363
|
get componentName() {
|
|
364
364
|
return "Comment";
|
|
@@ -398,11 +398,11 @@ class g extends G {
|
|
|
398
398
|
textType;
|
|
399
399
|
get resolvedText() {
|
|
400
400
|
const t = h(this.text);
|
|
401
|
-
return
|
|
401
|
+
return M(t) ? t() : t;
|
|
402
402
|
}
|
|
403
403
|
get getTextType() {
|
|
404
404
|
const t = this.resolvedText;
|
|
405
|
-
return t ? t instanceof
|
|
405
|
+
return t ? t instanceof N ? "md" : Z(t) ? "component" : "string" : "string";
|
|
406
406
|
}
|
|
407
407
|
get componentName() {
|
|
408
408
|
switch (h(this.textType)) {
|
|
@@ -447,11 +447,11 @@ class g extends G {
|
|
|
447
447
|
class se extends g {
|
|
448
448
|
}
|
|
449
449
|
function b(n) {
|
|
450
|
-
return Gt().useMarkdownInValidators ? new
|
|
450
|
+
return Gt().useMarkdownInValidators ? new N(n) : n.replace(/[*_~`]/g, "").replace(/!\[(.*?)\]\(.*?\)/g, "$1").replace(/\[(.*?)\]\((.*?)\)/g, "$1").replace(/#+\s?/g, "").replace(/>\s?/g, "").replace(/(\*|-|\d+\.)\s+/g, "").replace(/`{3}[\s\S]*?`{3}/g, "").replace(/`([^`]+)`/g, "$1").replace(/\n{2,}/g, `
|
|
451
451
|
`);
|
|
452
452
|
}
|
|
453
453
|
const ie = /* @__PURE__ */ Symbol("Validator"), ne = () => b("Validation could not be completed");
|
|
454
|
-
class f extends
|
|
454
|
+
class f extends P {
|
|
455
455
|
source;
|
|
456
456
|
/**
|
|
457
457
|
* Creates a new validator
|
|
@@ -461,22 +461,22 @@ class f extends T {
|
|
|
461
461
|
const e = (s, i, r, a) => {
|
|
462
462
|
const o = this.bindingState(s), l = o.abandon, v = ++o.run, p = s.validationEpoch, it = It();
|
|
463
463
|
let nt = !1;
|
|
464
|
-
const $ = () => !nt && o.run === v && s.validationEpoch === p && !it?.rolledBack, rt = new AbortController(),
|
|
465
|
-
$() || (nt = !0, o.abandon ===
|
|
464
|
+
const $ = () => !nt && o.run === v && s.validationEpoch === p && !it?.rolledBack, rt = new AbortController(), D = () => {
|
|
465
|
+
$() || (nt = !0, o.abandon === D && (o.abandon = void 0), rt.abort());
|
|
466
466
|
};
|
|
467
467
|
l?.();
|
|
468
468
|
const W = t(r, a, s, rt.signal) || [], q = (E) => J(() => {
|
|
469
|
-
const
|
|
470
|
-
for (let
|
|
471
|
-
const at = s.errors[
|
|
469
|
+
const L = E?.map((T) => this.claim(T)) ?? [];
|
|
470
|
+
for (let T = s.errors.length - 1; T >= 0; T--) {
|
|
471
|
+
const at = s.errors[T];
|
|
472
472
|
if (at.source === this.source) {
|
|
473
|
-
const ot =
|
|
474
|
-
ot >= 0 ?
|
|
473
|
+
const ot = L.findIndex((Mt) => Mt.sameAs(at));
|
|
474
|
+
ot >= 0 ? L.splice(ot, 1) : s.errors.splice(T, 1);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
L.length > 0 && s.errors.push(...L), s.validate();
|
|
478
478
|
});
|
|
479
|
-
return W instanceof Promise ? (o.abandon =
|
|
479
|
+
return W instanceof Promise ? (o.abandon = D, it?.whenRolledBack(D), s.beginValidating(), W.then(
|
|
480
480
|
(E) => {
|
|
481
481
|
$() && q(E);
|
|
482
482
|
},
|
|
@@ -484,7 +484,7 @@ class f extends T {
|
|
|
484
484
|
$() && (q([new g(ne(), "", "validation-failed")]), console.error("Validation failed", E));
|
|
485
485
|
}
|
|
486
486
|
).finally(() => {
|
|
487
|
-
o.abandon ===
|
|
487
|
+
o.abandon === D && (o.abandon = void 0), s.endValidating();
|
|
488
488
|
}).catch((E) => console.error("Validation failed", E))) : q(W), i(s, r, a);
|
|
489
489
|
};
|
|
490
490
|
super(e), this.source = Symbol(this.constructor.name);
|
|
@@ -556,23 +556,23 @@ class f extends T {
|
|
|
556
556
|
replacePlaceholdersFunction(t, e) {
|
|
557
557
|
return () => {
|
|
558
558
|
let s = h(t);
|
|
559
|
-
for (;
|
|
559
|
+
for (; M(s); )
|
|
560
560
|
s = h(this.replacePlaceholders(s(), e));
|
|
561
561
|
return s;
|
|
562
562
|
};
|
|
563
563
|
}
|
|
564
564
|
replacePlaceholders(t, e) {
|
|
565
|
-
if (
|
|
565
|
+
if (M(t)) return this.replacePlaceholdersFunction(t, e);
|
|
566
566
|
if (Z(t)) return t;
|
|
567
567
|
if (Vt(t))
|
|
568
568
|
return this.replacePlaceholdersFunction(() => h(t), e);
|
|
569
569
|
let s = h(t);
|
|
570
570
|
return Object.keys(e).forEach((i) => {
|
|
571
571
|
s = s.replaceAll(`{${i}}`, e[i]);
|
|
572
|
-
}), t instanceof
|
|
572
|
+
}), t instanceof N ? new N(s.toString(), t.options, t.plugins) : s;
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
class
|
|
575
|
+
class x {
|
|
576
576
|
/**
|
|
577
577
|
* Every action registered here, in registration order. It is replaced rather than written when an action is
|
|
578
578
|
* dropped, so a run already walking it finishes on the array it started with and the removal takes effect from
|
|
@@ -616,11 +616,14 @@ class M {
|
|
|
616
616
|
const s = this.actions;
|
|
617
617
|
for (let i = s.length - 1; i >= 0; i--) {
|
|
618
618
|
const r = s[i];
|
|
619
|
-
if (r.eager &&
|
|
619
|
+
if (r.eager && x.outermostEager(s, i))
|
|
620
620
|
try {
|
|
621
|
-
this.walk(s, i, r.classIdentifier, !0, t, e);
|
|
621
|
+
const a = this.walk(s, i, r.classIdentifier, !0, t, e);
|
|
622
|
+
x.isPromise(a) && a.then(void 0, (o) => {
|
|
623
|
+
if (!(o instanceof S)) throw o;
|
|
624
|
+
});
|
|
622
625
|
} catch (a) {
|
|
623
|
-
if (!(a instanceof
|
|
626
|
+
if (!(a instanceof S)) throw a;
|
|
624
627
|
}
|
|
625
628
|
}
|
|
626
629
|
}
|
|
@@ -647,17 +650,38 @@ class M {
|
|
|
647
650
|
if (t[i].eager && t[i].classIdentifier === s) return !1;
|
|
648
651
|
return !0;
|
|
649
652
|
}
|
|
653
|
+
/**
|
|
654
|
+
* True where `value` is a promise, which is what a walk through an asynchronous handler answers with. The test is
|
|
655
|
+
* the type rather than a `then` member: a handler may answer with a value object that carries one, and calling
|
|
656
|
+
* `then` on such an object replaces the answer with whatever that call returns.
|
|
657
|
+
*/
|
|
658
|
+
static isPromise(t) {
|
|
659
|
+
return t instanceof Promise;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Answers an abort with itself on the asynchronous path as well. Where a handler in the chain is asynchronous, the
|
|
663
|
+
* walk answers with a promise and the abort raised under it arrives as that promise's rejection; this turns it back
|
|
664
|
+
* into the value the caller receives, so a promise the trigger answers with resolves to the exception instead of
|
|
665
|
+
* rejecting with it. Anything else keeps rejecting.
|
|
666
|
+
*/
|
|
667
|
+
static answerAbort(t) {
|
|
668
|
+
return x.isPromise(t) ? t.then(void 0, (e) => {
|
|
669
|
+
if (e instanceof S) return e;
|
|
670
|
+
throw e;
|
|
671
|
+
}) : t;
|
|
672
|
+
}
|
|
650
673
|
/**
|
|
651
674
|
* Enters a group at its outermost action. An abort ends the run and is answered with rather than raised: the
|
|
652
|
-
* exception is what the caller receives
|
|
653
|
-
*
|
|
675
|
+
* exception is what the caller receives - directly where the chain ran synchronously, as what the answered promise
|
|
676
|
+
* resolves to where it did not - so a run a handler ended is told apart from one that reached no handler and from
|
|
677
|
+
* one whose handler answered null.
|
|
654
678
|
*/
|
|
655
679
|
run(t, e, s, i) {
|
|
656
680
|
const r = this.actions;
|
|
657
681
|
try {
|
|
658
|
-
return this.walk(r, r.length - 1, t, e, s, i);
|
|
682
|
+
return x.answerAbort(this.walk(r, r.length - 1, t, e, s, i));
|
|
659
683
|
} catch (a) {
|
|
660
|
-
if (a instanceof
|
|
684
|
+
if (a instanceof S) return a;
|
|
661
685
|
throw a;
|
|
662
686
|
}
|
|
663
687
|
}
|
|
@@ -703,7 +727,7 @@ function tt(n, t) {
|
|
|
703
727
|
}
|
|
704
728
|
return V(n) === V(t.declaration) ? void 0 : n;
|
|
705
729
|
}
|
|
706
|
-
function
|
|
730
|
+
function Pt(n, t) {
|
|
707
731
|
const e = tt(n, t);
|
|
708
732
|
if (!e) return [];
|
|
709
733
|
if (e !== n) return [e];
|
|
@@ -719,7 +743,7 @@ function ae(n, t) {
|
|
|
719
743
|
}
|
|
720
744
|
}
|
|
721
745
|
const oe = /* @__PURE__ */ Symbol("ConditionalStatementAction");
|
|
722
|
-
class U extends
|
|
746
|
+
class U extends P {
|
|
723
747
|
statement;
|
|
724
748
|
conditionalExecutor;
|
|
725
749
|
/**
|
|
@@ -736,7 +760,7 @@ class U extends T {
|
|
|
736
760
|
registrations = /* @__PURE__ */ new WeakSet();
|
|
737
761
|
constructor(t, e) {
|
|
738
762
|
super((i, r, a, o) => (this.applyIn(V(i)) || i.markRecordIncomplete(), r(i, a, o))), this.statement = t, this.conditionalExecutor = e;
|
|
739
|
-
const s = new
|
|
763
|
+
const s = new P((i, r, ...a) => (this.applyFrom(i), r(i, ...a)));
|
|
740
764
|
t.collectFields().forEach((i) => i.registerAction(s));
|
|
741
765
|
}
|
|
742
766
|
static get classIdentifier() {
|
|
@@ -758,7 +782,7 @@ class U extends T {
|
|
|
758
782
|
targetsIn(t) {
|
|
759
783
|
const e = [];
|
|
760
784
|
return this.declarations.forEach(
|
|
761
|
-
(s) =>
|
|
785
|
+
(s) => Pt(s, t).forEach((i) => {
|
|
762
786
|
this.registrations.has(i) && e.push(i);
|
|
763
787
|
})
|
|
764
788
|
), e;
|
|
@@ -791,7 +815,7 @@ class U extends T {
|
|
|
791
815
|
class le extends U {
|
|
792
816
|
constructor(t) {
|
|
793
817
|
super(t, (e, s) => {
|
|
794
|
-
e.visibility = s ?
|
|
818
|
+
e.visibility = s ? O.FULL : O.SUPPRESS;
|
|
795
819
|
});
|
|
796
820
|
}
|
|
797
821
|
}
|
|
@@ -809,7 +833,7 @@ class ce extends U {
|
|
|
809
833
|
});
|
|
810
834
|
}
|
|
811
835
|
}
|
|
812
|
-
var
|
|
836
|
+
var B = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.AND = 2] = "AND", n[n.XOR = 3] = "XOR", n[n.NAND = 4] = "NAND", n[n.NOR = 5] = "NOR", n[n.EQUALS = -1] = "EQUALS", n[n.NOT_EQUALS = -2] = "NOT_EQUALS", n[n.GT = -3] = "GT", n[n.LT = -4] = "LT", n[n.GE = -5] = "GE", n[n.LE = -6] = "LE", n[n.IN = -7] = "IN", n[n.NOT_IN = -8] = "NOT_IN", n[n.INCLUDES = -9] = "INCLUDES", n[n.NOT_INCLUDES = -10] = "NOT_INCLUDES", n))(B || {});
|
|
813
837
|
((n) => {
|
|
814
838
|
function t(r) {
|
|
815
839
|
const a = r.toLowerCase();
|
|
@@ -847,10 +871,10 @@ var N = /* @__PURE__ */ ((n) => (n[n.NOT = 0] = "NOT", n[n.OR = 1] = "OR", n[n.A
|
|
|
847
871
|
return r >= 0;
|
|
848
872
|
}
|
|
849
873
|
n.isLogicOperator = i;
|
|
850
|
-
})(
|
|
851
|
-
Object.freeze(
|
|
852
|
-
const c =
|
|
853
|
-
class
|
|
874
|
+
})(B || (B = {}));
|
|
875
|
+
Object.freeze(B);
|
|
876
|
+
const c = B, he = /* @__PURE__ */ Symbol("EnabledChangingAction");
|
|
877
|
+
class kt extends m {
|
|
854
878
|
constructor(t) {
|
|
855
879
|
super(t);
|
|
856
880
|
}
|
|
@@ -862,7 +886,7 @@ class Rt extends m {
|
|
|
862
886
|
}
|
|
863
887
|
}
|
|
864
888
|
const de = /* @__PURE__ */ Symbol("EnabledChangedAction");
|
|
865
|
-
class
|
|
889
|
+
class Rt extends m {
|
|
866
890
|
constructor(t) {
|
|
867
891
|
super(t);
|
|
868
892
|
}
|
|
@@ -886,7 +910,7 @@ class Ft extends m {
|
|
|
886
910
|
}
|
|
887
911
|
}
|
|
888
912
|
const fe = /* @__PURE__ */ Symbol("VisibilityChangingAction");
|
|
889
|
-
class
|
|
913
|
+
class _t extends m {
|
|
890
914
|
constructor(t) {
|
|
891
915
|
super(t);
|
|
892
916
|
}
|
|
@@ -1042,7 +1066,7 @@ class y {
|
|
|
1042
1066
|
const e = this.extendedOf(t);
|
|
1043
1067
|
Object.entries(t).forEach(([s, i]) => {
|
|
1044
1068
|
Object.hasOwn(e, s) || pt.has(s) || (this[s] = i);
|
|
1045
|
-
}),
|
|
1069
|
+
}), j(e) || this.setExtendedValues(e);
|
|
1046
1070
|
}
|
|
1047
1071
|
/**
|
|
1048
1072
|
* Takes this element into the record of the open transaction, where one is open. A write of a single slot that
|
|
@@ -1060,7 +1084,7 @@ class y {
|
|
|
1060
1084
|
* What is not in the snapshot is the action map, which no write touches: an operation that replaces it hands
|
|
1061
1085
|
* the transaction its own undo instead, so this stays the one shape every element captures.
|
|
1062
1086
|
*/
|
|
1063
|
-
[
|
|
1087
|
+
[k]() {
|
|
1064
1088
|
return { ...this.#e, errors: [...this.#e.errors] };
|
|
1065
1089
|
}
|
|
1066
1090
|
/**
|
|
@@ -1269,7 +1293,7 @@ class y {
|
|
|
1269
1293
|
get actions() {
|
|
1270
1294
|
const t = this.declaration;
|
|
1271
1295
|
if (!t._actions) {
|
|
1272
|
-
const e = new
|
|
1296
|
+
const e = new x();
|
|
1273
1297
|
t.boundElements.forEach((s) => {
|
|
1274
1298
|
s._actions = e;
|
|
1275
1299
|
});
|
|
@@ -1427,11 +1451,11 @@ class y {
|
|
|
1427
1451
|
set visibility(t) {
|
|
1428
1452
|
const e = this.#t.visibility;
|
|
1429
1453
|
t !== e && u((s) => {
|
|
1430
|
-
const i = this.boundActions?.trigger(
|
|
1431
|
-
if (!(i instanceof
|
|
1432
|
-
if (!
|
|
1454
|
+
const i = this.boundActions?.trigger(_t, this, t, e);
|
|
1455
|
+
if (!(i instanceof S)) {
|
|
1456
|
+
if (!O.isDefined(i ?? t))
|
|
1433
1457
|
throw new Error("visibility must be a DisplayMode constant");
|
|
1434
|
-
s.touch(this), this.#t.visibility =
|
|
1458
|
+
s.touch(this), this.#t.visibility = O.fromAny(i ?? t), this.boundActions?.trigger(jt, this, this.#t.visibility, e);
|
|
1435
1459
|
}
|
|
1436
1460
|
});
|
|
1437
1461
|
}
|
|
@@ -1441,10 +1465,10 @@ class y {
|
|
|
1441
1465
|
set enabled(t) {
|
|
1442
1466
|
const e = this.#t.enabled;
|
|
1443
1467
|
t !== e && u((s) => {
|
|
1444
|
-
const i = this.boundActions?.trigger(
|
|
1445
|
-
if (!(i instanceof
|
|
1468
|
+
const i = this.boundActions?.trigger(kt, this, t, e);
|
|
1469
|
+
if (!(i instanceof S)) {
|
|
1446
1470
|
if (!Qt(i ?? t)) throw new Error("Enabled value must be boolean");
|
|
1447
|
-
s.touch(this), this.#t.enabled = i ?? t, this.#t.enabled !== e && this.bumpValueVersion(), this.boundActions?.trigger(
|
|
1471
|
+
s.touch(this), this.#t.enabled = i ?? t, this.#t.enabled !== e && this.bumpValueVersion(), this.boundActions?.trigger(Rt, this, this.#t.enabled, e);
|
|
1448
1472
|
}
|
|
1449
1473
|
});
|
|
1450
1474
|
}
|
|
@@ -1495,7 +1519,7 @@ class y {
|
|
|
1495
1519
|
const r = this.boundActions;
|
|
1496
1520
|
if (this.composesValue && !(r?.willTrigger(Ct) || r?.hasEager)) return;
|
|
1497
1521
|
const a = this.value, o = this.#e.announcedValue;
|
|
1498
|
-
!s && (this.composesValue ?
|
|
1522
|
+
!s && (this.composesValue ? F(a, o) : a === o) || (t.touch(this), this.#e.announcedValue = a, this.composesValue && r?.triggerEager(this, a, o), r?.trigger(P, this, a, o));
|
|
1499
1523
|
}
|
|
1500
1524
|
/**
|
|
1501
1525
|
* Forms the verdict this element ends the transaction with and announces a transition of it. The container is
|
|
@@ -1523,7 +1547,7 @@ class y {
|
|
|
1523
1547
|
return this.value;
|
|
1524
1548
|
}
|
|
1525
1549
|
get isChanged() {
|
|
1526
|
-
return !
|
|
1550
|
+
return !F(this.value, this.originalValue);
|
|
1527
1551
|
}
|
|
1528
1552
|
/**
|
|
1529
1553
|
* Brings a fresh element into the state a binding of `source` is in: it records what it was declared as, takes
|
|
@@ -1536,7 +1560,7 @@ class y {
|
|
|
1536
1560
|
boundFrom(t, e, s, i) {
|
|
1537
1561
|
this.#e.declaration = t.declaration;
|
|
1538
1562
|
const r = { ...t.extra, ...i && this.extendedOf(i) };
|
|
1539
|
-
|
|
1563
|
+
j(r) || this.setExtendedValues(r);
|
|
1540
1564
|
const a = this.declaration;
|
|
1541
1565
|
a.noteBinding(this);
|
|
1542
1566
|
const o = a._actions;
|
|
@@ -1775,7 +1799,7 @@ function Dt() {
|
|
|
1775
1799
|
originalValue: void 0,
|
|
1776
1800
|
announcedValue: void 0,
|
|
1777
1801
|
errors: [],
|
|
1778
|
-
visibility:
|
|
1802
|
+
visibility: O.FULL,
|
|
1779
1803
|
enabled: !0,
|
|
1780
1804
|
valueVersion: 0,
|
|
1781
1805
|
validatingCount: 0,
|
|
@@ -1944,7 +1968,8 @@ class Se extends et {
|
|
|
1944
1968
|
*
|
|
1945
1969
|
* The answer is a promise whatever the handler returns, so a handler that throws rejects it rather than throwing
|
|
1946
1970
|
* out of this call: a caller that does not await the answer and does not attach a catch handler leaves that
|
|
1947
|
-
* rejection unhandled.
|
|
1971
|
+
* rejection unhandled. An `AbortEventHandlingException` is the one exception that does not reject: the answer
|
|
1972
|
+
* resolves with it, in a synchronous chain as in an asynchronous one.
|
|
1948
1973
|
*/
|
|
1949
1974
|
async execute(t) {
|
|
1950
1975
|
const e = this.busyRuns;
|
|
@@ -2020,22 +2045,22 @@ const xe = /* @__PURE__ */ qt({
|
|
|
2020
2045
|
"dt",
|
|
2021
2046
|
"dd"
|
|
2022
2047
|
]), i = () => {
|
|
2023
|
-
if (typeof t.message == "string") return
|
|
2048
|
+
if (typeof t.message == "string") return R("span", { class: t.classes }, t.message);
|
|
2024
2049
|
const r = [];
|
|
2025
2050
|
return t.message.forEach((a) => {
|
|
2026
2051
|
switch (a.componentName) {
|
|
2027
2052
|
case "template":
|
|
2028
|
-
r.push(
|
|
2053
|
+
r.push(R("div", { class: [t.classes, a.extraClasses] }, a.componentBody));
|
|
2029
2054
|
break;
|
|
2030
2055
|
case "vue-markdown":
|
|
2031
2056
|
if (typeof e == "string")
|
|
2032
2057
|
console.warn(
|
|
2033
2058
|
"You are using markdown for messages-widget, but you haven't registered a vue-markdown component"
|
|
2034
|
-
), r.push(
|
|
2059
|
+
), r.push(R("div", { class: [t.classes, a.extraClasses] }, a.componentBindings.source));
|
|
2035
2060
|
else {
|
|
2036
2061
|
const o = a.componentBindings;
|
|
2037
2062
|
r.push(
|
|
2038
|
-
|
|
2063
|
+
R(e, {
|
|
2039
2064
|
class: [t.classes, a.extraClasses, "df-messages-widget-markdown"],
|
|
2040
2065
|
source: o.source,
|
|
2041
2066
|
options: o.options,
|
|
@@ -2046,7 +2071,7 @@ const xe = /* @__PURE__ */ qt({
|
|
|
2046
2071
|
break;
|
|
2047
2072
|
default:
|
|
2048
2073
|
r.push(
|
|
2049
|
-
|
|
2074
|
+
R(
|
|
2050
2075
|
s.has(a.componentName.toLowerCase()) ? a.componentName : lt(a.componentName),
|
|
2051
2076
|
{
|
|
2052
2077
|
class: [t.classes, a.extraClasses],
|
|
@@ -2111,8 +2136,8 @@ class d extends y {
|
|
|
2111
2136
|
* The name array is copied as well: a rollback puts back the set of members the group held, not the array it
|
|
2112
2137
|
* went on to hold.
|
|
2113
2138
|
*/
|
|
2114
|
-
[
|
|
2115
|
-
const t = super[
|
|
2139
|
+
[k]() {
|
|
2140
|
+
const t = super[k]();
|
|
2116
2141
|
return t.fieldNames = [...this.raw.fieldNames], t;
|
|
2117
2142
|
}
|
|
2118
2143
|
/**
|
|
@@ -2210,9 +2235,9 @@ class d extends y {
|
|
|
2210
2235
|
const e = /* @__PURE__ */ Object.create(null);
|
|
2211
2236
|
Object.entries(this._fields).forEach(([i, r]) => {
|
|
2212
2237
|
const a = r.value;
|
|
2213
|
-
(r.enabled || this.childComposesValue(r) && !
|
|
2238
|
+
(r.enabled || this.childComposesValue(r) && !j(a)) && (e[i] = a);
|
|
2214
2239
|
});
|
|
2215
|
-
const s =
|
|
2240
|
+
const s = j(e) ? null : Object.freeze({ ...e });
|
|
2216
2241
|
return this.raw.cachedValue = s, this.raw.cachedValueVersion = t, s;
|
|
2217
2242
|
}
|
|
2218
2243
|
/**
|
|
@@ -2355,8 +2380,8 @@ class _ extends y {
|
|
|
2355
2380
|
});
|
|
2356
2381
|
}
|
|
2357
2382
|
/** The row array is copied as well: a rollback puts back the set the list held, not the array it went on to hold. */
|
|
2358
|
-
[
|
|
2359
|
-
const t = super[
|
|
2383
|
+
[k]() {
|
|
2384
|
+
const t = super[k]();
|
|
2360
2385
|
return t.rows = this.raw.rows ? [...this.raw.rows] : this.raw.rows, t;
|
|
2361
2386
|
}
|
|
2362
2387
|
/**
|
|
@@ -2409,7 +2434,7 @@ class _ extends y {
|
|
|
2409
2434
|
get value() {
|
|
2410
2435
|
const t = this.valueVersion;
|
|
2411
2436
|
if (this.raw.cachedValueVersion === t) return this.raw.cachedValue;
|
|
2412
|
-
const e = this.state.rows?.map((i) => i.value), s =
|
|
2437
|
+
const e = this.state.rows?.map((i) => i.value), s = j(e) ? null : Object.freeze(e);
|
|
2413
2438
|
return this.raw.cachedValue = s, this.raw.cachedValueVersion = t, s;
|
|
2414
2439
|
}
|
|
2415
2440
|
set value(t) {
|
|
@@ -2606,11 +2631,11 @@ class Ie extends f {
|
|
|
2606
2631
|
*/
|
|
2607
2632
|
listenOn(t) {
|
|
2608
2633
|
this.listening.has(t) || this.listening.has(t.declaration) || (this.listening.add(t), t.registerAction(
|
|
2609
|
-
new
|
|
2634
|
+
new P((e, s, i, r) => {
|
|
2610
2635
|
s(e, i, r);
|
|
2611
2636
|
const a = V(e);
|
|
2612
2637
|
this.declarations.forEach(
|
|
2613
|
-
(o) =>
|
|
2638
|
+
(o) => Pt(o, a).forEach((l) => {
|
|
2614
2639
|
this.registrations.has(l) && this.execute(l, () => null, l.value, this.comparisonState(l).oldValue);
|
|
2615
2640
|
})
|
|
2616
2641
|
);
|
|
@@ -2663,7 +2688,7 @@ function Oe(n) {
|
|
|
2663
2688
|
function wt(n) {
|
|
2664
2689
|
return typeof n == "object" && n !== null && !Vt(n) && !(n instanceof String) && !("componentName" in n);
|
|
2665
2690
|
}
|
|
2666
|
-
class
|
|
2691
|
+
class Pe extends f {
|
|
2667
2692
|
constructor(t, e) {
|
|
2668
2693
|
const s = wt(t) ? void 0 : t, i = (wt(t) ? t : e)?.trim ?? !0, r = s || b("Please enter a value"), a = (o, l, v) => {
|
|
2669
2694
|
const p = h(o);
|
|
@@ -2678,7 +2703,7 @@ class ke extends f {
|
|
|
2678
2703
|
super(a);
|
|
2679
2704
|
}
|
|
2680
2705
|
}
|
|
2681
|
-
class
|
|
2706
|
+
class ke extends f {
|
|
2682
2707
|
constructor(t, e) {
|
|
2683
2708
|
const s = e || b("Value must be larger or equal to **{minValue}**"), i = (r, a, o) => r < t || r === void 0 ? [
|
|
2684
2709
|
new g(
|
|
@@ -2690,7 +2715,7 @@ class Re extends f {
|
|
|
2690
2715
|
super(i);
|
|
2691
2716
|
}
|
|
2692
2717
|
}
|
|
2693
|
-
class
|
|
2718
|
+
class Re extends f {
|
|
2694
2719
|
constructor(t, e) {
|
|
2695
2720
|
const s = e || b("Value must be less than or equal to **{maxValue}**"), i = (r, a, o) => r > t || r === void 0 ? [
|
|
2696
2721
|
new g(
|
|
@@ -2717,7 +2742,7 @@ class Fe extends f {
|
|
|
2717
2742
|
function st(n) {
|
|
2718
2743
|
return n == null ? 0 : yt(n) || C(n) ? n.length : Et(n) && Object.getPrototypeOf(n) === Object.prototype ? Object.keys(n).length : String(n).length;
|
|
2719
2744
|
}
|
|
2720
|
-
class
|
|
2745
|
+
class _e extends f {
|
|
2721
2746
|
constructor(t, e) {
|
|
2722
2747
|
const s = e || b("Length must be larger or equal to **{minLength}**"), i = (r, a, o) => st(r) < t ? [
|
|
2723
2748
|
new g(
|
|
@@ -2774,25 +2799,25 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2774
2799
|
InAllowedValues: Te,
|
|
2775
2800
|
LengthInRange: Ne,
|
|
2776
2801
|
MaxLength: je,
|
|
2777
|
-
MaxValue:
|
|
2778
|
-
MinLength:
|
|
2779
|
-
MinValue:
|
|
2802
|
+
MaxValue: Re,
|
|
2803
|
+
MinLength: _e,
|
|
2804
|
+
MinValue: ke,
|
|
2780
2805
|
Pattern: Be,
|
|
2781
|
-
Required:
|
|
2806
|
+
Required: Pe,
|
|
2782
2807
|
Validator: f,
|
|
2783
2808
|
ValueInRange: Fe
|
|
2784
2809
|
}, Symbol.toStringTag, { value: "Module" })), $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2785
2810
|
__proto__: null,
|
|
2786
|
-
AbortEventHandlingException:
|
|
2811
|
+
AbortEventHandlingException: S,
|
|
2787
2812
|
Action: Se,
|
|
2788
|
-
ActionsMap:
|
|
2813
|
+
ActionsMap: x,
|
|
2789
2814
|
ConditionalEnabledAction: ue,
|
|
2790
2815
|
ConditionalStatementAction: U,
|
|
2791
2816
|
ConditionalValueAction: ce,
|
|
2792
2817
|
ConditionalVisibilityAction: le,
|
|
2793
|
-
DisplayMode:
|
|
2794
|
-
EnabledChangedAction:
|
|
2795
|
-
EnabledChangingAction:
|
|
2818
|
+
DisplayMode: O,
|
|
2819
|
+
EnabledChangedAction: Rt,
|
|
2820
|
+
EnabledChangingAction: kt,
|
|
2796
2821
|
ExecuteAction: Nt,
|
|
2797
2822
|
Field: et,
|
|
2798
2823
|
FieldActionBase: m,
|
|
@@ -2801,7 +2826,7 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2801
2826
|
List: _,
|
|
2802
2827
|
ListItemAddedAction: Y,
|
|
2803
2828
|
ListItemRemovedAction: Bt,
|
|
2804
|
-
MdString:
|
|
2829
|
+
MdString: N,
|
|
2805
2830
|
MessagesWidget: xe,
|
|
2806
2831
|
Operator: c,
|
|
2807
2832
|
RenderableValue: se,
|
|
@@ -2811,26 +2836,26 @@ const De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2811
2836
|
ValidationErrorRenderContent: g,
|
|
2812
2837
|
ValidationErrorText: ee,
|
|
2813
2838
|
Validators: De,
|
|
2814
|
-
ValueChangedAction:
|
|
2839
|
+
ValueChangedAction: P,
|
|
2815
2840
|
VisibilityChangedAction: jt,
|
|
2816
|
-
VisibilityChangingAction:
|
|
2841
|
+
VisibilityChangingAction: _t,
|
|
2817
2842
|
buildErrorMessage: b,
|
|
2818
2843
|
defaultDisplayMode: Kt,
|
|
2819
|
-
isCallableFunction:
|
|
2844
|
+
isCallableFunction: M,
|
|
2820
2845
|
isSimpleComponentDef: Z,
|
|
2821
2846
|
transaction: J
|
|
2822
2847
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2823
2848
|
export {
|
|
2824
|
-
|
|
2849
|
+
S as AbortEventHandlingException,
|
|
2825
2850
|
Se as Action,
|
|
2826
|
-
|
|
2851
|
+
x as ActionsMap,
|
|
2827
2852
|
ue as ConditionalEnabledAction,
|
|
2828
2853
|
U as ConditionalStatementAction,
|
|
2829
2854
|
ce as ConditionalValueAction,
|
|
2830
2855
|
le as ConditionalVisibilityAction,
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2856
|
+
O as DisplayMode,
|
|
2857
|
+
Rt as EnabledChangedAction,
|
|
2858
|
+
kt as EnabledChangingAction,
|
|
2834
2859
|
Nt as ExecuteAction,
|
|
2835
2860
|
et as Field,
|
|
2836
2861
|
m as FieldActionBase,
|
|
@@ -2839,7 +2864,7 @@ export {
|
|
|
2839
2864
|
_ as List,
|
|
2840
2865
|
Y as ListItemAddedAction,
|
|
2841
2866
|
Bt as ListItemRemovedAction,
|
|
2842
|
-
|
|
2867
|
+
N as MdString,
|
|
2843
2868
|
xe as MessagesWidget,
|
|
2844
2869
|
c as Operator,
|
|
2845
2870
|
se as RenderableValue,
|
|
@@ -2849,15 +2874,15 @@ export {
|
|
|
2849
2874
|
g as ValidationErrorRenderContent,
|
|
2850
2875
|
ee as ValidationErrorText,
|
|
2851
2876
|
De as Validators,
|
|
2852
|
-
|
|
2877
|
+
P as ValueChangedAction,
|
|
2853
2878
|
jt as VisibilityChangedAction,
|
|
2854
|
-
|
|
2879
|
+
_t as VisibilityChangingAction,
|
|
2855
2880
|
b as buildErrorMessage,
|
|
2856
2881
|
$e as default,
|
|
2857
2882
|
Kt as defaultDisplayMode,
|
|
2858
2883
|
Ue as forms,
|
|
2859
2884
|
Gt as getConfig,
|
|
2860
|
-
|
|
2885
|
+
M as isCallableFunction,
|
|
2861
2886
|
Z as isSimpleComponentDef,
|
|
2862
2887
|
te as setConfig,
|
|
2863
2888
|
J as transaction
|