@salutejs/plasma-new-hope 0.324.0-canary.1983.15135554391.0 → 0.324.0-canary.1984.15139244526.0
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/cjs/components/Calendar/hooks/useMonths.js +3 -1
- package/cjs/components/Calendar/hooks/useMonths.js.map +1 -1
- package/cjs/components/Calendar/hooks/useQuarters.js +3 -1
- package/cjs/components/Calendar/hooks/useQuarters.js.map +1 -1
- package/cjs/components/Calendar/hooks/useYears.js +3 -1
- package/cjs/components/Calendar/hooks/useYears.js.map +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js +30 -24
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Mask/Mask.js +9 -2
- package/cjs/components/Mask/Mask.js.map +1 -1
- package/emotion/cjs/components/Calendar/hooks/useMonths.js +3 -1
- package/emotion/cjs/components/Calendar/hooks/useQuarters.js +3 -1
- package/emotion/cjs/components/Calendar/hooks/useYears.js +3 -1
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +30 -24
- package/emotion/cjs/components/Mask/Mask.js +9 -2
- package/emotion/cjs/engines/emotion.js +3 -8
- package/emotion/es/components/Calendar/hooks/useMonths.js +3 -1
- package/emotion/es/components/Calendar/hooks/useQuarters.js +3 -1
- package/emotion/es/components/Calendar/hooks/useYears.js +3 -1
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +30 -24
- package/emotion/es/components/Mask/Mask.js +9 -2
- package/emotion/es/engines/emotion.js +3 -8
- package/es/components/Calendar/hooks/useMonths.js +3 -1
- package/es/components/Calendar/hooks/useMonths.js.map +1 -1
- package/es/components/Calendar/hooks/useQuarters.js +3 -1
- package/es/components/Calendar/hooks/useQuarters.js.map +1 -1
- package/es/components/Calendar/hooks/useYears.js +3 -1
- package/es/components/Calendar/hooks/useYears.js.map +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js +30 -24
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Mask/Mask.js +9 -2
- package/es/components/Mask/Mask.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Calendar/hooks/useMonths.js +3 -1
- package/styled-components/cjs/components/Calendar/hooks/useQuarters.js +3 -1
- package/styled-components/cjs/components/Calendar/hooks/useYears.js +3 -1
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +30 -24
- package/styled-components/cjs/components/Mask/Mask.js +9 -2
- package/styled-components/cjs/engines/styled-components.js +3 -8
- package/styled-components/es/components/Calendar/hooks/useMonths.js +3 -1
- package/styled-components/es/components/Calendar/hooks/useQuarters.js +3 -1
- package/styled-components/es/components/Calendar/hooks/useYears.js +3 -1
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +30 -24
- package/styled-components/es/components/Mask/Mask.js +9 -2
- package/styled-components/es/engines/styled-components.js +3 -8
- package/types/components/Calendar/hooks/types.d.ts +7 -2
- package/types/components/Calendar/hooks/types.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useMonths.d.ts +1 -1
- package/types/components/Calendar/hooks/useMonths.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useQuarters.d.ts +1 -1
- package/types/components/Calendar/hooks/useQuarters.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useYears.d.ts +1 -1
- package/types/components/Calendar/hooks/useYears.d.ts.map +1 -1
- package/types/components/Calendar/utils/getDateWithModification.d.ts.map +1 -1
- package/types/components/Mask/Mask.d.ts.map +1 -1
- package/types/engines/emotion.d.ts.map +1 -1
- package/types/engines/styled-components.d.ts.map +1 -1
@@ -34,17 +34,13 @@ var Root = /*#__PURE__*/(0, _base["default"])("div", {
|
|
34
34
|
}, ";", function (_ref4) {
|
35
35
|
var intersectionStyles = _ref4.intersectionStyles;
|
36
36
|
return intersectionStyles;
|
37
|
-
}, ";"
|
38
|
-
var invariants = _ref5.invariants;
|
39
|
-
return invariants;
|
40
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMapping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cbiAgICAgICAgICAgIDxSXG4gICAgICAgICAgICAgICAgYmFzZT17YmFzZX1cbiAgICAgICAgICAgICAgICBzdGF0aWNWYXJpYW50cz17c3RhdGljVmFyaWFudHN9XG4gICAgICAgICAgICAgICAgZHluYW1pY1ZhcmlhbnRzPXtkeW5hbWljVmFyaWFudHN9XG4gICAgICAgICAgICAgICAgaW50ZXJzZWN0aW9uU3R5bGVzPXtpbnRlcnNlY3Rpb25TdHlsZXN9XG4gICAgICAgICAgICAgICAgaW52YXJpYW50cz17aW52YXJpYW50c31cbiAgICAgICAgICAgICAgICB7Li4ucHJvcHN9XG4gICAgICAgICAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgICAgICAvPlxuICAgICAgICApO1xuICAgIH0pO1xufTtcbiJdfQ== */"));
|
37
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy1lbW90aW9uL2VuZ2luZXMvZW1vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBY0UiLCJmaWxlIjoiLi4vLi4vLi4vc3JjLWVtb3Rpb24vZW5naW5lcy9lbW90aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBnZXRTdGF0aWNWYXJpYW50cywgZ2V0RHluYW1pY1ZhcmlhbnRzLCBnZXRJbnRlcnNlY3Rpb25TdHlsZXMgfSBmcm9tICcuL3V0aWxzJztcbmltcG9ydCB7IENvbXBvbmVudENvbmZpZywgSFRNTEFueUF0d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SB0YWcgYXMgbW9yZSB0aGVuIHN0cmluZyA/XG4gICAgY29uc3QgUiA9IFJvb3Qud2l0aENvbXBvbmVudCh0YWcgYXMga2V5b2YgSlNYLkludHJpbnNpY0VsZW1lbnRzKTtcblxuICAgIHJldHVybiBmb3J3YXJkUmVmPEhUTUxFbGVtZW50LCBIVE1MQW55QXR0cmlidXRlcz4oKHByb3BzLCByZWYpID0+IHtcbiAgICAgICAgY29uc3QgaW50ZXJzZWN0aW9uU3R5bGVzID0gZ2V0SW50ZXJzZWN0aW9uU3R5bGVzKHByb3BzLCBpbnRlcnNlY3Rpb25zKTtcblxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPFJcbiAgICAgICAgICAgICAgICBiYXNlPXtiYXNlfVxuICAgICAgICAgICAgICAgIHN0YXRpY1ZhcmlhbnRzPXtzdGF0aWNWYXJpYW50c31cbiAgICAgICAgICAgICAgICBkeW5hbWljVmFyaWFudHM9e2R5bmFtaWNWYXJpYW50c31cbiAgICAgICAgICAgICAgICBpbnRlcnNlY3Rpb25TdHlsZXM9e2ludGVyc2VjdGlvblN0eWxlc31cbiAgICAgICAgICAgICAgICB7Li4ucHJvcHN9XG4gICAgICAgICAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgICAgICAvPlxuICAgICAgICApO1xuICAgIH0pO1xufTtcbiJdfQ== */"));
|
41
38
|
|
42
39
|
/* eslint-disable no-underscore-dangle */
|
43
40
|
var _component = exports._component = function _component(componentConfig) {
|
44
41
|
var tag = componentConfig.tag,
|
45
42
|
base = componentConfig.base,
|
46
|
-
intersections = componentConfig.intersections
|
47
|
-
invariants = componentConfig.invariants;
|
43
|
+
intersections = componentConfig.intersections;
|
48
44
|
var staticVariants = (0, _utils.getStaticVariants)(componentConfig);
|
49
45
|
var dynamicVariants = (0, _utils.getDynamicVariants)(componentConfig);
|
50
46
|
|
@@ -59,8 +55,7 @@ var _component = exports._component = function _component(componentConfig) {
|
|
59
55
|
base: base,
|
60
56
|
staticVariants: staticVariants,
|
61
57
|
dynamicVariants: dynamicVariants,
|
62
|
-
intersectionStyles: intersectionStyles
|
63
|
-
invariants: invariants
|
58
|
+
intersectionStyles: intersectionStyles
|
64
59
|
}, props, {
|
65
60
|
ref: ref
|
66
61
|
}));
|
@@ -12,7 +12,8 @@ export var useMonths = function useMonths(_ref) {
|
|
12
12
|
min = _ref.min,
|
13
13
|
max = _ref.max,
|
14
14
|
_ref$locale = _ref.locale,
|
15
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale
|
15
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
16
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
16
17
|
return useMemo(function () {
|
17
18
|
var months = SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
18
19
|
return {
|
@@ -37,6 +38,7 @@ export var useMonths = function useMonths(_ref) {
|
|
37
38
|
type: CalendarState.Months,
|
38
39
|
min: min,
|
39
40
|
max: max,
|
41
|
+
includeEdgeDates: includeEdgeDates,
|
40
42
|
eventList: eventList,
|
41
43
|
disabledList: disabledList
|
42
44
|
});
|
@@ -10,7 +10,8 @@ export var useQuarters = function useQuarters(_ref) {
|
|
10
10
|
eventList = _ref.eventList,
|
11
11
|
disabledList = _ref.disabledList,
|
12
12
|
min = _ref.min,
|
13
|
-
max = _ref.max
|
13
|
+
max = _ref.max,
|
14
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
14
15
|
return useMemo(function () {
|
15
16
|
var quarters = QUARTER_NAMES.map(function (quarterName) {
|
16
17
|
var _quarterDates$quarter = quarterDates[quarterName],
|
@@ -36,6 +37,7 @@ export var useQuarters = function useQuarters(_ref) {
|
|
36
37
|
type: CalendarState.Quarters,
|
37
38
|
min: min,
|
38
39
|
max: max,
|
40
|
+
includeEdgeDates: includeEdgeDates,
|
39
41
|
eventList: eventList,
|
40
42
|
disabledList: disabledList
|
41
43
|
});
|
@@ -11,7 +11,8 @@ export var useYears = function useYears(_ref) {
|
|
11
11
|
eventList = _ref.eventList,
|
12
12
|
disabledList = _ref.disabledList,
|
13
13
|
min = _ref.min,
|
14
|
-
max = _ref.max
|
14
|
+
max = _ref.max,
|
15
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
15
16
|
return useMemo(function () {
|
16
17
|
// type-coverage:ignore-next-line
|
17
18
|
var years = Array.from(Array(YEAR_RENDER_COUNT), function (_, i) {
|
@@ -36,6 +37,7 @@ export var useYears = function useYears(_ref) {
|
|
36
37
|
type: CalendarState.Years,
|
37
38
|
min: min,
|
38
39
|
max: max,
|
40
|
+
includeEdgeDates: includeEdgeDates,
|
39
41
|
eventList: eventList,
|
40
42
|
disabledList: disabledList
|
41
43
|
});
|
@@ -42,7 +42,7 @@ var normalizeDate = function normalizeDate(date, type) {
|
|
42
42
|
date.setMonth(0);
|
43
43
|
}
|
44
44
|
};
|
45
|
-
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
45
|
+
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdgeDates) {
|
46
46
|
var year = _ref.year,
|
47
47
|
monthIndex = _ref.monthIndex,
|
48
48
|
day = _ref.day;
|
@@ -54,13 +54,14 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
|
54
54
|
var currentDate = new Date(year, monthIndex, day);
|
55
55
|
dateOperationHandler[type].add(currentDate);
|
56
56
|
var isOut = true;
|
57
|
-
|
58
|
-
|
57
|
+
var maxDateCondition = includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate;
|
58
|
+
while (isOut && maxDateCondition) {
|
59
|
+
isOut = false;
|
59
60
|
dateOperationHandler[type].add(currentDate);
|
60
61
|
}
|
61
62
|
return isOut;
|
62
63
|
};
|
63
|
-
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
64
|
+
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, includeEdgeDates) {
|
64
65
|
var year = _ref2.year,
|
65
66
|
monthIndex = _ref2.monthIndex,
|
66
67
|
day = _ref2.day;
|
@@ -72,54 +73,59 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
|
72
73
|
var currentDate = new Date(year, monthIndex, day);
|
73
74
|
dateOperationHandler[type].subtract(currentDate);
|
74
75
|
var isOut = true;
|
75
|
-
|
76
|
-
|
76
|
+
var minDateCondition = includeEdgeDates ? currentDate > minDate : currentDate >= minDate;
|
77
|
+
while (isOut && minDateCondition) {
|
78
|
+
isOut = false;
|
77
79
|
dateOperationHandler[type].subtract(currentDate);
|
78
80
|
}
|
79
81
|
return isOut;
|
80
82
|
};
|
81
|
-
var getDisabledDates = function getDisabledDates(list, type, min, max) {
|
83
|
+
var getDisabledDates = function getDisabledDates(list, type, min, max, includeEdgeDates) {
|
82
84
|
var disabledDate = [];
|
83
|
-
if (isDisabledPreviousDate(list[0], type, min)) {
|
85
|
+
if (isDisabledPreviousDate(list[0], type, min, includeEdgeDates)) {
|
84
86
|
disabledDate.push('previous');
|
85
87
|
}
|
86
|
-
if (isDisabledNextDate(list[list.length - 1], type, max)) {
|
88
|
+
if (isDisabledNextDate(list[list.length - 1], type, max, includeEdgeDates)) {
|
87
89
|
disabledDate.push('next');
|
88
90
|
}
|
89
91
|
return disabledDate.join(',');
|
90
92
|
};
|
91
|
-
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min) {
|
93
|
+
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min, includeEdgeDates) {
|
92
94
|
var currentDate = new Date(date);
|
93
95
|
currentDate.setDate(currentDate.getDate() - 1);
|
94
|
-
|
96
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
97
|
+
return disableCondition;
|
95
98
|
};
|
96
|
-
var isDisabledArrowRight = function isDisabledArrowRight(date, max) {
|
99
|
+
var isDisabledArrowRight = function isDisabledArrowRight(date, max, includeEdgeDates) {
|
97
100
|
var currentDate = new Date(date);
|
98
101
|
currentDate.setDate(currentDate.getDate() + 1);
|
99
|
-
|
102
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
103
|
+
return disableCondition;
|
100
104
|
};
|
101
|
-
var isDisabledArrowUp = function isDisabledArrowUp(date, min) {
|
105
|
+
var isDisabledArrowUp = function isDisabledArrowUp(date, min, includeEdgeDates) {
|
102
106
|
var currentDate = new Date(date);
|
103
107
|
currentDate.setDate(date.getDate() - 7);
|
104
|
-
|
108
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
109
|
+
return disableCondition;
|
105
110
|
};
|
106
|
-
var isDisabledArrowDown = function isDisabledArrowDown(date, max) {
|
111
|
+
var isDisabledArrowDown = function isDisabledArrowDown(date, max, includeEdgeDates) {
|
107
112
|
var currentDate = new Date(date);
|
108
113
|
currentDate.setDate(date.getDate() + 7);
|
109
|
-
|
114
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
115
|
+
return disableCondition;
|
110
116
|
};
|
111
|
-
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max) {
|
117
|
+
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max, includeEdgeDates) {
|
112
118
|
var disabledArrowKey = [];
|
113
|
-
if (isDisabledArrowLeft(currentDate, min)) {
|
119
|
+
if (isDisabledArrowLeft(currentDate, min, includeEdgeDates)) {
|
114
120
|
disabledArrowKey.push('left');
|
115
121
|
}
|
116
|
-
if (isDisabledArrowRight(currentDate, max)) {
|
122
|
+
if (isDisabledArrowRight(currentDate, max, includeEdgeDates)) {
|
117
123
|
disabledArrowKey.push('right');
|
118
124
|
}
|
119
|
-
if (isDisabledArrowDown(currentDate, max)) {
|
125
|
+
if (isDisabledArrowDown(currentDate, max, includeEdgeDates)) {
|
120
126
|
disabledArrowKey.push('down');
|
121
127
|
}
|
122
|
-
if (isDisabledArrowUp(currentDate, min)) {
|
128
|
+
if (isDisabledArrowUp(currentDate, min, includeEdgeDates)) {
|
123
129
|
disabledArrowKey.push('up');
|
124
130
|
}
|
125
131
|
return disabledArrowKey.join(',');
|
@@ -148,7 +154,7 @@ export var getDatesWithModifications = function getDatesWithModifications(_ref3)
|
|
148
154
|
var date = _ref5.date;
|
149
155
|
return date;
|
150
156
|
});
|
151
|
-
var disabledDates = getDisabledDates(datesList, type, min, max);
|
157
|
+
var disabledDates = getDisabledDates(datesList, type, min, max, includeEdgeDates);
|
152
158
|
return dates.map(function (dateItem) {
|
153
159
|
var date = dateItem.date;
|
154
160
|
var year = date.year,
|
@@ -173,7 +179,7 @@ export var getDatesWithModifications = function getDatesWithModifications(_ref3)
|
|
173
179
|
dateItem.events = eventsMap.get(keyDate);
|
174
180
|
dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;
|
175
181
|
dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
176
|
-
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);
|
182
|
+
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max, includeEdgeDates);
|
177
183
|
dateItem.disabledDates = disabledDates;
|
178
184
|
return dateItem;
|
179
185
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["maskFormat"];
|
1
|
+
var _excluded = ["mask", "maskFormat"];
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
3
3
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -26,7 +26,8 @@ var defaultFormatChars = [{
|
|
26
26
|
export var composeMask = function composeMask(InputComponent) {
|
27
27
|
var MaskedInput = maskInputCompose(InputComponent);
|
28
28
|
return /*#__PURE__*/forwardRef(function (_ref, outerRef) {
|
29
|
-
var
|
29
|
+
var mask = _ref.mask,
|
30
|
+
_ref$maskFormat = _ref.maskFormat,
|
30
31
|
maskFormat = _ref$maskFormat === void 0 ? defaultFormatChars : _ref$maskFormat,
|
31
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
32
33
|
// TODO: replace inside react-maskinput 'getReference' on 'forwardRef'
|
@@ -37,8 +38,14 @@ export var composeMask = function composeMask(InputComponent) {
|
|
37
38
|
useImperativeHandle(outerRef, function () {
|
38
39
|
return ref;
|
39
40
|
}, [ref]);
|
41
|
+
if (!mask) {
|
42
|
+
return /*#__PURE__*/React.createElement(InputComponent, _extends({
|
43
|
+
ref: setRef
|
44
|
+
}, rest));
|
45
|
+
}
|
40
46
|
return /*#__PURE__*/React.createElement(MaskedInput, _extends({
|
41
47
|
getReference: setRef,
|
48
|
+
mask: mask,
|
42
49
|
maskFormat: maskFormat
|
43
50
|
}, rest));
|
44
51
|
});
|
@@ -19,17 +19,13 @@ var Root = /*#__PURE__*/_styled("div", {
|
|
19
19
|
}, ";", function (_ref4) {
|
20
20
|
var intersectionStyles = _ref4.intersectionStyles;
|
21
21
|
return intersectionStyles;
|
22
|
-
}, ";"
|
23
|
-
var invariants = _ref5.invariants;
|
24
|
-
return invariants;
|
25
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy1lbW90aW9uL2VuZ2luZXMvZW1vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZUUiLCJmaWxlIjoiLi4vLi4vLi4vc3JjLWVtb3Rpb24vZW5naW5lcy9lbW90aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzLCBTZXJp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tZGFuZ2xlICovXG5leHBvcnQgY29uc3QgX2NvbXBvbmVudCA9IChjb21wb25lbnRDb25maWc6IENvbXBvbmVudENvbmZpZykgPT4ge1xuICAgIGNvbnN0IHsgdGFnLCBiYXNlLCBpbnRlcnNlY3Rpb25zLCBpbnZhcmlhbnRzIH0gPSBjb21wb25lbnRDb25maWc7XG4gICAgY29uc3Qgc3RhdGljVmFyaWFudHMgPSBnZXRTdGF0aWNWYXJpYW50cyhjb21wb25lbnRDb25maWcpO1xuICAgIGNvbnN0IGR5bmFtaWNWYXJpYW50cyA9IGdldER5bmFtaWNWYXJpYW50cyhjb21wb25lbnRDb25maWcpO1xuXG4gICAgLy8gVE9ETzogc2hvdWxkIHdlIHR5cGUgdGFnIGFzIG1vcmUgdGhlbiBzdHJpbmcgP1xuICAgIGNvbnN0IFIgPSBSb290LndpdGhDb21wb25lbnQodGFnIGFzIGtleW9mIEpTWC5JbnRyaW5zaWNFbGVtZW50cyk7XG5cbiAgICByZXR1cm4gZm9yd2FyZFJlZjxIVE1MRWxlbWVudCwgSFRNTEFueUF0dHJpYnV0ZXM+KChwcm9wcywgcmVmKSA9PiB7XG4gICAgICAgIGNvbnN0IGludGVyc2VjdGlvblN0eWxlcyA9IGdldEludGVyc2VjdGlvblN0eWxlcyhwcm9wcywgaW50ZXJzZWN0aW9ucyk7XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxSXG4gICAgICAgICAgICAgICAgYmFzZT17YmFzZX1cbiAgICAgICAgICAgICAgICBzdGF0aWNWYXJpYW50cz17c3RhdGljVmFyaWFudHN9XG4gICAgICAgICAgICAgICAgZHluYW1pY1ZhcmlhbnRzPXtkeW5hbWljVmFyaWFudHN9XG4gICAgICAgICAgICAgICAgaW50ZXJzZWN0aW9uU3R5bGVzPXtpbnRlcnNlY3Rpb25TdHlsZXN9XG4gICAgICAgICAgICAgICAgaW52YXJpYW50cz17aW52YXJpYW50c31cbiAgICAgICAgICAgICAgICB7Li4ucHJvcHN9XG4gICAgICAgICAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgICAgICAvPlxuICAgICAgICApO1xuICAgIH0pO1xufTtcbiJdfQ== */"));
|
22
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy1lbW90aW9uL2VuZ2luZXMvZW1vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBY0UiLCJmaWxlIjoiLi4vLi4vLi4vc3JjLWVtb3Rpb24vZW5naW5lcy9lbW90aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgY3NzLCBTZXJpYWxpemVkU3R5bGVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBnZXRTdGF0aWNWYXJpYW50cywgZ2V0RHluYW1pY1ZhcmlhbnRzLCBnZXRJbnRlcnNlY3Rpb25TdHlsZXMgfSBmcm9tICcuL3V0aWxzJztcbmltcG9ydCB7IENvbXBvbmVudENvbmZpZywgSFRNTEFueUF0dHJpYnV0ZXMsIFBvbHltb3JwaGljQ2xhc3NOYW1lIH0gZnJvbSAnLi90eXBlcyc7XG5cbmV4cG9ydCB7IGNzcyB9O1xuXG5jb25zdCBSb290ID0gc3R5bGVkLmRpdjx7XG4gICAgYmFzZTogc3RyaW5nIHwgU2VyaWFsaXplZFN0eWxlcztcbiAgICBzdGF0aWNWYXJpYW50czogKHN0cmluZyB8IFNlcmlhbGl6ZWRTdHlsZXMpW107XG4gICAgZHluYW1pY1ZhcmlhbnRzOiAocHJvcHM6IEhUTUxBbnlBdHRyaWJ1dGVzKSA9PiBhbnlbXTtc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zKTtcblxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPFJcbiAgICAgICAgICAgICAgICBiYXNlPXtiYXNlfVxuICAgICAgICAgICAgICAgIHN0YXRpY1ZhcmlhbnRzPXtzdGF0aWNWYXJpYW50c31cbiAgICAgICAgICAgICAgICBkeW5hbWljVmFyaWFudHM9e2R5bmFtaWNWYXJpYW50c31cbiAgICAgICAgICAgICAgICBpbnRlcnNlY3Rpb25TdHlsZXM9e2ludGVyc2VjdGlvblN0eWxlc31cbiAgICAgICAgICAgICAgICB7Li4ucHJvcHN9XG4gICAgICAgICAgICAgICAgcmVmPXtyZWZ9XG4gICAgICAgICAgICAvPlxuICAgICAgICApO1xuICAgIH0pO1xufTtcbiJdfQ== */"));
|
26
23
|
|
27
24
|
/* eslint-disable no-underscore-dangle */
|
28
25
|
export var _component = function _component(componentConfig) {
|
29
26
|
var tag = componentConfig.tag,
|
30
27
|
base = componentConfig.base,
|
31
|
-
intersections = componentConfig.intersections
|
32
|
-
invariants = componentConfig.invariants;
|
28
|
+
intersections = componentConfig.intersections;
|
33
29
|
var staticVariants = getStaticVariants(componentConfig);
|
34
30
|
var dynamicVariants = getDynamicVariants(componentConfig);
|
35
31
|
|
@@ -44,8 +40,7 @@ export var _component = function _component(componentConfig) {
|
|
44
40
|
base: base,
|
45
41
|
staticVariants: staticVariants,
|
46
42
|
dynamicVariants: dynamicVariants,
|
47
|
-
intersectionStyles: intersectionStyles
|
48
|
-
invariants: invariants
|
43
|
+
intersectionStyles: intersectionStyles
|
49
44
|
}, props, {
|
50
45
|
ref: ref
|
51
46
|
}));
|
@@ -16,7 +16,8 @@ var useMonths = function useMonths(_ref) {
|
|
16
16
|
min = _ref.min,
|
17
17
|
max = _ref.max,
|
18
18
|
_ref$locale = _ref.locale,
|
19
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale
|
19
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
20
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
20
21
|
return useMemo(function () {
|
21
22
|
var months = SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
22
23
|
return {
|
@@ -41,6 +42,7 @@ var useMonths = function useMonths(_ref) {
|
|
41
42
|
type: CalendarState.Months,
|
42
43
|
min: min,
|
43
44
|
max: max,
|
45
|
+
includeEdgeDates: includeEdgeDates,
|
44
46
|
eventList: eventList,
|
45
47
|
disabledList: disabledList
|
46
48
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useMonths.js","sources":["../../../../src/components/Calendar/hooks/useMonths.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { DateItem } from '../Calendar.types';\nimport {\n SHORT_MONTH_NAME,\n isSelectedMonth,\n isCurrentMonth,\n getMatrix,\n MONTH_NAMES,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport { CalendarState } from '../store/types';\n\nimport { UseMonthsArgs } from './types';\n\n/**\n * Хук для получения списка месяцев.\n */\nexport const useMonths = ({
|
1
|
+
{"version":3,"file":"useMonths.js","sources":["../../../../src/components/Calendar/hooks/useMonths.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { DateItem } from '../Calendar.types';\nimport {\n SHORT_MONTH_NAME,\n isSelectedMonth,\n isCurrentMonth,\n getMatrix,\n MONTH_NAMES,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport { CalendarState } from '../store/types';\n\nimport { UseMonthsArgs } from './types';\n\n/**\n * Хук для получения списка месяцев.\n */\nexport const useMonths = ({\n date,\n value,\n eventList,\n disabledList,\n min,\n max,\n locale = 'ru',\n includeEdgeDates,\n}: UseMonthsArgs) =>\n useMemo(() => {\n const months = SHORT_MONTH_NAME[locale].map((monthName, monthIndex) => {\n return {\n monthName,\n monthIndex,\n isCurrent: isCurrentMonth(date, monthIndex),\n isSelected: Array.isArray(value)\n ? Boolean(value.find((v) => isSelectedMonth(date, monthIndex, v)))\n : isSelectedMonth(date, monthIndex, value),\n inRange: Array.isArray(value) ? isDateInRange(date.year, monthIndex, 1, value) : false,\n monthFullName: MONTH_NAMES[locale][monthIndex],\n date: { year: date.year, monthIndex, day: 1 },\n };\n });\n\n if (eventList?.length || disabledList?.length || max || min) {\n const modifiedMonths = getDatesWithModifications({\n dates: months,\n type: CalendarState.Months,\n min,\n max,\n includeEdgeDates,\n eventList,\n disabledList,\n });\n return getMatrix<DateItem>(modifiedMonths, 3);\n }\n\n return getMatrix<DateItem>(months, 3);\n }, [date, value, eventList, disabledList, max, min, locale]);\n"],"names":["useMonths","_ref","date","value","eventList","disabledList","min","max","_ref$locale","locale","includeEdgeDates","useMemo","months","SHORT_MONTH_NAME","map","monthName","monthIndex","isCurrent","isCurrentMonth","isSelected","Array","isArray","Boolean","find","v","isSelectedMonth","inRange","isDateInRange","year","monthFullName","MONTH_NAMES","day","length","modifiedMonths","getDatesWithModifications","dates","type","CalendarState","Months","getMatrix"],"mappings":";;;;;;;AAgBA;AACA;AACA;IACaA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAClBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,GAAG,GAAAL,IAAA,CAAHK,GAAG;IACHC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IAAAC,WAAA,GAAAP,IAAA,CACHQ,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,WAAA;IACbE,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB,CAAA;EAAA,OAEhBC,OAAO,CAAC,YAAM;AACV,IAAA,IAAMC,MAAM,GAAGC,gBAAgB,CAACJ,MAAM,CAAC,CAACK,GAAG,CAAC,UAACC,SAAS,EAAEC,UAAU,EAAK;MACnE,OAAO;AACHD,QAAAA,SAAS,EAATA,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A,SAAS,EAATA,SAAS;AACTC,QAAAA,YAAY,EAAZA,YAAAA;AACJ,OAAC,CAAC,CAAA;AACF,MAAA,OAAOkC,SAAS,CAAWN,cAAc,EAAE,CAAC,CAAC,CAAA;AACjD,KAAA;AAEA,IAAA,OAAOM,SAAS,CAAW3B,MAAM,EAAE,CAAC,CAAC,CAAA;AACzC,GAAC,EAAE,CAACV,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,EAAEG,MAAM,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -14,7 +14,8 @@ var useQuarters = function useQuarters(_ref) {
|
|
14
14
|
eventList = _ref.eventList,
|
15
15
|
disabledList = _ref.disabledList,
|
16
16
|
min = _ref.min,
|
17
|
-
max = _ref.max
|
17
|
+
max = _ref.max,
|
18
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
18
19
|
return useMemo(function () {
|
19
20
|
var quarters = QUARTER_NAMES.map(function (quarterName) {
|
20
21
|
var _quarterDates$quarter = quarterDates[quarterName],
|
@@ -40,6 +41,7 @@ var useQuarters = function useQuarters(_ref) {
|
|
40
41
|
type: CalendarState.Quarters,
|
41
42
|
min: min,
|
42
43
|
max: max,
|
44
|
+
includeEdgeDates: includeEdgeDates,
|
43
45
|
eventList: eventList,
|
44
46
|
disabledList: disabledList
|
45
47
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useQuarters.js","sources":["../../../../src/components/Calendar/hooks/useQuarters.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { DateItem } from '../Calendar.types';\nimport {\n QUARTER_NAMES,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n quarterDates,\n isSelectedMonth as isSelectedQuarter,\n isCurrentMonth as isCurrentQuarter,\n} from '../utils';\nimport { CalendarState } from '../store/types';\n\nimport type { UseQuartersArgs } from './types';\n\n/**\n * Хук для получения списка месяцев.\n */\nexport const useQuarters = ({ date, value, eventList, disabledList, min, max }: UseQuartersArgs) =>\n useMemo(() => {\n const quarters = QUARTER_NAMES.map((quarterName: string) => {\n const { monthIndex, day } = quarterDates[quarterName];\n\n return {\n quarterName,\n isCurrent: isCurrentQuarter(date, monthIndex),\n isSelected: Array.isArray(value)\n ? Boolean(value.find((v) => isSelectedQuarter(date, monthIndex, v)))\n : isSelectedQuarter(date, monthIndex, value),\n inRange: Array.isArray(value) ? isDateInRange(date.year, monthIndex, day, value) : false,\n date: { year: date.year, monthIndex, day: 1 },\n };\n });\n\n if (eventList?.length || disabledList?.length || max || min) {\n const modifiedQuarters = getDatesWithModifications({\n dates: quarters,\n type: CalendarState.Quarters,\n min,\n max,\n eventList,\n disabledList,\n });\n\n return getMatrix<DateItem>(modifiedQuarters, 2);\n }\n\n return getMatrix<DateItem>(quarters, 2);\n }, [date, value, eventList, disabledList, max, min]);\n"],"names":["useQuarters","_ref","date","value","eventList","disabledList","min","max","useMemo","quarters","QUARTER_NAMES","map","quarterName","_quarterDates$quarter","quarterDates","monthIndex","day","isCurrent","isCurrentQuarter","isSelected","Array","isArray","Boolean","find","v","isSelectedQuarter","inRange","isDateInRange","year","length","modifiedQuarters","getDatesWithModifications","dates","type","CalendarState","Quarters","getMatrix"],"mappings":";;;;;;;AAgBA;AACA;AACA;IACaA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAEC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IAAEC,GAAG,GAAAL,IAAA,CAAHK,GAAG;IAAEC,GAAG,GAAAN,IAAA,CAAHM,GAAG,CAAA;EAAA,
|
1
|
+
{"version":3,"file":"useQuarters.js","sources":["../../../../src/components/Calendar/hooks/useQuarters.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { DateItem } from '../Calendar.types';\nimport {\n QUARTER_NAMES,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n quarterDates,\n isSelectedMonth as isSelectedQuarter,\n isCurrentMonth as isCurrentQuarter,\n} from '../utils';\nimport { CalendarState } from '../store/types';\n\nimport type { UseQuartersArgs } from './types';\n\n/**\n * Хук для получения списка месяцев.\n */\nexport const useQuarters = ({ date, value, eventList, disabledList, min, max, includeEdgeDates }: UseQuartersArgs) =>\n useMemo(() => {\n const quarters = QUARTER_NAMES.map((quarterName: string) => {\n const { monthIndex, day } = quarterDates[quarterName];\n\n return {\n quarterName,\n isCurrent: isCurrentQuarter(date, monthIndex),\n isSelected: Array.isArray(value)\n ? Boolean(value.find((v) => isSelectedQuarter(date, monthIndex, v)))\n : isSelectedQuarter(date, monthIndex, value),\n inRange: Array.isArray(value) ? isDateInRange(date.year, monthIndex, day, value) : false,\n date: { year: date.year, monthIndex, day: 1 },\n };\n });\n\n if (eventList?.length || disabledList?.length || max || min) {\n const modifiedQuarters = getDatesWithModifications({\n dates: quarters,\n type: CalendarState.Quarters,\n min,\n max,\n includeEdgeDates,\n eventList,\n disabledList,\n });\n\n return getMatrix<DateItem>(modifiedQuarters, 2);\n }\n\n return getMatrix<DateItem>(quarters, 2);\n }, [date, value, eventList, disabledList, max, min]);\n"],"names":["useQuarters","_ref","date","value","eventList","disabledList","min","max","includeEdgeDates","useMemo","quarters","QUARTER_NAMES","map","quarterName","_quarterDates$quarter","quarterDates","monthIndex","day","isCurrent","isCurrentQuarter","isSelected","Array","isArray","Boolean","find","v","isSelectedQuarter","inRange","isDateInRange","year","length","modifiedQuarters","getDatesWithModifications","dates","type","CalendarState","Quarters","getMatrix"],"mappings":";;;;;;;AAgBA;AACA;AACA;IACaA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAA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,CAAE0B,MAAM,IAAIzB,YAAY,aAAZA,YAAY,KAAA,KAAA,CAAA,IAAZA,YAAY,CAAEyB,MAAM,IAAIvB,GAAG,IAAID,GAAG,EAAE;MACzD,IAAMyB,gBAAgB,GAAGC,yBAAyB,CAAC;AAC/CC,QAAAA,KAAK,EAAEvB,QAAQ;QACfwB,IAAI,EAAEC,aAAa,CAACC,QAAQ;AAC5B9B,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBJ,QAAAA,SAAS,EAATA,SAAS;AACTC,QAAAA,YAAY,EAAZA,YAAAA;AACJ,OAAC,CAAC,CAAA;AAEF,MAAA,OAAOgC,SAAS,CAAWN,gBAAgB,EAAE,CAAC,CAAC,CAAA;AACnD,KAAA;AAEA,IAAA,OAAOM,SAAS,CAAW3B,QAAQ,EAAE,CAAC,CAAC,CAAA;AAC3C,GAAC,EAAE,CAACR,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -15,7 +15,8 @@ var useYears = function useYears(_ref) {
|
|
15
15
|
eventList = _ref.eventList,
|
16
16
|
disabledList = _ref.disabledList,
|
17
17
|
min = _ref.min,
|
18
|
-
max = _ref.max
|
18
|
+
max = _ref.max,
|
19
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
19
20
|
return useMemo(function () {
|
20
21
|
// type-coverage:ignore-next-line
|
21
22
|
var years = Array.from(Array(YEAR_RENDER_COUNT), function (_, i) {
|
@@ -40,6 +41,7 @@ var useYears = function useYears(_ref) {
|
|
40
41
|
type: CalendarState.Years,
|
41
42
|
min: min,
|
42
43
|
max: max,
|
44
|
+
includeEdgeDates: includeEdgeDates,
|
43
45
|
eventList: eventList,
|
44
46
|
disabledList: disabledList
|
45
47
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useYears.js","sources":["../../../../src/components/Calendar/hooks/useYears.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport {\n YEAR_RENDER_COUNT,\n isCurrentYear,\n isSelectedYear,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport type { DateItem } from '../Calendar.types';\nimport { CalendarState } from '../store/types';\n\nimport type { UseYearsArgs } from './types';\n\n/**\n * Хук для получения списка годов.\n */\nexport const useYears = ({
|
1
|
+
{"version":3,"file":"useYears.js","sources":["../../../../src/components/Calendar/hooks/useYears.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport {\n YEAR_RENDER_COUNT,\n isCurrentYear,\n isSelectedYear,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport type { DateItem } from '../Calendar.types';\nimport { CalendarState } from '../store/types';\n\nimport type { UseYearsArgs } from './types';\n\n/**\n * Хук для получения списка годов.\n */\nexport const useYears = ({\n date,\n value,\n startYear,\n eventList,\n disabledList,\n min,\n max,\n includeEdgeDates,\n}: UseYearsArgs) =>\n useMemo(() => {\n // type-coverage:ignore-next-line\n const years = Array.from(Array(YEAR_RENDER_COUNT), (_, i) => {\n const yearValue = startYear + i;\n\n return {\n isCurrent: isCurrentYear(startYear + i),\n isSelected: Array.isArray(value)\n ? Boolean(value.find((v) => isSelectedYear(yearValue, v)))\n : isSelectedYear(yearValue, value),\n inRange: Array.isArray(value) ? isDateInRange(yearValue, 0, 1, value) : false,\n date: { year: yearValue, monthIndex: 0, day: 1 },\n yearValue,\n };\n });\n\n if (eventList?.length || disabledList?.length || max || min) {\n const modifiedMonths = getDatesWithModifications({\n dates: years,\n type: CalendarState.Years,\n min,\n max,\n includeEdgeDates,\n eventList,\n disabledList,\n });\n return getMatrix<DateItem>(modifiedMonths, 3);\n }\n\n return getMatrix<DateItem>(years, 3);\n }, [date, startYear, value, eventList, disabledList, max, min]);\n"],"names":["useYears","_ref","date","value","startYear","eventList","disabledList","min","max","includeEdgeDates","useMemo","years","Array","from","YEAR_RENDER_COUNT","_","i","yearValue","isCurrent","isCurrentYear","isSelected","isArray","Boolean","find","v","isSelectedYear","inRange","isDateInRange","year","monthIndex","day","length","modifiedMonths","getDatesWithModifications","dates","type","CalendarState","Years","getMatrix"],"mappings":";;;;;;;AAeA;AACA;AACA;IACaA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAA;AAAA,EAAA,IACjBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,GAAG,GAAAP,IAAA,CAAHO,GAAG;IACHC,gBAAgB,GAAAR,IAAA,CAAhBQ,gBAAgB,CAAA;EAAA,OAEhBC,OAAO,CAAC,YAAM;AACV;AACA,IAAA,IAAMC,KAAK,GAAGC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACE,iBAAiB,CAAC,EAAE,UAACC,CAAC,EAAEC,CAAC,EAAK;AACzD,MAAA,IAAMC,SAAS,GAAGb,SAAS,GAAGY,CAAC,CAAA;MAE/B,OAAO;AACHE,QAAAA,SAAS,EAAEC,aAAa,CAACf,SAAS,GAAGY,CAAC,CAAC;AACvCI,QAAAA,UAAU,EAAER,KAAK,CAACS,OAAO,CAAClB,KAAK,CAAC,GAC1BmB,OAAO,CAACnB,KAAK,CAACoB,IAAI,CAAC,UAACC,CAAC,EAAA;AAAA,UAAA,OAAKC,cAAc,CAACR,SAAS,EAAEO,CAAC,CAAC,CAAA;AAAA,SAAA,CAAC,CAAC,GACxDC,cAAc,CAACR,SAAS,EAAEd,KAAK,CAAC;AACtCuB,QAAAA,OAAO,EAAEd,KAAK,CAACS,OAAO,CAAClB,KAAK,CAAC,GAAGwB,aAAa,CAACV,SAAS,EAAE,CAAC,EAAE,CAAC,EAAEd,KAAK,CAAC,GAAG,KAAK;AAC7ED,QAAAA,IAAI,EAAE;AAAE0B,UAAAA,IAAI,EAAEX,SAAS;AAAEY,UAAAA,UAAU,EAAE,CAAC;AAAEC,UAAAA,GAAG,EAAE,CAAA;SAAG;AAChDb,QAAAA,SAAS,EAATA,SAAAA;OACH,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,IAAIZ,SAAS,KAATA,IAAAA,IAAAA,SAAS,eAATA,SAAS,CAAE0B,MAAM,IAAIzB,YAAY,aAAZA,YAAY,KAAA,KAAA,CAAA,IAAZA,YAAY,CAAEyB,MAAM,IAAIvB,GAAG,IAAID,GAAG,EAAE;MACzD,IAAMyB,cAAc,GAAGC,yBAAyB,CAAC;AAC7CC,QAAAA,KAAK,EAAEvB,KAAK;QACZwB,IAAI,EAAEC,aAAa,CAACC,KAAK;AACzB9B,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBJ,QAAAA,SAAS,EAATA,SAAS;AACTC,QAAAA,YAAY,EAAZA,YAAAA;AACJ,OAAC,CAAC,CAAA;AACF,MAAA,OAAOgC,SAAS,CAAWN,cAAc,EAAE,CAAC,CAAC,CAAA;AACjD,KAAA;AAEA,IAAA,OAAOM,SAAS,CAAW3B,KAAK,EAAE,CAAC,CAAC,CAAA;AACxC,GAAC,EAAE,CAACT,IAAI,EAAEE,SAAS,EAAED,KAAK,EAAEE,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -43,7 +43,7 @@ var normalizeDate = function normalizeDate(date, type) {
|
|
43
43
|
date.setMonth(0);
|
44
44
|
}
|
45
45
|
};
|
46
|
-
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
46
|
+
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdgeDates) {
|
47
47
|
var year = _ref.year,
|
48
48
|
monthIndex = _ref.monthIndex,
|
49
49
|
day = _ref.day;
|
@@ -55,13 +55,14 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
|
55
55
|
var currentDate = new Date(year, monthIndex, day);
|
56
56
|
dateOperationHandler[type].add(currentDate);
|
57
57
|
var isOut = true;
|
58
|
-
|
59
|
-
|
58
|
+
var maxDateCondition = includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate;
|
59
|
+
while (isOut && maxDateCondition) {
|
60
|
+
isOut = false;
|
60
61
|
dateOperationHandler[type].add(currentDate);
|
61
62
|
}
|
62
63
|
return isOut;
|
63
64
|
};
|
64
|
-
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
65
|
+
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, includeEdgeDates) {
|
65
66
|
var year = _ref2.year,
|
66
67
|
monthIndex = _ref2.monthIndex,
|
67
68
|
day = _ref2.day;
|
@@ -73,54 +74,59 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
|
73
74
|
var currentDate = new Date(year, monthIndex, day);
|
74
75
|
dateOperationHandler[type].subtract(currentDate);
|
75
76
|
var isOut = true;
|
76
|
-
|
77
|
-
|
77
|
+
var minDateCondition = includeEdgeDates ? currentDate > minDate : currentDate >= minDate;
|
78
|
+
while (isOut && minDateCondition) {
|
79
|
+
isOut = false;
|
78
80
|
dateOperationHandler[type].subtract(currentDate);
|
79
81
|
}
|
80
82
|
return isOut;
|
81
83
|
};
|
82
|
-
var getDisabledDates = function getDisabledDates(list, type, min, max) {
|
84
|
+
var getDisabledDates = function getDisabledDates(list, type, min, max, includeEdgeDates) {
|
83
85
|
var disabledDate = [];
|
84
|
-
if (isDisabledPreviousDate(list[0], type, min)) {
|
86
|
+
if (isDisabledPreviousDate(list[0], type, min, includeEdgeDates)) {
|
85
87
|
disabledDate.push('previous');
|
86
88
|
}
|
87
|
-
if (isDisabledNextDate(list[list.length - 1], type, max)) {
|
89
|
+
if (isDisabledNextDate(list[list.length - 1], type, max, includeEdgeDates)) {
|
88
90
|
disabledDate.push('next');
|
89
91
|
}
|
90
92
|
return disabledDate.join(',');
|
91
93
|
};
|
92
|
-
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min) {
|
94
|
+
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min, includeEdgeDates) {
|
93
95
|
var currentDate = new Date(date);
|
94
96
|
currentDate.setDate(currentDate.getDate() - 1);
|
95
|
-
|
97
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
98
|
+
return disableCondition;
|
96
99
|
};
|
97
|
-
var isDisabledArrowRight = function isDisabledArrowRight(date, max) {
|
100
|
+
var isDisabledArrowRight = function isDisabledArrowRight(date, max, includeEdgeDates) {
|
98
101
|
var currentDate = new Date(date);
|
99
102
|
currentDate.setDate(currentDate.getDate() + 1);
|
100
|
-
|
103
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
104
|
+
return disableCondition;
|
101
105
|
};
|
102
|
-
var isDisabledArrowUp = function isDisabledArrowUp(date, min) {
|
106
|
+
var isDisabledArrowUp = function isDisabledArrowUp(date, min, includeEdgeDates) {
|
103
107
|
var currentDate = new Date(date);
|
104
108
|
currentDate.setDate(date.getDate() - 7);
|
105
|
-
|
109
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
110
|
+
return disableCondition;
|
106
111
|
};
|
107
|
-
var isDisabledArrowDown = function isDisabledArrowDown(date, max) {
|
112
|
+
var isDisabledArrowDown = function isDisabledArrowDown(date, max, includeEdgeDates) {
|
108
113
|
var currentDate = new Date(date);
|
109
114
|
currentDate.setDate(date.getDate() + 7);
|
110
|
-
|
115
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
116
|
+
return disableCondition;
|
111
117
|
};
|
112
|
-
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max) {
|
118
|
+
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max, includeEdgeDates) {
|
113
119
|
var disabledArrowKey = [];
|
114
|
-
if (isDisabledArrowLeft(currentDate, min)) {
|
120
|
+
if (isDisabledArrowLeft(currentDate, min, includeEdgeDates)) {
|
115
121
|
disabledArrowKey.push('left');
|
116
122
|
}
|
117
|
-
if (isDisabledArrowRight(currentDate, max)) {
|
123
|
+
if (isDisabledArrowRight(currentDate, max, includeEdgeDates)) {
|
118
124
|
disabledArrowKey.push('right');
|
119
125
|
}
|
120
|
-
if (isDisabledArrowDown(currentDate, max)) {
|
126
|
+
if (isDisabledArrowDown(currentDate, max, includeEdgeDates)) {
|
121
127
|
disabledArrowKey.push('down');
|
122
128
|
}
|
123
|
-
if (isDisabledArrowUp(currentDate, min)) {
|
129
|
+
if (isDisabledArrowUp(currentDate, min, includeEdgeDates)) {
|
124
130
|
disabledArrowKey.push('up');
|
125
131
|
}
|
126
132
|
return disabledArrowKey.join(',');
|
@@ -149,7 +155,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
149
155
|
var date = _ref5.date;
|
150
156
|
return date;
|
151
157
|
});
|
152
|
-
var disabledDates = getDisabledDates(datesList, type, min, max);
|
158
|
+
var disabledDates = getDisabledDates(datesList, type, min, max, includeEdgeDates);
|
153
159
|
return dates.map(function (dateItem) {
|
154
160
|
var date = dateItem.date;
|
155
161
|
var year = date.year,
|
@@ -174,7 +180,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
174
180
|
dateItem.events = eventsMap.get(keyDate);
|
175
181
|
dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;
|
176
182
|
dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
177
|
-
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);
|
183
|
+
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max, includeEdgeDates);
|
178
184
|
dateItem.disabledDates = disabledDates;
|
179
185
|
return dateItem;
|
180
186
|
});
|