@bach.software/vue-dynamic-form 0.4.0 → 0.6.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 (49) hide show
  1. package/README.md +56 -49
  2. package/dist/examples.cjs.js +6 -6
  3. package/dist/examples.cjs.js.map +1 -1
  4. package/dist/examples.es.js +1656 -296
  5. package/dist/examples.es.js.map +1 -1
  6. package/dist/mapEachMetadataItem-Cxfn86Z2.cjs +2 -0
  7. package/dist/mapEachMetadataItem-Cxfn86Z2.cjs.map +1 -0
  8. package/dist/mapEachMetadataItem-Dvf3R5jd.js +1159 -0
  9. package/dist/mapEachMetadataItem-Dvf3R5jd.js.map +1 -0
  10. package/dist/src/components/DynamicFormItemWizard.vue.d.ts +25 -0
  11. package/dist/src/components/DynamicFormTemplate.vue.d.ts +97 -4
  12. package/dist/src/components/__tests__/DynamicFormItem.unmount.logic.test.d.ts +1 -0
  13. package/dist/src/components/__tests__/DynamicFormItemArray.analytics.test.d.ts +1 -0
  14. package/dist/src/components/__tests__/DynamicFormItemArray.test-helpers.d.ts +9 -0
  15. package/dist/src/components/__tests__/DynamicFormItemChoice.analytics.test.d.ts +1 -0
  16. package/dist/src/components/__tests__/DynamicFormItemChoice.test-helpers.d.ts +100 -0
  17. package/dist/src/components/__tests__/DynamicFormItemWizard.analytics.test.d.ts +1 -0
  18. package/dist/src/components/__tests__/DynamicFormItemWizard.logic.test.d.ts +1 -0
  19. package/dist/src/components/__tests__/DynamicFormItemWizard.test-helpers.d.ts +24 -0
  20. package/dist/src/components/__tests__/DynamicFormItemWizard.validation.test.d.ts +1 -0
  21. package/dist/src/components/__tests__/DynamicFormTemplate.test.d.ts +1 -0
  22. package/dist/src/core/useDynamicForm.d.ts +2 -3
  23. package/dist/src/core/validation.d.ts +8 -2
  24. package/dist/src/examples/KeepValuesOnUnmountTestCase.vue.d.ts +2 -0
  25. package/dist/src/examples/TestForm.vue.d.ts +1 -0
  26. package/dist/src/examples/TestFormTemplate.vue.d.ts +48 -13
  27. package/dist/src/examples/__tests__/TestFormTemplate.testcases.d.ts +2317 -7
  28. package/dist/src/examples/index.d.ts +1 -0
  29. package/dist/src/index.d.ts +5 -0
  30. package/dist/src/types/DynamicFormItemProps.d.ts +39 -2
  31. package/dist/src/types/DynamicFormSettings.d.ts +16 -0
  32. package/dist/src/types/FieldMetadata.d.ts +123 -1
  33. package/dist/src/utils/__tests__/deepCloneValue.test.d.ts +1 -0
  34. package/dist/src/utils/__tests__/isNullOrUndefined.test.d.ts +1 -0
  35. package/dist/src/utils/__tests__/mapEachMetadataItem.test.d.ts +1 -1
  36. package/dist/src/utils/__tests__/removeNullValues.test.d.ts +1 -0
  37. package/dist/src/utils/deepCloneValue.d.ts +10 -0
  38. package/dist/src/utils/isNullOrUndefined.d.ts +2 -0
  39. package/dist/src/utils/removeNullValues.d.ts +5 -0
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/dist/vue-dynamic-form.cjs.js +1 -1
  42. package/dist/vue-dynamic-form.cjs.js.map +1 -1
  43. package/dist/vue-dynamic-form.es.js +53 -10
  44. package/dist/vue-dynamic-form.es.js.map +1 -1
  45. package/package.json +11 -10
  46. package/dist/useDynamicForm-B3VHKage.js +0 -735
  47. package/dist/useDynamicForm-B3VHKage.js.map +0 -1
  48. package/dist/useDynamicForm-CIS8GwHy.cjs +0 -6
  49. package/dist/useDynamicForm-CIS8GwHy.cjs.map +0 -1
@@ -1,9 +1,6 @@
1
- import { defineComponent as B, createElementBlock as l, openBlock as t, normalizeClass as y, createCommentVNode as s, createElementVNode as r, createBlock as O, unref as k, withCtx as x, withDirectives as W, vModelText as I, vModelCheckbox as R, Fragment as F, renderList as T, toDisplayString as u, vModelSelect as A, renderSlot as v, createTextVNode as w, createVNode as q, ref as V, computed as L, withModifiers as U, markRaw as j, h as P } from "vue";
2
- import { d as z, e as G, u as H, _ as J, h as Y } from "./useDynamicForm-B3VHKage.js";
3
- function S(h, f) {
4
- return !h || !f || (h = f?.({ ...h }), h.children = h?.children?.map((c) => S(c, f)), h.choice = h?.choice?.map((c) => S(c, f))), h;
5
- }
6
- const Q = {
1
+ import { defineComponent as q, createElementBlock as i, openBlock as t, normalizeClass as g, createCommentVNode as n, createElementVNode as a, createBlock as _, unref as W, withCtx as k, withDirectives as B, vModelText as G, vModelCheckbox as z, Fragment as V, renderList as A, toDisplayString as o, vModelSelect as j, renderSlot as C, createTextVNode as w, createVNode as E, vShow as H, computed as L, ref as P, withModifiers as K, markRaw as Q, h as Y } from "vue";
2
+ import { e as Z, f as X, u as M, m as ee, _ as te, i as ie } from "./mapEachMetadataItem-Dvf3R5jd.js";
3
+ const ae = {
7
4
  key: 0,
8
5
  xmlns: "http://www.w3.org/2000/svg",
9
6
  fill: "none",
@@ -11,7 +8,7 @@ const Q = {
11
8
  "stroke-width": "1.5",
12
9
  stroke: "currentColor",
13
10
  class: "size-3"
14
- }, X = {
11
+ }, le = {
15
12
  key: 1,
16
13
  xmlns: "http://www.w3.org/2000/svg",
17
14
  fill: "none",
@@ -19,376 +16,630 @@ const Q = {
19
16
  "stroke-width": "1.5",
20
17
  stroke: "currentColor",
21
18
  class: "size-3"
22
- }, C = /* @__PURE__ */ B({
19
+ }, S = /* @__PURE__ */ q({
23
20
  __name: "IconButton",
24
21
  props: {
25
22
  icon: {},
26
23
  color: { default: "blue" }
27
24
  },
28
25
  emits: ["click"],
29
- setup(h) {
30
- return (f, c) => (t(), l("button", {
26
+ setup(p) {
27
+ return (f, c) => (t(), i("button", {
31
28
  type: "button",
32
- class: y(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
33
- "bg-blue-200 hover:bg-blue-300": f.color === "blue",
34
- "bg-red-200 hover:bg-red-300": f.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": p.color === "blue",
31
+ "bg-red-200 hover:bg-red-300": p.color === "red"
35
32
  }]),
36
- onClick: c[0] || (c[0] = (N) => f.$emit("click"))
33
+ onClick: c[0] || (c[0] = (u) => f.$emit("click"))
37
34
  }, [
38
- f.icon === "plus" ? (t(), l("svg", Q, c[1] || (c[1] = [
39
- r("path", {
35
+ p.icon === "plus" ? (t(), i("svg", ae, [...c[1] || (c[1] = [
36
+ a("path", {
40
37
  "stroke-linecap": "round",
41
38
  "stroke-linejoin": "round",
42
39
  d: "M12 4.5v15m7.5-7.5h-15"
43
40
  }, null, -1)
44
- ]))) : s("", !0),
45
- f.icon === "minus" ? (t(), l("svg", X, c[2] || (c[2] = [
46
- r("path", {
41
+ ])])) : n("", !0),
42
+ p.icon === "minus" ? (t(), i("svg", le, [...c[2] || (c[2] = [
43
+ a("path", {
47
44
  "stroke-linecap": "round",
48
45
  "stroke-linejoin": "round",
49
46
  d: "M5 12h14"
50
47
  }, null, -1)
51
- ]))) : s("", !0)
48
+ ])])) : n("", !0)
52
49
  ], 2));
53
50
  }
54
- }), Z = { class: "text-sm whitespace-pre-wrap" }, K = ["data-testid"], M = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, ee = {
51
+ }), ne = ["data-testid", "onClick"], se = { class: "text-sm whitespace-pre-wrap" }, oe = ["data-testid"], de = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, re = {
55
52
  key: 0,
56
53
  class: "text-red-500 dark:text-rose-400"
57
- }, te = {
54
+ }, ce = {
58
55
  key: 1,
59
56
  class: "text-sm text-gray-400"
60
- }, le = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, se = { class: "text-sm whitespace-pre-wrap" }, ie = ["data-testid"], ne = ["for"], oe = {
57
+ }, ue = ["data-testid"], pe = {
58
+ key: 0,
59
+ class: "flex gap-2 flex-wrap"
60
+ }, me = ["disabled", "data-testid", "onClick"], he = ["data-testid", "onClick"], be = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, fe = { class: "text-sm whitespace-pre-wrap" }, Oe = ["data-testid"], ge = {
61
61
  key: 0,
62
62
  class: "text-red-500 dark:text-rose-400"
63
- }, de = {
63
+ }, ye = {
64
64
  key: 1,
65
65
  class: "text-sm text-gray-400"
66
- }, ae = { class: "text-sm whitespace-pre-wrap" }, re = ["data-testid"], ue = ["for"], ce = {
66
+ }, xe = ["data-testid"], ve = {
67
+ key: 0,
68
+ class: "flex gap-2 flex-wrap"
69
+ }, we = ["disabled", "data-testid", "onClick"], ke = ["data-testid", "onClick"], Ce = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, Te = { class: "text-sm whitespace-pre-wrap" }, Se = ["data-testid"], _e = { class: "flex gap-2 items-center" }, Ve = ["data-testid"], We = ["data-testid"], Ae = ["data-testid"], Fe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, $e = { class: "flex flex-col gap-2" }, Be = { class: "flex gap-2 flex-wrap" }, Ne = ["data-testid", "onClick"], Pe = { class: "flex gap-2" }, qe = ["data-testid", "onClick"], Le = ["data-testid", "onClick"], Ee = ["data-testid"], Ie = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ze = ["data-testid"], Re = ["data-testid"], Ue = ["data-testid"], De = ["data-testid"], Je = ["data-testid"], Ge = ["data-testid"], je = ["data-testid"], He = ["data-testid", "data-current"], Ke = ["data-testid", "data-current"], Qe = ["for"], Ye = {
67
70
  key: 0,
68
71
  class: "text-red-500 dark:text-rose-400"
69
- }, pe = {
72
+ }, Ze = {
70
73
  key: 1,
71
74
  class: "text-sm text-gray-400"
72
- }, he = { class: "flex gap-2 items-center" }, me = { class: "flex flex-col grow" }, fe = { class: "text-sm whitespace-pre-wrap" }, be = ["data-testid"], ge = {
75
+ }, Xe = { class: "text-sm whitespace-pre-wrap" }, Me = ["data-testid"], et = ["for"], tt = {
73
76
  key: 0,
74
77
  class: "text-red-500 dark:text-rose-400"
75
- }, ye = {
78
+ }, it = {
79
+ key: 1,
80
+ class: "text-sm text-gray-400"
81
+ }, at = { class: "flex gap-2 items-center" }, lt = { class: "flex flex-col grow" }, nt = { class: "text-sm whitespace-pre-wrap" }, st = ["data-testid"], ot = {
82
+ key: 0,
83
+ class: "text-red-500 dark:text-rose-400"
84
+ }, dt = {
76
85
  key: 1,
77
86
  class: "text-sm text-gray-400"
78
- }, xe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ve = { class: "text-sm whitespace-pre-wrap" }, ke = ["data-testid"], _e = {
87
+ }, rt = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ct = { class: "text-sm whitespace-pre-wrap" }, ut = ["data-testid"], pt = {
79
88
  key: 0,
80
89
  class: "text-red-500 dark:text-rose-400"
81
- }, Oe = {
90
+ }, mt = {
82
91
  key: 1,
83
92
  class: "text-sm text-gray-400"
84
- }, Ce = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, we = { class: "text-sm whitespace-pre-wrap" }, $e = ["data-testid"], Ne = ["id", "value", "disabled", "onChange", "onBlur"], Fe = ["value"], Be = ["id", "onUpdate:modelValue", "disabled", "onBlur"], We = ["value"], Ve = ["id", "checked", "disabled", "onChange", "onBlur"], Te = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Se = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ee = ["id", "value", "disabled", "onInput", "onBlur"], Le = /* @__PURE__ */ B({
93
+ }, ht = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, bt = { class: "text-sm whitespace-pre-wrap" }, ft = ["data-testid"], Ot = ["id", "value", "disabled", "onChange", "onBlur"], gt = ["value"], yt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], xt = ["value"], vt = ["id", "checked", "disabled", "onChange", "onBlur"], wt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], kt = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ct = ["id", "value", "disabled", "onInput", "onBlur"], $ = "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", Tt = "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", St = /* @__PURE__ */ q({
85
94
  __name: "TestFormTemplate",
86
- setup(h) {
87
- const f = G();
88
- return (c, N) => (t(), O(z, { "metadata-configuration": k(f) }, {
89
- heading: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, canAddItems: o, addItem: p, canRemoveItems: b, removeItem: m, slotProps: a }) => [
90
- e.hidden ? s("", !0) : (t(), l("div", {
95
+ setup(p) {
96
+ const f = X();
97
+ return (c, u) => (t(), _(Z, { "metadata-configuration": W(f) }, {
98
+ heading: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, canAddItems: d, addItem: b, canRemoveItems: x, removeItem: y, slotProps: m }) => [
99
+ e.hidden ? n("", !0) : (t(), i("div", {
91
100
  key: 0,
92
- class: y(["mt-4", { "md:col-span-2": e.fullWidth }])
101
+ class: g(["mt-4", { "md:col-span-2": e.fullWidth }])
93
102
  }, [
94
- n ? (t(), l("h3", {
103
+ s ? (t(), i("h3", {
95
104
  key: 0,
96
- class: y(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
105
+ class: g(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || r }])
97
106
  }, [
98
- w(u(n) + " ", 1),
99
- o ? (t(), O(C, {
107
+ w(o(s) + " ", 1),
108
+ d ? (t(), _(S, {
100
109
  key: 0,
101
110
  icon: "plus",
102
111
  tabindex: "-1",
103
112
  "data-testid": `${e.path}-add-button`,
104
- onClick: p
105
- }, null, 8, ["data-testid", "onClick"])) : s("", !0),
106
- b ? (t(), O(C, {
113
+ onClick: b
114
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0),
115
+ x ? (t(), _(S, {
107
116
  key: 1,
108
117
  icon: "minus",
109
118
  tabindex: "-1",
110
119
  color: "red",
111
120
  "data-testid": `${e.path}-remove-button`,
112
- onClick: m
113
- }, null, 8, ["data-testid", "onClick"])) : s("", !0)
114
- ], 2)) : s("", !0),
115
- r("pre", Z, u(e.description), 1),
116
- i.value ? (t(), l("span", {
121
+ onClick: y
122
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0),
123
+ m?.gotoStep ? (t(), i("button", {
124
+ key: 2,
125
+ type: "button",
126
+ "data-testid": `${e.path}-goto-first-step-button`,
127
+ onClick: (v) => m.gotoStep(0)
128
+ }, " back to start ", 8, ne)) : n("", !0)
129
+ ], 2)) : n("", !0),
130
+ a("pre", se, o(e.description), 1),
131
+ l.value ? (t(), i("span", {
117
132
  key: 1,
118
133
  class: "text-red-600 text-sm",
119
134
  "data-testid": `${e.path}-error-message`
120
- }, u(i.value), 9, K)) : s("", !0),
121
- r("div", M, [
122
- v(c.$slots, "default", {
123
- level: (a?.level ?? 0) + 1
135
+ }, o(l.value), 9, oe)) : n("", !0),
136
+ a("div", de, [
137
+ C(c.$slots, "default", {
138
+ level: (m?.level ?? 0) + 1
124
139
  })
125
140
  ])
126
141
  ], 2))
127
142
  ]),
128
- "heading-array": x(() => [
129
- v(c.$slots, "default")
143
+ "heading-array": k(({ fieldMetadata: e, fieldContext: { label: l }, disabled: s, canAddItems: r, addItem: d, slotProps: b }) => [
144
+ e.hidden ? n("", !0) : (t(), i("div", {
145
+ key: 0,
146
+ class: g(["mt-4 flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
147
+ }, [
148
+ l ? (t(), i("h3", {
149
+ key: 0,
150
+ class: g(["flex text-xl font-bold gap-2 items-center", { "text-gray-500": e.disabled || s }])
151
+ }, [
152
+ w(o(l) + " ", 1),
153
+ r ? (t(), _(S, {
154
+ key: 0,
155
+ icon: "plus",
156
+ tabindex: "-1",
157
+ "data-testid": `${e.path}-add-button`,
158
+ onClick: d
159
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0)
160
+ ], 2)) : n("", !0),
161
+ C(c.$slots, "default", {
162
+ hideLabel: !0,
163
+ level: (b?.level ?? 0) + 1
164
+ })
165
+ ], 2))
130
166
  ]),
131
- "default-choice": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, slotProps: p, settings: { showOptionalInsteadOfRequired: b } }) => [
132
- e.hidden ? s("", !0) : (t(), l("div", {
167
+ "default-choice": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, slotProps: b, settings: { showOptionalInsteadOfRequired: x }, addChoiceOccurrence: y, removeChoiceOccurrence: m, canAddChoiceOccurrence: v, usedChoiceOccurrences: T }) => [
168
+ e.hidden ? n("", !0) : (t(), i("div", {
133
169
  key: 0,
134
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
170
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
135
171
  }, [
136
- r("span", {
137
- class: y(["flex gap-2 items-center", { "text-gray-500": d }])
172
+ a("span", {
173
+ class: g(["flex gap-2 items-center", { "text-gray-500": r }])
138
174
  }, [
139
- w(u(n) + " ", 1),
140
- o && !b ? (t(), l("span", ee, "*")) : s("", !0),
141
- !o && b ? (t(), l("span", te, "(optional)")) : s("", !0)
175
+ w(o(s) + " ", 1),
176
+ d && !x ? (t(), i("span", re, "*")) : n("", !0),
177
+ !d && x ? (t(), i("span", ce, "(optional)")) : n("", !0)
142
178
  ], 2),
143
- r("div", le, [
144
- v(c.$slots, "default", {
145
- level: (p?.level ?? 0) + 1,
179
+ a("div", null, [
180
+ u[0] || (u[0] = w("Used choice occurrences: ", -1)),
181
+ a("span", {
182
+ "data-testid": `${e.path}-used-choice-occurrences`
183
+ }, o(T), 9, ue)
184
+ ]),
185
+ e.choice?.length ? (t(), i("div", pe, [
186
+ (t(!0), i(V, null, A(e.choice, (O) => (t(), i("button", {
187
+ key: `${O.name}-add`,
188
+ type: "button",
189
+ class: g($),
190
+ disabled: !v(O.name),
191
+ "data-testid": `${e.path}.${O.name}-add-choice-button`,
192
+ onClick: (F) => y(O.name)
193
+ }, " Add " + o(O.name), 9, me))), 128)),
194
+ (t(!0), i(V, null, A(e.choice, (O) => (t(), i("button", {
195
+ key: `${O.name}-remove`,
196
+ type: "button",
197
+ class: g($),
198
+ "data-testid": `${e.path}.${O.name}-remove-choice-button`,
199
+ onClick: (F) => m(O.name)
200
+ }, " Remove " + o(O.name), 9, he))), 128))
201
+ ])) : n("", !0),
202
+ a("div", be, [
203
+ C(c.$slots, "default", {
204
+ level: (b?.level ?? 0) + 1,
146
205
  belowChoiceField: !0
147
206
  })
148
207
  ]),
149
- r("pre", se, u(e.description), 1),
150
- i.value ? (t(), l("span", {
151
- key: 0,
208
+ a("pre", fe, o(e.description), 1),
209
+ l.value ? (t(), i("span", {
210
+ key: 1,
152
211
  class: "text-red-600 text-sm",
153
212
  "data-testid": `${e.path}-error-message`
154
- }, u(i.value), 9, ie)) : s("", !0)
213
+ }, o(l.value), 9, Oe)) : n("", !0)
214
+ ], 2))
215
+ ]),
216
+ "default-choice-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, slotProps: b, settings: { showOptionalInsteadOfRequired: x }, addChoiceOccurrence: y, removeChoiceOccurrence: m, canAddChoiceOccurrence: v, usedChoiceOccurrences: T }) => [
217
+ e.hidden ? n("", !0) : (t(), i("div", {
218
+ key: 0,
219
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
220
+ }, [
221
+ a("span", {
222
+ class: g(["flex gap-2 items-center", { "text-gray-500": r }])
223
+ }, [
224
+ w(o(s) + " ", 1),
225
+ d && !x ? (t(), i("span", ge, "*")) : n("", !0),
226
+ !d && x ? (t(), i("span", ye, "(optional)")) : n("", !0)
227
+ ], 2),
228
+ a("div", null, [
229
+ u[1] || (u[1] = w("Used choice occurrences: ", -1)),
230
+ a("span", {
231
+ "data-testid": `${e.path}-used-choice-occurrences`
232
+ }, o(T), 9, xe)
233
+ ]),
234
+ e.choice?.length ? (t(), i("div", ve, [
235
+ (t(!0), i(V, null, A(e.choice, (O) => (t(), i("button", {
236
+ key: `${O.name}-add`,
237
+ type: "button",
238
+ class: g($),
239
+ disabled: !v(O.name),
240
+ "data-testid": `${e.path}.${O.name}-add-choice-button`,
241
+ onClick: (F) => y(O.name)
242
+ }, " Add " + o(O.name), 9, we))), 128)),
243
+ (t(!0), i(V, null, A(e.choice, (O) => (t(), i("button", {
244
+ key: `${O.name}-remove`,
245
+ type: "button",
246
+ class: g($),
247
+ "data-testid": `${e.path}.${O.name}-remove-choice-button`,
248
+ onClick: (F) => m(O.name)
249
+ }, " Remove " + o(O.name), 9, ke))), 128))
250
+ ])) : n("", !0),
251
+ a("div", Ce, [
252
+ C(c.$slots, "default", {
253
+ level: (b?.level ?? 0) + 1,
254
+ belowChoiceField: !0
255
+ })
256
+ ]),
257
+ a("pre", Te, o(e.description), 1),
258
+ l.value ? (t(), i("span", {
259
+ key: 1,
260
+ class: "text-red-600 text-sm",
261
+ "data-testid": `${e.path}-error-message`
262
+ }, o(l.value), 9, Se)) : n("", !0)
263
+ ], 2))
264
+ ]),
265
+ "default-choice-array-item": k(({ fieldMetadata: e, slotProps: l, branchKey: s, globalIndex: r, insertionOrder: d, canAddItems: b, addItem: x, removeItem: y }) => [
266
+ e.hidden ? n("", !0) : (t(), i("div", {
267
+ key: 0,
268
+ class: g(["flex flex-col gap-2 border-s-2 ps-2", { "md:col-span-2": e.fullWidth }])
269
+ }, [
270
+ a("div", _e, [
271
+ a("span", {
272
+ "data-testid": `${e.path}-kind-badge`
273
+ }, o(s), 9, Ve),
274
+ u[2] || (u[2] = w(" globalIndex: ", -1)),
275
+ a("span", {
276
+ "data-testid": `${e.path}-global-index`
277
+ }, o(r), 9, We),
278
+ u[3] || (u[3] = w(" insertionOrder: ", -1)),
279
+ d !== void 0 ? (t(), i("span", {
280
+ key: 0,
281
+ "data-testid": `${e.path}-insertion-order`
282
+ }, o(d), 9, Ae)) : n("", !0),
283
+ b ? (t(), _(S, {
284
+ key: 1,
285
+ icon: "plus",
286
+ tabindex: "-1",
287
+ "data-testid": `${e.path}-add-choice-button`,
288
+ onClick: x
289
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0),
290
+ E(S, {
291
+ icon: "minus",
292
+ tabindex: "-1",
293
+ color: "red",
294
+ "data-testid": `${e.path}-remove-choice-button`,
295
+ onClick: y
296
+ }, null, 8, ["data-testid", "onClick"])
297
+ ]),
298
+ a("div", Fe, [
299
+ C(c.$slots, "default", {
300
+ level: (l?.level ?? 0) + 1
301
+ })
302
+ ])
155
303
  ], 2))
156
304
  ]),
157
- "default-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, addItem: b, settings: { showOptionalInsteadOfRequired: m } }) => [
158
- e.hidden ? s("", !0) : (t(), l("div", {
305
+ "default-wizard": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, pages: r, currentStepIndex: d, pageCount: b, isFirst: x, isLast: y, isValidating: m, wizardConfig: v, next: T, prev: O, gotoStep: F, slotProps: J }) => [
306
+ a("div", $e, [
307
+ a("span", null, o(s), 1),
308
+ a("div", Be, [
309
+ (t(!0), i(V, null, A(r, (R, U) => (t(), i("button", {
310
+ key: R.path,
311
+ type: "button",
312
+ class: g($),
313
+ "data-testid": `${e.path}-goto-${U}-button`,
314
+ onClick: (Et) => F(U)
315
+ }, o(R.name), 9, Ne))), 128))
316
+ ]),
317
+ a("div", Pe, [
318
+ a("button", {
319
+ type: "button",
320
+ class: g($),
321
+ "data-testid": `${e.path}-prev-button`,
322
+ onClick: O
323
+ }, " Previous ", 8, qe),
324
+ a("button", {
325
+ type: "button",
326
+ class: g(Tt),
327
+ "data-testid": `${e.path}-next-button`,
328
+ onClick: T
329
+ }, " Next ", 8, Le)
330
+ ]),
331
+ l.value ? (t(), i("span", {
332
+ key: 0,
333
+ class: "text-red-600 text-sm",
334
+ "data-testid": `${e.path}-error-message`
335
+ }, o(l.value), 9, Ee)) : n("", !0),
336
+ a("div", Ie, [
337
+ C(c.$slots, "default", {
338
+ level: (J?.level ?? 0) + 1
339
+ })
340
+ ]),
341
+ a("div", null, [
342
+ u[4] || (u[4] = w("currentStepIndex: ", -1)),
343
+ a("span", {
344
+ "data-testid": `${e.path}-currentStepIndex`
345
+ }, o(d), 9, ze)
346
+ ]),
347
+ a("div", null, [
348
+ u[5] || (u[5] = w("pageCount: ", -1)),
349
+ a("span", {
350
+ "data-testid": `${e.path}-pageCount`
351
+ }, o(b), 9, Re)
352
+ ]),
353
+ a("div", null, [
354
+ u[6] || (u[6] = w("isFirst: ", -1)),
355
+ a("span", {
356
+ "data-testid": `${e.path}-isFirst`
357
+ }, o(x), 9, Ue)
358
+ ]),
359
+ a("div", null, [
360
+ u[7] || (u[7] = w("isLast: ", -1)),
361
+ a("span", {
362
+ "data-testid": `${e.path}-isLast`
363
+ }, o(y), 9, De)
364
+ ]),
365
+ a("div", null, [
366
+ u[8] || (u[8] = w("isValidating: ", -1)),
367
+ a("span", {
368
+ "data-testid": `${e.path}-isValidating`
369
+ }, o(m), 9, Je)
370
+ ]),
371
+ a("div", null, [
372
+ u[9] || (u[9] = w("allowForwardJump: ", -1)),
373
+ a("span", {
374
+ "data-testid": `${e.path}-wizardConfig-allowForwardJump`
375
+ }, o(v.allowForwardJump), 9, Ge)
376
+ ]),
377
+ a("div", null, [
378
+ u[10] || (u[10] = w("validateOnJump: ", -1)),
379
+ a("span", {
380
+ "data-testid": `${e.path}-wizardConfig-validateOnJump`
381
+ }, o(v.validateOnJump), 9, je)
382
+ ])
383
+ ])
384
+ ]),
385
+ "default-wizard-page": k(({ fieldMetadata: e, isCurrent: l, gotoStep: s, slotProps: r, settings: { wizardPageUseVIf: d } }) => [
386
+ d ? l ? (t(), i("div", {
387
+ key: 1,
388
+ "data-testid": `${e.path}-page`,
389
+ "data-current": l
390
+ }, [
391
+ C(c.$slots, "default", {
392
+ gotoStep: s,
393
+ level: r?.level
394
+ })
395
+ ], 8, Ke)) : n("", !0) : B((t(), i("div", {
159
396
  key: 0,
160
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
397
+ "data-testid": `${e.path}-page`,
398
+ "data-current": l
161
399
  }, [
162
- r("label", {
400
+ C(c.$slots, "default", {
401
+ gotoStep: s,
402
+ level: r?.level
403
+ })
404
+ ], 8, He)), [
405
+ [H, l]
406
+ ])
407
+ ]),
408
+ "default-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, canAddItems: b, addItem: x, settings: { showOptionalInsteadOfRequired: y } }) => [
409
+ e.hidden ? n("", !0) : (t(), i("div", {
410
+ key: 0,
411
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
412
+ }, [
413
+ a("label", {
163
414
  for: `${e.path}[0]`,
164
- class: y([{ "text-gray-500": e.disabled || d }, "flex gap-2 items-center"])
415
+ class: g([{ "text-gray-500": e.disabled || r }, "flex gap-2 items-center"])
165
416
  }, [
166
- w(u(n) + " ", 1),
167
- o && !m ? (t(), l("span", oe, "*")) : s("", !0),
168
- !o && m ? (t(), l("span", de, "(optional)")) : s("", !0),
169
- p ? (t(), O(C, {
417
+ w(o(s) + " ", 1),
418
+ d && !y ? (t(), i("span", Ye, "*")) : n("", !0),
419
+ !d && y ? (t(), i("span", Ze, "(optional)")) : n("", !0),
420
+ b ? (t(), _(S, {
170
421
  key: 2,
171
422
  icon: "plus",
172
423
  tabindex: "-1",
173
424
  "data-testid": `${e.path}-add-button`,
174
- onClick: b
175
- }, null, 8, ["data-testid", "onClick"])) : s("", !0)
176
- ], 10, ne),
177
- v(c.$slots, "default", { hideLabel: !0 }),
178
- r("pre", ae, u(e.description), 1),
179
- i.value ? (t(), l("span", {
425
+ onClick: x
426
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0)
427
+ ], 10, Qe),
428
+ C(c.$slots, "default", { hideLabel: !0 }),
429
+ a("pre", Xe, o(e.description), 1),
430
+ l.value ? (t(), i("span", {
180
431
  key: 0,
181
432
  class: "text-red-600 text-sm",
182
433
  "data-testid": `${e.path}-error-message`
183
- }, u(i.value), 9, re)) : s("", !0)
434
+ }, o(l.value), 9, Me)) : n("", !0)
184
435
  ], 2))
185
436
  ]),
186
- default: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canRemoveItems: p, removeItem: b, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
187
- e.hidden ? s("", !0) : (t(), l("div", {
437
+ default: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, canRemoveItems: b, removeItem: x, slotProps: y, settings: { showOptionalInsteadOfRequired: m } }) => [
438
+ e.hidden ? n("", !0) : (t(), i("div", {
188
439
  key: 0,
189
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
440
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
190
441
  }, [
191
- m?.hideLabel ? s("", !0) : (t(), l("label", {
442
+ y?.hideLabel ? n("", !0) : (t(), i("label", {
192
443
  key: 0,
193
444
  for: e.path,
194
- class: y([{ "text-gray-500": e.disabled || d }, "flex gap-1 items-center"])
445
+ class: g([{ "text-gray-500": e.disabled || r }, "flex gap-1 items-center"])
195
446
  }, [
196
- w(u(n) + " ", 1),
197
- o && !a ? (t(), l("span", ce, "*")) : s("", !0),
198
- !o && a ? (t(), l("span", pe, "(optional)")) : s("", !0)
199
- ], 10, ue)),
200
- r("div", he, [
201
- r("div", me, [
202
- v(c.$slots, "default")
447
+ w(o(s) + " ", 1),
448
+ d && !m ? (t(), i("span", tt, "*")) : n("", !0),
449
+ !d && m ? (t(), i("span", it, "(optional)")) : n("", !0)
450
+ ], 10, et)),
451
+ a("div", at, [
452
+ a("div", lt, [
453
+ C(c.$slots, "default")
203
454
  ]),
204
- q(C, {
205
- class: y({ invisible: !p }),
455
+ E(S, {
456
+ class: g({ invisible: !b }),
206
457
  icon: "minus",
207
458
  tabindex: "-1",
208
459
  color: "red",
209
460
  "data-testid": `${e.path}-remove-button`,
210
- onClick: b
461
+ onClick: x
211
462
  }, null, 8, ["class", "data-testid", "onClick"])
212
463
  ]),
213
- r("pre", fe, u(e.description), 1),
214
- i.value ? (t(), l("span", {
464
+ a("pre", nt, o(e.description), 1),
465
+ l.value ? (t(), i("span", {
215
466
  key: 1,
216
467
  class: "text-red-600 text-sm",
217
468
  "data-testid": `${e.path}-error-message`
218
- }, u(i.value), 9, be)) : s("", !0)
469
+ }, o(l.value), 9, st)) : n("", !0)
219
470
  ], 2)),
220
- v(c.$slots, "attributes")
471
+ C(c.$slots, "attributes")
221
472
  ]),
222
- "group-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, addItem: b, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
223
- e.hidden ? (t(), l(F, { key: 0 }, [], 64)) : m?.belowChoiceField ? (t(), l("div", {
473
+ "group-array": k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, canAddItems: b, addItem: x, slotProps: y, settings: { showOptionalInsteadOfRequired: m } }) => [
474
+ e.hidden ? (t(), i(V, { key: 0 }, [], 64)) : y?.belowChoiceField ? (t(), i("div", {
224
475
  key: 1,
225
- class: y({ "md:col-span-2": e.fullWidth })
476
+ class: g({ "md:col-span-2": e.fullWidth })
226
477
  }, [
227
- r("span", {
228
- class: y(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
478
+ a("span", {
479
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || r }])
229
480
  }, [
230
- w(u(n) + " ", 1),
231
- o && !a ? (t(), l("span", ge, "*")) : s("", !0),
232
- !o && a ? (t(), l("span", ye, "(optional)")) : s("", !0),
233
- p ? (t(), O(C, {
481
+ w(o(s) + " ", 1),
482
+ d && !m ? (t(), i("span", ot, "*")) : n("", !0),
483
+ !d && m ? (t(), i("span", dt, "(optional)")) : n("", !0),
484
+ b ? (t(), _(S, {
234
485
  key: 2,
235
486
  icon: "plus",
236
487
  tabindex: "-1",
237
488
  "data-testid": `${e.path}-add-button`,
238
- onClick: b
239
- }, null, 8, ["data-testid", "onClick"])) : s("", !0)
489
+ onClick: x
490
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0)
240
491
  ], 2),
241
- r("div", xe, [
242
- v(c.$slots, "default", {
243
- level: (m?.level ?? 0) + 1
492
+ a("div", rt, [
493
+ C(c.$slots, "default", {
494
+ level: (y?.level ?? 0) + 1
244
495
  })
245
496
  ]),
246
- r("pre", ve, u(e.description), 1),
247
- i.value ? (t(), l("span", {
497
+ a("pre", ct, o(e.description), 1),
498
+ l.value ? (t(), i("span", {
248
499
  key: 0,
249
500
  class: "text-red-600 text-sm",
250
501
  "data-testid": `${e.path}-error-message`
251
- }, u(i.value), 9, ke)) : s("", !0)
252
- ], 2)) : v(c.$slots, "default", { key: 2 })
502
+ }, o(l.value), 9, ut)) : n("", !0)
503
+ ], 2)) : C(c.$slots, "default", { key: 2 })
253
504
  ]),
254
- group: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, canRemoveItems: b, addItem: m, removeItem: a, slotProps: g, settings: { showOptionalInsteadOfRequired: _ } }) => [
255
- e.hidden ? s("", !0) : (t(), l("div", {
505
+ group: k(({ fieldMetadata: e, fieldContext: { errorMessage: l, label: s }, disabled: r, required: d, canAddItems: b, canRemoveItems: x, addItem: y, removeItem: m, slotProps: v, settings: { showOptionalInsteadOfRequired: T } }) => [
506
+ e.hidden ? n("", !0) : (t(), i("div", {
256
507
  key: 0,
257
- class: y({ "md:col-span-2": e.fullWidth })
508
+ class: g({ "md:col-span-2": e.fullWidth })
258
509
  }, [
259
- g?.hideLabel ? s("", !0) : (t(), l("span", {
510
+ v?.hideLabel ? n("", !0) : (t(), i("span", {
260
511
  key: 0,
261
- class: y(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
512
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || r }])
262
513
  }, [
263
- w(u(n) + " ", 1),
264
- o && !_ ? (t(), l("span", _e, "*")) : s("", !0),
265
- !o && _ ? (t(), l("span", Oe, "(optional)")) : s("", !0),
266
- p ? (t(), O(C, {
514
+ w(o(s) + " ", 1),
515
+ d && !T ? (t(), i("span", pt, "*")) : n("", !0),
516
+ !d && T ? (t(), i("span", mt, "(optional)")) : n("", !0),
517
+ b ? (t(), _(S, {
267
518
  key: 2,
268
519
  icon: "plus",
269
520
  tabindex: "-1",
270
521
  "data-testid": `${e.path}-add-button`,
271
- onClick: m
272
- }, null, 8, ["data-testid", "onClick"])) : s("", !0),
273
- b ? (t(), O(C, {
522
+ onClick: y
523
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0),
524
+ x ? (t(), _(S, {
274
525
  key: 3,
275
526
  icon: "minus",
276
527
  tabindex: "-1",
277
528
  "data-testid": `${e.path}-remove-button`,
278
529
  color: "red",
279
- onClick: a
280
- }, null, 8, ["data-testid", "onClick"])) : s("", !0)
530
+ onClick: m
531
+ }, null, 8, ["data-testid", "onClick"])) : n("", !0)
281
532
  ], 2)),
282
- r("div", Ce, [
283
- v(c.$slots, "default", {
284
- level: (g?.level ?? 0) + 1
533
+ a("div", ht, [
534
+ C(c.$slots, "default", {
535
+ level: (v?.level ?? 0) + 1
285
536
  })
286
537
  ]),
287
- r("pre", we, u(e.description), 1),
288
- i.value ? (t(), l("span", {
538
+ a("pre", bt, o(e.description), 1),
539
+ l.value ? (t(), i("span", {
289
540
  key: 1,
290
541
  class: "text-red-600 text-sm",
291
542
  "data-testid": `${e.path}-error-message`
292
- }, u(i.value), 9, $e)) : s("", !0)
543
+ }, o(l.value), 9, ft)) : n("", !0)
293
544
  ], 2)),
294
- v(c.$slots, "attributes")
545
+ C(c.$slots, "attributes")
295
546
  ]),
296
- "select-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
297
- r("select", {
547
+ "select-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s, handleChange: r }, disabled: d }) => [
548
+ a("select", {
298
549
  id: e.path,
299
- value: i.value,
300
- disabled: e.disabled || o,
550
+ value: l.value,
551
+ disabled: e.disabled || d,
301
552
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
302
- onChange: d,
303
- onBlur: n
553
+ onChange: r,
554
+ onBlur: s
304
555
  }, [
305
- (t(!0), l(F, null, T(e.options, ({ key: p, value: b }) => (t(), l("option", {
306
- key: p,
307
- value: p
308
- }, u(b), 9, Fe))), 128))
309
- ], 40, Ne)
556
+ (t(!0), i(V, null, A(e.options, ({ key: b, value: x }) => (t(), i("option", {
557
+ key: b,
558
+ value: b
559
+ }, o(x), 9, gt))), 128))
560
+ ], 40, Ot)
310
561
  ]),
311
- "selectBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
312
- W(r("select", {
562
+ "selectBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s }, disabled: r }) => [
563
+ B(a("select", {
313
564
  id: e.path,
314
- "onUpdate:modelValue": (o) => i.value = o,
315
- disabled: e.disabled || d,
565
+ "onUpdate:modelValue": (d) => l.value = d,
566
+ disabled: e.disabled || r,
316
567
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
317
- onBlur: n
568
+ onBlur: s
318
569
  }, [
319
- (t(!0), l(F, null, T(e.options, ({ key: o, value: p }) => (t(), l("option", {
320
- key: o,
321
- value: o
322
- }, u(p), 9, We))), 128))
323
- ], 40, Be), [
324
- [A, i.value]
570
+ (t(!0), i(V, null, A(e.options, ({ key: d, value: b }) => (t(), i("option", {
571
+ key: d,
572
+ value: d
573
+ }, o(b), 9, xt))), 128))
574
+ ], 40, yt), [
575
+ [j, l.value]
325
576
  ])
326
577
  ]),
327
- "checkbox-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
328
- r("input", {
578
+ "checkbox-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s, handleChange: r }, disabled: d }) => [
579
+ a("input", {
329
580
  id: e.path,
330
- checked: i.value,
331
- disabled: e.disabled || o,
581
+ checked: l.value,
582
+ disabled: e.disabled || d,
332
583
  type: "checkbox",
333
584
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
334
- onChange: (p) => d(p.target.checked),
335
- onBlur: n
336
- }, null, 40, Ve)
585
+ onChange: (b) => r(b.target.checked),
586
+ onBlur: s
587
+ }, null, 40, vt)
337
588
  ]),
338
- "checkboxBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
339
- W(r("input", {
589
+ "checkboxBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s }, disabled: r }) => [
590
+ B(a("input", {
340
591
  id: e.path,
341
- "onUpdate:modelValue": (o) => i.value = o,
342
- disabled: e.disabled || d,
592
+ "onUpdate:modelValue": (d) => l.value = d,
593
+ disabled: e.disabled || r,
343
594
  type: "checkbox",
344
595
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
345
- onBlur: n
346
- }, null, 40, Te), [
347
- [R, i.value]
596
+ onBlur: s
597
+ }, null, 40, wt), [
598
+ [z, l.value]
348
599
  ])
349
600
  ]),
350
- "textBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
351
- W(r("input", {
601
+ "textBoundByVModel-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s }, disabled: r }) => [
602
+ B(a("input", {
352
603
  id: e.path,
353
- "onUpdate:modelValue": (o) => i.value = o,
354
- disabled: e.disabled || d,
604
+ "onUpdate:modelValue": (d) => l.value = d,
605
+ disabled: e.disabled || r,
355
606
  type: "text",
356
607
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
357
- onBlur: n
358
- }, null, 40, Se), [
359
- [I, i.value]
608
+ onBlur: s
609
+ }, null, 40, kt), [
610
+ [G, l.value]
360
611
  ])
361
612
  ]),
362
- "default-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
363
- r("input", {
613
+ "default-input": k(({ fieldMetadata: e, fieldContext: { value: l, handleBlur: s, handleChange: r }, disabled: d }) => [
614
+ a("input", {
364
615
  id: e.path,
365
- value: i.value,
366
- disabled: e.disabled || o,
616
+ value: l.value,
617
+ disabled: e.disabled || d,
367
618
  type: "text",
368
619
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
369
- onInput: d,
370
- onBlur: n
371
- }, null, 40, Ee)
620
+ onInput: r,
621
+ onBlur: s
622
+ }, null, 40, Ct)
372
623
  ]),
373
624
  _: 3
374
625
  }, 8, ["metadata-configuration"]));
375
626
  }
376
- }), qe = { class: "flex justify-end gap-2" }, De = {
627
+ }), _t = { class: "flex justify-end gap-2" }, Vt = {
377
628
  key: 1,
378
629
  type: "submit",
379
630
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
380
631
  "data-testid": "submit"
381
- }, Ie = {
632
+ }, Wt = {
382
633
  key: 0,
383
634
  "data-testid": "errors",
384
635
  class: "col-12 text-red-600"
385
- }, Re = ["innerHTML"], Ae = {
636
+ }, At = ["innerHTML"], Ft = {
386
637
  key: 1,
387
638
  "data-testid": "isSubmitted"
388
- }, Ue = {
639
+ }, $t = {
389
640
  key: 2,
390
641
  class: "bg-gray-100 p-4 rounded-lg text-sm overflow-auto"
391
- }, je = /* @__PURE__ */ B({
642
+ }, D = /* @__PURE__ */ q({
392
643
  __name: "TestForm",
393
644
  props: {
394
645
  metadata: {},
@@ -396,23 +647,30 @@ const Q = {
396
647
  showDebugState: { type: Boolean, default: !1 },
397
648
  initialEdit: { type: Boolean, default: !0 },
398
649
  hideFieldsWithoutValue: { type: Boolean, default: !1 },
399
- initialValues: {}
650
+ initialValues: {},
651
+ keepValuesOnUnmount: { type: Boolean }
400
652
  },
401
- setup(h) {
402
- const { values: f, handleSubmit: c, errors: N, meta: e } = H({
403
- initialValues: h.initialValues
404
- }), i = V(), n = V(h.initialEdit), d = V(!1), o = L(() => h.metadata?.map((m) => S(m, (a) => (a.computedProps = a.computedProps ?? [], a.computedProps.push((g) => {
405
- n.value || (g.disabled = !0);
406
- }), h.hideFieldsWithoutValue && (a.computedProps.push((g, _) => {
407
- !n.value && !Y(_.value) && (g.hidden = !0);
408
- }), a.computedProps.push((g, _, E) => {
409
- !n.value && E.value.length > 0 && E.value.every((D) => D.hidden) && (g.hidden = !0);
410
- })), a)))), p = L(() => ({
653
+ setup(p) {
654
+ const { values: f, handleSubmit: c, errors: u, meta: e } = M({
655
+ initialValues: p.initialValues,
656
+ // Passed as a computed ref (not the destructured value directly) so a live toggle of the prop
657
+ // after mount keeps affecting unmount behaviour, instead of freezing whatever it was at setup time.
658
+ keepValuesOnUnmount: L(() => p.keepValuesOnUnmount)
659
+ }), l = P(), s = P(p.initialEdit), r = P(!1), d = L(() => p.metadata?.map((y) => ee(y, (m) => (m.computedProps = m.computedProps ?? [], m.computedProps.push((v) => {
660
+ s.value || (v.disabled = !0);
661
+ }), p.hideFieldsWithoutValue && (m.computedProps.push((v, T) => {
662
+ !s.value && !ie(T.value) && (v.hidden = !0);
663
+ }), m.computedProps.push((v, T, O) => {
664
+ !s.value && O.value.length > 0 && O.value.every((F) => F.hidden) && (v.hidden = !0);
665
+ })), m)))), b = L(() => ({
411
666
  analytics: !0,
412
667
  messages: {
413
668
  required: "{field} is required",
414
669
  minOccurs: "At least {min} items required",
670
+ maxOccurs: "At most {max} items allowed",
415
671
  choiceMinOccurs: "The following fields need to occur at least {min} time(s): {field}",
672
+ choiceMaxOccurs: "The following fields may occur at most {max} time(s): {field}",
673
+ maxOccursTotal: "This branch may occur at most {max} time(s) in total: {field}",
416
674
  minLength: "The minimum length of {field} is {length}",
417
675
  maxLength: "The maximum length of {field} is {length}",
418
676
  length: "{field} must be exactly {length} characters",
@@ -426,153 +684,194 @@ const Q = {
426
684
  fractionDigits: "{field} may have at most {digits} decimal place(s)",
427
685
  totalDigits: "{field} may have at most {digits} significant digit(s)"
428
686
  },
429
- ...h.settings ?? {}
687
+ ...p.settings ?? {}
430
688
  }));
431
- function b(m) {
689
+ function x(y) {
432
690
  c(
433
- (a) => {
434
- d.value = !0, n.value = !1;
691
+ (m) => {
692
+ r.value = !0, s.value = !1;
435
693
  },
436
- ({ errors: a }) => {
437
- d.value = !1;
694
+ ({ errors: m }) => {
695
+ r.value = !1;
438
696
  }
439
- )(m);
697
+ )(y);
440
698
  }
441
- return (m, a) => (t(), l("form", {
442
- onSubmit: U(b, ["prevent"])
699
+ return (y, m) => (t(), i("form", {
700
+ onSubmit: K(x, ["prevent"])
443
701
  }, [
444
- r("div", qe, [
445
- n.value ? s("", !0) : (t(), l("button", {
702
+ a("div", _t, [
703
+ s.value ? n("", !0) : (t(), i("button", {
446
704
  key: 0,
447
705
  type: "button",
448
706
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
449
707
  "data-testid": "submit",
450
- onClick: a[0] || (a[0] = (g) => n.value = !0)
708
+ onClick: m[0] || (m[0] = (v) => s.value = !0)
451
709
  }, " Edit ")),
452
- n.value ? (t(), l("button", De, " Submit ")) : s("", !0),
453
- n.value ? (t(), l("button", {
710
+ s.value ? (t(), i("button", Vt, " Submit ")) : n("", !0),
711
+ s.value ? (t(), i("button", {
454
712
  key: 2,
455
713
  type: "button",
456
714
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
457
715
  "data-testid": "cancel",
458
- onClick: a[1] || (a[1] = (g) => n.value = !1)
459
- }, " Cancel ")) : s("", !0)
716
+ onClick: m[1] || (m[1] = (v) => s.value = !1)
717
+ }, " Cancel ")) : n("", !0)
460
718
  ]),
461
- Object.values(k(N)).length ? (t(), l("div", Ie, [
462
- a[3] || (a[3] = w(" Errors: ", -1)),
463
- r("ul", null, [
464
- (t(!0), l(F, null, T(k(N), (g, _) => (t(), l("li", { key: _ }, [
465
- r("span", { innerHTML: g }, null, 8, Re)
719
+ Object.values(W(u)).length ? (t(), i("div", Wt, [
720
+ m[3] || (m[3] = w(" Errors: ", -1)),
721
+ a("ul", null, [
722
+ (t(!0), i(V, null, A(W(u), (v, T) => (t(), i("li", { key: T }, [
723
+ a("span", { innerHTML: v }, null, 8, At)
466
724
  ]))), 128))
467
725
  ])
468
- ])) : s("", !0),
469
- q(J, {
470
- template: Le,
471
- metadata: o.value,
472
- settings: p.value,
473
- "onUpdate:modelValue": a[2] || (a[2] = (g) => i.value = g)
726
+ ])) : n("", !0),
727
+ E(te, {
728
+ template: St,
729
+ metadata: d.value,
730
+ settings: b.value,
731
+ "onUpdate:modelValue": m[2] || (m[2] = (v) => l.value = v)
474
732
  }, null, 8, ["metadata", "settings"]),
475
- d.value ? (t(), l("span", Ae)) : s("", !0),
476
- m.showDebugState ? (t(), l("pre", Ue, "IsDirty: " + u(k(e).dirty) + `
477
- Pending: ` + u(k(e).pending) + `
478
- Touched: ` + u(k(e).touched) + `
479
- Valid: ` + u(k(e).valid) + `
480
- Submitted: ` + u(d.value) + `
733
+ r.value ? (t(), i("span", Ft)) : n("", !0),
734
+ p.showDebugState ? (t(), i("pre", $t, "IsDirty: " + o(W(e).dirty) + `
735
+ Pending: ` + o(W(e).pending) + `
736
+ Touched: ` + o(W(e).touched) + `
737
+ Valid: ` + o(W(e).valid) + `
738
+ Submitted: ` + o(r.value) + `
481
739
 
482
740
  // form values:
483
- ` + u(JSON.stringify(k(f), null, 2)) + `
484
- `, 1)) : s("", !0)
741
+ ` + o(JSON.stringify(W(f), null, 2)) + `
742
+ `, 1)) : n("", !0)
485
743
  ], 32));
486
744
  }
487
- }), Ge = $([{
745
+ }), Rt = h([{
488
746
  name: "text",
489
747
  type: "text",
490
748
  fieldOptions: { label: "Text Input" },
491
749
  path: "with.custom.structure",
492
750
  restriction: { maxLength: 10 }
493
- }]), He = $([{
751
+ }]), Ut = {
752
+ with: { custom: { structure: "Order A204" } }
753
+ }, Dt = h([{
754
+ name: "arrays",
494
755
  fieldOptions: { label: "Array Fields" },
495
756
  type: "heading",
496
757
  children: [
497
- { fieldOptions: { label: "Optional field (max 3)" }, minOccurs: 0, maxOccurs: 3 },
498
- { fieldOptions: { label: "Required field (max 3)" }, maxOccurs: 3 },
499
- { fieldOptions: { label: "2 Fields required" }, minOccurs: 2, maxOccurs: 4 },
500
- { fieldOptions: { label: "Section (2 sections required)" }, type: "heading", minOccurs: 2, maxOccurs: 4, fullWidth: !0, children: [
501
- { fieldOptions: { label: "Nested field 1" } },
502
- { fieldOptions: { label: "Required Nested field 2" }, type: "select", options: [
758
+ { name: "optionalItems", fieldOptions: { label: "Optional field (max 3)" }, minOccurs: 0, maxOccurs: 3 },
759
+ { name: "requiredItems", fieldOptions: { label: "Required field (max 3)" }, maxOccurs: 3 },
760
+ { name: "twoRequired", fieldOptions: { label: "2 Fields required" }, minOccurs: 2, maxOccurs: 4 },
761
+ { name: "sections", fieldOptions: { label: "Section (2 sections required)" }, type: "heading", minOccurs: 2, maxOccurs: 4, fullWidth: !0, children: [
762
+ { name: "note", fieldOptions: { label: "Nested field 1" } },
763
+ { name: "category", fieldOptions: { label: "Required Nested field 2" }, type: "select", options: [
503
764
  { key: "option1", value: "Option 1" },
504
765
  { key: "option2", value: "Option 2" },
505
766
  { key: "option3", value: "Option 3" }
506
767
  ] },
507
- { fieldOptions: { label: "Nested field 3" }, type: "checkbox" }
768
+ { name: "flag", fieldOptions: { label: "Nested field 3" }, type: "checkbox" }
508
769
  ] }
509
770
  ]
510
- }]), Je = $([{
771
+ }]), Jt = {
772
+ arrays: {
773
+ optionalItems: ["First note"],
774
+ requiredItems: ["Alpha", "Beta"],
775
+ twoRequired: ["One", "Two"],
776
+ sections: [
777
+ { note: "Section one", category: "option2", flag: !0 },
778
+ { note: "Section two", category: "option1", flag: !1 }
779
+ ]
780
+ }
781
+ }, Gt = h([{
782
+ name: "groups",
511
783
  fieldOptions: { label: "Grouped Fields" },
512
784
  type: "heading",
513
785
  children: [
514
- { fieldOptions: { label: "Required group" }, type: "group", children: [
515
- { fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
516
- { fieldOptions: { label: "Required Nested field 2" }, fullWidth: !0 }
786
+ { name: "requiredGroup", fieldOptions: { label: "Required group" }, type: "group", children: [
787
+ { name: "first", fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
788
+ { name: "second", fieldOptions: { label: "Required Nested field 2" }, fullWidth: !0 }
517
789
  ] },
518
- { fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, description: `The group is optional, therefore the children will only be required once 1 value is filled in.
519
-
790
+ { name: "optionalGroup", fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, description: `The group is optional, therefore the children will only be required once 1 value is filled in.
791
+
520
792
  You can test it by filling in one of the fields.`, children: [
521
- { fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
522
- { fieldOptions: { label: "Required Nested field 2" }, fullWidth: !0 }
793
+ { name: "first", fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
794
+ { name: "second", fieldOptions: { label: "Required Nested field 2" }, fullWidth: !0 }
523
795
  ] }
524
796
  ]
525
797
  }, {
798
+ name: "groupArrays",
526
799
  fieldOptions: { label: "Grouped Array Fields" },
527
800
  type: "heading",
528
801
  children: [
529
- { fieldOptions: { label: "Required group" }, type: "group", maxOccurs: 5, fullWidth: !0, children: [
530
- { fieldOptions: { label: "Required Nested field 1" } },
531
- { fieldOptions: { label: "Required Nested field 2" } }
802
+ { name: "requiredGroups", fieldOptions: { label: "Required group" }, type: "group", maxOccurs: 5, fullWidth: !0, children: [
803
+ { name: "first", fieldOptions: { label: "Required Nested field 1" } },
804
+ { name: "second", fieldOptions: { label: "Required Nested field 2" } }
532
805
  ] },
533
- { fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, maxOccurs: 5, fullWidth: !0, children: [
534
- { fieldOptions: { label: "Required Nested field 1" } },
535
- { fieldOptions: { label: "Required Nested field 2" } }
806
+ { name: "optionalGroups", fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, maxOccurs: 5, fullWidth: !0, children: [
807
+ { name: "first", fieldOptions: { label: "Required Nested field 1" } },
808
+ { name: "second", fieldOptions: { label: "Required Nested field 2" } }
536
809
  ] }
537
810
  ]
538
- }]), Ye = $([
811
+ }]), jt = {
812
+ groups: {
813
+ requiredGroup: { first: "Ada", second: "Lovelace" },
814
+ optionalGroup: { first: "Grace", second: "Hopper" }
815
+ },
816
+ groupArrays: {
817
+ requiredGroups: [
818
+ { first: "Alan", second: "Turing" },
819
+ { first: "Edsger", second: "Dijkstra" }
820
+ ],
821
+ optionalGroups: [
822
+ { first: "Barbara", second: "Liskov" }
823
+ ]
824
+ }
825
+ }, Ht = h([
539
826
  {
827
+ name: "simpleChoiceSection",
540
828
  fieldOptions: { label: "Choice Fields (minOccurs 1, maxOccurs 1)" },
541
829
  type: "heading",
542
830
  children: [
543
- { fieldOptions: { label: "Simple Choice Field" }, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
544
- { fieldOptions: { label: "Nested Field 1" } },
545
- { fieldOptions: { label: "Nested Field 2" } }
831
+ { name: "contactMethod", fieldOptions: { label: "Simple Choice Field" }, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
832
+ { name: "primary", fieldOptions: { label: "Nested Field 1" } },
833
+ { name: "secondary", fieldOptions: { label: "Nested Field 2" } }
546
834
  ] }
547
835
  ]
548
836
  },
549
837
  {
838
+ name: "groupedChoiceSection",
550
839
  fieldOptions: { label: "Choice Grouped Fields (minOccurs 1, maxOccurs 3)" },
551
840
  type: "heading",
552
841
  children: [
553
- { fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
554
- { fieldOptions: { label: "Nested Field 1" }, type: "group", children: [
555
- { fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
556
- { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
842
+ { name: "pick", fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
843
+ { name: "optionA", fieldOptions: { label: "Nested Field 1" }, type: "group", children: [
844
+ { name: "detail1", fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
845
+ { name: "detail2", fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
557
846
  ] },
558
- { fieldOptions: { label: "Nested Field 2" }, type: "group", children: [
559
- { fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
560
- { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
847
+ { name: "optionB", fieldOptions: { label: "Nested Field 2" }, type: "group", children: [
848
+ { name: "detail1", fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
849
+ { name: "detail2", fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
561
850
  ] }
562
851
  ] }
563
852
  ]
564
853
  },
565
854
  {
855
+ name: "arrayChoiceSection",
566
856
  fieldOptions: { label: "Choice Array Fields (minOccurs 1, maxOccurs 3)" },
567
857
  type: "heading",
568
858
  children: [
569
- { fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
570
- { fieldOptions: { label: "Nested Field 1" }, maxOccurs: 3 },
571
- { fieldOptions: { label: "Nested Field 2" }, maxOccurs: 3 }
859
+ { name: "pick", fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
860
+ { name: "optionA", fieldOptions: { label: "Nested Field 1" }, maxOccurs: 3 },
861
+ { name: "optionB", fieldOptions: { label: "Nested Field 2" }, maxOccurs: 3 }
572
862
  ] }
573
863
  ]
574
864
  }
575
- ]), Qe = $([
865
+ ]), Kt = {
866
+ // Only one branch per choice carries a value, honouring the mutually exclusive rule.
867
+ simpleChoiceSection: { contactMethod: { primary: "Picked the first branch" } },
868
+ groupedChoiceSection: {
869
+ pick: { optionA: [{ detail1: "Group A, item 1a", detail2: "Group A, item 1b" }] }
870
+ },
871
+ arrayChoiceSection: {
872
+ pick: { optionA: ["First entry", "Second entry"] }
873
+ }
874
+ }, Qt = h([
576
875
  {
577
876
  fieldOptions: { label: "Personal Info" },
578
877
  type: "heading",
@@ -605,7 +904,611 @@ You can test it by filling in one of the fields.`, children: [
605
904
  lastName: "Smit"
606
905
  }
607
906
  }
608
- }), Xe = $(
907
+ }), Yt = {
908
+ person: {
909
+ firstName: "Ada",
910
+ lastName: "Lovelace",
911
+ email: "ada@example.com"
912
+ },
913
+ address: {
914
+ street: "Baker Street 221B",
915
+ city: "London",
916
+ country: "United Kingdom"
917
+ }
918
+ }, Zt = h([
919
+ {
920
+ name: "inputs",
921
+ fieldOptions: { label: "All Input Types" },
922
+ type: "heading",
923
+ description: "Every dedicated input slot plus the default fallback, in both handleChange and v-model binding styles.",
924
+ children: [
925
+ { name: "text", type: "text", fieldOptions: { label: "Text" } },
926
+ { name: "textBoundByVModel", type: "textBoundByVModel", fieldOptions: { label: "Text (v-model)" } },
927
+ { name: "select", type: "select", fieldOptions: { label: "Select" }, options: [
928
+ { key: "option1", value: "Option 1" },
929
+ { key: "option2", value: "Option 2" },
930
+ { key: "option3", value: "Option 3" }
931
+ ] },
932
+ { name: "selectBoundByVModel", type: "selectBoundByVModel", fieldOptions: { label: "Select (v-model)" }, options: [
933
+ { key: "option1", value: "Option 1" },
934
+ { key: "option2", value: "Option 2" },
935
+ { key: "option3", value: "Option 3" }
936
+ ] },
937
+ { name: "checkbox", type: "checkbox", minOccurs: 0, fieldOptions: { label: "Checkbox" } },
938
+ { name: "checkboxBoundByVModel", type: "checkboxBoundByVModel", minOccurs: 0, fieldOptions: { label: "Checkbox (v-model)" } },
939
+ { name: "noType", fieldOptions: { label: "No type (default-input fallback)" } }
940
+ ]
941
+ },
942
+ {
943
+ name: "staticProps",
944
+ fieldOptions: { label: "Static Field Props" },
945
+ type: "heading",
946
+ description: "One field here has hidden: true and should not render at all.",
947
+ children: [
948
+ { name: "optionalField", minOccurs: 0, fieldOptions: { label: "Optional field (minOccurs 0)" } },
949
+ { name: "disabledField", minOccurs: 0, disabled: !0, fieldOptions: { label: "Disabled field" } },
950
+ { name: "hiddenField", minOccurs: 0, hidden: !0, fieldOptions: { label: "Hidden field (should not be visible)" } },
951
+ { name: "fullWidthField", minOccurs: 0, fullWidth: !0, fieldOptions: { label: "Full width field" } },
952
+ { name: "describedField", minOccurs: 0, description: "A per-field description rendered below the input.", fieldOptions: { label: "Field with description" } }
953
+ ]
954
+ }
955
+ ]), Xt = {
956
+ inputs: {
957
+ text: "Hello world",
958
+ textBoundByVModel: "Two-way bound",
959
+ select: "option2",
960
+ selectBoundByVModel: "option3",
961
+ checkbox: !0,
962
+ checkboxBoundByVModel: !1,
963
+ noType: "Fallback input"
964
+ },
965
+ staticProps: {
966
+ optionalField: "Filled optional",
967
+ disabledField: "Preset while disabled",
968
+ fullWidthField: "Spans the full width",
969
+ describedField: "Described value"
970
+ }
971
+ }, Mt = h([
972
+ {
973
+ name: "strings",
974
+ fieldOptions: { label: "String Restrictions" },
975
+ type: "heading",
976
+ description: "All fields are optional so only the restriction errors surface.",
977
+ children: [
978
+ { name: "minLength", minOccurs: 0, restriction: { minLength: 3 }, fieldOptions: { label: "minLength 3" } },
979
+ { name: "maxLength", minOccurs: 0, restriction: { maxLength: 5 }, fieldOptions: { label: "maxLength 5" } },
980
+ { name: "length", minOccurs: 0, restriction: { length: 4 }, fieldOptions: { label: "length 4 (exact)" } },
981
+ { name: "pattern", minOccurs: 0, restriction: { pattern: "^[A-Z]{2}-\\d{3}$" }, description: "Two uppercase letters, a dash, three digits (e.g. AB-123).", fieldOptions: { label: "pattern" } },
982
+ { name: "enumeration", minOccurs: 0, restriction: { enumeration: ["red", "green", "blue"] }, description: "Only red, green or blue are allowed.", fieldOptions: { label: "enumeration" } },
983
+ { name: "whiteSpace", minOccurs: 0, restriction: { whiteSpace: "collapse" }, description: "Leading, trailing or double spaces are invalid.", fieldOptions: { label: "whiteSpace collapse" } }
984
+ ]
985
+ },
986
+ {
987
+ name: "numbers",
988
+ fieldOptions: { label: "Numeric Restrictions" },
989
+ type: "heading",
990
+ children: [
991
+ { name: "minInclusive", minOccurs: 0, restriction: { minInclusive: 5 }, fieldOptions: { label: "minInclusive 5 (value >= 5)" } },
992
+ { name: "maxInclusive", minOccurs: 0, restriction: { maxInclusive: 10 }, fieldOptions: { label: "maxInclusive 10 (value <= 10)" } },
993
+ { name: "minExclusive", minOccurs: 0, restriction: { minExclusive: 0 }, fieldOptions: { label: "minExclusive 0 (value > 0)" } },
994
+ { name: "maxExclusive", minOccurs: 0, restriction: { maxExclusive: 100 }, fieldOptions: { label: "maxExclusive 100 (value < 100)" } },
995
+ { name: "fractionDigits", minOccurs: 0, restriction: { fractionDigits: 2 }, fieldOptions: { label: "fractionDigits 2 (max 2 decimals)" } },
996
+ { name: "totalDigits", minOccurs: 0, restriction: { totalDigits: 5 }, fieldOptions: { label: "totalDigits 5" } }
997
+ ]
998
+ },
999
+ {
1000
+ name: "mixed",
1001
+ fieldOptions: { label: "Combined & Custom" },
1002
+ type: "heading",
1003
+ children: [
1004
+ { 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" } },
1005
+ { name: "requiredWithRestriction", restriction: { minLength: 3 }, fieldOptions: { label: "Required + minLength 3" } },
1006
+ { name: "customValidation", minOccurs: 0, validation: (p) => !p || String(p).startsWith("A") || 'Value must start with "A"', description: "Custom vee-validate function via the validation property.", fieldOptions: { label: "Custom validation function" } }
1007
+ ]
1008
+ }
1009
+ ]), ei = {
1010
+ // Every value here satisfies its restriction, so loading the sample form validates cleanly.
1011
+ strings: {
1012
+ minLength: "abcd",
1013
+ maxLength: "abc",
1014
+ length: "code",
1015
+ pattern: "AB-123",
1016
+ enumeration: "green",
1017
+ whiteSpace: "clean text"
1018
+ },
1019
+ numbers: {
1020
+ minInclusive: "7",
1021
+ maxInclusive: "9",
1022
+ minExclusive: "3",
1023
+ maxExclusive: "42",
1024
+ fractionDigits: "3.14",
1025
+ totalDigits: "12345"
1026
+ },
1027
+ mixed: {
1028
+ combined: "hello",
1029
+ requiredWithRestriction: "valid",
1030
+ customValidation: "Apple"
1031
+ }
1032
+ }, ti = h([
1033
+ {
1034
+ name: "occurrences",
1035
+ fieldOptions: { label: "Occurrence Variants" },
1036
+ type: "heading",
1037
+ children: [
1038
+ { name: "manualFirstItem", minOccurs: 1, maxOccurs: 3, autoAddMinOccurs: !1, description: "Starts empty even though 1 item is required (autoAddMinOccurs: false). Add the first item yourself; submitting while empty shows the minOccurs error.", fieldOptions: { label: "No auto first item" } },
1039
+ { name: "prefilledToMin", minOccurs: 2, maxOccurs: 4, description: "Auto-fills 2 empty items on first render (the default behaviour).", fieldOptions: { label: "Pre-filled to minOccurs 2" } },
1040
+ { name: "manyAllowed", minOccurs: 0, maxOccurs: 10, fieldOptions: { label: "Optional, up to 10 items" } }
1041
+ ]
1042
+ },
1043
+ {
1044
+ name: "typedArrays",
1045
+ fieldOptions: { label: "Arrays of Other Input Types" },
1046
+ type: "heading",
1047
+ children: [
1048
+ { name: "selects", type: "select", minOccurs: 0, maxOccurs: 3, fieldOptions: { label: "Select array (max 3)" }, options: [
1049
+ { key: "option1", value: "Option 1" },
1050
+ { key: "option2", value: "Option 2" }
1051
+ ] },
1052
+ { name: "checkboxes", type: "checkbox", minOccurs: 0, maxOccurs: 3, fieldOptions: { label: "Checkbox array (max 3)" } },
1053
+ { name: "vModelTexts", type: "textBoundByVModel", minOccurs: 0, maxOccurs: 3, fieldOptions: { label: "v-model text array (max 3)" } }
1054
+ ]
1055
+ }
1056
+ ]), ii = {
1057
+ occurrences: {
1058
+ manualFirstItem: ["Added by hand"],
1059
+ prefilledToMin: ["First", "Second"],
1060
+ manyAllowed: ["One", "Two", "Three"]
1061
+ },
1062
+ typedArrays: {
1063
+ selects: ["option1", "option2"],
1064
+ checkboxes: [!0, !1],
1065
+ vModelTexts: ["Alpha", "Beta"]
1066
+ }
1067
+ }, ai = h([
1068
+ {
1069
+ name: "overLimit",
1070
+ fieldOptions: { label: "Over-limit Arrays (loaded from initialValues)" },
1071
+ type: "heading",
1072
+ children: [
1073
+ { name: "requiredItems", minOccurs: 1, maxOccurs: 2, fieldOptions: { label: "Required (max 2)" }, description: "Loaded with 3 items, one over the maximum. Submit to see the xsd_maxOccurs error; the Add button is already disabled." },
1074
+ { 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." }
1075
+ ]
1076
+ }
1077
+ ]), li = {
1078
+ overLimit: {
1079
+ requiredItems: ["First", "Second", "Third"],
1080
+ optionalItems: ["One", "Two", "Three"]
1081
+ }
1082
+ }, ni = h([
1083
+ {
1084
+ name: "optionalChoice",
1085
+ fieldOptions: { label: "Optional Choice (minOccurs 0)" },
1086
+ type: "heading",
1087
+ children: [
1088
+ { name: "contact", fieldOptions: { label: "Optional choice" }, minOccurs: 0, fullWidth: !0, description: "Valid when left completely empty; still only one branch may hold a value.", choice: [
1089
+ { name: "email", fieldOptions: { label: "Email" } },
1090
+ { name: "phone", fieldOptions: { label: "Phone" } }
1091
+ ] }
1092
+ ]
1093
+ },
1094
+ {
1095
+ name: "twoOccurrence",
1096
+ fieldOptions: { label: "Choice Requiring 2 Occurrences (minOccurs 2, maxOccurs 4)" },
1097
+ type: "heading",
1098
+ children: [
1099
+ { name: "contact", fieldOptions: { label: "At least 2 occurrences" }, minOccurs: 2, maxOccurs: 4, fullWidth: !0, description: "Submit with fewer than 2 filled occurrences to see the choiceMinOccurs error.", choice: [
1100
+ { name: "email", fieldOptions: { label: "Email" } },
1101
+ { name: "phone", fieldOptions: { label: "Phone" } }
1102
+ ] }
1103
+ ]
1104
+ },
1105
+ {
1106
+ name: "differentLimits",
1107
+ fieldOptions: { label: "Branches With Different Limits (maxOccurs 3)" },
1108
+ type: "heading",
1109
+ children: [
1110
+ { name: "entries", fieldOptions: { label: "Per-iteration branch limits" }, maxOccurs: 3, fullWidth: !0, description: "Branch A allows 2 items per choice iteration, branch B only 1; the choice itself may repeat 3 times.", choice: [
1111
+ { name: "branchA", maxOccurs: 2, fieldOptions: { label: "Branch A (maxOccurs 2)" } },
1112
+ { name: "branchB", maxOccurs: 1, fieldOptions: { label: "Branch B (maxOccurs 1)" } }
1113
+ ] }
1114
+ ]
1115
+ },
1116
+ {
1117
+ name: "totalCap",
1118
+ fieldOptions: { label: "Branch Total Cap (maxOccursTotal, maxOccurs 4)" },
1119
+ type: "heading",
1120
+ children: [
1121
+ { name: "entries", fieldOptions: { label: "Capped branch totals" }, maxOccurs: 4, fullWidth: !0, description: "The capped branch may reach at most 3 items in total across the whole choice, even though the shared budget would allow more.", choice: [
1122
+ { name: "capped", maxOccurs: 2, maxOccursTotal: 3, fieldOptions: { label: "Capped (maxOccurs 2, maxOccursTotal 3)" } },
1123
+ { name: "uncapped", maxOccurs: 2, fieldOptions: { label: "Uncapped (maxOccurs 2)" } }
1124
+ ] }
1125
+ ]
1126
+ },
1127
+ {
1128
+ name: "singleBranchCap",
1129
+ fieldOptions: { label: "Single-Branch Total Cap (maxOccursTotal 2)" },
1130
+ type: "heading",
1131
+ children: [
1132
+ { name: "tags", fieldOptions: { label: "Capped single branch" }, fullWidth: !0, description: "A one-branch choice renders its branch directly, with no occurrence budget to share. The branch declares maxOccurs 3 but maxOccursTotal 2, so the add button disables after 2 items.", choice: [
1133
+ { name: "tag", maxOccurs: 3, maxOccursTotal: 2, fieldOptions: { label: "Tag (maxOccurs 3, maxOccursTotal 2)" } }
1134
+ ] },
1135
+ { name: "clamped", fieldOptions: { label: "Cap above maxOccurs has no effect" }, fullWidth: !0, description: "maxOccursTotal can only tighten: this branch declares maxOccurs 2 with maxOccursTotal 5, and still stops at 2 items.", choice: [
1136
+ { name: "item", maxOccurs: 2, maxOccursTotal: 5, fieldOptions: { label: "Item (maxOccurs 2, maxOccursTotal 5)" } }
1137
+ ] }
1138
+ ]
1139
+ }
1140
+ ]), si = {
1141
+ optionalChoice: { contact: { email: "ada@example.com" } },
1142
+ // Two filled email occurrences satisfy the minOccurs 2 requirement.
1143
+ twoOccurrence: { contact: { email: ["ada@example.com", "grace@example.com"] } },
1144
+ differentLimits: { entries: { branchA: ["A-one", "A-two"] } },
1145
+ totalCap: { entries: { capped: ["C-one", "C-two"] } },
1146
+ // Both single branches filled exactly to their effective cap, so every add button is disabled.
1147
+ singleBranchCap: { tags: { tag: ["T-one", "T-two"] }, clamped: { item: ["I-one", "I-two"] } }
1148
+ }, oi = h([
1149
+ {
1150
+ name: "tooManyBranches",
1151
+ fieldOptions: { label: "Choice Over maxOccurs (auto mode, maxOccurs 1)" },
1152
+ type: "heading",
1153
+ children: [
1154
+ { name: "contact", fieldOptions: { label: "Only one branch allowed" }, maxOccurs: 1, fullWidth: !0, description: "Loaded with both email and phone filled at once. Two occupied branches exceed maxOccurs 1, so submit shows the xsd_choiceMaxOccurs error.", choice: [
1155
+ { name: "email", fieldOptions: { label: "Email" } },
1156
+ { name: "phone", fieldOptions: { label: "Phone" } }
1157
+ ] }
1158
+ ]
1159
+ },
1160
+ {
1161
+ name: "branchOverTotal",
1162
+ fieldOptions: { label: "Branch Over maxOccursTotal (maxOccurs 4)" },
1163
+ type: "heading",
1164
+ children: [
1165
+ { name: "entries", fieldOptions: { label: "Capped branch over its total" }, maxOccurs: 4, fullWidth: !0, description: "The capped branch allows at most 2 items in total across the whole choice (maxOccursTotal 2) but is loaded with 3. Submit shows the maxOccursTotal error.", choice: [
1166
+ { name: "capped", maxOccurs: 3, maxOccursTotal: 2, fieldOptions: { label: "Capped (maxOccursTotal 2)" } },
1167
+ { name: "uncapped", maxOccurs: 3, fieldOptions: { label: "Uncapped" } }
1168
+ ] }
1169
+ ]
1170
+ },
1171
+ {
1172
+ name: "singleBranchOverTotal",
1173
+ fieldOptions: { label: "Single Branch Over maxOccursTotal" },
1174
+ type: "heading",
1175
+ children: [
1176
+ { name: "tags", fieldOptions: { label: "Capped single branch over its total" }, fullWidth: !0, description: "A one-branch choice skips choice-level validation, so a breach surfaces as the branch's own maxOccurs error instead: the branch is capped at 2 items (maxOccursTotal 2) but loaded with 3. Submit to see it.", choice: [
1177
+ { name: "tag", maxOccurs: 3, maxOccursTotal: 2, fieldOptions: { label: "Tag (maxOccursTotal 2)" } }
1178
+ ] }
1179
+ ]
1180
+ }
1181
+ ]), di = {
1182
+ tooManyBranches: { contact: { email: "ada@example.com", phone: "555-0100" } },
1183
+ branchOverTotal: { entries: { capped: ["C-one", "C-two", "C-three"] } },
1184
+ singleBranchOverTotal: { tags: { tag: ["T-one", "T-two", "T-three"] } }
1185
+ }, ri = h([
1186
+ {
1187
+ name: "explicitSection",
1188
+ fieldOptions: { label: "Explicit Choice (selection-first)" },
1189
+ type: "heading",
1190
+ children: [
1191
+ { name: "contact", fieldOptions: { label: "Contact method" }, fullWidth: !0, explicitChoiceSelection: !0, description: "No branch renders until one is chosen via the add buttons; switching to the other branch clears the current one.", choice: [
1192
+ { name: "email", type: "group", fieldOptions: { label: "Email" }, children: [
1193
+ { name: "address", fullWidth: !0, fieldOptions: { label: "Email address" } }
1194
+ ] },
1195
+ { name: "phone", type: "group", fieldOptions: { label: "Phone" }, children: [
1196
+ { name: "number", fullWidth: !0, fieldOptions: { label: "Phone number" } },
1197
+ { name: "allowSms", type: "checkbox", minOccurs: 0, fieldOptions: { label: "Allow SMS" } }
1198
+ ] }
1199
+ ] }
1200
+ ]
1201
+ }
1202
+ ]), ci = {
1203
+ // A loaded value auto-selects its branch, even though nothing was clicked.
1204
+ explicitSection: { contact: { email: { address: "jane@example.com" } } }
1205
+ }, ui = h([
1206
+ {
1207
+ name: "preserveSection",
1208
+ fieldOptions: { label: "Explicit Choice With preserveOnSwitch" },
1209
+ type: "heading",
1210
+ children: [
1211
+ { name: "contact", fieldOptions: { label: "Contact method" }, fullWidth: !0, explicitChoiceSelection: !0, preserveOnSwitch: !0, description: "Fill in Email, switch to Phone and back: the Email value is restored from the stash, with fresh touched/validation state.", choice: [
1212
+ { name: "email", type: "group", fieldOptions: { label: "Email" }, children: [
1213
+ { name: "address", fullWidth: !0, fieldOptions: { label: "Email address" } }
1214
+ ] },
1215
+ { name: "phone", type: "group", fieldOptions: { label: "Phone" }, children: [
1216
+ { name: "number", fullWidth: !0, fieldOptions: { label: "Phone number" } }
1217
+ ] }
1218
+ ] }
1219
+ ]
1220
+ }
1221
+ ]), pi = {
1222
+ preserveSection: { contact: { email: { address: "restore@example.com" } } }
1223
+ }, mi = h([
1224
+ {
1225
+ name: "integrationsSection",
1226
+ fieldOptions: { label: "Explicit Repeatable Choice (maxOccurs 5)" },
1227
+ type: "heading",
1228
+ children: [
1229
+ { name: "integrations", fieldOptions: { label: "Integrations" }, fullWidth: !0, maxOccurs: 5, explicitChoiceSelection: !0, description: "Add up to 5 occurrences in any mix; each kind is additionally capped at 3 in total (maxOccursTotal), so its add button disables independently.", choice: [
1230
+ { name: "crmExport", maxOccurs: 1, maxOccursTotal: 3, fullWidth: !0, fieldOptions: { label: "CRM export" }, children: [
1231
+ { name: "crmSystem", fieldOptions: { label: "CRM system" } },
1232
+ { name: "exportSchedule", fieldOptions: { label: "Export schedule" } }
1233
+ ] },
1234
+ { name: "apiEndpoint", maxOccurs: 1, maxOccursTotal: 3, fullWidth: !0, fieldOptions: { label: "API endpoint" }, children: [
1235
+ { name: "url", fieldOptions: { label: "Endpoint URL" } },
1236
+ { name: "apiKey", fieldOptions: { label: "API key" } }
1237
+ ] }
1238
+ ] }
1239
+ ]
1240
+ }
1241
+ ]), hi = {
1242
+ // A mix of both kinds; each branch is its own array of occurrences.
1243
+ integrationsSection: {
1244
+ integrations: {
1245
+ crmExport: [
1246
+ { crmSystem: "Salesforce", exportSchedule: "Nightly" }
1247
+ ],
1248
+ apiEndpoint: [
1249
+ { url: "https://api.example.com/orders", apiKey: "key-1234" },
1250
+ { url: "https://api.example.com/customers", apiKey: "key-5678" }
1251
+ ]
1252
+ }
1253
+ }
1254
+ }, bi = h([
1255
+ {
1256
+ name: "timelineSection",
1257
+ fieldOptions: { label: "Repeatable Explicit Choice (displayOrder: added)" },
1258
+ type: "heading",
1259
+ children: [
1260
+ { name: "events", fieldOptions: { label: "Timeline entries" }, fullWidth: !0, maxOccurs: 6, explicitChoiceSelection: !0, displayOrder: "added", description: "Occurrences render in the order their add button was pressed, interleaved across both kinds, instead of grouped by kind. The global-index badge follows the rendered order; the insertion-order badge appears only on occurrences added this session. Pre-loaded occurrences have no add-order, so they sort first in grouped order; reloading drops the add-order entirely.", choice: [
1261
+ { name: "note", maxOccurs: 6, fullWidth: !0, fieldOptions: { label: "Note" }, children: [
1262
+ { name: "text", fullWidth: !0, fieldOptions: { label: "Note text" } }
1263
+ ] },
1264
+ { name: "milestone", maxOccurs: 6, fullWidth: !0, fieldOptions: { label: "Milestone" }, children: [
1265
+ { name: "title", fieldOptions: { label: "Milestone title" } },
1266
+ { name: "owner", fieldOptions: { label: "Owner" } }
1267
+ ] }
1268
+ ] }
1269
+ ]
1270
+ }
1271
+ ]), fi = {
1272
+ // Both pre-loaded occurrences lack an add-order, so they render first in grouped order;
1273
+ // anything added afterwards appends below them in add-press order.
1274
+ timelineSection: {
1275
+ events: {
1276
+ note: [{ text: "Loaded note (sorts first, grouped)" }],
1277
+ milestone: [{ title: "Loaded milestone", owner: "Ada" }]
1278
+ }
1279
+ }
1280
+ }, Oi = h([
1281
+ {
1282
+ name: "stepsSection",
1283
+ fieldOptions: { label: "Repeatable Explicit Choice (preserveOrder + displayOrder: added)" },
1284
+ type: "heading",
1285
+ children: [
1286
+ { name: "steps", fieldOptions: { label: "Workflow steps" }, fullWidth: !0, maxOccurs: 6, explicitChoiceSelection: !0, displayOrder: "added", preserveOrder: !0, description: 'Each added occurrence writes a 1-based "order" field into its own values (watch the debug output below), counted across both kinds. Removing one compacts the survivors back to a contiguous 1..N. Unlike the ephemeral displayOrder-only case, this order is real submitted data and survives a reload. The pre-loaded occurrences arrive without "order" and are backfilled once from their grouped position.', choice: [
1287
+ { name: "manual", maxOccurs: 6, fullWidth: !0, fieldOptions: { label: "Manual step" }, children: [
1288
+ { name: "instruction", fullWidth: !0, fieldOptions: { label: "Instruction" } }
1289
+ ] },
1290
+ { name: "automated", maxOccurs: 6, fullWidth: !0, fieldOptions: { label: "Automated step" }, children: [
1291
+ { name: "script", fullWidth: !0, fieldOptions: { label: "Script" } }
1292
+ ] }
1293
+ ] }
1294
+ ]
1295
+ }
1296
+ ]), gi = {
1297
+ // Neither pre-loaded occurrence carries "order"; the mount-time backfill assigns 1 and 2 from
1298
+ // their grouped position before any add-press can occur.
1299
+ stepsSection: {
1300
+ steps: {
1301
+ manual: [{ instruction: "Backfilled order 1" }],
1302
+ automated: [{ script: "deploy.sh" }]
1303
+ }
1304
+ }
1305
+ }, yi = h([
1306
+ {
1307
+ name: "labelsSection",
1308
+ fieldOptions: { label: "preserveOrder With a Scalar-Leaf Branch (per-branch no-op)" },
1309
+ type: "heading",
1310
+ children: [
1311
+ { name: "items", fieldOptions: { label: "Mixed branches" }, fullWidth: !0, maxOccurs: 6, explicitChoiceSelection: !0, displayOrder: "added", preserveOrder: !1, description: 'The object branch (with children) gets an "order" field written into its values; the scalar-leaf branch (plain text, no children) has nowhere to attach "order", so preserveOrder is a no-op for it and logs a console.warn in development. Adding a scalar item still works, it just carries no persisted order.', choice: [
1312
+ { name: "labelled", maxOccurs: 6, fullWidth: !0, fieldOptions: { label: "Labelled item (object branch)" }, children: [
1313
+ { name: "label", fullWidth: !0, fieldOptions: { label: "Label" } }
1314
+ ] },
1315
+ { name: "tag", maxOccurs: 6, type: "text", fullWidth: !0, fieldOptions: { label: "Tag (scalar branch, no order)" } }
1316
+ ] }
1317
+ ]
1318
+ }
1319
+ ]), xi = {
1320
+ labelsSection: {
1321
+ items: {
1322
+ labelled: [{ label: "Has an order field" }],
1323
+ tag: ["plain-tag-no-order"]
1324
+ }
1325
+ }
1326
+ }, vi = h([
1327
+ {
1328
+ name: "ownValue",
1329
+ fieldOptions: { label: "Reacting to Own Value" },
1330
+ type: "heading",
1331
+ children: [
1332
+ { name: "charCounter", minOccurs: 0, restriction: { maxLength: 10 }, fieldOptions: { label: "Character counter" }, computedProps: [
1333
+ (p, f) => {
1334
+ const c = typeof f.value == "string" ? f.value.length : 0;
1335
+ p.description = `${10 - c} character(s) remaining`;
1336
+ }
1337
+ ] },
1338
+ { name: "selfHiding", minOccurs: 0, fieldOptions: { label: 'Type "hide" to hide me' }, computedProps: [
1339
+ (p, f) => {
1340
+ f.value === "hide" && (p.hidden = !0);
1341
+ }
1342
+ ] },
1343
+ { name: "selfDisabling", minOccurs: 0, fieldOptions: { label: 'Type "lock" to disable me' }, computedProps: [
1344
+ (p, f) => {
1345
+ f.value === "lock" && (p.disabled = !0);
1346
+ }
1347
+ ] }
1348
+ ]
1349
+ },
1350
+ {
1351
+ name: "progress",
1352
+ fieldOptions: { label: "Parent Reacting to Child Values (computeOnChildValueChange)" },
1353
+ type: "heading",
1354
+ computeOnChildValueChange: !0,
1355
+ computedProps: [
1356
+ (p, f) => {
1357
+ const u = Object.values(f.value ?? {}).filter((e) => e != null && e !== "").length;
1358
+ p.description = `${u} of 3 fields filled in`;
1359
+ }
1360
+ ],
1361
+ children: [
1362
+ { name: "first", minOccurs: 0, fieldOptions: { label: "First" } },
1363
+ { name: "second", minOccurs: 0, fieldOptions: { label: "Second" } },
1364
+ { name: "third", minOccurs: 0, fieldOptions: { label: "Third" } }
1365
+ ]
1366
+ },
1367
+ {
1368
+ name: "childFieldsDemo",
1369
+ fieldOptions: { label: "Parent Reacting to Child Computed State (childFields)" },
1370
+ type: "heading",
1371
+ description: 'Each child hides itself when its value is "hide"; once every child is hidden the parent heading hides too.',
1372
+ computedProps: [
1373
+ (p, f, c) => {
1374
+ c.value.length > 0 && c.value.every((u) => u.hidden) && (p.hidden = !0);
1375
+ }
1376
+ ],
1377
+ children: [
1378
+ { name: "childA", minOccurs: 0, fieldOptions: { label: 'Child A (type "hide")' }, computedProps: [
1379
+ (p, f) => {
1380
+ f.value === "hide" && (p.hidden = !0);
1381
+ }
1382
+ ] },
1383
+ { name: "childB", minOccurs: 0, fieldOptions: { label: 'Child B (type "hide")' }, computedProps: [
1384
+ (p, f) => {
1385
+ f.value === "hide" && (p.hidden = !0);
1386
+ }
1387
+ ] }
1388
+ ]
1389
+ }
1390
+ ]), wi = {
1391
+ // Values that stay visible/enabled (typing "hide"/"lock" would trigger the self-hiding demos).
1392
+ ownValue: { charCounter: "Counting", selfHiding: "still shown", selfDisabling: "still on" },
1393
+ progress: { first: "Filled one", second: "Filled two" },
1394
+ childFieldsDemo: { childA: "kept visible" }
1395
+ }, ki = h([
1396
+ {
1397
+ name: "attributes",
1398
+ fieldOptions: { label: "Attributes" },
1399
+ type: "heading",
1400
+ description: "Attributes render once the parent field has a value; the value becomes an object like { value, ...attributes }. Check the debug output below.",
1401
+ children: [
1402
+ { name: "nickname", minOccurs: 0, fullWidth: !0, fieldOptions: { label: "Optional attribute (lang)" }, attributes: [
1403
+ { name: "lang", minOccurs: 0, fieldOptions: { label: "Language" } }
1404
+ ] },
1405
+ { name: "verifiedPhone", fullWidth: !0, fieldOptions: { label: "Required attribute (certainty)" }, attributes: [
1406
+ { name: "certainty", type: "select", fieldOptions: { label: "Certainty" }, options: [
1407
+ { key: "verified", value: "Verified" },
1408
+ { key: "unverified", value: "Unverified" }
1409
+ ] }
1410
+ ] }
1411
+ ]
1412
+ },
1413
+ {
1414
+ name: "complexTypes",
1415
+ fieldOptions: { label: "Complex Types" },
1416
+ type: "heading",
1417
+ children: [
1418
+ { name: "complexValue", minOccurs: 0, fullWidth: !0, isComplexType: !0, description: "isComplexType without attributes: the value is stored as { value: ... }.", fieldOptions: { label: "isComplexType" } }
1419
+ ]
1420
+ }
1421
+ ]), Ci = {
1422
+ attributes: {
1423
+ // A complex type stores its value plus each attribute under one object.
1424
+ nickname: { value: "Ace", lang: "en" },
1425
+ verifiedPhone: { value: "+31 6 1234 5678", certainty: "verified" }
1426
+ },
1427
+ complexTypes: {
1428
+ complexValue: { value: "Wrapped in { value }" }
1429
+ }
1430
+ }, Ti = h([
1431
+ {
1432
+ name: "customValueProp",
1433
+ fieldOptions: { label: "Custom complexTypeValueProperty" },
1434
+ type: "heading",
1435
+ description: 'The settings rename the complex type value property to "val", so the debug output shows { val: ..., lang: ... }.',
1436
+ children: [
1437
+ { name: "title", minOccurs: 0, fullWidth: !0, fieldOptions: { label: "Title with lang attribute" }, attributes: [
1438
+ { name: "lang", minOccurs: 0, fieldOptions: { label: "Language" } }
1439
+ ] }
1440
+ ]
1441
+ }
1442
+ ], {
1443
+ complexTypeValueProperty: "val"
1444
+ }), Si = {
1445
+ // The value lives under "val" (not "value") because of the complexTypeValueProperty setting.
1446
+ customValueProp: { title: { val: "Hello world", lang: "en" } }
1447
+ };
1448
+ function I(p, f) {
1449
+ return h([
1450
+ {
1451
+ name: "timing",
1452
+ fieldOptions: { label: "Validation Timing" },
1453
+ type: "heading",
1454
+ description: p,
1455
+ children: [
1456
+ { name: "requiredField", fieldOptions: { label: "Required field" } },
1457
+ { name: "maxLengthField", minOccurs: 0, restriction: { maxLength: 5 }, fieldOptions: { label: "maxLength 5" } }
1458
+ ]
1459
+ }
1460
+ ], f);
1461
+ }
1462
+ const _i = {
1463
+ timing: { requiredField: "Filled in", maxLengthField: "abc" }
1464
+ }, Vi = I(
1465
+ "validateOnValueUpdate: false, validateWhenInError: false. Errors only appear on submit and stay unchanged while typing until the next submit.",
1466
+ { validateOnValueUpdate: !1, validateWhenInError: !1 }
1467
+ ), Wi = I(
1468
+ "validateOnBlur: true, validateOnValueUpdate: false. Errors appear when leaving a field, not while typing.",
1469
+ { validateOnBlur: !0, validateOnValueUpdate: !1 }
1470
+ ), Ai = I(
1471
+ "validateOnValueUpdateAfterSubmit: true, validateOnValueUpdate: false. Typing does not validate until the first submit; after that every change validates.",
1472
+ { validateOnValueUpdateAfterSubmit: !0, validateOnValueUpdate: !1 }
1473
+ ), Fi = I(
1474
+ "validateOnValueUpdate: false, validateWhenInError: true. A field only starts live-validating once it is in error (after a submit).",
1475
+ { validateOnValueUpdate: !1, validateWhenInError: !0 }
1476
+ ), $i = h([
1477
+ {
1478
+ name: "optionalMarkers",
1479
+ fieldOptions: { label: 'Show "(optional)" Instead of "*"' },
1480
+ type: "heading",
1481
+ description: "With showOptionalInsteadOfRequired the required markers disappear and optional fields are marked instead.",
1482
+ children: [
1483
+ { name: "requiredField", fieldOptions: { label: "Required field" } },
1484
+ { name: "optionalField", minOccurs: 0, fieldOptions: { label: "Optional field" } }
1485
+ ]
1486
+ }
1487
+ ], {
1488
+ showOptionalInsteadOfRequired: !0
1489
+ }), Bi = {
1490
+ optionalMarkers: { requiredField: "Required value", optionalField: "Optional value" }
1491
+ }, Ni = h([
1492
+ {
1493
+ name: "messages",
1494
+ fieldOptions: { label: "Custom Validation Messages" },
1495
+ type: "heading",
1496
+ description: "The settings override the required, maxLength and minInclusive messages; rules without an override fall back to the library defaults.",
1497
+ children: [
1498
+ { name: "requiredField", fieldOptions: { label: "Required field" } },
1499
+ { name: "maxLengthField", minOccurs: 0, restriction: { maxLength: 5 }, fieldOptions: { label: "maxLength 5" } },
1500
+ { name: "minInclusiveField", minOccurs: 0, restriction: { minInclusive: 10 }, fieldOptions: { label: "minInclusive 10" } }
1501
+ ]
1502
+ }
1503
+ ], {
1504
+ messages: {
1505
+ required: "Custom message: please fill in {field}",
1506
+ maxLength: "Custom message: {field} must stay under {length} characters",
1507
+ minInclusive: "Custom message: {field} must be {min} or higher"
1508
+ }
1509
+ }), Pi = {
1510
+ messages: { requiredField: "Filled in", maxLengthField: "abcd", minInclusiveField: "15" }
1511
+ }, qi = h(
609
1512
  [{
610
1513
  name: "items",
611
1514
  type: "text",
@@ -619,20 +1522,477 @@ You can test it by filling in one of the fields.`, children: [
619
1522
  // validateWhenInError: true,
620
1523
  // validateOnBlur: true,
621
1524
  }
622
- );
623
- function $(h, f, c = {}) {
624
- return j(B({
625
- render: () => P(je, { ...c, metadata: h, settings: f, showDebugState: !0 })
1525
+ ), Li = {
1526
+ // Each repeatable item is a complex type: its text under "value" plus the lang attribute.
1527
+ items: [
1528
+ { value: "First item", lang: "en" },
1529
+ { value: "Second item", lang: "nl" }
1530
+ ]
1531
+ }, N = [
1532
+ { key: "starter", value: "Starter" },
1533
+ { key: "growth", value: "Growth" },
1534
+ { key: "enterprise", value: "Enterprise" }
1535
+ ], Ei = h([{
1536
+ name: "onboarding",
1537
+ wizard: !0,
1538
+ fieldOptions: { label: "Onboarding wizard (backward-only)" },
1539
+ children: [
1540
+ {
1541
+ name: "company",
1542
+ type: "heading",
1543
+ fieldOptions: { label: "Company" },
1544
+ children: [
1545
+ { name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 },
1546
+ { name: "website", minOccurs: 0, fieldOptions: { label: "Website (optional)" }, fullWidth: !0 }
1547
+ ]
1548
+ },
1549
+ {
1550
+ name: "plan",
1551
+ type: "heading",
1552
+ fieldOptions: { label: "Plan" },
1553
+ children: [
1554
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: N },
1555
+ { name: "seats", minOccurs: 0, fieldOptions: { label: "Seats (optional)" } }
1556
+ ]
1557
+ },
1558
+ {
1559
+ name: "review",
1560
+ type: "heading",
1561
+ fieldOptions: { label: "Review" },
1562
+ children: [
1563
+ { name: "termsAccepted", type: "checkbox", fieldOptions: { label: "I accept the terms (required)" } }
1564
+ ]
1565
+ }
1566
+ ]
1567
+ }]), Ii = {
1568
+ onboarding: {
1569
+ company: { companyName: "Acme Corp", website: "https://acme.example" },
1570
+ plan: { planName: "growth", seats: "25" },
1571
+ review: { termsAccepted: !0 }
1572
+ }
1573
+ }, zi = h([{
1574
+ name: "onboarding",
1575
+ wizard: { allowForwardJump: !0, validateOnJump: !1 },
1576
+ fieldOptions: { label: "Wizard with forward jumping" },
1577
+ children: [
1578
+ {
1579
+ name: "company",
1580
+ type: "heading",
1581
+ fieldOptions: { label: "Company" },
1582
+ children: [{ name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 }]
1583
+ },
1584
+ {
1585
+ name: "plan",
1586
+ type: "heading",
1587
+ fieldOptions: { label: "Plan" },
1588
+ children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: N }]
1589
+ },
1590
+ {
1591
+ name: "review",
1592
+ type: "heading",
1593
+ fieldOptions: { label: "Review" },
1594
+ children: [{ name: "termsAccepted", type: "checkbox", fieldOptions: { label: "I accept the terms (required)" } }]
1595
+ }
1596
+ ]
1597
+ }]), Bt = {
1598
+ onboarding: {
1599
+ company: { companyName: "Acme Corp" },
1600
+ plan: { planName: "enterprise" },
1601
+ review: { termsAccepted: !0 }
1602
+ }
1603
+ }, Ri = h([{
1604
+ name: "onboarding",
1605
+ wizard: { allowForwardJump: !0, validateOnJump: !0 },
1606
+ fieldOptions: { label: "Wizard with validate-on-jump" },
1607
+ children: [
1608
+ {
1609
+ name: "company",
1610
+ type: "heading",
1611
+ fieldOptions: { label: "Company" },
1612
+ children: [{ name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 }]
1613
+ },
1614
+ {
1615
+ name: "plan",
1616
+ type: "heading",
1617
+ fieldOptions: { label: "Plan" },
1618
+ children: [{ name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: N }]
1619
+ },
1620
+ {
1621
+ name: "review",
1622
+ type: "heading",
1623
+ fieldOptions: { label: "Review" },
1624
+ children: [{ name: "termsAccepted", type: "checkbox", fieldOptions: { label: "I accept the terms (required)" } }]
1625
+ }
1626
+ ]
1627
+ }]), Ui = Bt, Di = h([{
1628
+ name: "onboarding",
1629
+ wizard: { allowForwardJump: !0 },
1630
+ fieldOptions: { label: "Wizard with group / array / choice / summary pages" },
1631
+ children: [
1632
+ {
1633
+ name: "company",
1634
+ type: "heading",
1635
+ fieldOptions: { label: "Company (group page)" },
1636
+ children: [
1637
+ { name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 }
1638
+ ]
1639
+ },
1640
+ {
1641
+ name: "contacts",
1642
+ type: "heading",
1643
+ maxOccurs: 4,
1644
+ minOccurs: 1,
1645
+ fullWidth: !0,
1646
+ fieldOptions: { label: "Contacts (repeatable array page)" },
1647
+ children: [
1648
+ { name: "fullName", fieldOptions: { label: "Full name" } },
1649
+ { name: "email", minOccurs: 0, fieldOptions: { label: "Email (optional)" } }
1650
+ ]
1651
+ },
1652
+ {
1653
+ name: "launchApproach",
1654
+ type: "heading",
1655
+ fullWidth: !0,
1656
+ fieldOptions: { label: "Launch approach (choice page)" },
1657
+ choice: [
1658
+ { name: "selfServe", type: "group", fieldOptions: { label: "Self serve" }, children: [
1659
+ { name: "startDate", fieldOptions: { label: "Start date" } }
1660
+ ] },
1661
+ { name: "guidedRollout", type: "group", fieldOptions: { label: "Guided rollout" }, children: [
1662
+ { name: "accountManager", fieldOptions: { label: "Account manager" } }
1663
+ ] }
1664
+ ]
1665
+ },
1666
+ {
1667
+ name: "summary",
1668
+ type: "heading",
1669
+ fieldOptions: { label: "Summary (field-less page)" }
1670
+ }
1671
+ ]
1672
+ }]), Ji = {
1673
+ onboarding: {
1674
+ company: { companyName: "Acme Corp" },
1675
+ contacts: [
1676
+ { fullName: "Ada Lovelace", email: "ada@acme.example" },
1677
+ { fullName: "Grace Hopper" }
1678
+ ],
1679
+ launchApproach: { guidedRollout: { accountManager: "Alan Turing" } }
1680
+ }
1681
+ }, Gi = h([{
1682
+ name: "setupPath",
1683
+ explicitChoiceSelection: !0,
1684
+ fullWidth: !0,
1685
+ fieldOptions: { label: "Pick a setup path (choice of wizards)" },
1686
+ choice: [
1687
+ {
1688
+ name: "quickStart",
1689
+ wizard: { allowForwardJump: !0 },
1690
+ fieldOptions: { label: "Quick start wizard" },
1691
+ children: [
1692
+ { name: "basics", type: "heading", fieldOptions: { label: "Basics" }, children: [
1693
+ { name: "projectName", fieldOptions: { label: "Project name (required)" }, fullWidth: !0 }
1694
+ ] },
1695
+ { name: "done", type: "heading", fieldOptions: { label: "Done" }, children: [
1696
+ { name: "confirm", type: "checkbox", fieldOptions: { label: "Looks good (required)" } }
1697
+ ] }
1698
+ ]
1699
+ },
1700
+ {
1701
+ name: "guidedSetup",
1702
+ wizard: { allowForwardJump: !0 },
1703
+ fieldOptions: { label: "Guided setup wizard" },
1704
+ children: [
1705
+ { name: "company", type: "heading", fieldOptions: { label: "Company" }, children: [
1706
+ { name: "companyName", fieldOptions: { label: "Company name (required)" }, fullWidth: !0 }
1707
+ ] },
1708
+ { name: "plan", type: "heading", fieldOptions: { label: "Plan" }, children: [
1709
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required)" }, options: N }
1710
+ ] },
1711
+ { name: "review", type: "heading", fieldOptions: { label: "Review" }, children: [
1712
+ { name: "termsAccepted", type: "checkbox", fieldOptions: { label: "Accept terms (required)" } }
1713
+ ] }
1714
+ ]
1715
+ }
1716
+ ]
1717
+ }]), ji = {
1718
+ setupPath: {
1719
+ guidedSetup: {
1720
+ company: { companyName: "Acme Corp" },
1721
+ plan: { planName: "growth" },
1722
+ review: { termsAccepted: !0 }
1723
+ }
1724
+ }
1725
+ }, Hi = h([{
1726
+ name: "teams",
1727
+ type: "heading",
1728
+ maxOccurs: 3,
1729
+ minOccurs: 1,
1730
+ fullWidth: !0,
1731
+ fieldOptions: { label: "Teams (each team runs its own wizard)" },
1732
+ children: [{
1733
+ name: "setup",
1734
+ wizard: { allowForwardJump: !0 },
1735
+ fieldOptions: { label: "Team setup wizard" },
1736
+ children: [
1737
+ { name: "team", type: "heading", fieldOptions: { label: "Team" }, children: [
1738
+ { name: "teamName", fieldOptions: { label: "Team name (required)" }, fullWidth: !0 }
1739
+ ] },
1740
+ { name: "lead", type: "heading", fieldOptions: { label: "Lead" }, children: [
1741
+ { name: "leadName", fieldOptions: { label: "Lead name (required)" }, fullWidth: !0 }
1742
+ ] }
1743
+ ]
1744
+ }]
1745
+ }]), Ki = {
1746
+ teams: [
1747
+ { setup: { team: { teamName: "Platform" }, lead: { leadName: "Ada Lovelace" } } },
1748
+ { setup: { team: { teamName: "Growth" }, lead: { leadName: "Grace Hopper" } } }
1749
+ ]
1750
+ }, Qi = h([{
1751
+ name: "onboarding",
1752
+ wizard: { allowForwardJump: !0 },
1753
+ fieldOptions: { label: "Wizard: v-show vs v-if and keepValuesOnUnmount" },
1754
+ children: [
1755
+ {
1756
+ name: "company",
1757
+ type: "heading",
1758
+ fieldOptions: { label: "Company" },
1759
+ children: [{ name: "companyName", minOccurs: 1, fieldOptions: { label: "Company name (type something, then navigate away and back)" }, fullWidth: !0 }]
1760
+ },
1761
+ {
1762
+ name: "plan",
1763
+ type: "heading",
1764
+ fieldOptions: { label: "Plan" },
1765
+ children: [{ name: "planName", minOccurs: 1, fieldOptions: { label: "Plan name" }, fullWidth: !0 }]
1766
+ }
1767
+ ]
1768
+ }]), Yi = {
1769
+ onboarding: {
1770
+ company: { companyName: "Acme Corp" },
1771
+ plan: { planName: "Growth" }
1772
+ }
1773
+ }, Zi = h([{
1774
+ name: "registration",
1775
+ type: "heading",
1776
+ minOccurs: 0,
1777
+ fieldOptions: { label: "Optional section containing a wizard" },
1778
+ description: "While this section is empty, nothing in the wizard is required: Submit passes right away. Type into any field and the required fields gate again.",
1779
+ children: [{
1780
+ name: "onboarding",
1781
+ wizard: !0,
1782
+ fieldOptions: { label: "Onboarding wizard" },
1783
+ children: [
1784
+ {
1785
+ name: "company",
1786
+ type: "heading",
1787
+ fieldOptions: { label: "Company" },
1788
+ children: [
1789
+ { name: "companyName", fieldOptions: { label: "Company name (required once the section has a value)" }, fullWidth: !0 },
1790
+ { name: "website", minOccurs: 0, fieldOptions: { label: "Website (optional)" }, fullWidth: !0 }
1791
+ ]
1792
+ },
1793
+ {
1794
+ name: "plan",
1795
+ type: "heading",
1796
+ fieldOptions: { label: "Plan" },
1797
+ children: [
1798
+ { name: "planName", type: "select", fieldOptions: { label: "Plan (required once the section has a value)" }, options: N }
1799
+ ]
1800
+ }
1801
+ ]
1802
+ }]
1803
+ }]), Xi = {
1804
+ registration: {
1805
+ onboarding: {
1806
+ company: { companyName: "Acme Corp" }
1807
+ }
1808
+ }
1809
+ }, Mi = h([{
1810
+ name: "archived",
1811
+ type: "heading",
1812
+ maxOccurs: 0,
1813
+ fieldOptions: { label: "Disabled section containing a wizard" },
1814
+ description: "The whole section is disabled via maxOccurs: 0. Navigate the wizard: every page field is disabled and Submit passes without validating them.",
1815
+ children: [{
1816
+ name: "onboarding",
1817
+ wizard: { allowForwardJump: !0 },
1818
+ fieldOptions: { label: "Onboarding wizard" },
1819
+ children: [
1820
+ {
1821
+ name: "company",
1822
+ type: "heading",
1823
+ fieldOptions: { label: "Company" },
1824
+ children: [
1825
+ { name: "companyName", fieldOptions: { label: "Company name" }, fullWidth: !0 },
1826
+ { name: "website", minOccurs: 0, fieldOptions: { label: "Website" }, fullWidth: !0 }
1827
+ ]
1828
+ },
1829
+ {
1830
+ name: "plan",
1831
+ type: "heading",
1832
+ fieldOptions: { label: "Plan" },
1833
+ children: [
1834
+ { name: "planName", type: "select", fieldOptions: { label: "Plan" }, options: N }
1835
+ ]
1836
+ }
1837
+ ]
1838
+ }]
1839
+ }]), ea = {
1840
+ archived: {
1841
+ onboarding: {
1842
+ company: { companyName: "Acme Corp", website: "https://acme.example" },
1843
+ plan: { planName: "growth" }
1844
+ }
1845
+ }
1846
+ };
1847
+ function h(p, f, c = {}) {
1848
+ return Q(q({
1849
+ // Overridable at runtime so a Storybook control can flip a case between empty and pre-filled
1850
+ // without a second component; an unset prop falls back to the baked testCaseConfig/settings.
1851
+ props: {
1852
+ initialValues: { type: Object, default: void 0 },
1853
+ initialEdit: { type: Boolean, default: void 0 },
1854
+ hideFieldsWithoutValue: { type: Boolean, default: void 0 },
1855
+ settings: { type: Object, default: void 0 },
1856
+ keepValuesOnUnmount: { type: Boolean, default: void 0 }
1857
+ },
1858
+ setup: (u) => () => Y(D, {
1859
+ metadata: p,
1860
+ settings: u.settings ?? f,
1861
+ showDebugState: !0,
1862
+ initialValues: u.initialValues ?? c.initialValues,
1863
+ initialEdit: u.initialEdit ?? c.initialEdit,
1864
+ hideFieldsWithoutValue: u.hideFieldsWithoutValue ?? c.hideFieldsWithoutValue,
1865
+ keepValuesOnUnmount: u.keepValuesOnUnmount
1866
+ })
626
1867
  }));
627
1868
  }
1869
+ const Nt = { class: "flex flex-col gap-4" }, Pt = { class: "flex gap-6 flex-wrap" }, qt = { class: "flex items-center gap-2" }, Lt = { class: "flex items-center gap-2" }, ta = /* @__PURE__ */ q({
1870
+ __name: "KeepValuesOnUnmountTestCase",
1871
+ setup(p) {
1872
+ const f = P(!0), c = P(!1), u = L(() => [
1873
+ ...f.value ? [{
1874
+ name: "contact",
1875
+ fieldOptions: { label: "Contact (complex field with an attribute)" },
1876
+ minOccurs: 0,
1877
+ fullWidth: !0,
1878
+ attributes: [
1879
+ {
1880
+ name: "certainty",
1881
+ type: "select",
1882
+ minOccurs: 0,
1883
+ fieldOptions: { label: "Certainty" },
1884
+ options: [
1885
+ { key: "verified", value: "Verified" },
1886
+ { key: "unverified", value: "Unverified" }
1887
+ ]
1888
+ }
1889
+ ]
1890
+ }] : [],
1891
+ { name: "note", fieldOptions: { label: "Sibling field (always mounted)" }, minOccurs: 0, fullWidth: !0 }
1892
+ ]);
1893
+ return (e, l) => (t(), i("div", Nt, [
1894
+ a("div", Pt, [
1895
+ a("label", qt, [
1896
+ B(a("input", {
1897
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => f.value = s),
1898
+ type: "checkbox",
1899
+ "data-testid": "toggle-show-contact"
1900
+ }, null, 512), [
1901
+ [z, f.value]
1902
+ ]),
1903
+ l[2] || (l[2] = w(" Show contact field (v-if unmount) ", -1))
1904
+ ]),
1905
+ a("label", Lt, [
1906
+ B(a("input", {
1907
+ "onUpdate:modelValue": l[1] || (l[1] = (s) => c.value = s),
1908
+ type: "checkbox",
1909
+ "data-testid": "toggle-keep-values-on-unmount"
1910
+ }, null, 512), [
1911
+ [z, c.value]
1912
+ ]),
1913
+ l[3] || (l[3] = w(" keepValuesOnUnmount ", -1))
1914
+ ])
1915
+ ]),
1916
+ E(D, {
1917
+ metadata: u.value,
1918
+ "keep-values-on-unmount": c.value,
1919
+ "show-debug-state": ""
1920
+ }, null, 8, ["metadata", "keep-values-on-unmount"])
1921
+ ]));
1922
+ }
1923
+ });
628
1924
  export {
629
- Le as TestFormTemplate,
630
- He as arrayTestCase,
631
- Qe as childFieldsTestCase,
632
- Ye as choiceTestCase,
633
- $ as createTestCase,
634
- Ge as defaultTestCase,
635
- Je as groupTestCase,
636
- Xe as individualTestCase
1925
+ ta as KeepValuesOnUnmountTestCase,
1926
+ St as TestFormTemplate,
1927
+ li as arrayMaxOccursSampleValues,
1928
+ ai as arrayMaxOccursTestCase,
1929
+ ii as arrayOccurrenceSampleValues,
1930
+ ti as arrayOccurrenceTestCase,
1931
+ Jt as arraySampleValues,
1932
+ Dt as arrayTestCase,
1933
+ Ci as attributesSampleValues,
1934
+ ki as attributesTestCase,
1935
+ Yt as childFieldsSampleValues,
1936
+ Qt as childFieldsTestCase,
1937
+ fi as choiceDisplayOrderAddedSampleValues,
1938
+ bi as choiceDisplayOrderAddedTestCase,
1939
+ di as choiceMaxOccursSampleValues,
1940
+ oi as choiceMaxOccursTestCase,
1941
+ si as choiceOccurrenceSampleValues,
1942
+ ni as choiceOccurrenceTestCase,
1943
+ ji as choiceOfWizardsSampleValues,
1944
+ Gi as choiceOfWizardsTestCase,
1945
+ gi as choicePreserveOrderSampleValues,
1946
+ xi as choicePreserveOrderScalarBranchSampleValues,
1947
+ yi as choicePreserveOrderScalarBranchTestCase,
1948
+ Oi as choicePreserveOrderTestCase,
1949
+ Kt as choiceSampleValues,
1950
+ Ht as choiceTestCase,
1951
+ Si as complexTypeValuePropertySampleValues,
1952
+ Ti as complexTypeValuePropertyTestCase,
1953
+ wi as computedPropsSampleValues,
1954
+ vi as computedPropsTestCase,
1955
+ h as createTestCase,
1956
+ Pi as customMessagesSampleValues,
1957
+ Ni as customMessagesTestCase,
1958
+ Ut as defaultSampleValues,
1959
+ Rt as defaultTestCase,
1960
+ ci as explicitChoiceSampleValues,
1961
+ ri as explicitChoiceTestCase,
1962
+ hi as explicitRepeatableChoiceSampleValues,
1963
+ mi as explicitRepeatableChoiceTestCase,
1964
+ jt as groupSampleValues,
1965
+ Gt as groupTestCase,
1966
+ Li as individualSampleValues,
1967
+ qi as individualTestCase,
1968
+ Xt as inputTypesSampleValues,
1969
+ Zt as inputTypesTestCase,
1970
+ pi as preserveOnSwitchSampleValues,
1971
+ ui as preserveOnSwitchTestCase,
1972
+ Ki as repeatedWizardSampleValues,
1973
+ Hi as repeatedWizardTestCase,
1974
+ ei as restrictionsSampleValues,
1975
+ Mt as restrictionsTestCase,
1976
+ Bi as showOptionalInsteadOfRequiredSampleValues,
1977
+ $i as showOptionalInsteadOfRequiredTestCase,
1978
+ Ai as validateAfterSubmitTestCase,
1979
+ Wi as validateOnBlurTestCase,
1980
+ Vi as validateOnSubmitOnlyTestCase,
1981
+ Fi as validateWhenInErrorTestCase,
1982
+ _i as validationTimingSampleValues,
1983
+ Ji as wizardCompositePagesSampleValues,
1984
+ Di as wizardCompositePagesTestCase,
1985
+ ea as wizardDisabledAncestorSampleValues,
1986
+ Mi as wizardDisabledAncestorTestCase,
1987
+ Bt as wizardForwardJumpSampleValues,
1988
+ zi as wizardForwardJumpTestCase,
1989
+ Yi as wizardKeepValuesSampleValues,
1990
+ Qi as wizardKeepValuesTestCase,
1991
+ Xi as wizardOptionalAncestorSampleValues,
1992
+ Zi as wizardOptionalAncestorTestCase,
1993
+ Ii as wizardSampleValues,
1994
+ Ei as wizardTestCase,
1995
+ Ui as wizardValidateOnJumpSampleValues,
1996
+ Ri as wizardValidateOnJumpTestCase
637
1997
  };
638
1998
  //# sourceMappingURL=examples.es.js.map