willba-component-library 0.2.74 → 0.2.76
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/lib/index.esm.js +51 -43
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +51 -43
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +51 -43
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterCalendar/FilterCalendar.css +3 -4
- package/src/components/FilterCalendar/components/Footer.tsx +42 -60
- package/src/core/components/calendar/Calendar.css +8 -1
- package/src/core/components/calendar/utils/calendarSelectionRules.tsx +26 -5
- package/src/locales/en/common.json +1 -2
- package/src/locales/fi/common.json +2 -3
package/lib/index.esm.js
CHANGED
|
@@ -2859,8 +2859,7 @@ var checkOutOnly$1 = "Check-out only";
|
|
|
2859
2859
|
var checkInOnly$1 = "Check-in only";
|
|
2860
2860
|
var errors$1 = {
|
|
2861
2861
|
calendarErrors: {
|
|
2862
|
-
checkInAvailabilityError: "All room reservations in a single purchase must be for the same dates."
|
|
2863
|
-
checkInAvailabilityGuide: "If you need reservations for different dates, please make a separate purchase."
|
|
2862
|
+
checkInAvailabilityError: "All room reservations in a single purchase must be for the same dates. If you need reservations for different dates, please make a separate purchase."
|
|
2864
2863
|
}
|
|
2865
2864
|
};
|
|
2866
2865
|
var enCommon = {
|
|
@@ -2925,11 +2924,10 @@ var clearDates = "Tyhjennä";
|
|
|
2925
2924
|
var noCheckIn = "Huone ei saatavilla";
|
|
2926
2925
|
var noCheckOut = "Uloskirjaus ei saatavilla";
|
|
2927
2926
|
var checkOutOnly = "Vain uloskirjaus";
|
|
2928
|
-
var checkInOnly = "Vain
|
|
2927
|
+
var checkInOnly = "Vain sisäänkirjaus";
|
|
2929
2928
|
var errors = {
|
|
2930
2929
|
calendarErrors: {
|
|
2931
|
-
checkInAvailabilityError: "Yhdellä ostolla tehdyt huonevaraukset tulee olla samalle ajankohdalle."
|
|
2932
|
-
checkInAvailabilityGuide: "Jos tarvitset huonevarauksia eri ajankohdille, ole hyvä ja tee uusi osto."
|
|
2930
|
+
checkInAvailabilityError: "Yhdellä ostolla tehdyt huonevaraukset tulee olla samalle ajankohdalle. Jos tarvitset huonevarauksia eri ajankohdille, ole hyvä ja tee uusi osto."
|
|
2933
2931
|
}
|
|
2934
2932
|
};
|
|
2935
2933
|
var fiCommon = {
|
|
@@ -11041,10 +11039,13 @@ var calendarSelectionRules = function (_a) {
|
|
|
11041
11039
|
var rangeContextTo = (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.to) ? endOfDay(rangeContext.to) : null;
|
|
11042
11040
|
// When some dates are not available for selection, the earliest date will be available only for "end"
|
|
11043
11041
|
// and the latest date will only be available for "start"
|
|
11042
|
+
var rangeFromDate = !range && calendarRangeFrom && calendarRangeTo
|
|
11043
|
+
? calendarRangeFrom
|
|
11044
|
+
: rangeFrom;
|
|
11044
11045
|
var overlappingDateFrom = (overlappingDate === null || overlappingDate === void 0 ? void 0 : overlappingDate.length)
|
|
11045
11046
|
? overlappingDate.find(function (date) {
|
|
11046
|
-
return !!(date.from &&
|
|
11047
|
-
? isEqual(endOfDay(date.from),
|
|
11047
|
+
return !!(date.from && rangeFromDate)
|
|
11048
|
+
? isEqual(endOfDay(date.from), rangeFromDate)
|
|
11048
11049
|
: false;
|
|
11049
11050
|
})
|
|
11050
11051
|
: null;
|
|
@@ -11071,8 +11072,16 @@ var calendarSelectionRules = function (_a) {
|
|
|
11071
11072
|
// Calendar selection rules: The cases are handled sequentially, starting from simple selections to more complex contextual selections.
|
|
11072
11073
|
// The rules are processed in a specific order, so one case is handled before another.
|
|
11073
11074
|
// Changing the order will cause the rules to break or not work properly.
|
|
11074
|
-
if (
|
|
11075
|
-
|
|
11075
|
+
if ((calendarRangeFrom &&
|
|
11076
|
+
overlappingDateFrom &&
|
|
11077
|
+
rangeFrom &&
|
|
11078
|
+
!isEqual(rangeFrom, calendarRangeFrom)) ||
|
|
11079
|
+
!range ||
|
|
11080
|
+
(calendarRangeFrom &&
|
|
11081
|
+
calendarRangeTo &&
|
|
11082
|
+
overlappingDateTo &&
|
|
11083
|
+
rangeTo &&
|
|
11084
|
+
!isEqual(rangeTo, calendarRangeTo))) {
|
|
11076
11085
|
// 1. If dates overlap, clear the selection.
|
|
11077
11086
|
return setCalendarRange(undefined);
|
|
11078
11087
|
}
|
|
@@ -11080,10 +11089,14 @@ var calendarSelectionRules = function (_a) {
|
|
|
11080
11089
|
// 2. If selected "start" is after "range context end", clear selection and display error.
|
|
11081
11090
|
// Also, if there are unavailable dates between the rangeContext "start" and "end", do not allow a fully overlapping selection.
|
|
11082
11091
|
(rangeFrom && rangeContextTo && isAfter(rangeFrom, rangeContextTo)) ||
|
|
11092
|
+
// In case of current rangeTo is after contextRange and user clicks the new check-in
|
|
11083
11093
|
(calendarRangeFrom &&
|
|
11084
11094
|
calendarRangeTo &&
|
|
11085
11095
|
rangeContextTo &&
|
|
11086
11096
|
rangeTo &&
|
|
11097
|
+
// If rangeTo has been adjusted, the current click was at the end
|
|
11098
|
+
// In this case we can verify if the new click (check-in-to-be) goes over the context range end
|
|
11099
|
+
!isEqual(rangeTo, calendarRangeTo) &&
|
|
11087
11100
|
isAfter(rangeTo, rangeContextTo))) {
|
|
11088
11101
|
setCalendarHasError && setCalendarHasError(true);
|
|
11089
11102
|
return setCalendarRange(undefined);
|
|
@@ -11105,6 +11118,9 @@ var calendarSelectionRules = function (_a) {
|
|
|
11105
11118
|
rangeTo &&
|
|
11106
11119
|
(checkOutRange === null || checkOutRange === void 0 ? void 0 : checkOutRange.lastCheckOut) &&
|
|
11107
11120
|
isAfter(rangeTo, endOfDay(checkOutRange.lastCheckOut)) &&
|
|
11121
|
+
// Handle case of existing range that span over the end of the context range
|
|
11122
|
+
((calendarRangeTo && !isEqual(rangeTo, calendarRangeTo)) ||
|
|
11123
|
+
!calendarRangeTo) &&
|
|
11108
11124
|
isAfter(rangeTo, endOfDay(rangeContext.to))) {
|
|
11109
11125
|
setCalendarHasError && setCalendarHasError(true);
|
|
11110
11126
|
return setCalendarRange(undefined);
|
|
@@ -11121,6 +11137,9 @@ var calendarSelectionRules = function (_a) {
|
|
|
11121
11137
|
rangeTo &&
|
|
11122
11138
|
(checkOutRange === null || checkOutRange === void 0 ? void 0 : checkOutRange.lastCheckOut) &&
|
|
11123
11139
|
isAfter(rangeTo, endOfDay(checkOutRange.lastCheckOut))) {
|
|
11140
|
+
if (overlappingDateTo) {
|
|
11141
|
+
return setCalendarRange(undefined);
|
|
11142
|
+
}
|
|
11124
11143
|
return setCalendarRange({ from: rangeTo, to: undefined });
|
|
11125
11144
|
}
|
|
11126
11145
|
if (calendarRangeFrom &&
|
|
@@ -11499,7 +11518,7 @@ var useUpdateDisabledDates = function (_a) {
|
|
|
11499
11518
|
var css_248z$9 = ".rdp {\n --rdp-cell-size: 40px;\n --rdp-caption-font-size: 18px;\n --rdp-accent-color: #0000ff;\n --rdp-background-color: #e7edff;\n --rdp-accent-color-dark: #3003e1;\n --rdp-background-color-dark: #180270;\n --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */\n --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */\n\n margin: 1em;\n}\n\n/* Hide elements for devices that are not screen readers */\n.rdp-vhidden {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n position: absolute !important;\n top: 0;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n overflow: hidden !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n border: 0 !important;\n}\n\n/* Buttons */\n.rdp-button_reset {\n appearance: none;\n position: relative;\n margin: 0;\n padding: 0;\n cursor: default;\n color: inherit;\n background: none;\n font: inherit;\n\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n\n.rdp-button_reset:focus-visible {\n /* Make sure to reset outline only when :focus-visible is supported */\n outline: none;\n}\n\n.rdp-button {\n border: 2px solid transparent;\n}\n\n.rdp-button[disabled]:not(.rdp-day_selected) {\n opacity: 0.25;\n}\n\n.rdp-button:not([disabled]) {\n cursor: pointer;\n}\n\n.rdp-button:focus-visible:not([disabled]) {\n color: inherit;\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n}\n\n.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {\n background-color: var(--rdp-background-color);\n}\n\n.rdp-months {\n display: flex;\n}\n\n.rdp-month {\n margin: 0 1em;\n}\n\n.rdp-month:first-child {\n margin-left: 0;\n}\n\n.rdp-month:last-child {\n margin-right: 0;\n}\n\n.rdp-table {\n margin: 0;\n max-width: calc(var(--rdp-cell-size) * 7);\n border-collapse: collapse;\n}\n\n.rdp-with_weeknumber .rdp-table {\n max-width: calc(var(--rdp-cell-size) * 8);\n border-collapse: collapse;\n}\n\n.rdp-caption {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n text-align: left;\n}\n\n.rdp-multiple_months .rdp-caption {\n position: relative;\n display: block;\n text-align: center;\n}\n\n.rdp-caption_dropdowns {\n position: relative;\n display: inline-flex;\n}\n\n.rdp-caption_label {\n position: relative;\n z-index: 1;\n display: inline-flex;\n align-items: center;\n margin: 0;\n padding: 0 0.25em;\n white-space: nowrap;\n color: currentColor;\n border: 0;\n border: 2px solid transparent;\n font-family: inherit;\n font-size: var(--rdp-caption-font-size);\n font-weight: bold;\n}\n\n.rdp-nav {\n white-space: nowrap;\n}\n\n.rdp-multiple_months .rdp-caption_start .rdp-nav {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n}\n\n.rdp-multiple_months .rdp-caption_end .rdp-nav {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n\n.rdp-nav_button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n padding: 0.25em;\n border-radius: 100%;\n}\n\n/* ---------- */\n/* Dropdowns */\n/* ---------- */\n\n.rdp-dropdown_year,\n.rdp-dropdown_month {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown {\n appearance: none;\n position: absolute;\n z-index: 2;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n opacity: 0;\n border: none;\n background-color: transparent;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.rdp-dropdown[disabled] {\n opacity: unset;\n color: unset;\n}\n\n.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n border-radius: 6px;\n}\n\n.rdp-dropdown_icon {\n margin: 0 0 0 5px;\n}\n\n.rdp-head {\n border: 0;\n}\n\n.rdp-head_row,\n.rdp-row {\n height: 100%;\n}\n\n.rdp-head_cell {\n vertical-align: middle;\n font-size: 0.75em;\n font-weight: 700;\n text-align: center;\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-transform: uppercase;\n}\n\n.rdp-tbody {\n border: 0;\n}\n\n.rdp-tfoot {\n margin: 0.5em;\n}\n\n.rdp-cell {\n width: var(--rdp-cell-size);\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-align: center;\n}\n\n.rdp-weeknumber {\n font-size: 0.75em;\n}\n\n.rdp-weeknumber,\n.rdp-day {\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--rdp-cell-size);\n max-width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n margin: 0;\n border: 2px solid transparent;\n border-radius: 100%;\n}\n\n.rdp-day_today:not(.rdp-day_outside) {\n font-weight: bold;\n}\n\n.rdp-day_selected,\n.rdp-day_selected:focus-visible,\n.rdp-day_selected:hover {\n color: white;\n opacity: 1;\n background-color: var(--rdp-accent-color);\n}\n\n.rdp-day_outside {\n opacity: 0.5;\n}\n\n.rdp-day_selected:focus-visible {\n /* Since the background is the same use again the outline */\n outline: var(--rdp-outline);\n outline-offset: 2px;\n z-index: 1;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp-day_range_end.rdp-day_range_start {\n border-radius: 100%;\n}\n\n.rdp-day_range_middle {\n border-radius: 0;\n}";
|
|
11500
11519
|
styleInject(css_248z$9);
|
|
11501
11520
|
|
|
11502
|
-
var css_248z$8 = ".will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n\n.will-calendar-filter-container .DayPicker {\n font-size: 25px;\n}\n\n.will-calendar-filter-container .rdp-month {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 70px;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 70px;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav {\n border: 1px solid var(--will-primary);\n border-radius: 50%;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav svg {\n color: var(--will-primary);\n}\n\n\n.will-calendar-filter-container .rdp-month .rdp-caption {\n position: initial;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,\n.will-calendar-filter-container .rdp-table .rdp-head {\n opacity: .6;\n}\n\n.will-calendar-filter-container .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {\n background-color: var(--will-primary);\n opacity: 1;\n}\n\n.will-calendar-filter-container .my-today:not(.rdp-day_selected) { \n font-weight: 700;\n opacity: 1;\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-cell {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-cell button {\n font-weight: 500;\n}\n\n.will-calendar-filter-container .rdp-cell button.booked {\n font-weight: 400;\n cursor: not-allowed;\n}\n\n.will-calendar-filter-container .rdp-cell .rdp-button[disabled] {\n color: var(--will-transparent-black);\n opacity: 1\n}\n\n@media (max-width: 960px) {\n .will-calendar-filter-container .rdp-month .rdp-nav {\n border: none;\n border-radius: initial;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 10px;\n }\n \n .will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 10px;\n }\n}\n\n/* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only {\n position: absolute;\n top: -42px;\n transform: translateX(calc(-50% + 20px));\n display: none;\n white-space: nowrap;\n z-index: 2;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only > div {\n background-color: white;\n position: relative;\n padding: 5px 10px;\n border: 1px solid var(--will-primary);\n border-radius: 5px;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only::before {\n content: \"\";\n width: 10px;\n height: 10px;\n border: 1px solid var(--will-primary);\n position: absolute;\n bottom: -4px;\n left:calc(50% - 5.555px);\n rotate: 45deg;\n z-index: 0;\n background-color: var(--will-white);\n}\n\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-out,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-overlapping-date,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-out-only,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-in-only {\n display: block;\n}\n\n/* Loading spinner */\n\n.will-root .will-calendar-filter-container .rdp-months {\n position: relative;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-spinner {\n position: absolute;\n top:0;\n bottom:0;\n left: 0;\n right: 0;\n background-color: var(--will-white-transparent);\n z-index: 3;\n display: none;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n}\n\n/* No active selection */\n\n.will-root .will-calendar-filter-container .no-active-selection-start,\n.will-root .will-calendar-filter-container .no-active-selection-mid,\n.will-root .will-calendar-filter-container .no-active-selection-end { \n position: initial;\n \n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before,\n.will-root .will-calendar-filter-container .no-active-selection-mid::before,\n.will-root .will-calendar-filter-container .no-active-selection-end::before { \n content: \"\";\n position: absolute;\n width:
|
|
11521
|
+
var css_248z$8 = ".will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n\n.will-calendar-filter-container .DayPicker {\n font-size: 25px;\n}\n\n.will-calendar-filter-container .rdp-month {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 70px;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 70px;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav {\n border: 1px solid var(--will-primary);\n border-radius: 50%;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav svg {\n color: var(--will-primary);\n}\n\n\n.will-calendar-filter-container .rdp-month .rdp-caption {\n position: initial;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,\n.will-calendar-filter-container .rdp-table .rdp-head {\n opacity: .6;\n}\n\n.will-calendar-filter-container .rdp-table {\n border-collapse: separate;\n border-spacing: 0px 2px;\n}\n\n.will-calendar-filter-container .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {\n background-color: var(--will-primary);\n opacity: 1;\n color: var(--will-white)\n}\n\n.will-calendar-filter-container .my-today:not(.rdp-day_selected) { \n font-weight: 700;\n opacity: 1;\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-cell {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-cell button {\n font-weight: 500;\n}\n\n.will-calendar-filter-container .rdp-cell button.booked {\n font-weight: 400;\n cursor: not-allowed;\n}\n\n.will-calendar-filter-container .rdp-cell .rdp-button[disabled] {\n color: var(--will-transparent-black);\n opacity: 1\n}\n\n@media (max-width: 960px) {\n .will-calendar-filter-container .rdp-month .rdp-nav {\n border: none;\n border-radius: initial;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 10px;\n }\n \n .will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 10px;\n }\n}\n\n/* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only {\n position: absolute;\n top: -42px;\n transform: translateX(calc(-50% + 20px));\n display: none;\n white-space: nowrap;\n z-index: 2;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only > div,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only > div {\n background-color: white;\n position: relative;\n padding: 5px 10px;\n border: 1px solid var(--will-primary);\n border-radius: 5px;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only::before,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only::before {\n content: \"\";\n width: 10px;\n height: 10px;\n border: 1px solid var(--will-primary);\n position: absolute;\n bottom: -4px;\n left:calc(50% - 5.555px);\n rotate: 45deg;\n z-index: 0;\n background-color: var(--will-white);\n}\n\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-out,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-overlapping-date,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-out-only,\n.will-root .will-calendar-filter-container .rdp-cell:hover .will-calendar-tooltip-check-in-only {\n display: block;\n}\n\n/* Loading spinner */\n\n.will-root .will-calendar-filter-container .rdp-months {\n position: relative;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-spinner {\n position: absolute;\n top:0;\n bottom:0;\n left: 0;\n right: 0;\n background-color: var(--will-white-transparent);\n z-index: 3;\n display: none;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n}\n\n/* No active selection */\n\n.will-root .will-calendar-filter-container .no-active-selection-start,\n.will-root .will-calendar-filter-container .no-active-selection-mid,\n.will-root .will-calendar-filter-container .no-active-selection-end { \n position: initial;\n \n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before,\n.will-root .will-calendar-filter-container .no-active-selection-mid::before,\n.will-root .will-calendar-filter-container .no-active-selection-end::before { \n content: \"\";\n position: absolute;\n width: 95%;\n height: 100%;\n border: 3px dashed var(--will-grey);\n box-sizing: border-box;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before {\n border-right: none;\n border-top-left-radius: 50%;\n border-bottom-left-radius: 50%;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-mid::before {\n border-right: none;\n border-left: none;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n border-left: none;\n border-top-right-radius: 50%;\n border-bottom-right-radius: 50%;\n}\n\n.will-root .will-calendar-filter-container .rdp-day_selected.rdp-day_range_middle.checkout-option {\n background-color: var(--will-primary-lightest);\n color: inherit;\n}\n\n/* Overlapping date */\n\n.will-root .will-calendar-filter-container .overlapping-date {\n user-select: none;\n pointer-events: none;\n}\n\n.will-root .will-calendar-filter-container .overlapping-date:hover {\n cursor: not-allowed;\n}\n\n@media (max-width: 600px) {\n /* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-overlapping-date,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out-only,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-in-only {\n top: -70px;\n white-space: wrap;\n max-width: 120px;\n}\n}\n\n\n";
|
|
11503
11522
|
styleInject(css_248z$8);
|
|
11504
11523
|
|
|
11505
11524
|
var Calendar = forwardRef(function (_a, ref) {
|
|
@@ -12111,44 +12130,33 @@ var useFilterCalendar = function (_a) {
|
|
|
12111
12130
|
var Footer = function (_a) {
|
|
12112
12131
|
var calendarHasError = _a.calendarHasError, calendarRange = _a.calendarRange, handleClearDates = _a.handleClearDates, language = _a.language, palette = _a.palette;
|
|
12113
12132
|
var t = useTranslation().t;
|
|
12114
|
-
|
|
12133
|
+
reactResponsiveExports.useMediaQuery({ maxWidth: 600 });
|
|
12115
12134
|
var nights = nightsCount({
|
|
12116
12135
|
calendarRange: calendarRange,
|
|
12117
12136
|
});
|
|
12118
|
-
return (React__default__default.createElement(
|
|
12119
|
-
React__default__default.createElement("div", { className: "will-calendar-footer-
|
|
12120
|
-
React__default__default.createElement("div", { className: "will-calendar-footer-
|
|
12121
|
-
calendarHasError ? (React__default__default.createElement("span", null, t("common:errors.calendarErrors.checkInAvailabilityGuide"))) : (React__default__default.createElement("div", null,
|
|
12122
|
-
React__default__default.createElement("span", null, parseDate({
|
|
12123
|
-
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12124
|
-
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12125
|
-
language: language,
|
|
12126
|
-
}) || t('common:checkIn')),
|
|
12127
|
-
React__default__default.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
|
|
12128
|
-
React__default__default.createElement("span", null, parseDate({
|
|
12129
|
-
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12130
|
-
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12131
|
-
language: language,
|
|
12132
|
-
}) || t('common:checkOut')))),
|
|
12133
|
-
React__default__default.createElement("span", { className: "will-calendar-footer-booked" }, calendarHasError
|
|
12134
|
-
? "".concat(1, " ").concat(t("common:night"), " min")
|
|
12135
|
-
: nights
|
|
12136
|
-
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12137
|
-
: '')),
|
|
12138
|
-
React__default__default.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
|
|
12139
|
-
isMobile &&
|
|
12137
|
+
return (React__default__default.createElement("div", { className: "will-calendar-footer-actions-wrapper" },
|
|
12138
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-dates" },
|
|
12139
|
+
calendarHasError ? (React__default__default.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
|
|
12140
12140
|
renderCalendarErrorMessage({
|
|
12141
12141
|
palette: palette,
|
|
12142
12142
|
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12143
|
-
})),
|
|
12144
|
-
|
|
12145
|
-
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12143
|
+
}))) : (React__default__default.createElement("div", null,
|
|
12144
|
+
React__default__default.createElement("span", null, parseDate({
|
|
12145
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12146
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12147
|
+
language: language,
|
|
12148
|
+
}) || t('common:checkIn')),
|
|
12149
|
+
React__default__default.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
|
|
12150
|
+
React__default__default.createElement("span", null, parseDate({
|
|
12151
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12152
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12153
|
+
language: language,
|
|
12154
|
+
}) || t('common:checkOut')))),
|
|
12155
|
+
React__default__default.createElement("span", { className: "will-calendar-footer-booked" }, !calendarHasError && nights
|
|
12156
|
+
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12157
|
+
: '')),
|
|
12158
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-actions" },
|
|
12159
|
+
React__default__default.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))));
|
|
12152
12160
|
};
|
|
12153
12161
|
/////////
|
|
12154
12162
|
var renderCalendarErrorMessage = function (_a) {
|
|
@@ -12158,7 +12166,7 @@ var renderCalendarErrorMessage = function (_a) {
|
|
|
12158
12166
|
React__default__default.createElement("span", null, message || '')));
|
|
12159
12167
|
};
|
|
12160
12168
|
|
|
12161
|
-
var css_248z = ".will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n
|
|
12169
|
+
var css_248z = ".will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n max-width: 80%;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error span {\n display: inline-block;\n margin-left: 10px;\n}\n\n@media (max-width: 960px) {\n .will-root .will-calendar-wrapper {\n width: -webkit-fill-available;\n margin: 0 -6%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-header,\n .will-root .will-calendar-wrapper .will-calendar-main,\n .will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n flex-direction: column;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates {\n text-align: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n justify-content: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions {\n flex-direction: column;\n width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions button{\n width: 100%;\n margin-top: 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error {\n max-width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error span {\n text-align: center;\n margin-left: 5px;\n }\n }\n\n.will-root .will-calendar-wrapper .will-calendar-header .will-filter-bar-close-button {\n position: initial;\n}";
|
|
12162
12170
|
styleInject(css_248z);
|
|
12163
12171
|
|
|
12164
12172
|
function FilterCalendar(_a) {
|