@vtex/country-forms 1.44.0 → 1.46.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/CHANGELOG.md +22 -1
- package/README.md +6 -2
- package/dist/MLT-AAXWQO5M.js +91 -0
- package/dist/MLT-AAXWQO5M.js.map +1 -0
- package/dist/MLT-G2A4PKU3.mjs +89 -0
- package/dist/MLT-G2A4PKU3.mjs.map +1 -0
- package/dist/MLT-ZEGEH77F.js +88 -0
- package/dist/MLT-ZEGEH77F.js.map +1 -0
- package/dist/MLT-ZV2AIVQJ.mjs +86 -0
- package/dist/MLT-ZV2AIVQJ.mjs.map +1 -0
- package/dist/MNP-C3PW6WOG.js +70 -0
- package/dist/MNP-C3PW6WOG.js.map +1 -0
- package/dist/MNP-J2OQTBW3.js +83 -0
- package/dist/MNP-J2OQTBW3.js.map +1 -0
- package/dist/MNP-SGRJ3OAW.mjs +68 -0
- package/dist/MNP-SGRJ3OAW.mjs.map +1 -0
- package/dist/MNP-W7AS7M2M.mjs +81 -0
- package/dist/MNP-W7AS7M2M.mjs.map +1 -0
- package/dist/PRI-2KBA5NUH.mjs +81 -0
- package/dist/PRI-2KBA5NUH.mjs.map +1 -0
- package/dist/PRI-3ZDFDJZQ.mjs +58 -0
- package/dist/PRI-3ZDFDJZQ.mjs.map +1 -0
- package/dist/PRI-DU3UWTNO.js +83 -0
- package/dist/PRI-DU3UWTNO.js.map +1 -0
- package/dist/PRI-IFVUC6M3.js +60 -0
- package/dist/PRI-IFVUC6M3.js.map +1 -0
- package/dist/VIR-FKFL4TRQ.mjs +81 -0
- package/dist/VIR-FKFL4TRQ.mjs.map +1 -0
- package/dist/VIR-P52FCMDR.js +83 -0
- package/dist/VIR-P52FCMDR.js.map +1 -0
- package/dist/VIR-TNUILVMX.js +73 -0
- package/dist/VIR-TNUILVMX.js.map +1 -0
- package/dist/VIR-WLLUA34T.mjs +71 -0
- package/dist/VIR-WLLUA34T.mjs.map +1 -0
- package/dist/{ar-SA-7MWBNBYZ.js → ar-SA-FIIDSHYH.js} +13 -2
- package/dist/ar-SA-FIIDSHYH.js.map +1 -0
- package/dist/{ar-SA-24MQ4NTS.mjs → ar-SA-S7QHSESN.mjs} +13 -2
- package/dist/ar-SA-S7QHSESN.mjs.map +1 -0
- package/dist/{bg-BG-NKPGGFNQ.mjs → bg-BG-RHVYSJDY.mjs} +13 -2
- package/dist/bg-BG-RHVYSJDY.mjs.map +1 -0
- package/dist/{bg-BG-PCWF2EFH.js → bg-BG-VTIJVG5M.js} +13 -2
- package/dist/bg-BG-VTIJVG5M.js.map +1 -0
- package/dist/{ca-ES-GWB5HVCN.js → ca-ES-4AFDFMDS.js} +13 -2
- package/dist/ca-ES-4AFDFMDS.js.map +1 -0
- package/dist/{ca-ES-64RRBS7A.mjs → ca-ES-RBKQN6ZX.mjs} +13 -2
- package/dist/ca-ES-RBKQN6ZX.mjs.map +1 -0
- package/dist/chunk-DEFAYQZ6.js +87 -0
- package/dist/chunk-DEFAYQZ6.js.map +1 -0
- package/dist/chunk-GPISMOJJ.mjs +81 -0
- package/dist/chunk-GPISMOJJ.mjs.map +1 -0
- package/dist/chunk-Q43M2AYN.js +82 -0
- package/dist/chunk-Q43M2AYN.js.map +1 -0
- package/dist/chunk-VYEQYQIO.mjs +75 -0
- package/dist/chunk-VYEQYQIO.mjs.map +1 -0
- package/dist/{cs-CZ-M7YMVEUY.js → cs-CZ-CI5LWDUS.js} +13 -2
- package/dist/cs-CZ-CI5LWDUS.js.map +1 -0
- package/dist/{cs-CZ-VHXGZ5ZR.mjs → cs-CZ-GGOJGXD7.mjs} +13 -2
- package/dist/cs-CZ-GGOJGXD7.mjs.map +1 -0
- package/dist/{da-DK-4ZGWLPZL.mjs → da-DK-5246NYQR.mjs} +13 -2
- package/dist/da-DK-5246NYQR.mjs.map +1 -0
- package/dist/{da-DK-QBYCPVCT.js → da-DK-ICXIBAXM.js} +13 -2
- package/dist/da-DK-ICXIBAXM.js.map +1 -0
- package/dist/{de-DE-QHR7FPPS.js → de-DE-HPBIQQYY.js} +13 -2
- package/dist/de-DE-HPBIQQYY.js.map +1 -0
- package/dist/{de-DE-PT46DUM5.mjs → de-DE-ZV5JKTE5.mjs} +13 -2
- package/dist/de-DE-ZV5JKTE5.mjs.map +1 -0
- package/dist/{el-GR-F2TPIHFS.js → el-GR-Q5724U7V.js} +13 -2
- package/dist/el-GR-Q5724U7V.js.map +1 -0
- package/dist/{el-GR-XGGPEAN2.mjs → el-GR-TG5XLTUR.mjs} +13 -2
- package/dist/el-GR-TG5XLTUR.mjs.map +1 -0
- package/dist/{en-US-7USGBEEM.mjs → en-US-LIME7YZU.mjs} +13 -2
- package/dist/en-US-LIME7YZU.mjs.map +1 -0
- package/dist/{en-US-WSOTTPBX.js → en-US-XB4U3IMQ.js} +13 -2
- package/dist/en-US-XB4U3IMQ.js.map +1 -0
- package/dist/{es-MX-JN74N55W.mjs → es-MX-6WCGDRXF.mjs} +13 -2
- package/dist/es-MX-6WCGDRXF.mjs.map +1 -0
- package/dist/{es-MX-FNJQDP2Y.js → es-MX-RN7JC5QH.js} +13 -2
- package/dist/es-MX-RN7JC5QH.js.map +1 -0
- package/dist/{fi-FI-2ZUHDGKW.js → fi-FI-GG2LMX2Q.js} +13 -2
- package/dist/fi-FI-GG2LMX2Q.js.map +1 -0
- package/dist/{fi-FI-FWFIDWI3.mjs → fi-FI-N3JDILE5.mjs} +13 -2
- package/dist/fi-FI-N3JDILE5.mjs.map +1 -0
- package/dist/{fr-FR-OAA3P5VG.mjs → fr-FR-I7UQC7M4.mjs} +13 -2
- package/dist/fr-FR-I7UQC7M4.mjs.map +1 -0
- package/dist/{fr-FR-6VEG7FOA.js → fr-FR-JKS3UT7H.js} +13 -2
- package/dist/fr-FR-JKS3UT7H.js.map +1 -0
- package/dist/{hu-HU-W4KKHTBQ.js → hu-HU-32X6LENV.js} +13 -2
- package/dist/hu-HU-32X6LENV.js.map +1 -0
- package/dist/{hu-HU-UMH2XWZW.mjs → hu-HU-DMXKQFF4.mjs} +13 -2
- package/dist/hu-HU-DMXKQFF4.mjs.map +1 -0
- package/dist/{id-ID-J4RX2D56.js → id-ID-3IGVH6GJ.js} +13 -2
- package/dist/id-ID-3IGVH6GJ.js.map +1 -0
- package/dist/{id-ID-CFPFZDCH.mjs → id-ID-HINNV4VB.mjs} +13 -2
- package/dist/id-ID-HINNV4VB.mjs.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +134 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +134 -62
- package/dist/index.mjs.map +1 -1
- package/dist/{it-IT-MAE62YHH.mjs → it-IT-IJISFYK5.mjs} +13 -2
- package/dist/it-IT-IJISFYK5.mjs.map +1 -0
- package/dist/{it-IT-LOIXDZPW.js → it-IT-R5GAHWFL.js} +13 -2
- package/dist/it-IT-R5GAHWFL.js.map +1 -0
- package/dist/{ja-JP-QQSZ3CLG.js → ja-JP-JU3VCPSL.js} +13 -2
- package/dist/ja-JP-JU3VCPSL.js.map +1 -0
- package/dist/{ja-JP-3FEQRT2F.mjs → ja-JP-RLXSM4XX.mjs} +13 -2
- package/dist/ja-JP-RLXSM4XX.mjs.map +1 -0
- package/dist/{ko-KR-DXPJO5HX.mjs → ko-KR-HR223E4O.mjs} +13 -2
- package/dist/ko-KR-HR223E4O.mjs.map +1 -0
- package/dist/{ko-KR-PAL5G267.js → ko-KR-KJYLSFUJ.js} +13 -2
- package/dist/ko-KR-KJYLSFUJ.js.map +1 -0
- package/dist/mlt-6T67IYYD.js +37 -0
- package/dist/mlt-6T67IYYD.js.map +1 -0
- package/dist/mlt-B273HMBL.mjs +30 -0
- package/dist/mlt-B273HMBL.mjs.map +1 -0
- package/dist/mlt-KIKOGLVY.js +33 -0
- package/dist/mlt-KIKOGLVY.js.map +1 -0
- package/dist/mlt-MU6B6KTL.mjs +32 -0
- package/dist/mlt-MU6B6KTL.mjs.map +1 -0
- package/dist/mlt-councils-6STAKSC4.mjs +78 -0
- package/dist/mlt-councils-6STAKSC4.mjs.map +1 -0
- package/dist/mlt-councils-TPBCMWUM.js +80 -0
- package/dist/mlt-councils-TPBCMWUM.js.map +1 -0
- package/dist/mnp-AZL6C45N.mjs +16 -0
- package/dist/mnp-AZL6C45N.mjs.map +1 -0
- package/dist/mnp-CP5YACPW.js +19 -0
- package/dist/mnp-CP5YACPW.js.map +1 -0
- package/dist/mnp-GT4DIPOO.js +14 -0
- package/dist/mnp-GT4DIPOO.js.map +1 -0
- package/dist/mnp-KT5UXQYU.mjs +12 -0
- package/dist/mnp-KT5UXQYU.mjs.map +1 -0
- package/dist/{nb-NO-3GOZV5CL.js → nb-NO-6XB45DYR.js} +13 -2
- package/dist/nb-NO-6XB45DYR.js.map +1 -0
- package/dist/{nb-NO-XENDBN6Y.mjs → nb-NO-JMCDCLUY.mjs} +13 -2
- package/dist/nb-NO-JMCDCLUY.mjs.map +1 -0
- package/dist/{nl-NL-WMR6SE4J.js → nl-NL-N5TXBSDS.js} +13 -2
- package/dist/nl-NL-N5TXBSDS.js.map +1 -0
- package/dist/{nl-NL-54F7VLYH.mjs → nl-NL-YAFIMMX3.mjs} +13 -2
- package/dist/nl-NL-YAFIMMX3.mjs.map +1 -0
- package/dist/{pl-PL-SHXZEQZU.mjs → pl-PL-G56U4ACX.mjs} +13 -2
- package/dist/pl-PL-G56U4ACX.mjs.map +1 -0
- package/dist/{pl-PL-5A6K4TAS.js → pl-PL-VJB6LBRJ.js} +13 -2
- package/dist/pl-PL-VJB6LBRJ.js.map +1 -0
- package/dist/pri-CMV63ESP.js +19 -0
- package/dist/pri-CMV63ESP.js.map +1 -0
- package/dist/pri-JOCJRRQD.mjs +19 -0
- package/dist/pri-JOCJRRQD.mjs.map +1 -0
- package/dist/pri-VQKQPFON.js +22 -0
- package/dist/pri-VQKQPFON.js.map +1 -0
- package/dist/pri-ZYPI4EEI.mjs +16 -0
- package/dist/pri-ZYPI4EEI.mjs.map +1 -0
- package/dist/{pt-BR-GVZ7HC6A.mjs → pt-BR-PSX64ZNY.mjs} +13 -2
- package/dist/pt-BR-PSX64ZNY.mjs.map +1 -0
- package/dist/{pt-BR-MZIK3ZBW.js → pt-BR-TX56YQBF.js} +13 -2
- package/dist/pt-BR-TX56YQBF.js.map +1 -0
- package/dist/{pt-PT-J4MGCOY2.mjs → pt-PT-2HWXKPLP.mjs} +13 -2
- package/dist/pt-PT-2HWXKPLP.mjs.map +1 -0
- package/dist/{pt-PT-3Q3QTABJ.js → pt-PT-ZRVUVL3N.js} +13 -2
- package/dist/pt-PT-ZRVUVL3N.js.map +1 -0
- package/dist/{ro-RO-A5R2HQOE.js → ro-RO-PVGD4KS7.js} +13 -2
- package/dist/ro-RO-PVGD4KS7.js.map +1 -0
- package/dist/{ro-RO-OC3R2VJK.mjs → ro-RO-UDOVPV6K.mjs} +13 -2
- package/dist/ro-RO-UDOVPV6K.mjs.map +1 -0
- package/dist/{ru-RU-S6CD65NS.js → ru-RU-E22QQCZG.js} +13 -2
- package/dist/ru-RU-E22QQCZG.js.map +1 -0
- package/dist/{ru-RU-IL5TWKLZ.mjs → ru-RU-F7SY25N4.mjs} +13 -2
- package/dist/ru-RU-F7SY25N4.mjs.map +1 -0
- package/dist/{sk-SK-J4TH6NKJ.mjs → sk-SK-QIR4IR3F.mjs} +13 -2
- package/dist/sk-SK-QIR4IR3F.mjs.map +1 -0
- package/dist/{sk-SK-GHOCQVC6.js → sk-SK-ZJSIZIW6.js} +13 -2
- package/dist/sk-SK-ZJSIZIW6.js.map +1 -0
- package/dist/{sl-SI-R6D4Z63Q.mjs → sl-SI-TUYQBULP.mjs} +13 -2
- package/dist/sl-SI-TUYQBULP.mjs.map +1 -0
- package/dist/{sl-SI-GLGRZJIT.js → sl-SI-ZZJKN6T7.js} +13 -2
- package/dist/sl-SI-ZZJKN6T7.js.map +1 -0
- package/dist/{sv-SE-RX5ROPYA.js → sv-SE-DLHVG6AM.js} +13 -2
- package/dist/sv-SE-DLHVG6AM.js.map +1 -0
- package/dist/{sv-SE-4MZUYC4Z.mjs → sv-SE-ONWBSVC7.mjs} +13 -2
- package/dist/sv-SE-ONWBSVC7.mjs.map +1 -0
- package/dist/{th-TH-DX3EECIM.mjs → th-TH-7NACA6C2.mjs} +13 -2
- package/dist/th-TH-7NACA6C2.mjs.map +1 -0
- package/dist/{th-TH-LLFMZ667.js → th-TH-WBMUBPEI.js} +13 -2
- package/dist/th-TH-WBMUBPEI.js.map +1 -0
- package/dist/{uk-UA-3FCVDFMC.js → uk-UA-SOAULEGT.js} +13 -2
- package/dist/uk-UA-SOAULEGT.js.map +1 -0
- package/dist/{uk-UA-QEJIUNH6.mjs → uk-UA-TJPHKKJC.mjs} +13 -2
- package/dist/uk-UA-TJPHKKJC.mjs.map +1 -0
- package/dist/vir-22CAWRIX.js +22 -0
- package/dist/vir-22CAWRIX.js.map +1 -0
- package/dist/vir-BI2EXEGG.mjs +19 -0
- package/dist/vir-BI2EXEGG.mjs.map +1 -0
- package/dist/vir-CSM7SRPL.js +33 -0
- package/dist/vir-CSM7SRPL.js.map +1 -0
- package/dist/vir-WQDKBF6C.mjs +28 -0
- package/dist/vir-WQDKBF6C.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/ar-SA-24MQ4NTS.mjs.map +0 -1
- package/dist/ar-SA-7MWBNBYZ.js.map +0 -1
- package/dist/bg-BG-NKPGGFNQ.mjs.map +0 -1
- package/dist/bg-BG-PCWF2EFH.js.map +0 -1
- package/dist/ca-ES-64RRBS7A.mjs.map +0 -1
- package/dist/ca-ES-GWB5HVCN.js.map +0 -1
- package/dist/cs-CZ-M7YMVEUY.js.map +0 -1
- package/dist/cs-CZ-VHXGZ5ZR.mjs.map +0 -1
- package/dist/da-DK-4ZGWLPZL.mjs.map +0 -1
- package/dist/da-DK-QBYCPVCT.js.map +0 -1
- package/dist/de-DE-PT46DUM5.mjs.map +0 -1
- package/dist/de-DE-QHR7FPPS.js.map +0 -1
- package/dist/el-GR-F2TPIHFS.js.map +0 -1
- package/dist/el-GR-XGGPEAN2.mjs.map +0 -1
- package/dist/en-US-7USGBEEM.mjs.map +0 -1
- package/dist/en-US-WSOTTPBX.js.map +0 -1
- package/dist/es-MX-FNJQDP2Y.js.map +0 -1
- package/dist/es-MX-JN74N55W.mjs.map +0 -1
- package/dist/fi-FI-2ZUHDGKW.js.map +0 -1
- package/dist/fi-FI-FWFIDWI3.mjs.map +0 -1
- package/dist/fr-FR-6VEG7FOA.js.map +0 -1
- package/dist/fr-FR-OAA3P5VG.mjs.map +0 -1
- package/dist/hu-HU-UMH2XWZW.mjs.map +0 -1
- package/dist/hu-HU-W4KKHTBQ.js.map +0 -1
- package/dist/id-ID-CFPFZDCH.mjs.map +0 -1
- package/dist/id-ID-J4RX2D56.js.map +0 -1
- package/dist/it-IT-LOIXDZPW.js.map +0 -1
- package/dist/it-IT-MAE62YHH.mjs.map +0 -1
- package/dist/ja-JP-3FEQRT2F.mjs.map +0 -1
- package/dist/ja-JP-QQSZ3CLG.js.map +0 -1
- package/dist/ko-KR-DXPJO5HX.mjs.map +0 -1
- package/dist/ko-KR-PAL5G267.js.map +0 -1
- package/dist/nb-NO-3GOZV5CL.js.map +0 -1
- package/dist/nb-NO-XENDBN6Y.mjs.map +0 -1
- package/dist/nl-NL-54F7VLYH.mjs.map +0 -1
- package/dist/nl-NL-WMR6SE4J.js.map +0 -1
- package/dist/pl-PL-5A6K4TAS.js.map +0 -1
- package/dist/pl-PL-SHXZEQZU.mjs.map +0 -1
- package/dist/pt-BR-GVZ7HC6A.mjs.map +0 -1
- package/dist/pt-BR-MZIK3ZBW.js.map +0 -1
- package/dist/pt-PT-3Q3QTABJ.js.map +0 -1
- package/dist/pt-PT-J4MGCOY2.mjs.map +0 -1
- package/dist/ro-RO-A5R2HQOE.js.map +0 -1
- package/dist/ro-RO-OC3R2VJK.mjs.map +0 -1
- package/dist/ru-RU-IL5TWKLZ.mjs.map +0 -1
- package/dist/ru-RU-S6CD65NS.js.map +0 -1
- package/dist/sk-SK-GHOCQVC6.js.map +0 -1
- package/dist/sk-SK-J4TH6NKJ.mjs.map +0 -1
- package/dist/sl-SI-GLGRZJIT.js.map +0 -1
- package/dist/sl-SI-R6D4Z63Q.mjs.map +0 -1
- package/dist/sv-SE-4MZUYC4Z.mjs.map +0 -1
- package/dist/sv-SE-RX5ROPYA.js.map +0 -1
- package/dist/th-TH-DX3EECIM.mjs.map +0 -1
- package/dist/th-TH-LLFMZ667.js.map +0 -1
- package/dist/uk-UA-3FCVDFMC.js.map +0 -1
- package/dist/uk-UA-QEJIUNH6.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.46.0] - 2026-11-30
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- MLT address schema (`address-MLT`). Field order: postalCode → street → number → complement → neighborhood → city → state, following the visible `address-form` `MLT.ts` fields. Postal code is required: 2–3 letters, an optional single space, and exactly 4 digits (`validatePostalCodeMLT`, `/^[A-Za-z]{2,3} ?\d{4}$/` after trim, the legacy regex; the letters are not checked against the real locality codes, as in the legacy form). Masks `formatPostalCodeMLT` / `unformatPostalCodeMLT` upper-case the code and show a space once it is complete (`vlt1117` → `VLT 1117`); the mask checks completeness with the validator's own pattern on the trimmed raw value, so it never accepts what the validator rejects (`VLT 1117`, a no-break space, or a dotless `ı` stay invalid); partial or over-long input is only ASCII upper-cased, so nothing walks or is cut into a valid value, and the API receives the code without the space (`VLT1117`). The legacy mask `AAA 999` is not reproduced: it has 3 digit slots while the regex needs 4. `maxLength` is 9 (the legacy field uses 8): the 8 characters of `VLT 1117` plus one for a pasted space, so `VLT 11172` is rejected instead of being cut to the different valid `VLT 1117`. The limit is one character of slack, not a guarantee: a paste with both surrounding whitespace and an extra digit (`" VLT 11172"`) is still cut (JPN, LTU, and LUX have the same gap). State is a required select (`MLT.councils`, the 68 legacy `address-form` strings such as `Attard (Attard)` and `Vittoriosa (Birgu)`, kept unchanged, including their spelling quirks, so a saved address still matches an option; sorted with `localeCompare` so `Ħamrun` and `Żebbuġ` sit with their base letters) with the new label `country-forms.address.state.label.MLT` ("Local council"; the legacy select caption is "Council"). Street is required (`maxLength` 750; the legacy field has no max). Number is required (`maxLength` 750). Complement is optional (`maxLength` 750). Neighborhood is required (`maxLength` 100), as in `address-form`. City is required (`maxLength` 100). Hidden `country` and `reference` are omitted, along with `receiverName`. `MLT` is now part of `SUPPORTED_ADDRESS_COUNTRIES`.
|
|
15
|
+
- MLT personal-data schema (`personal-data-MLT`). `personType` toggles individual/business visibility for `lastName`. No tax/identity document field (`profile-form` has no `MLT.js`, so it falls back to the generic default rules with a free-text `document` and no check digit). Adds `validatePhoneMLT` and masks `formatPhoneMLT`/`unformatPhoneMLT` (national display `9961 2345` mobile / `2123 4567` fixed line, grouped like libphonenumber's `MT` format). `front.phone` has no MLT module, so the rules follow the Maltese numbering plan (country code `356`, no trunk prefix, 8-digit national numbers) and libphonenumber's `MT` ranges. Mobile is `7210`, `77xx`/`79xx`, `92xx`, `99xx`, `9696`, `9697`, `9811`–`9813`, `9889`, or `9897` followed by 4 digits. Fixed line is `2031`–`2034`, `2060`, `2065`, `2069`, `201`, `209`, `21`–`23`, `25`, `27`, or `260` followed by the remaining digits. Toll-free (`800`), premium-rate (`50`/`51`/`52`), government (`501`), VoIP (`3550`), and pager (`7117`) ranges are rejected. `+356` / `00356` are stripped once; a bare `356` is stripped only when the remainder is a complete valid number (no valid national number starts with `356`); a leading `0` is rejected because there is no trunk prefix. A foreign `+` / `00` prefix (Italy `+39`, the United Kingdom `+44`, Germany `+49`) is rejected; letters and other non-phone characters are rejected (not stripped), and the mask returns such input unchanged. When `+356` / `00356` is followed by another `356` the mask keeps the input on screen so typing a value key by key gives the same result as pasting it. `maxLength` is 22: the widest valid paste (`00 (+356) 99 61 23 45`, 21 characters; the plain `00 (356) 99 61 23 45` has 20) fits, and one more digit fits and is rejected instead of being cut to a different valid number. A `+` before the first digit counts as the international prefix even after `(`, and a `00` after that `+` is not stripped, so `+00 (356) 9961 2345` is rejected as a foreign prefix. When the remainder after `+356` / `00356` starts with `0` (`+356 00 356 9961 2345`), the mask keeps the input on screen so the leftover `00` is not read as a new international prefix. `MLT` is now part of `SUPPORTED_PERSONAL_DATA_COUNTRIES`.
|
|
16
|
+
- New i18n keys in all locale bundles: `country-forms.address.state.label.MLT`, `country-forms.address.postalCode.placeholder.MLT`, `country-forms.personal-data.phone.placeholder.MLT`, `country-forms.validation.postalCode.MLT`.
|
|
17
|
+
|
|
18
|
+
## [1.45.0] - 2026-11-30
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- NANP territories MNP, PRI, and VIR (the `front.phone` `NANP.coffee` territories that had no schema yet; USA, CAN, ASM, DOM, and GUM already exist). The three share one pure phone helper, `src/rules/nanp-phone.ts`, so digit normalization is a single implementation; each country keeps its own validator and mask refs.
|
|
23
|
+
- MNP address schema (`address-MNP`). `address-form` has no MNP file, so the field order follows `country/default.ts`: postalCode → street → complement → city → state. Postal code is optional free text (`maxLength` 50, no regex, no mask). State is required free text with the shared "State" label. Street is required (`maxLength` 750; the legacy field has no max). Complement is optional (`maxLength` 750). Hidden legacy fields are omitted (`country`, `number`, `reference`, `neighborhood`) along with `receiverName`. `MNP` is now part of `SUPPORTED_ADDRESS_COUNTRIES`.
|
|
24
|
+
- PRI address schema (`address-PRI`). Field order: postalCode → street → complement → city, following the visible `address-form` `PRI.ts` fields. Postal code is required, 5 digits with an optional `+4` with or without a hyphen (`validatePostalCodePRI`, `/^\d{5}(-?\d{4})?$/` after trim, the legacy regex). No mask: the legacy mask `99999` only limits the input to 5 digits, which would also block the `+4`. `maxLength` is 10 (the legacy field uses 50). The hidden, required `state` (single option `PR`, default `PR`) and the hidden `number` (default `N/A`) are omitted, so consumers that need them must default them. Street is required (`maxLength` 750; the legacy field has no max). Complement is optional (`maxLength` 750). City is required (`maxLength` 100). `PRI` is now part of `SUPPORTED_ADDRESS_COUNTRIES`.
|
|
25
|
+
- VIR address schema (`address-VIR`). Field order: postalCode → street → complement → neighborhood → city, following the visible `address-form` `VIR.ts` fields. Postal code is required (`validatePostalCodeVIR`, the legacy regex): `008` plus `01`–`05`, `20`–`24`, `30`, `31`, `40`, `41`, `50`, or `51`, optionally followed by 4 digits. The legacy regex requires a hyphen before the `+4`; it is optional here because the field is numeric and most mobile keypads have no hyphen key, so `008021234` is valid. Masks `formatPostalCodeVIR` / `unformatPostalCodeVIR` show 9 digits as `00802-1234` and send them without the hyphen to the API; any other value (partial input, letters, extra digits) is returned unchanged, so nothing is dropped or truncated into a valid value. The legacy `99999` mask is not reproduced (it would block the `+4`); `maxLength` is 10. Neighborhood is optional and visible (`maxLength` 100), unlike the default form. The hidden `state` (default `VI`; legacy neither requires it nor restricts it to options) and the hidden `number` (default `N/A`) are omitted. Street is required (`maxLength` 750), complement is optional (`maxLength` 750), city is required (`maxLength` 100). `VIR` is now part of `SUPPORTED_ADDRESS_COUNTRIES`.
|
|
26
|
+
- MNP, PRI, and VIR personal-data schemas (`personal-data-MNP`, `personal-data-PRI`, `personal-data-VIR`). `personType` toggles individual/business visibility for `lastName`; no tax/identity document field (`profile-form` has no MNP, PRI, or VIR rules, and the generic default document is free text with no check digit). Adds `validatePhoneMNP`/`validatePhonePRI`/`validatePhoneVIR` and masks `formatPhoneXXX`/`unformatPhoneXXX` (national display `(670) 234 5678`, `(787) 722 1234`, `(340) 774 1234`). The national number is a territory area code (MNP `670`, PRI `787` or `939`, VIR `340`, the lists in `front.phone` `NANP.coffee`) plus 7 subscriber digits, and the central-office code must start with `2`–`9` (same structural rule as USA and CAN; `front.phone` accepts any 7 digits and, because the three share one NANP regex, any NANP area code for any of them). Other NANP area codes, including the other territories and US toll-free, are rejected. With `+`/`00`, country code `1` is always stripped (the mask keeps `+`/`00`/`001` on screen until that strip happens); without a prefix it is stripped only past 10 digits. Only one `1` is stripped: when a second `1` follows it, the validator rejects the value and the mask returns the input unchanged. Foreign `+`/`00` prefixes are rejected. `maxLength` is 20, so `001 (787) 722 1234` is not truncated. All three are now part of `SUPPORTED_PERSONAL_DATA_COUNTRIES`.
|
|
27
|
+
- New i18n keys in all locale bundles: `country-forms.address.postalCode.placeholder.PRI`, `country-forms.address.postalCode.placeholder.VIR`, `country-forms.personal-data.phone.placeholder.MNP`, `country-forms.personal-data.phone.placeholder.PRI`, `country-forms.personal-data.phone.placeholder.VIR`, `country-forms.validation.postalCode.PRI`, `country-forms.validation.postalCode.VIR`.
|
|
28
|
+
|
|
10
29
|
## [1.44.0] - 2026-11-30
|
|
11
30
|
|
|
12
31
|
### Added
|
|
@@ -482,7 +501,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
482
501
|
- `examples/react-minimal/` — React example with country/locale selection, form rendering, validation, and i18n overrides
|
|
483
502
|
|
|
484
503
|
|
|
485
|
-
[Unreleased]: https://github.com/vtex/country-forms/compare/v1.
|
|
504
|
+
[Unreleased]: https://github.com/vtex/country-forms/compare/v1.46.0...HEAD
|
|
505
|
+
[1.46.0]: https://github.com/vtex/country-forms/compare/v1.45.0...v1.46.0
|
|
506
|
+
[1.45.0]: https://github.com/vtex/country-forms/compare/v1.44.0...v1.45.0
|
|
486
507
|
[1.44.0]: https://github.com/vtex/country-forms/compare/v1.43.0...v1.44.0
|
|
487
508
|
[1.43.0]: https://github.com/vtex/country-forms/compare/v1.42.0...v1.43.0
|
|
488
509
|
[1.42.0]: https://github.com/vtex/country-forms/compare/v1.41.0...v1.42.0
|
package/README.md
CHANGED
|
@@ -89,8 +89,8 @@ Both `loadSchema` and `loadLocale` use dynamic `import()` internally — only th
|
|
|
89
89
|
|
|
90
90
|
| Constant | Type | Description |
|
|
91
91
|
|----------|------|-------------|
|
|
92
|
-
| `SUPPORTED_ADDRESS_COUNTRIES` | `readonly string[]` | Countries with a dedicated address schema (`['AGO', 'ARE', 'ARG', 'ASM', 'AUS', 'AUT', 'BEL', 'BGR', 'BOL', 'BRA', 'CAN', 'CHL', 'COL', 'CRI', 'CZE', 'DEU', 'DNK', 'DOM', 'ECU', 'ESP', 'FIN', 'FRA', 'GBR', 'GIB', 'GRC', 'GTM', 'GUM', 'HND', 'HRV', 'HUN', 'IDN', 'IND', 'IRL', 'IRQ', 'ITA', 'JAM', 'JPN', 'KOR', 'LTU', 'LUX', 'LVA', 'MEX', 'NZL', 'PER', 'USA']`). |
|
|
93
|
-
| `SUPPORTED_PERSONAL_DATA_COUNTRIES` | `readonly string[]` | Countries with a dedicated personal-data schema (`['AGO', 'ARE', 'ARG', 'ASM', 'AUS', 'AUT', 'BEL', 'BGR', 'BOL', 'BRA', 'CAN', 'CHL', 'COL', 'CRI', 'CZE', 'DEU', 'DNK', 'DOM', 'ECU', 'ESP', 'FIN', 'FRA', 'GBR', 'GIB', 'GRC', 'GTM', 'GUM', 'HND', 'HRV', 'HUN', 'IDN', 'IND', 'IRQ', 'ITA', 'JAM', 'JPN', 'KOR', 'LTU', 'LUX', 'LVA', 'MEX', 'NZL', 'PER', 'USA']`). |
|
|
92
|
+
| `SUPPORTED_ADDRESS_COUNTRIES` | `readonly string[]` | Countries with a dedicated address schema (`['AGO', 'ARE', 'ARG', 'ASM', 'AUS', 'AUT', 'BEL', 'BGR', 'BOL', 'BRA', 'CAN', 'CHL', 'COL', 'CRI', 'CZE', 'DEU', 'DNK', 'DOM', 'ECU', 'ESP', 'FIN', 'FRA', 'GBR', 'GIB', 'GRC', 'GTM', 'GUM', 'HND', 'HRV', 'HUN', 'IDN', 'IND', 'IRL', 'IRQ', 'ITA', 'JAM', 'JPN', 'KOR', 'LTU', 'LUX', 'LVA', 'MEX', 'MLT', 'MNP', 'NZL', 'PER', 'PRI', 'USA', 'VIR']`). |
|
|
93
|
+
| `SUPPORTED_PERSONAL_DATA_COUNTRIES` | `readonly string[]` | Countries with a dedicated personal-data schema (`['AGO', 'ARE', 'ARG', 'ASM', 'AUS', 'AUT', 'BEL', 'BGR', 'BOL', 'BRA', 'CAN', 'CHL', 'COL', 'CRI', 'CZE', 'DEU', 'DNK', 'DOM', 'ECU', 'ESP', 'FIN', 'FRA', 'GBR', 'GIB', 'GRC', 'GTM', 'GUM', 'HND', 'HRV', 'HUN', 'IDN', 'IND', 'IRQ', 'ITA', 'JAM', 'JPN', 'KOR', 'LTU', 'LUX', 'LVA', 'MEX', 'MLT', 'MNP', 'NZL', 'PER', 'PRI', 'USA', 'VIR']`). |
|
|
94
94
|
| `SUPPORTED_LOCALES` | `readonly string[]` | Every locale tag `loadLocale` accepts (including checkout aliases). See [Supported Locales](#supported-locales). |
|
|
95
95
|
| `CANONICAL_LOCALES` | `readonly string[]` | Dedicated bundle tags only — use for locale selectors. |
|
|
96
96
|
| `LOCALE_ALIASES` | `readonly string[]` | Alias tags that fall through to a canonical bundle in `loadLocale`. |
|
|
@@ -167,7 +167,11 @@ import type {
|
|
|
167
167
|
| Lithuania | `LTU` | Yes | Yes | Postal code, Phone | Postal code, Phone |
|
|
168
168
|
| Luxembourg | `LUX` | Yes | Yes | Phone | Phone |
|
|
169
169
|
| Latvia | `LVA` | Yes | Yes | Postal code, Phone | Postal code, Phone |
|
|
170
|
+
| Malta | `MLT` | Yes | Yes | Postal code, Phone | Postal code, Phone |
|
|
171
|
+
| Northern Mariana Islands | `MNP` | Yes | Yes | Phone | Phone |
|
|
170
172
|
| New Zealand | `NZL` | Yes | Yes | Postal code, Phone | Phone |
|
|
173
|
+
| Puerto Rico | `PRI` | Yes | Yes | Postal code, Phone | Phone |
|
|
174
|
+
| U.S. Virgin Islands | `VIR` | Yes | Yes | Postal code, Phone | Phone |
|
|
171
175
|
|
|
172
176
|
For unknown countries, `loadSchema` returns a generic fallback schema with basic address or personal-data fields.
|
|
173
177
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/schemas/address/MLT.ts
|
|
4
|
+
var schema = {
|
|
5
|
+
id: "address-MLT",
|
|
6
|
+
country: "MLT",
|
|
7
|
+
formType: "address",
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: "postalCode",
|
|
11
|
+
type: "text",
|
|
12
|
+
label: "country-forms.address.postalCode.label",
|
|
13
|
+
placeholder: "country-forms.address.postalCode.placeholder.MLT",
|
|
14
|
+
required: true,
|
|
15
|
+
inputMode: "text",
|
|
16
|
+
maxLength: 9,
|
|
17
|
+
formatRef: "formatPostalCodeMLT",
|
|
18
|
+
unformatRef: "unformatPostalCodeMLT",
|
|
19
|
+
validation: {
|
|
20
|
+
customValidator: "validatePostalCodeMLT"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "street",
|
|
25
|
+
type: "text",
|
|
26
|
+
label: "country-forms.address.street.label",
|
|
27
|
+
required: true,
|
|
28
|
+
inputMode: "text",
|
|
29
|
+
maxLength: 750,
|
|
30
|
+
validation: {
|
|
31
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "number",
|
|
36
|
+
type: "text",
|
|
37
|
+
label: "country-forms.address.number.label",
|
|
38
|
+
required: true,
|
|
39
|
+
inputMode: "text",
|
|
40
|
+
maxLength: 750,
|
|
41
|
+
validation: {
|
|
42
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "complement",
|
|
47
|
+
type: "text",
|
|
48
|
+
label: "country-forms.address.complement.label",
|
|
49
|
+
required: false,
|
|
50
|
+
inputMode: "text",
|
|
51
|
+
maxLength: 750,
|
|
52
|
+
validation: {
|
|
53
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "neighborhood",
|
|
58
|
+
type: "text",
|
|
59
|
+
label: "country-forms.address.neighborhood.label",
|
|
60
|
+
required: true,
|
|
61
|
+
inputMode: "text",
|
|
62
|
+
maxLength: 100,
|
|
63
|
+
validation: {
|
|
64
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "city",
|
|
69
|
+
type: "text",
|
|
70
|
+
label: "country-forms.address.city.label",
|
|
71
|
+
required: true,
|
|
72
|
+
inputMode: "text",
|
|
73
|
+
maxLength: 100,
|
|
74
|
+
validation: {
|
|
75
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "state",
|
|
80
|
+
type: "select",
|
|
81
|
+
label: "country-forms.address.state.label.MLT",
|
|
82
|
+
required: true,
|
|
83
|
+
options: "MLT.councils"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
};
|
|
87
|
+
var MLT_default = schema;
|
|
88
|
+
|
|
89
|
+
module.exports = MLT_default;
|
|
90
|
+
//# sourceMappingURL=MLT-AAXWQO5M.js.map
|
|
91
|
+
//# sourceMappingURL=MLT-AAXWQO5M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/address/MLT.ts"],"names":[],"mappings":";;;AAyCA,IAAM,MAAA,GAAS;AAAA,EACb,EAAA,EAAI,aAAA;AAAA,EACJ,OAAA,EAAS,KAAA;AAAA,EACT,QAAA,EAAU,SAAA;AAAA,EACV,MAAA,EAAQ;AAAA,IACN;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,wCAAA;AAAA,MACP,WAAA,EAAa,kDAAA;AAAA,MACb,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,CAAA;AAAA,MACX,SAAA,EAAW,qBAAA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,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,kCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,OAAA;AAAA,MACN,IAAA,EAAM,QAAA;AAAA,MACN,KAAA,EAAO,uCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"MLT-AAXWQO5M.js","sourcesContent":["/**\n * Address schema for Malta (MLT).\n *\n * Field order: postalCode → street → number → complement → neighborhood →\n * city → state (matches the visible legacy `address-form` MLT fields; omits\n * hidden `country` / `reference` and `receiverName`, which are outside this\n * library's address model).\n *\n * Postal code: required, 2–3 letters and 4 digits with an optional space\n * (`\"VLT 1117\"`, `\"VLT1117\"`), validated by `validatePostalCodeMLT` (parity\n * with `address-form` `MLT.ts` regex `^[a-zA-Z]{2,3}\\ ?\\d{4}$`; the letters are\n * not checked against the real locality codes, as in the legacy form). Masks\n * `formatPostalCodeMLT` / `unformatPostalCodeMLT` upper-case the code and show\n * a space once it is complete (`vlt1117` → `VLT 1117`), using the validator's\n * own pattern so they never accept what the validator rejects; the API receives\n * it without the space (`VLT1117`). The legacy mask `AAA 999` is not reproduced:\n * it has 3 digit slots while the regex needs 4, so it would cut a valid code.\n * `maxLength` is 9 (the legacy field uses 8): the 8 characters of `\"VLT 1117\"`\n * plus one for a pasted space. With 8, a code with one more digit\n * (`\"VLT 11172\"`) would be cut to the different, valid `\"VLT 1117\"`; with 9 it\n * fits and is rejected by the validator instead. The limit is one character of\n * slack, not a guarantee: a paste with both surrounding whitespace and an extra\n * digit is still cut (JPN, LTU and LUX have the same gap).\n *\n * Subdivision: required select of the local councils — options ref\n * `\"MLT.councils\"`. `value` equals `displayValue` and is the exact string\n * `address-form` stores (`\"Attard (Attard)\"`, `\"Vittoriosa (Birgu)\"`). Label:\n * `country-forms.address.state.label.MLT` (English \"Local council\"; the legacy\n * select caption is \"Council\").\n *\n * Street is required. The legacy field has no max length; this schema caps it\n * at 750, the same cap used for other countries. `number` is required\n * (`maxLength` 750). Complement is optional (`maxLength` 750). Neighborhood is\n * required (`maxLength` 100), as in `address-form`. City is required\n * (`maxLength` 100).\n *\n * Required rule modules: `rules/validators/mlt`, `rules/masks/mlt`,\n * `rules/options/mlt-councils`\n */\nimport type { FormSchema } from '../../types'\n\nconst schema = {\n id: 'address-MLT',\n country: 'MLT',\n formType: 'address',\n fields: [\n {\n name: 'postalCode',\n type: 'text',\n label: 'country-forms.address.postalCode.label',\n placeholder: 'country-forms.address.postalCode.placeholder.MLT',\n required: true,\n inputMode: 'text',\n maxLength: 9,\n formatRef: 'formatPostalCodeMLT',\n unformatRef: 'unformatPostalCodeMLT',\n validation: {\n customValidator: 'validatePostalCodeMLT',\n },\n },\n {\n name: 'street',\n type: 'text',\n label: 'country-forms.address.street.label',\n required: true,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'number',\n type: 'text',\n label: 'country-forms.address.number.label',\n required: true,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'complement',\n type: 'text',\n label: 'country-forms.address.complement.label',\n required: false,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'neighborhood',\n type: 'text',\n label: 'country-forms.address.neighborhood.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'city',\n type: 'text',\n label: 'country-forms.address.city.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'state',\n type: 'select',\n label: 'country-forms.address.state.label.MLT',\n required: true,\n options: 'MLT.councils',\n },\n ],\n} satisfies FormSchema\n\nexport default schema\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/schemas/address/MLT.ts
|
|
2
|
+
var schema = {
|
|
3
|
+
id: "address-MLT",
|
|
4
|
+
country: "MLT",
|
|
5
|
+
formType: "address",
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: "postalCode",
|
|
9
|
+
type: "text",
|
|
10
|
+
label: "country-forms.address.postalCode.label",
|
|
11
|
+
placeholder: "country-forms.address.postalCode.placeholder.MLT",
|
|
12
|
+
required: true,
|
|
13
|
+
inputMode: "text",
|
|
14
|
+
maxLength: 9,
|
|
15
|
+
formatRef: "formatPostalCodeMLT",
|
|
16
|
+
unformatRef: "unformatPostalCodeMLT",
|
|
17
|
+
validation: {
|
|
18
|
+
customValidator: "validatePostalCodeMLT"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: "street",
|
|
23
|
+
type: "text",
|
|
24
|
+
label: "country-forms.address.street.label",
|
|
25
|
+
required: true,
|
|
26
|
+
inputMode: "text",
|
|
27
|
+
maxLength: 750,
|
|
28
|
+
validation: {
|
|
29
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "number",
|
|
34
|
+
type: "text",
|
|
35
|
+
label: "country-forms.address.number.label",
|
|
36
|
+
required: true,
|
|
37
|
+
inputMode: "text",
|
|
38
|
+
maxLength: 750,
|
|
39
|
+
validation: {
|
|
40
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "complement",
|
|
45
|
+
type: "text",
|
|
46
|
+
label: "country-forms.address.complement.label",
|
|
47
|
+
required: false,
|
|
48
|
+
inputMode: "text",
|
|
49
|
+
maxLength: 750,
|
|
50
|
+
validation: {
|
|
51
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "neighborhood",
|
|
56
|
+
type: "text",
|
|
57
|
+
label: "country-forms.address.neighborhood.label",
|
|
58
|
+
required: true,
|
|
59
|
+
inputMode: "text",
|
|
60
|
+
maxLength: 100,
|
|
61
|
+
validation: {
|
|
62
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "city",
|
|
67
|
+
type: "text",
|
|
68
|
+
label: "country-forms.address.city.label",
|
|
69
|
+
required: true,
|
|
70
|
+
inputMode: "text",
|
|
71
|
+
maxLength: 100,
|
|
72
|
+
validation: {
|
|
73
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "state",
|
|
78
|
+
type: "select",
|
|
79
|
+
label: "country-forms.address.state.label.MLT",
|
|
80
|
+
required: true,
|
|
81
|
+
options: "MLT.councils"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
var MLT_default = schema;
|
|
86
|
+
|
|
87
|
+
export { MLT_default as default };
|
|
88
|
+
//# sourceMappingURL=MLT-G2A4PKU3.mjs.map
|
|
89
|
+
//# sourceMappingURL=MLT-G2A4PKU3.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/address/MLT.ts"],"names":[],"mappings":";AAyCA,IAAM,MAAA,GAAS;AAA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A,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,cAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,0CAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,kCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,OAAA;AAAA,MACN,IAAA,EAAM,QAAA;AAAA,MACN,KAAA,EAAO,uCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"MLT-G2A4PKU3.mjs","sourcesContent":["/**\n * Address schema for Malta (MLT).\n *\n * Field order: postalCode → street → number → complement → neighborhood →\n * city → state (matches the visible legacy `address-form` MLT fields; omits\n * hidden `country` / `reference` and `receiverName`, which are outside this\n * library's address model).\n *\n * Postal code: required, 2–3 letters and 4 digits with an optional space\n * (`\"VLT 1117\"`, `\"VLT1117\"`), validated by `validatePostalCodeMLT` (parity\n * with `address-form` `MLT.ts` regex `^[a-zA-Z]{2,3}\\ ?\\d{4}$`; the letters are\n * not checked against the real locality codes, as in the legacy form). Masks\n * `formatPostalCodeMLT` / `unformatPostalCodeMLT` upper-case the code and show\n * a space once it is complete (`vlt1117` → `VLT 1117`), using the validator's\n * own pattern so they never accept what the validator rejects; the API receives\n * it without the space (`VLT1117`). The legacy mask `AAA 999` is not reproduced:\n * it has 3 digit slots while the regex needs 4, so it would cut a valid code.\n * `maxLength` is 9 (the legacy field uses 8): the 8 characters of `\"VLT 1117\"`\n * plus one for a pasted space. With 8, a code with one more digit\n * (`\"VLT 11172\"`) would be cut to the different, valid `\"VLT 1117\"`; with 9 it\n * fits and is rejected by the validator instead. The limit is one character of\n * slack, not a guarantee: a paste with both surrounding whitespace and an extra\n * digit is still cut (JPN, LTU and LUX have the same gap).\n *\n * Subdivision: required select of the local councils — options ref\n * `\"MLT.councils\"`. `value` equals `displayValue` and is the exact string\n * `address-form` stores (`\"Attard (Attard)\"`, `\"Vittoriosa (Birgu)\"`). Label:\n * `country-forms.address.state.label.MLT` (English \"Local council\"; the legacy\n * select caption is \"Council\").\n *\n * Street is required. The legacy field has no max length; this schema caps it\n * at 750, the same cap used for other countries. `number` is required\n * (`maxLength` 750). Complement is optional (`maxLength` 750). Neighborhood is\n * required (`maxLength` 100), as in `address-form`. City is required\n * (`maxLength` 100).\n *\n * Required rule modules: `rules/validators/mlt`, `rules/masks/mlt`,\n * `rules/options/mlt-councils`\n */\nimport type { FormSchema } from '../../types'\n\nconst schema = {\n id: 'address-MLT',\n country: 'MLT',\n formType: 'address',\n fields: [\n {\n name: 'postalCode',\n type: 'text',\n label: 'country-forms.address.postalCode.label',\n placeholder: 'country-forms.address.postalCode.placeholder.MLT',\n required: true,\n inputMode: 'text',\n maxLength: 9,\n formatRef: 'formatPostalCodeMLT',\n unformatRef: 'unformatPostalCodeMLT',\n validation: {\n customValidator: 'validatePostalCodeMLT',\n },\n },\n {\n name: 'street',\n type: 'text',\n label: 'country-forms.address.street.label',\n required: true,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'number',\n type: 'text',\n label: 'country-forms.address.number.label',\n required: true,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'complement',\n type: 'text',\n label: 'country-forms.address.complement.label',\n required: false,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'neighborhood',\n type: 'text',\n label: 'country-forms.address.neighborhood.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'city',\n type: 'text',\n label: 'country-forms.address.city.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'state',\n type: 'select',\n label: 'country-forms.address.state.label.MLT',\n required: true,\n options: 'MLT.councils',\n },\n ],\n} satisfies FormSchema\n\nexport default schema\n"]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/schemas/personal-data/MLT.ts
|
|
4
|
+
var schema = {
|
|
5
|
+
id: "personal-data-MLT",
|
|
6
|
+
country: "MLT",
|
|
7
|
+
formType: "personal-data",
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: "personType",
|
|
11
|
+
type: "radio-group",
|
|
12
|
+
label: "country-forms.personal-data.personType.label",
|
|
13
|
+
required: true,
|
|
14
|
+
options: [
|
|
15
|
+
{ value: "individual", displayValue: "country-forms.personal-data.personType.individual" },
|
|
16
|
+
{ value: "business", displayValue: "country-forms.personal-data.personType.business" }
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "firstName",
|
|
21
|
+
type: "text",
|
|
22
|
+
label: "country-forms.personal-data.firstName.label",
|
|
23
|
+
required: true,
|
|
24
|
+
inputMode: "text",
|
|
25
|
+
maxLength: 100,
|
|
26
|
+
dependsOn: "personType",
|
|
27
|
+
conditionalLabel: {
|
|
28
|
+
individual: "country-forms.personal-data.firstName.label.individual",
|
|
29
|
+
business: "country-forms.personal-data.firstName.label.business"
|
|
30
|
+
},
|
|
31
|
+
validation: {
|
|
32
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "lastName",
|
|
37
|
+
type: "text",
|
|
38
|
+
label: "country-forms.personal-data.lastName.label",
|
|
39
|
+
required: true,
|
|
40
|
+
inputMode: "text",
|
|
41
|
+
maxLength: 100,
|
|
42
|
+
conditionalVisibility: {
|
|
43
|
+
field: "personType",
|
|
44
|
+
operator: "equals",
|
|
45
|
+
value: "individual"
|
|
46
|
+
},
|
|
47
|
+
validation: {
|
|
48
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "email",
|
|
53
|
+
type: "email",
|
|
54
|
+
label: "country-forms.personal-data.email.label",
|
|
55
|
+
required: true,
|
|
56
|
+
inputMode: "email",
|
|
57
|
+
validation: {
|
|
58
|
+
customValidator: "validateEmail"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "phone",
|
|
63
|
+
type: "text",
|
|
64
|
+
// 22 chars: the widest valid paste is 21 characters ("00 (+356) 99 61 23 45"; the
|
|
65
|
+
// plain "00 (356) 99 61 23 45" has 20 and "00 (+356) 9961 2345" has 19), so one more
|
|
66
|
+
// digit fits and is rejected instead of being cut down to a different valid number.
|
|
67
|
+
// "+00 (356) …" is not valid, because a "00" after "+" is not an international
|
|
68
|
+
// prefix. The limit is one character of slack, not a guarantee: a 22-character valid
|
|
69
|
+
// value followed by more characters is still cut (JPN, KOR, LTU, LUX and LVA have the
|
|
70
|
+
// same gap).
|
|
71
|
+
maxLength: 22,
|
|
72
|
+
label: "country-forms.personal-data.phone.label",
|
|
73
|
+
placeholder: "country-forms.personal-data.phone.placeholder.MLT",
|
|
74
|
+
required: true,
|
|
75
|
+
inputMode: "tel",
|
|
76
|
+
formatRef: "formatPhoneMLT",
|
|
77
|
+
unformatRef: "unformatPhoneMLT",
|
|
78
|
+
validation: {
|
|
79
|
+
customValidator: "validatePhoneMLT"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
var MLT_default = schema;
|
|
85
|
+
|
|
86
|
+
module.exports = MLT_default;
|
|
87
|
+
//# sourceMappingURL=MLT-ZEGEH77F.js.map
|
|
88
|
+
//# sourceMappingURL=MLT-ZEGEH77F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/personal-data/MLT.ts"],"names":[],"mappings":";;;AAkCA,IAAM,MAAA,GAAS;AAAA,EACb,EAAA,EAAI,mBAAA;AAAA,EACJ,OAAA,EAAS,KAAA;AAAA,EACT,QAAA,EAAU,eAAA;AAAA,EACV,MAAA,EAAQ;AAAA,IACN;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,IAAA,EAAM,aAAA;AAAA,MACN,KAAA,EAAO,8CAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,OAAA,EAAS;AAAA,QACP,EAAE,KAAA,EAAO,YAAA,EAAc,YAAA,EAAc,mDAAA,EAAoD;AAAA,QACzF,EAAE,KAAA,EAAO,UAAA,EAAY,YAAA,EAAc,iDAAA;AAAkD;AACvF,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,WAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,6CAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,SAAA,EAAW,YAAA;AAAA,MACX,gBAAA,EAAkB;AAAA,QAChB,UAA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sourcesContent":["/**\n * Personal-data schema for Malta (MLT).\n *\n * Field order: personType → firstName → lastName → email → phone\n *\n * `personType` drives conditional visibility:\n * - `\"individual\"` → `lastName` visible\n * - `\"business\"` → `lastName` hidden; `firstName` labelled as company name\n *\n * `profile-form` has no `MLT.js`, so it falls back to the generic default\n * rules (required free-text `document`, no check digit). No tax/identity\n * document field is modelled here. Optional gender and birth date are omitted.\n * Business fields (`corporateName`, `tradeName`, `corporateDocument`,\n * `businessPhone`) are optional there. Email is hidden there; here it is\n * required. `homePhone` is optional there; `phone` is required here.\n *\n * Email: validated by `validateEmail` (shared).\n * Phone: `9961 2345` mobile / `2123 4567` fixed line — validated by\n * `validatePhoneMLT`, masked by `formatPhoneMLT`/`unformatPhoneMLT`. There is\n * no `front.phone` MLT module; rules follow the Maltese numbering plan\n * (country code `356`, no trunk prefix, 8-digit numbers) and libphonenumber's\n * `MT` ranges: mobile `7210`, `77xx`/`79xx`, `92xx`, `99xx`, `9696`, `9697`,\n * `9811`–`9813`, `9889`, `9897`, and fixed line `2031`–`2034`, `2060`, `2065`,\n * `2069`, `201`, `209`, `21`–`23`, `25`, `27`, `260`. `+356` / `00356` are\n * stripped once; a bare `356` is stripped only when the remainder is a complete\n * valid number (no national number starts with `356`). A foreign `+` / `00`\n * prefix (including Italy `+39`, the United Kingdom `+44`, Germany `+49`) is\n * rejected, and so is `+00…`: a `00` after a `+` is not an international prefix.\n *\n * Required rule modules: `rules/validators/common`, `rules/validators/mlt`,\n * `rules/masks/mlt`\n */\nimport type { FormSchema } from '../../types'\n\nconst schema = {\n id: 'personal-data-MLT',\n country: 'MLT',\n formType: 'personal-data',\n fields: [\n {\n name: 'personType',\n type: 'radio-group',\n label: 'country-forms.personal-data.personType.label',\n required: true,\n options: [\n { value: 'individual', displayValue: 'country-forms.personal-data.personType.individual' },\n { value: 'business', displayValue: 'country-forms.personal-data.personType.business' },\n ],\n },\n {\n name: 'firstName',\n type: 'text',\n label: 'country-forms.personal-data.firstName.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n dependsOn: 'personType',\n conditionalLabel: {\n individual: 'country-forms.personal-data.firstName.label.individual',\n business: 'country-forms.personal-data.firstName.label.business',\n },\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'lastName',\n type: 'text',\n label: 'country-forms.personal-data.lastName.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n conditionalVisibility: {\n field: 'personType',\n operator: 'equals',\n value: 'individual',\n },\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'email',\n type: 'email',\n label: 'country-forms.personal-data.email.label',\n required: true,\n inputMode: 'email',\n validation: {\n customValidator: 'validateEmail',\n },\n },\n {\n name: 'phone',\n type: 'text',\n // 22 chars: the widest valid paste is 21 characters (\"00 (+356) 99 61 23 45\"; the\n // plain \"00 (356) 99 61 23 45\" has 20 and \"00 (+356) 9961 2345\" has 19), so one more\n // digit fits and is rejected instead of being cut down to a different valid number.\n // \"+00 (356) …\" is not valid, because a \"00\" after \"+\" is not an international\n // prefix. The limit is one character of slack, not a guarantee: a 22-character valid\n // value followed by more characters is still cut (JPN, KOR, LTU, LUX and LVA have the\n // same gap).\n maxLength: 22,\n label: 'country-forms.personal-data.phone.label',\n placeholder: 'country-forms.personal-data.phone.placeholder.MLT',\n required: true,\n inputMode: 'tel',\n formatRef: 'formatPhoneMLT',\n unformatRef: 'unformatPhoneMLT',\n validation: {\n customValidator: 'validatePhoneMLT',\n },\n },\n ],\n} satisfies FormSchema\n\nexport default schema\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// src/schemas/personal-data/MLT.ts
|
|
2
|
+
var schema = {
|
|
3
|
+
id: "personal-data-MLT",
|
|
4
|
+
country: "MLT",
|
|
5
|
+
formType: "personal-data",
|
|
6
|
+
fields: [
|
|
7
|
+
{
|
|
8
|
+
name: "personType",
|
|
9
|
+
type: "radio-group",
|
|
10
|
+
label: "country-forms.personal-data.personType.label",
|
|
11
|
+
required: true,
|
|
12
|
+
options: [
|
|
13
|
+
{ value: "individual", displayValue: "country-forms.personal-data.personType.individual" },
|
|
14
|
+
{ value: "business", displayValue: "country-forms.personal-data.personType.business" }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "firstName",
|
|
19
|
+
type: "text",
|
|
20
|
+
label: "country-forms.personal-data.firstName.label",
|
|
21
|
+
required: true,
|
|
22
|
+
inputMode: "text",
|
|
23
|
+
maxLength: 100,
|
|
24
|
+
dependsOn: "personType",
|
|
25
|
+
conditionalLabel: {
|
|
26
|
+
individual: "country-forms.personal-data.firstName.label.individual",
|
|
27
|
+
business: "country-forms.personal-data.firstName.label.business"
|
|
28
|
+
},
|
|
29
|
+
validation: {
|
|
30
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "lastName",
|
|
35
|
+
type: "text",
|
|
36
|
+
label: "country-forms.personal-data.lastName.label",
|
|
37
|
+
required: true,
|
|
38
|
+
inputMode: "text",
|
|
39
|
+
maxLength: 100,
|
|
40
|
+
conditionalVisibility: {
|
|
41
|
+
field: "personType",
|
|
42
|
+
operator: "equals",
|
|
43
|
+
value: "individual"
|
|
44
|
+
},
|
|
45
|
+
validation: {
|
|
46
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "email",
|
|
51
|
+
type: "email",
|
|
52
|
+
label: "country-forms.personal-data.email.label",
|
|
53
|
+
required: true,
|
|
54
|
+
inputMode: "email",
|
|
55
|
+
validation: {
|
|
56
|
+
customValidator: "validateEmail"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "phone",
|
|
61
|
+
type: "text",
|
|
62
|
+
// 22 chars: the widest valid paste is 21 characters ("00 (+356) 99 61 23 45"; the
|
|
63
|
+
// plain "00 (356) 99 61 23 45" has 20 and "00 (+356) 9961 2345" has 19), so one more
|
|
64
|
+
// digit fits and is rejected instead of being cut down to a different valid number.
|
|
65
|
+
// "+00 (356) …" is not valid, because a "00" after "+" is not an international
|
|
66
|
+
// prefix. The limit is one character of slack, not a guarantee: a 22-character valid
|
|
67
|
+
// value followed by more characters is still cut (JPN, KOR, LTU, LUX and LVA have the
|
|
68
|
+
// same gap).
|
|
69
|
+
maxLength: 22,
|
|
70
|
+
label: "country-forms.personal-data.phone.label",
|
|
71
|
+
placeholder: "country-forms.personal-data.phone.placeholder.MLT",
|
|
72
|
+
required: true,
|
|
73
|
+
inputMode: "tel",
|
|
74
|
+
formatRef: "formatPhoneMLT",
|
|
75
|
+
unformatRef: "unformatPhoneMLT",
|
|
76
|
+
validation: {
|
|
77
|
+
customValidator: "validatePhoneMLT"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
var MLT_default = schema;
|
|
83
|
+
|
|
84
|
+
export { MLT_default as default };
|
|
85
|
+
//# sourceMappingURL=MLT-ZV2AIVQJ.mjs.map
|
|
86
|
+
//# sourceMappingURL=MLT-ZV2AIVQJ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/personal-data/MLT.ts"],"names":[],"mappings":";AAkCA,IAAM,MAAA,GAAS;AAAA,EACb,EAAA,EAAI,mBAAA;AAAA,EACJ,OAAA,EAAS,KAAA;AAAA,EACT,QAAA,EAAU,eAAA;AAAA,EACV,MAAA,EAAQ;AAAA,IACN;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,IAAA,EAAM,aAAA;AAAA,MACN,KAAA,EAAO,8CAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,OAAA,EAAS;AAAA,QACP,EAAE,KAAA,EAAO,YAAA,EAAc,YAAA,EAAc,mDAAA,EAAoD;AAAA,QACzF,EAAE,KAAA,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W,EAAA;AAAA,MACX,KAAA,EAAO,yCAAA;AAAA,MACP,WAAA,EAAa,mDAAA;AAAA,MACb,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,KAAA;AAAA,MACX,SAAA,EAAW,gBAAA;AAAA,MACX,WAAA,EAAa,kBAAA;AAAA,MACb,UAAA,EAAY;AAAA,QACV,eAAA,EAAiB;AAAA;AACnB;AACF;AAEJ,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"MLT-ZV2AIVQJ.mjs","sourcesContent":["/**\n * Personal-data schema for Malta (MLT).\n *\n * Field order: personType → firstName → lastName → email → phone\n *\n * `personType` drives conditional visibility:\n * - `\"individual\"` → `lastName` visible\n * - `\"business\"` → `lastName` hidden; `firstName` labelled as company name\n *\n * `profile-form` has no `MLT.js`, so it falls back to the generic default\n * rules (required free-text `document`, no check digit). No tax/identity\n * document field is modelled here. Optional gender and birth date are omitted.\n * Business fields (`corporateName`, `tradeName`, `corporateDocument`,\n * `businessPhone`) are optional there. Email is hidden there; here it is\n * required. `homePhone` is optional there; `phone` is required here.\n *\n * Email: validated by `validateEmail` (shared).\n * Phone: `9961 2345` mobile / `2123 4567` fixed line — validated by\n * `validatePhoneMLT`, masked by `formatPhoneMLT`/`unformatPhoneMLT`. There is\n * no `front.phone` MLT module; rules follow the Maltese numbering plan\n * (country code `356`, no trunk prefix, 8-digit numbers) and libphonenumber's\n * `MT` ranges: mobile `7210`, `77xx`/`79xx`, `92xx`, `99xx`, `9696`, `9697`,\n * `9811`–`9813`, `9889`, `9897`, and fixed line `2031`–`2034`, `2060`, `2065`,\n * `2069`, `201`, `209`, `21`–`23`, `25`, `27`, `260`. `+356` / `00356` are\n * stripped once; a bare `356` is stripped only when the remainder is a complete\n * valid number (no national number starts with `356`). A foreign `+` / `00`\n * prefix (including Italy `+39`, the United Kingdom `+44`, Germany `+49`) is\n * rejected, and so is `+00…`: a `00` after a `+` is not an international prefix.\n *\n * Required rule modules: `rules/validators/common`, `rules/validators/mlt`,\n * `rules/masks/mlt`\n */\nimport type { FormSchema } from '../../types'\n\nconst schema = {\n id: 'personal-data-MLT',\n country: 'MLT',\n formType: 'personal-data',\n fields: [\n {\n name: 'personType',\n type: 'radio-group',\n label: 'country-forms.personal-data.personType.label',\n required: true,\n options: [\n { value: 'individual', displayValue: 'country-forms.personal-data.personType.individual' },\n { value: 'business', displayValue: 'country-forms.personal-data.personType.business' },\n ],\n },\n {\n name: 'firstName',\n type: 'text',\n label: 'country-forms.personal-data.firstName.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n dependsOn: 'personType',\n conditionalLabel: {\n individual: 'country-forms.personal-data.firstName.label.individual',\n business: 'country-forms.personal-data.firstName.label.business',\n },\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'lastName',\n type: 'text',\n label: 'country-forms.personal-data.lastName.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n conditionalVisibility: {\n field: 'personType',\n operator: 'equals',\n value: 'individual',\n },\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'email',\n type: 'email',\n label: 'country-forms.personal-data.email.label',\n required: true,\n inputMode: 'email',\n validation: {\n customValidator: 'validateEmail',\n },\n },\n {\n name: 'phone',\n type: 'text',\n // 22 chars: the widest valid paste is 21 characters (\"00 (+356) 99 61 23 45\"; the\n // plain \"00 (356) 99 61 23 45\" has 20 and \"00 (+356) 9961 2345\" has 19), so one more\n // digit fits and is rejected instead of being cut down to a different valid number.\n // \"+00 (356) …\" is not valid, because a \"00\" after \"+\" is not an international\n // prefix. The limit is one character of slack, not a guarantee: a 22-character valid\n // value followed by more characters is still cut (JPN, KOR, LTU, LUX and LVA have the\n // same gap).\n maxLength: 22,\n label: 'country-forms.personal-data.phone.label',\n placeholder: 'country-forms.personal-data.phone.placeholder.MLT',\n required: true,\n inputMode: 'tel',\n formatRef: 'formatPhoneMLT',\n unformatRef: 'unformatPhoneMLT',\n validation: {\n customValidator: 'validatePhoneMLT',\n },\n },\n ],\n} satisfies FormSchema\n\nexport default schema\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/schemas/address/MNP.ts
|
|
4
|
+
var schema = {
|
|
5
|
+
id: "address-MNP",
|
|
6
|
+
country: "MNP",
|
|
7
|
+
formType: "address",
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: "postalCode",
|
|
11
|
+
type: "text",
|
|
12
|
+
label: "country-forms.address.postalCode.label",
|
|
13
|
+
required: false,
|
|
14
|
+
inputMode: "text",
|
|
15
|
+
maxLength: 50,
|
|
16
|
+
validation: {
|
|
17
|
+
maxLength: { value: 50, message: "country-forms.validation.maxLength" }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "street",
|
|
22
|
+
type: "text",
|
|
23
|
+
label: "country-forms.address.street.label",
|
|
24
|
+
required: true,
|
|
25
|
+
inputMode: "text",
|
|
26
|
+
maxLength: 750,
|
|
27
|
+
validation: {
|
|
28
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "complement",
|
|
33
|
+
type: "text",
|
|
34
|
+
label: "country-forms.address.complement.label",
|
|
35
|
+
required: false,
|
|
36
|
+
inputMode: "text",
|
|
37
|
+
maxLength: 750,
|
|
38
|
+
validation: {
|
|
39
|
+
maxLength: { value: 750, message: "country-forms.validation.maxLength" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "city",
|
|
44
|
+
type: "text",
|
|
45
|
+
label: "country-forms.address.city.label",
|
|
46
|
+
required: true,
|
|
47
|
+
inputMode: "text",
|
|
48
|
+
maxLength: 100,
|
|
49
|
+
validation: {
|
|
50
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "state",
|
|
55
|
+
type: "text",
|
|
56
|
+
label: "country-forms.address.state.label",
|
|
57
|
+
required: true,
|
|
58
|
+
inputMode: "text",
|
|
59
|
+
maxLength: 100,
|
|
60
|
+
validation: {
|
|
61
|
+
maxLength: { value: 100, message: "country-forms.validation.maxLength" }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
var MNP_default = schema;
|
|
67
|
+
|
|
68
|
+
module.exports = MNP_default;
|
|
69
|
+
//# sourceMappingURL=MNP-C3PW6WOG.js.map
|
|
70
|
+
//# sourceMappingURL=MNP-C3PW6WOG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/address/MNP.ts"],"names":[],"mappings":";;;AAmBA,IAAM,MAAA,GAAS;AAAA,EACb,EAAA,EAAI,aAAA;AAAA,EACJ,OAAA,EAAS,KAAA;AAAA,EACT,QAAA,EAAU,SAAA;AAAA,EACV,MAAA,EAAQ;AAAA,IACN;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,wCAAA;AAAA,MACP,QAAA,EAAU,KAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,EAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,EAAA,EAAI,SAAS,oCAAA;AAAqC;AACxE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,QAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,oCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,YAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,wCAAA;AAAA,MACP,QAAA,EAAU,KAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,kCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE,KACF;AAAA,IACA;AAAA,MACE,IAAA,EAAM,OAAA;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,mCAAA;AAAA,MACP,QAAA,EAAU,IAAA;AAAA,MACV,SAAA,EAAW,MAAA;AAAA,MACX,SAAA,EAAW,GAAA;AAAA,MACX,UAAA,EAAY;AAAA,QACV,SAAA,EAAW,EAAE,KAAA,EAAO,GAAA,EAAK,SAAS,oCAAA;AAAqC;AACzE;AACF;AAEJ,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"MNP-C3PW6WOG.js","sourcesContent":["/**\n * Address schema for the Northern Mariana Islands (MNP).\n *\n * `address-form` has no `MNP.ts`. The checkout form is `country/default.ts`.\n * Visible field order: postalCode → street → complement → city → state.\n * Hidden legacy fields are omitted: `country`, `number`, `reference`,\n * `neighborhood`, and `receiverName` (outside this library's address model).\n *\n * Postal code: optional free text, `maxLength` 50, no regex and no mask\n * (the default rules do not validate it). USPS ZIPs `96950`–`96952` are\n * the usual codes, but the legacy field also accepts any other string.\n * Subdivision: required free text (`maxLength` 100), label \"State\" — the\n * default form is not a municipality select.\n * Street is required. The legacy field has no max length; this schema caps\n * it at 750, the same cap used for other countries. Complement is optional\n * (`maxLength` 750). City is required (`maxLength` 100).\n */\nimport type { FormSchema } from '../../types'\n\nconst schema = {\n id: 'address-MNP',\n country: 'MNP',\n formType: 'address',\n fields: [\n {\n name: 'postalCode',\n type: 'text',\n label: 'country-forms.address.postalCode.label',\n required: false,\n inputMode: 'text',\n maxLength: 50,\n validation: {\n maxLength: { value: 50, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'street',\n type: 'text',\n label: 'country-forms.address.street.label',\n required: true,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'complement',\n type: 'text',\n label: 'country-forms.address.complement.label',\n required: false,\n inputMode: 'text',\n maxLength: 750,\n validation: {\n maxLength: { value: 750, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'city',\n type: 'text',\n label: 'country-forms.address.city.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n {\n name: 'state',\n type: 'text',\n label: 'country-forms.address.state.label',\n required: true,\n inputMode: 'text',\n maxLength: 100,\n validation: {\n maxLength: { value: 100, message: 'country-forms.validation.maxLength' },\n },\n },\n ],\n} satisfies FormSchema\n\nexport default schema\n"]}
|