@bach.software/vue-dynamic-form 0.2.0 → 0.3.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 (56) hide show
  1. package/dist/examples.cjs.js +4 -4
  2. package/dist/examples.cjs.js.map +1 -1
  3. package/dist/examples.es.js +325 -265
  4. package/dist/examples.es.js.map +1 -1
  5. package/dist/src/components/DynamicFormItem.vue.d.ts +3 -1
  6. package/dist/src/components/DynamicFormItemArray.vue.d.ts +3 -1
  7. package/dist/src/components/DynamicFormItemChoice.vue.d.ts +3 -1
  8. package/dist/src/components/DynamicFormTemplate.vue.d.ts +30 -37
  9. package/dist/src/core/__tests__/validation.test.d.ts +1 -0
  10. package/dist/src/core/defineMetadata.d.ts +3 -2
  11. package/dist/src/core/useDynamicForm.d.ts +2 -0
  12. package/dist/src/core/useValidatePartialForm.d.ts +4 -0
  13. package/dist/src/examples/TestForm.vue.d.ts +4 -0
  14. package/dist/src/examples/TestFormTemplate.vue.d.ts +28 -27
  15. package/dist/src/examples/{TestFormTemplate.testcases.d.ts → __tests__/TestFormTemplate.testcases.d.ts} +9 -3
  16. package/dist/src/examples/index.d.ts +1 -1
  17. package/dist/src/index.d.ts +1 -1
  18. package/dist/src/types/FieldMetadata.d.ts +24 -2
  19. package/dist/src/types/InternalFieldMetadata.d.ts +7 -1
  20. package/dist/src/types/MetadataConfiguration.d.ts +1 -0
  21. package/dist/src/utils/__tests__/createValidation.test.d.ts +1 -0
  22. package/dist/src/utils/__tests__/mapEachMetadataItem.test.d.ts +16 -0
  23. package/dist/src/utils/__tests__/splitValidationFunctions.test.d.ts +1 -0
  24. package/dist/src/utils/hashField.d.ts +7 -0
  25. package/dist/src/utils/mapEachMetadataItem.d.ts +10 -0
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/dist/useDynamicForm-C6-0mGw4.js +737 -0
  28. package/dist/useDynamicForm-C6-0mGw4.js.map +1 -0
  29. package/dist/useDynamicForm-SHyV1lLH.cjs +6 -0
  30. package/dist/useDynamicForm-SHyV1lLH.cjs.map +1 -0
  31. package/dist/vue-dynamic-form.cjs.js +1 -1
  32. package/dist/vue-dynamic-form.es.js +6 -6
  33. package/package.json +1 -1
  34. package/dist/src/core/validation.test.d.ts +0 -1
  35. package/dist/src/utils/createValidation.test.d.ts +0 -1
  36. package/dist/useDynamicForm-3E1RNkVq.cjs +0 -6
  37. package/dist/useDynamicForm-3E1RNkVq.cjs.map +0 -1
  38. package/dist/useDynamicForm-B6YN35Qb.js +0 -684
  39. package/dist/useDynamicForm-B6YN35Qb.js.map +0 -1
  40. /package/dist/src/components/{DynamicForm.test.d.ts → __tests__/DynamicForm.test.d.ts} +0 -0
  41. /package/dist/src/components/{DynamicFormItem.analytics.test.d.ts → __tests__/DynamicFormItem.analytics.test.d.ts} +0 -0
  42. /package/dist/src/components/{DynamicFormItem.logic.test.d.ts → __tests__/DynamicFormItem.logic.test.d.ts} +0 -0
  43. /package/dist/src/components/{DynamicFormItem.test-helpers.d.ts → __tests__/DynamicFormItem.test-helpers.d.ts} +0 -0
  44. /package/dist/src/components/{DynamicFormItem.validation.test.d.ts → __tests__/DynamicFormItem.validation.test.d.ts} +0 -0
  45. /package/dist/src/components/{DynamicFormItemArray.logic.test.d.ts → __tests__/DynamicFormItemArray.logic.test.d.ts} +0 -0
  46. /package/dist/src/components/{DynamicFormItemArray.validation.test.d.ts → __tests__/DynamicFormItemArray.validation.test.d.ts} +0 -0
  47. /package/dist/src/components/{DynamicFormItemChoice.logic.test.d.ts → __tests__/DynamicFormItemChoice.logic.test.d.ts} +0 -0
  48. /package/dist/src/components/{DynamicFormItemChoice.validation.test.d.ts → __tests__/DynamicFormItemChoice.validation.test.d.ts} +0 -0
  49. /package/dist/src/{examples/DynamicForm.test.d.ts → core/__tests__/useValidatePartialForm.test.d.ts} +0 -0
  50. /package/dist/src/{test-setup.d.ts → examples/__tests__/DynamicForm.test.d.ts} +0 -0
  51. /package/dist/src/{utils/checkTreeHasValue.test.d.ts → tests/test-setup.d.ts} +0 -0
  52. /package/dist/src/utils/{normalizePath.test.d.ts → __tests__/checkTreeHasValue.test.d.ts} +0 -0
  53. /package/dist/src/utils/{overridePath.test.d.ts → __tests__/normalizePath.test.d.ts} +0 -0
  54. /package/dist/src/utils/{resolveMessage.test.d.ts → __tests__/overridePath.test.d.ts} +0 -0
  55. /package/dist/src/utils/{setInPath.test.d.ts → __tests__/resolveMessage.test.d.ts} +0 -0
  56. /package/dist/src/utils/{splitValidationFunctions.test.d.ts → __tests__/setInPath.test.d.ts} +0 -0
@@ -1,6 +1,9 @@
1
- import { defineComponent as B, createElementBlock as l, openBlock as t, normalizeClass as m, createCommentVNode as n, createElementVNode as o, createBlock as O, unref as v, withCtx as x, withDirectives as F, vModelText as R, vModelCheckbox as D, Fragment as W, renderList as q, toDisplayString as a, vModelSelect as L, renderSlot as y, createTextVNode as w, createVNode as V, ref as T, computed as S, markRaw as E, h as I } from "vue";
2
- import { d as U, e as j, u as A, _ as z } from "./useDynamicForm-B6YN35Qb.js";
3
- const G = {
1
+ import { defineComponent as B, createElementBlock as l, openBlock as t, normalizeClass as g, createCommentVNode as d, createElementVNode as r, createBlock as k, unref as O, withCtx as x, withDirectives as W, vModelText as L, vModelCheckbox as D, Fragment as F, renderList as T, toDisplayString as a, vModelSelect as A, renderSlot as v, createTextVNode as C, createVNode as R, ref as V, computed as I, withModifiers as U, markRaw as j, h as P } from "vue";
2
+ import { d as z, e as G, u as H, _ as J, i as Y } from "./useDynamicForm-C6-0mGw4.js";
3
+ function q(h, m) {
4
+ return !h || !m || (h = m?.({ ...h }), h.children = h?.children?.map((u) => q(u, m)), h.choice = h?.choice?.map((u) => q(u, m))), h;
5
+ }
6
+ const Q = {
4
7
  key: 0,
5
8
  xmlns: "http://www.w3.org/2000/svg",
6
9
  fill: "none",
@@ -8,7 +11,7 @@ const G = {
8
11
  "stroke-width": "1.5",
9
12
  stroke: "currentColor",
10
13
  class: "size-3"
11
- }, H = {
14
+ }, X = {
12
15
  key: 1,
13
16
  xmlns: "http://www.w3.org/2000/svg",
14
17
  fill: "none",
@@ -23,344 +26,362 @@ const G = {
23
26
  color: { default: "blue" }
24
27
  },
25
28
  emits: ["click"],
26
- setup(C) {
27
- return (b, u) => (t(), l("button", {
29
+ setup(h) {
30
+ return (m, u) => (t(), l("button", {
28
31
  type: "button",
29
- class: m(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800", {
30
- "bg-blue-200 hover:bg-blue-300": b.color === "blue",
31
- "bg-red-200 hover:bg-red-300": b.color === "red"
32
+ class: g(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
33
+ "bg-blue-200 hover:bg-blue-300": m.color === "blue",
34
+ "bg-red-200 hover:bg-red-300": m.color === "red"
32
35
  }]),
33
- onClick: u[0] || (u[0] = (N) => b.$emit("click"))
36
+ onClick: u[0] || (u[0] = ($) => m.$emit("click"))
34
37
  }, [
35
- b.icon === "plus" ? (t(), l("svg", G, u[1] || (u[1] = [
36
- o("path", {
38
+ m.icon === "plus" ? (t(), l("svg", Q, u[1] || (u[1] = [
39
+ r("path", {
37
40
  "stroke-linecap": "round",
38
41
  "stroke-linejoin": "round",
39
42
  d: "M12 4.5v15m7.5-7.5h-15"
40
43
  }, null, -1)
41
- ]))) : n("", !0),
42
- b.icon === "minus" ? (t(), l("svg", H, u[2] || (u[2] = [
43
- o("path", {
44
+ ]))) : d("", !0),
45
+ m.icon === "minus" ? (t(), l("svg", X, u[2] || (u[2] = [
46
+ r("path", {
44
47
  "stroke-linecap": "round",
45
48
  "stroke-linejoin": "round",
46
49
  d: "M5 12h14"
47
50
  }, null, -1)
48
- ]))) : n("", !0)
51
+ ]))) : d("", !0)
49
52
  ], 2));
50
53
  }
51
- }), J = { class: "text-sm whitespace-pre-wrap" }, Y = ["data-testid"], Q = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, X = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, Z = { class: "text-sm whitespace-pre-wrap" }, K = ["data-testid"], M = {
54
+ }), Z = { class: "text-sm whitespace-pre-wrap" }, K = ["data-testid"], M = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, ee = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, te = { class: "text-sm whitespace-pre-wrap" }, le = ["data-testid"], ie = ["for"], se = {
52
55
  key: 0,
53
56
  class: "-ml-0.5 text-red-500"
54
- }, ee = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, te = { class: "text-sm whitespace-pre-wrap" }, le = ["data-testid"], se = ["for"], ie = {
57
+ }, de = { class: "text-sm whitespace-pre-wrap" }, ne = ["data-testid"], oe = ["for"], re = {
55
58
  key: 0,
56
59
  class: "-ml-0.5 text-red-500"
57
- }, oe = { class: "text-sm whitespace-pre-wrap" }, ne = ["data-testid"], de = {
60
+ }, ae = { class: "flex gap-2 items-center" }, ue = { class: "flex flex-col grow" }, ce = { class: "text-sm whitespace-pre-wrap" }, pe = ["data-testid"], he = {
58
61
  key: 0,
59
62
  class: "-ml-0.5 text-red-500"
60
- }, re = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ae = { class: "text-sm whitespace-pre-wrap" }, ue = ["data-testid"], ce = ["for"], pe = {
63
+ }, me = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, fe = { class: "text-sm whitespace-pre-wrap" }, be = ["data-testid"], ge = {
61
64
  key: 0,
62
65
  class: "-ml-0.5 text-red-500"
63
- }, he = { class: "flex gap-2 items-center" }, me = { class: "flex flex-col grow" }, be = { class: "text-sm whitespace-pre-wrap" }, fe = ["data-testid"], ge = ["id", "value", "disabled", "onChange", "onBlur"], xe = ["value"], ye = ["id", "onUpdate:modelValue", "disabled", "onBlur"], ve = ["value"], ke = ["id", "checked", "disabled", "onChange", "onBlur"], Oe = ["id", "onUpdate:modelValue", "disabled", "onBlur"], _e = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ce = ["id", "value", "disabled", "onInput", "onBlur"], we = /* @__PURE__ */ B({
66
+ }, ye = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, xe = { class: "text-sm whitespace-pre-wrap" }, ve = ["data-testid"], Oe = ["id", "value", "disabled", "onChange", "onBlur"], ke = ["value"], _e = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ce = ["value"], we = ["id", "checked", "disabled", "onChange", "onBlur"], $e = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ne = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Fe = ["id", "value", "disabled", "onInput", "onBlur"], Be = /* @__PURE__ */ B({
64
67
  __name: "TestFormTemplate",
65
- props: {
66
- slotProps: {}
67
- },
68
- setup(C) {
69
- const b = j();
70
- return (u, N) => (t(), O(U, { "metadata-configuration": v(b) }, {
71
- heading: x(({ fieldMetadata: e, fieldContext: { errorMessage: s, label: i }, disabled: d, canAddItems: r, addItem: h, canRemoveItems: f, removeItem: k }) => [
72
- o("div", {
73
- class: m(["mt-4", { "md:col-span-2": e.fullWidth }])
68
+ setup(h) {
69
+ const m = G();
70
+ return (u, $) => (t(), k(z, { "metadata-configuration": O(m) }, {
71
+ heading: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, canAddItems: o, addItem: p, canRemoveItems: y, removeItem: f, slotProps: c }) => [
72
+ e.hidden ? d("", !0) : (t(), l("div", {
73
+ key: 0,
74
+ class: g(["mt-4", { "md:col-span-2": e.fullWidth }])
74
75
  }, [
75
- i ? (t(), l("h3", {
76
+ s ? (t(), l("h3", {
76
77
  key: 0,
77
- class: m(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
78
+ class: g(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || n }])
78
79
  }, [
79
- w(a(i) + " ", 1),
80
- r ? (t(), O(_, {
80
+ C(a(s) + " ", 1),
81
+ o ? (t(), k(_, {
81
82
  key: 0,
82
83
  icon: "plus",
83
84
  tabindex: "-1",
84
85
  "data-testid": `${e.path}-add-button`,
85
- onClick: h
86
- }, null, 8, ["data-testid", "onClick"])) : n("", !0),
87
- f ? (t(), O(_, {
86
+ onClick: p
87
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0),
88
+ y ? (t(), k(_, {
88
89
  key: 1,
89
90
  icon: "minus",
90
91
  tabindex: "-1",
91
92
  color: "red",
92
93
  "data-testid": `${e.path}-remove-button`,
93
- onClick: k
94
- }, null, 8, ["data-testid", "onClick"])) : n("", !0)
95
- ], 2)) : n("", !0),
96
- o("pre", J, a(e.description), 1),
97
- s.value ? (t(), l("span", {
94
+ onClick: f
95
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0)
96
+ ], 2)) : d("", !0),
97
+ r("pre", Z, a(e.description), 1),
98
+ i.value ? (t(), l("span", {
98
99
  key: 1,
99
100
  class: "text-red-600 text-sm",
100
101
  "data-testid": `${e.path}-error-message`
101
- }, a(s.value), 9, Y)) : n("", !0),
102
- o("div", Q, [
103
- y(u.$slots, "default", {
104
- level: (u.slotProps?.level ?? 0) + 1
102
+ }, a(i.value), 9, K)) : d("", !0),
103
+ r("div", M, [
104
+ v(u.$slots, "default", {
105
+ level: (c?.level ?? 0) + 1
105
106
  })
106
107
  ])
107
- ], 2)
108
+ ], 2))
109
+ ]),
110
+ "heading-array": x(() => [
111
+ v(u.$slots, "default")
108
112
  ]),
109
- choice: x(({ fieldMetadata: e, fieldContext: { errorMessage: s, label: i }, disabled: d, required: r }) => [
110
- o("div", {
111
- class: m(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
113
+ "default-choice": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, required: o, slotProps: p }) => [
114
+ e.hidden ? d("", !0) : (t(), l("div", {
115
+ key: 0,
116
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
112
117
  }, [
113
- o("span", {
114
- class: m(["flex gap-2 items-center", { "text-gray-500": d, "after:content-['*'] after:-ml-0.5 after:text-red-500": r }])
115
- }, a(i), 3),
116
- o("div", X, [
117
- y(u.$slots, "default", {
118
- level: (u.slotProps?.level ?? 0) + 1,
118
+ r("span", {
119
+ class: g(["flex gap-2 items-center", { "text-gray-500": n, "after:content-['*'] after:-ml-0.5 after:text-red-500": o }])
120
+ }, a(s), 3),
121
+ r("div", ee, [
122
+ v(u.$slots, "default", {
123
+ level: (p?.level ?? 0) + 1,
119
124
  belowChoiceField: !0
120
125
  })
121
126
  ]),
122
- o("pre", Z, a(e.description), 1),
123
- s.value ? (t(), l("span", {
127
+ r("pre", te, a(e.description), 1),
128
+ i.value ? (t(), l("span", {
124
129
  key: 0,
125
130
  class: "text-red-600 text-sm",
126
131
  "data-testid": `${e.path}-error-message`
127
- }, a(s.value), 9, K)) : n("", !0)
128
- ], 2)
132
+ }, a(i.value), 9, le)) : d("", !0)
133
+ ], 2))
129
134
  ]),
130
- array: x(({ fieldMetadata: e, fieldContext: { errorMessage: s, label: i }, disabled: d, required: r, canAddItems: h, addItem: f }) => [
131
- u.slotProps?.belowChoiceField ? (t(), l("div", {
135
+ "default-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, required: o, canAddItems: p, addItem: y }) => [
136
+ e.hidden ? d("", !0) : (t(), l("div", {
132
137
  key: 0,
133
- class: m({ "md:col-span-2": e.fullWidth })
138
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
134
139
  }, [
135
- o("span", {
136
- class: m(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
140
+ r("label", {
141
+ for: `${e.path}[0]`,
142
+ class: g([{ "text-gray-500": e.disabled || n }, "flex gap-2 items-center"])
137
143
  }, [
138
- w(a(i) + " ", 1),
139
- r ? (t(), l("span", M, "*")) : n("", !0),
140
- h ? (t(), O(_, {
144
+ C(a(s) + " ", 1),
145
+ o ? (t(), l("span", se, "*")) : d("", !0),
146
+ p ? (t(), k(_, {
141
147
  key: 1,
142
148
  icon: "plus",
143
149
  tabindex: "-1",
144
150
  "data-testid": `${e.path}-add-button`,
145
- onClick: f
146
- }, null, 8, ["data-testid", "onClick"])) : n("", !0)
147
- ], 2),
148
- o("div", ee, [
149
- y(u.$slots, "default", {
150
- level: (u.slotProps?.level ?? 0) + 1
151
- })
152
- ]),
153
- o("pre", te, a(e.description), 1),
154
- s.value ? (t(), l("span", {
151
+ onClick: y
152
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0)
153
+ ], 10, ie),
154
+ v(u.$slots, "default", { hideLabel: !0 }),
155
+ r("pre", de, a(e.description), 1),
156
+ i.value ? (t(), l("span", {
155
157
  key: 0,
156
158
  class: "text-red-600 text-sm",
157
159
  "data-testid": `${e.path}-error-message`
158
- }, a(s.value), 9, le)) : n("", !0)
159
- ], 2)) : e.children?.length ? y(u.$slots, "default", { key: 1 }) : (t(), l("div", {
160
- key: 2,
161
- class: m(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
160
+ }, a(i.value), 9, ne)) : d("", !0)
161
+ ], 2))
162
+ ]),
163
+ default: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, required: o, canRemoveItems: p, removeItem: y, slotProps: f }) => [
164
+ e.hidden ? d("", !0) : (t(), l("div", {
165
+ key: 0,
166
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
162
167
  }, [
163
- o("label", {
164
- for: `${e.path}[0]`,
165
- class: m([{ "text-gray-500": e.disabled || d }, "flex gap-2 items-center"])
168
+ f?.hideLabel ? d("", !0) : (t(), l("label", {
169
+ key: 0,
170
+ for: e.path,
171
+ class: g({ "text-gray-500": e.disabled || n })
172
+ }, [
173
+ C(a(s) + " ", 1),
174
+ o ? (t(), l("span", re, "*")) : d("", !0)
175
+ ], 10, oe)),
176
+ r("div", ae, [
177
+ r("div", ue, [
178
+ v(u.$slots, "default")
179
+ ]),
180
+ R(_, {
181
+ class: g({ invisible: !p }),
182
+ icon: "minus",
183
+ tabindex: "-1",
184
+ color: "red",
185
+ "data-testid": `${e.path}-remove-button`,
186
+ onClick: y
187
+ }, null, 8, ["class", "data-testid", "onClick"])
188
+ ]),
189
+ r("pre", ce, a(e.description), 1),
190
+ i.value ? (t(), l("span", {
191
+ key: 1,
192
+ class: "text-red-600 text-sm",
193
+ "data-testid": `${e.path}-error-message`
194
+ }, a(i.value), 9, pe)) : d("", !0)
195
+ ], 2)),
196
+ v(u.$slots, "attributes")
197
+ ]),
198
+ "group-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, required: o, canAddItems: p, addItem: y, slotProps: f }) => [
199
+ e.hidden ? (t(), l(F, { key: 0 }, [], 64)) : f?.belowChoiceField ? (t(), l("div", {
200
+ key: 1,
201
+ class: g({ "md:col-span-2": e.fullWidth })
202
+ }, [
203
+ r("span", {
204
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || n }])
166
205
  }, [
167
- w(a(i) + " ", 1),
168
- r ? (t(), l("span", ie, "*")) : n("", !0),
169
- h ? (t(), O(_, {
206
+ C(a(s) + " ", 1),
207
+ o ? (t(), l("span", he, "*")) : d("", !0),
208
+ p ? (t(), k(_, {
170
209
  key: 1,
171
210
  icon: "plus",
172
211
  tabindex: "-1",
173
212
  "data-testid": `${e.path}-add-button`,
174
- onClick: f
175
- }, null, 8, ["data-testid", "onClick"])) : n("", !0)
176
- ], 10, se),
177
- y(u.$slots, "default", { hideLabel: !0 }),
178
- o("pre", oe, a(e.description), 1),
179
- s.value ? (t(), l("span", {
213
+ onClick: y
214
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0)
215
+ ], 2),
216
+ r("div", me, [
217
+ v(u.$slots, "default", {
218
+ level: (f?.level ?? 0) + 1
219
+ })
220
+ ]),
221
+ r("pre", fe, a(e.description), 1),
222
+ i.value ? (t(), l("span", {
180
223
  key: 0,
181
224
  class: "text-red-600 text-sm",
182
225
  "data-testid": `${e.path}-error-message`
183
- }, a(s.value), 9, ne)) : n("", !0)
184
- ], 2))
226
+ }, a(i.value), 9, be)) : d("", !0)
227
+ ], 2)) : v(u.$slots, "default", { key: 2 })
185
228
  ]),
186
- default: x(({ fieldMetadata: e, fieldContext: { errorMessage: s, label: i }, disabled: d, required: r, canAddItems: h, canRemoveItems: f, addItem: k, removeItem: p }) => [
187
- e.children?.length ? (t(), l("div", {
229
+ group: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: s }, disabled: n, required: o, canAddItems: p, canRemoveItems: y, addItem: f, removeItem: c, slotProps: b }) => [
230
+ e.hidden ? d("", !0) : (t(), l("div", {
188
231
  key: 0,
189
- class: m({ "md:col-span-2": e.fullWidth })
232
+ class: g({ "md:col-span-2": e.fullWidth })
190
233
  }, [
191
- u.slotProps?.hideLabel ? n("", !0) : (t(), l("span", {
234
+ b?.hideLabel ? d("", !0) : (t(), l("span", {
192
235
  key: 0,
193
- class: m(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
236
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || n }])
194
237
  }, [
195
- w(a(i) + " ", 1),
196
- r ? (t(), l("span", de, "*")) : n("", !0),
197
- h ? (t(), O(_, {
238
+ C(a(s) + " ", 1),
239
+ o ? (t(), l("span", ge, "*")) : d("", !0),
240
+ p ? (t(), k(_, {
198
241
  key: 1,
199
242
  icon: "plus",
200
243
  tabindex: "-1",
201
244
  "data-testid": `${e.path}-add-button`,
202
- onClick: k
203
- }, null, 8, ["data-testid", "onClick"])) : n("", !0),
204
- f ? (t(), O(_, {
245
+ onClick: f
246
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0),
247
+ y ? (t(), k(_, {
205
248
  key: 2,
206
249
  icon: "minus",
207
250
  tabindex: "-1",
208
251
  "data-testid": `${e.path}-remove-button`,
209
252
  color: "red",
210
- onClick: p
211
- }, null, 8, ["data-testid", "onClick"])) : n("", !0)
253
+ onClick: c
254
+ }, null, 8, ["data-testid", "onClick"])) : d("", !0)
212
255
  ], 2)),
213
- o("div", re, [
214
- y(u.$slots, "default", {
215
- level: (u.slotProps?.level ?? 0) + 1
256
+ r("div", ye, [
257
+ v(u.$slots, "default", {
258
+ level: (b?.level ?? 0) + 1
216
259
  })
217
260
  ]),
218
- o("pre", ae, a(e.description), 1),
219
- s.value ? (t(), l("span", {
261
+ r("pre", xe, a(e.description), 1),
262
+ i.value ? (t(), l("span", {
220
263
  key: 1,
221
264
  class: "text-red-600 text-sm",
222
265
  "data-testid": `${e.path}-error-message`
223
- }, a(s.value), 9, ue)) : n("", !0)
224
- ], 2)) : (t(), l("div", {
225
- key: 1,
226
- class: m(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
227
- }, [
228
- u.slotProps?.hideLabel ? n("", !0) : (t(), l("label", {
229
- key: 0,
230
- for: e.path,
231
- class: m({ "text-gray-500": e.disabled || d })
232
- }, [
233
- w(a(i) + " ", 1),
234
- r ? (t(), l("span", pe, "*")) : n("", !0)
235
- ], 10, ce)),
236
- o("div", he, [
237
- o("div", me, [
238
- y(u.$slots, "default")
239
- ]),
240
- V(_, {
241
- class: m({ invisible: !f }),
242
- icon: "minus",
243
- tabindex: "-1",
244
- color: "red",
245
- "data-testid": `${e.path}-remove-button`,
246
- onClick: p
247
- }, null, 8, ["class", "data-testid", "onClick"])
248
- ]),
249
- o("pre", be, a(e.description), 1),
250
- s.value ? (t(), l("span", {
251
- key: 1,
252
- class: "text-red-600 text-sm",
253
- "data-testid": `${e.path}-error-message`
254
- }, a(s.value), 9, fe)) : n("", !0)
266
+ }, a(i.value), 9, ve)) : d("", !0)
255
267
  ], 2)),
256
- y(u.$slots, "attributes")
268
+ v(u.$slots, "attributes")
257
269
  ]),
258
- "select-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i, handleChange: d }, disabled: r }) => [
259
- o("select", {
270
+ "select-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s, handleChange: n }, disabled: o }) => [
271
+ r("select", {
260
272
  id: e.path,
261
- value: s.value,
262
- disabled: e.disabled || r,
273
+ value: i.value,
274
+ disabled: e.disabled || o,
263
275
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
264
- onChange: d,
265
- onBlur: i
276
+ onChange: n,
277
+ onBlur: s
266
278
  }, [
267
- (t(!0), l(W, null, q(e.options, ({ key: h, value: f }) => (t(), l("option", {
268
- key: h,
269
- value: h
270
- }, a(f), 9, xe))), 128))
271
- ], 40, ge)
279
+ (t(!0), l(F, null, T(e.options, ({ key: p, value: y }) => (t(), l("option", {
280
+ key: p,
281
+ value: p
282
+ }, a(y), 9, ke))), 128))
283
+ ], 40, Oe)
272
284
  ]),
273
- "selectBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i }, disabled: d }) => [
274
- F(o("select", {
285
+ "selectBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s }, disabled: n }) => [
286
+ W(r("select", {
275
287
  id: e.path,
276
- "onUpdate:modelValue": (r) => s.value = r,
277
- disabled: e.disabled || d,
288
+ "onUpdate:modelValue": (o) => i.value = o,
289
+ disabled: e.disabled || n,
278
290
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
279
- onBlur: i
291
+ onBlur: s
280
292
  }, [
281
- (t(!0), l(W, null, q(e.options, ({ key: r, value: h }) => (t(), l("option", {
282
- key: r,
283
- value: r
284
- }, a(h), 9, ve))), 128))
285
- ], 40, ye), [
286
- [L, s.value]
293
+ (t(!0), l(F, null, T(e.options, ({ key: o, value: p }) => (t(), l("option", {
294
+ key: o,
295
+ value: o
296
+ }, a(p), 9, Ce))), 128))
297
+ ], 40, _e), [
298
+ [A, i.value]
287
299
  ])
288
300
  ]),
289
- "checkbox-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i, handleChange: d }, disabled: r }) => [
290
- o("input", {
301
+ "checkbox-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s, handleChange: n }, disabled: o }) => [
302
+ r("input", {
291
303
  id: e.path,
292
- checked: s.value,
293
- disabled: e.disabled || r,
304
+ checked: i.value,
305
+ disabled: e.disabled || o,
294
306
  type: "checkbox",
295
307
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
296
- onChange: (h) => d(h.target.checked),
297
- onBlur: i
298
- }, null, 40, ke)
308
+ onChange: (p) => n(p.target.checked),
309
+ onBlur: s
310
+ }, null, 40, we)
299
311
  ]),
300
- "checkboxBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i }, disabled: d }) => [
301
- F(o("input", {
312
+ "checkboxBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s }, disabled: n }) => [
313
+ W(r("input", {
302
314
  id: e.path,
303
- "onUpdate:modelValue": (r) => s.value = r,
304
- disabled: e.disabled || d,
315
+ "onUpdate:modelValue": (o) => i.value = o,
316
+ disabled: e.disabled || n,
305
317
  type: "checkbox",
306
318
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
307
- onBlur: i
308
- }, null, 40, Oe), [
309
- [D, s.value]
319
+ onBlur: s
320
+ }, null, 40, $e), [
321
+ [D, i.value]
310
322
  ])
311
323
  ]),
312
- "textBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i }, disabled: d }) => [
313
- F(o("input", {
324
+ "textBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s }, disabled: n }) => [
325
+ W(r("input", {
314
326
  id: e.path,
315
- "onUpdate:modelValue": (r) => s.value = r,
316
- disabled: e.disabled || d,
327
+ "onUpdate:modelValue": (o) => i.value = o,
328
+ disabled: e.disabled || n,
317
329
  type: "text",
318
330
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
319
- onBlur: i
320
- }, null, 40, _e), [
321
- [R, s.value]
331
+ onBlur: s
332
+ }, null, 40, Ne), [
333
+ [L, i.value]
322
334
  ])
323
335
  ]),
324
- "default-input": x(({ fieldMetadata: e, fieldContext: { value: s, handleBlur: i, handleChange: d }, disabled: r }) => [
325
- o("input", {
336
+ "default-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: s, handleChange: n }, disabled: o }) => [
337
+ r("input", {
326
338
  id: e.path,
327
- value: s.value,
328
- disabled: e.disabled || r,
339
+ value: i.value,
340
+ disabled: e.disabled || o,
329
341
  type: "text",
330
342
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
331
- onInput: d,
332
- onBlur: i
333
- }, null, 40, Ce)
343
+ onInput: n,
344
+ onBlur: s
345
+ }, null, 40, Fe)
334
346
  ]),
335
347
  _: 3
336
348
  }, 8, ["metadata-configuration"]));
337
349
  }
338
- }), $e = { class: "flex justify-end gap-2" }, Ne = {
350
+ }), We = { class: "flex justify-end gap-2" }, Ve = {
339
351
  key: 1,
340
352
  type: "submit",
341
353
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
342
354
  "data-testid": "submit"
343
- }, Be = {
355
+ }, Te = {
344
356
  key: 0,
345
357
  "data-testid": "errors",
346
358
  class: "col-12 text-red-600"
347
- }, Fe = ["innerHTML"], Te = {
359
+ }, qe = ["innerHTML"], Se = {
348
360
  key: 1,
349
361
  "data-testid": "isSubmitted"
350
- }, We = {
362
+ }, Ie = {
351
363
  key: 2,
352
364
  class: "bg-gray-100 p-4 rounded-lg text-sm overflow-auto"
353
- }, qe = /* @__PURE__ */ B({
365
+ }, Re = /* @__PURE__ */ B({
354
366
  __name: "TestForm",
355
367
  props: {
356
368
  metadata: {},
357
369
  settings: {},
358
- showDebugState: { type: Boolean, default: !1 }
370
+ showDebugState: { type: Boolean, default: !1 },
371
+ initialEdit: { type: Boolean, default: !0 },
372
+ hideFieldsWithoutValue: { type: Boolean, default: !1 },
373
+ initialValues: {}
359
374
  },
360
- setup(C) {
361
- const { values: b, handleSubmit: u, errors: N, meta: e } = A(), s = T(), i = T(!0), d = T(!1), r = S(() => C.metadata?.map((p) => k(p, (c) => (c.computedProps = c.computedProps ?? [], c.computedProps?.push((g) => {
362
- i.value || (g.disabled = !0);
363
- }), c)))), h = S(() => ({
375
+ setup(h) {
376
+ const { values: m, handleSubmit: u, errors: $, meta: e } = H({
377
+ initialValues: h.initialValues
378
+ }), i = V(), s = V(h.initialEdit), n = V(!1), o = I(() => h.metadata?.map((f) => q(f, (c) => (c.computedProps = c.computedProps ?? [], c.computedProps.push((b) => {
379
+ s.value || (b.disabled = !0);
380
+ }), h.hideFieldsWithoutValue && (c.computedProps.push((b, N) => {
381
+ !s.value && !Y(N.value) && (b.hidden = !0);
382
+ }), c.computedProps.push((b, N, S) => {
383
+ !s.value && S.value.length > 0 && S.value.every((E) => E.hidden) && (b.hidden = !0);
384
+ })), c)))), p = I(() => ({
364
385
  analytics: !0,
365
386
  messages: {
366
387
  required: "{field} is required",
@@ -379,72 +400,71 @@ const G = {
379
400
  fractionDigits: "{field} may have at most {digits} decimal place(s)",
380
401
  totalDigits: "{field} may have at most {digits} significant digit(s)"
381
402
  },
382
- ...C.settings ?? {}
403
+ ...h.settings ?? {}
383
404
  }));
384
- function f(p) {
405
+ function y(f) {
385
406
  u(
386
407
  (c) => {
387
- d.value = !0;
408
+ n.value = !0, s.value = !1;
388
409
  },
389
410
  ({ errors: c }) => {
390
- d.value = !1;
411
+ n.value = !1;
391
412
  }
392
- )(p);
393
- }
394
- function k(p, c) {
395
- return !p || !c || (p = c?.({ ...p }), p.children = p?.children?.map((g) => k(g, c)), p.choice = p?.choice?.map((g) => k(g, c))), p;
413
+ )(f);
396
414
  }
397
- return (p, c) => (t(), l("form", { onSubmit: f }, [
398
- o("div", $e, [
399
- i.value ? n("", !0) : (t(), l("button", {
415
+ return (f, c) => (t(), l("form", {
416
+ onSubmit: U(y, ["prevent"])
417
+ }, [
418
+ r("div", We, [
419
+ s.value ? d("", !0) : (t(), l("button", {
400
420
  key: 0,
401
421
  type: "button",
402
422
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
403
423
  "data-testid": "submit",
404
- onClick: c[0] || (c[0] = (g) => i.value = !0)
424
+ onClick: c[0] || (c[0] = (b) => s.value = !0)
405
425
  }, " Edit ")),
406
- i.value ? (t(), l("button", Ne, " Submit ")) : n("", !0),
407
- i.value ? (t(), l("button", {
426
+ s.value ? (t(), l("button", Ve, " Submit ")) : d("", !0),
427
+ s.value ? (t(), l("button", {
408
428
  key: 2,
409
429
  type: "button",
410
430
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
411
431
  "data-testid": "cancel",
412
- onClick: c[1] || (c[1] = (g) => i.value = !1)
413
- }, " Cancel ")) : n("", !0)
432
+ onClick: c[1] || (c[1] = (b) => s.value = !1)
433
+ }, " Cancel ")) : d("", !0)
414
434
  ]),
415
- Object.values(v(N)).length ? (t(), l("div", Be, [
416
- c[3] || (c[3] = w(" Errors: ", -1)),
417
- o("ul", null, [
418
- (t(!0), l(W, null, q(v(N), (g, P) => (t(), l("li", { key: P }, [
419
- o("span", { innerHTML: g }, null, 8, Fe)
435
+ Object.values(O($)).length ? (t(), l("div", Te, [
436
+ c[3] || (c[3] = C(" Errors: ", -1)),
437
+ r("ul", null, [
438
+ (t(!0), l(F, null, T(O($), (b, N) => (t(), l("li", { key: N }, [
439
+ r("span", { innerHTML: b }, null, 8, qe)
420
440
  ]))), 128))
421
441
  ])
422
- ])) : n("", !0),
423
- V(z, {
424
- template: we,
425
- metadata: r.value,
426
- settings: h.value,
427
- "onUpdate:modelValue": c[2] || (c[2] = (g) => s.value = g)
442
+ ])) : d("", !0),
443
+ R(J, {
444
+ template: Be,
445
+ metadata: o.value,
446
+ settings: p.value,
447
+ "onUpdate:modelValue": c[2] || (c[2] = (b) => i.value = b)
428
448
  }, null, 8, ["metadata", "settings"]),
429
- d.value ? (t(), l("span", Te)) : n("", !0),
430
- p.showDebugState ? (t(), l("pre", We, "IsDirty: " + a(v(e).dirty) + `
431
- Pending: ` + a(v(e).pending) + `
432
- Touched: ` + a(v(e).touched) + `
433
- Valid: ` + a(v(e).valid) + `
434
- Submitted: ` + a(d.value) + `
449
+ n.value ? (t(), l("span", Se)) : d("", !0),
450
+ f.showDebugState ? (t(), l("pre", Ie, "IsDirty: " + a(O(e).dirty) + `
451
+ Pending: ` + a(O(e).pending) + `
452
+ Touched: ` + a(O(e).touched) + `
453
+ Valid: ` + a(O(e).valid) + `
454
+ Submitted: ` + a(n.value) + `
435
455
 
436
456
  // form values:
437
- ` + a(JSON.stringify(v(b), null, 2)) + `
438
- `, 1)) : n("", !0)
457
+ ` + a(JSON.stringify(O(m), null, 2)) + `
458
+ `, 1)) : d("", !0)
439
459
  ], 32));
440
460
  }
441
- }), Pe = $([{
461
+ }), De = w([{
442
462
  name: "text",
443
463
  type: "text",
444
464
  fieldOptions: { label: "Text Input" },
445
465
  path: "with.custom.structure",
446
466
  restriction: { maxLength: 10 }
447
- }]), Re = $([{
467
+ }]), Ae = w([{
448
468
  fieldOptions: { label: "Array Fields" },
449
469
  type: "heading",
450
470
  children: [
@@ -461,15 +481,15 @@ Submitted: ` + a(d.value) + `
461
481
  { fieldOptions: { label: "Nested field 3" }, type: "checkbox" }
462
482
  ] }
463
483
  ]
464
- }]), De = $([{
484
+ }]), Ue = w([{
465
485
  fieldOptions: { label: "Grouped Fields" },
466
486
  type: "heading",
467
487
  children: [
468
- { fieldOptions: { label: "Required group" }, children: [
488
+ { fieldOptions: { label: "Required group" }, type: "group", children: [
469
489
  { fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
470
490
  { fieldOptions: { label: "Required Nested field 2" }, fullWidth: !0 }
471
491
  ] },
472
- { fieldOptions: { label: "Optional group" }, minOccurs: 0, description: `The group is optional, therefore the children will only be required once 1 value is filled in.
492
+ { fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, description: `The group is optional, therefore the children will only be required once 1 value is filled in.
473
493
 
474
494
  You can test it by filling in one of the fields.`, children: [
475
495
  { fieldOptions: { label: "Required Nested field 1" }, fullWidth: !0 },
@@ -480,16 +500,16 @@ You can test it by filling in one of the fields.`, children: [
480
500
  fieldOptions: { label: "Grouped Array Fields" },
481
501
  type: "heading",
482
502
  children: [
483
- { fieldOptions: { label: "Required group" }, maxOccurs: 5, fullWidth: !0, children: [
503
+ { fieldOptions: { label: "Required group" }, type: "group", maxOccurs: 5, fullWidth: !0, children: [
484
504
  { fieldOptions: { label: "Required Nested field 1" } },
485
505
  { fieldOptions: { label: "Required Nested field 2" } }
486
506
  ] },
487
- { fieldOptions: { label: "Optional group" }, minOccurs: 0, maxOccurs: 5, fullWidth: !0, children: [
507
+ { fieldOptions: { label: "Optional group" }, type: "group", minOccurs: 0, maxOccurs: 5, fullWidth: !0, children: [
488
508
  { fieldOptions: { label: "Required Nested field 1" } },
489
509
  { fieldOptions: { label: "Required Nested field 2" } }
490
510
  ] }
491
511
  ]
492
- }]), Le = $([
512
+ }]), je = w([
493
513
  {
494
514
  fieldOptions: { label: "Choice Fields (minOccurs 1, maxOccurs 1)" },
495
515
  type: "heading",
@@ -504,9 +524,15 @@ You can test it by filling in one of the fields.`, children: [
504
524
  fieldOptions: { label: "Choice Grouped Fields (minOccurs 1, maxOccurs 3)" },
505
525
  type: "heading",
506
526
  children: [
507
- { fieldOptions: { label: "Array Choice Field" }, maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
508
- { fieldOptions: { label: "Nested Field 1" }, children: [{ fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 }, { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }] },
509
- { fieldOptions: { label: "Nested Field 2" }, children: [{ fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 }, { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }] }
527
+ { fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
528
+ { fieldOptions: { label: "Nested Field 1" }, type: "group", children: [
529
+ { fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
530
+ { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
531
+ ] },
532
+ { fieldOptions: { label: "Nested Field 2" }, type: "group", children: [
533
+ { fieldOptions: { label: "Nested Child Field 1" }, fullWidth: !0 },
534
+ { fieldOptions: { label: "Nested Child Field 2" }, fullWidth: !0 }
535
+ ] }
510
536
  ] }
511
537
  ]
512
538
  },
@@ -514,13 +540,46 @@ You can test it by filling in one of the fields.`, children: [
514
540
  fieldOptions: { label: "Choice Array Fields (minOccurs 1, maxOccurs 3)" },
515
541
  type: "heading",
516
542
  children: [
517
- { fieldOptions: { label: "Array Choice Field" }, maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
543
+ { fieldOptions: { label: "Array Choice Field" }, type: "group", maxOccurs: 3, fullWidth: !0, description: "In a choice field, only 1 of the fields can be filled in.", choice: [
518
544
  { fieldOptions: { label: "Nested Field 1" }, maxOccurs: 3 },
519
545
  { fieldOptions: { label: "Nested Field 2" }, maxOccurs: 3 }
520
546
  ] }
521
547
  ]
522
548
  }
523
- ]), Ee = $(
549
+ ]), Pe = w([
550
+ {
551
+ fieldOptions: { label: "Personal Info" },
552
+ type: "heading",
553
+ name: "person",
554
+ description: "Only showing the fields that have a value. Click edit to change.",
555
+ fullWidth: !0,
556
+ children: [
557
+ { name: "firstName", fieldOptions: { label: "First Name" } },
558
+ { name: "lastName", fieldOptions: { label: "Last Name" } },
559
+ { name: "email", fieldOptions: { label: "Email" } }
560
+ ]
561
+ },
562
+ {
563
+ fieldOptions: { label: "Address" },
564
+ type: "heading",
565
+ name: "address",
566
+ fullWidth: !0,
567
+ children: [
568
+ { name: "street", fieldOptions: { label: "Street" }, minOccurs: 0 },
569
+ { name: "city", fieldOptions: { label: "City" }, minOccurs: 0 },
570
+ { name: "country", fieldOptions: { label: "Country" }, minOccurs: 0 }
571
+ ]
572
+ }
573
+ ], void 0, {
574
+ initialEdit: !1,
575
+ hideFieldsWithoutValue: !0,
576
+ initialValues: {
577
+ person: {
578
+ firstName: "Jack",
579
+ lastName: "Smit"
580
+ }
581
+ }
582
+ }), ze = w(
524
583
  [{
525
584
  name: "items",
526
585
  type: "text",
@@ -535,18 +594,19 @@ You can test it by filling in one of the fields.`, children: [
535
594
  // validateOnBlur: true,
536
595
  }
537
596
  );
538
- function $(C, b) {
539
- return E(B({
540
- render: () => I(qe, { metadata: C, settings: b, showDebugState: !0 })
597
+ function w(h, m, u = {}) {
598
+ return j(B({
599
+ render: () => P(Re, { ...u, metadata: h, settings: m, showDebugState: !0 })
541
600
  }));
542
601
  }
543
602
  export {
544
- we as TestFormTemplate,
545
- Re as arrayTestCase,
546
- Le as choiceTestCase,
547
- $ as createTestCase,
548
- Pe as defaultTestCase,
549
- De as groupTestCase,
550
- Ee as individualTestCase
603
+ Be as TestFormTemplate,
604
+ Ae as arrayTestCase,
605
+ Pe as childFieldsTestCase,
606
+ je as choiceTestCase,
607
+ w as createTestCase,
608
+ De as defaultTestCase,
609
+ Ue as groupTestCase,
610
+ ze as individualTestCase
551
611
  };
552
612
  //# sourceMappingURL=examples.es.js.map