willba-component-library 0.2.39 → 0.2.41
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 +19 -15
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +19 -15
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +19 -15
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/core/components/calendar/Calendar.tsx +18 -14
package/lib/index.esm.js
CHANGED
|
@@ -10809,20 +10809,6 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
10809
10809
|
var isTablet = reactResponsiveExports.useMediaQuery({ maxWidth: 960 });
|
|
10810
10810
|
var today = startOfDay(new Date());
|
|
10811
10811
|
var selectedStartDate = calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from;
|
|
10812
|
-
// Handle loading spinner
|
|
10813
|
-
useEffect(function () {
|
|
10814
|
-
if (typeof document === 'undefined')
|
|
10815
|
-
return;
|
|
10816
|
-
var loadingSpinner = document.querySelector('.will-filter-bar-calendar .will-calendar-spinner');
|
|
10817
|
-
if (loadingData) {
|
|
10818
|
-
if (loadingSpinner)
|
|
10819
|
-
loadingSpinner.style.display = 'flex';
|
|
10820
|
-
}
|
|
10821
|
-
else {
|
|
10822
|
-
if (loadingSpinner)
|
|
10823
|
-
loadingSpinner.style.display = 'none';
|
|
10824
|
-
}
|
|
10825
|
-
}, [loadingData]);
|
|
10826
10812
|
// Handle overlapping availableDates.lastCheckOut and disabledDates.start
|
|
10827
10813
|
var _c = __read(useState(undefined), 2), overlappingDate = _c[0], setOverlappingDate = _c[1];
|
|
10828
10814
|
useMemo(function () {
|
|
@@ -10884,6 +10870,7 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
10884
10870
|
var calendarOverlappingDate = document.querySelectorAll('.will-filter-bar-calendar .rdp-cell:has(.overlapping-date)');
|
|
10885
10871
|
var tooltipClonesCheckIn = [];
|
|
10886
10872
|
var tooltipClonesCheckOut = [];
|
|
10873
|
+
var tooltipClonesSpinner = [];
|
|
10887
10874
|
var tooltipClonesOverlappingDates = [];
|
|
10888
10875
|
if (calendarTooltip && calendarButtons.length > 0) {
|
|
10889
10876
|
calendarButtons.forEach(function (element) {
|
|
@@ -10900,7 +10887,9 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
10900
10887
|
});
|
|
10901
10888
|
}
|
|
10902
10889
|
if (loadingSpinner && calendarMonthContainer) {
|
|
10903
|
-
|
|
10890
|
+
var tooltipClone = loadingSpinner.cloneNode(true);
|
|
10891
|
+
calendarMonthContainer.appendChild(tooltipClone);
|
|
10892
|
+
tooltipClonesSpinner.push(tooltipClone);
|
|
10904
10893
|
}
|
|
10905
10894
|
if (calendarTooltipOverlappingDate &&
|
|
10906
10895
|
calendarOverlappingDate.length > 0) {
|
|
@@ -10913,6 +10902,7 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
10913
10902
|
return function () {
|
|
10914
10903
|
tooltipClonesCheckIn.forEach(function (clone) { return clone.remove(); });
|
|
10915
10904
|
tooltipClonesCheckOut.forEach(function (clone) { return clone.remove(); });
|
|
10905
|
+
tooltipClonesSpinner.forEach(function (clone) { return clone.remove(); });
|
|
10916
10906
|
tooltipClonesOverlappingDates.forEach(function (clone) { return clone.remove(); });
|
|
10917
10907
|
};
|
|
10918
10908
|
}, [
|
|
@@ -10922,6 +10912,20 @@ var Calendar = forwardRef(function (_a, ref) {
|
|
|
10922
10912
|
initialCalendarRange,
|
|
10923
10913
|
updateCalendarDefaultMoth,
|
|
10924
10914
|
]);
|
|
10915
|
+
// Handle loading spinner
|
|
10916
|
+
useEffect(function () {
|
|
10917
|
+
if (typeof document === 'undefined')
|
|
10918
|
+
return;
|
|
10919
|
+
var loadingSpinner = document.querySelector('.will-filter-bar-calendar .rdp-months .will-calendar-spinner');
|
|
10920
|
+
if (loadingData) {
|
|
10921
|
+
if (loadingSpinner)
|
|
10922
|
+
loadingSpinner.style.display = 'flex';
|
|
10923
|
+
}
|
|
10924
|
+
else {
|
|
10925
|
+
if (loadingSpinner)
|
|
10926
|
+
loadingSpinner.style.display = 'none';
|
|
10927
|
+
}
|
|
10928
|
+
}, [loadingData, updateCalendarMonthNavigation, updateCalendarDefaultMoth]);
|
|
10925
10929
|
return (React__default__default.createElement("div", { className: "will-filter-bar-calendar", ref: ref },
|
|
10926
10930
|
React__default__default.createElement("div", { className: "will-calendar-filter-container" },
|
|
10927
10931
|
React__default__default.createElement(DayPicker, { key: updateCalendarDefaultMoth, id: "will-calendar", mode: "range", locale: language === 'en' ? enUS : fi, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, selected: calendarRange, onSelect: function (range) {
|