@verbb/formie-browser 1.0.3 → 1.0.5
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/CHANGELOG.md +65 -17
- package/dist/chunks/address-country-Rx6GQTND.js +68 -0
- package/dist/chunks/address-finder-yXU5yMjG.js +30 -0
- package/dist/chunks/address-state-BQ0xGV9n.js +344 -0
- package/dist/chunks/api-CmwLRq_n.js +780 -0
- package/dist/chunks/api-DMK8NSUI.js +407 -0
- package/dist/chunks/api-sPqGbOww.js +125 -0
- package/dist/chunks/async-nPFRNQ06.js +25 -0
- package/dist/chunks/bpoint-DSjqRv63.js +24 -0
- package/dist/chunks/calculations-CgVJcQ2P.js +299 -0
- package/dist/chunks/captcha-eu-CWJb64_j.js +31 -0
- package/dist/chunks/checkbox-radio-DQ0H67Tj.js +125 -0
- package/dist/chunks/chunk-3b4jIN3o.js +13 -0
- package/dist/chunks/combobox-D-2b42wn.js +1954 -0
- package/dist/chunks/conditions-CZ3FU5QO.js +412 -0
- package/dist/chunks/constants-DVcJAvc5.js +38 -0
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +26 -0
- package/dist/chunks/custom-google-maps-BsaSirEZ.js +194 -0
- package/dist/chunks/custom-link-CJ1-FjEM.js +46 -0
- package/dist/chunks/custom-maps-DYW_pBid.js +161 -0
- package/dist/chunks/date-picker-5CA_-zGb.js +5311 -0
- package/dist/chunks/debug-BV0DvdHx.js +41 -0
- package/dist/chunks/dist-BF5GU3_9.js +2674 -0
- package/dist/chunks/event-names-BCI2FLD8.js +51 -0
- package/dist/chunks/eway-D3ctTbEk.js +70 -0
- package/dist/chunks/field-references.keys-58ZSTrCW.js +21 -0
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +145 -0
- package/dist/chunks/file-upload-D49m8-DR.js +287 -0
- package/dist/chunks/friendly-captcha-v1-ByXzENYZ.js +31 -0
- package/dist/chunks/friendly-captcha-v2-BPdlmhQu.js +36 -0
- package/dist/chunks/friendly-challenge-8uPatWqk.js +832 -0
- package/dist/chunks/go-cardless-BwASSYSK.js +23 -0
- package/dist/chunks/google-address-OhKilPWE.js +161 -0
- package/dist/chunks/hcaptcha-CdCd9oEi.js +54 -0
- package/dist/chunks/hidden-D7_Ch-QN.js +26 -0
- package/dist/chunks/http-D-JExro7.js +27 -0
- package/dist/chunks/i18n-BY1ds1BL.js +121 -0
- package/dist/chunks/leaflet-src-j-lHNmhR.js +4585 -0
- package/dist/chunks/loqate-Cp2zvwpE.js +76 -0
- package/dist/chunks/mollie-COG-ko2D.js +23 -0
- package/dist/chunks/moneris-CMH8PlRc.js +117 -0
- package/dist/chunks/opayo-D2jsR5vh.js +113 -0
- package/dist/chunks/paddle-DxF88RfC.js +55 -0
- package/dist/chunks/paypal-b5pnwrA2.js +95 -0
- package/dist/chunks/payway-BJYu9DIR.js +55 -0
- package/dist/chunks/phone-country-D3ayr60L.js +2645 -0
- package/dist/chunks/place-kit-BGHklIZ-.js +48 -0
- package/dist/chunks/placekit-autocomplete.esm-DWVabQlq.js +1236 -0
- package/dist/chunks/recaptcha-enterprise-BSwi8IVX.js +65 -0
- package/dist/chunks/recaptcha-shared-B4zAescW.js +15 -0
- package/dist/chunks/recaptcha-v2-checkbox-CnDQmsKa.js +40 -0
- package/dist/chunks/recaptcha-v2-invisible-Cz5uIlp-.js +53 -0
- package/dist/chunks/recaptcha-v3-BtbbP111.js +27 -0
- package/dist/chunks/repeater-B5leVxZU.js +102 -0
- package/dist/chunks/rich-text-Cv8ADyk-.js +349 -0
- package/dist/chunks/scripts-6CYSUGKQ.js +24 -0
- package/dist/chunks/sdk-BhHAYgga.js +1397 -0
- package/dist/chunks/shared-Bx9s0i0P.js +100 -0
- package/dist/chunks/signature-CpgqHCEx.js +463 -0
- package/dist/chunks/snaptcha-vz1RnZ15.js +8 -0
- package/dist/chunks/square-BP8RWAKB.js +40 -0
- package/dist/chunks/stripe-MihN63uC.js +184 -0
- package/dist/chunks/styles-BfoIZwJp.js +19 -0
- package/dist/chunks/summary-D3AjxpYN.js +114 -0
- package/dist/chunks/table-C-lkQN6I.js +78 -0
- package/dist/chunks/text-limit-B09elPDB.js +125 -0
- package/dist/chunks/theme-classes-Tv7q7ToE.js +44 -0
- package/dist/chunks/turnstile-D_Pi1CKM.js +58 -0
- package/dist/chunks/utils-Vqp8i_RM.js +49401 -0
- package/dist/css/formie-theme.css +2 -0
- package/dist/css/theme/fields/_address-state.css +94 -0
- package/dist/css/theme/fields/_combobox.css +246 -0
- package/dist/css/theme/fields/_select.css +13 -0
- package/dist/index.js +2447 -39
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/field-error-container.d.ts +4 -0
- package/dist/js/core/field-error-container.d.ts.map +1 -0
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/core/validation-focus.d.ts +4 -0
- package/dist/js/core/validation-focus.d.ts.map +1 -0
- package/dist/js/modules/address/api.d.ts +1 -0
- package/dist/js/modules/address/api.d.ts.map +1 -1
- package/dist/js/modules/address/constants.d.ts +22 -1
- package/dist/js/modules/address/constants.d.ts.map +1 -1
- package/dist/js/modules/address/host.d.ts +2 -2
- package/dist/js/modules/address/host.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +3 -0
- package/dist/js/modules/fields/address-country.d.ts.map +1 -0
- package/dist/js/modules/fields/address-state.d.ts +3 -0
- package/dist/js/modules/fields/address-state.d.ts.map +1 -0
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +17 -0
- package/dist/js/modules/fields/combobox.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-google-maps.d.ts +64 -0
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-link.d.ts +3 -0
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -0
- package/dist/js/modules/fields/custom-maps.d.ts +3 -0
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -0
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +7 -0
- package/dist/js/utils/country-from-ip.d.ts.map +1 -0
- package/dist/js/utils/field-references.d.ts +1 -0
- package/dist/js/utils/field-references.d.ts.map +1 -1
- package/dist/js/utils/field-references.row-scope.d.ts +11 -0
- package/dist/js/utils/field-references.row-scope.d.ts.map +1 -0
- package/dist/js/utils/i18n.d.ts.map +1 -1
- package/dist/js/validation/rules/email.d.ts.map +1 -1
- package/dist/js/validation/rules/number.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/css/formie-theme.css +2 -0
- package/src/css/theme/fields/_address-state.css +94 -0
- package/src/css/theme/fields/_combobox.css +246 -0
- package/src/css/theme/fields/_select.css +13 -0
- package/src/js/core/create-formie-client.ts +27 -0
- package/src/js/core/field-error-container.ts +39 -0
- package/src/js/core/submit-result-state.ts +12 -2
- package/src/js/core/submit-result-ui.ts +7 -13
- package/src/js/core/validation-focus.ts +117 -0
- package/src/js/modules/address/api.ts +7 -0
- package/src/js/modules/address/constants.ts +82 -2
- package/src/js/modules/address/host.ts +16 -6
- package/src/js/modules/address/loqate.ts +3 -17
- package/src/js/modules/fields/address-country.ts +156 -0
- package/src/js/modules/fields/address-state.ts +946 -0
- package/src/js/modules/fields/calculations.ts +32 -0
- package/src/js/modules/fields/checkbox-radio.ts +21 -15
- package/src/js/modules/fields/combobox.ts +188 -0
- package/src/js/modules/fields/custom-google-maps.ts +416 -0
- package/src/js/modules/fields/custom-link.ts +95 -0
- package/src/js/modules/fields/custom-maps.ts +339 -0
- package/src/js/modules/fields/date-picker.ts +96 -3
- package/src/js/modules/fields/file-upload.ts +12 -9
- package/src/js/modules/fields/index.ts +6 -0
- package/src/js/modules/fields/phone-country.ts +6 -0
- package/src/js/modules/fields/text-limit.ts +87 -22
- package/src/js/submit/pipeline.ts +11 -1
- package/src/js/utils/country-from-ip.ts +54 -0
- package/src/js/utils/field-references.row-scope.ts +303 -0
- package/src/js/utils/field-references.ts +1 -0
- package/src/js/utils/i18n.ts +184 -5
- package/src/js/validation/rules/email.ts +3 -2
- package/src/js/validation/rules/match.ts +2 -2
- package/src/js/validation/rules/minmax.ts +4 -4
- package/src/js/validation/rules/number.ts +9 -5
- package/src/js/validation/rules/pattern.ts +4 -4
- package/src/js/validation/rules/required.ts +1 -1
- package/src/js/validation/rules/url.ts +1 -1
- package/src/js/validation/validator.ts +7 -7
- package/dist/chunks/address-finder-BjMuEiwF.js +0 -37
- package/dist/chunks/bpoint-KudsBCo2.js +0 -26
- package/dist/chunks/calculations-DlGSkQ3W.js +0 -147
- package/dist/chunks/captcha-eu-CterYFok.js +0 -34
- package/dist/chunks/checkbox-radio-CBvgk3hR.js +0 -136
- package/dist/chunks/conditions-DYy1-Hwt.js +0 -459
- package/dist/chunks/date-picker-BlD--zfe.js +0 -4994
- package/dist/chunks/eway-qwc-B5Us.js +0 -74
- package/dist/chunks/file-upload-CIgHrXfp.js +0 -316
- package/dist/chunks/friendly-captcha-v1-EDFac33c.js +0 -33
- package/dist/chunks/friendly-captcha-v2-BDpSvFGR.js +0 -38
- package/dist/chunks/go-cardless-DuDMVsnz.js +0 -24
- package/dist/chunks/google-address-Bmjp01pH.js +0 -181
- package/dist/chunks/hcaptcha-BTQ6An6g.js +0 -56
- package/dist/chunks/hidden-DbPdOxKb.js +0 -31
- package/dist/chunks/index-BEsfee-D.js +0 -1839
- package/dist/chunks/index-BP7Unm5Y.js +0 -863
- package/dist/chunks/index-BcqwpPNE.js +0 -4314
- package/dist/chunks/loqate-BdNGv93o.js +0 -55
- package/dist/chunks/mollie-DFOjTuGX.js +0 -24
- package/dist/chunks/moneris-BbFfl-EL.js +0 -101
- package/dist/chunks/opayo-CmgYa9ya.js +0 -122
- package/dist/chunks/paddle-BUi7w1_o.js +0 -60
- package/dist/chunks/paypal-A-ePfh6k.js +0 -100
- package/dist/chunks/payway-BqFCbhyo.js +0 -56
- package/dist/chunks/phone-country-DPMiqk4L.js +0 -3765
- package/dist/chunks/place-kit-CX7tamAg.js +0 -42
- package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +0 -1299
- package/dist/chunks/recaptcha-enterprise-DxF6cW95.js +0 -71
- package/dist/chunks/recaptcha-shared-DhGcbiaq.js +0 -15
- package/dist/chunks/recaptcha-v2-checkbox-R9EfbZ4k.js +0 -41
- package/dist/chunks/recaptcha-v2-invisible-DV9hswAp.js +0 -59
- package/dist/chunks/recaptcha-v3-V0xc-Edh.js +0 -28
- package/dist/chunks/repeater-DKUT6TGI.js +0 -124
- package/dist/chunks/rich-text-SH7KiaKH.js +0 -304
- package/dist/chunks/scripts-D9N2d5rN.js +0 -36
- package/dist/chunks/sdk-3SicTWby.js +0 -1559
- package/dist/chunks/shared-BmntPmnW.js +0 -80
- package/dist/chunks/signature-BA3tQsGT.js +0 -550
- package/dist/chunks/snaptcha-DV7p6J9k.js +0 -8
- package/dist/chunks/square-Bs-ndqYK.js +0 -46
- package/dist/chunks/stripe-DkZAHxtn.js +0 -202
- package/dist/chunks/styles-C3aqgtek.js +0 -21
- package/dist/chunks/summary-Dq2i9TQk.js +0 -126
- package/dist/chunks/table-Cu4WfVcw.js +0 -95
- package/dist/chunks/text-limit-2ycmB-Ae.js +0 -135
- package/dist/chunks/turnstile-CId90tRr.js +0 -59
- package/dist/chunks/utils-BntI3W4S.js +0 -6149
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { a as i, c as p } from "./index-BcqwpPNE.js";
|
|
2
|
-
import { l } from "./recaptcha-shared-DhGcbiaq.js";
|
|
3
|
-
const y = i({
|
|
4
|
-
id: "recaptcha-enterprise",
|
|
5
|
-
defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
|
|
6
|
-
defaultTokenFieldNames: ["g-recaptcha-response"],
|
|
7
|
-
load: ({ options: t }) => l(
|
|
8
|
-
t.provider,
|
|
9
|
-
!0,
|
|
10
|
-
(t.provider.enterpriseType === "score" || t.provider.enterpriseType === "policy") && t.provider.siteKey || void 0
|
|
11
|
-
),
|
|
12
|
-
mount: ({ api: t, container: s, provider: e, services: a }) => {
|
|
13
|
-
const r = t.enterprise || t;
|
|
14
|
-
return new Promise((c) => {
|
|
15
|
-
r.ready(() => {
|
|
16
|
-
if (e.enterpriseType !== "checkbox") {
|
|
17
|
-
c(e.siteKey || `recaptcha-enterprise-${e.enterpriseType || "score"}`);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
c(r.render(s, {
|
|
21
|
-
sitekey: e.siteKey || "",
|
|
22
|
-
theme: e.theme || "light",
|
|
23
|
-
badge: e.badge || "bottomright",
|
|
24
|
-
size: e.size || "normal",
|
|
25
|
-
action: e.action || "submit",
|
|
26
|
-
callback: (o) => {
|
|
27
|
-
typeof o == "string" && o.trim() !== "" && a.tokens.write(o.trim()), a.errors.clear();
|
|
28
|
-
},
|
|
29
|
-
"expired-callback": () => {
|
|
30
|
-
a.tokens.clear(), a.errors.clear();
|
|
31
|
-
},
|
|
32
|
-
"error-callback": () => {
|
|
33
|
-
a.tokens.clear();
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
screen: async ({ api: t, widget: s, provider: e, placeholder: a, services: r, stageCtx: c }) => {
|
|
40
|
-
const o = t.enterprise || t;
|
|
41
|
-
if (e.enterpriseType === "checkbox") {
|
|
42
|
-
if (r.tokens.has())
|
|
43
|
-
return;
|
|
44
|
-
const n = r.errors.getDefaultMessage();
|
|
45
|
-
r.errors.show(n, a), c.abort(n);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (r.tokens.has())
|
|
49
|
-
return;
|
|
50
|
-
if (e.enterpriseType === "score" || e.enterpriseType === "policy") {
|
|
51
|
-
const n = await o.execute(e.siteKey || "", { action: e.action || "submit" });
|
|
52
|
-
typeof n == "string" && n.trim() !== "" && r.tokens.write(n.trim());
|
|
53
|
-
} else
|
|
54
|
-
o.execute(s);
|
|
55
|
-
if (!await r.tokens.wait(p)) {
|
|
56
|
-
const n = r.errors.getDefaultMessage();
|
|
57
|
-
r.errors.show(n, a), c.abort(n);
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
reset: ({ api: t, widget: s, provider: e, services: a }) => {
|
|
61
|
-
const r = t.enterprise || t;
|
|
62
|
-
e.enterpriseType === "checkbox" && r.reset(s), a.tokens.clear();
|
|
63
|
-
},
|
|
64
|
-
unmount: ({ api: t, widget: s, provider: e, services: a }) => {
|
|
65
|
-
const r = t.enterprise || t;
|
|
66
|
-
e.enterpriseType === "checkbox" && r.reset(s), a.tokens.clear();
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
export {
|
|
70
|
-
y as recaptchaEnterpriseModule
|
|
71
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { l } from "./scripts-D9N2d5rN.js";
|
|
2
|
-
import { b as m, C as o } from "./index-BcqwpPNE.js";
|
|
3
|
-
async function R(t, r = !1, e) {
|
|
4
|
-
const s = typeof t.language == "string" && t.language.trim() !== "" ? t.language.trim() : "en", { async: g, defer: i } = m(t.loadingMethod), n = r ? "https://www.google.com/recaptcha/enterprise.js" : "https://www.recaptcha.net/recaptcha/api.js", c = typeof e == "string" && e.trim() !== "" ? e.trim() : "explicit", a = new URL(n);
|
|
5
|
-
return a.searchParams.set("render", c), a.searchParams.set("hl", s), c !== "explicit" && typeof t.badge == "string" && t.badge.trim() !== "" && a.searchParams.set("badge", t.badge.trim()), l("grecaptcha", {
|
|
6
|
-
id: r ? "FORMIE_RECAPTCHA_ENTERPRISE_SCRIPT" : "FORMIE_RECAPTCHA_SCRIPT",
|
|
7
|
-
src: a.toString(),
|
|
8
|
-
async: g,
|
|
9
|
-
defer: i,
|
|
10
|
-
timeoutMs: o
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
R as l
|
|
15
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { a as c } from "./index-BcqwpPNE.js";
|
|
2
|
-
import { l as s } from "./recaptcha-shared-DhGcbiaq.js";
|
|
3
|
-
const d = c({
|
|
4
|
-
id: "recaptcha-v2-checkbox",
|
|
5
|
-
defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
|
|
6
|
-
defaultTokenFieldNames: ["g-recaptcha-response"],
|
|
7
|
-
load: ({ options: e }) => s(e.provider),
|
|
8
|
-
mount: ({ api: e, container: r, provider: a, services: t }) => new Promise((l) => {
|
|
9
|
-
e.ready(() => {
|
|
10
|
-
l(e.render(r, {
|
|
11
|
-
sitekey: a.siteKey || "",
|
|
12
|
-
theme: a.theme || "light",
|
|
13
|
-
size: a.size || "normal",
|
|
14
|
-
callback: (o) => {
|
|
15
|
-
typeof o == "string" && o.trim() !== "" && t.tokens.write(o.trim()), t.errors.clear();
|
|
16
|
-
},
|
|
17
|
-
"expired-callback": () => {
|
|
18
|
-
t.tokens.clear(), t.errors.clear();
|
|
19
|
-
},
|
|
20
|
-
"error-callback": () => {
|
|
21
|
-
t.tokens.clear();
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
24
|
-
});
|
|
25
|
-
}),
|
|
26
|
-
screen: ({ placeholder: e, services: r, stageCtx: a }) => {
|
|
27
|
-
if (r.tokens.has())
|
|
28
|
-
return;
|
|
29
|
-
const t = r.errors.getDefaultMessage();
|
|
30
|
-
r.errors.show(t, e), a.abort(t);
|
|
31
|
-
},
|
|
32
|
-
reset: ({ api: e, widget: r, services: a }) => {
|
|
33
|
-
e.reset(r), a.tokens.clear();
|
|
34
|
-
},
|
|
35
|
-
unmount: ({ api: e, widget: r, services: a }) => {
|
|
36
|
-
e.reset(r), a.tokens.clear();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
export {
|
|
40
|
-
d as recaptchaV2CheckboxModule
|
|
41
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { a as c, c as l } from "./index-BcqwpPNE.js";
|
|
2
|
-
import { l as d } from "./recaptcha-shared-DhGcbiaq.js";
|
|
3
|
-
async function p(e, o, r = 1e3) {
|
|
4
|
-
const t = Date.now() + r;
|
|
5
|
-
for (; Date.now() < t; ) {
|
|
6
|
-
const n = typeof e.getResponse == "function" ? e.getResponse(o) : "";
|
|
7
|
-
if (typeof n == "string" && n.trim() !== "")
|
|
8
|
-
return n.trim();
|
|
9
|
-
await new Promise((a) => {
|
|
10
|
-
window.setTimeout(a, 100);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const u = c({
|
|
15
|
-
id: "recaptcha-v2-invisible",
|
|
16
|
-
defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
|
|
17
|
-
defaultTokenFieldNames: ["g-recaptcha-response"],
|
|
18
|
-
load: ({ options: e }) => d(e.provider),
|
|
19
|
-
mount: ({ api: e, container: o, provider: r, services: t }) => new Promise((n) => {
|
|
20
|
-
e.ready(() => {
|
|
21
|
-
const a = e.render(o, {
|
|
22
|
-
sitekey: r.siteKey || "",
|
|
23
|
-
badge: r.badge || "bottomright",
|
|
24
|
-
size: "invisible",
|
|
25
|
-
callback: (i) => {
|
|
26
|
-
const s = typeof i == "string" && i.trim() !== "" ? i.trim() : typeof e.getResponse == "function" ? e.getResponse(a) : "";
|
|
27
|
-
s && t.tokens.write(s), t.errors.clear();
|
|
28
|
-
},
|
|
29
|
-
"expired-callback": () => {
|
|
30
|
-
t.tokens.clear(), t.errors.clear();
|
|
31
|
-
},
|
|
32
|
-
"error-callback": () => {
|
|
33
|
-
t.tokens.clear();
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
n({
|
|
37
|
-
// Keep the widget id in a tiny object so later lifecycle
|
|
38
|
-
// methods have a stable shape to work with.
|
|
39
|
-
id: a
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}),
|
|
43
|
-
screen: async ({ api: e, widget: o, placeholder: r, services: t, stageCtx: n }) => {
|
|
44
|
-
if (t.tokens.has())
|
|
45
|
-
return;
|
|
46
|
-
e.execute(o.id);
|
|
47
|
-
const a = await p(e, o.id);
|
|
48
|
-
if (typeof a == "string" && a.trim() !== "" && t.tokens.write(a.trim()), !await t.tokens.wait(l)) {
|
|
49
|
-
const s = t.errors.getDefaultMessage();
|
|
50
|
-
t.errors.show(s, r), n.abort(s);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
unmount: ({ api: e, widget: o, services: r }) => {
|
|
54
|
-
e.reset(o.id), r.tokens.clear();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
export {
|
|
58
|
-
u as recaptchaV2InvisibleModule
|
|
59
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { a as c, c as i } from "./index-BcqwpPNE.js";
|
|
2
|
-
import { l } from "./recaptcha-shared-DhGcbiaq.js";
|
|
3
|
-
const u = c({
|
|
4
|
-
id: "recaptcha-v3",
|
|
5
|
-
defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
|
|
6
|
-
defaultTokenFieldNames: ["g-recaptcha-response"],
|
|
7
|
-
load: ({ options: e }) => l(e.provider, !1, e.provider.siteKey || void 0),
|
|
8
|
-
mount: ({ api: e, provider: t }) => new Promise((o) => {
|
|
9
|
-
e.ready(() => {
|
|
10
|
-
o(t.siteKey || "recaptcha-v3");
|
|
11
|
-
});
|
|
12
|
-
}),
|
|
13
|
-
screen: async ({ api: e, provider: t, placeholder: o, services: a, stageCtx: s }) => {
|
|
14
|
-
if (a.tokens.has())
|
|
15
|
-
return;
|
|
16
|
-
const r = await e.execute(t.siteKey || "", { action: t.action || "submit" });
|
|
17
|
-
if (typeof r == "string" && r.trim() !== "" && a.tokens.write(r.trim()), !await a.tokens.wait(i)) {
|
|
18
|
-
const n = a.errors.getDefaultMessage();
|
|
19
|
-
a.errors.show(n, o), s.abort(n);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
unmount: ({ services: e }) => {
|
|
23
|
-
e.tokens.clear();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
u as recaptchaV3Module
|
|
28
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { d as p, b as L, c as y } from "./shared-BmntPmnW.js";
|
|
2
|
-
import { e as M } from "./styles-C3aqgtek.js";
|
|
3
|
-
import { h as k, s as A } from "./index-BcqwpPNE.js";
|
|
4
|
-
const R = '@layer formie-theme{.formie-repeater-container{display:grid;gap:var(--formie-space-4)}.formie-repeater-item-wrapper{position:relative;display:grid;gap:var(--formie-space-4);padding:var(--formie-space-4);border:var(--formie-border-width) solid var(--formie-color-border);border-radius:var(--formie-radius-md);transition:border-color .15s ease,box-shadow .15s ease,background-color .15s ease}.formie-repeater-item-wrapper:focus-within{border-color:var(--formie-focus-ring-border-color);box-shadow:var(--formie-shadow-focus)}.formie-field-has-error .formie-repeater-item-wrapper{border-color:var(--formie-color-danger)}.formie-field-has-error .formie-repeater-item-wrapper:focus-within{box-shadow:var(--formie-shadow-danger-focus)}.formie-repeater-item-wrapper>.formie-repeater-remove-button{position:absolute;top:var(--formie-repeater-remove-button-top);right:var(--formie-repeater-remove-button-right);transform:var(--formie-repeater-remove-button-transform);font-size:0;line-height:0}.formie-button.formie-repeater-add-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:auto;max-width:100%;justify-self:start;padding-left:var(--formie-repeater-add-button-padding-left)}.formie-button.formie-repeater-add-button:before{position:absolute;content:"";display:block;width:var(--formie-repeater-add-button-width);height:var(--formie-repeater-add-button-height);left:var(--formie-repeater-add-button-left);top:50%;transform:translateY(-50%);background-color:currentColor;-webkit-mask-image:var(--formie-repeater-add-button-icon-mask);mask-image:var(--formie-repeater-add-button-icon-mask);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}}', u = "[data-formie-repeater-field-layout]", v = "[data-formie-repeater-container]", g = "[data-formie-repeater-item]", C = "[data-formie-repeater-add]", H = "[data-formie-repeater-remove]", E = "data-formie-template-id", l = "repeater", s = k("fields", "repeater");
|
|
5
|
-
M(l, [R]);
|
|
6
|
-
function S(e, o) {
|
|
7
|
-
return y(e, o);
|
|
8
|
-
}
|
|
9
|
-
function _(e, o) {
|
|
10
|
-
const t = document.createElement("div");
|
|
11
|
-
return t.innerHTML = e.replaceAll("__ROW__", String(o)).trim(), t.firstElementChild instanceof HTMLElement ? t.firstElementChild : null;
|
|
12
|
-
}
|
|
13
|
-
function i(e) {
|
|
14
|
-
return e.querySelectorAll(g).length;
|
|
15
|
-
}
|
|
16
|
-
function f(e, o) {
|
|
17
|
-
if (!e)
|
|
18
|
-
return;
|
|
19
|
-
const t = parseInt(e.getAttribute("data-formie-max-rows") || "", 10);
|
|
20
|
-
if (t > 0 && o >= t) {
|
|
21
|
-
e.disabled = !0;
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
e.disabled = !1;
|
|
25
|
-
}
|
|
26
|
-
function I(e) {
|
|
27
|
-
const o = e.matches(v) ? e : e.querySelector(v), t = e.querySelector(C);
|
|
28
|
-
if (!(o instanceof HTMLElement))
|
|
29
|
-
return s.warn("Missing repeater container; skipping field."), () => {
|
|
30
|
-
};
|
|
31
|
-
const n = /* @__PURE__ */ new Map();
|
|
32
|
-
let T = Array.from(e.querySelectorAll(g)).reduce((r, a) => {
|
|
33
|
-
const m = parseInt(a.getAttribute("data-formie-repeater-item-id") || "", 10);
|
|
34
|
-
return Number.isNaN(m) ? r : Math.max(r, m + 1);
|
|
35
|
-
}, 0);
|
|
36
|
-
const w = () => {
|
|
37
|
-
e.querySelectorAll(H).forEach((r) => {
|
|
38
|
-
if (!(r instanceof HTMLElement) || n.has(r))
|
|
39
|
-
return;
|
|
40
|
-
const a = (m) => {
|
|
41
|
-
m.preventDefault();
|
|
42
|
-
const c = r.closest(g);
|
|
43
|
-
if (!(c instanceof HTMLElement))
|
|
44
|
-
return;
|
|
45
|
-
const d = parseInt((t instanceof HTMLButtonElement ? t.getAttribute("data-formie-min-rows") : "") || "", 10);
|
|
46
|
-
d > 0 && i(e) <= d || (c.remove(), f(t instanceof HTMLButtonElement ? t : null, i(e)), s.log("Row removed.", {
|
|
47
|
-
rowCount: i(e)
|
|
48
|
-
}), p(e, l, "remove", {
|
|
49
|
-
repeater: e,
|
|
50
|
-
row: c
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
r.addEventListener("click", a), n.set(r, a);
|
|
54
|
-
});
|
|
55
|
-
}, b = async () => {
|
|
56
|
-
if (!(t instanceof HTMLButtonElement))
|
|
57
|
-
return;
|
|
58
|
-
const r = t.getAttribute("data-formie-repeater-add");
|
|
59
|
-
if (!r) {
|
|
60
|
-
s.warn("Add handle missing.");
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const a = t.getAttribute(E) || e.getAttribute(E), m = parseInt(t.getAttribute("data-formie-max-rows") || "", 10);
|
|
64
|
-
if (m > 0 && i(e) >= m)
|
|
65
|
-
return;
|
|
66
|
-
const c = S(e, a);
|
|
67
|
-
if (!c) {
|
|
68
|
-
s.warn("Template not found for add action.", { handle: r });
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const d = _(L(c), T++);
|
|
72
|
-
if (!d) {
|
|
73
|
-
s.warn("Failed to build row from template.");
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
o.appendChild(d), await A(50), w(), f(t, i(e)), s.log("Row appended.", {
|
|
77
|
-
rowCount: i(e)
|
|
78
|
-
}), p(e, l, "append", {
|
|
79
|
-
repeater: e,
|
|
80
|
-
row: d
|
|
81
|
-
}), p(e, l, "init-row", {
|
|
82
|
-
repeater: e,
|
|
83
|
-
row: d
|
|
84
|
-
});
|
|
85
|
-
}, h = (r) => {
|
|
86
|
-
r.preventDefault(), b();
|
|
87
|
-
};
|
|
88
|
-
if (t instanceof HTMLButtonElement && t.addEventListener("click", h), w(), f(t instanceof HTMLButtonElement ? t : null, i(e)), t instanceof HTMLButtonElement && i(e) === 0) {
|
|
89
|
-
const r = parseInt(t.getAttribute("data-formie-min-rows") || "", 10);
|
|
90
|
-
for (let a = 0; a < r; a += 1)
|
|
91
|
-
b();
|
|
92
|
-
}
|
|
93
|
-
return p(e, l, "init", {
|
|
94
|
-
repeater: e
|
|
95
|
-
}), s.log("Field initialized.", {
|
|
96
|
-
rowCount: i(e)
|
|
97
|
-
}), () => {
|
|
98
|
-
t instanceof HTMLButtonElement && t.removeEventListener("click", h), n.forEach((r, a) => {
|
|
99
|
-
a.removeEventListener("click", r);
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const q = {
|
|
104
|
-
id: l,
|
|
105
|
-
kind: "field",
|
|
106
|
-
match: (e) => e.target instanceof HTMLElement && (e.target.matches(u) || !!e.target.querySelector(u)),
|
|
107
|
-
setup: async (e) => {
|
|
108
|
-
if (!(e.target instanceof HTMLElement))
|
|
109
|
-
return;
|
|
110
|
-
const o = e.target.matches(u) ? [e.target] : Array.from(e.target.querySelectorAll(u)).filter((n) => n instanceof HTMLElement), t = o.map((n) => I(n));
|
|
111
|
-
return s.log("Module setup.", { fieldCount: o.length }), await e.emit("formie:module:repeater:init", {
|
|
112
|
-
count: o.length
|
|
113
|
-
}), {
|
|
114
|
-
destroy: () => {
|
|
115
|
-
t.forEach((n) => {
|
|
116
|
-
n();
|
|
117
|
-
}), s.log("Module destroy.", { fieldCount: o.length }), e.emit("formie:module:repeater:destroy", {});
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
export {
|
|
123
|
-
q as repeaterModule
|
|
124
|
-
};
|