@bach.software/vue-dynamic-form 0.4.0 → 0.5.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.
@@ -1,8 +1,5 @@
1
- import { defineComponent as B, createElementBlock as l, openBlock as t, normalizeClass as y, createCommentVNode as s, createElementVNode as r, createBlock as O, unref as k, withCtx as x, withDirectives as W, vModelText as I, vModelCheckbox as R, Fragment as F, renderList as T, toDisplayString as u, vModelSelect as A, renderSlot as v, createTextVNode as w, createVNode as q, ref as V, computed as L, withModifiers as U, markRaw as j, h as P } from "vue";
2
- import { d as z, e as G, u as H, _ as J, h as Y } from "./useDynamicForm-B3VHKage.js";
3
- function S(h, f) {
4
- return !h || !f || (h = f?.({ ...h }), h.children = h?.children?.map((c) => S(c, f)), h.choice = h?.choice?.map((c) => S(c, f))), h;
5
- }
1
+ import { defineComponent as B, createElementBlock as l, openBlock as t, normalizeClass as g, createCommentVNode as s, createElementVNode as r, createBlock as O, unref as v, withCtx as x, withDirectives as W, vModelText as D, vModelCheckbox as I, Fragment as F, renderList as T, toDisplayString as u, vModelSelect as R, renderSlot as y, createTextVNode as w, createVNode as L, ref as V, computed as E, withModifiers as A, markRaw as U, h as j } from "vue";
2
+ import { d as P, e as z, u as G, m as H, _ as J, h as Y } from "./mapEachMetadataItem-B4xJvJDj.js";
6
3
  const Q = {
7
4
  key: 0,
8
5
  xmlns: "http://www.w3.org/2000/svg",
@@ -26,29 +23,29 @@ const Q = {
26
23
  color: { default: "blue" }
27
24
  },
28
25
  emits: ["click"],
29
- setup(h) {
30
- return (f, c) => (t(), l("button", {
26
+ setup(b) {
27
+ return (k, c) => (t(), l("button", {
31
28
  type: "button",
32
- class: y(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
33
- "bg-blue-200 hover:bg-blue-300": f.color === "blue",
34
- "bg-red-200 hover:bg-red-300": f.color === "red"
29
+ class: g(["cursor-pointer inline-flex items-center justify-center rounded-full size-5 text-white-800 cursor-pointer", {
30
+ "bg-blue-200 hover:bg-blue-300": b.color === "blue",
31
+ "bg-red-200 hover:bg-red-300": b.color === "red"
35
32
  }]),
36
- onClick: c[0] || (c[0] = (N) => f.$emit("click"))
33
+ onClick: c[0] || (c[0] = (N) => k.$emit("click"))
37
34
  }, [
38
- f.icon === "plus" ? (t(), l("svg", Q, c[1] || (c[1] = [
35
+ b.icon === "plus" ? (t(), l("svg", Q, [...c[1] || (c[1] = [
39
36
  r("path", {
40
37
  "stroke-linecap": "round",
41
38
  "stroke-linejoin": "round",
42
39
  d: "M12 4.5v15m7.5-7.5h-15"
43
40
  }, null, -1)
44
- ]))) : s("", !0),
45
- f.icon === "minus" ? (t(), l("svg", X, c[2] || (c[2] = [
41
+ ])])) : s("", !0),
42
+ b.icon === "minus" ? (t(), l("svg", X, [...c[2] || (c[2] = [
46
43
  r("path", {
47
44
  "stroke-linecap": "round",
48
45
  "stroke-linejoin": "round",
49
46
  d: "M5 12h14"
50
47
  }, null, -1)
51
- ]))) : s("", !0)
48
+ ])])) : s("", !0)
52
49
  ], 2));
53
50
  }
54
51
  }), Z = { class: "text-sm whitespace-pre-wrap" }, K = ["data-testid"], M = { class: "grid grid-cols-1 md:grid-cols-2 gap-6" }, ee = {
@@ -57,10 +54,10 @@ const Q = {
57
54
  }, te = {
58
55
  key: 1,
59
56
  class: "text-sm text-gray-400"
60
- }, le = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, se = { class: "text-sm whitespace-pre-wrap" }, ie = ["data-testid"], ne = ["for"], oe = {
57
+ }, le = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, se = { class: "text-sm whitespace-pre-wrap" }, ie = ["data-testid"], ne = ["for"], de = {
61
58
  key: 0,
62
59
  class: "text-red-500 dark:text-rose-400"
63
- }, de = {
60
+ }, oe = {
64
61
  key: 1,
65
62
  class: "text-sm text-gray-400"
66
63
  }, ae = { class: "text-sm whitespace-pre-wrap" }, re = ["data-testid"], ue = ["for"], ce = {
@@ -69,13 +66,13 @@ const Q = {
69
66
  }, pe = {
70
67
  key: 1,
71
68
  class: "text-sm text-gray-400"
72
- }, he = { class: "flex gap-2 items-center" }, me = { class: "flex flex-col grow" }, fe = { class: "text-sm whitespace-pre-wrap" }, be = ["data-testid"], ge = {
69
+ }, he = { class: "flex gap-2 items-center" }, me = { class: "flex flex-col grow" }, be = { class: "text-sm whitespace-pre-wrap" }, fe = ["data-testid"], ge = {
73
70
  key: 0,
74
71
  class: "text-red-500 dark:text-rose-400"
75
- }, ye = {
72
+ }, xe = {
76
73
  key: 1,
77
74
  class: "text-sm text-gray-400"
78
- }, xe = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ve = { class: "text-sm whitespace-pre-wrap" }, ke = ["data-testid"], _e = {
75
+ }, ye = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, ve = { class: "text-sm whitespace-pre-wrap" }, ke = ["data-testid"], _e = {
79
76
  key: 0,
80
77
  class: "text-red-500 dark:text-rose-400"
81
78
  }, Oe = {
@@ -83,27 +80,27 @@ const Q = {
83
80
  class: "text-sm text-gray-400"
84
81
  }, Ce = { class: "grid grid-cols-1 md:grid-cols-2 gap-6 ms-6" }, we = { class: "text-sm whitespace-pre-wrap" }, $e = ["data-testid"], Ne = ["id", "value", "disabled", "onChange", "onBlur"], Fe = ["value"], Be = ["id", "onUpdate:modelValue", "disabled", "onBlur"], We = ["value"], Ve = ["id", "checked", "disabled", "onChange", "onBlur"], Te = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Se = ["id", "onUpdate:modelValue", "disabled", "onBlur"], Ee = ["id", "value", "disabled", "onInput", "onBlur"], Le = /* @__PURE__ */ B({
85
82
  __name: "TestFormTemplate",
86
- setup(h) {
87
- const f = G();
88
- return (c, N) => (t(), O(z, { "metadata-configuration": k(f) }, {
89
- heading: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, canAddItems: o, addItem: p, canRemoveItems: b, removeItem: m, slotProps: a }) => [
83
+ setup(b) {
84
+ const k = z();
85
+ return (c, N) => (t(), O(P, { "metadata-configuration": v(k) }, {
86
+ heading: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, canAddItems: d, addItem: p, canRemoveItems: h, removeItem: m, slotProps: a }) => [
90
87
  e.hidden ? s("", !0) : (t(), l("div", {
91
88
  key: 0,
92
- class: y(["mt-4", { "md:col-span-2": e.fullWidth }])
89
+ class: g(["mt-4", { "md:col-span-2": e.fullWidth }])
93
90
  }, [
94
91
  n ? (t(), l("h3", {
95
92
  key: 0,
96
- class: y(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
93
+ class: g(["flex text-xl font-bold gap-2 items-center mb-2", { "text-gray-500": e.disabled || o }])
97
94
  }, [
98
95
  w(u(n) + " ", 1),
99
- o ? (t(), O(C, {
96
+ d ? (t(), O(C, {
100
97
  key: 0,
101
98
  icon: "plus",
102
99
  tabindex: "-1",
103
100
  "data-testid": `${e.path}-add-button`,
104
101
  onClick: p
105
102
  }, null, 8, ["data-testid", "onClick"])) : s("", !0),
106
- b ? (t(), O(C, {
103
+ h ? (t(), O(C, {
107
104
  key: 1,
108
105
  icon: "minus",
109
106
  tabindex: "-1",
@@ -119,29 +116,29 @@ const Q = {
119
116
  "data-testid": `${e.path}-error-message`
120
117
  }, u(i.value), 9, K)) : s("", !0),
121
118
  r("div", M, [
122
- v(c.$slots, "default", {
119
+ y(c.$slots, "default", {
123
120
  level: (a?.level ?? 0) + 1
124
121
  })
125
122
  ])
126
123
  ], 2))
127
124
  ]),
128
125
  "heading-array": x(() => [
129
- v(c.$slots, "default")
126
+ y(c.$slots, "default")
130
127
  ]),
131
- "default-choice": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, slotProps: p, settings: { showOptionalInsteadOfRequired: b } }) => [
128
+ "default-choice": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, required: d, slotProps: p, settings: { showOptionalInsteadOfRequired: h } }) => [
132
129
  e.hidden ? s("", !0) : (t(), l("div", {
133
130
  key: 0,
134
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
131
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
135
132
  }, [
136
133
  r("span", {
137
- class: y(["flex gap-2 items-center", { "text-gray-500": d }])
134
+ class: g(["flex gap-2 items-center", { "text-gray-500": o }])
138
135
  }, [
139
136
  w(u(n) + " ", 1),
140
- o && !b ? (t(), l("span", ee, "*")) : s("", !0),
141
- !o && b ? (t(), l("span", te, "(optional)")) : s("", !0)
137
+ d && !h ? (t(), l("span", ee, "*")) : s("", !0),
138
+ !d && h ? (t(), l("span", te, "(optional)")) : s("", !0)
142
139
  ], 2),
143
140
  r("div", le, [
144
- v(c.$slots, "default", {
141
+ y(c.$slots, "default", {
145
142
  level: (p?.level ?? 0) + 1,
146
143
  belowChoiceField: !0
147
144
  })
@@ -154,27 +151,27 @@ const Q = {
154
151
  }, u(i.value), 9, ie)) : s("", !0)
155
152
  ], 2))
156
153
  ]),
157
- "default-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, addItem: b, settings: { showOptionalInsteadOfRequired: m } }) => [
154
+ "default-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, required: d, canAddItems: p, addItem: h, settings: { showOptionalInsteadOfRequired: m } }) => [
158
155
  e.hidden ? s("", !0) : (t(), l("div", {
159
156
  key: 0,
160
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
157
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
161
158
  }, [
162
159
  r("label", {
163
160
  for: `${e.path}[0]`,
164
- class: y([{ "text-gray-500": e.disabled || d }, "flex gap-2 items-center"])
161
+ class: g([{ "text-gray-500": e.disabled || o }, "flex gap-2 items-center"])
165
162
  }, [
166
163
  w(u(n) + " ", 1),
167
- o && !m ? (t(), l("span", oe, "*")) : s("", !0),
168
- !o && m ? (t(), l("span", de, "(optional)")) : s("", !0),
164
+ d && !m ? (t(), l("span", de, "*")) : s("", !0),
165
+ !d && m ? (t(), l("span", oe, "(optional)")) : s("", !0),
169
166
  p ? (t(), O(C, {
170
167
  key: 2,
171
168
  icon: "plus",
172
169
  tabindex: "-1",
173
170
  "data-testid": `${e.path}-add-button`,
174
- onClick: b
171
+ onClick: h
175
172
  }, null, 8, ["data-testid", "onClick"])) : s("", !0)
176
173
  ], 10, ne),
177
- v(c.$slots, "default", { hideLabel: !0 }),
174
+ y(c.$slots, "default", { hideLabel: !0 }),
178
175
  r("pre", ae, u(e.description), 1),
179
176
  i.value ? (t(), l("span", {
180
177
  key: 0,
@@ -183,63 +180,63 @@ const Q = {
183
180
  }, u(i.value), 9, re)) : s("", !0)
184
181
  ], 2))
185
182
  ]),
186
- default: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canRemoveItems: p, removeItem: b, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
183
+ default: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, required: d, canRemoveItems: p, removeItem: h, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
187
184
  e.hidden ? s("", !0) : (t(), l("div", {
188
185
  key: 0,
189
- class: y(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
186
+ class: g(["flex flex-col gap-2", { "md:col-span-2": e.fullWidth }])
190
187
  }, [
191
188
  m?.hideLabel ? s("", !0) : (t(), l("label", {
192
189
  key: 0,
193
190
  for: e.path,
194
- class: y([{ "text-gray-500": e.disabled || d }, "flex gap-1 items-center"])
191
+ class: g([{ "text-gray-500": e.disabled || o }, "flex gap-1 items-center"])
195
192
  }, [
196
193
  w(u(n) + " ", 1),
197
- o && !a ? (t(), l("span", ce, "*")) : s("", !0),
198
- !o && a ? (t(), l("span", pe, "(optional)")) : s("", !0)
194
+ d && !a ? (t(), l("span", ce, "*")) : s("", !0),
195
+ !d && a ? (t(), l("span", pe, "(optional)")) : s("", !0)
199
196
  ], 10, ue)),
200
197
  r("div", he, [
201
198
  r("div", me, [
202
- v(c.$slots, "default")
199
+ y(c.$slots, "default")
203
200
  ]),
204
- q(C, {
205
- class: y({ invisible: !p }),
201
+ L(C, {
202
+ class: g({ invisible: !p }),
206
203
  icon: "minus",
207
204
  tabindex: "-1",
208
205
  color: "red",
209
206
  "data-testid": `${e.path}-remove-button`,
210
- onClick: b
207
+ onClick: h
211
208
  }, null, 8, ["class", "data-testid", "onClick"])
212
209
  ]),
213
- r("pre", fe, u(e.description), 1),
210
+ r("pre", be, u(e.description), 1),
214
211
  i.value ? (t(), l("span", {
215
212
  key: 1,
216
213
  class: "text-red-600 text-sm",
217
214
  "data-testid": `${e.path}-error-message`
218
- }, u(i.value), 9, be)) : s("", !0)
215
+ }, u(i.value), 9, fe)) : s("", !0)
219
216
  ], 2)),
220
- v(c.$slots, "attributes")
217
+ y(c.$slots, "attributes")
221
218
  ]),
222
- "group-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, addItem: b, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
219
+ "group-array": x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, required: d, canAddItems: p, addItem: h, slotProps: m, settings: { showOptionalInsteadOfRequired: a } }) => [
223
220
  e.hidden ? (t(), l(F, { key: 0 }, [], 64)) : m?.belowChoiceField ? (t(), l("div", {
224
221
  key: 1,
225
- class: y({ "md:col-span-2": e.fullWidth })
222
+ class: g({ "md:col-span-2": e.fullWidth })
226
223
  }, [
227
224
  r("span", {
228
- class: y(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
225
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || o }])
229
226
  }, [
230
227
  w(u(n) + " ", 1),
231
- o && !a ? (t(), l("span", ge, "*")) : s("", !0),
232
- !o && a ? (t(), l("span", ye, "(optional)")) : s("", !0),
228
+ d && !a ? (t(), l("span", ge, "*")) : s("", !0),
229
+ !d && a ? (t(), l("span", xe, "(optional)")) : s("", !0),
233
230
  p ? (t(), O(C, {
234
231
  key: 2,
235
232
  icon: "plus",
236
233
  tabindex: "-1",
237
234
  "data-testid": `${e.path}-add-button`,
238
- onClick: b
235
+ onClick: h
239
236
  }, null, 8, ["data-testid", "onClick"])) : s("", !0)
240
237
  ], 2),
241
- r("div", xe, [
242
- v(c.$slots, "default", {
238
+ r("div", ye, [
239
+ y(c.$slots, "default", {
243
240
  level: (m?.level ?? 0) + 1
244
241
  })
245
242
  ]),
@@ -249,20 +246,20 @@ const Q = {
249
246
  class: "text-red-600 text-sm",
250
247
  "data-testid": `${e.path}-error-message`
251
248
  }, u(i.value), 9, ke)) : s("", !0)
252
- ], 2)) : v(c.$slots, "default", { key: 2 })
249
+ ], 2)) : y(c.$slots, "default", { key: 2 })
253
250
  ]),
254
- group: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: d, required: o, canAddItems: p, canRemoveItems: b, addItem: m, removeItem: a, slotProps: g, settings: { showOptionalInsteadOfRequired: _ } }) => [
251
+ group: x(({ fieldMetadata: e, fieldContext: { errorMessage: i, label: n }, disabled: o, required: d, canAddItems: p, canRemoveItems: h, addItem: m, removeItem: a, slotProps: f, settings: { showOptionalInsteadOfRequired: _ } }) => [
255
252
  e.hidden ? s("", !0) : (t(), l("div", {
256
253
  key: 0,
257
- class: y({ "md:col-span-2": e.fullWidth })
254
+ class: g({ "md:col-span-2": e.fullWidth })
258
255
  }, [
259
- g?.hideLabel ? s("", !0) : (t(), l("span", {
256
+ f?.hideLabel ? s("", !0) : (t(), l("span", {
260
257
  key: 0,
261
- class: y(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || d }])
258
+ class: g(["flex gap-2 items-center mb-2", { "text-gray-500": e.disabled || o }])
262
259
  }, [
263
260
  w(u(n) + " ", 1),
264
- o && !_ ? (t(), l("span", _e, "*")) : s("", !0),
265
- !o && _ ? (t(), l("span", Oe, "(optional)")) : s("", !0),
261
+ d && !_ ? (t(), l("span", _e, "*")) : s("", !0),
262
+ !d && _ ? (t(), l("span", Oe, "(optional)")) : s("", !0),
266
263
  p ? (t(), O(C, {
267
264
  key: 2,
268
265
  icon: "plus",
@@ -270,7 +267,7 @@ const Q = {
270
267
  "data-testid": `${e.path}-add-button`,
271
268
  onClick: m
272
269
  }, null, 8, ["data-testid", "onClick"])) : s("", !0),
273
- b ? (t(), O(C, {
270
+ h ? (t(), O(C, {
274
271
  key: 3,
275
272
  icon: "minus",
276
273
  tabindex: "-1",
@@ -280,8 +277,8 @@ const Q = {
280
277
  }, null, 8, ["data-testid", "onClick"])) : s("", !0)
281
278
  ], 2)),
282
279
  r("div", Ce, [
283
- v(c.$slots, "default", {
284
- level: (g?.level ?? 0) + 1
280
+ y(c.$slots, "default", {
281
+ level: (f?.level ?? 0) + 1
285
282
  })
286
283
  ]),
287
284
  r("pre", we, u(e.description), 1),
@@ -291,82 +288,82 @@ const Q = {
291
288
  "data-testid": `${e.path}-error-message`
292
289
  }, u(i.value), 9, $e)) : s("", !0)
293
290
  ], 2)),
294
- v(c.$slots, "attributes")
291
+ y(c.$slots, "attributes")
295
292
  ]),
296
- "select-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
293
+ "select-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: o }, disabled: d }) => [
297
294
  r("select", {
298
295
  id: e.path,
299
296
  value: i.value,
300
- disabled: e.disabled || o,
297
+ disabled: e.disabled || d,
301
298
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
302
- onChange: d,
299
+ onChange: o,
303
300
  onBlur: n
304
301
  }, [
305
- (t(!0), l(F, null, T(e.options, ({ key: p, value: b }) => (t(), l("option", {
302
+ (t(!0), l(F, null, T(e.options, ({ key: p, value: h }) => (t(), l("option", {
306
303
  key: p,
307
304
  value: p
308
- }, u(b), 9, Fe))), 128))
305
+ }, u(h), 9, Fe))), 128))
309
306
  ], 40, Ne)
310
307
  ]),
311
- "selectBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
308
+ "selectBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: o }) => [
312
309
  W(r("select", {
313
310
  id: e.path,
314
- "onUpdate:modelValue": (o) => i.value = o,
315
- disabled: e.disabled || d,
311
+ "onUpdate:modelValue": (d) => i.value = d,
312
+ disabled: e.disabled || o,
316
313
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
317
314
  onBlur: n
318
315
  }, [
319
- (t(!0), l(F, null, T(e.options, ({ key: o, value: p }) => (t(), l("option", {
320
- key: o,
321
- value: o
316
+ (t(!0), l(F, null, T(e.options, ({ key: d, value: p }) => (t(), l("option", {
317
+ key: d,
318
+ value: d
322
319
  }, u(p), 9, We))), 128))
323
320
  ], 40, Be), [
324
- [A, i.value]
321
+ [R, i.value]
325
322
  ])
326
323
  ]),
327
- "checkbox-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
324
+ "checkbox-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: o }, disabled: d }) => [
328
325
  r("input", {
329
326
  id: e.path,
330
327
  checked: i.value,
331
- disabled: e.disabled || o,
328
+ disabled: e.disabled || d,
332
329
  type: "checkbox",
333
330
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
334
- onChange: (p) => d(p.target.checked),
331
+ onChange: (p) => o(p.target.checked),
335
332
  onBlur: n
336
333
  }, null, 40, Ve)
337
334
  ]),
338
- "checkboxBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
335
+ "checkboxBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: o }) => [
339
336
  W(r("input", {
340
337
  id: e.path,
341
- "onUpdate:modelValue": (o) => i.value = o,
342
- disabled: e.disabled || d,
338
+ "onUpdate:modelValue": (d) => i.value = d,
339
+ disabled: e.disabled || o,
343
340
  type: "checkbox",
344
341
  class: "h-6 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
345
342
  onBlur: n
346
343
  }, null, 40, Te), [
347
- [R, i.value]
344
+ [I, i.value]
348
345
  ])
349
346
  ]),
350
- "textBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: d }) => [
347
+ "textBoundByVModel-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n }, disabled: o }) => [
351
348
  W(r("input", {
352
349
  id: e.path,
353
- "onUpdate:modelValue": (o) => i.value = o,
354
- disabled: e.disabled || d,
350
+ "onUpdate:modelValue": (d) => i.value = d,
351
+ disabled: e.disabled || o,
355
352
  type: "text",
356
353
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
357
354
  onBlur: n
358
355
  }, null, 40, Se), [
359
- [I, i.value]
356
+ [D, i.value]
360
357
  ])
361
358
  ]),
362
- "default-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: d }, disabled: o }) => [
359
+ "default-input": x(({ fieldMetadata: e, fieldContext: { value: i, handleBlur: n, handleChange: o }, disabled: d }) => [
363
360
  r("input", {
364
361
  id: e.path,
365
362
  value: i.value,
366
- disabled: e.disabled || o,
363
+ disabled: e.disabled || d,
367
364
  type: "text",
368
365
  class: "h-9 bg-gray-100 border-gray-200 border rounded px-3 text-sm",
369
- onInput: d,
366
+ onInput: o,
370
367
  onBlur: n
371
368
  }, null, 40, Ee)
372
369
  ]),
@@ -398,16 +395,16 @@ const Q = {
398
395
  hideFieldsWithoutValue: { type: Boolean, default: !1 },
399
396
  initialValues: {}
400
397
  },
401
- setup(h) {
402
- const { values: f, handleSubmit: c, errors: N, meta: e } = H({
403
- initialValues: h.initialValues
404
- }), i = V(), n = V(h.initialEdit), d = V(!1), o = L(() => h.metadata?.map((m) => S(m, (a) => (a.computedProps = a.computedProps ?? [], a.computedProps.push((g) => {
405
- n.value || (g.disabled = !0);
406
- }), h.hideFieldsWithoutValue && (a.computedProps.push((g, _) => {
407
- !n.value && !Y(_.value) && (g.hidden = !0);
408
- }), a.computedProps.push((g, _, E) => {
409
- !n.value && E.value.length > 0 && E.value.every((D) => D.hidden) && (g.hidden = !0);
410
- })), a)))), p = L(() => ({
398
+ setup(b) {
399
+ const { values: k, handleSubmit: c, errors: N, meta: e } = G({
400
+ initialValues: b.initialValues
401
+ }), i = V(), n = V(b.initialEdit), o = V(!1), d = E(() => b.metadata?.map((m) => H(m, (a) => (a.computedProps = a.computedProps ?? [], a.computedProps.push((f) => {
402
+ n.value || (f.disabled = !0);
403
+ }), b.hideFieldsWithoutValue && (a.computedProps.push((f, _) => {
404
+ !n.value && !Y(_.value) && (f.hidden = !0);
405
+ }), a.computedProps.push((f, _, S) => {
406
+ !n.value && S.value.length > 0 && S.value.every((q) => q.hidden) && (f.hidden = !0);
407
+ })), a)))), p = E(() => ({
411
408
  analytics: !0,
412
409
  messages: {
413
410
  required: "{field} is required",
@@ -426,20 +423,20 @@ const Q = {
426
423
  fractionDigits: "{field} may have at most {digits} decimal place(s)",
427
424
  totalDigits: "{field} may have at most {digits} significant digit(s)"
428
425
  },
429
- ...h.settings ?? {}
426
+ ...b.settings ?? {}
430
427
  }));
431
- function b(m) {
428
+ function h(m) {
432
429
  c(
433
430
  (a) => {
434
- d.value = !0, n.value = !1;
431
+ o.value = !0, n.value = !1;
435
432
  },
436
433
  ({ errors: a }) => {
437
- d.value = !1;
434
+ o.value = !1;
438
435
  }
439
436
  )(m);
440
437
  }
441
438
  return (m, a) => (t(), l("form", {
442
- onSubmit: U(b, ["prevent"])
439
+ onSubmit: A(h, ["prevent"])
443
440
  }, [
444
441
  r("div", qe, [
445
442
  n.value ? s("", !0) : (t(), l("button", {
@@ -447,7 +444,7 @@ const Q = {
447
444
  type: "button",
448
445
  class: "cursor-pointer mt-4 bg-blue-500 text-white px-4 py-2 rounded",
449
446
  "data-testid": "submit",
450
- onClick: a[0] || (a[0] = (g) => n.value = !0)
447
+ onClick: a[0] || (a[0] = (f) => n.value = !0)
451
448
  }, " Edit ")),
452
449
  n.value ? (t(), l("button", De, " Submit ")) : s("", !0),
453
450
  n.value ? (t(), l("button", {
@@ -455,32 +452,32 @@ const Q = {
455
452
  type: "button",
456
453
  class: "cursor-pointer mt-4 bg-gray-200 text-black px-4 py-2 rounded",
457
454
  "data-testid": "cancel",
458
- onClick: a[1] || (a[1] = (g) => n.value = !1)
455
+ onClick: a[1] || (a[1] = (f) => n.value = !1)
459
456
  }, " Cancel ")) : s("", !0)
460
457
  ]),
461
- Object.values(k(N)).length ? (t(), l("div", Ie, [
458
+ Object.values(v(N)).length ? (t(), l("div", Ie, [
462
459
  a[3] || (a[3] = w(" Errors: ", -1)),
463
460
  r("ul", null, [
464
- (t(!0), l(F, null, T(k(N), (g, _) => (t(), l("li", { key: _ }, [
465
- r("span", { innerHTML: g }, null, 8, Re)
461
+ (t(!0), l(F, null, T(v(N), (f, _) => (t(), l("li", { key: _ }, [
462
+ r("span", { innerHTML: f }, null, 8, Re)
466
463
  ]))), 128))
467
464
  ])
468
465
  ])) : s("", !0),
469
- q(J, {
466
+ L(J, {
470
467
  template: Le,
471
- metadata: o.value,
468
+ metadata: d.value,
472
469
  settings: p.value,
473
- "onUpdate:modelValue": a[2] || (a[2] = (g) => i.value = g)
470
+ "onUpdate:modelValue": a[2] || (a[2] = (f) => i.value = f)
474
471
  }, null, 8, ["metadata", "settings"]),
475
- d.value ? (t(), l("span", Ae)) : s("", !0),
476
- m.showDebugState ? (t(), l("pre", Ue, "IsDirty: " + u(k(e).dirty) + `
477
- Pending: ` + u(k(e).pending) + `
478
- Touched: ` + u(k(e).touched) + `
479
- Valid: ` + u(k(e).valid) + `
480
- Submitted: ` + u(d.value) + `
472
+ o.value ? (t(), l("span", Ae)) : s("", !0),
473
+ b.showDebugState ? (t(), l("pre", Ue, "IsDirty: " + u(v(e).dirty) + `
474
+ Pending: ` + u(v(e).pending) + `
475
+ Touched: ` + u(v(e).touched) + `
476
+ Valid: ` + u(v(e).valid) + `
477
+ Submitted: ` + u(o.value) + `
481
478
 
482
479
  // form values:
483
- ` + u(JSON.stringify(k(f), null, 2)) + `
480
+ ` + u(JSON.stringify(v(k), null, 2)) + `
484
481
  `, 1)) : s("", !0)
485
482
  ], 32));
486
483
  }
@@ -620,9 +617,9 @@ You can test it by filling in one of the fields.`, children: [
620
617
  // validateOnBlur: true,
621
618
  }
622
619
  );
623
- function $(h, f, c = {}) {
624
- return j(B({
625
- render: () => P(je, { ...c, metadata: h, settings: f, showDebugState: !0 })
620
+ function $(b, k, c = {}) {
621
+ return U(B({
622
+ render: () => j(je, { ...c, metadata: b, settings: k, showDebugState: !0 })
626
623
  }));
627
624
  }
628
625
  export {