@steroidsjs/bootstrap 3.0.38 → 3.0.39
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.
|
@@ -48,13 +48,20 @@ function CalendarView(props) {
|
|
|
48
48
|
var localeComponent = (0, hooks_1.useComponents)().locale;
|
|
49
49
|
//TODO Исправить тип, связано с yarn tsc в action publish.yml
|
|
50
50
|
var DayPicker = react_day_picker_1["default"];
|
|
51
|
-
var month = props.month, toYear = props.toYear, fromYear = props.fromYear, showFooter = props.showFooter, showTodayButton = props.showTodayButton, onDaySelect = props.onDaySelect, selectedDates = props.selectedDates, onMonthSelect = props.onMonthSelect, numberOfMonths = props.numberOfMonths, toggleCaptionPanel = props.toggleCaptionPanel, isCaptionPanelVisible = props.isCaptionPanelVisible;
|
|
51
|
+
var month = props.month, toYear = props.toYear, fromYear = props.fromYear, showFooter = props.showFooter, showTodayButton = props.showTodayButton, onDaySelect = props.onDaySelect, selectedDates = props.selectedDates, onMonthSelect = props.onMonthSelect, numberOfMonths = props.numberOfMonths, toggleCaptionPanel = props.toggleCaptionPanel, isCaptionPanelVisible = props.isCaptionPanelVisible, todayDate = props.todayDate;
|
|
52
52
|
var isRange = !!selectedDates[0] && !!selectedDates[1];
|
|
53
53
|
var _a = (0, react_1.useMemo)(function () {
|
|
54
54
|
var from = selectedDates[0];
|
|
55
55
|
var to = selectedDates[1];
|
|
56
56
|
var inRange = function (day) { return react_day_picker_1.DateUtils.isDayAfter(day, from) && react_day_picker_1.DateUtils.isDayBefore(day, to); };
|
|
57
57
|
var outRange = function (day) { return react_day_picker_1.DateUtils.isDayBefore(day, from); };
|
|
58
|
+
var rangeModifiers = isRange && !react_day_picker_1.DateUtils.isSameDay(from, to)
|
|
59
|
+
? {
|
|
60
|
+
start: from,
|
|
61
|
+
end: to,
|
|
62
|
+
inRange: inRange
|
|
63
|
+
}
|
|
64
|
+
: undefined;
|
|
58
65
|
return {
|
|
59
66
|
selectedDays: isRange
|
|
60
67
|
? [from, {
|
|
@@ -62,15 +69,9 @@ function CalendarView(props) {
|
|
|
62
69
|
to: to
|
|
63
70
|
}]
|
|
64
71
|
: from,
|
|
65
|
-
modifiers:
|
|
66
|
-
? {
|
|
67
|
-
start: from,
|
|
68
|
-
end: to,
|
|
69
|
-
inRange: inRange
|
|
70
|
-
}
|
|
71
|
-
: undefined
|
|
72
|
+
modifiers: __assign(__assign({}, (rangeModifiers || {})), { today: function (day) { return react_day_picker_1.DateUtils.isSameDay(day, todayDate); } })
|
|
72
73
|
};
|
|
73
|
-
}, [isRange, selectedDates]), selectedDays = _a.selectedDays, modifiers = _a.modifiers;
|
|
74
|
+
}, [isRange, selectedDates, todayDate]), selectedDays = _a.selectedDays, modifiers = _a.modifiers;
|
|
74
75
|
var shouldShowFooter = (0, react_1.useMemo)(function () { return (
|
|
75
76
|
// Показывать кнопку "закрыть", если открыто меню с выбором месяца, независимо от showTodayButton
|
|
76
77
|
(showFooter && isCaptionPanelVisible)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-use": "^17.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@steroidsjs/core": "3.0.
|
|
38
|
+
"@steroidsjs/core": "3.0.73",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.6",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|