@asdp/ferryui 0.1.22-dev.10310 → 0.1.22-dev.10344
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 +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +22 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -399,10 +399,12 @@ var PASSENGER_TYPE = {
|
|
|
399
399
|
ELDERLY: 4
|
|
400
400
|
};
|
|
401
401
|
var IDENTITY_TYPE = {
|
|
402
|
-
KTP:
|
|
403
|
-
SIM:
|
|
404
|
-
|
|
405
|
-
|
|
402
|
+
KTP: "KTP",
|
|
403
|
+
SIM: "SIM",
|
|
404
|
+
KK: "KK",
|
|
405
|
+
KTA: "KTA",
|
|
406
|
+
PASSPORT: "PASSPORT",
|
|
407
|
+
LAINNYA: "LAINNYA"
|
|
406
408
|
};
|
|
407
409
|
var LOAD_TYPE = {
|
|
408
410
|
PEDESTRIAN: 1,
|
|
@@ -1089,6 +1091,7 @@ var DEFAULT_LABELS5 = {
|
|
|
1089
1091
|
soldOutLabel: "Habis",
|
|
1090
1092
|
estimationPrefix: "Estimasi",
|
|
1091
1093
|
priceDetailsButton: "Rincian Harga",
|
|
1094
|
+
priceListDetailButton: "Daftar Harga",
|
|
1092
1095
|
policyButton: "Kebijakan",
|
|
1093
1096
|
totalPriceLabel: "Total harga",
|
|
1094
1097
|
facilitiesLabel: "Fasilitas",
|
|
@@ -1104,6 +1107,7 @@ var DEFAULT_LABELS5 = {
|
|
|
1104
1107
|
soldOutLabel: "Sold Out",
|
|
1105
1108
|
estimationPrefix: "Estimation",
|
|
1106
1109
|
priceDetailsButton: "Price Details",
|
|
1110
|
+
priceListDetailButton: "Price List",
|
|
1107
1111
|
policyButton: "Policy",
|
|
1108
1112
|
totalPriceLabel: "Total price",
|
|
1109
1113
|
facilitiesLabel: "Facilities",
|
|
@@ -1711,7 +1715,7 @@ var CardTicket = ({
|
|
|
1711
1715
|
departureItem?.billingDetail,
|
|
1712
1716
|
departureItem?.provider
|
|
1713
1717
|
),
|
|
1714
|
-
children: mergedLabels.priceDetailsButton
|
|
1718
|
+
children: loadType === 6 ? mergedLabels.priceListDetailButton : mergedLabels.priceDetailsButton
|
|
1715
1719
|
}
|
|
1716
1720
|
),
|
|
1717
1721
|
/* @__PURE__ */ jsx(
|
|
@@ -11459,10 +11463,10 @@ var ModalPassengerForm = ({
|
|
|
11459
11463
|
const watchIdentityTypeId = watch("identityTypeId");
|
|
11460
11464
|
const watchPassportCountryId = watch("countryId");
|
|
11461
11465
|
const watchBirthdate = watch("birthdate");
|
|
11462
|
-
const
|
|
11466
|
+
const _selectedIdentityType = idTypes.find(
|
|
11463
11467
|
(type) => type.id.toString() === watchIdentityTypeId
|
|
11464
11468
|
);
|
|
11465
|
-
const idRuleLengthMatch =
|
|
11469
|
+
const idRuleLengthMatch = _selectedIdentityType?.rule?.match(/\{(\d+)(?:,\d+)?\}/);
|
|
11466
11470
|
const dynamicMinLengthId = idRuleLengthMatch ? parseInt(idRuleLengthMatch[1], 10) : 6;
|
|
11467
11471
|
useEffect(() => {
|
|
11468
11472
|
reset(defaultValues);
|
|
@@ -11533,7 +11537,7 @@ var ModalPassengerForm = ({
|
|
|
11533
11537
|
ctx.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height);
|
|
11534
11538
|
setCapturedImage(canvas.toDataURL("image/jpeg"));
|
|
11535
11539
|
stopCamera();
|
|
11536
|
-
if (scannedIdType === IDENTITY_TYPE.KTP) {
|
|
11540
|
+
if (scannedIdType === IDENTITY_TYPE.KTP.toString()) {
|
|
11537
11541
|
setScanStatus("reading");
|
|
11538
11542
|
} else {
|
|
11539
11543
|
setScanStatus("error");
|
|
@@ -11654,8 +11658,8 @@ var ModalPassengerForm = ({
|
|
|
11654
11658
|
const handleCloseModalSelectTypeId = () => {
|
|
11655
11659
|
setIsModalSelectIdTypeOpen(false);
|
|
11656
11660
|
};
|
|
11657
|
-
const handleSelectIdType = (
|
|
11658
|
-
setScannedIdType(
|
|
11661
|
+
const handleSelectIdType = (selectedIdentityTypeCode) => {
|
|
11662
|
+
setScannedIdType(selectedIdentityTypeCode);
|
|
11659
11663
|
setIsModalSelectIdTypeOpen(false);
|
|
11660
11664
|
setScanStatus("idle");
|
|
11661
11665
|
setIsModalScanOpen(true);
|
|
@@ -11699,11 +11703,11 @@ var ModalPassengerForm = ({
|
|
|
11699
11703
|
"div",
|
|
11700
11704
|
{
|
|
11701
11705
|
className: styles.idTypeItem,
|
|
11702
|
-
onClick: () => handleSelectIdType(
|
|
11706
|
+
onClick: () => handleSelectIdType(type.code),
|
|
11703
11707
|
onKeyDown: (e) => {
|
|
11704
11708
|
if (e.key === "Enter" || e.key === " ") {
|
|
11705
11709
|
e.preventDefault();
|
|
11706
|
-
handleSelectIdType(type.
|
|
11710
|
+
handleSelectIdType(type.code);
|
|
11707
11711
|
}
|
|
11708
11712
|
},
|
|
11709
11713
|
role: "button",
|
|
@@ -12082,8 +12086,8 @@ var ModalPassengerForm = ({
|
|
|
12082
12086
|
}
|
|
12083
12087
|
}
|
|
12084
12088
|
),
|
|
12085
|
-
watchIdentityTypeId ?
|
|
12086
|
-
|
|
12089
|
+
watchIdentityTypeId ? _selectedIdentityType?.code !== IDENTITY_TYPE.LAINNYA.toString() && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12090
|
+
_selectedIdentityType?.code === IDENTITY_TYPE.PASSPORT.toString() && /* @__PURE__ */ jsx(
|
|
12087
12091
|
InputDynamic_default,
|
|
12088
12092
|
{
|
|
12089
12093
|
control,
|
|
@@ -12119,10 +12123,10 @@ var ModalPassengerForm = ({
|
|
|
12119
12123
|
dynamicMinLengthId.toString()
|
|
12120
12124
|
)
|
|
12121
12125
|
},
|
|
12122
|
-
...
|
|
12126
|
+
..._selectedIdentityType?.rule ? {
|
|
12123
12127
|
pattern: {
|
|
12124
12128
|
value: new RegExp(
|
|
12125
|
-
|
|
12129
|
+
_selectedIdentityType.rule
|
|
12126
12130
|
),
|
|
12127
12131
|
message: mergedErrors.invalidIdNumber
|
|
12128
12132
|
}
|
|
@@ -12130,8 +12134,8 @@ var ModalPassengerForm = ({
|
|
|
12130
12134
|
},
|
|
12131
12135
|
onChange: (val) => {
|
|
12132
12136
|
let cleaned = val;
|
|
12133
|
-
if (
|
|
12134
|
-
const match =
|
|
12137
|
+
if (_selectedIdentityType?.rule) {
|
|
12138
|
+
const match = _selectedIdentityType.rule.match(/\[(.*?)\]/);
|
|
12135
12139
|
if (match && match[1]) {
|
|
12136
12140
|
const filterRegex = new RegExp(
|
|
12137
12141
|
`[^${match[1]}]`,
|