willba-component-library 0.1.70 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.esm.js +4 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4 -8
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +4 -8
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -1
- package/src/components/FilterBar/components/calendar/Calendar.tsx +7 -7
package/lib/index.js
CHANGED
|
@@ -11065,22 +11065,18 @@ var css_248z$3 = ".will-calendar-filter-header {\n padding: 15px 0;\n border-b
|
|
|
11065
11065
|
styleInject(css_248z$3);
|
|
11066
11066
|
|
|
11067
11067
|
var Calendar = React__default.forwardRef(function (_a, ref) {
|
|
11068
|
-
var
|
|
11068
|
+
var _b;
|
|
11069
|
+
var calendarRange = _a.calendarRange, setCalendarRange = _a.setCalendarRange, calendarOffset = _a.calendarOffset, selectedPath = _a.selectedPath, locale = _a.locale;
|
|
11069
11070
|
var isTablet = reactResponsiveExports.useMediaQuery({ maxWidth: 960 });
|
|
11070
11071
|
React__default.useEffect(function () {
|
|
11071
11072
|
if (!calendarRange)
|
|
11072
11073
|
setCalendarRange(undefined);
|
|
11073
11074
|
}, []);
|
|
11074
11075
|
var today = startOfDay(new Date());
|
|
11075
|
-
|
|
11076
|
-
// calendarOffset && typeof calendarOffset === 'object'
|
|
11077
|
-
// ? Object.entries(calendarOffset).find(
|
|
11078
|
-
// (page) => selectedPath.substring(1) === page[0]
|
|
11079
|
-
// )
|
|
11080
|
-
// : null
|
|
11076
|
+
var daysToOffsetCalendar = (_b = Object.entries(calendarOffset)) === null || _b === void 0 ? void 0 : _b.find(function (page) { return selectedPath.substring(1) === page[0]; });
|
|
11081
11077
|
var disabledDays = [
|
|
11082
11078
|
{
|
|
11083
|
-
from: addDays(today, -2),
|
|
11079
|
+
from: addDays(today, !!(daysToOffsetCalendar === null || daysToOffsetCalendar === void 0 ? void 0 : daysToOffsetCalendar.length) ? daysToOffsetCalendar[1] : -2),
|
|
11084
11080
|
to: addDays(today, -100),
|
|
11085
11081
|
},
|
|
11086
11082
|
];
|