@salutejs/plasma-new-hope 0.324.1-canary.1986.15225454757.0 → 0.324.1-canary.1986.15255471728.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 +28 -24
- package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/cjs/components/Note/Note.css +35 -6
- package/cjs/components/Note/Note.js +17 -3
- package/cjs/components/Note/Note.js.map +1 -1
- package/cjs/components/Note/Note.styles.js +25 -2
- package/cjs/components/Note/Note.styles.js.map +1 -1
- package/cjs/components/Note/{Note.styles_178qpj9.css → Note.styles_thpfhk.css} +2 -1
- package/cjs/components/Note/Note.tokens.js +9 -1
- package/cjs/components/Note/Note.tokens.js.map +1 -1
- package/cjs/index.css +8 -7
- 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 +28 -24
- package/emotion/cjs/components/Note/Note.js +17 -3
- package/emotion/cjs/components/Note/Note.styles.js +27 -15
- package/emotion/cjs/components/Note/Note.tokens.js +9 -1
- package/emotion/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +188 -15
- package/emotion/cjs/examples/plasma_b2c/components/Note/Note.config.js +9 -9
- package/emotion/cjs/examples/plasma_b2c/components/Note/Note.stories.tsx +1 -0
- package/emotion/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +188 -21
- package/emotion/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +187 -15
- package/emotion/cjs/examples/plasma_web/components/Note/Note.config.js +9 -9
- package/emotion/cjs/examples/plasma_web/components/Note/Note.stories.tsx +1 -0
- package/emotion/cjs/examples/plasma_web/components/Select/Select.stories.tsx +188 -21
- 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 +28 -24
- package/emotion/es/components/Note/Note.js +18 -4
- package/emotion/es/components/Note/Note.styles.js +26 -14
- package/emotion/es/components/Note/Note.tokens.js +9 -1
- package/emotion/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +188 -15
- package/emotion/es/examples/plasma_b2c/components/Note/Note.config.js +9 -9
- package/emotion/es/examples/plasma_b2c/components/Note/Note.stories.tsx +1 -0
- package/emotion/es/examples/plasma_b2c/components/Select/Select.stories.tsx +188 -21
- package/emotion/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +187 -15
- package/emotion/es/examples/plasma_web/components/Note/Note.config.js +9 -9
- package/emotion/es/examples/plasma_web/components/Note/Note.stories.tsx +1 -0
- package/emotion/es/examples/plasma_web/components/Select/Select.stories.tsx +188 -21
- 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 +28 -24
- package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
- package/es/components/Note/Note.css +35 -6
- package/es/components/Note/Note.js +18 -4
- package/es/components/Note/Note.js.map +1 -1
- package/es/components/Note/Note.styles.js +25 -3
- package/es/components/Note/Note.styles.js.map +1 -1
- package/es/components/Note/{Note.styles_178qpj9.css → Note.styles_thpfhk.css} +2 -1
- package/es/components/Note/Note.tokens.js +9 -1
- package/es/components/Note/Note.tokens.js.map +1 -1
- package/es/index.css +8 -7
- 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 +28 -24
- package/styled-components/cjs/components/Note/Note.js +17 -3
- package/styled-components/cjs/components/Note/Note.styles.js +14 -3
- package/styled-components/cjs/components/Note/Note.tokens.js +9 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +188 -15
- package/styled-components/cjs/examples/plasma_b2c/components/Note/Note.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Note/Note.stories.tsx +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +188 -21
- package/styled-components/cjs/examples/plasma_web/components/Combobox/Combobox.stories.tsx +187 -15
- package/styled-components/cjs/examples/plasma_web/components/Note/Note.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Note/Note.stories.tsx +1 -0
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.stories.tsx +188 -21
- 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 +28 -24
- package/styled-components/es/components/Note/Note.js +18 -4
- package/styled-components/es/components/Note/Note.styles.js +13 -2
- package/styled-components/es/components/Note/Note.tokens.js +9 -1
- package/styled-components/es/examples/plasma_b2c/components/Combobox/Combobox.stories.tsx +188 -15
- package/styled-components/es/examples/plasma_b2c/components/Note/Note.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Note/Note.stories.tsx +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.stories.tsx +188 -21
- package/styled-components/es/examples/plasma_web/components/Combobox/Combobox.stories.tsx +187 -15
- package/styled-components/es/examples/plasma_web/components/Note/Note.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Note/Note.stories.tsx +1 -0
- package/styled-components/es/examples/plasma_web/components/Select/Select.stories.tsx +188 -21
- 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/Note/Note.d.ts +4 -0
- package/types/components/Note/Note.d.ts.map +1 -1
- package/types/components/Note/Note.styles.d.ts +46 -1
- package/types/components/Note/Note.styles.d.ts.map +1 -1
- package/types/components/Note/Note.tokens.d.ts +8 -0
- package/types/components/Note/Note.tokens.d.ts.map +1 -1
- package/types/components/Note/Note.types.d.ts +8 -0
- package/types/components/Note/Note.types.d.ts.map +1 -1
@@ -13,7 +13,7 @@ import { Select } from './Select';
|
|
13
13
|
type StorySelectProps = ComponentProps<typeof Select> & {
|
14
14
|
enableContentLeft?: boolean;
|
15
15
|
hasHint?: boolean;
|
16
|
-
|
16
|
+
selectAllLabel?: string;
|
17
17
|
selectAllSticky?: boolean;
|
18
18
|
};
|
19
19
|
|
@@ -198,13 +198,6 @@ const meta: Meta<StorySelectProps> = {
|
|
198
198
|
options: ['default', 'text'],
|
199
199
|
if: { arg: 'target', eq: 'textfield-like' },
|
200
200
|
},
|
201
|
-
enableSelectAll: {
|
202
|
-
control: 'boolean',
|
203
|
-
},
|
204
|
-
selectAllSticky: {
|
205
|
-
control: 'boolean',
|
206
|
-
if: { arg: 'enableSelectAll', truthy: true },
|
207
|
-
},
|
208
201
|
},
|
209
202
|
args: {
|
210
203
|
target: 'textfield-like',
|
@@ -234,8 +227,6 @@ const meta: Meta<StorySelectProps> = {
|
|
234
227
|
hintPlacement: 'auto',
|
235
228
|
hintWidth: '10rem',
|
236
229
|
hintHasArrow: true,
|
237
|
-
enableSelectAll: false,
|
238
|
-
selectAllSticky: false,
|
239
230
|
},
|
240
231
|
parameters: {
|
241
232
|
controls: {
|
@@ -271,8 +262,6 @@ const meta: Meta<StorySelectProps> = {
|
|
271
262
|
'hintPlacement',
|
272
263
|
'hintWidth',
|
273
264
|
'hintHasArrow',
|
274
|
-
'enableSelectAll',
|
275
|
-
'selectAllSticky',
|
276
265
|
],
|
277
266
|
},
|
278
267
|
},
|
@@ -511,7 +500,7 @@ const SingleStory = ({ enableContentLeft, ...args }: StorySelectProps) => {
|
|
511
500
|
export const Single: StoryObj<StorySelectProps> = {
|
512
501
|
parameters: {
|
513
502
|
controls: {
|
514
|
-
exclude: ['chipView', 'isTargetAmount', 'chipType'
|
503
|
+
exclude: ['chipView', 'isTargetAmount', 'chipType'],
|
515
504
|
},
|
516
505
|
},
|
517
506
|
render: (args) => <SingleStory {...args} />,
|
@@ -520,7 +509,7 @@ export const Single: StoryObj<StorySelectProps> = {
|
|
520
509
|
},
|
521
510
|
};
|
522
511
|
|
523
|
-
const MultiselectStory = ({ enableContentLeft,
|
512
|
+
const MultiselectStory = ({ enableContentLeft, ...args }: StorySelectProps) => {
|
524
513
|
const [value, setValue] = useState<Array<string>>([]);
|
525
514
|
|
526
515
|
return (
|
@@ -531,7 +520,6 @@ const MultiselectStory = ({ enableContentLeft, enableSelectAll, selectAllSticky,
|
|
531
520
|
value={value}
|
532
521
|
onChange={setValue}
|
533
522
|
contentLeft={enableContentLeft ? <IconDone size="s" color="inherit" /> : undefined}
|
534
|
-
selectAllOptions={enableSelectAll ? { sticky: selectAllSticky || false } : undefined}
|
535
523
|
/>
|
536
524
|
</div>
|
537
525
|
);
|
@@ -574,11 +562,6 @@ const PredefinedStory = ({ enableContentLeft, ...args }: StorySelectProps) => {
|
|
574
562
|
};
|
575
563
|
|
576
564
|
export const Predefined: StoryObj<StorySelectProps> = {
|
577
|
-
parameters: {
|
578
|
-
controls: {
|
579
|
-
exclude: ['enableSelectAll'],
|
580
|
-
},
|
581
|
-
},
|
582
565
|
render: (args) => <PredefinedStory {...args} />,
|
583
566
|
};
|
584
567
|
|
@@ -1002,7 +985,7 @@ const CommonStory = ({ enableContentLeft, ...args }: StorySelectProps) => {
|
|
1002
985
|
export const Common: StoryObj<StorySelectProps> = {
|
1003
986
|
parameters: {
|
1004
987
|
controls: {
|
1005
|
-
exclude: ['target', 'view'
|
988
|
+
exclude: ['target', 'view'],
|
1006
989
|
},
|
1007
990
|
},
|
1008
991
|
argTypes: {
|
@@ -1016,3 +999,187 @@ export const Common: StoryObj<StorySelectProps> = {
|
|
1016
999
|
},
|
1017
1000
|
render: (args) => <CommonStory {...args} />,
|
1018
1001
|
};
|
1002
|
+
|
1003
|
+
const flatItems = [
|
1004
|
+
{
|
1005
|
+
value: 'north_america',
|
1006
|
+
label: 'Северная Америка',
|
1007
|
+
},
|
1008
|
+
{
|
1009
|
+
value: 'rio_de_janeiro',
|
1010
|
+
label: 'Рио-де-Жанейро',
|
1011
|
+
},
|
1012
|
+
{
|
1013
|
+
value: 'sao_paulo',
|
1014
|
+
label: 'Сан-Паулу',
|
1015
|
+
},
|
1016
|
+
{
|
1017
|
+
value: 'buenos_aires',
|
1018
|
+
label: 'Буэнос-Айрес',
|
1019
|
+
},
|
1020
|
+
{
|
1021
|
+
value: 'cordoba',
|
1022
|
+
label: 'Кордова',
|
1023
|
+
},
|
1024
|
+
{
|
1025
|
+
value: 'bogota',
|
1026
|
+
label: 'Богота',
|
1027
|
+
},
|
1028
|
+
{
|
1029
|
+
value: 'medellin',
|
1030
|
+
label: 'Медельин',
|
1031
|
+
},
|
1032
|
+
{
|
1033
|
+
value: 'paris',
|
1034
|
+
label: 'Париж',
|
1035
|
+
},
|
1036
|
+
{
|
1037
|
+
value: 'lyon',
|
1038
|
+
label: 'Лион',
|
1039
|
+
},
|
1040
|
+
{
|
1041
|
+
value: 'berlin',
|
1042
|
+
label: 'Берлин',
|
1043
|
+
},
|
1044
|
+
{
|
1045
|
+
value: 'munich',
|
1046
|
+
label: 'Мюнхен',
|
1047
|
+
},
|
1048
|
+
{
|
1049
|
+
value: 'rome',
|
1050
|
+
label: 'Рим',
|
1051
|
+
},
|
1052
|
+
{
|
1053
|
+
value: 'milan',
|
1054
|
+
label: 'Милан',
|
1055
|
+
},
|
1056
|
+
{
|
1057
|
+
value: 'madrid',
|
1058
|
+
label: 'Мадрид',
|
1059
|
+
},
|
1060
|
+
{
|
1061
|
+
value: 'barcelona',
|
1062
|
+
label: 'Барселона',
|
1063
|
+
},
|
1064
|
+
{
|
1065
|
+
value: 'london',
|
1066
|
+
label: 'Лондон',
|
1067
|
+
},
|
1068
|
+
{
|
1069
|
+
value: 'manchester',
|
1070
|
+
label: 'Манчестер',
|
1071
|
+
},
|
1072
|
+
{
|
1073
|
+
value: 'beijing',
|
1074
|
+
label: 'Пекин',
|
1075
|
+
},
|
1076
|
+
{
|
1077
|
+
value: 'shanghai',
|
1078
|
+
label: 'Шанхай',
|
1079
|
+
},
|
1080
|
+
{
|
1081
|
+
value: 'tokyo',
|
1082
|
+
label: 'Токио',
|
1083
|
+
},
|
1084
|
+
{
|
1085
|
+
value: 'osaka',
|
1086
|
+
label: 'Осака',
|
1087
|
+
},
|
1088
|
+
{
|
1089
|
+
value: 'delhi',
|
1090
|
+
label: 'Дели',
|
1091
|
+
},
|
1092
|
+
{
|
1093
|
+
value: 'mumbai',
|
1094
|
+
label: 'Мумбаи',
|
1095
|
+
},
|
1096
|
+
{
|
1097
|
+
value: 'seoul',
|
1098
|
+
label: 'Сеул',
|
1099
|
+
},
|
1100
|
+
{
|
1101
|
+
value: 'busan',
|
1102
|
+
label: 'Пусан',
|
1103
|
+
},
|
1104
|
+
{
|
1105
|
+
value: 'bangkok',
|
1106
|
+
label: 'Бангкок',
|
1107
|
+
},
|
1108
|
+
{
|
1109
|
+
value: 'phuket',
|
1110
|
+
label: 'Пхукет',
|
1111
|
+
},
|
1112
|
+
{
|
1113
|
+
value: 'africa',
|
1114
|
+
label: 'Африка',
|
1115
|
+
},
|
1116
|
+
];
|
1117
|
+
|
1118
|
+
const SelectAllStory = (args: StorySelectProps) => {
|
1119
|
+
const [value, setValue] = useState([]);
|
1120
|
+
const [checked, setChecked] = useState(false);
|
1121
|
+
const [indeterminate, setIndeterminate] = useState(false);
|
1122
|
+
|
1123
|
+
const handleClick = () => {
|
1124
|
+
if (checked && !indeterminate) {
|
1125
|
+
setValue([]);
|
1126
|
+
} else {
|
1127
|
+
setValue(flatItems.map((item) => item.value));
|
1128
|
+
}
|
1129
|
+
};
|
1130
|
+
|
1131
|
+
React.useEffect(() => {
|
1132
|
+
if (value.length === 0) {
|
1133
|
+
setChecked(false);
|
1134
|
+
setIndeterminate(false);
|
1135
|
+
} else if (value.length === flatItems.length) {
|
1136
|
+
setChecked(true);
|
1137
|
+
setIndeterminate(false);
|
1138
|
+
} else {
|
1139
|
+
setChecked(true);
|
1140
|
+
setIndeterminate(true);
|
1141
|
+
}
|
1142
|
+
}, [value]);
|
1143
|
+
|
1144
|
+
return (
|
1145
|
+
<div style={{ width: '400px' }}>
|
1146
|
+
<Select
|
1147
|
+
placeholder="Placeholder"
|
1148
|
+
multiselect
|
1149
|
+
items={flatItems}
|
1150
|
+
value={value}
|
1151
|
+
onChange={setValue}
|
1152
|
+
listOverflow="auto"
|
1153
|
+
listMaxHeight="300px"
|
1154
|
+
selectAllOptions={{
|
1155
|
+
sticky: args?.selectAllSticky || false,
|
1156
|
+
label: args?.selectAllLabel,
|
1157
|
+
checked,
|
1158
|
+
indeterminate,
|
1159
|
+
onClick: handleClick,
|
1160
|
+
}}
|
1161
|
+
/>
|
1162
|
+
</div>
|
1163
|
+
);
|
1164
|
+
};
|
1165
|
+
|
1166
|
+
export const SelectAll: StoryObj<StorySelectProps> = {
|
1167
|
+
render: (args) => <SelectAllStory {...args} />,
|
1168
|
+
argTypes: {
|
1169
|
+
selectAllSticky: {
|
1170
|
+
control: 'boolean',
|
1171
|
+
},
|
1172
|
+
selectAllLabel: {
|
1173
|
+
control: 'text',
|
1174
|
+
},
|
1175
|
+
},
|
1176
|
+
args: {
|
1177
|
+
selectAllSticky: false,
|
1178
|
+
selectAllLabel: 'Выбрать все',
|
1179
|
+
},
|
1180
|
+
parameters: {
|
1181
|
+
controls: {
|
1182
|
+
include: ['selectAllSticky', 'selectAllLabel'],
|
1183
|
+
},
|
1184
|
+
},
|
1185
|
+
};
|
@@ -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","modif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,EAAEb,KAAK,CAAC,GAAG,KAAK;AACtF0B,QAAAA,aAAa,EAAEC,WAAW,CAACrB,MAAM,CAAC,CAACO,UAAU,CAAC;AAC9Cd,QAAAA,IAAI,EAAE;UAAE0B,IAAI,EAAE1B,IAAI,CAAC0B,IAAI;AAAEZ,UAAAA,UAAU,EAAVA,UAAU;AAAEe,UAAAA,GAAG,EAAE,CAAA;AAAE,SAAA;OAC/C,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,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
|
});
|
@@ -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,CAAhBO,gBAAgB,CAAA;EAAA,OAC1FC,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,CAACjB,IAAI,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;AAEA,IAAA,OAAOM,SAAS,CAAW3B,QAAQ,EAAE,CAAC,CAAC,CAAA;AAC3C,GAAC,EAAE,CAACR,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -15,7 +15,8 @@ var useYears = function useYears(_ref) {
|
|
15
15
|
eventList = _ref.eventList,
|
16
16
|
disabledList = _ref.disabledList,
|
17
17
|
min = _ref.min,
|
18
|
-
max = _ref.max
|
18
|
+
max = _ref.max,
|
19
|
+
includeEdgeDates = _ref.includeEdgeDates;
|
19
20
|
return useMemo(function () {
|
20
21
|
// type-coverage:ignore-next-line
|
21
22
|
var years = Array.from(Array(YEAR_RENDER_COUNT), function (_, i) {
|
@@ -40,6 +41,7 @@ var useYears = function useYears(_ref) {
|
|
40
41
|
type: CalendarState.Years,
|
41
42
|
min: min,
|
42
43
|
max: max,
|
44
|
+
includeEdgeDates: includeEdgeDates,
|
43
45
|
eventList: eventList,
|
44
46
|
disabledList: disabledList
|
45
47
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useYears.js","sources":["../../../../src/components/Calendar/hooks/useYears.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport {\n YEAR_RENDER_COUNT,\n isCurrentYear,\n isSelectedYear,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport type { DateItem } from '../Calendar.types';\nimport { CalendarState } from '../store/types';\n\nimport type { UseYearsArgs } from './types';\n\n/**\n * Хук для получения списка годов.\n */\nexport const useYears = ({
|
1
|
+
{"version":3,"file":"useYears.js","sources":["../../../../src/components/Calendar/hooks/useYears.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport {\n YEAR_RENDER_COUNT,\n isCurrentYear,\n isSelectedYear,\n getMatrix,\n isDateInRange,\n getDatesWithModifications,\n} from '../utils';\nimport type { DateItem } from '../Calendar.types';\nimport { CalendarState } from '../store/types';\n\nimport type { UseYearsArgs } from './types';\n\n/**\n * Хук для получения списка годов.\n */\nexport const useYears = ({\n date,\n value,\n startYear,\n eventList,\n disabledList,\n min,\n max,\n includeEdgeDates,\n}: UseYearsArgs) =>\n useMemo(() => {\n // type-coverage:ignore-next-line\n const years = Array.from(Array(YEAR_RENDER_COUNT), (_, i) => {\n const yearValue = startYear + i;\n\n return {\n isCurrent: isCurrentYear(startYear + i),\n isSelected: Array.isArray(value)\n ? Boolean(value.find((v) => isSelectedYear(yearValue, v)))\n : isSelectedYear(yearValue, value),\n inRange: Array.isArray(value) ? isDateInRange(yearValue, 0, 1, value) : false,\n date: { year: yearValue, monthIndex: 0, day: 1 },\n yearValue,\n };\n });\n\n if (eventList?.length || disabledList?.length || max || min) {\n const modifiedMonths = getDatesWithModifications({\n dates: years,\n type: CalendarState.Years,\n min,\n max,\n includeEdgeDates,\n eventList,\n disabledList,\n });\n return getMatrix<DateItem>(modifiedMonths, 3);\n }\n\n return getMatrix<DateItem>(years, 3);\n }, [date, startYear, value, eventList, disabledList, max, min]);\n"],"names":["useYears","_ref","date","value","startYear","eventList","disabledList","min","max","includeEdgeDates","useMemo","years","Array","from","YEAR_RENDER_COUNT","_","i","yearValue","isCurrent","isCurrentYear","isSelected","isArray","Boolean","find","v","isSelectedYear","inRange","isDateInRange","year","monthIndex","day","length","modifiedMonths","getDatesWithModifications","dates","type","CalendarState","Years","getMatrix"],"mappings":";;;;;;;AAeA;AACA;AACA;IACaA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAA;AAAA,EAAA,IACjBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,SAAS,GAAAJ,IAAA,CAATI,SAAS;IACTC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,GAAG,GAAAN,IAAA,CAAHM,GAAG;IACHC,GAAG,GAAAP,IAAA,CAAHO,G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I,EAAEC,aAAa,CAACC,KAAK;AACzB9B,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,GAAG,EAAHA,GAAG;AACHC,QAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBJ,QAAAA,SAAS,EAATA,SAAS;AACTC,QAAAA,YAAY,EAAZA,YAAAA;AACJ,OAAC,CAAC,CAAA;AACF,MAAA,OAAOgC,SAAS,CAAWN,cAAc,EAAE,CAAC,CAAC,CAAA;AACjD,KAAA;AAEA,IAAA,OAAOM,SAAS,CAAW3B,KAAK,EAAE,CAAC,CAAC,CAAA;AACxC,GAAC,EAAE,CAACT,IAAI,EAAEE,SAAS,EAAED,KAAK,EAAEE,SAAS,EAAEC,YAAY,EAAEE,GAAG,EAAED,GAAG,CAAC,CAAC,CAAA;AAAA;;;;"}
|
@@ -43,7 +43,7 @@ var normalizeDate = function normalizeDate(date, type) {
|
|
43
43
|
date.setMonth(0);
|
44
44
|
}
|
45
45
|
};
|
46
|
-
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
46
|
+
var isDisabledNextDate = function isDisabledNextDate(_ref, type, max, includeEdgeDates) {
|
47
47
|
var year = _ref.year,
|
48
48
|
monthIndex = _ref.monthIndex,
|
49
49
|
day = _ref.day;
|
@@ -55,13 +55,13 @@ var isDisabledNextDate = function isDisabledNextDate(_ref, type, max) {
|
|
55
55
|
var currentDate = new Date(year, monthIndex, day);
|
56
56
|
dateOperationHandler[type].add(currentDate);
|
57
57
|
var isOut = true;
|
58
|
-
while (isOut && currentDate <= maxDate) {
|
59
|
-
isOut = maxDate <= currentDate;
|
58
|
+
while (isOut && includeEdgeDates ? currentDate < maxDate : currentDate <= maxDate) {
|
59
|
+
isOut = includeEdgeDates ? maxDate < currentDate : maxDate <= currentDate;
|
60
60
|
dateOperationHandler[type].add(currentDate);
|
61
61
|
}
|
62
62
|
return isOut;
|
63
63
|
};
|
64
|
-
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
64
|
+
var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min, includeEdgeDates) {
|
65
65
|
var year = _ref2.year,
|
66
66
|
monthIndex = _ref2.monthIndex,
|
67
67
|
day = _ref2.day;
|
@@ -73,54 +73,58 @@ var isDisabledPreviousDate = function isDisabledPreviousDate(_ref2, type, min) {
|
|
73
73
|
var currentDate = new Date(year, monthIndex, day);
|
74
74
|
dateOperationHandler[type].subtract(currentDate);
|
75
75
|
var isOut = true;
|
76
|
-
while (isOut && currentDate >= minDate) {
|
77
|
-
isOut = minDate >= currentDate;
|
76
|
+
while (isOut && includeEdgeDates ? currentDate > minDate : currentDate >= minDate) {
|
77
|
+
isOut = includeEdgeDates ? minDate > currentDate : minDate >= currentDate;
|
78
78
|
dateOperationHandler[type].subtract(currentDate);
|
79
79
|
}
|
80
80
|
return isOut;
|
81
81
|
};
|
82
|
-
var getDisabledDates = function getDisabledDates(list, type, min, max) {
|
82
|
+
var getDisabledDates = function getDisabledDates(list, type, min, max, includeEdgeDates) {
|
83
83
|
var disabledDate = [];
|
84
|
-
if (isDisabledPreviousDate(list[0], type, min)) {
|
84
|
+
if (isDisabledPreviousDate(list[0], type, min, includeEdgeDates)) {
|
85
85
|
disabledDate.push('previous');
|
86
86
|
}
|
87
|
-
if (isDisabledNextDate(list[list.length - 1], type, max)) {
|
87
|
+
if (isDisabledNextDate(list[list.length - 1], type, max, includeEdgeDates)) {
|
88
88
|
disabledDate.push('next');
|
89
89
|
}
|
90
90
|
return disabledDate.join(',');
|
91
91
|
};
|
92
|
-
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min) {
|
92
|
+
var isDisabledArrowLeft = function isDisabledArrowLeft(date, min, includeEdgeDates) {
|
93
93
|
var currentDate = new Date(date);
|
94
94
|
currentDate.setDate(currentDate.getDate() - 1);
|
95
|
-
|
95
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
96
|
+
return disableCondition;
|
96
97
|
};
|
97
|
-
var isDisabledArrowRight = function isDisabledArrowRight(date, max) {
|
98
|
+
var isDisabledArrowRight = function isDisabledArrowRight(date, max, includeEdgeDates) {
|
98
99
|
var currentDate = new Date(date);
|
99
100
|
currentDate.setDate(currentDate.getDate() + 1);
|
100
|
-
|
101
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
102
|
+
return disableCondition;
|
101
103
|
};
|
102
|
-
var isDisabledArrowUp = function isDisabledArrowUp(date, min) {
|
104
|
+
var isDisabledArrowUp = function isDisabledArrowUp(date, min, includeEdgeDates) {
|
103
105
|
var currentDate = new Date(date);
|
104
106
|
currentDate.setDate(date.getDate() - 7);
|
105
|
-
|
107
|
+
var disableCondition = min && (includeEdgeDates ? min > currentDate : min >= currentDate);
|
108
|
+
return disableCondition;
|
106
109
|
};
|
107
|
-
var isDisabledArrowDown = function isDisabledArrowDown(date, max) {
|
110
|
+
var isDisabledArrowDown = function isDisabledArrowDown(date, max, includeEdgeDates) {
|
108
111
|
var currentDate = new Date(date);
|
109
112
|
currentDate.setDate(date.getDate() + 7);
|
110
|
-
|
113
|
+
var disableCondition = max && (includeEdgeDates ? max < currentDate : max <= currentDate);
|
114
|
+
return disableCondition;
|
111
115
|
};
|
112
|
-
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max) {
|
116
|
+
var getDisabledArrowKey = function getDisabledArrowKey(currentDate, min, max, includeEdgeDates) {
|
113
117
|
var disabledArrowKey = [];
|
114
|
-
if (isDisabledArrowLeft(currentDate, min)) {
|
118
|
+
if (isDisabledArrowLeft(currentDate, min, includeEdgeDates)) {
|
115
119
|
disabledArrowKey.push('left');
|
116
120
|
}
|
117
|
-
if (isDisabledArrowRight(currentDate, max)) {
|
121
|
+
if (isDisabledArrowRight(currentDate, max, includeEdgeDates)) {
|
118
122
|
disabledArrowKey.push('right');
|
119
123
|
}
|
120
|
-
if (isDisabledArrowDown(currentDate, max)) {
|
124
|
+
if (isDisabledArrowDown(currentDate, max, includeEdgeDates)) {
|
121
125
|
disabledArrowKey.push('down');
|
122
126
|
}
|
123
|
-
if (isDisabledArrowUp(currentDate, min)) {
|
127
|
+
if (isDisabledArrowUp(currentDate, min, includeEdgeDates)) {
|
124
128
|
disabledArrowKey.push('up');
|
125
129
|
}
|
126
130
|
return disabledArrowKey.join(',');
|
@@ -149,7 +153,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
149
153
|
var date = _ref5.date;
|
150
154
|
return date;
|
151
155
|
});
|
152
|
-
var disabledDates = getDisabledDates(datesList, type, min, max);
|
156
|
+
var disabledDates = getDisabledDates(datesList, type, min, max, includeEdgeDates);
|
153
157
|
return dates.map(function (dateItem) {
|
154
158
|
var date = dateItem.date;
|
155
159
|
var year = date.year,
|
@@ -174,7 +178,7 @@ var getDatesWithModifications = function getDatesWithModifications(_ref3) {
|
|
174
178
|
dateItem.events = eventsMap.get(keyDate);
|
175
179
|
dateItem.disabled = disabledDatesMap.has(keyDate) || isOutOfMinMaxRange;
|
176
180
|
dateItem.isOutOfMinMaxRange = isOutOfMinMaxRange;
|
177
|
-
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max);
|
181
|
+
dateItem.disabledArrowKey = getDisabledArrowKey(currentDate, min, max, includeEdgeDates);
|
178
182
|
dateItem.disabledDates = disabledDates;
|
179
183
|
return dateItem;
|
180
184
|
});
|
@@ -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 = ({ 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,IAAI,CAACC,OAAO,CAACD,IAAI,CAACE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAA;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M0C,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;;;;"}
|
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,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