@asdp/ferryui 0.1.22-dev.10319 → 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 +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -17
- 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,
|
|
@@ -11461,10 +11463,10 @@ var ModalPassengerForm = ({
|
|
|
11461
11463
|
const watchIdentityTypeId = watch("identityTypeId");
|
|
11462
11464
|
const watchPassportCountryId = watch("countryId");
|
|
11463
11465
|
const watchBirthdate = watch("birthdate");
|
|
11464
|
-
const
|
|
11466
|
+
const _selectedIdentityType = idTypes.find(
|
|
11465
11467
|
(type) => type.id.toString() === watchIdentityTypeId
|
|
11466
11468
|
);
|
|
11467
|
-
const idRuleLengthMatch =
|
|
11469
|
+
const idRuleLengthMatch = _selectedIdentityType?.rule?.match(/\{(\d+)(?:,\d+)?\}/);
|
|
11468
11470
|
const dynamicMinLengthId = idRuleLengthMatch ? parseInt(idRuleLengthMatch[1], 10) : 6;
|
|
11469
11471
|
useEffect(() => {
|
|
11470
11472
|
reset(defaultValues);
|
|
@@ -11535,7 +11537,7 @@ var ModalPassengerForm = ({
|
|
|
11535
11537
|
ctx.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height);
|
|
11536
11538
|
setCapturedImage(canvas.toDataURL("image/jpeg"));
|
|
11537
11539
|
stopCamera();
|
|
11538
|
-
if (scannedIdType === IDENTITY_TYPE.KTP) {
|
|
11540
|
+
if (scannedIdType === IDENTITY_TYPE.KTP.toString()) {
|
|
11539
11541
|
setScanStatus("reading");
|
|
11540
11542
|
} else {
|
|
11541
11543
|
setScanStatus("error");
|
|
@@ -11656,8 +11658,8 @@ var ModalPassengerForm = ({
|
|
|
11656
11658
|
const handleCloseModalSelectTypeId = () => {
|
|
11657
11659
|
setIsModalSelectIdTypeOpen(false);
|
|
11658
11660
|
};
|
|
11659
|
-
const handleSelectIdType = (
|
|
11660
|
-
setScannedIdType(
|
|
11661
|
+
const handleSelectIdType = (selectedIdentityTypeCode) => {
|
|
11662
|
+
setScannedIdType(selectedIdentityTypeCode);
|
|
11661
11663
|
setIsModalSelectIdTypeOpen(false);
|
|
11662
11664
|
setScanStatus("idle");
|
|
11663
11665
|
setIsModalScanOpen(true);
|
|
@@ -11701,11 +11703,11 @@ var ModalPassengerForm = ({
|
|
|
11701
11703
|
"div",
|
|
11702
11704
|
{
|
|
11703
11705
|
className: styles.idTypeItem,
|
|
11704
|
-
onClick: () => handleSelectIdType(
|
|
11706
|
+
onClick: () => handleSelectIdType(type.code),
|
|
11705
11707
|
onKeyDown: (e) => {
|
|
11706
11708
|
if (e.key === "Enter" || e.key === " ") {
|
|
11707
11709
|
e.preventDefault();
|
|
11708
|
-
handleSelectIdType(type.
|
|
11710
|
+
handleSelectIdType(type.code);
|
|
11709
11711
|
}
|
|
11710
11712
|
},
|
|
11711
11713
|
role: "button",
|
|
@@ -12084,8 +12086,8 @@ var ModalPassengerForm = ({
|
|
|
12084
12086
|
}
|
|
12085
12087
|
}
|
|
12086
12088
|
),
|
|
12087
|
-
watchIdentityTypeId ?
|
|
12088
|
-
|
|
12089
|
+
watchIdentityTypeId ? _selectedIdentityType?.code !== IDENTITY_TYPE.LAINNYA.toString() && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12090
|
+
_selectedIdentityType?.code === IDENTITY_TYPE.PASSPORT.toString() && /* @__PURE__ */ jsx(
|
|
12089
12091
|
InputDynamic_default,
|
|
12090
12092
|
{
|
|
12091
12093
|
control,
|
|
@@ -12121,10 +12123,10 @@ var ModalPassengerForm = ({
|
|
|
12121
12123
|
dynamicMinLengthId.toString()
|
|
12122
12124
|
)
|
|
12123
12125
|
},
|
|
12124
|
-
...
|
|
12126
|
+
..._selectedIdentityType?.rule ? {
|
|
12125
12127
|
pattern: {
|
|
12126
12128
|
value: new RegExp(
|
|
12127
|
-
|
|
12129
|
+
_selectedIdentityType.rule
|
|
12128
12130
|
),
|
|
12129
12131
|
message: mergedErrors.invalidIdNumber
|
|
12130
12132
|
}
|
|
@@ -12132,8 +12134,8 @@ var ModalPassengerForm = ({
|
|
|
12132
12134
|
},
|
|
12133
12135
|
onChange: (val) => {
|
|
12134
12136
|
let cleaned = val;
|
|
12135
|
-
if (
|
|
12136
|
-
const match =
|
|
12137
|
+
if (_selectedIdentityType?.rule) {
|
|
12138
|
+
const match = _selectedIdentityType.rule.match(/\[(.*?)\]/);
|
|
12137
12139
|
if (match && match[1]) {
|
|
12138
12140
|
const filterRegex = new RegExp(
|
|
12139
12141
|
`[^${match[1]}]`,
|