@salutejs/plasma-new-hope 0.324.0-canary.1984.15135602558.0 → 0.324.0-canary.1984.15159659604.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 +4 -6
- 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 +4 -6
- package/emotion/cjs/components/Mask/Mask.js +9 -2
- 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 +4 -6
- package/emotion/es/components/Mask/Mask.js +9 -2
- 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 +4 -6
- 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 +4 -6
- package/styled-components/cjs/components/Mask/Mask.js +9 -2
- 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 +4 -6
- package/styled-components/es/components/Mask/Mask.js +9 -2
- 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
@@ -20,7 +20,8 @@ var useMonths = function useMonths(_ref) {
|
|
20
20
|
min = _ref.min,
|
21
21
|
max = _ref.max,
|
22
22
|
_ref$locale = _ref.locale,
|
23
|
-
locale = _ref$locale === void 0 ? 'ru' : _ref$locale
|
23
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
24
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
24
25
|
return React.useMemo(function () {
|
25
26
|
var months = constants.SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
26
27
|
return {
|
@@ -45,6 +46,7 @@ var useMonths = function useMonths(_ref) {
|
|
45
46
|
type: types.CalendarState.Months,
|
46
47
|
min: min,
|
47
48
|
max: max,
|
49
|
+
includeEdgeDates: includeEdgeDates,
|
48
50
|
eventList: eventList,
|
49
51
|
disabledList: disabledList
|
50
52
|
});
|
@@ -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,aAAO,CAAC,YAAM;AACV,IAAA,IAAMC,MAAM,GAAGC,0BAAgB,CAACJ,MAAM,CAAC,CAACK,GAAG,CAAC,UAACC,SAAS,EAAEC,UAAU,EAAK;MACnE,OAAO;AACHD,QAAAA,SAAS,EAATA,SAAS;AACTC,QAAAA,UAAU,EAAVA,UAAU;AACVC,QAAAA,SAAS,EAAEC,iCAAc,CAAChB,IAAI,EAAEc,UAAU,CAAC;AAC3CG,QAAAA,UAAU,EAAEC,KAAK,CAACC,OAAO,CAAClB,KAAK,CAAC,GAC1BmB,OAA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AS,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;;;;"}
|
@@ -18,7 +18,8 @@ var useQuarters = function useQuarters(_ref) {
|
|
18
18
|
eventList = _ref.eventList,
|
19
19
|
disabledList = _ref.disabledList,
|
20
20
|
min = _ref.min,
|
21
|
-
max = _ref.max
|
21
|
+
max = _ref.max,
|
22
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
22
23
|
return React.useMemo(function () {
|
23
24
|
var quarters = constants.QUARTER_NAMES.map(function (quarterName) {
|
24
25
|
var _quarterDates$quarter = constants.quarterDates[quarterName],
|
@@ -44,6 +45,7 @@ var useQuarters = function useQuarters(_ref) {
|
|
44
45
|
type: types.CalendarState.Quarters,
|
45
46
|
min: min,
|
46
47
|
max: max,
|
48
|
+
includeEdgeDates: includeEdgeDates,
|
47
49
|
eventList: eventList,
|
48
50
|
disabledList: disabledList
|
49
51
|
});
|
@@ -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,SAAS;IAAEC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IAAEC,GAAG,GAAAL,IAAA,CAAHK,GAAG;IAAEC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IAAEC,gBAAgB,GAAAP,IAAA,C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AAGC,iDAAyB,CAAC;AAC/CC,QAAAA,KAAK,EAAEvB,QAAQ;QACfwB,IAAI,EAAEC,mBAAa,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,4BAAS,CAAWN,gBAAgB,EAAE,CAAC,CAAC,CAAA;AACnD,KAAA;AAEA,IAAA,OAAOM,4BAAS,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;;;;"}
|
@@ -19,7 +19,8 @@ var useYears = function useYears(_ref) {
|
|
19
19
|
eventList = _ref.eventList,
|
20
20
|
disabledList = _ref.disabledList,
|
21
21
|
min = _ref.min,
|
22
|
-
max = _ref.max
|
22
|
+
max = _ref.max,
|
23
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
23
24
|
return React.useMemo(function () {
|
24
25
|
// type-coverage:ignore-next-line
|
25
26
|
var years = Array.from(Array(constants.YEAR_RENDER_COUNT), function (_, i) {
|
@@ -44,6 +45,7 @@ var useYears = function useYears(_ref) {
|
|
44
45
|
type: types.CalendarState.Years,
|
45
46
|
min: min,
|
46
47
|
max: max,
|
48
|
+
includeEdgeDates: includeEdgeDates,
|
47
49
|
eventList: eventList,
|
48
50
|
disabledList: disabledList
|
49
51
|
});
|
@@ -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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U,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,iDAAyB,CAAC;AAC7CC,QAAAA,KAAK,EAAEvB,KAAK;QACZwB,IAAI,EAAEC,mBAAa,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,4BAAS,CAAWN,cAAc,EAAE,CAAC,CAAC,CAAA;AACjD,KAAA;AAEA,IAAA,OAAOM,4BAAS,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;;;;"}
|
@@ -59,9 +59,8 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdg
|
|
59
59
|
var currentDate = new Date(year, monthIndex, day);
|
60
60
|
dateOperationHandler[type].add(currentDate);
|
61
61
|
var isOut = true;
|
62
|
-
|
63
|
-
|
64
|
-
isOut = maxDateCondition;
|
62
|
+
while (isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate) {
|
63
|
+
isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;
|
65
64
|
dateOperationHandler[type].add(currentDate);
|
66
65
|
}
|
67
66
|
return isOut;
|
@@ -78,9 +77,8 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, i
|
|
78
77
|
var currentDate = new Date(year, monthIndex, day);
|
79
78
|
dateOperationHandler[type].subtract(currentDate);
|
80
79
|
var isOut = true;
|
81
|
-
|
82
|
-
|
83
|
-
isOut = minDateCondition;
|
80
|
+
while (isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate) {
|
81
|
+
isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;
|
84
82
|
dateOperationHandler[type].subtract(currentDate);
|
85
83
|
}
|
86
84
|
return isOut;
|
@@ -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 = maxDateCondition;\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 = minDateCondition;\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,CA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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 = (\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\n while (isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate) {\n isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;\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\n while (isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate) {\n isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;\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","isDisabledPreviousDate","_ref2","min","minDate","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,CAAC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AEjC,IAAA,IAAIpD,IAAI,KAAKC,mBAAa,CAACf,IAAI,EAAE;AAC7BiE,MAAAA,QAAQ,GAAGpC,GAAG,KAAKV,gBAAgB,GAAGU,GAAG,GAAGJ,WAAW,GAAGI,GAAG,IAAIJ,WAAW,CAAC,CAAA;AAC7EyC,MAAAA,QAAQ,GAAGhD,GAAG,KAAKC,gBAAgB,GAAGD,GAAG,GAAGO,WAAW,GAAGP,GAAG,IAAIO,WAAW,CAAC,CAAA;AACjF,KAAC,MAAM;AACHwC,MAAAA,QAAQ,GAAGnC,OAAO,IAAIA,OAAO,GAAGL,WAAW,CAAA;AAC3CyC,MAAAA,QAAQ,GAAG3C,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;AAChDL,IAAAA,QAAQ,CAACnB,gBAAgB,GAAGD,mBAAmB,CAACjB,WAAW,EAAEI,GAAG,EAAEX,GAAG,EAAEC,gBAAgB,CAAC,CAAA;IACxF2C,QAAQ,CAACD,aAAa,GAAGA,aAAa,CAAA;AAEtC,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAC,CAAC,CAAA;AACN;;;;"}
|
@@ -11,7 +11,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
12
12
|
var maskInputCompose__default = /*#__PURE__*/_interopDefault(maskInputCompose);
|
13
13
|
|
14
|
-
var _excluded = ["maskFormat"];
|
14
|
+
var _excluded = ["mask", "maskFormat"];
|
15
15
|
var defaultFormatChars = [{
|
16
16
|
str: '0',
|
17
17
|
regexp: /[0-9]/
|
@@ -28,7 +28,8 @@ var defaultFormatChars = [{
|
|
28
28
|
var composeMask = function composeMask(InputComponent) {
|
29
29
|
var MaskedInput = maskInputCompose__default.default(InputComponent);
|
30
30
|
return /*#__PURE__*/React.forwardRef(function (_ref, outerRef) {
|
31
|
-
var
|
31
|
+
var mask = _ref.mask,
|
32
|
+
_ref$maskFormat = _ref.maskFormat,
|
32
33
|
maskFormat = _ref$maskFormat === void 0 ? defaultFormatChars : _ref$maskFormat,
|
33
34
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
34
35
|
// TODO: replace inside react-maskinput 'getReference' on 'forwardRef'
|
@@ -39,8 +40,14 @@ var composeMask = function composeMask(InputComponent) {
|
|
39
40
|
React.useImperativeHandle(outerRef, function () {
|
40
41
|
return ref;
|
41
42
|
}, [ref]);
|
43
|
+
if (!mask) {
|
44
|
+
return /*#__PURE__*/React__default.default.createElement(InputComponent, _rollupPluginBabelHelpers.extends({
|
45
|
+
ref: setRef
|
46
|
+
}, rest));
|
47
|
+
}
|
42
48
|
return /*#__PURE__*/React__default.default.createElement(MaskedInput, _rollupPluginBabelHelpers.extends({
|
43
49
|
getReference: setRef,
|
50
|
+
mask: mask,
|
44
51
|
maskFormat: maskFormat
|
45
52
|
}, rest));
|
46
53
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Mask.js","sources":["../../../src/components/Mask/Mask.tsx"],"sourcesContent":["import React, { forwardRef, useImperativeHandle, useState } from 'react';\nimport type { FC } from 'react';\nimport maskInputCompose from '@salutejs/react-maskinput';\n\nimport type { CustomInputProps, MaskProps } from './Mask.types';\n\nconst defaultFormatChars = [\n {\n str: '0',\n regexp: /[0-9]/,\n },\n {\n str: '*',\n regexp: /./,\n },\n {\n str: 'a',\n regexp: /[a-zA-Z]/,\n },\n {\n str: 'я',\n regexp: /[а-яА-ЯёЁ]/,\n },\n];\n\nexport const composeMask = <T extends CustomInputProps>(InputComponent: FC<T>) => {\n const MaskedInput = maskInputCompose(InputComponent);\n\n return forwardRef<HTMLInputElement, T & MaskProps>(({ maskFormat = defaultFormatChars, ...rest }, outerRef) => {\n
|
1
|
+
{"version":3,"file":"Mask.js","sources":["../../../src/components/Mask/Mask.tsx"],"sourcesContent":["import React, { forwardRef, useImperativeHandle, useState } from 'react';\nimport type { FC } from 'react';\nimport maskInputCompose from '@salutejs/react-maskinput';\n\nimport type { CustomInputProps, MaskProps } from './Mask.types';\n\nconst defaultFormatChars = [\n {\n str: '0',\n regexp: /[0-9]/,\n },\n {\n str: '*',\n regexp: /./,\n },\n {\n str: 'a',\n regexp: /[a-zA-Z]/,\n },\n {\n str: 'я',\n regexp: /[а-яА-ЯёЁ]/,\n },\n];\n\nexport const composeMask = <T extends CustomInputProps>(InputComponent: FC<T>) => {\n const MaskedInput = maskInputCompose(InputComponent);\n\n return forwardRef<HTMLInputElement, T & MaskProps>(\n ({ mask, maskFormat = defaultFormatChars, ...rest }, outerRef) => {\n // TODO: replace inside react-maskinput 'getReference' on 'forwardRef'\n const [ref, setRef] = useState<HTMLInputElement | null>(null);\n\n useImperativeHandle(outerRef, () => ref as HTMLInputElement, [ref]);\n\n if (!mask) {\n return <InputComponent ref={setRef} {...(rest as T)} />;\n }\n\n return <MaskedInput getReference={setRef} mask={mask} maskFormat={maskFormat} {...(rest as T)} />;\n },\n );\n};\n"],"names":["defaultFormatChars","str","regexp","composeMask","InputComponent","MaskedInput","maskInputCompose","forwardRef","_ref","outerRef","mask","_ref$maskFormat","maskFormat","rest","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","ref","setRef","useImperativeHandle","React","createElement","_extends","getReference"],"mappings":";;;;;;;;;;;;;;AAMA,IAAMA,kBAAkB,GAAG,CACvB;AACIC,EAAAA,GAAG,EAAE,GAAG;AACRC,EAAAA,MAAM,EAAE,OAAA;AACZ,CAAC,EACD;AACID,EAAAA,GAAG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U,sBAAA,CAAAC,aAAA,CAACnB,WAAW,EAAAoB,iCAAA,CAAA;AAACC,MAAAA,YAAY,EAAEL,MAAO;AAACX,MAAAA,IAAI,EAAEA,IAAK;AAACE,MAAAA,UAAU,EAAEA,UAAAA;KAAiBC,EAAAA,IAAI,CAAS,CAAC,CAAA;AACrG,GACJ,CAAC,CAAA;AACL;;;;"}
|
@@ -18,7 +18,8 @@ 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
|
21
|
+
locale = _ref$locale === void 0 ? 'ru' : _ref$locale,
|
22
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
22
23
|
return (0, _react.useMemo)(function () {
|
23
24
|
var months = _utils.SHORT_MONTH_NAME[locale].map(function (monthName, monthIndex) {
|
24
25
|
return {
|
@@ -43,6 +44,7 @@ var useMonths = exports.useMonths = function useMonths(_ref) {
|
|
43
44
|
type: _types.CalendarState.Months,
|
44
45
|
min: min,
|
45
46
|
max: max,
|
47
|
+
includeEdgeDates: includeEdgeDates,
|
46
48
|
eventList: eventList,
|
47
49
|
disabledList: disabledList
|
48
50
|
});
|
@@ -16,7 +16,8 @@ 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
|
19
|
+
max = _ref.max,
|
20
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
20
21
|
return (0, _react.useMemo)(function () {
|
21
22
|
var quarters = _utils.QUARTER_NAMES.map(function (quarterName) {
|
22
23
|
var _quarterDates$quarter = _utils.quarterDates[quarterName],
|
@@ -42,6 +43,7 @@ var useQuarters = exports.useQuarters = function useQuarters(_ref) {
|
|
42
43
|
type: _types.CalendarState.Quarters,
|
43
44
|
min: min,
|
44
45
|
max: max,
|
46
|
+
includeEdgeDates: includeEdgeDates,
|
45
47
|
eventList: eventList,
|
46
48
|
disabledList: disabledList
|
47
49
|
});
|
@@ -17,7 +17,8 @@ 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
|
20
|
+
max = _ref.max,
|
21
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
21
22
|
return (0, _react.useMemo)(function () {
|
22
23
|
// type-coverage:ignore-next-line
|
23
24
|
var years = Array.from(Array(_utils.YEAR_RENDER_COUNT), function (_, i) {
|
@@ -42,6 +43,7 @@ var useYears = exports.useYears = function useYears(_ref) {
|
|
42
43
|
type: _types.CalendarState.Years,
|
43
44
|
min: min,
|
44
45
|
max: max,
|
46
|
+
includeEdgeDates: includeEdgeDates,
|
45
47
|
eventList: eventList,
|
46
48
|
disabledList: disabledList
|
47
49
|
});
|
@@ -60,9 +60,8 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdg
|
|
60
60
|
var currentDate = new Date(year, monthIndex, day);
|
61
61
|
dateOperationHandler[type].add(currentDate);
|
62
62
|
var isOut = true;
|
63
|
-
|
64
|
-
|
65
|
-
isOut = maxDateCondition;
|
63
|
+
while (isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate) {
|
64
|
+
isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;
|
66
65
|
dateOperationHandler[type].add(currentDate);
|
67
66
|
}
|
68
67
|
return isOut;
|
@@ -79,9 +78,8 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, i
|
|
79
78
|
var currentDate = new Date(year, monthIndex, day);
|
80
79
|
dateOperationHandler[type].subtract(currentDate);
|
81
80
|
var isOut = true;
|
82
|
-
|
83
|
-
|
84
|
-
isOut = minDateCondition;
|
81
|
+
while (isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate) {
|
82
|
+
isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;
|
85
83
|
dateOperationHandler[type].subtract(currentDate);
|
86
84
|
}
|
87
85
|
return isOut;
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.composeMask = void 0;
|
8
8
|
var _react = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("react"));
|
9
9
|
var _reactMaskinput = /*#__PURE__*/_interopRequireDefault(/*#__PURE__*/require("@salutejs/react-maskinput"));
|
10
|
-
var _excluded = ["maskFormat"];
|
10
|
+
var _excluded = ["mask", "maskFormat"];
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
@@ -36,7 +36,8 @@ var defaultFormatChars = [{
|
|
36
36
|
var composeMask = exports.composeMask = function composeMask(InputComponent) {
|
37
37
|
var MaskedInput = (0, _reactMaskinput["default"])(InputComponent);
|
38
38
|
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, outerRef) {
|
39
|
-
var
|
39
|
+
var mask = _ref.mask,
|
40
|
+
_ref$maskFormat = _ref.maskFormat,
|
40
41
|
maskFormat = _ref$maskFormat === void 0 ? defaultFormatChars : _ref$maskFormat,
|
41
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
42
43
|
// TODO: replace inside react-maskinput 'getReference' on 'forwardRef'
|
@@ -47,8 +48,14 @@ var composeMask = exports.composeMask = function composeMask(InputComponent) {
|
|
47
48
|
(0, _react.useImperativeHandle)(outerRef, function () {
|
48
49
|
return ref;
|
49
50
|
}, [ref]);
|
51
|
+
if (!mask) {
|
52
|
+
return /*#__PURE__*/_react["default"].createElement(InputComponent, _extends({
|
53
|
+
ref: setRef
|
54
|
+
}, rest));
|
55
|
+
}
|
50
56
|
return /*#__PURE__*/_react["default"].createElement(MaskedInput, _extends({
|
51
57
|
getReference: setRef,
|
58
|
+
mask: mask,
|
52
59
|
maskFormat: maskFormat
|
53
60
|
}, rest));
|
54
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
|
});
|
@@ -54,9 +54,8 @@ 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 = maxDateCondition;
|
57
|
+
while (isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate) {
|
58
|
+
isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;
|
60
59
|
dateOperationHandler[type].add(currentDate);
|
61
60
|
}
|
62
61
|
return isOut;
|
@@ -73,9 +72,8 @@ 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 = minDateCondition;
|
75
|
+
while (isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate) {
|
76
|
+
isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;
|
79
77
|
dateOperationHandler[type].subtract(currentDate);
|
80
78
|
}
|
81
79
|
return isOut;
|
@@ -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
|
});
|
@@ -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,G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AAA,IAAI3B,SAAS,KAATA,IAAAA,IAAAA,SAAS,eAATA,SAAS,CAAE4B,MAAM,IAAI3B,YAAY,aAAZA,YAAY,KAAA,KAAA,CAAA,IAAZA,YAAY,CAAE2B,MAAM,IAAIzB,GAAG,IAAID,GAAG,EAAE;MACzD,IAAM2B,cAAc,GAAGC,yBAAyB,CAAC;AAC7CC,QAAAA,KAAK,EAAEvB,MAAM;QACbwB,IAAI,EAAEC,aAAa,CAACC,MAAM;AAC1BhC,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,GAAG,EAAHA,GAAG;AACHG,QAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBN,QAAAA,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
|
});
|