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

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