@asdp/ferryui 0.1.16 → 0.1.19
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 +229 -225
- package/dist/assets/images/banner/usemanifest-banner.svg +9 -9
- package/dist/assets/images/illustrations/mobile-pay.svg +218 -218
- package/dist/assets/images/illustrations/pay.svg +294 -294
- package/dist/assets/images/illustrations/radius.svg +68 -68
- package/dist/assets/images/illustrations/sessionexp.svg +486 -486
- package/dist/assets/logo/asdp-default.svg +184 -184
- package/dist/index.d.mts +192 -18
- package/dist/index.d.ts +192 -18
- package/dist/index.js +807 -404
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +774 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +82 -82
package/dist/index.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var reactComponents = require('@fluentui/react-components');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var
|
|
5
|
+
var React5 = require('react');
|
|
6
6
|
var reactGridSystem = require('react-grid-system');
|
|
7
|
-
var
|
|
7
|
+
var iconify_js = require('@iconify/react/dist/iconify.js');
|
|
8
8
|
var reactHookForm = require('react-hook-form');
|
|
9
|
+
var react = require('@iconify/react');
|
|
9
10
|
var PhoneInputComponent = require('react-phone-input-2');
|
|
10
11
|
var Select = require('react-select');
|
|
11
12
|
var reactCalendarCompat = require('@fluentui/react-calendar-compat');
|
|
@@ -13,7 +14,7 @@ var moment = require('moment');
|
|
|
13
14
|
|
|
14
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var React5__default = /*#__PURE__*/_interopDefault(React5);
|
|
17
18
|
var PhoneInputComponent__default = /*#__PURE__*/_interopDefault(PhoneInputComponent);
|
|
18
19
|
var Select__default = /*#__PURE__*/_interopDefault(Select);
|
|
19
20
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
@@ -214,9 +215,9 @@ var CarouselWithCustomNav = ({
|
|
|
214
215
|
cardFocus = false
|
|
215
216
|
}) => {
|
|
216
217
|
const styles = useStyles2();
|
|
217
|
-
const [internalIndex, setInternalIndex] =
|
|
218
|
+
const [internalIndex, setInternalIndex] = React5.useState(0);
|
|
218
219
|
const activeIndex = controlledIndex !== void 0 ? controlledIndex : internalIndex;
|
|
219
|
-
const handleIndexChange =
|
|
220
|
+
const handleIndexChange = React5.useCallback((index) => {
|
|
220
221
|
if (controlledIndex === void 0) {
|
|
221
222
|
setInternalIndex(index);
|
|
222
223
|
}
|
|
@@ -353,7 +354,8 @@ var CardPromo = ({
|
|
|
353
354
|
className,
|
|
354
355
|
imageClassName,
|
|
355
356
|
descriptionClassName,
|
|
356
|
-
isLoading = false
|
|
357
|
+
isLoading = false,
|
|
358
|
+
imageOnly = false
|
|
357
359
|
}) => {
|
|
358
360
|
const classes = useStyles3();
|
|
359
361
|
const ariaLabel = totalCards ? `Card ${index + 1} of ${totalCards}` : `Promo card ${index + 1}`;
|
|
@@ -366,7 +368,7 @@ var CardPromo = ({
|
|
|
366
368
|
style: { cursor: "default" },
|
|
367
369
|
children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.Skeleton, { "aria-label": "Loading content", children: [
|
|
368
370
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: reactComponents.mergeClasses(classes.imageContainer, imageClassName), children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { shape: "rectangle", style: { width: "100%", height: "100%" } }) }),
|
|
369
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { className: classes.infoWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { className: classes.info, xs: 12, children: [
|
|
371
|
+
!imageOnly && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Row, { className: classes.infoWrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { className: classes.info, xs: 12, children: [
|
|
370
372
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "70%", height: "20px" } }),
|
|
371
373
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "90%", height: "16px" } }),
|
|
372
374
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.SkeletonItem, { style: { width: "80%", height: "16px" } })
|
|
@@ -393,7 +395,7 @@ var CardPromo = ({
|
|
|
393
395
|
alt: imageAlt
|
|
394
396
|
}
|
|
395
397
|
) }),
|
|
396
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { className: classes.infoWrapper, children: [
|
|
398
|
+
!imageOnly && /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { className: classes.infoWrapper, children: [
|
|
397
399
|
/* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { className: classes.info, xs: 12, sm: 12, md: 12, lg: showButton ? 8 : 12, xl: showButton ? 8 : 12, xxl: showButton ? 8 : 12, xxxl: showButton ? 8 : 12, children: [
|
|
398
400
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Subtitle2, { className: classes.title, children: title }),
|
|
399
401
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { className: reactComponents.mergeClasses(classes.title, descriptionClassName), children: description })
|
|
@@ -1109,49 +1111,114 @@ var useStyles6 = reactComponents.makeStyles({
|
|
|
1109
1111
|
}
|
|
1110
1112
|
}
|
|
1111
1113
|
});
|
|
1114
|
+
var SERVICE_MENU_ITEMS = {
|
|
1115
|
+
ferry: {
|
|
1116
|
+
id: "ferry",
|
|
1117
|
+
logo: "/assets/images/icons/ferry.svg",
|
|
1118
|
+
labels: {
|
|
1119
|
+
id: { label: "Ferry", description: "Layanan penyeberangan ferry ASDP" },
|
|
1120
|
+
en: { label: "Ferry", description: "ASDP Ferry Crossing Service" }
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
ifcs: {
|
|
1124
|
+
id: "ifcs",
|
|
1125
|
+
logo: "/assets/logo/asdp-default.svg",
|
|
1126
|
+
labels: {
|
|
1127
|
+
id: { label: "IFCS", description: "Integrated Ferry Control System" },
|
|
1128
|
+
en: { label: "IFCS", description: "Integrated Ferry Control System" }
|
|
1129
|
+
}
|
|
1130
|
+
},
|
|
1131
|
+
skpt: {
|
|
1132
|
+
id: "skpt",
|
|
1133
|
+
logo: "/assets/logo/asdp-default.svg",
|
|
1134
|
+
labels: {
|
|
1135
|
+
id: { label: "SKPT", description: "Sistem Karcis Penumpang Terpadu" },
|
|
1136
|
+
en: { label: "SKPT", description: "Integrated Passenger Ticketing System" }
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
hotel: {
|
|
1140
|
+
id: "hotel",
|
|
1141
|
+
logo: "/assets/images/icons/hotel.svg",
|
|
1142
|
+
labels: {
|
|
1143
|
+
id: { label: "Hotel", description: "Layanan pemesanan hotel" },
|
|
1144
|
+
en: { label: "Hotel", description: "Hotel Booking Service" }
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
other: {
|
|
1148
|
+
id: "other",
|
|
1149
|
+
logo: "/assets/images/icons/other.svg",
|
|
1150
|
+
labels: {
|
|
1151
|
+
id: { label: "Lainnya", description: "Layanan lainnya" },
|
|
1152
|
+
en: { label: "Other", description: "Other Services" }
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1112
1156
|
var CardServiceMenu = ({
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1157
|
+
activeServiceId = "ferry",
|
|
1158
|
+
language = "id",
|
|
1159
|
+
onServiceClick,
|
|
1116
1160
|
showDescriptions = true,
|
|
1117
1161
|
className
|
|
1118
1162
|
}) => {
|
|
1119
1163
|
const styles = useStyles6();
|
|
1120
|
-
const getMenuItemClass = (
|
|
1121
|
-
const isActive =
|
|
1164
|
+
const getMenuItemClass = (serviceId) => {
|
|
1165
|
+
const isActive = activeServiceId === serviceId;
|
|
1122
1166
|
return reactComponents.mergeClasses(
|
|
1123
1167
|
styles.menuItem,
|
|
1124
1168
|
isActive && styles.menuItemActive
|
|
1125
1169
|
);
|
|
1126
1170
|
};
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1153
|
-
|
|
1154
|
-
|
|
1171
|
+
const menuItems = Object.values(SERVICE_MENU_ITEMS);
|
|
1172
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Card, { className: reactComponents.mergeClasses(styles.card, className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.menuList, children: menuItems.map((item, index) => {
|
|
1173
|
+
const { label, description } = item.labels[language];
|
|
1174
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React5__default.default.Fragment, { children: [
|
|
1175
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1176
|
+
reactComponents.Button,
|
|
1177
|
+
{
|
|
1178
|
+
className: getMenuItemClass(item.id),
|
|
1179
|
+
onClick: () => onServiceClick?.(item.id),
|
|
1180
|
+
children: [
|
|
1181
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1182
|
+
"img",
|
|
1183
|
+
{
|
|
1184
|
+
src: item.logo,
|
|
1185
|
+
alt: label,
|
|
1186
|
+
className: styles.logo
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.textContent, children: [
|
|
1190
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.label, children: label }),
|
|
1191
|
+
showDescriptions && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.description, children: description })
|
|
1192
|
+
] })
|
|
1193
|
+
]
|
|
1194
|
+
}
|
|
1195
|
+
),
|
|
1196
|
+
index < menuItems.length - 1 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, { className: styles.dividerHorizontal }),
|
|
1198
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, { vertical: true, className: styles.dividerVertical })
|
|
1199
|
+
] })
|
|
1200
|
+
] }, item.id);
|
|
1201
|
+
}) }) });
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
// src/constants/generated/tokensV2.ts
|
|
1205
|
+
var brandColors = {
|
|
1206
|
+
"10": "#001a1bff",
|
|
1207
|
+
"20": "#02383bff",
|
|
1208
|
+
"30": "#002426",
|
|
1209
|
+
"40": "#004044",
|
|
1210
|
+
"50": "#005D62",
|
|
1211
|
+
"60": "#007A81",
|
|
1212
|
+
"70": "#00969F",
|
|
1213
|
+
"80": "#00B3BD",
|
|
1214
|
+
"90": "#29BFC8",
|
|
1215
|
+
"100": "#52CBD2",
|
|
1216
|
+
"110": "#7AD7DD",
|
|
1217
|
+
"120": "#A3E4E7",
|
|
1218
|
+
"130": "#CCF0F2",
|
|
1219
|
+
"140": "#E1F7F8",
|
|
1220
|
+
"150": "#fdfdff",
|
|
1221
|
+
"160": "#ffffff"
|
|
1155
1222
|
};
|
|
1156
1223
|
var fontWeight = {
|
|
1157
1224
|
"Medium": 500};
|
|
@@ -1161,7 +1228,7 @@ var lightModeColors = {
|
|
|
1161
1228
|
"Brand_Stroke_1_Rest": "#00B3BD"};
|
|
1162
1229
|
var tokensV2_default = {
|
|
1163
1230
|
lightModeColors};
|
|
1164
|
-
var DatePickerInput =
|
|
1231
|
+
var DatePickerInput = React5.forwardRef(
|
|
1165
1232
|
({
|
|
1166
1233
|
field,
|
|
1167
1234
|
placeholder,
|
|
@@ -1174,7 +1241,7 @@ var DatePickerInput = React2.forwardRef(
|
|
|
1174
1241
|
max,
|
|
1175
1242
|
...restProps
|
|
1176
1243
|
}, ref) => {
|
|
1177
|
-
const [isOpen, setIsOpen] =
|
|
1244
|
+
const [isOpen, setIsOpen] = React5.useState(false);
|
|
1178
1245
|
const dateValue = field.value ? new Date(field.value) : void 0;
|
|
1179
1246
|
const onSelectDate = (date) => {
|
|
1180
1247
|
if (date) {
|
|
@@ -1432,249 +1499,19 @@ var useStyles7 = reactComponents.makeStyles({
|
|
|
1432
1499
|
border: `1px solid ${tokensV2_default.lightModeColors.Brand_Stroke_1_Rest}`,
|
|
1433
1500
|
color: tokensV2_default.lightModeColors.Brand_Stroke_1_Rest,
|
|
1434
1501
|
backgroundColor: "transparent"
|
|
1502
|
+
},
|
|
1503
|
+
// Disabled state styling
|
|
1504
|
+
"& .fui-Radio__input:disabled ~ .fui-Radio__label": {
|
|
1505
|
+
opacity: 0.6,
|
|
1506
|
+
cursor: "not-allowed",
|
|
1507
|
+
backgroundColor: reactComponents.tokens.colorNeutralBackground4
|
|
1508
|
+
},
|
|
1509
|
+
"&:hover .fui-Radio__input:disabled ~ .fui-Radio__label": {
|
|
1510
|
+
backgroundColor: reactComponents.tokens.colorNeutralBackground4,
|
|
1511
|
+
border: `1px solid ${reactComponents.tokens.colorNeutralStroke1}`
|
|
1435
1512
|
}
|
|
1436
1513
|
}
|
|
1437
1514
|
});
|
|
1438
|
-
var DEFAULT_COUNTRY_CODES = [
|
|
1439
|
-
{ code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1440
|
-
{ code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1441
|
-
{ code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
|
|
1442
|
-
{ code: "AS", name: "American Samoa", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
|
|
1443
|
-
{ code: "AD", name: "Andorra", dialCode: "+376", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1444
|
-
{ code: "AO", name: "Angola", dialCode: "+244", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1445
|
-
{ code: "AI", name: "Anguilla", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1446
|
-
{ code: "AQ", name: "Antarctica", dialCode: "+672", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1447
|
-
{ code: "AG", name: "Antigua and Barbuda", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1448
|
-
{ code: "AR", name: "Argentina", dialCode: "+54", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1449
|
-
{ code: "AM", name: "Armenia", dialCode: "+374", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1450
|
-
{ code: "AW", name: "Aruba", dialCode: "+297", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1451
|
-
{ code: "AU", name: "Australia", dialCode: "+61", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1452
|
-
{ code: "AT", name: "Austria", dialCode: "+43", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1453
|
-
{ code: "AZ", name: "Azerbaijan", dialCode: "+994", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1454
|
-
{ code: "BS", name: "Bahamas", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1455
|
-
{ code: "BH", name: "Bahrain", dialCode: "+973", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1456
|
-
{ code: "BD", name: "Bangladesh", dialCode: "+880", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1457
|
-
{ code: "BB", name: "Barbados", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1458
|
-
{ code: "BY", name: "Belarus", dialCode: "+375", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1459
|
-
{ code: "BE", name: "Belgium", dialCode: "+32", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1460
|
-
{ code: "BZ", name: "Belize", dialCode: "+501", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1461
|
-
{ code: "BJ", name: "Benin", dialCode: "+229", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1462
|
-
{ code: "BM", name: "Bermuda", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1463
|
-
{ code: "BT", name: "Bhutan", dialCode: "+975", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1464
|
-
{ code: "BO", name: "Bolivia", dialCode: "+591", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1465
|
-
{
|
|
1466
|
-
code: "BA",
|
|
1467
|
-
name: "Bosnia and Herzegovina",
|
|
1468
|
-
dialCode: "+387",
|
|
1469
|
-
passportRegex: "^[A-Z]{2}[0-9]{6}$"
|
|
1470
|
-
},
|
|
1471
|
-
{ code: "BW", name: "Botswana", dialCode: "+267", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1472
|
-
{ code: "BR", name: "Brazil", dialCode: "+55", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1473
|
-
{ code: "BN", name: "Brunei", dialCode: "+673", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1474
|
-
{ code: "BG", name: "Bulgaria", dialCode: "+359", passportRegex: "^[0-9]{9}$" },
|
|
1475
|
-
{ code: "BF", name: "Burkina Faso", dialCode: "+226", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1476
|
-
{ code: "BI", name: "Burundi", dialCode: "+257", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1477
|
-
{ code: "KH", name: "Cambodia", dialCode: "+855", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1478
|
-
{ code: "CM", name: "Cameroon", dialCode: "+237", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1479
|
-
{ code: "CA", name: "Canada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1480
|
-
{ code: "CV", name: "Cape Verde", dialCode: "+238", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1481
|
-
{ code: "KY", name: "Cayman Islands", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1482
|
-
{
|
|
1483
|
-
code: "CF",
|
|
1484
|
-
name: "Central African Republic",
|
|
1485
|
-
dialCode: "+236",
|
|
1486
|
-
passportRegex: "^[A-Z0-9]{6,10}$"
|
|
1487
|
-
},
|
|
1488
|
-
{ code: "TD", name: "Chad", dialCode: "+235", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1489
|
-
{ code: "CL", name: "Chile", dialCode: "+56", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1490
|
-
{ code: "CN", name: "China", dialCode: "+86", passportRegex: "^[0-9]{9}$" },
|
|
1491
|
-
{ code: "CO", name: "Colombia", dialCode: "+57", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1492
|
-
{ code: "KM", name: "Comoros", dialCode: "+269", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1493
|
-
{ code: "CG", name: "Congo", dialCode: "+242", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1494
|
-
{ code: "CR", name: "Costa Rica", dialCode: "+506", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1495
|
-
{ code: "HR", name: "Croatia", dialCode: "+385", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1496
|
-
{ code: "CU", name: "Cuba", dialCode: "+53", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1497
|
-
{ code: "CY", name: "Cyprus", dialCode: "+357", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1498
|
-
{ code: "CZ", name: "Czech Republic", dialCode: "+420", passportRegex: "^[0-9]{8}$" },
|
|
1499
|
-
{ code: "DK", name: "Denmark", dialCode: "+45", passportRegex: "^[A-Z0-9]{9}$" },
|
|
1500
|
-
{ code: "DJ", name: "Djibouti", dialCode: "+253", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1501
|
-
{ code: "DM", name: "Dominica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1502
|
-
{ code: "DO", name: "Dominican Republic", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1503
|
-
{ code: "EC", name: "Ecuador", dialCode: "+593", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1504
|
-
{ code: "EG", name: "Egypt", dialCode: "+20", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1505
|
-
{ code: "SV", name: "El Salvador", dialCode: "+503", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1506
|
-
{ code: "GQ", name: "Equatorial Guinea", dialCode: "+240", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1507
|
-
{ code: "ER", name: "Eritrea", dialCode: "+291", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1508
|
-
{ code: "EE", name: "Estonia", dialCode: "+372", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1509
|
-
{ code: "SZ", name: "Eswatini", dialCode: "+268", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1510
|
-
{ code: "ET", name: "Ethiopia", dialCode: "+251", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1511
|
-
{ code: "FJ", name: "Fiji", dialCode: "+679", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1512
|
-
{ code: "FI", name: "Finland", dialCode: "+358", passportRegex: "^[A-Z0-9]{9}$" },
|
|
1513
|
-
{ code: "FR", name: "France", dialCode: "+33", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1514
|
-
{ code: "GA", name: "Gabon", dialCode: "+241", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1515
|
-
{ code: "GM", name: "Gambia", dialCode: "+220", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1516
|
-
{ code: "GE", name: "Georgia", dialCode: "+995", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1517
|
-
{ code: "DE", name: "Germany", dialCode: "+49", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1518
|
-
{ code: "GH", name: "Ghana", dialCode: "+233", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1519
|
-
{ code: "GR", name: "Greece", dialCode: "+30", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1520
|
-
{ code: "GD", name: "Grenada", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1521
|
-
{ code: "GT", name: "Guatemala", dialCode: "+502", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1522
|
-
{ code: "GN", name: "Guinea", dialCode: "+224", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1523
|
-
{ code: "GW", name: "Guinea-Bissau", dialCode: "+245", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1524
|
-
{ code: "GY", name: "Guyana", dialCode: "+592", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1525
|
-
{ code: "HT", name: "Haiti", dialCode: "+509", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1526
|
-
{ code: "HN", name: "Honduras", dialCode: "+504", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1527
|
-
{ code: "HK", name: "Hong Kong", dialCode: "+852", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1528
|
-
{ code: "HU", name: "Hungary", dialCode: "+36", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1529
|
-
{ code: "IS", name: "Iceland", dialCode: "+354", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1530
|
-
{ code: "IN", name: "India", dialCode: "+91", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
1531
|
-
{ code: "ID", name: "Indonesia", dialCode: "+62", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1532
|
-
{ code: "IR", name: "Iran", dialCode: "+98", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1533
|
-
{ code: "IQ", name: "Iraq", dialCode: "+964", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1534
|
-
{ code: "IE", name: "Ireland", dialCode: "+353", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
|
|
1535
|
-
{ code: "IL", name: "Israel", dialCode: "+972", passportRegex: "^[0-9]{8,9}$" },
|
|
1536
|
-
{ code: "IT", name: "Italy", dialCode: "+39", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1537
|
-
{ code: "JM", name: "Jamaica", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1538
|
-
{ code: "JP", name: "Japan", dialCode: "+81", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1539
|
-
{ code: "JO", name: "Jordan", dialCode: "+962", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1540
|
-
{ code: "KZ", name: "Kazakhstan", dialCode: "+7", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1541
|
-
{ code: "KE", name: "Kenya", dialCode: "+254", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1542
|
-
{ code: "KI", name: "Kiribati", dialCode: "+686", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1543
|
-
{ code: "KP", name: "North Korea", dialCode: "+850", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1544
|
-
{ code: "KR", name: "South Korea", dialCode: "+82", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
|
|
1545
|
-
{ code: "KW", name: "Kuwait", dialCode: "+965", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1546
|
-
{ code: "KG", name: "Kyrgyzstan", dialCode: "+996", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1547
|
-
{ code: "LA", name: "Laos", dialCode: "+856", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1548
|
-
{ code: "LV", name: "Latvia", dialCode: "+371", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1549
|
-
{ code: "LB", name: "Lebanon", dialCode: "+961", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1550
|
-
{ code: "LS", name: "Lesotho", dialCode: "+266", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1551
|
-
{ code: "LR", name: "Liberia", dialCode: "+231", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1552
|
-
{ code: "LY", name: "Libya", dialCode: "+218", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1553
|
-
{ code: "LI", name: "Liechtenstein", dialCode: "+423", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1554
|
-
{ code: "LT", name: "Lithuania", dialCode: "+370", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1555
|
-
{ code: "LU", name: "Luxembourg", dialCode: "+352", passportRegex: "^[A-Z0-9]{8}$" },
|
|
1556
|
-
{ code: "MO", name: "Macau", dialCode: "+853", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1557
|
-
{ code: "MG", name: "Madagascar", dialCode: "+261", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1558
|
-
{ code: "MW", name: "Malawi", dialCode: "+265", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1559
|
-
{ code: "MY", name: "Malaysia", dialCode: "+60", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
|
|
1560
|
-
{ code: "MV", name: "Maldives", dialCode: "+960", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1561
|
-
{ code: "ML", name: "Mali", dialCode: "+223", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1562
|
-
{ code: "MT", name: "Malta", dialCode: "+356", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1563
|
-
{ code: "MH", name: "Marshall Islands", dialCode: "+692", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1564
|
-
{ code: "MQ", name: "Martinique", dialCode: "+596", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1565
|
-
{ code: "MR", name: "Mauritania", dialCode: "+222", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1566
|
-
{ code: "MU", name: "Mauritius", dialCode: "+230", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1567
|
-
{ code: "MX", name: "Mexico", dialCode: "+52", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
|
|
1568
|
-
{ code: "FM", name: "Micronesia", dialCode: "+691", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1569
|
-
{ code: "MD", name: "Moldova", dialCode: "+373", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1570
|
-
{ code: "MC", name: "Monaco", dialCode: "+377", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1571
|
-
{ code: "MN", name: "Mongolia", dialCode: "+976", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1572
|
-
{ code: "ME", name: "Montenegro", dialCode: "+382", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1573
|
-
{ code: "MS", name: "Montserrat", dialCode: "+1", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1574
|
-
{ code: "MA", name: "Morocco", dialCode: "+212", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1575
|
-
{ code: "MZ", name: "Mozambique", dialCode: "+258", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1576
|
-
{ code: "MM", name: "Myanmar", dialCode: "+95", passportRegex: "^[A-Z]{1}[0-9]{6,7}$" },
|
|
1577
|
-
{ code: "NA", name: "Namibia", dialCode: "+264", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1578
|
-
{ code: "NR", name: "Nauru", dialCode: "+674", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1579
|
-
{ code: "NP", name: "Nepal", dialCode: "+977", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1580
|
-
{ code: "NL", name: "Netherlands", dialCode: "+31", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1581
|
-
{ code: "NC", name: "New Caledonia", dialCode: "+687", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1582
|
-
{ code: "NZ", name: "New Zealand", dialCode: "+64", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1583
|
-
{ code: "NI", name: "Nicaragua", dialCode: "+505", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1584
|
-
{ code: "NE", name: "Niger", dialCode: "+227", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1585
|
-
{ code: "NG", name: "Nigeria", dialCode: "+234", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1586
|
-
{ code: "NO", name: "Norway", dialCode: "+47", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1587
|
-
{ code: "OM", name: "Oman", dialCode: "+968", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1588
|
-
{ code: "PK", name: "Pakistan", dialCode: "+92", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1589
|
-
{ code: "PW", name: "Palau", dialCode: "+680", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1590
|
-
{ code: "PS", name: "Palestine", dialCode: "+970", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1591
|
-
{ code: "PA", name: "Panama", dialCode: "+507", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1592
|
-
{ code: "PG", name: "Papua New Guinea", dialCode: "+675", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1593
|
-
{ code: "PY", name: "Paraguay", dialCode: "+595", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1594
|
-
{ code: "PE", name: "Peru", dialCode: "+51", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1595
|
-
{ code: "PH", name: "Philippines", dialCode: "+63", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1596
|
-
{ code: "PL", name: "Poland", dialCode: "+48", passportRegex: "^[A-Z0-9]{2}[0-9]{7}$" },
|
|
1597
|
-
{ code: "PT", name: "Portugal", dialCode: "+351", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1598
|
-
{ code: "RO", name: "Romania", dialCode: "+40", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1599
|
-
{ code: "RU", name: "Russia", dialCode: "+7", passportRegex: "^[0-9]{9}$" },
|
|
1600
|
-
{ code: "RW", name: "Rwanda", dialCode: "+250", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1601
|
-
{
|
|
1602
|
-
code: "KN",
|
|
1603
|
-
name: "Saint Kitts and Nevis",
|
|
1604
|
-
dialCode: "+1",
|
|
1605
|
-
passportRegex: "^[A-Z]{2}[0-9]{7}$"
|
|
1606
|
-
},
|
|
1607
|
-
{ code: "LC", name: "Saint Lucia", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1608
|
-
{
|
|
1609
|
-
code: "VC",
|
|
1610
|
-
name: "Saint Vincent and the Grenadines",
|
|
1611
|
-
dialCode: "+1",
|
|
1612
|
-
passportRegex: "^[A-Z]{2}[0-9]{7}$"
|
|
1613
|
-
},
|
|
1614
|
-
{ code: "WS", name: "Samoa", dialCode: "+685", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1615
|
-
{ code: "SM", name: "San Marino", dialCode: "+378", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1616
|
-
{
|
|
1617
|
-
code: "ST",
|
|
1618
|
-
name: "Sao Tome and Principe",
|
|
1619
|
-
dialCode: "+239",
|
|
1620
|
-
passportRegex: "^[A-Z0-9]{6,10}$"
|
|
1621
|
-
},
|
|
1622
|
-
{ code: "SA", name: "Saudi Arabia", dialCode: "+966", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1623
|
-
{ code: "SN", name: "Senegal", dialCode: "+221", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1624
|
-
{ code: "RS", name: "Serbia", dialCode: "+381", passportRegex: "^[A-Z0-9]{9}$" },
|
|
1625
|
-
{ code: "SC", name: "Seychelles", dialCode: "+248", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1626
|
-
{ code: "SL", name: "Sierra Leone", dialCode: "+232", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1627
|
-
{ code: "SG", name: "Singapore", dialCode: "+65", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1628
|
-
{ code: "SK", name: "Slovakia", dialCode: "+421", passportRegex: "^[0-9]{9}$" },
|
|
1629
|
-
{ code: "SI", name: "Slovenia", dialCode: "+386", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1630
|
-
{ code: "SB", name: "Solomon Islands", dialCode: "+677", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1631
|
-
{ code: "SO", name: "Somalia", dialCode: "+252", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1632
|
-
{ code: "ZA", name: "South Africa", dialCode: "+27", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1633
|
-
{ code: "ES", name: "Spain", dialCode: "+34", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1634
|
-
{ code: "LK", name: "Sri Lanka", dialCode: "+94", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1635
|
-
{ code: "SD", name: "Sudan", dialCode: "+249", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1636
|
-
{ code: "SR", name: "Suriname", dialCode: "+597", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1637
|
-
{ code: "SE", name: "Sweden", dialCode: "+46", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1638
|
-
{ code: "CH", name: "Switzerland", dialCode: "+41", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1639
|
-
{ code: "SY", name: "Syria", dialCode: "+963", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1640
|
-
{ code: "TW", name: "Taiwan", dialCode: "+886", passportRegex: "^[A-Z]{1}[0-9]{8}$" },
|
|
1641
|
-
{ code: "TJ", name: "Tajikistan", dialCode: "+992", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1642
|
-
{ code: "TZ", name: "Tanzania", dialCode: "+255", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1643
|
-
{ code: "TH", name: "Thailand", dialCode: "+66", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1644
|
-
{ code: "TL", name: "Timor-Leste", dialCode: "+670", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1645
|
-
{ code: "TG", name: "Togo", dialCode: "+228", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1646
|
-
{ code: "TO", name: "Tonga", dialCode: "+676", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1647
|
-
{ code: "TT", name: "Trinidad and Tobago", dialCode: "+1", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1648
|
-
{ code: "TN", name: "Tunisia", dialCode: "+216", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1649
|
-
{ code: "TR", name: "Turkey", dialCode: "+90", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1650
|
-
{ code: "TM", name: "Turkmenistan", dialCode: "+993", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1651
|
-
{
|
|
1652
|
-
code: "TC",
|
|
1653
|
-
name: "Turks and Caicos Islands",
|
|
1654
|
-
dialCode: "+1",
|
|
1655
|
-
passportRegex: "^[A-Z0-9]{6,10}$"
|
|
1656
|
-
},
|
|
1657
|
-
{ code: "TV", name: "Tuvalu", dialCode: "+688", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1658
|
-
{ code: "UG", name: "Uganda", dialCode: "+256", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1659
|
-
{ code: "UA", name: "Ukraine", dialCode: "+380", passportRegex: "^[A-Z]{2}[0-9]{6}$" },
|
|
1660
|
-
{
|
|
1661
|
-
code: "AE",
|
|
1662
|
-
name: "United Arab Emirates",
|
|
1663
|
-
dialCode: "+971",
|
|
1664
|
-
passportRegex: "^[A-Z]{1}[0-9]{7}$"
|
|
1665
|
-
},
|
|
1666
|
-
{ code: "GB", name: "United Kingdom", dialCode: "+44", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1667
|
-
{ code: "US", name: "United States", dialCode: "+1", passportRegex: "^[0-9]{9}$" },
|
|
1668
|
-
{ code: "UY", name: "Uruguay", dialCode: "+598", passportRegex: "^[A-Z]{3}[0-9]{6}$" },
|
|
1669
|
-
{ code: "UZ", name: "Uzbekistan", dialCode: "+998", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1670
|
-
{ code: "VU", name: "Vanuatu", dialCode: "+678", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1671
|
-
{ code: "VA", name: "Vatican City", dialCode: "+379", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1672
|
-
{ code: "VE", name: "Venezuela", dialCode: "+58", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
1673
|
-
{ code: "VN", name: "Vietnam", dialCode: "+84", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1674
|
-
{ code: "YE", name: "Yemen", dialCode: "+967", passportRegex: "^[A-Z]{1}[0-9]{7}$" },
|
|
1675
|
-
{ code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
1676
|
-
{ code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
|
|
1677
|
-
];
|
|
1678
1515
|
var detectIdentityType = (value) => {
|
|
1679
1516
|
if (!value) return "id";
|
|
1680
1517
|
const stringValue = String(value);
|
|
@@ -1690,7 +1527,7 @@ var detectEmailOrPhoneStrict = (value) => {
|
|
|
1690
1527
|
if (/^62\d/.test(value)) return "phone";
|
|
1691
1528
|
return "none";
|
|
1692
1529
|
};
|
|
1693
|
-
|
|
1530
|
+
var InputDynamic = ({
|
|
1694
1531
|
name,
|
|
1695
1532
|
control,
|
|
1696
1533
|
label,
|
|
@@ -1716,7 +1553,6 @@ function InputDynamic({
|
|
|
1716
1553
|
size,
|
|
1717
1554
|
onClick,
|
|
1718
1555
|
style,
|
|
1719
|
-
countryCodes = DEFAULT_COUNTRY_CODES,
|
|
1720
1556
|
defaultCountry = "ID",
|
|
1721
1557
|
maxLength,
|
|
1722
1558
|
autoAdvance = false,
|
|
@@ -1726,19 +1562,19 @@ function InputDynamic({
|
|
|
1726
1562
|
onInput,
|
|
1727
1563
|
contentAfter,
|
|
1728
1564
|
onChange
|
|
1729
|
-
}) {
|
|
1565
|
+
}) => {
|
|
1730
1566
|
const styles = useStyles7();
|
|
1731
|
-
const [showPassword, setShowPassword] =
|
|
1732
|
-
const [isPhoneMode, setIsPhoneMode] =
|
|
1733
|
-
const [emailOrPhoneType, setEmailOrPhoneType] =
|
|
1734
|
-
const [identityType, setIdentityType] =
|
|
1735
|
-
const [lastPhoneValue, setLastPhoneValue] =
|
|
1736
|
-
const [lastEmailOrPhoneValue, setLastEmailOrPhoneValue] =
|
|
1737
|
-
const inputRef =
|
|
1738
|
-
const phoneInputRef =
|
|
1739
|
-
const emailOrPhoneInputRef =
|
|
1740
|
-
const shouldFocusRef =
|
|
1741
|
-
const isBackspaceNavigationRef =
|
|
1567
|
+
const [showPassword, setShowPassword] = React5.useState(false);
|
|
1568
|
+
const [isPhoneMode, setIsPhoneMode] = React5.useState(false);
|
|
1569
|
+
const [emailOrPhoneType, setEmailOrPhoneType] = React5.useState("none");
|
|
1570
|
+
const [identityType, setIdentityType] = React5.useState("id");
|
|
1571
|
+
const [lastPhoneValue, setLastPhoneValue] = React5.useState("");
|
|
1572
|
+
const [lastEmailOrPhoneValue, setLastEmailOrPhoneValue] = React5.useState("");
|
|
1573
|
+
const inputRef = React5.useRef(null);
|
|
1574
|
+
const phoneInputRef = React5.useRef(null);
|
|
1575
|
+
const emailOrPhoneInputRef = React5.useRef(null);
|
|
1576
|
+
const shouldFocusRef = React5.useRef(false);
|
|
1577
|
+
const isBackspaceNavigationRef = React5.useRef(false);
|
|
1742
1578
|
const getSelectStyles = (hasError2) => ({
|
|
1743
1579
|
menuPortal: (base) => ({
|
|
1744
1580
|
...base,
|
|
@@ -1807,7 +1643,7 @@ function InputDynamic({
|
|
|
1807
1643
|
fontSize: reactComponents.tokens.fontSizeBase400
|
|
1808
1644
|
})
|
|
1809
1645
|
});
|
|
1810
|
-
|
|
1646
|
+
React5.useEffect(() => {
|
|
1811
1647
|
if (shouldFocusRef.current) {
|
|
1812
1648
|
setTimeout(() => {
|
|
1813
1649
|
if (identityType === "phone" && phoneInputRef.current) {
|
|
@@ -1829,7 +1665,7 @@ function InputDynamic({
|
|
|
1829
1665
|
}, 50);
|
|
1830
1666
|
}
|
|
1831
1667
|
}, [identityType]);
|
|
1832
|
-
|
|
1668
|
+
React5.useEffect(() => {
|
|
1833
1669
|
if (shouldFocusRef.current && type === "emailOrPhone") {
|
|
1834
1670
|
setTimeout(() => {
|
|
1835
1671
|
if (emailOrPhoneType === "phone" && emailOrPhoneInputRef.current) {
|
|
@@ -2159,66 +1995,6 @@ function InputDynamic({
|
|
|
2159
1995
|
}
|
|
2160
1996
|
) });
|
|
2161
1997
|
}
|
|
2162
|
-
case "passport": {
|
|
2163
|
-
const passportValue = field.value || {
|
|
2164
|
-
countryCode: defaultCountry,
|
|
2165
|
-
phoneNumber: ""
|
|
2166
|
-
};
|
|
2167
|
-
const countryOptions = countryCodes.map((country) => ({
|
|
2168
|
-
value: country.code,
|
|
2169
|
-
label: country.name,
|
|
2170
|
-
code: country.code,
|
|
2171
|
-
passportRegex: country.passportRegex
|
|
2172
|
-
}));
|
|
2173
|
-
const formatOptionLabel = (option) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2174
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "18px" }, children: String.fromCodePoint(
|
|
2175
|
-
...option.code.split("").map((char) => 127397 + char.charCodeAt(0))
|
|
2176
|
-
) }),
|
|
2177
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label })
|
|
2178
|
-
] });
|
|
2179
|
-
const selectedCountry = countryOptions.find((opt) => opt.value === passportValue.countryCode);
|
|
2180
|
-
const isCountrySelected = !!selectedCountry;
|
|
2181
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.phoneContainer, children: [
|
|
2182
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.phoneCountrySelect, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2183
|
-
Select__default.default,
|
|
2184
|
-
{
|
|
2185
|
-
value: selectedCountry || null,
|
|
2186
|
-
onChange: (selectedOption) => {
|
|
2187
|
-
field.onChange({
|
|
2188
|
-
...passportValue,
|
|
2189
|
-
countryCode: selectedOption ? selectedOption.value : defaultCountry
|
|
2190
|
-
});
|
|
2191
|
-
},
|
|
2192
|
-
options: countryOptions,
|
|
2193
|
-
isDisabled: disabled,
|
|
2194
|
-
placeholder: "\xF0\u0178\x8F\xB3\xEF\xB8\x8F",
|
|
2195
|
-
styles: getSelectStyles(!!error),
|
|
2196
|
-
isSearchable: true,
|
|
2197
|
-
formatOptionLabel
|
|
2198
|
-
}
|
|
2199
|
-
) }),
|
|
2200
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2201
|
-
reactComponents.Input,
|
|
2202
|
-
{
|
|
2203
|
-
value: passportValue.phoneNumber,
|
|
2204
|
-
maxLength,
|
|
2205
|
-
autoComplete: autoComplete || "off",
|
|
2206
|
-
onChange: (e) => {
|
|
2207
|
-
field.onChange({
|
|
2208
|
-
...passportValue,
|
|
2209
|
-
phoneNumber: e.target.value
|
|
2210
|
-
});
|
|
2211
|
-
},
|
|
2212
|
-
placeholder: placeholder || "Nomor paspor",
|
|
2213
|
-
disabled: disabled || !isCountrySelected,
|
|
2214
|
-
appearance,
|
|
2215
|
-
size,
|
|
2216
|
-
type: "text",
|
|
2217
|
-
style: { width: "100%" }
|
|
2218
|
-
}
|
|
2219
|
-
) })
|
|
2220
|
-
] });
|
|
2221
|
-
}
|
|
2222
1998
|
case "file":
|
|
2223
1999
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2224
2000
|
"input",
|
|
@@ -2284,7 +2060,7 @@ function InputDynamic({
|
|
|
2284
2060
|
{
|
|
2285
2061
|
value: option.value,
|
|
2286
2062
|
label: option.label,
|
|
2287
|
-
disabled: option.disabled,
|
|
2063
|
+
disabled: disabled || option.disabled,
|
|
2288
2064
|
className: styles.classRadio
|
|
2289
2065
|
},
|
|
2290
2066
|
option.value
|
|
@@ -2588,23 +2364,6 @@ function InputDynamic({
|
|
|
2588
2364
|
return true;
|
|
2589
2365
|
};
|
|
2590
2366
|
}
|
|
2591
|
-
if (type === "passport") {
|
|
2592
|
-
rules.validate = (value) => {
|
|
2593
|
-
if (required && !value?.phoneNumber) {
|
|
2594
|
-
return "Nomor paspor wajib diisi";
|
|
2595
|
-
}
|
|
2596
|
-
if (value?.phoneNumber) {
|
|
2597
|
-
const selectedCountry = countryCodes.find((c) => c.code === value.countryCode);
|
|
2598
|
-
if (selectedCountry?.passportRegex) {
|
|
2599
|
-
const passportRegex = new RegExp(selectedCountry.passportRegex);
|
|
2600
|
-
if (!passportRegex.test(value.phoneNumber)) {
|
|
2601
|
-
return `Format paspor ${selectedCountry.name} tidak valid`;
|
|
2602
|
-
}
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
return true;
|
|
2606
|
-
};
|
|
2607
|
-
}
|
|
2608
2367
|
return rules;
|
|
2609
2368
|
};
|
|
2610
2369
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2628,11 +2387,11 @@ function InputDynamic({
|
|
|
2628
2387
|
)
|
|
2629
2388
|
}
|
|
2630
2389
|
);
|
|
2631
|
-
}
|
|
2390
|
+
};
|
|
2632
2391
|
var InputDynamic_default = InputDynamic;
|
|
2633
2392
|
|
|
2634
2393
|
// src/components/InputDynamic/constants.ts
|
|
2635
|
-
var
|
|
2394
|
+
var DEFAULT_COUNTRY_CODES = [
|
|
2636
2395
|
{ code: "AF", name: "Afghanistan", dialCode: "+93", passportRegex: "^[A-Z][0-9]{7}$" },
|
|
2637
2396
|
{ code: "AL", name: "Albania", dialCode: "+355", passportRegex: "^[A-Z]{2}[0-9]{7}$" },
|
|
2638
2397
|
{ code: "DZ", name: "Algeria", dialCode: "+213", passportRegex: "^[0-9]{9}$" },
|
|
@@ -2872,7 +2631,649 @@ var DEFAULT_COUNTRY_CODES2 = [
|
|
|
2872
2631
|
{ code: "ZM", name: "Zambia", dialCode: "+260", passportRegex: "^[A-Z0-9]{6,10}$" },
|
|
2873
2632
|
{ code: "ZW", name: "Zimbabwe", dialCode: "+263", passportRegex: "^[A-Z0-9]{6,10}$" }
|
|
2874
2633
|
];
|
|
2634
|
+
|
|
2635
|
+
// src/components/CardTicketSearch/CardTicketSearch.constants.ts
|
|
2636
|
+
var DEFAULT_LABELS = {
|
|
2637
|
+
id: {
|
|
2638
|
+
fromLabel: "Dari",
|
|
2639
|
+
toLabel: "Ke",
|
|
2640
|
+
departureDateLabel: "Tanggal Berangkat",
|
|
2641
|
+
returnDateLabel: "Tanggal Pulang",
|
|
2642
|
+
serviceClassLabel: "Kelas Layanan",
|
|
2643
|
+
typeOfServiceLabel: "Jenis Layanan",
|
|
2644
|
+
passengerLabel: "Penumpang",
|
|
2645
|
+
roundTripLabel: "Pulang Pergi",
|
|
2646
|
+
searchButton: "Cari Tiket",
|
|
2647
|
+
placeholderPort: "Pilih Pelabuhan Asal",
|
|
2648
|
+
placeholderDestinationPort: "Pilih Pelabuhan Tujuan",
|
|
2649
|
+
placeholderDepartureDate: "Pilih Tanggal Keberangkatan",
|
|
2650
|
+
placeholderReturnDate: "Pilih Tanggal Kepulangan",
|
|
2651
|
+
placeholderTypeClass: "Pilih Kelas Layanan",
|
|
2652
|
+
placeholderTypeService: "Pilih Jenis Layanan",
|
|
2653
|
+
placeholderPassenger: "Pilih Jumlah Penumpang"
|
|
2654
|
+
},
|
|
2655
|
+
en: {
|
|
2656
|
+
fromLabel: "From",
|
|
2657
|
+
toLabel: "To",
|
|
2658
|
+
departureDateLabel: "Departure Date",
|
|
2659
|
+
returnDateLabel: "Return Date",
|
|
2660
|
+
serviceClassLabel: "Service Class",
|
|
2661
|
+
typeOfServiceLabel: "Service Type",
|
|
2662
|
+
passengerLabel: "Passenger",
|
|
2663
|
+
roundTripLabel: "Round Trip",
|
|
2664
|
+
searchButton: "Search Ticket",
|
|
2665
|
+
placeholderPort: "Select Origin Port",
|
|
2666
|
+
placeholderDestinationPort: "Select Destination Port",
|
|
2667
|
+
placeholderDepartureDate: "Select Departure Date",
|
|
2668
|
+
placeholderReturnDate: "Select Return Date",
|
|
2669
|
+
placeholderTypeClass: "Select Service Class",
|
|
2670
|
+
placeholderTypeService: "Select Service Type",
|
|
2671
|
+
placeholderPassenger: "Select Number of Passengers"
|
|
2672
|
+
}
|
|
2673
|
+
};
|
|
2674
|
+
|
|
2675
|
+
// src/constants/generated/tokens.ts
|
|
2676
|
+
var brandColors2 = {
|
|
2677
|
+
"10": "#000000",
|
|
2678
|
+
"20": "#03060e",
|
|
2679
|
+
"30": "#060b1c",
|
|
2680
|
+
"40": "#09112a",
|
|
2681
|
+
"50": "#0c1738",
|
|
2682
|
+
"60": "#122255",
|
|
2683
|
+
"70": "#182e71",
|
|
2684
|
+
"80": "#1e398d",
|
|
2685
|
+
"90": "#4b60a4",
|
|
2686
|
+
"100": "#7787bb",
|
|
2687
|
+
"110": "#a4afd1",
|
|
2688
|
+
"120": "#bac2dd",
|
|
2689
|
+
"130": "#d0d6e8",
|
|
2690
|
+
"140": "#e7e9f4",
|
|
2691
|
+
"150": "#fdfdff",
|
|
2692
|
+
"160": "#ffffff"
|
|
2693
|
+
};
|
|
2694
|
+
|
|
2695
|
+
// src/constants/brandColors.ts
|
|
2696
|
+
var isV2Path = typeof window !== "undefined" && window.location.pathname.startsWith("/v2");
|
|
2697
|
+
var brandColors3 = !isV2Path ? brandColors : brandColors2;
|
|
2698
|
+
var customBrand = {
|
|
2699
|
+
10: brandColors3["10"],
|
|
2700
|
+
20: brandColors3["20"],
|
|
2701
|
+
30: brandColors3["30"],
|
|
2702
|
+
40: brandColors3["40"],
|
|
2703
|
+
50: brandColors3["50"],
|
|
2704
|
+
60: brandColors3["60"],
|
|
2705
|
+
70: brandColors3["70"],
|
|
2706
|
+
80: brandColors3["80"],
|
|
2707
|
+
90: brandColors3["90"],
|
|
2708
|
+
100: brandColors3["100"],
|
|
2709
|
+
110: brandColors3["110"],
|
|
2710
|
+
120: brandColors3["120"],
|
|
2711
|
+
130: brandColors3["130"],
|
|
2712
|
+
140: brandColors3["140"],
|
|
2713
|
+
150: brandColors3["150"],
|
|
2714
|
+
160: brandColors3["160"]
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
// src/constants/designTokens.ts
|
|
2718
|
+
typeof window !== "undefined" && window.location.pathname.startsWith("/v2");
|
|
2719
|
+
var designTokens = {
|
|
2720
|
+
// Breakpoints for responsive design
|
|
2721
|
+
breakpoints: {
|
|
2722
|
+
md: "768px",
|
|
2723
|
+
lg: "1024px",
|
|
2724
|
+
xl: "1200px"}};
|
|
2725
|
+
|
|
2726
|
+
// src/constants/themes.ts
|
|
2727
|
+
var extendedTokens = {
|
|
2728
|
+
breakpointMd: designTokens.breakpoints.md,
|
|
2729
|
+
breakpointLg: designTokens.breakpoints.lg,
|
|
2730
|
+
breakpointXl: designTokens.breakpoints.xl};
|
|
2731
|
+
({
|
|
2732
|
+
...reactComponents.createLightTheme(customBrand),
|
|
2733
|
+
// Brand colors from Figma
|
|
2734
|
+
colorBrandBackground: customBrand[80],
|
|
2735
|
+
colorBrandBackgroundHover: customBrand[70],
|
|
2736
|
+
colorBrandBackgroundPressed: customBrand[60],
|
|
2737
|
+
colorBrandBackgroundSelected: customBrand[80],
|
|
2738
|
+
colorBrandForeground1: customBrand[80],
|
|
2739
|
+
colorBrandForeground2: customBrand[70],
|
|
2740
|
+
colorBrandForegroundLink: customBrand[70],
|
|
2741
|
+
colorBrandForegroundLinkHover: customBrand[60],
|
|
2742
|
+
colorBrandForegroundLinkPressed: customBrand[50],
|
|
2743
|
+
colorBrandForegroundLinkSelected: customBrand[70]});
|
|
2744
|
+
({
|
|
2745
|
+
...reactComponents.createDarkTheme(customBrand),
|
|
2746
|
+
// Brand colors from Figma (inverted for dark mode)
|
|
2747
|
+
colorBrandBackground: customBrand[100],
|
|
2748
|
+
colorBrandBackgroundHover: customBrand[110],
|
|
2749
|
+
colorBrandBackgroundPressed: customBrand[120],
|
|
2750
|
+
colorBrandBackgroundSelected: customBrand[100],
|
|
2751
|
+
colorBrandForeground1: customBrand[100],
|
|
2752
|
+
colorBrandForeground2: customBrand[110],
|
|
2753
|
+
colorBrandForegroundLink: customBrand[110],
|
|
2754
|
+
colorBrandForegroundLinkHover: customBrand[120],
|
|
2755
|
+
colorBrandForegroundLinkPressed: customBrand[130],
|
|
2756
|
+
colorBrandForegroundLinkSelected: customBrand[110]});
|
|
2875
2757
|
var useStyles8 = reactComponents.makeStyles({
|
|
2758
|
+
card: {
|
|
2759
|
+
position: "relative",
|
|
2760
|
+
width: "100%",
|
|
2761
|
+
padding: 0,
|
|
2762
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2763
|
+
padding: "0"
|
|
2764
|
+
},
|
|
2765
|
+
[`@media (min-width: ${extendedTokens.breakpointMd})`]: {
|
|
2766
|
+
scale: "1"
|
|
2767
|
+
},
|
|
2768
|
+
marginTop: "5rem"
|
|
2769
|
+
},
|
|
2770
|
+
svgBackground: {
|
|
2771
|
+
position: "absolute",
|
|
2772
|
+
top: 0,
|
|
2773
|
+
left: 0,
|
|
2774
|
+
width: "100%",
|
|
2775
|
+
height: "100%",
|
|
2776
|
+
zIndex: 0
|
|
2777
|
+
},
|
|
2778
|
+
formField: {
|
|
2779
|
+
padding: "16px",
|
|
2780
|
+
display: "flex",
|
|
2781
|
+
flexDirection: "column",
|
|
2782
|
+
gap: "8px",
|
|
2783
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge,
|
|
2784
|
+
border: "1px solid " + reactComponents.tokens.colorNeutralStroke1,
|
|
2785
|
+
height: "100%",
|
|
2786
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2787
|
+
padding: "20px",
|
|
2788
|
+
borderRadius: reactComponents.tokens.borderRadiusXLarge
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
deviderButton: {
|
|
2792
|
+
display: "flex",
|
|
2793
|
+
justifyContent: "center",
|
|
2794
|
+
position: "absolute",
|
|
2795
|
+
left: "18px",
|
|
2796
|
+
bottom: "-16px",
|
|
2797
|
+
width: "90%"
|
|
2798
|
+
},
|
|
2799
|
+
buttonSwitch: {
|
|
2800
|
+
background: reactComponents.tokens.colorNeutralBackground1,
|
|
2801
|
+
boxShadow: `0 1px 2px 0 ${reactComponents.tokens.colorNeutralShadowKey}, 0 0 2px 0 ${reactComponents.tokens.colorNeutralShadowAmbient}`
|
|
2802
|
+
},
|
|
2803
|
+
switchIcon: {
|
|
2804
|
+
display: "inline-flex",
|
|
2805
|
+
transition: "transform 0.3s ease"
|
|
2806
|
+
},
|
|
2807
|
+
switchIconRotate: {
|
|
2808
|
+
transform: "rotate(180deg)"
|
|
2809
|
+
},
|
|
2810
|
+
searchButton: {
|
|
2811
|
+
width: "100%",
|
|
2812
|
+
borderRadius: reactComponents.tokens.borderRadiusCircular
|
|
2813
|
+
},
|
|
2814
|
+
serviceMenuCard: {
|
|
2815
|
+
[`@media (min-width: ${extendedTokens.breakpointMd})`]: {
|
|
2816
|
+
margin: reactComponents.tokens.spacingVerticalM
|
|
2817
|
+
},
|
|
2818
|
+
[`@media (min-width: ${extendedTokens.breakpointLg})`]: {
|
|
2819
|
+
margin: reactComponents.tokens.spacingVerticalL
|
|
2820
|
+
},
|
|
2821
|
+
[`@media (min-width: ${extendedTokens.breakpointXl})`]: {
|
|
2822
|
+
margin: reactComponents.tokens.spacingVerticalXXXL,
|
|
2823
|
+
maxWidth: "70%"
|
|
2824
|
+
}
|
|
2825
|
+
},
|
|
2826
|
+
ticketSearchRow: {
|
|
2827
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2828
|
+
padding: "20px !important"
|
|
2829
|
+
}
|
|
2830
|
+
},
|
|
2831
|
+
formContainerCol: {
|
|
2832
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2833
|
+
paddingLeft: "20px !important",
|
|
2834
|
+
paddingRight: "20px !important",
|
|
2835
|
+
marginBottom: "1rem",
|
|
2836
|
+
marginTop: "8rem"
|
|
2837
|
+
}
|
|
2838
|
+
},
|
|
2839
|
+
serviceCol: {
|
|
2840
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2841
|
+
paddingLeft: "15px !important",
|
|
2842
|
+
paddingRight: "15px !important",
|
|
2843
|
+
marginTop: "16px"
|
|
2844
|
+
}
|
|
2845
|
+
},
|
|
2846
|
+
formInnerRow: {
|
|
2847
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2848
|
+
margin: "0 !important"
|
|
2849
|
+
}
|
|
2850
|
+
},
|
|
2851
|
+
formFieldRow: {
|
|
2852
|
+
[`@media (max-width: ${extendedTokens.breakpointXl})`]: {
|
|
2853
|
+
gap: "12px !important"
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
});
|
|
2857
|
+
var CardTicketSearch = ({
|
|
2858
|
+
language = "id",
|
|
2859
|
+
from = "",
|
|
2860
|
+
to = "",
|
|
2861
|
+
startDate = "",
|
|
2862
|
+
endDate = "",
|
|
2863
|
+
roundTrip = false,
|
|
2864
|
+
serviceClass = "",
|
|
2865
|
+
typeOfService = "",
|
|
2866
|
+
passenger = "",
|
|
2867
|
+
toDisabled = false,
|
|
2868
|
+
endDateDisabled = false,
|
|
2869
|
+
serviceClassDisabled = false,
|
|
2870
|
+
typeOfServiceDisabled = false,
|
|
2871
|
+
switchDisabled = false,
|
|
2872
|
+
roundTripDisabled = false,
|
|
2873
|
+
submitDisabled = false,
|
|
2874
|
+
onFromClick,
|
|
2875
|
+
onToClick,
|
|
2876
|
+
onFromChange,
|
|
2877
|
+
onStartDateClick,
|
|
2878
|
+
onEndDateClick,
|
|
2879
|
+
onServiceClassClick,
|
|
2880
|
+
onTypeOfServiceClick,
|
|
2881
|
+
onPassengerClick,
|
|
2882
|
+
onSwitchClick,
|
|
2883
|
+
onRoundTripChange,
|
|
2884
|
+
onSubmit,
|
|
2885
|
+
activeServiceId = "ferry",
|
|
2886
|
+
labels: customLabels,
|
|
2887
|
+
className,
|
|
2888
|
+
isRotating = false,
|
|
2889
|
+
showPassengerField = false
|
|
2890
|
+
}) => {
|
|
2891
|
+
const styles = useStyles8();
|
|
2892
|
+
const labels = React5__default.default.useMemo(
|
|
2893
|
+
() => ({ ...DEFAULT_LABELS[language], ...customLabels }),
|
|
2894
|
+
[language, customLabels]
|
|
2895
|
+
);
|
|
2896
|
+
const { control, setValue, getValues, handleSubmit } = reactHookForm.useForm({
|
|
2897
|
+
defaultValues: {
|
|
2898
|
+
from,
|
|
2899
|
+
to,
|
|
2900
|
+
startDate,
|
|
2901
|
+
roundTrip,
|
|
2902
|
+
endDate,
|
|
2903
|
+
serviceClass,
|
|
2904
|
+
typeOfService,
|
|
2905
|
+
passenger
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
const roundTripValue = reactHookForm.useWatch({
|
|
2909
|
+
control,
|
|
2910
|
+
name: "roundTrip",
|
|
2911
|
+
defaultValue: roundTrip
|
|
2912
|
+
});
|
|
2913
|
+
React5__default.default.useEffect(() => {
|
|
2914
|
+
setValue("from", from);
|
|
2915
|
+
setValue("to", to);
|
|
2916
|
+
setValue("startDate", startDate);
|
|
2917
|
+
setValue("endDate", endDate);
|
|
2918
|
+
setValue("roundTrip", roundTrip);
|
|
2919
|
+
setValue("serviceClass", serviceClass);
|
|
2920
|
+
setValue("typeOfService", typeOfService);
|
|
2921
|
+
setValue("passenger", passenger);
|
|
2922
|
+
}, [from, to, startDate, endDate, roundTrip, serviceClass, typeOfService, passenger, setValue]);
|
|
2923
|
+
React5__default.default.useEffect(() => {
|
|
2924
|
+
if (onRoundTripChange) {
|
|
2925
|
+
onRoundTripChange(roundTripValue);
|
|
2926
|
+
}
|
|
2927
|
+
}, [roundTripValue, onRoundTripChange]);
|
|
2928
|
+
const handleFormSubmit = (data) => {
|
|
2929
|
+
if (onSubmit) {
|
|
2930
|
+
onSubmit(data);
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
const handleFromChange = () => {
|
|
2934
|
+
setValue("to", "");
|
|
2935
|
+
if (onFromChange) {
|
|
2936
|
+
onFromChange();
|
|
2937
|
+
}
|
|
2938
|
+
};
|
|
2939
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles.card} ${className || ""}`, children: [
|
|
2940
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Visible, { xl: true, xxl: true, xxxl: true, children: /* @__PURE__ */ jsxRuntime.jsx(BackgroundTicketCard_default, { className: styles.svgBackground }) }),
|
|
2941
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Visible, { xs: true, sm: true, md: true, lg: true, children: /* @__PURE__ */ jsxRuntime.jsx(BackgroundTicketCardVertical_default, { className: styles.svgBackground }) }),
|
|
2942
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2943
|
+
reactGridSystem.Row,
|
|
2944
|
+
{
|
|
2945
|
+
style: {
|
|
2946
|
+
paddingTop: "1rem",
|
|
2947
|
+
paddingBottom: "2rem"
|
|
2948
|
+
},
|
|
2949
|
+
className: styles.ticketSearchRow,
|
|
2950
|
+
children: [
|
|
2951
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2952
|
+
reactGridSystem.Col,
|
|
2953
|
+
{
|
|
2954
|
+
xs: 12,
|
|
2955
|
+
sm: 12,
|
|
2956
|
+
md: 12,
|
|
2957
|
+
lg: 12,
|
|
2958
|
+
xl: 3,
|
|
2959
|
+
xxl: 3,
|
|
2960
|
+
xxxl: 3,
|
|
2961
|
+
style: {
|
|
2962
|
+
display: "flex",
|
|
2963
|
+
justifyContent: "center",
|
|
2964
|
+
alignItems: "center",
|
|
2965
|
+
marginBottom: "0px"
|
|
2966
|
+
},
|
|
2967
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2968
|
+
CardServiceMenu,
|
|
2969
|
+
{
|
|
2970
|
+
className: styles.serviceMenuCard,
|
|
2971
|
+
activeServiceId,
|
|
2972
|
+
language
|
|
2973
|
+
}
|
|
2974
|
+
)
|
|
2975
|
+
}
|
|
2976
|
+
),
|
|
2977
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 0.4, xxl: 0.4, xxxl: 0.4 }),
|
|
2978
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2979
|
+
reactGridSystem.Col,
|
|
2980
|
+
{
|
|
2981
|
+
xs: 12,
|
|
2982
|
+
sm: 12,
|
|
2983
|
+
md: 12,
|
|
2984
|
+
lg: 12,
|
|
2985
|
+
xl: 8.6,
|
|
2986
|
+
xxl: 8.6,
|
|
2987
|
+
xxxl: 8.6,
|
|
2988
|
+
style: {
|
|
2989
|
+
display: "flex",
|
|
2990
|
+
alignItems: "center",
|
|
2991
|
+
justifyContent: "center",
|
|
2992
|
+
flexDirection: "column"
|
|
2993
|
+
},
|
|
2994
|
+
className: styles.formContainerCol,
|
|
2995
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit(handleFormSubmit), children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { style: { width: "100%" }, className: styles.formInnerRow, children: [
|
|
2996
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, lg: 12, xl: 6, xxl: 6, xxxl: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { style: { gap: "16px" }, className: styles.formFieldRow, children: [
|
|
2997
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.formField, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { children: [
|
|
2998
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: [
|
|
2999
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3000
|
+
InputDynamic_default,
|
|
3001
|
+
{
|
|
3002
|
+
name: "from",
|
|
3003
|
+
label: labels.fromLabel,
|
|
3004
|
+
control,
|
|
3005
|
+
type: "text",
|
|
3006
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3007
|
+
iconify_js.Icon,
|
|
3008
|
+
{
|
|
3009
|
+
icon: "fluent:vehicle-ship-16-filled",
|
|
3010
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3011
|
+
}
|
|
3012
|
+
),
|
|
3013
|
+
appearance: "filled-lighter",
|
|
3014
|
+
size: "medium",
|
|
3015
|
+
placeholder: labels.placeholderPort,
|
|
3016
|
+
onClick: onFromClick,
|
|
3017
|
+
onChange: handleFromChange,
|
|
3018
|
+
validationRules: {
|
|
3019
|
+
required: "Pelabuhan asal wajib diisi"
|
|
3020
|
+
},
|
|
3021
|
+
required: true
|
|
3022
|
+
}
|
|
3023
|
+
),
|
|
3024
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.deviderButton, children: [
|
|
3025
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, {}),
|
|
3026
|
+
" ",
|
|
3027
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3028
|
+
reactComponents.Button,
|
|
3029
|
+
{
|
|
3030
|
+
onClick: onSwitchClick,
|
|
3031
|
+
className: styles.buttonSwitch,
|
|
3032
|
+
shape: "circular",
|
|
3033
|
+
appearance: "secondary",
|
|
3034
|
+
size: "large",
|
|
3035
|
+
disabled: switchDisabled,
|
|
3036
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3037
|
+
"div",
|
|
3038
|
+
{
|
|
3039
|
+
className: `${styles.switchIcon} ${isRotating ? styles.switchIconRotate : ""}`,
|
|
3040
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3041
|
+
"img",
|
|
3042
|
+
{
|
|
3043
|
+
src: "/assets/images/icons/switch.svg",
|
|
3044
|
+
alt: "Switch",
|
|
3045
|
+
width: 26,
|
|
3046
|
+
height: 26
|
|
3047
|
+
}
|
|
3048
|
+
)
|
|
3049
|
+
}
|
|
3050
|
+
)
|
|
3051
|
+
}
|
|
3052
|
+
)
|
|
3053
|
+
] })
|
|
3054
|
+
] }),
|
|
3055
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3056
|
+
InputDynamic_default,
|
|
3057
|
+
{
|
|
3058
|
+
name: "to",
|
|
3059
|
+
label: labels.toLabel,
|
|
3060
|
+
control,
|
|
3061
|
+
type: "text",
|
|
3062
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3063
|
+
iconify_js.Icon,
|
|
3064
|
+
{
|
|
3065
|
+
icon: "fluent:location-24-filled",
|
|
3066
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3067
|
+
}
|
|
3068
|
+
),
|
|
3069
|
+
disabled: toDisabled,
|
|
3070
|
+
appearance: "filled-lighter",
|
|
3071
|
+
size: "medium",
|
|
3072
|
+
placeholder: labels.placeholderDestinationPort,
|
|
3073
|
+
onClick: onToClick,
|
|
3074
|
+
validationRules: {
|
|
3075
|
+
required: "Pelabuhan tujuan wajib diisi"
|
|
3076
|
+
},
|
|
3077
|
+
required: true
|
|
3078
|
+
}
|
|
3079
|
+
) })
|
|
3080
|
+
] }) }) }),
|
|
3081
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.formField, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { style: { height: "100%" }, children: [
|
|
3082
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 7, sm: 7, md: 7, lg: 7, xl: 7, xxl: 7, xxxl: 7, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "relative", zIndex: 2 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3083
|
+
InputDynamic_default,
|
|
3084
|
+
{
|
|
3085
|
+
name: "startDate",
|
|
3086
|
+
label: labels.departureDateLabel,
|
|
3087
|
+
control,
|
|
3088
|
+
type: "text",
|
|
3089
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3090
|
+
iconify_js.Icon,
|
|
3091
|
+
{
|
|
3092
|
+
icon: "fluent:calendar-24-filled",
|
|
3093
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3094
|
+
}
|
|
3095
|
+
),
|
|
3096
|
+
appearance: "filled-lighter",
|
|
3097
|
+
size: "medium",
|
|
3098
|
+
placeholder: labels.placeholderDepartureDate,
|
|
3099
|
+
onClick: onStartDateClick,
|
|
3100
|
+
required: true,
|
|
3101
|
+
validationRules: {
|
|
3102
|
+
required: "Tanggal Berangkat wajib diisi"
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
) }) }),
|
|
3106
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3107
|
+
reactGridSystem.Col,
|
|
3108
|
+
{
|
|
3109
|
+
xs: 5,
|
|
3110
|
+
sm: 5,
|
|
3111
|
+
md: 5,
|
|
3112
|
+
lg: 5,
|
|
3113
|
+
xl: 5,
|
|
3114
|
+
xxl: 5,
|
|
3115
|
+
xxxl: 5,
|
|
3116
|
+
style: { display: "flex", justifyContent: "end" },
|
|
3117
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3118
|
+
InputDynamic_default,
|
|
3119
|
+
{
|
|
3120
|
+
name: "roundTrip",
|
|
3121
|
+
label: labels.roundTripLabel,
|
|
3122
|
+
control,
|
|
3123
|
+
type: "switch",
|
|
3124
|
+
disabled: roundTripDisabled,
|
|
3125
|
+
size: "medium"
|
|
3126
|
+
}
|
|
3127
|
+
)
|
|
3128
|
+
}
|
|
3129
|
+
),
|
|
3130
|
+
roundTripValue && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3131
|
+
InputDynamic_default,
|
|
3132
|
+
{
|
|
3133
|
+
name: "endDate",
|
|
3134
|
+
label: labels.returnDateLabel,
|
|
3135
|
+
control,
|
|
3136
|
+
type: "text",
|
|
3137
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3138
|
+
iconify_js.Icon,
|
|
3139
|
+
{
|
|
3140
|
+
icon: "fluent:calendar-24-filled",
|
|
3141
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3142
|
+
}
|
|
3143
|
+
),
|
|
3144
|
+
appearance: "filled-lighter",
|
|
3145
|
+
size: "medium",
|
|
3146
|
+
placeholder: labels.placeholderReturnDate,
|
|
3147
|
+
onClick: onEndDateClick,
|
|
3148
|
+
disabled: endDateDisabled,
|
|
3149
|
+
style: { borderColor: "transparent" },
|
|
3150
|
+
required: roundTripValue,
|
|
3151
|
+
validationRules: {
|
|
3152
|
+
required: "Tanggal Pulang wajib diisi"
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
) })
|
|
3156
|
+
] }) }) })
|
|
3157
|
+
] }) }),
|
|
3158
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Visible, { xl: true, xxl: true, xxxl: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3159
|
+
reactGridSystem.Col,
|
|
3160
|
+
{
|
|
3161
|
+
xs: 12,
|
|
3162
|
+
sm: 12,
|
|
3163
|
+
lg: 12,
|
|
3164
|
+
xl: 1,
|
|
3165
|
+
xxl: 1,
|
|
3166
|
+
xxxl: 1,
|
|
3167
|
+
style: { display: "flex", alignItems: "center", justifyContent: "center" },
|
|
3168
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Divider, { vertical: true, style: { height: "100%" } })
|
|
3169
|
+
}
|
|
3170
|
+
) }),
|
|
3171
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
|
+
reactGridSystem.Col,
|
|
3173
|
+
{
|
|
3174
|
+
xs: 12,
|
|
3175
|
+
sm: 12,
|
|
3176
|
+
lg: 12,
|
|
3177
|
+
xl: 5,
|
|
3178
|
+
xxl: 5,
|
|
3179
|
+
xxxl: 5,
|
|
3180
|
+
style: {
|
|
3181
|
+
paddingRight: "2rem",
|
|
3182
|
+
paddingLeft: "8px"
|
|
3183
|
+
},
|
|
3184
|
+
className: styles.serviceCol,
|
|
3185
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { style: { height: "100%", gap: "16px" }, children: [
|
|
3186
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.formField, children: /* @__PURE__ */ jsxRuntime.jsxs(reactGridSystem.Row, { style: { height: "100%", gap: "16px" }, children: [
|
|
3187
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3188
|
+
InputDynamic_default,
|
|
3189
|
+
{
|
|
3190
|
+
name: "serviceClass",
|
|
3191
|
+
label: labels.serviceClassLabel,
|
|
3192
|
+
control,
|
|
3193
|
+
type: "text",
|
|
3194
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3195
|
+
iconify_js.Icon,
|
|
3196
|
+
{
|
|
3197
|
+
icon: "fluent:ribbon-star-24-filled",
|
|
3198
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3199
|
+
}
|
|
3200
|
+
),
|
|
3201
|
+
appearance: "filled-lighter",
|
|
3202
|
+
size: "medium",
|
|
3203
|
+
placeholder: labels.placeholderTypeClass,
|
|
3204
|
+
onClick: onServiceClassClick,
|
|
3205
|
+
required: true,
|
|
3206
|
+
disabled: serviceClassDisabled
|
|
3207
|
+
}
|
|
3208
|
+
) }),
|
|
3209
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3210
|
+
InputDynamic_default,
|
|
3211
|
+
{
|
|
3212
|
+
name: "typeOfService",
|
|
3213
|
+
label: labels.typeOfServiceLabel,
|
|
3214
|
+
control,
|
|
3215
|
+
type: "text",
|
|
3216
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3217
|
+
iconify_js.Icon,
|
|
3218
|
+
{
|
|
3219
|
+
icon: "fluent:apps-list-24-filled",
|
|
3220
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3221
|
+
}
|
|
3222
|
+
),
|
|
3223
|
+
appearance: "filled-lighter",
|
|
3224
|
+
size: "medium",
|
|
3225
|
+
placeholder: labels.placeholderTypeService,
|
|
3226
|
+
onClick: onTypeOfServiceClick,
|
|
3227
|
+
required: true,
|
|
3228
|
+
disabled: typeOfServiceDisabled
|
|
3229
|
+
}
|
|
3230
|
+
) }),
|
|
3231
|
+
showPassengerField && /* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, md: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3232
|
+
InputDynamic_default,
|
|
3233
|
+
{
|
|
3234
|
+
required: true,
|
|
3235
|
+
name: "passenger",
|
|
3236
|
+
label: labels.passengerLabel,
|
|
3237
|
+
control,
|
|
3238
|
+
type: "text",
|
|
3239
|
+
contentBefore: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3240
|
+
iconify_js.Icon,
|
|
3241
|
+
{
|
|
3242
|
+
icon: "fluent:people-24-filled",
|
|
3243
|
+
color: reactComponents.tokens.colorBrandBackground
|
|
3244
|
+
}
|
|
3245
|
+
),
|
|
3246
|
+
appearance: "filled-lighter",
|
|
3247
|
+
size: "medium",
|
|
3248
|
+
placeholder: labels.placeholderPassenger,
|
|
3249
|
+
onClick: onPassengerClick
|
|
3250
|
+
}
|
|
3251
|
+
) })
|
|
3252
|
+
] }) }) }),
|
|
3253
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactGridSystem.Col, { xs: 12, sm: 12, lg: 12, xl: 12, xxl: 12, xxxl: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3254
|
+
reactComponents.Button,
|
|
3255
|
+
{
|
|
3256
|
+
className: styles.searchButton,
|
|
3257
|
+
appearance: "primary",
|
|
3258
|
+
size: "large",
|
|
3259
|
+
type: "submit",
|
|
3260
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(iconify_js.Icon, { icon: "fluent:vehicle-ship-20-filled" }),
|
|
3261
|
+
disabled: submitDisabled,
|
|
3262
|
+
children: labels.searchButton
|
|
3263
|
+
}
|
|
3264
|
+
) })
|
|
3265
|
+
] })
|
|
3266
|
+
}
|
|
3267
|
+
)
|
|
3268
|
+
] }) })
|
|
3269
|
+
}
|
|
3270
|
+
)
|
|
3271
|
+
]
|
|
3272
|
+
}
|
|
3273
|
+
)
|
|
3274
|
+
] });
|
|
3275
|
+
};
|
|
3276
|
+
var useStyles9 = reactComponents.makeStyles({
|
|
2876
3277
|
dialogTitle: {
|
|
2877
3278
|
display: "flex",
|
|
2878
3279
|
justifyContent: "space-between",
|
|
@@ -3001,7 +3402,7 @@ var ModalSearchHarbor = ({
|
|
|
3001
3402
|
onRemoveLastSearched,
|
|
3002
3403
|
onClearLastSearched
|
|
3003
3404
|
}) => {
|
|
3004
|
-
const styles =
|
|
3405
|
+
const styles = useStyles9();
|
|
3005
3406
|
const handleSelect = (harbor) => {
|
|
3006
3407
|
onAddLastSearched(harbor);
|
|
3007
3408
|
onSelectHarbor(harbor);
|
|
@@ -3129,7 +3530,7 @@ var ModalSearchHarbor = ({
|
|
|
3129
3530
|
}
|
|
3130
3531
|
);
|
|
3131
3532
|
};
|
|
3132
|
-
var
|
|
3533
|
+
var useStyles10 = reactComponents.makeStyles({
|
|
3133
3534
|
dialogSurface: {
|
|
3134
3535
|
maxWidth: "600px",
|
|
3135
3536
|
width: "100%"
|
|
@@ -3246,12 +3647,12 @@ var ModalSelectDate = ({
|
|
|
3246
3647
|
maxDate,
|
|
3247
3648
|
dateFormat = "DD MMMM YYYY"
|
|
3248
3649
|
}) => {
|
|
3249
|
-
const styles =
|
|
3250
|
-
const [selectedDate, setSelectedDate] =
|
|
3251
|
-
const [selectedEndDate, setSelectedEndDate] =
|
|
3252
|
-
const [hoveredDate, setHoveredDate] =
|
|
3253
|
-
const [activeTab, setActiveTab] =
|
|
3254
|
-
const previewEndDate =
|
|
3650
|
+
const styles = useStyles10();
|
|
3651
|
+
const [selectedDate, setSelectedDate] = React5.useState(selectedDepartureDate);
|
|
3652
|
+
const [selectedEndDate, setSelectedEndDate] = React5.useState(selectedReturnDate);
|
|
3653
|
+
const [hoveredDate, setHoveredDate] = React5.useState();
|
|
3654
|
+
const [activeTab, setActiveTab] = React5.useState(initialTab);
|
|
3655
|
+
const previewEndDate = React5.useMemo(() => {
|
|
3255
3656
|
if (selectedEndDate) return selectedEndDate;
|
|
3256
3657
|
if (selectedDate && hoveredDate && hoveredDate > selectedDate) {
|
|
3257
3658
|
return hoveredDate;
|
|
@@ -3262,7 +3663,7 @@ var ModalSelectDate = ({
|
|
|
3262
3663
|
if (!first || !second) return false;
|
|
3263
3664
|
return moment__default.default(first).isSame(second, "day");
|
|
3264
3665
|
};
|
|
3265
|
-
|
|
3666
|
+
React5.useEffect(() => {
|
|
3266
3667
|
if (open) {
|
|
3267
3668
|
setSelectedDate(selectedDepartureDate);
|
|
3268
3669
|
setSelectedEndDate(selectedReturnDate);
|
|
@@ -3314,7 +3715,7 @@ var ModalSelectDate = ({
|
|
|
3314
3715
|
handleClose();
|
|
3315
3716
|
}
|
|
3316
3717
|
};
|
|
3317
|
-
const handleCustomDayCellRef =
|
|
3718
|
+
const handleCustomDayCellRef = React5.useCallback(
|
|
3318
3719
|
(element, date, _classNames) => {
|
|
3319
3720
|
if (!element) return;
|
|
3320
3721
|
const removeTokens = (className) => {
|
|
@@ -3454,7 +3855,7 @@ var ModalSelectDate = ({
|
|
|
3454
3855
|
}
|
|
3455
3856
|
);
|
|
3456
3857
|
};
|
|
3457
|
-
var
|
|
3858
|
+
var useStyles11 = reactComponents.makeStyles({
|
|
3458
3859
|
dialogSurface: {
|
|
3459
3860
|
maxWidth: "600px",
|
|
3460
3861
|
width: "100%"
|
|
@@ -3537,9 +3938,9 @@ var ModalService = ({
|
|
|
3537
3938
|
isLoading = false,
|
|
3538
3939
|
isError = false
|
|
3539
3940
|
}) => {
|
|
3540
|
-
const styles =
|
|
3541
|
-
const [selectedServices, setSelectedServices] =
|
|
3542
|
-
|
|
3941
|
+
const styles = useStyles11();
|
|
3942
|
+
const [selectedServices, setSelectedServices] = React5.useState(selectedServiceIds);
|
|
3943
|
+
React5.useEffect(() => {
|
|
3543
3944
|
if (open) {
|
|
3544
3945
|
if (selectedServiceIds && selectedServiceIds.length > 0) {
|
|
3545
3946
|
const validIds = services.filter((s) => selectedServiceIds.includes(s.id)).map((s) => s.id);
|
|
@@ -3652,7 +4053,7 @@ var DEFAULT_SERVICE_CLASSES = [
|
|
|
3652
4053
|
{ id: 2, name: "Bisnis", key: "bisnis", serviceName: "BUSINESS" },
|
|
3653
4054
|
{ id: 3, name: "Eksekutif", key: "eksekutif", serviceName: "EXECUTIVE" }
|
|
3654
4055
|
];
|
|
3655
|
-
var
|
|
4056
|
+
var useStyles12 = reactComponents.makeStyles({
|
|
3656
4057
|
dialogSurface: {
|
|
3657
4058
|
maxWidth: "600px",
|
|
3658
4059
|
width: "100%"
|
|
@@ -3731,11 +4132,11 @@ var ModalTotalPassengers = ({
|
|
|
3731
4132
|
maxPassengers = 10,
|
|
3732
4133
|
infoMessage
|
|
3733
4134
|
}) => {
|
|
3734
|
-
const styles =
|
|
3735
|
-
const [passengers, setPassengers] =
|
|
3736
|
-
const [openItems, setOpenItems] =
|
|
4135
|
+
const styles = useStyles12();
|
|
4136
|
+
const [passengers, setPassengers] = React5.useState([]);
|
|
4137
|
+
const [openItems, setOpenItems] = React5.useState([]);
|
|
3737
4138
|
const defaultInfoMessage = `Anda dapat menambahkan hingga ${maxPassengers} penumpang pada golongan kendaraan ini.`;
|
|
3738
|
-
|
|
4139
|
+
React5.useEffect(() => {
|
|
3739
4140
|
if (passengerTypes.length === 0) return;
|
|
3740
4141
|
const defaultPassengers = passengerTypes.map((passengerType) => ({
|
|
3741
4142
|
passengerTypeId: passengerType.id,
|
|
@@ -3965,7 +4366,7 @@ var ModalTotalPassengers = ({
|
|
|
3965
4366
|
}
|
|
3966
4367
|
);
|
|
3967
4368
|
};
|
|
3968
|
-
var
|
|
4369
|
+
var useStyles13 = reactComponents.makeStyles({
|
|
3969
4370
|
dialogSurface: {
|
|
3970
4371
|
maxWidth: "600px",
|
|
3971
4372
|
width: "100%"
|
|
@@ -4017,11 +4418,11 @@ var ModalTypeOfService = ({
|
|
|
4017
4418
|
onSave,
|
|
4018
4419
|
renderImage
|
|
4019
4420
|
}) => {
|
|
4020
|
-
const styles =
|
|
4021
|
-
const [selectedServiceTitle, setSelectedServiceTitle] =
|
|
4421
|
+
const styles = useStyles13();
|
|
4422
|
+
const [selectedServiceTitle, setSelectedServiceTitle] = React5.useState(
|
|
4022
4423
|
selectedService?.title || ""
|
|
4023
4424
|
);
|
|
4024
|
-
const [openItems, setOpenItems] =
|
|
4425
|
+
const [openItems, setOpenItems] = React5.useState(() => {
|
|
4025
4426
|
if (!selectedService) return void 0;
|
|
4026
4427
|
for (const item of serviceTypes) {
|
|
4027
4428
|
if (item.type === "accordion" && item.child.length > 0) {
|
|
@@ -4037,7 +4438,7 @@ var ModalTypeOfService = ({
|
|
|
4037
4438
|
});
|
|
4038
4439
|
const defaultRenderImage = ({ src, alt, width, height }) => /* @__PURE__ */ jsxRuntime.jsx("img", { src, alt, width, height, style: { objectFit: "contain" } });
|
|
4039
4440
|
const imageRenderer = renderImage || defaultRenderImage;
|
|
4040
|
-
|
|
4441
|
+
React5.useEffect(() => {
|
|
4041
4442
|
const newTitle = selectedService?.title || "";
|
|
4042
4443
|
if (newTitle !== selectedServiceTitle) {
|
|
4043
4444
|
setSelectedServiceTitle(newTitle);
|
|
@@ -4241,8 +4642,10 @@ exports.CardBanner = CardBanner;
|
|
|
4241
4642
|
exports.CardPromo = CardPromo;
|
|
4242
4643
|
exports.CardServiceMenu = CardServiceMenu;
|
|
4243
4644
|
exports.CardTicket = CardTicket;
|
|
4645
|
+
exports.CardTicketSearch = CardTicketSearch;
|
|
4646
|
+
exports.CardTicketSearchDefaultLabels = DEFAULT_LABELS;
|
|
4244
4647
|
exports.CarouselWithCustomNav = CarouselWithCustomNav;
|
|
4245
|
-
exports.DEFAULT_COUNTRY_CODES =
|
|
4648
|
+
exports.DEFAULT_COUNTRY_CODES = DEFAULT_COUNTRY_CODES;
|
|
4246
4649
|
exports.DEFAULT_SERVICE_CLASSES = DEFAULT_SERVICE_CLASSES;
|
|
4247
4650
|
exports.DEFAULT_VEHICLE_ICONS = DEFAULT_VEHICLE_ICONS;
|
|
4248
4651
|
exports.InputDynamic = InputDynamic_default;
|