@alfalab/core-components-calendar-range 7.0.7 → 7.0.8
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.js +2 -1
- package/components/divider/Component.d.ts +8 -0
- package/components/divider/Component.js +25 -0
- package/components/divider/index.css +75 -0
- package/components/divider/index.d.ts +1 -0
- package/components/divider/index.js +9 -0
- package/cssm/Component.js +2 -0
- package/cssm/components/divider/Component.d.ts +8 -0
- package/cssm/components/divider/Component.js +24 -0
- package/cssm/components/divider/index.d.ts +1 -0
- package/cssm/components/divider/index.js +10 -0
- package/cssm/components/divider/index.module.css +74 -0
- package/cssm/index.js +2 -0
- package/cssm/views/index.module.css +0 -21
- package/cssm/views/popover.js +3 -1
- package/cssm/views/static.js +3 -1
- package/esm/Component.js +2 -1
- package/esm/components/divider/Component.d.ts +8 -0
- package/esm/components/divider/Component.js +18 -0
- package/esm/components/divider/index.css +75 -0
- package/esm/components/divider/index.d.ts +1 -0
- package/esm/components/divider/index.js +3 -0
- package/esm/index.js +2 -1
- package/esm/{index.module-b9db88e5.d.ts → index.module-1aaed941.d.ts} +0 -0
- package/esm/{index.module-b9db88e5.js → index.module-1aaed941.js} +1 -1
- package/esm/views/index.css +6 -27
- package/esm/views/popover.js +3 -2
- package/esm/views/static.js +3 -2
- package/index.js +2 -1
- package/{index.module-24e4de4c.d.ts → index.module-255b4286.d.ts} +0 -0
- package/{index.module-24e4de4c.js → index.module-255b4286.js} +1 -1
- package/modern/Component.js +2 -1
- package/modern/components/divider/Component.d.ts +8 -0
- package/modern/components/divider/Component.js +16 -0
- package/modern/components/divider/index.css +75 -0
- package/modern/components/divider/index.d.ts +1 -0
- package/modern/components/divider/index.js +3 -0
- package/modern/index.js +2 -1
- package/modern/index.module-491eb220.js +4 -0
- package/modern/views/index.css +6 -27
- package/modern/views/popover.js +3 -2
- package/modern/views/static.js +3 -2
- package/package.json +4 -4
- package/views/index.css +6 -27
- package/views/popover.js +3 -2
- package/views/static.js +3 -2
- package/modern/index.module-8c524c02.js +0 -4
package/Component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_module = require('./index.module-
|
|
3
|
+
var index_module = require('./index.module-255b4286.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var views_popover = require('./views/popover.js');
|
|
6
6
|
var views_static = require('./views/static.js');
|
|
@@ -8,6 +8,7 @@ require('classnames');
|
|
|
8
8
|
require('date-fns/startOfMonth');
|
|
9
9
|
require('@alfalab/core-components-calendar-input');
|
|
10
10
|
require('@alfalab/core-components-date-input');
|
|
11
|
+
require('./components/divider/Component.js');
|
|
11
12
|
require('./hooks.js');
|
|
12
13
|
require('date-fns/addMonths');
|
|
13
14
|
require('date-fns/isEqual');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarRangeProps } from "../../Component";
|
|
3
|
+
type Props = {
|
|
4
|
+
inputFromProps?: CalendarRangeProps['inputFromProps'];
|
|
5
|
+
inputToProps?: CalendarRangeProps['inputToProps'];
|
|
6
|
+
};
|
|
7
|
+
declare const Divider: FC<Props>;
|
|
8
|
+
export { Divider };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('classnames');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
9
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
10
|
+
|
|
11
|
+
var styles = {"component":"calendar-range__component_1tbg6","outer":"calendar-range__outer_1tbg6","s":"calendar-range__s_1tbg6","m":"calendar-range__m_1tbg6","l":"calendar-range__l_1tbg6","xl":"calendar-range__xl_1tbg6"};
|
|
12
|
+
require('./index.css')
|
|
13
|
+
|
|
14
|
+
var Divider = function (_a) {
|
|
15
|
+
var _b;
|
|
16
|
+
var inputFromProps = _a.inputFromProps, inputToProps = _a.inputToProps;
|
|
17
|
+
var outer = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.label) &&
|
|
18
|
+
(inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.labelView) === 'outer' &&
|
|
19
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.label) &&
|
|
20
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.labelView) === 'outer';
|
|
21
|
+
var size = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.size) || (inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.size) || 's';
|
|
22
|
+
return React__default.default.createElement("span", { className: cn__default.default(styles.component, styles[size], (_b = {}, _b[styles.outer] = outer, _b)) });
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.Divider = Divider;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* hash: 1udsd */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-graphic-primary: #0b1f35;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-xs: 8px;
|
|
15
|
+
}
|
|
16
|
+
:root {
|
|
17
|
+
--size-s-height: 48px;
|
|
18
|
+
--size-m-height: 56px;
|
|
19
|
+
--size-l-height: 64px;
|
|
20
|
+
--size-xl-height: 72px;
|
|
21
|
+
}
|
|
22
|
+
:root {
|
|
23
|
+
|
|
24
|
+
/* Кнопки выбора месяцев и годов */
|
|
25
|
+
|
|
26
|
+
/* Шапка */
|
|
27
|
+
|
|
28
|
+
/* День */
|
|
29
|
+
|
|
30
|
+
/* today */
|
|
31
|
+
|
|
32
|
+
/* highlighted */
|
|
33
|
+
|
|
34
|
+
/* holidays */
|
|
35
|
+
|
|
36
|
+
/* range */
|
|
37
|
+
|
|
38
|
+
/* selected */
|
|
39
|
+
|
|
40
|
+
/* disabled */
|
|
41
|
+
|
|
42
|
+
/* marker */
|
|
43
|
+
}
|
|
44
|
+
.calendar-range__component_1tbg6 {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
width: 16px;
|
|
49
|
+
margin: 0 var(--gap-xs)
|
|
50
|
+
}
|
|
51
|
+
.calendar-range__component_1tbg6:after {
|
|
52
|
+
content: '';
|
|
53
|
+
display: block;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 1px;
|
|
56
|
+
background-color: var(--color-light-graphic-primary);
|
|
57
|
+
}
|
|
58
|
+
.calendar-range__outer_1tbg6 {
|
|
59
|
+
position: relative;
|
|
60
|
+
|
|
61
|
+
/* FormControl .above height + margin-bottom */
|
|
62
|
+
top: 24px;
|
|
63
|
+
}
|
|
64
|
+
.calendar-range__s_1tbg6 {
|
|
65
|
+
height: var(--size-s-height);
|
|
66
|
+
}
|
|
67
|
+
.calendar-range__m_1tbg6 {
|
|
68
|
+
height: var(--size-m-height);
|
|
69
|
+
}
|
|
70
|
+
.calendar-range__l_1tbg6 {
|
|
71
|
+
height: var(--size-l-height);
|
|
72
|
+
}
|
|
73
|
+
.calendar-range__xl_1tbg6 {
|
|
74
|
+
height: var(--size-xl-height);
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
package/cssm/Component.js
CHANGED
|
@@ -8,6 +8,8 @@ require('classnames');
|
|
|
8
8
|
require('date-fns/startOfMonth');
|
|
9
9
|
require('@alfalab/core-components-calendar-input/cssm');
|
|
10
10
|
require('@alfalab/core-components-date-input/cssm');
|
|
11
|
+
require('./components/divider/Component.js');
|
|
12
|
+
require('./components/divider/index.module.css');
|
|
11
13
|
require('./hooks.js');
|
|
12
14
|
require('date-fns/addMonths');
|
|
13
15
|
require('date-fns/isEqual');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarRangeProps } from "../../Component";
|
|
3
|
+
type Props = {
|
|
4
|
+
inputFromProps?: CalendarRangeProps['inputFromProps'];
|
|
5
|
+
inputToProps?: CalendarRangeProps['inputToProps'];
|
|
6
|
+
};
|
|
7
|
+
declare const Divider: FC<Props>;
|
|
8
|
+
export { Divider };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('classnames');
|
|
5
|
+
var styles = require('./index.module.css');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
+
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
11
|
+
var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
|
|
12
|
+
|
|
13
|
+
var Divider = function (_a) {
|
|
14
|
+
var _b;
|
|
15
|
+
var inputFromProps = _a.inputFromProps, inputToProps = _a.inputToProps;
|
|
16
|
+
var outer = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.label) &&
|
|
17
|
+
(inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.labelView) === 'outer' &&
|
|
18
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.label) &&
|
|
19
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.labelView) === 'outer';
|
|
20
|
+
var size = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.size) || (inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.size) || 's';
|
|
21
|
+
return React__default.default.createElement("span", { className: cn__default.default(styles__default.default.component, styles__default.default[size], (_b = {}, _b[styles__default.default.outer] = outer, _b)) });
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.Divider = Divider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-light-graphic-primary: #0b1f35;
|
|
3
|
+
}
|
|
4
|
+
:root {
|
|
5
|
+
|
|
6
|
+
/* Hard */
|
|
7
|
+
|
|
8
|
+
/* Up */
|
|
9
|
+
|
|
10
|
+
/* Hard up */
|
|
11
|
+
}
|
|
12
|
+
:root {
|
|
13
|
+
--gap-xs: 8px;
|
|
14
|
+
}
|
|
15
|
+
:root {
|
|
16
|
+
--size-s-height: 48px;
|
|
17
|
+
--size-m-height: 56px;
|
|
18
|
+
--size-l-height: 64px;
|
|
19
|
+
--size-xl-height: 72px;
|
|
20
|
+
}
|
|
21
|
+
:root {
|
|
22
|
+
|
|
23
|
+
/* Кнопки выбора месяцев и годов */
|
|
24
|
+
|
|
25
|
+
/* Шапка */
|
|
26
|
+
|
|
27
|
+
/* День */
|
|
28
|
+
|
|
29
|
+
/* today */
|
|
30
|
+
|
|
31
|
+
/* highlighted */
|
|
32
|
+
|
|
33
|
+
/* holidays */
|
|
34
|
+
|
|
35
|
+
/* range */
|
|
36
|
+
|
|
37
|
+
/* selected */
|
|
38
|
+
|
|
39
|
+
/* disabled */
|
|
40
|
+
|
|
41
|
+
/* marker */
|
|
42
|
+
}
|
|
43
|
+
.component {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
width: 16px;
|
|
48
|
+
margin: 0 var(--gap-xs)
|
|
49
|
+
}
|
|
50
|
+
.component:after {
|
|
51
|
+
content: '';
|
|
52
|
+
display: block;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 1px;
|
|
55
|
+
background-color: var(--color-light-graphic-primary);
|
|
56
|
+
}
|
|
57
|
+
.outer {
|
|
58
|
+
position: relative;
|
|
59
|
+
|
|
60
|
+
/* FormControl .above height + margin-bottom */
|
|
61
|
+
top: 24px;
|
|
62
|
+
}
|
|
63
|
+
.s {
|
|
64
|
+
height: var(--size-s-height);
|
|
65
|
+
}
|
|
66
|
+
.m {
|
|
67
|
+
height: var(--size-m-height);
|
|
68
|
+
}
|
|
69
|
+
.l {
|
|
70
|
+
height: var(--size-l-height);
|
|
71
|
+
}
|
|
72
|
+
.xl {
|
|
73
|
+
height: var(--size-xl-height);
|
|
74
|
+
}
|
package/cssm/index.js
CHANGED
|
@@ -8,6 +8,8 @@ require('classnames');
|
|
|
8
8
|
require('date-fns/startOfMonth');
|
|
9
9
|
require('@alfalab/core-components-calendar-input/cssm');
|
|
10
10
|
require('@alfalab/core-components-date-input/cssm');
|
|
11
|
+
require('./components/divider/Component.js');
|
|
12
|
+
require('./components/divider/index.module.css');
|
|
11
13
|
require('./hooks.js');
|
|
12
14
|
require('date-fns/addMonths');
|
|
13
15
|
require('date-fns/isEqual');
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--color-light-graphic-primary: #0b1f35;
|
|
3
|
-
}
|
|
4
1
|
:root {
|
|
5
2
|
|
|
6
3
|
/* Hard */
|
|
@@ -9,9 +6,6 @@
|
|
|
9
6
|
|
|
10
7
|
/* Hard up */
|
|
11
8
|
}
|
|
12
|
-
:root {
|
|
13
|
-
--gap-xs: 8px;
|
|
14
|
-
}
|
|
15
9
|
:root {
|
|
16
10
|
--calendar-inner-width: 280px;
|
|
17
11
|
|
|
@@ -47,21 +41,6 @@
|
|
|
47
41
|
.component *[class*='calendarIcon_'] {
|
|
48
42
|
margin-right: 0;
|
|
49
43
|
}
|
|
50
|
-
.divider {
|
|
51
|
-
height: 48px;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
width: 16px;
|
|
56
|
-
margin: 0 var(--gap-xs)
|
|
57
|
-
}
|
|
58
|
-
.divider:after {
|
|
59
|
-
content: '';
|
|
60
|
-
display: block;
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 1px;
|
|
63
|
-
background-color: var(--color-light-graphic-primary);
|
|
64
|
-
}
|
|
65
44
|
.static .calendar {
|
|
66
45
|
width: var(--calendar-inner-width);
|
|
67
46
|
}
|
package/cssm/views/popover.js
CHANGED
|
@@ -6,8 +6,10 @@ var cn = require('classnames');
|
|
|
6
6
|
var startOfMonth = require('date-fns/startOfMonth');
|
|
7
7
|
var coreComponentsCalendarInput = require('@alfalab/core-components-calendar-input/cssm');
|
|
8
8
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input/cssm');
|
|
9
|
+
var components_divider_Component = require('../components/divider/Component.js');
|
|
9
10
|
var hooks = require('../hooks.js');
|
|
10
11
|
var styles = require('./index.module.css');
|
|
12
|
+
require('../components/divider/index.module.css');
|
|
11
13
|
require('date-fns/addMonths');
|
|
12
14
|
require('date-fns/isEqual');
|
|
13
15
|
require('date-fns/max');
|
|
@@ -116,7 +118,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
116
118
|
}, [hasValidateError]);
|
|
117
119
|
return (React__default.default.createElement("div", { className: cn__default.default(styles__default.default.component, className), "data-test-id": dataTestId },
|
|
118
120
|
React__default.default.createElement(coreComponentsCalendarInput.CalendarInput, tslib_es6.__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_es6.__assign(tslib_es6.__assign({}, inputFromProps.calendarProps), { month: monthFrom, onMonthChange: handleMonthFromChange, selectorView: 'full' }) })),
|
|
119
|
-
React__default.default.createElement(
|
|
121
|
+
React__default.default.createElement(components_divider_Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
120
122
|
React__default.default.createElement(coreComponentsCalendarInput.CalendarInput, tslib_es6.__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_es6.__assign(tslib_es6.__assign({}, inputToProps.calendarProps), { month: monthTo, onMonthChange: handleMonthToChange, selectorView: 'full' }) }))));
|
|
121
123
|
};
|
|
122
124
|
|
package/cssm/views/static.js
CHANGED
|
@@ -11,9 +11,11 @@ var subMonths = require('date-fns/subMonths');
|
|
|
11
11
|
var coreComponentsCalendar = require('@alfalab/core-components-calendar/cssm');
|
|
12
12
|
var coreComponentsCalendarInput = require('@alfalab/core-components-calendar-input/cssm');
|
|
13
13
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input/cssm');
|
|
14
|
+
var components_divider_Component = require('../components/divider/Component.js');
|
|
14
15
|
var hooks = require('../hooks.js');
|
|
15
16
|
var utils = require('../utils.js');
|
|
16
17
|
var styles = require('./index.module.css');
|
|
18
|
+
require('../components/divider/index.module.css');
|
|
17
19
|
require('date-fns/isEqual');
|
|
18
20
|
require('date-fns/min');
|
|
19
21
|
|
|
@@ -165,7 +167,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
165
167
|
? 'input'
|
|
166
168
|
: dateInputFromProps.mobileMode, value: inputFromValue, onChange: handleInputFromChange, onClear: handleClearFrom, onBlur: handleValidInputFrom, error: bothInvalid || inputFromInvalid || dateInputFromProps.error, clear: true, block: true })),
|
|
167
169
|
React__default.default.createElement(CalendarFromComponent, tslib_es6.__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: maxDate && max__default.default([maxDate, endOfMonth__default.default(subMonths__default.default(maxDate, 1))]).getTime() }, rangeProps))),
|
|
168
|
-
React__default.default.createElement(
|
|
170
|
+
React__default.default.createElement(components_divider_Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
169
171
|
React__default.default.createElement("div", null,
|
|
170
172
|
React__default.default.createElement(coreComponentsDateInput.DateInput, tslib_es6.__assign({}, dateInputToProps, { mobileMode: dateInputToProps.mobileMode === 'popover'
|
|
171
173
|
? 'input'
|
package/esm/Component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, a as __assign } from './index.module-
|
|
1
|
+
import { _ as __rest, a as __assign } from './index.module-1aaed941.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { CalendarRangePopover } from './views/popover.js';
|
|
4
4
|
import { CalendarRangeStatic } from './views/static.js';
|
|
@@ -6,6 +6,7 @@ import 'classnames';
|
|
|
6
6
|
import 'date-fns/startOfMonth';
|
|
7
7
|
import '@alfalab/core-components-calendar-input/esm';
|
|
8
8
|
import '@alfalab/core-components-date-input/esm';
|
|
9
|
+
import './components/divider/Component.js';
|
|
9
10
|
import './hooks.js';
|
|
10
11
|
import 'date-fns/addMonths';
|
|
11
12
|
import 'date-fns/isEqual';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarRangeProps } from "../../Component";
|
|
3
|
+
type Props = {
|
|
4
|
+
inputFromProps?: CalendarRangeProps['inputFromProps'];
|
|
5
|
+
inputToProps?: CalendarRangeProps['inputToProps'];
|
|
6
|
+
};
|
|
7
|
+
declare const Divider: FC<Props>;
|
|
8
|
+
export { Divider };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
|
|
4
|
+
var styles = {"component":"calendar-range__component_1tbg6","outer":"calendar-range__outer_1tbg6","s":"calendar-range__s_1tbg6","m":"calendar-range__m_1tbg6","l":"calendar-range__l_1tbg6","xl":"calendar-range__xl_1tbg6"};
|
|
5
|
+
require('./index.css')
|
|
6
|
+
|
|
7
|
+
var Divider = function (_a) {
|
|
8
|
+
var _b;
|
|
9
|
+
var inputFromProps = _a.inputFromProps, inputToProps = _a.inputToProps;
|
|
10
|
+
var outer = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.label) &&
|
|
11
|
+
(inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.labelView) === 'outer' &&
|
|
12
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.label) &&
|
|
13
|
+
(inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.labelView) === 'outer';
|
|
14
|
+
var size = (inputFromProps === null || inputFromProps === void 0 ? void 0 : inputFromProps.size) || (inputToProps === null || inputToProps === void 0 ? void 0 : inputToProps.size) || 's';
|
|
15
|
+
return React.createElement("span", { className: cn(styles.component, styles[size], (_b = {}, _b[styles.outer] = outer, _b)) });
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Divider };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* hash: 1udsd */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-graphic-primary: #0b1f35;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-xs: 8px;
|
|
15
|
+
}
|
|
16
|
+
:root {
|
|
17
|
+
--size-s-height: 48px;
|
|
18
|
+
--size-m-height: 56px;
|
|
19
|
+
--size-l-height: 64px;
|
|
20
|
+
--size-xl-height: 72px;
|
|
21
|
+
}
|
|
22
|
+
:root {
|
|
23
|
+
|
|
24
|
+
/* Кнопки выбора месяцев и годов */
|
|
25
|
+
|
|
26
|
+
/* Шапка */
|
|
27
|
+
|
|
28
|
+
/* День */
|
|
29
|
+
|
|
30
|
+
/* today */
|
|
31
|
+
|
|
32
|
+
/* highlighted */
|
|
33
|
+
|
|
34
|
+
/* holidays */
|
|
35
|
+
|
|
36
|
+
/* range */
|
|
37
|
+
|
|
38
|
+
/* selected */
|
|
39
|
+
|
|
40
|
+
/* disabled */
|
|
41
|
+
|
|
42
|
+
/* marker */
|
|
43
|
+
}
|
|
44
|
+
.calendar-range__component_1tbg6 {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
width: 16px;
|
|
49
|
+
margin: 0 var(--gap-xs)
|
|
50
|
+
}
|
|
51
|
+
.calendar-range__component_1tbg6:after {
|
|
52
|
+
content: '';
|
|
53
|
+
display: block;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 1px;
|
|
56
|
+
background-color: var(--color-light-graphic-primary);
|
|
57
|
+
}
|
|
58
|
+
.calendar-range__outer_1tbg6 {
|
|
59
|
+
position: relative;
|
|
60
|
+
|
|
61
|
+
/* FormControl .above height + margin-bottom */
|
|
62
|
+
top: 24px;
|
|
63
|
+
}
|
|
64
|
+
.calendar-range__s_1tbg6 {
|
|
65
|
+
height: var(--size-s-height);
|
|
66
|
+
}
|
|
67
|
+
.calendar-range__m_1tbg6 {
|
|
68
|
+
height: var(--size-m-height);
|
|
69
|
+
}
|
|
70
|
+
.calendar-range__l_1tbg6 {
|
|
71
|
+
height: var(--size-l-height);
|
|
72
|
+
}
|
|
73
|
+
.calendar-range__xl_1tbg6 {
|
|
74
|
+
height: var(--size-xl-height);
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { CalendarRange } from './Component.js';
|
|
2
|
-
import './index.module-
|
|
2
|
+
import './index.module-1aaed941.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './views/popover.js';
|
|
5
5
|
import 'classnames';
|
|
6
6
|
import 'date-fns/startOfMonth';
|
|
7
7
|
import '@alfalab/core-components-calendar-input/esm';
|
|
8
8
|
import '@alfalab/core-components-date-input/esm';
|
|
9
|
+
import './components/divider/Component.js';
|
|
9
10
|
import './hooks.js';
|
|
10
11
|
import 'date-fns/addMonths';
|
|
11
12
|
import 'date-fns/isEqual';
|
|
File without changes
|
|
@@ -37,7 +37,7 @@ function __rest(s, e) {
|
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var styles = {"component":"calendar-
|
|
40
|
+
var styles = {"component":"calendar-range__component_1ci3b","static":"calendar-range__static_1ci3b","calendar":"calendar-range__calendar_1ci3b"};
|
|
41
41
|
require('./views/index.css')
|
|
42
42
|
|
|
43
43
|
export { __rest as _, __assign as a, styles as s };
|
package/esm/views/index.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
:root {
|
|
3
|
-
--color-light-graphic-primary: #0b1f35;
|
|
4
|
-
}
|
|
1
|
+
/* hash: 1y02j */
|
|
5
2
|
:root {
|
|
6
3
|
|
|
7
4
|
/* Hard */
|
|
@@ -10,9 +7,6 @@
|
|
|
10
7
|
|
|
11
8
|
/* Hard up */
|
|
12
9
|
}
|
|
13
|
-
:root {
|
|
14
|
-
--gap-xs: 8px;
|
|
15
|
-
}
|
|
16
10
|
:root {
|
|
17
11
|
--calendar-inner-width: 280px;
|
|
18
12
|
|
|
@@ -36,33 +30,18 @@
|
|
|
36
30
|
|
|
37
31
|
/* marker */
|
|
38
32
|
}
|
|
39
|
-
.calendar-
|
|
33
|
+
.calendar-range__component_1ci3b {
|
|
40
34
|
display: flex
|
|
41
35
|
}
|
|
42
|
-
.calendar-
|
|
36
|
+
.calendar-range__component_1ci3b button[aria-selected='true'] {
|
|
43
37
|
cursor: pointer;
|
|
44
38
|
}
|
|
45
|
-
.calendar-
|
|
39
|
+
.calendar-range__component_1ci3b *[class*='errorIcon_'] {
|
|
46
40
|
display: none;
|
|
47
41
|
}
|
|
48
|
-
.calendar-
|
|
42
|
+
.calendar-range__component_1ci3b *[class*='calendarIcon_'] {
|
|
49
43
|
margin-right: 0;
|
|
50
44
|
}
|
|
51
|
-
.calendar-
|
|
52
|
-
height: 48px;
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
width: 16px;
|
|
57
|
-
margin: 0 var(--gap-xs)
|
|
58
|
-
}
|
|
59
|
-
.calendar-range__divider_qeu3v:after {
|
|
60
|
-
content: '';
|
|
61
|
-
display: block;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 1px;
|
|
64
|
-
background-color: var(--color-light-graphic-primary);
|
|
65
|
-
}
|
|
66
|
-
.calendar-range__static_qeu3v .calendar-range__calendar_qeu3v {
|
|
45
|
+
.calendar-range__static_1ci3b .calendar-range__calendar_1ci3b {
|
|
67
46
|
width: var(--calendar-inner-width);
|
|
68
47
|
}
|
package/esm/views/popover.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { s as styles, a as __assign } from '../index.module-
|
|
1
|
+
import { s as styles, a as __assign } from '../index.module-1aaed941.js';
|
|
2
2
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import startOfMonth from 'date-fns/startOfMonth';
|
|
5
5
|
import { isValidInputValue, parseDateString, CalendarInput } from '@alfalab/core-components-calendar-input/esm';
|
|
6
6
|
import { isCompleteDateInput } from '@alfalab/core-components-date-input/esm';
|
|
7
|
+
import { Divider } from '../components/divider/Component.js';
|
|
7
8
|
import { usePopoverViewMonthes } from '../hooks.js';
|
|
8
9
|
import 'date-fns/addMonths';
|
|
9
10
|
import 'date-fns/isEqual';
|
|
@@ -106,7 +107,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
106
107
|
}, [hasValidateError]);
|
|
107
108
|
return (React.createElement("div", { className: cn(styles.component, className), "data-test-id": dataTestId },
|
|
108
109
|
React.createElement(CalendarInput, __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: __assign(__assign({}, inputFromProps.calendarProps), { month: monthFrom, onMonthChange: handleMonthFromChange, selectorView: 'full' }) })),
|
|
109
|
-
React.createElement(
|
|
110
|
+
React.createElement(Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
110
111
|
React.createElement(CalendarInput, __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: __assign(__assign({}, inputToProps.calendarProps), { month: monthTo, onMonthChange: handleMonthToChange, selectorView: 'full' }) }))));
|
|
111
112
|
};
|
|
112
113
|
|
package/esm/views/static.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __rest, s as styles, a as __assign } from '../index.module-
|
|
1
|
+
import { _ as __rest, s as styles, a as __assign } from '../index.module-1aaed941.js';
|
|
2
2
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import cn from 'classnames';
|
|
4
4
|
import addMonths from 'date-fns/addMonths';
|
|
@@ -9,6 +9,7 @@ import subMonths from 'date-fns/subMonths';
|
|
|
9
9
|
import { usePeriodWithReset, Calendar } from '@alfalab/core-components-calendar/esm';
|
|
10
10
|
import { isValidInputValue, parseDateString, formatDate } from '@alfalab/core-components-calendar-input/esm';
|
|
11
11
|
import { isCompleteDateInput, DateInput } from '@alfalab/core-components-date-input/esm';
|
|
12
|
+
import { Divider } from '../components/divider/Component.js';
|
|
12
13
|
import { useStaticViewMonthes, useSelectionProps } from '../hooks.js';
|
|
13
14
|
import { isDayButton } from '../utils.js';
|
|
14
15
|
import 'date-fns/isEqual';
|
|
@@ -151,7 +152,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
151
152
|
? 'input'
|
|
152
153
|
: dateInputFromProps.mobileMode, value: inputFromValue, onChange: handleInputFromChange, onClear: handleClearFrom, onBlur: handleValidInputFrom, error: bothInvalid || inputFromInvalid || dateInputFromProps.error, clear: true, block: true })),
|
|
153
154
|
React.createElement(CalendarFromComponent, __assign({}, calendarFromProps, { className: cn(styles.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: maxDate && max([maxDate, endOfMonth(subMonths(maxDate, 1))]).getTime() }, rangeProps))),
|
|
154
|
-
React.createElement(
|
|
155
|
+
React.createElement(Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
155
156
|
React.createElement("div", null,
|
|
156
157
|
React.createElement(DateInput, __assign({}, dateInputToProps, { mobileMode: dateInputToProps.mobileMode === 'popover'
|
|
157
158
|
? 'input'
|
package/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var Component = require('./Component.js');
|
|
4
|
-
require('./index.module-
|
|
4
|
+
require('./index.module-255b4286.js');
|
|
5
5
|
require('react');
|
|
6
6
|
require('./views/popover.js');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('date-fns/startOfMonth');
|
|
9
9
|
require('@alfalab/core-components-calendar-input');
|
|
10
10
|
require('@alfalab/core-components-date-input');
|
|
11
|
+
require('./components/divider/Component.js');
|
|
11
12
|
require('./hooks.js');
|
|
12
13
|
require('date-fns/addMonths');
|
|
13
14
|
require('date-fns/isEqual');
|
|
File without changes
|
|
@@ -39,7 +39,7 @@ function __rest(s, e) {
|
|
|
39
39
|
return t;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var styles = {"component":"calendar-
|
|
42
|
+
var styles = {"component":"calendar-range__component_1ci3b","static":"calendar-range__static_1ci3b","calendar":"calendar-range__calendar_1ci3b"};
|
|
43
43
|
require('./views/index.css')
|
|
44
44
|
|
|
45
45
|
exports.__rest = __rest;
|
package/modern/Component.js
CHANGED
|
@@ -5,13 +5,14 @@ import 'classnames';
|
|
|
5
5
|
import 'date-fns/startOfMonth';
|
|
6
6
|
import '@alfalab/core-components-calendar-input/modern';
|
|
7
7
|
import '@alfalab/core-components-date-input/modern';
|
|
8
|
+
import './components/divider/Component.js';
|
|
8
9
|
import './hooks.js';
|
|
9
10
|
import 'date-fns/addMonths';
|
|
10
11
|
import 'date-fns/isEqual';
|
|
11
12
|
import 'date-fns/max';
|
|
12
13
|
import 'date-fns/min';
|
|
13
14
|
import 'date-fns/subMonths';
|
|
14
|
-
import './index.module-
|
|
15
|
+
import './index.module-491eb220.js';
|
|
15
16
|
import 'date-fns/endOfMonth';
|
|
16
17
|
import '@alfalab/core-components-calendar/modern';
|
|
17
18
|
import './utils.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CalendarRangeProps } from "../../Component";
|
|
3
|
+
type Props = {
|
|
4
|
+
inputFromProps?: CalendarRangeProps['inputFromProps'];
|
|
5
|
+
inputToProps?: CalendarRangeProps['inputToProps'];
|
|
6
|
+
};
|
|
7
|
+
declare const Divider: FC<Props>;
|
|
8
|
+
export { Divider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
|
|
4
|
+
const styles = {"component":"calendar-range__component_1tbg6","outer":"calendar-range__outer_1tbg6","s":"calendar-range__s_1tbg6","m":"calendar-range__m_1tbg6","l":"calendar-range__l_1tbg6","xl":"calendar-range__xl_1tbg6"};
|
|
5
|
+
require('./index.css')
|
|
6
|
+
|
|
7
|
+
const Divider = ({ inputFromProps, inputToProps }) => {
|
|
8
|
+
const outer = inputFromProps?.label &&
|
|
9
|
+
inputFromProps?.labelView === 'outer' &&
|
|
10
|
+
inputToProps?.label &&
|
|
11
|
+
inputToProps?.labelView === 'outer';
|
|
12
|
+
const size = inputFromProps?.size || inputToProps?.size || 's';
|
|
13
|
+
return React.createElement("span", { className: cn(styles.component, styles[size], { [styles.outer]: outer }) });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { Divider };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* hash: 1udsd */
|
|
2
|
+
:root {
|
|
3
|
+
--color-light-graphic-primary: #0b1f35;
|
|
4
|
+
}
|
|
5
|
+
:root {
|
|
6
|
+
|
|
7
|
+
/* Hard */
|
|
8
|
+
|
|
9
|
+
/* Up */
|
|
10
|
+
|
|
11
|
+
/* Hard up */
|
|
12
|
+
}
|
|
13
|
+
:root {
|
|
14
|
+
--gap-xs: 8px;
|
|
15
|
+
}
|
|
16
|
+
:root {
|
|
17
|
+
--size-s-height: 48px;
|
|
18
|
+
--size-m-height: 56px;
|
|
19
|
+
--size-l-height: 64px;
|
|
20
|
+
--size-xl-height: 72px;
|
|
21
|
+
}
|
|
22
|
+
:root {
|
|
23
|
+
|
|
24
|
+
/* Кнопки выбора месяцев и годов */
|
|
25
|
+
|
|
26
|
+
/* Шапка */
|
|
27
|
+
|
|
28
|
+
/* День */
|
|
29
|
+
|
|
30
|
+
/* today */
|
|
31
|
+
|
|
32
|
+
/* highlighted */
|
|
33
|
+
|
|
34
|
+
/* holidays */
|
|
35
|
+
|
|
36
|
+
/* range */
|
|
37
|
+
|
|
38
|
+
/* selected */
|
|
39
|
+
|
|
40
|
+
/* disabled */
|
|
41
|
+
|
|
42
|
+
/* marker */
|
|
43
|
+
}
|
|
44
|
+
.calendar-range__component_1tbg6 {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
width: 16px;
|
|
49
|
+
margin: 0 var(--gap-xs)
|
|
50
|
+
}
|
|
51
|
+
.calendar-range__component_1tbg6:after {
|
|
52
|
+
content: '';
|
|
53
|
+
display: block;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 1px;
|
|
56
|
+
background-color: var(--color-light-graphic-primary);
|
|
57
|
+
}
|
|
58
|
+
.calendar-range__outer_1tbg6 {
|
|
59
|
+
position: relative;
|
|
60
|
+
|
|
61
|
+
/* FormControl .above height + margin-bottom */
|
|
62
|
+
top: 24px;
|
|
63
|
+
}
|
|
64
|
+
.calendar-range__s_1tbg6 {
|
|
65
|
+
height: var(--size-s-height);
|
|
66
|
+
}
|
|
67
|
+
.calendar-range__m_1tbg6 {
|
|
68
|
+
height: var(--size-m-height);
|
|
69
|
+
}
|
|
70
|
+
.calendar-range__l_1tbg6 {
|
|
71
|
+
height: var(--size-l-height);
|
|
72
|
+
}
|
|
73
|
+
.calendar-range__xl_1tbg6 {
|
|
74
|
+
height: var(--size-xl-height);
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Component";
|
package/modern/index.js
CHANGED
|
@@ -5,13 +5,14 @@ import 'classnames';
|
|
|
5
5
|
import 'date-fns/startOfMonth';
|
|
6
6
|
import '@alfalab/core-components-calendar-input/modern';
|
|
7
7
|
import '@alfalab/core-components-date-input/modern';
|
|
8
|
+
import './components/divider/Component.js';
|
|
8
9
|
import './hooks.js';
|
|
9
10
|
import 'date-fns/addMonths';
|
|
10
11
|
import 'date-fns/isEqual';
|
|
11
12
|
import 'date-fns/max';
|
|
12
13
|
import 'date-fns/min';
|
|
13
14
|
import 'date-fns/subMonths';
|
|
14
|
-
import './index.module-
|
|
15
|
+
import './index.module-491eb220.js';
|
|
15
16
|
import './views/static.js';
|
|
16
17
|
import 'date-fns/endOfMonth';
|
|
17
18
|
import '@alfalab/core-components-calendar/modern';
|
package/modern/views/index.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
:root {
|
|
3
|
-
--color-light-graphic-primary: #0b1f35;
|
|
4
|
-
}
|
|
1
|
+
/* hash: 1y02j */
|
|
5
2
|
:root {
|
|
6
3
|
|
|
7
4
|
/* Hard */
|
|
@@ -10,9 +7,6 @@
|
|
|
10
7
|
|
|
11
8
|
/* Hard up */
|
|
12
9
|
}
|
|
13
|
-
:root {
|
|
14
|
-
--gap-xs: 8px;
|
|
15
|
-
}
|
|
16
10
|
:root {
|
|
17
11
|
--calendar-inner-width: 280px;
|
|
18
12
|
|
|
@@ -36,33 +30,18 @@
|
|
|
36
30
|
|
|
37
31
|
/* marker */
|
|
38
32
|
}
|
|
39
|
-
.calendar-
|
|
33
|
+
.calendar-range__component_1ci3b {
|
|
40
34
|
display: flex
|
|
41
35
|
}
|
|
42
|
-
.calendar-
|
|
36
|
+
.calendar-range__component_1ci3b button[aria-selected='true'] {
|
|
43
37
|
cursor: pointer;
|
|
44
38
|
}
|
|
45
|
-
.calendar-
|
|
39
|
+
.calendar-range__component_1ci3b *[class*='errorIcon_'] {
|
|
46
40
|
display: none;
|
|
47
41
|
}
|
|
48
|
-
.calendar-
|
|
42
|
+
.calendar-range__component_1ci3b *[class*='calendarIcon_'] {
|
|
49
43
|
margin-right: 0;
|
|
50
44
|
}
|
|
51
|
-
.calendar-
|
|
52
|
-
height: 48px;
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
width: 16px;
|
|
57
|
-
margin: 0 var(--gap-xs)
|
|
58
|
-
}
|
|
59
|
-
.calendar-range__divider_qeu3v:after {
|
|
60
|
-
content: '';
|
|
61
|
-
display: block;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 1px;
|
|
64
|
-
background-color: var(--color-light-graphic-primary);
|
|
65
|
-
}
|
|
66
|
-
.calendar-range__static_qeu3v .calendar-range__calendar_qeu3v {
|
|
45
|
+
.calendar-range__static_1ci3b .calendar-range__calendar_1ci3b {
|
|
67
46
|
width: var(--calendar-inner-width);
|
|
68
47
|
}
|
package/modern/views/popover.js
CHANGED
|
@@ -3,8 +3,9 @@ import cn from 'classnames';
|
|
|
3
3
|
import startOfMonth from 'date-fns/startOfMonth';
|
|
4
4
|
import { isValidInputValue, parseDateString, CalendarInput } from '@alfalab/core-components-calendar-input/modern';
|
|
5
5
|
import { isCompleteDateInput } from '@alfalab/core-components-date-input/modern';
|
|
6
|
+
import { Divider } from '../components/divider/Component.js';
|
|
6
7
|
import { usePopoverViewMonthes } from '../hooks.js';
|
|
7
|
-
import { s as styles } from '../index.module-
|
|
8
|
+
import { s as styles } from '../index.module-491eb220.js';
|
|
8
9
|
import 'date-fns/addMonths';
|
|
9
10
|
import 'date-fns/isEqual';
|
|
10
11
|
import 'date-fns/max';
|
|
@@ -110,7 +111,7 @@ const CalendarRangePopover = ({ className, defaultMonth = startOfMonth(new Date(
|
|
|
110
111
|
onMonthChange: handleMonthFromChange,
|
|
111
112
|
selectorView: 'full',
|
|
112
113
|
} }),
|
|
113
|
-
React.createElement(
|
|
114
|
+
React.createElement(Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
114
115
|
React.createElement(CalendarInput, { ...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: {
|
|
115
116
|
...inputToProps.calendarProps,
|
|
116
117
|
month: monthTo,
|
package/modern/views/static.js
CHANGED
|
@@ -8,9 +8,10 @@ import subMonths from 'date-fns/subMonths';
|
|
|
8
8
|
import { usePeriodWithReset, Calendar } from '@alfalab/core-components-calendar/modern';
|
|
9
9
|
import { isValidInputValue, parseDateString, formatDate } from '@alfalab/core-components-calendar-input/modern';
|
|
10
10
|
import { isCompleteDateInput, DateInput } from '@alfalab/core-components-date-input/modern';
|
|
11
|
+
import { Divider } from '../components/divider/Component.js';
|
|
11
12
|
import { useStaticViewMonthes, useSelectionProps } from '../hooks.js';
|
|
12
13
|
import { isDayButton } from '../utils.js';
|
|
13
|
-
import { s as styles } from '../index.module-
|
|
14
|
+
import { s as styles } from '../index.module-491eb220.js';
|
|
14
15
|
import 'date-fns/isEqual';
|
|
15
16
|
import 'date-fns/min';
|
|
16
17
|
|
|
@@ -151,7 +152,7 @@ const CalendarRangeStatic = ({ className, defaultMonth = startOfMonth(new Date()
|
|
|
151
152
|
? 'input'
|
|
152
153
|
: dateInputFromProps.mobileMode, value: inputFromValue, onChange: handleInputFromChange, onClear: handleClearFrom, onBlur: handleValidInputFrom, error: bothInvalid || inputFromInvalid || dateInputFromProps.error, clear: true, block: true }),
|
|
153
154
|
React.createElement(CalendarFromComponent, { ...calendarFromProps, className: cn(styles.calendar, calendarFromProps?.className), month: monthFrom, selectorView: 'month-only', offDays: offDays, events: events, onChange: period.updatePeriod, onMonthChange: handleMonthFromChange, minDate: minDate, maxDate: maxDate && max([maxDate, endOfMonth(subMonths(maxDate, 1))]).getTime(), ...rangeProps })),
|
|
154
|
-
React.createElement(
|
|
155
|
+
React.createElement(Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
155
156
|
React.createElement("div", null,
|
|
156
157
|
React.createElement(DateInput, { ...dateInputToProps, mobileMode: dateInputToProps.mobileMode === 'popover'
|
|
157
158
|
? 'input'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-calendar-range",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.8",
|
|
4
4
|
"description": "Calendar range component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@alfalab/core-components-calendar": "^6.2.
|
|
22
|
-
"@alfalab/core-components-calendar-input": "^8.2.
|
|
23
|
-
"@alfalab/core-components-date-input": "^4.1.
|
|
21
|
+
"@alfalab/core-components-calendar": "^6.2.1",
|
|
22
|
+
"@alfalab/core-components-calendar-input": "^8.2.1",
|
|
23
|
+
"@alfalab/core-components-date-input": "^4.1.2",
|
|
24
24
|
"classnames": "^2.3.1",
|
|
25
25
|
"date-fns": "^2.16.1"
|
|
26
26
|
}
|
package/views/index.css
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
:root {
|
|
3
|
-
--color-light-graphic-primary: #0b1f35;
|
|
4
|
-
}
|
|
1
|
+
/* hash: 1y02j */
|
|
5
2
|
:root {
|
|
6
3
|
|
|
7
4
|
/* Hard */
|
|
@@ -10,9 +7,6 @@
|
|
|
10
7
|
|
|
11
8
|
/* Hard up */
|
|
12
9
|
}
|
|
13
|
-
:root {
|
|
14
|
-
--gap-xs: 8px;
|
|
15
|
-
}
|
|
16
10
|
:root {
|
|
17
11
|
--calendar-inner-width: 280px;
|
|
18
12
|
|
|
@@ -36,33 +30,18 @@
|
|
|
36
30
|
|
|
37
31
|
/* marker */
|
|
38
32
|
}
|
|
39
|
-
.calendar-
|
|
33
|
+
.calendar-range__component_1ci3b {
|
|
40
34
|
display: flex
|
|
41
35
|
}
|
|
42
|
-
.calendar-
|
|
36
|
+
.calendar-range__component_1ci3b button[aria-selected='true'] {
|
|
43
37
|
cursor: pointer;
|
|
44
38
|
}
|
|
45
|
-
.calendar-
|
|
39
|
+
.calendar-range__component_1ci3b *[class*='errorIcon_'] {
|
|
46
40
|
display: none;
|
|
47
41
|
}
|
|
48
|
-
.calendar-
|
|
42
|
+
.calendar-range__component_1ci3b *[class*='calendarIcon_'] {
|
|
49
43
|
margin-right: 0;
|
|
50
44
|
}
|
|
51
|
-
.calendar-
|
|
52
|
-
height: 48px;
|
|
53
|
-
display: flex;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
width: 16px;
|
|
57
|
-
margin: 0 var(--gap-xs)
|
|
58
|
-
}
|
|
59
|
-
.calendar-range__divider_qeu3v:after {
|
|
60
|
-
content: '';
|
|
61
|
-
display: block;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 1px;
|
|
64
|
-
background-color: var(--color-light-graphic-primary);
|
|
65
|
-
}
|
|
66
|
-
.calendar-range__static_qeu3v .calendar-range__calendar_qeu3v {
|
|
45
|
+
.calendar-range__static_1ci3b .calendar-range__calendar_1ci3b {
|
|
67
46
|
width: var(--calendar-inner-width);
|
|
68
47
|
}
|
package/views/popover.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_module = require('../index.module-
|
|
3
|
+
var index_module = require('../index.module-255b4286.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var startOfMonth = require('date-fns/startOfMonth');
|
|
7
7
|
var coreComponentsCalendarInput = require('@alfalab/core-components-calendar-input');
|
|
8
8
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input');
|
|
9
|
+
var components_divider_Component = require('../components/divider/Component.js');
|
|
9
10
|
var hooks = require('../hooks.js');
|
|
10
11
|
require('date-fns/addMonths');
|
|
11
12
|
require('date-fns/isEqual');
|
|
@@ -114,7 +115,7 @@ var CalendarRangePopover = function (_a) {
|
|
|
114
115
|
}, [hasValidateError]);
|
|
115
116
|
return (React__default.default.createElement("div", { className: cn__default.default(index_module.styles.component, className), "data-test-id": dataTestId },
|
|
116
117
|
React__default.default.createElement(coreComponentsCalendarInput.CalendarInput, index_module.__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: index_module.__assign(index_module.__assign({}, inputFromProps.calendarProps), { month: monthFrom, onMonthChange: handleMonthFromChange, selectorView: 'full' }) })),
|
|
117
|
-
React__default.default.createElement(
|
|
118
|
+
React__default.default.createElement(components_divider_Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
118
119
|
React__default.default.createElement(coreComponentsCalendarInput.CalendarInput, index_module.__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: index_module.__assign(index_module.__assign({}, inputToProps.calendarProps), { month: monthTo, onMonthChange: handleMonthToChange, selectorView: 'full' }) }))));
|
|
119
120
|
};
|
|
120
121
|
|
package/views/static.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index_module = require('../index.module-
|
|
3
|
+
var index_module = require('../index.module-255b4286.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var cn = require('classnames');
|
|
6
6
|
var addMonths = require('date-fns/addMonths');
|
|
@@ -11,6 +11,7 @@ var subMonths = require('date-fns/subMonths');
|
|
|
11
11
|
var coreComponentsCalendar = require('@alfalab/core-components-calendar');
|
|
12
12
|
var coreComponentsCalendarInput = require('@alfalab/core-components-calendar-input');
|
|
13
13
|
var coreComponentsDateInput = require('@alfalab/core-components-date-input');
|
|
14
|
+
var components_divider_Component = require('../components/divider/Component.js');
|
|
14
15
|
var hooks = require('../hooks.js');
|
|
15
16
|
var utils = require('../utils.js');
|
|
16
17
|
require('date-fns/isEqual');
|
|
@@ -163,7 +164,7 @@ var CalendarRangeStatic = function (_a) {
|
|
|
163
164
|
? 'input'
|
|
164
165
|
: dateInputFromProps.mobileMode, value: inputFromValue, onChange: handleInputFromChange, onClear: handleClearFrom, onBlur: handleValidInputFrom, error: bothInvalid || inputFromInvalid || dateInputFromProps.error, clear: true, block: true })),
|
|
165
166
|
React__default.default.createElement(CalendarFromComponent, index_module.__assign({}, calendarFromProps, { className: cn__default.default(index_module.styles.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: maxDate && max__default.default([maxDate, endOfMonth__default.default(subMonths__default.default(maxDate, 1))]).getTime() }, rangeProps))),
|
|
166
|
-
React__default.default.createElement(
|
|
167
|
+
React__default.default.createElement(components_divider_Component.Divider, { inputFromProps: inputFromProps, inputToProps: inputToProps }),
|
|
167
168
|
React__default.default.createElement("div", null,
|
|
168
169
|
React__default.default.createElement(coreComponentsDateInput.DateInput, index_module.__assign({}, dateInputToProps, { mobileMode: dateInputToProps.mobileMode === 'popover'
|
|
169
170
|
? 'input'
|