@verbb/formie-browser 1.0.12 → 1.0.14
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 +57 -0
- package/dist/chunks/{address-country-Rx6GQTND.js → address-country-Dn71jroa.js} +10 -4
- package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-O49uDRoR.js} +2 -2
- package/dist/chunks/{address-state-BwE01m2_.js → address-state-ByYatUur.js} +154 -143
- package/dist/chunks/{api-DqpfkZWL.js → api-D6kJ7kXZ.js} +183 -179
- package/dist/chunks/{api-BUb6P-xu.js → api-DYYsVIub.js} +77 -47
- package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
- package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-D0RKFM4F.js} +3 -3
- package/dist/chunks/calculations-YEoVCG2q.js +310 -0
- package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DERJbXnH.js} +5 -4
- package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
- package/dist/chunks/{combobox-C0EuExSI.js → combobox-CWNdx4Fk.js} +290 -279
- package/dist/chunks/conditions-DqNHLTbN.js +464 -0
- package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
- package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
- package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
- package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
- package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
- package/dist/chunks/{date-picker-5CA_-zGb.js → date-picker-RUnevF7l.js} +456 -430
- package/dist/chunks/{dist-BdUy8m_p.js → dist-ZLeW0zZ3.js} +1280 -452
- package/dist/chunks/{eway-D9_m8ooj.js → eway-or6dtjoT.js} +3 -3
- package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
- package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-Bm-TXyNB.js} +104 -96
- package/dist/chunks/friendly-captcha-v1-GFqCt1Mh.js +34 -0
- package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-WoW246JG.js} +6 -5
- package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
- package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-DzJ-0FKg.js} +2 -2
- package/dist/chunks/google-address-C1P1nTDM.js +163 -0
- package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-D0T8aIHz.js} +3 -3
- package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
- package/dist/chunks/http-C2QdHuWO.js +27 -0
- package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
- package/dist/chunks/{loqate-CJPzBmSm.js → loqate-DD1S7PY9.js} +2 -2
- package/dist/chunks/{mollie-Bibhl67p.js → mollie-DG8Ju83x.js} +2 -2
- package/dist/chunks/{moneris-H2wSqk9h.js → moneris-C8m3Fvqu.js} +3 -3
- package/dist/chunks/opayo-B3EvrVxw.js +188 -0
- package/dist/chunks/{paddle-DkvIxQdG.js → paddle-BIYR9Um3.js} +3 -3
- package/dist/chunks/{password-validation-T0vDQPCr.js → password-validation-C8_uO_c_.js} +18 -12
- package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-B_yxIo2d.js} +7 -5
- package/dist/chunks/{payway-CwDkC7YZ.js → payway-CeOzS0sL.js} +3 -3
- package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-bAqje17P.js} +80 -63
- package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BE5gi3vo.js} +3 -3
- package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
- package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CruXddZq.js} +4 -4
- package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-AQRMDMme.js} +1 -1
- package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-CCnJYCnG.js} +4 -4
- package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-BuVqRRYn.js} +4 -4
- package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CloqhO2A.js} +4 -4
- package/dist/chunks/{repeater-BVnPUqTj.js → repeater-DwE27jI1.js} +25 -19
- package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
- package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
- package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
- package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
- package/dist/chunks/{signature-xz4QO7CR.js → signature-7cldFbqj.js} +160 -112
- package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C04kNGYQ.js} +2 -2
- package/dist/chunks/{square-DwdcOI1G.js → square-DEzxv9D9.js} +8 -6
- package/dist/chunks/{stripe-DaoG2FT1.js → stripe-CVPQGDz3.js} +10 -11
- package/dist/chunks/{summary-Dks0gXS3.js → summary-BF_8mrXI.js} +47 -45
- package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
- package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
- package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
- package/dist/chunks/{table-CAjCJHrL.js → table-DnIBdeKF.js} +21 -15
- package/dist/chunks/{text-limit-Bn18WrPU.js → text-limit-LGMPhFuC.js} +40 -34
- package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
- package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-n9DNyPxi.js} +3 -3
- package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BbiUosZq.js} +410 -350
- package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
- package/dist/css/formie-base.css +104 -1
- package/dist/css/theme/_messages.css +2 -0
- package/dist/css/theme/_tokens.css +31 -25
- package/dist/css/theme/fields/_signature.css +2 -1
- package/dist/css/theme/forms/_form.css +5 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1778 -1425
- package/dist/js/contracts/client.d.ts +5 -3
- package/dist/js/contracts/client.d.ts.map +1 -1
- package/dist/js/contracts/common.d.ts +2 -2
- package/dist/js/contracts/common.d.ts.map +1 -1
- package/dist/js/contracts/modules.d.ts +37 -12
- package/dist/js/contracts/modules.d.ts.map +1 -1
- package/dist/js/contracts/schema.d.ts +20 -38
- package/dist/js/contracts/schema.d.ts.map +1 -1
- package/dist/js/contracts/theme.d.ts +4 -1
- package/dist/js/contracts/theme.d.ts.map +1 -1
- package/dist/js/core/client-rendered-modules.d.ts +17 -0
- package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/field-error-aria.d.ts +23 -0
- package/dist/js/core/field-error-aria.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +10 -8
- package/dist/js/core/hydrate-modules.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/js/modules/address/address-finder.d.ts +1 -1
- package/dist/js/modules/address/address-finder.d.ts.map +1 -1
- package/dist/js/modules/address/factories.d.ts +3 -3
- package/dist/js/modules/address/factories.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +2 -1
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/index.d.ts +2 -2
- package/dist/js/modules/address/index.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts +11 -11
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/index.d.ts +2 -2
- package/dist/js/modules/captchas/index.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +2 -2
- package/dist/js/modules/fields/address-country.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts +2 -2
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/calculations.d.ts +2 -2
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +2 -2
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
- package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +3 -1
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts +2 -2
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-link.d.ts +2 -2
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts +2 -2
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts +2 -2
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/hidden.d.ts +2 -2
- package/dist/js/modules/fields/hidden.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts +2 -2
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/password-validation.d.ts +2 -2
- package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts +2 -2
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts +2 -2
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/rich-text.d.ts +2 -2
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
- package/dist/js/modules/fields/shared.d.ts +1 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts +2 -2
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts +2 -2
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-likert.d.ts +2 -2
- package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rank.d.ts +2 -2
- package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rating.d.ts +2 -2
- package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
- package/dist/js/modules/fields/table.d.ts +2 -2
- package/dist/js/modules/fields/table.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts +2 -2
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +2 -2
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/modules/loader.d.ts +10 -4
- package/dist/js/modules/loader.d.ts.map +1 -1
- package/dist/js/modules/payments/bpoint.d.ts +1 -1
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
- package/dist/js/modules/payments/eway.d.ts +1 -1
- package/dist/js/modules/payments/eway.d.ts.map +1 -1
- package/dist/js/modules/payments/factories.d.ts +7 -7
- package/dist/js/modules/payments/factories.d.ts.map +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
- package/dist/js/modules/payments/index.d.ts +2 -2
- package/dist/js/modules/payments/index.d.ts.map +1 -1
- package/dist/js/modules/payments/mollie.d.ts +1 -1
- package/dist/js/modules/payments/mollie.d.ts.map +1 -1
- package/dist/js/modules/payments/moneris.d.ts +1 -1
- package/dist/js/modules/payments/moneris.d.ts.map +1 -1
- package/dist/js/modules/payments/opayo.d.ts +1 -1
- package/dist/js/modules/payments/opayo.d.ts.map +1 -1
- package/dist/js/modules/payments/paddle.d.ts +1 -1
- package/dist/js/modules/payments/paddle.d.ts.map +1 -1
- package/dist/js/modules/payments/paypal.d.ts +1 -1
- package/dist/js/modules/payments/paypal.d.ts.map +1 -1
- package/dist/js/modules/payments/payway.d.ts +1 -1
- package/dist/js/modules/payments/payway.d.ts.map +1 -1
- package/dist/js/modules/payments/square.d.ts +1 -1
- package/dist/js/modules/payments/square.d.ts.map +1 -1
- package/dist/js/modules/payments/stripe.d.ts +1 -1
- package/dist/js/modules/payments/stripe.d.ts.map +1 -1
- package/dist/js/modules/payments/utils.d.ts +6 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -1
- package/dist/js/modules/registry.d.ts +6 -4
- package/dist/js/modules/registry.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
- package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +3 -3
- package/dist/js/theme/theme-classes.d.ts.map +1 -1
- package/dist/js/transport/forms-api.d.ts +5 -3
- package/dist/js/transport/forms-api.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +2 -2
- package/dist/js/utils/country-from-ip.d.ts.map +1 -1
- package/dist/js/utils/csrf.d.ts +17 -0
- package/dist/js/utils/csrf.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +1 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -1
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
- package/dist/js/utils/field-references.types.d.ts +1 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -1
- package/dist/js/utils/http.d.ts +3 -1
- package/dist/js/utils/http.d.ts.map +1 -1
- package/dist/js/utils/request-profile.d.ts +4 -0
- package/dist/js/utils/request-profile.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/rules/email.d.ts.map +1 -1
- package/dist/js/validation/rules/match.d.ts.map +1 -1
- package/dist/js/validation/rules/number.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/rules/shared.d.ts.map +1 -1
- package/dist/js/validation/rules/url.d.ts.map +1 -1
- package/dist/js/validation/skip.d.ts +7 -0
- package/dist/js/validation/skip.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +43 -12
- package/src/css/formie-base.css +104 -1
- package/src/css/theme/_messages.css +2 -0
- package/src/css/theme/_tokens.css +31 -25
- package/src/css/theme/fields/_signature.css +2 -1
- package/src/css/theme/forms/_form.css +5 -1
- package/src/index.ts +13 -8
- package/src/js/contracts/client.ts +5 -3
- package/src/js/contracts/common.ts +5 -6
- package/src/js/contracts/modules.ts +41 -12
- package/src/js/contracts/schema.ts +21 -43
- package/src/js/contracts/theme.ts +6 -1
- package/src/js/core/client-rendered-modules.ts +69 -0
- package/src/js/core/create-formie-client.ts +119 -73
- package/src/js/core/field-error-aria.ts +93 -0
- package/src/js/core/hydrate-modules.ts +54 -29
- package/src/js/core/submit-result-state.ts +34 -45
- package/src/js/core/submit-result-ui.ts +21 -65
- package/src/js/core/validation-focus.ts +20 -20
- package/src/js/modules/address/address-finder.ts +1 -1
- package/src/js/modules/address/factories.ts +15 -13
- package/src/js/modules/address/google-address.ts +10 -6
- package/src/js/modules/address/index.ts +2 -2
- package/src/js/modules/address/loqate.ts +1 -1
- package/src/js/modules/address/place-kit.ts +1 -1
- package/src/js/modules/captchas/captcha-eu.ts +2 -2
- package/src/js/modules/captchas/factories.ts +66 -42
- package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
- package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
- package/src/js/modules/captchas/hcaptcha.ts +5 -5
- package/src/js/modules/captchas/index.ts +2 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
- package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
- package/src/js/modules/captchas/snaptcha.ts +1 -1
- package/src/js/modules/captchas/turnstile.ts +3 -3
- package/src/js/modules/fields/address-country.ts +6 -4
- package/src/js/modules/fields/address-state.ts +20 -12
- package/src/js/modules/fields/calculations.ts +5 -3
- package/src/js/modules/fields/checkbox-radio.ts +24 -42
- package/src/js/modules/fields/combobox.ts +25 -9
- package/src/js/modules/fields/conditions/config.ts +17 -20
- package/src/js/modules/fields/conditions/effects.ts +23 -26
- package/src/js/modules/fields/conditions/evaluator.ts +21 -29
- package/src/js/modules/fields/conditions/references.ts +16 -5
- package/src/js/modules/fields/conditions/submission-context.ts +80 -0
- package/src/js/modules/fields/conditions/types.ts +3 -1
- package/src/js/modules/fields/conditions/values.ts +31 -6
- package/src/js/modules/fields/conditions.ts +59 -18
- package/src/js/modules/fields/custom-google-maps.ts +5 -3
- package/src/js/modules/fields/custom-link.ts +5 -3
- package/src/js/modules/fields/custom-maps.ts +5 -3
- package/src/js/modules/fields/date-picker.ts +40 -4
- package/src/js/modules/fields/file-upload.ts +19 -10
- package/src/js/modules/fields/hidden.ts +5 -3
- package/src/js/modules/fields/index.ts +2 -2
- package/src/js/modules/fields/password-validation.ts +5 -3
- package/src/js/modules/fields/phone-country.ts +33 -6
- package/src/js/modules/fields/repeater.ts +5 -3
- package/src/js/modules/fields/rich-text.ts +20 -4
- package/src/js/modules/fields/shared.ts +13 -0
- package/src/js/modules/fields/signature.ts +64 -6
- package/src/js/modules/fields/summary.ts +8 -20
- package/src/js/modules/fields/survey-likert.ts +5 -3
- package/src/js/modules/fields/survey-rank.ts +21 -3
- package/src/js/modules/fields/survey-rating.ts +17 -3
- package/src/js/modules/fields/table.ts +5 -3
- package/src/js/modules/fields/text-limit.ts +5 -3
- package/src/js/modules/fields/upload-manager.ts +190 -49
- package/src/js/modules/loader.ts +345 -281
- package/src/js/modules/payments/bpoint.ts +2 -2
- package/src/js/modules/payments/eway.ts +2 -2
- package/src/js/modules/payments/factories.ts +53 -52
- package/src/js/modules/payments/go-cardless.ts +1 -1
- package/src/js/modules/payments/index.ts +2 -2
- package/src/js/modules/payments/mollie.ts +1 -1
- package/src/js/modules/payments/moneris.ts +2 -2
- package/src/js/modules/payments/opayo.ts +21 -8
- package/src/js/modules/payments/paddle.ts +10 -6
- package/src/js/modules/payments/payment.ts +22 -18
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +2 -2
- package/src/js/modules/payments/square.ts +2 -2
- package/src/js/modules/payments/stripe.ts +5 -5
- package/src/js/modules/payments/utils.ts +14 -0
- package/src/js/modules/registry.ts +19 -11
- package/src/js/submit/pipeline.ts +10 -11
- package/src/js/theme/browser-theme-state.generated.ts +25 -0
- package/src/js/theme/theme-classes.ts +3 -3
- package/src/js/transport/forms-api.ts +66 -67
- package/src/js/utils/country-from-ip.ts +14 -9
- package/src/js/utils/csrf.ts +136 -0
- package/src/js/utils/field-references.parser.ts +13 -113
- package/src/js/utils/field-references.resolver.ts +27 -64
- package/src/js/utils/field-references.row-scope.ts +1 -1
- package/src/js/utils/field-references.types.ts +1 -0
- package/src/js/utils/http.ts +5 -5
- package/src/js/utils/request-profile.ts +10 -0
- package/src/js/utils/unload-warning.ts +12 -4
- package/src/js/validation/rules/email.ts +3 -5
- package/src/js/validation/rules/match.ts +2 -1
- package/src/js/validation/rules/minmax.ts +4 -43
- package/src/js/validation/rules/number.ts +3 -47
- package/src/js/validation/rules/pattern.ts +3 -8
- package/src/js/validation/rules/required.ts +2 -1
- package/src/js/validation/rules/shared.ts +5 -1
- package/src/js/validation/rules/url.ts +3 -10
- package/src/js/validation/skip.ts +9 -0
- package/src/js/validation/submit-readiness.ts +9 -2
- package/src/js/validation/validator.ts +35 -59
- package/dist/chunks/calculations-DERi2xaC.js +0 -299
- package/dist/chunks/conditions-65kBcFWW.js +0 -424
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
- package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
- package/dist/chunks/google-address-BH3Zhi06.js +0 -161
- package/dist/chunks/http-D-JExro7.js +0 -27
- package/dist/chunks/opayo-CR0DtsLa.js +0 -179
- package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
- package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
- package/src/js/modules/fields/conditions/transforms.ts +0 -206
- package/src/js/modules/payments/stub-payment-module.ts +0 -87
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.0.14 - 2026-10-08
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Add a `formie:field:clear` event for custom controls to clear their values when conditions hide a field or page.
|
|
9
|
+
- Add one generated browser-theme state manifest and canonical state classes for browser-created controls.
|
|
10
|
+
- Add `data-formie-validation-skip` so helper controls (such as the Upload Manager browse input) can opt out of client-side validation.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Use Tailwind's Rose palette for the default danger theme colors.
|
|
14
|
+
- Use Tailwind's Emerald palette for the default success theme colors.
|
|
15
|
+
- Add themeable borders to success and error form messages.
|
|
16
|
+
- Consume canonical payment actions and domain status independently from completion redirects, retaining the Formie 3 response facade.
|
|
17
|
+
- Expose mounted instances and current failures as a structured hydration report, separately from runtime lifecycle controls.
|
|
18
|
+
- Consume canonical completion data attributes and response fields while retaining Formie 3 markup and response fallbacks.
|
|
19
|
+
- Resolve surface-specific browser-module manifests by exact occurrence key, pass the exact rendering surface to match and setup hooks, and expose stable `beforeSubmit` and `afterSubmit` lifecycle hooks instead of internal pipeline stages.
|
|
20
|
+
- Read the bounded `data-formie-theme-classes` contract, stop posting executable theme config during Summary refreshes, and keep client-rendered forms responsible for their own markup.
|
|
21
|
+
- Split required `formie-base.css` behaviour from optional `formie-theme.css` visuals while retaining combined `formie.css`.
|
|
22
|
+
- Share versioned tri-state conditions and plain-text validation rules across PHP and browser consumers; enforce recursive hidden-value clearing and server-authoritative navigation.
|
|
23
|
+
- Preserve exact nested submission error paths, return typed page-transition results, and distinguish skipped side effects from invalid condition configuration.
|
|
24
|
+
- Consume the shared completion outcome and preserve the server-owned configuration and query-prefill boundary.
|
|
25
|
+
- Resolve trusted versioned browser modules, reconcile occurrence lifecycles and failures, and restrict full form mounts to server-rendered HTML.
|
|
26
|
+
- Share reference parsing with the Variable Picker and diagnose unavailable browser references.
|
|
27
|
+
- Initialize Opayo through its CSRF-protected payment-session endpoint and display unknown payment outcomes as awaiting reconciliation.
|
|
28
|
+
- Use browser-bound creation plus separate view, delete and attach capabilities for Upload Manager assets, and submit staged files as structured upload references instead of authoritative asset IDs.
|
|
29
|
+
- Carry expected submission versions and signed request tokens through submit and page-state requests.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- Fixed successful front-end submission edits showing an unsaved-changes warning when leaving the page.
|
|
33
|
+
- Fixed saved uploads being cleared when opening a submission for editing or resuming.
|
|
34
|
+
- Fixed conditional Date/Time fields failing to initialize when shown again.
|
|
35
|
+
- Fixed conditionally hidden date and signature fields retaining their previous values.
|
|
36
|
+
- Fixed browser module errors repeatedly updating the page and making forms unresponsive.
|
|
37
|
+
- Fixed unchecked checkbox groups being treated as nonempty by browser conditions.
|
|
38
|
+
- Fixed empty searchable multi-select fields being treated as filled by conditions.
|
|
39
|
+
- Fixed date pickers retaining a submitted date after their visible input reset.
|
|
40
|
+
- Fixed signatures carrying over into a new submission after a form reset.
|
|
41
|
+
- Fixed searchable Dropdown fields showing a stale selection after a form reset.
|
|
42
|
+
- Fixed checkbox, radio, rich-text, rating, and rank fields retaining stale values or display state after a form reset.
|
|
43
|
+
- Fixed “Disable Submit Button Until Valid” being ignored on server-rendered forms and repeatedly updating disabled buttons.
|
|
44
|
+
- Fixed successful AJAX redirects triggering an unsaved-changes warning.
|
|
45
|
+
- Fixed refreshed upload tokens triggering an unsaved-changes warning after a successful form submission.
|
|
46
|
+
- Fix TypeScript declaration imports when the npm packages are installed outside the Formie workspace.
|
|
47
|
+
- Present required browser-module failures as accessible alerts with collapsed, copyable technical details, while keeping raw exception details restricted to Craft's authenticated submission editor.
|
|
48
|
+
- Let the persistent field error region own announcements without reserving empty layout space or overriding its configured priority with nested assertive alerts. ([#2954](https://github.com/verbb/formie/issues/2954))
|
|
49
|
+
- Keep Stripe checkout amounts aligned with server rounding and UGX currency conversion.
|
|
50
|
+
- Open Paddle checkout using the transaction created by the server.
|
|
51
|
+
- Refresh cached form tokens when Twig emits the static-cache attribute without a value.
|
|
52
|
+
- Fix required File Upload fields using Upload Manager never passing client-side validation after a successful upload. ([#2924](https://github.com/verbb/formie/issues/2924))
|
|
53
|
+
- Fix Advanced Upload Manager and form transport helpers hard-coding `CRAFT_CSRF_TOKEN`, so uploads and related XHR requests work when Craft’s `csrfTokenName` is customised.
|
|
54
|
+
|
|
55
|
+
## 1.0.13 - 2026-07-09
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
- Fix Signature field canvas height preserving the stored PNG aspect ratio when restoring values or resizing, so signatures are not vertically stretched.
|
|
59
|
+
- Fix Date/Time calendar fields not using an existing input value as the Flatpickr default date on init.
|
|
60
|
+
- Fix false unload warnings after front-end form init by resetting dirty state once captcha/token hydration and field modules have settled.
|
|
61
|
+
|
|
5
62
|
## 1.0.12 - 2026-07-02
|
|
6
63
|
|
|
7
64
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./debug-BV0DvdHx.js";
|
|
2
2
|
import { i as t, n } from "./constants-DVcJAvc5.js";
|
|
3
|
-
import { r } from "./shared-
|
|
4
|
-
import { n as i } from "./country-from-ip-
|
|
3
|
+
import { i as r } from "./shared-OKhSay59.js";
|
|
4
|
+
import { n as i } from "./country-from-ip-DDj_mFki.js";
|
|
5
5
|
//#region src/js/modules/fields/address-country.ts
|
|
6
6
|
var a = "address-country", o = n.country, s = e("fields", "address-country");
|
|
7
7
|
function c(e, t, n) {
|
|
@@ -35,7 +35,7 @@ async function f(e, n) {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
if (r.value.trim()) return;
|
|
38
|
-
let a = await i(n.countryFromIpAction);
|
|
38
|
+
let a = await i(n.countryFromIpAction, e.closest("form"));
|
|
39
39
|
if (!a?.countryCode) return;
|
|
40
40
|
if (!l(a.countryCode, n.countryAllowed)) {
|
|
41
41
|
s.log("Detected country is not in the allowed list; skipping preselect.", { countryCode: a.countryCode });
|
|
@@ -49,7 +49,13 @@ async function f(e, n) {
|
|
|
49
49
|
await d(r, f), s.log("Preselected country from IP.", { selectValue: f });
|
|
50
50
|
}
|
|
51
51
|
var p = {
|
|
52
|
-
|
|
52
|
+
moduleId: `formie:${a}`,
|
|
53
|
+
version: 2,
|
|
54
|
+
surfaces: [
|
|
55
|
+
"server-rendered",
|
|
56
|
+
"client-rendered",
|
|
57
|
+
"cp-edit"
|
|
58
|
+
],
|
|
53
59
|
kind: "field",
|
|
54
60
|
match: (e) => !!e.target.querySelector(o),
|
|
55
61
|
setup: async (e) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as e } from "./event-names-BCI2FLD8.js";
|
|
2
|
-
import { t } from "./api-
|
|
2
|
+
import { t } from "./api-ghNr2uxX.js";
|
|
3
3
|
import { r as n } from "./scripts-CbQ7agX3.js";
|
|
4
4
|
//#region src/js/modules/address/address-finder.ts
|
|
5
5
|
var r = "FORMIE_ADDRESS_FINDER_SCRIPT", i = t({
|
|
6
|
-
|
|
6
|
+
moduleId: "formie:address-finder",
|
|
7
7
|
load: async () => n("AddressFinder", {
|
|
8
8
|
id: r,
|
|
9
9
|
src: "https://api.addressfinder.io/assets/v3/widget.js",
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "./request-profile-DhwkeCpS.js";
|
|
2
|
+
import { t } from "./dist-ZLeW0zZ3.js";
|
|
3
|
+
import { t as n } from "./debug-BV0DvdHx.js";
|
|
4
|
+
import { a as r, n as i } from "./theme-classes-DAQuEqdP.js";
|
|
5
|
+
import { n as a } from "./constants-DVcJAvc5.js";
|
|
6
|
+
import { i as o, n as s } from "./shared-OKhSay59.js";
|
|
7
|
+
import { initFormieCombobox as c } from "./combobox-CWNdx4Fk.js";
|
|
5
8
|
//#region src/js/modules/fields/address-state.ts
|
|
6
|
-
var
|
|
9
|
+
var l = "[data-formie-address-state-dynamic]", u = "[data-formie-address-state-input]", d = "[data-formie-address-state-autofill-anchor]", f = "formie-address-autofill-start", p = a.country, m = "address-state", h = "formie/address/subdivisions", g = ["formie-select", "formie-dropdown-input"], _ = [
|
|
7
10
|
0,
|
|
8
11
|
100,
|
|
9
12
|
300
|
|
10
|
-
],
|
|
11
|
-
function
|
|
13
|
+
], v = n("fields", "address-state"), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
14
|
+
function x(e) {
|
|
12
15
|
return e.closest("[data-formie-field-type=\"address\"]") || e.closest("[data-formie-address-field-layout]")?.closest("[data-formie-field]") || e.closest("[data-formie-field]");
|
|
13
16
|
}
|
|
14
|
-
function
|
|
15
|
-
let t = e.querySelector(
|
|
17
|
+
function S(e) {
|
|
18
|
+
let t = e.querySelector(p);
|
|
16
19
|
return t instanceof HTMLInputElement || t instanceof HTMLSelectElement ? t : null;
|
|
17
20
|
}
|
|
18
|
-
function
|
|
19
|
-
let t = e.querySelector(
|
|
21
|
+
function C(e) {
|
|
22
|
+
let t = e.querySelector(l);
|
|
20
23
|
return t instanceof HTMLInputElement || t instanceof HTMLSelectElement ? t : null;
|
|
21
24
|
}
|
|
22
|
-
function
|
|
25
|
+
function w(e) {
|
|
23
26
|
return e.querySelector("[data-formie-field-label]");
|
|
24
27
|
}
|
|
25
|
-
function
|
|
28
|
+
function T(e) {
|
|
26
29
|
e.dispatchEvent(new Event("input", { bubbles: !0 })), e.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
27
30
|
}
|
|
28
|
-
function
|
|
31
|
+
function E(e, t) {
|
|
29
32
|
if (!(e instanceof HTMLSelectElement)) return;
|
|
30
33
|
let n = e._formieTomSelect;
|
|
31
34
|
n && n.getValue() !== t && n.setValue(t, !0);
|
|
32
35
|
}
|
|
33
|
-
function
|
|
36
|
+
function D(e, t) {
|
|
34
37
|
if (e.value !== t) {
|
|
35
|
-
e.value = t,
|
|
38
|
+
e.value = t, T(e);
|
|
36
39
|
return;
|
|
37
40
|
}
|
|
38
|
-
|
|
41
|
+
E(e, t);
|
|
39
42
|
}
|
|
40
|
-
function
|
|
43
|
+
function O(e, t) {
|
|
41
44
|
e.autofillAnchor && (e.autofillAnchor.value = t);
|
|
42
45
|
}
|
|
43
|
-
function
|
|
46
|
+
function k(e) {
|
|
44
47
|
let t = e.autofillAnchor?.value?.trim() || "", n = e.stateControl.value?.trim() || "", r = t || n;
|
|
45
48
|
r && (e.pendingStateValue = r);
|
|
46
49
|
}
|
|
47
|
-
function
|
|
50
|
+
function A(e) {
|
|
48
51
|
return e.pendingStateValue?.trim() || e.autofillAnchor?.value?.trim() || e.stateControl.value?.trim() || "";
|
|
49
52
|
}
|
|
50
|
-
function
|
|
53
|
+
function j(e) {
|
|
51
54
|
if (e.autofillAnchor) return e.autofillAnchor;
|
|
52
|
-
let t = e.addressRoot.querySelector(
|
|
55
|
+
let t = e.addressRoot.querySelector(d);
|
|
53
56
|
if (t instanceof HTMLInputElement) e.autofillAnchor = t;
|
|
54
57
|
else {
|
|
55
58
|
let t = document.createElement("input");
|
|
@@ -57,18 +60,18 @@ function D(e) {
|
|
|
57
60
|
}
|
|
58
61
|
return e.stateControl.setAttribute("autocomplete", "off"), e.stateControl.value && !e.autofillAnchor.value && (e.autofillAnchor.value = e.stateControl.value), e.autofillAnchor;
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
62
|
-
let t =
|
|
63
|
+
function M(e) {
|
|
64
|
+
k(e);
|
|
65
|
+
let t = A(e);
|
|
63
66
|
if (!t) return;
|
|
64
|
-
let n = e.lastSubdivisions, r = n.length > 0 &&
|
|
65
|
-
|
|
67
|
+
let n = e.lastSubdivisions, r = n.length > 0 && L(t, n) || t;
|
|
68
|
+
D(e.stateControl, r), E(e.stateControl, r), O(e, r), e.pendingStateValue = r;
|
|
66
69
|
}
|
|
67
|
-
function
|
|
68
|
-
let i = new URL(e.startsWith("/") ? e : `/actions/${e}`, window.location.origin);
|
|
70
|
+
function N(e, t, n, r) {
|
|
71
|
+
let i = new URL(/^https?:\/\//.test(e) || e.startsWith("/") ? e : `/actions/${e}`, window.location.origin);
|
|
69
72
|
return i.searchParams.set("country", t), i.searchParams.set("optionLabel", n), i.searchParams.set("optionValue", r), i.toString();
|
|
70
73
|
}
|
|
71
|
-
function
|
|
74
|
+
function P(e, t, n, r) {
|
|
72
75
|
return [
|
|
73
76
|
e,
|
|
74
77
|
t,
|
|
@@ -76,34 +79,34 @@ function A(e, t, n, r) {
|
|
|
76
79
|
r
|
|
77
80
|
].join("|");
|
|
78
81
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
82
|
+
function F(e) {
|
|
83
|
+
return y.has(e);
|
|
81
84
|
}
|
|
82
|
-
async function
|
|
83
|
-
let
|
|
84
|
-
return
|
|
85
|
+
async function I(e, n, r, i, a) {
|
|
86
|
+
let o = P(e, n, r, i);
|
|
87
|
+
return y.has(o) ? y.get(o) || null : (b.has(o) || b.set(o, (async () => {
|
|
85
88
|
try {
|
|
86
|
-
let
|
|
87
|
-
if (!
|
|
88
|
-
let
|
|
89
|
-
return
|
|
89
|
+
let s = await t(N(i, e, n, r), { headers: { Accept: "application/json" } }, a);
|
|
90
|
+
if (!s.ok) return y.set(o, null), null;
|
|
91
|
+
let c = await s.json();
|
|
92
|
+
return y.set(o, c), c;
|
|
90
93
|
} catch (t) {
|
|
91
|
-
return
|
|
94
|
+
return v.warn("Failed fetching subdivisions.", {
|
|
92
95
|
country: e,
|
|
93
96
|
error: t
|
|
94
|
-
}),
|
|
97
|
+
}), y.set(o, null), null;
|
|
95
98
|
} finally {
|
|
96
|
-
|
|
99
|
+
b.delete(o);
|
|
97
100
|
}
|
|
98
|
-
})()),
|
|
101
|
+
})()), b.get(o) || null);
|
|
99
102
|
}
|
|
100
|
-
function
|
|
103
|
+
function L(e, t) {
|
|
101
104
|
let n = e.trim().toLowerCase();
|
|
102
105
|
if (!n) return null;
|
|
103
106
|
for (let e of t) if (e.value.toLowerCase() === n || (e.name || "").toLowerCase() === n || (e.short || "").toLowerCase() === n || e.label.toLowerCase() === n) return e.value;
|
|
104
107
|
return null;
|
|
105
108
|
}
|
|
106
|
-
function
|
|
109
|
+
function R(e, t) {
|
|
107
110
|
[
|
|
108
111
|
"id",
|
|
109
112
|
"name",
|
|
@@ -129,33 +132,35 @@ function P(e, t) {
|
|
|
129
132
|
t.setAttribute(n, r);
|
|
130
133
|
});
|
|
131
134
|
}
|
|
132
|
-
function
|
|
135
|
+
function z(e, t) {
|
|
133
136
|
t.className = e.className;
|
|
134
137
|
}
|
|
135
|
-
function
|
|
136
|
-
let n = [...
|
|
137
|
-
e
|
|
138
|
+
function B(e, t) {
|
|
139
|
+
let n = [...g];
|
|
140
|
+
i(e, "fieldControlError").forEach((t) => {
|
|
141
|
+
e.classList.contains(t) && n.push(t);
|
|
142
|
+
}), t.className = n.join(" ");
|
|
138
143
|
}
|
|
139
|
-
function
|
|
144
|
+
function V(e, t) {
|
|
140
145
|
return e.parentNode?.replaceChild(t, e), t;
|
|
141
146
|
}
|
|
142
|
-
function
|
|
147
|
+
function H(e, t) {
|
|
143
148
|
let n = document.createElement("input");
|
|
144
|
-
return n.type = "text",
|
|
149
|
+
return n.type = "text", R(e, n), z(e, n), n.setAttribute("data-formie-input-type", "text"), n.setAttribute("data-formie-address-state-input", "true"), n.setAttribute("data-formie-single-line-text-input", "true"), n.setAttribute("autocomplete", "off"), n.removeAttribute("data-formie-combobox-input"), n.value = t, n;
|
|
145
150
|
}
|
|
146
|
-
function
|
|
151
|
+
function U(e, t, n, r = "") {
|
|
147
152
|
e.innerHTML = "";
|
|
148
153
|
let i = document.createElement("option");
|
|
149
154
|
i.value = "", i.textContent = n || "", e.appendChild(i), t.forEach((t) => {
|
|
150
155
|
let n = document.createElement("option");
|
|
151
156
|
n.value = t.value, n.textContent = t.label, e.appendChild(n);
|
|
152
|
-
}), e.value =
|
|
157
|
+
}), e.value = L(r, t) || r;
|
|
153
158
|
}
|
|
154
|
-
function
|
|
159
|
+
function W(e, t, n, r) {
|
|
155
160
|
let i = document.createElement("select");
|
|
156
|
-
return
|
|
161
|
+
return R(e, i), B(e, i), i.setAttribute("data-formie-input-type", "select"), i.setAttribute("data-formie-address-state-input", "true"), i.setAttribute("data-formie-select", "true"), i.setAttribute("data-formie-dropdown-input", "true"), i.removeAttribute("data-formie-single-line-text-input"), i.setAttribute("autocomplete", "off"), U(i, n, r, t), i;
|
|
157
162
|
}
|
|
158
|
-
function
|
|
163
|
+
function G(e, t, n, r) {
|
|
159
164
|
let i = e.list;
|
|
160
165
|
if (!r || n.length === 0) {
|
|
161
166
|
e.removeAttribute("list"), i && i.remove();
|
|
@@ -167,110 +172,110 @@ function V(e, t, n, r) {
|
|
|
167
172
|
n.value = t.label, a?.appendChild(n);
|
|
168
173
|
}), e.setAttribute("list", t);
|
|
169
174
|
}
|
|
170
|
-
function
|
|
171
|
-
let { stateField: n, stateControl:
|
|
172
|
-
if (n
|
|
173
|
-
|
|
175
|
+
function K(e, t) {
|
|
176
|
+
let { stateField: n, stateControl: i, required: a } = e;
|
|
177
|
+
if (r(n, n, "conditionalHidden", !t), n.toggleAttribute("data-formie-conditionally-hidden", !t), !t) {
|
|
178
|
+
i.required = !1, i.disabled = !0;
|
|
174
179
|
return;
|
|
175
180
|
}
|
|
176
|
-
|
|
181
|
+
i.disabled = !1, i.required = a;
|
|
177
182
|
}
|
|
178
|
-
function
|
|
183
|
+
function q(e) {
|
|
179
184
|
if (e.fetchingAnnouncementEl) return e.fetchingAnnouncementEl;
|
|
180
185
|
let t = document.createElement("div");
|
|
181
186
|
return t.className = "formie-sr-only", t.setAttribute("data-formie-address-state-fetching-announce", "true"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.addressRoot.appendChild(t), e.fetchingAnnouncementEl = t, t;
|
|
182
187
|
}
|
|
183
|
-
function
|
|
188
|
+
function J() {
|
|
184
189
|
let e = document.createElement("div");
|
|
185
190
|
e.className = "formie-address-state-skeleton", e.setAttribute("data-formie-address-state-skeleton", "true"), e.setAttribute("aria-hidden", "true");
|
|
186
191
|
let t = document.createElement("div");
|
|
187
192
|
return t.className = "formie-address-state-skeleton-input", e.appendChild(t), e;
|
|
188
193
|
}
|
|
189
|
-
function
|
|
190
|
-
e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), e.stateField.
|
|
194
|
+
function Y(e) {
|
|
195
|
+
e.addressRoot.setAttribute("data-formie-address-state-fetching", "true"), e.countryControl?.setAttribute("aria-busy", "true"), e.stateControl.setAttribute("aria-hidden", "true"), e.stateControl.setAttribute("tabindex", "-1"), r(e.stateField, e.stateField, "conditionalHidden", !1), e.stateField.removeAttribute("data-formie-conditionally-hidden"), e.stateField.setAttribute("data-formie-address-state-skeleton-active", "true");
|
|
191
196
|
let t = e.stateField.querySelector("[data-formie-field-control]");
|
|
192
|
-
t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl =
|
|
197
|
+
t instanceof HTMLElement && (e.skeletonEl || (e.skeletonEl = J(), t.appendChild(e.skeletonEl)), e.skeletonEl.removeAttribute("hidden")), q(e).textContent = "Loading state or province options for the selected country.";
|
|
193
198
|
}
|
|
194
|
-
function
|
|
199
|
+
function X(e) {
|
|
195
200
|
e.addressRoot.removeAttribute("data-formie-address-state-fetching"), e.countryControl?.removeAttribute("aria-busy"), e.stateControl.removeAttribute("aria-hidden"), e.stateControl.removeAttribute("tabindex"), e.stateField.removeAttribute("data-formie-address-state-skeleton-active"), e.skeletonEl?.setAttribute("hidden", "hidden"), e.fetchingAnnouncementEl && (e.fetchingAnnouncementEl.textContent = "");
|
|
196
201
|
}
|
|
197
|
-
function
|
|
198
|
-
let n =
|
|
202
|
+
function Z(e, t) {
|
|
203
|
+
let n = w(e);
|
|
199
204
|
if (!n) return;
|
|
200
205
|
let r = n.querySelector("[data-formie-field-required]");
|
|
201
206
|
n.textContent = t, r && n.appendChild(r);
|
|
202
207
|
}
|
|
203
|
-
function
|
|
204
|
-
e.setAttribute("data-formie-combobox-input", "true"),
|
|
208
|
+
function Q(e, t) {
|
|
209
|
+
e.setAttribute("data-formie-combobox-input", "true"), s(e, "combobox", "before-init", {
|
|
205
210
|
select: e,
|
|
206
211
|
options: { placeholder: t }
|
|
207
212
|
});
|
|
208
|
-
let n =
|
|
209
|
-
return
|
|
213
|
+
let n = c(e, { placeholder: t });
|
|
214
|
+
return s(e, "combobox", "after-init", {
|
|
210
215
|
combobox: e._formieTomSelect,
|
|
211
216
|
options: { placeholder: t }
|
|
212
217
|
}), n;
|
|
213
218
|
}
|
|
214
|
-
async function
|
|
215
|
-
let { hideWhenUnused:
|
|
216
|
-
|
|
217
|
-
let
|
|
218
|
-
if (
|
|
219
|
-
if (
|
|
220
|
-
|
|
219
|
+
async function $(t, n) {
|
|
220
|
+
let { hideWhenUnused: r = !0, useSearchable: i = !0, useDatalist: a = !0, optionLabel: o = "name", optionValue: s = "name", placeholder: c = null, subdivisionsAction: l = h } = n, u = t.countryControl?.value?.trim() || "";
|
|
221
|
+
k(t);
|
|
222
|
+
let d = A(t), f = ++t.fetchGeneration;
|
|
223
|
+
if (t.comboboxCleanup?.(), t.comboboxCleanup = null, !u) {
|
|
224
|
+
if (Z(t.stateField, t.stateField.dataset.formieAddressStateDefaultLabel || "State / Province"), X(t), r) {
|
|
225
|
+
K(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "", t.lastSubdivisions = [];
|
|
221
226
|
return;
|
|
222
227
|
}
|
|
223
|
-
if (
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
} else
|
|
227
|
-
|
|
228
|
+
if (K(t, !0), t.stateControl instanceof HTMLSelectElement) {
|
|
229
|
+
let e = H(t.stateControl, d);
|
|
230
|
+
t.stateControl = V(t.stateControl, e);
|
|
231
|
+
} else t.stateControl.disabled = !0, t.stateControl.placeholder = c || t.stateControl.placeholder;
|
|
232
|
+
t.lastSubdivisions = [];
|
|
228
233
|
return;
|
|
229
234
|
}
|
|
230
|
-
|
|
231
|
-
let p = await
|
|
232
|
-
if (f !==
|
|
233
|
-
let m = p?.subdivisions || [],
|
|
234
|
-
if (
|
|
235
|
-
|
|
235
|
+
F(P(u, o, s, l)) || Y(t);
|
|
236
|
+
let p = await I(u, o, s, l, e(t.addressRoot.closest("form")));
|
|
237
|
+
if (f !== t.fetchGeneration) return;
|
|
238
|
+
let m = p?.subdivisions || [], g = p?.administrativeAreaUsed ?? !0, _ = p?.administrativeAreaLabel || "State / Province";
|
|
239
|
+
if (t.lastSubdivisions = m, X(t), r && !g) {
|
|
240
|
+
K(t, !1), D(t.stateControl, ""), O(t, ""), t.pendingStateValue = "";
|
|
236
241
|
return;
|
|
237
242
|
}
|
|
238
|
-
if (
|
|
239
|
-
let
|
|
240
|
-
|
|
243
|
+
if (K(t, !0), Z(t.stateField, _), m.length > 0) {
|
|
244
|
+
let e = t.stateControl instanceof HTMLSelectElement ? t.stateControl : W(t.stateControl, d, m, c);
|
|
245
|
+
t.stateControl === e ? (B(t.stateControl, e), U(e, m, c, e.value)) : t.stateControl = V(t.stateControl, e), i ? t.comboboxCleanup = Q(e, c) : e.removeAttribute("data-formie-combobox-input"), D(e, L(d, m) || d), M(t);
|
|
241
246
|
return;
|
|
242
247
|
}
|
|
243
|
-
let
|
|
244
|
-
|
|
248
|
+
let v = t.stateControl instanceof HTMLInputElement ? t.stateControl : H(t.stateControl, d);
|
|
249
|
+
t.stateControl !== v && (t.stateControl = V(t.stateControl, v)), v.disabled = !1, G(v, t.datalistId, m, a), D(v, d), M(t);
|
|
245
250
|
}
|
|
246
|
-
function
|
|
251
|
+
function ee(e, t) {
|
|
247
252
|
let n = () => {
|
|
248
|
-
|
|
249
|
-
|
|
253
|
+
k(e), e.countryControl?.value?.trim() && (e.lastCountry = "", $(e, t).then(() => {
|
|
254
|
+
M(e);
|
|
250
255
|
}));
|
|
251
256
|
};
|
|
252
|
-
|
|
257
|
+
_.forEach((t) => {
|
|
253
258
|
let r = window.setTimeout(n, t);
|
|
254
259
|
e.autofillSweepTimers.push(r);
|
|
255
260
|
});
|
|
256
261
|
}
|
|
257
|
-
function
|
|
262
|
+
function te(e) {
|
|
258
263
|
e.countryChangeTimer !== null && (window.clearTimeout(e.countryChangeTimer), e.countryChangeTimer = null), e.autofillSweepTimers.forEach((e) => {
|
|
259
264
|
window.clearTimeout(e);
|
|
260
265
|
}), e.autofillSweepTimers = [];
|
|
261
266
|
}
|
|
262
|
-
function
|
|
263
|
-
let n =
|
|
264
|
-
if (!n) return
|
|
265
|
-
let r =
|
|
266
|
-
if (!r) return
|
|
267
|
-
let i =
|
|
267
|
+
function ne(e, t) {
|
|
268
|
+
let n = x(e);
|
|
269
|
+
if (!n) return v.warn("Address root not found; skipping field."), () => {};
|
|
270
|
+
let r = C(e);
|
|
271
|
+
if (!r) return v.warn("Dynamic state control not found; skipping field."), () => {};
|
|
272
|
+
let i = w(e);
|
|
268
273
|
i && !e.dataset.formieAddressStateDefaultLabel && (e.dataset.formieAddressStateDefaultLabel = i.textContent?.trim() || "State / Province");
|
|
269
|
-
let
|
|
274
|
+
let a = {
|
|
270
275
|
addressRoot: n,
|
|
271
276
|
stateField: e,
|
|
272
277
|
stateControl: r,
|
|
273
|
-
countryControl:
|
|
278
|
+
countryControl: S(n),
|
|
274
279
|
autofillAnchor: null,
|
|
275
280
|
pendingStateValue: r.value?.trim() || "",
|
|
276
281
|
datalistId: `formie-address-state-datalist-${r.getAttribute("data-formie-input-id") || Math.random().toString(36).slice(2)}`,
|
|
@@ -284,61 +289,67 @@ function Q(e, t) {
|
|
|
284
289
|
required: r.required,
|
|
285
290
|
lastSubdivisions: []
|
|
286
291
|
};
|
|
287
|
-
|
|
288
|
-
let
|
|
289
|
-
let n =
|
|
290
|
-
if (!e && n ===
|
|
291
|
-
let r =
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
j(a);
|
|
293
|
+
let o = (e = !1) => {
|
|
294
|
+
let n = a.countryControl?.value?.trim() || "";
|
|
295
|
+
if (!e && n === a.lastCountry) return;
|
|
296
|
+
let r = a.lastCountry, i = A(a);
|
|
297
|
+
a.lastCountry = n, $(a, t).then(() => {
|
|
298
|
+
M(a), r && n && r !== n && !L(i, a.lastSubdivisions) && !A(a) && (D(a.stateControl, ""), O(a, ""));
|
|
294
299
|
});
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
|
|
300
|
+
}, s = () => {
|
|
301
|
+
a.countryChangeTimer !== null && window.clearTimeout(a.countryChangeTimer), a.countryChangeTimer = window.setTimeout(() => {
|
|
302
|
+
a.countryChangeTimer = null, k(a), o(!0);
|
|
298
303
|
}, 50);
|
|
299
|
-
},
|
|
304
|
+
}, c = (e) => {
|
|
300
305
|
let n = e.target;
|
|
301
306
|
if (!(n instanceof HTMLInputElement || n instanceof HTMLSelectElement)) return;
|
|
302
|
-
let r = n ===
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
|
|
307
|
+
let r = n === a.autofillAnchor, i = n.matches(l) || n.matches(u);
|
|
308
|
+
if ((r || i) && (i && !r && O(a, n.value), k(a), a.countryControl?.value?.trim())) {
|
|
309
|
+
if (a.lastSubdivisions.length > 0) {
|
|
310
|
+
M(a);
|
|
306
311
|
return;
|
|
307
312
|
}
|
|
308
|
-
|
|
309
|
-
|
|
313
|
+
a.lastCountry = "", $(a, t).then(() => {
|
|
314
|
+
M(a);
|
|
310
315
|
});
|
|
311
316
|
}
|
|
312
|
-
},
|
|
313
|
-
if (e.animationName !==
|
|
317
|
+
}, d = (e) => {
|
|
318
|
+
if (e.animationName !== f) return;
|
|
314
319
|
let r = e.target;
|
|
315
|
-
(r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (
|
|
316
|
-
|
|
320
|
+
(r instanceof HTMLInputElement || r instanceof HTMLSelectElement) && n.contains(r) && (k(a), a.countryControl?.value?.trim() && (a.lastCountry = "", $(a, t).then(() => {
|
|
321
|
+
M(a);
|
|
317
322
|
})));
|
|
318
323
|
}, p = (e) => {
|
|
319
324
|
let n = e.detail?.state?.trim();
|
|
320
325
|
if (!n) {
|
|
321
|
-
|
|
326
|
+
o();
|
|
322
327
|
return;
|
|
323
328
|
}
|
|
324
|
-
|
|
325
|
-
|
|
329
|
+
a.pendingStateValue = n, O(a, n), $(a, t).then(() => {
|
|
330
|
+
D(a.stateControl, n), E(a.stateControl, n), a.lastCountry = a.countryControl?.value?.trim() || "";
|
|
326
331
|
});
|
|
327
332
|
};
|
|
328
|
-
return
|
|
329
|
-
|
|
333
|
+
return a.countryControl?.addEventListener("change", s), a.countryControl?.addEventListener("input", s), n.addEventListener("input", c), n.addEventListener("change", c), n.addEventListener("animationstart", d), n.addEventListener("formie:address:google:populate", p), n.addEventListener("formie:address:address-finder:populate", p), n.addEventListener("formie:address:loqate:populate", p), n.addEventListener("formie:address:place-kit:populate", p), o(), ee(a, t), () => {
|
|
334
|
+
te(a), X(a), a.skeletonEl?.remove(), a.fetchingAnnouncementEl?.remove(), a.autofillAnchor?.remove(), a.comboboxCleanup?.(), a.countryControl?.removeEventListener("change", s), a.countryControl?.removeEventListener("input", s), n.removeEventListener("input", c), n.removeEventListener("change", c), n.removeEventListener("animationstart", d), n.removeEventListener("formie:address:google:populate", p), n.removeEventListener("formie:address:address-finder:populate", p), n.removeEventListener("formie:address:loqate:populate", p), n.removeEventListener("formie:address:place-kit:populate", p);
|
|
330
335
|
};
|
|
331
336
|
}
|
|
332
|
-
var
|
|
333
|
-
|
|
337
|
+
var re = {
|
|
338
|
+
moduleId: `formie:${m}`,
|
|
339
|
+
version: 2,
|
|
340
|
+
surfaces: [
|
|
341
|
+
"server-rendered",
|
|
342
|
+
"client-rendered",
|
|
343
|
+
"cp-edit"
|
|
344
|
+
],
|
|
334
345
|
kind: "field",
|
|
335
|
-
match: (e) => !!e.target.querySelector(
|
|
346
|
+
match: (e) => !!e.target.querySelector(l),
|
|
336
347
|
setup: async (e) => {
|
|
337
|
-
let t = e.options || {},
|
|
338
|
-
return
|
|
339
|
-
|
|
348
|
+
let t = e.options || {}, n = o(e), r = n.map((e) => ne(e, t));
|
|
349
|
+
return v.log("Module setup.", { fieldCount: n.length }), { destroy: () => {
|
|
350
|
+
r.forEach((e) => e()), v.log("Module destroy.", { fieldCount: n.length });
|
|
340
351
|
} };
|
|
341
352
|
}
|
|
342
353
|
};
|
|
343
354
|
//#endregion
|
|
344
|
-
export {
|
|
355
|
+
export { re as addressStateModule };
|