@famgia/omnify-react 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -0
- package/dist/components/index.cjs +686 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +95 -0
- package/dist/components/index.d.ts +95 -0
- package/dist/components/index.js +657 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +81 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +20 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/index.js +54 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +1005 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +947 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/index.cjs +479 -0
- package/dist/lib/index.cjs.map +1 -0
- package/dist/lib/index.d.cts +209 -0
- package/dist/lib/index.d.ts +209 -0
- package/dist/lib/index.js +425 -0
- package/dist/lib/index.js.map +1 -0
- package/package.json +110 -0
- package/scripts/postinstall.cjs +121 -0
|
@@ -0,0 +1,686 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/index.ts
|
|
21
|
+
var components_exports = {};
|
|
22
|
+
__export(components_exports, {
|
|
23
|
+
JapaneseAddressField: () => JapaneseAddressField,
|
|
24
|
+
JapaneseBankField: () => JapaneseBankField,
|
|
25
|
+
JapaneseNameField: () => JapaneseNameField
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(components_exports);
|
|
28
|
+
|
|
29
|
+
// src/components/JapaneseNameField.tsx
|
|
30
|
+
var import_antd = require("antd");
|
|
31
|
+
|
|
32
|
+
// src/lib/zod-i18n.ts
|
|
33
|
+
var DEFAULT_MESSAGES = {
|
|
34
|
+
required: {
|
|
35
|
+
en: "${displayName} is required",
|
|
36
|
+
ja: "${displayName}\u306F\u5FC5\u9808\u3067\u3059",
|
|
37
|
+
vi: "${displayName} l\xE0 b\u1EAFt bu\u1ED9c",
|
|
38
|
+
ko: "${displayName}\uC740(\uB294) \uD544\uC218\uC785\uB2C8\uB2E4",
|
|
39
|
+
"zh-CN": "${displayName}\u662F\u5FC5\u586B\u9879",
|
|
40
|
+
"zh-TW": "${displayName}\u70BA\u5FC5\u586B\u6B04\u4F4D",
|
|
41
|
+
th: "${displayName} \u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E23\u0E2D\u0E01",
|
|
42
|
+
es: "${displayName} es obligatorio"
|
|
43
|
+
},
|
|
44
|
+
minLength: {
|
|
45
|
+
en: "${displayName} must be at least ${min} characters",
|
|
46
|
+
ja: "${displayName}\u306F${min}\u6587\u5B57\u4EE5\u4E0A\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
47
|
+
vi: "${displayName} ph\u1EA3i c\xF3 \xEDt nh\u1EA5t ${min} k\xFD t\u1EF1",
|
|
48
|
+
ko: "${displayName}\uC740(\uB294) ${min}\uC790 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
49
|
+
"zh-CN": "${displayName}\u81F3\u5C11\u9700\u8981${min}\u4E2A\u5B57\u7B26",
|
|
50
|
+
"zh-TW": "${displayName}\u81F3\u5C11\u9700\u8981${min}\u500B\u5B57\u5143",
|
|
51
|
+
th: "${displayName} \u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 ${min} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
|
|
52
|
+
es: "${displayName} debe tener al menos ${min} caracteres"
|
|
53
|
+
},
|
|
54
|
+
maxLength: {
|
|
55
|
+
en: "${displayName} must be at most ${max} characters",
|
|
56
|
+
ja: "${displayName}\u306F${max}\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
57
|
+
vi: "${displayName} kh\xF4ng \u0111\u01B0\u1EE3c qu\xE1 ${max} k\xFD t\u1EF1",
|
|
58
|
+
ko: "${displayName}\uC740(\uB294) ${max}\uC790 \uC774\uD558\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
59
|
+
"zh-CN": "${displayName}\u6700\u591A${max}\u4E2A\u5B57\u7B26",
|
|
60
|
+
"zh-TW": "${displayName}\u6700\u591A${max}\u500B\u5B57\u5143",
|
|
61
|
+
th: "${displayName} \u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${max} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
|
|
62
|
+
es: "${displayName} debe tener como m\xE1ximo ${max} caracteres"
|
|
63
|
+
},
|
|
64
|
+
min: {
|
|
65
|
+
en: "${displayName} must be at least ${min}",
|
|
66
|
+
ja: "${displayName}\u306F${min}\u4EE5\u4E0A\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
67
|
+
vi: "${displayName} ph\u1EA3i l\u1EDBn h\u01A1n ho\u1EB7c b\u1EB1ng ${min}",
|
|
68
|
+
ko: "${displayName}\uC740(\uB294) ${min} \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
69
|
+
"zh-CN": "${displayName}\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E${min}",
|
|
70
|
+
"zh-TW": "${displayName}\u5FC5\u9808\u5927\u65BC\u7B49\u65BC${min}",
|
|
71
|
+
th: "${displayName} \u0E15\u0E49\u0E2D\u0E07\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${min}",
|
|
72
|
+
es: "${displayName} debe ser al menos ${min}"
|
|
73
|
+
},
|
|
74
|
+
max: {
|
|
75
|
+
en: "${displayName} must be at most ${max}",
|
|
76
|
+
ja: "${displayName}\u306F${max}\u4EE5\u4E0B\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
77
|
+
vi: "${displayName} ph\u1EA3i nh\u1ECF h\u01A1n ho\u1EB7c b\u1EB1ng ${max}",
|
|
78
|
+
ko: "${displayName}\uC740(\uB294) ${max} \uC774\uD558\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
79
|
+
"zh-CN": "${displayName}\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E${max}",
|
|
80
|
+
"zh-TW": "${displayName}\u5FC5\u9808\u5C0F\u65BC\u7B49\u65BC${max}",
|
|
81
|
+
th: "${displayName} \u0E15\u0E49\u0E2D\u0E07\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A ${max}",
|
|
82
|
+
es: "${displayName} debe ser como m\xE1ximo ${max}"
|
|
83
|
+
},
|
|
84
|
+
email: {
|
|
85
|
+
en: "Please enter a valid email address",
|
|
86
|
+
ja: "\u6709\u52B9\u306A\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
87
|
+
vi: "Vui l\xF2ng nh\u1EADp \u0111\u1ECBa ch\u1EC9 email h\u1EE3p l\u1EC7",
|
|
88
|
+
ko: "\uC720\uD6A8\uD55C \uC774\uBA54\uC77C \uC8FC\uC18C\uB97C \uC785\uB825\uD558\uC138\uC694",
|
|
89
|
+
"zh-CN": "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u7535\u5B50\u90AE\u4EF6\u5730\u5740",
|
|
90
|
+
"zh-TW": "\u8ACB\u8F38\u5165\u6709\u6548\u7684\u96FB\u5B50\u90F5\u4EF6\u5730\u5740",
|
|
91
|
+
th: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E2D\u0E35\u0E40\u0E21\u0E25\u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
92
|
+
es: "Por favor, introduce una direcci\xF3n de correo electr\xF3nico v\xE1lida"
|
|
93
|
+
},
|
|
94
|
+
url: {
|
|
95
|
+
en: "Please enter a valid URL",
|
|
96
|
+
ja: "\u6709\u52B9\u306AURL\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
97
|
+
vi: "Vui l\xF2ng nh\u1EADp URL h\u1EE3p l\u1EC7",
|
|
98
|
+
ko: "\uC720\uD6A8\uD55C URL\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
99
|
+
"zh-CN": "\u8BF7\u8F93\u5165\u6709\u6548\u7684URL",
|
|
100
|
+
"zh-TW": "\u8ACB\u8F38\u5165\u6709\u6548\u7684\u7DB2\u5740",
|
|
101
|
+
th: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01 URL \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
102
|
+
es: "Por favor, introduce una URL v\xE1lida"
|
|
103
|
+
},
|
|
104
|
+
pattern: {
|
|
105
|
+
en: "${displayName} format is invalid",
|
|
106
|
+
ja: "${displayName}\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093",
|
|
107
|
+
vi: "${displayName} kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng",
|
|
108
|
+
ko: "${displayName} \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4",
|
|
109
|
+
"zh-CN": "${displayName}\u683C\u5F0F\u4E0D\u6B63\u786E",
|
|
110
|
+
"zh-TW": "${displayName}\u683C\u5F0F\u4E0D\u6B63\u78BA",
|
|
111
|
+
th: "\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A${displayName}\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
112
|
+
es: "El formato de ${displayName} no es v\xE1lido"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
var currentLocale = "ja";
|
|
116
|
+
var fallbackLocale = "en";
|
|
117
|
+
var customMessages = {};
|
|
118
|
+
function getZodLocale() {
|
|
119
|
+
return currentLocale;
|
|
120
|
+
}
|
|
121
|
+
function getZodMessage(key, params = {}) {
|
|
122
|
+
const messages = customMessages[key] ?? DEFAULT_MESSAGES[key];
|
|
123
|
+
if (!messages) return key;
|
|
124
|
+
let message2 = messages[currentLocale] ?? messages[fallbackLocale] ?? messages["en"] ?? key;
|
|
125
|
+
for (const [param, value] of Object.entries(params)) {
|
|
126
|
+
message2 = message2.replace(new RegExp(`\\$\\{${param}\\}`, "g"), String(value));
|
|
127
|
+
}
|
|
128
|
+
return message2;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/lib/form-validation.ts
|
|
132
|
+
function zodRule(schema, displayName) {
|
|
133
|
+
const field = displayName ?? "\u3053\u306E\u9805\u76EE";
|
|
134
|
+
return {
|
|
135
|
+
validator: async (_, value) => {
|
|
136
|
+
if (value === void 0 || value === null || value === "") {
|
|
137
|
+
if (schema.safeParse(void 0).success) return;
|
|
138
|
+
throw new Error(getZodMessage("required", { displayName: field }));
|
|
139
|
+
}
|
|
140
|
+
const result = schema.safeParse(value);
|
|
141
|
+
if (result.success) return;
|
|
142
|
+
const issue = result.error.issues[0];
|
|
143
|
+
if (!issue) {
|
|
144
|
+
throw new Error(getZodMessage("required", { displayName: field }));
|
|
145
|
+
}
|
|
146
|
+
const issueAny = issue;
|
|
147
|
+
switch (issue.code) {
|
|
148
|
+
case "too_small": {
|
|
149
|
+
const origin = issueAny.origin;
|
|
150
|
+
const minimum = issueAny.minimum;
|
|
151
|
+
if (origin === "string" && minimum === 1) {
|
|
152
|
+
throw new Error(getZodMessage("required", { displayName: field }));
|
|
153
|
+
}
|
|
154
|
+
if (origin === "string") {
|
|
155
|
+
throw new Error(getZodMessage("minLength", { displayName: field, min: minimum }));
|
|
156
|
+
}
|
|
157
|
+
throw new Error(getZodMessage("min", { displayName: field, min: minimum }));
|
|
158
|
+
}
|
|
159
|
+
case "too_big": {
|
|
160
|
+
const origin = issueAny.origin;
|
|
161
|
+
const maximum = issueAny.maximum;
|
|
162
|
+
if (origin === "string") {
|
|
163
|
+
throw new Error(getZodMessage("maxLength", { displayName: field, max: maximum }));
|
|
164
|
+
}
|
|
165
|
+
throw new Error(getZodMessage("max", { displayName: field, max: maximum }));
|
|
166
|
+
}
|
|
167
|
+
// Zod v4: 'invalid_string' → 'invalid_format'
|
|
168
|
+
case "invalid_format": {
|
|
169
|
+
const format = issueAny.format;
|
|
170
|
+
if (format === "email") {
|
|
171
|
+
throw new Error(getZodMessage("email", { displayName: field }));
|
|
172
|
+
}
|
|
173
|
+
if (format === "url") {
|
|
174
|
+
throw new Error(getZodMessage("url", { displayName: field }));
|
|
175
|
+
}
|
|
176
|
+
if (format === "regex") {
|
|
177
|
+
throw new Error(getZodMessage("pattern", { displayName: field }));
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
// Zod v3: 'invalid_string' (handled via default case for forward compatibility)
|
|
182
|
+
default: {
|
|
183
|
+
if (issue.code === "invalid_string") {
|
|
184
|
+
const validation = issueAny.validation;
|
|
185
|
+
if (validation === "email") {
|
|
186
|
+
throw new Error(getZodMessage("email", { displayName: field }));
|
|
187
|
+
}
|
|
188
|
+
if (validation === "url") {
|
|
189
|
+
throw new Error(getZodMessage("url", { displayName: field }));
|
|
190
|
+
}
|
|
191
|
+
if (validation === "regex") {
|
|
192
|
+
throw new Error(getZodMessage("pattern", { displayName: field }));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
case "invalid_type": {
|
|
198
|
+
const expected = issueAny.expected;
|
|
199
|
+
if (expected && value === void 0) {
|
|
200
|
+
throw new Error(getZodMessage("required", { displayName: field }));
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
throw new Error(issue.message);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function isZodRequired(schema) {
|
|
210
|
+
const schemaDesc = schema?._def?.typeName;
|
|
211
|
+
const inner = schema?._def?.innerType;
|
|
212
|
+
if (schemaDesc === "ZodOptional" || schemaDesc === "ZodNullable") return false;
|
|
213
|
+
if (inner?._def?.typeName === "ZodOptional" || inner?._def?.typeName === "ZodNullable") return false;
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// src/components/JapaneseNameField.tsx
|
|
218
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
219
|
+
function getLabel(i18n, field, locale) {
|
|
220
|
+
return i18n.fields[field]?.label?.[locale] ?? i18n.fields[field]?.label?.["en"] ?? field;
|
|
221
|
+
}
|
|
222
|
+
function getCompoundLabel(i18n, prefix, locale) {
|
|
223
|
+
return i18n.fields[prefix]?.label?.[locale] ?? i18n.fields[prefix]?.label?.["en"];
|
|
224
|
+
}
|
|
225
|
+
function getPlaceholder(i18n, field, locale) {
|
|
226
|
+
return i18n.fields[field]?.placeholder?.[locale] ?? i18n.fields[field]?.placeholder?.["en"] ?? "";
|
|
227
|
+
}
|
|
228
|
+
function JapaneseNameField({
|
|
229
|
+
schemas,
|
|
230
|
+
i18n,
|
|
231
|
+
prefix = "name",
|
|
232
|
+
required = false,
|
|
233
|
+
showKana = true,
|
|
234
|
+
label,
|
|
235
|
+
kanaLabel
|
|
236
|
+
}) {
|
|
237
|
+
const locale = getZodLocale();
|
|
238
|
+
const lastnameField = `${prefix}_lastname`;
|
|
239
|
+
const firstnameField = `${prefix}_firstname`;
|
|
240
|
+
const kanaLastnameField = `${prefix}_kana_lastname`;
|
|
241
|
+
const kanaFirstnameField = `${prefix}_kana_firstname`;
|
|
242
|
+
const getRule = (field) => {
|
|
243
|
+
const schema = schemas[field];
|
|
244
|
+
if (!schema) return [];
|
|
245
|
+
return [zodRule(schema, getLabel(i18n, field, locale))];
|
|
246
|
+
};
|
|
247
|
+
const isFieldRequired = (field) => {
|
|
248
|
+
const schema = schemas[field];
|
|
249
|
+
if (!schema) return false;
|
|
250
|
+
return isZodRequired(schema);
|
|
251
|
+
};
|
|
252
|
+
const nameRequired = isFieldRequired(lastnameField) || isFieldRequired(firstnameField) || required;
|
|
253
|
+
const kanaRequired = isFieldRequired(kanaLastnameField) || isFieldRequired(kanaFirstnameField);
|
|
254
|
+
const nameLabel = label ?? getCompoundLabel(i18n, prefix, locale) ?? getLabel(i18n, lastnameField, locale);
|
|
255
|
+
const nameKanaLabel = kanaLabel ?? `${getCompoundLabel(i18n, prefix, locale) ?? getLabel(i18n, kanaLastnameField, locale)}\uFF08\u30AB\u30CA\uFF09`;
|
|
256
|
+
const lastnameShortLabel = locale === "ja" ? "\u59D3" : "Last";
|
|
257
|
+
const firstnameShortLabel = locale === "ja" ? "\u540D" : "First";
|
|
258
|
+
const prefixStyle = {
|
|
259
|
+
color: "rgba(0, 0, 0, 0.88)",
|
|
260
|
+
fontWeight: 500,
|
|
261
|
+
borderRight: "1px solid #d9d9d9",
|
|
262
|
+
paddingRight: 8,
|
|
263
|
+
marginRight: 4
|
|
264
|
+
};
|
|
265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
266
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: nameLabel, required: nameRequired, style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Row, { gutter: 8, children: [
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: lastnameField, rules: getRule(lastnameField), style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
268
|
+
import_antd.Input,
|
|
269
|
+
{
|
|
270
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: prefixStyle, children: lastnameShortLabel }),
|
|
271
|
+
placeholder: getPlaceholder(i18n, lastnameField, locale)
|
|
272
|
+
}
|
|
273
|
+
) }) }),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { name: firstnameField, rules: getRule(firstnameField), style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
275
|
+
import_antd.Input,
|
|
276
|
+
{
|
|
277
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: prefixStyle, children: firstnameShortLabel }),
|
|
278
|
+
placeholder: getPlaceholder(i18n, firstnameField, locale)
|
|
279
|
+
}
|
|
280
|
+
) }) })
|
|
281
|
+
] }) }),
|
|
282
|
+
showKana && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Form.Item, { label: nameKanaLabel, required: kanaRequired, style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Row, { gutter: 8, children: [
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
284
|
+
import_antd.Form.Item,
|
|
285
|
+
{
|
|
286
|
+
name: kanaLastnameField,
|
|
287
|
+
rules: getRule(kanaLastnameField),
|
|
288
|
+
style: { marginBottom: 16 },
|
|
289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
290
|
+
import_antd.Input,
|
|
291
|
+
{
|
|
292
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: prefixStyle, children: lastnameShortLabel }),
|
|
293
|
+
placeholder: getPlaceholder(i18n, kanaLastnameField, locale)
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
}
|
|
297
|
+
) }),
|
|
298
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { span: 12, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
299
|
+
import_antd.Form.Item,
|
|
300
|
+
{
|
|
301
|
+
name: kanaFirstnameField,
|
|
302
|
+
rules: getRule(kanaFirstnameField),
|
|
303
|
+
style: { marginBottom: 16 },
|
|
304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
305
|
+
import_antd.Input,
|
|
306
|
+
{
|
|
307
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: prefixStyle, children: firstnameShortLabel }),
|
|
308
|
+
placeholder: getPlaceholder(i18n, kanaFirstnameField, locale)
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
}
|
|
312
|
+
) })
|
|
313
|
+
] }) })
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// src/components/JapaneseAddressField.tsx
|
|
318
|
+
var import_react = require("react");
|
|
319
|
+
var import_antd2 = require("antd");
|
|
320
|
+
var import_icons = require("@ant-design/icons");
|
|
321
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
322
|
+
function getLabel2(i18n, field, locale) {
|
|
323
|
+
return i18n.fields[field]?.label?.[locale] ?? i18n.fields[field]?.label?.["en"] ?? field;
|
|
324
|
+
}
|
|
325
|
+
function getPlaceholder2(i18n, field, locale) {
|
|
326
|
+
return i18n.fields[field]?.placeholder?.[locale] ?? i18n.fields[field]?.placeholder?.["en"] ?? "";
|
|
327
|
+
}
|
|
328
|
+
async function lookupPostalCode(postalCode) {
|
|
329
|
+
try {
|
|
330
|
+
const response = await fetch(`https://zipcloud.ibsnet.co.jp/api/search?zipcode=${postalCode}`);
|
|
331
|
+
const data = await response.json();
|
|
332
|
+
if (data.results && data.results.length > 0) {
|
|
333
|
+
const result = data.results[0];
|
|
334
|
+
return {
|
|
335
|
+
prefectureCode: result.prefcode,
|
|
336
|
+
prefectureName: result.address1,
|
|
337
|
+
address1: result.address2,
|
|
338
|
+
address2: result.address3
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
} catch (error) {
|
|
343
|
+
console.error("Postal code lookup failed:", error);
|
|
344
|
+
return null;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
var MESSAGES = {
|
|
348
|
+
ja: {
|
|
349
|
+
searchAddress: "\u4F4F\u6240\u691C\u7D22",
|
|
350
|
+
searching: "\u691C\u7D22\u4E2D...",
|
|
351
|
+
notFound: "\u90F5\u4FBF\u756A\u53F7\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F",
|
|
352
|
+
error: "\u4F4F\u6240\u691C\u7D22\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
353
|
+
invalidFormat: "\u90F5\u4FBF\u756A\u53F7\u306E\u5F62\u5F0F\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\uFF08\u4F8B\uFF1A123-4567\uFF09"
|
|
354
|
+
},
|
|
355
|
+
en: {
|
|
356
|
+
searchAddress: "Search Address",
|
|
357
|
+
searching: "Searching...",
|
|
358
|
+
notFound: "Postal code not found",
|
|
359
|
+
error: "Address lookup failed",
|
|
360
|
+
invalidFormat: "Invalid postal code format (e.g., 123-4567)"
|
|
361
|
+
},
|
|
362
|
+
vi: {
|
|
363
|
+
searchAddress: "T\xECm \u0111\u1ECBa ch\u1EC9",
|
|
364
|
+
searching: "\u0110ang t\xECm...",
|
|
365
|
+
notFound: "Kh\xF4ng t\xECm th\u1EA5y m\xE3 b\u01B0u \u0111i\u1EC7n",
|
|
366
|
+
error: "T\xECm \u0111\u1ECBa ch\u1EC9 th\u1EA5t b\u1EA1i",
|
|
367
|
+
invalidFormat: "\u0110\u1ECBnh d\u1EA1ng m\xE3 b\u01B0u \u0111i\u1EC7n kh\xF4ng h\u1EE3p l\u1EC7 (VD: 123-4567)"
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
function getMessage(key, locale) {
|
|
371
|
+
return MESSAGES[locale]?.[key] ?? MESSAGES.ja[key];
|
|
372
|
+
}
|
|
373
|
+
function JapaneseAddressField({
|
|
374
|
+
form,
|
|
375
|
+
schemas,
|
|
376
|
+
i18n,
|
|
377
|
+
prefix = "address",
|
|
378
|
+
usePrefectureId = false,
|
|
379
|
+
prefectureOptions,
|
|
380
|
+
enablePostalLookup = true,
|
|
381
|
+
showSearchButton = true,
|
|
382
|
+
autoSearch = true,
|
|
383
|
+
onPostalLookup
|
|
384
|
+
}) {
|
|
385
|
+
const locale = getZodLocale();
|
|
386
|
+
const [isSearching, setIsSearching] = (0, import_react.useState)(false);
|
|
387
|
+
const postalCodeField = `${prefix}_postal_code`;
|
|
388
|
+
const prefectureField = usePrefectureId ? `${prefix}_prefecture_id` : `${prefix}_prefecture`;
|
|
389
|
+
const address1Field = `${prefix}_address1`;
|
|
390
|
+
const address2Field = `${prefix}_address2`;
|
|
391
|
+
const address3Field = `${prefix}_address3`;
|
|
392
|
+
const getRule = (field) => {
|
|
393
|
+
const schema = schemas[field];
|
|
394
|
+
if (!schema) return [];
|
|
395
|
+
return [zodRule(schema, getLabel2(i18n, field, locale))];
|
|
396
|
+
};
|
|
397
|
+
const isRequired = (field) => {
|
|
398
|
+
const schema = schemas[field];
|
|
399
|
+
if (!schema) return false;
|
|
400
|
+
return isZodRequired(schema);
|
|
401
|
+
};
|
|
402
|
+
const doLookup = (0, import_react.useCallback)(
|
|
403
|
+
async (postalCode) => {
|
|
404
|
+
const digits = postalCode.replace(/[^0-9]/g, "");
|
|
405
|
+
if (digits.length !== 7) {
|
|
406
|
+
import_antd2.message.warning(getMessage("invalidFormat", locale));
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
setIsSearching(true);
|
|
410
|
+
try {
|
|
411
|
+
const lookupFn = onPostalLookup ?? lookupPostalCode;
|
|
412
|
+
const result = await lookupFn(postalCode);
|
|
413
|
+
if (result) {
|
|
414
|
+
const prefectureValue = usePrefectureId ? result.prefectureCode : result.prefecture;
|
|
415
|
+
form.setFieldsValue({
|
|
416
|
+
[prefectureField]: prefectureValue,
|
|
417
|
+
[address1Field]: result.address1,
|
|
418
|
+
[address2Field]: result.address2
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
import_antd2.message.info(getMessage("notFound", locale));
|
|
422
|
+
}
|
|
423
|
+
} catch (error) {
|
|
424
|
+
import_antd2.message.error(getMessage("error", locale));
|
|
425
|
+
console.error("Postal code lookup failed:", error);
|
|
426
|
+
} finally {
|
|
427
|
+
setIsSearching(false);
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
[form, locale, onPostalLookup, prefectureField, address1Field, address2Field, usePrefectureId]
|
|
431
|
+
);
|
|
432
|
+
const handlePostalCodeChange = async (e) => {
|
|
433
|
+
const postalCode = e.target.value.replace(/[^0-9]/g, "");
|
|
434
|
+
if (autoSearch && enablePostalLookup && postalCode.length === 7) {
|
|
435
|
+
await doLookup(postalCode);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
const handleSearchClick = async () => {
|
|
439
|
+
const postalCode = form.getFieldValue(postalCodeField);
|
|
440
|
+
if (postalCode) {
|
|
441
|
+
await doLookup(postalCode);
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
445
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
446
|
+
import_antd2.Form.Item,
|
|
447
|
+
{
|
|
448
|
+
name: postalCodeField,
|
|
449
|
+
label: getLabel2(i18n, postalCodeField, locale),
|
|
450
|
+
rules: getRule(postalCodeField),
|
|
451
|
+
required: isRequired(postalCodeField),
|
|
452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
453
|
+
import_antd2.Input,
|
|
454
|
+
{
|
|
455
|
+
placeholder: getPlaceholder2(i18n, postalCodeField, locale),
|
|
456
|
+
style: { width: enablePostalLookup && showSearchButton ? "calc(100% - 110px)" : 150 },
|
|
457
|
+
onChange: handlePostalCodeChange,
|
|
458
|
+
addonAfter: enablePostalLookup && showSearchButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
459
|
+
import_antd2.Button,
|
|
460
|
+
{
|
|
461
|
+
type: "text",
|
|
462
|
+
size: "small",
|
|
463
|
+
icon: isSearching ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.LoadingOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons.SearchOutlined, {}),
|
|
464
|
+
onClick: handleSearchClick,
|
|
465
|
+
disabled: isSearching,
|
|
466
|
+
children: getMessage("searchAddress", locale)
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
),
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
474
|
+
import_antd2.Form.Item,
|
|
475
|
+
{
|
|
476
|
+
name: prefectureField,
|
|
477
|
+
label: getLabel2(i18n, prefectureField, locale),
|
|
478
|
+
rules: getRule(prefectureField),
|
|
479
|
+
required: isRequired(prefectureField),
|
|
480
|
+
children: prefectureOptions ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
481
|
+
import_antd2.Select,
|
|
482
|
+
{
|
|
483
|
+
placeholder: getPlaceholder2(i18n, prefectureField, locale),
|
|
484
|
+
options: prefectureOptions,
|
|
485
|
+
style: { width: 200 },
|
|
486
|
+
showSearch: true,
|
|
487
|
+
optionFilterProp: "label"
|
|
488
|
+
}
|
|
489
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
490
|
+
import_antd2.Input,
|
|
491
|
+
{
|
|
492
|
+
placeholder: getPlaceholder2(i18n, prefectureField, locale),
|
|
493
|
+
style: { width: 200 }
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
}
|
|
497
|
+
),
|
|
498
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
499
|
+
import_antd2.Form.Item,
|
|
500
|
+
{
|
|
501
|
+
name: address1Field,
|
|
502
|
+
label: getLabel2(i18n, address1Field, locale),
|
|
503
|
+
rules: getRule(address1Field),
|
|
504
|
+
required: isRequired(address1Field),
|
|
505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Input, { placeholder: getPlaceholder2(i18n, address1Field, locale) })
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
509
|
+
import_antd2.Form.Item,
|
|
510
|
+
{
|
|
511
|
+
name: address2Field,
|
|
512
|
+
label: getLabel2(i18n, address2Field, locale),
|
|
513
|
+
rules: getRule(address2Field),
|
|
514
|
+
required: isRequired(address2Field),
|
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Input, { placeholder: getPlaceholder2(i18n, address2Field, locale) })
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
519
|
+
import_antd2.Form.Item,
|
|
520
|
+
{
|
|
521
|
+
name: address3Field,
|
|
522
|
+
label: getLabel2(i18n, address3Field, locale),
|
|
523
|
+
rules: getRule(address3Field),
|
|
524
|
+
required: isRequired(address3Field),
|
|
525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Input, { placeholder: getPlaceholder2(i18n, address3Field, locale) })
|
|
526
|
+
}
|
|
527
|
+
)
|
|
528
|
+
] });
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// src/components/JapaneseBankField.tsx
|
|
532
|
+
var import_antd3 = require("antd");
|
|
533
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
534
|
+
function getLabel3(i18n, field, locale) {
|
|
535
|
+
return i18n.fields[field]?.label?.[locale] ?? i18n.fields[field]?.label?.["en"] ?? field;
|
|
536
|
+
}
|
|
537
|
+
function getPlaceholder3(i18n, field, locale) {
|
|
538
|
+
return i18n.fields[field]?.placeholder?.[locale] ?? i18n.fields[field]?.placeholder?.["en"] ?? "";
|
|
539
|
+
}
|
|
540
|
+
function JapaneseBankField({
|
|
541
|
+
schemas,
|
|
542
|
+
i18n,
|
|
543
|
+
prefix = "bank",
|
|
544
|
+
accountTypeOptions
|
|
545
|
+
}) {
|
|
546
|
+
const locale = getZodLocale();
|
|
547
|
+
const bankCodeField = `${prefix}_bank_code`;
|
|
548
|
+
const bankNameField = `${prefix}_bank_name`;
|
|
549
|
+
const branchCodeField = `${prefix}_branch_code`;
|
|
550
|
+
const branchNameField = `${prefix}_branch_name`;
|
|
551
|
+
const accountTypeField = `${prefix}_account_type`;
|
|
552
|
+
const accountNumberField = `${prefix}_account_number`;
|
|
553
|
+
const accountHolderField = `${prefix}_account_holder`;
|
|
554
|
+
const getRule = (field) => {
|
|
555
|
+
const schema = schemas[field];
|
|
556
|
+
if (!schema) return [];
|
|
557
|
+
return [zodRule(schema, getLabel3(i18n, field, locale))];
|
|
558
|
+
};
|
|
559
|
+
const isRequired = (field) => {
|
|
560
|
+
const schema = schemas[field];
|
|
561
|
+
if (!schema) return false;
|
|
562
|
+
return isZodRequired(schema);
|
|
563
|
+
};
|
|
564
|
+
const bankRequired = isRequired(bankCodeField) || isRequired(bankNameField);
|
|
565
|
+
const branchRequired = isRequired(branchCodeField) || isRequired(branchNameField);
|
|
566
|
+
const codeShortLabel = locale === "ja" ? "\u30B3\u30FC\u30C9" : "Code";
|
|
567
|
+
const nameShortLabel = locale === "ja" ? "\u540D\u79F0" : "Name";
|
|
568
|
+
const bankLabel = locale === "ja" ? "\u9280\u884C" : "Bank";
|
|
569
|
+
const branchLabel = locale === "ja" ? "\u652F\u5E97" : "Branch";
|
|
570
|
+
const prefixStyle = {
|
|
571
|
+
color: "rgba(0, 0, 0, 0.88)",
|
|
572
|
+
fontWeight: 500,
|
|
573
|
+
borderRight: "1px solid #d9d9d9",
|
|
574
|
+
paddingRight: 8,
|
|
575
|
+
marginRight: 4
|
|
576
|
+
};
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
578
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Form.Item, { label: bankLabel, required: bankRequired, style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_antd3.Row, { gutter: 8, children: [
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Col, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Form.Item, { name: bankCodeField, rules: getRule(bankCodeField), style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
580
|
+
import_antd3.Input,
|
|
581
|
+
{
|
|
582
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: prefixStyle, children: codeShortLabel }),
|
|
583
|
+
placeholder: getPlaceholder3(i18n, bankCodeField, locale),
|
|
584
|
+
maxLength: 4
|
|
585
|
+
}
|
|
586
|
+
) }) }),
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Col, { span: 16, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Form.Item, { name: bankNameField, rules: getRule(bankNameField), style: { marginBottom: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
588
|
+
import_antd3.Input,
|
|
589
|
+
{
|
|
590
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: prefixStyle, children: nameShortLabel }),
|
|
591
|
+
placeholder: getPlaceholder3(i18n, bankNameField, locale)
|
|
592
|
+
}
|
|
593
|
+
) }) })
|
|
594
|
+
] }) }),
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Form.Item, { label: branchLabel, required: branchRequired, style: { marginBottom: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_antd3.Row, { gutter: 8, children: [
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Col, { span: 8, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
597
|
+
import_antd3.Form.Item,
|
|
598
|
+
{
|
|
599
|
+
name: branchCodeField,
|
|
600
|
+
rules: getRule(branchCodeField),
|
|
601
|
+
style: { marginBottom: 16 },
|
|
602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
603
|
+
import_antd3.Input,
|
|
604
|
+
{
|
|
605
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: prefixStyle, children: codeShortLabel }),
|
|
606
|
+
placeholder: getPlaceholder3(i18n, branchCodeField, locale),
|
|
607
|
+
maxLength: 3
|
|
608
|
+
}
|
|
609
|
+
)
|
|
610
|
+
}
|
|
611
|
+
) }),
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Col, { span: 16, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
613
|
+
import_antd3.Form.Item,
|
|
614
|
+
{
|
|
615
|
+
name: branchNameField,
|
|
616
|
+
rules: getRule(branchNameField),
|
|
617
|
+
style: { marginBottom: 16 },
|
|
618
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
619
|
+
import_antd3.Input,
|
|
620
|
+
{
|
|
621
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: prefixStyle, children: nameShortLabel }),
|
|
622
|
+
placeholder: getPlaceholder3(i18n, branchNameField, locale)
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
}
|
|
626
|
+
) })
|
|
627
|
+
] }) }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
629
|
+
import_antd3.Form.Item,
|
|
630
|
+
{
|
|
631
|
+
name: accountTypeField,
|
|
632
|
+
label: getLabel3(i18n, accountTypeField, locale),
|
|
633
|
+
rules: getRule(accountTypeField),
|
|
634
|
+
required: isRequired(accountTypeField),
|
|
635
|
+
children: accountTypeOptions ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
636
|
+
import_antd3.Select,
|
|
637
|
+
{
|
|
638
|
+
placeholder: getPlaceholder3(i18n, accountTypeField, locale),
|
|
639
|
+
options: accountTypeOptions,
|
|
640
|
+
style: { width: 150 }
|
|
641
|
+
}
|
|
642
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
643
|
+
import_antd3.Input,
|
|
644
|
+
{
|
|
645
|
+
placeholder: getPlaceholder3(i18n, accountTypeField, locale),
|
|
646
|
+
style: { width: 150 }
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
}
|
|
650
|
+
),
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
652
|
+
import_antd3.Form.Item,
|
|
653
|
+
{
|
|
654
|
+
name: accountNumberField,
|
|
655
|
+
label: getLabel3(i18n, accountNumberField, locale),
|
|
656
|
+
rules: getRule(accountNumberField),
|
|
657
|
+
required: isRequired(accountNumberField),
|
|
658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
659
|
+
import_antd3.Input,
|
|
660
|
+
{
|
|
661
|
+
placeholder: getPlaceholder3(i18n, accountNumberField, locale),
|
|
662
|
+
maxLength: 7,
|
|
663
|
+
style: { width: 150 }
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
669
|
+
import_antd3.Form.Item,
|
|
670
|
+
{
|
|
671
|
+
name: accountHolderField,
|
|
672
|
+
label: getLabel3(i18n, accountHolderField, locale),
|
|
673
|
+
rules: getRule(accountHolderField),
|
|
674
|
+
required: isRequired(accountHolderField),
|
|
675
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.Input, { placeholder: getPlaceholder3(i18n, accountHolderField, locale) })
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
] });
|
|
679
|
+
}
|
|
680
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
681
|
+
0 && (module.exports = {
|
|
682
|
+
JapaneseAddressField,
|
|
683
|
+
JapaneseBankField,
|
|
684
|
+
JapaneseNameField
|
|
685
|
+
});
|
|
686
|
+
//# sourceMappingURL=index.cjs.map
|