@bach.software/vue-dynamic-form 0.7.0 → 0.8.0

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.
Files changed (31) hide show
  1. package/dist/examples.cjs.js +8 -8
  2. package/dist/examples.cjs.js.map +1 -1
  3. package/dist/examples.es.js +689 -542
  4. package/dist/examples.es.js.map +1 -1
  5. package/dist/mapEachMetadataItem-CZmoxEoA.js +1234 -0
  6. package/dist/mapEachMetadataItem-CZmoxEoA.js.map +1 -0
  7. package/dist/mapEachMetadataItem-Dw1U9jf2.cjs +2 -0
  8. package/dist/mapEachMetadataItem-Dw1U9jf2.cjs.map +1 -0
  9. package/dist/src/components/__tests__/DynamicFormItem.test-helpers.d.ts +8 -0
  10. package/dist/src/components/__tests__/DynamicFormItemArray.test-helpers.d.ts +2 -0
  11. package/dist/src/components/__tests__/DynamicFormItemChoice.test-helpers.d.ts +9 -0
  12. package/dist/src/examples/__tests__/TestFormTemplate.testcases.d.ts +233 -0
  13. package/dist/src/index.d.ts +1 -0
  14. package/dist/src/types/FieldMetadata.d.ts +32 -1
  15. package/dist/src/utils/__tests__/deepEqual.test.d.ts +1 -0
  16. package/dist/src/utils/__tests__/hashField.test.d.ts +1 -0
  17. package/dist/src/utils/__tests__/isPathInSection.test.d.ts +1 -0
  18. package/dist/src/utils/buildRestrictionValidations.d.ts +11 -0
  19. package/dist/src/utils/deepEqual.d.ts +9 -0
  20. package/dist/src/utils/isPathInSection.d.ts +9 -0
  21. package/dist/src/utils/removeNullValues.d.ts +4 -0
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/vue-dynamic-form.cjs.js +1 -1
  24. package/dist/vue-dynamic-form.cjs.js.map +1 -1
  25. package/dist/vue-dynamic-form.es.js +22 -21
  26. package/dist/vue-dynamic-form.es.js.map +1 -1
  27. package/package.json +2 -1
  28. package/dist/mapEachMetadataItem-DwSDJyzo.cjs +0 -2
  29. package/dist/mapEachMetadataItem-DwSDJyzo.cjs.map +0 -1
  30. package/dist/mapEachMetadataItem-DxEO1PDs.js +0 -1186
  31. package/dist/mapEachMetadataItem-DxEO1PDs.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { defineComponent as E, createElementBlock as i, openBlock as t, normalizeClass as O, createCommentVNode as n, createElementVNode as a, createBlock as W, unref as F, withCtx as k, withDirectives as N, vModelText as K, vModelCheckbox as D, Fragment as $, renderList as A, toDisplayString as o, vModelSelect as Q, renderSlot as T, createTextVNode as x, createVNode as R, vShow as Y, computed as U, ref as L, withModifiers as Z, markRaw as X, h as M, useTemplateRef as ee } from "vue";
2
- import { e as te, f as ie, u as ae, m as le, _ as ne, i as se } from "./mapEachMetadataItem-DxEO1PDs.js";
3
- const oe = {
1
+ import { defineComponent as q, createElementBlock as i, openBlock as t, normalizeClass as g, createCommentVNode as n, createElementVNode as a, createBlock as A, unref as F, withCtx as C, withDirectives as E, vModelText as Y, vModelCheckbox as D, Fragment as $, renderList as B, toDisplayString as o, vModelSelect as X, renderSlot as V, createTextVNode as w, createVNode as z, vShow as M, computed as U, ref as N, withModifiers as ee, markRaw as te, h as ie, useTemplateRef as ae } from "vue";
2
+ import { e as le, f as ne, u as se, m as oe, _ as de, i as re } from "./mapEachMetadataItem-CZmoxEoA.js";
3
+ const ce = {
4
4
  key: 0,
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  fill: "none",
@@ -8,7 +8,7 @@ const oe = {
8
8
  "stroke-width": "1.5",
9
9
  stroke: "currentColor",
10
10
  class: "size-3"
11
- }, de = {
11
+ }, ue = {
12
12
  key: 1,
13
13
  xmlns: "http://www.w3.org/2000/svg",
14
14
  fill: "none",
@@ -16,30 +16,30 @@ const oe = {
16
16
  "stroke-width": "1.5",
17
17
  stroke: "currentColor",
18
18
  class: "size-3"
19
- }, S = /* @__PURE__ */ E({
19
+ }, W = /* @__PURE__ */ q({
20
20
  __name: "IconButton",
21
21
  props: {
22
22
  icon: {},
23
23
  color: { default: "blue" }
24
24
  },
25
25
  emits: ["click"],
26
- setup(u) {
27
- return (h, d) => (t(), i("button", {
26
+ setup(s) {
27
+ return (r, f) => (t(), i("button", {
28
28
  type: "button",
29
- class: O(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
30
- "bg-blue-200 hover:bg-blue-300": u.color === "blue",
31
- "bg-red-200 hover:bg-red-300": u.color === "red"
29
+ class: g(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
30
+ "bg-blue-200 hover:bg-blue-300": s.color === "blue",
31
+ "bg-red-200 hover:bg-red-300": s.color === "red"
32
32
  }]),
33
- onClick: d[0] || (d[0] = (c) => h.$emit("click"))
33
+ onClick: f[0] || (f[0] = (h) => r.$emit("click"))
34
34
  }, [
35
- u.icon === "plus" ? (t(), i("svg", oe, [...d[1] || (d[1] = [
35
+ s.icon === "plus" ? (t(), i("svg", ce, [...f[1] || (f[1] = [
36
36
  a("path", {
37
37
  "stroke-linecap": "round",
38
38
  "stroke-linejoin": "round",
39
39
  d: "M12 4.5v15m7.5-7.5h-15"
40
40
  }, null, -1)
41
41
  ])])) : n("", !0),
42
- u.icon === "minus" ? (t(), i("svg", de, [...d[2] || (d[2] = [
42
+ s.icon === "minus" ? (t(), i("svg", ue, [...f[2] || (f[2] = [
43
43
  a("path", {
44
44
  "stroke-linecap": "round",
45
45
  "stroke-linejoin": "round",
@@ -48,598 +48,604 @@ const oe = {
48
48
  ])])) : n("", !0)
49
49
  ], 2));
50
50
  }
51
- }), re = ["data-testid", "onClick"], ce = { class: "text-sm whitespace-pre-wrap" }, ue = ["data-testid"], pe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, me = {
51
+ }), pe = ["data-testid", "onClick"], me = { class: "text-sm whitespace-pre-wrap" }, he = ["data-testid"], be = {
52
+ key: 2,
53
+ class: "grid grid-cols-1 md:grid-cols-2 gap-6"
54
+ }, fe = {
52
55
  key: 0,
53
56
  class: "text-red-500 dark:text-rose-400"
54
- }, he = {
57
+ }, Oe = {
55
58
  key: 1,
56
59
  class: "text-sm text-gray-400"
57
- }, be = ["data-testid"], fe = {
60
+ }, ye = ["data-testid"], ge = {
58
61
  key: 0,
59
62
  class: "flex gap-2 flex-wrap"
60
- }, Oe = ["disabled", "data-testid", "onClick"], ge = ["data-testid", "onClick"], ye = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, xe = { class: "text-sm whitespace-pre-wrap" }, ve = ["data-testid"], we = {
63
+ }, ve = ["disabled", "data-testid", "onClick"], xe = ["data-testid", "onClick"], we = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ke = { class: "text-sm whitespace-pre-wrap" }, Ce = ["data-testid"], Te = {
61
64
  key: 0,
62
65
  class: "text-red-500 dark:text-rose-400"
63
- }, ke = {
66
+ }, Ve = {
64
67
  key: 1,
65
68
  class: "text-sm text-gray-400"
66
- }, Ce = ["data-testid"], Te = {
69
+ }, Se = ["data-testid"], _e = {
67
70
  key: 0,
68
71
  class: "flex gap-2 flex-wrap"
69
- }, Ve = ["disabled", "data-testid", "onClick"], _e = ["data-testid", "onClick"], Se = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, We = { class: "text-sm whitespace-pre-wrap" }, Fe = ["data-testid"], $e = { class: "flex gap-2 items-center" }, Ae = ["data-testid"], Be = ["data-testid"], Ne = ["data-testid"], Pe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, qe = { class: "flex flex-col gap-2" }, Le = { class: "flex gap-2 flex-wrap" }, Ee = ["data-testid", "onClick"], Ie = { class: "flex gap-2" }, ze = ["data-testid", "onClick"], Re = ["data-testid", "onClick"], Ue = ["data-testid"], De = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, Je = ["data-testid"], Ge = ["data-testid"], je = ["data-testid"], He = ["data-testid"], Ke = ["data-testid"], Qe = ["data-testid"], Ye = ["data-testid"], Ze = ["data-testid", "data-current"], Xe = ["data-testid", "data-current"], Me = ["for"], et = {
72
+ }, We = ["disabled", "data-testid", "onClick"], Ae = ["data-testid", "onClick"], Fe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, $e = { class: "text-sm whitespace-pre-wrap" }, Be = ["data-testid"], Ne = { class: "flex gap-2 items-center" }, Pe = ["data-testid"], Le = ["data-testid"], Ee = ["data-testid"], qe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, Re = { class: "flex flex-col gap-2" }, Ie = { class: "flex gap-2 flex-wrap" }, ze = ["data-testid", "onClick"], Ue = { class: "flex gap-2" }, De = ["data-testid", "onClick"], Ge = ["data-testid", "onClick"], Je = ["data-testid"], je = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, He = ["data-testid"], Ke = ["data-testid"], Ze = ["data-testid"], Qe = ["data-testid"], Ye = ["data-testid"], Xe = ["data-testid"], Me = ["data-testid"], et = ["data-testid", "data-current"], tt = ["data-testid", "data-current"], it = ["for"], at = {
70
73
  key: 0,
71
74
  class: "text-red-500 dark:text-rose-400"
72
- }, tt = {
75
+ }, lt = {
73
76
  key: 1,
74
77
  class: "text-sm text-gray-400"
75
- }, it = { class: "text-sm whitespace-pre-wrap" }, at = ["data-testid"], lt = ["for"], nt = {
78
+ }, nt = { class: "text-sm whitespace-pre-wrap" }, st = ["data-testid"], ot = ["for"], dt = {
76
79
  key: 0,
77
80
  class: "text-red-500 dark:text-rose-400"
78
- }, st = {
81
+ }, rt = {
79
82
  key: 1,
80
83
  class: "text-sm text-gray-400"
81
- }, ot = { class: "flex gap-2 items-center" }, dt = { class: "flex flex-col grow" }, rt = { class: "text-sm whitespace-pre-wrap" }, ct = ["data-testid"], ut = {
84
+ }, ct = { class: "flex gap-2 items-center" }, ut = { class: "flex flex-col grow" }, pt = { class: "text-sm whitespace-pre-wrap" }, mt = ["data-testid"], ht = {
82
85
  key: 0,
83
86
  class: "text-red-500 dark:text-rose-400"
84
- }, pt = {
87
+ }, bt = {
85
88
  key: 1,
86
89
  class: "text-sm text-gray-400"
87
- }, mt = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ht = { class: "text-sm whitespace-pre-wrap" }, bt = ["data-testid"], ft = {
90
+ }, ft = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, Ot = { class: "text-sm whitespace-pre-wrap" }, yt = ["data-testid"], gt = {
88
91
  key: 0,
89
92
  class: "text-red-500 dark:text-rose-400"
90
- }, Ot = {
93
+ }, vt = {
91
94
  key: 1,
92
95
  class: "text-sm text-gray-400"
93
- }, gt = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, yt = { class: "text-sm whitespace-pre-wrap" }, xt = ["data-testid"], vt = ["id", "value", "disabled", "onChange", "onBlur"], wt = ["value"], kt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ct = ["value"], Tt = ["id", "checked", "disabled", "onChange", "onBlur"], Vt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], _t = ["id", "onUpdate:modelValue", "disabled", "onBlur"], St = ["id", "value", "disabled", "onInput", "onBlur"], q = "inline-flex items-center h-9 px-3 text-sm border border-gray-300 rounded bg-gray-100 text-gray-900 cursor-pointer hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", Wt = "inline-flex items-center h-9 px-3 text-sm border border-blue-600 rounded bg-blue-600 text-white cursor-pointer hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed", Ft = /* @__PURE__ */ E({
96
+ }, xt = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, wt = { class: "text-sm whitespace-pre-wrap" }, kt = ["data-testid"], Ct = ["id", "value", "disabled", "onChange", "onBlur"], Tt = ["value"], Vt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], St = ["value"], _t = ["id", "checked", "disabled", "onChange", "onBlur"], Wt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], At = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ft = ["id", "value", "disabled", "onInput", "onBlur"], I = "inline-flex items-center h-9 px-3 text-sm border border-gray-300 rounded bg-gray-100 text-gray-900 cursor-pointer hover:bg-gray-200 disabled:opacity-50 disabled:cursor-not-allowed", K = "inline-flex items-center h-9 px-3 text-sm border border-blue-600 rounded bg-blue-600 text-white cursor-pointer hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed", $t = /* @__PURE__ */ q({
94
97
  __name: "TestFormTemplate",
95
- setup(u) {
96
- const h = ie();
97
- return (d, c) => (t(), W(te, { "metadata-configuration": F(h) }, {
98
- heading: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, canAddItems: s, addItem: f, canRemoveItems: y, removeItem: b, slotProps: v }) => [
98
+ setup(s) {
99
+ const r = ne();
100
+ function f(h, m) {
101
+ return h.some((e) => e.branchKey === m) ? K : I;
102
+ }
103
+ return (h, m) => (t(), A(le, { "metadata-configuration": F(r) }, {
104
+ heading: C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, canAddItems: d, addItem: y, canRemoveItems: b, removeItem: x, slotProps: k }) => [
99
105
  e.hidden ? n("", !0) : (t(), i("div", {
100
106
  key: 0,
101
- class: O(["mt-4", { "md:col-span-2": e.fullWidth }])
107
+ class: g(["mt-4", { "md:col-span-2": e.fullWidth }])
102
108
  }, [
103
- r ? (t(), i("h3", {
109
+ u ? (t(), i("h3", {
104
110
  key: 0,
105
- class: O(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || p }])
111
+ class: g(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || c }])
106
112
  }, [
107
- x(o(r) + " ", 1),
108
- s ? (t(), W(S, {
113
+ w(o(u) + " ", 1),
114
+ d ? (t(), A(W, {
109
115
  key: 0,
110
116
  icon: "plus",
111
117
  tabindex: "-1",
112
118
  "data-testid": `${e.path}-add-button`,
113
- onClick: f
119
+ onClick: y
114
120
  }, null, 8, ["data-testid", "onClick"])) : n("", !0),
115
- y ? (t(), W(S, {
121
+ b ? (t(), A(W, {
116
122
  key: 1,
117
123
  icon: "minus",
118
124
  tabindex: "-1",
119
125
  color: "red",
120
126
  "data-testid": `${e.path}-remove-button`,
121
- onClick: b
127
+ onClick: x
122
128
  }, null, 8, ["data-testid", "onClick"])) : n("", !0),
123
- v?.gotoStep ? (t(), i("button", {
129
+ k?.gotoStep ? (t(), i("button", {
124
130
  key: 2,
125
131
  type: "button",
126
132
  "data-testid": `${e.path}-goto-first-step-button`,
127
- onClick: (V) => v.gotoStep(0)
128
- }, " back to start ", 8, re)) : n("", !0)
133
+ onClick: (S) => k.gotoStep(0)
134
+ }, " back to start ", 8, pe)) : n("", !0)
129
135
  ], 2)) : n("", !0),
130
- a("pre", ce, o(e.description), 1),
136
+ a("pre", me, o(e.description), 1),
131
137
  l.value ? (t(), i("span", {
132
138
  key: 1,
133
139
  class: "text-red-600 text-sm",
134
140
  "data-testid": `${e.path}-error-message`
135
- }, o(l.value), 9, ue)) : n("", !0),
136
- a("div", pe, [
137
- T(d.$slots, "default", {
138
- level: (v?.level ?? 0) + 1
141
+ }, o(l.value), 9, he)) : n("", !0),
142
+ e.children?.length ? (t(), i("div", be, [
143
+ V(h.$slots, "default", {
144
+ level: (k?.level ?? 0) + 1
139
145
  })
140
- ])
146
+ ])) : n("", !0)
141
147
  ], 2))
142
148
  ]),
143
- "heading-array": k(({ fieldMetadata: e, fieldContext: { label: l }, disabled: r, canAddItems: p, addItem: s, slotProps: f }) => [
149
+ "heading-array": C(({ fieldMetadata: e, fieldContext: { label: l }, disabled: u, canAddItems: c, addItem: d, slotProps: y }) => [
144
150
  e.hidden ? n("", !0) : (t(), i("div", {
145
151
  key: 0,
146
- class: O(["mt-4 flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
152
+ class: g(["mt-4 flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
147
153
  }, [
148
154
  l ? (t(), i("h3", {
149
155
  key: 0,
150
- class: O(["flex text-xl font-bold gap-2 items-center", { "text-gray-500": e.disabled || r }])
156
+ class: g(["flex text-xl font-bold gap-2 items-center", { "text-gray-500": e.disabled || u }])
151
157
  }, [
152
- x(o(l) + " ", 1),
153
- p ? (t(), W(S, {
158
+ w(o(l) + " ", 1),
159
+ c ? (t(), A(W, {
154
160
  key: 0,
155
161
  icon: "plus",
156
162
  tabindex: "-1",
157
163
  "data-testid": `${e.path}-add-button`,
158
- onClick: s
164
+ onClick: d
159
165
  }, null, 8, ["data-testid", "onClick"])) : n("", !0)
160
166
  ], 2)) : n("", !0),
161
- T(d.$slots, "default", {
167
+ V(h.$slots, "default", {
162
168
  hideLabel: !0,
163
- level: (f?.level ?? 0) + 1
169
+ level: (y?.level ?? 0) + 1
164
170
  })
165
171
  ], 2))
166
172
  ]),
167
- "default-choice": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, slotProps: f, settings: { showOptionalInsteadOfRequired: y }, addChoiceOccurrence: b, removeChoiceOccurrence: v, canAddChoiceOccurrence: V, usedChoiceOccurrences: _ }) => [
173
+ "default-choice": C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, slotProps: y, settings: { showOptionalInsteadOfRequired: b }, addChoiceOccurrence: x, removeChoiceOccurrence: k, canAddChoiceOccurrence: S, usedChoiceOccurrences: _, activeChoiceOccurrences: P }) => [
168
174
  e.hidden ? n("", !0) : (t(), i("div", {
169
175
  key: 0,
170
- class: O(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
176
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
171
177
  }, [
172
178
  a("span", {
173
- class: O(["flex gap-2 items-center", { "text-gray-500": p }])
179
+ class: g(["flex gap-2 items-center", { "text-gray-500": c }])
174
180
  }, [
175
- x(o(r) + " ", 1),
176
- s && !y ? (t(), i("span", me, "*")) : n("", !0),
177
- !s && y ? (t(), i("span", he, "(optional)")) : n("", !0)
181
+ w(o(u) + " ", 1),
182
+ d && !b ? (t(), i("span", fe, "*")) : n("", !0),
183
+ !d && b ? (t(), i("span", Oe, "(optional)")) : n("", !0)
178
184
  ], 2),
179
185
  a("div", null, [
180
- c[0] || (c[0] = x("Used choice occurrences: ", -1)),
186
+ m[0] || (m[0] = w("Used choice occurrences: ", -1)),
181
187
  a("span", {
182
188
  "data-testid": `${e.path}-used-choice-occurrences`
183
- }, o(_), 9, be)
189
+ }, o(_), 9, ye)
184
190
  ]),
185
- e.choice?.length ? (t(), i("div", fe, [
186
- (t(!0), i($, null, A(e.choice, (g) => (t(), i("button", {
187
- key: `${g.name}-add`,
191
+ e.choice?.length ? (t(), i("div", ge, [
192
+ (t(!0), i($, null, B(e.choice, (O) => (t(), i("button", {
193
+ key: `${O.name}-add`,
188
194
  type: "button",
189
- class: O(q),
190
- disabled: !V(g.name),
191
- "data-testid": `${e.path}.${g.name}-add-choice-button`,
192
- onClick: (B) => b(g.name)
193
- }, " Add " + o(g.name), 9, Oe))), 128)),
194
- (t(!0), i($, null, A(e.choice, (g) => (t(), i("button", {
195
- key: `${g.name}-remove`,
195
+ class: g(f(P, O.name)),
196
+ disabled: !S(O.name),
197
+ "data-testid": `${e.path}.${O.name}-add-choice-button`,
198
+ onClick: (v) => x(O.name)
199
+ }, " Add " + o(O.name), 11, ve))), 128)),
200
+ (t(!0), i($, null, B(e.choice, (O) => (t(), i("button", {
201
+ key: `${O.name}-remove`,
196
202
  type: "button",
197
- class: O(q),
198
- "data-testid": `${e.path}.${g.name}-remove-choice-button`,
199
- onClick: (B) => v(g.name)
200
- }, " Remove " + o(g.name), 9, ge))), 128))
203
+ class: g(I),
204
+ "data-testid": `${e.path}.${O.name}-remove-choice-button`,
205
+ onClick: (v) => k(O.name)
206
+ }, " Remove " + o(O.name), 9, xe))), 128))
201
207
  ])) : n("", !0),
202
- a("div", ye, [
203
- T(d.$slots, "default", {
204
- level: (f?.level ?? 0) + 1,
208
+ a("div", we, [
209
+ V(h.$slots, "default", {
210
+ level: (y?.level ?? 0) + 1,
205
211
  belowChoiceField: !0
206
212
  })
207
213
  ]),
208
- a("pre", xe, o(e.description), 1),
214
+ a("pre", ke, o(e.description), 1),
209
215
  l.value ? (t(), i("span", {
210
216
  key: 1,
211
217
  class: "text-red-600 text-sm",
212
218
  "data-testid": `${e.path}-error-message`
213
- }, o(l.value), 9, ve)) : n("", !0)
219
+ }, o(l.value), 9, Ce)) : n("", !0)
214
220
  ], 2))
215
221
  ]),
216
- "default-choice-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, slotProps: f, settings: { showOptionalInsteadOfRequired: y }, addChoiceOccurrence: b, removeChoiceOccurrence: v, canAddChoiceOccurrence: V, usedChoiceOccurrences: _ }) => [
222
+ "default-choice-array": C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, slotProps: y, settings: { showOptionalInsteadOfRequired: b }, addChoiceOccurrence: x, removeChoiceOccurrence: k, canAddChoiceOccurrence: S, usedChoiceOccurrences: _, activeChoiceOccurrences: P }) => [
217
223
  e.hidden ? n("", !0) : (t(), i("div", {
218
224
  key: 0,
219
- class: O(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
225
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
220
226
  }, [
221
227
  a("span", {
222
- class: O(["flex gap-2 items-center", { "text-gray-500": p }])
228
+ class: g(["flex gap-2 items-center", { "text-gray-500": c }])
223
229
  }, [
224
- x(o(r) + " ", 1),
225
- s && !y ? (t(), i("span", we, "*")) : n("", !0),
226
- !s && y ? (t(), i("span", ke, "(optional)")) : n("", !0)
230
+ w(o(u) + " ", 1),
231
+ d && !b ? (t(), i("span", Te, "*")) : n("", !0),
232
+ !d && b ? (t(), i("span", Ve, "(optional)")) : n("", !0)
227
233
  ], 2),
228
234
  a("div", null, [
229
- c[1] || (c[1] = x("Used choice occurrences: ", -1)),
235
+ m[1] || (m[1] = w("Used choice occurrences: ", -1)),
230
236
  a("span", {
231
237
  "data-testid": `${e.path}-used-choice-occurrences`
232
- }, o(_), 9, Ce)
238
+ }, o(_), 9, Se)
233
239
  ]),
234
- e.choice?.length ? (t(), i("div", Te, [
235
- (t(!0), i($, null, A(e.choice, (g) => (t(), i("button", {
236
- key: `${g.name}-add`,
240
+ e.choice?.length ? (t(), i("div", _e, [
241
+ (t(!0), i($, null, B(e.choice, (O) => (t(), i("button", {
242
+ key: `${O.name}-add`,
237
243
  type: "button",
238
- class: O(q),
239
- disabled: !V(g.name),
240
- "data-testid": `${e.path}.${g.name}-add-choice-button`,
241
- onClick: (B) => b(g.name)
242
- }, " Add " + o(g.name), 9, Ve))), 128)),
243
- (t(!0), i($, null, A(e.choice, (g) => (t(), i("button", {
244
- key: `${g.name}-remove`,
244
+ class: g(f(P, O.name)),
245
+ disabled: !S(O.name),
246
+ "data-testid": `${e.path}.${O.name}-add-choice-button`,
247
+ onClick: (v) => x(O.name)
248
+ }, " Add " + o(O.name), 11, We))), 128)),
249
+ (t(!0), i($, null, B(e.choice, (O) => (t(), i("button", {
250
+ key: `${O.name}-remove`,
245
251
  type: "button",
246
- class: O(q),
247
- "data-testid": `${e.path}.${g.name}-remove-choice-button`,
248
- onClick: (B) => v(g.name)
249
- }, " Remove " + o(g.name), 9, _e))), 128))
252
+ class: g(I),
253
+ "data-testid": `${e.path}.${O.name}-remove-choice-button`,
254
+ onClick: (v) => k(O.name)
255
+ }, " Remove " + o(O.name), 9, Ae))), 128))
250
256
  ])) : n("", !0),
251
- a("div", Se, [
252
- T(d.$slots, "default", {
253
- level: (f?.level ?? 0) + 1,
257
+ a("div", Fe, [
258
+ V(h.$slots, "default", {
259
+ level: (y?.level ?? 0) + 1,
254
260
  belowChoiceField: !0
255
261
  })
256
262
  ]),
257
- a("pre", We, o(e.description), 1),
263
+ a("pre", $e, o(e.description), 1),
258
264
  l.value ? (t(), i("span", {
259
265
  key: 1,
260
266
  class: "text-red-600 text-sm",
261
267
  "data-testid": `${e.path}-error-message`
262
- }, o(l.value), 9, Fe)) : n("", !0)
268
+ }, o(l.value), 9, Be)) : n("", !0)
263
269
  ], 2))
264
270
  ]),
265
- "default-choice-array-item": k(({ fieldMetadata: e, slotProps: l, branchKey: r, globalIndex: p, insertionOrder: s, canAddItems: f, addItem: y, removeItem: b }) => [
271
+ "default-choice-array-item": C(({ fieldMetadata: e, slotProps: l, branchKey: u, globalIndex: c, insertionOrder: d, canAddItems: y, addItem: b, removeItem: x }) => [
266
272
  e.hidden ? n("", !0) : (t(), i("div", {
267
273
  key: 0,
268
- class: O(["flex flex-col gap-2 border-s-2 ps-2", { "md:col-span-2": e.fullWidth }])
274
+ class: g(["flex flex-col gap-2 border-s-2 ps-2", { "md:col-span-2": e.fullWidth }])
269
275
  }, [
270
- a("div", $e, [
276
+ a("div", Ne, [
271
277
  a("span", {
272
278
  "data-testid": `${e.path}-kind-badge`
273
- }, o(r), 9, Ae),
274
- c[2] || (c[2] = x(" globalIndex: ", -1)),
279
+ }, o(u), 9, Pe),
280
+ m[2] || (m[2] = w(" globalIndex: ", -1)),
275
281
  a("span", {
276
282
  "data-testid": `${e.path}-global-index`
277
- }, o(p), 9, Be),
278
- c[3] || (c[3] = x(" insertionOrder: ", -1)),
279
- s !== void 0 ? (t(), i("span", {
283
+ }, o(c), 9, Le),
284
+ m[3] || (m[3] = w(" insertionOrder: ", -1)),
285
+ d !== void 0 ? (t(), i("span", {
280
286
  key: 0,
281
287
  "data-testid": `${e.path}-insertion-order`
282
- }, o(s), 9, Ne)) : n("", !0),
283
- f ? (t(), W(S, {
288
+ }, o(d), 9, Ee)) : n("", !0),
289
+ y ? (t(), A(W, {
284
290
  key: 1,
285
291
  icon: "plus",
286
292
  tabindex: "-1",
287
293
  "data-testid": `${e.path}-add-choice-button`,
288
- onClick: y
294
+ onClick: b
289
295
  }, null, 8, ["data-testid", "onClick"])) : n("", !0),
290
- R(S, {
296
+ z(W, {
291
297
  icon: "minus",
292
298
  tabindex: "-1",
293
299
  color: "red",
294
300
  "data-testid": `${e.path}-remove-choice-button`,
295
- onClick: b
301
+ onClick: x
296
302
  }, null, 8, ["data-testid", "onClick"])
297
303
  ]),
298
- a("div", Pe, [
299
- T(d.$slots, "default", {
304
+ a("div", qe, [
305
+ V(h.$slots, "default", {
300
306
  level: (l?.level ?? 0) + 1
301
307
  })
302
308
  ])
303
309
  ], 2))
304
310
  ]),
305
- "default-wizard": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, pages: p, currentStepIndex: s, pageCount: f, isFirst: y, isLast: b, isValidating: v, wizardConfig: V, next: _, prev: g, gotoStep: B, slotProps: P }) => [
306
- a("div", qe, [
307
- a("span", null, o(r), 1),
308
- a("div", Le, [
309
- (t(!0), i($, null, A(p, (w, C) => (t(), i("button", {
310
- key: w.path,
311
+ "default-wizard": C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, pages: c, currentStepIndex: d, pageCount: y, isFirst: b, isLast: x, isValidating: k, wizardConfig: S, next: _, prev: P, gotoStep: O, slotProps: v }) => [
312
+ a("div", Re, [
313
+ a("span", null, o(u), 1),
314
+ a("div", Ie, [
315
+ (t(!0), i($, null, B(c, (T, L) => (t(), i("button", {
316
+ key: T.path,
311
317
  type: "button",
312
- class: O(q),
313
- "data-testid": `${e.path}-goto-${C}-button`,
314
- onClick: (z) => B(C)
315
- }, o(w.name), 9, Ee))), 128))
318
+ class: g(I),
319
+ "data-testid": `${e.path}-goto-${L}-button`,
320
+ onClick: (J) => O(L)
321
+ }, o(T.name), 9, ze))), 128))
316
322
  ]),
317
- a("div", Ie, [
323
+ a("div", Ue, [
318
324
  a("button", {
319
325
  type: "button",
320
- class: O(q),
326
+ class: g(I),
321
327
  "data-testid": `${e.path}-prev-button`,
322
- onClick: g
323
- }, " Previous ", 8, ze),
328
+ onClick: P
329
+ }, " Previous ", 8, De),
324
330
  a("button", {
325
331
  type: "button",
326
- class: O(Wt),
332
+ class: g(K),
327
333
  "data-testid": `${e.path}-next-button`,
328
334
  onClick: _
329
- }, " Next ", 8, Re)
335
+ }, " Next ", 8, Ge)
330
336
  ]),
331
337
  l.value ? (t(), i("span", {
332
338
  key: 0,
333
339
  class: "text-red-600 text-sm",
334
340
  "data-testid": `${e.path}-error-message`
335
- }, o(l.value), 9, Ue)) : n("", !0),
336
- a("div", De, [
337
- T(d.$slots, "default", {
338
- level: (P?.level ?? 0) + 1
341
+ }, o(l.value), 9, Je)) : n("", !0),
342
+ a("div", je, [
343
+ V(h.$slots, "default", {
344
+ level: (v?.level ?? 0) + 1
339
345
  })
340
346
  ]),
341
347
  a("div", null, [
342
- c[4] || (c[4] = x("currentStepIndex: ", -1)),
348
+ m[4] || (m[4] = w("currentStepIndex: ", -1)),
343
349
  a("span", {
344
350
  "data-testid": `${e.path}-currentStepIndex`
345
- }, o(s), 9, Je)
351
+ }, o(d), 9, He)
346
352
  ]),
347
353
  a("div", null, [
348
- c[5] || (c[5] = x("pageCount: ", -1)),
354
+ m[5] || (m[5] = w("pageCount: ", -1)),
349
355
  a("span", {
350
356
  "data-testid": `${e.path}-pageCount`
351
- }, o(f), 9, Ge)
357
+ }, o(y), 9, Ke)
352
358
  ]),
353
359
  a("div", null, [
354
- c[6] || (c[6] = x("isFirst: ", -1)),
360
+ m[6] || (m[6] = w("isFirst: ", -1)),
355
361
  a("span", {
356
362
  "data-testid": `${e.path}-isFirst`
357
- }, o(y), 9, je)
363
+ }, o(b), 9, Ze)
358
364
  ]),
359
365
  a("div", null, [
360
- c[7] || (c[7] = x("isLast: ", -1)),
366
+ m[7] || (m[7] = w("isLast: ", -1)),
361
367
  a("span", {
362
368
  "data-testid": `${e.path}-isLast`
363
- }, o(b), 9, He)
369
+ }, o(x), 9, Qe)
364
370
  ]),
365
371
  a("div", null, [
366
- c[8] || (c[8] = x("isValidating: ", -1)),
372
+ m[8] || (m[8] = w("isValidating: ", -1)),
367
373
  a("span", {
368
374
  "data-testid": `${e.path}-isValidating`
369
- }, o(v), 9, Ke)
375
+ }, o(k), 9, Ye)
370
376
  ]),
371
377
  a("div", null, [
372
- c[9] || (c[9] = x("allowForwardJump: ", -1)),
378
+ m[9] || (m[9] = w("allowForwardJump: ", -1)),
373
379
  a("span", {
374
380
  "data-testid": `${e.path}-wizardConfig-allowForwardJump`
375
- }, o(V.allowForwardJump), 9, Qe)
381
+ }, o(S.allowForwardJump), 9, Xe)
376
382
  ]),
377
383
  a("div", null, [
378
- c[10] || (c[10] = x("validateOnJump: ", -1)),
384
+ m[10] || (m[10] = w("validateOnJump: ", -1)),
379
385
  a("span", {
380
386
  "data-testid": `${e.path}-wizardConfig-validateOnJump`
381
- }, o(V.validateOnJump), 9, Ye)
387
+ }, o(S.validateOnJump), 9, Me)
382
388
  ])
383
389
  ])
384
390
  ]),
385
- "default-wizard-page": k(({ fieldMetadata: e, isCurrent: l, gotoStep: r, slotProps: p, settings: { wizardPageUseVIf: s } }) => [
386
- s ? l ? (t(), i("div", {
391
+ "default-wizard-page": C(({ fieldMetadata: e, isCurrent: l, gotoStep: u, slotProps: c, settings: { wizardPageUseVIf: d } }) => [
392
+ d ? l ? (t(), i("div", {
387
393
  key: 1,
388
394
  "data-testid": `${e.path}-page`,
389
395
  "data-current": l
390
396
  }, [
391
- T(d.$slots, "default", {
392
- gotoStep: r,
393
- level: p?.level
397
+ V(h.$slots, "default", {
398
+ gotoStep: u,
399
+ level: c?.level
394
400
  })
395
- ], 8, Xe)) : n("", !0) : N((t(), i("div", {
401
+ ], 8, tt)) : n("", !0) : E((t(), i("div", {
396
402
  key: 0,
397
403
  "data-testid": `${e.path}-page`,
398
404
  "data-current": l
399
405
  }, [
400
- T(d.$slots, "default", {
401
- gotoStep: r,
402
- level: p?.level
406
+ V(h.$slots, "default", {
407
+ gotoStep: u,
408
+ level: c?.level
403
409
  })
404
- ], 8, Ze)), [
405
- [Y, l]
410
+ ], 8, et)), [
411
+ [M, l]
406
412
  ])
407
413
  ]),
408
- "default-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, canAddItems: f, addItem: y, settings: { showOptionalInsteadOfRequired: b } }) => [
414
+ "default-array": C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, canAddItems: y, addItem: b, settings: { showOptionalInsteadOfRequired: x } }) => [
409
415
  e.hidden ? n("", !0) : (t(), i("div", {
410
416
  key: 0,
411
- class: O(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
417
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
412
418
  }, [
413
419
  a("label", {
414
420
  for: `${e.path}[0]`,
415
- class: O([{ "text-gray-500": e.disabled || p }, "flex gap-2 items-center"])
421
+ class: g([{ "text-gray-500": e.disabled || c }, "flex gap-2 items-center"])
416
422
  }, [
417
- x(o(r) + " ", 1),
418
- s && !b ? (t(), i("span", et, "*")) : n("", !0),
419
- !s && b ? (t(), i("span", tt, "(optional)")) : n("", !0),
420
- f ? (t(), W(S, {
423
+ w(o(u) + " ", 1),
424
+ d && !x ? (t(), i("span", at, "*")) : n("", !0),
425
+ !d && x ? (t(), i("span", lt, "(optional)")) : n("", !0),
426
+ y ? (t(), A(W, {
421
427
  key: 2,
422
428
  icon: "plus",
423
429
  tabindex: "-1",
424
430
  "data-testid": `${e.path}-add-button`,
425
- onClick: y
431
+ onClick: b
426
432
  }, null, 8, ["data-testid", "onClick"])) : n("", !0)
427
- ], 10, Me),
428
- T(d.$slots, "default", { hideLabel: !0 }),
429
- a("pre", it, o(e.description), 1),
433
+ ], 10, it),
434
+ V(h.$slots, "default", { hideLabel: !0 }),
435
+ a("pre", nt, o(e.description), 1),
430
436
  l.value ? (t(), i("span", {
431
437
  key: 0,
432
438
  class: "text-red-600 text-sm",
433
439
  "data-testid": `${e.path}-error-message`
434
- }, o(l.value), 9, at)) : n("", !0)
440
+ }, o(l.value), 9, st)) : n("", !0)
435
441
  ], 2))
436
442
  ]),
437
- default: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, canRemoveItems: f, removeItem: y, slotProps: b, settings: { showOptionalInsteadOfRequired: v } }) => [
443
+ default: C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, canRemoveItems: y, removeItem: b, slotProps: x, settings: { showOptionalInsteadOfRequired: k } }) => [
438
444
  e.hidden ? n("", !0) : (t(), i("div", {
439
445
  key: 0,
440
- class: O(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
446
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
441
447
  }, [
442
- b?.hideLabel ? n("", !0) : (t(), i("label", {
448
+ x?.hideLabel ? n("", !0) : (t(), i("label", {
443
449
  key: 0,
444
450
  for: e.path,
445
- class: O([{ "text-gray-500": e.disabled || p }, "flex gap-1 items-center"])
451
+ class: g([{ "text-gray-500": e.disabled || c }, "flex gap-1 items-center"])
446
452
  }, [
447
- x(o(r) + " ", 1),
448
- s && !v ? (t(), i("span", nt, "*")) : n("", !0),
449
- !s && v ? (t(), i("span", st, "(optional)")) : n("", !0)
450
- ], 10, lt)),
451
- a("div", ot, [
452
- a("div", dt, [
453
- T(d.$slots, "default")
453
+ w(o(u) + " ", 1),
454
+ d && !k ? (t(), i("span", dt, "*")) : n("", !0),
455
+ !d && k ? (t(), i("span", rt, "(optional)")) : n("", !0)
456
+ ], 10, ot)),
457
+ a("div", ct, [
458
+ a("div", ut, [
459
+ V(h.$slots, "default")
454
460
  ]),
455
- R(S, {
456
- class: O({ invisible: !f }),
461
+ z(W, {
462
+ class: g({ invisible: !y }),
457
463
  icon: "minus",
458
464
  tabindex: "-1",
459
465
  color: "red",
460
466
  "data-testid": `${e.path}-remove-button`,
461
- onClick: y
467
+ onClick: b
462
468
  }, null, 8, ["class", "data-testid", "onClick"])
463
469
  ]),
464
- a("pre", rt, o(e.description), 1),
470
+ a("pre", pt, o(e.description), 1),
465
471
  l.value ? (t(), i("span", {
466
472
  key: 1,
467
473
  class: "text-red-600 text-sm",
468
474
  "data-testid": `${e.path}-error-message`
469
- }, o(l.value), 9, ct)) : n("", !0)
475
+ }, o(l.value), 9, mt)) : n("", !0)
470
476
  ], 2)),
471
- T(d.$slots, "attributes")
477
+ V(h.$slots, "attributes")
472
478
  ]),
473
- "group-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, canAddItems: f, addItem: y, slotProps: b, settings: { showOptionalInsteadOfRequired: v } }) => [
474
- e.hidden ? (t(), i($, { key: 0 }, [], 64)) : b?.belowChoiceField ? (t(), i("div", {
479
+ "group-array": C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, canAddItems: y, addItem: b, slotProps: x, settings: { showOptionalInsteadOfRequired: k } }) => [
480
+ e.hidden ? (t(), i($, { key: 0 }, [], 64)) : x?.belowChoiceField ? (t(), i("div", {
475
481
  key: 1,
476
- class: O({ "md:col-span-2": e.fullWidth })
482
+ class: g({ "md:col-span-2": e.fullWidth })
477
483
  }, [
478
484
  a("span", {
479
- class: O(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || p }])
485
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || c }])
480
486
  }, [
481
- x(o(r) + " ", 1),
482
- s && !v ? (t(), i("span", ut, "*")) : n("", !0),
483
- !s && v ? (t(), i("span", pt, "(optional)")) : n("", !0),
484
- f ? (t(), W(S, {
487
+ w(o(u) + " ", 1),
488
+ d && !k ? (t(), i("span", ht, "*")) : n("", !0),
489
+ !d && k ? (t(), i("span", bt, "(optional)")) : n("", !0),
490
+ y ? (t(), A(W, {
485
491
  key: 2,
486
492
  icon: "plus",
487
493
  tabindex: "-1",
488
494
  "data-testid": `${e.path}-add-button`,
489
- onClick: y
495
+ onClick: b
490
496
  }, null, 8, ["data-testid", "onClick"])) : n("", !0)
491
497
  ], 2),
492
- a("div", mt, [
493
- T(d.$slots, "default", {
494
- level: (b?.level ?? 0) + 1
498
+ a("div", ft, [
499
+ V(h.$slots, "default", {
500
+ level: (x?.level ?? 0) + 1
495
501
  })
496
502
  ]),
497
- a("pre", ht, o(e.description), 1),
503
+ a("pre", Ot, o(e.description), 1),
498
504
  l.value ? (t(), i("span", {
499
505
  key: 0,
500
506
  class: "text-red-600 text-sm",
501
507
  "data-testid": `${e.path}-error-message`
502
- }, o(l.value), 9, bt)) : n("", !0)
503
- ], 2)) : T(d.$slots, "default", {}, void 0, void 0, 2)
508
+ }, o(l.value), 9, yt)) : n("", !0)
509
+ ], 2)) : V(h.$slots, "default", {}, void 0, void 0, 2)
504
510
  ]),
505
- group: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: r }, disabled: p, required: s, canAddItems: f, canRemoveItems: y, addItem: b, removeItem: v, slotProps: V, settings: { showOptionalInsteadOfRequired: _ } }) => [
511
+ group: C(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: u }, disabled: c, required: d, canAddItems: y, canRemoveItems: b, addItem: x, removeItem: k, slotProps: S, settings: { showOptionalInsteadOfRequired: _ } }) => [
506
512
  e.hidden ? n("", !0) : (t(), i("div", {
507
513
  key: 0,
508
- class: O({ "md:col-span-2": e.fullWidth })
514
+ class: g({ "md:col-span-2": e.fullWidth })
509
515
  }, [
510
- V?.hideLabel ? n("", !0) : (t(), i("span", {
516
+ S?.hideLabel ? n("", !0) : (t(), i("span", {
511
517
  key: 0,
512
- class: O(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || p }])
518
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || c }])
513
519
  }, [
514
- x(o(r) + " ", 1),
515
- s && !_ ? (t(), i("span", ft, "*")) : n("", !0),
516
- !s && _ ? (t(), i("span", Ot, "(optional)")) : n("", !0),
517
- f ? (t(), W(S, {
520
+ w(o(u) + " ", 1),
521
+ d && !_ ? (t(), i("span", gt, "*")) : n("", !0),
522
+ !d && _ ? (t(), i("span", vt, "(optional)")) : n("", !0),
523
+ y ? (t(), A(W, {
518
524
  key: 2,
519
525
  icon: "plus",
520
526
  tabindex: "-1",
521
527
  "data-testid": `${e.path}-add-button`,
522
- onClick: b
528
+ onClick: x
523
529
  }, null, 8, ["data-testid", "onClick"])) : n("", !0),
524
- y ? (t(), W(S, {
530
+ b ? (t(), A(W, {
525
531
  key: 3,
526
532
  icon: "minus",
527
533
  tabindex: "-1",
528
534
  "data-testid": `${e.path}-remove-button`,
529
535
  color: "red",
530
- onClick: v
536
+ onClick: k
531
537
  }, null, 8, ["data-testid", "onClick"])) : n("", !0)
532
538
  ], 2)),
533
- a("div", gt, [
534
- T(d.$slots, "default", {
535
- level: (V?.level ?? 0) + 1
539
+ a("div", xt, [
540
+ V(h.$slots, "default", {
541
+ level: (S?.level ?? 0) + 1
536
542
  })
537
543
  ]),
538
- a("pre", yt, o(e.description), 1),
544
+ a("pre", wt, o(e.description), 1),
539
545
  l.value ? (t(), i("span", {
540
546
  key: 1,
541
547
  class: "text-red-600 text-sm",
542
548
  "data-testid": `${e.path}-error-message`
543
- }, o(l.value), 9, xt)) : n("", !0)
549
+ }, o(l.value), 9, kt)) : n("", !0)
544
550
  ], 2)),
545
- T(d.$slots, "attributes")
551
+ V(h.$slots, "attributes")
546
552
  ]),
547
- "select-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r, handleChange: p }, disabled: s }) => [
553
+ "select-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u, handleChange: c }, disabled: d }) => [
548
554
  a("select", {
549
555
  id: e.path,
550
556
  value: l.value,
551
- disabled: e.disabled || s,
557
+ disabled: e.disabled || d,
552
558
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
553
- onChange: p,
554
- onBlur: r
559
+ onChange: c,
560
+ onBlur: u
555
561
  }, [
556
- (t(!0), i($, null, A(e.options, ({ key: f, value: y }) => (t(), i("option", {
557
- key: f,
558
- value: f
559
- }, o(y), 9, wt))), 128))
560
- ], 40, vt)
562
+ (t(!0), i($, null, B(e.options, ({ key: y, value: b }) => (t(), i("option", {
563
+ key: y,
564
+ value: y
565
+ }, o(b), 9, Tt))), 128))
566
+ ], 40, Ct)
561
567
  ]),
562
- "selectBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r }, disabled: p }) => [
563
- N(a("select", {
568
+ "selectBoundByVModel-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u }, disabled: c }) => [
569
+ E(a("select", {
564
570
  id: e.path,
565
- "onUpdate:modelValue": (s) => l.value = s,
566
- disabled: e.disabled || p,
571
+ "onUpdate:modelValue": (d) => l.value = d,
572
+ disabled: e.disabled || c,
567
573
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
568
- onBlur: r
574
+ onBlur: u
569
575
  }, [
570
- (t(!0), i($, null, A(e.options, ({ key: s, value: f }) => (t(), i("option", {
571
- key: s,
572
- value: s
573
- }, o(f), 9, Ct))), 128))
574
- ], 40, kt), [
575
- [Q, l.value]
576
+ (t(!0), i($, null, B(e.options, ({ key: d, value: y }) => (t(), i("option", {
577
+ key: d,
578
+ value: d
579
+ }, o(y), 9, St))), 128))
580
+ ], 40, Vt), [
581
+ [X, l.value]
576
582
  ])
577
583
  ]),
578
- "checkbox-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r, handleChange: p }, disabled: s }) => [
584
+ "checkbox-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u, handleChange: c }, disabled: d }) => [
579
585
  a("input", {
580
586
  id: e.path,
581
587
  checked: l.value,
582
- disabled: e.disabled || s,
588
+ disabled: e.disabled || d,
583
589
  type: "checkbox",
584
590
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
585
- onChange: (f) => p(f.target.checked),
586
- onBlur: r
587
- }, null, 40, Tt)
591
+ onChange: (y) => c(y.target.checked),
592
+ onBlur: u
593
+ }, null, 40, _t)
588
594
  ]),
589
- "checkboxBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r }, disabled: p }) => [
590
- N(a("input", {
595
+ "checkboxBoundByVModel-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u }, disabled: c }) => [
596
+ E(a("input", {
591
597
  id: e.path,
592
- "onUpdate:modelValue": (s) => l.value = s,
593
- disabled: e.disabled || p,
598
+ "onUpdate:modelValue": (d) => l.value = d,
599
+ disabled: e.disabled || c,
594
600
  type: "checkbox",
595
601
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
596
- onBlur: r
597
- }, null, 40, Vt), [
602
+ onBlur: u
603
+ }, null, 40, Wt), [
598
604
  [D, l.value]
599
605
  ])
600
606
  ]),
601
- "textBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r }, disabled: p }) => [
602
- N(a("input", {
607
+ "textBoundByVModel-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u }, disabled: c }) => [
608
+ E(a("input", {
603
609
  id: e.path,
604
- "onUpdate:modelValue": (s) => l.value = s,
605
- disabled: e.disabled || p,
610
+ "onUpdate:modelValue": (d) => l.value = d,
611
+ disabled: e.disabled || c,
606
612
  type: "text",
607
613
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
608
- onBlur: r
609
- }, null, 40, _t), [
610
- [K, l.value]
614
+ onBlur: u
615
+ }, null, 40, At), [
616
+ [Y, l.value]
611
617
  ])
612
618
  ]),
613
- "default-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: r, handleChange: p }, disabled: s }) => [
619
+ "default-input": C(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: u, handleChange: c }, disabled: d }) => [
614
620
  a("input", {
615
621
  id: e.path,
616
622
  value: l.value,
617
- disabled: e.disabled || s,
623
+ disabled: e.disabled || d,
618
624
  type: "text",
619
625
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
620
- onInput: p,
621
- onBlur: r
622
- }, null, 40, St)
626
+ onInput: c,
627
+ onBlur: u
628
+ }, null, 40, Ft)
623
629
  ]),
624
630
  _: 3
625
631
  }, 8, ["metadata-configuration"]));
626
632
  }
627
- }), $t = { class: "flex justify-end gap-2" }, At = {
633
+ }), Bt = { class: "flex justify-end gap-2" }, Nt = {
628
634
  key: 1,
629
635
  type: "submit",
630
636
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
631
637
  "data-testid": "submit"
632
- }, Bt = {
638
+ }, Pt = {
633
639
  key: 0,
634
640
  "data-testid": "errors",
635
641
  class: "col-12 text-red-600"
636
- }, Nt = ["innerHTML"], Pt = {
642
+ }, Lt = ["innerHTML"], Et = {
637
643
  key: 1,
638
644
  "data-testid": "isSubmitted"
639
645
  }, qt = {
640
646
  key: 2,
641
647
  class: "bg-gray-100 p-4 rounded-lg text-sm overflow-auto"
642
- }, G = /* @__PURE__ */ E({
648
+ }, H = /* @__PURE__ */ q({
643
649
  __name: "TestForm",
644
650
  props: {
645
651
  metadata: {},
@@ -650,19 +656,19 @@ const oe = {
650
656
  initialValues: {},
651
657
  keepValuesOnUnmount: { type: Boolean }
652
658
  },
653
- setup(u, { expose: h }) {
654
- const { values: d, handleSubmit: c, errors: e, meta: l, resetForm: r, resetField: p, setFieldValue: s, setValues: f } = ae({
655
- initialValues: u.initialValues,
659
+ setup(s, { expose: r }) {
660
+ const { values: f, handleSubmit: h, errors: m, meta: e, resetForm: l, resetField: u, setFieldValue: c, setValues: d } = se({
661
+ initialValues: s.initialValues,
656
662
  // Passed as a computed ref (not the destructured value directly) so a live toggle of the prop
657
663
  // after mount keeps affecting unmount behaviour, instead of freezing whatever it was at setup time.
658
- keepValuesOnUnmount: U(() => u.keepValuesOnUnmount)
659
- }), y = L(), b = L(u.initialEdit), v = L(!1), V = U(() => u.metadata?.map((P) => le(P, (w) => (w.computedProps = w.computedProps ?? [], w.computedProps.push((C) => {
660
- b.value || (C.disabled = !0);
661
- }), u.hideFieldsWithoutValue && (w.computedProps.push((C, z) => {
662
- !b.value && !se(z.value) && (C.hidden = !0);
663
- }), w.computedProps.push((C, z, j) => {
664
- !b.value && j.value.length > 0 && j.value.every((H) => H.hidden) && (C.hidden = !0);
665
- })), w)))), _ = U(() => ({
664
+ keepValuesOnUnmount: U(() => s.keepValuesOnUnmount)
665
+ }), y = N(), b = N(s.initialEdit), x = N(!1), k = U(() => s.metadata?.map((O) => oe(O, (v) => (v.computedProps = v.computedProps ?? [], v.computedProps.push((T) => {
666
+ b.value || (T.disabled = !0);
667
+ }), s.hideFieldsWithoutValue && (v.computedProps.push((T, L) => {
668
+ !b.value && !re(L.value) && (T.hidden = !0);
669
+ }), v.computedProps.push((T, L, J) => {
670
+ !b.value && J.value.length > 0 && J.value.every((Q) => Q.hidden) && (T.hidden = !0);
671
+ })), v)))), S = U(() => ({
666
672
  analytics: !0,
667
673
  messages: {
668
674
  required: "{field} is required",
@@ -684,91 +690,91 @@ const oe = {
684
690
  fractionDigits: "{field} may have at most {digits} decimal place(s)",
685
691
  totalDigits: "{field} may have at most {digits} significant digit(s)"
686
692
  },
687
- ...u.settings ?? {}
693
+ ...s.settings ?? {}
688
694
  }));
689
- function g() {
690
- p(u.metadata[0].name);
695
+ function _() {
696
+ u(s.metadata[0].name);
691
697
  }
692
- h({ setFieldValue: s, setValues: f });
693
- function B(P) {
694
- c(
695
- (w) => {
696
- v.value = !0, b.value = !1;
698
+ r({ setFieldValue: c, setValues: d });
699
+ function P(O) {
700
+ h(
701
+ (v) => {
702
+ x.value = !0, b.value = !1;
697
703
  },
698
- ({ errors: w }) => {
699
- v.value = !1;
704
+ ({ errors: v }) => {
705
+ x.value = !1;
700
706
  }
701
- )(P);
707
+ )(O);
702
708
  }
703
- return (P, w) => (t(), i("form", {
704
- onSubmit: Z(B, ["prevent"])
709
+ return (O, v) => (t(), i("form", {
710
+ onSubmit: ee(P, ["prevent"])
705
711
  }, [
706
- a("div", $t, [
712
+ a("div", Bt, [
707
713
  b.value ? n("", !0) : (t(), i("button", {
708
714
  key: 0,
709
715
  type: "button",
710
716
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
711
717
  "data-testid": "submit",
712
- onClick: w[0] || (w[0] = (C) => b.value = !0)
718
+ onClick: v[0] || (v[0] = (T) => b.value = !0)
713
719
  }, " Edit ")),
714
- b.value ? (t(), i("button", At, " Submit ")) : n("", !0),
720
+ b.value ? (t(), i("button", Nt, " Submit ")) : n("", !0),
715
721
  b.value ? (t(), i("button", {
716
722
  key: 2,
717
723
  type: "button",
718
724
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
719
725
  "data-testid": "cancel",
720
- onClick: w[1] || (w[1] = (C) => b.value = !1)
726
+ onClick: v[1] || (v[1] = (T) => b.value = !1)
721
727
  }, " Cancel ")) : n("", !0),
722
728
  b.value ? (t(), i("button", {
723
729
  key: 3,
724
730
  type: "button",
725
731
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
726
732
  "data-testid": "reset",
727
- onClick: w[2] || (w[2] = (C) => F(r)())
733
+ onClick: v[2] || (v[2] = (T) => F(l)())
728
734
  }, " Reset ")) : n("", !0),
729
735
  b.value ? (t(), i("button", {
730
736
  key: 4,
731
737
  type: "button",
732
738
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
733
739
  "data-testid": "resetField",
734
- onClick: g
740
+ onClick: _
735
741
  }, " Reset field ")) : n("", !0)
736
742
  ]),
737
- Object.values(F(e)).length ? (t(), i("div", Bt, [
738
- w[4] || (w[4] = x(" Errors: ", -1)),
743
+ Object.values(F(m)).length ? (t(), i("div", Pt, [
744
+ v[4] || (v[4] = w(" Errors: ", -1)),
739
745
  a("ul", null, [
740
- (t(!0), i($, null, A(F(e), (C, z) => (t(), i("li", { key: z }, [
741
- a("span", { innerHTML: C }, null, 8, Nt)
746
+ (t(!0), i($, null, B(F(m), (T, L) => (t(), i("li", { key: L }, [
747
+ a("span", { innerHTML: T }, null, 8, Lt)
742
748
  ]))), 128))
743
749
  ])
744
750
  ])) : n("", !0),
745
- R(ne, {
746
- template: Ft,
747
- metadata: V.value,
748
- settings: _.value,
749
- "onUpdate:modelValue": w[3] || (w[3] = (C) => y.value = C)
751
+ z(de, {
752
+ template: $t,
753
+ metadata: k.value,
754
+ settings: S.value,
755
+ "onUpdate:modelValue": v[3] || (v[3] = (T) => y.value = T)
750
756
  }, null, 8, ["metadata", "settings"]),
751
- v.value ? (t(), i("span", Pt)) : n("", !0),
752
- u.showDebugState ? (t(), i("pre", qt, "IsDirty: " + o(F(l).dirty) + `
753
- Pending: ` + o(F(l).pending) + `
754
- Touched: ` + o(F(l).touched) + `
755
- Valid: ` + o(F(l).valid) + `
756
- Submitted: ` + o(v.value) + `
757
+ x.value ? (t(), i("span", Et)) : n("", !0),
758
+ s.showDebugState ? (t(), i("pre", qt, "IsDirty: " + o(F(e).dirty) + `
759
+ Pending: ` + o(F(e).pending) + `
760
+ Touched: ` + o(F(e).touched) + `
761
+ Valid: ` + o(F(e).valid) + `
762
+ Submitted: ` + o(x.value) + `
757
763
 
758
764
  // form values:
759
- ` + o(JSON.stringify(F(d), null, 2)) + `
765
+ ` + o(JSON.stringify(F(f), null, 2)) + `
760
766
  `, 1)) : n("", !0)
761
767
  ], 32));
762
768
  }
763
- }), Ht = m([{
769
+ }), ei = p([{
764
770
  name: "text",
765
771
  type: "text",
766
772
  fieldOptions: { label: "Text Input" },
767
773
  path: "with.custom.structure",
768
774
  restriction: { maxLength: 10 }
769
- }]), Kt = {
775
+ }]), ti = {
770
776
  with: { custom: { structure: "Order A204" } }
771
- }, Qt = m([{
777
+ }, ii = p([{
772
778
  name: "arrays",
773
779
  fieldOptions: { label: "Array Fields" },
774
780
  type: "heading",
@@ -786,7 +792,7 @@ Submitted: ` + o(v.value) + `
786
792
  { name: "flag", fieldOptions: { label: "Nested field 3" }, type: "checkbox" }
787
793
  ] }
788
794
  ]
789
- }]), Yt = {
795
+ }]), ai = {
790
796
  arrays: {
791
797
  optionalItems: ["First note"],
792
798
  requiredItems: ["Alpha", "Beta"],
@@ -796,7 +802,7 @@ Submitted: ` + o(v.value) + `
796
802
  { note: "Section two", category: "option1", flag: !1 }
797
803
  ]
798
804
  }
799
- }, Zt = m([{
805
+ }, li = p([{
800
806
  name: "groups",
801
807
  fieldOptions: { label: "Grouped Fields" },
802
808
  type: "heading",
@@ -826,7 +832,7 @@ You can test it by filling in one of the fields.`, children: [
826
832
  { name: "second", fieldOptions: { label: "Required Nested field 2" } }
827
833
  ] }
828
834
  ]
829
- }]), Xt = {
835
+ }]), ni = {
830
836
  groups: {
831
837
  requiredGroup: { first: "Ada", second: "Lovelace" },
832
838
  optionalGroup: { first: "Grace", second: "Hopper" }
@@ -840,7 +846,7 @@ You can test it by filling in one of the fields.`, children: [
840
846
  { first: "Barbara", second: "Liskov" }
841
847
  ]
842
848
  }
843
- }, Mt = m([
849
+ }, si = p([
844
850
  {
845
851
  name: "simpleChoiceSection",
846
852
  fieldOptions: { label: "Choice Fields (minOccurs 1, maxOccurs 1)" },
@@ -880,7 +886,7 @@ You can test it by filling in one of the fields.`, children: [
880
886
  ] }
881
887
  ]
882
888
  }
883
- ]), ei = {
889
+ ]), oi = {
884
890
  // Only one branch per choice carries a value, honouring the mutually exclusive rule.
885
891
  simpleChoiceSection: { contactMethod: { primary: "Picked the first branch" } },
886
892
  groupedChoiceSection: {
@@ -889,7 +895,7 @@ You can test it by filling in one of the fields.`, children: [
889
895
  arrayChoiceSection: {
890
896
  pick: { optionA: ["First entry", "Second entry"] }
891
897
  }
892
- }, ti = m([
898
+ }, di = p([
893
899
  {
894
900
  fieldOptions: { label: "Personal Info" },
895
901
  type: "heading",
@@ -922,7 +928,7 @@ You can test it by filling in one of the fields.`, children: [
922
928
  lastName: "Smit"
923
929
  }
924
930
  }
925
- }), ii = {
931
+ }), ri = {
926
932
  person: {
927
933
  firstName: "Ada",
928
934
  lastName: "Lovelace",
@@ -933,7 +939,7 @@ You can test it by filling in one of the fields.`, children: [
933
939
  city: "London",
934
940
  country: "United Kingdom"
935
941
  }
936
- }, ai = m([
942
+ }, ci = p([
937
943
  {
938
944
  name: "inputs",
939
945
  fieldOptions: { label: "All Input Types" },
@@ -970,7 +976,7 @@ You can test it by filling in one of the fields.`, children: [
970
976
  { name: "describedField", minOccurs: 0, description: "A per-field description rendered below the input.", fieldOptions: { label: "Field with description" } }
971
977
  ]
972
978
  }
973
- ]), li = {
979
+ ]), ui = {
974
980
  inputs: {
975
981
  text: "Hello world",
976
982
  textBoundByVModel: "Two-way bound",
@@ -986,7 +992,7 @@ You can test it by filling in one of the fields.`, children: [
986
992
  fullWidthField: "Spans the full width",
987
993
  describedField: "Described value"
988
994
  }
989
- }, ni = m([
995
+ }, pi = p([
990
996
  {
991
997
  name: "strings",
992
998
  fieldOptions: { label: "String Restrictions" },
@@ -1021,10 +1027,10 @@ You can test it by filling in one of the fields.`, children: [
1021
1027
  children: [
1022
1028
  { name: "combined", minOccurs: 0, restriction: { minLength: 2, maxLength: 6, pattern: "^[a-z]+$" }, description: "minLength 2, maxLength 6 and lowercase-only pattern combined.", fieldOptions: { label: "Combined restrictions" } },
1023
1029
  { name: "requiredWithRestriction", restriction: { minLength: 3 }, fieldOptions: { label: "Required + minLength 3" } },
1024
- { name: "customValidation", minOccurs: 0, validation: (u) => !u || String(u).startsWith("A") || 'Value must start with "A"', description: "Custom vee-validate function via the validation property.", fieldOptions: { label: "Custom validation function" } }
1030
+ { name: "customValidation", minOccurs: 0, validation: (s) => !s || String(s).startsWith("A") || 'Value must start with "A"', description: "Custom vee-validate function via the validation property.", fieldOptions: { label: "Custom validation function" } }
1025
1031
  ]
1026
1032
  }
1027
- ]), si = {
1033
+ ]), mi = {
1028
1034
  // Every value here satisfies its restriction, so loading the sample form validates cleanly.
1029
1035
  strings: {
1030
1036
  minLength: "abcd",
@@ -1047,7 +1053,28 @@ You can test it by filling in one of the fields.`, children: [
1047
1053
  requiredWithRestriction: "valid",
1048
1054
  customValidation: "Apple"
1049
1055
  }
1050
- }, oi = m([
1056
+ };
1057
+ function Rt(s) {
1058
+ const r = s ?? {};
1059
+ return !!(r.email || r.phone) || "Fill in an email or a phone number.";
1060
+ }
1061
+ const hi = p([
1062
+ {
1063
+ name: "contact",
1064
+ fieldOptions: { label: "Live Form Validity" },
1065
+ type: "heading",
1066
+ fullWidth: !0,
1067
+ minOccurs: 0,
1068
+ description: 'The group checks that at least one contact method is filled in. Watch the "Valid" line in the debug state below: it flips the moment the form becomes valid or invalid, with no Submit press needed. That makes it usable for a disabled submit button or a completeness indicator.',
1069
+ validation: Rt,
1070
+ children: [
1071
+ { name: "email", minOccurs: 0, fieldOptions: { label: "Email" } },
1072
+ { name: "phone", minOccurs: 0, fieldOptions: { label: "Phone" } }
1073
+ ]
1074
+ }
1075
+ ]), bi = {
1076
+ contact: { email: "jane@example.com" }
1077
+ }, fi = p([
1051
1078
  {
1052
1079
  name: "occurrences",
1053
1080
  fieldOptions: { label: "Occurrence Variants" },
@@ -1071,7 +1098,7 @@ You can test it by filling in one of the fields.`, children: [
1071
1098
  { name: "vModelTexts", type: "textBoundByVModel", minOccurs: 0, maxOccurs: 3, fieldOptions: { label: "v-model text array (max 3)" } }
1072
1099
  ]
1073
1100
  }
1074
- ]), di = {
1101
+ ]), Oi = {
1075
1102
  occurrences: {
1076
1103
  manualFirstItem: ["Added by hand"],
1077
1104
  prefilledToMin: ["First", "Second"],
@@ -1082,7 +1109,7 @@ You can test it by filling in one of the fields.`, children: [
1082
1109
  checkboxes: [!0, !1],
1083
1110
  vModelTexts: ["Alpha", "Beta"]
1084
1111
  }
1085
- }, ri = m([
1112
+ }, yi = p([
1086
1113
  {
1087
1114
  name: "overLimit",
1088
1115
  fieldOptions: { label: "Over-limit Arrays (loaded from initialValues)" },
@@ -1092,12 +1119,12 @@ You can test it by filling in one of the fields.`, children: [
1092
1119
  { name: "optionalItems", minOccurs: 0, maxOccurs: 2, fieldOptions: { label: "Optional (max 2)" }, description: "A non-required array carried no occurrence rule before; loaded with 3 items it now fails xsd_maxOccurs on submit too." }
1093
1120
  ]
1094
1121
  }
1095
- ]), ci = {
1122
+ ]), gi = {
1096
1123
  overLimit: {
1097
1124
  requiredItems: ["First", "Second", "Third"],
1098
1125
  optionalItems: ["One", "Two", "Three"]
1099
1126
  }
1100
- }, ui = m([
1127
+ }, vi = p([
1101
1128
  {
1102
1129
  name: "optionalChoice",
1103
1130
  fieldOptions: { label: "Optional Choice (minOccurs 0)" },
@@ -1155,7 +1182,7 @@ You can test it by filling in one of the fields.`, children: [
1155
1182
  ] }
1156
1183
  ]
1157
1184
  }
1158
- ]), pi = {
1185
+ ]), xi = {
1159
1186
  optionalChoice: { contact: { email: "ada@example.com" } },
1160
1187
  // Two filled email occurrences satisfy the minOccurs 2 requirement.
1161
1188
  twoOccurrence: { contact: { email: ["ada@example.com", "grace@example.com"] } },
@@ -1163,7 +1190,7 @@ You can test it by filling in one of the fields.`, children: [
1163
1190
  totalCap: { entries: { capped: ["C-one", "C-two"] } },
1164
1191
  // Both single branches filled exactly to their effective cap, so every add button is disabled.
1165
1192
  singleBranchCap: { tags: { tag: ["T-one", "T-two"] }, clamped: { item: ["I-one", "I-two"] } }
1166
- }, mi = m([
1193
+ }, wi = p([
1167
1194
  {
1168
1195
  name: "tooManyBranches",
1169
1196
  fieldOptions: { label: "Choice Over maxOccurs (auto mode, maxOccurs 1)" },
@@ -1196,11 +1223,11 @@ You can test it by filling in one of the fields.`, children: [
1196
1223
  ] }
1197
1224
  ]
1198
1225
  }
1199
- ]), hi = {
1226
+ ]), ki = {
1200
1227
  tooManyBranches: { contact: { email: "ada@example.com", phone: "555-0100" } },
1201
1228
  branchOverTotal: { entries: { capped: ["C-one", "C-two", "C-three"] } },
1202
1229
  singleBranchOverTotal: { tags: { tag: ["T-one", "T-two", "T-three"] } }
1203
- }, bi = m([
1230
+ }, Ci = p([
1204
1231
  {
1205
1232
  name: "explicitSection",
1206
1233
  fieldOptions: { label: "Explicit Choice (selection-first)" },
@@ -1217,10 +1244,29 @@ You can test it by filling in one of the fields.`, children: [
1217
1244
  ] }
1218
1245
  ]
1219
1246
  }
1220
- ]), fi = {
1247
+ ]), Ti = {
1221
1248
  // A loaded value auto-selects its branch, even though nothing was clicked.
1222
1249
  explicitSection: { contact: { email: { address: "jane@example.com" } } }
1223
- }, Oi = m([
1250
+ }, Vi = p([
1251
+ {
1252
+ name: "checkoutSection",
1253
+ fieldOptions: { label: "Explicit Choice With presenceValue" },
1254
+ type: "heading",
1255
+ children: [
1256
+ { name: "checkout", fieldOptions: { label: "Checkout method" }, fullWidth: !0, explicitChoiceSelection: !0, description: "Express checkout has nothing to fill in; selecting it writes presenceValue (true) into its own value so it satisfies its own required check and persists into submitted/reloaded values. Email is an ordinary branch for comparison.", choice: [
1257
+ // type: 'heading' routes the selected branch to a label-only slot; without it the
1258
+ // childless leaf would render as a text input exposing the raw presence marker.
1259
+ { name: "express", type: "heading", presenceValue: !0, fieldOptions: { label: "Express checkout selected" }, description: "Nothing to fill in: selecting this branch wrote presenceValue (true) into its value, visible in the debug output below." },
1260
+ { name: "email", type: "group", fieldOptions: { label: "Email" }, children: [
1261
+ { name: "address", fullWidth: !0, fieldOptions: { label: "Email address" } }
1262
+ ] }
1263
+ ] }
1264
+ ]
1265
+ }
1266
+ ]), Si = {
1267
+ // Reads back as selected on mount with no click, through presenceValue's value-driven bypass.
1268
+ checkoutSection: { checkout: { express: !0 } }
1269
+ }, _i = p([
1224
1270
  {
1225
1271
  name: "preserveSection",
1226
1272
  fieldOptions: { label: "Explicit Choice With preserveOnSwitch" },
@@ -1236,9 +1282,27 @@ You can test it by filling in one of the fields.`, children: [
1236
1282
  ] }
1237
1283
  ]
1238
1284
  }
1239
- ]), gi = {
1285
+ ]), Wi = {
1240
1286
  preserveSection: { contact: { email: { address: "restore@example.com" } } }
1241
- }, yi = m([
1287
+ }, Ai = p([
1288
+ {
1289
+ name: "resetSection",
1290
+ fieldOptions: { label: "Explicit Choice vs. Form Reset" },
1291
+ type: "heading",
1292
+ children: [
1293
+ { name: "contact", fieldOptions: { label: "Contact method" }, fullWidth: !0, explicitChoiceSelection: !0, preserveOnSwitch: !0, description: "With sample data loaded, Email starts selected from the initial values. Switch to Phone, then press Reset: Email must be the only selected branch again (a stale Phone selection must not stay active alongside it), and re-selecting Phone afterwards starts empty because the reset also drops the preserve-on-switch stash.", choice: [
1294
+ { name: "email", type: "group", fieldOptions: { label: "Email" }, children: [
1295
+ { name: "address", fullWidth: !0, fieldOptions: { label: "Email address" } }
1296
+ ] },
1297
+ { name: "phone", type: "group", fieldOptions: { label: "Phone" }, children: [
1298
+ { name: "number", fullWidth: !0, fieldOptions: { label: "Phone number" } }
1299
+ ] }
1300
+ ] }
1301
+ ]
1302
+ }
1303
+ ]), Fi = {
1304
+ resetSection: { contact: { email: { address: "initial@example.com" } } }
1305
+ }, $i = p([
1242
1306
  {
1243
1307
  name: "integrationsSection",
1244
1308
  fieldOptions: { label: "Explicit Repeatable Choice (maxOccurs 5)" },
@@ -1256,7 +1320,7 @@ You can test it by filling in one of the fields.`, children: [
1256
1320
  ] }
1257
1321
  ]
1258
1322
  }
1259
- ]), xi = {
1323
+ ]), Bi = {
1260
1324
  // A mix of both kinds; each branch is its own array of occurrences.
1261
1325
  integrationsSection: {
1262
1326
  integrations: {
@@ -1269,7 +1333,7 @@ You can test it by filling in one of the fields.`, children: [
1269
1333
  ]
1270
1334
  }
1271
1335
  }
1272
- }, vi = m([
1336
+ }, Ni = p([
1273
1337
  {
1274
1338
  name: "timelineSection",
1275
1339
  fieldOptions: { label: "Repeatable Explicit Choice (displayOrder: added)" },
@@ -1286,7 +1350,7 @@ You can test it by filling in one of the fields.`, children: [
1286
1350
  ] }
1287
1351
  ]
1288
1352
  }
1289
- ]), wi = {
1353
+ ]), Pi = {
1290
1354
  // Both pre-loaded occurrences lack an add-order, so they render first in grouped order;
1291
1355
  // anything added afterwards appends below them in add-press order.
1292
1356
  timelineSection: {
@@ -1295,7 +1359,7 @@ You can test it by filling in one of the fields.`, children: [
1295
1359
  milestone: [{ title: "Loaded milestone", owner: "Ada" }]
1296
1360
  }
1297
1361
  }
1298
- }, ki = m([
1362
+ }, Li = p([
1299
1363
  {
1300
1364
  name: "stepsSection",
1301
1365
  fieldOptions: { label: "Repeatable Explicit Choice (preserveOrder + displayOrder: added)" },
@@ -1311,7 +1375,7 @@ You can test it by filling in one of the fields.`, children: [
1311
1375
  ] }
1312
1376
  ]
1313
1377
  }
1314
- ]), Ci = {
1378
+ ]), Ei = {
1315
1379
  // Neither pre-loaded occurrence carries "order"; the mount-time backfill assigns 1 and 2 from
1316
1380
  // their grouped position before any add-press can occur.
1317
1381
  stepsSection: {
@@ -1320,7 +1384,7 @@ You can test it by filling in one of the fields.`, children: [
1320
1384
  automated: [{ script: "deploy.sh" }]
1321
1385
  }
1322
1386
  }
1323
- }, Ti = m([
1387
+ }, qi = p([
1324
1388
  {
1325
1389
  name: "labelsSection",
1326
1390
  fieldOptions: { label: "preserveOrder With a Scalar-Leaf Branch (per-branch no-op)" },
@@ -1334,33 +1398,33 @@ You can test it by filling in one of the fields.`, children: [
1334
1398
  ] }
1335
1399
  ]
1336
1400
  }
1337
- ]), Vi = {
1401
+ ]), Ri = {
1338
1402
  labelsSection: {
1339
1403
  items: {
1340
1404
  labelled: [{ label: "Has an order field" }],
1341
1405
  tag: ["plain-tag-no-order"]
1342
1406
  }
1343
1407
  }
1344
- }, _i = m([
1408
+ }, Ii = p([
1345
1409
  {
1346
1410
  name: "ownValue",
1347
1411
  fieldOptions: { label: "Reacting to Own Value" },
1348
1412
  type: "heading",
1349
1413
  children: [
1350
1414
  { name: "charCounter", minOccurs: 0, restriction: { maxLength: 10 }, fieldOptions: { label: "Character counter" }, computedProps: [
1351
- (u, h) => {
1352
- const d = typeof h.value == "string" ? h.value.length : 0;
1353
- u.description = `${10 - d} character(s) remaining`;
1415
+ (s, r) => {
1416
+ const f = typeof r.value == "string" ? r.value.length : 0;
1417
+ s.description = `${10 - f} character(s) remaining`;
1354
1418
  }
1355
1419
  ] },
1356
1420
  { name: "selfHiding", minOccurs: 0, fieldOptions: { label: 'Type "hide" to hide me' }, computedProps: [
1357
- (u, h) => {
1358
- h.value === "hide" && (u.hidden = !0);
1421
+ (s, r) => {
1422
+ r.value === "hide" && (s.hidden = !0);
1359
1423
  }
1360
1424
  ] },
1361
1425
  { name: "selfDisabling", minOccurs: 0, fieldOptions: { label: 'Type "lock" to disable me' }, computedProps: [
1362
- (u, h) => {
1363
- h.value === "lock" && (u.disabled = !0);
1426
+ (s, r) => {
1427
+ r.value === "lock" && (s.disabled = !0);
1364
1428
  }
1365
1429
  ] }
1366
1430
  ]
@@ -1371,9 +1435,9 @@ You can test it by filling in one of the fields.`, children: [
1371
1435
  type: "heading",
1372
1436
  computeOnChildValueChange: !0,
1373
1437
  computedProps: [
1374
- (u, h) => {
1375
- const c = Object.values(h.value ?? {}).filter((e) => e != null && e !== "").length;
1376
- u.description = `${c} of 3 fields filled in`;
1438
+ (s, r) => {
1439
+ const h = Object.values(r.value ?? {}).filter((m) => m != null && m !== "").length;
1440
+ s.description = `${h} of 3 fields filled in`;
1377
1441
  }
1378
1442
  ],
1379
1443
  children: [
@@ -1388,29 +1452,104 @@ You can test it by filling in one of the fields.`, children: [
1388
1452
  type: "heading",
1389
1453
  description: 'Each child hides itself when its value is "hide"; once every child is hidden the parent heading hides too.',
1390
1454
  computedProps: [
1391
- (u, h, d) => {
1392
- d.value.length > 0 && d.value.every((c) => c.hidden) && (u.hidden = !0);
1455
+ (s, r, f) => {
1456
+ f.value.length > 0 && f.value.every((h) => h.hidden) && (s.hidden = !0);
1393
1457
  }
1394
1458
  ],
1395
1459
  children: [
1396
1460
  { name: "childA", minOccurs: 0, fieldOptions: { label: 'Child A (type "hide")' }, computedProps: [
1397
- (u, h) => {
1398
- h.value === "hide" && (u.hidden = !0);
1461
+ (s, r) => {
1462
+ r.value === "hide" && (s.hidden = !0);
1399
1463
  }
1400
1464
  ] },
1401
1465
  { name: "childB", minOccurs: 0, fieldOptions: { label: 'Child B (type "hide")' }, computedProps: [
1402
- (u, h) => {
1403
- h.value === "hide" && (u.hidden = !0);
1466
+ (s, r) => {
1467
+ r.value === "hide" && (s.hidden = !0);
1404
1468
  }
1405
1469
  ] }
1406
1470
  ]
1407
1471
  }
1408
- ]), Si = {
1472
+ ]), zi = {
1409
1473
  // Values that stay visible/enabled (typing "hide"/"lock" would trigger the self-hiding demos).
1410
1474
  ownValue: { charCounter: "Counting", selfHiding: "still shown", selfDisabling: "still on" },
1411
1475
  progress: { first: "Filled one", second: "Filled two" },
1412
1476
  childFieldsDemo: { childA: "kept visible" }
1413
- }, Wi = m([
1477
+ }, Z = N(void 0), j = N(!1), It = {
1478
+ NL: { pattern: "^[0-9]{4} ?[A-Z]{2}$" },
1479
+ DE: { pattern: "^[0-9]{5}$" }
1480
+ }, zt = {
1481
+ NL: "Dutch format: 1234 AB.",
1482
+ DE: "German format: 12345."
1483
+ };
1484
+ function Ut(s) {
1485
+ return s ? /^[A-Z]{2}[A-Z0-9]{8,12}$/.test(String(s)) || "Enter a valid VAT number (e.g. NL123456789B01)." : !0;
1486
+ }
1487
+ function Dt() {
1488
+ return !0;
1489
+ }
1490
+ const Ui = p([
1491
+ {
1492
+ name: "dynamicRules",
1493
+ fieldOptions: { label: "Dynamic Validation Rules (computedProps)" },
1494
+ type: "heading",
1495
+ description: "computedProps swaps a field's restriction and validation at runtime, and the field actually revalidates against the swapped rule.",
1496
+ children: [
1497
+ {
1498
+ name: "country",
1499
+ type: "select",
1500
+ minOccurs: 0,
1501
+ fieldOptions: { label: "Country" },
1502
+ description: "Switching country swaps the postal code restriction below.",
1503
+ options: [
1504
+ { key: "NL", value: "Netherlands" },
1505
+ { key: "DE", value: "Germany" }
1506
+ ],
1507
+ restriction: { enumeration: ["NL", "DE"] },
1508
+ computedProps: [
1509
+ (s, r) => {
1510
+ Z.value = typeof r.value == "string" ? r.value : void 0;
1511
+ }
1512
+ ]
1513
+ },
1514
+ {
1515
+ name: "postalCode",
1516
+ minOccurs: 0,
1517
+ fieldOptions: { label: "Postal code" },
1518
+ computedProps: [
1519
+ (s) => {
1520
+ const r = Z.value;
1521
+ s.restriction = r ? It[r] : void 0, s.description = r ? zt[r] : "Pick a country to activate a postal code rule.";
1522
+ }
1523
+ ]
1524
+ },
1525
+ {
1526
+ name: "businessOrder",
1527
+ type: "checkbox",
1528
+ minOccurs: 0,
1529
+ fieldOptions: { label: "Business order" },
1530
+ description: "Toggling this swaps the VAT number validation below.",
1531
+ computedProps: [
1532
+ (s, r) => {
1533
+ j.value = r.value === !0;
1534
+ }
1535
+ ]
1536
+ },
1537
+ {
1538
+ name: "vatNumber",
1539
+ minOccurs: 0,
1540
+ fieldOptions: { label: "VAT number" },
1541
+ computedProps: [
1542
+ (s) => {
1543
+ s.validation = j.value ? Ut : Dt, s.description = j.value ? "Validated: two uppercase letters followed by 8 to 12 characters." : "Not validated while this is a private order.";
1544
+ }
1545
+ ]
1546
+ }
1547
+ ]
1548
+ }
1549
+ ]), Di = {
1550
+ // All values satisfy the rules their drivers activate (NL postal format, business VAT format).
1551
+ dynamicRules: { country: "NL", postalCode: "1234 AB", businessOrder: !0, vatNumber: "NL123456789B01" }
1552
+ }, Gi = p([
1414
1553
  {
1415
1554
  name: "attributes",
1416
1555
  fieldOptions: { label: "Attributes" },
@@ -1436,7 +1575,7 @@ You can test it by filling in one of the fields.`, children: [
1436
1575
  { name: "complexValue", minOccurs: 0, fullWidth: !0, isComplexType: !0, description: "isComplexType without attributes: the value is stored as { value: ... }.", fieldOptions: { label: "isComplexType" } }
1437
1576
  ]
1438
1577
  }
1439
- ]), Fi = {
1578
+ ]), Ji = {
1440
1579
  attributes: {
1441
1580
  // A complex type stores its value plus each attribute under one object.
1442
1581
  nickname: { value: "Ace", lang: "en" },
@@ -1445,7 +1584,7 @@ You can test it by filling in one of the fields.`, children: [
1445
1584
  complexTypes: {
1446
1585
  complexValue: { value: "Wrapped in { value }" }
1447
1586
  }
1448
- }, $i = m([
1587
+ }, ji = p([
1449
1588
  {
1450
1589
  name: "customValueProp",
1451
1590
  fieldOptions: { label: "Custom complexTypeValueProperty" },
@@ -1459,39 +1598,39 @@ You can test it by filling in one of the fields.`, children: [
1459
1598
  }
1460
1599
  ], {
1461
1600
  complexTypeValueProperty: "val"
1462
- }), Ai = {
1601
+ }), Hi = {
1463
1602
  // The value lives under "val" (not "value") because of the complexTypeValueProperty setting.
1464
1603
  customValueProp: { title: { val: "Hello world", lang: "en" } }
1465
1604
  };
1466
- function J(u, h) {
1467
- return m([
1605
+ function G(s, r) {
1606
+ return p([
1468
1607
  {
1469
1608
  name: "timing",
1470
1609
  fieldOptions: { label: "Validation Timing" },
1471
1610
  type: "heading",
1472
- description: u,
1611
+ description: s,
1473
1612
  children: [
1474
1613
  { name: "requiredField", fieldOptions: { label: "Required field" } },
1475
1614
  { name: "maxLengthField", minOccurs: 0, restriction: { maxLength: 5 }, fieldOptions: { label: "maxLength 5" } }
1476
1615
  ]
1477
1616
  }
1478
- ], h);
1617
+ ], r);
1479
1618
  }
1480
- const Bi = {
1619
+ const Ki = {
1481
1620
  timing: { requiredField: "Filled in", maxLengthField: "abc" }
1482
- }, Ni = J(
1621
+ }, Zi = G(
1483
1622
  "validateOnValueUpdate: false, validateWhenInError: false. Errors only appear on submit and stay unchanged while typing until the next submit.",
1484
1623
  { validateOnValueUpdate: !1, validateWhenInError: !1 }
1485
- ), Pi = J(
1624
+ ), Qi = G(
1486
1625
  "validateOnBlur: true, validateOnValueUpdate: false. Errors appear when leaving a field, not while typing.",
1487
1626
  { validateOnBlur: !0, validateOnValueUpdate: !1 }
1488
- ), qi = J(
1627
+ ), Yi = G(
1489
1628
  "validateOnValueUpdateAfterSubmit: true, validateOnValueUpdate: false. Typing does not validate until the first submit; after that every change validates.",
1490
1629
  { validateOnValueUpdateAfterSubmit: !0, validateOnValueUpdate: !1 }
1491
- ), Li = J(
1630
+ ), Xi = G(
1492
1631
  "validateOnValueUpdate: false, validateWhenInError: true. A field only starts live-validating once it is in error (after a submit).",
1493
1632
  { validateOnValueUpdate: !1, validateWhenInError: !0 }
1494
- ), Ei = m([
1633
+ ), Mi = p([
1495
1634
  {
1496
1635
  name: "optionalMarkers",
1497
1636
  fieldOptions: { label: 'Show "(optional)" Instead of "*"' },
@@ -1504,9 +1643,9 @@ const Bi = {
1504
1643
  }
1505
1644
  ], {
1506
1645
  showOptionalInsteadOfRequired: !0
1507
- }), Ii = {
1646
+ }), ea = {
1508
1647
  optionalMarkers: { requiredField: "Required value", optionalField: "Optional value" }
1509
- }, zi = m([
1648
+ }, ta = p([
1510
1649
  {
1511
1650
  name: "messages",
1512
1651
  fieldOptions: { label: "Custom Validation Messages" },
@@ -1524,9 +1663,9 @@ const Bi = {
1524
1663
  maxLength: "Custom message: {field} must stay under {length} characters",
1525
1664
  minInclusive: "Custom message: {field} must be {min} or higher"
1526
1665
  }
1527
- }), Ri = {
1666
+ }), ia = {
1528
1667
  messages: { requiredField: "Filled in", maxLengthField: "abcd", minInclusiveField: "15" }
1529
- }, Ui = m(
1668
+ }, aa = p(
1530
1669
  [{
1531
1670
  name: "items",
1532
1671
  type: "text",
@@ -1540,17 +1679,17 @@ const Bi = {
1540
1679
  // validateWhenInError: true,
1541
1680
  // validateOnBlur: true,
1542
1681
  }
1543
- ), Di = {
1682
+ ), la = {
1544
1683
  // Each repeatable item is a complex type: its text under "value" plus the lang attribute.
1545
1684
  items: [
1546
1685
  { value: "First item", lang: "en" },
1547
1686
  { value: "Second item", lang: "nl" }
1548
1687
  ]
1549
- }, I = [
1688
+ }, R = [
1550
1689
  { key: "starter", value: "Starter" },
1551
1690
  { key: "growth", value: "Growth" },
1552
1691
  { key: "enterprise", value: "Enterprise" }
1553
- ], Ji = m([{
1692
+ ], na = p([{
1554
1693
  name: "onboarding",
1555
1694
  wizard: !0,
1556
1695
  fieldOptions: { label: "Onboarding wizard (backward-only)" },
@@ -1569,7 +1708,7 @@ const Bi = {
1569
1708
  type: "heading",
1570
1709
  fieldOptions: { label: "Plan" },
1571
1710
  children: [
1572
- { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: I },
1711
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: R },
1573
1712
  { name: "seats", minOccurs: 0, fieldOptions: { label: "Seats (optional)" } }
1574
1713
  ]
1575
1714
  },
@@ -1582,13 +1721,13 @@ const Bi = {
1582
1721
  ]
1583
1722
  }
1584
1723
  ]
1585
- }]), Gi = {
1724
+ }]), sa = {
1586
1725
  onboarding: {
1587
1726
  company: { companyName: "Acme Corp", website: "https://acme.example" },
1588
1727
  plan: { planName: "growth", seats: "25" },
1589
1728
  review: { termsAccepted: !0 }
1590
1729
  }
1591
- }, ji = m([{
1730
+ }, oa = p([{
1592
1731
  name: "onboarding",
1593
1732
  wizard: { allowForwardJump: !0, validateOnJump: !1 },
1594
1733
  fieldOptions: { label: "Wizard with forward jumping" },
@@ -1603,7 +1742,7 @@ const Bi = {
1603
1742
  name: "plan",
1604
1743
  type: "heading",
1605
1744
  fieldOptions: { label: "Plan" },
1606
- children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: I }]
1745
+ children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: R }]
1607
1746
  },
1608
1747
  {
1609
1748
  name: "review",
@@ -1612,13 +1751,13 @@ const Bi = {
1612
1751
  children: [{ name: "termsAccepted", type: "checkbox", fieldOptions: { label: "I accept the terms (required)" } }]
1613
1752
  }
1614
1753
  ]
1615
- }]), Lt = {
1754
+ }]), Gt = {
1616
1755
  onboarding: {
1617
1756
  company: { companyName: "Acme Corp" },
1618
1757
  plan: { planName: "enterprise" },
1619
1758
  review: { termsAccepted: !0 }
1620
1759
  }
1621
- }, Hi = m([{
1760
+ }, da = p([{
1622
1761
  name: "onboarding",
1623
1762
  wizard: { allowForwardJump: !0, validateOnJump: !0 },
1624
1763
  fieldOptions: { label: "Wizard with validate-on-jump" },
@@ -1633,7 +1772,7 @@ const Bi = {
1633
1772
  name: "plan",
1634
1773
  type: "heading",
1635
1774
  fieldOptions: { label: "Plan" },
1636
- children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: I }]
1775
+ children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: R }]
1637
1776
  },
1638
1777
  {
1639
1778
  name: "review",
@@ -1642,7 +1781,7 @@ const Bi = {
1642
1781
  children: [{ name: "termsAccepted", type: "checkbox", fieldOptions: { label: "I accept the terms (required)" } }]
1643
1782
  }
1644
1783
  ]
1645
- }]), Ki = Lt, Qi = m([{
1784
+ }]), ra = Gt, ca = p([{
1646
1785
  name: "onboarding",
1647
1786
  wizard: { allowForwardJump: !0 },
1648
1787
  fieldOptions: { label: "Wizard with group / array / choice / summary pages" },
@@ -1687,7 +1826,7 @@ const Bi = {
1687
1826
  fieldOptions: { label: "Summary (field-less page)" }
1688
1827
  }
1689
1828
  ]
1690
- }]), Yi = {
1829
+ }]), ua = {
1691
1830
  onboarding: {
1692
1831
  company: { companyName: "Acme Corp" },
1693
1832
  contacts: [
@@ -1696,7 +1835,7 @@ const Bi = {
1696
1835
  ],
1697
1836
  launchApproach: { guidedRollout: { accountManager: "Alan Turing" } }
1698
1837
  }
1699
- }, Zi = m([{
1838
+ }, pa = p([{
1700
1839
  name: "setupPath",
1701
1840
  explicitChoiceSelection: !0,
1702
1841
  fullWidth: !0,
@@ -1724,7 +1863,7 @@ const Bi = {
1724
1863
  { name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 }
1725
1864
  ] },
1726
1865
  { name: "plan", type: "heading", fieldOptions: { label: "Plan" }, children: [
1727
- { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: I }
1866
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: R }
1728
1867
  ] },
1729
1868
  { name: "review", type: "heading", fieldOptions: { label: "Review" }, children: [
1730
1869
  { name: "termsAccepted", type: "checkbox", fieldOptions: { label: "Accept terms (required)" } }
@@ -1732,7 +1871,7 @@ const Bi = {
1732
1871
  ]
1733
1872
  }
1734
1873
  ]
1735
- }]), Xi = {
1874
+ }]), ma = {
1736
1875
  setupPath: {
1737
1876
  guidedSetup: {
1738
1877
  company: { companyName: "Acme Corp" },
@@ -1740,7 +1879,7 @@ const Bi = {
1740
1879
  review: { termsAccepted: !0 }
1741
1880
  }
1742
1881
  }
1743
- }, Mi = m([{
1882
+ }, ha = p([{
1744
1883
  name: "teams",
1745
1884
  type: "heading",
1746
1885
  maxOccurs: 3,
@@ -1760,12 +1899,12 @@ const Bi = {
1760
1899
  ] }
1761
1900
  ]
1762
1901
  }]
1763
- }]), ea = {
1902
+ }]), ba = {
1764
1903
  teams: [
1765
1904
  { setup: { team: { teamName: "Platform" }, lead: { leadName: "Ada Lovelace" } } },
1766
1905
  { setup: { team: { teamName: "Growth" }, lead: { leadName: "Grace Hopper" } } }
1767
1906
  ]
1768
- }, ta = m([{
1907
+ }, fa = p([{
1769
1908
  name: "onboarding",
1770
1909
  wizard: { allowForwardJump: !0 },
1771
1910
  fieldOptions: { label: "Wizard: v-show vs v-if and keepValuesOnUnmount" },
@@ -1783,12 +1922,12 @@ const Bi = {
1783
1922
  children: [{ name: "planName", minOccurs: 1, fieldOptions: { label: "Plan name" }, fullWidth: !0 }]
1784
1923
  }
1785
1924
  ]
1786
- }]), ia = {
1925
+ }]), Oa = {
1787
1926
  onboarding: {
1788
1927
  company: { companyName: "Acme Corp" },
1789
1928
  plan: { planName: "Growth" }
1790
1929
  }
1791
- }, aa = m([{
1930
+ }, ya = p([{
1792
1931
  name: "registration",
1793
1932
  type: "heading",
1794
1933
  minOccurs: 0,
@@ -1813,18 +1952,18 @@ const Bi = {
1813
1952
  type: "heading",
1814
1953
  fieldOptions: { label: "Plan" },
1815
1954
  children: [
1816
- { name: "planName", type: "select", fieldOptions: { label: "Plan (required once the section has a value)" }, options: I }
1955
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required once the section has a value)" }, options: R }
1817
1956
  ]
1818
1957
  }
1819
1958
  ]
1820
1959
  }]
1821
- }]), la = {
1960
+ }]), ga = {
1822
1961
  registration: {
1823
1962
  onboarding: {
1824
1963
  company: { companyName: "Acme Corp" }
1825
1964
  }
1826
1965
  }
1827
- }, na = m([{
1966
+ }, va = p([{
1828
1967
  name: "archived",
1829
1968
  type: "heading",
1830
1969
  maxOccurs: 0,
@@ -1849,12 +1988,12 @@ const Bi = {
1849
1988
  type: "heading",
1850
1989
  fieldOptions: { label: "Plan" },
1851
1990
  children: [
1852
- { name: "planName", type: "select", fieldOptions: { label: "Plan" }, options: I }
1991
+ { name: "planName", type: "select", fieldOptions: { label: "Plan" }, options: R }
1853
1992
  ]
1854
1993
  }
1855
1994
  ]
1856
1995
  }]
1857
- }]), sa = {
1996
+ }]), xa = {
1858
1997
  archived: {
1859
1998
  onboarding: {
1860
1999
  company: { companyName: "Acme Corp", website: "https://acme.example" },
@@ -1862,8 +2001,8 @@ const Bi = {
1862
2001
  }
1863
2002
  }
1864
2003
  };
1865
- function m(u, h, d = {}) {
1866
- return X(E({
2004
+ function p(s, r, f = {}) {
2005
+ return te(q({
1867
2006
  // Overridable at runtime so a Storybook control can flip a case between empty and pre-filled
1868
2007
  // without a second component; an unset prop falls back to the baked testCaseConfig/settings.
1869
2008
  props: {
@@ -1873,22 +2012,22 @@ function m(u, h, d = {}) {
1873
2012
  settings: { type: Object, default: void 0 },
1874
2013
  keepValuesOnUnmount: { type: Boolean, default: void 0 }
1875
2014
  },
1876
- setup: (c) => () => M(G, {
1877
- metadata: u,
1878
- settings: c.settings ?? h,
2015
+ setup: (h) => () => ie(H, {
2016
+ metadata: s,
2017
+ settings: h.settings ?? r,
1879
2018
  showDebugState: !0,
1880
- initialValues: c.initialValues ?? d.initialValues,
1881
- initialEdit: c.initialEdit ?? d.initialEdit,
1882
- hideFieldsWithoutValue: c.hideFieldsWithoutValue ?? d.hideFieldsWithoutValue,
1883
- keepValuesOnUnmount: c.keepValuesOnUnmount
2019
+ initialValues: h.initialValues ?? f.initialValues,
2020
+ initialEdit: h.initialEdit ?? f.initialEdit,
2021
+ hideFieldsWithoutValue: h.hideFieldsWithoutValue ?? f.hideFieldsWithoutValue,
2022
+ keepValuesOnUnmount: h.keepValuesOnUnmount
1884
2023
  })
1885
2024
  }));
1886
2025
  }
1887
- const Et = { class: "flex flex-col gap-4" }, It = { class: "flex gap-6 flex-wrap" }, zt = { class: "flex items-center gap-2" }, Rt = { class: "flex items-center gap-2" }, oa = /* @__PURE__ */ E({
2026
+ const Jt = { class: "flex flex-col gap-4" }, jt = { class: "flex gap-6 flex-wrap" }, Ht = { class: "flex items-center gap-2" }, Kt = { class: "flex items-center gap-2" }, wa = /* @__PURE__ */ q({
1888
2027
  __name: "KeepValuesOnUnmountTestCase",
1889
- setup(u) {
1890
- const h = L(!0), d = L(!1), c = U(() => [
1891
- ...h.value ? [{
2028
+ setup(s) {
2029
+ const r = N(!0), f = N(!1), h = U(() => [
2030
+ ...r.value ? [{
1892
2031
  name: "contact",
1893
2032
  fieldOptions: { label: "Contact (complex field with an attribute)" },
1894
2033
  minOccurs: 0,
@@ -1908,161 +2047,169 @@ const Et = { class: "flex flex-col gap-4" }, It = { class: "flex gap-6 flex-wrap
1908
2047
  }] : [],
1909
2048
  { name: "note", fieldOptions: { label: "Sibling field (always mounted)" }, minOccurs: 0, fullWidth: !0 }
1910
2049
  ]);
1911
- return (e, l) => (t(), i("div", Et, [
1912
- a("div", It, [
1913
- a("label", zt, [
1914
- N(a("input", {
1915
- "onUpdate:modelValue": l[0] || (l[0] = (r) => h.value = r),
2050
+ return (m, e) => (t(), i("div", Jt, [
2051
+ a("div", jt, [
2052
+ a("label", Ht, [
2053
+ E(a("input", {
2054
+ "onUpdate:modelValue": e[0] || (e[0] = (l) => r.value = l),
1916
2055
  type: "checkbox",
1917
2056
  "data-testid": "toggle-show-contact"
1918
2057
  }, null, 512), [
1919
- [D, h.value]
2058
+ [D, r.value]
1920
2059
  ]),
1921
- l[2] || (l[2] = x(" Show contact field (v-if unmount) ", -1))
2060
+ e[2] || (e[2] = w(" Show contact field (v-if unmount) ", -1))
1922
2061
  ]),
1923
- a("label", Rt, [
1924
- N(a("input", {
1925
- "onUpdate:modelValue": l[1] || (l[1] = (r) => d.value = r),
2062
+ a("label", Kt, [
2063
+ E(a("input", {
2064
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => f.value = l),
1926
2065
  type: "checkbox",
1927
2066
  "data-testid": "toggle-keep-values-on-unmount"
1928
2067
  }, null, 512), [
1929
- [D, d.value]
2068
+ [D, f.value]
1930
2069
  ]),
1931
- l[3] || (l[3] = x(" keepValuesOnUnmount ", -1))
2070
+ e[3] || (e[3] = w(" keepValuesOnUnmount ", -1))
1932
2071
  ])
1933
2072
  ]),
1934
- R(G, {
1935
- metadata: c.value,
1936
- "keep-values-on-unmount": d.value,
2073
+ z(H, {
2074
+ metadata: h.value,
2075
+ "keep-values-on-unmount": f.value,
1937
2076
  "show-debug-state": ""
1938
2077
  }, null, 8, ["metadata", "keep-values-on-unmount"])
1939
2078
  ]));
1940
2079
  }
1941
- }), Ut = { class: "flex flex-col gap-4" }, Dt = { class: "flex items-center gap-4 flex-wrap" }, Jt = { class: "flex items-center gap-2" }, da = /* @__PURE__ */ E({
2080
+ }), Zt = { class: "flex flex-col gap-4" }, Qt = { class: "flex items-center gap-4 flex-wrap" }, Yt = { class: "flex items-center gap-2" }, ka = /* @__PURE__ */ q({
1942
2081
  __name: "ProgrammaticWritesTestCase",
1943
- setup(u) {
1944
- const h = ee("form"), d = L(!1), c = [
2082
+ setup(s) {
2083
+ const r = ae("form"), f = N(!1), h = [
1945
2084
  { name: "code", fieldOptions: { label: "Code (required, maxLength 5)" }, restriction: { maxLength: 5 }, fullWidth: !0 },
1946
2085
  { name: "quantity", fieldOptions: { label: "Quantity (at most 10)" }, minOccurs: 0, restriction: { maxInclusive: 10 }, fullWidth: !0 },
1947
2086
  { name: "tags", fieldOptions: { label: "Tags (at least 2 items)" }, minOccurs: 2, maxOccurs: 4, fullWidth: !0 }
1948
- ], e = {
2087
+ ], m = {
1949
2088
  code: "far too long for five",
1950
2089
  quantity: "42",
1951
2090
  tags: ["only one"]
1952
2091
  };
1953
- function l() {
1954
- h.value?.setFieldValue("code", e.code, d.value);
2092
+ function e() {
2093
+ r.value?.setFieldValue("code", m.code, f.value);
1955
2094
  }
1956
- function r() {
1957
- h.value?.setValues({ ...e }, d.value);
2095
+ function l() {
2096
+ r.value?.setValues({ ...m }, f.value);
1958
2097
  }
1959
- return (p, s) => (t(), i("div", Ut, [
1960
- a("div", Dt, [
2098
+ return (u, c) => (t(), i("div", Zt, [
2099
+ a("div", Qt, [
1961
2100
  a("button", {
1962
2101
  type: "button",
1963
2102
  class: "cursor-pointer bg-gray-200 text-black px-4 py-2 rounded",
1964
2103
  "data-testid": "set-field-value",
1965
- onClick: l
2104
+ onClick: e
1966
2105
  }, " setFieldValue('code', ...) "),
1967
2106
  a("button", {
1968
2107
  type: "button",
1969
2108
  class: "cursor-pointer bg-gray-200 text-black px-4 py-2 rounded",
1970
2109
  "data-testid": "set-values",
1971
- onClick: r
2110
+ onClick: l
1972
2111
  }, " setValues({ ... }) "),
1973
- a("label", Jt, [
1974
- N(a("input", {
1975
- "onUpdate:modelValue": s[0] || (s[0] = (f) => d.value = f),
2112
+ a("label", Yt, [
2113
+ E(a("input", {
2114
+ "onUpdate:modelValue": c[0] || (c[0] = (d) => f.value = d),
1976
2115
  type: "checkbox",
1977
2116
  "data-testid": "toggle-should-validate"
1978
2117
  }, null, 512), [
1979
- [D, d.value]
2118
+ [D, f.value]
1980
2119
  ]),
1981
- s[1] || (s[1] = x(" shouldValidate ", -1))
2120
+ c[1] || (c[1] = w(" shouldValidate ", -1))
1982
2121
  ])
1983
2122
  ]),
1984
- R(G, {
2123
+ z(H, {
1985
2124
  ref_key: "form",
1986
- ref: h,
1987
- metadata: c,
2125
+ ref: r,
2126
+ metadata: h,
1988
2127
  "show-debug-state": ""
1989
2128
  }, null, 512)
1990
2129
  ]));
1991
2130
  }
1992
2131
  });
1993
2132
  export {
1994
- oa as KeepValuesOnUnmountTestCase,
1995
- da as ProgrammaticWritesTestCase,
1996
- Ft as TestFormTemplate,
1997
- ci as arrayMaxOccursSampleValues,
1998
- ri as arrayMaxOccursTestCase,
1999
- di as arrayOccurrenceSampleValues,
2000
- oi as arrayOccurrenceTestCase,
2001
- Yt as arraySampleValues,
2002
- Qt as arrayTestCase,
2003
- Fi as attributesSampleValues,
2004
- Wi as attributesTestCase,
2005
- ii as childFieldsSampleValues,
2006
- ti as childFieldsTestCase,
2007
- wi as choiceDisplayOrderAddedSampleValues,
2008
- vi as choiceDisplayOrderAddedTestCase,
2009
- hi as choiceMaxOccursSampleValues,
2010
- mi as choiceMaxOccursTestCase,
2011
- pi as choiceOccurrenceSampleValues,
2012
- ui as choiceOccurrenceTestCase,
2013
- Xi as choiceOfWizardsSampleValues,
2014
- Zi as choiceOfWizardsTestCase,
2015
- Ci as choicePreserveOrderSampleValues,
2016
- Vi as choicePreserveOrderScalarBranchSampleValues,
2017
- Ti as choicePreserveOrderScalarBranchTestCase,
2018
- ki as choicePreserveOrderTestCase,
2019
- ei as choiceSampleValues,
2020
- Mt as choiceTestCase,
2021
- Ai as complexTypeValuePropertySampleValues,
2022
- $i as complexTypeValuePropertyTestCase,
2023
- Si as computedPropsSampleValues,
2024
- _i as computedPropsTestCase,
2025
- m as createTestCase,
2026
- Ri as customMessagesSampleValues,
2027
- zi as customMessagesTestCase,
2028
- Kt as defaultSampleValues,
2029
- Ht as defaultTestCase,
2030
- fi as explicitChoiceSampleValues,
2031
- bi as explicitChoiceTestCase,
2032
- xi as explicitRepeatableChoiceSampleValues,
2033
- yi as explicitRepeatableChoiceTestCase,
2034
- Xt as groupSampleValues,
2035
- Zt as groupTestCase,
2036
- Di as individualSampleValues,
2037
- Ui as individualTestCase,
2038
- li as inputTypesSampleValues,
2039
- ai as inputTypesTestCase,
2040
- gi as preserveOnSwitchSampleValues,
2041
- Oi as preserveOnSwitchTestCase,
2042
- ea as repeatedWizardSampleValues,
2043
- Mi as repeatedWizardTestCase,
2044
- si as restrictionsSampleValues,
2045
- ni as restrictionsTestCase,
2046
- Ii as showOptionalInsteadOfRequiredSampleValues,
2047
- Ei as showOptionalInsteadOfRequiredTestCase,
2048
- qi as validateAfterSubmitTestCase,
2049
- Pi as validateOnBlurTestCase,
2050
- Ni as validateOnSubmitOnlyTestCase,
2051
- Li as validateWhenInErrorTestCase,
2052
- Bi as validationTimingSampleValues,
2053
- Yi as wizardCompositePagesSampleValues,
2054
- Qi as wizardCompositePagesTestCase,
2055
- sa as wizardDisabledAncestorSampleValues,
2056
- na as wizardDisabledAncestorTestCase,
2057
- Lt as wizardForwardJumpSampleValues,
2058
- ji as wizardForwardJumpTestCase,
2059
- ia as wizardKeepValuesSampleValues,
2060
- ta as wizardKeepValuesTestCase,
2061
- la as wizardOptionalAncestorSampleValues,
2062
- aa as wizardOptionalAncestorTestCase,
2063
- Gi as wizardSampleValues,
2064
- Ji as wizardTestCase,
2065
- Ki as wizardValidateOnJumpSampleValues,
2066
- Hi as wizardValidateOnJumpTestCase
2133
+ wa as KeepValuesOnUnmountTestCase,
2134
+ ka as ProgrammaticWritesTestCase,
2135
+ $t as TestFormTemplate,
2136
+ gi as arrayMaxOccursSampleValues,
2137
+ yi as arrayMaxOccursTestCase,
2138
+ Oi as arrayOccurrenceSampleValues,
2139
+ fi as arrayOccurrenceTestCase,
2140
+ ai as arraySampleValues,
2141
+ ii as arrayTestCase,
2142
+ Ji as attributesSampleValues,
2143
+ Gi as attributesTestCase,
2144
+ ri as childFieldsSampleValues,
2145
+ di as childFieldsTestCase,
2146
+ Pi as choiceDisplayOrderAddedSampleValues,
2147
+ Ni as choiceDisplayOrderAddedTestCase,
2148
+ ki as choiceMaxOccursSampleValues,
2149
+ wi as choiceMaxOccursTestCase,
2150
+ xi as choiceOccurrenceSampleValues,
2151
+ vi as choiceOccurrenceTestCase,
2152
+ ma as choiceOfWizardsSampleValues,
2153
+ pa as choiceOfWizardsTestCase,
2154
+ Ei as choicePreserveOrderSampleValues,
2155
+ Ri as choicePreserveOrderScalarBranchSampleValues,
2156
+ qi as choicePreserveOrderScalarBranchTestCase,
2157
+ Li as choicePreserveOrderTestCase,
2158
+ oi as choiceSampleValues,
2159
+ Fi as choiceSelectionResetSampleValues,
2160
+ Ai as choiceSelectionResetTestCase,
2161
+ si as choiceTestCase,
2162
+ Hi as complexTypeValuePropertySampleValues,
2163
+ ji as complexTypeValuePropertyTestCase,
2164
+ zi as computedPropsSampleValues,
2165
+ Ii as computedPropsTestCase,
2166
+ p as createTestCase,
2167
+ ia as customMessagesSampleValues,
2168
+ ta as customMessagesTestCase,
2169
+ ti as defaultSampleValues,
2170
+ ei as defaultTestCase,
2171
+ Di as dynamicRulesSampleValues,
2172
+ Ui as dynamicRulesTestCase,
2173
+ Ti as explicitChoiceSampleValues,
2174
+ Ci as explicitChoiceTestCase,
2175
+ Bi as explicitRepeatableChoiceSampleValues,
2176
+ $i as explicitRepeatableChoiceTestCase,
2177
+ ni as groupSampleValues,
2178
+ li as groupTestCase,
2179
+ la as individualSampleValues,
2180
+ aa as individualTestCase,
2181
+ ui as inputTypesSampleValues,
2182
+ ci as inputTypesTestCase,
2183
+ bi as liveValiditySampleValues,
2184
+ hi as liveValidityTestCase,
2185
+ Si as presenceValueSampleValues,
2186
+ Vi as presenceValueTestCase,
2187
+ Wi as preserveOnSwitchSampleValues,
2188
+ _i as preserveOnSwitchTestCase,
2189
+ ba as repeatedWizardSampleValues,
2190
+ ha as repeatedWizardTestCase,
2191
+ mi as restrictionsSampleValues,
2192
+ pi as restrictionsTestCase,
2193
+ ea as showOptionalInsteadOfRequiredSampleValues,
2194
+ Mi as showOptionalInsteadOfRequiredTestCase,
2195
+ Yi as validateAfterSubmitTestCase,
2196
+ Qi as validateOnBlurTestCase,
2197
+ Zi as validateOnSubmitOnlyTestCase,
2198
+ Xi as validateWhenInErrorTestCase,
2199
+ Ki as validationTimingSampleValues,
2200
+ ua as wizardCompositePagesSampleValues,
2201
+ ca as wizardCompositePagesTestCase,
2202
+ xa as wizardDisabledAncestorSampleValues,
2203
+ va as wizardDisabledAncestorTestCase,
2204
+ Gt as wizardForwardJumpSampleValues,
2205
+ oa as wizardForwardJumpTestCase,
2206
+ Oa as wizardKeepValuesSampleValues,
2207
+ fa as wizardKeepValuesTestCase,
2208
+ ga as wizardOptionalAncestorSampleValues,
2209
+ ya as wizardOptionalAncestorTestCase,
2210
+ sa as wizardSampleValues,
2211
+ na as wizardTestCase,
2212
+ ra as wizardValidateOnJumpSampleValues,
2213
+ da as wizardValidateOnJumpTestCase
2067
2214
  };
2068
2215
  //# sourceMappingURL=examples.es.js.map