@asdp/ferryui 0.1.22-dev.10166 → 0.1.22-dev.10168
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 +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +105 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -55
- 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
|
*/
|
|
@@ -815,6 +825,7 @@ interface SelectOption {
|
|
|
815
825
|
value: string;
|
|
816
826
|
label: string;
|
|
817
827
|
disabled?: boolean;
|
|
828
|
+
description?: string;
|
|
818
829
|
}
|
|
819
830
|
interface RadioOption {
|
|
820
831
|
value: string;
|
|
@@ -1314,7 +1325,7 @@ interface ModalSelectDateProps {
|
|
|
1314
1325
|
* <ModalSelectDate
|
|
1315
1326
|
* open={isOpen}
|
|
1316
1327
|
* onClose={() => setIsOpen(false)}
|
|
1317
|
-
* title="Pilih Tanggal
|
|
1328
|
+
* title="Pilih Tanggal Pergi"
|
|
1318
1329
|
* selectedDepartureDate={departureDate}
|
|
1319
1330
|
* selectedReturnDate={returnDate}
|
|
1320
1331
|
* 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
|
*/
|
|
@@ -815,6 +825,7 @@ interface SelectOption {
|
|
|
815
825
|
value: string;
|
|
816
826
|
label: string;
|
|
817
827
|
disabled?: boolean;
|
|
828
|
+
description?: string;
|
|
818
829
|
}
|
|
819
830
|
interface RadioOption {
|
|
820
831
|
value: string;
|
|
@@ -1314,7 +1325,7 @@ interface ModalSelectDateProps {
|
|
|
1314
1325
|
* <ModalSelectDate
|
|
1315
1326
|
* open={isOpen}
|
|
1316
1327
|
* onClose={() => setIsOpen(false)}
|
|
1317
|
-
* title="Pilih Tanggal
|
|
1328
|
+
* title="Pilih Tanggal Pergi"
|
|
1318
1329
|
* selectedDepartureDate={departureDate}
|
|
1319
1330
|
* selectedReturnDate={returnDate}
|
|
1320
1331
|
* onSelectDepartureDate={setDepartureDate}
|
package/dist/index.js
CHANGED
|
@@ -4264,7 +4264,8 @@ var InputDynamic = ({
|
|
|
4264
4264
|
const [isMobile, setIsMobile] = React.useState(false);
|
|
4265
4265
|
const [isInsideDialog, setIsInsideDialog] = React.useState(false);
|
|
4266
4266
|
React.useEffect(() => {
|
|
4267
|
-
if (typeof document === "undefined" || typeof window === "undefined")
|
|
4267
|
+
if (typeof document === "undefined" || typeof window === "undefined")
|
|
4268
|
+
return;
|
|
4268
4269
|
const provider = document.querySelector(
|
|
4269
4270
|
".fui-FluentProvider"
|
|
4270
4271
|
);
|
|
@@ -4586,7 +4587,9 @@ var InputDynamic = ({
|
|
|
4586
4587
|
if (!DIGITS_ONLY_REGEX.test(e.key)) {
|
|
4587
4588
|
e.preventDefault();
|
|
4588
4589
|
const fieldStr = typeof field.value === "string" ? field.value : "";
|
|
4589
|
-
const fieldDigits = stripNonDigits(
|
|
4590
|
+
const fieldDigits = stripNonDigits(
|
|
4591
|
+
fieldStr.replace(/^\+/, "")
|
|
4592
|
+
);
|
|
4590
4593
|
const activeDialCode = getDialCode(onlyCountries?.[0] || defaultCountry) || "";
|
|
4591
4594
|
const userDigitsFromField = activeDialCode && fieldDigits.startsWith(activeDialCode) ? fieldDigits.slice(activeDialCode.length) : fieldDigits;
|
|
4592
4595
|
const hadTrunkPrefix = rawEmailOrPhoneInputRef.current.startsWith("08");
|
|
@@ -4617,7 +4620,10 @@ var InputDynamic = ({
|
|
|
4617
4620
|
return;
|
|
4618
4621
|
}
|
|
4619
4622
|
const countryDialCode = data?.dialCode || "";
|
|
4620
|
-
const cleanedValue = removeLeadingZeroAfterDialCode(
|
|
4623
|
+
const cleanedValue = removeLeadingZeroAfterDialCode(
|
|
4624
|
+
value,
|
|
4625
|
+
countryDialCode
|
|
4626
|
+
);
|
|
4621
4627
|
if (cleanedValue === countryDialCode) {
|
|
4622
4628
|
const dialCodeChanged = lastEmailOrPhoneValue && lastEmailOrPhoneValue !== countryDialCode && !lastEmailOrPhoneValue.startsWith(countryDialCode);
|
|
4623
4629
|
const isInitial = !lastEmailOrPhoneValue;
|
|
@@ -4656,7 +4662,9 @@ var InputDynamic = ({
|
|
|
4656
4662
|
const inputEl = e.currentTarget;
|
|
4657
4663
|
if (nativeInputValueSetter) {
|
|
4658
4664
|
nativeInputValueSetter.call(inputEl, digitsOnly);
|
|
4659
|
-
inputEl.dispatchEvent(
|
|
4665
|
+
inputEl.dispatchEvent(
|
|
4666
|
+
new Event("input", { bubbles: true })
|
|
4667
|
+
);
|
|
4660
4668
|
}
|
|
4661
4669
|
}
|
|
4662
4670
|
}
|
|
@@ -4682,7 +4690,10 @@ var InputDynamic = ({
|
|
|
4682
4690
|
rawEmailOrPhoneInputRef.current = newValue;
|
|
4683
4691
|
let normalizedValue = newValue;
|
|
4684
4692
|
if (detectedType === "phone") {
|
|
4685
|
-
normalizedValue = localToInternational(
|
|
4693
|
+
normalizedValue = localToInternational(
|
|
4694
|
+
newValue,
|
|
4695
|
+
defaultCountry
|
|
4696
|
+
);
|
|
4686
4697
|
}
|
|
4687
4698
|
field.onChange(normalizedValue);
|
|
4688
4699
|
updateEmailOrPhoneType(normalizedValue);
|
|
@@ -4748,7 +4759,10 @@ var InputDynamic = ({
|
|
|
4748
4759
|
return;
|
|
4749
4760
|
}
|
|
4750
4761
|
const countryDialCode = data?.dialCode || "";
|
|
4751
|
-
const cleanedValue = removeLeadingZeroAfterDialCode(
|
|
4762
|
+
const cleanedValue = removeLeadingZeroAfterDialCode(
|
|
4763
|
+
value,
|
|
4764
|
+
countryDialCode
|
|
4765
|
+
);
|
|
4752
4766
|
if (cleanedValue === countryDialCode) {
|
|
4753
4767
|
const dialCodeChanged = lastPhoneValue && lastPhoneValue !== countryDialCode && !lastPhoneValue.startsWith(countryDialCode);
|
|
4754
4768
|
const isInitial = !lastPhoneValue;
|
|
@@ -4786,7 +4800,9 @@ var InputDynamic = ({
|
|
|
4786
4800
|
const inputEl = e.currentTarget;
|
|
4787
4801
|
if (nativeInputValueSetter) {
|
|
4788
4802
|
nativeInputValueSetter.call(inputEl, digitsOnly);
|
|
4789
|
-
inputEl.dispatchEvent(
|
|
4803
|
+
inputEl.dispatchEvent(
|
|
4804
|
+
new Event("input", { bubbles: true })
|
|
4805
|
+
);
|
|
4790
4806
|
}
|
|
4791
4807
|
}
|
|
4792
4808
|
}
|
|
@@ -4813,7 +4829,10 @@ var InputDynamic = ({
|
|
|
4813
4829
|
if (willSwitchType) shouldFocusRef.current = true;
|
|
4814
4830
|
let normalizedValue = newValue;
|
|
4815
4831
|
if (detectedType === "phone") {
|
|
4816
|
-
normalizedValue = localToInternational(
|
|
4832
|
+
normalizedValue = localToInternational(
|
|
4833
|
+
newValue,
|
|
4834
|
+
defaultCountry
|
|
4835
|
+
);
|
|
4817
4836
|
}
|
|
4818
4837
|
field.onChange(normalizedValue);
|
|
4819
4838
|
updateIdentityType(normalizedValue);
|
|
@@ -4877,6 +4896,21 @@ var InputDynamic = ({
|
|
|
4877
4896
|
},
|
|
4878
4897
|
getOptionLabel: (option) => option.label,
|
|
4879
4898
|
getOptionValue: (option) => option.value,
|
|
4899
|
+
formatOptionLabel: (option) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4900
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: option.label }),
|
|
4901
|
+
option.description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4902
|
+
"div",
|
|
4903
|
+
{
|
|
4904
|
+
style: {
|
|
4905
|
+
fontSize: "12px",
|
|
4906
|
+
color: "#6b7280",
|
|
4907
|
+
marginTop: "2px",
|
|
4908
|
+
lineHeight: "1.4"
|
|
4909
|
+
},
|
|
4910
|
+
children: option.description
|
|
4911
|
+
}
|
|
4912
|
+
)
|
|
4913
|
+
] }),
|
|
4880
4914
|
isOptionDisabled: (option) => option.disabled || false,
|
|
4881
4915
|
menuPlacement: menuPlacement || "auto",
|
|
4882
4916
|
menuShouldScrollIntoView: false,
|
|
@@ -4974,7 +5008,10 @@ var InputDynamic = ({
|
|
|
4974
5008
|
return;
|
|
4975
5009
|
}
|
|
4976
5010
|
const dialCode = data?.dialCode || "";
|
|
4977
|
-
let cleanedValue = removeLeadingZeroAfterDialCode(
|
|
5011
|
+
let cleanedValue = removeLeadingZeroAfterDialCode(
|
|
5012
|
+
value,
|
|
5013
|
+
dialCode
|
|
5014
|
+
);
|
|
4978
5015
|
if (cleanedValue.length > PHONE_MAX_DIGITS) {
|
|
4979
5016
|
cleanedValue = cleanedValue.substring(0, PHONE_MAX_DIGITS);
|
|
4980
5017
|
}
|
|
@@ -4994,7 +5031,9 @@ var InputDynamic = ({
|
|
|
4994
5031
|
const inputEl = e.currentTarget;
|
|
4995
5032
|
if (nativeInputValueSetter) {
|
|
4996
5033
|
nativeInputValueSetter.call(inputEl, digitsOnly);
|
|
4997
|
-
inputEl.dispatchEvent(
|
|
5034
|
+
inputEl.dispatchEvent(
|
|
5035
|
+
new Event("input", { bubbles: true })
|
|
5036
|
+
);
|
|
4998
5037
|
}
|
|
4999
5038
|
}
|
|
5000
5039
|
}
|
|
@@ -5476,7 +5515,7 @@ var DEFAULT_LABELS8 = {
|
|
|
5476
5515
|
id: {
|
|
5477
5516
|
fromLabel: "Dari",
|
|
5478
5517
|
toLabel: "Ke",
|
|
5479
|
-
departureDateLabel: "Tanggal
|
|
5518
|
+
departureDateLabel: "Tanggal Pergi",
|
|
5480
5519
|
returnDateLabel: "Tanggal Pulang",
|
|
5481
5520
|
serviceClassLabel: "Jenis Layanan",
|
|
5482
5521
|
typeOfServiceLabel: "Jenis Penumpang",
|
|
@@ -5485,14 +5524,14 @@ var DEFAULT_LABELS8 = {
|
|
|
5485
5524
|
searchButton: "Cari Tiket",
|
|
5486
5525
|
placeholderPort: "Pilih Pelabuhan Asal",
|
|
5487
5526
|
placeholderDestinationPort: "Pilih Pelabuhan Tujuan",
|
|
5488
|
-
placeholderDepartureDate: "Pilih Tanggal
|
|
5489
|
-
placeholderReturnDate: "Pilih Tanggal
|
|
5527
|
+
placeholderDepartureDate: "Pilih Tanggal Pergi",
|
|
5528
|
+
placeholderReturnDate: "Pilih Tanggal Pulang",
|
|
5490
5529
|
placeholderTypeClass: "Pilih Jenis Layanan",
|
|
5491
5530
|
placeholderTypeService: "Pilih Jenis Penumpang",
|
|
5492
5531
|
placeholderPassenger: "Pilih Jumlah Penumpang",
|
|
5493
5532
|
errorOriginRequired: "Pelabuhan asal wajib diisi",
|
|
5494
5533
|
errorDestinationRequired: "Pelabuhan tujuan wajib diisi",
|
|
5495
|
-
errorDepartureDateRequired: "Tanggal
|
|
5534
|
+
errorDepartureDateRequired: "Tanggal Pergi wajib diisi",
|
|
5496
5535
|
errorReturnDateRequired: "Tanggal Pulang wajib diisi",
|
|
5497
5536
|
switchAriaLabel: "Tukar asal dan tujuan",
|
|
5498
5537
|
ferryDescription: "Layanan Penyeberangan Ferry ASDP",
|
|
@@ -6182,7 +6221,8 @@ var DEFAULT_LABELS9 = {
|
|
|
6182
6221
|
id: {
|
|
6183
6222
|
originHarbor: "Pelabuhan Keberangkatan",
|
|
6184
6223
|
destinationHarbor: "Pelabuhan Tujuan",
|
|
6185
|
-
departureDate: "Tanggal
|
|
6224
|
+
departureDate: "Tanggal Pergi",
|
|
6225
|
+
returnDate: "Tanggal Pulang",
|
|
6186
6226
|
serviceClass: "Jenis Layanan",
|
|
6187
6227
|
typeOfService: "Jenis Penumpang",
|
|
6188
6228
|
totalPassengers: "Jumlah Penumpang",
|
|
@@ -6193,6 +6233,7 @@ var DEFAULT_LABELS9 = {
|
|
|
6193
6233
|
originHarbor: "Departure Port",
|
|
6194
6234
|
destinationHarbor: "Destination Port",
|
|
6195
6235
|
departureDate: "Departure Date",
|
|
6236
|
+
returnDate: "Return Date",
|
|
6196
6237
|
serviceClass: "Service Type",
|
|
6197
6238
|
typeOfService: "Type Of Passenger",
|
|
6198
6239
|
totalPassengers: "Total Passengers",
|
|
@@ -6270,10 +6311,12 @@ var useStyles10 = reactComponents.makeStyles({
|
|
|
6270
6311
|
}
|
|
6271
6312
|
});
|
|
6272
6313
|
var CardTicketSearchSummary = ({
|
|
6314
|
+
showReturnDate = false,
|
|
6273
6315
|
language = "id",
|
|
6274
6316
|
originHarbor,
|
|
6275
6317
|
destinationHarbor,
|
|
6276
6318
|
departureDate,
|
|
6319
|
+
returnDate,
|
|
6277
6320
|
serviceClass,
|
|
6278
6321
|
typeOfService,
|
|
6279
6322
|
totalPassengers,
|
|
@@ -6469,8 +6512,8 @@ var CardTicketSearchSummary = ({
|
|
|
6469
6512
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6470
6513
|
RenderField,
|
|
6471
6514
|
{
|
|
6472
|
-
label: mergedLabels.departureDate,
|
|
6473
|
-
value: departureDate,
|
|
6515
|
+
label: showReturnDate ? mergedLabels.returnDate : mergedLabels.departureDate,
|
|
6516
|
+
value: showReturnDate ? returnDate : departureDate,
|
|
6474
6517
|
icon: "fluent:calendar-24-regular"
|
|
6475
6518
|
}
|
|
6476
6519
|
)
|
|
@@ -7341,6 +7384,10 @@ var ModalSelectDate = ({
|
|
|
7341
7384
|
}) => {
|
|
7342
7385
|
const styles = useStyles13();
|
|
7343
7386
|
const mergedLabels = { ...DEFAULT_LABELS12[language], ...labels };
|
|
7387
|
+
const isSameCalendarDay = (first, second) => {
|
|
7388
|
+
if (!first || !second) return false;
|
|
7389
|
+
return moment__default.default(first).isSame(second, "day");
|
|
7390
|
+
};
|
|
7344
7391
|
React.useEffect(() => {
|
|
7345
7392
|
moment__default.default.locale(language === "id" ? "id" : "en");
|
|
7346
7393
|
}, [language]);
|
|
@@ -7352,24 +7399,26 @@ var ModalSelectDate = ({
|
|
|
7352
7399
|
);
|
|
7353
7400
|
const [hoveredDate, setHoveredDate] = React.useState();
|
|
7354
7401
|
const [activeTab, setActiveTab] = React.useState(initialTab);
|
|
7355
|
-
const
|
|
7356
|
-
if (selectedEndDate)
|
|
7357
|
-
|
|
7358
|
-
|
|
7402
|
+
const previewRange = React.useMemo(() => {
|
|
7403
|
+
if (selectedEndDate) {
|
|
7404
|
+
return { start: selectedDate, end: selectedEndDate };
|
|
7405
|
+
}
|
|
7406
|
+
if (selectedDate && hoveredDate && !isSameCalendarDay(hoveredDate, selectedDate)) {
|
|
7407
|
+
const earlier = hoveredDate < selectedDate ? hoveredDate : selectedDate;
|
|
7408
|
+
const later = hoveredDate > selectedDate ? hoveredDate : selectedDate;
|
|
7409
|
+
return { start: earlier, end: later };
|
|
7359
7410
|
}
|
|
7360
|
-
return void 0;
|
|
7411
|
+
return { start: selectedDate, end: void 0 };
|
|
7361
7412
|
}, [hoveredDate, selectedDate, selectedEndDate]);
|
|
7362
|
-
const
|
|
7363
|
-
if (!first || !second) return false;
|
|
7364
|
-
return moment__default.default(first).isSame(second, "day");
|
|
7365
|
-
};
|
|
7413
|
+
const prevOpenRef = React.useRef(false);
|
|
7366
7414
|
React.useEffect(() => {
|
|
7367
|
-
if (open) {
|
|
7415
|
+
if (open && !prevOpenRef.current) {
|
|
7368
7416
|
setSelectedDate(selectedDepartureDate);
|
|
7369
7417
|
setSelectedEndDate(selectedReturnDate);
|
|
7370
7418
|
setActiveTab(initialTab);
|
|
7371
7419
|
setHoveredDate(void 0);
|
|
7372
7420
|
}
|
|
7421
|
+
prevOpenRef.current = open;
|
|
7373
7422
|
}, [open, selectedDepartureDate, selectedReturnDate, initialTab]);
|
|
7374
7423
|
const handleTabChange = (tab) => {
|
|
7375
7424
|
setActiveTab(tab);
|
|
@@ -7393,18 +7442,19 @@ var ModalSelectDate = ({
|
|
|
7393
7442
|
setHoveredDate(void 0);
|
|
7394
7443
|
onSelectDepartureDate(date);
|
|
7395
7444
|
} else {
|
|
7396
|
-
|
|
7397
|
-
|
|
7445
|
+
const earlier = date < currentStart ? date : currentStart;
|
|
7446
|
+
const later = date > currentStart ? date : currentStart;
|
|
7447
|
+
if (isSameCalendarDay(date, currentStart)) {
|
|
7398
7448
|
setSelectedDate(date);
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7449
|
+
setSelectedEndDate(void 0);
|
|
7450
|
+
setHoveredDate(void 0);
|
|
7451
|
+
return;
|
|
7452
|
+
}
|
|
7453
|
+
setSelectedDate(earlier);
|
|
7454
|
+
setSelectedEndDate(later);
|
|
7455
|
+
onSelectDepartureDate(earlier);
|
|
7456
|
+
if (onSelectReturnDate) {
|
|
7457
|
+
onSelectReturnDate(later);
|
|
7408
7458
|
}
|
|
7409
7459
|
setHoveredDate(void 0);
|
|
7410
7460
|
handleClose();
|
|
@@ -7437,14 +7487,15 @@ var ModalSelectDate = ({
|
|
|
7437
7487
|
element.onmouseleave = null;
|
|
7438
7488
|
return;
|
|
7439
7489
|
}
|
|
7440
|
-
const
|
|
7441
|
-
const
|
|
7442
|
-
const
|
|
7490
|
+
const rangeStart = previewRange.start;
|
|
7491
|
+
const rangeEnd = previewRange.end;
|
|
7492
|
+
const startTime = rangeStart?.getTime();
|
|
7493
|
+
const endTime = rangeEnd?.getTime();
|
|
7443
7494
|
const currentTime = date.getTime();
|
|
7444
|
-
const isSameStartEnd = isSameCalendarDay(
|
|
7445
|
-
const isStartDay = isSameCalendarDay(date,
|
|
7446
|
-
const isEndDay = isSameCalendarDay(date,
|
|
7447
|
-
if (isStartDay && (!
|
|
7495
|
+
const isSameStartEnd = isSameCalendarDay(rangeStart, rangeEnd);
|
|
7496
|
+
const isStartDay = isSameCalendarDay(date, rangeStart);
|
|
7497
|
+
const isEndDay = isSameCalendarDay(date, rangeEnd);
|
|
7498
|
+
if (isStartDay && (!rangeEnd || isSameStartEnd)) {
|
|
7448
7499
|
addTokens(styles.rangeSingle);
|
|
7449
7500
|
} else {
|
|
7450
7501
|
if (isStartDay) {
|
|
@@ -7454,12 +7505,11 @@ var ModalSelectDate = ({
|
|
|
7454
7505
|
addTokens(styles.rangeEnd);
|
|
7455
7506
|
}
|
|
7456
7507
|
}
|
|
7457
|
-
if (endTime && currentTime > startTime && currentTime < endTime) {
|
|
7508
|
+
if (startTime && endTime && currentTime > startTime && currentTime < endTime) {
|
|
7458
7509
|
addTokens(selectedEndDate ? styles.rangeMiddle : styles.rangePreview);
|
|
7459
7510
|
}
|
|
7460
7511
|
if (!selectedEndDate) {
|
|
7461
7512
|
element.onmouseenter = () => {
|
|
7462
|
-
if (date < selectedDate) return;
|
|
7463
7513
|
setHoveredDate((prev) => {
|
|
7464
7514
|
if (isSameCalendarDay(prev, date)) {
|
|
7465
7515
|
return prev;
|
|
@@ -7477,7 +7527,7 @@ var ModalSelectDate = ({
|
|
|
7477
7527
|
},
|
|
7478
7528
|
[
|
|
7479
7529
|
activeTab,
|
|
7480
|
-
|
|
7530
|
+
previewRange,
|
|
7481
7531
|
selectedDate,
|
|
7482
7532
|
selectedEndDate,
|
|
7483
7533
|
styles.rangeEnd,
|
|
@@ -8857,8 +8907,8 @@ var DEFAULT_LABELS16 = {
|
|
|
8857
8907
|
recommendation: "Rekomendasi",
|
|
8858
8908
|
highestPrice: "Harga Tertinggi",
|
|
8859
8909
|
lowestPrice: "Harga Terendah",
|
|
8860
|
-
earliestDeparture: "
|
|
8861
|
-
latestDeparture: "
|
|
8910
|
+
earliestDeparture: "Pergi Paling Awal",
|
|
8911
|
+
latestDeparture: "Pergi Paling Akhir",
|
|
8862
8912
|
resetSortAriaLabel: "Hapus pengurutan"
|
|
8863
8913
|
},
|
|
8864
8914
|
en: {
|
|
@@ -8884,8 +8934,8 @@ var DEFAULT_SORT_OPTIONS = [
|
|
|
8884
8934
|
{ value: "recommended", sortBy: "recommendation", sortDir: "ASC", label: "Rekomendasi" },
|
|
8885
8935
|
{ value: "price-desc", sortBy: "price", sortDir: "DESC", label: "Harga Tertinggi" },
|
|
8886
8936
|
{ 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: "
|
|
8937
|
+
{ value: "departure-asc", sortBy: "departure", sortDir: "ASC", label: "Pergi Paling Awal" },
|
|
8938
|
+
{ value: "departure-desc", sortBy: "departure", sortDir: "DESC", label: "Pergi Paling Akhir" }
|
|
8889
8939
|
];
|
|
8890
8940
|
var getSortLabel = (value) => {
|
|
8891
8941
|
const option = DEFAULT_SORT_OPTIONS.find((opt) => opt.value === value);
|
|
@@ -9780,9 +9830,9 @@ var DEFAULT_LABELS19 = {
|
|
|
9780
9830
|
toLabel: "Ke",
|
|
9781
9831
|
toPlaceholder: "Pilih pelabuhan tujuan",
|
|
9782
9832
|
toRequired: "Pelabuhan tujuan wajib diisi",
|
|
9783
|
-
departureDateLabel: "Tanggal
|
|
9784
|
-
departureDatePlaceholder: "Pilih Tanggal
|
|
9785
|
-
departureDateRequired: "Tanggal
|
|
9833
|
+
departureDateLabel: "Tanggal Pergi",
|
|
9834
|
+
departureDatePlaceholder: "Pilih Tanggal Pergi",
|
|
9835
|
+
departureDateRequired: "Tanggal Pergi wajib diisi",
|
|
9786
9836
|
roundTripLabel: "Pulang Pergi",
|
|
9787
9837
|
returnDateLabel: "Tanggal Pulang",
|
|
9788
9838
|
returnDatePlaceholder: "Pilih Tanggal Pulang",
|