@itcase/ui 1.8.122 → 1.8.124
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_mojzcWRL.js +161 -0
- package/dist/Avatar_es_BFom0nAS.js +157 -0
- package/dist/{Button_cjs_i0Dn1pkl.js → Button_cjs_CZz8OjWi.js} +42 -30
- package/dist/{Button_es_CtH5EKJd.js → Button_es_Cn3wtv3M.js} +42 -30
- package/dist/ChipsGroup_cjs_Dgskkc1e.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_BVQ7_n0k.js} +48 -35
- package/dist/DatePicker_cjs_Lzrr9Amf.js +182 -0
- package/dist/DatePicker_es_D1LvY5RT.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_rKLdFxSj.js +211 -0
- package/dist/DropdownItem_es_B-1qtEa7.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_DpFxIFv5.js} +170 -121
- package/dist/{Icon_es_BrwLifge.js → Icon_es_D5eiycFI.js} +170 -121
- package/dist/Image_cjs_CBDMUzv_.js +29 -0
- package/dist/Image_es_BHec4iVN.js +27 -0
- package/dist/{Input_cjs_Du73R-wm.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_CiDHjDqJ.js → Input_es_BnCXATnh.js} +27 -19
- package/dist/{Label_cjs_DMoaOoHi.js → Label_cjs_C-x9blCL.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_DCqpSw_F.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 +114 -84
- 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 +102 -84
- 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 +47 -42
- 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 +59 -69
- 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 +114 -84
- 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 +102 -84
- 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 +47 -42
- 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 +59 -69
- 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/Checkmark/Checkmark.css +2 -0
- package/dist/css/components/DatePeriod/DatePeriod.css +3 -0
- package/dist/css/components/Input/Input.css +0 -8
- package/dist/css/components/InputPassword/InputPassword.css +34 -43
- 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/InputPassword/InputPassword.appearance.d.ts +179 -2
- package/dist/types/components/InputPassword/appearance/inputPasswordDefault.d.ts +7 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordDisabled.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordError.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordRequire.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordShape.d.ts +25 -0
- package/dist/types/components/InputPassword/appearance/inputPasswordSize.d.ts +14 -28
- package/dist/types/components/InputPassword/appearance/inputPasswordStyle.d.ts +5 -5
- package/dist/types/components/InputPassword/appearance/inputPasswordSuccess.d.ts +6 -4
- package/dist/types/components/Response/Response.constant.d.ts +32 -35
- package/dist/types/components/Response/appearance/responseConfirm.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseDanger.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseEmpty.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseError.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseFail.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseNothingFound.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseRefresh.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseSuccess.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseUnableLoadData.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseWarning.d.ts +1 -0
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Tab/appearance/tabSize.d.ts +0 -14
- package/dist/types/components/Tab/appearance/tabSurface.d.ts +7 -7
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +14 -14
- package/dist/Avatar_cjs_kuE0Rueg.js +0 -157
- package/dist/Avatar_es_lx7s4Vla.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_DsIAoi01.js +0 -183
- package/dist/DatePicker_es_BP5BrEr-.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_B6YlGx8G.js +0 -28
- package/dist/Image_es_BvYo_cHH.js +0 -26
- 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,179 +0,0 @@
|
|
|
1
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useMemo, useCallback, useRef } from 'react';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { ru } from 'date-fns/locale';
|
|
6
|
-
import DatePicker from 'react-datepicker';
|
|
7
|
-
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
|
-
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
|
-
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
10
|
-
import { B as Button } from './Button_es_CtH5EKJd.js';
|
|
11
|
-
import { I as Icon } from './Icon_es_BrwLifge.js';
|
|
12
|
-
import { I as Input } from './Input_es_CiDHjDqJ.js';
|
|
13
|
-
import { L as Label } from './Label_es_SULlg9bL.js';
|
|
14
|
-
import { T as Text } from './Text_es_CwV9rjFD.js';
|
|
15
|
-
import { icons14 } from '@itcase/icons/default';
|
|
16
|
-
|
|
17
|
-
var datePickerSize = {
|
|
18
|
-
sizeL: {
|
|
19
|
-
size: 'l',
|
|
20
|
-
daySize: 'xs',
|
|
21
|
-
dayTextSize: 'm',
|
|
22
|
-
iconFillSize: 24,
|
|
23
|
-
iconLeft: icons14.Arrow.ChevronLeft,
|
|
24
|
-
iconRight: icons14.Arrow.ChevronRight,
|
|
25
|
-
},
|
|
26
|
-
sizeM: {
|
|
27
|
-
size: 'm',
|
|
28
|
-
daySize: 'xxl',
|
|
29
|
-
dayTextSize: 'm',
|
|
30
|
-
iconFillSize: 24,
|
|
31
|
-
iconLeft: icons14.Arrow.ChevronLeft,
|
|
32
|
-
iconRight: icons14.Arrow.ChevronRight,
|
|
33
|
-
iconSize: 14,
|
|
34
|
-
monthTextSize: 'm',
|
|
35
|
-
yearTextSize: 'm',
|
|
36
|
-
},
|
|
37
|
-
sizeS: {
|
|
38
|
-
size: 's',
|
|
39
|
-
daySize: 'xs',
|
|
40
|
-
dayTextSize: 'm',
|
|
41
|
-
iconFillSize: 24,
|
|
42
|
-
iconLeft: icons14.Arrow.ChevronLeft,
|
|
43
|
-
iconRight: icons14.Arrow.ChevronRight,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
var datePickerStyle = {
|
|
48
|
-
solid: {
|
|
49
|
-
inputProps: {
|
|
50
|
-
borderColor: 'none',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
outlined: {
|
|
54
|
-
inputProps: {
|
|
55
|
-
fill: 'none',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
full: {},
|
|
59
|
-
ghost: {
|
|
60
|
-
inputProps: {
|
|
61
|
-
fill: 'none',
|
|
62
|
-
borderColor: 'none',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var datePickerAppearanceSurface = {
|
|
68
|
-
surfacePrimary: {
|
|
69
|
-
dayTextColor: 'surfaceTextPrimary',
|
|
70
|
-
dayTextShape: 'rounded',
|
|
71
|
-
iconFillHover: 'surfaceSecondary',
|
|
72
|
-
iconItemFill: 'surfaceItemPrimary',
|
|
73
|
-
iconShape: 'circular',
|
|
74
|
-
monthTextColor: 'surfaceTextPrimary',
|
|
75
|
-
monthTextWeight: 400,
|
|
76
|
-
placeholderTextColor: 'surfaceTextPrimary',
|
|
77
|
-
yearTextColor: 'surfaceTextPrimary',
|
|
78
|
-
yearTextWeight: 400,
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
var datePickerAppearance = __assign(__assign(__assign({}, datePickerAppearanceSurface), datePickerSize), datePickerStyle);
|
|
83
|
-
|
|
84
|
-
var datePickerConfig = {
|
|
85
|
-
appearance: datePickerAppearance,
|
|
86
|
-
setAppearance: function (appearanceConfig) {
|
|
87
|
-
datePickerConfig.appearance = appearanceConfig;
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
function DatePickerInput(props) {
|
|
91
|
-
var className = props.className, _a = props.datePickerProps, datePickerProps = _a === void 0 ? {} : _a, endValue = props.endValue, _b = props.inputProps, inputProps = _b === void 0 ? {} : _b, value = props.value, onChange = props.onChange;
|
|
92
|
-
var datepickerRef = useRef(null);
|
|
93
|
-
var customTimeInput = datePickerProps.customTimeInput, disablePastDays = datePickerProps.disablePastDays, monthsShown = datePickerProps.monthsShown, selectsRange = datePickerProps.selectsRange;
|
|
94
|
-
var appearanceConfig = useAppearanceConfig(datePickerProps.appearance, datePickerConfig);
|
|
95
|
-
var propsGenerator = useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
96
|
-
var daySize = propsGenerator.daySize, dayTextColor = propsGenerator.dayTextColor, dayTextShape = propsGenerator.dayTextShape, dayTextSize = propsGenerator.dayTextSize, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconLeft = propsGenerator.iconLeft, iconRight = propsGenerator.iconRight, iconShape = propsGenerator.iconShape, monthTextColor = propsGenerator.monthTextColor, monthTextSize = propsGenerator.monthTextSize, monthTextWeight = propsGenerator.monthTextWeight, popper = propsGenerator.popper, popperPlacement = propsGenerator.popperPlacement, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, yearTextColor = propsGenerator.yearTextColor, yearTextSize = propsGenerator.yearTextSize, yearTextWeight = propsGenerator.yearTextWeight, isClearable = propsGenerator.isClearable;
|
|
97
|
-
var _c = useMemo(function () {
|
|
98
|
-
var dateStart;
|
|
99
|
-
if (value) {
|
|
100
|
-
if (typeof value === 'string') {
|
|
101
|
-
dateStart = new Date(value);
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
dateStart = value;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
dateStart = undefined;
|
|
109
|
-
}
|
|
110
|
-
var dateEnd;
|
|
111
|
-
if (endValue) {
|
|
112
|
-
if (typeof endValue === 'string') {
|
|
113
|
-
dateEnd = new Date(endValue);
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
dateEnd = endValue;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
dateEnd = undefined;
|
|
121
|
-
}
|
|
122
|
-
return [dateStart, dateEnd];
|
|
123
|
-
}, [value, endValue]), dateStart = _c[0], dateEnd = _c[1];
|
|
124
|
-
var handleChange = useCallback(function (valuesList) {
|
|
125
|
-
var newDateStart = valuesList[0], newDateEnd = valuesList[1];
|
|
126
|
-
onChange(newDateStart, newDateEnd);
|
|
127
|
-
}, [onChange]);
|
|
128
|
-
var renderDayContents = useCallback(function (day, date) {
|
|
129
|
-
return (jsx(Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
130
|
-
}, [daySize, dayTextColor, dayTextShape, dayTextSize]);
|
|
131
|
-
var renderCustomHeader = useCallback(function (_a) {
|
|
132
|
-
var decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, monthDate = _a.monthDate;
|
|
133
|
-
return (jsxs("div", { className: "react-datepicker__header--div", children: [iconLeft && (jsx(Icon, { className: "react-datepicker__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, shape: iconShape, SvgImage: iconLeft, onClick: decreaseMonth })), jsxs("div", { className: "react-datepicker__data", children: [jsx(Text, { className: "react-datepicker__month", size: monthTextSize, textColor: monthTextColor, textWeight: monthTextWeight, children: monthDate.toLocaleString('ru-RU', { month: 'long' }) }), jsx(Text, { className: "react-datepicker__year", size: yearTextSize, textColor: yearTextColor, textWeight: yearTextWeight, children: monthDate.toLocaleString('ru-RU', { year: 'numeric' }) })] }), iconRight && (jsx(Icon, { className: "react-datepicker__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, shape: iconShape, SvgImage: iconRight, onClick: increaseMonth }))] }));
|
|
134
|
-
}, [
|
|
135
|
-
iconFill,
|
|
136
|
-
iconFillHover,
|
|
137
|
-
iconFillSize,
|
|
138
|
-
iconItemFill,
|
|
139
|
-
iconLeft,
|
|
140
|
-
iconRight,
|
|
141
|
-
iconShape,
|
|
142
|
-
monthTextColor,
|
|
143
|
-
monthTextSize,
|
|
144
|
-
monthTextWeight,
|
|
145
|
-
yearTextColor,
|
|
146
|
-
yearTextSize,
|
|
147
|
-
yearTextWeight,
|
|
148
|
-
]);
|
|
149
|
-
var datePickerStyles = useStyles(props).styles;
|
|
150
|
-
return (jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsx(DatePicker, __assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ? dateEnd : undefined, locale: ru, popperClassName: popper && "react-datepicker-popper-".concat(popper), popperPlacement: popperPlacement, ref: datepickerRef, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: selectsRange ? handleChange : onChange }, datePickerProps, {
|
|
151
|
-
// Important for use custom clear button
|
|
152
|
-
isClearable: false })) }));
|
|
153
|
-
}
|
|
154
|
-
var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
155
|
-
var inputIcon = props.inputIcon, inputProps = props.inputProps, value = props.value, isClearable = props.isClearable;
|
|
156
|
-
var multipleValue = useMemo(function () {
|
|
157
|
-
if (value) {
|
|
158
|
-
var twoDates = value.split(' - ');
|
|
159
|
-
return twoDates[0] === twoDates[1] ? twoDates[0] : value;
|
|
160
|
-
}
|
|
161
|
-
return '';
|
|
162
|
-
}, [value]);
|
|
163
|
-
return (jsxs(React.Fragment, { children: [jsx(Input, __assign({}, props, inputProps, { className: clsx(inputProps.className, 'datepicker__input'), autocomplete: "off", ref: ref, value: multipleValue })), inputIcon && jsx(DatePickerInputIcon, __assign({}, inputProps)), isClearable && jsx(DatePickerClearButton, __assign({}, inputProps))] }));
|
|
164
|
-
});
|
|
165
|
-
function DatePickerClearButton(props) {
|
|
166
|
-
var clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datepickerRef = props.datepickerRef;
|
|
167
|
-
var onClick = useCallback(function (event) {
|
|
168
|
-
var _a, _b;
|
|
169
|
-
(_a = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _a === void 0 ? void 0 : _a.onClearClick(event);
|
|
170
|
-
(_b = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _b === void 0 ? void 0 : _b.handleFocus(event);
|
|
171
|
-
}, []);
|
|
172
|
-
return (jsx(React.Fragment, { children: clearLabel ? (jsx(Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'), label: clearLabel, labelTextColor: clearLabelTextColor, labelTextColorHover: clearLabelTextColorHover, labelTextSize: clearLabelTextSize, onClick: onClick })) : ((clearIcon || clearIconSrc) && (jsx(Icon, { className: clsx('react-datepicker__clear-icon', 'cursor_type_pointer'), size: clearIconSize, fill: clearIconFill, fillHover: clearIconFillHover, fillSize: clearIconFillSize, iconFill: clearIconItemFill, iconFillHover: clearIconItemFillHover, imageSrc: clearIconSrc, shape: clearIconShape, SvgImage: clearIcon, onClick: onClick }))) }));
|
|
173
|
-
}
|
|
174
|
-
function DatePickerInputIcon(props) {
|
|
175
|
-
var inputIcon = props.inputIcon, inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize, inputIconItemFill = props.inputIconItemFill, inputIconShape = props.inputIconShape, inputIconSize = props.inputIconSize, inputIconSrc = props.inputIconSrc, onClick = props.onClick;
|
|
176
|
-
return (jsx(Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), size: inputIconSize, fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, SvgImage: inputIcon, onClick: function () { return onClick && onClick(); } }));
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export { DatePickerInput as D, datePickerAppearance as a, datePickerConfig as d };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
6
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
9
|
-
|
|
10
|
-
var dividerAppearanceAccent = {
|
|
11
|
-
accentPrimary: {
|
|
12
|
-
fill: 'accentPrimary',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var dividerAppearanceError = {
|
|
17
|
-
errorPrimary: {
|
|
18
|
-
fill: 'errorPrimary',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var dividerAppearancePrimary = {
|
|
23
|
-
primaryPrimary: {
|
|
24
|
-
fill: 'primaryPrimary',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var dividerAppearanceSecondary = {
|
|
29
|
-
secondaryPrimary: {
|
|
30
|
-
fill: 'secondaryPrimary',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var dividerAppearanceSize = {
|
|
35
|
-
sizeL: {
|
|
36
|
-
size: 'l',
|
|
37
|
-
},
|
|
38
|
-
sizeM: {
|
|
39
|
-
size: 'm',
|
|
40
|
-
},
|
|
41
|
-
sizeS: {
|
|
42
|
-
size: 's',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
var dividerAppearanceSuccess = {
|
|
47
|
-
successPrimary: {
|
|
48
|
-
fill: 'successPrimary',
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var dividerAppearanceSurface = {
|
|
53
|
-
surfacePrimary: {
|
|
54
|
-
fill: 'surfacePrimary',
|
|
55
|
-
},
|
|
56
|
-
surfaceSecondary: {
|
|
57
|
-
fill: 'surfaceSecondary',
|
|
58
|
-
},
|
|
59
|
-
surfaceTertiary: {
|
|
60
|
-
fill: 'surfaceTertiary',
|
|
61
|
-
},
|
|
62
|
-
surfaceQuaternary: {
|
|
63
|
-
fill: 'surfaceQuaternary',
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
var dividerAppearanceWarning = {
|
|
68
|
-
warningPrimary: {
|
|
69
|
-
fill: 'warningPrimary',
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
var dividerAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, dividerAppearanceSize), dividerAppearanceAccent), dividerAppearanceError), dividerAppearancePrimary), dividerAppearanceSecondary), dividerAppearanceSuccess), dividerAppearanceSurface), dividerAppearanceWarning);
|
|
74
|
-
|
|
75
|
-
var dividerConfig = {
|
|
76
|
-
appearance: dividerAppearance,
|
|
77
|
-
setAppearance: function (appearanceConfig) {
|
|
78
|
-
dividerConfig.appearance = appearanceConfig;
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
function Divider(props) {
|
|
82
|
-
var className = props.className, appearance = props.appearance, isDisabled = props.isDisabled, isActive = props.isActive, isSkeleton = props.isSkeleton;
|
|
83
|
-
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, dividerConfig);
|
|
84
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
85
|
-
var directionClass = propsGenerator.directionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
86
|
-
// @ts-expect-error
|
|
87
|
-
var hrStyles = useStyles.useStyles(props).styles;
|
|
88
|
-
return (jsxRuntime.jsx("hr", { className: clsx(className, 'divider', widthClass && "width_".concat(widthClass), directionClass && "divider_direction_".concat(directionClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), sizeClass && "divider_size_".concat(sizeClass), !isActive
|
|
89
|
-
? fillClass && "fill_".concat(fillClass)
|
|
90
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
91
|
-
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
92
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), isDisabled && fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), isSkeleton && "divider_skeleton"), style: hrStyles }));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
exports.Divider = Divider;
|
|
96
|
-
exports.dividerAppearance = dividerAppearance;
|
|
97
|
-
exports.dividerConfig = dividerConfig;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
|
-
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
|
-
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
7
|
-
|
|
8
|
-
var dividerAppearanceAccent = {
|
|
9
|
-
accentPrimary: {
|
|
10
|
-
fill: 'accentPrimary',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
var dividerAppearanceError = {
|
|
15
|
-
errorPrimary: {
|
|
16
|
-
fill: 'errorPrimary',
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var dividerAppearancePrimary = {
|
|
21
|
-
primaryPrimary: {
|
|
22
|
-
fill: 'primaryPrimary',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var dividerAppearanceSecondary = {
|
|
27
|
-
secondaryPrimary: {
|
|
28
|
-
fill: 'secondaryPrimary',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var dividerAppearanceSize = {
|
|
33
|
-
sizeL: {
|
|
34
|
-
size: 'l',
|
|
35
|
-
},
|
|
36
|
-
sizeM: {
|
|
37
|
-
size: 'm',
|
|
38
|
-
},
|
|
39
|
-
sizeS: {
|
|
40
|
-
size: 's',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var dividerAppearanceSuccess = {
|
|
45
|
-
successPrimary: {
|
|
46
|
-
fill: 'successPrimary',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
var dividerAppearanceSurface = {
|
|
51
|
-
surfacePrimary: {
|
|
52
|
-
fill: 'surfacePrimary',
|
|
53
|
-
},
|
|
54
|
-
surfaceSecondary: {
|
|
55
|
-
fill: 'surfaceSecondary',
|
|
56
|
-
},
|
|
57
|
-
surfaceTertiary: {
|
|
58
|
-
fill: 'surfaceTertiary',
|
|
59
|
-
},
|
|
60
|
-
surfaceQuaternary: {
|
|
61
|
-
fill: 'surfaceQuaternary',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var dividerAppearanceWarning = {
|
|
66
|
-
warningPrimary: {
|
|
67
|
-
fill: 'warningPrimary',
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
var dividerAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, dividerAppearanceSize), dividerAppearanceAccent), dividerAppearanceError), dividerAppearancePrimary), dividerAppearanceSecondary), dividerAppearanceSuccess), dividerAppearanceSurface), dividerAppearanceWarning);
|
|
72
|
-
|
|
73
|
-
var dividerConfig = {
|
|
74
|
-
appearance: dividerAppearance,
|
|
75
|
-
setAppearance: function (appearanceConfig) {
|
|
76
|
-
dividerConfig.appearance = appearanceConfig;
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
function Divider(props) {
|
|
80
|
-
var className = props.className, appearance = props.appearance, isDisabled = props.isDisabled, isActive = props.isActive, isSkeleton = props.isSkeleton;
|
|
81
|
-
var appearanceConfig = useAppearanceConfig(appearance, dividerConfig);
|
|
82
|
-
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
83
|
-
var directionClass = propsGenerator.directionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
84
|
-
// @ts-expect-error
|
|
85
|
-
var hrStyles = useStyles(props).styles;
|
|
86
|
-
return (jsx("hr", { className: clsx(className, 'divider', widthClass && "width_".concat(widthClass), directionClass && "divider_direction_".concat(directionClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), sizeClass && "divider_size_".concat(sizeClass), !isActive
|
|
87
|
-
? fillClass && "fill_".concat(fillClass)
|
|
88
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
89
|
-
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
90
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), isDisabled && fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), isSkeleton && "divider_skeleton"), style: hrStyles }));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { Divider as D, dividerAppearance as a, dividerConfig as d };
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
-
var Icon = require('./Icon_cjs_Cz6IyOkb.js');
|
|
9
|
-
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
10
|
-
var Divider = require('./Divider_cjs_DUYtmwn2.js');
|
|
11
|
-
var Text = require('./Text_cjs_0EINiUq4.js');
|
|
12
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
13
|
-
|
|
14
|
-
function Dropdown(props) {
|
|
15
|
-
var className = props.className, appearance = props.appearance, _a = props.animationClose, animationClose = _a === void 0 ? 'dropdown_animation_close' : _a, _b = props.animationOpen, animationOpen = _b === void 0 ? 'dropdown_animation_open' : _b, dropdownList = props.dropdownList, before = props.before, after = props.after, isOpen = props.isOpen, isSkeleton = props.isSkeleton, setIsOpen = props.setIsOpen, onClickItem = props.onClickItem, children = props.children;
|
|
16
|
-
var dropdownRef = React.useRef(null);
|
|
17
|
-
// const [isOpen, setIsOpen] = useState(false)
|
|
18
|
-
var _c = React.useState({
|
|
19
|
-
className: '',
|
|
20
|
-
}), animationState = _c[0], setAnimationState = _c[1];
|
|
21
|
-
var onAnimationEnd = React.useCallback(function () {
|
|
22
|
-
// When component is change his visibility(display) in DOM,
|
|
23
|
-
// animation of close can run unnecessary on showing element.
|
|
24
|
-
// const dropdownElement = dropdownRef.current
|
|
25
|
-
setAnimationState(function (prevState) { return ({
|
|
26
|
-
className: isOpen ? prevState.className : '',
|
|
27
|
-
}); });
|
|
28
|
-
}, [isOpen]);
|
|
29
|
-
React.useEffect(function () {
|
|
30
|
-
if (animationOpen && animationClose) {
|
|
31
|
-
setAnimationState(function () { return ({
|
|
32
|
-
className: isOpen ? animationOpen : animationClose,
|
|
33
|
-
}); });
|
|
34
|
-
}
|
|
35
|
-
}, [isOpen, animationOpen, animationClose]);
|
|
36
|
-
// Close dropdown by click outside
|
|
37
|
-
React.useEffect(function () {
|
|
38
|
-
// Add a handler to keep track of the click target.
|
|
39
|
-
function onClickWindow(event) {
|
|
40
|
-
var dropdownElement = dropdownRef.current;
|
|
41
|
-
if (dropdownElement && animationOpen) {
|
|
42
|
-
// Is event target inside of dropdown element
|
|
43
|
-
var isContainsTarget = dropdownElement.contains(event.target);
|
|
44
|
-
// Is dropdown element has "open" class
|
|
45
|
-
var hasOpenClass = dropdownElement.classList.contains(animationOpen);
|
|
46
|
-
if (!isContainsTarget && hasOpenClass) {
|
|
47
|
-
// Trigger close event with animation
|
|
48
|
-
// dropdownElement.click() - trigger "onClickWindow" again
|
|
49
|
-
setIsOpen(false);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
// Add event listener for current dropdown on first render
|
|
54
|
-
window.addEventListener('click', onClickWindow);
|
|
55
|
-
return function () {
|
|
56
|
-
// Remove event listener for current dropdown on unmount
|
|
57
|
-
window.removeEventListener('click', onClickWindow);
|
|
58
|
-
};
|
|
59
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
-
}, []);
|
|
61
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
62
|
-
var alignmentClass = propsGenerator.alignmentClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, elevationClass = propsGenerator.elevationClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass;
|
|
63
|
-
var styles = useStyles.useStyles(props).styles;
|
|
64
|
-
return (jsxRuntime.jsxs("div", { className: clsx(className, 'dropdown', alignmentClass && "alignment_".concat(alignmentClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), elevationClass && "elevation_".concat(elevationClass), isOpen ? 'dropdown_state_open' : 'dropdown_state_close', animationState.className), ref: dropdownRef, style: styles, children: [before, (children || dropdownList) && (jsxRuntime.jsxs("div", { className: clsx('dropdown__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)),
|
|
65
|
-
// Add "onAnimationEnd" only for wrapper for ignore dropdown button
|
|
66
|
-
onAnimationEnd: onAnimationEnd, children: [dropdownList === null || dropdownList === void 0 ? void 0 : dropdownList.map(function (item) { return (jsxRuntime.jsx(DropdownItem, { appearance: appearance, label: item.label, badgeValue: item.badgeValue, emptyMessage: item.emptyMessage, iconAfter: item.iconAfter, iconBefore: item.iconBefore, iconSrc: item.icon, isActive: item.isActive, isSkeleton: isSkeleton, onClick: item.onClick || (function (event) { return onClickItem === null || onClickItem === void 0 ? void 0 : onClickItem(item, event); }) }, item.key)); }), children] })), after] }));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var dropdownAppearanceAccent = {
|
|
70
|
-
accentPrimary: {
|
|
71
|
-
fill: 'accentPrimary',
|
|
72
|
-
fillActive: 'accentPrimaryActive',
|
|
73
|
-
fillActiveHover: 'accentHoverPrimary',
|
|
74
|
-
fillHover: 'accentHoverPrimary',
|
|
75
|
-
labelTextColor: 'accentTextPrimary',
|
|
76
|
-
labelTextColorActive: 'accentTextPrimary',
|
|
77
|
-
labelTextColorActiveHover: 'accentTextPrimary',
|
|
78
|
-
labelTextColorHover: 'accentTextPrimary',
|
|
79
|
-
badgeAppearance: 'surfacePrimary',
|
|
80
|
-
dividerFill: 'surfaceTertiary',
|
|
81
|
-
emptyMessageTextColor: 'accentTextPrimary',
|
|
82
|
-
iconAfterFillIcon: 'accentItemPrimary',
|
|
83
|
-
iconBeforeFillIcon: 'accentItemPrimary',
|
|
84
|
-
},
|
|
85
|
-
accentSecondary: {
|
|
86
|
-
fill: 'accentPrimary',
|
|
87
|
-
fillHover: 'accentPrimaryHover',
|
|
88
|
-
labelTextColor: 'accentTextSecondary',
|
|
89
|
-
labelTextColorHover: 'accentTextSecondary',
|
|
90
|
-
borderColor: 'accentBorderPrimary',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var dropdownAppearanceSize = {
|
|
95
|
-
sizeL: {
|
|
96
|
-
size: 'l',
|
|
97
|
-
labelTextSize: 'm',
|
|
98
|
-
badgeSize: 'xs',
|
|
99
|
-
badgeTextSize: 'xs',
|
|
100
|
-
dividerSize: 's',
|
|
101
|
-
emptyMessageTextSize: 'm',
|
|
102
|
-
iconAfterFillSize: '24',
|
|
103
|
-
iconAfterSize: '24',
|
|
104
|
-
iconBeforeFillSize: '24',
|
|
105
|
-
iconBeforeSize: '24',
|
|
106
|
-
},
|
|
107
|
-
sizeS: {
|
|
108
|
-
size: 's',
|
|
109
|
-
labelTextSize: 's',
|
|
110
|
-
badgeSize: 'xs',
|
|
111
|
-
badgeTextSize: 'xs',
|
|
112
|
-
dividerSize: 's',
|
|
113
|
-
emptyMessageTextSize: 'm',
|
|
114
|
-
iconAfterFillSize: '16',
|
|
115
|
-
iconAfterSize: '16',
|
|
116
|
-
iconBeforeFillSize: '16',
|
|
117
|
-
iconBeforeSize: '16',
|
|
118
|
-
},
|
|
119
|
-
sizeXS: {
|
|
120
|
-
size: 'xs',
|
|
121
|
-
labelTextSize: 'xs',
|
|
122
|
-
badgeSize: 'xs',
|
|
123
|
-
badgeTextSize: 'xs',
|
|
124
|
-
dividerSize: 's',
|
|
125
|
-
emptyMessageTextSize: 'xs',
|
|
126
|
-
iconAfterFillSize: '12',
|
|
127
|
-
iconAfterSize: '12',
|
|
128
|
-
iconBeforeFillSize: '12',
|
|
129
|
-
iconBeforeSize: '12',
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
var dropdownAppearanceStyle = {
|
|
134
|
-
solid: {
|
|
135
|
-
borderColor: 'none',
|
|
136
|
-
},
|
|
137
|
-
outlined: {
|
|
138
|
-
fill: 'none',
|
|
139
|
-
},
|
|
140
|
-
full: {},
|
|
141
|
-
ghost: {
|
|
142
|
-
fill: 'none',
|
|
143
|
-
borderColor: 'none',
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
var dropdownAppearanceSurface = {
|
|
148
|
-
surfacePrimary: {
|
|
149
|
-
fill: 'surfacePrimary',
|
|
150
|
-
fillActive: 'surfacePrimaryActive',
|
|
151
|
-
fillHover: 'surfaceHoverPrimary',
|
|
152
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
153
|
-
labelTextColorActive: 'surfaceTextPrimary',
|
|
154
|
-
labelTextColorActiveHover: 'surfaceTextPrimary',
|
|
155
|
-
labelTextColorHover: 'surfaceTextPrimary',
|
|
156
|
-
badgeAppearance: 'accentPrimary',
|
|
157
|
-
dividerFill: 'surfaceTertiary',
|
|
158
|
-
emptyMessageTextColor: 'surfaceTextPrimary',
|
|
159
|
-
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
160
|
-
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
161
|
-
},
|
|
162
|
-
surfaceSecondary: {
|
|
163
|
-
fill: 'surfaceSecondary',
|
|
164
|
-
fillHover: 'surfaceSecondaryHover',
|
|
165
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
166
|
-
loaderFill: 'surfaceSecondary',
|
|
167
|
-
loaderItemFill: 'surfaceItemPrimary',
|
|
168
|
-
},
|
|
169
|
-
surfaceTertiary: {
|
|
170
|
-
fill: 'surfaceTertiary',
|
|
171
|
-
fillHover: 'surfaceTertiaryHover',
|
|
172
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
173
|
-
},
|
|
174
|
-
surfaceQuaternary: {
|
|
175
|
-
fill: 'surfaceQuaternary',
|
|
176
|
-
fillHover: 'surfaceQuaternaryHover',
|
|
177
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
var dropdownItemAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, dropdownAppearanceSurface), dropdownAppearanceStyle), dropdownAppearanceAccent), dropdownAppearanceSize);
|
|
182
|
-
|
|
183
|
-
var dropdownItemConfig = {
|
|
184
|
-
appearance: dropdownItemAppearance,
|
|
185
|
-
setAppearance: function (appearanceConfig) {
|
|
186
|
-
dropdownItemConfig.appearance = appearanceConfig;
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
function DropdownItem(props) {
|
|
190
|
-
var className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, badgeValue = props.badgeValue, emptyMessage = props.emptyMessage, showDivider = props.showDivider, before = props.before, after = props.after, isActive = props.isActive, isHover = props.isHover, isSkeleton = props.isSkeleton, onClick = props.onClick, onMouseEnter = props.onMouseEnter, children = props.children;
|
|
191
|
-
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, dropdownItemConfig);
|
|
192
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
193
|
-
var directionClass = propsGenerator.directionClass, justifyContentClass = propsGenerator.justifyContentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextAlign = propsGenerator.labelTextAlign, labelTextColor = propsGenerator.labelTextColor, labelTextColorActive = propsGenerator.labelTextColorActive, labelTextColorActiveHover = propsGenerator.labelTextColorActiveHover, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, descTextColor = propsGenerator.descTextColor, descTextColorHover = propsGenerator.descTextColorHover, descTextGradient = propsGenerator.descTextGradient, descTextSize = propsGenerator.descTextSize, descTextStyle = propsGenerator.descTextStyle, descTextWeight = propsGenerator.descTextWeight, descTextWrap = propsGenerator.descTextWrap, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerSize = propsGenerator.dividerSize, emptyMessageTextColor = propsGenerator.emptyMessageTextColor, emptyMessageTextColorHover = propsGenerator.emptyMessageTextColorHover, emptyMessageTextSize = propsGenerator.emptyMessageTextSize, emptyMessageTextStyle = propsGenerator.emptyMessageTextStyle, emptyMessageTextWeight = propsGenerator.emptyMessageTextWeight, emptyMessageTextWrap = propsGenerator.emptyMessageTextWrap, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeValue = propsGenerator.iconBadgeValue, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
194
|
-
// @ts-expect-error
|
|
195
|
-
var dropdownItem = useStyles.useStyles(props).styles;
|
|
196
|
-
return (jsxRuntime.jsxs("div", { className: clsx('dropdown__item', isActive && 'dropdown__item_state_active', isHover && 'dropdown__item_state_hover', directionClass && "dropdown__item_direction_".concat(directionClass), className, !isActive
|
|
197
|
-
? fillClass && "fill_".concat(fillClass)
|
|
198
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
199
|
-
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
200
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), sizeClass && "dropdown__item_size_".concat(sizeClass), shapeClass && "dropdown__item_shape_".concat(shapeClass), widthClass && "dropdown__item_width_".concat(widthClass), isDisabled && "dropdown__item_state_disabled", onClick && 'cursor_type_pointer', isSkeleton && "dropdown__item_skeleton", justifyContentClass &&
|
|
201
|
-
"dropdown__item_justify-content_".concat(justifyContentClass)), style: dropdownItem, onClick: onClick, onMouseEnter: onMouseEnter, children: [jsxRuntime.jsx("div", { className: "dropdown__item-wrapper", children: jsxRuntime.jsxs(React.Fragment, { children: [before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon.Icon, { className: clsx('dropdown__item_before', iconBadgeValue && 'dropdown__item_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), children || (jsxRuntime.jsxs(React.Fragment, { children: [label && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-label", size: labelTextSize, textAlign: labelTextAlign, textColor: !isActive && labelTextColor, textColorActive: "accentTextPrimary", textColorActive: isActive && labelTextColorActive, textColorHover: !isActive && labelTextColorHover, textColorHoverActive: isActive && labelTextColorActiveHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })), badgeValue && (jsxRuntime.jsx(Icon.Badge, { appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), desc && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-desc", size: descTextSize, textColor: descTextColor, textColorGradient: descTextGradient, textColorHover: descTextColorHover, textStyle: descTextStyle, textWeight: descTextWeight, textWrap: descTextWrap, isActive: isActive, children: desc })), emptyMessage && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item", size: emptyMessageTextSize, textColor: emptyMessageTextColor, textColorHover: emptyMessageTextColorHover, textStyle: emptyMessageTextStyle, textWeight: emptyMessageTextWeight, textWrap: emptyMessageTextWrap, isActive: isActive, children: emptyMessage }))] })), after, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon.Icon, { className: clsx('dropdown__item_after', iconBadgeValue && 'dropdown__item_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }) }), showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
exports.Dropdown = Dropdown;
|
|
205
|
-
exports.DropdownItem = DropdownItem;
|
|
206
|
-
exports.dropdownItemAppearance = dropdownItemAppearance;
|
|
207
|
-
exports.dropdownItemConfig = dropdownItemConfig;
|