@asdp/ferryui 0.1.22-dev.10166 → 0.1.22-dev.10167
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.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +56 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
color: var(--colorNeutralForegroundOnBrand) !important;
|
|
24
24
|
}
|
|
25
25
|
.fui-CalendarDayGrid__dayButton {
|
|
26
|
-
background-color: transparent
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
}
|
|
28
|
+
.fui-CalendarDayGrid__dayButton:hover {
|
|
29
|
+
background-color: transparent;
|
|
30
30
|
}
|
|
31
31
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ModalSelectDate/modalSelectDate.css"],"sourcesContent":[".fui-Calendar {\n width: 100% !important;\n}\n\n.fui-CalendarDay {\n width: 100% !important;\n}\n\n.fui-CalendarDayGrid__table {\n width: 100% !important;\n}\n\n.fui-Calendar__monthPickerWrapper {\n width: 100% !important;\n}\n\n.fui-CalendarPicker {\n width: 100% !important;\n}\n\n.fui-CalendarPicker__buttonRow {\n justify-content: space-between !important;\n display: flex !important;\n}\n.fui-CalendarPicker__selected{\n background-color: var(--colorBrandBackground) !important;\n color: var(--colorNeutralForegroundOnBrand) !important;\n}\n.fui-CalendarDayGrid__dayButton{\n background-color: transparent
|
|
1
|
+
{"version":3,"sources":["../src/components/ModalSelectDate/modalSelectDate.css"],"sourcesContent":[".fui-Calendar {\n width: 100% !important;\n}\n\n.fui-CalendarDay {\n width: 100% !important;\n}\n\n.fui-CalendarDayGrid__table {\n width: 100% !important;\n}\n\n.fui-Calendar__monthPickerWrapper {\n width: 100% !important;\n}\n\n.fui-CalendarPicker {\n width: 100% !important;\n}\n\n.fui-CalendarPicker__buttonRow {\n justify-content: space-between !important;\n display: flex !important;\n}\n.fui-CalendarPicker__selected{\n background-color: var(--colorBrandBackground) !important;\n color: var(--colorNeutralForegroundOnBrand) !important;\n}\n.fui-CalendarDayGrid__dayButton{\n background-color: transparent;\n}\n.fui-CalendarDayGrid__dayButton:hover{\n background-color: transparent;\n}"],"mappings":";AAAA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,SAAO;AACT;AAEA,CAAC;AACC,mBAAiB;AACjB,WAAS;AACX;AACA,CAAC;AACC,oBAAkB,IAAI;AACtB,SAAO,IAAI;AACb;AACA,CAAC;AACC,oBAAkB;AACpB;AACA,CAHC,8BAG8B;AAC7B,oBAAkB;AACpB;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -750,6 +750,7 @@ interface CardTicketSearchSummaryLabels {
|
|
|
750
750
|
originHarbor: string;
|
|
751
751
|
destinationHarbor: string;
|
|
752
752
|
departureDate: string;
|
|
753
|
+
returnDate: string;
|
|
753
754
|
serviceClass: string;
|
|
754
755
|
typeOfService: string;
|
|
755
756
|
totalPassengers: string;
|
|
@@ -757,6 +758,11 @@ interface CardTicketSearchSummaryLabels {
|
|
|
757
758
|
swapAriaLabel: string;
|
|
758
759
|
}
|
|
759
760
|
interface CardTicketSearchSummaryProps {
|
|
761
|
+
/**
|
|
762
|
+
* Show return date field
|
|
763
|
+
* @default false
|
|
764
|
+
*/
|
|
765
|
+
showReturnDate?: boolean;
|
|
760
766
|
/**
|
|
761
767
|
* Language for labels (Indonesian or English)
|
|
762
768
|
* @default 'id'
|
|
@@ -774,6 +780,10 @@ interface CardTicketSearchSummaryProps {
|
|
|
774
780
|
* Departure date
|
|
775
781
|
*/
|
|
776
782
|
departureDate: string;
|
|
783
|
+
/**
|
|
784
|
+
* Return date
|
|
785
|
+
*/
|
|
786
|
+
returnDate?: string;
|
|
777
787
|
/**
|
|
778
788
|
* Service type text (e.g., "3 Service Types")
|
|
779
789
|
*/
|
|
@@ -1314,7 +1324,7 @@ interface ModalSelectDateProps {
|
|
|
1314
1324
|
* <ModalSelectDate
|
|
1315
1325
|
* open={isOpen}
|
|
1316
1326
|
* onClose={() => setIsOpen(false)}
|
|
1317
|
-
* title="Pilih Tanggal
|
|
1327
|
+
* title="Pilih Tanggal Pergi"
|
|
1318
1328
|
* selectedDepartureDate={departureDate}
|
|
1319
1329
|
* selectedReturnDate={returnDate}
|
|
1320
1330
|
* onSelectDepartureDate={setDepartureDate}
|
package/dist/index.d.ts
CHANGED
|
@@ -750,6 +750,7 @@ interface CardTicketSearchSummaryLabels {
|
|
|
750
750
|
originHarbor: string;
|
|
751
751
|
destinationHarbor: string;
|
|
752
752
|
departureDate: string;
|
|
753
|
+
returnDate: string;
|
|
753
754
|
serviceClass: string;
|
|
754
755
|
typeOfService: string;
|
|
755
756
|
totalPassengers: string;
|
|
@@ -757,6 +758,11 @@ interface CardTicketSearchSummaryLabels {
|
|
|
757
758
|
swapAriaLabel: string;
|
|
758
759
|
}
|
|
759
760
|
interface CardTicketSearchSummaryProps {
|
|
761
|
+
/**
|
|
762
|
+
* Show return date field
|
|
763
|
+
* @default false
|
|
764
|
+
*/
|
|
765
|
+
showReturnDate?: boolean;
|
|
760
766
|
/**
|
|
761
767
|
* Language for labels (Indonesian or English)
|
|
762
768
|
* @default 'id'
|
|
@@ -774,6 +780,10 @@ interface CardTicketSearchSummaryProps {
|
|
|
774
780
|
* Departure date
|
|
775
781
|
*/
|
|
776
782
|
departureDate: string;
|
|
783
|
+
/**
|
|
784
|
+
* Return date
|
|
785
|
+
*/
|
|
786
|
+
returnDate?: string;
|
|
777
787
|
/**
|
|
778
788
|
* Service type text (e.g., "3 Service Types")
|
|
779
789
|
*/
|
|
@@ -1314,7 +1324,7 @@ interface ModalSelectDateProps {
|
|
|
1314
1324
|
* <ModalSelectDate
|
|
1315
1325
|
* open={isOpen}
|
|
1316
1326
|
* onClose={() => setIsOpen(false)}
|
|
1317
|
-
* title="Pilih Tanggal
|
|
1327
|
+
* title="Pilih Tanggal Pergi"
|
|
1318
1328
|
* selectedDepartureDate={departureDate}
|
|
1319
1329
|
* selectedReturnDate={returnDate}
|
|
1320
1330
|
* onSelectDepartureDate={setDepartureDate}
|
package/dist/index.js
CHANGED
|
@@ -5476,7 +5476,7 @@ var DEFAULT_LABELS8 = {
|
|
|
5476
5476
|
id: {
|
|
5477
5477
|
fromLabel: "Dari",
|
|
5478
5478
|
toLabel: "Ke",
|
|
5479
|
-
departureDateLabel: "Tanggal
|
|
5479
|
+
departureDateLabel: "Tanggal Pergi",
|
|
5480
5480
|
returnDateLabel: "Tanggal Pulang",
|
|
5481
5481
|
serviceClassLabel: "Jenis Layanan",
|
|
5482
5482
|
typeOfServiceLabel: "Jenis Penumpang",
|
|
@@ -5485,14 +5485,14 @@ var DEFAULT_LABELS8 = {
|
|
|
5485
5485
|
searchButton: "Cari Tiket",
|
|
5486
5486
|
placeholderPort: "Pilih Pelabuhan Asal",
|
|
5487
5487
|
placeholderDestinationPort: "Pilih Pelabuhan Tujuan",
|
|
5488
|
-
placeholderDepartureDate: "Pilih Tanggal
|
|
5489
|
-
placeholderReturnDate: "Pilih Tanggal
|
|
5488
|
+
placeholderDepartureDate: "Pilih Tanggal Pergi",
|
|
5489
|
+
placeholderReturnDate: "Pilih Tanggal Pulang",
|
|
5490
5490
|
placeholderTypeClass: "Pilih Jenis Layanan",
|
|
5491
5491
|
placeholderTypeService: "Pilih Jenis Penumpang",
|
|
5492
5492
|
placeholderPassenger: "Pilih Jumlah Penumpang",
|
|
5493
5493
|
errorOriginRequired: "Pelabuhan asal wajib diisi",
|
|
5494
5494
|
errorDestinationRequired: "Pelabuhan tujuan wajib diisi",
|
|
5495
|
-
errorDepartureDateRequired: "Tanggal
|
|
5495
|
+
errorDepartureDateRequired: "Tanggal Pergi wajib diisi",
|
|
5496
5496
|
errorReturnDateRequired: "Tanggal Pulang wajib diisi",
|
|
5497
5497
|
switchAriaLabel: "Tukar asal dan tujuan",
|
|
5498
5498
|
ferryDescription: "Layanan Penyeberangan Ferry ASDP",
|
|
@@ -6182,7 +6182,8 @@ var DEFAULT_LABELS9 = {
|
|
|
6182
6182
|
id: {
|
|
6183
6183
|
originHarbor: "Pelabuhan Keberangkatan",
|
|
6184
6184
|
destinationHarbor: "Pelabuhan Tujuan",
|
|
6185
|
-
departureDate: "Tanggal
|
|
6185
|
+
departureDate: "Tanggal Pergi",
|
|
6186
|
+
returnDate: "Tanggal Pulang",
|
|
6186
6187
|
serviceClass: "Jenis Layanan",
|
|
6187
6188
|
typeOfService: "Jenis Penumpang",
|
|
6188
6189
|
totalPassengers: "Jumlah Penumpang",
|
|
@@ -6193,6 +6194,7 @@ var DEFAULT_LABELS9 = {
|
|
|
6193
6194
|
originHarbor: "Departure Port",
|
|
6194
6195
|
destinationHarbor: "Destination Port",
|
|
6195
6196
|
departureDate: "Departure Date",
|
|
6197
|
+
returnDate: "Return Date",
|
|
6196
6198
|
serviceClass: "Service Type",
|
|
6197
6199
|
typeOfService: "Type Of Passenger",
|
|
6198
6200
|
totalPassengers: "Total Passengers",
|
|
@@ -6270,10 +6272,12 @@ var useStyles10 = reactComponents.makeStyles({
|
|
|
6270
6272
|
}
|
|
6271
6273
|
});
|
|
6272
6274
|
var CardTicketSearchSummary = ({
|
|
6275
|
+
showReturnDate = false,
|
|
6273
6276
|
language = "id",
|
|
6274
6277
|
originHarbor,
|
|
6275
6278
|
destinationHarbor,
|
|
6276
6279
|
departureDate,
|
|
6280
|
+
returnDate,
|
|
6277
6281
|
serviceClass,
|
|
6278
6282
|
typeOfService,
|
|
6279
6283
|
totalPassengers,
|
|
@@ -6469,8 +6473,8 @@ var CardTicketSearchSummary = ({
|
|
|
6469
6473
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6470
6474
|
RenderField,
|
|
6471
6475
|
{
|
|
6472
|
-
label: mergedLabels.departureDate,
|
|
6473
|
-
value: departureDate,
|
|
6476
|
+
label: showReturnDate ? mergedLabels.returnDate : mergedLabels.departureDate,
|
|
6477
|
+
value: showReturnDate ? returnDate : departureDate,
|
|
6474
6478
|
icon: "fluent:calendar-24-regular"
|
|
6475
6479
|
}
|
|
6476
6480
|
)
|
|
@@ -7341,6 +7345,10 @@ var ModalSelectDate = ({
|
|
|
7341
7345
|
}) => {
|
|
7342
7346
|
const styles = useStyles13();
|
|
7343
7347
|
const mergedLabels = { ...DEFAULT_LABELS12[language], ...labels };
|
|
7348
|
+
const isSameCalendarDay = (first, second) => {
|
|
7349
|
+
if (!first || !second) return false;
|
|
7350
|
+
return moment__default.default(first).isSame(second, "day");
|
|
7351
|
+
};
|
|
7344
7352
|
React.useEffect(() => {
|
|
7345
7353
|
moment__default.default.locale(language === "id" ? "id" : "en");
|
|
7346
7354
|
}, [language]);
|
|
@@ -7352,24 +7360,26 @@ var ModalSelectDate = ({
|
|
|
7352
7360
|
);
|
|
7353
7361
|
const [hoveredDate, setHoveredDate] = React.useState();
|
|
7354
7362
|
const [activeTab, setActiveTab] = React.useState(initialTab);
|
|
7355
|
-
const
|
|
7356
|
-
if (selectedEndDate)
|
|
7357
|
-
|
|
7358
|
-
return hoveredDate;
|
|
7363
|
+
const previewRange = React.useMemo(() => {
|
|
7364
|
+
if (selectedEndDate) {
|
|
7365
|
+
return { start: selectedDate, end: selectedEndDate };
|
|
7359
7366
|
}
|
|
7360
|
-
|
|
7367
|
+
if (selectedDate && hoveredDate && !isSameCalendarDay(hoveredDate, selectedDate)) {
|
|
7368
|
+
const earlier = hoveredDate < selectedDate ? hoveredDate : selectedDate;
|
|
7369
|
+
const later = hoveredDate > selectedDate ? hoveredDate : selectedDate;
|
|
7370
|
+
return { start: earlier, end: later };
|
|
7371
|
+
}
|
|
7372
|
+
return { start: selectedDate, end: void 0 };
|
|
7361
7373
|
}, [hoveredDate, selectedDate, selectedEndDate]);
|
|
7362
|
-
const
|
|
7363
|
-
if (!first || !second) return false;
|
|
7364
|
-
return moment__default.default(first).isSame(second, "day");
|
|
7365
|
-
};
|
|
7374
|
+
const prevOpenRef = React.useRef(false);
|
|
7366
7375
|
React.useEffect(() => {
|
|
7367
|
-
if (open) {
|
|
7376
|
+
if (open && !prevOpenRef.current) {
|
|
7368
7377
|
setSelectedDate(selectedDepartureDate);
|
|
7369
7378
|
setSelectedEndDate(selectedReturnDate);
|
|
7370
7379
|
setActiveTab(initialTab);
|
|
7371
7380
|
setHoveredDate(void 0);
|
|
7372
7381
|
}
|
|
7382
|
+
prevOpenRef.current = open;
|
|
7373
7383
|
}, [open, selectedDepartureDate, selectedReturnDate, initialTab]);
|
|
7374
7384
|
const handleTabChange = (tab) => {
|
|
7375
7385
|
setActiveTab(tab);
|
|
@@ -7393,18 +7403,19 @@ var ModalSelectDate = ({
|
|
|
7393
7403
|
setHoveredDate(void 0);
|
|
7394
7404
|
onSelectDepartureDate(date);
|
|
7395
7405
|
} else {
|
|
7396
|
-
|
|
7397
|
-
|
|
7406
|
+
const earlier = date < currentStart ? date : currentStart;
|
|
7407
|
+
const later = date > currentStart ? date : currentStart;
|
|
7408
|
+
if (isSameCalendarDay(date, currentStart)) {
|
|
7398
7409
|
setSelectedDate(date);
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7410
|
+
setSelectedEndDate(void 0);
|
|
7411
|
+
setHoveredDate(void 0);
|
|
7412
|
+
return;
|
|
7413
|
+
}
|
|
7414
|
+
setSelectedDate(earlier);
|
|
7415
|
+
setSelectedEndDate(later);
|
|
7416
|
+
onSelectDepartureDate(earlier);
|
|
7417
|
+
if (onSelectReturnDate) {
|
|
7418
|
+
onSelectReturnDate(later);
|
|
7408
7419
|
}
|
|
7409
7420
|
setHoveredDate(void 0);
|
|
7410
7421
|
handleClose();
|
|
@@ -7437,14 +7448,15 @@ var ModalSelectDate = ({
|
|
|
7437
7448
|
element.onmouseleave = null;
|
|
7438
7449
|
return;
|
|
7439
7450
|
}
|
|
7440
|
-
const
|
|
7441
|
-
const
|
|
7442
|
-
const
|
|
7451
|
+
const rangeStart = previewRange.start;
|
|
7452
|
+
const rangeEnd = previewRange.end;
|
|
7453
|
+
const startTime = rangeStart?.getTime();
|
|
7454
|
+
const endTime = rangeEnd?.getTime();
|
|
7443
7455
|
const currentTime = date.getTime();
|
|
7444
|
-
const isSameStartEnd = isSameCalendarDay(
|
|
7445
|
-
const isStartDay = isSameCalendarDay(date,
|
|
7446
|
-
const isEndDay = isSameCalendarDay(date,
|
|
7447
|
-
if (isStartDay && (!
|
|
7456
|
+
const isSameStartEnd = isSameCalendarDay(rangeStart, rangeEnd);
|
|
7457
|
+
const isStartDay = isSameCalendarDay(date, rangeStart);
|
|
7458
|
+
const isEndDay = isSameCalendarDay(date, rangeEnd);
|
|
7459
|
+
if (isStartDay && (!rangeEnd || isSameStartEnd)) {
|
|
7448
7460
|
addTokens(styles.rangeSingle);
|
|
7449
7461
|
} else {
|
|
7450
7462
|
if (isStartDay) {
|
|
@@ -7454,12 +7466,11 @@ var ModalSelectDate = ({
|
|
|
7454
7466
|
addTokens(styles.rangeEnd);
|
|
7455
7467
|
}
|
|
7456
7468
|
}
|
|
7457
|
-
if (endTime && currentTime > startTime && currentTime < endTime) {
|
|
7469
|
+
if (startTime && endTime && currentTime > startTime && currentTime < endTime) {
|
|
7458
7470
|
addTokens(selectedEndDate ? styles.rangeMiddle : styles.rangePreview);
|
|
7459
7471
|
}
|
|
7460
7472
|
if (!selectedEndDate) {
|
|
7461
7473
|
element.onmouseenter = () => {
|
|
7462
|
-
if (date < selectedDate) return;
|
|
7463
7474
|
setHoveredDate((prev) => {
|
|
7464
7475
|
if (isSameCalendarDay(prev, date)) {
|
|
7465
7476
|
return prev;
|
|
@@ -7477,7 +7488,7 @@ var ModalSelectDate = ({
|
|
|
7477
7488
|
},
|
|
7478
7489
|
[
|
|
7479
7490
|
activeTab,
|
|
7480
|
-
|
|
7491
|
+
previewRange,
|
|
7481
7492
|
selectedDate,
|
|
7482
7493
|
selectedEndDate,
|
|
7483
7494
|
styles.rangeEnd,
|
|
@@ -8857,8 +8868,8 @@ var DEFAULT_LABELS16 = {
|
|
|
8857
8868
|
recommendation: "Rekomendasi",
|
|
8858
8869
|
highestPrice: "Harga Tertinggi",
|
|
8859
8870
|
lowestPrice: "Harga Terendah",
|
|
8860
|
-
earliestDeparture: "
|
|
8861
|
-
latestDeparture: "
|
|
8871
|
+
earliestDeparture: "Pergi Paling Awal",
|
|
8872
|
+
latestDeparture: "Pergi Paling Akhir",
|
|
8862
8873
|
resetSortAriaLabel: "Hapus pengurutan"
|
|
8863
8874
|
},
|
|
8864
8875
|
en: {
|
|
@@ -8884,8 +8895,8 @@ var DEFAULT_SORT_OPTIONS = [
|
|
|
8884
8895
|
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: "Rekomendasi" },
|
|
8885
8896
|
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: "Harga Tertinggi" },
|
|
8886
8897
|
{ value: "price-asc", sortBy: "price", sortDir: "ASC", label: "Harga Terendah" },
|
|
8887
|
-
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: "
|
|
8888
|
-
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: "
|
|
8898
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: "Pergi Paling Awal" },
|
|
8899
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: "Pergi Paling Akhir" }
|
|
8889
8900
|
];
|
|
8890
8901
|
var getSortLabel = (value) => {
|
|
8891
8902
|
const option = DEFAULT_SORT_OPTIONS.find((opt) => opt.value === value);
|
|
@@ -9780,9 +9791,9 @@ var DEFAULT_LABELS19 = {
|
|
|
9780
9791
|
toLabel: "Ke",
|
|
9781
9792
|
toPlaceholder: "Pilih pelabuhan tujuan",
|
|
9782
9793
|
toRequired: "Pelabuhan tujuan wajib diisi",
|
|
9783
|
-
departureDateLabel: "Tanggal
|
|
9784
|
-
departureDatePlaceholder: "Pilih Tanggal
|
|
9785
|
-
departureDateRequired: "Tanggal
|
|
9794
|
+
departureDateLabel: "Tanggal Pergi",
|
|
9795
|
+
departureDatePlaceholder: "Pilih Tanggal Pergi",
|
|
9796
|
+
departureDateRequired: "Tanggal Pergi wajib diisi",
|
|
9786
9797
|
roundTripLabel: "Pulang Pergi",
|
|
9787
9798
|
returnDateLabel: "Tanggal Pulang",
|
|
9788
9799
|
returnDatePlaceholder: "Pilih Tanggal Pulang",
|