@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.d.mts
CHANGED
|
@@ -1691,10 +1691,12 @@ declare const PASSENGER_TYPE: {
|
|
|
1691
1691
|
};
|
|
1692
1692
|
type PASSENGER_TYPE_TYPE = typeof PASSENGER_TYPE[keyof typeof PASSENGER_TYPE];
|
|
1693
1693
|
declare const IDENTITY_TYPE: {
|
|
1694
|
-
readonly KTP:
|
|
1695
|
-
readonly SIM:
|
|
1696
|
-
readonly
|
|
1697
|
-
readonly
|
|
1694
|
+
readonly KTP: "KTP";
|
|
1695
|
+
readonly SIM: "SIM";
|
|
1696
|
+
readonly KK: "KK";
|
|
1697
|
+
readonly KTA: "KTA";
|
|
1698
|
+
readonly PASSPORT: "PASSPORT";
|
|
1699
|
+
readonly LAINNYA: "LAINNYA";
|
|
1698
1700
|
};
|
|
1699
1701
|
type IDENTITY_TYPE_TYPE = typeof IDENTITY_TYPE[keyof typeof IDENTITY_TYPE];
|
|
1700
1702
|
declare const LOAD_TYPE: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1691,10 +1691,12 @@ declare const PASSENGER_TYPE: {
|
|
|
1691
1691
|
};
|
|
1692
1692
|
type PASSENGER_TYPE_TYPE = typeof PASSENGER_TYPE[keyof typeof PASSENGER_TYPE];
|
|
1693
1693
|
declare const IDENTITY_TYPE: {
|
|
1694
|
-
readonly KTP:
|
|
1695
|
-
readonly SIM:
|
|
1696
|
-
readonly
|
|
1697
|
-
readonly
|
|
1694
|
+
readonly KTP: "KTP";
|
|
1695
|
+
readonly SIM: "SIM";
|
|
1696
|
+
readonly KK: "KK";
|
|
1697
|
+
readonly KTA: "KTA";
|
|
1698
|
+
readonly PASSPORT: "PASSPORT";
|
|
1699
|
+
readonly LAINNYA: "LAINNYA";
|
|
1698
1700
|
};
|
|
1699
1701
|
type IDENTITY_TYPE_TYPE = typeof IDENTITY_TYPE[keyof typeof IDENTITY_TYPE];
|
|
1700
1702
|
declare const LOAD_TYPE: {
|
package/dist/index.js
CHANGED
|
@@ -408,10 +408,12 @@ var PASSENGER_TYPE = {
|
|
|
408
408
|
ELDERLY: 4
|
|
409
409
|
};
|
|
410
410
|
var IDENTITY_TYPE = {
|
|
411
|
-
KTP:
|
|
412
|
-
SIM:
|
|
413
|
-
|
|
414
|
-
|
|
411
|
+
KTP: "KTP",
|
|
412
|
+
SIM: "SIM",
|
|
413
|
+
KK: "KK",
|
|
414
|
+
KTA: "KTA",
|
|
415
|
+
PASSPORT: "PASSPORT",
|
|
416
|
+
LAINNYA: "LAINNYA"
|
|
415
417
|
};
|
|
416
418
|
var LOAD_TYPE = {
|
|
417
419
|
PEDESTRIAN: 1,
|
|
@@ -11470,10 +11472,10 @@ var ModalPassengerForm = ({
|
|
|
11470
11472
|
const watchIdentityTypeId = watch("identityTypeId");
|
|
11471
11473
|
const watchPassportCountryId = watch("countryId");
|
|
11472
11474
|
const watchBirthdate = watch("birthdate");
|
|
11473
|
-
const
|
|
11475
|
+
const _selectedIdentityType = idTypes.find(
|
|
11474
11476
|
(type) => type.id.toString() === watchIdentityTypeId
|
|
11475
11477
|
);
|
|
11476
|
-
const idRuleLengthMatch =
|
|
11478
|
+
const idRuleLengthMatch = _selectedIdentityType?.rule?.match(/\{(\d+)(?:,\d+)?\}/);
|
|
11477
11479
|
const dynamicMinLengthId = idRuleLengthMatch ? parseInt(idRuleLengthMatch[1], 10) : 6;
|
|
11478
11480
|
React.useEffect(() => {
|
|
11479
11481
|
reset(defaultValues);
|
|
@@ -11544,7 +11546,7 @@ var ModalPassengerForm = ({
|
|
|
11544
11546
|
ctx.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height);
|
|
11545
11547
|
setCapturedImage(canvas.toDataURL("image/jpeg"));
|
|
11546
11548
|
stopCamera();
|
|
11547
|
-
if (scannedIdType === IDENTITY_TYPE.KTP) {
|
|
11549
|
+
if (scannedIdType === IDENTITY_TYPE.KTP.toString()) {
|
|
11548
11550
|
setScanStatus("reading");
|
|
11549
11551
|
} else {
|
|
11550
11552
|
setScanStatus("error");
|
|
@@ -11665,8 +11667,8 @@ var ModalPassengerForm = ({
|
|
|
11665
11667
|
const handleCloseModalSelectTypeId = () => {
|
|
11666
11668
|
setIsModalSelectIdTypeOpen(false);
|
|
11667
11669
|
};
|
|
11668
|
-
const handleSelectIdType = (
|
|
11669
|
-
setScannedIdType(
|
|
11670
|
+
const handleSelectIdType = (selectedIdentityTypeCode) => {
|
|
11671
|
+
setScannedIdType(selectedIdentityTypeCode);
|
|
11670
11672
|
setIsModalSelectIdTypeOpen(false);
|
|
11671
11673
|
setScanStatus("idle");
|
|
11672
11674
|
setIsModalScanOpen(true);
|
|
@@ -11710,11 +11712,11 @@ var ModalPassengerForm = ({
|
|
|
11710
11712
|
"div",
|
|
11711
11713
|
{
|
|
11712
11714
|
className: styles.idTypeItem,
|
|
11713
|
-
onClick: () => handleSelectIdType(
|
|
11715
|
+
onClick: () => handleSelectIdType(type.code),
|
|
11714
11716
|
onKeyDown: (e) => {
|
|
11715
11717
|
if (e.key === "Enter" || e.key === " ") {
|
|
11716
11718
|
e.preventDefault();
|
|
11717
|
-
handleSelectIdType(type.
|
|
11719
|
+
handleSelectIdType(type.code);
|
|
11718
11720
|
}
|
|
11719
11721
|
},
|
|
11720
11722
|
role: "button",
|
|
@@ -12093,8 +12095,8 @@ var ModalPassengerForm = ({
|
|
|
12093
12095
|
}
|
|
12094
12096
|
}
|
|
12095
12097
|
),
|
|
12096
|
-
watchIdentityTypeId ?
|
|
12097
|
-
|
|
12098
|
+
watchIdentityTypeId ? _selectedIdentityType?.code !== IDENTITY_TYPE.LAINNYA.toString() && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12099
|
+
_selectedIdentityType?.code === IDENTITY_TYPE.PASSPORT.toString() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12098
12100
|
InputDynamic_default,
|
|
12099
12101
|
{
|
|
12100
12102
|
control,
|
|
@@ -12130,10 +12132,10 @@ var ModalPassengerForm = ({
|
|
|
12130
12132
|
dynamicMinLengthId.toString()
|
|
12131
12133
|
)
|
|
12132
12134
|
},
|
|
12133
|
-
...
|
|
12135
|
+
..._selectedIdentityType?.rule ? {
|
|
12134
12136
|
pattern: {
|
|
12135
12137
|
value: new RegExp(
|
|
12136
|
-
|
|
12138
|
+
_selectedIdentityType.rule
|
|
12137
12139
|
),
|
|
12138
12140
|
message: mergedErrors.invalidIdNumber
|
|
12139
12141
|
}
|
|
@@ -12141,8 +12143,8 @@ var ModalPassengerForm = ({
|
|
|
12141
12143
|
},
|
|
12142
12144
|
onChange: (val) => {
|
|
12143
12145
|
let cleaned = val;
|
|
12144
|
-
if (
|
|
12145
|
-
const match =
|
|
12146
|
+
if (_selectedIdentityType?.rule) {
|
|
12147
|
+
const match = _selectedIdentityType.rule.match(/\[(.*?)\]/);
|
|
12146
12148
|
if (match && match[1]) {
|
|
12147
12149
|
const filterRegex = new RegExp(
|
|
12148
12150
|
`[^${match[1]}]`,
|