@itcase/ui 1.8.176 → 1.8.178
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 +2 -2
|
@@ -1,584 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
11
|
-
import { icons12, icons16, icons14, icons24 } from '@itcase/icons/default';
|
|
12
|
-
import { L as Loader } from '../Loader_es_Dq2-7sn2.js';
|
|
13
|
-
import { D as Divider } from '../Divider_es_BiYozVBS.js';
|
|
14
|
-
import 'react-inlinesvg';
|
|
15
|
-
import '../hoc/urlWithAssetPrefix.js';
|
|
16
|
-
import '@itcase/common';
|
|
17
|
-
import '../context/UrlAssetPrefix.js';
|
|
18
|
-
import '../hooks/useStyles/useStyles.js';
|
|
1
|
+
export { a as Select, S as SelectClearIndicator, b as SelectControl, c as SelectDropdownIndicator, d as SelectGroupHeading, e as SelectIndicatorsContainer, f as SelectInput, g as SelectMenu, h as SelectMultiValueContainer, i as SelectMultiValueLabel, j as SelectMultiValueRemove, k as SelectOption, l as SelectPlaceholder, m as SelectSingleValue, n as SelectValueContainer, s as selectConfig } from '../SelectContainer_es_gcm20n4I.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'clsx';
|
|
5
|
+
import 'react-select';
|
|
6
|
+
import 'react-select/creatable';
|
|
7
|
+
import '../Group_es_BwTj-yH-.js';
|
|
8
|
+
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
9
|
+
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
19
10
|
import 'lodash/camelCase';
|
|
20
|
-
import 'lodash/
|
|
11
|
+
import 'lodash/castArray';
|
|
21
12
|
import 'lodash/upperFirst';
|
|
22
13
|
import '../context/Notifications.js';
|
|
23
14
|
import 'uuid';
|
|
15
|
+
import '@itcase/common';
|
|
24
16
|
import '../context/UIContext.js';
|
|
25
17
|
import '../hooks/useMediaQueries/useMediaQueries.js';
|
|
26
18
|
import 'react-responsive';
|
|
27
19
|
import '../utils/setViewportProperty.js';
|
|
28
20
|
import '../hooks.js';
|
|
29
21
|
import '../hooks/useStyles/styleAttributes.js';
|
|
22
|
+
import '../hooks/useStyles/useStyles.js';
|
|
23
|
+
import 'lodash/maxBy';
|
|
24
|
+
import '../Text_es_RDU9GLCV.js';
|
|
25
|
+
import '@itcase/icons/default';
|
|
26
|
+
import '../Icon_es_B02tKDTb.js';
|
|
27
|
+
import 'react-inlinesvg';
|
|
28
|
+
import '../hoc/urlWithAssetPrefix.js';
|
|
29
|
+
import '../context/UrlAssetPrefix.js';
|
|
30
30
|
import '../Link_es_P2b6ya7P.js';
|
|
31
|
-
import '
|
|
32
|
-
|
|
33
|
-
// interface ClearIndicatorProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>>
|
|
34
|
-
// extends DefaultClearIndicatorProps<Option, IsMulti, Group> {}
|
|
35
|
-
// For use memo need to check "ClearIndicator" props
|
|
36
|
-
// const SelectClearIndicator = React.memo(
|
|
37
|
-
const SelectClearIndicator = (props) => {
|
|
38
|
-
const { children } = props;
|
|
39
|
-
const { clearIcon, clearIconFill } = props.selectProps;
|
|
40
|
-
return (jsx(components.ClearIndicator, { ...props, children: clearIcon ? (jsx(Icon, { iconFill: clearIconFill, SvgImage: clearIcon })) : (children) }));
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const SelectLoadingMessage = (props) => {
|
|
44
|
-
const { loadingMessageText, loadingMessageTextColor, loadingMessageTextSize, } = props.selectProps;
|
|
45
|
-
return (jsx(Group, { textAlign: "center", children: jsx(Text, { size: loadingMessageTextSize, textColor: loadingMessageTextColor, children: loadingMessageText }) }));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const selectAppearanceDefault = {
|
|
49
|
-
defaultPrimary: {
|
|
50
|
-
fill: 'surfaceSecondary',
|
|
51
|
-
fillHover: 'surfaceTertiary',
|
|
52
|
-
optionFillDisabled: 'surfaceSecondary',
|
|
53
|
-
optionTextColorDisabled: 'surfaceTextQuaternary',
|
|
54
|
-
borderColor: 'surfaceBorderTertiary',
|
|
55
|
-
borderColorHover: 'surfaceBorderQuaternary',
|
|
56
|
-
elevation: 8,
|
|
57
|
-
badgeAppearance: 'accent',
|
|
58
|
-
clearIconFill: 'surfaceItemQuaternary',
|
|
59
|
-
dropdownIconFill: 'surfaceItemQuaternary',
|
|
60
|
-
groupFill: 'surfaceSecondary',
|
|
61
|
-
groupTextColor: 'surfaceTextPrimary',
|
|
62
|
-
groupTextWeight: '600',
|
|
63
|
-
inputCaretColor: 'accentPrimary',
|
|
64
|
-
inputTextColor: 'surfaceTextPrimary',
|
|
65
|
-
loaderAppearance: 'accentPrimary sizeS ghost',
|
|
66
|
-
loadingMessageTextColor: 'surfaceTextPrimary',
|
|
67
|
-
menuFill: 'surfacePrimary',
|
|
68
|
-
multipleItemFill: 'accentPrimary',
|
|
69
|
-
multipleItemFillHover: 'accentSecondary',
|
|
70
|
-
multipleItemIconFill: 'accentItemPrimary',
|
|
71
|
-
multipleItemTextColor: 'accentTextPrimary',
|
|
72
|
-
multipleTextColor: 'accentTextPrimary',
|
|
73
|
-
noOptionsTextColor: 'surfaceTextPrimary',
|
|
74
|
-
optionBorder: 'none',
|
|
75
|
-
optionFill: 'surfacePrimary',
|
|
76
|
-
optionFillActive: 'accentPrimary',
|
|
77
|
-
optionFillActiveHover: 'accentSecondary',
|
|
78
|
-
optionFillHover: 'surfaceSecondary',
|
|
79
|
-
optionSelectedIconFillIcon: 'successItemPrimary',
|
|
80
|
-
optionTextColor: 'surfaceTextPrimary',
|
|
81
|
-
optionTextColorActive: 'accentTextPrimary',
|
|
82
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
83
|
-
requiredInputBorderColor: 'warningBorderPrimary',
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const selectAppearanceDisabled = {
|
|
88
|
-
disabledPrimary: {
|
|
89
|
-
elevation: 8,
|
|
90
|
-
badgeAppearance: 'accent',
|
|
91
|
-
clearIconFill: 'surfaceItemDisabled',
|
|
92
|
-
dropdownIconFill: 'surfaceItemDisabled',
|
|
93
|
-
headingFill: 'surfaceSecondary',
|
|
94
|
-
headingTextColor: 'surfaceTextPrimary',
|
|
95
|
-
inputBorderColor: 'surfaceBorderTertiary',
|
|
96
|
-
inputBorderColorHover: 'surfaceBorderQuaternary',
|
|
97
|
-
inputCaretColor: 'secondaryItemPrimary',
|
|
98
|
-
inputFill: 'surfaceDisabled',
|
|
99
|
-
inputShape: 'rounded',
|
|
100
|
-
inputTextColor: 'surfaceTextPrimary',
|
|
101
|
-
multipleItemFill: 'accentPrimary',
|
|
102
|
-
multipleItemFillHover: 'surfaceHover',
|
|
103
|
-
multipleItemIconFill: 'accentItemPrimary',
|
|
104
|
-
multipleItemTextColor: 'accentTextPrimary',
|
|
105
|
-
multipleTextColor: 'accentTextPrimary',
|
|
106
|
-
noOptionsTextColor: 'surfaceTextPrimary',
|
|
107
|
-
optionBorder: 'none',
|
|
108
|
-
optionFill: 'surfacePrimary',
|
|
109
|
-
optionFillHover: 'surfaceSecondary',
|
|
110
|
-
optionShape: 'rounded',
|
|
111
|
-
optionTextColor: 'surfaceTextPrimary',
|
|
112
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
113
|
-
requiredInputBorderColor: 'warningBorderPrimary',
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const selectAppearanceError = {
|
|
118
|
-
errorPrimary: {
|
|
119
|
-
fill: 'errorTertiary',
|
|
120
|
-
fillHover: 'errorTertiary',
|
|
121
|
-
optionFillDisabled: 'surfaceSecondary',
|
|
122
|
-
optionTextColorDisabled: 'surfaceTextQuaternary',
|
|
123
|
-
borderColor: 'surfaceBorderTertiary',
|
|
124
|
-
borderColorHover: 'surfaceBorderQuaternary',
|
|
125
|
-
elevation: 8,
|
|
126
|
-
badgeAppearance: 'accent',
|
|
127
|
-
clearIconFill: 'surfaceItemQuaternary',
|
|
128
|
-
dropdownIconFill: 'surfaceItemQuaternary',
|
|
129
|
-
groupFill: 'surfaceSecondary',
|
|
130
|
-
groupTextColor: 'surfaceTextPrimary',
|
|
131
|
-
groupTextWeight: '600',
|
|
132
|
-
inputCaretColor: 'accentPrimary',
|
|
133
|
-
inputTextColor: 'surfaceTextPrimary',
|
|
134
|
-
loaderAppearance: 'accentPrimary sizeS ghost',
|
|
135
|
-
loadingMessageTextColor: 'surfaceTextPrimary',
|
|
136
|
-
menuFill: 'surfacePrimary',
|
|
137
|
-
multipleItemFill: 'accentPrimary',
|
|
138
|
-
multipleItemFillHover: 'accentSecondary',
|
|
139
|
-
multipleItemIconFill: 'accentItemPrimary',
|
|
140
|
-
multipleItemTextColor: 'accentTextPrimary',
|
|
141
|
-
multipleTextColor: 'accentTextPrimary',
|
|
142
|
-
noOptionsTextColor: 'surfaceTextPrimary',
|
|
143
|
-
optionBorder: 'none',
|
|
144
|
-
optionFill: 'surfacePrimary',
|
|
145
|
-
optionFillActive: 'accentPrimary',
|
|
146
|
-
optionFillActiveHover: 'accentSecondary',
|
|
147
|
-
optionFillHover: 'surfaceSecondary',
|
|
148
|
-
optionSelectedIconFillIcon: 'successItemPrimary',
|
|
149
|
-
optionTextColor: 'surfaceTextPrimary',
|
|
150
|
-
optionTextColorActive: 'accentTextPrimary',
|
|
151
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
152
|
-
requiredInputBorderColor: 'warningBorderPrimary',
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const selectAppearanceRequire = {
|
|
157
|
-
requirePrimary: {
|
|
158
|
-
fill: 'warningTertiary',
|
|
159
|
-
fillHover: 'warningTertiary',
|
|
160
|
-
optionFillDisabled: 'surfaceSecondary',
|
|
161
|
-
optionTextColorDisabled: 'surfaceTextQuaternary',
|
|
162
|
-
borderColor: 'surfaceBorderTertiary',
|
|
163
|
-
borderColorHover: 'surfaceBorderQuaternary',
|
|
164
|
-
elevation: 8,
|
|
165
|
-
badgeAppearance: 'accent',
|
|
166
|
-
clearIconFill: 'surfaceItemQuaternary',
|
|
167
|
-
dropdownIconFill: 'surfaceItemQuaternary',
|
|
168
|
-
groupFill: 'surfaceSecondary',
|
|
169
|
-
groupTextColor: 'surfaceTextPrimary',
|
|
170
|
-
groupTextWeight: '600',
|
|
171
|
-
inputCaretColor: 'accentPrimary',
|
|
172
|
-
inputTextColor: 'surfaceTextPrimary',
|
|
173
|
-
loaderAppearance: 'accentPrimary sizeS ghost',
|
|
174
|
-
loadingMessageTextColor: 'surfaceTextPrimary',
|
|
175
|
-
menuFill: 'surfacePrimary',
|
|
176
|
-
multipleItemFill: 'accentPrimary',
|
|
177
|
-
multipleItemFillHover: 'accentSecondary',
|
|
178
|
-
multipleItemIconFill: 'accentItemPrimary',
|
|
179
|
-
multipleItemTextColor: 'accentTextPrimary',
|
|
180
|
-
multipleTextColor: 'accentTextPrimary',
|
|
181
|
-
noOptionsTextColor: 'surfaceTextPrimary',
|
|
182
|
-
optionBorder: 'none',
|
|
183
|
-
optionFill: 'surfacePrimary',
|
|
184
|
-
optionFillActive: 'accentPrimary',
|
|
185
|
-
optionFillActiveHover: 'accentSecondary',
|
|
186
|
-
optionFillHover: 'surfaceSecondary',
|
|
187
|
-
optionSelectedIconFillIcon: 'successItemPrimary',
|
|
188
|
-
optionTextColor: 'surfaceTextPrimary',
|
|
189
|
-
optionTextColorActive: 'accentTextPrimary',
|
|
190
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
191
|
-
requiredInputBorderColor: 'warningBorderPrimary',
|
|
192
|
-
},
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
const selectAppearanceShape = {
|
|
196
|
-
rounded: {
|
|
197
|
-
multipleItemShapeRadius: '1m',
|
|
198
|
-
shape: 'rounded',
|
|
199
|
-
},
|
|
200
|
-
roundedXL: {
|
|
201
|
-
multipleItemShapeRadius: '1m',
|
|
202
|
-
shape: 'rounded',
|
|
203
|
-
shapeStrength: '2m',
|
|
204
|
-
},
|
|
205
|
-
roundedL: {
|
|
206
|
-
multipleItemShapeRadius: '1m',
|
|
207
|
-
shape: 'rounded',
|
|
208
|
-
shapeStrength: '1_5m',
|
|
209
|
-
},
|
|
210
|
-
roundedM: {
|
|
211
|
-
multipleItemShapeRadius: '1m',
|
|
212
|
-
shape: 'rounded',
|
|
213
|
-
shapeStrength: '1m',
|
|
214
|
-
},
|
|
215
|
-
roundedS: {
|
|
216
|
-
multipleItemShapeRadius: '1m',
|
|
217
|
-
shape: 'rounded',
|
|
218
|
-
shapeStrength: '0_5m',
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
const selectAppearanceSize = {
|
|
223
|
-
sizeXL: {
|
|
224
|
-
size: 'xl',
|
|
225
|
-
textLoadingMessageAppearance: 'sizeM',
|
|
226
|
-
badgeSize: 'm',
|
|
227
|
-
badgeTextSize: 'm',
|
|
228
|
-
clearIcon: icons24.Action.Clear,
|
|
229
|
-
dividerSize: 'xxs',
|
|
230
|
-
dropdownIcon: icons24.Arrow.ChevronDownSmall,
|
|
231
|
-
groupTextSize: 'm',
|
|
232
|
-
headingTextWeight: '600',
|
|
233
|
-
inputTextSize: 'm',
|
|
234
|
-
menuItemSize: 'l',
|
|
235
|
-
multipleItemIcon: icons16.Action.Close,
|
|
236
|
-
multipleItemTextSize: 's',
|
|
237
|
-
noOptionsTextSize: 's',
|
|
238
|
-
optionSelectedIcon: icons16.Form.Check,
|
|
239
|
-
optionTextSize: 'm',
|
|
240
|
-
placeholderTextSize: 'm',
|
|
241
|
-
},
|
|
242
|
-
sizeL: {
|
|
243
|
-
size: 'l',
|
|
244
|
-
textLoadingMessageAppearance: 'sizeM',
|
|
245
|
-
badgeSize: 'm',
|
|
246
|
-
badgeTextSize: 'm',
|
|
247
|
-
clearIcon: icons24.Action.Clear,
|
|
248
|
-
dividerSize: 'xxs',
|
|
249
|
-
dropdownIcon: icons24.Arrow.ChevronDownSmall,
|
|
250
|
-
groupTextSize: 'm',
|
|
251
|
-
headingTextWeight: '600',
|
|
252
|
-
inputTextSize: 'm',
|
|
253
|
-
menuItemSize: 'l',
|
|
254
|
-
multipleItemIcon: icons16.Action.Close,
|
|
255
|
-
multipleItemTextSize: 's',
|
|
256
|
-
noOptionsTextSize: 'm',
|
|
257
|
-
optionSelectedIcon: icons16.Form.Check,
|
|
258
|
-
optionTextSize: 'm',
|
|
259
|
-
placeholderTextSize: 'm',
|
|
260
|
-
},
|
|
261
|
-
sizeM: {
|
|
262
|
-
size: 'm',
|
|
263
|
-
textLoadingMessageAppearance: 'sizeM',
|
|
264
|
-
badgeSize: 'm',
|
|
265
|
-
badgeTextSize: 'm',
|
|
266
|
-
clearIcon: icons24.Action.Clear,
|
|
267
|
-
dividerSize: 'xxs',
|
|
268
|
-
dropdownIcon: icons24.Arrow.ChevronDownSmall,
|
|
269
|
-
groupTextSize: 'm',
|
|
270
|
-
inputTextSize: 'm',
|
|
271
|
-
loadingMessageTextSize: 'm',
|
|
272
|
-
menuItemSize: 'l',
|
|
273
|
-
multipleItemIcon: icons14.Action.Close,
|
|
274
|
-
multipleItemTextSize: 'xs ',
|
|
275
|
-
noOptionsTextSize: 'm',
|
|
276
|
-
optionSelectedIcon: icons14.Form.Check,
|
|
277
|
-
optionTextSize: 'm',
|
|
278
|
-
placeholderTextSize: 'm',
|
|
279
|
-
},
|
|
280
|
-
sizeS: {
|
|
281
|
-
size: 's',
|
|
282
|
-
textLoadingMessageAppearance: 'sizeS',
|
|
283
|
-
badgeSize: 'm',
|
|
284
|
-
badgeTextSize: 'm',
|
|
285
|
-
clearIcon: icons24.Action.Clear,
|
|
286
|
-
dividerSize: 'xxs',
|
|
287
|
-
dropdownIcon: icons24.Arrow.ChevronDownSmall,
|
|
288
|
-
groupTextSize: 'm',
|
|
289
|
-
headingTextWeight: '600',
|
|
290
|
-
inputTextSize: 's',
|
|
291
|
-
menuItemSize: 'l',
|
|
292
|
-
multipleItemIcon: icons14.Action.Close,
|
|
293
|
-
multipleItemTextSize: 'xs ',
|
|
294
|
-
noOptionsTextSize: 's',
|
|
295
|
-
optionSelectedIcon: icons14.Form.Check,
|
|
296
|
-
optionTextSize: 's',
|
|
297
|
-
placeholderTextSize: 's',
|
|
298
|
-
},
|
|
299
|
-
sizeXS: {
|
|
300
|
-
size: 'xs',
|
|
301
|
-
textLoadingMessageAppearance: 'sizeXS',
|
|
302
|
-
badgeSize: 'm',
|
|
303
|
-
badgeTextSize: 'm',
|
|
304
|
-
clearIcon: icons16.Action.Clear,
|
|
305
|
-
dividerSize: 'xxs',
|
|
306
|
-
dropdownIcon: icons16.Arrow.ChevronDownSmall,
|
|
307
|
-
groupTextSize: 'm',
|
|
308
|
-
headingTextWeight: '600',
|
|
309
|
-
inputTextSize: 'xs ',
|
|
310
|
-
menuItemSize: 'l',
|
|
311
|
-
multipleItemIcon: icons12.Action.Close,
|
|
312
|
-
multipleItemTextSize: 'xxs',
|
|
313
|
-
noOptionsTextSize: 'xs',
|
|
314
|
-
// optionSelectedIcon: icons12.Form.Check,
|
|
315
|
-
optionTextSize: 'xs',
|
|
316
|
-
placeholderTextSize: 'xs',
|
|
317
|
-
},
|
|
318
|
-
sizeXXS: {
|
|
319
|
-
size: 'xxs',
|
|
320
|
-
textLoadingMessageAppearance: 'sizeXS',
|
|
321
|
-
badgeSize: 'm',
|
|
322
|
-
badgeTextSize: 'm',
|
|
323
|
-
clearIcon: icons16.Action.Clear,
|
|
324
|
-
dividerSize: 'xxs',
|
|
325
|
-
dropdownIcon: icons16.Arrow.ChevronDownSmall,
|
|
326
|
-
groupTextSize: 'm',
|
|
327
|
-
headingTextWeight: '600',
|
|
328
|
-
inputTextSize: 'xs',
|
|
329
|
-
menuItemSize: 'l',
|
|
330
|
-
multipleItemIcon: icons12.Action.Close,
|
|
331
|
-
// optionSelectedIcon: icons12.Form.Check,
|
|
332
|
-
multipleItemTextSize: 'xxs',
|
|
333
|
-
noOptionsTextSize: 'xs',
|
|
334
|
-
optionTextSize: 'xs',
|
|
335
|
-
placeholderTextSize: 'xs',
|
|
336
|
-
},
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
const selectAppearanceStyle = {
|
|
340
|
-
solid: {
|
|
341
|
-
borderColor: 'none',
|
|
342
|
-
borderColorHover: 'none',
|
|
343
|
-
},
|
|
344
|
-
outlined: {
|
|
345
|
-
fill: 'none',
|
|
346
|
-
fillHover: 'none',
|
|
347
|
-
},
|
|
348
|
-
full: {},
|
|
349
|
-
ghost: {
|
|
350
|
-
fill: 'none',
|
|
351
|
-
borderColor: 'none',
|
|
352
|
-
borderColorHover: 'none',
|
|
353
|
-
},
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
const selectAppearanceSuccess = {
|
|
357
|
-
successPrimary: {
|
|
358
|
-
fill: 'successTertiary',
|
|
359
|
-
fillHover: 'successTertiary',
|
|
360
|
-
optionFillDisabled: 'surfaceSecondary',
|
|
361
|
-
optionTextColorDisabled: 'surfaceTextQuaternary',
|
|
362
|
-
borderColor: 'surfaceBorderTertiary',
|
|
363
|
-
borderColorHover: 'surfaceBorderQuaternary',
|
|
364
|
-
elevation: 8,
|
|
365
|
-
badgeAppearance: 'accent',
|
|
366
|
-
clearIconFill: 'surfaceItemQuaternary',
|
|
367
|
-
dropdownIconFill: 'surfaceItemQuaternary',
|
|
368
|
-
groupFill: 'surfaceSecondary',
|
|
369
|
-
groupTextColor: 'surfaceTextPrimary',
|
|
370
|
-
groupTextWeight: '600',
|
|
371
|
-
inputCaretColor: 'accentPrimary',
|
|
372
|
-
inputTextColor: 'surfaceTextPrimary',
|
|
373
|
-
loaderAppearance: 'accentPrimary sizeS ghost',
|
|
374
|
-
loadingMessageTextColor: 'surfaceTextPrimary',
|
|
375
|
-
menuFill: 'surfacePrimary',
|
|
376
|
-
multipleItemFill: 'accentPrimary',
|
|
377
|
-
multipleItemFillHover: 'accentSecondary',
|
|
378
|
-
multipleItemIconFill: 'accentItemPrimary',
|
|
379
|
-
multipleItemTextColor: 'accentTextPrimary',
|
|
380
|
-
multipleTextColor: 'accentTextPrimary',
|
|
381
|
-
noOptionsTextColor: 'surfaceTextPrimary',
|
|
382
|
-
optionBorder: 'none',
|
|
383
|
-
optionFill: 'surfacePrimary',
|
|
384
|
-
optionFillActive: 'accentPrimary',
|
|
385
|
-
optionFillActiveHover: 'accentSecondary',
|
|
386
|
-
optionFillHover: 'surfaceSecondary',
|
|
387
|
-
optionSelectedIconFillIcon: 'successItemPrimary',
|
|
388
|
-
optionTextColor: 'surfaceTextPrimary',
|
|
389
|
-
optionTextColorActive: 'accentTextPrimary',
|
|
390
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
391
|
-
requiredInputBorderColor: 'warningBorderPrimary',
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
const selectAppearance = {
|
|
396
|
-
...selectAppearanceRequire,
|
|
397
|
-
...selectAppearanceDefault,
|
|
398
|
-
...selectAppearanceDisabled,
|
|
399
|
-
...selectAppearanceSuccess,
|
|
400
|
-
...selectAppearanceSize,
|
|
401
|
-
...selectAppearanceError,
|
|
402
|
-
...selectAppearanceShape,
|
|
403
|
-
...selectAppearanceStyle,
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
const SelectControl = (props) => {
|
|
407
|
-
const { before, after } = props.selectProps;
|
|
408
|
-
return (jsxs(React.Fragment, { children: [before, jsx(components.Control, { ...props, className: clsx('select__control') }), after] }));
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// For use memo need to check "DropdownIndicator" props
|
|
412
|
-
// const SelectDropdownIndicator = React.memo(
|
|
413
|
-
const SelectDropdownIndicator = (props) => {
|
|
414
|
-
const { children } = props;
|
|
415
|
-
const { dropdownFillHover, dropdownIcon, dropdownIconFill, dropdownIconShape, } = props.selectProps;
|
|
416
|
-
return (jsx(components.DropdownIndicator, { ...props, children: dropdownIcon ? (jsx(Icon, { fillHover: dropdownFillHover, iconFill: dropdownIconFill, shape: dropdownIconShape, SvgImage: dropdownIcon })) : (children) }));
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
const SelectGroupHeading = (props) => {
|
|
420
|
-
const { groupFill, groupTextColor, groupTextSize, groupTextWeight } = props.selectProps;
|
|
421
|
-
return (jsx(components.GroupHeading, { ...props, className: clsx('select__menu-group-heading', groupFill && `fill_${groupFill}`), children: jsx(Text, { size: groupTextSize, textColor: groupTextColor, textWeight: groupTextWeight, children: props.data.label }) }));
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
const SelectIndicatorsContainer = (props) => {
|
|
425
|
-
const { badgeAppearance, badgeSize, badgeTextSize, showBadge, value } = props.selectProps;
|
|
426
|
-
return (jsxs(components.IndicatorsContainer, { ...props, children: [showBadge &&
|
|
427
|
-
value &&
|
|
428
|
-
// @ts-expect-error
|
|
429
|
-
value?.length > 0 ? (jsx(Badge, { appearance: badgeAppearance, size: badgeSize, textSize: badgeTextSize,
|
|
430
|
-
// @ts-expect-error
|
|
431
|
-
value: value.length.toString() })) : null, props.children] }));
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
const SelectInput = (props) => {
|
|
435
|
-
const { inputCaretColor, inputTextColor, inputTextSize } = props.selectProps;
|
|
436
|
-
return (jsx(components.Input, { ...props, className: clsx(inputTextSize && `text_size_${inputTextSize}`, inputTextColor && `text-color_${inputTextColor}`, inputCaretColor && `caret-color_${inputCaretColor}`) }));
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
const SelectLoadingIndicator = (props) => {
|
|
440
|
-
const { loaderAppearance, isLoading } = props.selectProps;
|
|
441
|
-
return isLoading && jsx(Loader, { appearance: loaderAppearance });
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
const SelectMenu = (props) => {
|
|
445
|
-
const { elevation, menuAfter, menuBefore, menuFill, menuShape, menuShapeStrength, } = props.selectProps;
|
|
446
|
-
return (jsxs(components.Menu, { ...props, className: clsx(menuFill && `fill_${menuFill}`, menuShape && `shape_${menuShape}`, menuShapeStrength && `shape-strength_${menuShapeStrength}`, elevation && `elevation_${elevation}`), children: [menuBefore, props.selectProps.fetchingData ? (jsx("span", { className: "fetching", children: "Fetching data..." })) : (jsx(React.Fragment, { children: props.children })), menuAfter] }));
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
const SelectMultiValueContainer = (props) => {
|
|
450
|
-
const { multipleItemFill, multipleItemFillHover, multipleItemShapeRadius } = props.selectProps;
|
|
451
|
-
return (jsx(components.MultiValueContainer, { ...props, children: jsx(Group, { className: clsx('select__multi-value-item'), direction: "horizontal", alignItems: "center", fill: multipleItemFill, fillHover: multipleItemFillHover, borderRadius: multipleItemShapeRadius, gap: "0.5m", children: props.children }) }));
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
const SelectMultiValueLabel = (props) => {
|
|
455
|
-
const { multipleItemTextColor, multipleItemTextSize } = props.selectProps;
|
|
456
|
-
return (jsx(components.MultiValueLabel, { ...props, children: props.data && (jsx(Text, { size: multipleItemTextSize, textColor: multipleItemTextColor, children: props.data.label })) }));
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
const SelectMultiValueRemove = (props) => {
|
|
460
|
-
const { multipleItemIcon, multipleItemIconFill } = props.selectProps;
|
|
461
|
-
return (jsx(components.MultiValueRemove, { ...props, children: jsx(Icon, { iconFill: multipleItemIconFill, SvgImage: multipleItemIcon }) }));
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
const SelectNoOptions = (props) => {
|
|
465
|
-
const { inputValue, noOptionsSearchText, noOptionsText, noOptionsTextColor, noOptionsTextSize, optionFill, } = props.selectProps;
|
|
466
|
-
return (jsx(components.NoOptionsMessage, { ...props, className: clsx(optionFill && `fill_${optionFill}`), children: jsx(Group, { textAlign: "center", children: jsx(Text, { size: noOptionsTextSize, textColor: noOptionsTextColor, children: inputValue && noOptionsSearchText
|
|
467
|
-
? noOptionsSearchText
|
|
468
|
-
: noOptionsText }) }) }));
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
const SelectOption = (props) => {
|
|
472
|
-
const { label, isSelected } = props;
|
|
473
|
-
const { optionFillActiveDisabled, optionFillDisabled, optionTextColorDisabled, dividerDirection, dividerFill, dividerSize, menuItemSize, optionAfter, optionBefore, optionBorder, optionBorderType, optionFill, optionFillActive, optionFillActiveHover, optionFillHover, optionSelectedIcon, optionSelectedIconFillIcon, optionSelectedIconSize, optionSelectedIconSrc, optionShape, optionShapeStrength, optionTextColor, optionTextColorActive, optionTextSize, showDivider, } = props.selectProps;
|
|
474
|
-
return (jsxs(components.Option, { ...props, className: clsx('select__menu-list-item', isSelected || props.isSelected
|
|
475
|
-
? !props.isDisabled
|
|
476
|
-
? optionFillActive && `fill_active_${optionFillActive}`
|
|
477
|
-
: optionFillActiveDisabled &&
|
|
478
|
-
`fill_active_disabled_${optionFillActiveDisabled}`
|
|
479
|
-
: !props.isDisabled
|
|
480
|
-
? optionFill && `fill_${optionFill}`
|
|
481
|
-
: optionFillDisabled && `fill_${optionFillDisabled}`, (isSelected || props.isSelected) &&
|
|
482
|
-
!props.isDisabled &&
|
|
483
|
-
optionFillActiveHover &&
|
|
484
|
-
`fill_active_hover_${optionFillActiveHover}`, !isSelected &&
|
|
485
|
-
!props.isSelected &&
|
|
486
|
-
!props.isDisabled &&
|
|
487
|
-
optionFillHover &&
|
|
488
|
-
`fill_hover_${optionFillHover}`, isSelected && 'select__menu-list-item_state_selected', menuItemSize && `select__menu-list-item_size_${menuItemSize}`, optionBorder && `border-color_${optionBorder}`, optionBorderType && `border_type_${optionBorderType}`, optionShape && `shape_${optionShape}`, optionShapeStrength && `shape-strength_${optionShapeStrength}`), children: [optionBefore, jsx(Text, { className: "select__menu-list-item_option", size: optionTextSize, textColor: optionTextColor, textColorActive: optionTextColorActive, textColorDisabled: optionTextColorDisabled, isDisabled: props.isDisabled, isActive: props.isSelected || isSelected, children: label }), (isSelected || props.isSelected) && (jsx("div", { className: "select__menu-list-item_selected", children: jsx(Icon, { iconFill: optionSelectedIconFillIcon, iconSize: optionSelectedIconSize, imageSrc: optionSelectedIconSrc, SvgImage: optionSelectedIcon }) })), optionAfter, showDivider && (jsx(Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
const SelectPlaceholder = (props) => {
|
|
492
|
-
const { placeholderTextColor, placeholderTextSize } = props.selectProps;
|
|
493
|
-
return (jsx(components.Placeholder, { ...props, children: jsx(Text, { size: placeholderTextSize, textColor: placeholderTextColor, children: props.children }) }));
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
const SelectSingleValue = (props) => {
|
|
497
|
-
const { data } = props;
|
|
498
|
-
const { inputTextColor, inputTextSize } = props.selectProps;
|
|
499
|
-
return (jsxs(components.SingleValue, { ...props, children: [data && data.optionBefore, jsx(Text, { size: inputTextSize, textColor: inputTextColor, children: props.children }), data && data.optionAfter] }));
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
const SelectValueContainer = (props) => {
|
|
503
|
-
const { inputAfter, inputBefore } = props.selectProps;
|
|
504
|
-
return (jsxs(components.ValueContainer, { ...props, children: [inputBefore, props.children, inputAfter] }));
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
const selectConfig = {
|
|
508
|
-
appearance: selectAppearance,
|
|
509
|
-
setAppearance: (appearanceConfig) => {
|
|
510
|
-
selectConfig.appearance = appearanceConfig;
|
|
511
|
-
},
|
|
512
|
-
};
|
|
513
|
-
const SelectContainer = React.forwardRef(function SelectContainer(props, ref) {
|
|
514
|
-
const { appearance = '', className, width, minWidth, initialValue, badgeAppearance, badgeSize, defaultValue, dividerDirection, filterOption, hideSelectedOptions, hideValueContainer, inputAfter, inputBefore, instanceId, loaderAppearance, loadingMessageText, menuAfter, menuBefore, menuIsOpen, menuItemSize, noOptionsSearchText, noOptionsText, optionAfter, optionBefore, options, placeholder, showBadge, showDivider, value, before, after, openMenuOnClick, closeMenuOnSelect, isDisabled, isClearable, isCreatable, isLoading, isMulti, isSearchable, set, onChange, onInputChange, } = props;
|
|
515
|
-
const defaultRef = useRef(null);
|
|
516
|
-
const selectRef = ref || defaultRef;
|
|
517
|
-
const SelectComponent = isCreatable
|
|
518
|
-
? CreatableSelect
|
|
519
|
-
: Select;
|
|
520
|
-
useEffect(() => {
|
|
521
|
-
// @ts-expect-error
|
|
522
|
-
const onClickOutside = (event) => {
|
|
523
|
-
const isTargetSelectContainer =
|
|
524
|
-
// maybe here ".contains()"?
|
|
525
|
-
event.target.hasClass &&
|
|
526
|
-
event.target.hasClass('select_state_hide-value-container');
|
|
527
|
-
if ('current' in selectRef &&
|
|
528
|
-
selectRef.current &&
|
|
529
|
-
selectRef.current.controlRef) {
|
|
530
|
-
const isTargetInsideController = selectRef.current.controlRef.contains(event.target);
|
|
531
|
-
if (!isTargetSelectContainer && !isTargetInsideController) {
|
|
532
|
-
// @ts-expect-error
|
|
533
|
-
selectRef.current?.onInputBlur();
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
};
|
|
537
|
-
if (hideValueContainer) {
|
|
538
|
-
document.addEventListener('click', onClickOutside);
|
|
539
|
-
}
|
|
540
|
-
return () => {
|
|
541
|
-
if (hideValueContainer) {
|
|
542
|
-
document.removeEventListener('click', onClickOutside);
|
|
543
|
-
}
|
|
544
|
-
};
|
|
545
|
-
}, [hideValueContainer, selectRef]);
|
|
546
|
-
const clearStyle = useMemo(() => new Proxy({
|
|
547
|
-
container: {
|
|
548
|
-
width: width,
|
|
549
|
-
minWidth: minWidth,
|
|
550
|
-
},
|
|
551
|
-
}, {
|
|
552
|
-
get: (target, prop) => {
|
|
553
|
-
if (prop in target) {
|
|
554
|
-
return () => target[prop];
|
|
555
|
-
}
|
|
556
|
-
return () => { };
|
|
557
|
-
},
|
|
558
|
-
}), [minWidth, width]);
|
|
559
|
-
const appearanceConfig = useAppearanceConfig(appearance, selectConfig, isDisabled);
|
|
560
|
-
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
561
|
-
const { fillClass, fillHoverClass, borderColorClass, borderColorHoverClass, elevation, badgeTextSize, clearIcon, clearIconFill, dividerFill, dividerSize, dropdownFillHover, dropdownIcon, dropdownIconFill, dropdownIconShape, groupFillClass, groupTextColorClass, groupTextSizeClass, groupTextWeightClass, inputCaretColorClass, inputTextColorClass, inputTextSizeClass, loadingMessageTextColor, loadingMessageTextSize, menuFillClass, multipleItemFill, multipleItemFillHover, multipleItemIcon, multipleItemIconFill, multipleItemShapeRadius, multipleItemTextColorClass, multipleItemTextSizeClass, noOptionsTextColorClass, noOptionsTextSizeClass, optionBorderClass, optionBorderTypeClass, optionFillActiveClass, optionFillActiveDisabledClass, optionFillActiveHoverClass, optionFillClass, optionFillDisabledClass, optionFillHoverClass, optionSelectedIcon, optionSelectedIconFillIcon, optionSelectedIconSize, optionSelectedIconSrc, optionTextColorActiveClass, optionTextColorClass, optionTextColorDisabled, optionTextSizeClass, placeholderTextColor, placeholderTextSize, shapeClass, shapeStrengthClass, sizeClass, widthClass, } = propsGenerator;
|
|
562
|
-
return (jsx(SelectComponent, { className: clsx(className, 'select', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, sizeClass && `select_size_${sizeClass}`, hideValueContainer && 'select_state_hide-value-container', set && `select_set_${set}`, widthClass && `select_width_${widthClass}`), ref: selectRef, elevation: elevation, badgeAppearance: badgeAppearance, badgeSize: badgeSize, badgeTextSize: badgeTextSize, classNamePrefix: "select", clearIcon: clearIcon, clearIconFill: clearIconFill, components: {
|
|
563
|
-
IndicatorSeparator: () => null,
|
|
564
|
-
ClearIndicator: SelectClearIndicator,
|
|
565
|
-
Control: SelectControl,
|
|
566
|
-
DropdownIndicator: SelectDropdownIndicator,
|
|
567
|
-
GroupHeading: SelectGroupHeading,
|
|
568
|
-
IndicatorsContainer: SelectIndicatorsContainer,
|
|
569
|
-
Input: SelectInput,
|
|
570
|
-
LoadingIndicator: SelectLoadingIndicator,
|
|
571
|
-
LoadingMessage: SelectLoadingMessage,
|
|
572
|
-
Menu: SelectMenu,
|
|
573
|
-
MultiValueContainer: SelectMultiValueContainer,
|
|
574
|
-
MultiValueLabel: SelectMultiValueLabel,
|
|
575
|
-
MultiValueRemove: SelectMultiValueRemove,
|
|
576
|
-
NoOptionsMessage: SelectNoOptions,
|
|
577
|
-
Option: SelectOption,
|
|
578
|
-
Placeholder: SelectPlaceholder,
|
|
579
|
-
SingleValue: SelectSingleValue,
|
|
580
|
-
ValueContainer: SelectValueContainer,
|
|
581
|
-
}, defaultValue: defaultValue || initialValue, dividerDirection: dividerDirection, dividerFill: dividerFill, dividerSize: dividerSize, dropdownFillHover: dropdownFillHover, dropdownIcon: dropdownIcon, dropdownIconFill: dropdownIconFill, dropdownIconShape: dropdownIconShape, filterOption: filterOption, groupFill: groupFillClass, groupTextColor: groupTextColorClass, groupTextSize: groupTextSizeClass, groupTextWeight: groupTextWeightClass, hideSelectedOptions: hideSelectedOptions ?? false, inputAfter: inputAfter, inputBefore: inputBefore, inputCaretColor: inputCaretColorClass, inputShape: shapeClass, inputShapeStrength: shapeStrengthClass, inputTextColor: inputTextColorClass, inputTextSize: inputTextSizeClass, instanceId: instanceId, loaderAppearance: loaderAppearance, loadingMessageText: loadingMessageText, loadingMessageTextColor: loadingMessageTextColor, loadingMessageTextSize: loadingMessageTextSize, menuAfter: menuAfter, menuBefore: menuBefore, menuFill: menuFillClass, menuIsOpen: menuIsOpen, menuItemSize: menuItemSize, menuShape: shapeClass, menuShapeStrength: shapeStrengthClass, multipleItemFill: multipleItemFill, multipleItemFillHover: multipleItemFillHover, multipleItemIcon: multipleItemIcon, multipleItemIconFill: multipleItemIconFill, multipleItemShapeRadius: multipleItemShapeRadius, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass && `border-color_${optionBorderClass}`, noOptionBorderType: optionBorderTypeClass && `border_type_${optionBorderTypeClass}`, noOptionsFill: optionFillClass && `fill_${optionFillClass}`, noOptionsSearchText: noOptionsSearchText, noOptionsText: noOptionsText, noOptionsTextColor: noOptionsTextColorClass, noOptionsTextSize: noOptionsTextSizeClass, optionAfter: optionAfter, optionBefore: optionBefore, optionBorder: optionBorderClass, optionBorderType: optionBorderTypeClass, optionFill: optionFillClass, optionFillActive: optionFillActiveClass, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillActiveHover: optionFillActiveHoverClass, optionFillDisabled: optionFillDisabledClass, optionFillHover: optionFillHoverClass, options: options, optionSelectedIcon: optionSelectedIcon, optionSelectedIconFillIcon: optionSelectedIconFillIcon, optionSelectedIconSize: optionSelectedIconSize, optionSelectedIconSrc: optionSelectedIconSrc, optionShape: shapeClass, optionShapeStrength: shapeStrengthClass, optionTextColor: optionTextColorClass, optionTextColorActive: optionTextColorActiveClass, optionTextColorDisabled: optionTextColorDisabled, optionTextSize: optionTextSizeClass, placeholder: placeholder, placeholderTextColor: placeholderTextColor, placeholderTextSize: placeholderTextSize, showBadge: showBadge, showDivider: showDivider, styles: clearStyle, value: value, before: before, after: after, openMenuOnClick: openMenuOnClick, closeMenuOnSelect: closeMenuOnSelect ?? true, isDisabled: isDisabled, isClearable: isClearable ?? false, isLoading: isLoading, isMulti: isMulti ?? false, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
582
|
-
});
|
|
583
|
-
|
|
584
|
-
export { SelectContainer as Select, SelectClearIndicator, SelectControl, SelectDropdownIndicator, SelectGroupHeading, SelectIndicatorsContainer, SelectInput, SelectMenu, SelectMultiValueContainer, SelectMultiValueLabel, SelectMultiValueRemove, SelectOption, SelectPlaceholder, SelectSingleValue, SelectValueContainer, selectConfig };
|
|
31
|
+
import '../Loader_es_Dq2-7sn2.js';
|
|
32
|
+
import '../Divider_es_BiYozVBS.js';
|