@asdp/ferryui 0.1.22-dev.9700 → 0.1.22-dev.9701
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 +48 -11
- package/dist/index.d.ts +48 -11
- package/dist/index.js +68 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -147,6 +147,34 @@ declare const PRESET_CONTENT: {
|
|
|
147
147
|
readonly imageAlt: "Transaction Limit Illustration";
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
|
+
readonly UNAUTHENTICATED: {
|
|
151
|
+
readonly id: {
|
|
152
|
+
readonly title: "Masuk untuk melanjutkan pemesanan";
|
|
153
|
+
readonly message: "Untuk memesan tiket dan mengisi manifest penumpang, Anda perlu masuk terlebih dahulu. Pilihan jadwal Anda akan tetap tersimpan.";
|
|
154
|
+
readonly imageSrc: "/assets/images/illustrations/auth.svg";
|
|
155
|
+
readonly imageAlt: "Unauthenticated Illustration";
|
|
156
|
+
};
|
|
157
|
+
readonly en: {
|
|
158
|
+
readonly title: "Sign in to continue booking";
|
|
159
|
+
readonly message: "To book tickets and fill in the passenger manifest, you need to sign in first. Your schedule selection will be saved.";
|
|
160
|
+
readonly imageSrc: "/assets/images/illustrations/auth.svg";
|
|
161
|
+
readonly imageAlt: "Unauthenticated Illustration";
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly PROFILE_NOT_COMPLETE: {
|
|
165
|
+
readonly id: {
|
|
166
|
+
readonly title: "Profil Belum Lengkap";
|
|
167
|
+
readonly message: "Untuk melanjutkan pemesanan tiket, kami memerlukan data profil yang lengkap sesuai ketentuan ASDP. Lengkapi profil Anda terlebih dahulu agar dapat melanjutkan ke pengisian manifest.";
|
|
168
|
+
readonly imageSrc: "/assets/images/illustrations/profile.svg";
|
|
169
|
+
readonly imageAlt: "Profile Not Complete Illustration";
|
|
170
|
+
};
|
|
171
|
+
readonly en: {
|
|
172
|
+
readonly title: "Profile Not Complete";
|
|
173
|
+
readonly message: "To continue booking tickets, we need complete profile data according to ASDP provisions. Please complete your profile first to proceed to manifest filling.";
|
|
174
|
+
readonly imageSrc: "/assets/images/illustrations/profile.svg";
|
|
175
|
+
readonly imageAlt: "Profile Not Complete Illustration";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
150
178
|
};
|
|
151
179
|
|
|
152
180
|
/**
|
|
@@ -166,6 +194,8 @@ declare const MODAL_PRESETS: {
|
|
|
166
194
|
readonly SESSION_EXPIRED: Partial<ModalIllustrationProps>;
|
|
167
195
|
readonly PURCHASE_PERIOD_EXPIRED: Partial<ModalIllustrationProps>;
|
|
168
196
|
readonly TRANSACTION_LIMIT: Partial<ModalIllustrationProps>;
|
|
197
|
+
readonly UNAUTHENTICATED: Partial<ModalIllustrationProps>;
|
|
198
|
+
readonly PROFILE_NOT_COMPLETE: Partial<ModalIllustrationProps>;
|
|
169
199
|
};
|
|
170
200
|
|
|
171
201
|
interface CarouselWithCustomNavLabels {
|
|
@@ -403,6 +433,7 @@ interface CardTicketLabels {
|
|
|
403
433
|
timezoneLabel: string;
|
|
404
434
|
currencySymbol: string;
|
|
405
435
|
logoAlt: string;
|
|
436
|
+
verifyingTicketButton: string;
|
|
406
437
|
}
|
|
407
438
|
interface CardTicketProps {
|
|
408
439
|
/**
|
|
@@ -439,6 +470,7 @@ interface CardTicketProps {
|
|
|
439
470
|
*/
|
|
440
471
|
onSelectTicket?: () => void;
|
|
441
472
|
isLoading?: boolean;
|
|
473
|
+
isVerifyingTicket?: boolean;
|
|
442
474
|
}
|
|
443
475
|
interface DepartureItem {
|
|
444
476
|
departureDay: string;
|
|
@@ -1900,8 +1932,10 @@ declare const DEFAULT_VEHICLE_ICONS: {
|
|
|
1900
1932
|
};
|
|
1901
1933
|
|
|
1902
1934
|
interface SortOption {
|
|
1903
|
-
value: string;
|
|
1904
1935
|
label: string;
|
|
1936
|
+
value: string;
|
|
1937
|
+
sortBy: string;
|
|
1938
|
+
sortDir: string;
|
|
1905
1939
|
}
|
|
1906
1940
|
interface FilterCount {
|
|
1907
1941
|
typeService?: number;
|
|
@@ -1936,9 +1970,9 @@ interface SortMenuProps {
|
|
|
1936
1970
|
*/
|
|
1937
1971
|
value: string;
|
|
1938
1972
|
/**
|
|
1939
|
-
* Callback when sort value changes
|
|
1973
|
+
* Callback when sort value changes — receives full SortOption object
|
|
1940
1974
|
*/
|
|
1941
|
-
onChange: (
|
|
1975
|
+
onChange: (option: SortOption) => void;
|
|
1942
1976
|
/**
|
|
1943
1977
|
* Total active filter categories
|
|
1944
1978
|
* @default 0
|
|
@@ -1982,10 +2016,7 @@ declare const SortMenu: React$1.FC<SortMenuProps>;
|
|
|
1982
2016
|
/**
|
|
1983
2017
|
* @deprecated Use getSortOptions and find the label from there
|
|
1984
2018
|
*/
|
|
1985
|
-
declare const DEFAULT_SORT_OPTIONS:
|
|
1986
|
-
value: string;
|
|
1987
|
-
label: string;
|
|
1988
|
-
}[];
|
|
2019
|
+
declare const DEFAULT_SORT_OPTIONS: SortOption[];
|
|
1989
2020
|
/**
|
|
1990
2021
|
* @deprecated Use labels directly
|
|
1991
2022
|
*/
|
|
@@ -2006,13 +2037,19 @@ interface ModalFilterTicketProps {
|
|
|
2006
2037
|
*/
|
|
2007
2038
|
onOpenChange: (open: boolean) => void;
|
|
2008
2039
|
/**
|
|
2009
|
-
* Selected service types
|
|
2040
|
+
* Selected service types as objects with id and label
|
|
2010
2041
|
*/
|
|
2011
|
-
selectedServiceTypes:
|
|
2042
|
+
selectedServiceTypes: Array<{
|
|
2043
|
+
id: number;
|
|
2044
|
+
label: string;
|
|
2045
|
+
}>;
|
|
2012
2046
|
/**
|
|
2013
2047
|
* Callback when service types change
|
|
2014
2048
|
*/
|
|
2015
|
-
onServiceTypesChange: (serviceTypes:
|
|
2049
|
+
onServiceTypesChange: (serviceTypes: Array<{
|
|
2050
|
+
id: number;
|
|
2051
|
+
label: string;
|
|
2052
|
+
}>) => void;
|
|
2016
2053
|
/**
|
|
2017
2054
|
* Selected departure time slots
|
|
2018
2055
|
*/
|
|
@@ -2061,7 +2098,7 @@ interface ModalFilterTicketProps {
|
|
|
2061
2098
|
* Service types list (from API data)
|
|
2062
2099
|
*/
|
|
2063
2100
|
serviceTypes?: Array<{
|
|
2064
|
-
value:
|
|
2101
|
+
value: number;
|
|
2065
2102
|
label: string;
|
|
2066
2103
|
}>;
|
|
2067
2104
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,34 @@ declare const PRESET_CONTENT: {
|
|
|
147
147
|
readonly imageAlt: "Transaction Limit Illustration";
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
|
+
readonly UNAUTHENTICATED: {
|
|
151
|
+
readonly id: {
|
|
152
|
+
readonly title: "Masuk untuk melanjutkan pemesanan";
|
|
153
|
+
readonly message: "Untuk memesan tiket dan mengisi manifest penumpang, Anda perlu masuk terlebih dahulu. Pilihan jadwal Anda akan tetap tersimpan.";
|
|
154
|
+
readonly imageSrc: "/assets/images/illustrations/auth.svg";
|
|
155
|
+
readonly imageAlt: "Unauthenticated Illustration";
|
|
156
|
+
};
|
|
157
|
+
readonly en: {
|
|
158
|
+
readonly title: "Sign in to continue booking";
|
|
159
|
+
readonly message: "To book tickets and fill in the passenger manifest, you need to sign in first. Your schedule selection will be saved.";
|
|
160
|
+
readonly imageSrc: "/assets/images/illustrations/auth.svg";
|
|
161
|
+
readonly imageAlt: "Unauthenticated Illustration";
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly PROFILE_NOT_COMPLETE: {
|
|
165
|
+
readonly id: {
|
|
166
|
+
readonly title: "Profil Belum Lengkap";
|
|
167
|
+
readonly message: "Untuk melanjutkan pemesanan tiket, kami memerlukan data profil yang lengkap sesuai ketentuan ASDP. Lengkapi profil Anda terlebih dahulu agar dapat melanjutkan ke pengisian manifest.";
|
|
168
|
+
readonly imageSrc: "/assets/images/illustrations/profile.svg";
|
|
169
|
+
readonly imageAlt: "Profile Not Complete Illustration";
|
|
170
|
+
};
|
|
171
|
+
readonly en: {
|
|
172
|
+
readonly title: "Profile Not Complete";
|
|
173
|
+
readonly message: "To continue booking tickets, we need complete profile data according to ASDP provisions. Please complete your profile first to proceed to manifest filling.";
|
|
174
|
+
readonly imageSrc: "/assets/images/illustrations/profile.svg";
|
|
175
|
+
readonly imageAlt: "Profile Not Complete Illustration";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
150
178
|
};
|
|
151
179
|
|
|
152
180
|
/**
|
|
@@ -166,6 +194,8 @@ declare const MODAL_PRESETS: {
|
|
|
166
194
|
readonly SESSION_EXPIRED: Partial<ModalIllustrationProps>;
|
|
167
195
|
readonly PURCHASE_PERIOD_EXPIRED: Partial<ModalIllustrationProps>;
|
|
168
196
|
readonly TRANSACTION_LIMIT: Partial<ModalIllustrationProps>;
|
|
197
|
+
readonly UNAUTHENTICATED: Partial<ModalIllustrationProps>;
|
|
198
|
+
readonly PROFILE_NOT_COMPLETE: Partial<ModalIllustrationProps>;
|
|
169
199
|
};
|
|
170
200
|
|
|
171
201
|
interface CarouselWithCustomNavLabels {
|
|
@@ -403,6 +433,7 @@ interface CardTicketLabels {
|
|
|
403
433
|
timezoneLabel: string;
|
|
404
434
|
currencySymbol: string;
|
|
405
435
|
logoAlt: string;
|
|
436
|
+
verifyingTicketButton: string;
|
|
406
437
|
}
|
|
407
438
|
interface CardTicketProps {
|
|
408
439
|
/**
|
|
@@ -439,6 +470,7 @@ interface CardTicketProps {
|
|
|
439
470
|
*/
|
|
440
471
|
onSelectTicket?: () => void;
|
|
441
472
|
isLoading?: boolean;
|
|
473
|
+
isVerifyingTicket?: boolean;
|
|
442
474
|
}
|
|
443
475
|
interface DepartureItem {
|
|
444
476
|
departureDay: string;
|
|
@@ -1900,8 +1932,10 @@ declare const DEFAULT_VEHICLE_ICONS: {
|
|
|
1900
1932
|
};
|
|
1901
1933
|
|
|
1902
1934
|
interface SortOption {
|
|
1903
|
-
value: string;
|
|
1904
1935
|
label: string;
|
|
1936
|
+
value: string;
|
|
1937
|
+
sortBy: string;
|
|
1938
|
+
sortDir: string;
|
|
1905
1939
|
}
|
|
1906
1940
|
interface FilterCount {
|
|
1907
1941
|
typeService?: number;
|
|
@@ -1936,9 +1970,9 @@ interface SortMenuProps {
|
|
|
1936
1970
|
*/
|
|
1937
1971
|
value: string;
|
|
1938
1972
|
/**
|
|
1939
|
-
* Callback when sort value changes
|
|
1973
|
+
* Callback when sort value changes — receives full SortOption object
|
|
1940
1974
|
*/
|
|
1941
|
-
onChange: (
|
|
1975
|
+
onChange: (option: SortOption) => void;
|
|
1942
1976
|
/**
|
|
1943
1977
|
* Total active filter categories
|
|
1944
1978
|
* @default 0
|
|
@@ -1982,10 +2016,7 @@ declare const SortMenu: React$1.FC<SortMenuProps>;
|
|
|
1982
2016
|
/**
|
|
1983
2017
|
* @deprecated Use getSortOptions and find the label from there
|
|
1984
2018
|
*/
|
|
1985
|
-
declare const DEFAULT_SORT_OPTIONS:
|
|
1986
|
-
value: string;
|
|
1987
|
-
label: string;
|
|
1988
|
-
}[];
|
|
2019
|
+
declare const DEFAULT_SORT_OPTIONS: SortOption[];
|
|
1989
2020
|
/**
|
|
1990
2021
|
* @deprecated Use labels directly
|
|
1991
2022
|
*/
|
|
@@ -2006,13 +2037,19 @@ interface ModalFilterTicketProps {
|
|
|
2006
2037
|
*/
|
|
2007
2038
|
onOpenChange: (open: boolean) => void;
|
|
2008
2039
|
/**
|
|
2009
|
-
* Selected service types
|
|
2040
|
+
* Selected service types as objects with id and label
|
|
2010
2041
|
*/
|
|
2011
|
-
selectedServiceTypes:
|
|
2042
|
+
selectedServiceTypes: Array<{
|
|
2043
|
+
id: number;
|
|
2044
|
+
label: string;
|
|
2045
|
+
}>;
|
|
2012
2046
|
/**
|
|
2013
2047
|
* Callback when service types change
|
|
2014
2048
|
*/
|
|
2015
|
-
onServiceTypesChange: (serviceTypes:
|
|
2049
|
+
onServiceTypesChange: (serviceTypes: Array<{
|
|
2050
|
+
id: number;
|
|
2051
|
+
label: string;
|
|
2052
|
+
}>) => void;
|
|
2016
2053
|
/**
|
|
2017
2054
|
* Selected departure time slots
|
|
2018
2055
|
*/
|
|
@@ -2061,7 +2098,7 @@ interface ModalFilterTicketProps {
|
|
|
2061
2098
|
* Service types list (from API data)
|
|
2062
2099
|
*/
|
|
2063
2100
|
serviceTypes?: Array<{
|
|
2064
|
-
value:
|
|
2101
|
+
value: number;
|
|
2065
2102
|
label: string;
|
|
2066
2103
|
}>;
|
|
2067
2104
|
/**
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,34 @@ var PRESET_CONTENT = {
|
|
|
89
89
|
imageSrc: "/assets/images/illustrations/mobile-pay.svg",
|
|
90
90
|
imageAlt: "Transaction Limit Illustration"
|
|
91
91
|
}
|
|
92
|
+
},
|
|
93
|
+
UNAUTHENTICATED: {
|
|
94
|
+
id: {
|
|
95
|
+
title: "Masuk untuk melanjutkan pemesanan",
|
|
96
|
+
message: "Untuk memesan tiket dan mengisi manifest penumpang, Anda perlu masuk terlebih dahulu. Pilihan jadwal Anda akan tetap tersimpan.",
|
|
97
|
+
imageSrc: "/assets/images/illustrations/auth.svg",
|
|
98
|
+
imageAlt: "Unauthenticated Illustration"
|
|
99
|
+
},
|
|
100
|
+
en: {
|
|
101
|
+
title: "Sign in to continue booking",
|
|
102
|
+
message: "To book tickets and fill in the passenger manifest, you need to sign in first. Your schedule selection will be saved.",
|
|
103
|
+
imageSrc: "/assets/images/illustrations/auth.svg",
|
|
104
|
+
imageAlt: "Unauthenticated Illustration"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
PROFILE_NOT_COMPLETE: {
|
|
108
|
+
id: {
|
|
109
|
+
title: "Profil Belum Lengkap",
|
|
110
|
+
message: "Untuk melanjutkan pemesanan tiket, kami memerlukan data profil yang lengkap sesuai ketentuan ASDP. Lengkapi profil Anda terlebih dahulu agar dapat melanjutkan ke pengisian manifest.",
|
|
111
|
+
imageSrc: "/assets/images/illustrations/profile.svg",
|
|
112
|
+
imageAlt: "Profile Not Complete Illustration"
|
|
113
|
+
},
|
|
114
|
+
en: {
|
|
115
|
+
title: "Profile Not Complete",
|
|
116
|
+
message: "To continue booking tickets, we need complete profile data according to ASDP provisions. Please complete your profile first to proceed to manifest filling.",
|
|
117
|
+
imageSrc: "/assets/images/illustrations/profile.svg",
|
|
118
|
+
imageAlt: "Profile Not Complete Illustration"
|
|
119
|
+
}
|
|
92
120
|
}
|
|
93
121
|
};
|
|
94
122
|
var useStyles = reactComponents.makeStyles({
|
|
@@ -198,7 +226,9 @@ var MODAL_PRESETS = {
|
|
|
198
226
|
RADIUS: getModalPreset("RADIUS", "id"),
|
|
199
227
|
SESSION_EXPIRED: getModalPreset("SESSION_EXPIRED", "id"),
|
|
200
228
|
PURCHASE_PERIOD_EXPIRED: getModalPreset("PURCHASE_PERIOD_EXPIRED", "id"),
|
|
201
|
-
TRANSACTION_LIMIT: getModalPreset("TRANSACTION_LIMIT", "id")
|
|
229
|
+
TRANSACTION_LIMIT: getModalPreset("TRANSACTION_LIMIT", "id"),
|
|
230
|
+
UNAUTHENTICATED: getModalPreset("UNAUTHENTICATED", "id"),
|
|
231
|
+
PROFILE_NOT_COMPLETE: getModalPreset("PROFILE_NOT_COMPLETE", "id")
|
|
202
232
|
};
|
|
203
233
|
|
|
204
234
|
// src/components/CarouselWithCustomNav/CarouselWithCustomNav.constants.ts
|
|
@@ -1123,7 +1153,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1123
1153
|
selectTicketButton: "Pilih Tiket",
|
|
1124
1154
|
timezoneLabel: "WIB",
|
|
1125
1155
|
currencySymbol: "IDR",
|
|
1126
|
-
logoAlt: "Logo ASDP"
|
|
1156
|
+
logoAlt: "Logo ASDP",
|
|
1157
|
+
verifyingTicketButton: "Memeriksa Tiket"
|
|
1127
1158
|
},
|
|
1128
1159
|
en: {
|
|
1129
1160
|
availableSeatsLabel: "Available",
|
|
@@ -1135,7 +1166,8 @@ var DEFAULT_LABELS5 = {
|
|
|
1135
1166
|
selectTicketButton: "Select Ticket",
|
|
1136
1167
|
timezoneLabel: "WIB",
|
|
1137
1168
|
currencySymbol: "IDR",
|
|
1138
|
-
logoAlt: "ASDP Logo"
|
|
1169
|
+
logoAlt: "ASDP Logo",
|
|
1170
|
+
verifyingTicketButton: "Verifying Ticket"
|
|
1139
1171
|
}
|
|
1140
1172
|
};
|
|
1141
1173
|
|
|
@@ -1351,7 +1383,8 @@ var CardTicket = ({
|
|
|
1351
1383
|
onPriceDetailClick,
|
|
1352
1384
|
onPolicyClick,
|
|
1353
1385
|
onSelectTicket,
|
|
1354
|
-
isLoading = false
|
|
1386
|
+
isLoading = false,
|
|
1387
|
+
isVerifyingTicket = false
|
|
1355
1388
|
}) => {
|
|
1356
1389
|
const styles = useStyles5();
|
|
1357
1390
|
const { width } = useWindowSize();
|
|
@@ -1701,8 +1734,13 @@ var CardTicket = ({
|
|
|
1701
1734
|
style: { backgroundColor: brandColors["60"] },
|
|
1702
1735
|
size: "medium",
|
|
1703
1736
|
shape: "circular",
|
|
1704
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:ticket-diagonal-24-filled" }),
|
|
1705
|
-
|
|
1737
|
+
icon: isVerifyingTicket ? null : /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { icon: "fluent:ticket-diagonal-24-filled" }),
|
|
1738
|
+
disabled: isVerifyingTicket,
|
|
1739
|
+
children: isVerifyingTicket ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1740
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Spinner, { size: "extra-tiny", style: { marginRight: "5px" } }),
|
|
1741
|
+
" ",
|
|
1742
|
+
mergedLabels.verifyingTicketButton
|
|
1743
|
+
] }) : buttonText || mergedLabels.selectTicketButton
|
|
1706
1744
|
}
|
|
1707
1745
|
)
|
|
1708
1746
|
] }),
|
|
@@ -8750,18 +8788,18 @@ var DEFAULT_LABELS16 = {
|
|
|
8750
8788
|
}
|
|
8751
8789
|
};
|
|
8752
8790
|
var getSortOptions = (labels) => [
|
|
8753
|
-
{ value: "
|
|
8754
|
-
{ value: "
|
|
8755
|
-
{ value: "
|
|
8756
|
-
{ value: "
|
|
8757
|
-
{ value: "
|
|
8791
|
+
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: labels.recommendation },
|
|
8792
|
+
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: labels.highestPrice },
|
|
8793
|
+
{ value: "price-asc", sortBy: "price", sortDir: "ASC", label: labels.lowestPrice },
|
|
8794
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: labels.earliestDeparture },
|
|
8795
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: labels.latestDeparture }
|
|
8758
8796
|
];
|
|
8759
8797
|
var DEFAULT_SORT_OPTIONS = [
|
|
8760
|
-
{ value: "
|
|
8761
|
-
{ value: "
|
|
8762
|
-
{ value: "
|
|
8763
|
-
{ value: "
|
|
8764
|
-
{ value: "
|
|
8798
|
+
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: "Rekomendasi" },
|
|
8799
|
+
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: "Harga Tertinggi" },
|
|
8800
|
+
{ value: "price-asc", sortBy: "price", sortDir: "ASC", label: "Harga Terendah" },
|
|
8801
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: "Keberangkatan Paling Awal" },
|
|
8802
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: "Keberangkatan Paling Akhir" }
|
|
8765
8803
|
];
|
|
8766
8804
|
var getSortLabel = (value) => {
|
|
8767
8805
|
const option = DEFAULT_SORT_OPTIONS.find((opt) => opt.value === value);
|
|
@@ -8835,8 +8873,9 @@ var SortMenu = ({
|
|
|
8835
8873
|
() => sortOptions.find((opt) => opt.value === value)?.label || labels.recommendation,
|
|
8836
8874
|
[sortOptions, value, labels.recommendation]
|
|
8837
8875
|
);
|
|
8876
|
+
const defaultOption = sortOptions.find((opt) => opt.value === "recommended") || sortOptions[0];
|
|
8838
8877
|
const handleReset = () => {
|
|
8839
|
-
onChange(
|
|
8878
|
+
onChange(defaultOption);
|
|
8840
8879
|
};
|
|
8841
8880
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.container, children: [
|
|
8842
8881
|
onFilterClick && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8868,7 +8907,10 @@ var SortMenu = ({
|
|
|
8868
8907
|
reactComponents.RadioGroup,
|
|
8869
8908
|
{
|
|
8870
8909
|
value,
|
|
8871
|
-
onChange: (_, data) =>
|
|
8910
|
+
onChange: (_, data) => {
|
|
8911
|
+
const selected = sortOptions.find((opt) => opt.value === data.value);
|
|
8912
|
+
if (selected) onChange(selected);
|
|
8913
|
+
},
|
|
8872
8914
|
children: sortOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8873
8915
|
reactComponents.Radio,
|
|
8874
8916
|
{
|
|
@@ -9117,11 +9159,12 @@ var ModalFilterTicket = ({
|
|
|
9117
9159
|
};
|
|
9118
9160
|
}
|
|
9119
9161
|
}, [open]);
|
|
9120
|
-
const handleServiceTypeToggle = (
|
|
9121
|
-
|
|
9122
|
-
|
|
9162
|
+
const handleServiceTypeToggle = (service) => {
|
|
9163
|
+
const exists = selectedServiceTypes.some((s) => s.id === service.value);
|
|
9164
|
+
if (exists) {
|
|
9165
|
+
onServiceTypesChange(selectedServiceTypes.filter((s) => s.id !== service.value));
|
|
9123
9166
|
} else {
|
|
9124
|
-
onServiceTypesChange([...selectedServiceTypes, value]);
|
|
9167
|
+
onServiceTypesChange([...selectedServiceTypes, { id: service.value, label: service.label }]);
|
|
9125
9168
|
}
|
|
9126
9169
|
};
|
|
9127
9170
|
const handleDepartureTimeChange = (value, checked) => {
|
|
@@ -9297,8 +9340,8 @@ var ModalFilterTicket = ({
|
|
|
9297
9340
|
isLoading ? renderServiceTypesSkeleton() : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.section, children: [
|
|
9298
9341
|
/* @__PURE__ */ jsxRuntime.jsx(reactComponents.Body1, { children: mergedLabels.serviceTypeLabel }),
|
|
9299
9342
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.buttonGrid, children: serviceTypes.map((service) => {
|
|
9300
|
-
const isSelected = selectedServiceTypes.
|
|
9301
|
-
service.value
|
|
9343
|
+
const isSelected = selectedServiceTypes.some(
|
|
9344
|
+
(s) => s.id === service.value
|
|
9302
9345
|
);
|
|
9303
9346
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9304
9347
|
reactComponents.Button,
|
|
@@ -9306,7 +9349,7 @@ var ModalFilterTicket = ({
|
|
|
9306
9349
|
appearance: isSelected ? "primary" : "outline",
|
|
9307
9350
|
className: isSelected ? "" : styles.outlinePrimary,
|
|
9308
9351
|
size: "large",
|
|
9309
|
-
onClick: () => handleServiceTypeToggle(service
|
|
9352
|
+
onClick: () => handleServiceTypeToggle(service),
|
|
9310
9353
|
style: { width: "100%" },
|
|
9311
9354
|
children: service.label
|
|
9312
9355
|
},
|