@itcase/ui 1.8.123 → 1.8.125
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/Avatar_cjs_AwXEUY8j.js +161 -0
- package/dist/Avatar_es_BtlaCRc5.js +157 -0
- package/dist/{Button_cjs_Ce97psFT.js → Button_cjs_C34BU1BK.js} +46 -34
- package/dist/{Button_es_CZss7cXh.js → Button_es_DnlzLBUT.js} +46 -34
- package/dist/ChipsGroup_cjs_DfAKN5CA.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_DBKY2UyF.js} +48 -35
- package/dist/DatePicker_cjs_DfbeIL2m.js +182 -0
- package/dist/DatePicker_es_BIJNx427.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_vHuzXW9M.js +211 -0
- package/dist/DropdownItem_es_DVHWWgnU.js +206 -0
- package/dist/Group_cjs_DmfeUcFI.js +59 -0
- package/dist/Group_es_BU5k8f5S.js +55 -0
- package/dist/{Icon_cjs_Cz6IyOkb.js → Icon_cjs_BVLGzj7Y.js} +170 -157
- package/dist/{Icon_es_BrwLifge.js → Icon_es_DkVkzTha.js} +170 -157
- package/dist/Image_cjs_BUM81t4Y.js +28 -0
- package/dist/Image_es_C-IjVkKX.js +26 -0
- package/dist/{Input_cjs_DRPK_RHK.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_Cv5nEb_n.js → Input_es_BnCXATnh.js} +27 -19
- package/dist/{Label_cjs_DMoaOoHi.js → Label_cjs_DwAmukik.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_B2kcstsG.js} +45 -33
- package/dist/{Link_cjs_C5UsZUiF.js → Link_cjs_qKXVfU8e.js} +43 -30
- package/dist/{Link_es_XiqbdwLp.js → Link_es_P2b6ya7P.js} +43 -30
- package/dist/Loader_cjs_DIDsIq3J.js +143 -0
- package/dist/Loader_es_CmSggwbR.js +139 -0
- package/dist/Overlay_cjs_tGA2fU43.js +42 -0
- package/dist/Overlay_es_BS7OTFoy.js +38 -0
- package/dist/{Scrollbar_cjs_DcKOfcNp.js → Scrollbar_cjs_Cp-7v2Mt.js} +1 -1
- package/dist/{Scrollbar_es_CThJeCLF.js → Scrollbar_es_CcMgNvGi.js} +1 -1
- package/dist/Text_cjs_BDTjOTVB.js +69 -0
- package/dist/Text_es_CnymlElo.js +65 -0
- package/dist/cjs/components/Accordion.js +37 -34
- package/dist/cjs/components/Avatar.js +5 -6
- package/dist/cjs/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/cjs/components/AvatarStack.js +17 -16
- package/dist/cjs/components/Badge.js +3 -4
- package/dist/cjs/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/cjs/components/Breadcrumbs.js +27 -23
- package/dist/cjs/components/Button.js +5 -6
- package/dist/cjs/components/Cell/stories/__mock__.js +1 -1
- package/dist/cjs/components/Cell.js +28 -25
- package/dist/cjs/components/Checkbox.js +33 -26
- package/dist/cjs/components/Checkmark.js +28 -23
- package/dist/cjs/components/Chips/stories/__mock__.js +1 -1
- package/dist/cjs/components/Chips.js +4 -5
- package/dist/cjs/components/Choice/stories/__mock__.js +2 -2
- package/dist/cjs/components/Choice.js +46 -40
- package/dist/cjs/components/Code.js +34 -26
- package/dist/cjs/components/CookiesWarning.js +23 -23
- package/dist/cjs/components/Dadata.js +14 -9
- package/dist/cjs/components/DatePeriod.js +32 -30
- package/dist/cjs/components/DatePicker.js +8 -9
- package/dist/cjs/components/Divider.js +1 -2
- package/dist/cjs/components/Dot.js +5 -6
- package/dist/cjs/components/Drawer.js +23 -21
- package/dist/cjs/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/cjs/components/Dropdown.js +5 -6
- package/dist/cjs/components/Flex.js +11 -12
- package/dist/cjs/components/Grid.js +15 -16
- package/dist/cjs/components/Group.js +1 -2
- package/dist/cjs/components/HTMLContent.js +5 -6
- package/dist/cjs/components/HeroTitle.js +17 -16
- package/dist/cjs/components/Icon.js +3 -4
- package/dist/cjs/components/Image.js +1 -2
- package/dist/cjs/components/Input.js +1 -2
- package/dist/cjs/components/InputPassword.js +34 -26
- package/dist/cjs/components/Label.js +4 -5
- package/dist/cjs/components/Link.js +1 -2
- package/dist/cjs/components/List.js +39 -28
- package/dist/cjs/components/Loader.js +2 -3
- package/dist/cjs/components/Logo.js +10 -11
- package/dist/cjs/components/MenuItem.js +36 -33
- package/dist/cjs/components/Modal.js +40 -38
- package/dist/cjs/components/ModalSheetBottom.js +17 -18
- package/dist/cjs/components/Notification/stories/__mock__.js +1 -1
- package/dist/cjs/components/Notification.js +31 -24
- package/dist/cjs/components/Overlay.js +1 -2
- package/dist/cjs/components/Pagination.js +43 -41
- package/dist/cjs/components/Radio.js +34 -26
- package/dist/cjs/components/RangeSlider.js +8 -9
- package/dist/cjs/components/Response/img.js +1 -1
- package/dist/cjs/components/Response.js +45 -34
- package/dist/cjs/components/SVGContent.js +6 -7
- package/dist/cjs/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/cjs/components/ScrollOnDrag.js +7 -8
- package/dist/cjs/components/ScrollToView.js +8 -9
- package/dist/cjs/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/cjs/components/Scrollbar.js +1 -1
- package/dist/cjs/components/Search.js +39 -31
- package/dist/cjs/components/Segmented/stories/__mock__.js +23 -10
- package/dist/cjs/components/Segmented.js +46 -41
- package/dist/cjs/components/Select.js +118 -113
- package/dist/cjs/components/Swiper/stories/__mock__.js +3 -3
- package/dist/cjs/components/Swiper.js +27 -29
- package/dist/cjs/components/Switch.js +33 -26
- package/dist/cjs/components/Tab/stories/__mock__.js +1 -1
- package/dist/cjs/components/Tab.js +33 -29
- package/dist/cjs/components/Text.js +1 -2
- package/dist/cjs/components/Textarea.js +26 -18
- package/dist/cjs/components/Tile.js +21 -17
- package/dist/cjs/components/Title.js +3 -4
- package/dist/cjs/components/Tooltip.js +3 -4
- package/dist/cjs/components/Video/stories/__mocks__.js +1 -1
- package/dist/cjs/components/Video.js +3 -4
- package/dist/cjs/components/Warning.js +26 -20
- package/dist/cjs/context/Notifications.js +38 -42
- package/dist/cjs/context/UIContext.js +19 -17
- package/dist/cjs/context/UrlAssetPrefix.js +3 -3
- package/dist/cjs/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/cjs/hooks/useAppearanceConfig.js +0 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/cjs/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/cjs/hooks/useDeviceTargetClass.js +0 -1
- package/dist/cjs/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +0 -1
- package/dist/cjs/hooks/useStyles.js +0 -1
- package/dist/cjs/hooks/useViewportFix.js +5 -5
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/utils/setViewportProperty.js +3 -3
- package/dist/components/Accordion.js +37 -34
- package/dist/components/Avatar.js +5 -6
- package/dist/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/components/AvatarStack.js +17 -16
- package/dist/components/Badge.js +3 -4
- package/dist/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/components/Breadcrumbs.js +27 -23
- package/dist/components/Button.js +5 -6
- package/dist/components/Cell/stories/__mock__.js +1 -1
- package/dist/components/Cell.js +28 -25
- package/dist/components/Checkbox.js +33 -26
- package/dist/components/Checkmark.js +28 -23
- package/dist/components/Chips/stories/__mock__.js +1 -1
- package/dist/components/Chips.js +4 -5
- package/dist/components/Choice/stories/__mock__.js +2 -2
- package/dist/components/Choice.js +46 -40
- package/dist/components/Code.js +34 -26
- package/dist/components/CookiesWarning.js +23 -23
- package/dist/components/Dadata.js +14 -9
- package/dist/components/DatePeriod.js +32 -30
- package/dist/components/DatePicker.js +8 -9
- package/dist/components/Divider.js +1 -2
- package/dist/components/Dot.js +5 -6
- package/dist/components/Drawer.js +23 -21
- package/dist/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/components/Dropdown.js +5 -6
- package/dist/components/Flex.js +11 -12
- package/dist/components/Grid.js +15 -16
- package/dist/components/Group.js +1 -2
- package/dist/components/HTMLContent.js +5 -6
- package/dist/components/HeroTitle.js +17 -16
- package/dist/components/Icon.js +3 -4
- package/dist/components/Image.js +1 -2
- package/dist/components/Input.js +1 -2
- package/dist/components/InputPassword.js +34 -26
- package/dist/components/Label.js +4 -5
- package/dist/components/Link.js +1 -2
- package/dist/components/List.js +39 -28
- package/dist/components/Loader.js +2 -3
- package/dist/components/Logo.js +10 -11
- package/dist/components/MenuItem.js +36 -33
- package/dist/components/Modal.js +40 -38
- package/dist/components/ModalSheetBottom.js +17 -18
- package/dist/components/Notification/stories/__mock__.js +1 -1
- package/dist/components/Notification.js +31 -24
- package/dist/components/Overlay.js +1 -2
- package/dist/components/Pagination.js +43 -41
- package/dist/components/Radio.js +34 -26
- package/dist/components/RangeSlider.js +8 -9
- package/dist/components/Response/img.js +1 -1
- package/dist/components/Response.js +45 -34
- package/dist/components/SVGContent.js +6 -7
- package/dist/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/components/ScrollOnDrag.js +7 -8
- package/dist/components/ScrollToView.js +8 -9
- package/dist/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/components/Scrollbar.js +1 -1
- package/dist/components/Search.js +39 -31
- package/dist/components/Segmented/stories/__mock__.js +23 -10
- package/dist/components/Segmented.js +46 -41
- package/dist/components/Select.js +118 -113
- package/dist/components/Swiper/stories/__mock__.js +3 -3
- package/dist/components/Swiper.js +27 -29
- package/dist/components/Switch.js +33 -26
- package/dist/components/Tab/stories/__mock__.js +1 -1
- package/dist/components/Tab.js +33 -29
- package/dist/components/Text.js +1 -2
- package/dist/components/Textarea.js +26 -18
- package/dist/components/Tile.js +21 -17
- package/dist/components/Title.js +3 -4
- package/dist/components/Tooltip.js +3 -4
- package/dist/components/Video/stories/__mocks__.js +1 -1
- package/dist/components/Video.js +3 -4
- package/dist/components/Warning.js +26 -20
- package/dist/context/Notifications.js +38 -42
- package/dist/context/UIContext.js +19 -17
- package/dist/context/UrlAssetPrefix.js +3 -3
- package/dist/css/components/Tile/Tile.css +3 -3
- package/dist/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/hooks/useAppearanceConfig.js +0 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/hooks/useDeviceTargetClass.js +0 -1
- package/dist/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/hooks/useStyles/useStyles.js +0 -1
- package/dist/hooks/useStyles.js +0 -1
- package/dist/hooks/useViewportFix.js +5 -5
- package/dist/hooks.js +1 -1
- package/dist/types/components/Button/Button.appearance.d.ts +232 -232
- package/dist/types/components/Button/Button.d.ts +4 -4
- package/dist/types/components/Button/Button.interface.d.ts +5 -5
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Text/Text.appearance.d.ts +58 -58
- package/dist/types/components/Text/Text.interface.d.ts +1 -1
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +3 -3
- package/dist/Avatar_cjs_CLJnKU39.js +0 -157
- package/dist/Avatar_es_BgN-fbOj.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_BzEtDAb8.js +0 -183
- package/dist/DatePicker_es_DRyCMO0I.js +0 -179
- package/dist/Divider_cjs_DUYtmwn2.js +0 -97
- package/dist/Divider_es_CCLBFIx6.js +0 -93
- package/dist/DropdownItem_cjs_Bhss6lyM.js +0 -207
- package/dist/DropdownItem_es_BXl6lPJx.js +0 -202
- package/dist/Group_cjs_CsJ6ICKK.js +0 -59
- package/dist/Group_es_DRqIIM9m.js +0 -55
- package/dist/Image_cjs_DRhhc66R.js +0 -29
- package/dist/Image_es_BpMidmve.js +0 -27
- package/dist/Loader_cjs_D3lnxPlI.js +0 -132
- package/dist/Loader_es_BUSqFrCd.js +0 -128
- package/dist/Overlay_cjs_CcfJYN5o.js +0 -41
- package/dist/Overlay_es_DF3DAdxS.js +0 -37
- package/dist/Text_cjs_0EINiUq4.js +0 -68
- package/dist/Text_es_CwV9rjFD.js +0 -64
- package/dist/tslib.es6_cjs_CCZ3TN_7.js +0 -59
- package/dist/tslib.es6_es_Bwu1Cn-t.js +0 -56
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('../../tslib.es6_cjs_CCZ3TN_7.js');
|
|
4
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var Select = require('react-select');
|
|
6
|
-
var Icon = require('../../
|
|
5
|
+
var Icon = require('../../Icon_cjs_BVLGzj7Y.js');
|
|
7
6
|
var React = require('react');
|
|
8
7
|
var clsx = require('clsx');
|
|
9
8
|
var CreatableSelect = require('react-select/creatable');
|
|
10
|
-
var Group = require('../../
|
|
11
|
-
var Text = require('../../
|
|
9
|
+
var Group = require('../../Group_cjs_DmfeUcFI.js');
|
|
10
|
+
var Text = require('../../Text_cjs_BDTjOTVB.js');
|
|
12
11
|
var useAppearanceConfig = require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
13
12
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
14
13
|
var _default = require('@itcase/icons/default');
|
|
15
|
-
var Loader = require('../../
|
|
16
|
-
var Divider = require('../../
|
|
14
|
+
var Loader = require('../../Loader_cjs_DIDsIq3J.js');
|
|
15
|
+
var Divider = require('../../Divider_cjs_DrmV2ezS.js');
|
|
17
16
|
require('react-inlinesvg');
|
|
18
17
|
require('../hoc/urlWithAssetPrefix.js');
|
|
19
18
|
require('@itcase/common');
|
|
@@ -30,25 +29,25 @@ require('react-responsive');
|
|
|
30
29
|
require('../utils/setViewportProperty.js');
|
|
31
30
|
require('../hooks.js');
|
|
32
31
|
require('../hooks/useStyles/styleAttributes.js');
|
|
33
|
-
require('../../
|
|
32
|
+
require('../../Link_cjs_qKXVfU8e.js');
|
|
34
33
|
require('lodash/castArray');
|
|
35
34
|
|
|
36
35
|
// interface ClearIndicatorProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>>
|
|
37
36
|
// extends DefaultClearIndicatorProps<Option, IsMulti, Group> {}
|
|
38
37
|
// For use memo need to check "ClearIndicator" props
|
|
39
38
|
// const SelectClearIndicator = React.memo(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return (jsxRuntime.jsx(Select.components.ClearIndicator,
|
|
39
|
+
const SelectClearIndicator = (props) => {
|
|
40
|
+
const { children } = props;
|
|
41
|
+
const { clearIcon, clearIconFill } = props.selectProps;
|
|
42
|
+
return (jsxRuntime.jsx(Select.components.ClearIndicator, { ...props, children: clearIcon ? (jsxRuntime.jsx(Icon.Icon, { iconFill: clearIconFill, SvgImage: clearIcon })) : (children) }));
|
|
44
43
|
};
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
const SelectLoadingMessage = (props) => {
|
|
46
|
+
const { loadingMessageText, loadingMessageTextColor, loadingMessageTextSize, } = props.selectProps;
|
|
48
47
|
return (jsxRuntime.jsx(Group.Group, { textAlign: "center", children: jsxRuntime.jsx(Text.Text, { size: loadingMessageTextSize, textColor: loadingMessageTextColor, children: loadingMessageText }) }));
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
const selectAppearanceDefault = {
|
|
52
51
|
defaultPrimary: {
|
|
53
52
|
fill: 'surfaceSecondary',
|
|
54
53
|
fillHover: 'surfaceTertiary',
|
|
@@ -87,7 +86,7 @@ var selectAppearanceDefault = {
|
|
|
87
86
|
},
|
|
88
87
|
};
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
const selectAppearanceDisabled = {
|
|
91
90
|
disabledPrimary: {
|
|
92
91
|
elevation: 8,
|
|
93
92
|
badgeAppearance: 'accent',
|
|
@@ -117,7 +116,7 @@ var selectAppearanceDisabled = {
|
|
|
117
116
|
},
|
|
118
117
|
};
|
|
119
118
|
|
|
120
|
-
|
|
119
|
+
const selectAppearanceError = {
|
|
121
120
|
errorPrimary: {
|
|
122
121
|
fill: 'errorTertiary',
|
|
123
122
|
fillHover: 'errorTertiary',
|
|
@@ -156,7 +155,7 @@ var selectAppearanceError = {
|
|
|
156
155
|
},
|
|
157
156
|
};
|
|
158
157
|
|
|
159
|
-
|
|
158
|
+
const selectAppearanceRequire = {
|
|
160
159
|
requirePrimary: {
|
|
161
160
|
fill: 'warningTertiary',
|
|
162
161
|
fillHover: 'warningTertiary',
|
|
@@ -195,7 +194,7 @@ var selectAppearanceRequire = {
|
|
|
195
194
|
},
|
|
196
195
|
};
|
|
197
196
|
|
|
198
|
-
|
|
197
|
+
const selectAppearanceShape = {
|
|
199
198
|
rounded: {
|
|
200
199
|
shape: 'rounded',
|
|
201
200
|
},
|
|
@@ -217,7 +216,7 @@ var selectAppearanceShape = {
|
|
|
217
216
|
},
|
|
218
217
|
};
|
|
219
218
|
|
|
220
|
-
|
|
219
|
+
const selectAppearanceSize = {
|
|
221
220
|
sizeXXL: {
|
|
222
221
|
size: 'xxl',
|
|
223
222
|
textLoadingMessageAppearance: 'sizeM',
|
|
@@ -334,7 +333,7 @@ var selectAppearanceSize = {
|
|
|
334
333
|
},
|
|
335
334
|
};
|
|
336
335
|
|
|
337
|
-
|
|
336
|
+
const selectAppearanceStyle = {
|
|
338
337
|
solid: {
|
|
339
338
|
borderColor: 'none',
|
|
340
339
|
borderColorHover: 'none',
|
|
@@ -351,7 +350,7 @@ var selectAppearanceStyle = {
|
|
|
351
350
|
},
|
|
352
351
|
};
|
|
353
352
|
|
|
354
|
-
|
|
353
|
+
const selectAppearanceSuccess = {
|
|
355
354
|
successPrimary: {
|
|
356
355
|
fill: 'successTertiary',
|
|
357
356
|
fillHover: 'successTertiary',
|
|
@@ -390,169 +389,175 @@ var selectAppearanceSuccess = {
|
|
|
390
389
|
},
|
|
391
390
|
};
|
|
392
391
|
|
|
393
|
-
|
|
392
|
+
const selectAppearance = {
|
|
393
|
+
...selectAppearanceRequire,
|
|
394
|
+
...selectAppearanceDefault,
|
|
395
|
+
...selectAppearanceDisabled,
|
|
396
|
+
...selectAppearanceSuccess,
|
|
397
|
+
...selectAppearanceSize,
|
|
398
|
+
...selectAppearanceError,
|
|
399
|
+
...selectAppearanceShape,
|
|
400
|
+
...selectAppearanceStyle,
|
|
401
|
+
};
|
|
394
402
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [before, jsxRuntime.jsx(Select.components.Control,
|
|
403
|
+
const SelectControl = (props) => {
|
|
404
|
+
const { before, after } = props.selectProps;
|
|
405
|
+
return (jsxRuntime.jsxs(React.Fragment, { children: [before, jsxRuntime.jsx(Select.components.Control, { ...props, className: clsx('select__control') }), after] }));
|
|
398
406
|
};
|
|
399
407
|
|
|
400
408
|
// For use memo need to check "DropdownIndicator" props
|
|
401
409
|
// const SelectDropdownIndicator = React.memo(
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return (jsxRuntime.jsx(Select.components.DropdownIndicator,
|
|
410
|
+
const SelectDropdownIndicator = (props) => {
|
|
411
|
+
const { children } = props;
|
|
412
|
+
const { dropdownFillHover, dropdownIcon, dropdownIconFill, dropdownIconShape, } = props.selectProps;
|
|
413
|
+
return (jsxRuntime.jsx(Select.components.DropdownIndicator, { ...props, children: dropdownIcon ? (jsxRuntime.jsx(Icon.Icon, { fillHover: dropdownFillHover, iconFill: dropdownIconFill, shape: dropdownIconShape, SvgImage: dropdownIcon })) : (children) }));
|
|
406
414
|
};
|
|
407
415
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
return (jsxRuntime.jsx(Select.components.GroupHeading,
|
|
416
|
+
const SelectGroupHeading = (props) => {
|
|
417
|
+
const { groupFill, groupTextColor, groupTextSize, groupTextWeight } = props.selectProps;
|
|
418
|
+
return (jsxRuntime.jsx(Select.components.GroupHeading, { ...props, className: clsx('select__menu-group-heading', groupFill && `fill_${groupFill}`), children: jsxRuntime.jsx(Text.Text, { size: groupTextSize, textColor: groupTextColor, textWeight: groupTextWeight, children: props.data.label }) }));
|
|
411
419
|
};
|
|
412
420
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
return (jsxRuntime.jsxs(Select.components.IndicatorsContainer,
|
|
421
|
+
const SelectIndicatorsContainer = (props) => {
|
|
422
|
+
const { badgeAppearance, badgeSize, badgeTextSize, showBadge, value } = props.selectProps;
|
|
423
|
+
return (jsxRuntime.jsxs(Select.components.IndicatorsContainer, { ...props, children: [showBadge &&
|
|
416
424
|
value &&
|
|
417
425
|
// @ts-expect-error
|
|
418
|
-
|
|
426
|
+
value?.length > 0 ? (jsxRuntime.jsx(Icon.Badge, { appearance: badgeAppearance, size: badgeSize, textSize: badgeTextSize,
|
|
419
427
|
// @ts-expect-error
|
|
420
|
-
value: value.length.toString() })) : null, props.children] }))
|
|
428
|
+
value: value.length.toString() })) : null, props.children] }));
|
|
421
429
|
};
|
|
422
430
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
return (jsxRuntime.jsx(Select.components.Input,
|
|
431
|
+
const SelectInput = (props) => {
|
|
432
|
+
const { inputCaretColor, inputTextColor, inputTextSize } = props.selectProps;
|
|
433
|
+
return (jsxRuntime.jsx(Select.components.Input, { ...props, className: clsx(inputTextSize && `text_size_${inputTextSize}`, inputTextColor && `text-color_${inputTextColor}`, inputCaretColor && `caret-color_${inputCaretColor}`) }));
|
|
426
434
|
};
|
|
427
435
|
|
|
428
|
-
|
|
429
|
-
|
|
436
|
+
const SelectLoadingIndicator = (props) => {
|
|
437
|
+
const { loaderAppearance, isLoading } = props.selectProps;
|
|
430
438
|
return isLoading && jsxRuntime.jsx(Loader.Loader, { appearance: loaderAppearance });
|
|
431
439
|
};
|
|
432
440
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return (jsxRuntime.jsxs(Select.components.Menu,
|
|
441
|
+
const SelectMenu = (props) => {
|
|
442
|
+
const { elevation, menuAfter, menuBefore, menuFill, menuShape, menuShapeStrength, } = props.selectProps;
|
|
443
|
+
return (jsxRuntime.jsxs(Select.components.Menu, { ...props, className: clsx(menuFill && `fill_${menuFill}`, menuShape && `shape_${menuShape}`, menuShapeStrength && `shape-strength_${menuShapeStrength}`, elevation && `elevation_${elevation}`), children: [menuBefore, props.selectProps.fetchingData ? (jsxRuntime.jsx("span", { className: "fetching", children: "Fetching data..." })) : (jsxRuntime.jsx(React.Fragment, { children: props.children })), menuAfter] }));
|
|
436
444
|
};
|
|
437
445
|
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
return (jsxRuntime.jsx(Select.components.MultiValueContainer,
|
|
446
|
+
const SelectMultiValueContainer = (props) => {
|
|
447
|
+
const { multipleItemFill, multipleItemFillHover } = props.selectProps;
|
|
448
|
+
return (jsxRuntime.jsx(Select.components.MultiValueContainer, { ...props, children: jsxRuntime.jsx(Group.Group, { className: clsx('select__multi-value-item'), direction: "horizontal", alignItems: "center", fill: multipleItemFill, fillHover: multipleItemFillHover, gap: "0.5m", children: props.children }) }));
|
|
441
449
|
};
|
|
442
450
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
return (jsxRuntime.jsx(Select.components.MultiValueLabel,
|
|
451
|
+
const SelectMultiValueLabel = (props) => {
|
|
452
|
+
const { multipleItemTextColor, multipleItemTextSize } = props.selectProps;
|
|
453
|
+
return (jsxRuntime.jsx(Select.components.MultiValueLabel, { ...props, children: props.data && (jsxRuntime.jsx(Text.Text, { size: multipleItemTextSize, textColor: multipleItemTextColor, children: props.data.label })) }));
|
|
446
454
|
};
|
|
447
455
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
return (jsxRuntime.jsx(Select.components.MultiValueRemove,
|
|
456
|
+
const SelectMultiValueRemove = (props) => {
|
|
457
|
+
const { multipleItemIcon, multipleItemIconFill } = props.selectProps;
|
|
458
|
+
return (jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: jsxRuntime.jsx(Icon.Icon, { iconFill: multipleItemIconFill, SvgImage: multipleItemIcon }) }));
|
|
451
459
|
};
|
|
452
460
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return (jsxRuntime.jsx(Select.components.NoOptionsMessage,
|
|
461
|
+
const SelectNoOptions = (props) => {
|
|
462
|
+
const { inputValue, noOptionsSearchText, noOptionsText, noOptionsTextColor, noOptionsTextSize, optionFill, } = props.selectProps;
|
|
463
|
+
return (jsxRuntime.jsx(Select.components.NoOptionsMessage, { ...props, className: clsx(optionFill && `fill_${optionFill}`), children: jsxRuntime.jsx(Group.Group, { textAlign: "center", children: jsxRuntime.jsx(Text.Text, { size: noOptionsTextSize, textColor: noOptionsTextColor, children: inputValue && noOptionsSearchText
|
|
456
464
|
? noOptionsSearchText
|
|
457
|
-
: noOptionsText }) }) }))
|
|
465
|
+
: noOptionsText }) }) }));
|
|
458
466
|
};
|
|
459
467
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
return (jsxRuntime.jsxs(Select.components.Option,
|
|
468
|
+
const SelectOption = (props) => {
|
|
469
|
+
const { label, isSelected } = props;
|
|
470
|
+
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;
|
|
471
|
+
return (jsxRuntime.jsxs(Select.components.Option, { ...props, className: clsx('select__menu-list-item', isSelected || props.isSelected
|
|
464
472
|
? !props.isDisabled
|
|
465
|
-
? optionFillActive &&
|
|
473
|
+
? optionFillActive && `fill_active_${optionFillActive}`
|
|
466
474
|
: optionFillActiveDisabled &&
|
|
467
|
-
|
|
475
|
+
`fill_active_disabled_${optionFillActiveDisabled}`
|
|
468
476
|
: !props.isDisabled
|
|
469
|
-
? optionFill &&
|
|
470
|
-
: optionFillDisabled &&
|
|
477
|
+
? optionFill && `fill_${optionFill}`
|
|
478
|
+
: optionFillDisabled && `fill_${optionFillDisabled}`, (isSelected || props.isSelected) &&
|
|
471
479
|
!props.isDisabled &&
|
|
472
480
|
optionFillActiveHover &&
|
|
473
|
-
|
|
481
|
+
`fill_active_hover_${optionFillActiveHover}`, !isSelected &&
|
|
474
482
|
!props.isSelected &&
|
|
475
483
|
!props.isDisabled &&
|
|
476
484
|
optionFillHover &&
|
|
477
|
-
|
|
485
|
+
`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, jsxRuntime.jsx(Text.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) && (jsxRuntime.jsx("div", { className: "select__menu-list-item_selected", children: jsxRuntime.jsx(Icon.Icon, { iconFill: optionSelectedIconFillIcon, iconSize: optionSelectedIconSize, imageSrc: optionSelectedIconSrc, SvgImage: optionSelectedIcon }) })), optionAfter, showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
478
486
|
};
|
|
479
487
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return (jsxRuntime.jsx(Select.components.Placeholder,
|
|
488
|
+
const SelectPlaceholder = (props) => {
|
|
489
|
+
const { placeholderTextColor, placeholderTextSize } = props.selectProps;
|
|
490
|
+
return (jsxRuntime.jsx(Select.components.Placeholder, { ...props, children: jsxRuntime.jsx(Text.Text, { size: placeholderTextSize, textColor: placeholderTextColor, children: props.children }) }));
|
|
483
491
|
};
|
|
484
492
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
return (jsxRuntime.jsxs(Select.components.SingleValue,
|
|
493
|
+
const SelectSingleValue = (props) => {
|
|
494
|
+
const { data } = props;
|
|
495
|
+
const { inputTextColor, inputTextSize } = props.selectProps;
|
|
496
|
+
return (jsxRuntime.jsxs(Select.components.SingleValue, { ...props, children: [data && data.optionBefore, jsxRuntime.jsx(Text.Text, { size: inputTextSize, textColor: inputTextColor, children: props.children }), data && data.optionAfter] }));
|
|
489
497
|
};
|
|
490
498
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return (jsxRuntime.jsxs(Select.components.ValueContainer,
|
|
499
|
+
const SelectValueContainer = (props) => {
|
|
500
|
+
const { inputAfter, inputBefore } = props.selectProps;
|
|
501
|
+
return (jsxRuntime.jsxs(Select.components.ValueContainer, { ...props, children: [inputBefore, props.children, inputAfter] }));
|
|
494
502
|
};
|
|
495
503
|
|
|
496
|
-
|
|
504
|
+
const selectConfig = {
|
|
497
505
|
appearance: selectAppearance,
|
|
498
|
-
setAppearance:
|
|
506
|
+
setAppearance: (appearanceConfig) => {
|
|
499
507
|
selectConfig.appearance = appearanceConfig;
|
|
500
508
|
},
|
|
501
509
|
};
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
510
|
+
const SelectContainer = React.forwardRef(function SelectContainer(props, ref) {
|
|
511
|
+
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;
|
|
512
|
+
const defaultRef = React.useRef(null);
|
|
513
|
+
const selectRef = ref || defaultRef;
|
|
514
|
+
const SelectComponent = isCreatable
|
|
507
515
|
? CreatableSelect
|
|
508
516
|
: Select;
|
|
509
|
-
React.useEffect(
|
|
517
|
+
React.useEffect(() => {
|
|
510
518
|
// @ts-expect-error
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
var isTargetSelectContainer =
|
|
519
|
+
const onClickOutside = (event) => {
|
|
520
|
+
const isTargetSelectContainer =
|
|
514
521
|
// maybe here ".contains()"?
|
|
515
522
|
event.target.hasClass &&
|
|
516
523
|
event.target.hasClass('select_state_hide-value-container');
|
|
517
524
|
if ('current' in selectRef &&
|
|
518
525
|
selectRef.current &&
|
|
519
526
|
selectRef.current.controlRef) {
|
|
520
|
-
|
|
527
|
+
const isTargetInsideController = selectRef.current.controlRef.contains(event.target);
|
|
521
528
|
if (!isTargetSelectContainer && !isTargetInsideController) {
|
|
522
529
|
// @ts-expect-error
|
|
523
|
-
|
|
530
|
+
selectRef.current?.onInputBlur();
|
|
524
531
|
}
|
|
525
532
|
}
|
|
526
533
|
};
|
|
527
534
|
if (hideValueContainer) {
|
|
528
535
|
document.addEventListener('click', onClickOutside);
|
|
529
536
|
}
|
|
530
|
-
return
|
|
537
|
+
return () => {
|
|
531
538
|
if (hideValueContainer) {
|
|
532
539
|
document.removeEventListener('click', onClickOutside);
|
|
533
540
|
}
|
|
534
541
|
};
|
|
535
542
|
}, [hideValueContainer, selectRef]);
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return (jsxRuntime.jsx(SelectComponent, { className: clsx(className, 'select', shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass && "border-color_hover_".concat(borderColorHoverClass), sizeClass && "select_size_".concat(sizeClass), hideValueContainer && 'select_state_hide-value-container', set && "select_set_".concat(set), widthClass && "select_width_".concat(widthClass)), ref: selectRef, isDisabled: isDisabled, optionFillActiveDisabledClass: optionFillActiveDisabledClass, optionFillDisabled: optionFillDisabledClass, optionTextColorDisabled: optionTextColorDisabled, elevation: elevation, badgeAppearance: badgeAppearance, badgeSize: badgeSize, badgeTextSize: badgeTextSize, classNamePrefix: "select", clearIcon: clearIcon, clearIconFill: clearIconFill, components: {
|
|
555
|
-
IndicatorSeparator: function () { return null; },
|
|
543
|
+
const clearStyle = React.useMemo(() => new Proxy({
|
|
544
|
+
container: {
|
|
545
|
+
width: width,
|
|
546
|
+
minWidth: minWidth,
|
|
547
|
+
},
|
|
548
|
+
}, {
|
|
549
|
+
get: (target, prop) => {
|
|
550
|
+
if (prop in target) {
|
|
551
|
+
return () => target[prop];
|
|
552
|
+
}
|
|
553
|
+
return () => { };
|
|
554
|
+
},
|
|
555
|
+
}), [minWidth, width]);
|
|
556
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, selectConfig, isDisabled);
|
|
557
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
558
|
+
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, 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;
|
|
559
|
+
return (jsxRuntime.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: {
|
|
560
|
+
IndicatorSeparator: () => null,
|
|
556
561
|
ClearIndicator: SelectClearIndicator,
|
|
557
562
|
Control: SelectControl,
|
|
558
563
|
DropdownIndicator: SelectDropdownIndicator,
|
|
@@ -570,7 +575,7 @@ var SelectContainer = React.forwardRef(function SelectContainer(props, ref) {
|
|
|
570
575
|
Placeholder: SelectPlaceholder,
|
|
571
576
|
SingleValue: SelectSingleValue,
|
|
572
577
|
ValueContainer: SelectValueContainer,
|
|
573
|
-
}, 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, 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, multipleItemSize: sizeClass, multipleItemTextColor: multipleItemTextColorClass, multipleItemTextSize: multipleItemTextSizeClass, noOptionBorder: optionBorderClass &&
|
|
578
|
+
}, 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, 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, isSearchable: isSearchable ?? false, set: set, onChange: onChange, onInputChange: onInputChange }));
|
|
574
579
|
});
|
|
575
580
|
|
|
576
581
|
exports.Select = SelectContainer;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const slidesMock = Array.from({ length: 10 }, (_, index) => (jsxRuntime.jsxs("div", { style: {
|
|
6
6
|
width: '100%',
|
|
7
7
|
height: 'auto',
|
|
8
8
|
justifyContent: 'center',
|
|
@@ -10,7 +10,7 @@ var slidesMock = Array.from({ length: 10 }, function (_, index) { return (jsxRun
|
|
|
10
10
|
fontSize: 24,
|
|
11
11
|
fontWeight: 'bold',
|
|
12
12
|
display: 'flex',
|
|
13
|
-
background:
|
|
14
|
-
}, children: ["Slide ", index + 1] }, index))
|
|
13
|
+
background: `hsl(${index * 60}, 70%, 80%)`,
|
|
14
|
+
}, children: ["Slide ", index + 1] }, index)));
|
|
15
15
|
|
|
16
16
|
exports.slidesMock = slidesMock;
|
|
@@ -6,8 +6,7 @@ var clsx = require('clsx');
|
|
|
6
6
|
var react = require('swiper/react');
|
|
7
7
|
var useDevicePropsGenerator = require('../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
8
|
var useStyles = require('../hooks/useStyles/useStyles.js');
|
|
9
|
-
var Icon = require('../../
|
|
10
|
-
require('../../tslib.es6_cjs_CCZ3TN_7.js');
|
|
9
|
+
var Icon = require('../../Icon_cjs_BVLGzj7Y.js');
|
|
11
10
|
require('lodash/camelCase');
|
|
12
11
|
require('lodash/castArray');
|
|
13
12
|
require('lodash/upperFirst');
|
|
@@ -25,18 +24,18 @@ require('react-inlinesvg');
|
|
|
25
24
|
require('../hoc/urlWithAssetPrefix.js');
|
|
26
25
|
require('../context/UrlAssetPrefix.js');
|
|
27
26
|
require('../hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
28
|
-
require('../../
|
|
29
|
-
require('../../
|
|
27
|
+
require('../../Link_cjs_qKXVfU8e.js');
|
|
28
|
+
require('../../Text_cjs_BDTjOTVB.js');
|
|
30
29
|
|
|
31
30
|
function Swiper(props) {
|
|
32
|
-
|
|
33
|
-
freeMode
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
const { id, className, direction, title, titleAfter, titleSize, titleTextColor, titleWeight, setNextBtnDisabled, setPrevBtnDisabled, activeSlideIndex = 0, allowTouchMove, autoHeight, breakpoints, forwardedRef, // https://github.com/vercel/next.js/issues/4957
|
|
32
|
+
freeMode, items, keyboard, loop, modules, mousewheel, nextButton, normalizeSlideIndex, pagination, prevButton, preventClicks, preventClicksPropagation, set, simulateTouch, slidesPerView, spaceBetween, speed, swiperClass, swiperSlideClass, isChangeOnClickSlide, isInit, isNavigation = false, isScrollbar, onSlideNextTransitionEnd, onSlidePrevTransitionEnd, onSwiper, onUpdate, children, } = props;
|
|
33
|
+
const swiperRef = React.useRef(null);
|
|
34
|
+
const isMountedRef = React.useRef(false);
|
|
35
|
+
const [nextEl, nextRef] = useSwiperRef();
|
|
36
|
+
const [prevEl, prevRef] = useSwiperRef();
|
|
37
|
+
const isLoop = loop ?? true;
|
|
38
|
+
const onInitSwiper = React.useCallback((swiper) => {
|
|
40
39
|
// swiper.touchEventsData.formElements = 'undefined'
|
|
41
40
|
// Set "disabled" state to navigation buttons on init
|
|
42
41
|
if (!isLoop && setPrevBtnDisabled && setNextBtnDisabled) {
|
|
@@ -44,13 +43,13 @@ function Swiper(props) {
|
|
|
44
43
|
setNextBtnDisabled(swiper.isEnd);
|
|
45
44
|
}
|
|
46
45
|
}, [isLoop, setPrevBtnDisabled, setNextBtnDisabled]);
|
|
47
|
-
|
|
46
|
+
const onSlideChange = React.useCallback((swiper) => {
|
|
48
47
|
// Some things with clickedIndex
|
|
49
48
|
if (isChangeOnClickSlide) {
|
|
50
49
|
swiper.activeIndex = activeSlideIndex || swiper.clickedIndex;
|
|
51
50
|
}
|
|
52
51
|
}, [isChangeOnClickSlide, activeSlideIndex]);
|
|
53
|
-
|
|
52
|
+
const onTransitionStart = React.useCallback((swiper) => {
|
|
54
53
|
// Set "disabled" state to navigation buttons, when slider move
|
|
55
54
|
if (!isLoop && setPrevBtnDisabled && setNextBtnDisabled) {
|
|
56
55
|
setPrevBtnDisabled(swiper.isBeginning);
|
|
@@ -58,31 +57,30 @@ function Swiper(props) {
|
|
|
58
57
|
}
|
|
59
58
|
}, [isLoop, setPrevBtnDisabled, setNextBtnDisabled]);
|
|
60
59
|
// @ts-expect-error
|
|
61
|
-
React.useImperativeHandle(forwardedRef,
|
|
62
|
-
React.useEffect(
|
|
63
|
-
var _a;
|
|
60
|
+
React.useImperativeHandle(forwardedRef, () => swiperRef.current, []);
|
|
61
|
+
React.useEffect(() => {
|
|
64
62
|
if (isMountedRef.current) {
|
|
65
|
-
|
|
63
|
+
const swiperInstance = swiperRef.current?.swiper;
|
|
66
64
|
// @ts-expect-error
|
|
67
|
-
swiperInstance
|
|
68
|
-
swiperInstance
|
|
65
|
+
swiperInstance?.updateActiveIndex(activeSlideIndex);
|
|
66
|
+
swiperInstance?.updateSlidesClasses();
|
|
69
67
|
}
|
|
70
68
|
else {
|
|
71
69
|
isMountedRef.current = true;
|
|
72
70
|
}
|
|
73
71
|
}, [activeSlideIndex]);
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
73
|
+
const { alignClass, alignDirectionClass, fillClass, shapeClass } = propsGenerator;
|
|
76
74
|
// @ts-expect-error
|
|
77
|
-
|
|
78
|
-
return (jsxRuntime.jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass &&
|
|
79
|
-
|
|
75
|
+
const { styles: style } = useStyles.useStyles(props);
|
|
76
|
+
return (jsxRuntime.jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass && `fill_${fillClass}`, shapeClass && `swiper_shape_${shapeClass}`, className, set && `swiper-block_set_${set}`), style: style, children: [(title || (prevButton && nextButton)) && (jsxRuntime.jsxs("div", { className: "swiper-block__wrapper", children: [title && (jsxRuntime.jsx(Icon.Title, { className: "swiper-block__title", size: titleSize, textColor: titleTextColor, textWeight: titleWeight, children: title })), titleAfter, prevButton && nextButton && (jsxRuntime.jsxs("div", { className: "swiper-block__navigation", children: [jsxRuntime.jsx("div", { className: "swiper-block__prev swiper-button", ref: prevRef, children: prevButton }), jsxRuntime.jsx("div", { className: "swiper-block__next swiper-button", ref: nextRef, children: nextButton })] }))] })), jsxRuntime.jsx(react.Swiper, { className: clsx('swiper-block__swiper', swiperClass), ref: swiperRef, direction: direction, allowTouchMove: allowTouchMove, autoHeight: autoHeight ?? false, breakpoints: breakpoints, centeredSlides: true, freeMode: freeMode, init: isInit ?? true, keyboard: keyboard, loop: isLoop, modules: modules, mousewheel: mousewheel, navigation: isNavigation ? { nextEl, prevEl } : false, normalizeSlideIndex: normalizeSlideIndex, pagination: pagination, preventClicks: preventClicks, preventClicksPropagation: preventClicksPropagation, scrollbar: isScrollbar, simulateTouch: simulateTouch, slidesPerView: slidesPerView, spaceBetween: spaceBetween, speed: speed ?? 500, onInit: onInitSwiper, onSlideChange: onSlideChange, onSlideNextTransitionEnd: onSlideNextTransitionEnd, onSlidePrevTransitionEnd: onSlidePrevTransitionEnd, onSwiper: onSwiper, onTransitionStart: onTransitionStart, onUpdate: onUpdate, children: children ||
|
|
77
|
+
items?.map((item, i) => (jsxRuntime.jsx(react.SwiperSlide, { className: clsx('swiper-block__item', swiperSlideClass, alignDirectionClass && `align_${alignDirectionClass}`, alignClass && `align_${alignClass}`), children: item }, `swiper-slide_${i}`))) })] }));
|
|
80
78
|
}
|
|
81
79
|
// https://github.com/nolimits4web/swiper/issues/3855#issuecomment-1050694342
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
React.useEffect(
|
|
80
|
+
const useSwiperRef = () => {
|
|
81
|
+
const [wrapper, setWrapper] = React.useState(null);
|
|
82
|
+
const ref = React.useRef(null);
|
|
83
|
+
React.useEffect(() => {
|
|
86
84
|
if (ref.current) {
|
|
87
85
|
setWrapper(ref.current);
|
|
88
86
|
}
|