@alfalab/core-components-calendar-range 7.8.21 → 8.0.0-snapshot-133b390
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/Component.d.ts +3 -4
- package/Component.js +4 -3
- package/Component.js.map +1 -0
- package/components/divider/Component.d.ts +4 -4
- package/components/divider/Component.js +3 -4
- package/components/divider/Component.js.map +1 -0
- package/components/divider/index.css +11 -54
- package/components/divider/index.d.ts +1 -1
- package/components/divider/index.js +3 -2
- package/components/divider/index.js.map +1 -0
- package/components/divider/index.module.css.js +8 -0
- package/components/divider/index.module.css.js.map +1 -0
- package/cssm/Component.d.ts +3 -4
- package/cssm/Component.js +4 -3
- package/cssm/Component.js.map +1 -0
- package/cssm/components/divider/Component.d.ts +4 -4
- package/cssm/components/divider/Component.js +1 -0
- package/cssm/components/divider/Component.js.map +1 -0
- package/cssm/components/divider/index.d.ts +1 -1
- package/cssm/components/divider/index.js +3 -2
- package/cssm/components/divider/index.js.map +1 -0
- package/cssm/components/divider/index.module.css +4 -46
- package/cssm/hooks.d.ts +3 -4
- package/cssm/hooks.js +1 -0
- package/cssm/hooks.js.map +1 -0
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +1 -0
- package/cssm/index.js.map +1 -0
- package/cssm/shared/index.d.ts +1 -1
- package/cssm/shared/index.js +1 -0
- package/cssm/shared/index.js.map +1 -0
- package/cssm/utils.d.ts +2 -3
- package/cssm/utils.js +4 -3
- package/cssm/utils.js.map +1 -0
- package/cssm/views/index.module.css +3 -44
- package/cssm/views/popover.d.ts +3 -4
- package/cssm/views/popover.js +14 -13
- package/cssm/views/popover.js.map +1 -0
- package/cssm/views/static.d.ts +3 -4
- package/cssm/views/static.js +17 -16
- package/cssm/views/static.js.map +1 -0
- package/esm/Component.d.ts +3 -4
- package/esm/Component.js +1 -0
- package/esm/Component.js.map +1 -0
- package/esm/components/divider/Component.d.ts +4 -4
- package/esm/components/divider/Component.js +2 -3
- package/esm/components/divider/Component.js.map +1 -0
- package/esm/components/divider/index.css +11 -54
- package/esm/components/divider/index.d.ts +1 -1
- package/esm/components/divider/index.js +1 -0
- package/esm/components/divider/index.js.map +1 -0
- package/esm/components/divider/index.module.css.js +6 -0
- package/esm/components/divider/index.module.css.js.map +1 -0
- package/esm/hooks.d.ts +3 -4
- package/esm/hooks.js +1 -0
- package/esm/hooks.js.map +1 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -0
- package/esm/shared/index.d.ts +1 -1
- package/esm/shared/index.js +1 -0
- package/esm/shared/index.js.map +1 -0
- package/esm/utils.d.ts +2 -3
- package/esm/utils.js +1 -0
- package/esm/utils.js.map +1 -0
- package/esm/views/index.css +10 -52
- package/esm/views/index.module.css.js +6 -0
- package/esm/views/index.module.css.js.map +1 -0
- package/esm/views/popover.d.ts +3 -4
- package/esm/views/popover.js +2 -1
- package/esm/views/popover.js.map +1 -0
- package/esm/views/static.d.ts +3 -4
- package/esm/views/static.js +2 -1
- package/esm/views/static.js.map +1 -0
- package/hooks.d.ts +3 -4
- package/hooks.js +1 -0
- package/hooks.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/modern/Component.d.ts +3 -4
- package/modern/Component.js +1 -0
- package/modern/Component.js.map +1 -0
- package/modern/components/divider/Component.d.ts +4 -4
- package/modern/components/divider/Component.js +2 -3
- package/modern/components/divider/Component.js.map +1 -0
- package/modern/components/divider/index.css +11 -54
- package/modern/components/divider/index.d.ts +1 -1
- package/modern/components/divider/index.js +1 -0
- package/modern/components/divider/index.js.map +1 -0
- package/modern/components/divider/index.module.css.js +6 -0
- package/modern/components/divider/index.module.css.js.map +1 -0
- package/modern/hooks.d.ts +3 -4
- package/modern/hooks.js +1 -0
- package/modern/hooks.js.map +1 -0
- package/modern/index.d.ts +1 -1
- package/modern/index.js +1 -0
- package/modern/index.js.map +1 -0
- package/modern/shared/index.d.ts +1 -1
- package/modern/shared/index.js +1 -0
- package/modern/shared/index.js.map +1 -0
- package/modern/utils.d.ts +2 -3
- package/modern/utils.js +1 -0
- package/modern/utils.js.map +1 -0
- package/modern/views/index.css +10 -52
- package/modern/views/index.module.css.js +6 -0
- package/modern/views/index.module.css.js.map +1 -0
- package/modern/views/popover.d.ts +3 -4
- package/modern/views/popover.js +2 -1
- package/modern/views/popover.js.map +1 -0
- package/modern/views/static.d.ts +3 -4
- package/modern/views/static.js +2 -1
- package/modern/views/static.js.map +1 -0
- package/moderncssm/Component.d.ts +3 -4
- package/moderncssm/Component.js +1 -0
- package/moderncssm/Component.js.map +1 -0
- package/moderncssm/components/divider/Component.d.ts +4 -4
- package/moderncssm/components/divider/Component.js +1 -0
- package/moderncssm/components/divider/Component.js.map +1 -0
- package/moderncssm/components/divider/index.d.ts +1 -1
- package/moderncssm/components/divider/index.js +1 -0
- package/moderncssm/components/divider/index.js.map +1 -0
- package/moderncssm/components/divider/index.module.css +0 -25
- package/moderncssm/hooks.d.ts +3 -4
- package/moderncssm/hooks.js +1 -0
- package/moderncssm/hooks.js.map +1 -0
- package/moderncssm/index.d.ts +1 -1
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.js.map +1 -0
- package/moderncssm/shared/index.d.ts +1 -1
- package/moderncssm/shared/index.js +1 -0
- package/moderncssm/shared/index.js.map +1 -0
- package/moderncssm/utils.d.ts +2 -3
- package/moderncssm/utils.js +1 -0
- package/moderncssm/utils.js.map +1 -0
- package/moderncssm/views/index.module.css +0 -21
- package/moderncssm/views/popover.d.ts +3 -4
- package/moderncssm/views/popover.js +1 -0
- package/moderncssm/views/popover.js.map +1 -0
- package/moderncssm/views/static.d.ts +3 -4
- package/moderncssm/views/static.js +1 -0
- package/moderncssm/views/static.js.map +1 -0
- package/package.json +7 -7
- package/shared/index.d.ts +1 -1
- package/shared/index.js +1 -0
- package/shared/index.js.map +1 -0
- package/src/components/divider/index.module.css +1 -1
- package/src/views/index.module.css +1 -1
- package/utils.d.ts +2 -3
- package/utils.js +1 -0
- package/utils.js.map +1 -0
- package/views/index.css +10 -52
- package/views/index.module.css.js +8 -0
- package/views/index.module.css.js.map +1 -0
- package/views/popover.d.ts +3 -4
- package/views/popover.js +5 -4
- package/views/popover.js.map +1 -0
- package/views/static.d.ts +3 -4
- package/views/static.js +8 -7
- package/views/static.js.map +1 -0
- package/esm/index.module-0ba13850.js +0 -4
- package/index.module-c8388a07.js +0 -6
- package/modern/index.module-af38fcf5.js +0 -4
|
@@ -1,52 +1,11 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root {
|
|
6
|
-
|
|
7
|
-
/* Hard */
|
|
8
|
-
|
|
9
|
-
/* Up */
|
|
10
|
-
|
|
11
|
-
/* Hard up */
|
|
12
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
13
|
-
|
|
14
|
-
/* новые значения, используйте их */
|
|
15
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */
|
|
16
|
-
--gap-s: 12px; /* deprecated */ /* deprecated */
|
|
17
|
-
--gap-m: 16px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
18
|
-
|
|
19
|
-
/* новые значения, используйте их */
|
|
20
|
-
|
|
21
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
22
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
1
|
+
:root {
|
|
2
|
+
--gap-s: 12px;
|
|
3
|
+
--gap-m: 16px;
|
|
23
4
|
--gap-0: 0px;
|
|
24
5
|
--gap-12: var(--gap-s);
|
|
25
6
|
--gap-16: var(--gap-m);
|
|
26
7
|
} :root {
|
|
27
|
-
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
28
|
-
} /* сбрасывает синюю подсветку при нажатии */ :root {
|
|
29
8
|
--calendar-inner-width: 280px;
|
|
30
|
-
|
|
31
|
-
/* Кнопки выбора месяцев и годов */
|
|
32
|
-
|
|
33
|
-
/* Шапка */
|
|
34
|
-
|
|
35
|
-
/* День */
|
|
36
|
-
|
|
37
|
-
/* today */
|
|
38
|
-
|
|
39
|
-
/* highlighted */
|
|
40
|
-
|
|
41
|
-
/* holidays */
|
|
42
|
-
|
|
43
|
-
/* range */
|
|
44
|
-
|
|
45
|
-
/* selected */
|
|
46
|
-
|
|
47
|
-
/* disabled */
|
|
48
|
-
|
|
49
|
-
/* marker */
|
|
50
9
|
} .component {
|
|
51
10
|
display: flex
|
|
52
11
|
} .component button[aria-selected='true'] {
|
package/cssm/views/popover.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { CalendarRangeProps } from
|
|
3
|
-
type CalendarRangePopoverProps = Omit<CalendarRangeProps, 'calendarPosition'>;
|
|
4
|
-
declare const CalendarRangePopover: FC<CalendarRangePopoverProps>;
|
|
5
|
-
export { CalendarRangePopoverProps, CalendarRangePopover };
|
|
2
|
+
import { CalendarRangeProps } from '../Component';
|
|
3
|
+
export declare type CalendarRangePopoverProps = Omit<CalendarRangeProps, 'calendarPosition'>;
|
|
4
|
+
export declare const CalendarRangePopover: FC<CalendarRangePopoverProps>;
|
package/cssm/views/popover.js
CHANGED
|
@@ -6,11 +6,11 @@ var tslib = require('tslib');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var cn = require('classnames');
|
|
8
8
|
var startOfMonth = require('date-fns/startOfMonth');
|
|
9
|
-
var
|
|
9
|
+
var cssm$1 = require('@alfalab/core-components-calendar-input/cssm');
|
|
10
10
|
var shared = require('@alfalab/core-components-calendar-input/cssm/shared');
|
|
11
|
-
var
|
|
11
|
+
var cssm = require('@alfalab/core-components-date-input/cssm');
|
|
12
12
|
var hooks$1 = require('@alfalab/hooks');
|
|
13
|
-
var
|
|
13
|
+
var Component = require('../components/divider/Component.js');
|
|
14
14
|
var hooks = require('../hooks.js');
|
|
15
15
|
var styles = require('./index.module.css');
|
|
16
16
|
|
|
@@ -37,10 +37,10 @@ var CalendarRangePopover = function (_a) {
|
|
|
37
37
|
var dateTo = shared.isValidInputValue(inputToValue, dateFrom || minDate, maxDate, offDays)
|
|
38
38
|
? shared.parseDateString(inputToValue).getTime()
|
|
39
39
|
: null;
|
|
40
|
-
var _p = React.useState(
|
|
41
|
-
var _q = React.useState(
|
|
42
|
-
var bothInvalid =
|
|
43
|
-
|
|
40
|
+
var _p = React.useState(cssm.isCompleteDateInput(inputFromValue) && dateFrom === null), inputFromInvalid = _p[0], setInputFromInvalid = _p[1];
|
|
41
|
+
var _q = React.useState(cssm.isCompleteDateInput(inputToValue) && dateTo === null), inputToInvalid = _q[0], setInputToInvalid = _q[1];
|
|
42
|
+
var bothInvalid = cssm.isCompleteDateInput(inputFromValue) &&
|
|
43
|
+
cssm.isCompleteDateInput(inputToValue) &&
|
|
44
44
|
shared.parseDateString(inputFromValue).getTime() > shared.parseDateString(inputToValue).getTime();
|
|
45
45
|
var hasValidateError = inputFromInvalid || inputToInvalid || bothInvalid;
|
|
46
46
|
var _r = hooks.usePopoverViewMonthes({
|
|
@@ -94,7 +94,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
94
94
|
dateFrom: dateFrom,
|
|
95
95
|
dateTo: dateTo,
|
|
96
96
|
});
|
|
97
|
-
if (!inputFromValue ||
|
|
97
|
+
if (!inputFromValue || cssm.isCompleteDateInput(inputFromValue)) {
|
|
98
98
|
handleValidInputFrom();
|
|
99
99
|
}
|
|
100
100
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -103,7 +103,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
103
103
|
onDateToChange({ value: inputToValue, date: dateTo });
|
|
104
104
|
// eslint-disable-next-line no-nested-ternary
|
|
105
105
|
var inputDateTo = returnInvalidDates
|
|
106
|
-
?
|
|
106
|
+
? cssm.isCompleteDateInput(inputToValue)
|
|
107
107
|
? shared.parseDateString(inputToValue).getTime()
|
|
108
108
|
: null
|
|
109
109
|
: dateTo;
|
|
@@ -113,7 +113,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
113
113
|
dateFrom: dateFrom,
|
|
114
114
|
dateTo: inputDateTo,
|
|
115
115
|
});
|
|
116
|
-
if (!inputToValue ||
|
|
116
|
+
if (!inputToValue || cssm.isCompleteDateInput(inputToValue)) {
|
|
117
117
|
handleValidInputTo();
|
|
118
118
|
}
|
|
119
119
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -125,9 +125,10 @@ var CalendarRangePopover = function (_a) {
|
|
|
125
125
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
126
126
|
}, [hasValidateError]);
|
|
127
127
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className), "data-test-id": dataTestId },
|
|
128
|
-
React__default.default.createElement(
|
|
129
|
-
React__default.default.createElement(
|
|
130
|
-
React__default.default.createElement(
|
|
128
|
+
React__default.default.createElement(cssm$1.CalendarInput, tslib.__assign({}, inputFromProps, { useAnchorWidth: false, calendarPosition: 'popover', popoverPosition: 'bottom-start', error: inputFromInvalid || bothInvalid || inputFromProps.error, onChange: handleFromChange, onInputChange: handleInputFromChange, onBlur: handleInputFromBlur, value: inputFromValue, minDate: minDate, maxDate: maxDate, offDays: offDays, events: events, calendarProps: tslib.__assign(tslib.__assign({}, inputFromProps.calendarProps), { month: monthFrom, onMonthChange: handleMonthFromChange, selectorView: 'full' }) })),
|
|
129
|
+
React__default.default.createElement(Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
130
|
+
React__default.default.createElement(cssm$1.CalendarInput, tslib.__assign({}, inputToProps, { useAnchorWidth: false, calendarPosition: 'popover', popoverPosition: 'bottom-end', error: inputToInvalid || bothInvalid || inputToProps.error, onChange: handleToChange, onInputChange: handleInputToChange, onBlur: handleInputToBlur, value: inputToValue, minDate: dateFrom || minDate, maxDate: maxDate, offDays: offDays, events: events, calendarProps: tslib.__assign(tslib.__assign({}, inputToProps.calendarProps), { month: monthTo, onMonthChange: handleMonthToChange, selectorView: 'full' }) }))));
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
exports.CalendarRangePopover = CalendarRangePopover;
|
|
134
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../src/views/popover.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useState } from 'react';\nimport cn from 'classnames';\nimport startOfMonth from 'date-fns/startOfMonth';\n\nimport { CalendarInput, CalendarInputProps } from '@alfalab/core-components-calendar-input';\nimport { isValidInputValue, parseDateString } from '@alfalab/core-components-calendar-input/shared';\nimport { isCompleteDateInput } from '@alfalab/core-components-date-input';\nimport { useDidUpdateEffect } from '@alfalab/hooks';\n\nimport { CalendarRangeProps } from '../Component';\nimport { Divider } from '../components/divider';\nimport { usePopoverViewMonthes } from '../hooks';\n\nimport styles from './index.module.css';\n\nexport type CalendarRangePopoverProps = Omit<CalendarRangeProps, 'calendarPosition'>;\n\nexport const CalendarRangePopover: FC<CalendarRangePopoverProps> = ({\n className,\n defaultMonth = startOfMonth(new Date()).getTime(),\n minDate,\n maxDate,\n valueFrom = '',\n valueTo = '',\n onDateFromChange = () => null,\n onDateToChange = () => null,\n onChange = () => null,\n onError,\n inputFromProps = {},\n inputToProps = {},\n offDays,\n events,\n returnInvalidDates = false,\n dataTestId,\n}) => {\n const [inputFromValue, setInputFromValue] = useState<string>(valueFrom);\n const [inputToValue, setInputToValue] = useState<string>(valueTo);\n\n /**\n * Ключ для сброса календарей\n * Пользователь открыл календарь, изменил месяц, но ничего не выбрал\n * — при следующем открытии в календаре будет установлен начальный месяц\n */\n const [resetKey, setResetKey] = useState<number>(0);\n\n const dateFrom = isValidInputValue(inputFromValue, minDate, maxDate, offDays)\n ? parseDateString(inputFromValue).getTime()\n : null;\n\n const dateTo = isValidInputValue(inputToValue, dateFrom || minDate, maxDate, offDays)\n ? parseDateString(inputToValue).getTime()\n : null;\n\n const [inputFromInvalid, setInputFromInvalid] = useState<boolean>(\n isCompleteDateInput(inputFromValue) && dateFrom === null,\n );\n const [inputToInvalid, setInputToInvalid] = useState<boolean>(\n isCompleteDateInput(inputToValue) && dateTo === null,\n );\n\n const bothInvalid =\n isCompleteDateInput(inputFromValue) &&\n isCompleteDateInput(inputToValue) &&\n parseDateString(inputFromValue).getTime() > parseDateString(inputToValue).getTime();\n\n const hasValidateError = inputFromInvalid || inputToInvalid || bothInvalid;\n\n const { monthFrom, monthTo, handleMonthFromChange, handleMonthToChange } =\n usePopoverViewMonthes({\n dateFrom,\n dateTo,\n defaultMonth,\n resetKey,\n });\n\n const handleValidInputFrom = useCallback(() => {\n setInputFromInvalid(\n inputFromValue !== '' && !isValidInputValue(inputFromValue, minDate, maxDate, offDays),\n );\n }, [inputFromValue, maxDate, minDate, offDays]);\n\n const handleValidInputTo = useCallback(() => {\n setInputToInvalid(\n inputToValue !== '' &&\n !isValidInputValue(inputToValue, dateFrom || minDate, maxDate, offDays),\n );\n }, [dateFrom, inputToValue, maxDate, minDate, offDays]);\n\n const handleInputFromChange: Required<CalendarInputProps>['onInputChange'] = (\n event,\n payload,\n ) => {\n setInputFromValue(payload.value);\n inputFromProps.onInputChange?.(event, payload);\n };\n\n const handleInputToChange: Required<CalendarInputProps>['onInputChange'] = (event, payload) => {\n setInputToValue(payload.value);\n inputToProps.onInputChange?.(event, payload);\n };\n\n const handleInputFromBlur = useCallback(() => {\n handleValidInputFrom();\n setResetKey(+new Date());\n }, [handleValidInputFrom]);\n\n const handleInputToBlur = useCallback(() => {\n handleValidInputTo();\n setResetKey(+new Date());\n }, [handleValidInputTo]);\n\n const handleFromChange: Required<CalendarInputProps>['onChange'] = useCallback((_, payload) => {\n setInputFromValue(payload.value);\n }, []);\n\n const handleToChange: Required<CalendarInputProps>['onChange'] = useCallback((_, payload) => {\n setInputToValue(payload.value);\n }, []);\n\n useEffect(() => {\n setInputFromValue(valueFrom);\n }, [valueFrom]);\n\n useEffect(() => {\n setInputToValue(valueTo);\n }, [valueTo]);\n\n useDidUpdateEffect(() => {\n onDateFromChange({ value: inputFromValue, date: dateFrom });\n\n onChange({\n valueFrom: inputFromValue,\n valueTo: inputToValue,\n dateFrom,\n dateTo,\n });\n\n if (!inputFromValue || isCompleteDateInput(inputFromValue)) {\n handleValidInputFrom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputFromValue]);\n\n useDidUpdateEffect(() => {\n onDateToChange({ value: inputToValue, date: dateTo });\n\n // eslint-disable-next-line no-nested-ternary\n const inputDateTo = returnInvalidDates\n ? isCompleteDateInput(inputToValue)\n ? parseDateString(inputToValue).getTime()\n : null\n : dateTo;\n\n onChange({\n valueFrom: inputFromValue,\n valueTo: inputToValue,\n dateFrom,\n dateTo: inputDateTo,\n });\n\n if (!inputToValue || isCompleteDateInput(inputToValue)) {\n handleValidInputTo();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputToValue]);\n\n useEffect(() => {\n if (onError) {\n onError(hasValidateError);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hasValidateError]);\n\n return (\n <div className={cn(styles.component, className)} data-test-id={dataTestId}>\n <CalendarInput\n {...inputFromProps}\n useAnchorWidth={false}\n calendarPosition='popover'\n popoverPosition='bottom-start'\n error={inputFromInvalid || bothInvalid || inputFromProps.error}\n onChange={handleFromChange}\n onInputChange={handleInputFromChange}\n onBlur={handleInputFromBlur}\n value={inputFromValue}\n minDate={minDate}\n maxDate={maxDate}\n offDays={offDays}\n events={events}\n calendarProps={{\n ...inputFromProps.calendarProps,\n month: monthFrom,\n onMonthChange: handleMonthFromChange,\n selectorView: 'full',\n }}\n />\n\n <Divider inputFromProps={inputFromProps} inputToProps={inputToProps} />\n\n <CalendarInput\n {...inputToProps}\n useAnchorWidth={false}\n calendarPosition='popover'\n popoverPosition='bottom-end'\n error={inputToInvalid || bothInvalid || inputToProps.error}\n onChange={handleToChange}\n onInputChange={handleInputToChange}\n onBlur={handleInputToBlur}\n value={inputToValue}\n minDate={dateFrom || minDate}\n maxDate={maxDate}\n offDays={offDays}\n events={events}\n calendarProps={{\n ...inputToProps.calendarProps,\n month: monthTo,\n onMonthChange: handleMonthToChange,\n selectorView: 'full',\n }}\n />\n </div>\n );\n};\n"],"names":["startOfMonth","useState","isValidInputValue","parseDateString","isCompleteDateInput","usePopoverViewMonthes","useCallback","useEffect","useDidUpdateEffect","React","cn","styles","CalendarInput","__assign","Divider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiBO,IAAM,oBAAoB,GAAkC,UAAC,EAiBnE,EAAA;QAhBG,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,EAAiD,GAAA,EAAA,CAAA,YAAA,EAAjD,YAAY,GAAG,EAAA,KAAA,MAAA,GAAAA,6BAAY,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,GAAA,EAAA,EACjD,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,EAAA,GAAA,EAAA,CAAA,SAAc,EAAd,SAAS,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,GAAA,EAAA,EACd,eAAY,EAAZ,OAAO,GAAG,EAAA,KAAA,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EAAA,CAAA,CAAA;QAEFJ,sBAAC,CAAA,aAAA,CAAAK,iBAAO,IAAC,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAI,CAAA;AAEvE,QAAAL,sBAAA,CAAA,aAAA,CAACG,oBAAa,EACNC,cAAA,CAAA,EAAA,EAAA,YAAY,EAChB,EAAA,cAAc,EAAE,KAAK,EACrB,gBAAgB,EAAC,SAAS,EAC1B,eAAe,EAAC,YAAY,EAC5B,KAAK,EAAE,cAAc,IAAI,WAAW,IAAI,YAAY,CAAC,KAAK,EAC1D,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,mBAAmB,EAClC,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,QAAQ,IAAI,OAAO,EAC5B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EACNA,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAA,YAAY,CAAC,aAAa,CAAA,EAAA,EAC7B,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,mBAAmB,EAClC,YAAY,EAAE,MAAM,EAE1B,CAAA,EAAA,CAAA,CAAA,CACA;AAEd;;;;"}
|
package/cssm/views/static.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { CalendarRangeProps } from
|
|
3
|
-
type CalendarRangeStaticProps = Omit<CalendarRangeProps, 'calendarPosition'> & {
|
|
2
|
+
import { CalendarRangeProps } from '../Component';
|
|
3
|
+
export declare type CalendarRangeStaticProps = Omit<CalendarRangeProps, 'calendarPosition'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Отображать начальный месяц слева или справа (влияет только на начальный рендер)
|
|
6
6
|
*/
|
|
7
7
|
defaultMonthPosition?: 'left' | 'right';
|
|
8
8
|
};
|
|
9
|
-
declare const CalendarRangeStatic: FC<CalendarRangeStaticProps>;
|
|
10
|
-
export { CalendarRangeStaticProps, CalendarRangeStatic };
|
|
9
|
+
export declare const CalendarRangeStatic: FC<CalendarRangeStaticProps>;
|
package/cssm/views/static.js
CHANGED
|
@@ -14,9 +14,9 @@ var subMonths = require('date-fns/subMonths');
|
|
|
14
14
|
var desktop = require('@alfalab/core-components-calendar/cssm/desktop');
|
|
15
15
|
var shared$1 = require('@alfalab/core-components-calendar/cssm/shared');
|
|
16
16
|
var shared = require('@alfalab/core-components-calendar-input/cssm/shared');
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
17
|
+
var cssm = require('@alfalab/core-components-date-input/cssm');
|
|
18
|
+
var cssm$1 = require('@alfalab/core-components-shared/cssm');
|
|
19
|
+
var Component = require('../components/divider/Component.js');
|
|
20
20
|
var hooks = require('../hooks.js');
|
|
21
21
|
var utils = require('../utils.js');
|
|
22
22
|
var styles = require('./index.module.css');
|
|
@@ -43,11 +43,11 @@ var CalendarRangeStatic = function (_a) {
|
|
|
43
43
|
var dateTo = shared.isValidInputValue(inputToValue, dateFrom || minDate, maxDate, offDays)
|
|
44
44
|
? shared.parseDateString(inputToValue).getTime()
|
|
45
45
|
: null;
|
|
46
|
-
if (
|
|
46
|
+
if (cssm.isCompleteDateInput(inputToValue) && !dateTo && !returnInvalidDates) {
|
|
47
47
|
dateFrom = null;
|
|
48
48
|
}
|
|
49
|
-
var bothInvalid =
|
|
50
|
-
|
|
49
|
+
var bothInvalid = cssm.isCompleteDateInput(inputFromValue) &&
|
|
50
|
+
cssm.isCompleteDateInput(inputToValue) &&
|
|
51
51
|
shared.parseDateString(inputFromValue).getTime() > shared.parseDateString(inputToValue).getTime();
|
|
52
52
|
var _p = React.useState(undefined), highlightedDate = _p[0], setHighlightedDate = _p[1];
|
|
53
53
|
var period = shared$1.usePeriodWithReset({
|
|
@@ -56,8 +56,8 @@ var CalendarRangeStatic = function (_a) {
|
|
|
56
56
|
});
|
|
57
57
|
var validateInputFromValue = React.useCallback(function (value) { return shared.isValidInputValue(value, minDate, dateFrom || maxDate, offDays); }, [dateFrom, maxDate, minDate, offDays]);
|
|
58
58
|
var validateInputToValue = React.useCallback(function (value) { return shared.isValidInputValue(value, dateFrom || minDate, maxDate, offDays); }, [dateFrom, minDate, maxDate, offDays]);
|
|
59
|
-
var _q = React.useState(
|
|
60
|
-
var _r = React.useState(
|
|
59
|
+
var _q = React.useState(cssm.isCompleteDateInput(inputFromValue) && dateFrom === null), inputFromInvalid = _q[0], setInputFromInvalid = _q[1];
|
|
60
|
+
var _r = React.useState(cssm.isCompleteDateInput(inputToValue) && dateTo === null), inputToInvalid = _r[0], setInputToInvalid = _r[1];
|
|
61
61
|
var hasValidateError = bothInvalid || inputFromInvalid || inputToInvalid;
|
|
62
62
|
var calendarFromProps = inputFromProps.calendarProps, onInputChangeFrom = inputFromProps.onInputChange, dateInputFromProps = tslib.__rest(inputFromProps, ["calendarProps", "onInputChange"]);
|
|
63
63
|
var calendarToProps = inputToProps.calendarProps, onInputChangeTo = inputToProps.onInputChange, dateInputToProps = tslib.__rest(inputToProps, ["calendarProps", "onInputChange"]);
|
|
@@ -112,7 +112,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
112
112
|
setInputToValue(valueTo);
|
|
113
113
|
}, [valueTo]);
|
|
114
114
|
React.useEffect(function () {
|
|
115
|
-
if (!inputFromValue ||
|
|
115
|
+
if (!inputFromValue || cssm.isCompleteDateInput(inputFromValue)) {
|
|
116
116
|
handleValidInputFrom();
|
|
117
117
|
}
|
|
118
118
|
period.setStart(dateFrom || undefined);
|
|
@@ -134,7 +134,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
134
134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
135
|
}, [inputFromValue]);
|
|
136
136
|
React.useEffect(function () {
|
|
137
|
-
if (!inputToValue ||
|
|
137
|
+
if (!inputToValue || cssm.isCompleteDateInput(inputToValue)) {
|
|
138
138
|
handleValidInputTo();
|
|
139
139
|
}
|
|
140
140
|
period.setEnd(dateTo || undefined);
|
|
@@ -144,7 +144,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
144
144
|
if (inputToValue !== valueTo) {
|
|
145
145
|
// eslint-disable-next-line no-nested-ternary
|
|
146
146
|
var inputDateTo = returnInvalidDates
|
|
147
|
-
?
|
|
147
|
+
? cssm.isCompleteDateInput(inputToValue)
|
|
148
148
|
? shared.parseDateString(inputToValue).getTime()
|
|
149
149
|
: null
|
|
150
150
|
: dateTo;
|
|
@@ -175,23 +175,24 @@ var CalendarRangeStatic = function (_a) {
|
|
|
175
175
|
// eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
176
176
|
React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, styles__default.default.static, className), onMouseOver: handleMouseOver, "data-test-id": dataTestId },
|
|
177
177
|
React__default.default.createElement("div", null,
|
|
178
|
-
React__default.default.createElement(
|
|
178
|
+
React__default.default.createElement(cssm.DateInput, tslib.__assign({}, dateInputFromProps, { mobileMode: dateInputFromProps.mobileMode === 'popover'
|
|
179
179
|
? 'input'
|
|
180
180
|
: dateInputFromProps.mobileMode, value: inputFromValue, onChange: handleInputFromChange, onClear: handleClearFrom, onBlur: handleValidInputFrom, error: bothInvalid || inputFromInvalid || dateInputFromProps.error, clear: true, block: true })),
|
|
181
|
-
React__default.default.createElement("div", { className: cn__default.default(styles__default.default.calendarContainer, calendarContainerClassName), "data-test-id":
|
|
181
|
+
React__default.default.createElement("div", { className: cn__default.default(styles__default.default.calendarContainer, calendarContainerClassName), "data-test-id": cssm$1.getDataTestId(dataTestId, 'container-from') },
|
|
182
182
|
React__default.default.createElement(CalendarFromComponent, tslib.__assign({}, calendarFromProps, { className: cn__default.default(styles__default.default.calendar, calendarFromProps === null || calendarFromProps === void 0 ? void 0 : calendarFromProps.className), month: monthFrom, selectorView: 'month-only', offDays: offDays, events: events, onChange: period.updatePeriod, onMonthChange: handleMonthFromChange, minDate: minDate, maxDate: minMaxInSameMonth
|
|
183
183
|
? maxDate
|
|
184
184
|
: maxDate &&
|
|
185
185
|
max__default.default([maxDate, endOfMonth__default.default(subMonths__default.default(maxDate, 1))]).getTime() }, rangeProps)))),
|
|
186
|
-
React__default.default.createElement(
|
|
186
|
+
React__default.default.createElement(Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
187
187
|
React__default.default.createElement("div", null,
|
|
188
|
-
React__default.default.createElement(
|
|
188
|
+
React__default.default.createElement(cssm.DateInput, tslib.__assign({}, dateInputToProps, { mobileMode: dateInputToProps.mobileMode === 'popover'
|
|
189
189
|
? 'input'
|
|
190
190
|
: dateInputToProps.mobileMode, value: inputToValue, onChange: handleInputToChange, onClear: handleClearTo, onBlur: handleValidInputTo, error: bothInvalid || inputToInvalid || dateInputToProps.error, clear: true, block: true })),
|
|
191
|
-
React__default.default.createElement("div", { "data-test-id":
|
|
191
|
+
React__default.default.createElement("div", { "data-test-id": cssm$1.getDataTestId(dataTestId, 'container-to') },
|
|
192
192
|
React__default.default.createElement(CalendarToComponent, tslib.__assign({}, calendarToProps, { className: cn__default.default(styles__default.default.calendar, calendarToProps === null || calendarToProps === void 0 ? void 0 : calendarToProps.className), month: monthTo, selectorView: 'month-only', offDays: offDays, events: events, onChange: period.updatePeriod, onMonthChange: handleMonthToChange, minDate: minMaxInSameMonth
|
|
193
193
|
? minDate
|
|
194
194
|
: minDate && startOfMonth__default.default(addMonths__default.default(minDate, 1)).getTime(), maxDate: maxDate }, rangeProps))))));
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
exports.CalendarRangeStatic = CalendarRangeStatic;
|
|
198
|
+
//# sourceMappingURL=static.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static.js","sources":["../../src/views/static.tsx"],"sourcesContent":["/* eslint-disable complexity */\nimport React, { FC, MouseEvent, useCallback, useEffect, useState } from 'react';\nimport cn from 'classnames';\nimport addMonths from 'date-fns/addMonths';\nimport endOfMonth from 'date-fns/endOfMonth';\nimport isSameMonth from 'date-fns/isSameMonth';\nimport max from 'date-fns/max';\nimport startOfMonth from 'date-fns/startOfMonth';\nimport subMonths from 'date-fns/subMonths';\n\nimport { CalendarDesktop } from '@alfalab/core-components-calendar/desktop';\nimport { usePeriodWithReset } from '@alfalab/core-components-calendar/shared';\nimport {\n formatDate,\n isValidInputValue,\n parseDateString,\n} from '@alfalab/core-components-calendar-input/shared';\nimport {\n DateInput,\n DateInputProps,\n isCompleteDateInput,\n} from '@alfalab/core-components-date-input';\nimport { getDataTestId } from '@alfalab/core-components-shared';\n\nimport { CalendarRangeProps } from '../Component';\nimport { Divider } from '../components/divider';\nimport { useSelectionProps, useStaticViewMonthes } from '../hooks';\nimport { isDayButton } from '../utils';\n\nimport styles from './index.module.css';\n\nexport type CalendarRangeStaticProps = Omit<CalendarRangeProps, 'calendarPosition'> & {\n /**\n * Отображать начальный месяц слева или справа (влияет только на начальный рендер)\n */\n defaultMonthPosition?: 'left' | 'right';\n};\n\nexport const CalendarRangeStatic: FC<CalendarRangeStaticProps> = ({\n className,\n defaultMonth = startOfMonth(new Date()).getTime(),\n defaultMonthPosition = 'left',\n minDate,\n maxDate,\n valueFrom = '',\n valueTo = '',\n onDateFromChange = () => null,\n onDateToChange = () => null,\n onChange = () => null,\n onError,\n inputFromProps = {},\n inputToProps = {},\n offDays,\n events,\n returnInvalidDates = false,\n dataTestId,\n calendarContainerClassName,\n}) => {\n const [inputFromValue, setInputFromValue] = useState<string>(valueFrom);\n const [inputToValue, setInputToValue] = useState<string>(valueTo);\n\n let dateFrom = isValidInputValue(inputFromValue, minDate, maxDate, offDays)\n ? parseDateString(inputFromValue).getTime()\n : null;\n\n const dateTo = isValidInputValue(inputToValue, dateFrom || minDate, maxDate, offDays)\n ? parseDateString(inputToValue).getTime()\n : null;\n\n if (isCompleteDateInput(inputToValue) && !dateTo && !returnInvalidDates) {\n dateFrom = null;\n }\n\n const bothInvalid =\n isCompleteDateInput(inputFromValue) &&\n isCompleteDateInput(inputToValue) &&\n parseDateString(inputFromValue).getTime() > parseDateString(inputToValue).getTime();\n\n const [highlightedDate, setHighlightedDate] = useState<number | undefined>(undefined);\n\n const period = usePeriodWithReset({\n initialSelectedFrom: dateFrom ? parseDateString(inputFromValue).getTime() : undefined,\n initialSelectedTo: dateTo ? parseDateString(inputToValue).getTime() : undefined,\n });\n\n const validateInputFromValue = useCallback(\n (value: string) => isValidInputValue(value, minDate, dateFrom || maxDate, offDays),\n [dateFrom, maxDate, minDate, offDays],\n );\n\n const validateInputToValue = useCallback(\n (value: string) => isValidInputValue(value, dateFrom || minDate, maxDate, offDays),\n\n [dateFrom, minDate, maxDate, offDays],\n );\n\n const [inputFromInvalid, setInputFromInvalid] = useState<boolean>(\n isCompleteDateInput(inputFromValue) && dateFrom === null,\n );\n\n const [inputToInvalid, setInputToInvalid] = useState<boolean>(\n isCompleteDateInput(inputToValue) && dateTo === null,\n );\n\n const hasValidateError = bothInvalid || inputFromInvalid || inputToInvalid;\n const {\n calendarProps: calendarFromProps,\n onInputChange: onInputChangeFrom,\n ...dateInputFromProps\n } = inputFromProps;\n const {\n calendarProps: calendarToProps,\n onInputChange: onInputChangeTo,\n ...dateInputToProps\n } = inputToProps;\n\n const { monthFrom, monthTo, handleMonthFromChange, handleMonthToChange } = useStaticViewMonthes(\n {\n selectedFrom: period.selectedFrom,\n selectedTo: period.selectedTo,\n defaultMonth,\n defaultMonthPosition,\n },\n );\n\n const handleValidInputFrom = useCallback(() => {\n setInputFromInvalid(inputFromValue !== '' && !validateInputFromValue(inputFromValue));\n }, [inputFromValue, validateInputFromValue]);\n\n const handleValidInputTo = useCallback(() => {\n setInputToInvalid(inputToValue !== '' && !validateInputToValue(inputToValue));\n }, [inputToValue, validateInputToValue]);\n\n const handleInputFromChange: Required<DateInputProps>['onChange'] = (event, payload) => {\n setInputFromValue(payload.value);\n onInputChangeFrom?.(event, payload);\n };\n\n const handleInputToChange: Required<DateInputProps>['onChange'] = (event, payload) => {\n setInputToValue(payload.value);\n onInputChangeTo?.(event, payload);\n };\n\n const handleMouseOver = useCallback((event: MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n\n const mouseOverDayButton = isDayButton(target) || isDayButton(target.parentElement);\n\n let date;\n\n if (mouseOverDayButton) {\n const button =\n target.tagName === 'BUTTON' ? target : (target.parentElement as HTMLButtonElement);\n\n if (button.dataset.date) {\n date = +button.dataset.date;\n }\n }\n\n setHighlightedDate(date);\n }, []);\n\n const handleClearFrom = useCallback(() => {\n setInputFromValue('');\n }, []);\n\n const handleClearTo = useCallback(() => {\n setInputToValue('');\n }, []);\n\n useEffect(() => {\n setInputFromValue(period.selectedFrom ? formatDate(period.selectedFrom) : '');\n }, [period.selectedFrom]);\n\n useEffect(() => {\n setInputToValue(period.selectedTo ? formatDate(period.selectedTo) : '');\n }, [period.selectedTo]);\n\n useEffect(() => {\n setInputFromValue(valueFrom);\n }, [valueFrom]);\n\n useEffect(() => {\n setInputToValue(valueTo);\n }, [valueTo]);\n\n useEffect(() => {\n if (!inputFromValue || isCompleteDateInput(inputFromValue)) {\n handleValidInputFrom();\n }\n\n period.setStart(dateFrom || undefined);\n if (dateTo) {\n period.setEnd(dateTo);\n }\n\n if (inputFromValue !== valueFrom) {\n onDateFromChange({\n value: inputFromValue,\n date: dateFrom,\n });\n\n onChange({\n valueFrom: inputFromValue,\n valueTo: inputToValue,\n dateFrom,\n dateTo,\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputFromValue]);\n\n useEffect(() => {\n if (!inputToValue || isCompleteDateInput(inputToValue)) {\n handleValidInputTo();\n }\n\n period.setEnd(dateTo || undefined);\n if (dateFrom) {\n period.setStart(dateFrom);\n }\n\n if (inputToValue !== valueTo) {\n // eslint-disable-next-line no-nested-ternary\n const inputDateTo = returnInvalidDates\n ? isCompleteDateInput(inputToValue)\n ? parseDateString(inputToValue).getTime()\n : null\n : dateTo;\n\n onDateToChange({\n value: inputToValue,\n date: inputDateTo,\n });\n\n onChange({\n valueFrom: inputFromValue,\n valueTo: inputToValue,\n dateFrom,\n dateTo: inputDateTo,\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [inputToValue]);\n\n useEffect(() => {\n if (onError) {\n onError(hasValidateError);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hasValidateError]);\n\n const rangeProps = useSelectionProps(period.selectedFrom, period.selectedTo, highlightedDate);\n\n const CalendarFromComponent = dateInputFromProps.Calendar || CalendarDesktop;\n const CalendarToComponent = dateInputToProps.Calendar || CalendarDesktop;\n\n const minMaxInSameMonth = minDate && maxDate && isSameMonth(minDate, maxDate);\n\n return (\n // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events\n <div\n className={cn(styles.component, styles.static, className)}\n onMouseOver={handleMouseOver}\n data-test-id={dataTestId}\n >\n <div>\n <DateInput\n {...dateInputFromProps}\n mobileMode={\n dateInputFromProps.mobileMode === 'popover'\n ? 'input'\n : dateInputFromProps.mobileMode\n }\n value={inputFromValue}\n onChange={handleInputFromChange}\n onClear={handleClearFrom}\n onBlur={handleValidInputFrom}\n error={bothInvalid || inputFromInvalid || dateInputFromProps.error}\n clear={true}\n block={true}\n />\n <div\n className={cn(styles.calendarContainer, calendarContainerClassName)}\n data-test-id={getDataTestId(dataTestId, 'container-from')}\n >\n <CalendarFromComponent\n {...calendarFromProps}\n className={cn(styles.calendar, calendarFromProps?.className)}\n month={monthFrom}\n selectorView='month-only'\n offDays={offDays}\n events={events}\n onChange={period.updatePeriod}\n onMonthChange={handleMonthFromChange}\n minDate={minDate}\n maxDate={\n minMaxInSameMonth\n ? maxDate\n : maxDate &&\n max([maxDate, endOfMonth(subMonths(maxDate, 1))]).getTime()\n }\n {...rangeProps}\n />\n </div>\n </div>\n\n <Divider inputFromProps={inputFromProps} inputToProps={inputToProps} />\n\n <div>\n <DateInput\n {...dateInputToProps}\n mobileMode={\n dateInputToProps.mobileMode === 'popover'\n ? 'input'\n : dateInputToProps.mobileMode\n }\n value={inputToValue}\n onChange={handleInputToChange}\n onClear={handleClearTo}\n onBlur={handleValidInputTo}\n error={bothInvalid || inputToInvalid || dateInputToProps.error}\n clear={true}\n block={true}\n />\n <div data-test-id={getDataTestId(dataTestId, 'container-to')}>\n <CalendarToComponent\n {...calendarToProps}\n className={cn(styles.calendar, calendarToProps?.className)}\n month={monthTo}\n selectorView='month-only'\n offDays={offDays}\n events={events}\n onChange={period.updatePeriod}\n onMonthChange={handleMonthToChange}\n minDate={\n minMaxInSameMonth\n ? minDate\n : minDate && startOfMonth(addMonths(minDate, 1)).getTime()\n }\n maxDate={maxDate}\n {...rangeProps}\n />\n </div>\n </div>\n </div>\n );\n};\n"],"names":["startOfMonth","useState","isValidInputValue","parseDateString","isCompleteDateInput","usePeriodWithReset","useCallback","__rest","useStaticViewMonthes","isDayButton","useEffect","formatDate","useSelectionProps","CalendarDesktop","isSameMonth","React","cn","styles","DateInput","__assign","getDataTestId","max","endOfMonth","subMonths","Divider","addMonths"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,IAAM,mBAAmB,GAAiC,UAAC,EAmBjE,EAAA;QAlBG,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,EAAA,GAAA,EAAA,CAAA,YAAiD,EAAjD,YAAY,mBAAGA,6BAAY,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,GAAA,EAAA,EACjD,EAA6B,GAAA,EAAA,CAAA,oBAAA,EAA7B,oBAAoB,GAAG,EAAA,KAAA,MAAA,GAAA,MAAM,GAAA,EAAA,EAC7B,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,EAAA,GAAA,EAAA,CAAA,SAAc,EAAd,SAAS,mBAAG,EAAE,GAAA,EAAA,EACd,EAAA,GAAA,EAAA,CAAA,OAAY,EAAZ,OAAO,mBAAG,EAAE,GAAA,EAAA,EACZ,EAAA,GAAA,EAAA,CAAA,gBAA6B,EAA7B,gBAAgB,GAAG,EAAA,KAAA,M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S,EAAEC,mBAAE,CAACC,uBAAM,CAAC,QAAQ,EAAE,eAAe,KAAA,IAAA,IAAf,eAAe,KAAf,MAAA,GAAA,MAAA,GAAA,eAAe,CAAE,SAAS,CAAC,EAC1D,KAAK,EAAE,OAAO,EACd,YAAY,EAAC,YAAY,EACzB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,aAAa,EAAE,mBAAmB,EAClC,OAAO,EACH;AACI,0BAAE;0BACA,OAAO,IAAIjB,6BAAY,CAACyB,0BAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAElE,OAAO,EAAE,OAAO,EAAA,EACZ,UAAU,CAAA,CAChB,CACA,CACJ,CACJ;AAEd;;;;"}
|
package/esm/Component.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { CalendarInputProps } from
|
|
3
|
-
type CalendarRangeProps = {
|
|
2
|
+
import { CalendarInputProps } from '@alfalab/core-components-calendar-input';
|
|
3
|
+
export declare type CalendarRangeProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Дополнительный класс
|
|
6
6
|
*/
|
|
@@ -90,5 +90,4 @@ type CalendarRangeProps = {
|
|
|
90
90
|
*/
|
|
91
91
|
calendarContainerClassName?: string;
|
|
92
92
|
};
|
|
93
|
-
declare const CalendarRange: FC<CalendarRangeProps>;
|
|
94
|
-
export { CalendarRangeProps, CalendarRange };
|
|
93
|
+
export declare const CalendarRange: FC<CalendarRangeProps>;
|
package/esm/Component.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { CalendarInputProps } from '@alfalab/core-components-calendar-input';\n\nimport { CalendarRangePopover } from './views/popover';\nimport { CalendarRangeStatic } from './views/static';\n\nexport type CalendarRangeProps = {\n /**\n * Дополнительный класс\n */\n className?: string;\n\n /**\n * Значение инпута (используется и для календаря)\n */\n valueFrom?: string;\n\n /**\n * Значение инпута (используется и для календаря)\n */\n valueTo?: string;\n\n /**\n * Месяц в календаре по умолчанию\n */\n defaultMonth?: number;\n\n /**\n * Минимальная дата, доступная для выбора (timestamp)\n */\n minDate?: number;\n\n /**\n * Максимальная дата, доступная для выбора (timestamp)\n */\n maxDate?: number;\n\n /**\n * Обработчик изменения даты от\n */\n onDateFromChange?: (payload: { date: number | null; value: string }) => void;\n\n /**\n * Обработчик изменения даты до\n */\n onDateToChange?: (payload: { date: number | null; value: string }) => void;\n\n /**\n * Обработчик изменения\n */\n onChange?: (payload: {\n dateFrom: number | null;\n valueFrom: string;\n dateTo: number | null;\n valueTo: string;\n }) => void;\n\n /**\n * Коллбэк, срабатывающий при возникновении ошибок валидации дат внутри компонента.\n */\n onError?: (hasError: boolean) => void;\n\n /**\n * Список событий\n */\n events?: Array<Date | number>;\n\n /**\n * Список выходных\n */\n offDays?: Array<Date | number>;\n\n /**\n * Пропсы для инпута даты от\n */\n inputFromProps?: CalendarInputProps;\n\n /**\n * Пропсы для инпута даты до\n */\n inputToProps?: CalendarInputProps;\n\n /**\n * Идентификатор для систем автоматизированного тестирования\n */\n dataTestId?: string;\n\n /**\n * Определяет, как рендерить календарь — в поповере или снизу инпута\n */\n calendarPosition?: 'static' | 'popover';\n\n /**\n * calendarPosition = static\n * Отображать начальный месяц слева или справа (влияет только на начальный рендер)\n */\n defaultMonthPosition?: 'left' | 'right';\n\n /**\n * Возвращать невалидную дату для кастомной валидации\n */\n returnInvalidDates?: boolean;\n\n /**\n * Дополнительный класс для контейнера календаря\n */\n calendarContainerClassName?: string;\n};\n\nexport const CalendarRange: FC<CalendarRangeProps> = ({\n calendarPosition = 'static',\n ...restProps\n}) => {\n const View = calendarPosition === 'popover' ? CalendarRangePopover : CalendarRangeStatic;\n\n return <View {...restProps} />;\n};\n"],"names":[],"mappings":";;;;;AA8GO,IAAM,aAAa,GAA2B,UAAC,EAGrD,EAAA;IAFG,IAAA,EAAA,GAAA,EAAA,CAAA,gBAA2B,EAA3B,gBAAgB,GAAG,EAAA,KAAA,MAAA,GAAA,QAAQ,KAAA,EACxB,SAAS,GAFsC,MAAA,CAAA,EAAA,EAAA,CAAA,kBAAA,CAGrD,CADe;AAEZ,IAAA,IAAM,IAAI,GAAG,gBAAgB,KAAK,SAAS,GAAG,oBAAoB,GAAG,mBAAmB;AAExF,IAAA,OAAO,KAAC,CAAA,aAAA,CAAA,IAAI,EAAK,QAAA,CAAA,EAAA,EAAA,SAAS,EAAI;AAClC;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { CalendarRangeProps } from
|
|
3
|
-
type Props = {
|
|
2
|
+
import { CalendarRangeProps } from '../../Component';
|
|
3
|
+
declare type Props = {
|
|
4
4
|
inputFromProps?: CalendarRangeProps['inputFromProps'];
|
|
5
5
|
inputToProps?: CalendarRangeProps['inputToProps'];
|
|
6
6
|
};
|
|
7
|
-
declare const Divider: FC<Props>;
|
|
8
|
-
export {
|
|
7
|
+
export declare const Divider: FC<Props>;
|
|
8
|
+
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
|
|
4
|
-
var styles = {"component":"calendar-range__component_18oty","outer":"calendar-range__outer_18oty","s":"calendar-range__s_18oty","m":"calendar-range__m_18oty","l":"calendar-range__l_18oty","xl":"calendar-range__xl_18oty"};
|
|
5
|
-
require('./index.css')
|
|
3
|
+
import styles from './index.module.css.js';
|
|
6
4
|
|
|
7
5
|
var Divider = function (_a) {
|
|
8
6
|
var _b;
|
|
@@ -16,3 +14,4 @@ var Divider = function (_a) {
|
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
export { Divider };
|
|
17
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../../src/components/divider/Component.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport cn from 'classnames';\n\nimport { CalendarRangeProps } from '../../Component';\n\nimport styles from './index.module.css';\n\ntype Props = {\n inputFromProps?: CalendarRangeProps['inputFromProps'];\n inputToProps?: CalendarRangeProps['inputToProps'];\n};\n\nexport const Divider: FC<Props> = ({ inputFromProps, inputToProps }) => {\n const outer =\n inputFromProps?.label &&\n inputFromProps?.labelView === 'outer' &&\n inputToProps?.label &&\n inputToProps?.labelView === 'outer';\n\n const size = inputFromProps?.size || inputToProps?.size || 's';\n\n return <span className={cn(styles.component, styles[size], { [styles.outer]: outer })} />;\n};\n"],"names":[],"mappings":";;;;AAYO,IAAM,OAAO,GAAc,UAAC,EAAgC,EAAA;;QAA9B,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,YAAY,GAAA,EAAA,CAAA,YAAA;IAC7D,IAAM,KAAK,GACP,CAAA,cAAc,aAAd,cAAc,KAAA,MAAA,GAAA,MAAA,GAAd,cAAc,CAAE,KAAK;QACrB,CAAA,cAAc,aAAd,cAAc,KAAA,MAAA,GAAA,MAAA,GAAd,cAAc,CAAE,SAAS,MAAK,OAAO;AACrC,SAAA,YAAY,aAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,KAAK,CAAA;QACnB,CAAA,YAAY,aAAZ,YAAY,KAAA,MAAA,GAAA,MAAA,GAAZ,YAAY,CAAE,SAAS,MAAK,OAAO;IAEvC,IAAM,IAAI,GAAG,CAAA,cAAc,aAAd,cAAc,KAAA,MAAA,GAAA,MAAA,GAAd,cAAc,CAAE,IAAI,MAAI,YAAY,KAAA,IAAA,IAAZ,YAAY,KAAZ,MAAA,GAAA,MAAA,GAAA,YAAY,CAAE,IAAI,CAAA,IAAI,GAAG;IAE9D,OAAO,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,GAAA,EAAA,GAAA,EAAA,EAAI,GAAC,MAAM,CAAC,KAAK,CAAG,GAAA,KAAK,EAAG,EAAA,EAAA,EAAA,CAAI;AAC7F;;;;"}
|
|
@@ -1,80 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
:
|
|
3
|
-
} /* deprecated */ :root {
|
|
4
|
-
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
5
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
6
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-neutral-translucent-1300: rgba(3, 3, 6, 0.88);
|
|
7
3
|
} :root {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/* Up */
|
|
12
|
-
|
|
13
|
-
/* Hard up */
|
|
14
|
-
} :root { /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
15
|
-
|
|
16
|
-
/* новые значения, используйте их */
|
|
17
|
-
} :root { /* deprecated */ /* deprecated */
|
|
18
|
-
--gap-xs: 8px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
19
|
-
--gap-xl: 24px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
|
|
20
|
-
|
|
21
|
-
/* новые значения, используйте их */
|
|
22
|
-
|
|
23
|
-
/* no-unit может приводить к проблемам в calc (#1559) */
|
|
24
|
-
/* stylelint-disable-next-line length-zero-no-unit */
|
|
4
|
+
--gap-xs: 8px;
|
|
5
|
+
--gap-xl: 24px;
|
|
25
6
|
--gap-0: 0px;
|
|
26
7
|
--gap-8: var(--gap-xs);
|
|
27
8
|
--gap-24: var(--gap-xl);
|
|
28
9
|
} :root {
|
|
29
|
-
} /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ /* @deprecated */ :root {
|
|
30
10
|
--size-s-height: 48px;
|
|
31
11
|
--size-m-height: 56px;
|
|
32
12
|
--size-l-height: 64px;
|
|
33
13
|
--size-xl-height: 72px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/* Кнопки выбора месяцев и годов */
|
|
37
|
-
|
|
38
|
-
/* Шапка */
|
|
39
|
-
|
|
40
|
-
/* День */
|
|
41
|
-
|
|
42
|
-
/* today */
|
|
43
|
-
|
|
44
|
-
/* highlighted */
|
|
45
|
-
|
|
46
|
-
/* holidays */
|
|
47
|
-
|
|
48
|
-
/* range */
|
|
49
|
-
|
|
50
|
-
/* selected */
|
|
51
|
-
|
|
52
|
-
/* disabled */
|
|
53
|
-
|
|
54
|
-
/* marker */
|
|
55
|
-
} .calendar-range__component_18oty {
|
|
14
|
+
} .calendar-range__component_tirmy {
|
|
56
15
|
display: flex;
|
|
57
16
|
align-items: center;
|
|
58
17
|
justify-content: center;
|
|
59
18
|
width: 16px;
|
|
60
19
|
margin: var(--gap-0) var(--gap-8)
|
|
61
|
-
} .calendar-
|
|
20
|
+
} .calendar-range__component_tirmy:after {
|
|
62
21
|
content: '';
|
|
63
22
|
display: block;
|
|
64
23
|
width: 100%;
|
|
65
24
|
height: 1px;
|
|
66
25
|
background-color: var(--color-light-neutral-translucent-1300);
|
|
67
|
-
} .calendar-
|
|
26
|
+
} .calendar-range__outer_tirmy {
|
|
68
27
|
position: relative;
|
|
69
|
-
|
|
70
|
-
/* FormControl .above height + margin-bottom */
|
|
71
28
|
top: var(--gap-24);
|
|
72
|
-
} .calendar-
|
|
29
|
+
} .calendar-range__s_tirmy {
|
|
73
30
|
height: var(--size-s-height);
|
|
74
|
-
} .calendar-
|
|
31
|
+
} .calendar-range__m_tirmy {
|
|
75
32
|
height: var(--size-m-height);
|
|
76
|
-
} .calendar-
|
|
33
|
+
} .calendar-range__l_tirmy {
|
|
77
34
|
height: var(--size-l-height);
|
|
78
|
-
} .calendar-
|
|
35
|
+
} .calendar-range__xl_tirmy {
|
|
79
36
|
height: var(--size-xl-height);
|
|
80
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './Component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|