@itcase/ui 1.8.177 → 1.8.179
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/dist/{DatePicker_cjs_Jt22mPR8.js → DatePicker_cjs_C4EKZl4o.js} +1 -1
- package/dist/{DatePicker_es_CbKQCO3U.js → DatePicker_es_B7Th76gy.js} +1 -1
- package/dist/{Input_cjs_CJOik_SP.js → Input_cjs_KgFCCi2U.js} +2 -2
- package/dist/{Input_es_Dboktsxf.js → Input_es_I8GPoibb.js} +2 -2
- package/dist/SelectContainer_cjs_BOMkYSVf.js +583 -0
- package/dist/SelectContainer_es_gcm20n4I.js +566 -0
- package/dist/cjs/components/Dadata.js +1 -1
- package/dist/cjs/components/DatePeriod.js +59 -37
- package/dist/cjs/components/DatePicker.js +2 -2
- package/dist/cjs/components/Input.js +1 -1
- package/dist/cjs/components/Select.js +40 -588
- package/dist/components/Dadata.js +1 -1
- package/dist/components/DatePeriod.js +60 -38
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/Select.js +21 -573
- package/dist/css/components/DatePeriod/DatePeriod.css +54 -92
- package/dist/css/styles/bundles.css +54 -92
- package/dist/types/components/DatePeriod/DatePeriod.appearance.d.ts +21 -4
- package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +1 -2
- package/dist/types/components/DatePeriod/appearance/datePeriodShape.d.ts +10 -0
- package/dist/types/components/DatePeriod/appearance/datePeriodSize.d.ts +9 -0
- package/dist/types/components/DatePeriod/appearance/datePeriodSurface.d.ts +2 -4
- package/package.json +3 -3
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { DateTime } from 'luxon';
|
|
5
5
|
import { DATE_PERIOD_INTERVALS } from '@itcase/common';
|
|
6
|
-
import { D as DatePickerInput } from '../
|
|
6
|
+
import { D as DatePickerInput } from '../DatePicker_es_B7Th76gy.js';
|
|
7
7
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
8
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
9
|
import { b as ChipsGroup, C as Chips } from '../ChipsGroup_es_BflE-5Q3.js';
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
12
|
-
import '../
|
|
10
|
+
import 'react-select';
|
|
11
|
+
import '../Icon_es_B02tKDTb.js';
|
|
12
|
+
import { a as SelectContainer } from '../SelectContainer_es_gcm20n4I.js';
|
|
13
13
|
import 'lodash/camelCase';
|
|
14
14
|
import 'lodash/maxBy';
|
|
15
15
|
import 'lodash/upperFirst';
|
|
16
16
|
import '../context/Notifications.js';
|
|
17
|
-
import 'uuid';
|
|
18
17
|
import '../context/UIContext.js';
|
|
18
|
+
import '../Group_es_BwTj-yH-.js';
|
|
19
|
+
import 'date-fns/locale';
|
|
20
|
+
import 'react-datepicker';
|
|
21
|
+
import '../hooks/useStyles/useStyles.js';
|
|
22
|
+
import '../hooks.js';
|
|
23
|
+
import '../hooks/useStyles/styleAttributes.js';
|
|
24
|
+
import 'uuid';
|
|
19
25
|
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
20
26
|
import 'react-responsive';
|
|
21
27
|
import '../utils/setViewportProperty.js';
|
|
22
|
-
import '../hooks.js';
|
|
23
|
-
import '../hooks/useStyles/styleAttributes.js';
|
|
24
28
|
import '../Button_es_Bns3_lNe.js';
|
|
25
|
-
import '../Icon_es_B02tKDTb.js';
|
|
26
|
-
import 'react-inlinesvg';
|
|
27
|
-
import '../hoc/urlWithAssetPrefix.js';
|
|
28
|
-
import '../context/UrlAssetPrefix.js';
|
|
29
29
|
import '../Link_es_P2b6ya7P.js';
|
|
30
|
-
import '../Text_es_RDU9GLCV.js';
|
|
31
30
|
import '../Loader_es_Dq2-7sn2.js';
|
|
32
|
-
import '../
|
|
31
|
+
import '../Text_es_RDU9GLCV.js';
|
|
32
|
+
import '../Input_es_I8GPoibb.js';
|
|
33
33
|
import '../Label_es_CwhSc0UL.js';
|
|
34
34
|
import '@itcase/icons/default';
|
|
35
35
|
import 'lodash/castArray';
|
|
36
|
+
import 'react-inlinesvg';
|
|
37
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
38
|
+
import '../context/UrlAssetPrefix.js';
|
|
39
|
+
import 'react-select/creatable';
|
|
40
|
+
import '../Divider_es_BiYozVBS.js';
|
|
36
41
|
|
|
37
42
|
const datePeriodAppearanceShape = {
|
|
38
43
|
circular: {
|
|
@@ -40,22 +45,32 @@ const datePeriodAppearanceShape = {
|
|
|
40
45
|
},
|
|
41
46
|
rounded: {
|
|
42
47
|
shape: 'rounded',
|
|
48
|
+
chipsShape: 'rounded',
|
|
49
|
+
selectShape: 'rounded',
|
|
43
50
|
},
|
|
44
51
|
roundedXL: {
|
|
45
52
|
shape: 'rounded',
|
|
46
53
|
shapeStrength: '2m',
|
|
54
|
+
chipsShape: 'rounded',
|
|
55
|
+
selectShape: 'rounded',
|
|
47
56
|
},
|
|
48
57
|
roundedL: {
|
|
49
58
|
shape: 'rounded',
|
|
50
59
|
shapeStrength: '1_5m',
|
|
60
|
+
chipsShape: 'rounded',
|
|
61
|
+
selectShape: 'rounded',
|
|
51
62
|
},
|
|
52
63
|
roundedM: {
|
|
53
64
|
shape: 'rounded',
|
|
54
65
|
shapeStrength: '1m',
|
|
66
|
+
chipsShape: 'rounded',
|
|
67
|
+
selectShape: 'rounded',
|
|
55
68
|
},
|
|
56
69
|
roundedS: {
|
|
57
70
|
shape: 'rounded',
|
|
58
71
|
shapeStrength: '0_5m',
|
|
72
|
+
chipsShape: 'rounded',
|
|
73
|
+
selectShape: 'rounded',
|
|
59
74
|
},
|
|
60
75
|
};
|
|
61
76
|
|
|
@@ -63,14 +78,23 @@ const datePeriodAppearanceSize = {
|
|
|
63
78
|
sizeL: {
|
|
64
79
|
size: 'l',
|
|
65
80
|
chipsAppearanceSize: 'sizeXL',
|
|
66
|
-
datePickerAppearanceSize: '
|
|
67
|
-
datePickerInputAppearanceSize: '
|
|
81
|
+
datePickerAppearanceSize: 'sizeL',
|
|
82
|
+
datePickerInputAppearanceSize: 'sizeL',
|
|
83
|
+
selectAppearanceSize: 'sizeL',
|
|
68
84
|
},
|
|
69
85
|
sizeM: {
|
|
70
86
|
size: 'm',
|
|
71
87
|
chipsAppearanceSize: 'sizeL',
|
|
72
88
|
datePickerAppearanceSize: 'sizeM',
|
|
73
89
|
datePickerInputAppearanceSize: 'sizeM',
|
|
90
|
+
selectAppearanceSize: 'sizeM',
|
|
91
|
+
},
|
|
92
|
+
sizeS: {
|
|
93
|
+
size: 's',
|
|
94
|
+
chipsAppearanceSize: 'sizeM',
|
|
95
|
+
datePickerAppearanceSize: 'sizeS',
|
|
96
|
+
datePickerInputAppearanceSize: 'sizeS',
|
|
97
|
+
selectAppearanceSize: 'sizeS',
|
|
74
98
|
},
|
|
75
99
|
};
|
|
76
100
|
|
|
@@ -78,18 +102,16 @@ const datePeriodAppearanceSurface = {
|
|
|
78
102
|
surfacePrimary: {
|
|
79
103
|
fill: 'surfacePrimary',
|
|
80
104
|
chipsAppearance: 'surfacePrimary ghost',
|
|
81
|
-
chipsShape: 'rounded',
|
|
82
105
|
datePickerAppearance: 'surfacePrimary',
|
|
83
106
|
datePickerInputAppearance: 'defaultPrimary',
|
|
84
|
-
|
|
107
|
+
selectAppearance: 'defaultPrimary solid',
|
|
85
108
|
},
|
|
86
109
|
surfaceSecondary: {
|
|
87
110
|
fill: 'surfaceSecondary',
|
|
88
111
|
chipsAppearance: 'surfacePrimary ghost',
|
|
89
|
-
chipsShape: 'rounded',
|
|
90
112
|
datePickerAppearance: 'surfacePrimary',
|
|
91
113
|
datePickerInputAppearance: 'defaultPrimary',
|
|
92
|
-
|
|
114
|
+
selectAppearance: 'defaultPrimary solid',
|
|
93
115
|
},
|
|
94
116
|
};
|
|
95
117
|
|
|
@@ -106,10 +128,10 @@ const datePeriodConfig = {
|
|
|
106
128
|
},
|
|
107
129
|
};
|
|
108
130
|
function DatePeriod(props) {
|
|
109
|
-
const { appearance, className, datePeriodIntervalsList = Object.values(DATE_PERIOD_INTERVALS), datePeriodValueEnd, datePeriodValueStart, monthsShown, selectsRange = true, showWeekNumbers = true, isDisabled, isSkeleton, onChangeDatePeriod, onKeyDown, } = props;
|
|
131
|
+
const { appearance, className, datePeriodIntervalsList = Object.values(DATE_PERIOD_INTERVALS), datePeriodSelectOptions, datePeriodSelectValue, selectPlaceholder, datePeriodValueEnd, datePeriodValueStart, monthsShown, selectsRange = true, showWeekNumbers = true, isDisabled, isSkeleton, onChangeDatePeriod, onChangeDatePeriodSelect, onKeyDown, } = props;
|
|
110
132
|
const appearanceConfig = useAppearanceConfig(appearance, datePeriodConfig, isDisabled);
|
|
111
133
|
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
112
|
-
const { fillClass, chipsAppearance, chipsAppearanceSize, chipsShape, datePickerAppearance, datePickerAppearanceSize, datePickerInputAppearance, datePickerInputAppearanceSize, datePickerInputFillHover,
|
|
134
|
+
const { fillClass, chipsAppearance, chipsAppearanceSize, selectAppearance, selectAppearanceSize, chipsShape, selectShape, datePickerAppearance, datePickerAppearanceSize, datePickerInputAppearance, datePickerInputAppearanceSize, datePickerInputFillHover, datePickerInputTextSize, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
113
135
|
const onClickPeriodChips = useCallback((selectedPeriodItem) => {
|
|
114
136
|
const dateStartIso = selectedPeriodItem.dateIntervalsList[0];
|
|
115
137
|
const dateEndIso = selectedPeriodItem.dateIntervalsList[1];
|
|
@@ -129,22 +151,22 @@ function DatePeriod(props) {
|
|
|
129
151
|
return (dateStartIso === normalizedDatePeriodValueStart &&
|
|
130
152
|
dateEndIso === normalizedDatePeriodValueEnd);
|
|
131
153
|
}, [datePeriodValueEnd, datePeriodValueStart]);
|
|
132
|
-
return (
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
154
|
+
return (jsxs("div", { className: clsx(className, 'date-period', sizeClass && `date-period_size_${sizeClass}`, isSkeleton && `date-period_skeleton`), children: [jsxs("div", { className: clsx('date-period__wrapper', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, fillClass && `fill_${fillClass}`, 'cursor_type_pointer'), children: [jsx(ChipsGroup, { className: "date-period__choice", direction: "horizontal", children: datePeriodIntervalsList.map((datePeriodItem) => (jsx(Chips, { appearance: `${chipsAppearance} ${chipsAppearanceSize}`, label: datePeriodItem.label, shape: chipsShape, isActive: checkIsChipsActive(datePeriodItem), onClick: () => onClickPeriodChips(datePeriodItem) }, datePeriodItem.value))) }), jsx(DatePickerInput, { className: "date-period__datepicker", datePickerProps: {
|
|
155
|
+
appearance: `${datePickerAppearance} ${datePickerAppearanceSize}`,
|
|
156
|
+
dateFormat: 'dd/MM/yyyy',
|
|
157
|
+
monthsShown: monthsShown,
|
|
158
|
+
selectsRange: selectsRange,
|
|
159
|
+
showWeekNumbers: showWeekNumbers,
|
|
160
|
+
isClearable: false,
|
|
161
|
+
isStartDefaultNull: true,
|
|
162
|
+
onKeyDown: onKeyDown,
|
|
163
|
+
}, endValue: datePeriodValueEnd, inputProps: {
|
|
164
|
+
appearance: `${datePickerInputAppearance} ${datePickerInputAppearanceSize} ghost`,
|
|
165
|
+
className: `date-period__datepicker-input date-period__datepicker-input_size_${sizeClass} `,
|
|
166
|
+
fillHover: datePickerInputFillHover,
|
|
167
|
+
textSize: datePickerInputTextSize,
|
|
168
|
+
placeholder: 'Выбрать период',
|
|
169
|
+
}, value: datePeriodValueStart, onChange: onChangeDatePeriod })] }), jsx(SelectContainer, { appearance: `${selectAppearance} ${selectAppearanceSize}`, className: "date-period__select", width: "180px", minWidth: "180px", options: datePeriodSelectOptions, placeholder: selectPlaceholder, shape: selectShape, value: datePeriodSelectValue, isSearchable: true, onChange: onChangeDatePeriodSelect })] }));
|
|
148
170
|
}
|
|
149
171
|
|
|
150
172
|
export { DatePeriod, datePeriodAppearance, datePeriodConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../
|
|
1
|
+
export { D as DatePickerInput, a as datePickerAppearance, d as datePickerConfig } from '../DatePicker_es_B7Th76gy.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'clsx';
|
|
@@ -28,6 +28,6 @@ import '../context/UrlAssetPrefix.js';
|
|
|
28
28
|
import '../Link_es_P2b6ya7P.js';
|
|
29
29
|
import '../Text_es_RDU9GLCV.js';
|
|
30
30
|
import '../Loader_es_Dq2-7sn2.js';
|
|
31
|
-
import '../
|
|
31
|
+
import '../Input_es_I8GPoibb.js';
|
|
32
32
|
import '../Label_es_CwhSc0UL.js';
|
|
33
33
|
import '@itcase/icons/default';
|
package/dist/components/Input.js
CHANGED