willba-component-library 0.3.11 → 0.3.13
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/README.md +6 -18
- package/lib/assets/IconsSvg.d.ts +1 -2
- package/lib/components/Button/Button.d.ts +6 -6
- package/lib/components/FilterBar/FilterBar.d.ts +1 -1
- package/lib/components/FilterBar/FilterBarTypes.d.ts +1 -1
- package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +1 -2
- package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +1 -2
- package/lib/components/FilterBar/components/cards/image-card/ImageCard.d.ts +1 -2
- package/lib/components/FilterBar/components/categories/Categories.d.ts +1 -2
- package/lib/components/FilterBar/components/common/FilterSectionHeader.d.ts +2 -2
- package/lib/components/FilterBar/components/dates/Dates.d.ts +4 -4
- package/lib/components/FilterBar/components/divider/Divider.d.ts +1 -2
- package/lib/components/FilterBar/components/guests/Guests.d.ts +1 -2
- package/lib/components/FilterBar/components/locations/Locations.d.ts +1 -2
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -2
- package/lib/components/FilterCalendar/components/Footer.d.ts +1 -2
- package/lib/core/components/buttons/close-button/CloseButton.d.ts +1 -2
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -2
- package/lib/core/components/calendar/Calendar.d.ts +1 -2
- package/lib/index.d.ts +9 -9
- package/lib/index.esm.js +204 -290
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +291 -377
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +293 -380
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +1 -1
- package/src/components/Button/Button.stories.tsx +16 -16
- package/src/components/Button/Button.tsx +15 -15
- package/src/components/FilterBar/FilterBar.tsx +1 -1
- package/src/components/FilterBar/FilterBarTypes.ts +1 -1
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.tsx +12 -1
- package/src/components/FilterBar/components/common/FilterSectionHeader.tsx +1 -0
- package/src/components/FilterBar/components/dates/Dates.tsx +3 -4
- package/src/components/FilterBar/components/guests/Guests.tsx +10 -1
- package/src/components/FilterBar/utils/calculateDropdownPosition.tsx +0 -10
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +1 -1
- package/src/core/components/buttons/submit-button/SubmitButton.tsx +2 -1
- package/src/core/components/calendar/Calendar.tsx +6 -3
- package/stories/Button.tsx +16 -11
- package/stories/Header.tsx +28 -14
- package/stories/Page.tsx +39 -21
package/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React__default = require('react');
|
|
4
5
|
|
|
5
6
|
function _interopNamespaceDefault(e) {
|
|
6
7
|
var n = Object.create(null);
|
|
@@ -19,7 +20,7 @@ function _interopNamespaceDefault(e) {
|
|
|
19
20
|
return Object.freeze(n);
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
var
|
|
23
|
+
var React__default__namespace = /*#__PURE__*/_interopNamespaceDefault(React__default);
|
|
23
24
|
|
|
24
25
|
/******************************************************************************
|
|
25
26
|
Copyright (c) Microsoft Corporation.
|
|
@@ -218,9 +219,9 @@ styleInject(css_248z$h);
|
|
|
218
219
|
* Primary UI component for user interaction
|
|
219
220
|
*/
|
|
220
221
|
var Button$1 = function (_a) {
|
|
221
|
-
var _b = _a.type, type = _b === void 0 ?
|
|
222
|
-
var _d = __read(
|
|
223
|
-
return (
|
|
222
|
+
var _b = _a.type, type = _b === void 0 ? 'primary' : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 'medium' : _c, onClick = _a.onClick, label = _a.label;
|
|
223
|
+
var _d = __read(React__default.useState(4), 2), theState = _d[0]; _d[1];
|
|
224
|
+
return (jsxRuntime.jsx("button", { type: "button", className: classNames('storybook-button', "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick, children: "".concat(label, " ").concat(theState) }));
|
|
224
225
|
};
|
|
225
226
|
|
|
226
227
|
function warn() {
|
|
@@ -361,7 +362,7 @@ const initReactI18next = {
|
|
|
361
362
|
}
|
|
362
363
|
};
|
|
363
364
|
|
|
364
|
-
const I18nContext =
|
|
365
|
+
const I18nContext = React__default.createContext();
|
|
365
366
|
class ReportNamespaces {
|
|
366
367
|
constructor() {
|
|
367
368
|
this.usedNamespaces = {};
|
|
@@ -377,8 +378,8 @@ class ReportNamespaces {
|
|
|
377
378
|
}
|
|
378
379
|
|
|
379
380
|
const usePrevious = (value, ignore) => {
|
|
380
|
-
const ref =
|
|
381
|
-
|
|
381
|
+
const ref = React__default.useRef();
|
|
382
|
+
React__default.useEffect(() => {
|
|
382
383
|
ref.current = ignore ? ref.current : value;
|
|
383
384
|
}, [value, ignore]);
|
|
384
385
|
return ref.current;
|
|
@@ -391,7 +392,7 @@ function useTranslation(ns) {
|
|
|
391
392
|
const {
|
|
392
393
|
i18n: i18nFromContext,
|
|
393
394
|
defaultNS: defaultNSFromContext
|
|
394
|
-
} =
|
|
395
|
+
} = React__default.useContext(I18nContext) || {};
|
|
395
396
|
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
396
397
|
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
397
398
|
if (!i18n) {
|
|
@@ -424,12 +425,12 @@ function useTranslation(ns) {
|
|
|
424
425
|
function getT() {
|
|
425
426
|
return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
426
427
|
}
|
|
427
|
-
const [t, setT] =
|
|
428
|
+
const [t, setT] = React__default.useState(getT);
|
|
428
429
|
let joinedNS = namespaces.join();
|
|
429
430
|
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
430
431
|
const previousJoinedNS = usePrevious(joinedNS);
|
|
431
|
-
const isMounted =
|
|
432
|
-
|
|
432
|
+
const isMounted = React__default.useRef(true);
|
|
433
|
+
React__default.useEffect(() => {
|
|
433
434
|
const {
|
|
434
435
|
bindI18n,
|
|
435
436
|
bindI18nStore
|
|
@@ -460,8 +461,8 @@ function useTranslation(ns) {
|
|
|
460
461
|
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
|
|
461
462
|
};
|
|
462
463
|
}, [i18n, joinedNS]);
|
|
463
|
-
const isInitial =
|
|
464
|
-
|
|
464
|
+
const isInitial = React__default.useRef(true);
|
|
465
|
+
React__default.useEffect(() => {
|
|
465
466
|
if (isMounted.current && !isInitial.current) {
|
|
466
467
|
setT(getT);
|
|
467
468
|
}
|
|
@@ -489,7 +490,7 @@ var DefaultContext = {
|
|
|
489
490
|
style: undefined,
|
|
490
491
|
attr: undefined
|
|
491
492
|
};
|
|
492
|
-
var IconContext =
|
|
493
|
+
var IconContext = React__default.createContext && React__default.createContext(DefaultContext);
|
|
493
494
|
|
|
494
495
|
var __assign$1 = undefined && undefined.__assign || function () {
|
|
495
496
|
__assign$1 = Object.assign || function (t) {
|
|
@@ -511,7 +512,7 @@ var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
|
511
512
|
};
|
|
512
513
|
function Tree2Element(tree) {
|
|
513
514
|
return tree && tree.map(function (node, i) {
|
|
514
|
-
return
|
|
515
|
+
return React__default.createElement(node.tag, __assign$1({
|
|
515
516
|
key: i
|
|
516
517
|
}, node.attr), Tree2Element(node.child));
|
|
517
518
|
});
|
|
@@ -519,7 +520,7 @@ function Tree2Element(tree) {
|
|
|
519
520
|
function GenIcon(data) {
|
|
520
521
|
// eslint-disable-next-line react/display-name
|
|
521
522
|
return function (props) {
|
|
522
|
-
return
|
|
523
|
+
return React__default.createElement(IconBase, __assign$1({
|
|
523
524
|
attr: __assign$1({}, data.attr)
|
|
524
525
|
}, props), Tree2Element(data.child));
|
|
525
526
|
};
|
|
@@ -534,7 +535,7 @@ function IconBase(props) {
|
|
|
534
535
|
var className;
|
|
535
536
|
if (conf.className) className = conf.className;
|
|
536
537
|
if (props.className) className = (className ? className + " " : "") + props.className;
|
|
537
|
-
return
|
|
538
|
+
return React__default.createElement("svg", __assign$1({
|
|
538
539
|
stroke: "currentColor",
|
|
539
540
|
fill: "currentColor",
|
|
540
541
|
strokeWidth: "0"
|
|
@@ -546,9 +547,9 @@ function IconBase(props) {
|
|
|
546
547
|
height: computedSize,
|
|
547
548
|
width: computedSize,
|
|
548
549
|
xmlns: "http://www.w3.org/2000/svg"
|
|
549
|
-
}), title &&
|
|
550
|
+
}), title && React__default.createElement("title", null, title), props.children);
|
|
550
551
|
};
|
|
551
|
-
return IconContext !== undefined ?
|
|
552
|
+
return IconContext !== undefined ? React__default.createElement(IconContext.Consumer, null, function (conf) {
|
|
552
553
|
return elem(conf);
|
|
553
554
|
}) : elem(DefaultContext);
|
|
554
555
|
}
|
|
@@ -574,8 +575,8 @@ var css_248z$g = "@import url('https://fonts.googleapis.com/css2?family=Montserr
|
|
|
574
575
|
styleInject(css_248z$g);
|
|
575
576
|
|
|
576
577
|
var useAwaitRender = function () {
|
|
577
|
-
var _a = __read(
|
|
578
|
-
|
|
578
|
+
var _a = __read(React__default.useState(false), 2), initialRenderComplete = _a[0], setInitialRenderComplete = _a[1];
|
|
579
|
+
React__default.useEffect(function () {
|
|
579
580
|
setInitialRenderComplete(true);
|
|
580
581
|
}, []);
|
|
581
582
|
if (!initialRenderComplete)
|
|
@@ -2970,8 +2971,8 @@ instance.use(initReactI18next).init({
|
|
|
2970
2971
|
|
|
2971
2972
|
var useUpdateTranslations = function (_a) {
|
|
2972
2973
|
var language = _a.language;
|
|
2973
|
-
var _b = __read(
|
|
2974
|
-
|
|
2974
|
+
var _b = __read(React__default.useState(0), 2); _b[0]; var setRerenderKey = _b[1];
|
|
2975
|
+
React__default.useEffect(function () {
|
|
2975
2976
|
instance.changeLanguage(language);
|
|
2976
2977
|
setRerenderKey(function (prevKey) { return prevKey + 1; });
|
|
2977
2978
|
}, [language]);
|
|
@@ -2980,8 +2981,8 @@ var useUpdateTranslations = function (_a) {
|
|
|
2980
2981
|
// TODO - Refactor and rename this hook
|
|
2981
2982
|
var useCloseFilterSection = function (_a) {
|
|
2982
2983
|
var handleSelectedFilter = _a.handleSelectedFilter;
|
|
2983
|
-
var filtersRef =
|
|
2984
|
-
|
|
2984
|
+
var filtersRef = React__default.useRef(null);
|
|
2985
|
+
React__default.useEffect(function () {
|
|
2985
2986
|
var handleClickOutside = function (event) {
|
|
2986
2987
|
if (filtersRef.current &&
|
|
2987
2988
|
!filtersRef.current.contains(event.target)) {
|
|
@@ -2997,8 +2998,8 @@ var useCloseFilterSection = function (_a) {
|
|
|
2997
2998
|
};
|
|
2998
2999
|
|
|
2999
3000
|
var useAutoFocus = function (autoFocus) {
|
|
3000
|
-
var ref =
|
|
3001
|
-
|
|
3001
|
+
var ref = React__default.useRef(null);
|
|
3002
|
+
React__default.useEffect(function () {
|
|
3002
3003
|
if (!autoFocus || !ref.current)
|
|
3003
3004
|
return;
|
|
3004
3005
|
var attemptFocus = function (attempts) {
|
|
@@ -3023,9 +3024,7 @@ styleInject(css_248z$f);
|
|
|
3023
3024
|
|
|
3024
3025
|
var SubmitButton = function (_a) {
|
|
3025
3026
|
var onClick = _a.onClick, startIcon = _a.startIcon, label = _a.label, disabled = _a.disabled, isLoading = _a.isLoading, variant = _a.variant;
|
|
3026
|
-
return (
|
|
3027
|
-
isLoading ? (React$1.createElement("span", null, React$1.createElement(FaSpinner, { style: { animation: 'spin 1s linear infinite' } }))) : (startIcon && React$1.createElement("span", null, startIcon)),
|
|
3028
|
-
label || 'Label'));
|
|
3027
|
+
return (jsxRuntime.jsxs("button", { className: "will-filter-bar-submit-button ".concat(variant || 'default'), onClick: onClick, disabled: disabled || isLoading, children: [isLoading ? (jsxRuntime.jsx("span", { children: jsxRuntime.jsx(FaSpinner, { style: { animation: 'spin 1s linear infinite' } }) })) : (startIcon && jsxRuntime.jsx("span", { children: startIcon })), label || 'Label'] }));
|
|
3029
3028
|
};
|
|
3030
3029
|
|
|
3031
3030
|
// THIS FILE IS AUTO GENERATED
|
|
@@ -3038,8 +3037,7 @@ styleInject(css_248z$e);
|
|
|
3038
3037
|
|
|
3039
3038
|
var CloseButton = function (_a) {
|
|
3040
3039
|
var handleClose = _a.handleClose;
|
|
3041
|
-
return (
|
|
3042
|
-
React$1.createElement(IoIosCloseCircleOutline, null)));
|
|
3040
|
+
return (jsxRuntime.jsx("button", { className: "will-filter-bar-close-button", onClick: handleClose, children: jsxRuntime.jsx(IoIosCloseCircleOutline, {}) }));
|
|
3043
3041
|
};
|
|
3044
3042
|
|
|
3045
3043
|
function _typeof(o) {
|
|
@@ -7320,7 +7318,7 @@ function parseFromToProps(props) {
|
|
|
7320
7318
|
*
|
|
7321
7319
|
* Access to this context from the {@link useDayPicker} hook.
|
|
7322
7320
|
*/
|
|
7323
|
-
var DayPickerContext =
|
|
7321
|
+
var DayPickerContext = React__default.createContext(undefined);
|
|
7324
7322
|
/**
|
|
7325
7323
|
* The provider for the {@link DayPickerContext}, assigning the defaults from the
|
|
7326
7324
|
* initial DayPicker props.
|
|
@@ -7342,7 +7340,7 @@ function DayPickerProvider(props) {
|
|
|
7342
7340
|
onSelect = initialProps.onSelect;
|
|
7343
7341
|
}
|
|
7344
7342
|
var value = __assign(__assign(__assign({}, defaultContextValues), initialProps), { captionLayout: captionLayout, classNames: __assign(__assign({}, defaultContextValues.classNames), initialProps.classNames), components: __assign({}, initialProps.components), formatters: __assign(__assign({}, defaultContextValues.formatters), initialProps.formatters), fromDate: fromDate, labels: __assign(__assign({}, defaultContextValues.labels), initialProps.labels), mode: initialProps.mode || defaultContextValues.mode, modifiers: __assign(__assign({}, defaultContextValues.modifiers), initialProps.modifiers), modifiersClassNames: __assign(__assign({}, defaultContextValues.modifiersClassNames), initialProps.modifiersClassNames), onSelect: onSelect, styles: __assign(__assign({}, defaultContextValues.styles), initialProps.styles), toDate: toDate });
|
|
7345
|
-
return (
|
|
7343
|
+
return (React__default.createElement(DayPickerContext.Provider, { value: value }, props.children));
|
|
7346
7344
|
}
|
|
7347
7345
|
/**
|
|
7348
7346
|
* Hook to access the {@link DayPickerContextValue}.
|
|
@@ -7351,7 +7349,7 @@ function DayPickerProvider(props) {
|
|
|
7351
7349
|
* internal or custom components.
|
|
7352
7350
|
*/
|
|
7353
7351
|
function useDayPicker() {
|
|
7354
|
-
var context =
|
|
7352
|
+
var context = React__default.useContext(DayPickerContext);
|
|
7355
7353
|
if (!context) {
|
|
7356
7354
|
throw new Error("useDayPicker must be used within a DayPickerProvider.");
|
|
7357
7355
|
}
|
|
@@ -7361,15 +7359,15 @@ function useDayPicker() {
|
|
|
7361
7359
|
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
7362
7360
|
function CaptionLabel(props) {
|
|
7363
7361
|
var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;
|
|
7364
|
-
return (
|
|
7362
|
+
return (React__default.createElement("div", { className: classNames.caption_label, style: styles.caption_label, "aria-live": "polite", role: "presentation", id: props.id }, formatCaption(props.displayMonth, { locale: locale })));
|
|
7365
7363
|
}
|
|
7366
7364
|
|
|
7367
7365
|
/**
|
|
7368
7366
|
* Render the icon in the styled drop-down.
|
|
7369
7367
|
*/
|
|
7370
7368
|
function IconDropdown(props) {
|
|
7371
|
-
return (
|
|
7372
|
-
|
|
7369
|
+
return (React__default.createElement("svg", __assign({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, props),
|
|
7370
|
+
React__default.createElement("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" })));
|
|
7373
7371
|
}
|
|
7374
7372
|
|
|
7375
7373
|
/**
|
|
@@ -7381,12 +7379,12 @@ function Dropdown(props) {
|
|
|
7381
7379
|
var onChange = props.onChange, value = props.value, children = props.children, caption = props.caption, className = props.className, style = props.style;
|
|
7382
7380
|
var dayPicker = useDayPicker();
|
|
7383
7381
|
var IconDropdownComponent = (_b = (_a = dayPicker.components) === null || _a === void 0 ? void 0 : _a.IconDropdown) !== null && _b !== void 0 ? _b : IconDropdown;
|
|
7384
|
-
return (
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7382
|
+
return (React__default.createElement("div", { className: className, style: style },
|
|
7383
|
+
React__default.createElement("span", { className: dayPicker.classNames.vhidden }, props['aria-label']),
|
|
7384
|
+
React__default.createElement("select", { name: props.name, "aria-label": props['aria-label'], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value: value, onChange: onChange }, children),
|
|
7385
|
+
React__default.createElement("div", { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, "aria-hidden": "true" },
|
|
7388
7386
|
caption,
|
|
7389
|
-
|
|
7387
|
+
React__default.createElement(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon }))));
|
|
7390
7388
|
}
|
|
7391
7389
|
|
|
7392
7390
|
/** Render the dropdown to navigate between months. */
|
|
@@ -7395,9 +7393,9 @@ function MonthsDropdown(props) {
|
|
|
7395
7393
|
var _b = useDayPicker(), fromDate = _b.fromDate, toDate = _b.toDate, styles = _b.styles, locale = _b.locale, formatMonthCaption = _b.formatters.formatMonthCaption, classNames = _b.classNames, components = _b.components, labelMonthDropdown = _b.labels.labelMonthDropdown;
|
|
7396
7394
|
// Dropdown should appear only when both from/toDate is set
|
|
7397
7395
|
if (!fromDate)
|
|
7398
|
-
return
|
|
7396
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7399
7397
|
if (!toDate)
|
|
7400
|
-
return
|
|
7398
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7401
7399
|
var dropdownMonths = [];
|
|
7402
7400
|
if (isSameYear(fromDate, toDate)) {
|
|
7403
7401
|
// only display the months included in the range
|
|
@@ -7419,7 +7417,7 @@ function MonthsDropdown(props) {
|
|
|
7419
7417
|
props.onChange(newMonth);
|
|
7420
7418
|
};
|
|
7421
7419
|
var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;
|
|
7422
|
-
return (
|
|
7420
|
+
return (React__default.createElement(DropdownComponent, { name: "months", "aria-label": labelMonthDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption(props.displayMonth, { locale: locale }) }, dropdownMonths.map(function (m) { return (React__default.createElement("option", { key: m.getMonth(), value: m.getMonth() }, formatMonthCaption(m, { locale: locale }))); })));
|
|
7423
7421
|
}
|
|
7424
7422
|
|
|
7425
7423
|
/**
|
|
@@ -7433,9 +7431,9 @@ function YearsDropdown(props) {
|
|
|
7433
7431
|
var years = [];
|
|
7434
7432
|
// Dropdown should appear only when both from/toDate is set
|
|
7435
7433
|
if (!fromDate)
|
|
7436
|
-
return
|
|
7434
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7437
7435
|
if (!toDate)
|
|
7438
|
-
return
|
|
7436
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7439
7437
|
var fromYear = fromDate.getFullYear();
|
|
7440
7438
|
var toYear = toDate.getFullYear();
|
|
7441
7439
|
for (var year = fromYear; year <= toYear; year++) {
|
|
@@ -7446,7 +7444,7 @@ function YearsDropdown(props) {
|
|
|
7446
7444
|
props.onChange(newMonth);
|
|
7447
7445
|
};
|
|
7448
7446
|
var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;
|
|
7449
|
-
return (
|
|
7447
|
+
return (React__default.createElement(DropdownComponent, { name: "years", "aria-label": labelYearDropdown(), className: classNames.dropdown_year, style: styles.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption(displayMonth, { locale: locale }) }, years.map(function (year) { return (React__default.createElement("option", { key: year.getFullYear(), value: year.getFullYear() }, formatYearCaption(year, { locale: locale }))); })));
|
|
7450
7448
|
}
|
|
7451
7449
|
|
|
7452
7450
|
/**
|
|
@@ -7459,7 +7457,7 @@ function YearsDropdown(props) {
|
|
|
7459
7457
|
* argument, which will be always returned as `value`.
|
|
7460
7458
|
*/
|
|
7461
7459
|
function useControlledValue(defaultValue, controlledValue) {
|
|
7462
|
-
var _a =
|
|
7460
|
+
var _a = React__default.useState(defaultValue), uncontrolledValue = _a[0], setValue = _a[1];
|
|
7463
7461
|
var value = controlledValue === undefined ? uncontrolledValue : controlledValue;
|
|
7464
7462
|
return [value, setValue];
|
|
7465
7463
|
}
|
|
@@ -7577,7 +7575,7 @@ function getPreviousMonth(startingMonth, options) {
|
|
|
7577
7575
|
* The Navigation context shares details and methods to navigate the months in DayPicker.
|
|
7578
7576
|
* Access this context from the {@link useNavigation} hook.
|
|
7579
7577
|
*/
|
|
7580
|
-
var NavigationContext =
|
|
7578
|
+
var NavigationContext = React__default.createContext(undefined);
|
|
7581
7579
|
/** Provides the values for the {@link NavigationContext}. */
|
|
7582
7580
|
function NavigationProvider(props) {
|
|
7583
7581
|
var dayPicker = useDayPicker();
|
|
@@ -7610,7 +7608,7 @@ function NavigationProvider(props) {
|
|
|
7610
7608
|
nextMonth: nextMonth,
|
|
7611
7609
|
isDateDisplayed: isDateDisplayed
|
|
7612
7610
|
};
|
|
7613
|
-
return (
|
|
7611
|
+
return (React__default.createElement(NavigationContext.Provider, { value: value }, props.children));
|
|
7614
7612
|
}
|
|
7615
7613
|
/**
|
|
7616
7614
|
* Hook to access the {@link NavigationContextValue}. Use this hook to navigate
|
|
@@ -7619,7 +7617,7 @@ function NavigationProvider(props) {
|
|
|
7619
7617
|
* This hook is meant to be used inside internal or custom components.
|
|
7620
7618
|
*/
|
|
7621
7619
|
function useNavigation() {
|
|
7622
|
-
var context =
|
|
7620
|
+
var context = React__default.useContext(NavigationContext);
|
|
7623
7621
|
if (!context) {
|
|
7624
7622
|
throw new Error('useNavigation must be used within a NavigationProvider');
|
|
7625
7623
|
}
|
|
@@ -7637,31 +7635,31 @@ function CaptionDropdowns(props) {
|
|
|
7637
7635
|
goToMonth(newMonth);
|
|
7638
7636
|
};
|
|
7639
7637
|
var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;
|
|
7640
|
-
var captionLabel = (
|
|
7641
|
-
return (
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7638
|
+
var captionLabel = (React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
|
|
7639
|
+
return (React__default.createElement("div", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns },
|
|
7640
|
+
React__default.createElement("div", { className: classNames.vhidden }, captionLabel),
|
|
7641
|
+
React__default.createElement(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }),
|
|
7642
|
+
React__default.createElement(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })));
|
|
7645
7643
|
}
|
|
7646
7644
|
|
|
7647
7645
|
/**
|
|
7648
7646
|
* Render the "previous month" button in the navigation.
|
|
7649
7647
|
*/
|
|
7650
7648
|
function IconLeft(props) {
|
|
7651
|
-
return (
|
|
7652
|
-
|
|
7649
|
+
return (React__default.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
|
|
7650
|
+
React__default.createElement("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" })));
|
|
7653
7651
|
}
|
|
7654
7652
|
|
|
7655
7653
|
/**
|
|
7656
7654
|
* Render the "next month" button in the navigation.
|
|
7657
7655
|
*/
|
|
7658
7656
|
function IconRight(props) {
|
|
7659
|
-
return (
|
|
7660
|
-
|
|
7657
|
+
return (React__default.createElement("svg", __assign({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, props),
|
|
7658
|
+
React__default.createElement("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" })));
|
|
7661
7659
|
}
|
|
7662
7660
|
|
|
7663
7661
|
/** Render a button HTML element applying the reset class name. */
|
|
7664
|
-
var Button =
|
|
7662
|
+
var Button = React__default.forwardRef(function (props, ref) {
|
|
7665
7663
|
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;
|
|
7666
7664
|
var classNamesArr = [classNames.button_reset, classNames.button];
|
|
7667
7665
|
if (props.className) {
|
|
@@ -7672,7 +7670,7 @@ var Button = React$1.forwardRef(function (props, ref) {
|
|
|
7672
7670
|
if (props.style) {
|
|
7673
7671
|
Object.assign(style, props.style);
|
|
7674
7672
|
}
|
|
7675
|
-
return (
|
|
7673
|
+
return (React__default.createElement("button", __assign({}, props, { ref: ref, type: "button", className: className, style: style })));
|
|
7676
7674
|
});
|
|
7677
7675
|
|
|
7678
7676
|
/** A component rendering the navigation buttons or the drop-downs. */
|
|
@@ -7680,7 +7678,7 @@ function Navigation(props) {
|
|
|
7680
7678
|
var _a, _b;
|
|
7681
7679
|
var _c = useDayPicker(), dir = _c.dir, locale = _c.locale, classNames = _c.classNames, styles = _c.styles, _d = _c.labels, labelPrevious = _d.labelPrevious, labelNext = _d.labelNext, components = _c.components;
|
|
7682
7680
|
if (!props.nextMonth && !props.previousMonth) {
|
|
7683
|
-
return
|
|
7681
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7684
7682
|
}
|
|
7685
7683
|
var previousLabel = labelPrevious(props.previousMonth, { locale: locale });
|
|
7686
7684
|
var previousClassName = [
|
|
@@ -7694,9 +7692,9 @@ function Navigation(props) {
|
|
|
7694
7692
|
].join(' ');
|
|
7695
7693
|
var IconRightComponent = (_a = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a !== void 0 ? _a : IconRight;
|
|
7696
7694
|
var IconLeftComponent = (_b = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b !== void 0 ? _b : IconLeft;
|
|
7697
|
-
return (
|
|
7698
|
-
!props.hidePrevious && (
|
|
7699
|
-
!props.hideNext && (
|
|
7695
|
+
return (React__default.createElement("div", { className: classNames.nav, style: styles.nav },
|
|
7696
|
+
!props.hidePrevious && (React__default.createElement(Button, { name: "previous-month", "aria-label": previousLabel, className: previousClassName, style: styles.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick }, dir === 'rtl' ? (React__default.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React__default.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })))),
|
|
7697
|
+
!props.hideNext && (React__default.createElement(Button, { name: "next-month", "aria-label": nextLabel, className: nextClassName, style: styles.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick }, dir === 'rtl' ? (React__default.createElement(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (React__default.createElement(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon }))))));
|
|
7700
7698
|
}
|
|
7701
7699
|
|
|
7702
7700
|
/**
|
|
@@ -7722,7 +7720,7 @@ function CaptionNavigation(props) {
|
|
|
7722
7720
|
return;
|
|
7723
7721
|
goToMonth(nextMonth);
|
|
7724
7722
|
};
|
|
7725
|
-
return (
|
|
7723
|
+
return (React__default.createElement(Navigation, { displayMonth: props.displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }));
|
|
7726
7724
|
}
|
|
7727
7725
|
|
|
7728
7726
|
/**
|
|
@@ -7735,22 +7733,22 @@ function Caption(props) {
|
|
|
7735
7733
|
var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;
|
|
7736
7734
|
var caption;
|
|
7737
7735
|
if (disableNavigation) {
|
|
7738
|
-
caption = (
|
|
7736
|
+
caption = (React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));
|
|
7739
7737
|
}
|
|
7740
7738
|
else if (captionLayout === 'dropdown') {
|
|
7741
|
-
caption = (
|
|
7739
|
+
caption = (React__default.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }));
|
|
7742
7740
|
}
|
|
7743
7741
|
else if (captionLayout === 'dropdown-buttons') {
|
|
7744
|
-
caption = (
|
|
7745
|
-
|
|
7746
|
-
|
|
7742
|
+
caption = (React__default.createElement(React__default.Fragment, null,
|
|
7743
|
+
React__default.createElement(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }),
|
|
7744
|
+
React__default.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
|
|
7747
7745
|
}
|
|
7748
7746
|
else {
|
|
7749
|
-
caption = (
|
|
7750
|
-
|
|
7751
|
-
|
|
7747
|
+
caption = (React__default.createElement(React__default.Fragment, null,
|
|
7748
|
+
React__default.createElement(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }),
|
|
7749
|
+
React__default.createElement(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })));
|
|
7752
7750
|
}
|
|
7753
|
-
return (
|
|
7751
|
+
return (React__default.createElement("div", { className: classNames.caption, style: styles.caption }, caption));
|
|
7754
7752
|
}
|
|
7755
7753
|
|
|
7756
7754
|
/** Render the Footer component (empty as default).*/
|
|
@@ -7758,10 +7756,10 @@ function Caption(props) {
|
|
|
7758
7756
|
function Footer$1(props) {
|
|
7759
7757
|
var _a = useDayPicker(), footer = _a.footer, styles = _a.styles, tfoot = _a.classNames.tfoot;
|
|
7760
7758
|
if (!footer)
|
|
7761
|
-
return
|
|
7762
|
-
return (
|
|
7763
|
-
|
|
7764
|
-
|
|
7759
|
+
return React__default.createElement(React__default.Fragment, null);
|
|
7760
|
+
return (React__default.createElement("tfoot", { className: tfoot, style: styles.tfoot },
|
|
7761
|
+
React__default.createElement("tr", null,
|
|
7762
|
+
React__default.createElement("td", { colSpan: 8 }, footer))));
|
|
7765
7763
|
}
|
|
7766
7764
|
|
|
7767
7765
|
/**
|
|
@@ -7790,9 +7788,9 @@ ISOWeek) {
|
|
|
7790
7788
|
function HeadRow() {
|
|
7791
7789
|
var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles, showWeekNumber = _a.showWeekNumber, locale = _a.locale, weekStartsOn = _a.weekStartsOn, ISOWeek = _a.ISOWeek, formatWeekdayName = _a.formatters.formatWeekdayName, labelWeekday = _a.labels.labelWeekday;
|
|
7792
7790
|
var weekdays = getWeekdays(locale, weekStartsOn, ISOWeek);
|
|
7793
|
-
return (
|
|
7794
|
-
showWeekNumber && (
|
|
7795
|
-
weekdays.map(function (weekday, i) { return (
|
|
7791
|
+
return (React__default.createElement("tr", { style: styles.head_row, className: classNames.head_row },
|
|
7792
|
+
showWeekNumber && (React__default.createElement("td", { style: styles.head_cell, className: classNames.head_cell })),
|
|
7793
|
+
weekdays.map(function (weekday, i) { return (React__default.createElement("th", { key: i, scope: "col", className: classNames.head_cell, style: styles.head_cell, "aria-label": labelWeekday(weekday, { locale: locale }) }, formatWeekdayName(weekday, { locale: locale }))); })));
|
|
7796
7794
|
}
|
|
7797
7795
|
|
|
7798
7796
|
/** Render the table head. */
|
|
@@ -7800,14 +7798,14 @@ function Head() {
|
|
|
7800
7798
|
var _a;
|
|
7801
7799
|
var _b = useDayPicker(), classNames = _b.classNames, styles = _b.styles, components = _b.components;
|
|
7802
7800
|
var HeadRowComponent = (_a = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a !== void 0 ? _a : HeadRow;
|
|
7803
|
-
return (
|
|
7804
|
-
|
|
7801
|
+
return (React__default.createElement("thead", { style: styles.head, className: classNames.head },
|
|
7802
|
+
React__default.createElement(HeadRowComponent, null)));
|
|
7805
7803
|
}
|
|
7806
7804
|
|
|
7807
7805
|
/** Render the content of the day cell. */
|
|
7808
7806
|
function DayContent(props) {
|
|
7809
7807
|
var _a = useDayPicker(), locale = _a.locale, formatDay = _a.formatters.formatDay;
|
|
7810
|
-
return
|
|
7808
|
+
return React__default.createElement(React__default.Fragment, null, formatDay(props.date, { locale: locale }));
|
|
7811
7809
|
}
|
|
7812
7810
|
|
|
7813
7811
|
/**
|
|
@@ -7816,7 +7814,7 @@ function DayContent(props) {
|
|
|
7816
7814
|
*
|
|
7817
7815
|
* Access this context from the {@link useSelectMultiple} hook.
|
|
7818
7816
|
*/
|
|
7819
|
-
var SelectMultipleContext =
|
|
7817
|
+
var SelectMultipleContext = React__default.createContext(undefined);
|
|
7820
7818
|
/** Provides the values for the {@link SelectMultipleContext}. */
|
|
7821
7819
|
function SelectMultipleProvider(props) {
|
|
7822
7820
|
if (!isDayPickerMultiple(props.initialProps)) {
|
|
@@ -7826,9 +7824,9 @@ function SelectMultipleProvider(props) {
|
|
|
7826
7824
|
disabled: []
|
|
7827
7825
|
}
|
|
7828
7826
|
};
|
|
7829
|
-
return (
|
|
7827
|
+
return (React__default.createElement(SelectMultipleContext.Provider, { value: emptyContextValue }, props.children));
|
|
7830
7828
|
}
|
|
7831
|
-
return (
|
|
7829
|
+
return (React__default.createElement(SelectMultipleProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
7832
7830
|
}
|
|
7833
7831
|
function SelectMultipleProviderInternal(_a) {
|
|
7834
7832
|
var initialProps = _a.initialProps, children = _a.children;
|
|
@@ -7873,7 +7871,7 @@ function SelectMultipleProviderInternal(_a) {
|
|
|
7873
7871
|
onDayClick: onDayClick,
|
|
7874
7872
|
modifiers: modifiers
|
|
7875
7873
|
};
|
|
7876
|
-
return (
|
|
7874
|
+
return (React__default.createElement(SelectMultipleContext.Provider, { value: contextValue }, children));
|
|
7877
7875
|
}
|
|
7878
7876
|
/**
|
|
7879
7877
|
* Hook to access the {@link SelectMultipleContextValue}.
|
|
@@ -7881,7 +7879,7 @@ function SelectMultipleProviderInternal(_a) {
|
|
|
7881
7879
|
* This hook is meant to be used inside internal or custom components.
|
|
7882
7880
|
*/
|
|
7883
7881
|
function useSelectMultiple() {
|
|
7884
|
-
var context =
|
|
7882
|
+
var context = React__default.useContext(SelectMultipleContext);
|
|
7885
7883
|
if (!context) {
|
|
7886
7884
|
throw new Error('useSelectMultiple must be used within a SelectMultipleProvider');
|
|
7887
7885
|
}
|
|
@@ -7929,7 +7927,7 @@ function addToRange(day, range) {
|
|
|
7929
7927
|
*
|
|
7930
7928
|
* Access this context from the {@link useSelectRange} hook.
|
|
7931
7929
|
*/
|
|
7932
|
-
var SelectRangeContext =
|
|
7930
|
+
var SelectRangeContext = React__default.createContext(undefined);
|
|
7933
7931
|
/** Provides the values for the {@link SelectRangeProvider}. */
|
|
7934
7932
|
function SelectRangeProvider(props) {
|
|
7935
7933
|
if (!isDayPickerRange(props.initialProps)) {
|
|
@@ -7942,9 +7940,9 @@ function SelectRangeProvider(props) {
|
|
|
7942
7940
|
disabled: []
|
|
7943
7941
|
}
|
|
7944
7942
|
};
|
|
7945
|
-
return (
|
|
7943
|
+
return (React__default.createElement(SelectRangeContext.Provider, { value: emptyContextValue }, props.children));
|
|
7946
7944
|
}
|
|
7947
|
-
return (
|
|
7945
|
+
return (React__default.createElement(SelectRangeProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
7948
7946
|
}
|
|
7949
7947
|
function SelectRangeProviderInternal(_a) {
|
|
7950
7948
|
var initialProps = _a.initialProps, children = _a.children;
|
|
@@ -8015,7 +8013,7 @@ function SelectRangeProviderInternal(_a) {
|
|
|
8015
8013
|
});
|
|
8016
8014
|
}
|
|
8017
8015
|
}
|
|
8018
|
-
return (
|
|
8016
|
+
return (React__default.createElement(SelectRangeContext.Provider, { value: { selected: selected, onDayClick: onDayClick, modifiers: modifiers } }, children));
|
|
8019
8017
|
}
|
|
8020
8018
|
/**
|
|
8021
8019
|
* Hook to access the {@link SelectRangeContextValue}.
|
|
@@ -8023,7 +8021,7 @@ function SelectRangeProviderInternal(_a) {
|
|
|
8023
8021
|
* This hook is meant to be used inside internal or custom components.
|
|
8024
8022
|
*/
|
|
8025
8023
|
function useSelectRange() {
|
|
8026
|
-
var context =
|
|
8024
|
+
var context = React__default.useContext(SelectRangeContext);
|
|
8027
8025
|
if (!context) {
|
|
8028
8026
|
throw new Error('useSelectRange must be used within a SelectRangeProvider');
|
|
8029
8027
|
}
|
|
@@ -8106,7 +8104,7 @@ function getInternalModifiers(dayPicker, selectMultiple, selectRange) {
|
|
|
8106
8104
|
}
|
|
8107
8105
|
|
|
8108
8106
|
/** The Modifiers context store the modifiers used in DayPicker. To access the value of this context, use {@link useModifiers}. */
|
|
8109
|
-
var ModifiersContext =
|
|
8107
|
+
var ModifiersContext = React__default.createContext(undefined);
|
|
8110
8108
|
/** Provide the value for the {@link ModifiersContext}. */
|
|
8111
8109
|
function ModifiersProvider(props) {
|
|
8112
8110
|
var dayPicker = useDayPicker();
|
|
@@ -8115,7 +8113,7 @@ function ModifiersProvider(props) {
|
|
|
8115
8113
|
var internalModifiers = getInternalModifiers(dayPicker, selectMultiple, selectRange);
|
|
8116
8114
|
var customModifiers = getCustomModifiers(dayPicker.modifiers);
|
|
8117
8115
|
var modifiers = __assign(__assign({}, internalModifiers), customModifiers);
|
|
8118
|
-
return (
|
|
8116
|
+
return (React__default.createElement(ModifiersContext.Provider, { value: modifiers }, props.children));
|
|
8119
8117
|
}
|
|
8120
8118
|
/**
|
|
8121
8119
|
* Return the modifiers used by DayPicker.
|
|
@@ -8125,7 +8123,7 @@ function ModifiersProvider(props) {
|
|
|
8125
8123
|
*
|
|
8126
8124
|
*/
|
|
8127
8125
|
function useModifiers() {
|
|
8128
|
-
var context =
|
|
8126
|
+
var context = React__default.useContext(ModifiersContext);
|
|
8129
8127
|
if (!context) {
|
|
8130
8128
|
throw new Error('useModifiers must be used within a ModifiersProvider');
|
|
8131
8129
|
}
|
|
@@ -8363,13 +8361,13 @@ function getNextFocus(focusedDay, options) {
|
|
|
8363
8361
|
*
|
|
8364
8362
|
* Access this context from the {@link useFocusContext} hook.
|
|
8365
8363
|
*/
|
|
8366
|
-
var FocusContext =
|
|
8364
|
+
var FocusContext = React__default.createContext(undefined);
|
|
8367
8365
|
/** The provider for the {@link FocusContext}. */
|
|
8368
8366
|
function FocusProvider(props) {
|
|
8369
8367
|
var navigation = useNavigation();
|
|
8370
8368
|
var modifiers = useModifiers();
|
|
8371
|
-
var _a =
|
|
8372
|
-
var _b =
|
|
8369
|
+
var _a = React__default.useState(), focusedDay = _a[0], setFocusedDay = _a[1];
|
|
8370
|
+
var _b = React__default.useState(), lastFocused = _b[0], setLastFocused = _b[1];
|
|
8373
8371
|
var initialFocusTarget = getInitialFocusTarget(navigation.displayMonths, modifiers);
|
|
8374
8372
|
// TODO: cleanup and test obscure code below
|
|
8375
8373
|
var focusTarget = (focusedDay !== null && focusedDay !== void 0 ? focusedDay : (lastFocused && navigation.isDateDisplayed(lastFocused)))
|
|
@@ -8413,7 +8411,7 @@ function FocusProvider(props) {
|
|
|
8413
8411
|
focusStartOfWeek: function () { return moveFocus('startOfWeek', 'before'); },
|
|
8414
8412
|
focusEndOfWeek: function () { return moveFocus('endOfWeek', 'after'); }
|
|
8415
8413
|
};
|
|
8416
|
-
return (
|
|
8414
|
+
return (React__default.createElement(FocusContext.Provider, { value: value }, props.children));
|
|
8417
8415
|
}
|
|
8418
8416
|
/**
|
|
8419
8417
|
* Hook to access the {@link FocusContextValue}. Use this hook to handle the
|
|
@@ -8422,7 +8420,7 @@ function FocusProvider(props) {
|
|
|
8422
8420
|
* This hook is meant to be used inside internal or custom components.
|
|
8423
8421
|
*/
|
|
8424
8422
|
function useFocusContext() {
|
|
8425
|
-
var context =
|
|
8423
|
+
var context = React__default.useContext(FocusContext);
|
|
8426
8424
|
if (!context) {
|
|
8427
8425
|
throw new Error('useFocusContext must be used within a FocusProvider');
|
|
8428
8426
|
}
|
|
@@ -8454,16 +8452,16 @@ displayMonth) {
|
|
|
8454
8452
|
*
|
|
8455
8453
|
* Access this context from the {@link useSelectSingle} hook.
|
|
8456
8454
|
*/
|
|
8457
|
-
var SelectSingleContext =
|
|
8455
|
+
var SelectSingleContext = React__default.createContext(undefined);
|
|
8458
8456
|
/** Provides the values for the {@link SelectSingleProvider}. */
|
|
8459
8457
|
function SelectSingleProvider(props) {
|
|
8460
8458
|
if (!isDayPickerSingle(props.initialProps)) {
|
|
8461
8459
|
var emptyContextValue = {
|
|
8462
8460
|
selected: undefined
|
|
8463
8461
|
};
|
|
8464
|
-
return (
|
|
8462
|
+
return (React__default.createElement(SelectSingleContext.Provider, { value: emptyContextValue }, props.children));
|
|
8465
8463
|
}
|
|
8466
|
-
return (
|
|
8464
|
+
return (React__default.createElement(SelectSingleProviderInternal, { initialProps: props.initialProps, children: props.children }));
|
|
8467
8465
|
}
|
|
8468
8466
|
function SelectSingleProviderInternal(_a) {
|
|
8469
8467
|
var initialProps = _a.initialProps, children = _a.children;
|
|
@@ -8480,7 +8478,7 @@ function SelectSingleProviderInternal(_a) {
|
|
|
8480
8478
|
selected: initialProps.selected,
|
|
8481
8479
|
onDayClick: onDayClick
|
|
8482
8480
|
};
|
|
8483
|
-
return (
|
|
8481
|
+
return (React__default.createElement(SelectSingleContext.Provider, { value: contextValue }, children));
|
|
8484
8482
|
}
|
|
8485
8483
|
/**
|
|
8486
8484
|
* Hook to access the {@link SelectSingleContextValue}.
|
|
@@ -8488,7 +8486,7 @@ function SelectSingleProviderInternal(_a) {
|
|
|
8488
8486
|
* This hook is meant to be used inside internal or custom components.
|
|
8489
8487
|
*/
|
|
8490
8488
|
function useSelectSingle() {
|
|
8491
|
-
var context =
|
|
8489
|
+
var context = React__default.useContext(SelectSingleContext);
|
|
8492
8490
|
if (!context) {
|
|
8493
8491
|
throw new Error('useSelectSingle must be used within a SelectSingleProvider');
|
|
8494
8492
|
}
|
|
@@ -8727,7 +8725,7 @@ buttonRef) {
|
|
|
8727
8725
|
var selectedDays = useSelectedDays();
|
|
8728
8726
|
var isButton = Boolean(dayPicker.onDayClick || dayPicker.mode !== 'default');
|
|
8729
8727
|
// Focus the button if the day is focused according to the focus context
|
|
8730
|
-
|
|
8728
|
+
React__default.useEffect(function () {
|
|
8731
8729
|
var _a;
|
|
8732
8730
|
if (activeModifiers.outside)
|
|
8733
8731
|
return;
|
|
@@ -8750,7 +8748,7 @@ buttonRef) {
|
|
|
8750
8748
|
var isHidden = Boolean((activeModifiers.outside && !dayPicker.showOutsideDays) ||
|
|
8751
8749
|
activeModifiers.hidden);
|
|
8752
8750
|
var DayContentComponent = (_c = (_b = dayPicker.components) === null || _b === void 0 ? void 0 : _b.DayContent) !== null && _c !== void 0 ? _c : DayContent;
|
|
8753
|
-
var children = (
|
|
8751
|
+
var children = (React__default.createElement(DayContentComponent, { date: day, displayMonth: displayMonth, activeModifiers: activeModifiers }));
|
|
8754
8752
|
var divProps = {
|
|
8755
8753
|
style: style,
|
|
8756
8754
|
className: className,
|
|
@@ -8778,15 +8776,15 @@ buttonRef) {
|
|
|
8778
8776
|
* modifiers.
|
|
8779
8777
|
*/
|
|
8780
8778
|
function Day(props) {
|
|
8781
|
-
var buttonRef =
|
|
8779
|
+
var buttonRef = React__default.useRef(null);
|
|
8782
8780
|
var dayRender = useDayRender(props.date, props.displayMonth, buttonRef);
|
|
8783
8781
|
if (dayRender.isHidden) {
|
|
8784
|
-
return
|
|
8782
|
+
return React__default.createElement("div", { role: "gridcell" });
|
|
8785
8783
|
}
|
|
8786
8784
|
if (!dayRender.isButton) {
|
|
8787
|
-
return
|
|
8785
|
+
return React__default.createElement("div", __assign({}, dayRender.divProps));
|
|
8788
8786
|
}
|
|
8789
|
-
return
|
|
8787
|
+
return React__default.createElement(Button, __assign({ name: "day", ref: buttonRef }, dayRender.buttonProps));
|
|
8790
8788
|
}
|
|
8791
8789
|
|
|
8792
8790
|
/**
|
|
@@ -8798,13 +8796,13 @@ function WeekNumber(props) {
|
|
|
8798
8796
|
var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles = _a.styles, classNames = _a.classNames, locale = _a.locale, labelWeekNumber = _a.labels.labelWeekNumber, formatWeekNumber = _a.formatters.formatWeekNumber;
|
|
8799
8797
|
var content = formatWeekNumber(Number(weekNumber), { locale: locale });
|
|
8800
8798
|
if (!onWeekNumberClick) {
|
|
8801
|
-
return (
|
|
8799
|
+
return (React__default.createElement("span", { className: classNames.weeknumber, style: styles.weeknumber }, content));
|
|
8802
8800
|
}
|
|
8803
8801
|
var label = labelWeekNumber(Number(weekNumber), { locale: locale });
|
|
8804
8802
|
var handleClick = function (e) {
|
|
8805
8803
|
onWeekNumberClick(weekNumber, dates, e);
|
|
8806
8804
|
};
|
|
8807
|
-
return (
|
|
8805
|
+
return (React__default.createElement(Button, { name: "week-number", "aria-label": label, className: classNames.weeknumber, style: styles.weeknumber, onClick: handleClick }, content));
|
|
8808
8806
|
}
|
|
8809
8807
|
|
|
8810
8808
|
/** Render a row in the calendar, with the days and the week number. */
|
|
@@ -8815,13 +8813,13 @@ function Row(props) {
|
|
|
8815
8813
|
var WeeknumberComponent = (_b = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b !== void 0 ? _b : WeekNumber;
|
|
8816
8814
|
var weekNumberCell;
|
|
8817
8815
|
if (showWeekNumber) {
|
|
8818
|
-
weekNumberCell = (
|
|
8819
|
-
|
|
8816
|
+
weekNumberCell = (React__default.createElement("td", { className: classNames.cell, style: styles.cell },
|
|
8817
|
+
React__default.createElement(WeeknumberComponent, { number: props.weekNumber, dates: props.dates })));
|
|
8820
8818
|
}
|
|
8821
|
-
return (
|
|
8819
|
+
return (React__default.createElement("tr", { className: classNames.row, style: styles.row },
|
|
8822
8820
|
weekNumberCell,
|
|
8823
|
-
props.dates.map(function (date) { return (
|
|
8824
|
-
|
|
8821
|
+
props.dates.map(function (date) { return (React__default.createElement("td", { className: classNames.cell, style: styles.cell, key: getUnixTime(date), role: "presentation" },
|
|
8822
|
+
React__default.createElement(DayComponent, { displayMonth: props.displayMonth, date: date }))); })));
|
|
8825
8823
|
}
|
|
8826
8824
|
|
|
8827
8825
|
/** Return the weeks between two dates. */
|
|
@@ -8889,10 +8887,10 @@ function Table(props) {
|
|
|
8889
8887
|
var HeadComponent = (_a = components === null || components === void 0 ? void 0 : components.Head) !== null && _a !== void 0 ? _a : Head;
|
|
8890
8888
|
var RowComponent = (_b = components === null || components === void 0 ? void 0 : components.Row) !== null && _b !== void 0 ? _b : Row;
|
|
8891
8889
|
var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer$1;
|
|
8892
|
-
return (
|
|
8893
|
-
!hideHead &&
|
|
8894
|
-
|
|
8895
|
-
|
|
8890
|
+
return (React__default.createElement("table", { id: props.id, className: classNames.table, style: styles.table, role: "grid", "aria-labelledby": props['aria-labelledby'] },
|
|
8891
|
+
!hideHead && React__default.createElement(HeadComponent, null),
|
|
8892
|
+
React__default.createElement("tbody", { className: classNames.tbody, style: styles.tbody, role: "rowgroup" }, weeks.map(function (week) { return (React__default.createElement(RowComponent, { displayMonth: props.displayMonth, key: week.weekNumber, dates: week.dates, weekNumber: week.weekNumber })); })),
|
|
8893
|
+
React__default.createElement(FooterComponent, { displayMonth: props.displayMonth })));
|
|
8896
8894
|
}
|
|
8897
8895
|
|
|
8898
8896
|
/*
|
|
@@ -8936,8 +8934,8 @@ function canUseDOM() {
|
|
|
8936
8934
|
* @param deps
|
|
8937
8935
|
*/
|
|
8938
8936
|
var useIsomorphicLayoutEffect = canUseDOM()
|
|
8939
|
-
?
|
|
8940
|
-
:
|
|
8937
|
+
? React__default__namespace.useLayoutEffect
|
|
8938
|
+
: React__default__namespace.useEffect;
|
|
8941
8939
|
var serverHandoffComplete = false;
|
|
8942
8940
|
var id = 0;
|
|
8943
8941
|
function genId() {
|
|
@@ -8950,7 +8948,7 @@ function useId(providedId) {
|
|
|
8950
8948
|
// If this instance isn't part of the initial render, we don't have to do the
|
|
8951
8949
|
// double render/patch-up dance. We can just generate the ID and return it.
|
|
8952
8950
|
var initialId = providedId !== null && providedId !== void 0 ? providedId : (serverHandoffComplete ? genId() : null);
|
|
8953
|
-
var _b =
|
|
8951
|
+
var _b = React__default__namespace.useState(initialId), id = _b[0], setId = _b[1];
|
|
8954
8952
|
useIsomorphicLayoutEffect(function () {
|
|
8955
8953
|
if (id === null) {
|
|
8956
8954
|
// Patch the ID after render. We do this in `useLayoutEffect` to avoid any
|
|
@@ -8961,7 +8959,7 @@ function useId(providedId) {
|
|
|
8961
8959
|
}
|
|
8962
8960
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8963
8961
|
}, []);
|
|
8964
|
-
|
|
8962
|
+
React__default__namespace.useEffect(function () {
|
|
8965
8963
|
if (serverHandoffComplete === false) {
|
|
8966
8964
|
// Flag all future uses of `useId` to skip the update dance. This is in
|
|
8967
8965
|
// `useEffect` because it goes after `useLayoutEffect`, ensuring we don't
|
|
@@ -9004,9 +9002,9 @@ function Month(props) {
|
|
|
9004
9002
|
style = __assign(__assign({}, style), styles.caption_between);
|
|
9005
9003
|
}
|
|
9006
9004
|
var CaptionComponent = (_b = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b !== void 0 ? _b : Caption;
|
|
9007
|
-
return (
|
|
9008
|
-
|
|
9009
|
-
|
|
9005
|
+
return (React__default.createElement("div", { key: props.displayIndex, className: className.join(' '), style: style },
|
|
9006
|
+
React__default.createElement(CaptionComponent, { id: captionId, displayMonth: props.displayMonth }),
|
|
9007
|
+
React__default.createElement(Table, { id: tableId, "aria-labelledby": captionId, displayMonth: props.displayMonth })));
|
|
9010
9008
|
}
|
|
9011
9009
|
|
|
9012
9010
|
/** Render the container with the months according to the number of months to display. */
|
|
@@ -9015,9 +9013,9 @@ function Root(_a) {
|
|
|
9015
9013
|
var dayPicker = useDayPicker();
|
|
9016
9014
|
var focusContext = useFocusContext();
|
|
9017
9015
|
var navigation = useNavigation();
|
|
9018
|
-
var _b =
|
|
9016
|
+
var _b = React__default.useState(false), hasInitialFocus = _b[0], setHasInitialFocus = _b[1];
|
|
9019
9017
|
// Focus the focus target when initialFocus is passed in
|
|
9020
|
-
|
|
9018
|
+
React__default.useEffect(function () {
|
|
9021
9019
|
if (!dayPicker.initialFocus)
|
|
9022
9020
|
return;
|
|
9023
9021
|
if (!focusContext.focusTarget)
|
|
@@ -9048,20 +9046,20 @@ function Root(_a) {
|
|
|
9048
9046
|
var _a;
|
|
9049
9047
|
return __assign(__assign({}, attrs), (_a = {}, _a[key] = initialProps[key], _a));
|
|
9050
9048
|
}, {});
|
|
9051
|
-
return (
|
|
9052
|
-
|
|
9049
|
+
return (React__default.createElement("div", __assign({ className: classNames.join(' '), style: style, dir: dayPicker.dir, id: dayPicker.id }, dataAttributes),
|
|
9050
|
+
React__default.createElement("div", { className: dayPicker.classNames.months, style: dayPicker.styles.months }, navigation.displayMonths.map(function (month, i) { return (React__default.createElement(Month, { key: i, displayIndex: i, displayMonth: month })); }))));
|
|
9053
9051
|
}
|
|
9054
9052
|
|
|
9055
9053
|
/** Provide the value for all the context providers. */
|
|
9056
9054
|
function RootProvider(props) {
|
|
9057
9055
|
var children = props.children, initialProps = __rest(props, ["children"]);
|
|
9058
|
-
return (
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9056
|
+
return (React__default.createElement(DayPickerProvider, { initialProps: initialProps },
|
|
9057
|
+
React__default.createElement(NavigationProvider, null,
|
|
9058
|
+
React__default.createElement(SelectSingleProvider, { initialProps: initialProps },
|
|
9059
|
+
React__default.createElement(SelectMultipleProvider, { initialProps: initialProps },
|
|
9060
|
+
React__default.createElement(SelectRangeProvider, { initialProps: initialProps },
|
|
9061
|
+
React__default.createElement(ModifiersProvider, null,
|
|
9062
|
+
React__default.createElement(FocusProvider, null, children))))))));
|
|
9065
9063
|
}
|
|
9066
9064
|
|
|
9067
9065
|
/**
|
|
@@ -9152,8 +9150,8 @@ function RootProvider(props) {
|
|
|
9152
9150
|
* ```
|
|
9153
9151
|
*/
|
|
9154
9152
|
function DayPicker(props) {
|
|
9155
|
-
return (
|
|
9156
|
-
|
|
9153
|
+
return (React__default.createElement(RootProvider, __assign({}, props),
|
|
9154
|
+
React__default.createElement(Root, { initialProps: props })));
|
|
9157
9155
|
}
|
|
9158
9156
|
|
|
9159
9157
|
var reactResponsive$1 = {exports: {}};
|
|
@@ -9167,7 +9165,7 @@ function requireReactResponsive () {
|
|
|
9167
9165
|
hasRequiredReactResponsive = 1;
|
|
9168
9166
|
(function (module, exports) {
|
|
9169
9167
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
9170
|
-
module.exports = factory(
|
|
9168
|
+
module.exports = factory(React__default);
|
|
9171
9169
|
})(reactResponsive, (__WEBPACK_EXTERNAL_MODULE_react__) => {
|
|
9172
9170
|
return /******/ (() => { // webpackBootstrap
|
|
9173
9171
|
/******/ var __webpack_modules__ = ({
|
|
@@ -10996,19 +10994,15 @@ var IconsSvg = function (_a) {
|
|
|
10996
10994
|
var fill = _a.fill, size = _a.size, icon = _a.icon;
|
|
10997
10995
|
switch (icon) {
|
|
10998
10996
|
case 'spinner':
|
|
10999
|
-
return (
|
|
11000
|
-
React$1.createElement("style", null, "\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n "),
|
|
11001
|
-
React$1.createElement("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", opacity: ".25", fill: fill }),
|
|
11002
|
-
React$1.createElement("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "spinner_z9k8", fill: fill })));
|
|
10997
|
+
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), viewBox: "0 0 24 24", children: [jsxRuntime.jsx("style", { children: "\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n " }), jsxRuntime.jsx("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", opacity: ".25", fill: fill }), jsxRuntime.jsx("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "spinner_z9k8", fill: fill })] }));
|
|
11003
10998
|
case 'warning':
|
|
11004
|
-
return (
|
|
10999
|
+
return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), className: "svg-icon", style: {
|
|
11005
11000
|
verticalAlign: 'middle',
|
|
11006
11001
|
fill: fill,
|
|
11007
11002
|
overflow: 'hidden',
|
|
11008
11003
|
minWidth: '25px',
|
|
11009
11004
|
minHeight: '25px',
|
|
11010
|
-
}, viewBox: "0 0 1024 1024", version: "1.1" }
|
|
11011
|
-
React$1.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" })));
|
|
11005
|
+
}, viewBox: "0 0 1024 1024", version: "1.1", children: jsxRuntime.jsx("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" }) }));
|
|
11012
11006
|
default:
|
|
11013
11007
|
return null;
|
|
11014
11008
|
}
|
|
@@ -11334,7 +11328,7 @@ var checkForContinuousSelection = function (_a) {
|
|
|
11334
11328
|
calendarRangeTo &&
|
|
11335
11329
|
areIntervalsOverlapping({ start: calendarRangeFrom, end: calendarRangeTo }, { start: rangeFrom, end: rangeTo }));
|
|
11336
11330
|
});
|
|
11337
|
-
|
|
11331
|
+
React__default.useEffect(function () {
|
|
11338
11332
|
if ((rangeContext &&
|
|
11339
11333
|
calendarRangeFrom &&
|
|
11340
11334
|
!startIsEqualOrBeforeRangeContextEnd) ||
|
|
@@ -11349,7 +11343,7 @@ var checkForContinuousSelection = function (_a) {
|
|
|
11349
11343
|
|
|
11350
11344
|
var useCalendarTooltips = function (_a) {
|
|
11351
11345
|
var showFeedback = _a.showFeedback;
|
|
11352
|
-
return
|
|
11346
|
+
return React__default.useEffect(function () {
|
|
11353
11347
|
if (typeof document === 'undefined' || !showFeedback)
|
|
11354
11348
|
return;
|
|
11355
11349
|
// Children
|
|
@@ -11426,7 +11420,7 @@ var useCalendarTooltips = function (_a) {
|
|
|
11426
11420
|
|
|
11427
11421
|
var useCalendarLoadingSpinner = function (_a) {
|
|
11428
11422
|
var loadingData = _a.loadingData;
|
|
11429
|
-
return
|
|
11423
|
+
return React__default.useEffect(function () {
|
|
11430
11424
|
if (typeof document === 'undefined')
|
|
11431
11425
|
return;
|
|
11432
11426
|
var loadingSpinner = document.querySelector('.will-filter-bar-calendar .rdp-months .will-calendar-spinner');
|
|
@@ -11443,9 +11437,9 @@ var useCalendarLoadingSpinner = function (_a) {
|
|
|
11443
11437
|
|
|
11444
11438
|
var useUpdateDisabledDates = function (_a) {
|
|
11445
11439
|
var disableCalendarDates = _a.disableCalendarDates, calendarRange = _a.calendarRange, updateCalendarMonthNavigation = _a.updateCalendarMonthNavigation, updateCalendarDefaultMonth = _a.updateCalendarDefaultMonth;
|
|
11446
|
-
var _b = __read(
|
|
11447
|
-
var _c = __read(
|
|
11448
|
-
var newDisableCalendarDates =
|
|
11440
|
+
var _b = __read(React__default.useState(undefined), 2), overlappingDate = _b[0], setOverlappingDate = _b[1];
|
|
11441
|
+
var _c = __read(React__default.useState([]), 2), lastPossibleCheckout = _c[0], setLatsPossibleCheckout = _c[1];
|
|
11442
|
+
var newDisableCalendarDates = React__default.useMemo(function () {
|
|
11449
11443
|
var _a;
|
|
11450
11444
|
if (disableCalendarDates === null || disableCalendarDates === void 0 ? void 0 : disableCalendarDates.availableDates) {
|
|
11451
11445
|
var dateFormat_1 = 'dd-MM-yyyy';
|
|
@@ -11502,7 +11496,7 @@ styleInject(css_248z$d);
|
|
|
11502
11496
|
var css_248z$c = ".will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n.will-calendar-filter-container .rdp {\n margin: 0;\n}\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.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: 0.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\n .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\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .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\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only\n > 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\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only::before,\n.will-root\n .will-calendar-filter-container\n .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\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .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.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: 2px solid var(--will-light-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\n .will-calendar-filter-container\n .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\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n top: -70px;\n white-space: wrap;\n max-width: 120px;\n }\n}\n";
|
|
11503
11497
|
styleInject(css_248z$c);
|
|
11504
11498
|
|
|
11505
|
-
var Calendar =
|
|
11499
|
+
var Calendar = React__default.forwardRef(function (_a, ref) {
|
|
11506
11500
|
var _b;
|
|
11507
11501
|
var selectedPath = _a.selectedPath, calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange, language = _a.language, disableCalendarDates = _a.disableCalendarDates, requestDates = _a.requestDates, disabledDates = _a.disabledDates, updateCalendarMonthNavigation = _a.updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation = _a.setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth = _a.updateCalendarDefaultMonth, loadingData = _a.loadingData, showFeedback = _a.showFeedback, palette = _a.palette, setCalendarHasError = _a.setCalendarHasError, setUpdatedForSubmit = _a.setUpdatedForSubmit, rangeContext = _a.rangeContext, calendarHasError = _a.calendarHasError, autoFocus = _a.autoFocus;
|
|
11508
11502
|
// Translations
|
|
@@ -11590,53 +11584,39 @@ var Calendar = React$1.forwardRef(function (_a, ref) {
|
|
|
11590
11584
|
: __spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1([
|
|
11591
11585
|
lastPossibleCheckout
|
|
11592
11586
|
], __read(base), false), __read(firstPossibleRangeContextCheckIn), false), __read(lastPossibleRangeContextCheckOut), false), __read(disabledInsideSelectableRange()), false);
|
|
11593
|
-
return (
|
|
11594
|
-
|
|
11595
|
-
|
|
11596
|
-
|
|
11597
|
-
|
|
11598
|
-
|
|
11599
|
-
?
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11603
|
-
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
currentSelectionLastCheckoutDate: currentSelectionAvailability,
|
|
11627
|
-
}) }),
|
|
11628
|
-
React$1.createElement("div", { className: 'will-calendar-tooltip' },
|
|
11629
|
-
React$1.createElement("div", null, t('noCheckIn'))),
|
|
11630
|
-
React$1.createElement("div", { className: 'will-calendar-tooltip-check-out' },
|
|
11631
|
-
React$1.createElement("div", null, t('noCheckOut'))),
|
|
11632
|
-
React$1.createElement("div", { className: 'will-calendar-tooltip-overlapping-date' },
|
|
11633
|
-
React$1.createElement("div", null, t('checkOutOnly'))),
|
|
11634
|
-
React$1.createElement("div", { className: 'will-calendar-tooltip-check-in-only' },
|
|
11635
|
-
React$1.createElement("div", null, t('checkInOnly'))),
|
|
11636
|
-
React$1.createElement("div", { className: 'will-calendar-tooltip-check-out-only' },
|
|
11637
|
-
React$1.createElement("div", null, t('checkOutOnly'))),
|
|
11638
|
-
React$1.createElement("div", { className: 'will-calendar-spinner' },
|
|
11639
|
-
React$1.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.primary) || 'inherit', size: 50, icon: "spinner" })))));
|
|
11587
|
+
return (jsxRuntime.jsx("div", { className: "will-filter-bar-calendar", ref: ref, children: jsxRuntime.jsxs("div", { className: "will-calendar-filter-container", ref: calendarContainerRef, children: [jsxRuntime.jsx(DayPicker, { id: "will-calendar", mode: "range", locale: language === 'en' ? enUS : fi, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, selected: calendarRange, onSelect: function (range) { return handleOnSelect(range); }, captionLayout: "dropdown-buttons", defaultMonth: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ||
|
|
11588
|
+
selectedStartDate ||
|
|
11589
|
+
rangeContextStartDate ||
|
|
11590
|
+
(((_b = newDisableCalendarDates === null || newDisableCalendarDates === void 0 ? void 0 : newDisableCalendarDates.disabledDates) === null || _b === void 0 ? void 0 : _b.length)
|
|
11591
|
+
? newDisableCalendarDates.disabledDates[0].from
|
|
11592
|
+
: today), disabled: disabled, fromMonth: today, onMonthChange: function (val) {
|
|
11593
|
+
requestDates === null || requestDates === void 0 ? void 0 : requestDates(val);
|
|
11594
|
+
setUpdateCalendarMonthNavigation === null || setUpdateCalendarMonthNavigation === void 0 ? void 0 : setUpdateCalendarMonthNavigation(function (prev) { return !prev; });
|
|
11595
|
+
}, classNames: {
|
|
11596
|
+
day_range_start: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ? 'rdp-day_range_start' : '',
|
|
11597
|
+
day_range_end: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) ? 'rdp-day_range_end' : '',
|
|
11598
|
+
}, modifiersClassNames: {
|
|
11599
|
+
today: 'my-today',
|
|
11600
|
+
booked: 'booked',
|
|
11601
|
+
disabledAfterCheckIn: 'disabled-after-check-in',
|
|
11602
|
+
overlappingDate: 'overlapping-date',
|
|
11603
|
+
noActiveSelectionStart: 'no-active-selection-start',
|
|
11604
|
+
noActiveSelectionMid: 'no-active-selection-mid',
|
|
11605
|
+
noActiveSelectionEnd: 'no-active-selection-end',
|
|
11606
|
+
checkoutOptionsMid: 'rdp-day_selected rdp-day_range_middle checkout-option',
|
|
11607
|
+
checkInOnly: 'check-in-only',
|
|
11608
|
+
checkOutOnly: 'check-out-only',
|
|
11609
|
+
}, modifiers:
|
|
11610
|
+
// This function handles conditions for applying the modifiersClassNames
|
|
11611
|
+
handleCalendarModifiers({
|
|
11612
|
+
calendarRange: calendarRange,
|
|
11613
|
+
disabledDates: disabled,
|
|
11614
|
+
overlappingDate: overlappingDate,
|
|
11615
|
+
rangeContext: rangeContext,
|
|
11616
|
+
findFirstPossibleRangeContextCheckIn: findFirstPossibleRangeContextCheckIn,
|
|
11617
|
+
findLastPossibleRangeContextCheckOut: findLastPossibleRangeContextCheckOut,
|
|
11618
|
+
currentSelectionLastCheckoutDate: currentSelectionAvailability,
|
|
11619
|
+
}) }, updateCalendarDefaultMonth), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip', children: jsxRuntime.jsx("div", { children: t('noCheckIn') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-out', children: jsxRuntime.jsx("div", { children: t('noCheckOut') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-overlapping-date', children: jsxRuntime.jsx("div", { children: t('checkOutOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-in-only', children: jsxRuntime.jsx("div", { children: t('checkInOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-tooltip-check-out-only', children: jsxRuntime.jsx("div", { children: t('checkOutOnly') }) }), jsxRuntime.jsx("div", { className: 'will-calendar-spinner', children: jsxRuntime.jsx(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.primary) || 'inherit', size: 50, icon: "spinner" }) })] }) }));
|
|
11640
11620
|
});
|
|
11641
11621
|
|
|
11642
11622
|
var parseGuests = function (_a) {
|
|
@@ -11779,14 +11759,14 @@ var calculateDropdownPosition = function (_a) {
|
|
|
11779
11759
|
|
|
11780
11760
|
var useFilterBar = function (_a) {
|
|
11781
11761
|
var redirectUrl = _a.redirectUrl, ageCategories = _a.ageCategories, onSubmit = _a.onSubmit, tabs = _a.tabs, locations = _a.locations;
|
|
11782
|
-
var _b = __read(
|
|
11783
|
-
var _c = __read(
|
|
11784
|
-
var _d = __read(
|
|
11785
|
-
var _e = __read(
|
|
11786
|
-
var _f = __read(
|
|
11787
|
-
var _g = __read(
|
|
11788
|
-
var _h = __read(
|
|
11789
|
-
|
|
11762
|
+
var _b = __read(React__default.useState(Pages.EVENTS), 2), selectedPath = _b[0], setSelectedPath = _b[1];
|
|
11763
|
+
var _c = __read(React__default.useState(false), 2), selectedFilter = _c[0], setSelectedFilter = _c[1];
|
|
11764
|
+
var _d = __read(React__default.useState(), 2), calendarRange = _d[0], setCalendarRange = _d[1];
|
|
11765
|
+
var _e = __read(React__default.useState(false), 2), innerLoading = _e[0], setInnerLoading = _e[1];
|
|
11766
|
+
var _f = __read(React__default.useState(0), 2), categories = _f[0], setCategories = _f[1];
|
|
11767
|
+
var _g = __read(React__default.useState({}), 2), ageCategoryCounts = _g[0], setAgeCategoryCounts = _g[1];
|
|
11768
|
+
var _h = __read(React__default.useState([]), 2), selectedLocations = _h[0], setSelectedLocations = _h[1];
|
|
11769
|
+
React__default.useEffect(function () {
|
|
11790
11770
|
var _a;
|
|
11791
11771
|
var urlSearchParams = new URLSearchParams(window.location.search);
|
|
11792
11772
|
var startDateParam = urlSearchParams.get('startDate');
|
|
@@ -11811,7 +11791,7 @@ var useFilterBar = function (_a) {
|
|
|
11811
11791
|
setSelectedLocations(matchedLocations);
|
|
11812
11792
|
}
|
|
11813
11793
|
}, []);
|
|
11814
|
-
|
|
11794
|
+
React__default.useEffect(function () {
|
|
11815
11795
|
if (typeof window === 'undefined')
|
|
11816
11796
|
return;
|
|
11817
11797
|
var defaultTab = (tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 ? tabs[0] : tabs === null || tabs === void 0 ? void 0 : tabs.find(function (tab) { return tab.default; });
|
|
@@ -11944,9 +11924,9 @@ var handleAgeCategoryRules = function (_a) {
|
|
|
11944
11924
|
|
|
11945
11925
|
var useScrollInToView = function (_a) {
|
|
11946
11926
|
var selectedFilter = _a.selectedFilter;
|
|
11947
|
-
var _b = __read(
|
|
11948
|
-
var targetFilterBarRef =
|
|
11949
|
-
|
|
11927
|
+
var _b = __read(React__default.useState(true), 2), isMobile = _b[0], setIsMobile = _b[1];
|
|
11928
|
+
var targetFilterBarRef = React__default.useRef(null);
|
|
11929
|
+
React__default.useEffect(function () {
|
|
11950
11930
|
if (typeof window !== 'undefined' && window.innerWidth > 960) {
|
|
11951
11931
|
setIsMobile(false);
|
|
11952
11932
|
return;
|
|
@@ -11966,13 +11946,9 @@ var useScrollInToView = function (_a) {
|
|
|
11966
11946
|
var css_248z$b = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n}\n\n.will-filter-bar-select-button.disabled {\n cursor: not-allowed;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid;\n}\n\n.will-filter-bar-select-button .select-button-label {\n color: var(--will-black);\n font-weight: 600;\n}\n\n.will-filter-bar-select-button .select-button-description {\n color: var(--will-black);\n font-weight: 400;\n opacity: 0.5;\n white-space: nowrap;\n min-height: 19px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.will-filter-bar-select-button .select-button-description span {\n font: inherit;\n}\n\n.will-filter-bar-select-button .select-button-label.active,\n.will-filter-bar-select-button .select-button-description.active {\n font-weight: 700;\n font-size: 15px;\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-select-button {\n padding: 15px 0;\n }\n\n .will-filter-bar-select-button:first-child {\n padding: 0 0 15px 0;\n }\n\n .will-filter-bar-select-button .select-button-wrapper {\n justify-content: center;\n text-align: center;\n }\n\n .will-filter-bar-select-button .select-button-description {\n white-space: wrap;\n }\n\n .will-filter-bar-select-button .select-button-divider {\n display: none;\n }\n}\n";
|
|
11967
11947
|
styleInject(css_248z$b);
|
|
11968
11948
|
|
|
11969
|
-
var SelectButton =
|
|
11949
|
+
var SelectButton = React__default.forwardRef(function (_a, ref) {
|
|
11970
11950
|
var active = _a.active, label = _a.label, onClick = _a.onClick, description = _a.description, disabled = _a.disabled, ariaExpanded = _a.ariaExpanded, ariaControls = _a.ariaControls;
|
|
11971
|
-
return (
|
|
11972
|
-
React$1.createElement("span", { className: "select-button-wrapper" },
|
|
11973
|
-
React$1.createElement("div", null,
|
|
11974
|
-
React$1.createElement("p", { className: "select-button-label" }, label),
|
|
11975
|
-
React$1.createElement("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })))));
|
|
11951
|
+
return (jsxRuntime.jsx("button", { ref: ref, className: "will-filter-bar-select-button ".concat(disabled ? 'disabled' : ''), onClick: disabled ? undefined : onClick, disabled: disabled, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": "true", "aria-disabled": disabled, children: jsxRuntime.jsx("span", { className: "select-button-wrapper", children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("p", { className: "select-button-label", children: label }), jsxRuntime.jsx("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })] }) }) }));
|
|
11976
11952
|
});
|
|
11977
11953
|
SelectButton.displayName = 'SelectButton';
|
|
11978
11954
|
|
|
@@ -11981,7 +11957,7 @@ styleInject(css_248z$a);
|
|
|
11981
11957
|
|
|
11982
11958
|
var TabButton = function (_a) {
|
|
11983
11959
|
var onClick = _a.onClick, label = _a.label, active = _a.active, mode = _a.mode;
|
|
11984
|
-
return (
|
|
11960
|
+
return (jsxRuntime.jsx("button", { className: "will-filter-bar-tab-button ".concat(mode || 'light', " ").concat(active && 'active', " "), onClick: onClick, children: label }));
|
|
11985
11961
|
};
|
|
11986
11962
|
|
|
11987
11963
|
var css_248z$9 = ".will-guests-filter-label,\n.will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text);\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\n}\n\n.will-guests-filter-inner .will-guests-filter-counter {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 10px;\n min-width: 30px;\n text-align: center;\n}\n\n.will-guests-filter-counter-button {\n border-radius: 50%;\n background-color: transparent;\n border: 1px solid var(--will-grey);\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n color: var(--will-black);\n\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.will-guests-filter-counter-button:hover {\n background-color: var(--will-onahau);\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-inner {\n width: 100%;\n margin: 15px 0;\n justify-content: space-between;\n }\n}\n";
|
|
@@ -11989,7 +11965,7 @@ styleInject(css_248z$9);
|
|
|
11989
11965
|
|
|
11990
11966
|
var GuestCount = function (_a) {
|
|
11991
11967
|
var label = _a.label, sortOrder = _a.sortOrder, id = _a.id, updateGuestsCount = _a.updateGuestsCount, count = _a.count, minVal = _a.minVal;
|
|
11992
|
-
|
|
11968
|
+
React__default.useEffect(function () {
|
|
11993
11969
|
if (minVal && minVal > count) {
|
|
11994
11970
|
updateGuestsCount("guests-".concat(id), minVal);
|
|
11995
11971
|
}
|
|
@@ -12002,20 +11978,11 @@ var GuestCount = function (_a) {
|
|
|
12002
11978
|
var handleIncrement = function () {
|
|
12003
11979
|
updateGuestsCount("guests-".concat(id), count + 1);
|
|
12004
11980
|
};
|
|
12005
|
-
return (
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
paddingBottom: '4px',
|
|
12011
|
-
opacity: (minVal && count <= minVal) || !count ? 0.4 : 1,
|
|
12012
|
-
} },
|
|
12013
|
-
React$1.createElement("svg", { width: "10", height: "10", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12014
|
-
React$1.createElement("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))),
|
|
12015
|
-
React$1.createElement("span", { className: "will-guests-filter-count" }, count),
|
|
12016
|
-
React$1.createElement("button", { className: "will-guests-filter-counter-button", onClick: handleIncrement },
|
|
12017
|
-
React$1.createElement("svg", { width: "15", height: "15", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12018
|
-
React$1.createElement("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))))));
|
|
11981
|
+
return (jsxRuntime.jsxs("div", { className: "will-guests-filter-inner", style: { order: "".concat(sortOrder) }, children: [jsxRuntime.jsx("p", { className: "will-guests-filter-label", children: label }), jsxRuntime.jsxs("div", { className: "will-guests-filter-counter", children: [jsxRuntime.jsx("button", { className: "will-guests-filter-counter-button", onClick: handleDecrement, disabled: (minVal && count <= minVal) || !count, style: {
|
|
11982
|
+
cursor: (minVal && count <= minVal) || !count ? 'initial' : 'pointer',
|
|
11983
|
+
paddingBottom: '4px',
|
|
11984
|
+
opacity: (minVal && count <= minVal) || !count ? 0.4 : 1,
|
|
11985
|
+
}, children: jsxRuntime.jsx("svg", { width: "10", height: "10", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) }), jsxRuntime.jsx("span", { className: "will-guests-filter-count", children: count }), jsxRuntime.jsx("button", { className: "will-guests-filter-counter-button", onClick: handleIncrement, children: jsxRuntime.jsx("svg", { width: "15", height: "15", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }) })] })] }));
|
|
12019
11986
|
};
|
|
12020
11987
|
|
|
12021
11988
|
var css_248z$8 = ".will-filter-section-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n}\n\n.will-filter-section-title {\n font-size: 22px;\n margin: 0;\n}\n\n.will-filter-section-action {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n.will-filter-section-action .will-filter-bar-close-button {\n position: relative;\n top: auto;\n right: auto;\n margin: 0;\n}\n\n@media (max-width: 960px) {\n .will-filter-section-title {\n font-size: 18px;\n }\n}\n";
|
|
@@ -12023,21 +11990,17 @@ styleInject(css_248z$8);
|
|
|
12023
11990
|
|
|
12024
11991
|
var FilterSectionHeader = function (_a) {
|
|
12025
11992
|
var title = _a.title, action = _a.action;
|
|
12026
|
-
return (
|
|
12027
|
-
React$1.createElement("h3", { className: "will-filter-section-title" }, title),
|
|
12028
|
-
action && React$1.createElement("div", { className: "will-filter-section-action" }, action)));
|
|
11993
|
+
return (jsxRuntime.jsxs("div", { className: "will-filter-section-header", children: [jsxRuntime.jsx("h3", { className: "will-filter-section-title", children: title }), action && jsxRuntime.jsx("div", { className: "will-filter-section-action", children: action })] }));
|
|
12029
11994
|
};
|
|
12030
11995
|
|
|
12031
11996
|
var css_248z$7 = ".will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 16px;\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
|
|
12032
11997
|
styleInject(css_248z$7);
|
|
12033
11998
|
|
|
12034
|
-
var Guests =
|
|
11999
|
+
var Guests = React__default.forwardRef(function (_a, ref) {
|
|
12035
12000
|
var ageCategories = _a.ageCategories, updateGuestsCount = _a.updateGuestsCount, ageCategoryCounts = _a.ageCategoryCounts, autoFocus = _a.autoFocus, onClose = _a.onClose;
|
|
12036
12001
|
var t = useTranslation('filterBar').t;
|
|
12037
12002
|
var containerRef = useAutoFocus(autoFocus);
|
|
12038
|
-
return (
|
|
12039
|
-
React$1.createElement(FilterSectionHeader, { title: t('guests.title'), action: onClose && React$1.createElement(CloseButton, { handleClose: onClose }) }),
|
|
12040
|
-
React$1.createElement("div", { className: "will-guests-filter-container", ref: containerRef }, ageCategories === null || ageCategories === void 0 ? void 0 : ageCategories.map(function (category) { return (React$1.createElement(GuestCount, { key: category.id, id: category.id, label: category.name, minVal: category.minVal, sortOrder: category.sortOrder, updateGuestsCount: updateGuestsCount, count: ageCategoryCounts["guests-".concat(category.id)] || 0 })); }))));
|
|
12003
|
+
return (jsxRuntime.jsxs("div", { className: "will-filter-bar-guests", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: t('guests.title'), action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-guests-filter-container", ref: containerRef, children: ageCategories === null || ageCategories === void 0 ? void 0 : ageCategories.map(function (category) { return (jsxRuntime.jsx(GuestCount, { id: category.id, label: category.name, minVal: category.minVal, sortOrder: category.sortOrder, updateGuestsCount: updateGuestsCount, count: ageCategoryCounts["guests-".concat(category.id)] || 0 }, category.id)); }) })] }));
|
|
12041
12004
|
});
|
|
12042
12005
|
Guests.displayName = 'Guests';
|
|
12043
12006
|
|
|
@@ -12045,7 +12008,7 @@ var css_248z$6 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n
|
|
|
12045
12008
|
styleInject(css_248z$6);
|
|
12046
12009
|
|
|
12047
12010
|
var Divider = function () {
|
|
12048
|
-
return
|
|
12011
|
+
return jsxRuntime.jsx("div", { className: "will-filter-bar-divider" });
|
|
12049
12012
|
};
|
|
12050
12013
|
|
|
12051
12014
|
var css_248z$5 = ".will-filter-bar-categories {\n text-align: center;\n}\n\n.will-categories-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0 30px 0;\n}\n\n.will-categories-filter-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 20px;\n}\n\n.will-categories-filter-inner input {\n cursor: pointer;\n margin-right: 10px;\n}\n";
|
|
@@ -12060,16 +12023,12 @@ var Categories = function (_a) {
|
|
|
12060
12023
|
'Summer camp',
|
|
12061
12024
|
'Winter camp',
|
|
12062
12025
|
];
|
|
12063
|
-
var _b = __read(
|
|
12026
|
+
var _b = __read(React__default.useState(''), 2), selectedCategory = _b[0], setSelectedCategory = _b[1];
|
|
12064
12027
|
var handleCategoryChange = function (selectedCategory) {
|
|
12065
12028
|
setSelectedCategory(selectedCategory);
|
|
12066
12029
|
setCategories(selectedCategory);
|
|
12067
12030
|
};
|
|
12068
|
-
return (
|
|
12069
|
-
React$1.createElement("h3", { className: "will-categories-filter-title" }, t('categories.label')),
|
|
12070
|
-
React$1.createElement("div", { className: "will-categories-filter-inner" }, categoriesPlaceholder.map(function (itm, idx) { return (React$1.createElement("div", { key: idx },
|
|
12071
|
-
React$1.createElement("input", { type: "radio", value: itm, checked: selectedCategory === itm, onChange: function () { return handleCategoryChange(itm); } }),
|
|
12072
|
-
React$1.createElement("span", null, itm))); }))));
|
|
12031
|
+
return (jsxRuntime.jsxs("div", { className: "will-filter-bar-categories", children: [jsxRuntime.jsx("h3", { className: "will-categories-filter-title", children: t('categories.label') }), jsxRuntime.jsx("div", { className: "will-categories-filter-inner", children: categoriesPlaceholder.map(function (itm, idx) { return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("input", { type: "radio", value: itm, checked: selectedCategory === itm, onChange: function () { return handleCategoryChange(itm); } }), jsxRuntime.jsx("span", { children: itm })] }, idx)); }) })] }));
|
|
12073
12032
|
};
|
|
12074
12033
|
|
|
12075
12034
|
var css_248z$4 = ".will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n gap: 10px;\n flex-direction: column;\n min-width: 400px;\n padding: 16px 0;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
|
|
@@ -12078,27 +12037,23 @@ styleInject(css_248z$4);
|
|
|
12078
12037
|
var css_248z$3 = ".will-image-card {\n display: flex;\n gap: 20px;\n justify-content: space-between;\n align-items: center;\n padding: 8px 16px;\n cursor: pointer;\n user-select: none;\n min-height: 40px;\n}\n\n.will-image-card.is-selected {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card:hover {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card-image img {\n width: 120px;\n height: 68px;\n object-fit: cover;\n}\n";
|
|
12079
12038
|
styleInject(css_248z$3);
|
|
12080
12039
|
|
|
12081
|
-
var ImageCard =
|
|
12040
|
+
var ImageCard = React__default.forwardRef(function (_a, ref) {
|
|
12082
12041
|
var title = _a.title, description = _a.description, imageUrl = _a.imageUrl, isSelected = _a.isSelected, onClick = _a.onClick;
|
|
12083
12042
|
var ariaLabel = "".concat(title).concat(description ? ", ".concat(description) : '');
|
|
12084
|
-
return (
|
|
12043
|
+
return (jsxRuntime.jsxs("div", { ref: ref, className: "will-image-card ".concat(isSelected ? 'is-selected' : ''), onClick: onClick, onKeyDown: function (e) {
|
|
12085
12044
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
12086
12045
|
e.preventDefault();
|
|
12087
12046
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12088
12047
|
}
|
|
12089
|
-
}, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel },
|
|
12090
|
-
React$1.createElement("div", { className: "will-image-card-content" },
|
|
12091
|
-
React$1.createElement("h3", null, title),
|
|
12092
|
-
description && React$1.createElement("p", null, description)),
|
|
12093
|
-
React$1.createElement("div", { className: "will-image-card-image" }, imageUrl && React$1.createElement("img", { src: imageUrl, alt: title || 'Location image' }))));
|
|
12048
|
+
}, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel, children: [jsxRuntime.jsxs("div", { className: "will-image-card-content", children: [jsxRuntime.jsx("h3", { children: title }), description && jsxRuntime.jsx("p", { children: description })] }), jsxRuntime.jsx("div", { className: "will-image-card-image", children: imageUrl && jsxRuntime.jsx("img", { src: imageUrl, alt: title || 'Location image' }) })] }));
|
|
12094
12049
|
});
|
|
12095
12050
|
ImageCard.displayName = 'ImageCard';
|
|
12096
12051
|
|
|
12097
|
-
var Locations =
|
|
12052
|
+
var Locations = React__default.forwardRef(function (_a, ref) {
|
|
12098
12053
|
var locations = _a.locations, language = _a.language, selectedLocations = _a.selectedLocations, setSelectedLocations = _a.setSelectedLocations, autoFocus = _a.autoFocus, _b = _a.multiSelect, multiSelect = _b === void 0 ? false : _b, onClose = _a.onClose;
|
|
12099
12054
|
var t = useTranslation('filterBar').t;
|
|
12100
|
-
var firstCardRef =
|
|
12101
|
-
|
|
12055
|
+
var firstCardRef = React__default.useRef(null);
|
|
12056
|
+
React__default.useEffect(function () {
|
|
12102
12057
|
if (autoFocus && firstCardRef.current) {
|
|
12103
12058
|
firstCardRef.current.focus();
|
|
12104
12059
|
}
|
|
@@ -12122,12 +12077,10 @@ var Locations = React$1.forwardRef(function (_a, ref) {
|
|
|
12122
12077
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
12123
12078
|
}
|
|
12124
12079
|
};
|
|
12125
|
-
return (
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12129
|
-
return (React$1.createElement(ImageCard, { key: location.id, ref: index === 0 ? firstCardRef : null, title: location.label, description: location.description, imageUrl: location.imageUrl, isSelected: selectedLocations.some(function (loc) { return loc.id === location.id; }), onClick: function () { return handleLocationClick(location); } }));
|
|
12130
|
-
}))));
|
|
12080
|
+
return (jsxRuntime.jsxs("div", { className: "will-filter-bar-locations", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: t('locations.title'), action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-locations-filter-container", children: !!((locations === null || locations === void 0 ? void 0 : locations.length) && language) &&
|
|
12081
|
+
locations.map(function (location, index) {
|
|
12082
|
+
return (jsxRuntime.jsx(ImageCard, { ref: index === 0 ? firstCardRef : null, title: location.label, description: location.description, imageUrl: location.imageUrl, isSelected: selectedLocations.some(function (loc) { return loc.id === location.id; }), onClick: function () { return handleLocationClick(location); } }, location.id));
|
|
12083
|
+
}) })] }));
|
|
12131
12084
|
});
|
|
12132
12085
|
Locations.displayName = 'Locations';
|
|
12133
12086
|
|
|
@@ -12137,12 +12090,9 @@ styleInject(css_248z$2);
|
|
|
12137
12090
|
var css_248z$1 = ".will-dates-filter-container {\n padding: 0 16px;\n}\n";
|
|
12138
12091
|
styleInject(css_248z$1);
|
|
12139
12092
|
|
|
12140
|
-
var Dates =
|
|
12093
|
+
var Dates = React__default.forwardRef(function (_a, ref) {
|
|
12141
12094
|
var onClose = _a.onClose, autoFocus = _a.autoFocus, calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange, disableCalendarDates = _a.disableCalendarDates, selectedPath = _a.selectedPath, language = _a.language, filtersRef = _a.filtersRef;
|
|
12142
|
-
return (
|
|
12143
|
-
React$1.createElement(FilterSectionHeader, { title: '', action: onClose && React$1.createElement(CloseButton, { handleClose: onClose }) }),
|
|
12144
|
-
React$1.createElement("div", { className: "will-dates-filter-container" },
|
|
12145
|
-
React$1.createElement(Calendar, { autoFocus: autoFocus, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, ref: filtersRef }))));
|
|
12095
|
+
return (jsxRuntime.jsxs("div", { className: "will-filter-bar-dates", ref: ref, children: [jsxRuntime.jsx(FilterSectionHeader, { title: '', action: onClose && jsxRuntime.jsx(CloseButton, { handleClose: onClose }) }), jsxRuntime.jsx("div", { className: "will-dates-filter-container", children: jsxRuntime.jsx(Calendar, { autoFocus: autoFocus, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, ref: filtersRef }) })] }));
|
|
12146
12096
|
});
|
|
12147
12097
|
Dates.displayName = 'Dates';
|
|
12148
12098
|
|
|
@@ -12154,13 +12104,13 @@ function FilterBar(_a) {
|
|
|
12154
12104
|
useUpdateTranslations({ language: language });
|
|
12155
12105
|
var t = useTranslation('filterBar').t;
|
|
12156
12106
|
// Refs for SelectButtons
|
|
12157
|
-
var locationsButtonRef =
|
|
12158
|
-
var datesButtonRef =
|
|
12159
|
-
var guestsButtonRef =
|
|
12160
|
-
var previouslyFocusedButtonRef =
|
|
12161
|
-
var headerRef =
|
|
12107
|
+
var locationsButtonRef = React__default.useRef(null);
|
|
12108
|
+
var datesButtonRef = React__default.useRef(null);
|
|
12109
|
+
var guestsButtonRef = React__default.useRef(null);
|
|
12110
|
+
var previouslyFocusedButtonRef = React__default.useRef(null);
|
|
12111
|
+
var headerRef = React__default.useRef(null);
|
|
12162
12112
|
// Dropdown positioning
|
|
12163
|
-
var _f = __read(
|
|
12113
|
+
var _f = __read(React__default.useState({}), 2), dropdownStyle = _f[0], setDropdownStyle = _f[1];
|
|
12164
12114
|
// Filters
|
|
12165
12115
|
var _g = useFilterBar({
|
|
12166
12116
|
redirectUrl: redirectUrl,
|
|
@@ -12189,7 +12139,7 @@ function FilterBar(_a) {
|
|
|
12189
12139
|
handleSelectedFilter(filter);
|
|
12190
12140
|
};
|
|
12191
12141
|
// Store previously focused button and restore focus when closing
|
|
12192
|
-
|
|
12142
|
+
React__default.useEffect(function () {
|
|
12193
12143
|
if (!selectedFilter && previouslyFocusedButtonRef.current) {
|
|
12194
12144
|
previouslyFocusedButtonRef.current.focus();
|
|
12195
12145
|
previouslyFocusedButtonRef.current = null;
|
|
@@ -12211,50 +12161,31 @@ function FilterBar(_a) {
|
|
|
12211
12161
|
locationsPlaceholder: t('locations.placeholder'),
|
|
12212
12162
|
locationsSelectedLabel: t('locations.selected'),
|
|
12213
12163
|
});
|
|
12214
|
-
return (
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
|
|
12235
|
-
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
|
|
12239
|
-
previouslyFocusedButtonRef.current = datesButtonRef.current;
|
|
12240
|
-
handleSelectedFilterWithPosition(FilterSections.CALENDAR);
|
|
12241
|
-
}, active: !!parsedDates, ariaExpanded: selectedFilter === FilterSections.CALENDAR, ariaControls: "will-calendar-filter" }),
|
|
12242
|
-
selectedPath !== Pages.EVENTS && (React.createElement(React.Fragment, null,
|
|
12243
|
-
React.createElement(Divider, null),
|
|
12244
|
-
React.createElement(SelectButton, { ref: guestsButtonRef, label: t('guests.label'), description: parsedGuests.content, onClick: function () {
|
|
12245
|
-
previouslyFocusedButtonRef.current = guestsButtonRef.current;
|
|
12246
|
-
handleSelectedFilterWithPosition(FilterSections.GUESTS);
|
|
12247
|
-
}, active: !!parsedGuests.data.total, ariaExpanded: selectedFilter === FilterSections.GUESTS, ariaControls: "will-guests-filter" }))),
|
|
12248
|
-
React.createElement(SubmitButton, { onClick: handleSubmit, startIcon: React.createElement(FaSearch, null), label: t('common:search'), isLoading: innerLoading || outerLoading })),
|
|
12249
|
-
selectedFilter && (React.createElement("div", { className: "will-filter-bar-container ".concat(mode || 'light'), style: __assign$2(__assign$2({}, ((!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {})), dropdownStyle) },
|
|
12250
|
-
selectedFilter === FilterSections.CALENDAR && (React.createElement("div", { id: "will-dates-filter" },
|
|
12251
|
-
React.createElement(Dates, { autoFocus: true, ref: filtersRef, onClose: function () { return handleSelectedFilter(false); }, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, filtersRef: filtersRef }))),
|
|
12252
|
-
selectedFilter === FilterSections.GUESTS && (React.createElement("div", { id: "will-guests-filter" },
|
|
12253
|
-
React.createElement(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef, autoFocus: true, onClose: function () { return handleSelectedFilter(false); } }))),
|
|
12254
|
-
selectedFilter === FilterSections.CATEGORIES && (React.createElement("div", { id: "will-categories-filter" },
|
|
12255
|
-
React.createElement(Categories, { categories: categories, setCategories: setCategories }))),
|
|
12256
|
-
selectedFilter === FilterSections.LOCATIONS && (React.createElement("div", { id: "will-locations-filter" },
|
|
12257
|
-
React.createElement(Locations, { autoFocus: true, ref: filtersRef, locations: locations === null || locations === void 0 ? void 0 : locations.data, language: language, selectedLocations: selectedLocations, setSelectedLocations: setSelectedLocations, multiSelect: locations === null || locations === void 0 ? void 0 : locations.multiSelect, onClose: function () { return handleSelectedFilter(false); } })))))));
|
|
12164
|
+
return (jsxRuntime.jsxs("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette, children: [tabs && tabs.length > 1 && (jsxRuntime.jsx("div", { className: "will-filter-bar-tabs", ref: targetFilterBarRef, children: tabs
|
|
12165
|
+
.sort(function (a, b) { return a.order - b.order; })
|
|
12166
|
+
.map(function (tab, idx) { return (jsxRuntime.jsx(TabButton, { label: tab.label || t("tabs.".concat(tab.path.substring(1))), onClick: function () {
|
|
12167
|
+
setSelectedPath(tab.path);
|
|
12168
|
+
handleResetFilters();
|
|
12169
|
+
handleSelectedFilter(false);
|
|
12170
|
+
}, active: selectedPath === tab.path, mode: mode }, "tab-".concat(idx))); }) })), jsxRuntime.jsxs("div", { className: "will-filter-bar-header ".concat(mode || 'light'), ref: function (el) {
|
|
12171
|
+
headerRef.current = el;
|
|
12172
|
+
if ((tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 && targetFilterBarRef) {
|
|
12173
|
+
targetFilterBarRef.current = el;
|
|
12174
|
+
}
|
|
12175
|
+
}, children: [!!((_b = locations === null || locations === void 0 ? void 0 : locations.data) === null || _b === void 0 ? void 0 : _b.length) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SelectButton, { ref: locationsButtonRef, label: t('locations.label'), description: parsedLocations, onClick: function () {
|
|
12176
|
+
previouslyFocusedButtonRef.current = locationsButtonRef.current;
|
|
12177
|
+
handleSelectedFilterWithPosition(FilterSections.LOCATIONS);
|
|
12178
|
+
}, active: !!selectedLocations.length, disabled: locations === null || locations === void 0 ? void 0 : locations.disabled, ariaExpanded: selectedFilter === FilterSections.LOCATIONS, ariaControls: "will-locations-filter" }), jsxRuntime.jsx(Divider, {})] })), jsxRuntime.jsx(SelectButton, { ref: datesButtonRef, label: t('calendar.label'), description: parsedDates
|
|
12179
|
+
? parsedDates
|
|
12180
|
+
: selectedPath === Pages.ROOMS
|
|
12181
|
+
? t('calendar.roomsLabelPlaceholder')
|
|
12182
|
+
: t('calendar.eventsLabelPlaceholder'), onClick: function () {
|
|
12183
|
+
previouslyFocusedButtonRef.current = datesButtonRef.current;
|
|
12184
|
+
handleSelectedFilterWithPosition(FilterSections.CALENDAR);
|
|
12185
|
+
}, active: !!parsedDates, ariaExpanded: selectedFilter === FilterSections.CALENDAR, ariaControls: "will-calendar-filter" }), selectedPath !== Pages.EVENTS && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(SelectButton, { ref: guestsButtonRef, label: t('guests.label'), description: parsedGuests.content, onClick: function () {
|
|
12186
|
+
previouslyFocusedButtonRef.current = guestsButtonRef.current;
|
|
12187
|
+
handleSelectedFilterWithPosition(FilterSections.GUESTS);
|
|
12188
|
+
}, active: !!parsedGuests.data.total, ariaExpanded: selectedFilter === FilterSections.GUESTS, ariaControls: "will-guests-filter" })] })), jsxRuntime.jsx(SubmitButton, { onClick: handleSubmit, startIcon: jsxRuntime.jsx(FaSearch, {}), label: t('common:search'), isLoading: innerLoading || outerLoading })] }), selectedFilter && (jsxRuntime.jsxs("div", { className: "will-filter-bar-container ".concat(mode || 'light'), style: __assign$2(__assign$2({}, ((!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {})), dropdownStyle), children: [selectedFilter === FilterSections.CALENDAR && (jsxRuntime.jsx("div", { id: "will-dates-filter", children: jsxRuntime.jsx(Dates, { autoFocus: true, ref: filtersRef, onClose: function () { return handleSelectedFilter(false); }, calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, filtersRef: filtersRef }) })), selectedFilter === FilterSections.GUESTS && (jsxRuntime.jsx("div", { id: "will-guests-filter", children: jsxRuntime.jsx(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef, autoFocus: true, onClose: function () { return handleSelectedFilter(false); } }) })), selectedFilter === FilterSections.CATEGORIES && (jsxRuntime.jsx("div", { id: "will-categories-filter", children: jsxRuntime.jsx(Categories, { categories: categories, setCategories: setCategories }) })), selectedFilter === FilterSections.LOCATIONS && (jsxRuntime.jsx("div", { id: "will-locations-filter", children: jsxRuntime.jsx(Locations, { autoFocus: true, ref: filtersRef, locations: locations === null || locations === void 0 ? void 0 : locations.data, language: language, selectedLocations: selectedLocations, setSelectedLocations: setSelectedLocations, multiSelect: locations === null || locations === void 0 ? void 0 : locations.multiSelect, onClose: function () { return handleSelectedFilter(false); } }) }))] }))] }));
|
|
12258
12189
|
}
|
|
12259
12190
|
////////////
|
|
12260
12191
|
var AGE_CATEGORIES_FALLBACK = [
|
|
@@ -12277,18 +12208,18 @@ var LANGUAGE_FALLBACK = 'en';
|
|
|
12277
12208
|
var useFilterCalendar = function (_a) {
|
|
12278
12209
|
var onSubmit = _a.onSubmit, setToggleCalendar = _a.setToggleCalendar, noActiveSelection = _a.noActiveSelection, toggleCalendar = _a.toggleCalendar, outerRangeContext = _a.outerRangeContext, outerDisableCalendarDates = _a.outerDisableCalendarDates;
|
|
12279
12210
|
// State
|
|
12280
|
-
var _b = __read(
|
|
12281
|
-
var _c = __read(
|
|
12282
|
-
var _d = __read(
|
|
12283
|
-
var _e = __read(
|
|
12284
|
-
var _f = __read(
|
|
12285
|
-
var _g = __read(
|
|
12286
|
-
var _h = __read(
|
|
12287
|
-
var _j = __read(
|
|
12288
|
-
var _k = __read(
|
|
12211
|
+
var _b = __read(React__default.useState(), 2), calendarRange = _b[0], setCalendarRange = _b[1];
|
|
12212
|
+
var _c = __read(React__default.useState(outerRangeContext), 2), rangeContext = _c[0], setRangeContext = _c[1];
|
|
12213
|
+
var _d = __read(React__default.useState(), 2), initialCalendarRange = _d[0], setInitialCalendarRange = _d[1];
|
|
12214
|
+
var _e = __read(React__default.useState([]), 2), disabledDates = _e[0], setDisabledDates = _e[1];
|
|
12215
|
+
var _f = __read(React__default.useState(false), 2), updateCalendarMonthNavigation = _f[0], setUpdateCalendarMonthNavigation = _f[1];
|
|
12216
|
+
var _g = __read(React__default.useState(0), 2), updateCalendarDefaultMonth = _g[0], setUpdateCalendarDefaultMonth = _g[1];
|
|
12217
|
+
var _h = __read(React__default.useState(false), 2), calendarHasError = _h[0], setCalendarHasError = _h[1];
|
|
12218
|
+
var _j = __read(React__default.useState(false), 2), updatedForSubmit = _j[0], setUpdatedForSubmit = _j[1];
|
|
12219
|
+
var _k = __read(React__default.useState(), 2), disableCalendarDates = _k[0], setDisableCalendarDates = _k[1];
|
|
12289
12220
|
// Lifecycle
|
|
12290
12221
|
// Handle update component with new data
|
|
12291
|
-
|
|
12222
|
+
React__default.useEffect(function () {
|
|
12292
12223
|
var _a;
|
|
12293
12224
|
if (outerDisableCalendarDates === null || outerDisableCalendarDates === void 0 ? void 0 : outerDisableCalendarDates.availableDates) {
|
|
12294
12225
|
setDisableCalendarDates({
|
|
@@ -12306,7 +12237,7 @@ var useFilterCalendar = function (_a) {
|
|
|
12306
12237
|
}
|
|
12307
12238
|
}, [outerDisableCalendarDates]);
|
|
12308
12239
|
// Handle Range Context initial selections
|
|
12309
|
-
|
|
12240
|
+
React__default.useEffect(function () {
|
|
12310
12241
|
if (typeof window === 'undefined')
|
|
12311
12242
|
return;
|
|
12312
12243
|
var urlSearchParams = new URLSearchParams(window.location.search);
|
|
@@ -12336,7 +12267,7 @@ var useFilterCalendar = function (_a) {
|
|
|
12336
12267
|
}
|
|
12337
12268
|
}, [toggleCalendar]);
|
|
12338
12269
|
// Handle submit dates
|
|
12339
|
-
|
|
12270
|
+
React__default.useEffect(function () {
|
|
12340
12271
|
var formatString = 'dd.MM.yyyy';
|
|
12341
12272
|
var initialRangeTo = (initialCalendarRange === null || initialCalendarRange === void 0 ? void 0 : initialCalendarRange.to)
|
|
12342
12273
|
? format(initialCalendarRange.to, formatString)
|
|
@@ -12395,36 +12326,26 @@ var Footer = function (_a) {
|
|
|
12395
12326
|
var nights = nightsCount({
|
|
12396
12327
|
calendarRange: calendarRange,
|
|
12397
12328
|
});
|
|
12398
|
-
return (
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12414
|
-
language: language,
|
|
12415
|
-
}) || t('common:checkOut')))),
|
|
12416
|
-
React$1.createElement("span", { className: "will-calendar-footer-booked" }, !calendarHasError && nights
|
|
12417
|
-
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12418
|
-
: '')),
|
|
12419
|
-
React$1.createElement("div", { className: "will-calendar-footer-actions" },
|
|
12420
|
-
React$1.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))));
|
|
12329
|
+
return (jsxRuntime.jsxs("div", { className: "will-calendar-footer-actions-wrapper", children: [jsxRuntime.jsxs("div", { className: "will-calendar-footer-dates", children: [calendarHasError ? (jsxRuntime.jsx("div", { className: "will-calendar-footer-error", children: calendarHasError &&
|
|
12330
|
+
renderCalendarErrorMessage({
|
|
12331
|
+
palette: palette,
|
|
12332
|
+
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12333
|
+
}) })) : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("span", { children: parseDate({
|
|
12334
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12335
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12336
|
+
language: language,
|
|
12337
|
+
}) || t('common:checkIn') }), jsxRuntime.jsx("span", { className: "will-calendar-footer-dates-separator", children: "-" }), jsxRuntime.jsx("span", { children: parseDate({
|
|
12338
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12339
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12340
|
+
language: language,
|
|
12341
|
+
}) || t('common:checkOut') })] })), jsxRuntime.jsx("span", { className: "will-calendar-footer-booked", children: !calendarHasError && nights
|
|
12342
|
+
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12343
|
+
: '' })] }), jsxRuntime.jsx("div", { className: "will-calendar-footer-actions", children: jsxRuntime.jsx(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }) })] }));
|
|
12421
12344
|
};
|
|
12422
12345
|
/////////
|
|
12423
12346
|
var renderCalendarErrorMessage = function (_a) {
|
|
12424
12347
|
var message = _a.message, palette = _a.palette;
|
|
12425
|
-
return (
|
|
12426
|
-
React$1.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }),
|
|
12427
|
-
React$1.createElement("span", null, message || '')));
|
|
12348
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }), jsxRuntime.jsx("span", { children: message || '' })] }));
|
|
12428
12349
|
};
|
|
12429
12350
|
|
|
12430
12351
|
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}";
|
|
@@ -12450,14 +12371,7 @@ function FilterCalendar(_a) {
|
|
|
12450
12371
|
var filtersRef = useCloseFilterSection({
|
|
12451
12372
|
handleSelectedFilter: setToggleCalendar,
|
|
12452
12373
|
}).filtersRef;
|
|
12453
|
-
return (
|
|
12454
|
-
React$1.createElement("div", { className: "will-calendar-header" },
|
|
12455
|
-
React$1.createElement("h2", null, t('filterBar:calendar.title')),
|
|
12456
|
-
React$1.createElement(CloseButton, { handleClose: function () { return setToggleCalendar(false); } })),
|
|
12457
|
-
React$1.createElement("div", { className: "will-calendar-main" },
|
|
12458
|
-
React$1.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError })),
|
|
12459
|
-
React$1.createElement("div", { className: "will-calendar-footer" },
|
|
12460
|
-
React$1.createElement(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }))))));
|
|
12374
|
+
return (jsxRuntime.jsx("div", { className: "will-root", style: themePalette, children: toggleCalendar && (jsxRuntime.jsxs("div", { className: "will-calendar-wrapper", ref: filtersRef, children: [jsxRuntime.jsxs("div", { className: "will-calendar-header", children: [jsxRuntime.jsx("h2", { children: t('filterBar:calendar.title') }), jsxRuntime.jsx(CloseButton, { handleClose: function () { return setToggleCalendar(false); } })] }), jsxRuntime.jsx("div", { className: "will-calendar-main", children: jsxRuntime.jsx(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError }) }), jsxRuntime.jsx("div", { className: "will-calendar-footer", children: jsxRuntime.jsx(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }) })] })) }));
|
|
12461
12375
|
}
|
|
12462
12376
|
|
|
12463
12377
|
exports.Button = Button$1;
|