@solspace/freeform-vue 1.0.0 → 1.1.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/README.md +57 -1
- package/dist/index.js +643 -373
- package/dist/index.js.map +1 -1
- package/dist/renderers/builtin/CharacterCount.test.d.ts +1 -0
- package/dist/renderers/builtin/EmailField.d.ts +23 -2
- package/dist/renderers/builtin/PasswordField.d.ts +23 -2
- package/dist/renderers/builtin/PhoneField.d.ts +23 -2
- package/dist/renderers/builtin/RangeField.d.ts +2 -0
- package/dist/renderers/builtin/RangeField.test.d.ts +1 -0
- package/dist/renderers/builtin/SearchableSelect.d.ts +13 -0
- package/dist/renderers/builtin/SearchableSelect.test.d.ts +1 -0
- package/dist/renderers/builtin/SummaryField.d.ts +2 -0
- package/dist/renderers/builtin/TextareaAutoGrow.test.d.ts +1 -0
- package/dist/renderers/builtin/TextareaField.d.ts +23 -2
- package/dist/renderers/builtin/fields.d.ts +2 -0
- package/dist/renderers/builtin/inputProps.d.ts +3 -0
- package/dist/types.d.ts +3 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l,
|
|
2
|
-
import { canAddTableRow as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, guardReactiveProps as l, isVNode as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeProps as m, normalizeStyle as h, onBeforeUnmount as g, onMounted as _, onScopeDispose as v, onUnmounted as y, onUpdated as b, openBlock as x, reactive as ee, ref as S, renderList as C, renderSlot as w, resolveComponent as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, toValue as te, unref as k, useId as A, watch as j, watchEffect as ne, withCtx as M } from "vue";
|
|
2
|
+
import { SearchableSelect as N, canAddTableRow as P, canRemoveTableRow as F, collectExtensionSubmitMeta as re, createFormState as I, createFreeformClient as ie, emptyTableRow as L, evaluateCalculation as R, getCalculationConfig as z, getCharacterCount as B, getSignatureConfig as ae, getSummaryEntries as oe, getTableConfig as V, isSignatureValueEmpty as se, mountEmailSuggestions as ce, mountInternationalPhone as le, mountTextareaAutoGrow as ue, normalizeTableRows as de, prepareSubmitValues as fe, resolveTableColumnOptions as pe, runExtensionAfterSubmit as me, runExtensionSetups as he } from "@solspace/freeform-core";
|
|
3
3
|
//#region src/components/FormLoader.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var ge = ["data-variant"], _e = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "ff-loader-skeleton",
|
|
7
7
|
"aria-hidden": "true"
|
|
8
|
-
},
|
|
8
|
+
}, ve = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "ff-loader-spinner",
|
|
11
11
|
"aria-hidden": "true"
|
|
12
|
-
},
|
|
12
|
+
}, ye = { class: "ff-loader-message" }, be = /*#__PURE__*/ ((e, t) => {
|
|
13
13
|
let n = e.__vccOpts || e;
|
|
14
14
|
for (let [e, r] of t) n[e] = r;
|
|
15
15
|
return n;
|
|
@@ -21,23 +21,23 @@ var z = ["data-variant"], B = {
|
|
|
21
21
|
variant: { default: "skeleton" }
|
|
22
22
|
},
|
|
23
23
|
setup(t) {
|
|
24
|
-
return (n, r) => (
|
|
24
|
+
return (n, r) => (x(), i("div", {
|
|
25
25
|
role: "status",
|
|
26
26
|
"aria-live": "polite",
|
|
27
27
|
"aria-busy": "true",
|
|
28
28
|
"data-variant": t.variant,
|
|
29
|
-
class:
|
|
30
|
-
}, [t.variant === "skeleton" ? (
|
|
29
|
+
class: p(["ff-loader-root", t.loaderClass])
|
|
30
|
+
}, [t.variant === "skeleton" ? (x(), i("div", _e, [
|
|
31
31
|
r[0] ||= a("div", { class: "ff-loader-line ff-loader-line--title" }, null, -1),
|
|
32
|
-
(
|
|
32
|
+
(x(), i(e, null, C(3, (e) => a("div", {
|
|
33
33
|
key: e,
|
|
34
34
|
class: "ff-loader-field"
|
|
35
35
|
}, [a("div", {
|
|
36
36
|
class: "ff-loader-line ff-loader-line--label",
|
|
37
|
-
style:
|
|
37
|
+
style: h({ animationDelay: `${e * .12}s` })
|
|
38
38
|
}, null, 4), a("div", {
|
|
39
39
|
class: "ff-loader-line ff-loader-line--input",
|
|
40
|
-
style:
|
|
40
|
+
style: h({
|
|
41
41
|
width: e === 2 ? "62%" : "100%",
|
|
42
42
|
animationDelay: `${e * .12}s`
|
|
43
43
|
})
|
|
@@ -46,7 +46,7 @@ var z = ["data-variant"], B = {
|
|
|
46
46
|
class: "ff-loader-line ff-loader-line--button",
|
|
47
47
|
style: { animationDelay: "0.36s" }
|
|
48
48
|
}, null, -1)
|
|
49
|
-
])) : (
|
|
49
|
+
])) : (x(), i("div", ve)), a("p", ye, O(t.message), 1)], 10, ge));
|
|
50
50
|
}
|
|
51
51
|
}), [["__scopeId", "data-v-5a3e01c4"]]), H = {
|
|
52
52
|
name: "default",
|
|
@@ -62,6 +62,9 @@ var z = ["data-variant"], B = {
|
|
|
62
62
|
fieldHasErrors: "ff-field--has-errors",
|
|
63
63
|
label: "ff-field__label",
|
|
64
64
|
instructions: "ff-field__instructions",
|
|
65
|
+
characterCount: "ff-field__character-count",
|
|
66
|
+
characterCountError: "ff-field__character-count--error",
|
|
67
|
+
passwordToggle: "ff-field__password-toggle",
|
|
65
68
|
input: "ff-field__input",
|
|
66
69
|
content: "ff-field__content",
|
|
67
70
|
errors: "ff-field__errors",
|
|
@@ -82,7 +85,7 @@ var z = ["data-variant"], B = {
|
|
|
82
85
|
colorScheme: "system"
|
|
83
86
|
}
|
|
84
87
|
};
|
|
85
|
-
function
|
|
88
|
+
function xe(e, t) {
|
|
86
89
|
if (!e && !t) return;
|
|
87
90
|
let n = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]), r = {};
|
|
88
91
|
for (let i of n) r[i] = {
|
|
@@ -91,7 +94,7 @@ function ue(e, t) {
|
|
|
91
94
|
};
|
|
92
95
|
return r;
|
|
93
96
|
}
|
|
94
|
-
function
|
|
97
|
+
function Se(e = {}) {
|
|
95
98
|
let t = e.classNameStrategy ?? H.classNameStrategy, n = t !== "replace";
|
|
96
99
|
return {
|
|
97
100
|
...H,
|
|
@@ -101,7 +104,7 @@ function de(e = {}) {
|
|
|
101
104
|
...H.classNames,
|
|
102
105
|
...e.classNames
|
|
103
106
|
} : { ...e.classNames },
|
|
104
|
-
classNamesByType:
|
|
107
|
+
classNamesByType: xe(n ? H.classNamesByType : void 0, e.classNamesByType),
|
|
105
108
|
defaults: {
|
|
106
109
|
...H.defaults,
|
|
107
110
|
...e.defaults
|
|
@@ -126,10 +129,10 @@ function de(e = {}) {
|
|
|
126
129
|
}
|
|
127
130
|
//#endregion
|
|
128
131
|
//#region src/version.ts
|
|
129
|
-
var
|
|
132
|
+
var Ce = "1.1.0", we = "@solspace/freeform-vue";
|
|
130
133
|
//#endregion
|
|
131
134
|
//#region src/utils/securityMeta.ts
|
|
132
|
-
function
|
|
135
|
+
function Te(e) {
|
|
133
136
|
let t = {};
|
|
134
137
|
return e.security.honeypot?.name && (t.honeypot = {
|
|
135
138
|
name: e.security.honeypot.name,
|
|
@@ -141,7 +144,7 @@ function me(e) {
|
|
|
141
144
|
}
|
|
142
145
|
//#endregion
|
|
143
146
|
//#region src/composables/useFreeform.ts
|
|
144
|
-
function
|
|
147
|
+
function Ee(e, t) {
|
|
145
148
|
return {
|
|
146
149
|
values: { ...e.values },
|
|
147
150
|
touched: { ...e.touched },
|
|
@@ -152,8 +155,8 @@ function he(e, t) {
|
|
|
152
155
|
visibilityVersion: t
|
|
153
156
|
};
|
|
154
157
|
}
|
|
155
|
-
function
|
|
156
|
-
let n = t(() =>
|
|
158
|
+
function De(e) {
|
|
159
|
+
let n = t(() => te(e)), r = t(() => n.value.theme ?? H), i = t(() => n.value.renderers ?? {}), a = t(() => n.value.allowRawHtml ?? !1), o = D(null), s = D(null), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D([]), d = S(0), f = S(null), p = S(n.value.manifest ?? null), m = S(!n.value.manifest), h = S(null), g = S(!1), _ = S(!1), y = S(null), b = S({
|
|
157
160
|
values: {},
|
|
158
161
|
touched: {},
|
|
159
162
|
fieldErrors: {},
|
|
@@ -162,29 +165,29 @@ function ge(e) {
|
|
|
162
165
|
currentPageIndex: 0,
|
|
163
166
|
visibilityVersion: 0
|
|
164
167
|
});
|
|
165
|
-
|
|
168
|
+
j(() => n.value.extensions, (e) => {
|
|
166
169
|
u.value = e ?? [];
|
|
167
170
|
}, { immediate: !0 });
|
|
168
|
-
function
|
|
171
|
+
function x() {
|
|
169
172
|
let e = s.value;
|
|
170
|
-
e && (d.value += 1,
|
|
173
|
+
e && (d.value += 1, b.value = Ee(e, d.value));
|
|
171
174
|
}
|
|
172
|
-
function
|
|
173
|
-
o.value ||=
|
|
175
|
+
function C() {
|
|
176
|
+
o.value ||= ie({
|
|
174
177
|
baseUrl: n.value.baseUrl,
|
|
175
|
-
clientVersion: n.value.clientVersion ?? "1.
|
|
178
|
+
clientVersion: n.value.clientVersion ?? "1.1.0",
|
|
176
179
|
fetch: n.value.fetch,
|
|
177
180
|
credentials: n.value.credentials
|
|
178
181
|
});
|
|
179
182
|
for (let e of u.value) o.value.extensions.register(e);
|
|
180
183
|
return o.value;
|
|
181
184
|
}
|
|
182
|
-
|
|
183
|
-
let e =
|
|
185
|
+
j(() => n.value.extensions, () => {
|
|
186
|
+
let e = C();
|
|
184
187
|
for (let t of u.value) e.extensions.register(t);
|
|
185
|
-
}),
|
|
186
|
-
e &&
|
|
187
|
-
}),
|
|
188
|
+
}), j(p, (e) => {
|
|
189
|
+
e && he(u.value, { manifest: e });
|
|
190
|
+
}), j(() => [
|
|
188
191
|
n.value.handle,
|
|
189
192
|
n.value.profile,
|
|
190
193
|
n.value.properties,
|
|
@@ -192,59 +195,59 @@ function ge(e) {
|
|
|
192
195
|
n.value.initialValues
|
|
193
196
|
], () => {
|
|
194
197
|
if (n.value.manifest) {
|
|
195
|
-
s.value =
|
|
198
|
+
s.value = I({
|
|
196
199
|
manifest: n.value.manifest,
|
|
197
200
|
initialValues: n.value.initialValues,
|
|
198
201
|
draftToken: n.value.draftToken,
|
|
199
202
|
draftKey: n.value.draftKey
|
|
200
|
-
}), p.value = n.value.manifest,
|
|
203
|
+
}), p.value = n.value.manifest, x(), m.value = !1;
|
|
201
204
|
return;
|
|
202
205
|
}
|
|
203
206
|
if (!n.value.handle && !n.value.profile) {
|
|
204
|
-
|
|
207
|
+
h.value = /* @__PURE__ */ Error("Either handle, profile, or manifest is required."), m.value = !1;
|
|
205
208
|
return;
|
|
206
209
|
}
|
|
207
210
|
let e = !1;
|
|
208
211
|
(async () => {
|
|
209
|
-
m.value = !0,
|
|
212
|
+
m.value = !0, h.value = null;
|
|
210
213
|
try {
|
|
211
|
-
let t = await
|
|
214
|
+
let t = await C().loadManifest({
|
|
212
215
|
handle: n.value.handle,
|
|
213
216
|
profile: n.value.profile,
|
|
214
217
|
properties: n.value.properties
|
|
215
218
|
});
|
|
216
219
|
if (e) return;
|
|
217
|
-
s.value =
|
|
220
|
+
s.value = I({
|
|
218
221
|
manifest: t,
|
|
219
222
|
initialValues: n.value.initialValues,
|
|
220
223
|
draftToken: n.value.draftToken,
|
|
221
224
|
draftKey: n.value.draftKey
|
|
222
|
-
}), p.value = t,
|
|
225
|
+
}), p.value = t, x(), n.value.onManifestLoaded?.(t);
|
|
223
226
|
} catch (t) {
|
|
224
|
-
e || (
|
|
227
|
+
e || (h.value = t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load manifest."));
|
|
225
228
|
} finally {
|
|
226
229
|
e || (m.value = !1);
|
|
227
230
|
}
|
|
228
|
-
})(),
|
|
231
|
+
})(), v(() => {
|
|
229
232
|
e = !0;
|
|
230
233
|
});
|
|
231
|
-
}, { immediate: !0 }),
|
|
234
|
+
}, { immediate: !0 }), j(() => [n.value.draftToken, n.value.draftKey], () => {
|
|
232
235
|
let e = s.value;
|
|
233
236
|
e && (n.value.draftToken !== void 0 && (e.draftToken = n.value.draftToken ?? null), n.value.draftKey !== void 0 && (e.draftKey = n.value.draftKey ?? null));
|
|
234
237
|
});
|
|
235
|
-
function
|
|
236
|
-
s.value?.setValue(e, t),
|
|
238
|
+
function w(e, t) {
|
|
239
|
+
s.value?.setValue(e, t), x();
|
|
237
240
|
}
|
|
238
|
-
function
|
|
241
|
+
function T(e) {
|
|
239
242
|
return s.value?.getValue(e);
|
|
240
243
|
}
|
|
241
|
-
function
|
|
244
|
+
function E(e) {
|
|
242
245
|
return s.value?.isFieldVisible(e) ?? !1;
|
|
243
246
|
}
|
|
244
|
-
function
|
|
247
|
+
function O(e) {
|
|
245
248
|
return s.value?.isFieldEnabled(e) ?? !0;
|
|
246
249
|
}
|
|
247
|
-
function
|
|
250
|
+
function k(e) {
|
|
248
251
|
let t = s.value, n = p.value?.fields[e], r = t?.getValue(e);
|
|
249
252
|
return {
|
|
250
253
|
id: `freeform-${e}`,
|
|
@@ -252,60 +255,61 @@ function ge(e) {
|
|
|
252
255
|
value: r ?? "",
|
|
253
256
|
onChange: (t) => {
|
|
254
257
|
let n = t.target;
|
|
255
|
-
|
|
258
|
+
w(e, n.value);
|
|
256
259
|
},
|
|
257
260
|
onBlur: () => {
|
|
258
261
|
let t = s.value;
|
|
259
262
|
t && (t.touched = {
|
|
260
263
|
...t.touched,
|
|
261
264
|
[e]: !0
|
|
262
|
-
},
|
|
265
|
+
}, x());
|
|
263
266
|
},
|
|
264
|
-
disabled: !
|
|
267
|
+
disabled: !O(e),
|
|
265
268
|
required: n?.required ?? !1,
|
|
266
269
|
placeholder: n?.placeholder ?? void 0,
|
|
270
|
+
autoComplete: n?.attributes?.input?.autocomplete ?? void 0,
|
|
267
271
|
"aria-invalid": (t?.fieldErrors[e]?.length ?? 0) > 0
|
|
268
272
|
};
|
|
269
273
|
}
|
|
270
|
-
async function
|
|
274
|
+
async function A(e = "submit") {
|
|
271
275
|
let t = s.value, r = p.value;
|
|
272
276
|
if (!(!t || !r)) {
|
|
273
|
-
|
|
277
|
+
g.value = !0;
|
|
274
278
|
try {
|
|
275
|
-
let i = t.getValuesForSubmit(), { values: a, files: o } =
|
|
279
|
+
let i = t.getValuesForSubmit(), { values: a, files: o } = fe(i, r.fields), s = {
|
|
276
280
|
...t.getSubmitContext(),
|
|
277
281
|
sourceUrl: typeof window < "u" ? window.location.href : void 0
|
|
278
|
-
}, c =
|
|
282
|
+
}, c = Te(r), l = await re(u.value, {
|
|
279
283
|
manifest: r,
|
|
280
284
|
intent: e,
|
|
281
285
|
values: a,
|
|
282
286
|
meta: c,
|
|
283
287
|
context: s,
|
|
284
288
|
baseUrl: n.value.baseUrl
|
|
285
|
-
}), d = await
|
|
289
|
+
}), d = await C().submit({
|
|
286
290
|
manifest: r,
|
|
287
291
|
request: {
|
|
288
292
|
values: a,
|
|
289
293
|
intent: e,
|
|
290
294
|
context: s,
|
|
291
295
|
meta: {
|
|
292
|
-
client:
|
|
293
|
-
clientVersion: n.value.clientVersion ?? "1.
|
|
296
|
+
client: we,
|
|
297
|
+
clientVersion: n.value.clientVersion ?? "1.1.0",
|
|
294
298
|
...l
|
|
295
299
|
}
|
|
296
300
|
},
|
|
297
301
|
files: Object.keys(o).length > 0 ? o : void 0
|
|
298
302
|
});
|
|
299
|
-
return t.applySubmitResponse(d),
|
|
303
|
+
return t.applySubmitResponse(d), x(), await me(u.value, {
|
|
300
304
|
manifest: r,
|
|
301
305
|
intent: e,
|
|
302
306
|
response: d,
|
|
303
307
|
baseUrl: n.value.baseUrl
|
|
304
|
-
}), d.complete && (
|
|
308
|
+
}), d.complete && (_.value = !0, y.value = d.message ?? r.settings.successMessage ?? "Thank you for your submission."), d.success ? n.value.onSuccess?.(d) : n.value.onError?.(d), d;
|
|
305
309
|
} catch (e) {
|
|
306
310
|
if (e instanceof Error && (e.name === "StripePaymentRedirectError" || e.name === "MolliePaymentRedirectError")) return;
|
|
307
311
|
let r = e instanceof Error ? e : /* @__PURE__ */ Error("Something went wrong while submitting the form.");
|
|
308
|
-
t && (t.formErrors = [r.message], t.fieldErrors = {}, t.pageErrors = [],
|
|
312
|
+
t && (t.formErrors = [r.message], t.fieldErrors = {}, t.pageErrors = [], x()), n.value.onError?.({
|
|
309
313
|
success: !1,
|
|
310
314
|
status: "error",
|
|
311
315
|
complete: !1,
|
|
@@ -317,12 +321,12 @@ function ge(e) {
|
|
|
317
321
|
});
|
|
318
322
|
return;
|
|
319
323
|
} finally {
|
|
320
|
-
|
|
324
|
+
g.value = !1;
|
|
321
325
|
}
|
|
322
326
|
}
|
|
323
327
|
}
|
|
324
|
-
let
|
|
325
|
-
|
|
328
|
+
let M = () => A("validate"), N = () => A("next"), P = () => A("back"), F = () => A("saveDraft");
|
|
329
|
+
j(() => [
|
|
326
330
|
p.value,
|
|
327
331
|
n.value.draftToken,
|
|
328
332
|
n.value.draftKey
|
|
@@ -331,26 +335,26 @@ function ge(e) {
|
|
|
331
335
|
let e = n.value.draftToken, t = n.value.draftKey;
|
|
332
336
|
if (!e || !t) return;
|
|
333
337
|
let r = `${e}:${t}`;
|
|
334
|
-
f.value !== r && (f.value = r,
|
|
338
|
+
f.value !== r && (f.value = r, A("validate"));
|
|
335
339
|
});
|
|
336
340
|
function L() {
|
|
337
|
-
p.value && (s.value =
|
|
341
|
+
p.value && (s.value = I({
|
|
338
342
|
manifest: p.value,
|
|
339
343
|
initialValues: n.value.initialValues,
|
|
340
344
|
draftToken: n.value.draftToken,
|
|
341
345
|
draftKey: n.value.draftKey
|
|
342
|
-
}),
|
|
346
|
+
}), _.value = !1, y.value = null, x());
|
|
343
347
|
}
|
|
344
348
|
async function R(e) {
|
|
345
349
|
e?.preventDefault();
|
|
346
350
|
let t = p.value;
|
|
347
351
|
if (!t) return;
|
|
348
|
-
let n = t.layout.pages, r = n.length === 0 ||
|
|
352
|
+
let n = t.layout.pages, r = n.length === 0 || b.value.currentPageIndex >= n.length - 1;
|
|
349
353
|
if (t.settings.multiPage && !r) {
|
|
350
|
-
await
|
|
354
|
+
await N();
|
|
351
355
|
return;
|
|
352
356
|
}
|
|
353
|
-
await
|
|
357
|
+
await A("submit");
|
|
354
358
|
}
|
|
355
359
|
function z(e, t) {
|
|
356
360
|
let r = p.value;
|
|
@@ -370,12 +374,12 @@ function ge(e) {
|
|
|
370
374
|
element: t,
|
|
371
375
|
value: s.value?.getValue(e),
|
|
372
376
|
setValue: (t) => {
|
|
373
|
-
s.value?.setValue(e, t),
|
|
377
|
+
s.value?.setValue(e, t), x();
|
|
374
378
|
},
|
|
375
379
|
getValues: () => s.value?.getValuesForSubmit() ?? {},
|
|
376
380
|
baseUrl: n.value.baseUrl,
|
|
377
381
|
requestSubmit: () => {
|
|
378
|
-
|
|
382
|
+
A("submit");
|
|
379
383
|
}
|
|
380
384
|
});
|
|
381
385
|
if (a) {
|
|
@@ -415,35 +419,35 @@ function ge(e) {
|
|
|
415
419
|
};
|
|
416
420
|
return l.value.set(e.name, a), a;
|
|
417
421
|
}
|
|
418
|
-
let
|
|
422
|
+
let ae = t(() => {
|
|
419
423
|
let e = p.value;
|
|
420
424
|
return e ? {
|
|
421
425
|
manifest: e,
|
|
422
|
-
values:
|
|
423
|
-
touched:
|
|
424
|
-
fieldErrors:
|
|
425
|
-
formErrors:
|
|
426
|
-
pageErrors:
|
|
427
|
-
currentPageIndex:
|
|
428
|
-
isSubmitting:
|
|
429
|
-
isComplete:
|
|
430
|
-
successMessage:
|
|
431
|
-
setValue:
|
|
432
|
-
getValue:
|
|
433
|
-
isFieldVisible:
|
|
434
|
-
isFieldEnabled:
|
|
435
|
-
getFieldProps:
|
|
436
|
-
submit:
|
|
437
|
-
validate:
|
|
438
|
-
goNext:
|
|
439
|
-
goBack:
|
|
440
|
-
saveDraft:
|
|
426
|
+
values: b.value.values,
|
|
427
|
+
touched: b.value.touched,
|
|
428
|
+
fieldErrors: b.value.fieldErrors,
|
|
429
|
+
formErrors: b.value.formErrors,
|
|
430
|
+
pageErrors: b.value.pageErrors,
|
|
431
|
+
currentPageIndex: b.value.currentPageIndex,
|
|
432
|
+
isSubmitting: g.value,
|
|
433
|
+
isComplete: _.value,
|
|
434
|
+
successMessage: y.value,
|
|
435
|
+
setValue: w,
|
|
436
|
+
getValue: T,
|
|
437
|
+
isFieldVisible: E,
|
|
438
|
+
isFieldEnabled: O,
|
|
439
|
+
getFieldProps: k,
|
|
440
|
+
submit: A,
|
|
441
|
+
validate: M,
|
|
442
|
+
goNext: N,
|
|
443
|
+
goBack: P,
|
|
444
|
+
saveDraft: F,
|
|
441
445
|
reset: L,
|
|
442
446
|
handleSubmit: R,
|
|
443
447
|
mountFieldExtension: z,
|
|
444
448
|
mountCaptcha: B
|
|
445
449
|
} : null;
|
|
446
|
-
}),
|
|
450
|
+
}), oe = {
|
|
447
451
|
values: {},
|
|
448
452
|
touched: {},
|
|
449
453
|
fieldErrors: {},
|
|
@@ -453,39 +457,39 @@ function ge(e) {
|
|
|
453
457
|
isSubmitting: !1,
|
|
454
458
|
isComplete: !1,
|
|
455
459
|
successMessage: null,
|
|
456
|
-
setValue:
|
|
457
|
-
getValue:
|
|
458
|
-
isFieldVisible:
|
|
459
|
-
isFieldEnabled:
|
|
460
|
-
getFieldProps:
|
|
461
|
-
submit:
|
|
462
|
-
validate:
|
|
463
|
-
goNext:
|
|
464
|
-
goBack:
|
|
465
|
-
saveDraft:
|
|
460
|
+
setValue: w,
|
|
461
|
+
getValue: T,
|
|
462
|
+
isFieldVisible: E,
|
|
463
|
+
isFieldEnabled: O,
|
|
464
|
+
getFieldProps: k,
|
|
465
|
+
submit: A,
|
|
466
|
+
validate: M,
|
|
467
|
+
goNext: N,
|
|
468
|
+
goBack: P,
|
|
469
|
+
saveDraft: F,
|
|
466
470
|
reset: L,
|
|
467
471
|
handleSubmit: R,
|
|
468
472
|
mountFieldExtension: z,
|
|
469
473
|
mountCaptcha: B
|
|
470
|
-
}, V =
|
|
471
|
-
return
|
|
472
|
-
let e =
|
|
474
|
+
}, V = ee({});
|
|
475
|
+
return ne(() => {
|
|
476
|
+
let e = ae.value;
|
|
473
477
|
if (!e) {
|
|
474
478
|
Object.assign(V, {
|
|
475
479
|
loading: m.value,
|
|
476
|
-
error:
|
|
480
|
+
error: h.value,
|
|
477
481
|
manifest: null,
|
|
478
482
|
theme: r.value,
|
|
479
483
|
renderers: i.value,
|
|
480
484
|
allowRawHtml: a.value,
|
|
481
|
-
...
|
|
485
|
+
...oe
|
|
482
486
|
});
|
|
483
487
|
return;
|
|
484
488
|
}
|
|
485
489
|
Object.assign(V, {
|
|
486
490
|
...e,
|
|
487
491
|
loading: m.value,
|
|
488
|
-
error:
|
|
492
|
+
error: h.value,
|
|
489
493
|
manifest: p.value,
|
|
490
494
|
theme: r.value,
|
|
491
495
|
renderers: i.value,
|
|
@@ -495,7 +499,7 @@ function ge(e) {
|
|
|
495
499
|
}
|
|
496
500
|
//#endregion
|
|
497
501
|
//#region src/renderers/builtin/CardsField.tsx
|
|
498
|
-
function
|
|
502
|
+
function Oe(e) {
|
|
499
503
|
let t = (e.field.frontend?.config?.cards ?? []) || [], n = Number(e.field.frontend?.config?.maxSelectedValues ?? 0), r = Array.isArray(e.value) ? e.value.map(String) : e.value ? [String(e.value)] : [], i = n === 1;
|
|
500
504
|
return s("div", {
|
|
501
505
|
class: e.classNames.input,
|
|
@@ -553,7 +557,7 @@ function _e(e) {
|
|
|
553
557
|
}
|
|
554
558
|
//#endregion
|
|
555
559
|
//#region src/renderers/builtin/CheckboxesField.tsx
|
|
556
|
-
function
|
|
560
|
+
function ke(e) {
|
|
557
561
|
let t = Array.isArray(e.value) ? e.value.map(String) : e.value ? [String(e.value)] : [];
|
|
558
562
|
return s("div", { class: e.classNames.input }, [(e.field.options ?? []).map((n) => s("label", {
|
|
559
563
|
key: n.value,
|
|
@@ -582,7 +586,7 @@ function U(e) {
|
|
|
582
586
|
}
|
|
583
587
|
//#endregion
|
|
584
588
|
//#region src/renderers/builtin/CheckboxField.tsx
|
|
585
|
-
function
|
|
589
|
+
function Ae(e) {
|
|
586
590
|
let t = U(e), n = t.value === "1" || e.value === !0 || t.value === "true";
|
|
587
591
|
return s("label", { class: e.classNames.optionLabel ?? e.classNames.input }, [s("input", {
|
|
588
592
|
type: "checkbox",
|
|
@@ -600,33 +604,33 @@ function ye(e) {
|
|
|
600
604
|
}
|
|
601
605
|
//#endregion
|
|
602
606
|
//#region src/renderers/builtin/ConfirmField.tsx
|
|
603
|
-
function
|
|
607
|
+
function je(e) {
|
|
604
608
|
let t = U(e), n = e.field.frontend?.config?.targetType === "password" ? "password" : "text";
|
|
605
|
-
return s("input",
|
|
609
|
+
return s("input", d({
|
|
606
610
|
type: n,
|
|
607
611
|
class: e.classNames.input
|
|
608
612
|
}, t), null);
|
|
609
613
|
}
|
|
610
614
|
//#endregion
|
|
611
615
|
//#region src/composables/useFieldExtension.ts
|
|
612
|
-
function
|
|
613
|
-
let n =
|
|
616
|
+
function Me(e, t) {
|
|
617
|
+
let n = S(null), r;
|
|
614
618
|
function i() {
|
|
615
619
|
r?.(), r = void 0;
|
|
616
620
|
let i = n.value;
|
|
617
621
|
!i || !e.frontend?.extension || t.isFieldVisible(e.handle) && (r = t.mountFieldExtension(e.handle, i));
|
|
618
622
|
}
|
|
619
|
-
return
|
|
623
|
+
return _(i), j(() => [
|
|
620
624
|
e.frontend?.extension,
|
|
621
625
|
e.handle,
|
|
622
626
|
t.isFieldVisible(e.handle)
|
|
623
|
-
], i),
|
|
627
|
+
], i), y(() => {
|
|
624
628
|
r?.();
|
|
625
629
|
}), n;
|
|
626
630
|
}
|
|
627
631
|
//#endregion
|
|
628
632
|
//#region src/components/ExtensionHost.vue?vue&type=script&setup=true&lang.ts
|
|
629
|
-
var
|
|
633
|
+
var Ne = ["hidden"], W = /* @__PURE__ */ c({
|
|
630
634
|
__name: "ExtensionHost",
|
|
631
635
|
props: {
|
|
632
636
|
field: {},
|
|
@@ -637,27 +641,27 @@ var Se = ["hidden"], W = /* @__PURE__ */ c({
|
|
|
637
641
|
hidden: { type: Boolean }
|
|
638
642
|
},
|
|
639
643
|
setup(e) {
|
|
640
|
-
let t = e, n =
|
|
644
|
+
let t = e, n = Me(t.field, t.form);
|
|
641
645
|
function r(e) {
|
|
642
646
|
n.value = e ?? null;
|
|
643
647
|
}
|
|
644
|
-
return (n, a) => (
|
|
648
|
+
return (n, a) => (x(), i("div", m({
|
|
645
649
|
ref: r,
|
|
646
650
|
class: t.class,
|
|
647
651
|
[e.dataAttr || ""]: e.dataValue ?? e.field.handle,
|
|
648
652
|
hidden: e.hidden || void 0
|
|
649
|
-
}), [
|
|
653
|
+
}), [w(n.$slots, "default")], 16, Ne));
|
|
650
654
|
}
|
|
651
655
|
});
|
|
652
656
|
//#endregion
|
|
653
657
|
//#region src/renderers/builtin/DatetimeField.tsx
|
|
654
|
-
function
|
|
658
|
+
function Pe(e) {
|
|
655
659
|
let t = U(e), n = e.field.frontend?.config ?? {}, r = n.useNativeTypes ? n.nativeInputType || "datetime-local" : "text";
|
|
656
660
|
return s(W, {
|
|
657
661
|
field: e.field,
|
|
658
662
|
form: e.form,
|
|
659
663
|
dataAttr: "data-freeform-datetime"
|
|
660
|
-
}, { default: () => [s("input",
|
|
664
|
+
}, { default: () => [s("input", d({
|
|
661
665
|
type: r,
|
|
662
666
|
class: e.classNames.input,
|
|
663
667
|
"data-datepicker": "",
|
|
@@ -666,16 +670,35 @@ function Ce(e) {
|
|
|
666
670
|
}
|
|
667
671
|
//#endregion
|
|
668
672
|
//#region src/renderers/builtin/EmailField.tsx
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
673
|
+
var Fe = /* @__PURE__ */ c({
|
|
674
|
+
name: "EmailFieldRenderer",
|
|
675
|
+
props: [
|
|
676
|
+
"field",
|
|
677
|
+
"form",
|
|
678
|
+
"value",
|
|
679
|
+
"errors",
|
|
680
|
+
"input",
|
|
681
|
+
"classNames",
|
|
682
|
+
"renderLabel",
|
|
683
|
+
"renderInstructions",
|
|
684
|
+
"renderErrors",
|
|
685
|
+
"allowRawHtml"
|
|
686
|
+
],
|
|
687
|
+
setup(e) {
|
|
688
|
+
let t = S(), n, r = () => {
|
|
689
|
+
n?.destroy(), n = void 0;
|
|
690
|
+
let r = e.field.frontend?.config;
|
|
691
|
+
r?.suggestEmailCorrections !== !0 || !t.value || (n = ce(t.value, r.emailSuggestionLabels, (t) => e.form.setValue(e.field.handle, t)));
|
|
692
|
+
};
|
|
693
|
+
return _(r), j(() => JSON.stringify(e.field.frontend?.config), r, { flush: "post" }), j(() => e.input.value, () => n?.clear()), g(() => n?.destroy()), () => s("input", d({
|
|
694
|
+
type: "email",
|
|
695
|
+
class: e.classNames.input
|
|
696
|
+
}, U(e), { ref: t }), null);
|
|
697
|
+
}
|
|
698
|
+
});
|
|
676
699
|
//#endregion
|
|
677
700
|
//#region src/renderers/builtin/FileDndField.tsx
|
|
678
|
-
function
|
|
701
|
+
function Ie(e) {
|
|
679
702
|
return s(W, {
|
|
680
703
|
field: e.field,
|
|
681
704
|
form: e.form,
|
|
@@ -709,9 +732,9 @@ function G(e) {
|
|
|
709
732
|
}
|
|
710
733
|
//#endregion
|
|
711
734
|
//#region src/renderers/builtin/HiddenField.tsx
|
|
712
|
-
function
|
|
735
|
+
function Le(e) {
|
|
713
736
|
let t = U(e);
|
|
714
|
-
return s("input",
|
|
737
|
+
return s("input", d({ type: "hidden" }, t), null);
|
|
715
738
|
}
|
|
716
739
|
//#endregion
|
|
717
740
|
//#region src/renderers/builtin/HtmlField.tsx
|
|
@@ -727,7 +750,7 @@ function K(e) {
|
|
|
727
750
|
}
|
|
728
751
|
//#endregion
|
|
729
752
|
//#region src/renderers/builtin/ImageField.tsx
|
|
730
|
-
function
|
|
753
|
+
function Re(e) {
|
|
731
754
|
let t = e.classNames.content ?? e.classNames.input ?? "ff-field__content", n = e.field.frontend?.config ?? {}, r = e.field.content?.image, i = r?.src || n.src, a = r?.srcset || n.srcset, o = r?.alt || n.alt || e.field.label || "";
|
|
732
755
|
return i ? s("img", {
|
|
733
756
|
class: t,
|
|
@@ -738,7 +761,7 @@ function De(e) {
|
|
|
738
761
|
}
|
|
739
762
|
//#endregion
|
|
740
763
|
//#region src/renderers/builtin/MolliePaymentField.tsx
|
|
741
|
-
function
|
|
764
|
+
function ze(e) {
|
|
742
765
|
return s(W, {
|
|
743
766
|
field: e.field,
|
|
744
767
|
form: e.form,
|
|
@@ -748,17 +771,36 @@ function Oe(e) {
|
|
|
748
771
|
}, null);
|
|
749
772
|
}
|
|
750
773
|
//#endregion
|
|
774
|
+
//#region src/renderers/builtin/SearchableSelect.tsx
|
|
775
|
+
var Be = /* @__PURE__ */ c({
|
|
776
|
+
name: "SearchableSelectWrapper",
|
|
777
|
+
props: { config: {
|
|
778
|
+
type: Object,
|
|
779
|
+
required: !0
|
|
780
|
+
} },
|
|
781
|
+
setup(e, { slots: t }) {
|
|
782
|
+
let n = S(), r;
|
|
783
|
+
return _(() => {
|
|
784
|
+
let t = n.value?.querySelector("select");
|
|
785
|
+
t && (r = new N(t, e.config));
|
|
786
|
+
}), b(() => r?.sync(e.config)), g(() => r?.destroy()), () => s("div", { ref: n }, [t.default?.()]);
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
//#endregion
|
|
751
790
|
//#region src/renderers/builtin/MultipleSelectField.tsx
|
|
752
|
-
function
|
|
753
|
-
|
|
754
|
-
|
|
791
|
+
function Ve(e) {
|
|
792
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
|
|
793
|
+
}
|
|
794
|
+
function He(e) {
|
|
795
|
+
let t = U(e), n = Array.isArray(e.value) ? e.value.map(String) : e.value ? [String(e.value)] : [], r = s("select", {
|
|
755
796
|
class: e.classNames.input,
|
|
756
797
|
id: t.id,
|
|
757
798
|
name: t.name,
|
|
758
799
|
multiple: !0,
|
|
800
|
+
required: t.required,
|
|
759
801
|
disabled: t.disabled,
|
|
760
802
|
"aria-invalid": t["aria-invalid"],
|
|
761
|
-
|
|
803
|
+
"aria-describedby": t["aria-describedby"],
|
|
762
804
|
onChange: (t) => {
|
|
763
805
|
let n = Array.from(t.target.selectedOptions).map((e) => e.value);
|
|
764
806
|
e.form.setValue(e.field.handle, n);
|
|
@@ -766,21 +808,26 @@ function ke(e) {
|
|
|
766
808
|
onBlur: t.onBlur
|
|
767
809
|
}, [(e.field.options ?? []).map((e) => s("option", {
|
|
768
810
|
key: e.value,
|
|
769
|
-
value: e.value
|
|
770
|
-
|
|
811
|
+
value: e.value,
|
|
812
|
+
selected: n.includes(e.value)
|
|
813
|
+
}, [e.label]))]), i = e.field.frontend?.config?.searchable;
|
|
814
|
+
return i?.enabled ? s(Be, { config: {
|
|
815
|
+
...i,
|
|
816
|
+
label: e.field.label
|
|
817
|
+
} }, Ve(r) ? r : { default: () => [r] }) : r;
|
|
771
818
|
}
|
|
772
819
|
//#endregion
|
|
773
820
|
//#region src/renderers/builtin/NumberField.tsx
|
|
774
|
-
function
|
|
821
|
+
function Ue(e) {
|
|
775
822
|
let t = U(e);
|
|
776
|
-
return s("input",
|
|
823
|
+
return s("input", d({
|
|
777
824
|
type: "number",
|
|
778
825
|
class: e.classNames.input
|
|
779
826
|
}, t), null);
|
|
780
827
|
}
|
|
781
828
|
//#endregion
|
|
782
829
|
//#region src/renderers/builtin/OpinionScaleField.tsx
|
|
783
|
-
function
|
|
830
|
+
function We(e) {
|
|
784
831
|
let t = String(e.value ?? ""), n = e.field.frontend?.config?.legends ?? [];
|
|
785
832
|
return s("div", { class: e.classNames.input }, [s("div", {
|
|
786
833
|
role: "radiogroup",
|
|
@@ -813,16 +860,62 @@ function je(e) {
|
|
|
813
860
|
}
|
|
814
861
|
//#endregion
|
|
815
862
|
//#region src/renderers/builtin/PasswordField.tsx
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
863
|
+
var Ge = /* @__PURE__ */ c({
|
|
864
|
+
name: "PasswordFieldRenderer",
|
|
865
|
+
props: [
|
|
866
|
+
"field",
|
|
867
|
+
"form",
|
|
868
|
+
"value",
|
|
869
|
+
"errors",
|
|
870
|
+
"input",
|
|
871
|
+
"classNames",
|
|
872
|
+
"renderLabel",
|
|
873
|
+
"renderInstructions",
|
|
874
|
+
"renderErrors",
|
|
875
|
+
"allowRawHtml"
|
|
876
|
+
],
|
|
877
|
+
setup(t) {
|
|
878
|
+
let n = S(!1), r = S(), i = A(), a, o = (e) => queueMicrotask(() => {
|
|
879
|
+
e.defaultPrevented || (n.value = !1);
|
|
880
|
+
});
|
|
881
|
+
return _(() => {
|
|
882
|
+
a = r.value?.form, a?.addEventListener("reset", o);
|
|
883
|
+
}), g(() => a?.removeEventListener("reset", o)), j(() => [t.input.value, t.field.frontend?.config?.showPasswordToggle], ([e, t]) => {
|
|
884
|
+
(!e || !t) && (n.value = !1);
|
|
885
|
+
}), () => {
|
|
886
|
+
let a = U(t), o = t.field.frontend?.config?.showPasswordToggle === !0, c = t.field.frontend?.config?.passwordToggleLabels, l = a.id ?? i;
|
|
887
|
+
return s(e, null, [s("input", d({ class: t.classNames.input }, a, {
|
|
888
|
+
id: l,
|
|
889
|
+
ref: r,
|
|
890
|
+
type: o && n.value ? "text" : "password"
|
|
891
|
+
}), null), o && s("button", {
|
|
892
|
+
type: "button",
|
|
893
|
+
class: t.classNames.passwordToggle,
|
|
894
|
+
"aria-controls": l,
|
|
895
|
+
disabled: a.disabled,
|
|
896
|
+
onClick: () => {
|
|
897
|
+
n.value = !n.value;
|
|
898
|
+
},
|
|
899
|
+
style: {
|
|
900
|
+
display: "block",
|
|
901
|
+
margin: ".25rem 0 0 auto",
|
|
902
|
+
padding: "0 .125rem",
|
|
903
|
+
minHeight: "24px",
|
|
904
|
+
border: 0,
|
|
905
|
+
background: "transparent",
|
|
906
|
+
color: "inherit",
|
|
907
|
+
font: "inherit",
|
|
908
|
+
fontSize: ".8125rem",
|
|
909
|
+
textDecoration: "underline",
|
|
910
|
+
cursor: "pointer"
|
|
911
|
+
}
|
|
912
|
+
}, [n.value ? c?.hide ?? "Hide password" : c?.show ?? "Show password"])]);
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
});
|
|
823
916
|
//#endregion
|
|
824
917
|
//#region src/renderers/builtin/PayPalPaymentField.tsx
|
|
825
|
-
function
|
|
918
|
+
function Ke(e) {
|
|
826
919
|
return s(W, {
|
|
827
920
|
field: e.field,
|
|
828
921
|
form: e.form,
|
|
@@ -832,13 +925,42 @@ function Ne(e) {
|
|
|
832
925
|
}
|
|
833
926
|
//#endregion
|
|
834
927
|
//#region src/renderers/builtin/PhoneField.tsx
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
928
|
+
var qe = /* @__PURE__ */ c({
|
|
929
|
+
name: "PhoneFieldRenderer",
|
|
930
|
+
props: [
|
|
931
|
+
"field",
|
|
932
|
+
"form",
|
|
933
|
+
"value",
|
|
934
|
+
"errors",
|
|
935
|
+
"input",
|
|
936
|
+
"classNames",
|
|
937
|
+
"renderLabel",
|
|
938
|
+
"renderInstructions",
|
|
939
|
+
"renderErrors",
|
|
940
|
+
"allowRawHtml"
|
|
941
|
+
],
|
|
942
|
+
setup(e) {
|
|
943
|
+
let t = S(), n, r = () => {
|
|
944
|
+
n?.destroy(), n = void 0;
|
|
945
|
+
let r = e.field.frontend?.config;
|
|
946
|
+
!r?.international || !t.value || (t.value.value = String(e.input.value ?? ""), n = le(t.value, r, (t) => e.form.setValue(e.field.handle, t)));
|
|
947
|
+
};
|
|
948
|
+
return _(r), j(() => JSON.stringify(e.field.frontend?.config), async () => {
|
|
949
|
+
await f(), r();
|
|
950
|
+
}), j(() => e.input.value, (e) => n?.update(String(e ?? ""))), g(() => n?.destroy()), () => {
|
|
951
|
+
let n = U(e);
|
|
952
|
+
if (e.field.frontend?.config?.international !== !0) return s("input", d({
|
|
953
|
+
type: "tel",
|
|
954
|
+
class: e.classNames.input
|
|
955
|
+
}, n), null);
|
|
956
|
+
let { value: r, onChange: i, ...a } = n;
|
|
957
|
+
return s("input", d({
|
|
958
|
+
type: "tel",
|
|
959
|
+
class: e.classNames.input
|
|
960
|
+
}, a, { ref: t }), null);
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
});
|
|
842
964
|
//#endregion
|
|
843
965
|
//#region src/renderers/builtin/RadioField.tsx
|
|
844
966
|
function q(e) {
|
|
@@ -860,8 +982,70 @@ function q(e) {
|
|
|
860
982
|
}, null), s("span", null, [n.label])]))]);
|
|
861
983
|
}
|
|
862
984
|
//#endregion
|
|
985
|
+
//#region src/renderers/builtin/RangeField.tsx
|
|
986
|
+
function Je(e) {
|
|
987
|
+
let t = U(e), n = e.field.frontend?.config ?? {}, r = n.min ?? 0, i = n.max ?? 100, a = n.step ?? 1, o = String(e.value ?? e.field.defaultValue ?? r);
|
|
988
|
+
return s("div", {
|
|
989
|
+
class: ["ff-range", e.classNames.content].filter(Boolean).join(" "),
|
|
990
|
+
style: {
|
|
991
|
+
width: "100%",
|
|
992
|
+
minWidth: 0
|
|
993
|
+
}
|
|
994
|
+
}, [s("input", d(t, {
|
|
995
|
+
type: "range",
|
|
996
|
+
class: [e.classNames.input, "ff-range-input"].filter(Boolean).join(" "),
|
|
997
|
+
style: {
|
|
998
|
+
display: "block",
|
|
999
|
+
width: "100%",
|
|
1000
|
+
height: "1.75rem",
|
|
1001
|
+
minHeight: 0,
|
|
1002
|
+
padding: 0,
|
|
1003
|
+
margin: 0,
|
|
1004
|
+
cursor: t.disabled ? "not-allowed" : "pointer",
|
|
1005
|
+
opacity: t.disabled ? .5 : void 0
|
|
1006
|
+
},
|
|
1007
|
+
min: r,
|
|
1008
|
+
max: i,
|
|
1009
|
+
step: a,
|
|
1010
|
+
value: o,
|
|
1011
|
+
onInput: t.onChange
|
|
1012
|
+
}), null), s("div", {
|
|
1013
|
+
class: "ff-range-values",
|
|
1014
|
+
style: {
|
|
1015
|
+
display: "flex",
|
|
1016
|
+
gap: "0.75rem",
|
|
1017
|
+
alignItems: "baseline",
|
|
1018
|
+
justifyContent: "space-between",
|
|
1019
|
+
marginTop: "0.25rem",
|
|
1020
|
+
fontSize: "0.875em",
|
|
1021
|
+
fontVariantNumeric: "tabular-nums"
|
|
1022
|
+
}
|
|
1023
|
+
}, [
|
|
1024
|
+
s("span", {
|
|
1025
|
+
"aria-hidden": "true",
|
|
1026
|
+
style: { opacity: .7 }
|
|
1027
|
+
}, [r]),
|
|
1028
|
+
s("output", {
|
|
1029
|
+
for: t.id,
|
|
1030
|
+
class: "ff-range-value",
|
|
1031
|
+
"aria-live": "off",
|
|
1032
|
+
style: {
|
|
1033
|
+
display: "inline",
|
|
1034
|
+
padding: 0,
|
|
1035
|
+
margin: 0,
|
|
1036
|
+
fontWeight: 600,
|
|
1037
|
+
color: "inherit"
|
|
1038
|
+
}
|
|
1039
|
+
}, [o]),
|
|
1040
|
+
s("span", {
|
|
1041
|
+
"aria-hidden": "true",
|
|
1042
|
+
style: { opacity: .7 }
|
|
1043
|
+
}, [i])
|
|
1044
|
+
])]);
|
|
1045
|
+
}
|
|
1046
|
+
//#endregion
|
|
863
1047
|
//#region src/renderers/builtin/RatingField.tsx
|
|
864
|
-
function
|
|
1048
|
+
function Ye(e) {
|
|
865
1049
|
let t = String(e.value ?? ""), n = e.field.frontend?.config ?? {}, r = n.colorIdle || "#dddddd", i = n.colorSelected || "#ff7700";
|
|
866
1050
|
return s("div", {
|
|
867
1051
|
class: e.classNames.input,
|
|
@@ -899,9 +1083,9 @@ function Fe(e) {
|
|
|
899
1083
|
}
|
|
900
1084
|
//#endregion
|
|
901
1085
|
//#region src/renderers/builtin/RegexField.tsx
|
|
902
|
-
function
|
|
1086
|
+
function Xe(e) {
|
|
903
1087
|
let t = U(e), n = e.field.validation?.pattern || (e.field.frontend?.config?.pattern ?? void 0);
|
|
904
|
-
return s("input",
|
|
1088
|
+
return s("input", d({
|
|
905
1089
|
type: "text",
|
|
906
1090
|
class: e.classNames.input,
|
|
907
1091
|
pattern: n || void 0
|
|
@@ -909,16 +1093,22 @@ function Ie(e) {
|
|
|
909
1093
|
}
|
|
910
1094
|
//#endregion
|
|
911
1095
|
//#region src/renderers/builtin/SelectField.tsx
|
|
1096
|
+
function Ze(e) {
|
|
1097
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !u(e);
|
|
1098
|
+
}
|
|
912
1099
|
function J(e) {
|
|
913
|
-
let t = U(e), n = String(t.value ?? "")
|
|
914
|
-
return s("select", u({ class: e.classNames.input }, t, { value: n }), [e.field.placeholder ? s("option", { value: "" }, [e.field.placeholder]) : null, (e.field.options ?? []).map((e) => s("option", {
|
|
1100
|
+
let t = U(e), n = String(t.value ?? ""), r = s("select", d({ class: e.classNames.input }, t, { value: n }), [e.field.placeholder ? s("option", { value: "" }, [e.field.placeholder]) : null, (e.field.options ?? []).map((e) => s("option", {
|
|
915
1101
|
key: e.value,
|
|
916
1102
|
value: e.value
|
|
917
|
-
}, [e.label]))]);
|
|
1103
|
+
}, [e.label]))]), i = e.field.frontend?.config?.searchable;
|
|
1104
|
+
return i?.enabled ? s(Be, { config: {
|
|
1105
|
+
...i,
|
|
1106
|
+
label: e.field.label
|
|
1107
|
+
} }, Ze(r) ? r : { default: () => [r] }) : r;
|
|
918
1108
|
}
|
|
919
1109
|
//#endregion
|
|
920
1110
|
//#region src/renderers/builtin/SquarePaymentField.tsx
|
|
921
|
-
function
|
|
1111
|
+
function Qe(e) {
|
|
922
1112
|
return s(W, {
|
|
923
1113
|
field: e.field,
|
|
924
1114
|
form: e.form,
|
|
@@ -928,7 +1118,7 @@ function Le(e) {
|
|
|
928
1118
|
}
|
|
929
1119
|
//#endregion
|
|
930
1120
|
//#region src/renderers/builtin/StripePaymentField.tsx
|
|
931
|
-
function
|
|
1121
|
+
function $e(e) {
|
|
932
1122
|
return s(W, {
|
|
933
1123
|
field: e.field,
|
|
934
1124
|
form: e.form,
|
|
@@ -937,26 +1127,102 @@ function Re(e) {
|
|
|
937
1127
|
}, null);
|
|
938
1128
|
}
|
|
939
1129
|
//#endregion
|
|
1130
|
+
//#region src/renderers/builtin/SummaryField.tsx
|
|
1131
|
+
function et({ field: e, form: t, classNames: n }) {
|
|
1132
|
+
let r = oe(e, t);
|
|
1133
|
+
return s("dl", { class: n.content ?? "ff-field__content" }, [r.map((e) => s("div", {
|
|
1134
|
+
key: e.handle,
|
|
1135
|
+
"data-summary-field": e.handle
|
|
1136
|
+
}, [s("dt", null, [e.label]), s("dd", { style: { whiteSpace: "pre-wrap" } }, [e.text])]))]);
|
|
1137
|
+
}
|
|
1138
|
+
//#endregion
|
|
940
1139
|
//#region src/renderers/builtin/TextareaField.tsx
|
|
941
|
-
function
|
|
942
|
-
let t =
|
|
943
|
-
return
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1140
|
+
function tt(e) {
|
|
1141
|
+
let t = e.field.frontend?.config?.rows;
|
|
1142
|
+
return typeof t == "number" && t > 0 ? t : 4;
|
|
1143
|
+
}
|
|
1144
|
+
function nt(e) {
|
|
1145
|
+
let t = e.field.frontend?.config?.autoGrowMaxHeight;
|
|
1146
|
+
return typeof t == "number" && t > 0 ? t : void 0;
|
|
947
1147
|
}
|
|
1148
|
+
var rt = /* @__PURE__ */ c({
|
|
1149
|
+
name: "TextareaFieldRenderer",
|
|
1150
|
+
props: [
|
|
1151
|
+
"field",
|
|
1152
|
+
"form",
|
|
1153
|
+
"value",
|
|
1154
|
+
"errors",
|
|
1155
|
+
"input",
|
|
1156
|
+
"classNames",
|
|
1157
|
+
"renderLabel",
|
|
1158
|
+
"renderInstructions",
|
|
1159
|
+
"renderErrors",
|
|
1160
|
+
"allowRawHtml"
|
|
1161
|
+
],
|
|
1162
|
+
setup(t) {
|
|
1163
|
+
let n = S(), r, i = () => {
|
|
1164
|
+
r?.destroy(), r = void 0, !(t.field.frontend?.config?.autoGrow !== !0 || !n.value) && (r = ue(n.value, { autoGrowMaxHeight: nt(t) }));
|
|
1165
|
+
};
|
|
1166
|
+
return _(i), j(() => JSON.stringify({
|
|
1167
|
+
autoGrow: t.field.frontend?.config?.autoGrow,
|
|
1168
|
+
autoGrowMaxHeight: t.field.frontend?.config?.autoGrowMaxHeight
|
|
1169
|
+
}), i, { flush: "post" }), j(() => t.input.value, () => r?.update()), g(() => r?.destroy()), () => {
|
|
1170
|
+
let r = U(t), i = B(t.field, r.value ?? t.value), a = tt(t), o = `${r.id ?? t.field.uid}-character-count`, c = i ? [r["aria-describedby"], o].filter(Boolean).join(" ") : r["aria-describedby"], l = s("textarea", d({
|
|
1171
|
+
rows: a,
|
|
1172
|
+
class: t.classNames.input
|
|
1173
|
+
}, r, {
|
|
1174
|
+
ref: n,
|
|
1175
|
+
maxLength: i?.limit,
|
|
1176
|
+
"aria-describedby": c,
|
|
1177
|
+
onInput: r.onChange
|
|
1178
|
+
}), null);
|
|
1179
|
+
return i ? s(e, null, [l, s("div", {
|
|
1180
|
+
id: o,
|
|
1181
|
+
"aria-live": "off",
|
|
1182
|
+
class: i.overLimit ? t.classNames.characterCountError : t.classNames.characterCount,
|
|
1183
|
+
style: {
|
|
1184
|
+
marginTop: "0.25rem",
|
|
1185
|
+
fontSize: "0.75rem",
|
|
1186
|
+
lineHeight: "1.5",
|
|
1187
|
+
textAlign: "end",
|
|
1188
|
+
fontVariantNumeric: "tabular-nums"
|
|
1189
|
+
}
|
|
1190
|
+
}, [i.text])]) : l;
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
948
1194
|
//#endregion
|
|
949
1195
|
//#region src/renderers/builtin/TextField.tsx
|
|
950
|
-
function
|
|
951
|
-
let
|
|
952
|
-
return s("input",
|
|
1196
|
+
function it(t) {
|
|
1197
|
+
let n = U(t), r = B(t.field, n.value ?? t.value);
|
|
1198
|
+
if (!r) return s("input", d({
|
|
953
1199
|
type: "text",
|
|
954
|
-
class:
|
|
955
|
-
},
|
|
1200
|
+
class: t.classNames.input
|
|
1201
|
+
}, n), null);
|
|
1202
|
+
let i = `${n.id ?? t.field.uid}-character-count`, a = [n["aria-describedby"], i].filter(Boolean).join(" ");
|
|
1203
|
+
return s(e, null, [s("input", d({
|
|
1204
|
+
type: "text",
|
|
1205
|
+
class: t.classNames.input
|
|
1206
|
+
}, n, {
|
|
1207
|
+
maxLength: r.limit,
|
|
1208
|
+
"aria-describedby": a,
|
|
1209
|
+
onInput: n.onChange
|
|
1210
|
+
}), null), s("div", {
|
|
1211
|
+
id: i,
|
|
1212
|
+
"aria-live": "off",
|
|
1213
|
+
class: r.overLimit ? t.classNames.characterCountError : t.classNames.characterCount,
|
|
1214
|
+
style: {
|
|
1215
|
+
marginTop: "0.25rem",
|
|
1216
|
+
fontSize: "0.75rem",
|
|
1217
|
+
lineHeight: "1.5",
|
|
1218
|
+
textAlign: "end",
|
|
1219
|
+
fontVariantNumeric: "tabular-nums"
|
|
1220
|
+
}
|
|
1221
|
+
}, [r.text])]);
|
|
956
1222
|
}
|
|
957
1223
|
//#endregion
|
|
958
1224
|
//#region src/renderers/builtin/UnsupportedField.tsx
|
|
959
|
-
function
|
|
1225
|
+
function at(e) {
|
|
960
1226
|
return s("div", {
|
|
961
1227
|
class: e.classNames.input,
|
|
962
1228
|
role: "alert"
|
|
@@ -964,16 +1230,16 @@ function Ve(e) {
|
|
|
964
1230
|
}
|
|
965
1231
|
//#endregion
|
|
966
1232
|
//#region src/renderers/builtin/WebsiteField.tsx
|
|
967
|
-
function
|
|
1233
|
+
function ot(e) {
|
|
968
1234
|
let t = U(e);
|
|
969
|
-
return s("input",
|
|
1235
|
+
return s("input", d({
|
|
970
1236
|
type: "url",
|
|
971
1237
|
class: e.classNames.input
|
|
972
1238
|
}, t), null);
|
|
973
1239
|
}
|
|
974
1240
|
//#endregion
|
|
975
1241
|
//#region src/renderers/builtin/CalculationField.tsx
|
|
976
|
-
var
|
|
1242
|
+
var st = /* @__PURE__ */ c({
|
|
977
1243
|
name: "CalculationFieldRenderer",
|
|
978
1244
|
props: {
|
|
979
1245
|
field: {
|
|
@@ -991,8 +1257,8 @@ var Ue = /* @__PURE__ */ c({
|
|
|
991
1257
|
value: { required: !0 }
|
|
992
1258
|
},
|
|
993
1259
|
setup(e) {
|
|
994
|
-
let t =
|
|
995
|
-
return r.value = e.form.setValue,
|
|
1260
|
+
let t = z(e.field.frontend?.config), n = t.inputType ?? "regularTextInput", r = D(e.form.setValue);
|
|
1261
|
+
return r.value = e.form.setValue, j(() => [
|
|
996
1262
|
e.field.handle,
|
|
997
1263
|
t.calculations,
|
|
998
1264
|
t.decimalCount,
|
|
@@ -1000,7 +1266,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1000
1266
|
], () => {
|
|
1001
1267
|
let n = !1, i = t.calculations ?? "";
|
|
1002
1268
|
return (async () => {
|
|
1003
|
-
let a = await
|
|
1269
|
+
let a = await R(i, e.form.values, t.decimalCount);
|
|
1004
1270
|
if (n) return;
|
|
1005
1271
|
let o = a == null ? "" : String(a), s = e.form.getValue(e.field.handle);
|
|
1006
1272
|
String(s ?? "") !== o && r.value(e.field.handle, o);
|
|
@@ -1036,7 +1302,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1036
1302
|
}, null);
|
|
1037
1303
|
};
|
|
1038
1304
|
}
|
|
1039
|
-
}),
|
|
1305
|
+
}), ct = /* @__PURE__ */ c({
|
|
1040
1306
|
name: "SignatureFieldRenderer",
|
|
1041
1307
|
props: {
|
|
1042
1308
|
field: {
|
|
@@ -1054,37 +1320,37 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1054
1320
|
}
|
|
1055
1321
|
},
|
|
1056
1322
|
setup(e) {
|
|
1057
|
-
let t =
|
|
1058
|
-
function
|
|
1323
|
+
let t = D(null), n = D(!1), r = S(!se(e.value)), i = ae(e.field), a = i.width ?? 400, c = i.height ?? 100, l = e.form.isFieldEnabled(e.field.handle), u = i.penColor || "#000000", d = i.backgroundColor || "rgba(0,0,0,0)", f = i.borderColor || "#999999", p = i.penDotSize ?? 2.5;
|
|
1324
|
+
function m(e) {
|
|
1059
1325
|
e.fillStyle = d, e.fillRect(0, 0, a, c);
|
|
1060
1326
|
}
|
|
1061
|
-
function
|
|
1327
|
+
function h() {
|
|
1062
1328
|
let n = t.value;
|
|
1063
1329
|
n && e.form.setValue(e.field.handle, n.toDataURL("image/png"));
|
|
1064
1330
|
}
|
|
1065
|
-
function
|
|
1331
|
+
function g() {
|
|
1066
1332
|
let n = t.value, i = n?.getContext("2d");
|
|
1067
|
-
!n || !i || (i.clearRect(0, 0, a, c),
|
|
1333
|
+
!n || !i || (i.clearRect(0, 0, a, c), m(i), r.value = !1, e.form.setValue(e.field.handle, ""));
|
|
1068
1334
|
}
|
|
1069
|
-
function
|
|
1335
|
+
function v() {
|
|
1070
1336
|
let n = t.value;
|
|
1071
1337
|
if (!n) return;
|
|
1072
1338
|
let i = typeof window < "u" && window.devicePixelRatio || 1;
|
|
1073
1339
|
n.width = Math.floor(a * i), n.height = Math.floor(c * i), n.style.width = `${a}px`, n.style.height = `${c}px`;
|
|
1074
1340
|
let o = n.getContext("2d");
|
|
1075
1341
|
if (o) {
|
|
1076
|
-
if (o.setTransform(i, 0, 0, i, 0, 0),
|
|
1342
|
+
if (o.setTransform(i, 0, 0, i, 0, 0), m(o), o.strokeStyle = u, o.lineWidth = p, o.lineCap = "round", o.lineJoin = "round", typeof e.value == "string" && e.value.startsWith("data:")) {
|
|
1077
1343
|
let t = new Image();
|
|
1078
1344
|
t.onload = () => {
|
|
1079
|
-
o.drawImage(t, 0, 0, a, c), r.value = !
|
|
1345
|
+
o.drawImage(t, 0, 0, a, c), r.value = !se(e.value);
|
|
1080
1346
|
}, t.src = e.value;
|
|
1081
1347
|
} else r.value = !1;
|
|
1082
1348
|
}
|
|
1083
1349
|
}
|
|
1084
|
-
|
|
1350
|
+
_(v), j(() => [a, c], v), y(() => {
|
|
1085
1351
|
n.value = !1;
|
|
1086
1352
|
});
|
|
1087
|
-
function
|
|
1353
|
+
function b(e) {
|
|
1088
1354
|
let n = t.value;
|
|
1089
1355
|
if (!n) return {
|
|
1090
1356
|
x: 0,
|
|
@@ -1096,8 +1362,8 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1096
1362
|
y: (e.clientY - r.top) / r.height * c
|
|
1097
1363
|
};
|
|
1098
1364
|
}
|
|
1099
|
-
function
|
|
1100
|
-
n.value && (n.value = !1,
|
|
1365
|
+
function x() {
|
|
1366
|
+
n.value && (n.value = !1, h());
|
|
1101
1367
|
}
|
|
1102
1368
|
return () => s("div", {
|
|
1103
1369
|
class: e.classNames.input,
|
|
@@ -1122,26 +1388,26 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1122
1388
|
let r = t.value, i = r?.getContext("2d");
|
|
1123
1389
|
if (!i || !r) return;
|
|
1124
1390
|
n.value = !0, r.setPointerCapture(e.pointerId), i.strokeStyle = u, i.lineWidth = p, i.lineCap = "round", i.lineJoin = "round";
|
|
1125
|
-
let { x: a, y: o } =
|
|
1391
|
+
let { x: a, y: o } = b(e);
|
|
1126
1392
|
i.beginPath(), i.moveTo(a, o);
|
|
1127
1393
|
},
|
|
1128
1394
|
onPointermove: (e) => {
|
|
1129
1395
|
if (!n.value) return;
|
|
1130
1396
|
let i = t.value?.getContext("2d");
|
|
1131
1397
|
if (!i) return;
|
|
1132
|
-
let { x: a, y: o } =
|
|
1398
|
+
let { x: a, y: o } = b(e);
|
|
1133
1399
|
i.lineTo(a, o), i.stroke(), r.value = !0;
|
|
1134
1400
|
},
|
|
1135
|
-
onPointerup:
|
|
1136
|
-
onPointercancel:
|
|
1137
|
-
onPointerleave:
|
|
1401
|
+
onPointerup: x,
|
|
1402
|
+
onPointercancel: x,
|
|
1403
|
+
onPointerleave: x
|
|
1138
1404
|
}, null), i.showClearButton === !1 ? null : s("button", {
|
|
1139
1405
|
type: "button",
|
|
1140
1406
|
disabled: !r.value || !l,
|
|
1141
|
-
onClick:
|
|
1407
|
+
onClick: g
|
|
1142
1408
|
}, [o("Clear")])]);
|
|
1143
1409
|
}
|
|
1144
|
-
}),
|
|
1410
|
+
}), lt = /* @__PURE__ */ c({
|
|
1145
1411
|
name: "TableFieldRenderer",
|
|
1146
1412
|
props: {
|
|
1147
1413
|
field: {
|
|
@@ -1159,8 +1425,8 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1159
1425
|
}
|
|
1160
1426
|
},
|
|
1161
1427
|
setup(e) {
|
|
1162
|
-
let n = t(() =>
|
|
1163
|
-
|
|
1428
|
+
let n = t(() => V(e.field)), r = t(() => n.value.columns ?? []), i = t(() => e.form.isFieldEnabled(e.field.handle)), a = t(() => de(e.value, r.value, n.value)), o = D(!1);
|
|
1429
|
+
j(() => [e.field.handle, e.value], () => {
|
|
1164
1430
|
o.value || (!Array.isArray(e.value) || e.value.length === 0) && (o.value = !0, e.form.setValue(e.field.handle, a.value));
|
|
1165
1431
|
}, { immediate: !0 });
|
|
1166
1432
|
let c = (t) => {
|
|
@@ -1170,7 +1436,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1170
1436
|
r[e][t] = n, c(r);
|
|
1171
1437
|
};
|
|
1172
1438
|
return () => {
|
|
1173
|
-
let t = a.value, o = r.value, u = n.value, d = i.value, f =
|
|
1439
|
+
let t = a.value, o = r.value, u = n.value, d = i.value, f = P(t, u);
|
|
1174
1440
|
return s("div", {
|
|
1175
1441
|
class: e.classNames.input,
|
|
1176
1442
|
"data-freeform-table": ""
|
|
@@ -1179,7 +1445,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1179
1445
|
class: e.required ? "is-required" : void 0,
|
|
1180
1446
|
"data-column-required": e.required ? "true" : void 0
|
|
1181
1447
|
}, [e.label])), s("th", null, null)])]), s("tbody", null, [t.map((n, r) => s("tr", { key: `row-${r}` }, [o.map((t, i) => {
|
|
1182
|
-
let a = n[i], o =
|
|
1448
|
+
let a = n[i], o = pe(t), c = `${r}-${i}`;
|
|
1183
1449
|
if (t.type === "checkbox") return s("td", { key: c }, [s("input", {
|
|
1184
1450
|
type: "checkbox",
|
|
1185
1451
|
checked: !!a,
|
|
@@ -1252,7 +1518,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1252
1518
|
l(r, i, e.target.value);
|
|
1253
1519
|
}
|
|
1254
1520
|
}, null)]);
|
|
1255
|
-
}), s("td", null, [
|
|
1521
|
+
}), s("td", null, [F(t, r, u) ? s("button", {
|
|
1256
1522
|
type: "button",
|
|
1257
1523
|
disabled: !d,
|
|
1258
1524
|
onClick: () => {
|
|
@@ -1261,11 +1527,11 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1261
1527
|
}, [u.removeButtonLabel || "Remove"]) : null])]))])]), f ? s("button", {
|
|
1262
1528
|
type: "button",
|
|
1263
1529
|
disabled: !d,
|
|
1264
|
-
onClick: () => c([...t,
|
|
1530
|
+
onClick: () => c([...t, L(o)])
|
|
1265
1531
|
}, [u.addButtonLabel || "Add"]) : null]);
|
|
1266
1532
|
};
|
|
1267
1533
|
}
|
|
1268
|
-
}),
|
|
1534
|
+
}), ut = /* @__PURE__ */ c({
|
|
1269
1535
|
name: "DefaultForm",
|
|
1270
1536
|
props: {
|
|
1271
1537
|
form: {
|
|
@@ -1288,7 +1554,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1288
1554
|
novalidate: !0
|
|
1289
1555
|
}, [t.default?.()]);
|
|
1290
1556
|
}
|
|
1291
|
-
}),
|
|
1557
|
+
}), dt = /* @__PURE__ */ c({
|
|
1292
1558
|
name: "DefaultPage",
|
|
1293
1559
|
props: {
|
|
1294
1560
|
form: {
|
|
@@ -1307,7 +1573,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1307
1573
|
setup(e, { slots: t }) {
|
|
1308
1574
|
return () => s("div", { class: e.class }, [t.default?.()]);
|
|
1309
1575
|
}
|
|
1310
|
-
}),
|
|
1576
|
+
}), ft = /* @__PURE__ */ c({
|
|
1311
1577
|
name: "DefaultRow",
|
|
1312
1578
|
props: { class: {
|
|
1313
1579
|
type: String,
|
|
@@ -1316,7 +1582,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1316
1582
|
setup(e, { slots: t }) {
|
|
1317
1583
|
return () => s("div", { class: e.class }, [t.default?.()]);
|
|
1318
1584
|
}
|
|
1319
|
-
}),
|
|
1585
|
+
}), pt = /* @__PURE__ */ c({
|
|
1320
1586
|
name: "DefaultFieldWrapper",
|
|
1321
1587
|
props: {
|
|
1322
1588
|
field: {
|
|
@@ -1344,7 +1610,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1344
1610
|
}, [t.default?.()]);
|
|
1345
1611
|
};
|
|
1346
1612
|
}
|
|
1347
|
-
}),
|
|
1613
|
+
}), mt = /* @__PURE__ */ c({
|
|
1348
1614
|
name: "DefaultLabel",
|
|
1349
1615
|
props: {
|
|
1350
1616
|
field: {
|
|
@@ -1366,7 +1632,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1366
1632
|
for: `freeform-${e.field.handle}`
|
|
1367
1633
|
}, [e.field.label, e.field.required ? s("span", { "aria-hidden": "true" }, [o(" "), e.requiredIndicator]) : null]) : null;
|
|
1368
1634
|
}
|
|
1369
|
-
}),
|
|
1635
|
+
}), ht = /* @__PURE__ */ c({
|
|
1370
1636
|
name: "DefaultInstructions",
|
|
1371
1637
|
props: {
|
|
1372
1638
|
field: {
|
|
@@ -1381,7 +1647,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1381
1647
|
setup(e) {
|
|
1382
1648
|
return () => e.field.instructions ? s("div", { class: e.class }, [e.field.instructions]) : null;
|
|
1383
1649
|
}
|
|
1384
|
-
}),
|
|
1650
|
+
}), gt = /* @__PURE__ */ c({
|
|
1385
1651
|
name: "DefaultErrors",
|
|
1386
1652
|
props: {
|
|
1387
1653
|
errors: {
|
|
@@ -1406,7 +1672,7 @@ var Ue = /* @__PURE__ */ c({
|
|
|
1406
1672
|
class: e.errorClass
|
|
1407
1673
|
}, [t]))]) : null;
|
|
1408
1674
|
}
|
|
1409
|
-
}),
|
|
1675
|
+
}), _t = /* @__PURE__ */ c({
|
|
1410
1676
|
name: "DefaultButtonRow",
|
|
1411
1677
|
props: { class: {
|
|
1412
1678
|
type: String,
|
|
@@ -1451,7 +1717,7 @@ function Y(e, t = "submit") {
|
|
|
1451
1717
|
}
|
|
1452
1718
|
});
|
|
1453
1719
|
}
|
|
1454
|
-
var
|
|
1720
|
+
var vt = Y("DefaultSubmitButton"), yt = Y("DefaultNextButton", "button"), bt = Y("DefaultBackButton", "button"), xt = Y("DefaultSaveButton", "button"), St = /* @__PURE__ */ c({
|
|
1455
1721
|
name: "DefaultSuccessMessage",
|
|
1456
1722
|
props: {
|
|
1457
1723
|
message: {
|
|
@@ -1471,101 +1737,105 @@ var et = Y("DefaultSubmitButton"), tt = Y("DefaultNextButton", "button"), nt = Y
|
|
|
1471
1737
|
}
|
|
1472
1738
|
}), X = {
|
|
1473
1739
|
frontend: {
|
|
1474
|
-
text:
|
|
1475
|
-
textarea:
|
|
1476
|
-
email:
|
|
1477
|
-
number:
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1740
|
+
text: it,
|
|
1741
|
+
textarea: rt,
|
|
1742
|
+
email: Fe,
|
|
1743
|
+
number: Ue,
|
|
1744
|
+
range: Je,
|
|
1745
|
+
phone: qe,
|
|
1746
|
+
website: ot,
|
|
1747
|
+
regex: Xe,
|
|
1748
|
+
password: Ge,
|
|
1749
|
+
confirm: je,
|
|
1750
|
+
hidden: Le,
|
|
1484
1751
|
dropdown: J,
|
|
1485
1752
|
select: J,
|
|
1486
|
-
"multiple-select":
|
|
1487
|
-
checkbox:
|
|
1488
|
-
checkboxes:
|
|
1753
|
+
"multiple-select": He,
|
|
1754
|
+
checkbox: Ae,
|
|
1755
|
+
checkboxes: ke,
|
|
1489
1756
|
radios: q,
|
|
1490
1757
|
radio: q,
|
|
1491
|
-
"opinion-scale":
|
|
1492
|
-
rating:
|
|
1493
|
-
cards:
|
|
1494
|
-
datetime:
|
|
1758
|
+
"opinion-scale": We,
|
|
1759
|
+
rating: Ye,
|
|
1760
|
+
cards: Oe,
|
|
1761
|
+
datetime: Pe,
|
|
1495
1762
|
file: G,
|
|
1496
1763
|
"file-upload": G,
|
|
1497
|
-
"file-dnd":
|
|
1764
|
+
"file-dnd": Ie,
|
|
1498
1765
|
html: K,
|
|
1766
|
+
summary: et,
|
|
1499
1767
|
"rich-text": K,
|
|
1500
|
-
image:
|
|
1501
|
-
table:
|
|
1502
|
-
signature:
|
|
1503
|
-
calculation:
|
|
1504
|
-
"payment.stripe":
|
|
1505
|
-
"payment.square":
|
|
1506
|
-
"payment.paypal":
|
|
1507
|
-
"payment.mollie":
|
|
1768
|
+
image: Re,
|
|
1769
|
+
table: lt,
|
|
1770
|
+
signature: ct,
|
|
1771
|
+
calculation: st,
|
|
1772
|
+
"payment.stripe": $e,
|
|
1773
|
+
"payment.square": Qe,
|
|
1774
|
+
"payment.paypal": Ke,
|
|
1775
|
+
"payment.mollie": ze
|
|
1508
1776
|
},
|
|
1509
1777
|
types: {
|
|
1510
|
-
text:
|
|
1511
|
-
textarea:
|
|
1512
|
-
email:
|
|
1513
|
-
number:
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1778
|
+
text: it,
|
|
1779
|
+
textarea: rt,
|
|
1780
|
+
email: Fe,
|
|
1781
|
+
number: Ue,
|
|
1782
|
+
range: Je,
|
|
1783
|
+
phone: qe,
|
|
1784
|
+
website: ot,
|
|
1785
|
+
regex: Xe,
|
|
1786
|
+
password: Ge,
|
|
1787
|
+
confirm: je,
|
|
1788
|
+
hidden: Le,
|
|
1520
1789
|
select: J,
|
|
1521
1790
|
dropdown: J,
|
|
1522
|
-
"multiple-select":
|
|
1523
|
-
checkbox:
|
|
1524
|
-
checkboxes:
|
|
1791
|
+
"multiple-select": He,
|
|
1792
|
+
checkbox: Ae,
|
|
1793
|
+
checkboxes: ke,
|
|
1525
1794
|
radio: q,
|
|
1526
1795
|
radios: q,
|
|
1527
1796
|
radiobox: q,
|
|
1528
|
-
"opinion-scale":
|
|
1529
|
-
rating:
|
|
1530
|
-
cards:
|
|
1531
|
-
datetime:
|
|
1797
|
+
"opinion-scale": We,
|
|
1798
|
+
rating: Ye,
|
|
1799
|
+
cards: Oe,
|
|
1800
|
+
datetime: Pe,
|
|
1532
1801
|
file: G,
|
|
1533
1802
|
"file-upload": G,
|
|
1534
|
-
"file-dnd":
|
|
1803
|
+
"file-dnd": Ie,
|
|
1535
1804
|
html: K,
|
|
1805
|
+
summary: et,
|
|
1536
1806
|
"rich-text": K,
|
|
1537
|
-
image:
|
|
1538
|
-
table:
|
|
1539
|
-
signature:
|
|
1540
|
-
calculation:
|
|
1541
|
-
stripe:
|
|
1542
|
-
square:
|
|
1543
|
-
paypal:
|
|
1544
|
-
mollie:
|
|
1545
|
-
_unsupported:
|
|
1807
|
+
image: Re,
|
|
1808
|
+
table: lt,
|
|
1809
|
+
signature: ct,
|
|
1810
|
+
calculation: st,
|
|
1811
|
+
stripe: $e,
|
|
1812
|
+
square: Qe,
|
|
1813
|
+
paypal: Ke,
|
|
1814
|
+
mollie: ze,
|
|
1815
|
+
_unsupported: at
|
|
1546
1816
|
}
|
|
1547
|
-
},
|
|
1548
|
-
Form:
|
|
1549
|
-
Page:
|
|
1550
|
-
Row:
|
|
1551
|
-
FieldWrapper:
|
|
1552
|
-
Label:
|
|
1553
|
-
Instructions:
|
|
1554
|
-
Errors:
|
|
1555
|
-
ButtonRow:
|
|
1556
|
-
SubmitButton:
|
|
1557
|
-
NextButton:
|
|
1558
|
-
BackButton:
|
|
1559
|
-
SaveButton:
|
|
1560
|
-
SuccessMessage:
|
|
1561
|
-
UnsupportedField:
|
|
1817
|
+
}, Ct = {
|
|
1818
|
+
Form: ut,
|
|
1819
|
+
Page: dt,
|
|
1820
|
+
Row: ft,
|
|
1821
|
+
FieldWrapper: pt,
|
|
1822
|
+
Label: mt,
|
|
1823
|
+
Instructions: ht,
|
|
1824
|
+
Errors: gt,
|
|
1825
|
+
ButtonRow: _t,
|
|
1826
|
+
SubmitButton: vt,
|
|
1827
|
+
NextButton: yt,
|
|
1828
|
+
BackButton: bt,
|
|
1829
|
+
SaveButton: xt,
|
|
1830
|
+
SuccessMessage: St,
|
|
1831
|
+
UnsupportedField: at
|
|
1562
1832
|
};
|
|
1563
1833
|
//#endregion
|
|
1564
1834
|
//#region src/theme/mergeClassNames.ts
|
|
1565
1835
|
function Z(...e) {
|
|
1566
1836
|
return e.filter((e) => typeof e == "string" && e.trim() !== "").join(" ").replace(/\s+/g, " ").trim() || void 0;
|
|
1567
1837
|
}
|
|
1568
|
-
function
|
|
1838
|
+
function wt(e, t, n) {
|
|
1569
1839
|
return n ? !t || e === "replace" ? n : `${t} ${n}`.trim() : t;
|
|
1570
1840
|
}
|
|
1571
1841
|
//#endregion
|
|
@@ -1575,14 +1845,14 @@ function Q(e) {
|
|
|
1575
1845
|
}
|
|
1576
1846
|
//#endregion
|
|
1577
1847
|
//#region src/components/CaptchaHost.vue?vue&type=script&setup=true&lang.ts
|
|
1578
|
-
var
|
|
1848
|
+
var Tt = ["data-freeform-captcha", "data-freeform-captcha-provider"], Et = /* @__PURE__ */ c({
|
|
1579
1849
|
__name: "CaptchaHost",
|
|
1580
1850
|
props: {
|
|
1581
1851
|
form: {},
|
|
1582
1852
|
captcha: {}
|
|
1583
1853
|
},
|
|
1584
1854
|
setup(e) {
|
|
1585
|
-
let t = e, n =
|
|
1855
|
+
let t = e, n = S(null), r;
|
|
1586
1856
|
function a(e) {
|
|
1587
1857
|
return [
|
|
1588
1858
|
e.name,
|
|
@@ -1599,23 +1869,23 @@ var st = ["data-freeform-captcha", "data-freeform-captcha-provider"], ct = /* @_
|
|
|
1599
1869
|
function o() {
|
|
1600
1870
|
r?.(), r = void 0, n.value && (r = t.form.mountCaptcha(t.captcha, n.value));
|
|
1601
1871
|
}
|
|
1602
|
-
|
|
1872
|
+
_(o), j(() => a(t.captcha), o), y(() => {
|
|
1603
1873
|
r?.();
|
|
1604
1874
|
});
|
|
1605
1875
|
function s(e) {
|
|
1606
1876
|
n.value = e ?? null;
|
|
1607
1877
|
}
|
|
1608
|
-
return (t, n) => (
|
|
1878
|
+
return (t, n) => (x(), i("div", {
|
|
1609
1879
|
ref: s,
|
|
1610
1880
|
class: "ff-captcha",
|
|
1611
1881
|
"data-freeform-captcha": e.captcha.name,
|
|
1612
1882
|
"data-freeform-captcha-provider": e.captcha.provider ?? e.captcha.name
|
|
1613
|
-
}, null, 8,
|
|
1883
|
+
}, null, 8, Tt));
|
|
1614
1884
|
}
|
|
1615
1885
|
});
|
|
1616
1886
|
//#endregion
|
|
1617
1887
|
//#region src/renderers/resolve.ts
|
|
1618
|
-
function
|
|
1888
|
+
function Dt(e, t, n) {
|
|
1619
1889
|
let r = e.frontend?.renderer ?? "";
|
|
1620
1890
|
return [
|
|
1621
1891
|
t?.handles?.[e.handle],
|
|
@@ -1631,7 +1901,7 @@ function lt(e, t, n) {
|
|
|
1631
1901
|
}
|
|
1632
1902
|
//#endregion
|
|
1633
1903
|
//#region src/theme/resolveThemeClassNames.ts
|
|
1634
|
-
var
|
|
1904
|
+
var Ot = /* @__PURE__ */ new Set([
|
|
1635
1905
|
"checkbox",
|
|
1636
1906
|
"checkboxes",
|
|
1637
1907
|
"radio",
|
|
@@ -1647,13 +1917,13 @@ function $(e, t) {
|
|
|
1647
1917
|
...t
|
|
1648
1918
|
} : e;
|
|
1649
1919
|
}
|
|
1650
|
-
function
|
|
1920
|
+
function kt(e, t, n = !1) {
|
|
1651
1921
|
let r = e.classNamesByType, i = $({}, e.classNames);
|
|
1652
1922
|
i = $(i, r?.[t.type]);
|
|
1653
1923
|
let a = t.frontend?.renderer;
|
|
1654
1924
|
a && (i = $(i, r?.[a]));
|
|
1655
1925
|
let o = t.frontend?.extension;
|
|
1656
|
-
return o && (i = $(i, r?.[o])), n && i.inputError && (i =
|
|
1926
|
+
return o && (i = $(i, r?.[o])), n && i.inputError && (i = Ot.has(t.type) ? {
|
|
1657
1927
|
...i,
|
|
1658
1928
|
optionInput: Z(i.optionInput, i.inputError)
|
|
1659
1929
|
} : {
|
|
@@ -1663,7 +1933,7 @@ function dt(e, t, n = !1) {
|
|
|
1663
1933
|
}
|
|
1664
1934
|
//#endregion
|
|
1665
1935
|
//#region src/components/FieldRenderer.vue?vue&type=script&setup=true&lang.ts
|
|
1666
|
-
var
|
|
1936
|
+
var At = ["data-freeform-group"], jt = /* @__PURE__ */ c({
|
|
1667
1937
|
name: "FieldRenderer",
|
|
1668
1938
|
__name: "FieldRenderer",
|
|
1669
1939
|
props: {
|
|
@@ -1674,73 +1944,73 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1674
1944
|
allowRawHtml: { type: Boolean }
|
|
1675
1945
|
},
|
|
1676
1946
|
setup(o) {
|
|
1677
|
-
let s = o, c = t(() => s.theme.classNameStrategy ?? "merge"), u = t(() => s.form.fieldErrors[s.field.handle] ?? []),
|
|
1678
|
-
...
|
|
1947
|
+
let s = o, c = t(() => s.theme.classNameStrategy ?? "merge"), u = t(() => s.form.fieldErrors[s.field.handle] ?? []), d = t(() => kt(s.theme, s.field, u.value.length > 0)), f = t(() => ({
|
|
1948
|
+
...Ct,
|
|
1679
1949
|
...s.theme.renderers?.components
|
|
1680
|
-
})), h = t(() =>
|
|
1681
|
-
if (!
|
|
1950
|
+
})), h = t(() => Dt(s.field, s.renderers, s.theme)), g = t(() => s.form.values[s.field.handle]), _ = t(() => s.field.type === "checkbox"), v = t(() => s.field.type === "html" || s.field.type === "rich-text" || s.field.type === "image"), y = t(() => s.field.type === "hidden" || s.field.type === "mollie" || s.field.frontend?.renderer === "payment.mollie" || s.field.frontend?.extension === "payment.mollie"), b = t(() => !_.value && !v.value && !y.value && s.theme.defaults?.renderLabels !== !1), ee = t(() => !v.value && !y.value && s.theme.defaults?.renderInstructions !== !1), S = t(() => s.theme.defaults?.renderErrors !== !1), w = t(() => {
|
|
1951
|
+
if (!v.value) return !0;
|
|
1682
1952
|
if (s.field.type === "image") {
|
|
1683
1953
|
let e = s.field.frontend?.config ?? {};
|
|
1684
1954
|
return !!(s.field.content?.image?.src || e.src);
|
|
1685
1955
|
}
|
|
1686
1956
|
let e = s.field.content?.rendered?.html?.trim();
|
|
1687
1957
|
return !!(s.allowRawHtml && e || s.field.instructions);
|
|
1688
|
-
}),
|
|
1958
|
+
}), D = t(() => Z(d.value.field, s.field.required ? d.value.fieldRequired : void 0, u.value.length ? d.value.fieldHasErrors : void 0, !s.form.isFieldVisible(s.field.handle) || y.value ? d.value.fieldHidden : void 0, c.value === "merge" ? `ff-field--${Q(s.field.type)}` : void 0, c.value === "merge" ? `ff-field--${Q(s.field.handle)}` : void 0)), O = t(() => ({
|
|
1689
1959
|
field: s.field,
|
|
1690
1960
|
form: s.form,
|
|
1691
1961
|
value: g.value,
|
|
1692
1962
|
errors: u.value,
|
|
1693
1963
|
input: s.form.getFieldProps(s.field.handle),
|
|
1694
|
-
classNames:
|
|
1964
|
+
classNames: d.value,
|
|
1695
1965
|
allowRawHtml: s.allowRawHtml,
|
|
1696
1966
|
renderLabel: () => null,
|
|
1697
1967
|
renderInstructions: () => null,
|
|
1698
1968
|
renderErrors: () => null
|
|
1699
1969
|
}));
|
|
1700
1970
|
return (t, s) => {
|
|
1701
|
-
let g =
|
|
1702
|
-
return
|
|
1971
|
+
let g = T("FieldRenderer", !0);
|
|
1972
|
+
return w.value ? (x(), i(e, { key: 0 }, [y.value ? (x(), n(E(f.value.FieldWrapper), {
|
|
1703
1973
|
key: 0,
|
|
1704
1974
|
field: o.field,
|
|
1705
1975
|
form: o.form,
|
|
1706
|
-
class:
|
|
1976
|
+
class: p(D.value)
|
|
1707
1977
|
}, {
|
|
1708
|
-
default:
|
|
1978
|
+
default: M(() => [(x(), n(E(h.value), m(l(O.value)), null, 16))]),
|
|
1709
1979
|
_: 1
|
|
1710
1980
|
}, 8, [
|
|
1711
1981
|
"field",
|
|
1712
1982
|
"form",
|
|
1713
1983
|
"class"
|
|
1714
|
-
])) : o.field.type === "group" ? (
|
|
1984
|
+
])) : o.field.type === "group" ? (x(), n(E(f.value.FieldWrapper), {
|
|
1715
1985
|
key: 1,
|
|
1716
1986
|
field: o.field,
|
|
1717
1987
|
form: o.form,
|
|
1718
|
-
class:
|
|
1988
|
+
class: p(D.value)
|
|
1719
1989
|
}, {
|
|
1720
|
-
default:
|
|
1721
|
-
|
|
1990
|
+
default: M(() => [
|
|
1991
|
+
b.value ? (x(), n(E(f.value.Label), {
|
|
1722
1992
|
key: 0,
|
|
1723
1993
|
field: o.field,
|
|
1724
|
-
class: d
|
|
1994
|
+
class: p(d.value.label),
|
|
1725
1995
|
"required-indicator": o.theme.defaults?.requiredIndicator
|
|
1726
1996
|
}, null, 8, [
|
|
1727
1997
|
"field",
|
|
1728
1998
|
"class",
|
|
1729
1999
|
"required-indicator"
|
|
1730
2000
|
])) : r("", !0),
|
|
1731
|
-
|
|
2001
|
+
ee.value ? (x(), n(E(f.value.Instructions), {
|
|
1732
2002
|
key: 1,
|
|
1733
2003
|
field: o.field,
|
|
1734
|
-
class: d
|
|
2004
|
+
class: p(d.value.instructions)
|
|
1735
2005
|
}, null, 8, ["field", "class"])) : r("", !0),
|
|
1736
2006
|
a("div", {
|
|
1737
|
-
class: d
|
|
2007
|
+
class: p(d.value.input),
|
|
1738
2008
|
"data-freeform-group": o.field.handle
|
|
1739
|
-
}, [(
|
|
2009
|
+
}, [(x(!0), i(e, null, C(o.field.layout?.rows ?? [], (t) => (x(), n(E(f.value.Row), {
|
|
1740
2010
|
key: t.uid,
|
|
1741
|
-
class:
|
|
2011
|
+
class: p(k(Z)(d.value.row, c.value === "merge" ? `ff-row--${t.fields.length}-fields` : void 0))
|
|
1742
2012
|
}, {
|
|
1743
|
-
default:
|
|
2013
|
+
default: M(() => [(x(!0), i(e, null, C(t.fields, (e) => (x(), n(g, {
|
|
1744
2014
|
key: e,
|
|
1745
2015
|
field: o.form.manifest.fields[e],
|
|
1746
2016
|
form: o.form,
|
|
@@ -1755,12 +2025,12 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1755
2025
|
"allow-raw-html"
|
|
1756
2026
|
]))), 128))]),
|
|
1757
2027
|
_: 2
|
|
1758
|
-
}, 1032, ["class"]))), 128))], 10,
|
|
1759
|
-
|
|
2028
|
+
}, 1032, ["class"]))), 128))], 10, At),
|
|
2029
|
+
S.value ? (x(), n(E(f.value.Errors), {
|
|
1760
2030
|
key: 2,
|
|
1761
2031
|
errors: u.value,
|
|
1762
|
-
class: d
|
|
1763
|
-
"error-class":
|
|
2032
|
+
class: p(d.value.errors),
|
|
2033
|
+
"error-class": d.value.error
|
|
1764
2034
|
}, null, 8, [
|
|
1765
2035
|
"errors",
|
|
1766
2036
|
"class",
|
|
@@ -1772,34 +2042,34 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1772
2042
|
"field",
|
|
1773
2043
|
"form",
|
|
1774
2044
|
"class"
|
|
1775
|
-
])) : (
|
|
2045
|
+
])) : (x(), n(E(f.value.FieldWrapper), {
|
|
1776
2046
|
key: 2,
|
|
1777
2047
|
field: o.field,
|
|
1778
2048
|
form: o.form,
|
|
1779
|
-
class:
|
|
2049
|
+
class: p(D.value)
|
|
1780
2050
|
}, {
|
|
1781
|
-
default:
|
|
1782
|
-
|
|
2051
|
+
default: M(() => [
|
|
2052
|
+
b.value ? (x(), n(E(f.value.Label), {
|
|
1783
2053
|
key: 0,
|
|
1784
2054
|
field: o.field,
|
|
1785
|
-
class: d
|
|
2055
|
+
class: p(d.value.label),
|
|
1786
2056
|
"required-indicator": o.theme.defaults?.requiredIndicator
|
|
1787
2057
|
}, null, 8, [
|
|
1788
2058
|
"field",
|
|
1789
2059
|
"class",
|
|
1790
2060
|
"required-indicator"
|
|
1791
2061
|
])) : r("", !0),
|
|
1792
|
-
|
|
2062
|
+
ee.value ? (x(), n(E(f.value.Instructions), {
|
|
1793
2063
|
key: 1,
|
|
1794
2064
|
field: o.field,
|
|
1795
|
-
class: d
|
|
2065
|
+
class: p(d.value.instructions)
|
|
1796
2066
|
}, null, 8, ["field", "class"])) : r("", !0),
|
|
1797
|
-
(
|
|
1798
|
-
|
|
2067
|
+
(x(), n(E(h.value), m(l(O.value)), null, 16)),
|
|
2068
|
+
S.value ? (x(), n(E(f.value.Errors), {
|
|
1799
2069
|
key: 2,
|
|
1800
2070
|
errors: u.value,
|
|
1801
|
-
class: d
|
|
1802
|
-
"error-class":
|
|
2071
|
+
class: p(d.value.errors),
|
|
2072
|
+
"error-class": d.value.error
|
|
1803
2073
|
}, null, 8, [
|
|
1804
2074
|
"errors",
|
|
1805
2075
|
"class",
|
|
@@ -1814,7 +2084,7 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1814
2084
|
]))], 64)) : r("", !0);
|
|
1815
2085
|
};
|
|
1816
2086
|
}
|
|
1817
|
-
}),
|
|
2087
|
+
}), Mt = /* @__PURE__ */ c({
|
|
1818
2088
|
__name: "FreeformView",
|
|
1819
2089
|
props: {
|
|
1820
2090
|
form: {},
|
|
@@ -1822,12 +2092,12 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1822
2092
|
},
|
|
1823
2093
|
setup(a) {
|
|
1824
2094
|
let o = a, s = t(() => ({
|
|
1825
|
-
...
|
|
2095
|
+
...Ct,
|
|
1826
2096
|
...o.form.theme.renderers?.components
|
|
1827
|
-
})), c = t(() => o.form.theme.classNameStrategy ?? "merge"), l = t(() => o.form.theme.defaults?.colorScheme ?? "system"), u = t(() => Z(o.form.theme.classNames?.form, c.value === "merge" ? `ff-form--${Q(o.form.manifest.form.handle)}` : void 0, c.value === "merge" && (l.value === "light" || l.value === "dark") ? `ff-form--${l.value}` : void 0, o.class)),
|
|
2097
|
+
})), c = t(() => o.form.theme.classNameStrategy ?? "merge"), l = t(() => o.form.theme.defaults?.colorScheme ?? "system"), u = t(() => Z(o.form.theme.classNames?.form, c.value === "merge" ? `ff-form--${Q(o.form.manifest.form.handle)}` : void 0, c.value === "merge" && (l.value === "light" || l.value === "dark") ? `ff-form--${l.value}` : void 0, o.class)), d = t(() => o.form.manifest.layout.pages[o.form.currentPageIndex] ?? o.form.manifest.layout.pages[0] ?? {
|
|
1828
2098
|
rows: [],
|
|
1829
2099
|
buttons: {}
|
|
1830
|
-
}),
|
|
2100
|
+
}), f = t(() => o.form.manifest.layout.pages.length === 0 || o.form.currentPageIndex >= o.form.manifest.layout.pages.length - 1), m = t(() => o.form.currentPageIndex === 0);
|
|
1831
2101
|
function h(e) {
|
|
1832
2102
|
if (e.type === "image") {
|
|
1833
2103
|
let t = e.frontend?.config ?? {};
|
|
@@ -1842,46 +2112,46 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1842
2112
|
function g(e) {
|
|
1843
2113
|
o.form.handleSubmit(e);
|
|
1844
2114
|
}
|
|
1845
|
-
return (t, o) => a.form.isComplete && a.form.successMessage ? (
|
|
2115
|
+
return (t, o) => a.form.isComplete && a.form.successMessage ? (x(), n(E(s.value.SuccessMessage), {
|
|
1846
2116
|
key: 0,
|
|
1847
2117
|
message: a.form.successMessage,
|
|
1848
|
-
class:
|
|
1849
|
-
}, null, 8, ["message", "class"])) : (
|
|
2118
|
+
class: p(a.form.theme.classNames?.success)
|
|
2119
|
+
}, null, 8, ["message", "class"])) : (x(), n(E(s.value.Form), {
|
|
1850
2120
|
key: 1,
|
|
1851
2121
|
form: a.form,
|
|
1852
|
-
class:
|
|
2122
|
+
class: p(u.value),
|
|
1853
2123
|
"on-submit": g
|
|
1854
2124
|
}, {
|
|
1855
|
-
default:
|
|
1856
|
-
a.form.formErrors.length > 0 ? (
|
|
2125
|
+
default: M(() => [
|
|
2126
|
+
a.form.formErrors.length > 0 ? (x(), n(E(s.value.Errors), {
|
|
1857
2127
|
key: 0,
|
|
1858
2128
|
errors: a.form.formErrors,
|
|
1859
|
-
class:
|
|
2129
|
+
class: p(a.form.theme.classNames?.errors),
|
|
1860
2130
|
"error-class": a.form.theme.classNames?.error
|
|
1861
2131
|
}, null, 8, [
|
|
1862
2132
|
"errors",
|
|
1863
2133
|
"class",
|
|
1864
2134
|
"error-class"
|
|
1865
2135
|
])) : r("", !0),
|
|
1866
|
-
(
|
|
2136
|
+
(x(), n(E(s.value.Page), {
|
|
1867
2137
|
form: a.form,
|
|
1868
2138
|
"page-index": a.form.currentPageIndex,
|
|
1869
|
-
class:
|
|
2139
|
+
class: p(k(Z)(a.form.theme.classNames?.page, c.value === "merge" ? `ff-page--${a.form.currentPageIndex}` : void 0))
|
|
1870
2140
|
}, {
|
|
1871
|
-
default:
|
|
2141
|
+
default: M(() => [(x(!0), i(e, null, C(d.value.rows, (t) => (x(), i(e, { key: t.uid }, [t.fields.filter((e) => {
|
|
1872
2142
|
let t = a.form.manifest.fields[e];
|
|
1873
2143
|
return t ? h(t) : !1;
|
|
1874
|
-
}).length > 0 ? (
|
|
2144
|
+
}).length > 0 ? (x(), n(E(s.value.Row), {
|
|
1875
2145
|
key: 0,
|
|
1876
|
-
class:
|
|
2146
|
+
class: p(k(Z)(a.form.theme.classNames?.row, c.value === "merge" ? `ff-row--${t.fields.filter((e) => {
|
|
1877
2147
|
let t = a.form.manifest.fields[e];
|
|
1878
2148
|
return t ? h(t) : !1;
|
|
1879
2149
|
}).length}-fields` : void 0))
|
|
1880
2150
|
}, {
|
|
1881
|
-
default:
|
|
2151
|
+
default: M(() => [(x(!0), i(e, null, C(t.fields.filter((e) => {
|
|
1882
2152
|
let t = a.form.manifest.fields[e];
|
|
1883
2153
|
return t ? h(t) : !1;
|
|
1884
|
-
}), (e) => (
|
|
2154
|
+
}), (e) => (x(), n(jt, {
|
|
1885
2155
|
key: e,
|
|
1886
2156
|
field: a.form.manifest.fields[e],
|
|
1887
2157
|
form: a.form,
|
|
@@ -1903,17 +2173,17 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1903
2173
|
"page-index",
|
|
1904
2174
|
"class"
|
|
1905
2175
|
])),
|
|
1906
|
-
(
|
|
2176
|
+
(x(!0), i(e, null, C(a.form.manifest.security.captchas ?? [], (e) => (x(), n(Et, {
|
|
1907
2177
|
key: e.name,
|
|
1908
2178
|
form: a.form,
|
|
1909
2179
|
captcha: e
|
|
1910
2180
|
}, null, 8, ["form", "captcha"]))), 128)),
|
|
1911
|
-
(
|
|
1912
|
-
default:
|
|
1913
|
-
!m.value &&
|
|
2181
|
+
(x(), n(E(s.value.ButtonRow), { class: p(a.form.theme.classNames?.buttons) }, {
|
|
2182
|
+
default: M(() => [
|
|
2183
|
+
!m.value && d.value.buttons?.back ? (x(), n(E(s.value.BackButton), {
|
|
1914
2184
|
key: 0,
|
|
1915
|
-
label:
|
|
1916
|
-
class:
|
|
2185
|
+
label: d.value.buttons.back.label,
|
|
2186
|
+
class: p(a.form.theme.classNames?.backButton),
|
|
1917
2187
|
disabled: a.form.isSubmitting,
|
|
1918
2188
|
"on-click": () => void a.form.goBack()
|
|
1919
2189
|
}, null, 40, [
|
|
@@ -1922,10 +2192,10 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1922
2192
|
"disabled",
|
|
1923
2193
|
"on-click"
|
|
1924
2194
|
])) : r("", !0),
|
|
1925
|
-
a.form.manifest.settings.multiPage && !
|
|
2195
|
+
a.form.manifest.settings.multiPage && !f.value && d.value.buttons?.submit ? (x(), n(E(s.value.NextButton), {
|
|
1926
2196
|
key: 1,
|
|
1927
|
-
label:
|
|
1928
|
-
class:
|
|
2197
|
+
label: d.value.buttons.submit.label,
|
|
2198
|
+
class: p(a.form.theme.classNames?.nextButton),
|
|
1929
2199
|
disabled: a.form.isSubmitting,
|
|
1930
2200
|
"on-click": () => void a.form.goNext()
|
|
1931
2201
|
}, null, 40, [
|
|
@@ -1934,20 +2204,20 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1934
2204
|
"disabled",
|
|
1935
2205
|
"on-click"
|
|
1936
2206
|
])) : r("", !0),
|
|
1937
|
-
(!a.form.manifest.settings.multiPage ||
|
|
2207
|
+
(!a.form.manifest.settings.multiPage || f.value) && d.value.buttons?.submit ? (x(), n(E(s.value.SubmitButton), {
|
|
1938
2208
|
key: 2,
|
|
1939
|
-
label:
|
|
1940
|
-
class:
|
|
2209
|
+
label: d.value.buttons.submit.label,
|
|
2210
|
+
class: p(a.form.theme.classNames?.submitButton),
|
|
1941
2211
|
disabled: a.form.isSubmitting
|
|
1942
2212
|
}, null, 8, [
|
|
1943
2213
|
"label",
|
|
1944
2214
|
"class",
|
|
1945
2215
|
"disabled"
|
|
1946
2216
|
])) : r("", !0),
|
|
1947
|
-
|
|
2217
|
+
d.value.buttons?.save ? (x(), n(E(s.value.SaveButton), {
|
|
1948
2218
|
key: 3,
|
|
1949
|
-
label:
|
|
1950
|
-
class:
|
|
2219
|
+
label: d.value.buttons.save.label,
|
|
2220
|
+
class: p(a.form.theme.classNames?.saveButton),
|
|
1951
2221
|
disabled: a.form.isSubmitting,
|
|
1952
2222
|
"on-click": () => void a.form.saveDraft()
|
|
1953
2223
|
}, null, 40, [
|
|
@@ -1963,7 +2233,7 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1963
2233
|
_: 1
|
|
1964
2234
|
}, 40, ["form", "class"]));
|
|
1965
2235
|
}
|
|
1966
|
-
}),
|
|
2236
|
+
}), Nt = { role: "alert" }, Pt = /* @__PURE__ */ c({
|
|
1967
2237
|
__name: "Freeform",
|
|
1968
2238
|
props: {
|
|
1969
2239
|
handle: {},
|
|
@@ -1988,15 +2258,15 @@ var ft = ["data-freeform-group"], pt = /* @__PURE__ */ c({
|
|
|
1988
2258
|
loadingMessage: {}
|
|
1989
2259
|
},
|
|
1990
2260
|
setup(e) {
|
|
1991
|
-
let i = e, o =
|
|
1992
|
-
return (t, l) => t.$slots.default ?
|
|
2261
|
+
let i = e, o = De(() => i), c = t(() => o.manifest ? o : null);
|
|
2262
|
+
return (t, l) => t.$slots.default ? w(t.$slots, "default", { form: k(o) }, void 0, void 0, 0) : k(o).loading ? w(t.$slots, "loading", {}, () => [s(be, { message: e.loadingMessage ?? "Loading form…" }, null, 8, ["message"])], void 0, 1) : k(o).error ? w(t.$slots, "error", { error: k(o).error }, () => [a("div", Nt, O(k(o).error.message), 1)], void 0, 2) : c.value ? (x(), n(Mt, {
|
|
1993
2263
|
key: 3,
|
|
1994
2264
|
form: c.value,
|
|
1995
|
-
class:
|
|
2265
|
+
class: p(i.class)
|
|
1996
2266
|
}, null, 8, ["form", "class"])) : r("", !0);
|
|
1997
2267
|
}
|
|
1998
2268
|
});
|
|
1999
2269
|
//#endregion
|
|
2000
|
-
export {
|
|
2270
|
+
export { we as CLIENT_NAME, be as FormLoader, Pt as Freeform, Mt as FreeformView, Ce as PACKAGE_VERSION, Ct as builtinComponents, X as builtinRenderers, Se as createTheme, H as defaultTheme, Z as joinClassNames, wt as mergeClassNames, Dt as resolveFieldRenderer, kt as resolveThemeClassNames, Q as toBemModifier, Me as useFieldExtension, De as useFreeform };
|
|
2001
2271
|
|
|
2002
2272
|
//# sourceMappingURL=index.js.map
|