@salutejs/plasma-new-hope 0.324.0-canary.1984.15139244526.0 → 0.324.0-canary.1985.15159180127.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 +1 -3
- package/cjs/components/Calendar/hooks/useMonths.js.map +1 -1
- package/cjs/components/Calendar/hooks/useQuarters.js +1 -3
- package/cjs/components/Calendar/hooks/useQuarters.js.map +1 -1
- package/cjs/components/Calendar/hooks/useYears.js +1 -3
- package/cjs/components/Calendar/hooks/useYears.js.map +1 -1
- package/cjs/components/Calendar/utils/getDateWithModification.js +24 -30
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/emotion/cjs/components/Calendar/hooks/useMonths.js +1 -3
- package/emotion/cjs/components/Calendar/hooks/useQuarters.js +1 -3
- package/emotion/cjs/components/Calendar/hooks/useYears.js +1 -3
- package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +24 -30
- package/emotion/es/components/Calendar/hooks/useMonths.js +1 -3
- package/emotion/es/components/Calendar/hooks/useQuarters.js +1 -3
- package/emotion/es/components/Calendar/hooks/useYears.js +1 -3
- package/emotion/es/components/Calendar/utils/getDateWithModification.js +24 -30
- package/es/components/Calendar/hooks/useMonths.js +1 -3
- package/es/components/Calendar/hooks/useMonths.js.map +1 -1
- package/es/components/Calendar/hooks/useQuarters.js +1 -3
- package/es/components/Calendar/hooks/useQuarters.js.map +1 -1
- package/es/components/Calendar/hooks/useYears.js +1 -3
- package/es/components/Calendar/hooks/useYears.js.map +1 -1
- package/es/components/Calendar/utils/getDateWithModification.js +24 -30
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Calendar/hooks/useMonths.js +1 -3
- package/styled-components/cjs/components/Calendar/hooks/useQuarters.js +1 -3
- package/styled-components/cjs/components/Calendar/hooks/useYears.js +1 -3
- package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +24 -30
- package/styled-components/es/components/Calendar/hooks/useMonths.js +1 -3
- package/styled-components/es/components/Calendar/hooks/useQuarters.js +1 -3
- package/styled-components/es/components/Calendar/hooks/useYears.js +1 -3
- package/styled-components/es/components/Calendar/utils/getDateWithModification.js +24 -30
- package/types/components/Calendar/hooks/types.d.ts +2 -7
- 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
@@ -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) {
|
46
46
|
var year = _ref.year,
|
47
47
|
monthIndex = _ref.monthIndex,
|
48
48
|
day = _ref.day;
|
@@ -54,14 +54,13 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdg
|
|
54
54
|
var currentDate = new Date(year, monthIndex, day);
|
55
55
|
dateOperationHandler[type].add(currentDate);
|
56
56
|
var isOut = true;
|
57
|
-
|
58
|
-
|
59
|
-
isOut = false;
|
57
|
+
while (isOut && currentDate <= maxDate) {
|
58
|
+
isOut = maxDate <= currentDate;
|
60
59
|
dateOperationHandler[type].add(currentDate);
|
61
60
|
}
|
62
61
|
return isOut;
|
63
62
|
};
|
64
|
-
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min
|
63
|
+
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
65
64
|
var year = _ref2.year,
|
66
65
|
monthIndex = _ref2.monthIndex,
|
67
66
|
day = _ref2.day;
|
@@ -73,59 +72,54 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, i
|
|
73
72
|
var currentDate = new Date(year, monthIndex, day);
|
74
73
|
dateOperationHandler[type].subtract(currentDate);
|
75
74
|
var isOut = true;
|
76
|
-
|
77
|
-
|
78
|
-
isOut = false;
|
75
|
+
while (isOut && currentDate >= minDate) {
|
76
|
+
isOut = minDate >= currentDate;
|
79
77
|
dateOperationHandler[type].subtract(currentDate);
|
80
78
|
}
|
81
79
|
return isOut;
|
82
80
|
};
|
83
|
-
var getDisabledDates = function getDisabledDates(list, type, min, max
|
81
|
+
var getDisabledDates = function getDisabledDates(list, type, min, max) {
|
84
82
|
var disabledDate = [];
|
85
|
-
if (isDisabledPreviousDate(list[0], type, min
|
83
|
+
if (isDisabledPreviousDate(list[0], type, min)) {
|
86
84
|
disabledDate.push('previous');
|
87
85
|
}
|
88
|
-
if (isDisabledNextDate(list[list.length - 1], type, max
|
86
|
+
if (isDisabledNextDate(list[list.length - 1], type, max)) {
|
89
87
|
disabledDate.push('next');
|
90
88
|
}
|
91
89
|
return disabledDate.join(',');
|
92
90
|
};
|
93
|
-
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min
|
91
|
+
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min) {
|
94
92
|
var currentDate = new Date(date);
|
95
93
|
currentDate.setDate(currentDate.getDate() - 1);
|
96
|
-
|
97
|
-
return disableCondition;
|
94
|
+
return min && min >= currentDate || min && min >= date;
|
98
95
|
};
|
99
|
-
var isDisabledArrowRight = function isDisabledArrowRight(date, max
|
96
|
+
var isDisabledArrowRight = function isDisabledArrowRight(date, max) {
|
100
97
|
var currentDate = new Date(date);
|
101
98
|
currentDate.setDate(currentDate.getDate() + 1);
|
102
|
-
|
103
|
-
return disableCondition;
|
99
|
+
return max && max <= currentDate || max && max <= date;
|
104
100
|
};
|
105
|
-
var isDisabledArrowUp = function isDisabledArrowUp(date, min
|
101
|
+
var isDisabledArrowUp = function isDisabledArrowUp(date, min) {
|
106
102
|
var currentDate = new Date(date);
|
107
103
|
currentDate.setDate(date.getDate() - 7);
|
108
|
-
|
109
|
-
return disableCondition;
|
104
|
+
return min && min >= currentDate;
|
110
105
|
};
|
111
|
-
var isDisabledArrowDown = function isDisabledArrowDown(date, max
|
106
|
+
var isDisabledArrowDown = function isDisabledArrowDown(date, max) {
|
112
107
|
var currentDate = new Date(date);
|
113
108
|
currentDate.setDate(date.getDate() + 7);
|
114
|
-
|
115
|
-
return disableCondition;
|
109
|
+
return max && max <= currentDate;
|
116
110
|
};
|
117
|
-
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max
|
111
|
+
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max) {
|
118
112
|
var disabledArrowKey = [];
|
119
|
-
if (isDisabledArrowLeft(currentDate, min
|
113
|
+
if (isDisabledArrowLeft(currentDate, min)) {
|
120
114
|
disabledArrowKey.push('left');
|
121
115
|
}
|
122
|
-
if (isDisabledArrowRight(currentDate, max
|
116
|
+
if (isDisabledArrowRight(currentDate, max)) {
|
123
117
|
disabledArrowKey.push('right');
|
124
118
|
}
|
125
|
-
if (isDisabledArrowDown(currentDate, max
|
119
|
+
if (isDisabledArrowDown(currentDate, max)) {
|
126
120
|
disabledArrowKey.push('down');
|
127
121
|
}
|
128
|
-
if (isDisabledArrowUp(currentDate, min
|
122
|
+
if (isDisabledArrowUp(currentDate, min)) {
|
129
123
|
disabledArrowKey.push('up');
|
130
124
|
}
|
131
125
|
return disabledArrowKey.join(',');
|
@@ -154,7 +148,7 @@ export var getDatesWithModifications = function getDatesWithModifications(_ref3)
|
|
154
148
|
var date = _ref5.date;
|
155
149
|
return date;
|
156
150
|
});
|
157
|
-
var disabledDates = getDisabledDates(datesList, type, min, max
|
151
|
+
var disabledDates = getDisabledDates(datesList, type, min, max);
|
158
152
|
return dates.map(function (dateItem) {
|
159
153
|
var date = dateItem.date;
|
160
154
|
var year = date.year,
|
@@ -179,7 +173,7 @@ export var getDatesWithModifications = function getDatesWithModifications(_ref3)
|
|
179
173
|
dateItem.events = eventsMap.get(keyDate);
|
180
174
|
dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;
|
181
175
|
dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
182
|
-
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max
|
176
|
+
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);
|
183
177
|
dateItem.disabledDates = disabledDates;
|
184
178
|
return dateItem;
|
185
179
|
});
|
@@ -16,8 +16,7 @@ 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
|
20
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
19
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale;
|
21
20
|
return useMemo(function () {
|
22
21
|
var months = SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
23
22
|
return {
|
@@ -42,7 +41,6 @@ var useMonths = function useMonths(_ref) {
|
|
42
41
|
type: CalendarState.Months,
|
43
42
|
min: min,
|
44
43
|
max: max,
|
45
|
-
includeEdgeDates: includeEdgeDates,
|
46
44
|
eventList: eventList,
|
47
45
|
disabledList: disabledList
|
48
46
|
});
|
@@ -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 = ({ date, value, eventList, disabledList, min, max, locale = 'ru' }: 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 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","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,IAA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,UAAAA,UAAU,EAAVA,UAAU;AAAEe,UAAAA,GAAG,EAAE,CAAA;AAAE,SAAA;OAC/C,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,IAAI1B,SAAS,KAATA,IAAAA,IAAAA,SAAS,eAATA,SAAS,CAAE2B,MAAM,IAAI1B,YAAY,aAAZA,YAAY,KAAA,KAAA,CAAA,IAAZA,YAAY,CAAE0B,MAAM,IAAIxB,GAAG,IAAID,GAAG,EAAE;MACzD,IAAM0B,cAAc,GAAGC,yBAAyB,CAAC;AAC7CC,QAAAA,KAAK,EAAEvB,MAAM;QACbwB,IAAI,EAAEC,aAAa,CAACC,MAAM;AAC1B/B,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,GAAG,EAAHA,GAAG;AACHH,QAAAA,SAAS,EAATA,SAAS;AACTC,QAAAA,YAAY,EAAZA,YAAAA;AACJ,OAAC,CAAC,CAAA;AACF,MAAA,OAAOiC,SAAS,CAAWN,cAAc,EAAE,CAAC,CAAC,CAAA;AACjD,KAAA;AAEA,IAAA,OAAOM,SAAS,CAAW3B,MAAM,EAAE,CAAC,CAAC,CAAA;AACzC,GAAC,EAAE,CAACT,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,EAAEG,MAAM,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -14,8 +14,7 @@ var useQuarters = function useQuarters(_ref) {
|
|
14
14
|
eventList = _ref.eventList,
|
15
15
|
disabledList = _ref.disabledList,
|
16
16
|
min = _ref.min,
|
17
|
-
max = _ref.max
|
18
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
17
|
+
max = _ref.max;
|
19
18
|
return useMemo(function () {
|
20
19
|
var quarters = QUARTER_NAMES.map(function (quarterName) {
|
21
20
|
var _quarterDates$quarter = quarterDates[quarterName],
|
@@ -41,7 +40,6 @@ var useQuarters = function useQuarters(_ref) {
|
|
41
40
|
type: CalendarState.Quarters,
|
42
41
|
min: min,
|
43
42
|
max: max,
|
44
|
-
includeEdgeDates: includeEdgeDates,
|
45
43
|
eventList: eventList,
|
46
44
|
disabledList: disabledList
|
47
45
|
});
|
@@ -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
|
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,OACxEC,OAAO,CAAC,YAAM;IACV,IAAMC,QAAQ,GAAGC,aAAa,CAACC,GAAG,CAAC,UAACC,WAAmB,EAAK;AACxD,MAAA,IAAAC,qBAAA,GAA4BC,YAAY,CAACF,WAAW,CAAC;QAA7CG,UAAU,GAAAF,qBAAA,CAAVE,UAAU;QAAEC,GAAG,GAAAH,qBAAA,CAAHG,GAAG,CAAA;MAEvB,OAAO;AACHJ,QAAAA,WAAW,EAAXA,WAAW;AACXK,QAAAA,SAAS,EAAEC,cAAgB,CAAChB,IAAI,EAAEa,UAAU,CAAC;AAC7CI,QAAAA,UAAU,EAAEC,KAAK,CAACC,OAAO,CAAClB,KAAK,CAAC,GAC1BmB,OAAO,CAACnB,KAAK,CAACoB,IAAI,CAAC,UAACC,CAAC,EAAA;AAAA,UAAA,OAAKC,e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@ var useYears = function useYears(_ref) {
|
|
15
15
|
eventList = _ref.eventList,
|
16
16
|
disabledList = _ref.disabledList,
|
17
17
|
min = _ref.min,
|
18
|
-
max = _ref.max
|
19
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
18
|
+
max = _ref.max;
|
20
19
|
return useMemo(function () {
|
21
20
|
// type-coverage:ignore-next-line
|
22
21
|
var years = Array.from(Array(YEAR_RENDER_COUNT), function (_, i) {
|
@@ -41,7 +40,6 @@ var useYears = function useYears(_ref) {
|
|
41
40
|
type: CalendarState.Years,
|
42
41
|
min: min,
|
43
42
|
max: max,
|
44
|
-
includeEdgeDates: includeEdgeDates,
|
45
43
|
eventList: eventList,
|
46
44
|
disabledList: disabledList
|
47
45
|
});
|
@@ -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 = ({ date, value, startYear, eventList, disabledList, min, max }: 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 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","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,IAAMC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAEC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IAAEC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IAAEC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IAAEC,GAAG,GAAAP,IAAA,CAAHO,GAAG,CAAA;EAAA,OAChFC,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,GAAGZ,SAAS,GAAGW,CAAC,CAAA;MAE/B,OAAO;AACHE,QAAAA,SAAS,EAAE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CAAC,CAAA;AACxC,GAAC,EAAE,CAACR,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) {
|
47
47
|
var year = _ref.year,
|
48
48
|
monthIndex = _ref.monthIndex,
|
49
49
|
day = _ref.day;
|
@@ -55,14 +55,13 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdg
|
|
55
55
|
var currentDate = new Date(year, monthIndex, day);
|
56
56
|
dateOperationHandler[type].add(currentDate);
|
57
57
|
var isOut = true;
|
58
|
-
|
59
|
-
|
60
|
-
isOut = false;
|
58
|
+
while (isOut && currentDate <= maxDate) {
|
59
|
+
isOut = maxDate <= currentDate;
|
61
60
|
dateOperationHandler[type].add(currentDate);
|
62
61
|
}
|
63
62
|
return isOut;
|
64
63
|
};
|
65
|
-
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min
|
64
|
+
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
66
65
|
var year = _ref2.year,
|
67
66
|
monthIndex = _ref2.monthIndex,
|
68
67
|
day = _ref2.day;
|
@@ -74,59 +73,54 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, i
|
|
74
73
|
var currentDate = new Date(year, monthIndex, day);
|
75
74
|
dateOperationHandler[type].subtract(currentDate);
|
76
75
|
var isOut = true;
|
77
|
-
|
78
|
-
|
79
|
-
isOut = false;
|
76
|
+
while (isOut && currentDate >= minDate) {
|
77
|
+
isOut = minDate >= currentDate;
|
80
78
|
dateOperationHandler[type].subtract(currentDate);
|
81
79
|
}
|
82
80
|
return isOut;
|
83
81
|
};
|
84
|
-
var getDisabledDates = function getDisabledDates(list, type, min, max
|
82
|
+
var getDisabledDates = function getDisabledDates(list, type, min, max) {
|
85
83
|
var disabledDate = [];
|
86
|
-
if (isDisabledPreviousDate(list[0], type, min
|
84
|
+
if (isDisabledPreviousDate(list[0], type, min)) {
|
87
85
|
disabledDate.push('previous');
|
88
86
|
}
|
89
|
-
if (isDisabledNextDate(list[list.length - 1], type, max
|
87
|
+
if (isDisabledNextDate(list[list.length - 1], type, max)) {
|
90
88
|
disabledDate.push('next');
|
91
89
|
}
|
92
90
|
return disabledDate.join(',');
|
93
91
|
};
|
94
|
-
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min
|
92
|
+
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min) {
|
95
93
|
var currentDate = new Date(date);
|
96
94
|
currentDate.setDate(currentDate.getDate() - 1);
|
97
|
-
|
98
|
-
return disableCondition;
|
95
|
+
return min && min >= currentDate || min && min >= date;
|
99
96
|
};
|
100
|
-
var isDisabledArrowRight = function isDisabledArrowRight(date, max
|
97
|
+
var isDisabledArrowRight = function isDisabledArrowRight(date, max) {
|
101
98
|
var currentDate = new Date(date);
|
102
99
|
currentDate.setDate(currentDate.getDate() + 1);
|
103
|
-
|
104
|
-
return disableCondition;
|
100
|
+
return max && max <= currentDate || max && max <= date;
|
105
101
|
};
|
106
|
-
var isDisabledArrowUp = function isDisabledArrowUp(date, min
|
102
|
+
var isDisabledArrowUp = function isDisabledArrowUp(date, min) {
|
107
103
|
var currentDate = new Date(date);
|
108
104
|
currentDate.setDate(date.getDate() - 7);
|
109
|
-
|
110
|
-
return disableCondition;
|
105
|
+
return min && min >= currentDate;
|
111
106
|
};
|
112
|
-
var isDisabledArrowDown = function isDisabledArrowDown(date, max
|
107
|
+
var isDisabledArrowDown = function isDisabledArrowDown(date, max) {
|
113
108
|
var currentDate = new Date(date);
|
114
109
|
currentDate.setDate(date.getDate() + 7);
|
115
|
-
|
116
|
-
return disableCondition;
|
110
|
+
return max && max <= currentDate;
|
117
111
|
};
|
118
|
-
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max
|
112
|
+
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max) {
|
119
113
|
var disabledArrowKey = [];
|
120
|
-
if (isDisabledArrowLeft(currentDate, min
|
114
|
+
if (isDisabledArrowLeft(currentDate, min)) {
|
121
115
|
disabledArrowKey.push('left');
|
122
116
|
}
|
123
|
-
if (isDisabledArrowRight(currentDate, max
|
117
|
+
if (isDisabledArrowRight(currentDate, max)) {
|
124
118
|
disabledArrowKey.push('right');
|
125
119
|
}
|
126
|
-
if (isDisabledArrowDown(currentDate, max
|
120
|
+
if (isDisabledArrowDown(currentDate, max)) {
|
127
121
|
disabledArrowKey.push('down');
|
128
122
|
}
|
129
|
-
if (isDisabledArrowUp(currentDate, min
|
123
|
+
if (isDisabledArrowUp(currentDate, min)) {
|
130
124
|
disabledArrowKey.push('up');
|
131
125
|
}
|
132
126
|
return disabledArrowKey.join(',');
|
@@ -155,7 +149,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
155
149
|
var date = _ref5.date;
|
156
150
|
return date;
|
157
151
|
});
|
158
|
-
var disabledDates = getDisabledDates(datesList, type, min, max
|
152
|
+
var disabledDates = getDisabledDates(datesList, type, min, max);
|
159
153
|
return dates.map(function (dateItem) {
|
160
154
|
var date = dateItem.date;
|
161
155
|
var year = date.year,
|
@@ -180,7 +174,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
180
174
|
dateItem.events = eventsMap.get(keyDate);
|
181
175
|
dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;
|
182
176
|
dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
183
|
-
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max
|
177
|
+
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);
|
184
178
|
dateItem.disabledDates = disabledDates;
|
185
179
|
return dateItem;
|
186
180
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDateWithModification.js","sources":["../../../../src/components/Calendar/utils/getDateWithModification.ts"],"sourcesContent":["import type { DateItem, DateObject, DisabledDay, EventDay } from '../Calendar.types';\nimport { CalendarState, CalendarStateType } from '../store/types';\n\nimport { getPropsMap } from './calendarGridHelper';\n\ntype GetDatesWithModificationsArgs = {\n dates: DateItem[];\n type: CalendarStateType;\n eventList?: EventDay[];\n disabledList?: DisabledDay[];\n includeEdgeDates?: boolean;\n min?: Date;\n max?: Date;\n};\n\ntype DateOperationHandler = {\n [k in CalendarStateType]: {\n [t in 'add' | 'subtract']: (date: Date) => number;\n };\n};\n\nconst dateOperationHandler: DateOperationHandler = {\n Days: {\n add: (date: Date) => date.setDate(date.getDate() + 1),\n subtract: (date: Date) => date.setDate(date.getDate() - 1),\n },\n Months: {\n add: (date: Date) => date.setMonth(date.getMonth() + 1),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 1),\n },\n Quarters: {\n add: (date: Date) => date.setMonth(date.getMonth() + 3),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 3),\n },\n Years: {\n add: (date: Date) => date.setFullYear(date.getFullYear() + 1),\n subtract: (date: Date) => date.setFullYear(date.getFullYear() - 1),\n },\n};\n\nconst normalizeDate = (date: Date, type: CalendarStateType) => {\n if (type === CalendarState.Months || type === CalendarState.Years) {\n date.setDate(1);\n }\n\n if (type === CalendarState.Years) {\n date.setMonth(0);\n }\n};\n\nconst isDisabledNextDate = (\n { year, monthIndex, day }: DateObject,\n type: CalendarStateType,\n max?: Date,\n includeEdgeDates?: boolean,\n) => {\n if (!max) {\n return false;\n }\n\n const maxDate = new Date(max);\n\n normalizeDate(maxDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].add(currentDate);\n\n let isOut = true;\n const maxDateCondition = includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate;\n\n while (isOut && maxDateCondition) {\n isOut = false;\n\n dateOperationHandler[type].add(currentDate);\n }\n\n return isOut;\n};\n\nconst isDisabledPreviousDate = (\n { year, monthIndex, day }: DateObject,\n type: CalendarStateType,\n min?: Date,\n includeEdgeDates?: boolean,\n) => {\n if (!min) {\n return false;\n }\n\n const minDate = new Date(min);\n\n normalizeDate(minDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].subtract(currentDate);\n\n let isOut = true;\n const minDateCondition = includeEdgeDates ? currentDate > minDate : currentDate >= minDate;\n\n while (isOut && minDateCondition) {\n isOut = false;\n\n dateOperationHandler[type].subtract(currentDate);\n }\n\n return isOut;\n};\n\nconst getDisabledDates = (\n list: DateObject[],\n type: CalendarStateType,\n min?: Date,\n max?: Date,\n includeEdgeDates?: boolean,\n) => {\n const disabledDate: string[] = [];\n\n if (isDisabledPreviousDate(list[0], type, min, includeEdgeDates)) {\n disabledDate.push('previous');\n }\n\n if (isDisabledNextDate(list[list.length - 1], type, max, includeEdgeDates)) {\n disabledDate.push('next');\n }\n\n return disabledDate.join(',');\n};\n\nconst isDisabledArrowLeft = (date: Date, min?: Date, includeEdgeDates?: boolean) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() - 1);\n\n const disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n\n return disableCondition;\n};\n\nconst isDisabledArrowRight = (date: Date, max?: Date, includeEdgeDates?: boolean) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() + 1);\n\n const disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n\n return disableCondition;\n};\n\nconst isDisabledArrowUp = (date: Date, min?: Date, includeEdgeDates?: boolean) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() - 7);\n\n const disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n\n return disableCondition;\n};\n\nconst isDisabledArrowDown = (date: Date, max?: Date, includeEdgeDates?: boolean) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() + 7);\n\n const disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n\n return disableCondition;\n};\n\nconst getDisabledArrowKey = (currentDate: Date, min?: Date, max?: Date, includeEdgeDates?: boolean) => {\n const disabledArrowKey: string[] = [];\n\n if (isDisabledArrowLeft(currentDate, min, includeEdgeDates)) {\n disabledArrowKey.push('left');\n }\n\n if (isDisabledArrowRight(currentDate, max, includeEdgeDates)) {\n disabledArrowKey.push('right');\n }\n\n if (isDisabledArrowDown(currentDate, max, includeEdgeDates)) {\n disabledArrowKey.push('down');\n }\n\n if (isDisabledArrowUp(currentDate, min, includeEdgeDates)) {\n disabledArrowKey.push('up');\n }\n\n return disabledArrowKey.join(',');\n};\n\n/**\n * Метод модифицирующий дату (добавляющий свойства events и disabled).\n */\nexport const getDatesWithModifications = ({\n dates,\n type,\n eventList = [],\n disabledList = [],\n includeEdgeDates,\n min,\n max,\n}: GetDatesWithModificationsArgs) => {\n const eventsMap = getPropsMap(eventList);\n const disabledDatesMap = getPropsMap(disabledList);\n\n const filteredDates =\n type === CalendarState.Days ? dates.filter(({ isDayInCurrentMonth }) => isDayInCurrentMonth) : dates;\n const datesList = filteredDates.map(({ date }) => date);\n\n const disabledDates = getDisabledDates(datesList, type, min, max, includeEdgeDates);\n\n return dates.map((dateItem) => {\n const { date } = dateItem;\n const { year, monthIndex, day } = date;\n\n const keyDate = `${year}-${monthIndex}-${day}`;\n const currentDate = new Date(year, monthIndex, day);\n\n const minDate = min && new Date(min);\n minDate && normalizeDate(minDate, type);\n\n const maxDate = max && new Date(max);\n maxDate && normalizeDate(maxDate, type);\n\n let minValue: boolean | undefined;\n let maxValue: boolean | undefined;\n\n if (type === CalendarState.Days) {\n minValue = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n maxValue = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n } else {\n minValue = minDate && minDate > currentDate;\n maxValue = maxDate && maxDate < currentDate;\n }\n\n const isOutOfMinMaxRange = minValue || maxValue;\n\n dateItem.events = eventsMap.get(keyDate);\n dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;\n\n dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;\n dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max, includeEdgeDates);\n dateItem.disabledDates = disabledDates;\n\n return dateItem;\n });\n};\n"],"names":["dateOperationHandler","Days","add","date","setDate","getDate","subtract","Months","setMonth","getMonth","Quarters","Years","setFullYear","getFullYear","normalizeDate","type","CalendarState","isDisabledNextDate","_ref","max","includeEdgeDates","year","monthIndex","day","maxDate","Date","currentDate","isOut","maxDateCondition","isDisabledPreviousDate","_ref2","min","minDate","minDateCondition","getDisabledDates","list","disabledDate","push","length","join","isDisabledArrowLeft","disableCondition","isDisabledArrowRight","isDisabledArrowUp","isDisabledArrowDown","getDisabledArrowKey","disabledArrowKey","getDatesWithModifications","_ref3","dates","_ref3$eventList","eventList","_ref3$disabledList","disabledList","eventsMap","getPropsMap","disabledDatesMap","filteredDates","filter","_ref4","isDayInCurrentMonth","datesList","map","_ref5","disabledDates","dateItem","keyDate","concat","minValue","maxValue","isOutOfMinMaxRange","events","get","disabled","has"],"mappings":";;;AAqBA,IAAMA,oBAA0C,GAAG;AAC/CC,EAAAA,IAAI,EAAE;IACFC,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;IACrDC,QAAQ,EAAE,SAAAA,QAAAA,CAACH,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;AAAA,KAAA;GAC7D;AACDE,EAAAA,MAAM,EAAE;IACJL,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,IAAI,CAACK,QAAQ,CAACL,IAAI,CAACM,QAAQ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AAGrC,GAAG,KAAKX,gBAAgB,GAAGW,GAAG,GAAGL,WAAW,GAAGK,GAAG,IAAIL,WAAW,CAAC,CAAA;AAC7E2C,MAAAA,QAAQ,GAAGlD,GAAG,KAAKC,gBAAgB,GAAGD,GAAG,GAAGO,WAAW,GAAGP,GAAG,IAAIO,WAAW,CAAC,CAAA;AACjF,KAAC,MAAM;AACH0C,MAAAA,QAAQ,GAAGpC,OAAO,IAAIA,OAAO,GAAGN,WAAW,CAAA;AAC3C2C,MAAAA,QAAQ,GAAG7C,OAAO,IAAIA,OAAO,GAAGE,WAAW,CAAA;AAC/C,KAAA;AAEA,IAAA,IAAM4C,kBAAkB,GAAGF,QAAQ,IAAIC,QAAQ,CAAA;IAE/CJ,QAAQ,CAACM,MAAM,GAAGjB,SAAS,CAACkB,GAAG,CAACN,OAAO,CAAC,CAAA;IACxCD,QAAQ,CAACQ,QAAQ,GAAGjB,gBAAgB,CAACkB,GAAG,CAACR,OAAO,CAAC,IAAII,kBAAkB,CAAA;IAEvEL,QAAQ,CAACK,kBAAkB,GAAGA,kBAAkB,CAAA;AAChDL,IAAAA,QAAQ,CAACnB,gBAAgB,GAAGD,mBAAmB,CAACnB,WAAW,EAAEK,GAAG,EAAEZ,GAAG,EAAEC,gBAAgB,CAAC,CAAA;IACxF6C,QAAQ,CAACD,aAAa,GAAGA,aAAa,CAAA;AAEtC,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAC,CAAC,CAAA;AACN;;;;"}
|
1
|
+
{"version":3,"file":"getDateWithModification.js","sources":["../../../../src/components/Calendar/utils/getDateWithModification.ts"],"sourcesContent":["import type { DateItem, DateObject, DisabledDay, EventDay } from '../Calendar.types';\nimport { CalendarState, CalendarStateType } from '../store/types';\n\nimport { getPropsMap } from './calendarGridHelper';\n\ntype GetDatesWithModificationsArgs = {\n dates: DateItem[];\n type: CalendarStateType;\n eventList?: EventDay[];\n disabledList?: DisabledDay[];\n includeEdgeDates?: boolean;\n min?: Date;\n max?: Date;\n};\n\ntype DateOperationHandler = {\n [k in CalendarStateType]: {\n [t in 'add' | 'subtract']: (date: Date) => number;\n };\n};\n\nconst dateOperationHandler: DateOperationHandler = {\n Days: {\n add: (date: Date) => date.setDate(date.getDate() + 1),\n subtract: (date: Date) => date.setDate(date.getDate() - 1),\n },\n Months: {\n add: (date: Date) => date.setMonth(date.getMonth() + 1),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 1),\n },\n Quarters: {\n add: (date: Date) => date.setMonth(date.getMonth() + 3),\n subtract: (date: Date) => date.setMonth(date.getMonth() - 3),\n },\n Years: {\n add: (date: Date) => date.setFullYear(date.getFullYear() + 1),\n subtract: (date: Date) => date.setFullYear(date.getFullYear() - 1),\n },\n};\n\nconst normalizeDate = (date: Date, type: CalendarStateType) => {\n if (type === CalendarState.Months || type === CalendarState.Years) {\n date.setDate(1);\n }\n\n if (type === CalendarState.Years) {\n date.setMonth(0);\n }\n};\n\nconst isDisabledNextDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, max?: Date) => {\n if (!max) {\n return false;\n }\n\n const maxDate = new Date(max);\n\n normalizeDate(maxDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].add(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate <= maxDate) {\n isOut = maxDate <= currentDate;\n\n dateOperationHandler[type].add(currentDate);\n }\n\n return isOut;\n};\n\nconst isDisabledPreviousDate = ({ year, monthIndex, day }: DateObject, type: CalendarStateType, min?: Date) => {\n if (!min) {\n return false;\n }\n\n const minDate = new Date(min);\n\n normalizeDate(minDate, type);\n\n const currentDate = new Date(year, monthIndex, day);\n dateOperationHandler[type].subtract(currentDate);\n\n let isOut = true;\n\n while (isOut && currentDate >= minDate) {\n isOut = minDate >= currentDate;\n\n dateOperationHandler[type].subtract(currentDate);\n }\n\n return isOut;\n};\n\nconst getDisabledDates = (list: DateObject[], type: CalendarStateType, min?: Date, max?: Date) => {\n const disabledDate: string[] = [];\n\n if (isDisabledPreviousDate(list[0], type, min)) {\n disabledDate.push('previous');\n }\n\n if (isDisabledNextDate(list[list.length - 1], type, max)) {\n disabledDate.push('next');\n }\n\n return disabledDate.join(',');\n};\n\nconst isDisabledArrowLeft = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() - 1);\n\n return (min && min >= currentDate) || (min && min >= date);\n};\n\nconst isDisabledArrowRight = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(currentDate.getDate() + 1);\n\n return (max && max <= currentDate) || (max && max <= date);\n};\n\nconst isDisabledArrowUp = (date: Date, min?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() - 7);\n\n return min && min >= currentDate;\n};\n\nconst isDisabledArrowDown = (date: Date, max?: Date) => {\n const currentDate = new Date(date);\n\n currentDate.setDate(date.getDate() + 7);\n\n return max && max <= currentDate;\n};\n\nconst getDisabledArrowKey = (currentDate: Date, min?: Date, max?: Date) => {\n const disabledArrowKey: string[] = [];\n\n if (isDisabledArrowLeft(currentDate, min)) {\n disabledArrowKey.push('left');\n }\n\n if (isDisabledArrowRight(currentDate, max)) {\n disabledArrowKey.push('right');\n }\n\n if (isDisabledArrowDown(currentDate, max)) {\n disabledArrowKey.push('down');\n }\n\n if (isDisabledArrowUp(currentDate, min)) {\n disabledArrowKey.push('up');\n }\n\n return disabledArrowKey.join(',');\n};\n\n/**\n * Метод модифицирующий дату (добавляющий свойства events и disabled).\n */\nexport const getDatesWithModifications = ({\n dates,\n type,\n eventList = [],\n disabledList = [],\n includeEdgeDates,\n min,\n max,\n}: GetDatesWithModificationsArgs) => {\n const eventsMap = getPropsMap(eventList);\n const disabledDatesMap = getPropsMap(disabledList);\n\n const filteredDates =\n type === CalendarState.Days ? dates.filter(({ isDayInCurrentMonth }) => isDayInCurrentMonth) : dates;\n const datesList = filteredDates.map(({ date }) => date);\n\n const disabledDates = getDisabledDates(datesList, type, min, max);\n\n return dates.map((dateItem) => {\n const { date } = dateItem;\n const { year, monthIndex, day } = date;\n\n const keyDate = `${year}-${monthIndex}-${day}`;\n const currentDate = new Date(year, monthIndex, day);\n\n const minDate = min && new Date(min);\n minDate && normalizeDate(minDate, type);\n\n const maxDate = max && new Date(max);\n maxDate && normalizeDate(maxDate, type);\n\n let minValue: boolean | undefined;\n let maxValue: boolean | undefined;\n\n if (type === CalendarState.Days) {\n minValue = min && (includeEdgeDates ? min > currentDate : min >= currentDate);\n maxValue = max && (includeEdgeDates ? max < currentDate : max <= currentDate);\n } else {\n minValue = minDate && minDate > currentDate;\n maxValue = maxDate && maxDate < currentDate;\n }\n\n const isOutOfMinMaxRange = minValue || maxValue;\n\n dateItem.events = eventsMap.get(keyDate);\n dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;\n\n dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;\n dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);\n dateItem.disabledDates = disabledDates;\n\n return dateItem;\n });\n};\n"],"names":["dateOperationHandler","Days","add","date","setDate","getDate","subtract","Months","setMonth","getMonth","Quarters","Years","setFullYear","getFullYear","normalizeDate","type","CalendarState","isDisabledNextDate","_ref","max","year","monthIndex","day","maxDate","Date","currentDate","isOut","isDisabledPreviousDate","_ref2","min","minDate","getDisabledDates","list","disabledDate","push","length","join","isDisabledArrowLeft","isDisabledArrowRight","isDisabledArrowUp","isDisabledArrowDown","getDisabledArrowKey","disabledArrowKey","getDatesWithModifications","_ref3","dates","_ref3$eventList","eventList","_ref3$disabledList","disabledList","includeEdgeDates","eventsMap","getPropsMap","disabledDatesMap","filteredDates","filter","_ref4","isDayInCurrentMonth","datesList","map","_ref5","disabledDates","dateItem","keyDate","concat","minValue","maxValue","isOutOfMinMaxRange","events","get","disabled","has"],"mappings":";;;AAqBA,IAAMA,oBAA0C,GAAG;AAC/CC,EAAAA,IAAI,EAAE;IACFC,GAAG,EAAE,SAAAA,GAAAA,CAACC,IAAU,EAAA;MAAA,OAAKA,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G3C,OAAO,IAAIA,OAAO,GAAGE,WAAW,CAAA;AAC/C,KAAA;AAEA,IAAA,IAAM0C,kBAAkB,GAAGF,QAAQ,IAAIC,QAAQ,CAAA;IAE/CJ,QAAQ,CAACM,MAAM,GAAGjB,SAAS,CAACkB,GAAG,CAACN,OAAO,CAAC,CAAA;IACxCD,QAAQ,CAACQ,QAAQ,GAAGjB,gBAAgB,CAACkB,GAAG,CAACR,OAAO,CAAC,IAAII,kBAAkB,CAAA;IAEvEL,QAAQ,CAACK,kBAAkB,GAAGA,kBAAkB,CAAA;IAChDL,QAAQ,CAACpB,gBAAgB,GAAGD,mBAAmB,CAAChB,WAAW,EAAEI,GAAG,EAAEV,GAAG,CAAC,CAAA;IACtE2C,QAAQ,CAACD,aAAa,GAAGA,aAAa,CAAA;AAEtC,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAC,CAAC,CAAA;AACN;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.324.0-canary.
|
3
|
+
"version": "0.324.0-canary.1985.15159180127.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -79,7 +79,7 @@
|
|
79
79
|
"@rollup/plugin-babel": "^6.0.4",
|
80
80
|
"@rollup/plugin-commonjs": "^25.0.4",
|
81
81
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
82
|
-
"@salutejs/plasma-sb-utils": "0.
|
82
|
+
"@salutejs/plasma-sb-utils": "0.198.0-canary.1985.15159180127.0",
|
83
83
|
"@salutejs/plasma-themes": "0.33.0",
|
84
84
|
"@storybook/addon-docs": "8.6.12",
|
85
85
|
"@storybook/addon-essentials": "8.6.12",
|
@@ -117,7 +117,7 @@
|
|
117
117
|
"@linaria/react": "5.0.3",
|
118
118
|
"@popperjs/core": "2.11.8",
|
119
119
|
"@salutejs/input-core": "2.1.2",
|
120
|
-
"@salutejs/plasma-core": "1.
|
120
|
+
"@salutejs/plasma-core": "1.197.0-canary.1985.15159180127.0",
|
121
121
|
"@salutejs/react-maskinput": "3.2.6",
|
122
122
|
"@tanstack/react-table": "8.21.2",
|
123
123
|
"@tanstack/react-virtual": "3.13.2",
|
@@ -137,5 +137,5 @@
|
|
137
137
|
"sideEffects": [
|
138
138
|
"*.css"
|
139
139
|
],
|
140
|
-
"gitHead": "
|
140
|
+
"gitHead": "f934fb0df0251ff615faf4042690be9e0165be0b"
|
141
141
|
}
|
@@ -18,8 +18,7 @@ var useMonths = exports.useMonths = function useMonths(_ref) {
|
|
18
18
|
min = _ref.min,
|
19
19
|
max = _ref.max,
|
20
20
|
_ref$locale = _ref.locale,
|
21
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale
|
22
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
21
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale;
|
23
22
|
return (0, _react.useMemo)(function () {
|
24
23
|
var months = _utils.SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
25
24
|
return {
|
@@ -44,7 +43,6 @@ var useMonths = exports.useMonths = function useMonths(_ref) {
|
|
44
43
|
type: _types.CalendarState.Months,
|
45
44
|
min: min,
|
46
45
|
max: max,
|
47
|
-
includeEdgeDates: includeEdgeDates,
|
48
46
|
eventList: eventList,
|
49
47
|
disabledList: disabledList
|
50
48
|
});
|
@@ -16,8 +16,7 @@ var useQuarters = exports.useQuarters = function useQuarters(_ref) {
|
|
16
16
|
eventList = _ref.eventList,
|
17
17
|
disabledList = _ref.disabledList,
|
18
18
|
min = _ref.min,
|
19
|
-
max = _ref.max
|
20
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
19
|
+
max = _ref.max;
|
21
20
|
return (0, _react.useMemo)(function () {
|
22
21
|
var quarters = _utils.QUARTER_NAMES.map(function (quarterName) {
|
23
22
|
var _quarterDates$quarter = _utils.quarterDates[quarterName],
|
@@ -43,7 +42,6 @@ var useQuarters = exports.useQuarters = function useQuarters(_ref) {
|
|
43
42
|
type: _types.CalendarState.Quarters,
|
44
43
|
min: min,
|
45
44
|
max: max,
|
46
|
-
includeEdgeDates: includeEdgeDates,
|
47
45
|
eventList: eventList,
|
48
46
|
disabledList: disabledList
|
49
47
|
});
|
@@ -17,8 +17,7 @@ var useYears = exports.useYears = function useYears(_ref) {
|
|
17
17
|
eventList = _ref.eventList,
|
18
18
|
disabledList = _ref.disabledList,
|
19
19
|
min = _ref.min,
|
20
|
-
max = _ref.max
|
21
|
-
includeEdgeDates = _ref.includeEdgeDates;
|
20
|
+
max = _ref.max;
|
22
21
|
return (0, _react.useMemo)(function () {
|
23
22
|
// type-coverage:ignore-next-line
|
24
23
|
var years = Array.from(Array(_utils.YEAR_RENDER_COUNT), function (_, i) {
|
@@ -43,7 +42,6 @@ var useYears = exports.useYears = function useYears(_ref) {
|
|
43
42
|
type: _types.CalendarState.Years,
|
44
43
|
min: min,
|
45
44
|
max: max,
|
46
|
-
includeEdgeDates: includeEdgeDates,
|
47
45
|
eventList: eventList,
|
48
46
|
disabledList: disabledList
|
49
47
|
});
|