willba-component-library 0.2.71 → 0.2.72
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/components/FilterCalendar/components/Footer.d.ts +10 -0
- package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +3 -2
- package/lib/index.esm.js +164 -62
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +164 -62
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +164 -62
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/IconsSvg.tsx +2 -0
- package/src/components/FilterBar/components/buttons/tab-button/TabButton.css +1 -1
- package/src/components/FilterCalendar/FilterCalendar.css +14 -10
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +177 -426
- package/src/components/FilterCalendar/FilterCalendar.tsx +10 -91
- package/src/components/FilterCalendar/components/Footer.tsx +114 -0
- package/src/core/components/buttons/submit-button/SubmitButton.css +2 -0
- package/src/core/components/calendar/Calendar.css +18 -11
- package/src/core/components/calendar/Calendar.tsx +2 -1
- package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +2 -0
- package/src/core/components/calendar/utils/checkForContinuousSelection.tsx +45 -12
- package/src/themes/Default.css +7 -5
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateRange } from 'react-day-picker';
|
|
3
|
+
import { Palette } from '../../../themes/useTheme';
|
|
4
|
+
export declare const Footer: ({ calendarHasError, calendarRange, handleClearDates, language, palette, }: {
|
|
5
|
+
calendarHasError: boolean;
|
|
6
|
+
calendarRange?: DateRange | undefined;
|
|
7
|
+
handleClearDates: () => void;
|
|
8
|
+
language?: string | undefined;
|
|
9
|
+
palette: Palette;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DateRange } from 'react-day-picker';
|
|
2
|
-
import { RangeContext } from '../CalendarTypes';
|
|
2
|
+
import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
|
|
3
3
|
type Props = {
|
|
4
4
|
setCalendarHasError?: (arg: boolean) => void;
|
|
5
5
|
rangeContext?: RangeContext;
|
|
6
6
|
calendarRange?: DateRange;
|
|
7
7
|
calendarHasError?: boolean;
|
|
8
|
+
disabledDates?: DisableCalendarDates['disabledDates'];
|
|
8
9
|
};
|
|
9
|
-
export declare const checkForContinuousSelection: ({ setCalendarHasError, rangeContext, calendarRange, calendarHasError, }: Props) => void;
|
|
10
|
+
export declare const checkForContinuousSelection: ({ setCalendarHasError, rangeContext, calendarRange, calendarHasError, disabledDates, }: Props) => void;
|
|
10
11
|
export {};
|
package/lib/index.esm.js
CHANGED
|
@@ -527,7 +527,7 @@ function useTheme(_a) {
|
|
|
527
527
|
return themePalette;
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
var css_248z$c = "@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');\n\n.will-root * {\n font-family: 'Montserrat', sans-serif;\n}\n\n.will-root {\n \n box-sizing: border-box;\n font-size: 14px;\n \n color: #1E1E1E;\n \n /* Palette */\n --will-primary: #374269;\n --will-secondary: #374269;\n --will-grey: #ABA7AF;\n --will-white: #fff;\n --will-white-transparent: #ffffffcf;\n --will-black: #000;\n --will-onahau: #CDEEFF;\n --will-text: #5A5959;\n --will-charcoal-blue: #384265;\n --will-transparent-white: rgba(255, 255, 255, 0.30);\n --will-transparent-
|
|
530
|
+
var css_248z$c = "@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');\n\n.will-root * {\n font-family: 'Montserrat', sans-serif;\n}\n\n.will-root {\n \n box-sizing: border-box;\n font-size: 14px;\n \n color: #1E1E1E;\n \n /* Palette */\n --will-primary: #374269;\n --will-secondary: #374269;\n --will-grey: #ABA7AF;\n --will-white: #fff;\n --will-white-transparent: #ffffffcf;\n --will-black: #000;\n --will-onahau: #CDEEFF;\n --will-text: #5A5959;\n --will-charcoal-blue: #384265;\n --will-error: #d32f2f;\n\n /* Transparent */\n --will-transparent-black: rgba(0, 0, 0, 0.5);\n --will-transparent-white: rgba(255, 255, 255, 0.30);\n --will-transparent-lavender: rgba(171, 167, 175, 0.30);\n\n /* Color mix */\n --will-primary-lighter: color-mix(in srgb, var(--will-primary), white 50%);\n --will-primary-lightest: color-mix(in srgb, var(--will-primary), white 80%);\n\n\n /* Shadows */\n --will-box-shadow-dark: 0px 2px 12px 2px #a1a1a180;\n --will-box-shadow-light: 0px 2px 12px 2px #bcb9b980;\n\n /* Breakpoints */\n --will-lg: 1140px;\n --will-md: 960px;\n --will-sm: 600px;\n --will-xl: 1280px;\n --will-xs: 0px;\n}\n\n/* Typography */\n\n.will-root h1, h2, h3, h4, h5, h6 {\n font-weight: 700;\n} \n\n.will-root p, h1, h2, h3, h4, h5, h6, span {\n margin: 0;\n padding: 0;\n}\n\n\n/* Integration fixes */\n\n.will-root p {\n margin: 0 !important;\n}\n\n.will-root button {\n line-height: normal !important;\n}\n";
|
|
531
531
|
styleInject(css_248z$c);
|
|
532
532
|
|
|
533
533
|
var useAwaitRender = function () {
|
|
@@ -2991,7 +2991,7 @@ var useCloseFilterSection = function (_a) {
|
|
|
2991
2991
|
return { filtersRef: filtersRef };
|
|
2992
2992
|
};
|
|
2993
2993
|
|
|
2994
|
-
var css_248z$b = ".will-filter-bar-submit-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n user-select: none;\n}\n\n/* Submit button variants */\n.will-filter-bar-submit-button.default {\n background-color: var(--will-primary);\n color: var(--will-white);\n}\n\n.will-filter-bar-submit-button.text {\n background-color: transparent;\n color: var(--will-black);\n text-decoration: underline;\n font-weight: 500;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n display: flex;\n}\n\nbutton.will-filter-bar-submit-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n\n@media (max-width: 960px) {\n .will-filter-bar-submit-button {\n justify-content: center;\n \n }\n}\n\n/* --- */\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n";
|
|
2994
|
+
var css_248z$b = ".will-filter-bar-submit-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n user-select: none;\n}\n\n/* Submit button variants */\n.will-filter-bar-submit-button.default {\n background-color: var(--will-primary);\n color: var(--will-white);\n}\n\n.will-filter-bar-submit-button.text {\n background-color: transparent;\n color: var(--will-black);\n text-decoration: underline;\n font-weight: 500;\n font-size: 15px;\n padding: 0 10px;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n display: flex;\n}\n\nbutton.will-filter-bar-submit-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n\n@media (max-width: 960px) {\n .will-filter-bar-submit-button {\n justify-content: center;\n \n }\n}\n\n/* --- */\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n";
|
|
2995
2995
|
styleInject(css_248z$b);
|
|
2996
2996
|
|
|
2997
2997
|
var SubmitButton = function (_a) {
|
|
@@ -3495,6 +3495,78 @@ function addYears(dirtyDate, dirtyAmount) {
|
|
|
3495
3495
|
return addMonths(dirtyDate, amount * 12);
|
|
3496
3496
|
}
|
|
3497
3497
|
|
|
3498
|
+
/**
|
|
3499
|
+
* @name areIntervalsOverlapping
|
|
3500
|
+
* @category Interval Helpers
|
|
3501
|
+
* @summary Is the given time interval overlapping with another time interval?
|
|
3502
|
+
*
|
|
3503
|
+
* @description
|
|
3504
|
+
* Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping.
|
|
3505
|
+
*
|
|
3506
|
+
* @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}
|
|
3507
|
+
* @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}
|
|
3508
|
+
* @param {Object} [options] - the object with options
|
|
3509
|
+
* @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not
|
|
3510
|
+
* @returns {Boolean} whether the time intervals are overlapping
|
|
3511
|
+
* @throws {TypeError} 2 arguments required
|
|
3512
|
+
* @throws {RangeError} The start of an interval cannot be after its end
|
|
3513
|
+
* @throws {RangeError} Date in interval cannot be `Invalid Date`
|
|
3514
|
+
*
|
|
3515
|
+
* @example
|
|
3516
|
+
* // For overlapping time intervals:
|
|
3517
|
+
* areIntervalsOverlapping(
|
|
3518
|
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
|
3519
|
+
* { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
|
|
3520
|
+
* )
|
|
3521
|
+
* //=> true
|
|
3522
|
+
*
|
|
3523
|
+
* @example
|
|
3524
|
+
* // For non-overlapping time intervals:
|
|
3525
|
+
* areIntervalsOverlapping(
|
|
3526
|
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
|
3527
|
+
* { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
|
|
3528
|
+
* )
|
|
3529
|
+
* //=> false
|
|
3530
|
+
*
|
|
3531
|
+
* @example
|
|
3532
|
+
* // For adjacent time intervals:
|
|
3533
|
+
* areIntervalsOverlapping(
|
|
3534
|
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
|
3535
|
+
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
|
|
3536
|
+
* )
|
|
3537
|
+
* //=> false
|
|
3538
|
+
*
|
|
3539
|
+
* @example
|
|
3540
|
+
* // Using the inclusive option:
|
|
3541
|
+
* areIntervalsOverlapping(
|
|
3542
|
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
|
3543
|
+
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
|
|
3544
|
+
* )
|
|
3545
|
+
* //=> false
|
|
3546
|
+
* areIntervalsOverlapping(
|
|
3547
|
+
* { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
|
|
3548
|
+
* { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
|
|
3549
|
+
* { inclusive: true }
|
|
3550
|
+
* )
|
|
3551
|
+
* //=> true
|
|
3552
|
+
*/
|
|
3553
|
+
function areIntervalsOverlapping(intervalLeft, intervalRight, options) {
|
|
3554
|
+
requiredArgs(2, arguments);
|
|
3555
|
+
var leftStartTime = toDate(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.start).getTime();
|
|
3556
|
+
var leftEndTime = toDate(intervalLeft === null || intervalLeft === void 0 ? void 0 : intervalLeft.end).getTime();
|
|
3557
|
+
var rightStartTime = toDate(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.start).getTime();
|
|
3558
|
+
var rightEndTime = toDate(intervalRight === null || intervalRight === void 0 ? void 0 : intervalRight.end).getTime();
|
|
3559
|
+
|
|
3560
|
+
// Throw an exception if start date is after end date or if any date is `Invalid Date`
|
|
3561
|
+
if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {
|
|
3562
|
+
throw new RangeError('Invalid interval');
|
|
3563
|
+
}
|
|
3564
|
+
if (options !== null && options !== void 0 && options.inclusive) {
|
|
3565
|
+
return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;
|
|
3566
|
+
}
|
|
3567
|
+
return leftStartTime < rightEndTime && rightStartTime < leftEndTime;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3498
3570
|
/**
|
|
3499
3571
|
* @name max
|
|
3500
3572
|
* @category Common Helpers
|
|
@@ -7661,7 +7733,7 @@ function Caption(props) {
|
|
|
7661
7733
|
|
|
7662
7734
|
/** Render the Footer component (empty as default).*/
|
|
7663
7735
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7664
|
-
function Footer(props) {
|
|
7736
|
+
function Footer$1(props) {
|
|
7665
7737
|
var _a = useDayPicker(), footer = _a.footer, styles = _a.styles, tfoot = _a.classNames.tfoot;
|
|
7666
7738
|
if (!footer)
|
|
7667
7739
|
return React__default__default.createElement(React__default__default.Fragment, null);
|
|
@@ -8815,7 +8887,7 @@ function Table(props) {
|
|
|
8815
8887
|
});
|
|
8816
8888
|
var HeadComponent = (_a = components === null || components === void 0 ? void 0 : components.Head) !== null && _a !== void 0 ? _a : Head;
|
|
8817
8889
|
var RowComponent = (_b = components === null || components === void 0 ? void 0 : components.Row) !== null && _b !== void 0 ? _b : Row;
|
|
8818
|
-
var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer;
|
|
8890
|
+
var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer$1;
|
|
8819
8891
|
return (React__default__default.createElement("table", { id: props.id, className: classNames.table, style: styles.table, role: "grid", "aria-labelledby": props['aria-labelledby'] },
|
|
8820
8892
|
!hideHead && React__default__default.createElement(HeadComponent, null),
|
|
8821
8893
|
React__default__default.createElement("tbody", { className: classNames.tbody, style: styles.tbody }, weeks.map(function (week) { return (React__default__default.createElement(RowComponent, { displayMonth: props.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber })); })),
|
|
@@ -10923,6 +10995,8 @@ var IconsSvg = function (_a) {
|
|
|
10923
10995
|
verticalAlign: 'middle',
|
|
10924
10996
|
fill: fill,
|
|
10925
10997
|
overflow: 'hidden',
|
|
10998
|
+
minWidth: '25px',
|
|
10999
|
+
minHeight: '25px',
|
|
10926
11000
|
}, viewBox: "0 0 1024 1024", version: "1.1" },
|
|
10927
11001
|
React__default__default.createElement("path", { d: "M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z" })));
|
|
10928
11002
|
}
|
|
@@ -11221,27 +11295,41 @@ var handleRangeContextDisabledDates = function (_a) {
|
|
|
11221
11295
|
// set setCalendarHasError to true. This will display an error message and
|
|
11222
11296
|
// prevent the submission of the selected dates.
|
|
11223
11297
|
var checkForContinuousSelection = function (_a) {
|
|
11224
|
-
var setCalendarHasError = _a.setCalendarHasError, rangeContext = _a.rangeContext, calendarRange = _a.calendarRange, calendarHasError = _a.calendarHasError;
|
|
11225
|
-
var calendarRangeFrom = (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from)
|
|
11226
|
-
var calendarRangeTo = (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to)
|
|
11227
|
-
var rangeContextFrom = (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.from)
|
|
11228
|
-
var rangeContextTo = (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.to)
|
|
11298
|
+
var setCalendarHasError = _a.setCalendarHasError, rangeContext = _a.rangeContext, calendarRange = _a.calendarRange, calendarHasError = _a.calendarHasError, disabledDates = _a.disabledDates;
|
|
11299
|
+
var calendarRangeFrom = (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) && endOfDay(calendarRange.from);
|
|
11300
|
+
var calendarRangeTo = (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) && endOfDay(calendarRange.to);
|
|
11301
|
+
var rangeContextFrom = (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.from) && endOfDay(rangeContext.from);
|
|
11302
|
+
var rangeContextTo = (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.to) && endOfDay(rangeContext.to);
|
|
11229
11303
|
// Checking if rangeFrom is equal to or before rangeContextTo
|
|
11230
11304
|
var startIsEqualOrBeforeRangeContextEnd = calendarRangeFrom && rangeContextTo
|
|
11231
|
-
? isBefore(
|
|
11232
|
-
isEqual(
|
|
11305
|
+
? isBefore(calendarRangeFrom, rangeContextTo) ||
|
|
11306
|
+
isEqual(calendarRangeFrom, rangeContextTo)
|
|
11233
11307
|
: null;
|
|
11234
11308
|
// Checking if rangeTo is equal to or after rangeContextFrom
|
|
11235
11309
|
var endIsEqualOrAfterRangeContextStart = calendarRangeTo && rangeContextFrom && rangeContextTo
|
|
11236
|
-
? isAfter(
|
|
11237
|
-
isEqual(
|
|
11310
|
+
? isAfter(calendarRangeTo, rangeContextFrom) ||
|
|
11311
|
+
isEqual(calendarRangeTo, rangeContextFrom)
|
|
11238
11312
|
: null;
|
|
11313
|
+
// Check if selection overlapping unavailable dates
|
|
11314
|
+
var selectionOverlappingUnavailableDate = disabledDates === null || disabledDates === void 0 ? void 0 : disabledDates.find(function (range) {
|
|
11315
|
+
var rangeFrom = endOfDay(range.from);
|
|
11316
|
+
var rangeTo = endOfDay(range.to);
|
|
11317
|
+
return (rangeContextFrom &&
|
|
11318
|
+
rangeContextTo &&
|
|
11319
|
+
areIntervalsOverlapping({ start: rangeContextFrom, end: rangeContextTo }, { start: rangeFrom, end: rangeTo }) &&
|
|
11320
|
+
calendarRangeFrom &&
|
|
11321
|
+
calendarRangeTo &&
|
|
11322
|
+
areIntervalsOverlapping({ start: calendarRangeFrom, end: calendarRangeTo }, { start: rangeFrom, end: rangeTo }));
|
|
11323
|
+
});
|
|
11239
11324
|
useEffect(function () {
|
|
11240
11325
|
if ((rangeContext &&
|
|
11241
11326
|
calendarRangeFrom &&
|
|
11242
11327
|
!startIsEqualOrBeforeRangeContextEnd) ||
|
|
11243
|
-
(rangeContext &&
|
|
11244
|
-
|
|
11328
|
+
(rangeContext &&
|
|
11329
|
+
calendarRangeTo &&
|
|
11330
|
+
!endIsEqualOrAfterRangeContextStart) ||
|
|
11331
|
+
selectionOverlappingUnavailableDate) {
|
|
11332
|
+
!!(setCalendarHasError && !calendarHasError) && setCalendarHasError(true);
|
|
11245
11333
|
}
|
|
11246
11334
|
});
|
|
11247
11335
|
};
|
|
@@ -11268,6 +11356,8 @@ var useCalendarTooltips = function (_a) {
|
|
|
11268
11356
|
// Append children to parents
|
|
11269
11357
|
var tooltipClonesCheckIn = [];
|
|
11270
11358
|
var tooltipClonesCheckOut = [];
|
|
11359
|
+
var tooltipClonesCheckInOnly = [];
|
|
11360
|
+
var tooltipClonesCheckOutOnly = [];
|
|
11271
11361
|
var tooltipClonesSpinner = [];
|
|
11272
11362
|
var tooltipClonesOverlappingDates = [];
|
|
11273
11363
|
if (calendarTooltip && calendarButtons.length > 0) {
|
|
@@ -11288,12 +11378,14 @@ var useCalendarTooltips = function (_a) {
|
|
|
11288
11378
|
calendarCheckOutOnly.forEach(function (element) {
|
|
11289
11379
|
var tooltipClone = calendarTooltipCheckOutOnly.cloneNode(true);
|
|
11290
11380
|
element.appendChild(tooltipClone);
|
|
11381
|
+
tooltipClonesCheckOutOnly.push(tooltipClone);
|
|
11291
11382
|
});
|
|
11292
11383
|
}
|
|
11293
11384
|
if (calendarTooltipCheckInOnly && calendarCheckInOnly.length > 0) {
|
|
11294
11385
|
calendarCheckInOnly.forEach(function (element) {
|
|
11295
11386
|
var tooltipClone = calendarTooltipCheckInOnly.cloneNode(true);
|
|
11296
11387
|
element.appendChild(tooltipClone);
|
|
11388
|
+
tooltipClonesCheckInOnly.push(tooltipClone);
|
|
11297
11389
|
});
|
|
11298
11390
|
}
|
|
11299
11391
|
if (loadingSpinner && calendarMonthContainer) {
|
|
@@ -11313,6 +11405,8 @@ var useCalendarTooltips = function (_a) {
|
|
|
11313
11405
|
tooltipClonesCheckOut.forEach(function (clone) { return clone.remove(); });
|
|
11314
11406
|
tooltipClonesSpinner.forEach(function (clone) { return clone.remove(); });
|
|
11315
11407
|
tooltipClonesOverlappingDates.forEach(function (clone) { return clone.remove(); });
|
|
11408
|
+
tooltipClonesCheckInOnly.forEach(function (clone) { return clone.remove(); });
|
|
11409
|
+
tooltipClonesCheckOutOnly.forEach(function (clone) { return clone.remove(); });
|
|
11316
11410
|
};
|
|
11317
11411
|
});
|
|
11318
11412
|
};
|
|
@@ -11394,7 +11488,7 @@ var useUpdateDisabledDates = function (_a) {
|
|
|
11394
11488
|
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}";
|
|
11395
11489
|
styleInject(css_248z$9);
|
|
11396
11490
|
|
|
11397
|
-
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
|
|
11491
|
+
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: 100%;\n height: 100%;\n border: 3px dashed var(--will-grey);\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";
|
|
11398
11492
|
styleInject(css_248z$8);
|
|
11399
11493
|
|
|
11400
11494
|
var Calendar = forwardRef(function (_a, ref) {
|
|
@@ -11454,6 +11548,7 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
11454
11548
|
rangeContext: rangeContext,
|
|
11455
11549
|
calendarRange: calendarRange,
|
|
11456
11550
|
calendarHasError: calendarHasError,
|
|
11551
|
+
disabledDates: newDisableCalendarDates === null || newDisableCalendarDates === void 0 ? void 0 : newDisableCalendarDates.disabledDates,
|
|
11457
11552
|
});
|
|
11458
11553
|
return (React__default__default.createElement("div", { className: "will-filter-bar-calendar", ref: ref },
|
|
11459
11554
|
React__default__default.createElement("div", { className: "will-calendar-filter-container" },
|
|
@@ -11735,7 +11830,7 @@ var SelectButton = function (_a) {
|
|
|
11735
11830
|
React__default__default.createElement("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })))));
|
|
11736
11831
|
};
|
|
11737
11832
|
|
|
11738
|
-
var css_248z$6 = ".will-filter-bar-tab-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n font-size: 16px;\n display: flex;\n align-items: center;\n background-color: transparent;\n user-select: none;\n font-weight: 600;\n border-radius: 50px;\n }\n\n .will-filter-bar-tab-button.light {\n color: var(--will-white)\n }\n\n .will-filter-bar-tab-button.dark {\n color: var(--will-black)\n }\n\n .will-filter-bar-tab-button.light.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-white);\n }\n\n .will-filter-bar-tab-button.dark.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-
|
|
11833
|
+
var css_248z$6 = ".will-filter-bar-tab-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n font-size: 16px;\n display: flex;\n align-items: center;\n background-color: transparent;\n user-select: none;\n font-weight: 600;\n border-radius: 50px;\n }\n\n .will-filter-bar-tab-button.light {\n color: var(--will-white)\n }\n\n .will-filter-bar-tab-button.dark {\n color: var(--will-black)\n }\n\n .will-filter-bar-tab-button.light.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-white);\n }\n\n .will-filter-bar-tab-button.dark.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-lavender);\n }\n\n \n\n";
|
|
11739
11834
|
styleInject(css_248z$6);
|
|
11740
11835
|
|
|
11741
11836
|
var TabButton = function (_a) {
|
|
@@ -12002,7 +12097,57 @@ var useFilterCalendar = function (_a) {
|
|
|
12002
12097
|
};
|
|
12003
12098
|
};
|
|
12004
12099
|
|
|
12005
|
-
var
|
|
12100
|
+
var Footer = function (_a) {
|
|
12101
|
+
var calendarHasError = _a.calendarHasError, calendarRange = _a.calendarRange, handleClearDates = _a.handleClearDates, language = _a.language, palette = _a.palette;
|
|
12102
|
+
var t = useTranslation().t;
|
|
12103
|
+
var isMobile = reactResponsiveExports.useMediaQuery({ maxWidth: 600 });
|
|
12104
|
+
var nights = nightsCount({
|
|
12105
|
+
calendarRange: calendarRange,
|
|
12106
|
+
});
|
|
12107
|
+
return (React__default__default.createElement(React__default__default.Fragment, null,
|
|
12108
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-actions-wrapper" },
|
|
12109
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-dates" },
|
|
12110
|
+
calendarHasError ? (React__default__default.createElement("span", null, t("common:errors.calendarErrors.checkInAvailabilityGuide"))) : (React__default__default.createElement("div", null,
|
|
12111
|
+
React__default__default.createElement("span", null, parseDate({
|
|
12112
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12113
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12114
|
+
language: language,
|
|
12115
|
+
}) || t('common:checkIn')),
|
|
12116
|
+
React__default__default.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
|
|
12117
|
+
React__default__default.createElement("span", null, parseDate({
|
|
12118
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12119
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12120
|
+
language: language,
|
|
12121
|
+
}) || t('common:checkOut')))),
|
|
12122
|
+
React__default__default.createElement("span", { className: "will-calendar-footer-booked" }, calendarHasError
|
|
12123
|
+
? t("filterBar:calendar.minNights")
|
|
12124
|
+
: nights
|
|
12125
|
+
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12126
|
+
: '')),
|
|
12127
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
|
|
12128
|
+
isMobile &&
|
|
12129
|
+
renderCalendarErrorMessage({
|
|
12130
|
+
palette: palette,
|
|
12131
|
+
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12132
|
+
})),
|
|
12133
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-actions" },
|
|
12134
|
+
React__default__default.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))),
|
|
12135
|
+
React__default__default.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
|
|
12136
|
+
!isMobile &&
|
|
12137
|
+
renderCalendarErrorMessage({
|
|
12138
|
+
palette: palette,
|
|
12139
|
+
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12140
|
+
}))));
|
|
12141
|
+
};
|
|
12142
|
+
/////////
|
|
12143
|
+
var renderCalendarErrorMessage = function (_a) {
|
|
12144
|
+
var message = _a.message, palette = _a.palette;
|
|
12145
|
+
return (React__default__default.createElement(React__default__default.Fragment, null,
|
|
12146
|
+
React__default__default.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }),
|
|
12147
|
+
React__default__default.createElement("span", null, message || '')));
|
|
12148
|
+
};
|
|
12149
|
+
|
|
12150
|
+
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 align-items: center;\n margin-top: 10px;\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 margin-top: 10px;\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}";
|
|
12006
12151
|
styleInject(css_248z);
|
|
12007
12152
|
|
|
12008
12153
|
function FilterCalendar(_a) {
|
|
@@ -12011,7 +12156,6 @@ function FilterCalendar(_a) {
|
|
|
12011
12156
|
// Translations
|
|
12012
12157
|
useUpdateTranslations({ language: language });
|
|
12013
12158
|
var t = useTranslation().t;
|
|
12014
|
-
var isMobile = reactResponsiveExports.useMediaQuery({ maxWidth: 690 });
|
|
12015
12159
|
var _b = useFilterCalendar({
|
|
12016
12160
|
onSubmit: onSubmit,
|
|
12017
12161
|
setToggleCalendar: setToggleCalendar,
|
|
@@ -12026,9 +12170,6 @@ function FilterCalendar(_a) {
|
|
|
12026
12170
|
var filtersRef = useCloseFilterSection({
|
|
12027
12171
|
handleSelectedFilter: setToggleCalendar,
|
|
12028
12172
|
}).filtersRef;
|
|
12029
|
-
var nights = nightsCount({
|
|
12030
|
-
calendarRange: calendarRange,
|
|
12031
|
-
});
|
|
12032
12173
|
return (React__default__default.createElement("div", { className: "will-root", style: themePalette }, toggleCalendar && (React__default__default.createElement("div", { className: "will-calendar-wrapper", ref: filtersRef },
|
|
12033
12174
|
React__default__default.createElement("div", { className: "will-calendar-header" },
|
|
12034
12175
|
React__default__default.createElement("h2", null, t('filterBar:calendar.title')),
|
|
@@ -12036,47 +12177,8 @@ function FilterCalendar(_a) {
|
|
|
12036
12177
|
React__default__default.createElement("div", { className: "will-calendar-main" },
|
|
12037
12178
|
React__default__default.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, setDisabledDates: setDisabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError })),
|
|
12038
12179
|
React__default__default.createElement("div", { className: "will-calendar-footer" },
|
|
12039
|
-
React__default__default.createElement(
|
|
12040
|
-
React__default__default.createElement("div", { className: "will-calendar-footer-dates" },
|
|
12041
|
-
calendarHasError ? (React__default__default.createElement("span", null, t("common:errors.calendarErrors.checkInAvailabilityGuide"))) : (React__default__default.createElement("div", null,
|
|
12042
|
-
React__default__default.createElement("span", null, parseDate({
|
|
12043
|
-
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12044
|
-
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12045
|
-
language: language,
|
|
12046
|
-
}) || t('common:checkIn')),
|
|
12047
|
-
React__default__default.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
|
|
12048
|
-
React__default__default.createElement("span", null, parseDate({
|
|
12049
|
-
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12050
|
-
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12051
|
-
language: language,
|
|
12052
|
-
}) || t('common:checkOut')))),
|
|
12053
|
-
React__default__default.createElement("span", { className: "will-calendar-footer-booked" }, calendarHasError
|
|
12054
|
-
? t("filterBar:calendar.minNights")
|
|
12055
|
-
: nights
|
|
12056
|
-
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12057
|
-
: '')),
|
|
12058
|
-
calendarHasError &&
|
|
12059
|
-
isMobile &&
|
|
12060
|
-
renderCalendarErrorMessage({
|
|
12061
|
-
palette: palette,
|
|
12062
|
-
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12063
|
-
}),
|
|
12064
|
-
React__default__default.createElement("div", { className: "will-calendar-footer-actions" },
|
|
12065
|
-
React__default__default.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))),
|
|
12066
|
-
calendarHasError &&
|
|
12067
|
-
!isMobile &&
|
|
12068
|
-
renderCalendarErrorMessage({
|
|
12069
|
-
palette: palette,
|
|
12070
|
-
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12071
|
-
}))))));
|
|
12180
|
+
React__default__default.createElement(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }))))));
|
|
12072
12181
|
}
|
|
12073
|
-
/////////
|
|
12074
|
-
var renderCalendarErrorMessage = function (_a) {
|
|
12075
|
-
var message = _a.message, palette = _a.palette;
|
|
12076
|
-
return (React__default__default.createElement("div", { className: "will-calendar-footer-error" },
|
|
12077
|
-
React__default__default.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }),
|
|
12078
|
-
React__default__default.createElement("span", { style: { marginLeft: '10px' } }, message || '')));
|
|
12079
|
-
};
|
|
12080
12182
|
|
|
12081
12183
|
export { Button$1 as Button, FilterBar, FilterCalendar };
|
|
12082
12184
|
//# sourceMappingURL=index.esm.js.map
|