@asdp/ferryui 0.1.22-dev.8578 → 0.1.22-dev.8630
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 +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +110 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -82
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -540,6 +540,7 @@ interface CardTicketSearchProps {
|
|
|
540
540
|
onSwitchClick?: () => void;
|
|
541
541
|
onRoundTripChange?: (value: boolean) => void;
|
|
542
542
|
onSubmit?: (data: CardTicketSearchFormData) => void;
|
|
543
|
+
onServiceClick?: (serviceId: ServiceId) => void;
|
|
543
544
|
/**
|
|
544
545
|
* Active service ID
|
|
545
546
|
* @default 'ferry'
|
|
@@ -1039,11 +1040,28 @@ interface ServiceClass {
|
|
|
1039
1040
|
*/
|
|
1040
1041
|
declare const DEFAULT_SERVICE_CLASSES: ServiceClass[];
|
|
1041
1042
|
|
|
1043
|
+
type PassengerTypeCode = "ADULT" | "CHILD" | "INFANT" | "ELDERLY";
|
|
1042
1044
|
/**
|
|
1043
1045
|
* Passenger object structure
|
|
1044
1046
|
*/
|
|
1045
1047
|
interface Passenger {
|
|
1046
|
-
|
|
1048
|
+
isOrderer?: boolean;
|
|
1049
|
+
isCompleted?: boolean;
|
|
1050
|
+
id?: number;
|
|
1051
|
+
title?: string;
|
|
1052
|
+
name: string;
|
|
1053
|
+
idType?: string;
|
|
1054
|
+
idNumber?: string;
|
|
1055
|
+
age?: number;
|
|
1056
|
+
date?: string;
|
|
1057
|
+
category?: PassengerTypeCode;
|
|
1058
|
+
ticketClass: PassengerServiceCode;
|
|
1059
|
+
cityId?: string;
|
|
1060
|
+
phoneNumber?: {
|
|
1061
|
+
countryCode: string;
|
|
1062
|
+
phoneNumber: string;
|
|
1063
|
+
};
|
|
1064
|
+
email?: string;
|
|
1047
1065
|
}
|
|
1048
1066
|
/**
|
|
1049
1067
|
* Service with passenger count
|
|
@@ -2550,4 +2568,4 @@ interface CardProfileMenuProps {
|
|
|
2550
2568
|
|
|
2551
2569
|
declare const CardProfileMenu: React$1.FC<CardProfileMenuProps>;
|
|
2552
2570
|
|
|
2553
|
-
export { BackgroundTicketCard, BackgroundTicketCardVertical, type BadgeConfig, CardAddon, type CardAddonProps, CardBanner, type CardBannerProps, CardBookingTicket, type CardBookingTicketProps, CardFAQ, type CardFAQProps, CardMealCatalog, type CardMealCatalogProps, CardOrdererInfo, type CardOrdererInfoProps, CardPassengerList, type CardPassengerListProps, CardPaymentGuide, type CardPaymentGuideProps, CardPaymentInfo, type CardPaymentInfoProps, CardPaymentMethodList, type CardPaymentMethodListProps, CardPriceDetails, type CardPriceDetailsProps, CardProfileMenu, type CardProfileMenuProps, CardPromo, type CardPromoProps, CardReview, CardReviewPassenger, type CardReviewPassengerProps, type CardReviewProps, CardServiceMenu, type CardServiceMenuProps, CardStatusOrder, type CardStatusOrderProps, CardTicket, type CardTicketProps, CardTicketSearch, DEFAULT_LABELS$3 as CardTicketSearchDefaultLabels, type CardTicketSearchFormData, type CardTicketSearchLabels, type CardTicketSearchProps, type ServiceMenuItem as CardTicketSearchServiceMenuItem, CardTicketSearchSummary, DEFAULT_LABELS$2 as CardTicketSearchSummaryDefaultLabels, type CardTicketSearchSummaryProps, CardVehicleDetail, type CardVehicleDetailProps, CardVehicleOwnerForm, type CardVehicleOwnerFormProps, type CargoItem, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS as DateFilterDefaultLabels, type DateFilterLabels, type DateFilterProps, type DateItem, type FilterCount, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalFilterTicket, DEFAULT_LABELS$1 as ModalFilterTicketDefaultLabels, type ModalFilterTicketLabels, type ModalFilterTicketProps, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, ModalListPassenger, type PassengerItem as ModalListPassengerItem, type ModalListPassengerProps, ModalPassengerForm, type ModalPassengerFormProps, type ModalPresetKey, ModalPriceDetail, type ModalPriceDetailProps, ModalSearchHarbor, type ModalSearchHarborProps, ModalSearchTicket, type ModalSearchTicketProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, ModalTypeOfService, type ModalTypeOfServiceProps, type OrdererInfo, type Passenger, type PassengerFormData, type PassengerListItem, type PassengerService, type PassengerServiceCode, type PassengerType, type PaymentStep, type PriceDetailItem, type ProfileMenuSection, type ProfileMenuTab, type RadioOption, type ReservationStep, type SearchSummaryField, type SearchTicketFormData, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceId, type ServiceItem, SortMenu, type SortMenuProps, type SortOption, type StepStatus, Stepper, type StepperProps, type StepperStep, type TabType, type TypeOfService, type VehicleOwner, getBadgeConfig, getModalPreset, getSortLabel };
|
|
2571
|
+
export { BackgroundTicketCard, BackgroundTicketCardVertical, type BadgeConfig, CardAddon, type CardAddonProps, CardBanner, type CardBannerProps, CardBookingTicket, type CardBookingTicketProps, CardFAQ, type CardFAQProps, CardMealCatalog, type CardMealCatalogProps, CardOrdererInfo, type CardOrdererInfoProps, CardPassengerList, type CardPassengerListProps, CardPaymentGuide, type CardPaymentGuideProps, CardPaymentInfo, type CardPaymentInfoProps, CardPaymentMethodList, type CardPaymentMethodListProps, CardPriceDetails, type CardPriceDetailsProps, CardProfileMenu, type CardProfileMenuProps, CardPromo, type CardPromoProps, CardReview, CardReviewPassenger, type CardReviewPassengerProps, type CardReviewProps, CardServiceMenu, type CardServiceMenuProps, CardStatusOrder, type CardStatusOrderProps, CardTicket, type CardTicketProps, CardTicketSearch, DEFAULT_LABELS$3 as CardTicketSearchDefaultLabels, type CardTicketSearchFormData, type CardTicketSearchLabels, type CardTicketSearchProps, type ServiceMenuItem as CardTicketSearchServiceMenuItem, CardTicketSearchSummary, DEFAULT_LABELS$2 as CardTicketSearchSummaryDefaultLabels, type CardTicketSearchSummaryProps, CardVehicleDetail, type CardVehicleDetailProps, CardVehicleOwnerForm, type CardVehicleOwnerFormProps, type CargoItem, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS as DateFilterDefaultLabels, type DateFilterLabels, type DateFilterProps, type DateItem, type FilterCount, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, type MealCategory, type MealItem, ModalFilterTicket, DEFAULT_LABELS$1 as ModalFilterTicketDefaultLabels, type ModalFilterTicketLabels, type ModalFilterTicketProps, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, ModalListPassenger, type PassengerItem as ModalListPassengerItem, type ModalListPassengerProps, ModalPassengerForm, type ModalPassengerFormProps, type ModalPresetKey, ModalPriceDetail, type ModalPriceDetailProps, ModalSearchHarbor, type ModalSearchHarborProps, ModalSearchTicket, type ModalSearchTicketProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, ModalTypeOfService, type ModalTypeOfServiceProps, type OrdererInfo, type Passenger, type PassengerFormData, type PassengerListItem, type PassengerService, type PassengerServiceCode, type PassengerType, type PaymentGuideStep, type PaymentMethodCategory, type PaymentStep, type PriceDetailItem, type ProfileMenuSection, type ProfileMenuTab, type RadioOption, type ReservationStep, type ReviewPassengerItem, type SearchSummaryField, type SearchTicketFormData, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceId, type ServiceItem, SortMenu, type SortMenuProps, type SortOption, type StepStatus, Stepper, type StepperProps, type StepperStep, type TabType, type TypeOfService, type VehicleOwner, getBadgeConfig, getModalPreset, getSortLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -540,6 +540,7 @@ interface CardTicketSearchProps {
|
|
|
540
540
|
onSwitchClick?: () => void;
|
|
541
541
|
onRoundTripChange?: (value: boolean) => void;
|
|
542
542
|
onSubmit?: (data: CardTicketSearchFormData) => void;
|
|
543
|
+
onServiceClick?: (serviceId: ServiceId) => void;
|
|
543
544
|
/**
|
|
544
545
|
* Active service ID
|
|
545
546
|
* @default 'ferry'
|
|
@@ -1039,11 +1040,28 @@ interface ServiceClass {
|
|
|
1039
1040
|
*/
|
|
1040
1041
|
declare const DEFAULT_SERVICE_CLASSES: ServiceClass[];
|
|
1041
1042
|
|
|
1043
|
+
type PassengerTypeCode = "ADULT" | "CHILD" | "INFANT" | "ELDERLY";
|
|
1042
1044
|
/**
|
|
1043
1045
|
* Passenger object structure
|
|
1044
1046
|
*/
|
|
1045
1047
|
interface Passenger {
|
|
1046
|
-
|
|
1048
|
+
isOrderer?: boolean;
|
|
1049
|
+
isCompleted?: boolean;
|
|
1050
|
+
id?: number;
|
|
1051
|
+
title?: string;
|
|
1052
|
+
name: string;
|
|
1053
|
+
idType?: string;
|
|
1054
|
+
idNumber?: string;
|
|
1055
|
+
age?: number;
|
|
1056
|
+
date?: string;
|
|
1057
|
+
category?: PassengerTypeCode;
|
|
1058
|
+
ticketClass: PassengerServiceCode;
|
|
1059
|
+
cityId?: string;
|
|
1060
|
+
phoneNumber?: {
|
|
1061
|
+
countryCode: string;
|
|
1062
|
+
phoneNumber: string;
|
|
1063
|
+
};
|
|
1064
|
+
email?: string;
|
|
1047
1065
|
}
|
|
1048
1066
|
/**
|
|
1049
1067
|
* Service with passenger count
|
|
@@ -2550,4 +2568,4 @@ interface CardProfileMenuProps {
|
|
|
2550
2568
|
|
|
2551
2569
|
declare const CardProfileMenu: React$1.FC<CardProfileMenuProps>;
|
|
2552
2570
|
|
|
2553
|
-
export { BackgroundTicketCard, BackgroundTicketCardVertical, type BadgeConfig, CardAddon, type CardAddonProps, CardBanner, type CardBannerProps, CardBookingTicket, type CardBookingTicketProps, CardFAQ, type CardFAQProps, CardMealCatalog, type CardMealCatalogProps, CardOrdererInfo, type CardOrdererInfoProps, CardPassengerList, type CardPassengerListProps, CardPaymentGuide, type CardPaymentGuideProps, CardPaymentInfo, type CardPaymentInfoProps, CardPaymentMethodList, type CardPaymentMethodListProps, CardPriceDetails, type CardPriceDetailsProps, CardProfileMenu, type CardProfileMenuProps, CardPromo, type CardPromoProps, CardReview, CardReviewPassenger, type CardReviewPassengerProps, type CardReviewProps, CardServiceMenu, type CardServiceMenuProps, CardStatusOrder, type CardStatusOrderProps, CardTicket, type CardTicketProps, CardTicketSearch, DEFAULT_LABELS$3 as CardTicketSearchDefaultLabels, type CardTicketSearchFormData, type CardTicketSearchLabels, type CardTicketSearchProps, type ServiceMenuItem as CardTicketSearchServiceMenuItem, CardTicketSearchSummary, DEFAULT_LABELS$2 as CardTicketSearchSummaryDefaultLabels, type CardTicketSearchSummaryProps, CardVehicleDetail, type CardVehicleDetailProps, CardVehicleOwnerForm, type CardVehicleOwnerFormProps, type CargoItem, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS as DateFilterDefaultLabels, type DateFilterLabels, type DateFilterProps, type DateItem, type FilterCount, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, ModalFilterTicket, DEFAULT_LABELS$1 as ModalFilterTicketDefaultLabels, type ModalFilterTicketLabels, type ModalFilterTicketProps, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, ModalListPassenger, type PassengerItem as ModalListPassengerItem, type ModalListPassengerProps, ModalPassengerForm, type ModalPassengerFormProps, type ModalPresetKey, ModalPriceDetail, type ModalPriceDetailProps, ModalSearchHarbor, type ModalSearchHarborProps, ModalSearchTicket, type ModalSearchTicketProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, ModalTypeOfService, type ModalTypeOfServiceProps, type OrdererInfo, type Passenger, type PassengerFormData, type PassengerListItem, type PassengerService, type PassengerServiceCode, type PassengerType, type PaymentStep, type PriceDetailItem, type ProfileMenuSection, type ProfileMenuTab, type RadioOption, type ReservationStep, type SearchSummaryField, type SearchTicketFormData, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceId, type ServiceItem, SortMenu, type SortMenuProps, type SortOption, type StepStatus, Stepper, type StepperProps, type StepperStep, type TabType, type TypeOfService, type VehicleOwner, getBadgeConfig, getModalPreset, getSortLabel };
|
|
2571
|
+
export { BackgroundTicketCard, BackgroundTicketCardVertical, type BadgeConfig, CardAddon, type CardAddonProps, CardBanner, type CardBannerProps, CardBookingTicket, type CardBookingTicketProps, CardFAQ, type CardFAQProps, CardMealCatalog, type CardMealCatalogProps, CardOrdererInfo, type CardOrdererInfoProps, CardPassengerList, type CardPassengerListProps, CardPaymentGuide, type CardPaymentGuideProps, CardPaymentInfo, type CardPaymentInfoProps, CardPaymentMethodList, type CardPaymentMethodListProps, CardPriceDetails, type CardPriceDetailsProps, CardProfileMenu, type CardProfileMenuProps, CardPromo, type CardPromoProps, CardReview, CardReviewPassenger, type CardReviewPassengerProps, type CardReviewProps, CardServiceMenu, type CardServiceMenuProps, CardStatusOrder, type CardStatusOrderProps, CardTicket, type CardTicketProps, CardTicketSearch, DEFAULT_LABELS$3 as CardTicketSearchDefaultLabels, type CardTicketSearchFormData, type CardTicketSearchLabels, type CardTicketSearchProps, type ServiceMenuItem as CardTicketSearchServiceMenuItem, CardTicketSearchSummary, DEFAULT_LABELS$2 as CardTicketSearchSummaryDefaultLabels, type CardTicketSearchSummaryProps, CardVehicleDetail, type CardVehicleDetailProps, CardVehicleOwnerForm, type CardVehicleOwnerFormProps, type CargoItem, CarouselWithCustomNav, type CarouselWithCustomNavProps, type CountryCode, DEFAULT_COUNTRY_CODES, DEFAULT_DURATION_RANGE, DEFAULT_PRICE_RANGE, DEFAULT_SCROLL_AMOUNT, DEFAULT_SERVICE_CLASSES, DEFAULT_SERVICE_TYPES, DEFAULT_SORT_OPTIONS, DEFAULT_TIME_SLOTS, DEFAULT_VEHICLE_ICONS, DateFilter, DEFAULT_LABELS as DateFilterDefaultLabels, type DateFilterLabels, type DateFilterProps, type DateItem, type FilterCount, type HarborItem, InputDynamic, type InputDynamicProps, type InputType, MODAL_PRESETS, type MealCategory, type MealItem, ModalFilterTicket, DEFAULT_LABELS$1 as ModalFilterTicketDefaultLabels, type ModalFilterTicketLabels, type ModalFilterTicketProps, ModalIllustration, type ModalIllustrationButton, type ModalIllustrationProps, ModalListPassenger, type PassengerItem as ModalListPassengerItem, type ModalListPassengerProps, ModalPassengerForm, type ModalPassengerFormProps, type ModalPresetKey, ModalPriceDetail, type ModalPriceDetailProps, ModalSearchHarbor, type ModalSearchHarborProps, ModalSearchTicket, type ModalSearchTicketProps, ModalSelectDate, type ModalSelectDateProps, ModalService, type ModalServiceProps, ModalTotalPassengers, type ModalTotalPassengersProps, ModalTypeOfService, type ModalTypeOfServiceProps, type OrdererInfo, type Passenger, type PassengerFormData, type PassengerListItem, type PassengerService, type PassengerServiceCode, type PassengerType, type PaymentGuideStep, type PaymentMethodCategory, type PaymentStep, type PriceDetailItem, type ProfileMenuSection, type ProfileMenuTab, type RadioOption, type ReservationStep, type ReviewPassengerItem, type SearchSummaryField, type SearchTicketFormData, type SelectOption, type SelectedPassengerItem, type ServiceClass, type ServiceId, type ServiceItem, SortMenu, type SortMenuProps, type SortOption, type StepStatus, Stepper, type StepperProps, type StepperStep, type TabType, type TypeOfService, type VehicleOwner, getBadgeConfig, getModalPreset, getSortLabel };
|
package/dist/index.js
CHANGED
|
@@ -3066,7 +3066,8 @@ var CardTicketSearch = ({
|
|
|
3066
3066
|
className,
|
|
3067
3067
|
isRotating = false,
|
|
3068
3068
|
showPassengerField = false,
|
|
3069
|
-
showRoundTrip = true
|
|
3069
|
+
showRoundTrip = true,
|
|
3070
|
+
onServiceClick
|
|
3070
3071
|
}) => {
|
|
3071
3072
|
const styles = useStyles7();
|
|
3072
3073
|
const labels = React5__default.default.useMemo(
|
|
@@ -3149,7 +3150,8 @@ var CardTicketSearch = ({
|
|
|
3149
3150
|
{
|
|
3150
3151
|
className: styles.serviceMenuCard,
|
|
3151
3152
|
activeServiceId,
|
|
3152
|
-
language
|
|
3153
|
+
language,
|
|
3154
|
+
onServiceClick
|
|
3153
3155
|
}
|
|
3154
3156
|
)
|
|
3155
3157
|
}
|
|
@@ -4716,17 +4718,19 @@ var ModalTotalPassengers = ({
|
|
|
4716
4718
|
const defaultInfoMessage = `Anda dapat menambahkan hingga ${maxPassengers} penumpang pada golongan kendaraan ini.`;
|
|
4717
4719
|
React5.useEffect(() => {
|
|
4718
4720
|
if (passengerTypes.length === 0) return;
|
|
4719
|
-
const defaultPassengers = passengerTypes.map(
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4721
|
+
const defaultPassengers = passengerTypes.map(
|
|
4722
|
+
(passengerType) => ({
|
|
4723
|
+
passengerTypeId: passengerType.id,
|
|
4724
|
+
passengerTypeCode: passengerType.passengerTypeCode,
|
|
4725
|
+
passengerTypeName: passengerType.passengerTypeName,
|
|
4726
|
+
services: serviceClasses.map((sc) => ({
|
|
4727
|
+
serviceId: sc.id,
|
|
4728
|
+
serviceName: sc.serviceName,
|
|
4729
|
+
count: 0,
|
|
4730
|
+
passengers: []
|
|
4731
|
+
}))
|
|
4732
|
+
})
|
|
4733
|
+
);
|
|
4730
4734
|
if (selectedPassengers && selectedPassengers.length > 0) {
|
|
4731
4735
|
const mergedPassengers = defaultPassengers.map((defaultP) => {
|
|
4732
4736
|
const selectedP = selectedPassengers.find(
|
|
@@ -4734,8 +4738,14 @@ var ModalTotalPassengers = ({
|
|
|
4734
4738
|
);
|
|
4735
4739
|
if (selectedP) {
|
|
4736
4740
|
const mergedServices = defaultP.services.map((defaultS) => {
|
|
4737
|
-
const selectedS = selectedP.services.find(
|
|
4738
|
-
|
|
4741
|
+
const selectedS = selectedP.services.find(
|
|
4742
|
+
(s) => s.serviceName === defaultS.serviceName
|
|
4743
|
+
);
|
|
4744
|
+
return selectedS ? {
|
|
4745
|
+
...defaultS,
|
|
4746
|
+
count: selectedS.count,
|
|
4747
|
+
passengers: selectedS.passengers || []
|
|
4748
|
+
} : defaultS;
|
|
4739
4749
|
});
|
|
4740
4750
|
return { ...defaultP, services: mergedServices };
|
|
4741
4751
|
}
|
|
@@ -4755,18 +4765,26 @@ var ModalTotalPassengers = ({
|
|
|
4755
4765
|
}
|
|
4756
4766
|
}, [open, passengerTypes, serviceClasses, selectedPassengers]);
|
|
4757
4767
|
const getServiceCount = (passengerTypeCode, serviceName) => {
|
|
4758
|
-
const passenger = passengers.find(
|
|
4768
|
+
const passenger = passengers.find(
|
|
4769
|
+
(p) => p.passengerTypeCode === passengerTypeCode
|
|
4770
|
+
);
|
|
4759
4771
|
if (!passenger) return 0;
|
|
4760
|
-
const service = passenger.services.find(
|
|
4772
|
+
const service = passenger.services.find(
|
|
4773
|
+
(s) => s.serviceName === serviceName
|
|
4774
|
+
);
|
|
4761
4775
|
return service?.count || 0;
|
|
4762
4776
|
};
|
|
4763
4777
|
const getTotalForType = (passengerTypeCode) => {
|
|
4764
|
-
const passenger = passengers.find(
|
|
4778
|
+
const passenger = passengers.find(
|
|
4779
|
+
(p) => p.passengerTypeCode === passengerTypeCode
|
|
4780
|
+
);
|
|
4765
4781
|
if (!passenger) return "0";
|
|
4766
4782
|
const parts = [];
|
|
4767
4783
|
passenger.services.forEach((service) => {
|
|
4768
4784
|
if (service.count > 0) {
|
|
4769
|
-
const serviceClass = serviceClasses.find(
|
|
4785
|
+
const serviceClass = serviceClasses.find(
|
|
4786
|
+
(sc) => sc.serviceName === service.serviceName
|
|
4787
|
+
);
|
|
4770
4788
|
const serviceName = serviceClass?.name || service.serviceName;
|
|
4771
4789
|
parts.push(`${service.count} ${serviceName}`);
|
|
4772
4790
|
}
|
|
@@ -4809,7 +4827,10 @@ var ModalTotalPassengers = ({
|
|
|
4809
4827
|
services: passenger.services.map((service) => {
|
|
4810
4828
|
if (service.serviceName === serviceName && service.count > 0) {
|
|
4811
4829
|
const newCount = service.count - 1;
|
|
4812
|
-
const newPassengers = (service.passengers || []).slice(
|
|
4830
|
+
const newPassengers = (service.passengers || []).slice(
|
|
4831
|
+
0,
|
|
4832
|
+
newCount
|
|
4833
|
+
);
|
|
4813
4834
|
return {
|
|
4814
4835
|
...service,
|
|
4815
4836
|
count: newCount,
|
|
@@ -4831,52 +4852,58 @@ var ModalTotalPassengers = ({
|
|
|
4831
4852
|
})).filter((passenger) => passenger.services.length > 0);
|
|
4832
4853
|
onSave(filteredPassengers);
|
|
4833
4854
|
};
|
|
4834
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4841
|
-
reactComponents.DialogTitle,
|
|
4855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Dialog, { open, onOpenChange: (_, data) => !data.open && onClose(), children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.DialogSurface, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogBody, { children: [
|
|
4856
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4857
|
+
reactComponents.DialogTitle,
|
|
4858
|
+
{
|
|
4859
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4860
|
+
reactComponents.Button,
|
|
4842
4861
|
{
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
"aria-label": "close",
|
|
4848
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:dismiss-12-regular" }),
|
|
4849
|
-
onClick: onClose
|
|
4850
|
-
}
|
|
4851
|
-
),
|
|
4852
|
-
children: title
|
|
4862
|
+
appearance: "subtle",
|
|
4863
|
+
"aria-label": "close",
|
|
4864
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:dismiss-12-regular" }),
|
|
4865
|
+
onClick: onClose
|
|
4853
4866
|
}
|
|
4854
4867
|
),
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4868
|
+
children: title
|
|
4869
|
+
}
|
|
4870
|
+
),
|
|
4871
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactComponents.DialogContent, { children: [
|
|
4872
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.MessageBar, { shape: "rounded", children: /* @__PURE__ */ jsxRuntime.jsx(reactComponents.MessageBarBody, { children: infoMessage || defaultInfoMessage }) }),
|
|
4873
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { children: "Loading..." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4874
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4875
|
+
reactComponents.Accordion,
|
|
4876
|
+
{
|
|
4877
|
+
collapsible: true,
|
|
4878
|
+
multiple: true,
|
|
4879
|
+
openItems,
|
|
4880
|
+
onToggle: (_, data) => setOpenItems(data.openItems),
|
|
4881
|
+
className: styles.passengerSection,
|
|
4882
|
+
children: passengerTypes.map((passengerType) => {
|
|
4883
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4884
|
+
reactComponents.AccordionItem,
|
|
4885
|
+
{
|
|
4886
|
+
value: String(passengerType.id),
|
|
4887
|
+
className: styles.accordionItem,
|
|
4888
|
+
children: [
|
|
4889
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4890
|
+
reactComponents.AccordionHeader,
|
|
4891
|
+
{
|
|
4892
|
+
className: styles.accordionHeader,
|
|
4893
|
+
expandIconPosition: "end",
|
|
4894
|
+
children: [
|
|
4874
4895
|
passengerType.passengerTypeName,
|
|
4875
4896
|
" (",
|
|
4876
4897
|
getTotalForType(passengerType.passengerTypeCode),
|
|
4877
4898
|
")"
|
|
4878
|
-
]
|
|
4879
|
-
|
|
4899
|
+
]
|
|
4900
|
+
}
|
|
4901
|
+
),
|
|
4902
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.AccordionPanel, { className: styles.accordionPanel, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.nestedSection, children: serviceClasses.map((service) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4903
|
+
"div",
|
|
4904
|
+
{
|
|
4905
|
+
className: styles.nestedRow,
|
|
4906
|
+
children: [
|
|
4880
4907
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { children: service.name }),
|
|
4881
4908
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.passengerCount, children: [
|
|
4882
4909
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4920,29 +4947,30 @@ var ModalTotalPassengers = ({
|
|
|
4920
4947
|
}
|
|
4921
4948
|
)
|
|
4922
4949
|
] })
|
|
4923
|
-
]
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
}
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4950
|
+
]
|
|
4951
|
+
},
|
|
4952
|
+
service.key
|
|
4953
|
+
)) }) })
|
|
4954
|
+
]
|
|
4955
|
+
},
|
|
4956
|
+
passengerType.id
|
|
4957
|
+
);
|
|
4958
|
+
})
|
|
4959
|
+
}
|
|
4960
|
+
),
|
|
4961
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4962
|
+
reactComponents.Button,
|
|
4963
|
+
{
|
|
4964
|
+
appearance: "primary",
|
|
4965
|
+
size: "medium",
|
|
4966
|
+
className: styles.submitButton,
|
|
4967
|
+
onClick: handleSave,
|
|
4968
|
+
children: "Simpan"
|
|
4969
|
+
}
|
|
4970
|
+
)
|
|
4971
|
+
] })
|
|
4972
|
+
] })
|
|
4973
|
+
] }) }) });
|
|
4946
4974
|
};
|
|
4947
4975
|
var useStyles13 = reactComponents.makeStyles({
|
|
4948
4976
|
dialogSurface: {
|