@vtex/country-forms 1.1.0 → 1.3.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 +46 -1
- package/README.md +52 -13
- package/dist/{BRA-PMVV6KOM.js → BRA-CWGYPPBD.js} +43 -27
- package/dist/BRA-CWGYPPBD.js.map +1 -0
- package/dist/{BRA-ZBZXE5II.mjs → BRA-R2DBJTZ2.mjs} +43 -27
- package/dist/BRA-R2DBJTZ2.mjs.map +1 -0
- package/dist/CAN-RDQPFPZU.mjs +127 -0
- package/dist/CAN-RDQPFPZU.mjs.map +1 -0
- package/dist/CAN-ZJQJFUW4.js +129 -0
- package/dist/CAN-ZJQJFUW4.js.map +1 -0
- package/dist/MEX-6CJCALY3.js +125 -0
- package/dist/MEX-6CJCALY3.js.map +1 -0
- package/dist/MEX-ZQL7ZS3G.mjs +123 -0
- package/dist/MEX-ZQL7ZS3G.mjs.map +1 -0
- package/dist/USA-2QW25XAI.mjs +128 -0
- package/dist/USA-2QW25XAI.mjs.map +1 -0
- package/dist/USA-MWP4SDGW.js +130 -0
- package/dist/USA-MWP4SDGW.js.map +1 -0
- package/dist/ar-SA-SIOKG54S.mjs +69 -0
- package/dist/ar-SA-SIOKG54S.mjs.map +1 -0
- package/dist/ar-SA-W6WD6U2J.js +71 -0
- package/dist/ar-SA-W6WD6U2J.js.map +1 -0
- package/dist/bg-BG-JZDO4V5H.mjs +69 -0
- package/dist/bg-BG-JZDO4V5H.mjs.map +1 -0
- package/dist/bg-BG-M7VXC7CN.js +71 -0
- package/dist/bg-BG-M7VXC7CN.js.map +1 -0
- package/dist/{bra-MHTXSNLA.js → bra-DQO5W7HB.js} +7 -15
- package/dist/bra-DQO5W7HB.js.map +1 -0
- package/dist/{bra-ILOTR4AN.mjs → bra-MJUXI46I.mjs} +4 -15
- package/dist/bra-MJUXI46I.mjs.map +1 -0
- package/dist/ca-ES-6EIAUGFL.mjs +69 -0
- package/dist/ca-ES-6EIAUGFL.mjs.map +1 -0
- package/dist/ca-ES-JIEE3YSB.js +71 -0
- package/dist/ca-ES-JIEE3YSB.js.map +1 -0
- package/dist/can-3MOZIOGB.js +65 -0
- package/dist/can-3MOZIOGB.js.map +1 -0
- package/dist/can-DKTB2M6I.mjs +41 -0
- package/dist/can-DKTB2M6I.mjs.map +1 -0
- package/dist/can-LLWX4LC2.js +48 -0
- package/dist/can-LLWX4LC2.js.map +1 -0
- package/dist/can-OONXPDKH.mjs +59 -0
- package/dist/can-OONXPDKH.mjs.map +1 -0
- package/dist/chunk-B2XPLIJU.mjs +19 -0
- package/dist/chunk-B2XPLIJU.mjs.map +1 -0
- package/dist/chunk-ZQQPNXLP.js +21 -0
- package/dist/chunk-ZQQPNXLP.js.map +1 -0
- package/dist/common-E4IN3G46.mjs +4 -0
- package/dist/common-E4IN3G46.mjs.map +1 -0
- package/dist/common-LFDTUEMM.js +13 -0
- package/dist/common-LFDTUEMM.js.map +1 -0
- package/dist/cs-CZ-KHYD2YJP.js +71 -0
- package/dist/cs-CZ-KHYD2YJP.js.map +1 -0
- package/dist/cs-CZ-ZRHS2Z7M.mjs +69 -0
- package/dist/cs-CZ-ZRHS2Z7M.mjs.map +1 -0
- package/dist/da-DK-6P3RNZ65.js +71 -0
- package/dist/da-DK-6P3RNZ65.js.map +1 -0
- package/dist/da-DK-FP3P352Z.mjs +69 -0
- package/dist/da-DK-FP3P352Z.mjs.map +1 -0
- package/dist/de-DE-IQHNQRXU.js +71 -0
- package/dist/de-DE-IQHNQRXU.js.map +1 -0
- package/dist/de-DE-NZJR3EPR.mjs +69 -0
- package/dist/de-DE-NZJR3EPR.mjs.map +1 -0
- package/dist/el-GR-3BSJEUT3.js +71 -0
- package/dist/el-GR-3BSJEUT3.js.map +1 -0
- package/dist/el-GR-SJU4XLTR.mjs +69 -0
- package/dist/el-GR-SJU4XLTR.mjs.map +1 -0
- package/dist/en-US-BMSEMR3V.mjs +69 -0
- package/dist/en-US-BMSEMR3V.mjs.map +1 -0
- package/dist/en-US-ECWNONM7.js +71 -0
- package/dist/en-US-ECWNONM7.js.map +1 -0
- package/dist/es-MX-OEVEGKIR.js +71 -0
- package/dist/es-MX-OEVEGKIR.js.map +1 -0
- package/dist/es-MX-YIDSNQFO.mjs +69 -0
- package/dist/es-MX-YIDSNQFO.mjs.map +1 -0
- package/dist/fi-FI-D7YYJLZX.mjs +69 -0
- package/dist/fi-FI-D7YYJLZX.mjs.map +1 -0
- package/dist/fi-FI-NBVEC6C7.js +71 -0
- package/dist/fi-FI-NBVEC6C7.js.map +1 -0
- package/dist/{fr-FR-LJIPE6BH.js → fr-FR-IU6UXAXT.js} +30 -10
- package/dist/fr-FR-IU6UXAXT.js.map +1 -0
- package/dist/{fr-FR-KWQ3MPP5.mjs → fr-FR-MPBKVFXY.mjs} +30 -10
- package/dist/fr-FR-MPBKVFXY.mjs.map +1 -0
- package/dist/hu-HU-5KQMYHTZ.mjs +69 -0
- package/dist/hu-HU-5KQMYHTZ.mjs.map +1 -0
- package/dist/hu-HU-IXMSWLNZ.js +71 -0
- package/dist/hu-HU-IXMSWLNZ.js.map +1 -0
- package/dist/id-ID-2ESPXRTF.js +71 -0
- package/dist/id-ID-2ESPXRTF.js.map +1 -0
- package/dist/id-ID-43IVZSYW.mjs +69 -0
- package/dist/id-ID-43IVZSYW.mjs.map +1 -0
- package/dist/index.d.mts +233 -20
- package/dist/index.d.ts +233 -20
- package/dist/index.js +266 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +259 -39
- package/dist/index.mjs.map +1 -1
- package/dist/it-IT-KCNTLXEI.js +71 -0
- package/dist/it-IT-KCNTLXEI.js.map +1 -0
- package/dist/it-IT-XYKU7OTJ.mjs +69 -0
- package/dist/it-IT-XYKU7OTJ.mjs.map +1 -0
- package/dist/ja-JP-63ZZJM4K.js +71 -0
- package/dist/ja-JP-63ZZJM4K.js.map +1 -0
- package/dist/ja-JP-PNND5YFG.mjs +69 -0
- package/dist/ja-JP-PNND5YFG.mjs.map +1 -0
- package/dist/ko-KR-FH2T2VEV.js +71 -0
- package/dist/ko-KR-FH2T2VEV.js.map +1 -0
- package/dist/ko-KR-LCD642SY.mjs +69 -0
- package/dist/ko-KR-LCD642SY.mjs.map +1 -0
- package/dist/mex-AMEX6IHY.mjs +108 -0
- package/dist/mex-AMEX6IHY.mjs.map +1 -0
- package/dist/mex-DYWVMWB6.js +38 -0
- package/dist/mex-DYWVMWB6.js.map +1 -0
- package/dist/mex-VX3Y5I6I.mjs +33 -0
- package/dist/mex-VX3Y5I6I.mjs.map +1 -0
- package/dist/mex-Y56WV2L7.js +114 -0
- package/dist/mex-Y56WV2L7.js.map +1 -0
- package/dist/nb-NO-NQITOZPA.js +71 -0
- package/dist/nb-NO-NQITOZPA.js.map +1 -0
- package/dist/nb-NO-Z5JX3HYO.mjs +69 -0
- package/dist/nb-NO-Z5JX3HYO.mjs.map +1 -0
- package/dist/nl-NL-HZODT2YX.mjs +69 -0
- package/dist/nl-NL-HZODT2YX.mjs.map +1 -0
- package/dist/nl-NL-OLAORJAP.js +71 -0
- package/dist/nl-NL-OLAORJAP.js.map +1 -0
- package/dist/pl-PL-UMJTTHWX.mjs +69 -0
- package/dist/pl-PL-UMJTTHWX.mjs.map +1 -0
- package/dist/pl-PL-UWOMEGDC.js +71 -0
- package/dist/pl-PL-UWOMEGDC.js.map +1 -0
- package/dist/pt-BR-BVRXRMDM.js +71 -0
- package/dist/pt-BR-BVRXRMDM.js.map +1 -0
- package/dist/pt-BR-KDFQZFNO.mjs +69 -0
- package/dist/pt-BR-KDFQZFNO.mjs.map +1 -0
- package/dist/pt-PT-BUEHVMWK.mjs +69 -0
- package/dist/pt-PT-BUEHVMWK.mjs.map +1 -0
- package/dist/pt-PT-I4ND64JI.js +71 -0
- package/dist/pt-PT-I4ND64JI.js.map +1 -0
- package/dist/ro-RO-JRYCW7PF.js +71 -0
- package/dist/ro-RO-JRYCW7PF.js.map +1 -0
- package/dist/ro-RO-MENVW6ZF.mjs +69 -0
- package/dist/ro-RO-MENVW6ZF.mjs.map +1 -0
- package/dist/ru-RU-FMI7PJAA.mjs +69 -0
- package/dist/ru-RU-FMI7PJAA.mjs.map +1 -0
- package/dist/ru-RU-NKOHON7P.js +71 -0
- package/dist/ru-RU-NKOHON7P.js.map +1 -0
- package/dist/sk-SK-G4Z4KYN2.mjs +69 -0
- package/dist/sk-SK-G4Z4KYN2.mjs.map +1 -0
- package/dist/sk-SK-HBZS6TYX.js +71 -0
- package/dist/sk-SK-HBZS6TYX.js.map +1 -0
- package/dist/sl-SI-JAXM5ZRI.mjs +69 -0
- package/dist/sl-SI-JAXM5ZRI.mjs.map +1 -0
- package/dist/sl-SI-QHJ656PZ.js +71 -0
- package/dist/sl-SI-QHJ656PZ.js.map +1 -0
- package/dist/sv-SE-CXGY47PC.mjs +69 -0
- package/dist/sv-SE-CXGY47PC.mjs.map +1 -0
- package/dist/sv-SE-OHZU6ZE3.js +71 -0
- package/dist/sv-SE-OHZU6ZE3.js.map +1 -0
- package/dist/th-TH-GZP27XYY.mjs +69 -0
- package/dist/th-TH-GZP27XYY.mjs.map +1 -0
- package/dist/th-TH-NHNIX64G.js +71 -0
- package/dist/th-TH-NHNIX64G.js.map +1 -0
- package/dist/uk-UA-MUTERDP2.mjs +69 -0
- package/dist/uk-UA-MUTERDP2.mjs.map +1 -0
- package/dist/uk-UA-VQC3SULE.js +71 -0
- package/dist/uk-UA-VQC3SULE.js.map +1 -0
- package/dist/usa-AC7YPVS3.mjs +52 -0
- package/dist/usa-AC7YPVS3.mjs.map +1 -0
- package/dist/usa-B6NCCTF6.js +61 -0
- package/dist/usa-B6NCCTF6.js.map +1 -0
- package/dist/usa-LOOP7MRM.mjs +55 -0
- package/dist/usa-LOOP7MRM.mjs.map +1 -0
- package/dist/usa-OQ44AFEI.js +61 -0
- package/dist/usa-OQ44AFEI.js.map +1 -0
- package/package.json +1 -1
- package/dist/BRA-PMVV6KOM.js.map +0 -1
- package/dist/BRA-ZBZXE5II.mjs.map +0 -1
- package/dist/bra-ILOTR4AN.mjs.map +0 -1
- package/dist/bra-MHTXSNLA.js.map +0 -1
- package/dist/can-7TMYDEJF.mjs +0 -17
- package/dist/can-7TMYDEJF.mjs.map +0 -1
- package/dist/can-B5ME2ZFN.js +0 -20
- package/dist/can-B5ME2ZFN.js.map +0 -1
- package/dist/can-FGNN5MZS.mjs +0 -19
- package/dist/can-FGNN5MZS.mjs.map +0 -1
- package/dist/can-LLJ4A5Y5.js +0 -21
- package/dist/can-LLJ4A5Y5.js.map +0 -1
- package/dist/en-US-RLEM27ZZ.js +0 -51
- package/dist/en-US-RLEM27ZZ.js.map +0 -1
- package/dist/en-US-YW7UYXNB.mjs +0 -49
- package/dist/en-US-YW7UYXNB.mjs.map +0 -1
- package/dist/es-MX-AGRGVXRK.mjs +0 -49
- package/dist/es-MX-AGRGVXRK.mjs.map +0 -1
- package/dist/es-MX-K5MWKMJW.js +0 -51
- package/dist/es-MX-K5MWKMJW.js.map +0 -1
- package/dist/fr-FR-KWQ3MPP5.mjs.map +0 -1
- package/dist/fr-FR-LJIPE6BH.js.map +0 -1
- package/dist/mex-5BKCF6LS.js +0 -21
- package/dist/mex-5BKCF6LS.js.map +0 -1
- package/dist/mex-G3HMNBBF.mjs +0 -19
- package/dist/mex-G3HMNBBF.mjs.map +0 -1
- package/dist/pt-BR-74IZNREP.js +0 -51
- package/dist/pt-BR-74IZNREP.js.map +0 -1
- package/dist/pt-BR-P2RZ3X3H.mjs +0 -49
- package/dist/pt-BR-P2RZ3X3H.mjs.map +0 -1
- package/dist/usa-3AM7UFVG.js +0 -20
- package/dist/usa-3AM7UFVG.js.map +0 -1
- package/dist/usa-I7DK2CTL.mjs +0 -18
- package/dist/usa-I7DK2CTL.mjs.map +0 -1
- package/dist/usa-LXT6WW64.js +0 -21
- package/dist/usa-LXT6WW64.js.map +0 -1
- package/dist/usa-ZD5OWGAD.mjs +0 -18
- package/dist/usa-ZD5OWGAD.mjs.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/i18n/messages/id-ID.ts
|
|
4
|
+
var bundle = {
|
|
5
|
+
// ── Address labels ────────────────────────────────────────────────────────
|
|
6
|
+
"country-forms.address.postalCode.label": "Kode Pos",
|
|
7
|
+
"country-forms.address.street.label": "Alamat jalan",
|
|
8
|
+
"country-forms.address.street.placeholder": "Baris alamat 1",
|
|
9
|
+
"country-forms.address.number.label": "Nomor",
|
|
10
|
+
"country-forms.address.complement.label": "Informasi tambahan (opsional)",
|
|
11
|
+
"country-forms.address.neighborhood.label": "Lingkungan",
|
|
12
|
+
"country-forms.address.city.label": "Kota",
|
|
13
|
+
"country-forms.address.state.label": "Negara Bagian",
|
|
14
|
+
// ── Address placeholders (per country) ────────────────────────────────────
|
|
15
|
+
"country-forms.address.postalCode.placeholder.BRA": "Contoh: 01310-100",
|
|
16
|
+
"country-forms.address.postalCode.placeholder.USA": "Contoh: 10001 atau 10001-1234",
|
|
17
|
+
"country-forms.address.postalCode.placeholder.CAN": "Contoh: K1A 0A9",
|
|
18
|
+
"country-forms.address.postalCode.placeholder.MEX": "Contoh: 06600",
|
|
19
|
+
// ── Personal data labels (fallback) ─────────────────────────────────────
|
|
20
|
+
"country-forms.personal-data.firstName.label": "Nama depan",
|
|
21
|
+
"country-forms.personal-data.lastName.label": "Nama belakang",
|
|
22
|
+
"country-forms.personal-data.contactType.label": "Kontak yang diinginkan",
|
|
23
|
+
"country-forms.personal-data.contactType.email": "Email",
|
|
24
|
+
"country-forms.personal-data.contactType.phone": "Nomor ponsel",
|
|
25
|
+
"country-forms.personal-data.email.label": "Email",
|
|
26
|
+
"country-forms.personal-data.phone.label": "Nomor ponsel",
|
|
27
|
+
"country-forms.personal-data.document.label": "Dokumen",
|
|
28
|
+
"country-forms.personal-data.documentType.label": "Jenis dokumen",
|
|
29
|
+
// ── Personal data labels (BRA) ────────────────────────────────────────────
|
|
30
|
+
"country-forms.personal-data.personType.label": "Jenis orang",
|
|
31
|
+
"country-forms.personal-data.personType.individual": "Individu",
|
|
32
|
+
"country-forms.personal-data.personType.business": "Bisnis",
|
|
33
|
+
"country-forms.personal-data.firstName.label.individual": "Nama depan",
|
|
34
|
+
"country-forms.personal-data.firstName.label.business": "Nama perusahaan",
|
|
35
|
+
"country-forms.personal-data.cpf.label": "CPF",
|
|
36
|
+
"country-forms.personal-data.cpf.placeholder": "Contoh: 123.456.789-09",
|
|
37
|
+
"country-forms.personal-data.cnpj.label": "CNPJ",
|
|
38
|
+
"country-forms.personal-data.cnpj.placeholder": "Contoh: 11.222.333/0001-81",
|
|
39
|
+
"country-forms.personal-data.phone.placeholder.BRA": "Contoh: (11) 99999-9999",
|
|
40
|
+
// ── Personal data labels (USA) ────────────────────────────────────────────
|
|
41
|
+
"country-forms.personal-data.ssn.label": "Nomor Jaminan Sosial (SSN)",
|
|
42
|
+
"country-forms.personal-data.ssn.placeholder": "Contoh: 123-45-6789",
|
|
43
|
+
"country-forms.personal-data.ein.label": "Nomor Identifikasi Pemberi Kerja (EIN)",
|
|
44
|
+
"country-forms.personal-data.ein.placeholder": "Contoh: 12-3456789",
|
|
45
|
+
"country-forms.personal-data.phone.placeholder.USA": "Contoh: (201) 555-0123",
|
|
46
|
+
// ── Personal data labels (CAN) ────────────────────────────────────────────
|
|
47
|
+
"country-forms.personal-data.sin.label": "Nomor Asuransi Sosial (SIN)",
|
|
48
|
+
"country-forms.personal-data.sin.placeholder": "Contoh: 046-454-286",
|
|
49
|
+
"country-forms.personal-data.bn.label": "Nomor Bisnis (BN)",
|
|
50
|
+
"country-forms.personal-data.bn.placeholder": "Contoh: 123456789",
|
|
51
|
+
"country-forms.personal-data.phone.placeholder.CAN": "Contoh: 613-555-0123",
|
|
52
|
+
// ── Personal data labels (MEX) ────────────────────────────────────────────
|
|
53
|
+
"country-forms.personal-data.rfc.label": "RFC (individu)",
|
|
54
|
+
"country-forms.personal-data.rfc.placeholder": "Contoh: XAXX010101000",
|
|
55
|
+
"country-forms.personal-data.rfcCorporate.label": "RFC (bisnis)",
|
|
56
|
+
"country-forms.personal-data.rfcCorporate.placeholder": "Contoh: ABC010101AB1",
|
|
57
|
+
"country-forms.personal-data.phone.placeholder.MEX": "Contoh: (55) 1234 5678",
|
|
58
|
+
// ── Validation messages ───────────────────────────────────────────────────
|
|
59
|
+
"country-forms.validation.required": "Kolom wajib diisi. Masukkan {fieldName} Anda.",
|
|
60
|
+
"country-forms.validation.invalid": "{fieldName} tidak valid. Lengkapi kolom {fieldName} lagi.",
|
|
61
|
+
"country-forms.validation.maxLength": "{fieldName} tidak boleh melebihi {maxLength} karakter",
|
|
62
|
+
"country-forms.validation.postalCode.BRA": "Masukkan CEP yang valid (contoh: 01310-100)",
|
|
63
|
+
"country-forms.validation.postalCode.USA": "Masukkan kode pos yang valid (contoh: 10001)",
|
|
64
|
+
"country-forms.validation.postalCode.CAN": "Masukkan kode pos yang valid (contoh: K1A 0A9)",
|
|
65
|
+
"country-forms.validation.postalCode.MEX": "Masukkan kode pos yang valid (contoh: 06600)"
|
|
66
|
+
};
|
|
67
|
+
var id_ID_default = bundle;
|
|
68
|
+
|
|
69
|
+
module.exports = id_ID_default;
|
|
70
|
+
//# sourceMappingURL=id-ID-2ESPXRTF.js.map
|
|
71
|
+
//# sourceMappingURL=id-ID-2ESPXRTF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/messages/id-ID.ts"],"names":[],"mappings":";;;AAKA,IAAM,MAAA,GAAqB;AAAA;AAAA,EAEzB,wCAAA,EAA0C,UAAA;AAAA,EAC1C,oCAAA,EAAsC,cAAA;AAAA,EACtC,0CAAA,EAA4C,gBAAA;AAAA,EAC5C,oCAAA,EAAsC,OAAA;AAAA,EACtC,wCAAA,EAA0C,+BAAA;AAAA,EAC1C,0CAAA,EAA4C,YAAA;AAAA,EAC5C,kCAAA,EAAoC,MAAA;AAAA,EACpC,mCAAA,EAAqC,eAAA;AAAA;AAAA,EAErC,kDAAA,EAAoD,mBAAA;AAAA,EACpD,kDAAA,EAAoD,+BAAA;AAAA,EACpD,kDAAA,EAAoD,iBAAA;AAAA,EACpD,kDAAA,EAAoD,eAAA;AAAA;AAAA,EAEpD,6CAAA,EAA+C,YAAA;AAAA,EAC/C,4CAAA,EAA8C,eAAA;AAAA,EAC9C,+CAAA,EAAiD,wBAAA;AAAA,EACjD,+CAAA,EAAiD,OAAA;AAAA,EACjD,+CAAA,EAAiD,cAAA;AAAA,EACjD,yCAAA,EAA2C,OAAA;AAAA,EAC3C,yCAAA,EAA2C,cAAA;AAAA,EAC3C,4CAAA,EAA8C,SAAA;AAAA,EAC9C,gDAAA,EAAkD,eAAA;AAAA;AAAA,EAElD,8CAAA,EAAgD,aAAA;AAAA,EAChD,mDAAA,EAAqD,UAAA;AAAA,EACrD,iDAAA,EAAmD,QAAA;AAAA,EACnD,wDAAA,EAA0D,YAAA;AAAA,EAC1D,sDAAA,EAAwD,iBAAA;AAAA,EACxD,uCAAA,EAAyC,KAAA;AAAA,EACzC,6CAAA,EAA+C,wBAAA;AAAA,EAC/C,wCAAA,EAA0C,MAAA;AAAA,EAC1C,8CAAA,EAAgD,4BAAA;AAAA,EAChD,mDAAA,EAAqD,yBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,4BAAA;AAAA,EACzC,6CAAA,EAA+C,qBAAA;AAAA,EAC/C,uCAAA,EAAyC,wCAAA;AAAA,EACzC,6CAAA,EAA+C,oBAAA;AAAA,EAC/C,mDAAA,EAAqD,wBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,6BAAA;AAAA,EACzC,6CAAA,EAA+C,qBAAA;AAAA,EAC/C,sCAAA,EAAwC,mBAAA;AAAA,EACxC,4CAAA,EAA8C,mBAAA;AAAA,EAC9C,mDAAA,EAAqD,sBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,gBAAA;AAAA,EACzC,6CAAA,EAA+C,uBAAA;AAAA,EAC/C,gDAAA,EAAkD,cAAA;AAAA,EAClD,sDAAA,EAAwD,sBAAA;AAAA,EACxD,mDAAA,EAAqD,wBAAA;AAAA;AAAA,EAErD,mCAAA,EAAqC,+CAAA;AAAA,EACrC,kCAAA,EAAoC,2DAAA;AAAA,EACpC,oCAAA,EAAsC,uDAAA;AAAA,EACtC,yCAAA,EAA2C,6CAAA;AAAA,EAC3C,yCAAA,EAA2C,8CAAA;AAAA,EAC3C,yCAAA,EAA2C,gDAAA;AAAA,EAC3C,yCAAA,EAA2C;AAC7C,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"id-ID-2ESPXRTF.js","sourcesContent":["/**\n * Indonesian (id-ID) i18n bundle.\n */\nimport type { I18nBundle } from '../../types/i18n'\n\nconst bundle: I18nBundle = {\n // ── Address labels ────────────────────────────────────────────────────────\n 'country-forms.address.postalCode.label': 'Kode Pos',\n 'country-forms.address.street.label': 'Alamat jalan',\n 'country-forms.address.street.placeholder': 'Baris alamat 1',\n 'country-forms.address.number.label': 'Nomor',\n 'country-forms.address.complement.label': 'Informasi tambahan (opsional)',\n 'country-forms.address.neighborhood.label': 'Lingkungan',\n 'country-forms.address.city.label': 'Kota',\n 'country-forms.address.state.label': 'Negara Bagian',\n // ── Address placeholders (per country) ────────────────────────────────────\n 'country-forms.address.postalCode.placeholder.BRA': 'Contoh: 01310-100',\n 'country-forms.address.postalCode.placeholder.USA': 'Contoh: 10001 atau 10001-1234',\n 'country-forms.address.postalCode.placeholder.CAN': 'Contoh: K1A 0A9',\n 'country-forms.address.postalCode.placeholder.MEX': 'Contoh: 06600',\n // ── Personal data labels (fallback) ─────────────────────────────────────\n 'country-forms.personal-data.firstName.label': 'Nama depan',\n 'country-forms.personal-data.lastName.label': 'Nama belakang',\n 'country-forms.personal-data.contactType.label': 'Kontak yang diinginkan',\n 'country-forms.personal-data.contactType.email': 'Email',\n 'country-forms.personal-data.contactType.phone': 'Nomor ponsel',\n 'country-forms.personal-data.email.label': 'Email',\n 'country-forms.personal-data.phone.label': 'Nomor ponsel',\n 'country-forms.personal-data.document.label': 'Dokumen',\n 'country-forms.personal-data.documentType.label': 'Jenis dokumen',\n // ── Personal data labels (BRA) ────────────────────────────────────────────\n 'country-forms.personal-data.personType.label': 'Jenis orang',\n 'country-forms.personal-data.personType.individual': 'Individu',\n 'country-forms.personal-data.personType.business': 'Bisnis',\n 'country-forms.personal-data.firstName.label.individual': 'Nama depan',\n 'country-forms.personal-data.firstName.label.business': 'Nama perusahaan',\n 'country-forms.personal-data.cpf.label': 'CPF',\n 'country-forms.personal-data.cpf.placeholder': 'Contoh: 123.456.789-09',\n 'country-forms.personal-data.cnpj.label': 'CNPJ',\n 'country-forms.personal-data.cnpj.placeholder': 'Contoh: 11.222.333/0001-81',\n 'country-forms.personal-data.phone.placeholder.BRA': 'Contoh: (11) 99999-9999',\n // ── Personal data labels (USA) ────────────────────────────────────────────\n 'country-forms.personal-data.ssn.label': 'Nomor Jaminan Sosial (SSN)',\n 'country-forms.personal-data.ssn.placeholder': 'Contoh: 123-45-6789',\n 'country-forms.personal-data.ein.label': 'Nomor Identifikasi Pemberi Kerja (EIN)',\n 'country-forms.personal-data.ein.placeholder': 'Contoh: 12-3456789',\n 'country-forms.personal-data.phone.placeholder.USA': 'Contoh: (201) 555-0123',\n // ── Personal data labels (CAN) ────────────────────────────────────────────\n 'country-forms.personal-data.sin.label': 'Nomor Asuransi Sosial (SIN)',\n 'country-forms.personal-data.sin.placeholder': 'Contoh: 046-454-286',\n 'country-forms.personal-data.bn.label': 'Nomor Bisnis (BN)',\n 'country-forms.personal-data.bn.placeholder': 'Contoh: 123456789',\n 'country-forms.personal-data.phone.placeholder.CAN': 'Contoh: 613-555-0123',\n // ── Personal data labels (MEX) ────────────────────────────────────────────\n 'country-forms.personal-data.rfc.label': 'RFC (individu)',\n 'country-forms.personal-data.rfc.placeholder': 'Contoh: XAXX010101000',\n 'country-forms.personal-data.rfcCorporate.label': 'RFC (bisnis)',\n 'country-forms.personal-data.rfcCorporate.placeholder': 'Contoh: ABC010101AB1',\n 'country-forms.personal-data.phone.placeholder.MEX': 'Contoh: (55) 1234 5678',\n // ── Validation messages ───────────────────────────────────────────────────\n 'country-forms.validation.required': 'Kolom wajib diisi. Masukkan {fieldName} Anda.',\n 'country-forms.validation.invalid': '{fieldName} tidak valid. Lengkapi kolom {fieldName} lagi.',\n 'country-forms.validation.maxLength': '{fieldName} tidak boleh melebihi {maxLength} karakter',\n 'country-forms.validation.postalCode.BRA': 'Masukkan CEP yang valid (contoh: 01310-100)',\n 'country-forms.validation.postalCode.USA': 'Masukkan kode pos yang valid (contoh: 10001)',\n 'country-forms.validation.postalCode.CAN': 'Masukkan kode pos yang valid (contoh: K1A 0A9)',\n 'country-forms.validation.postalCode.MEX': 'Masukkan kode pos yang valid (contoh: 06600)',\n}\n\nexport default bundle\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/i18n/messages/id-ID.ts
|
|
2
|
+
var bundle = {
|
|
3
|
+
// ── Address labels ────────────────────────────────────────────────────────
|
|
4
|
+
"country-forms.address.postalCode.label": "Kode Pos",
|
|
5
|
+
"country-forms.address.street.label": "Alamat jalan",
|
|
6
|
+
"country-forms.address.street.placeholder": "Baris alamat 1",
|
|
7
|
+
"country-forms.address.number.label": "Nomor",
|
|
8
|
+
"country-forms.address.complement.label": "Informasi tambahan (opsional)",
|
|
9
|
+
"country-forms.address.neighborhood.label": "Lingkungan",
|
|
10
|
+
"country-forms.address.city.label": "Kota",
|
|
11
|
+
"country-forms.address.state.label": "Negara Bagian",
|
|
12
|
+
// ── Address placeholders (per country) ────────────────────────────────────
|
|
13
|
+
"country-forms.address.postalCode.placeholder.BRA": "Contoh: 01310-100",
|
|
14
|
+
"country-forms.address.postalCode.placeholder.USA": "Contoh: 10001 atau 10001-1234",
|
|
15
|
+
"country-forms.address.postalCode.placeholder.CAN": "Contoh: K1A 0A9",
|
|
16
|
+
"country-forms.address.postalCode.placeholder.MEX": "Contoh: 06600",
|
|
17
|
+
// ── Personal data labels (fallback) ─────────────────────────────────────
|
|
18
|
+
"country-forms.personal-data.firstName.label": "Nama depan",
|
|
19
|
+
"country-forms.personal-data.lastName.label": "Nama belakang",
|
|
20
|
+
"country-forms.personal-data.contactType.label": "Kontak yang diinginkan",
|
|
21
|
+
"country-forms.personal-data.contactType.email": "Email",
|
|
22
|
+
"country-forms.personal-data.contactType.phone": "Nomor ponsel",
|
|
23
|
+
"country-forms.personal-data.email.label": "Email",
|
|
24
|
+
"country-forms.personal-data.phone.label": "Nomor ponsel",
|
|
25
|
+
"country-forms.personal-data.document.label": "Dokumen",
|
|
26
|
+
"country-forms.personal-data.documentType.label": "Jenis dokumen",
|
|
27
|
+
// ── Personal data labels (BRA) ────────────────────────────────────────────
|
|
28
|
+
"country-forms.personal-data.personType.label": "Jenis orang",
|
|
29
|
+
"country-forms.personal-data.personType.individual": "Individu",
|
|
30
|
+
"country-forms.personal-data.personType.business": "Bisnis",
|
|
31
|
+
"country-forms.personal-data.firstName.label.individual": "Nama depan",
|
|
32
|
+
"country-forms.personal-data.firstName.label.business": "Nama perusahaan",
|
|
33
|
+
"country-forms.personal-data.cpf.label": "CPF",
|
|
34
|
+
"country-forms.personal-data.cpf.placeholder": "Contoh: 123.456.789-09",
|
|
35
|
+
"country-forms.personal-data.cnpj.label": "CNPJ",
|
|
36
|
+
"country-forms.personal-data.cnpj.placeholder": "Contoh: 11.222.333/0001-81",
|
|
37
|
+
"country-forms.personal-data.phone.placeholder.BRA": "Contoh: (11) 99999-9999",
|
|
38
|
+
// ── Personal data labels (USA) ────────────────────────────────────────────
|
|
39
|
+
"country-forms.personal-data.ssn.label": "Nomor Jaminan Sosial (SSN)",
|
|
40
|
+
"country-forms.personal-data.ssn.placeholder": "Contoh: 123-45-6789",
|
|
41
|
+
"country-forms.personal-data.ein.label": "Nomor Identifikasi Pemberi Kerja (EIN)",
|
|
42
|
+
"country-forms.personal-data.ein.placeholder": "Contoh: 12-3456789",
|
|
43
|
+
"country-forms.personal-data.phone.placeholder.USA": "Contoh: (201) 555-0123",
|
|
44
|
+
// ── Personal data labels (CAN) ────────────────────────────────────────────
|
|
45
|
+
"country-forms.personal-data.sin.label": "Nomor Asuransi Sosial (SIN)",
|
|
46
|
+
"country-forms.personal-data.sin.placeholder": "Contoh: 046-454-286",
|
|
47
|
+
"country-forms.personal-data.bn.label": "Nomor Bisnis (BN)",
|
|
48
|
+
"country-forms.personal-data.bn.placeholder": "Contoh: 123456789",
|
|
49
|
+
"country-forms.personal-data.phone.placeholder.CAN": "Contoh: 613-555-0123",
|
|
50
|
+
// ── Personal data labels (MEX) ────────────────────────────────────────────
|
|
51
|
+
"country-forms.personal-data.rfc.label": "RFC (individu)",
|
|
52
|
+
"country-forms.personal-data.rfc.placeholder": "Contoh: XAXX010101000",
|
|
53
|
+
"country-forms.personal-data.rfcCorporate.label": "RFC (bisnis)",
|
|
54
|
+
"country-forms.personal-data.rfcCorporate.placeholder": "Contoh: ABC010101AB1",
|
|
55
|
+
"country-forms.personal-data.phone.placeholder.MEX": "Contoh: (55) 1234 5678",
|
|
56
|
+
// ── Validation messages ───────────────────────────────────────────────────
|
|
57
|
+
"country-forms.validation.required": "Kolom wajib diisi. Masukkan {fieldName} Anda.",
|
|
58
|
+
"country-forms.validation.invalid": "{fieldName} tidak valid. Lengkapi kolom {fieldName} lagi.",
|
|
59
|
+
"country-forms.validation.maxLength": "{fieldName} tidak boleh melebihi {maxLength} karakter",
|
|
60
|
+
"country-forms.validation.postalCode.BRA": "Masukkan CEP yang valid (contoh: 01310-100)",
|
|
61
|
+
"country-forms.validation.postalCode.USA": "Masukkan kode pos yang valid (contoh: 10001)",
|
|
62
|
+
"country-forms.validation.postalCode.CAN": "Masukkan kode pos yang valid (contoh: K1A 0A9)",
|
|
63
|
+
"country-forms.validation.postalCode.MEX": "Masukkan kode pos yang valid (contoh: 06600)"
|
|
64
|
+
};
|
|
65
|
+
var id_ID_default = bundle;
|
|
66
|
+
|
|
67
|
+
export { id_ID_default as default };
|
|
68
|
+
//# sourceMappingURL=id-ID-43IVZSYW.mjs.map
|
|
69
|
+
//# sourceMappingURL=id-ID-43IVZSYW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/i18n/messages/id-ID.ts"],"names":[],"mappings":";AAKA,IAAM,MAAA,GAAqB;AAAA;AAAA,EAEzB,wCAAA,EAA0C,UAAA;AAAA,EAC1C,oCAAA,EAAsC,cAAA;AAAA,EACtC,0CAAA,EAA4C,gBAAA;AAAA,EAC5C,oCAAA,EAAsC,OAAA;AAAA,EACtC,wCAAA,EAA0C,+BAAA;AAAA,EAC1C,0CAAA,EAA4C,YAAA;AAAA,EAC5C,kCAAA,EAAoC,MAAA;AAAA,EACpC,mCAAA,EAAqC,eAAA;AAAA;AAAA,EAErC,kDAAA,EAAoD,mBAAA;AAAA,EACpD,kDAAA,EAAoD,+BAAA;AAAA,EACpD,kDAAA,EAAoD,iBAAA;AAAA,EACpD,kDAAA,EAAoD,eAAA;AAAA;AAAA,EAEpD,6CAAA,EAA+C,YAAA;AAAA,EAC/C,4CAAA,EAA8C,eAAA;AAAA,EAC9C,+CAAA,EAAiD,wBAAA;AAAA,EACjD,+CAAA,EAAiD,OAAA;AAAA,EACjD,+CAAA,EAAiD,cAAA;AAAA,EACjD,yCAAA,EAA2C,OAAA;AAAA,EAC3C,yCAAA,EAA2C,cAAA;AAAA,EAC3C,4CAAA,EAA8C,SAAA;AAAA,EAC9C,gDAAA,EAAkD,eAAA;AAAA;AAAA,EAElD,8CAAA,EAAgD,aAAA;AAAA,EAChD,mDAAA,EAAqD,UAAA;AAAA,EACrD,iDAAA,EAAmD,QAAA;AAAA,EACnD,wDAAA,EAA0D,YAAA;AAAA,EAC1D,sDAAA,EAAwD,iBAAA;AAAA,EACxD,uCAAA,EAAyC,KAAA;AAAA,EACzC,6CAAA,EAA+C,wBAAA;AAAA,EAC/C,wCAAA,EAA0C,MAAA;AAAA,EAC1C,8CAAA,EAAgD,4BAAA;AAAA,EAChD,mDAAA,EAAqD,yBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,4BAAA;AAAA,EACzC,6CAAA,EAA+C,qBAAA;AAAA,EAC/C,uCAAA,EAAyC,wCAAA;AAAA,EACzC,6CAAA,EAA+C,oBAAA;AAAA,EAC/C,mDAAA,EAAqD,wBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,6BAAA;AAAA,EACzC,6CAAA,EAA+C,qBAAA;AAAA,EAC/C,sCAAA,EAAwC,mBAAA;AAAA,EACxC,4CAAA,EAA8C,mBAAA;AAAA,EAC9C,mDAAA,EAAqD,sBAAA;AAAA;AAAA,EAErD,uCAAA,EAAyC,gBAAA;AAAA,EACzC,6CAAA,EAA+C,uBAAA;AAAA,EAC/C,gDAAA,EAAkD,cAAA;AAAA,EAClD,sDAAA,EAAwD,sBAAA;AAAA,EACxD,mDAAA,EAAqD,wBAAA;AAAA;AAAA,EAErD,mCAAA,EAAqC,+CAAA;AAAA,EACrC,kCAAA,EAAoC,2DAAA;AAAA,EACpC,oCAAA,EAAsC,uDAAA;AAAA,EACtC,yCAAA,EAA2C,6CAAA;AAAA,EAC3C,yCAAA,EAA2C,8CAAA;AAAA,EAC3C,yCAAA,EAA2C,gDAAA;AAAA,EAC3C,yCAAA,EAA2C;AAC7C,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"id-ID-43IVZSYW.mjs","sourcesContent":["/**\n * Indonesian (id-ID) i18n bundle.\n */\nimport type { I18nBundle } from '../../types/i18n'\n\nconst bundle: I18nBundle = {\n // ── Address labels ────────────────────────────────────────────────────────\n 'country-forms.address.postalCode.label': 'Kode Pos',\n 'country-forms.address.street.label': 'Alamat jalan',\n 'country-forms.address.street.placeholder': 'Baris alamat 1',\n 'country-forms.address.number.label': 'Nomor',\n 'country-forms.address.complement.label': 'Informasi tambahan (opsional)',\n 'country-forms.address.neighborhood.label': 'Lingkungan',\n 'country-forms.address.city.label': 'Kota',\n 'country-forms.address.state.label': 'Negara Bagian',\n // ── Address placeholders (per country) ────────────────────────────────────\n 'country-forms.address.postalCode.placeholder.BRA': 'Contoh: 01310-100',\n 'country-forms.address.postalCode.placeholder.USA': 'Contoh: 10001 atau 10001-1234',\n 'country-forms.address.postalCode.placeholder.CAN': 'Contoh: K1A 0A9',\n 'country-forms.address.postalCode.placeholder.MEX': 'Contoh: 06600',\n // ── Personal data labels (fallback) ─────────────────────────────────────\n 'country-forms.personal-data.firstName.label': 'Nama depan',\n 'country-forms.personal-data.lastName.label': 'Nama belakang',\n 'country-forms.personal-data.contactType.label': 'Kontak yang diinginkan',\n 'country-forms.personal-data.contactType.email': 'Email',\n 'country-forms.personal-data.contactType.phone': 'Nomor ponsel',\n 'country-forms.personal-data.email.label': 'Email',\n 'country-forms.personal-data.phone.label': 'Nomor ponsel',\n 'country-forms.personal-data.document.label': 'Dokumen',\n 'country-forms.personal-data.documentType.label': 'Jenis dokumen',\n // ── Personal data labels (BRA) ────────────────────────────────────────────\n 'country-forms.personal-data.personType.label': 'Jenis orang',\n 'country-forms.personal-data.personType.individual': 'Individu',\n 'country-forms.personal-data.personType.business': 'Bisnis',\n 'country-forms.personal-data.firstName.label.individual': 'Nama depan',\n 'country-forms.personal-data.firstName.label.business': 'Nama perusahaan',\n 'country-forms.personal-data.cpf.label': 'CPF',\n 'country-forms.personal-data.cpf.placeholder': 'Contoh: 123.456.789-09',\n 'country-forms.personal-data.cnpj.label': 'CNPJ',\n 'country-forms.personal-data.cnpj.placeholder': 'Contoh: 11.222.333/0001-81',\n 'country-forms.personal-data.phone.placeholder.BRA': 'Contoh: (11) 99999-9999',\n // ── Personal data labels (USA) ────────────────────────────────────────────\n 'country-forms.personal-data.ssn.label': 'Nomor Jaminan Sosial (SSN)',\n 'country-forms.personal-data.ssn.placeholder': 'Contoh: 123-45-6789',\n 'country-forms.personal-data.ein.label': 'Nomor Identifikasi Pemberi Kerja (EIN)',\n 'country-forms.personal-data.ein.placeholder': 'Contoh: 12-3456789',\n 'country-forms.personal-data.phone.placeholder.USA': 'Contoh: (201) 555-0123',\n // ── Personal data labels (CAN) ────────────────────────────────────────────\n 'country-forms.personal-data.sin.label': 'Nomor Asuransi Sosial (SIN)',\n 'country-forms.personal-data.sin.placeholder': 'Contoh: 046-454-286',\n 'country-forms.personal-data.bn.label': 'Nomor Bisnis (BN)',\n 'country-forms.personal-data.bn.placeholder': 'Contoh: 123456789',\n 'country-forms.personal-data.phone.placeholder.CAN': 'Contoh: 613-555-0123',\n // ── Personal data labels (MEX) ────────────────────────────────────────────\n 'country-forms.personal-data.rfc.label': 'RFC (individu)',\n 'country-forms.personal-data.rfc.placeholder': 'Contoh: XAXX010101000',\n 'country-forms.personal-data.rfcCorporate.label': 'RFC (bisnis)',\n 'country-forms.personal-data.rfcCorporate.placeholder': 'Contoh: ABC010101AB1',\n 'country-forms.personal-data.phone.placeholder.MEX': 'Contoh: (55) 1234 5678',\n // ── Validation messages ───────────────────────────────────────────────────\n 'country-forms.validation.required': 'Kolom wajib diisi. Masukkan {fieldName} Anda.',\n 'country-forms.validation.invalid': '{fieldName} tidak valid. Lengkapi kolom {fieldName} lagi.',\n 'country-forms.validation.maxLength': '{fieldName} tidak boleh melebihi {maxLength} karakter',\n 'country-forms.validation.postalCode.BRA': 'Masukkan CEP yang valid (contoh: 01310-100)',\n 'country-forms.validation.postalCode.USA': 'Masukkan kode pos yang valid (contoh: 10001)',\n 'country-forms.validation.postalCode.CAN': 'Masukkan kode pos yang valid (contoh: K1A 0A9)',\n 'country-forms.validation.postalCode.MEX': 'Masukkan kode pos yang valid (contoh: 06600)',\n}\n\nexport default bundle\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -188,6 +188,93 @@ interface FieldDefinition {
|
|
|
188
188
|
* }
|
|
189
189
|
*/
|
|
190
190
|
conditionalOptions?: Record<string, SelectOption[] | string>;
|
|
191
|
+
/**
|
|
192
|
+
* Map from a controller field's value to a validator name for this field.
|
|
193
|
+
* Used when a single field validates differently depending on another field's
|
|
194
|
+
* selection — e.g. a `document` field validated as a CPF for individuals and as
|
|
195
|
+
* a CNPJ for businesses.
|
|
196
|
+
*
|
|
197
|
+
* Requires {@link FieldDefinition.dependsOn} to identify the controller field.
|
|
198
|
+
* When a matching key exists for the current controller value, it overrides
|
|
199
|
+
* {@link ValidationRules.customValidator}. Resolve the effective validator with
|
|
200
|
+
* `resolveFieldValidator(field, values)`.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* dependsOn: "personType"
|
|
204
|
+
* conditionalValidator: { individual: "validateCPF", business: "validateCNPJ" }
|
|
205
|
+
*
|
|
206
|
+
* @remarks
|
|
207
|
+
* Declaring this property also opts the field into automatic reset: `setValue`
|
|
208
|
+
* clears the field's value to `''` whenever the controller ({@link FieldDefinition.dependsOn})
|
|
209
|
+
* changes, because the validation domain — and therefore any previously entered
|
|
210
|
+
* value — is no longer guaranteed to be valid (e.g. a CPF is not a valid CNPJ).
|
|
211
|
+
* If a future field needs a conditional validator *without* this reset, add a
|
|
212
|
+
* dedicated opt-out flag rather than relying on the absence of this behavior.
|
|
213
|
+
*/
|
|
214
|
+
conditionalValidator?: Record<string, string>;
|
|
215
|
+
/**
|
|
216
|
+
* Map from a controller field's value to a format function name for this field.
|
|
217
|
+
* Same semantics as {@link FieldDefinition.conditionalValidator} but for the mask
|
|
218
|
+
* applied on display. Overrides {@link FieldDefinition.formatRef} when a key
|
|
219
|
+
* matches. Resolve the effective ref with `resolveFieldFormatRef(field, values)`.
|
|
220
|
+
*
|
|
221
|
+
* A missing key falls back to {@link FieldDefinition.formatRef} (or identity when
|
|
222
|
+
* neither is set), so a controller value with no mask is valid.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* dependsOn: "personType"
|
|
226
|
+
* conditionalFormatRef: { individual: "formatCPF", business: "formatCNPJ" }
|
|
227
|
+
*/
|
|
228
|
+
conditionalFormatRef?: Record<string, string>;
|
|
229
|
+
/**
|
|
230
|
+
* Map from a controller field's value to an unformat function name for this field.
|
|
231
|
+
* Symmetric to {@link FieldDefinition.conditionalFormatRef}. Overrides
|
|
232
|
+
* {@link FieldDefinition.unformatRef} when a key matches. Resolve the effective ref
|
|
233
|
+
* with `resolveFieldUnformatRef(field, values)`.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* dependsOn: "personType"
|
|
237
|
+
* conditionalUnformatRef: { individual: "unformatCPF", business: "unformatCNPJ" }
|
|
238
|
+
*/
|
|
239
|
+
conditionalUnformatRef?: Record<string, string>;
|
|
240
|
+
/**
|
|
241
|
+
* Map from a controller field's value to an {@link InputMode} for this field.
|
|
242
|
+
* Same semantics as {@link FieldDefinition.conditionalValidator} but for the
|
|
243
|
+
* mobile virtual-keyboard hint. Overrides {@link FieldDefinition.inputMode} when
|
|
244
|
+
* a key matches. Resolve the effective value with `resolveFieldInputMode(field, values)`.
|
|
245
|
+
*
|
|
246
|
+
* Useful when a single field expects different input per controller value — e.g.
|
|
247
|
+
* a numeric keyboard for a numeric CPF (individual) but a text keyboard for an
|
|
248
|
+
* alphanumeric CNPJ (business).
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* dependsOn: "personType"
|
|
252
|
+
* conditionalInputMode: { individual: "numeric", business: "text" }
|
|
253
|
+
*/
|
|
254
|
+
conditionalInputMode?: Record<string, InputMode>;
|
|
255
|
+
/**
|
|
256
|
+
* Name of the sibling field that drives {@link FieldDefinition.derivedValue}.
|
|
257
|
+
*
|
|
258
|
+
* A field with `derivedFrom` is **data-only**: its value is computed automatically
|
|
259
|
+
* from the controller and it is never rendered (excluded from `getVisibleFields`)
|
|
260
|
+
* nor validated. It exists so the form state matches the API payload shape — e.g.
|
|
261
|
+
* a `documentType` field derived from `personType` so submissions carry both
|
|
262
|
+
* `document` and `documentType`.
|
|
263
|
+
*
|
|
264
|
+
* @example "personType"
|
|
265
|
+
*/
|
|
266
|
+
derivedFrom?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Map from the {@link FieldDefinition.derivedFrom} controller value to this
|
|
269
|
+
* field's automatically-maintained value. `createFormState` seeds it and
|
|
270
|
+
* `setValue` recomputes it whenever the controller changes. A controller value
|
|
271
|
+
* with no entry resolves to `""`.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* derivedFrom: "personType"
|
|
275
|
+
* derivedValue: { individual: "cpf", business: "cnpj" }
|
|
276
|
+
*/
|
|
277
|
+
derivedValue?: Record<string, string>;
|
|
191
278
|
/**
|
|
192
279
|
* Declarative visibility condition.
|
|
193
280
|
* When present, the field is shown and validated only while the condition is `true`.
|
|
@@ -214,8 +301,9 @@ interface FieldDefinition {
|
|
|
214
301
|
conditionalPlaceholder?: Record<string, string>;
|
|
215
302
|
/**
|
|
216
303
|
* Name of the sibling field that drives {@link FieldDefinition.conditionalLabel},
|
|
217
|
-
* {@link FieldDefinition.conditionalPlaceholder},
|
|
218
|
-
* {@link FieldDefinition.
|
|
304
|
+
* {@link FieldDefinition.conditionalPlaceholder}, {@link FieldDefinition.conditionalOptions},
|
|
305
|
+
* {@link FieldDefinition.conditionalValidator}, {@link FieldDefinition.conditionalFormatRef},
|
|
306
|
+
* {@link FieldDefinition.conditionalUnformatRef}, and {@link FieldDefinition.conditionalInputMode}.
|
|
219
307
|
* Required when any of those properties is set.
|
|
220
308
|
* @example "personType", "state"
|
|
221
309
|
*/
|
|
@@ -467,9 +555,15 @@ declare function createFormState(schema: FormSchema, defaults?: Partial<FormValu
|
|
|
467
555
|
* The updated field is automatically marked as `touched: true`.
|
|
468
556
|
*
|
|
469
557
|
* When the changed field is referenced by another field's `dependsOn` and that
|
|
470
|
-
* field has `conditionalOptions`, the dependent field's
|
|
471
|
-
* reset to `''`. This prevents stale values when the
|
|
472
|
-
*
|
|
558
|
+
* field has `conditionalOptions` or `conditionalValidator`, the dependent field's
|
|
559
|
+
* value is automatically reset to `''`. This prevents stale values when the
|
|
560
|
+
* controller field changes — e.g. selecting a different state clears the previously
|
|
561
|
+
* selected city, or switching `personType` clears the `document` whose validator
|
|
562
|
+
* (CPF vs CNPJ) just changed.
|
|
563
|
+
*
|
|
564
|
+
* Derived, data-only fields ({@link FieldDefinition.derivedFrom}) referencing the
|
|
565
|
+
* changed field are recomputed from their `derivedValue` map (e.g. `documentType`
|
|
566
|
+
* follows `personType`).
|
|
473
567
|
*
|
|
474
568
|
* Existing errors are preserved so the consumer can decide when to re-validate.
|
|
475
569
|
* To clear all errors after a change, spread: `{ ...setValue(state, schema, f, v), errors: {} }`.
|
|
@@ -687,6 +781,83 @@ declare function unformatValue(ref: string | undefined, value: string): string;
|
|
|
687
781
|
*/
|
|
688
782
|
declare function resolveFieldOptions(field: FieldDefinition, values: FormValues): SelectOption[] | null;
|
|
689
783
|
|
|
784
|
+
/**
|
|
785
|
+
* @module engine/resolveField
|
|
786
|
+
*
|
|
787
|
+
* Resolvers for fields whose label, placeholder, validator, or mask change based
|
|
788
|
+
* on a sibling controller field (declared via `dependsOn`).
|
|
789
|
+
*
|
|
790
|
+
* These mirror {@link resolveFieldOptions}: each resolver looks up the controller
|
|
791
|
+
* value in the field's conditional map and falls back to the field's static
|
|
792
|
+
* property when no entry matches. They let a single field — e.g. a `document`
|
|
793
|
+
* field — behave as a CPF for individuals and a CNPJ for businesses without the
|
|
794
|
+
* consumer hard-coding the mapping.
|
|
795
|
+
*/
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Resolves the effective i18n label **key** for a field given the current values.
|
|
799
|
+
*
|
|
800
|
+
* Resolution order:
|
|
801
|
+
* 1) `conditionalLabel` entry matching `values[dependsOn]`
|
|
802
|
+
* 2) `field.label` fallback
|
|
803
|
+
*
|
|
804
|
+
* @returns The i18n key to pass to `resolveLabel`.
|
|
805
|
+
*/
|
|
806
|
+
declare function resolveFieldLabel(field: FieldDefinition, values: FormValues): string;
|
|
807
|
+
/**
|
|
808
|
+
* Resolves the effective i18n placeholder **key** for a field, or `undefined`
|
|
809
|
+
* when the field has neither a conditional nor a static placeholder.
|
|
810
|
+
*
|
|
811
|
+
* Resolution order:
|
|
812
|
+
* 1) `conditionalPlaceholder` entry matching `values[dependsOn]`
|
|
813
|
+
* 2) `field.placeholder` fallback
|
|
814
|
+
*/
|
|
815
|
+
declare function resolveFieldPlaceholder(field: FieldDefinition, values: FormValues): string | undefined;
|
|
816
|
+
/**
|
|
817
|
+
* Resolves the effective validator name for a field given the current values.
|
|
818
|
+
*
|
|
819
|
+
* Resolution order:
|
|
820
|
+
* 1) `conditionalValidator` entry matching `values[dependsOn]`
|
|
821
|
+
* 2) `field.validation.customValidator` fallback
|
|
822
|
+
*
|
|
823
|
+
* @returns The validator name to resolve from the rules registry, or `undefined`
|
|
824
|
+
* when the field has no custom validator for the current controller value.
|
|
825
|
+
*/
|
|
826
|
+
declare function resolveFieldValidator(field: FieldDefinition, values: FormValues): string | undefined;
|
|
827
|
+
/**
|
|
828
|
+
* Resolves the effective format function name for a field given the current values.
|
|
829
|
+
*
|
|
830
|
+
* Resolution order:
|
|
831
|
+
* 1) `conditionalFormatRef` entry matching `values[dependsOn]`
|
|
832
|
+
* 2) `field.formatRef` fallback
|
|
833
|
+
*
|
|
834
|
+
* Pass the result to `formatValue(ref, raw)`; `undefined` yields identity.
|
|
835
|
+
*/
|
|
836
|
+
declare function resolveFieldFormatRef(field: FieldDefinition, values: FormValues): string | undefined;
|
|
837
|
+
/**
|
|
838
|
+
* Resolves the effective unformat function name for a field given the current values.
|
|
839
|
+
*
|
|
840
|
+
* Resolution order:
|
|
841
|
+
* 1) `conditionalUnformatRef` entry matching `values[dependsOn]`
|
|
842
|
+
* 2) `field.unformatRef` fallback
|
|
843
|
+
*
|
|
844
|
+
* Pass the result to `unformatValue(ref, display)`; `undefined` yields identity.
|
|
845
|
+
*/
|
|
846
|
+
declare function resolveFieldUnformatRef(field: FieldDefinition, values: FormValues): string | undefined;
|
|
847
|
+
/**
|
|
848
|
+
* Resolves the effective `inputMode` (mobile keyboard hint) for a field given
|
|
849
|
+
* the current values.
|
|
850
|
+
*
|
|
851
|
+
* Resolution order:
|
|
852
|
+
* 1) `conditionalInputMode` entry matching `values[dependsOn]`
|
|
853
|
+
* 2) `field.inputMode` fallback
|
|
854
|
+
*
|
|
855
|
+
* Lets a single field hint a different virtual keyboard per controller value —
|
|
856
|
+
* e.g. a `document` field that is numeric for an individual (CPF) and text for a
|
|
857
|
+
* business (alphanumeric CNPJ).
|
|
858
|
+
*/
|
|
859
|
+
declare function resolveFieldInputMode(field: FieldDefinition, values: FormValues): InputMode | undefined;
|
|
860
|
+
|
|
690
861
|
/**
|
|
691
862
|
* Dynamic import map for address schemas.
|
|
692
863
|
* Each country is loaded on demand via `import()` for code-splitting.
|
|
@@ -724,7 +895,7 @@ declare const SUPPORTED_ADDRESS_COUNTRIES: readonly string[];
|
|
|
724
895
|
*
|
|
725
896
|
* @example
|
|
726
897
|
* import { SUPPORTED_PERSONAL_DATA_COUNTRIES } from '@vtex/country-forms'
|
|
727
|
-
* // currently supported countries: → ['BRA']
|
|
898
|
+
* // currently supported countries: → ['BRA', 'CAN', 'USA']
|
|
728
899
|
*/
|
|
729
900
|
declare const SUPPORTED_PERSONAL_DATA_COUNTRIES: readonly string[];
|
|
730
901
|
|
|
@@ -765,19 +936,23 @@ declare function loadSchema(iso3: string, formType: FormType): Promise<FormSchem
|
|
|
765
936
|
/**
|
|
766
937
|
* @module i18n/loader
|
|
767
938
|
*
|
|
768
|
-
* `loadLocale(locale)`
|
|
939
|
+
* `loadLocale(locale)` dynamically imports the i18n bundle for the requested
|
|
769
940
|
* BCP 47 locale tag, enabling code-splitting: only the locale actually used
|
|
770
941
|
* enters the consumer's bundle.
|
|
771
942
|
*
|
|
772
943
|
* ## Resolution order
|
|
773
944
|
*
|
|
774
|
-
* 1. **Exact match** on
|
|
945
|
+
* 1. **Exact match** on a tag in `SUPPORTED_LOCALES`. Content aliases
|
|
946
|
+
* (`en-GB`, `fr-BE`, `nn-NO`, `no-NO`, `se-SE`, `jp-JP`) fall through to
|
|
947
|
+
* the canonical bundle import in this switch.
|
|
775
948
|
* 2. **Language-subtag fallback** — the language portion before the `-` is used
|
|
776
949
|
* to match a bundle, so regional variants resolve gracefully:
|
|
777
|
-
* - `en-
|
|
950
|
+
* - `en-AU` → `en-US` bundle
|
|
778
951
|
* - `es-419`, `es-ES` → `es-MX` bundle
|
|
779
952
|
* - `fr-CA` → `fr-FR` bundle
|
|
780
|
-
* - `pt-
|
|
953
|
+
* - `pt` / `pt-AO` → `pt-BR` bundle (`pt-PT` is an exact match)
|
|
954
|
+
* - `jp` → `ja-JP` bundle
|
|
955
|
+
* - `se` → `sv-SE` bundle
|
|
781
956
|
* 3. **Default fallback** — any unrecognized tag returns the `en-US` bundle.
|
|
782
957
|
*
|
|
783
958
|
* The function **never throws** for an unsupported locale.
|
|
@@ -790,7 +965,7 @@ declare function loadSchema(iso3: string, formType: FormType): Promise<FormSchem
|
|
|
790
965
|
* bundle['country-forms.address.postalCode.label'] // "CEP"
|
|
791
966
|
*
|
|
792
967
|
* @example
|
|
793
|
-
* const bundle = await loadLocale('
|
|
968
|
+
* const bundle = await loadLocale('zz-ZZ') // → en-US bundle (fallback)
|
|
794
969
|
*/
|
|
795
970
|
|
|
796
971
|
declare function loadLocale(locale: string): Promise<I18nBundle>;
|
|
@@ -861,18 +1036,56 @@ declare function resolveLabel(key: string, bundle: I18nBundle, overrides?: I18nO
|
|
|
861
1036
|
*
|
|
862
1037
|
* | Tag | Language |
|
|
863
1038
|
* |----------|---------------------------|
|
|
864
|
-
* | `
|
|
865
|
-
* | `
|
|
866
|
-
* | `
|
|
1039
|
+
* | `ar-SA` | Arabic |
|
|
1040
|
+
* | `bg-BG` | Bulgarian |
|
|
1041
|
+
* | `ca-ES` | Catalan |
|
|
1042
|
+
* | `cs-CZ` | Czech |
|
|
1043
|
+
* | `da-DK` | Danish |
|
|
1044
|
+
* | `de-DE` | German |
|
|
1045
|
+
* | `el-GR` | Greek |
|
|
1046
|
+
* | `en-GB` | English (UK) |
|
|
1047
|
+
* | `en-US` | English |
|
|
1048
|
+
* | `es-MX` | Spanish |
|
|
1049
|
+
* | `fi-FI` | Finnish |
|
|
1050
|
+
* | `fr-BE` | French (Belgium) |
|
|
1051
|
+
* | `fr-FR` | French |
|
|
1052
|
+
* | `hu-HU` | Hungarian |
|
|
1053
|
+
* | `id-ID` | Indonesian |
|
|
1054
|
+
* | `it-IT` | Italian |
|
|
1055
|
+
* | `ja-JP` | Japanese |
|
|
1056
|
+
* | `jp-JP` | Japanese (legacy `jp`) |
|
|
1057
|
+
* | `ko-KR` | Korean |
|
|
1058
|
+
* | `nb-NO` | Norwegian Bokmål |
|
|
1059
|
+
* | `nl-NL` | Dutch |
|
|
1060
|
+
* | `nn-NO` | Norwegian Nynorsk |
|
|
1061
|
+
* | `no-NO` | Norwegian |
|
|
1062
|
+
* | `pl-PL` | Polish |
|
|
867
1063
|
* | `pt-BR` | Portuguese (Brazil) |
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
*
|
|
1064
|
+
* | `pt-PT` | Portuguese (Portugal) |
|
|
1065
|
+
* | `ro-RO` | Romanian |
|
|
1066
|
+
* | `ru-RU` | Russian |
|
|
1067
|
+
* | `se-SE` | Swedish (legacy `se`) |
|
|
1068
|
+
* | `sk-SK` | Slovak |
|
|
1069
|
+
* | `sl-SI` | Slovenian |
|
|
1070
|
+
* | `sv-SE` | Swedish |
|
|
1071
|
+
* | `th-TH` | Thai |
|
|
1072
|
+
* | `uk-UA` | Ukrainian |
|
|
1073
|
+
*
|
|
1074
|
+
* Tags in this list resolve by exact match. Content aliases share copy with a
|
|
1075
|
+
* canonical bundle: `en-GB` → `en-US`, `fr-BE` → `fr-FR`, `nn-NO`/`no-NO` →
|
|
1076
|
+
* `nb-NO`, `se-SE` → `sv-SE`, `jp-JP` → `ja-JP`.
|
|
1077
|
+
* Other regional variants resolve via the language subtag (e.g. `es-419` →
|
|
1078
|
+
* `es-MX`, `en-AU` → `en-US`). Unrecognized languages fall back to `en-US`.
|
|
872
1079
|
*/
|
|
873
1080
|
/** @const BCP 47 tags with built-in bundles. See `loadLocale` for resolution. */
|
|
874
|
-
declare const SUPPORTED_LOCALES: readonly ["en-US", "es-MX", "fr-FR", "pt-BR"];
|
|
1081
|
+
declare const SUPPORTED_LOCALES: readonly ["ar-SA", "bg-BG", "ca-ES", "cs-CZ", "da-DK", "de-DE", "el-GR", "en-GB", "en-US", "es-MX", "fi-FI", "fr-BE", "fr-FR", "hu-HU", "id-ID", "it-IT", "ja-JP", "jp-JP", "ko-KR", "nb-NO", "nl-NL", "nn-NO", "no-NO", "pl-PL", "pt-BR", "pt-PT", "ro-RO", "ru-RU", "se-SE", "sk-SK", "sl-SI", "sv-SE", "th-TH", "uk-UA"];
|
|
875
1082
|
/** Union of BCP 47 tags with dedicated built-in bundles. */
|
|
876
1083
|
type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
|
|
1084
|
+
/** @const Checkout/app locale tags that share copy with a canonical bundle via `loadLocale` fallthrough. */
|
|
1085
|
+
declare const LOCALE_ALIASES: readonly ["en-GB", "fr-BE", "jp-JP", "nn-NO", "no-NO", "se-SE"];
|
|
1086
|
+
/** @const Tags with dedicated bundle copy — aliases excluded. Use for locale selectors. */
|
|
1087
|
+
declare const CANONICAL_LOCALES: ("ar-SA" | "bg-BG" | "ca-ES" | "cs-CZ" | "da-DK" | "de-DE" | "el-GR" | "en-GB" | "en-US" | "es-MX" | "fi-FI" | "fr-BE" | "fr-FR" | "hu-HU" | "id-ID" | "it-IT" | "ja-JP" | "jp-JP" | "ko-KR" | "nb-NO" | "nl-NL" | "nn-NO" | "no-NO" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "se-SE" | "sk-SK" | "sl-SI" | "sv-SE" | "th-TH" | "uk-UA")[];
|
|
1088
|
+
/** Union of BCP 47 tags with a dedicated translation bundle (aliases excluded). */
|
|
1089
|
+
type CanonicalLocale = Exclude<SupportedLocale, (typeof LOCALE_ALIASES)[number]>;
|
|
877
1090
|
|
|
878
|
-
export { type ConditionalOperator, type ConditionalVisibility, type FieldDefinition, type FieldType, type FormErrors, type FormSchema, type FormState, type FormType, type FormValues, type FormatFn, type I18nBundle, type I18nOverrides, type I18nParams, type InputMode, SUPPORTED_ADDRESS_COUNTRIES, SUPPORTED_LOCALES, SUPPORTED_PERSONAL_DATA_COUNTRIES, type SelectOption, type SupportedLocale, type UnformatFn, type ValidationErrors, type ValidationRules, type ValidatorFn, createFormState, formatValue, getVisibleFields, loadLocale, loadSchema, resolveFieldOptions, resolveLabel, setValue, unformatValue, validate };
|
|
1091
|
+
export { CANONICAL_LOCALES, type CanonicalLocale, type ConditionalOperator, type ConditionalVisibility, type FieldDefinition, type FieldType, type FormErrors, type FormSchema, type FormState, type FormType, type FormValues, type FormatFn, type I18nBundle, type I18nOverrides, type I18nParams, type InputMode, LOCALE_ALIASES, SUPPORTED_ADDRESS_COUNTRIES, SUPPORTED_LOCALES, SUPPORTED_PERSONAL_DATA_COUNTRIES, type SelectOption, type SupportedLocale, type UnformatFn, type ValidationErrors, type ValidationRules, type ValidatorFn, createFormState, formatValue, getVisibleFields, loadLocale, loadSchema, resolveFieldFormatRef, resolveFieldInputMode, resolveFieldLabel, resolveFieldOptions, resolveFieldPlaceholder, resolveFieldUnformatRef, resolveFieldValidator, resolveLabel, setValue, unformatValue, validate };
|