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