ublo-lib 1.18.4 → 1.18.5

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.
@@ -30,6 +30,7 @@ const DateItem = ({
30
30
  _date.setHours(0, 0, 0, 0);
31
31
  const isToday = Utils.isSameDay(_date, today);
32
32
  const inMonth = month && year && Utils.isSameMonth(_date, new Date([Utils.zeroPad(year, 2), Utils.zeroPad(month, 2), "01"].join("-")));
33
+ const isDisabled = Utils.isBefore(date, min) || Utils.isAfter(date, max);
33
34
  const enableAvailability = Boolean(stays);
34
35
  const isAvailable = stays?.some(stay => {
35
36
  return stay.start < _date && stay.end > _date;
@@ -43,7 +44,7 @@ const DateItem = ({
43
44
  if (isLastSelected) setLastSelectedDate(index);
44
45
  }, [index, isFirstSelected, isLastSelected, setFirstSelectedDate, setLastSelectedDate]);
45
46
  const updateDateSelection = () => {
46
- if (isPastDate) return;
47
+ if (isPastDate || isDisabled) return;
47
48
  if (singleDate) {
48
49
  setSelectedDates([_date]);
49
50
  setSelecting(false);
@@ -94,7 +95,6 @@ const DateItem = ({
94
95
  }
95
96
  };
96
97
  const isSelected = !!selectedDates.find(d => d.getTime() === _date.getTime());
97
- const isDisabled = Utils.isBefore(date, min) || Utils.isAfter(date, max);
98
98
  const classes = classNames(styles.date, {
99
99
  [styles.dateToday]: isToday,
100
100
  [styles.dateSelected]: isSelected,
@@ -111,6 +111,7 @@ const DateItem = ({
111
111
  className: classes,
112
112
  onClick: updateDateSelection,
113
113
  tabIndex: isPastDate ? -1 : 0,
114
+ disabled: isPastDate || isDisabled,
114
115
  children: _date.getDate()
115
116
  });
116
117
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.18.4",
3
+ "version": "1.18.5",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.9.0",
6
6
  "leaflet": "^1.9.1",