willba-component-library 0.2.59 → 0.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +1 -1
- package/lib/index.esm.js +12 -14
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +12 -14
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +12 -14
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +9 -20
- package/src/components/FilterCalendar/FilterCalendar.tsx +1 -1
- package/src/core/components/calendar/Calendar.tsx +0 -2
- package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +0 -1
- package/src/core/components/calendar/utils/calendarSelectionRules.tsx +2 -1
- package/src/core/components/calendar/utils/handleCalendarModifiers.tsx +15 -13
|
@@ -25,11 +25,11 @@ export declare const handleCalendarModifiers: ({ newDisableCalendarDates, calend
|
|
|
25
25
|
from: Date | undefined;
|
|
26
26
|
}[];
|
|
27
27
|
noActiveSelectionStart: never[] | Date;
|
|
28
|
+
noActiveSelectionEnd: never[] | Date;
|
|
28
29
|
noActiveSelectionMid: {
|
|
29
30
|
from: Date;
|
|
30
31
|
to: Date;
|
|
31
32
|
}[];
|
|
32
|
-
noActiveSelectionEnd: never[] | Date;
|
|
33
33
|
checkoutOptionsMid: {
|
|
34
34
|
after: Date;
|
|
35
35
|
before: Date;
|
package/lib/index.esm.js
CHANGED
|
@@ -11010,7 +11010,6 @@ var calendarSelectionRules = function (_a) {
|
|
|
11010
11010
|
// Calendar selection rules: The cases are handled sequentially, starting from simple selections to more complex contextual selections.
|
|
11011
11011
|
// The rules are processed in a specific order, so one case is handled before another.
|
|
11012
11012
|
// Changing the order will cause the rules to break or not work properly.
|
|
11013
|
-
console.log(overlappingDateTo);
|
|
11014
11013
|
if (!!overlappingDateFrom ||
|
|
11015
11014
|
(calendarRangeFrom && calendarRangeTo && overlappingDateTo)) {
|
|
11016
11015
|
// 1. If dates overlap, clear the selection.
|
|
@@ -11133,24 +11132,26 @@ var handleCalendarModifiers = function (_a) {
|
|
|
11133
11132
|
disabledAfterCheckIn: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from)
|
|
11134
11133
|
? [{ after: calendarRange.from }]
|
|
11135
11134
|
: [],
|
|
11136
|
-
overlappingDate: __spreadArray$1([], __read((!(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) && !!(overlappingDate === null || overlappingDate === void 0 ? void 0 : overlappingDate.length)
|
|
11135
|
+
overlappingDate: __spreadArray$1([], __read((!(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) && !!(overlappingDate === null || overlappingDate === void 0 ? void 0 : overlappingDate.length)
|
|
11137
11136
|
? overlappingDate.map(function (date) { return ({ from: date.from }); })
|
|
11138
11137
|
: [])), false),
|
|
11139
11138
|
noActiveSelectionStart: (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.from) &&
|
|
11140
|
-
!((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) &&
|
|
11141
|
-
(rangeContext
|
|
11142
|
-
|
|
11139
|
+
!(((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) &&
|
|
11140
|
+
isEqual(endOfDay(rangeContext.from), endOfDay(calendarRange.from))) ||
|
|
11141
|
+
((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) &&
|
|
11142
|
+
isEqual(endOfDay(rangeContext.from), endOfDay(calendarRange.to))))
|
|
11143
11143
|
? rangeContext.from
|
|
11144
11144
|
: [],
|
|
11145
|
-
noActiveSelectionMid: __spreadArray$1([], __read((rangeContextMiddleSelection.length
|
|
11146
|
-
? rangeContextMiddleSelection
|
|
11147
|
-
: [])), false),
|
|
11148
11145
|
noActiveSelectionEnd: (rangeContext === null || rangeContext === void 0 ? void 0 : rangeContext.to) &&
|
|
11149
|
-
!((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) &&
|
|
11150
|
-
(rangeContext
|
|
11151
|
-
|
|
11146
|
+
!(((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) &&
|
|
11147
|
+
isEqual(endOfDay(rangeContext.to), endOfDay(calendarRange.from))) ||
|
|
11148
|
+
((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) &&
|
|
11149
|
+
isEqual(endOfDay(rangeContext.to), endOfDay(calendarRange.to))))
|
|
11152
11150
|
? rangeContext.to
|
|
11153
11151
|
: [],
|
|
11152
|
+
noActiveSelectionMid: __spreadArray$1([], __read((rangeContextMiddleSelection.length
|
|
11153
|
+
? rangeContextMiddleSelection
|
|
11154
|
+
: [])), false),
|
|
11154
11155
|
checkoutOptionsMid: __spreadArray$1([], __read(((calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) &&
|
|
11155
11156
|
!(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) &&
|
|
11156
11157
|
(currentSelectionLastCheckoutDate === null || currentSelectionLastCheckoutDate === void 0 ? void 0 : currentSelectionLastCheckoutDate.lastCheckOut)
|
|
@@ -11255,7 +11256,6 @@ var checkForContinuousSelection = function (_a) {
|
|
|
11255
11256
|
var useCalendarTooltips = function (_a) {
|
|
11256
11257
|
var showFeedback = _a.showFeedback;
|
|
11257
11258
|
return useEffect(function () {
|
|
11258
|
-
console.log('3');
|
|
11259
11259
|
if (typeof document === 'undefined' || !showFeedback)
|
|
11260
11260
|
return;
|
|
11261
11261
|
// Children
|
|
@@ -11419,7 +11419,6 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
11419
11419
|
selectedPath: selectedPath,
|
|
11420
11420
|
newDisableCalendarDates: newDisableCalendarDates,
|
|
11421
11421
|
});
|
|
11422
|
-
console.log('2', t('noCheckIn'));
|
|
11423
11422
|
// Handle tooltip
|
|
11424
11423
|
useCalendarTooltips({
|
|
11425
11424
|
showFeedback: showFeedback,
|
|
@@ -11985,7 +11984,6 @@ function FilterCalendar(_a) {
|
|
|
11985
11984
|
// Translations
|
|
11986
11985
|
useUpdateTranslations({ language: language });
|
|
11987
11986
|
var t = useTranslation().t;
|
|
11988
|
-
console.log('1', t('noCheckIn'));
|
|
11989
11987
|
var _b = useFilterCalendar({
|
|
11990
11988
|
onSubmit: onSubmit,
|
|
11991
11989
|
setToggleCalendar: setToggleCalendar,
|