@asdp/ferryui 0.1.22-dev.9789 → 0.1.22-dev.9800
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/dist/index.d.mts +17 -8
- package/dist/index.d.ts +17 -8
- package/dist/index.js +93 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +93 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10783,7 +10783,7 @@ var DEFAULT_LABELS23 = {
|
|
|
10783
10783
|
cancelButton: "Batal",
|
|
10784
10784
|
idTypeOtherLabel: "Tanggal lahir",
|
|
10785
10785
|
idTypeOtherPlaceholder: "DD/MM/YYYY",
|
|
10786
|
-
countryLabel: "Negara Penerbit
|
|
10786
|
+
countryLabel: "Negara Penerbit Paspor",
|
|
10787
10787
|
countryPlaceholder: "Masukkan Negara",
|
|
10788
10788
|
autofill: "Isi Data Otomatis",
|
|
10789
10789
|
phoneNumberLabel: "Nomor Telepon",
|
|
@@ -10813,7 +10813,7 @@ var DEFAULT_LABELS23 = {
|
|
|
10813
10813
|
minLengthName: "Nama minimal 3 karakter",
|
|
10814
10814
|
requiredIdType: "Jenis ID harus dipilih",
|
|
10815
10815
|
requiredIdNumber: "Nomor identitas harus diisi",
|
|
10816
|
-
|
|
10816
|
+
lengthIdNumber: "Nomor identitas minimal 6 karakter",
|
|
10817
10817
|
requiredAge: "Usia harus diisi",
|
|
10818
10818
|
minAge: "Usia minimal 1 tahun",
|
|
10819
10819
|
maxAge: "Usia maksimal 150 tahun",
|
|
@@ -10823,7 +10823,9 @@ var DEFAULT_LABELS23 = {
|
|
|
10823
10823
|
requiredCountry: "Negara harus diisi",
|
|
10824
10824
|
requiredPhoneNumber: "Nomor telepon harus diisi",
|
|
10825
10825
|
minLengthPhoneNumber: "Nomor telepon minimal 10 karakter",
|
|
10826
|
-
invalidEmail: "Format email tidak valid"
|
|
10826
|
+
invalidEmail: "Format email tidak valid",
|
|
10827
|
+
invalidName: "Nama hanya boleh berisi huruf dan spasi",
|
|
10828
|
+
invalidIdNumber: "Format Nomor Identitas tidak valid"
|
|
10827
10829
|
}
|
|
10828
10830
|
},
|
|
10829
10831
|
en: {
|
|
@@ -10879,7 +10881,7 @@ var DEFAULT_LABELS23 = {
|
|
|
10879
10881
|
minLengthName: "Name must be at least 3 characters",
|
|
10880
10882
|
requiredIdType: "ID type is required",
|
|
10881
10883
|
requiredIdNumber: "Identity number is required",
|
|
10882
|
-
|
|
10884
|
+
lengthIdNumber: "Identity number must be at least 6 characters",
|
|
10883
10885
|
requiredAge: "Age is required",
|
|
10884
10886
|
minAge: "Age must be at least 1 year",
|
|
10885
10887
|
maxAge: "Age must be at most 150 years",
|
|
@@ -10889,7 +10891,9 @@ var DEFAULT_LABELS23 = {
|
|
|
10889
10891
|
requiredCountry: "Country is required",
|
|
10890
10892
|
requiredPhoneNumber: "Phone number is required",
|
|
10891
10893
|
minLengthPhoneNumber: "Phone number must be at least 10 characters",
|
|
10892
|
-
invalidEmail: "Invalid email format"
|
|
10894
|
+
invalidEmail: "Invalid email format",
|
|
10895
|
+
invalidName: "Name must only contain letters and spaces",
|
|
10896
|
+
invalidIdNumber: "Invalid Identity Number format"
|
|
10893
10897
|
}
|
|
10894
10898
|
}
|
|
10895
10899
|
};
|
|
@@ -11086,7 +11090,7 @@ var ModalPassengerForm = ({
|
|
|
11086
11090
|
titleOptions,
|
|
11087
11091
|
countryOptions,
|
|
11088
11092
|
cityOptions,
|
|
11089
|
-
|
|
11093
|
+
idTypes,
|
|
11090
11094
|
ticketClassOptions,
|
|
11091
11095
|
onScanComplete
|
|
11092
11096
|
}) => {
|
|
@@ -11117,6 +11121,11 @@ var ModalPassengerForm = ({
|
|
|
11117
11121
|
const watchIdentityTypeId = watch("identityTypeId");
|
|
11118
11122
|
const watchPassportCountryId = watch("countryId");
|
|
11119
11123
|
const watchBirthdate = watch("birthdate");
|
|
11124
|
+
const selectedIdentityType = idTypes.find(
|
|
11125
|
+
(type) => type.id.toString() === watchIdentityTypeId
|
|
11126
|
+
);
|
|
11127
|
+
const idRuleLengthMatch = selectedIdentityType?.rule?.match(/\{(\d+)(?:,\d+)?\}/);
|
|
11128
|
+
const dynamicMinLengthId = idRuleLengthMatch ? parseInt(idRuleLengthMatch[1], 10) : 6;
|
|
11120
11129
|
useEffect(() => {
|
|
11121
11130
|
const subscription = watch((value, { name, type }) => {
|
|
11122
11131
|
console.log("Changed field:", name);
|
|
@@ -11346,22 +11355,22 @@ var ModalPassengerForm = ({
|
|
|
11346
11355
|
children: /* @__PURE__ */ jsx(Subtitle1, { children: mergedLabels.selectIdTypeTitle })
|
|
11347
11356
|
}
|
|
11348
11357
|
),
|
|
11349
|
-
/* @__PURE__ */ jsx(DialogContent, { className: styles.content, children: /* @__PURE__ */ jsx("div", { className: styles.idTypeList, children:
|
|
11358
|
+
/* @__PURE__ */ jsx(DialogContent, { className: styles.content, children: /* @__PURE__ */ jsx("div", { className: styles.idTypeList, children: idTypes.map((type) => /* @__PURE__ */ jsx(
|
|
11350
11359
|
"div",
|
|
11351
11360
|
{
|
|
11352
11361
|
className: styles.idTypeItem,
|
|
11353
|
-
onClick: () => handleSelectIdType(Number(type.
|
|
11362
|
+
onClick: () => handleSelectIdType(Number(type.id)),
|
|
11354
11363
|
onKeyDown: (e) => {
|
|
11355
11364
|
if (e.key === "Enter" || e.key === " ") {
|
|
11356
11365
|
e.preventDefault();
|
|
11357
|
-
handleSelectIdType(
|
|
11366
|
+
handleSelectIdType(type.id);
|
|
11358
11367
|
}
|
|
11359
11368
|
},
|
|
11360
11369
|
role: "button",
|
|
11361
11370
|
tabIndex: 0,
|
|
11362
|
-
children: /* @__PURE__ */ jsx("span", { className: styles.idTypeText, children: type.
|
|
11371
|
+
children: /* @__PURE__ */ jsx("span", { className: styles.idTypeText, children: type.name })
|
|
11363
11372
|
},
|
|
11364
|
-
type.
|
|
11373
|
+
type.id
|
|
11365
11374
|
)) }) })
|
|
11366
11375
|
] }) })
|
|
11367
11376
|
}
|
|
@@ -11656,6 +11665,10 @@ var ModalPassengerForm = ({
|
|
|
11656
11665
|
minLength: {
|
|
11657
11666
|
value: 3,
|
|
11658
11667
|
message: mergedErrors.minLengthName
|
|
11668
|
+
},
|
|
11669
|
+
pattern: {
|
|
11670
|
+
value: /^[a-zA-Z\s]+$/,
|
|
11671
|
+
message: mergedErrors.invalidName
|
|
11659
11672
|
}
|
|
11660
11673
|
}
|
|
11661
11674
|
}
|
|
@@ -11705,7 +11718,10 @@ var ModalPassengerForm = ({
|
|
|
11705
11718
|
type: "select",
|
|
11706
11719
|
label: mergedLabels.idTypeLabel,
|
|
11707
11720
|
placeholder: mergedLabels.idTypePlaceholder,
|
|
11708
|
-
options:
|
|
11721
|
+
options: idTypes.map((t) => ({
|
|
11722
|
+
label: t.name,
|
|
11723
|
+
value: t.id.toString()
|
|
11724
|
+
})),
|
|
11709
11725
|
size: "large",
|
|
11710
11726
|
required: true,
|
|
11711
11727
|
validationRules: {
|
|
@@ -11717,15 +11733,15 @@ var ModalPassengerForm = ({
|
|
|
11717
11733
|
watchIdentityTypeId === IDENTITY_TYPE.PSP.toString() && /* @__PURE__ */ jsx(
|
|
11718
11734
|
InputDynamic_default,
|
|
11719
11735
|
{
|
|
11736
|
+
control,
|
|
11737
|
+
label: mergedLabels.countryLabel,
|
|
11720
11738
|
menuPlacement: "top",
|
|
11721
11739
|
name: "countryId",
|
|
11722
|
-
control,
|
|
11723
11740
|
options: countryOptions,
|
|
11724
|
-
type: "select",
|
|
11725
|
-
label: mergedLabels.countryLabel,
|
|
11726
11741
|
placeholder: mergedLabels.countryPlaceholder,
|
|
11727
|
-
size: "large",
|
|
11728
11742
|
required: true,
|
|
11743
|
+
size: "large",
|
|
11744
|
+
type: "country",
|
|
11729
11745
|
validationRules: {
|
|
11730
11746
|
required: mergedErrors.requiredCountry
|
|
11731
11747
|
}
|
|
@@ -11736,7 +11752,7 @@ var ModalPassengerForm = ({
|
|
|
11736
11752
|
{
|
|
11737
11753
|
name: "identityId",
|
|
11738
11754
|
control,
|
|
11739
|
-
type:
|
|
11755
|
+
type: "text",
|
|
11740
11756
|
label: mergedLabels.idNumberLabel,
|
|
11741
11757
|
placeholder: mergedLabels.idNumberPlaceholder,
|
|
11742
11758
|
size: "large",
|
|
@@ -11744,8 +11760,40 @@ var ModalPassengerForm = ({
|
|
|
11744
11760
|
validationRules: {
|
|
11745
11761
|
required: mergedErrors.requiredIdNumber,
|
|
11746
11762
|
minLength: {
|
|
11747
|
-
value:
|
|
11748
|
-
message: mergedErrors.
|
|
11763
|
+
value: dynamicMinLengthId,
|
|
11764
|
+
message: mergedErrors.lengthIdNumber.replace(
|
|
11765
|
+
"6",
|
|
11766
|
+
dynamicMinLengthId.toString()
|
|
11767
|
+
)
|
|
11768
|
+
},
|
|
11769
|
+
...selectedIdentityType?.rule ? {
|
|
11770
|
+
pattern: {
|
|
11771
|
+
value: new RegExp(
|
|
11772
|
+
selectedIdentityType.rule
|
|
11773
|
+
),
|
|
11774
|
+
message: mergedErrors.invalidIdNumber
|
|
11775
|
+
}
|
|
11776
|
+
} : {}
|
|
11777
|
+
},
|
|
11778
|
+
onChange: (val) => {
|
|
11779
|
+
let cleaned = val;
|
|
11780
|
+
if (selectedIdentityType?.rule) {
|
|
11781
|
+
const match = selectedIdentityType.rule.match(/\[(.*?)\]/);
|
|
11782
|
+
if (match && match[1]) {
|
|
11783
|
+
const filterRegex = new RegExp(
|
|
11784
|
+
`[^${match[1]}]`,
|
|
11785
|
+
"g"
|
|
11786
|
+
);
|
|
11787
|
+
cleaned = val.replace(filterRegex, "");
|
|
11788
|
+
}
|
|
11789
|
+
} else {
|
|
11790
|
+
cleaned = val.replace(/[^a-zA-Z0-9]/g, "");
|
|
11791
|
+
}
|
|
11792
|
+
if (cleaned !== val) {
|
|
11793
|
+
setValue("identityId", cleaned, {
|
|
11794
|
+
shouldValidate: true,
|
|
11795
|
+
shouldDirty: true
|
|
11796
|
+
});
|
|
11749
11797
|
}
|
|
11750
11798
|
}
|
|
11751
11799
|
}
|
|
@@ -12046,7 +12094,8 @@ var DEFAULT_LABELS25 = {
|
|
|
12046
12094
|
vehicleNumberPlaceholder: "Contoh: B1234CD",
|
|
12047
12095
|
hasLoadLabel: "Apakah kendaraan membawa muatan?",
|
|
12048
12096
|
yesLabel: "Ya",
|
|
12049
|
-
noLabel: "Tidak"
|
|
12097
|
+
noLabel: "Tidak",
|
|
12098
|
+
vehicleNumberFormatError: "Format Plat Nomor Tidak Valid"
|
|
12050
12099
|
},
|
|
12051
12100
|
en: {
|
|
12052
12101
|
title: "Vehicle Details",
|
|
@@ -12054,7 +12103,8 @@ var DEFAULT_LABELS25 = {
|
|
|
12054
12103
|
vehicleNumberPlaceholder: "Example: B1234CD",
|
|
12055
12104
|
hasLoadLabel: "Does the vehicle carry a load?",
|
|
12056
12105
|
yesLabel: "Yes",
|
|
12057
|
-
noLabel: "No"
|
|
12106
|
+
noLabel: "No",
|
|
12107
|
+
vehicleNumberFormatError: "Invalid License Plate Format"
|
|
12058
12108
|
}
|
|
12059
12109
|
};
|
|
12060
12110
|
var useStyles26 = makeStyles({
|
|
@@ -12137,7 +12187,28 @@ var CardVehicleDetail = ({
|
|
|
12137
12187
|
name: vehicleNumberName,
|
|
12138
12188
|
placeholder: mergedLabels.vehicleNumberPlaceholder,
|
|
12139
12189
|
required: true,
|
|
12140
|
-
type: "text"
|
|
12190
|
+
type: "text",
|
|
12191
|
+
onInput: (e) => {
|
|
12192
|
+
const target = e.currentTarget;
|
|
12193
|
+
const val = target.value;
|
|
12194
|
+
const formatted = val.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
12195
|
+
if (val !== formatted) {
|
|
12196
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
|
|
12197
|
+
window.HTMLInputElement.prototype,
|
|
12198
|
+
"value"
|
|
12199
|
+
)?.set;
|
|
12200
|
+
if (nativeInputValueSetter) {
|
|
12201
|
+
nativeInputValueSetter.call(target, formatted);
|
|
12202
|
+
target.dispatchEvent(new Event("input", { bubbles: true }));
|
|
12203
|
+
}
|
|
12204
|
+
}
|
|
12205
|
+
},
|
|
12206
|
+
validationRules: {
|
|
12207
|
+
pattern: {
|
|
12208
|
+
value: /^[A-Z]{1,2}[0-9]{1,4}[A-Z]{1,4}$/,
|
|
12209
|
+
message: mergedLabels.vehicleNumberFormatError || "Format Plat Nomor Tidak Valid"
|
|
12210
|
+
}
|
|
12211
|
+
}
|
|
12141
12212
|
}
|
|
12142
12213
|
)
|
|
12143
12214
|
] }),
|