@true-engineering/true-react-common-ui-kit 4.0.0-alpha4 → 4.0.0-alpha40
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/LICENSE +201 -201
- package/README.md +11 -607
- package/dist/components/AccountInfo/AccountInfo.d.ts +11 -11
- package/dist/components/AccountInfo/AccountInfo.styles.d.ts +6 -6
- package/dist/components/AccountInfo/constants.d.ts +1 -1
- package/dist/components/AccountInfo/index.d.ts +2 -2
- package/dist/components/AddButton/AddButton.d.ts +14 -14
- package/dist/components/AddButton/AddButton.styles.d.ts +3 -3
- package/dist/components/AddButton/index.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +41 -41
- package/dist/components/Button/Button.styles.d.ts +8 -8
- package/dist/components/Button/constants.d.ts +2 -2
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Button/types.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.d.ts +24 -24
- package/dist/components/Checkbox/Checkbox.styles.d.ts +3 -3
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/CloseButton/CloseButton.d.ts +10 -10
- package/dist/components/CloseButton/CloseButton.styles.d.ts +3 -3
- package/dist/components/CloseButton/index.d.ts +2 -2
- package/dist/components/Colors/Colors.d.ts +2 -2
- package/dist/components/Colors/Colors.styles.d.ts +1 -1
- package/dist/components/Colors/index.d.ts +1 -1
- package/dist/components/ControlWrapper/ControlWrapper.d.ts +31 -27
- package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +7 -6
- package/dist/components/ControlWrapper/helpers.d.ts +4 -0
- package/dist/components/ControlWrapper/index.d.ts +4 -2
- package/dist/components/ControlWrapper/types.d.ts +12 -0
- package/dist/components/CssBaseline/CssBaseline.d.ts +5 -5
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +3 -3
- package/dist/components/CssBaseline/index.d.ts +2 -2
- package/dist/components/DateInput/DateInput.d.ts +16 -17
- package/dist/components/DateInput/DateInput.styles.d.ts +6 -6
- package/dist/components/DateInput/constants.d.ts +2 -2
- package/dist/components/DateInput/index.d.ts +3 -3
- package/dist/components/DatePicker/DatePicker.d.ts +27 -26
- package/dist/components/DatePicker/DatePicker.styles.d.ts +6 -6
- package/dist/components/DatePicker/components/DatePickerBase/DatePickerBase.d.ts +5 -0
- package/dist/components/DatePicker/components/DatePickerBase/index.d.ts +1 -0
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.d.ts +8 -8
- package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +7 -7
- package/dist/components/DatePicker/components/DatePickerHeader/index.d.ts +2 -2
- package/dist/components/DatePicker/components/PopperContainer/PopperContainer.d.ts +2 -4
- package/dist/components/DatePicker/components/PopperContainer/index.d.ts +1 -1
- package/dist/components/DatePicker/components/index.d.ts +3 -2
- package/dist/components/DatePicker/constants.d.ts +8 -3
- package/dist/components/DatePicker/helpers.d.ts +3 -3
- package/dist/components/DatePicker/index.d.ts +5 -4
- package/dist/components/DatePicker/types.d.ts +4 -4
- package/dist/components/Description/Description.d.ts +13 -13
- package/dist/components/Description/Description.styles.d.ts +3 -3
- package/dist/components/Description/constants.d.ts +1 -1
- package/dist/components/Description/index.d.ts +2 -2
- package/dist/components/FileInput/FileInput.d.ts +25 -25
- package/dist/components/FileInput/FileInput.styles.d.ts +3 -3
- package/dist/components/FileInput/helpers.d.ts +2 -2
- package/dist/components/FileInput/index.d.ts +2 -2
- package/dist/components/FileItem/FileItem.d.ts +31 -31
- package/dist/components/FileItem/FileItem.styles.d.ts +11 -11
- package/dist/components/FileItem/constants.d.ts +4 -5
- package/dist/components/FileItem/helpers.d.ts +5 -4
- package/dist/components/FileItem/index.d.ts +4 -4
- package/dist/components/FileItem/types.d.ts +7 -8
- package/dist/components/FiltersPane/FiltersPane.d.ts +27 -22
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +11 -11
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +7 -7
- package/dist/components/FiltersPane/components/Filter/helpers.d.ts +4 -0
- package/dist/components/FiltersPane/components/Filter/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.d.ts +16 -24
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +15 -15
- package/dist/components/FiltersPane/components/FilterInterval/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.d.ts +5 -5
- package/dist/components/FiltersPane/components/FilterMultiSelect/index.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.d.ts +30 -30
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +15 -15
- package/dist/components/FiltersPane/components/FilterSelect/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +7 -5
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +3 -3
- package/dist/components/FiltersPane/components/FilterValueView/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.d.ts +16 -16
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +26 -26
- package/dist/components/FiltersPane/components/FilterWithDates/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.d.ts +13 -13
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +7 -7
- package/dist/components/FiltersPane/components/FilterWithPeriod/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +13 -13
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +8 -8
- package/dist/components/FiltersPane/components/FilterWrapper/helpers.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +21 -20
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +10 -10
- package/dist/components/FiltersPane/components/FiltersPaneSearch/index.d.ts +2 -2
- package/dist/components/FiltersPane/components/index.d.ts +9 -9
- package/dist/components/FiltersPane/constants.d.ts +9 -9
- package/dist/components/FiltersPane/helpers.d.ts +5 -5
- package/dist/components/FiltersPane/index.d.ts +5 -4
- package/dist/components/FiltersPane/types.d.ts +122 -108
- package/dist/components/Flag/Flag.d.ts +8 -8
- package/dist/components/Flag/Flag.styles.d.ts +3 -3
- package/dist/components/Flag/customFlags/customFlags.d.ts +10 -0
- package/dist/components/Flag/customFlags/index.d.ts +1 -0
- package/dist/components/Flag/index.d.ts +2 -2
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +33 -31
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +7 -7
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +15 -14
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +3 -3
- package/dist/components/FlexibleTable/components/FlexibleTableCell/index.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +31 -31
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +6 -6
- package/dist/components/FlexibleTable/components/FlexibleTableRow/index.d.ts +2 -2
- package/dist/components/FlexibleTable/components/index.d.ts +2 -2
- package/dist/components/FlexibleTable/constants.d.ts +19 -3
- package/dist/components/FlexibleTable/helpers.d.ts +3 -3
- package/dist/components/FlexibleTable/index.d.ts +4 -4
- package/dist/components/FlexibleTable/types.d.ts +65 -57
- package/dist/components/FloatDocActions/FloatDocActions.d.ts +6 -0
- package/dist/components/FloatDocActions/FloatDocActions.styles.d.ts +8 -0
- package/dist/components/FloatDocActions/components/DocActions/DocActions.d.ts +12 -0
- package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +6 -0
- package/dist/components/FloatDocActions/components/DocActions/constants.d.ts +1 -0
- package/dist/components/FloatDocActions/components/DocActions/index.d.ts +4 -0
- package/dist/components/FloatDocActions/components/DocActions/types.d.ts +2 -0
- package/dist/components/FloatDocActions/components/index.d.ts +1 -0
- package/dist/components/FloatDocActions/constants.d.ts +1 -0
- package/dist/components/FloatDocActions/index.d.ts +3 -0
- package/dist/components/Icon/Icon.d.ts +8 -8
- package/dist/components/Icon/Icon.styles.d.ts +3 -3
- package/dist/components/Icon/icons/index.d.ts +31 -0
- package/dist/components/Icon/index.d.ts +5 -5
- package/dist/components/Icon/snippet.d.ts +3 -3
- package/dist/components/Icon/types.d.ts +9 -13
- package/dist/components/IconButton/IconButton.d.ts +19 -19
- package/dist/components/IconButton/IconButton.styles.d.ts +3 -3
- package/dist/components/IconButton/constants.d.ts +2 -2
- package/dist/components/IconButton/index.d.ts +3 -3
- package/dist/components/IconButton/types.d.ts +5 -5
- package/dist/components/IncrementInput/IncrementInput.d.ts +9 -9
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +7 -9
- package/dist/components/IncrementInput/index.d.ts +2 -2
- package/dist/components/Input/Input.d.ts +6 -5
- package/dist/components/Input/Input.styles.d.ts +8 -8
- package/dist/components/Input/InputBase.d.ts +24 -24
- package/dist/components/Input/index.d.ts +4 -4
- package/dist/components/Input/types.d.ts +3 -3
- package/dist/components/List/List.d.ts +9 -9
- package/dist/components/List/List.styles.d.ts +5 -5
- package/dist/components/List/components/ListItem/ListItem.d.ts +17 -17
- package/dist/components/List/components/ListItem/ListItem.styles.d.ts +3 -3
- package/dist/components/List/components/ListItem/index.d.ts +2 -2
- package/dist/components/List/components/index.d.ts +1 -1
- package/dist/components/List/index.d.ts +4 -3
- package/dist/components/List/types.d.ts +4 -0
- package/dist/components/Modal/Modal.d.ts +34 -34
- package/dist/components/Modal/Modal.styles.d.ts +7 -7
- package/dist/components/Modal/index.d.ts +3 -3
- package/dist/components/Modal/types.d.ts +3 -3
- package/dist/components/MoreMenu/MoreMenu.d.ts +15 -15
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +6 -6
- package/dist/components/MoreMenu/index.d.ts +2 -2
- package/dist/components/MultiSelect/MultiSelect.d.ts +23 -23
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +7 -7
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.d.ts +12 -12
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +3 -3
- package/dist/components/MultiSelect/components/MultiSelectInput/index.d.ts +2 -2
- package/dist/components/MultiSelect/components/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts +4 -4
- package/dist/components/MultiSelect/types.d.ts +1 -1
- package/dist/components/MultiSelectList/MultiSelectList.d.ts +25 -25
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +13 -13
- package/dist/components/MultiSelectList/constants.d.ts +3 -3
- package/dist/components/MultiSelectList/helpers.d.ts +3 -3
- package/dist/components/MultiSelectList/index.d.ts +3 -3
- package/dist/components/MultiSelectList/types.d.ts +12 -12
- package/dist/components/NewMoreMenu/NewMoreMenu.d.ts +13 -13
- package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +8 -8
- package/dist/components/NewMoreMenu/index.d.ts +2 -2
- package/dist/components/Notification/Notification.d.ts +17 -17
- package/dist/components/Notification/Notification.styles.d.ts +3 -3
- package/dist/components/Notification/index.d.ts +3 -3
- package/dist/components/Notification/types.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +18 -18
- package/dist/components/NumberInput/helpers.d.ts +4 -4
- package/dist/components/NumberInput/index.d.ts +1 -1
- package/dist/components/PhoneInput/PhoneInput.d.ts +17 -17
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +9 -9
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.d.ts +14 -14
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +7 -7
- package/dist/components/PhoneInput/components/PhoneInputCountryList/index.d.ts +2 -2
- package/dist/components/PhoneInput/components/index.d.ts +1 -1
- package/dist/components/PhoneInput/constants.d.ts +2 -2
- package/dist/components/PhoneInput/index.d.ts +4 -4
- package/dist/components/PhoneInput/types.d.ts +17 -17
- package/dist/components/RadioButton/RadioButton.d.ts +15 -15
- package/dist/components/RadioButton/RadioButton.styles.d.ts +3 -3
- package/dist/components/RadioButton/index.d.ts +2 -2
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +386 -386
- package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +3 -3
- package/dist/components/ScrollIntoViewIfNeeded/index.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +6 -6
- package/dist/components/SearchInput/SearchInput.styles.d.ts +5 -5
- package/dist/components/SearchInput/index.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +54 -52
- package/dist/components/Select/Select.styles.d.ts +34 -34
- package/dist/components/Select/components/SelectList/SelectList.d.ts +23 -23
- package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +6 -6
- package/dist/components/Select/components/SelectList/index.d.ts +2 -2
- package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +16 -15
- package/dist/components/Select/components/SelectListItem/SelectListItem.styles.d.ts +2 -2
- package/dist/components/Select/components/SelectListItem/index.d.ts +1 -1
- package/dist/components/Select/components/index.d.ts +2 -2
- package/dist/components/Select/constants.d.ts +2 -2
- package/dist/components/Select/helpers.d.ts +4 -4
- package/dist/components/Select/index.d.ts +4 -4
- package/dist/components/Select/types.d.ts +8 -4
- package/dist/components/Selector/Selector.d.ts +22 -22
- package/dist/components/Selector/Selector.styles.d.ts +9 -9
- package/dist/components/Selector/index.d.ts +2 -2
- package/dist/components/Selector/types.d.ts +10 -10
- package/dist/components/Skeleton/Skeleton.d.ts +7 -7
- package/dist/components/Skeleton/Skeleton.styles.d.ts +3 -3
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/SmartInput/SmartInput.d.ts +14 -14
- package/dist/components/SmartInput/constants.d.ts +16 -16
- package/dist/components/SmartInput/helpers.d.ts +2 -2
- package/dist/components/SmartInput/index.d.ts +2 -2
- package/dist/components/SmartInput/types.d.ts +6 -6
- package/dist/components/Status/Status.d.ts +16 -16
- package/dist/components/Status/Status.styles.d.ts +4 -3
- package/dist/components/Status/constants.d.ts +1 -2
- package/dist/components/Status/index.d.ts +3 -2
- package/dist/components/Status/types.d.ts +6 -3
- package/dist/components/Switch/Switch.d.ts +20 -20
- package/dist/components/Switch/Switch.styles.d.ts +3 -3
- package/dist/components/Switch/index.d.ts +3 -3
- package/dist/components/Switch/types.d.ts +4 -4
- package/dist/components/TextArea/TextArea.d.ts +28 -29
- package/dist/components/TextArea/TextArea.styles.d.ts +10 -9
- package/dist/components/TextArea/index.d.ts +3 -3
- package/dist/components/TextArea/types.d.ts +4 -2
- package/dist/components/TextButton/TextButton.d.ts +31 -31
- package/dist/components/TextButton/TextButton.styles.d.ts +7 -7
- package/dist/components/TextButton/constants.d.ts +2 -2
- package/dist/components/TextButton/index.d.ts +3 -3
- package/dist/components/TextButton/types.d.ts +5 -5
- package/dist/components/TextWithInfo/TextWithInfo.d.ts +15 -15
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +3 -3
- package/dist/components/TextWithInfo/index.d.ts +2 -2
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +27 -27
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +6 -6
- package/dist/components/TextWithTooltip/index.d.ts +2 -2
- package/dist/components/ThemedPreloader/ThemedPreloader.d.ts +11 -11
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +7 -7
- package/dist/components/ThemedPreloader/components/DefaultPreloader/DefaultPreloader.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/DefaultPreloader/index.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.d.ts +5 -5
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +3 -3
- package/dist/components/ThemedPreloader/components/DotsPreloader/index.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +8 -8
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +3 -3
- package/dist/components/ThemedPreloader/components/SvgPreloader/index.d.ts +2 -2
- package/dist/components/ThemedPreloader/components/index.d.ts +3 -3
- package/dist/components/ThemedPreloader/constants.d.ts +1 -1
- package/dist/components/ThemedPreloader/index.d.ts +4 -4
- package/dist/components/ThemedPreloader/types.d.ts +2 -2
- package/dist/components/Toaster/Toaster.d.ts +23 -23
- package/dist/components/Toaster/Toaster.styles.d.ts +6 -6
- package/dist/components/Toaster/constants.d.ts +1 -1
- package/dist/components/Toaster/index.d.ts +3 -3
- package/dist/components/Toaster/types.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +11 -11
- package/dist/components/Tooltip/Tooltip.styles.d.ts +3 -3
- package/dist/components/Tooltip/index.d.ts +3 -3
- package/dist/components/Tooltip/types.d.ts +1 -1
- package/dist/components/WithMessages/WithMessages.d.ts +10 -10
- package/dist/components/WithMessages/WithMessages.styles.d.ts +3 -3
- package/dist/components/WithMessages/index.d.ts +2 -2
- package/dist/components/WithPopup/WithPopup.d.ts +48 -40
- package/dist/components/WithPopup/WithPopup.styles.d.ts +3 -3
- package/dist/components/WithPopup/constants.d.ts +2 -2
- package/dist/components/WithPopup/helpers.d.ts +2 -2
- package/dist/components/WithPopup/index.d.ts +2 -2
- package/dist/components/WithPopup/types.d.ts +22 -22
- package/dist/components/WithTooltip/WithTooltip.d.ts +18 -18
- package/dist/components/WithTooltip/WithTooltip.styles.d.ts +7 -7
- package/dist/components/WithTooltip/index.d.ts +2 -2
- package/dist/components/index.d.ts +49 -48
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/mime-types.d.ts +76 -76
- package/dist/constants/phone-info.d.ts +2 -2
- package/dist/helpers/index.d.ts +3 -3
- package/dist/helpers/misc.d.ts +20 -21
- package/dist/helpers/phone.d.ts +14 -14
- package/dist/helpers/popper-helpers.d.ts +2 -2
- package/dist/hooks/index.d.ts +10 -7
- package/dist/hooks/use-did-mount-effect.d.ts +2 -2
- package/dist/hooks/use-dropdown.d.ts +11 -11
- package/dist/hooks/use-intersection-ref.d.ts +8 -0
- package/dist/hooks/use-is-mounted.d.ts +1 -1
- package/dist/hooks/use-latest-ref.d.ts +2 -0
- package/dist/hooks/use-merge.d.ts +1 -0
- package/dist/hooks/use-merged-refs.d.ts +2 -2
- package/dist/hooks/use-mixed-styles.d.ts +3 -1
- package/dist/hooks/use-on-click-outside.d.ts +5 -5
- package/dist/hooks/use-tweak-styles.d.ts +21 -21
- package/dist/index.d.ts +6 -6
- package/dist/style.css +78 -142
- package/dist/theme/Provider.d.ts +14 -11
- package/dist/theme/common.d.ts +113 -113
- package/dist/theme/create-themed-styles.d.ts +2 -0
- package/dist/theme/helpers.d.ts +16 -10
- package/dist/theme/index.d.ts +6 -4
- package/dist/theme/true-jss/ThemedStylesManager.d.ts +18 -0
- package/dist/theme/true-jss/TweakStylesManager.d.ts +34 -0
- package/dist/theme/true-jss/index.d.ts +2 -0
- package/dist/theme/true-jss/jss-context.d.ts +9 -0
- package/dist/theme/types.d.ts +86 -84
- package/dist/true-react-common-ui-kit.js +9886 -10278
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +10794 -11188
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +52 -45
- package/package.json +103 -99
- package/src/components/AccountInfo/AccountInfo.stories.tsx +32 -32
- package/src/components/AccountInfo/AccountInfo.styles.ts +52 -52
- package/src/components/AccountInfo/AccountInfo.tsx +80 -80
- package/src/components/AccountInfo/constants.ts +1 -1
- package/src/components/AccountInfo/index.ts +2 -2
- package/src/components/AddButton/AddButton.stories.tsx +21 -21
- package/src/components/AddButton/AddButton.styles.ts +34 -34
- package/src/components/AddButton/AddButton.tsx +52 -52
- package/src/components/AddButton/index.ts +2 -2
- package/src/components/Button/Button.stories.tsx +49 -50
- package/src/components/Button/Button.styles.ts +200 -200
- package/src/components/Button/Button.tsx +129 -129
- package/src/components/Button/constants.ts +11 -11
- package/src/components/Button/index.ts +3 -3
- package/src/components/Button/types.ts +5 -5
- package/src/components/Checkbox/Checkbox.stories.tsx +54 -54
- package/src/components/Checkbox/Checkbox.styles.ts +49 -49
- package/src/components/Checkbox/Checkbox.tsx +84 -84
- package/src/components/Checkbox/index.ts +2 -2
- package/src/components/CloseButton/CloseButton.stories.tsx +11 -11
- package/src/components/CloseButton/CloseButton.styles.ts +34 -34
- package/src/components/CloseButton/CloseButton.tsx +35 -35
- package/src/components/CloseButton/index.ts +2 -2
- package/src/components/Colors/Colors.stories.tsx +7 -7
- package/src/components/Colors/Colors.styles.ts +36 -36
- package/src/components/Colors/Colors.tsx +26 -26
- package/src/components/Colors/index.ts +1 -1
- package/src/components/ControlWrapper/ControlWrapper.stories.tsx +50 -45
- package/src/components/ControlWrapper/ControlWrapper.styles.ts +186 -185
- package/src/components/ControlWrapper/ControlWrapper.tsx +163 -151
- package/src/components/ControlWrapper/helpers.ts +11 -0
- package/src/components/ControlWrapper/index.ts +4 -2
- package/src/components/ControlWrapper/types.ts +16 -0
- package/src/components/CssBaseline/CssBaseline.styles.ts +14 -14
- package/src/components/CssBaseline/CssBaseline.tsx +13 -13
- package/src/components/CssBaseline/index.ts +2 -2
- package/src/components/DateInput/DateInput.stories.tsx +60 -61
- package/src/components/DateInput/DateInput.styles.ts +13 -13
- package/src/components/DateInput/DateInput.tsx +89 -90
- package/src/components/DateInput/constants.ts +2 -2
- package/src/components/DateInput/index.ts +3 -3
- package/src/components/DatePicker/DatePicker.stories.tsx +101 -88
- package/src/components/DatePicker/DatePicker.styles.ts +40 -38
- package/src/components/DatePicker/DatePicker.tsx +345 -314
- package/src/components/DatePicker/components/DatePickerBase/DatePickerBase.tsx +14 -0
- package/src/components/DatePicker/components/DatePickerBase/index.ts +1 -0
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.ts +54 -54
- package/src/components/DatePicker/components/DatePickerHeader/DatePickerHeader.tsx +81 -81
- package/src/components/DatePicker/components/DatePickerHeader/index.ts +2 -2
- package/src/components/DatePicker/components/PopperContainer/PopperContainer.tsx +6 -6
- package/src/components/DatePicker/components/PopperContainer/index.ts +1 -1
- package/src/components/DatePicker/components/index.ts +3 -2
- package/src/components/DatePicker/constants.ts +12 -6
- package/src/components/DatePicker/helpers.ts +23 -23
- package/src/components/DatePicker/index.ts +5 -4
- package/src/components/DatePicker/types.ts +50 -48
- package/src/components/Description/Description.stories.tsx +27 -27
- package/src/components/Description/Description.styles.ts +30 -30
- package/src/components/Description/Description.tsx +61 -61
- package/src/components/Description/constants.ts +1 -1
- package/src/components/Description/index.ts +2 -2
- package/src/components/FileInput/FileInput.stories.tsx +75 -75
- package/src/components/FileInput/FileInput.styles.ts +80 -80
- package/src/components/FileInput/FileInput.tsx +147 -147
- package/src/components/FileInput/helpers.ts +6 -6
- package/src/components/FileInput/index.ts +2 -2
- package/src/components/FileItem/FileItem.stories.tsx +58 -59
- package/src/components/FileItem/FileItem.styles.ts +122 -122
- package/src/components/FileItem/FileItem.tsx +157 -157
- package/src/components/FileItem/constants.ts +18 -29
- package/src/components/FileItem/helpers.ts +28 -27
- package/src/components/FileItem/index.ts +4 -4
- package/src/components/FileItem/types.ts +9 -11
- package/src/components/FiltersPane/FiltersPane.stories.tsx +301 -295
- package/src/components/FiltersPane/FiltersPane.styles.ts +92 -92
- package/src/components/FiltersPane/FiltersPane.tsx +171 -162
- package/src/components/FiltersPane/components/Filter/Filter.tsx +120 -114
- package/src/components/FiltersPane/components/Filter/helpers.ts +18 -0
- package/src/components/FiltersPane/components/Filter/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +62 -63
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +140 -152
- package/src/components/FiltersPane/components/FilterInterval/index.ts +2 -2
- package/src/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.tsx +10 -10
- package/src/components/FiltersPane/components/FilterMultiSelect/index.ts +1 -1
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +142 -143
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +360 -361
- package/src/components/FiltersPane/components/FilterSelect/index.ts +2 -2
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.styles.tsx +15 -15
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +171 -166
- package/src/components/FiltersPane/components/FilterValueView/index.tsx +2 -2
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +68 -68
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +207 -208
- package/src/components/FiltersPane/components/FilterWithDates/index.ts +2 -2
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.ts +21 -21
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +178 -177
- package/src/components/FiltersPane/components/FilterWithPeriod/index.ts +2 -2
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.ts +99 -99
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +153 -149
- package/src/components/FiltersPane/components/FilterWrapper/helpers.ts +14 -14
- package/src/components/FiltersPane/components/FilterWrapper/index.ts +2 -2
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +129 -124
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +162 -162
- package/src/components/FiltersPane/components/FiltersPaneSearch/index.ts +2 -2
- package/src/components/FiltersPane/components/index.ts +9 -9
- package/src/components/FiltersPane/constants.ts +137 -137
- package/src/components/FiltersPane/helpers.ts +26 -26
- package/src/components/FiltersPane/index.ts +6 -5
- package/src/components/FiltersPane/types.ts +183 -157
- package/src/components/Flag/Flag.stories.tsx +30 -29
- package/src/components/Flag/Flag.styles.ts +21 -17
- package/src/components/Flag/Flag.tsx +40 -26
- package/src/components/Flag/customFlags/AB.svg +1 -0
- package/src/components/Flag/customFlags/OS.svg +1 -0
- package/src/components/{Icon/complexIcons → Flag/customFlags}/augment.d.ts +1 -1
- package/src/components/Flag/customFlags/customFlags.ts +13 -0
- package/src/components/Flag/customFlags/index.ts +1 -0
- package/src/components/Flag/index.ts +2 -2
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +300 -300
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +113 -111
- package/src/components/FlexibleTable/FlexibleTable.tsx +288 -308
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +43 -43
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +116 -113
- package/src/components/FlexibleTable/components/FlexibleTableCell/index.ts +2 -2
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.ts +25 -25
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +194 -193
- package/src/components/FlexibleTable/components/FlexibleTableRow/index.ts +2 -2
- package/src/components/FlexibleTable/components/index.ts +2 -2
- package/src/components/FlexibleTable/constants.ts +11 -8
- package/src/components/FlexibleTable/helpers.ts +16 -16
- package/src/components/FlexibleTable/index.ts +4 -4
- package/src/components/FlexibleTable/types.ts +86 -82
- package/src/components/FloatDocActions/FloatDocActions.stories.tsx +117 -0
- package/src/components/FloatDocActions/FloatDocActions.styles.ts +12 -0
- package/src/components/FloatDocActions/FloatDocActions.tsx +34 -0
- package/src/components/FloatDocActions/components/DocActions/DocActions.styles.ts +29 -0
- package/src/components/FloatDocActions/components/DocActions/DocActions.tsx +43 -0
- package/src/components/FloatDocActions/components/DocActions/constants.ts +1 -0
- package/src/components/FloatDocActions/components/DocActions/index.ts +4 -0
- package/src/components/FloatDocActions/components/DocActions/types.ts +3 -0
- package/src/components/FloatDocActions/components/index.ts +1 -0
- package/src/components/FloatDocActions/constants.ts +1 -0
- package/src/components/FloatDocActions/index.ts +3 -0
- package/src/components/Icon/Icon.stories.tsx +95 -86
- package/src/components/Icon/Icon.styles.ts +10 -10
- package/src/components/Icon/Icon.tsx +31 -26
- package/src/components/Icon/{complexIcons/avatarGreen.svg → icons/avatar.svg} +57 -57
- package/src/components/Icon/icons/calendar.svg +1 -0
- package/src/components/Icon/icons/check.svg +1 -0
- package/src/components/Icon/icons/chevron-down-small.svg +1 -0
- package/src/components/Icon/icons/chevron-down.svg +1 -0
- package/src/components/Icon/icons/chevron-left.svg +1 -0
- package/src/components/Icon/icons/chevron-right.svg +1 -0
- package/src/components/Icon/icons/close-large.svg +1 -0
- package/src/components/Icon/icons/close-window.svg +1 -0
- package/src/components/Icon/icons/close.svg +1 -0
- package/src/components/Icon/{complexIcons/fileExcel.svg → icons/file-excel.svg} +10 -10
- package/src/components/Icon/{complexIcons/fileImage.svg → icons/file-image.svg} +12 -12
- package/src/components/Icon/{complexIcons/fileOther.svg → icons/file-other.svg} +9 -9
- package/src/components/Icon/{complexIcons/filePdf.svg → icons/file-pdf.svg} +10 -10
- package/src/components/Icon/{complexIcons/fileWord.svg → icons/file-word.svg} +10 -10
- package/src/components/Icon/{complexIcons/fileXml.svg → icons/file-xml.svg} +12 -12
- package/src/components/Icon/{complexIcons/fileZip.svg → icons/file-zip.svg} +15 -15
- package/src/components/Icon/icons/filter.svg +1 -0
- package/src/components/Icon/icons/index.ts +62 -0
- package/src/components/Icon/icons/information.svg +1 -0
- package/src/components/Icon/icons/menu.svg +1 -0
- package/src/components/Icon/icons/minus.svg +1 -0
- package/src/components/Icon/icons/plus.svg +1 -0
- package/src/components/Icon/icons/search.svg +1 -0
- package/src/components/Icon/icons/status-error.svg +1 -0
- package/src/components/Icon/icons/status-info.svg +1 -0
- package/src/components/Icon/icons/status-not-ok.svg +1 -0
- package/src/components/Icon/icons/status-ok.svg +1 -0
- package/src/components/Icon/icons/status-warning.svg +1 -0
- package/src/components/Icon/icons/trash-can.svg +1 -0
- package/src/components/Icon/index.ts +5 -5
- package/src/components/Icon/snippet.tsx +6 -6
- package/src/components/Icon/types.ts +12 -18
- package/src/components/IconButton/IconButton.stories.tsx +31 -32
- package/src/components/IconButton/IconButton.styles.ts +86 -84
- package/src/components/IconButton/IconButton.tsx +74 -74
- package/src/components/IconButton/constants.ts +3 -3
- package/src/components/IconButton/index.ts +3 -3
- package/src/components/IconButton/types.ts +11 -11
- package/src/components/IncrementInput/IncrementInput.stories.tsx +31 -29
- package/src/components/IncrementInput/IncrementInput.styles.ts +70 -78
- package/src/components/IncrementInput/IncrementInput.tsx +108 -105
- package/src/components/IncrementInput/index.ts +2 -2
- package/src/components/Input/Input.stories.tsx +78 -83
- package/src/components/Input/Input.styles.ts +101 -101
- package/src/components/Input/Input.tsx +35 -34
- package/src/components/Input/InputBase.tsx +254 -251
- package/src/components/Input/index.ts +4 -4
- package/src/components/Input/types.ts +4 -4
- package/src/components/List/List.stories.tsx +90 -90
- package/src/components/List/List.styles.ts +25 -25
- package/src/components/List/List.tsx +71 -68
- package/src/components/List/components/ListItem/ListItem.styles.ts +52 -52
- package/src/components/List/components/ListItem/ListItem.tsx +68 -68
- package/src/components/List/components/ListItem/index.ts +2 -2
- package/src/components/List/components/index.ts +1 -1
- package/src/components/List/index.ts +4 -3
- package/src/components/List/types.ts +5 -0
- package/src/components/Modal/Modal.stories.tsx +105 -105
- package/src/components/Modal/Modal.styles.ts +318 -318
- package/src/components/Modal/Modal.tsx +203 -203
- package/src/components/Modal/index.ts +3 -3
- package/src/components/Modal/types.ts +17 -17
- package/src/components/MoreMenu/MoreMenu.stories.tsx +46 -46
- package/src/components/MoreMenu/MoreMenu.styles.ts +69 -69
- package/src/components/MoreMenu/MoreMenu.tsx +93 -93
- package/src/components/MoreMenu/index.ts +2 -2
- package/src/components/MultiSelect/MultiSelect.stories.tsx +46 -46
- package/src/components/MultiSelect/MultiSelect.styles.ts +59 -59
- package/src/components/MultiSelect/MultiSelect.tsx +106 -106
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.ts +73 -73
- package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +53 -53
- package/src/components/MultiSelect/components/MultiSelectInput/index.ts +2 -2
- package/src/components/MultiSelect/components/index.ts +1 -1
- package/src/components/MultiSelect/index.ts +4 -4
- package/src/components/MultiSelect/types.ts +1 -1
- package/src/components/MultiSelectList/MultiSelectList.styles.ts +138 -138
- package/src/components/MultiSelectList/MultiSelectList.tsx +465 -461
- package/src/components/MultiSelectList/constants.ts +21 -21
- package/src/components/MultiSelectList/helpers.ts +11 -11
- package/src/components/MultiSelectList/index.ts +3 -3
- package/src/components/MultiSelectList/types.ts +15 -15
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +74 -74
- package/src/components/NewMoreMenu/NewMoreMenu.styles.ts +39 -39
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +79 -79
- package/src/components/NewMoreMenu/index.ts +2 -2
- package/src/components/Notification/Notification.stories.tsx +50 -51
- package/src/components/Notification/Notification.styles.ts +57 -57
- package/src/components/Notification/Notification.tsx +77 -77
- package/src/components/Notification/index.ts +3 -3
- package/src/components/Notification/types.ts +1 -1
- package/src/components/NumberInput/NumberInput.stories.tsx +37 -33
- package/src/components/NumberInput/NumberInput.tsx +134 -134
- package/src/components/NumberInput/helpers.ts +84 -84
- package/src/components/NumberInput/index.ts +1 -1
- package/src/components/PhoneInput/PhoneInput.stories.tsx +67 -66
- package/src/components/PhoneInput/PhoneInput.styles.ts +92 -92
- package/src/components/PhoneInput/PhoneInput.tsx +214 -211
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +21 -21
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.ts +105 -105
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +155 -155
- package/src/components/PhoneInput/components/PhoneInputCountryList/index.ts +2 -2
- package/src/components/PhoneInput/components/index.ts +1 -1
- package/src/components/PhoneInput/constants.ts +3 -3
- package/src/components/PhoneInput/index.ts +4 -4
- package/src/components/PhoneInput/types.ts +20 -20
- package/src/components/RadioButton/RadioButton.stories.tsx +46 -46
- package/src/components/RadioButton/RadioButton.styles.ts +37 -37
- package/src/components/RadioButton/RadioButton.tsx +57 -57
- package/src/components/RadioButton/index.ts +2 -2
- package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +54 -54
- package/src/components/ScrollIntoViewIfNeeded/constants.ts +12 -12
- package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
- package/src/components/SearchInput/SearchInput.stories.tsx +24 -24
- package/src/components/SearchInput/SearchInput.styles.ts +31 -31
- package/src/components/SearchInput/SearchInput.tsx +32 -41
- package/src/components/SearchInput/index.ts +2 -2
- package/src/components/Select/CustomSelect.stories.tsx +251 -250
- package/src/components/Select/MultiSelect.stories.tsx +237 -232
- package/src/components/Select/Select.stories.tsx +234 -228
- package/src/components/Select/Select.styles.ts +104 -139
- package/src/components/Select/Select.tsx +643 -628
- package/src/components/Select/components/SelectList/SelectList.styles.ts +73 -73
- package/src/components/Select/components/SelectList/SelectList.tsx +154 -152
- package/src/components/Select/components/SelectList/index.ts +2 -2
- package/src/components/Select/components/SelectListItem/SelectListItem.styles.ts +14 -14
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +79 -76
- package/src/components/Select/components/SelectListItem/index.ts +1 -1
- package/src/components/Select/components/index.ts +2 -2
- package/src/components/Select/constants.ts +2 -2
- package/src/components/Select/helpers.ts +20 -20
- package/src/components/Select/index.ts +4 -4
- package/src/components/Select/types.ts +9 -6
- package/src/components/Selector/Selector.stories.tsx +62 -62
- package/src/components/Selector/Selector.styles.ts +165 -165
- package/src/components/Selector/Selector.tsx +115 -115
- package/src/components/Selector/index.ts +2 -2
- package/src/components/Selector/types.ts +12 -12
- package/src/components/Skeleton/Skeleton.stories.tsx +19 -19
- package/src/components/Skeleton/Skeleton.styles.ts +46 -46
- package/src/components/Skeleton/Skeleton.tsx +12 -12
- package/src/components/Skeleton/index.ts +2 -2
- package/src/components/SmartInput/SmartInput.stories.tsx +51 -51
- package/src/components/SmartInput/SmartInput.tsx +116 -116
- package/src/components/SmartInput/constants.ts +91 -91
- package/src/components/SmartInput/helpers.ts +26 -26
- package/src/components/SmartInput/index.ts +2 -2
- package/src/components/SmartInput/types.ts +18 -18
- package/src/components/Status/Status.stories.tsx +121 -69
- package/src/components/Status/Status.styles.ts +108 -143
- package/src/components/Status/Status.tsx +49 -49
- package/src/components/Status/constants.ts +1 -11
- package/src/components/Status/index.ts +3 -3
- package/src/components/Status/types.ts +9 -5
- package/src/components/Switch/Switch.stories.tsx +40 -40
- package/src/components/Switch/Switch.styles.ts +75 -75
- package/src/components/Switch/Switch.tsx +75 -75
- package/src/components/Switch/index.ts +3 -3
- package/src/components/Switch/types.ts +4 -4
- package/src/components/TextArea/TextArea.stories.tsx +49 -35
- package/src/components/TextArea/TextArea.styles.ts +89 -82
- package/src/components/TextArea/TextArea.tsx +195 -161
- package/src/components/TextArea/index.ts +3 -3
- package/src/components/TextArea/types.ts +6 -6
- package/src/components/TextButton/TextButton.stories.tsx +42 -43
- package/src/components/TextButton/TextButton.styles.ts +131 -130
- package/src/components/TextButton/TextButton.tsx +110 -110
- package/src/components/TextButton/constants.ts +3 -3
- package/src/components/TextButton/index.ts +3 -3
- package/src/components/TextButton/types.ts +11 -11
- package/src/components/TextWithInfo/TextWithInfo.stories.tsx +53 -53
- package/src/components/TextWithInfo/TextWithInfo.styles.ts +59 -59
- package/src/components/TextWithInfo/TextWithInfo.tsx +62 -62
- package/src/components/TextWithInfo/index.ts +2 -2
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
- package/src/components/TextWithTooltip/TextWithTooltip.styles.ts +21 -21
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +156 -156
- package/src/components/TextWithTooltip/index.ts +2 -2
- package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +41 -41
- package/src/components/ThemedPreloader/ThemedPreloader.styles.ts +26 -26
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +54 -54
- package/src/components/ThemedPreloader/components/DefaultPreloader/DefaultPreloader.tsx +29 -29
- package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.ts +55 -55
- package/src/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.tsx +15 -15
- package/src/components/ThemedPreloader/components/DotsPreloader/index.ts +2 -2
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.ts +11 -11
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +24 -24
- package/src/components/ThemedPreloader/components/SvgPreloader/index.ts +2 -2
- package/src/components/ThemedPreloader/components/index.ts +3 -3
- package/src/components/ThemedPreloader/constants.ts +1 -1
- package/src/components/ThemedPreloader/index.ts +4 -4
- package/src/components/ThemedPreloader/types.ts +3 -3
- package/src/components/Toaster/Toaster.stories.tsx +30 -30
- package/src/components/Toaster/Toaster.styles.ts +60 -60
- package/src/components/Toaster/Toaster.tsx +96 -96
- package/src/components/Toaster/constants.ts +1 -1
- package/src/components/Toaster/index.ts +3 -3
- package/src/components/Toaster/types.ts +1 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +19 -19
- package/src/components/Tooltip/Tooltip.styles.ts +51 -49
- package/src/components/Tooltip/Tooltip.tsx +35 -35
- package/src/components/Tooltip/index.ts +3 -3
- package/src/components/Tooltip/types.ts +1 -1
- package/src/components/WithMessages/WithMessages.stories.tsx +40 -40
- package/src/components/WithMessages/WithMessages.styles.ts +47 -47
- package/src/components/WithMessages/WithMessages.tsx +59 -59
- package/src/components/WithMessages/index.ts +2 -2
- package/src/components/WithPopup/WithPopup.stories.tsx +101 -101
- package/src/components/WithPopup/WithPopup.styles.ts +47 -47
- package/src/components/WithPopup/WithPopup.tsx +231 -210
- package/src/components/WithPopup/constants.ts +3 -3
- package/src/components/WithPopup/helpers.ts +9 -9
- package/src/components/WithPopup/index.ts +2 -2
- package/src/components/WithPopup/types.ts +32 -32
- package/src/components/WithTooltip/WithTooltip.stories.tsx +56 -56
- package/src/components/WithTooltip/WithTooltip.styles.ts +13 -13
- package/src/components/WithTooltip/WithTooltip.tsx +72 -72
- package/src/components/WithTooltip/index.ts +2 -2
- package/src/components/index.ts +49 -48
- package/src/constants/index.ts +2 -2
- package/src/constants/mime-types.ts +77 -77
- package/src/constants/phone-info.ts +2134 -2147
- package/src/helpers/index.ts +3 -3
- package/src/helpers/misc.ts +159 -160
- package/src/helpers/phone.ts +95 -91
- package/src/helpers/popper-helpers.ts +17 -17
- package/src/hooks/index.ts +10 -7
- package/src/hooks/use-did-mount-effect.ts +18 -18
- package/src/hooks/use-dropdown.ts +84 -84
- package/src/hooks/use-intersection-ref.ts +30 -0
- package/src/hooks/use-is-mounted.ts +15 -15
- package/src/hooks/use-latest-ref.ts +7 -0
- package/src/hooks/use-merge.ts +8 -0
- package/src/hooks/use-merged-refs.ts +4 -4
- package/src/hooks/use-mixed-styles.ts +12 -14
- package/src/hooks/use-on-click-outside.ts +85 -77
- package/src/hooks/use-tweak-styles.ts +79 -57
- package/src/index.ts +6 -6
- package/src/theme/Provider.tsx +26 -21
- package/src/theme/common.ts +178 -178
- package/src/theme/create-themed-styles.ts +78 -0
- package/src/theme/helpers.ts +76 -76
- package/src/theme/index.ts +6 -4
- package/src/theme/true-jss/ThemedStylesManager.ts +92 -0
- package/src/theme/true-jss/TweakStylesManager.ts +157 -0
- package/src/theme/true-jss/index.ts +2 -0
- package/src/theme/true-jss/jss-context.tsx +34 -0
- package/src/theme/types.ts +164 -162
- package/src/types.ts +78 -65
- package/dist/components/AccountInfo/AccountInfo.stories.d.ts +0 -6
- package/dist/components/AddButton/AddButton.stories.d.ts +0 -6
- package/dist/components/Button/Button.stories.d.ts +0 -6
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -8
- package/dist/components/CloseButton/CloseButton.stories.d.ts +0 -5
- package/dist/components/Colors/Colors.stories.d.ts +0 -5
- package/dist/components/ControlWrapper/ControlWrapper.stories.d.ts +0 -6
- package/dist/components/DateInput/DateInput.stories.d.ts +0 -7
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -7
- package/dist/components/Description/Description.stories.d.ts +0 -16
- package/dist/components/FileInput/FileInput.stories.d.ts +0 -7
- package/dist/components/FileItem/FileItem.stories.d.ts +0 -8
- package/dist/components/FiltersPane/FiltersPane.stories.d.ts +0 -31
- package/dist/components/Flag/Flag.stories.d.ts +0 -12
- package/dist/components/FlexibleTable/FlexibleTable.stories.d.ts +0 -19
- package/dist/components/Icon/Icon.stories.d.ts +0 -6
- package/dist/components/Icon/complexIcons/icons.d.ts +0 -10
- package/dist/components/Icon/complexIcons/index.d.ts +0 -1
- package/dist/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.d.ts +0 -6
- package/dist/components/Icon/components/ComplexIconBoilerplate/index.d.ts +0 -1
- package/dist/components/Icon/components/IconBolerplate/IconBoilerplate.d.ts +0 -6
- package/dist/components/Icon/components/IconBolerplate/index.d.ts +0 -1
- package/dist/components/Icon/components/index.d.ts +0 -2
- package/dist/components/Icon/helpers.d.ts +0 -6
- package/dist/components/Icon/icons-list.d.ts +0 -1
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -6
- package/dist/components/IncrementInput/IncrementInput.stories.d.ts +0 -6
- package/dist/components/Input/Input.stories.d.ts +0 -25
- package/dist/components/List/List.stories.d.ts +0 -5
- package/dist/components/Modal/Modal.stories.d.ts +0 -29
- package/dist/components/MoreMenu/MoreMenu.stories.d.ts +0 -6
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -13
- package/dist/components/NewMoreMenu/NewMoreMenu.stories.d.ts +0 -12
- package/dist/components/Notification/Notification.stories.d.ts +0 -8
- package/dist/components/NumberInput/NumberInput.stories.d.ts +0 -7
- package/dist/components/PhoneInput/PhoneInput.stories.d.ts +0 -28
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.d.ts +0 -5
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -7
- package/dist/components/SearchInput/SearchInput.stories.d.ts +0 -6
- package/dist/components/Select/CustomSelect.stories.d.ts +0 -11
- package/dist/components/Select/MultiSelect.stories.d.ts +0 -15
- package/dist/components/Select/Select.stories.d.ts +0 -15
- package/dist/components/Selector/Selector.stories.d.ts +0 -7
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -6
- package/dist/components/SmartInput/SmartInput.stories.d.ts +0 -18
- package/dist/components/Status/Status.stories.d.ts +0 -6
- package/dist/components/Switch/Switch.stories.d.ts +0 -16
- package/dist/components/TextArea/TextArea.stories.d.ts +0 -17
- package/dist/components/TextButton/TextButton.stories.d.ts +0 -6
- package/dist/components/TextWithInfo/TextWithInfo.stories.d.ts +0 -12
- package/dist/components/TextWithTooltip/TextWithTooltip.stories.d.ts +0 -24
- package/dist/components/ThemedPreloader/ThemedPreloader.stories.d.ts +0 -17
- package/dist/components/Toaster/Toaster.stories.d.ts +0 -5
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -5
- package/dist/components/WithMessages/WithMessages.stories.d.ts +0 -7
- package/dist/components/WithPopup/WithPopup.stories.d.ts +0 -16
- package/dist/components/WithTooltip/WithTooltip.stories.d.ts +0 -6
- package/src/components/Flag/augment.d.ts +0 -1
- package/src/components/Icon/complexIcons/icons.ts +0 -19
- package/src/components/Icon/complexIcons/index.ts +0 -1
- package/src/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.tsx +0 -16
- package/src/components/Icon/components/ComplexIconBoilerplate/index.ts +0 -1
- package/src/components/Icon/components/IconBolerplate/IconBoilerplate.tsx +0 -43
- package/src/components/Icon/components/IconBolerplate/index.ts +0 -1
- package/src/components/Icon/components/index.ts +0 -2
- package/src/components/Icon/helpers.tsx +0 -9
- package/src/components/Icon/icons-list.ts +0 -855
- package/src/vite-env.d.ts +0 -1
|
@@ -1,628 +1,643 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeEvent,
|
|
3
|
-
CSSProperties,
|
|
4
|
-
FocusEvent,
|
|
5
|
-
KeyboardEvent,
|
|
6
|
-
MouseEvent,
|
|
7
|
-
ReactNode,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/** @default
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
tweakStyles,
|
|
153
|
-
className: '
|
|
154
|
-
currentComponentName: 'Select',
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const [
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
);
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
//
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
useEffect(() => {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
{
|
|
524
|
-
{
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
{
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
1
|
+
import {
|
|
2
|
+
ChangeEvent,
|
|
3
|
+
CSSProperties,
|
|
4
|
+
FocusEvent,
|
|
5
|
+
KeyboardEvent,
|
|
6
|
+
MouseEvent,
|
|
7
|
+
ReactNode,
|
|
8
|
+
Ref,
|
|
9
|
+
SyntheticEvent,
|
|
10
|
+
useCallback,
|
|
11
|
+
useEffect,
|
|
12
|
+
useMemo,
|
|
13
|
+
useRef,
|
|
14
|
+
useState,
|
|
15
|
+
} from 'react';
|
|
16
|
+
import { Portal } from 'react-overlays';
|
|
17
|
+
import clsx from 'clsx';
|
|
18
|
+
import { debounce } from 'ts-debounce';
|
|
19
|
+
import {
|
|
20
|
+
applyAction,
|
|
21
|
+
createFilter,
|
|
22
|
+
getArray,
|
|
23
|
+
getTestId,
|
|
24
|
+
isNotEmpty,
|
|
25
|
+
isReactNodeNotEmpty,
|
|
26
|
+
isStringNotEmpty,
|
|
27
|
+
} from '@true-engineering/true-react-platform-helpers';
|
|
28
|
+
import { hasExactParent } from '../../helpers';
|
|
29
|
+
import { useDropdown, useIsMounted, useOnClickOutsideWithRef, useTweakStyles } from '../../hooks';
|
|
30
|
+
import { ICommonProps, IDropdownWithPopperOptions } from '../../types';
|
|
31
|
+
import { IIcon, renderIcon } from '../Icon';
|
|
32
|
+
import { IChangeInputEvent, IInputProps, InputBase } from '../Input';
|
|
33
|
+
import { ISearchInputProps, SearchInput } from '../SearchInput';
|
|
34
|
+
import { WithMessages } from '../WithMessages';
|
|
35
|
+
import { SelectList } from './components';
|
|
36
|
+
import { ALL_OPTION_INDEX, DEFAULT_OPTION_INDEX } from './constants';
|
|
37
|
+
import {
|
|
38
|
+
defaultCompareFunction,
|
|
39
|
+
defaultConvertFunction,
|
|
40
|
+
defaultIsOptionDisabled,
|
|
41
|
+
getDefaultConvertToIdFunction,
|
|
42
|
+
} from './helpers';
|
|
43
|
+
import { IChangeSelectEvent, IMultipleSelectValue, ISelectFooter } from './types';
|
|
44
|
+
import { getInputStyles, ISelectStyles, useStyles } from './Select.styles';
|
|
45
|
+
|
|
46
|
+
export interface ISelectProps<Value>
|
|
47
|
+
extends Omit<IInputProps, 'value' | 'onChange' | 'onBlur' | 'type' | 'tweakStyles'>,
|
|
48
|
+
ICommonProps<ISelectStyles> {
|
|
49
|
+
header?: ReactNode;
|
|
50
|
+
footer?: ISelectFooter<Value>;
|
|
51
|
+
defaultOptionLabel?: ReactNode;
|
|
52
|
+
allOptionsLabel?: string;
|
|
53
|
+
noMatchesLabel?: string;
|
|
54
|
+
loadingLabel?: ReactNode;
|
|
55
|
+
/** @default 'normal' */
|
|
56
|
+
optionsMode?: 'search' | 'dynamic' | 'normal';
|
|
57
|
+
/** @default 400 */
|
|
58
|
+
debounceTime?: number;
|
|
59
|
+
/** @default 0 */
|
|
60
|
+
minSymbolsCountToOpenList?: number;
|
|
61
|
+
dropdownOptions?: IDropdownWithPopperOptions;
|
|
62
|
+
/** @default 'chevron-down' */
|
|
63
|
+
dropdownIcon?: IIcon;
|
|
64
|
+
options: Value[] | Readonly<Value[]>;
|
|
65
|
+
value: Value | undefined;
|
|
66
|
+
/** @default true */
|
|
67
|
+
shouldScrollToList?: boolean;
|
|
68
|
+
isMultiSelect?: false;
|
|
69
|
+
searchInput?: {
|
|
70
|
+
/** @default false */
|
|
71
|
+
shouldRenderInList?: boolean;
|
|
72
|
+
ref?: Ref<HTMLInputElement>;
|
|
73
|
+
} & Pick<ISearchInputProps, 'placeholder' | 'shouldFocusOnMount'>;
|
|
74
|
+
isOptionDisabled?: (option: Value) => boolean;
|
|
75
|
+
onChange: (value: Value | undefined, event: IChangeSelectEvent) => void; // подумать как возвращать индекс
|
|
76
|
+
onBlur?: (event: Event | SyntheticEvent) => void;
|
|
77
|
+
onType?: (value: string) => Promise<void>;
|
|
78
|
+
optionsFilter?: (options: Value[], query: string) => Value[];
|
|
79
|
+
onOpen?: () => void;
|
|
80
|
+
compareValuesOnChange?: (v1?: Value, v2?: Value) => boolean;
|
|
81
|
+
/** @description Функция должна быть мемоизирована с целью избежания ререндера */
|
|
82
|
+
convertValueToString?: (value: Value) => string | undefined;
|
|
83
|
+
/** @description Функция должна быть мемоизирована с целью избежания ререндера */
|
|
84
|
+
convertValueToReactNode?: (value: Value, isDisabled: boolean) => ReactNode;
|
|
85
|
+
/** @description Функция должна быть мемоизирована с целью избежания ререндера */
|
|
86
|
+
convertValueToId?: (value: Value) => string | undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface IMultipleSelectProps<Value>
|
|
90
|
+
extends Omit<
|
|
91
|
+
ISelectProps<Value>,
|
|
92
|
+
'value' | 'onChange' | 'compareValuesOnChange' | 'isMultiSelect'
|
|
93
|
+
> {
|
|
94
|
+
isMultiSelect: true;
|
|
95
|
+
value: IMultipleSelectValue<Value> | undefined;
|
|
96
|
+
onChange: (value: IMultipleSelectValue<Value> | undefined, event: IChangeSelectEvent) => void;
|
|
97
|
+
compareValuesOnChange?: (
|
|
98
|
+
v1?: IMultipleSelectValue<Value>,
|
|
99
|
+
v2?: IMultipleSelectValue<Value>,
|
|
100
|
+
) => boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function Select<Value>(
|
|
104
|
+
props: ISelectProps<Value> | IMultipleSelectProps<Value>,
|
|
105
|
+
): JSX.Element {
|
|
106
|
+
const {
|
|
107
|
+
options,
|
|
108
|
+
isMultiSelect,
|
|
109
|
+
value,
|
|
110
|
+
header,
|
|
111
|
+
footer,
|
|
112
|
+
defaultOptionLabel,
|
|
113
|
+
allOptionsLabel,
|
|
114
|
+
debounceTime = 400,
|
|
115
|
+
optionsMode = 'normal',
|
|
116
|
+
noMatchesLabel,
|
|
117
|
+
loadingLabel,
|
|
118
|
+
tweakStyles,
|
|
119
|
+
testId,
|
|
120
|
+
isActive,
|
|
121
|
+
isReadonly,
|
|
122
|
+
isDisabled,
|
|
123
|
+
dropdownOptions,
|
|
124
|
+
minSymbolsCountToOpenList = 0,
|
|
125
|
+
dropdownIcon = 'chevron-down',
|
|
126
|
+
shouldScrollToList = true,
|
|
127
|
+
searchInput,
|
|
128
|
+
icon,
|
|
129
|
+
onChange,
|
|
130
|
+
onFocus,
|
|
131
|
+
onBlur,
|
|
132
|
+
onType,
|
|
133
|
+
onOpen,
|
|
134
|
+
isOptionDisabled = defaultIsOptionDisabled,
|
|
135
|
+
compareValuesOnChange = defaultCompareFunction,
|
|
136
|
+
convertValueToString = defaultConvertFunction,
|
|
137
|
+
convertValueToId,
|
|
138
|
+
convertValueToReactNode,
|
|
139
|
+
optionsFilter,
|
|
140
|
+
infoMessage,
|
|
141
|
+
errorMessage,
|
|
142
|
+
...inputProps
|
|
143
|
+
} = props;
|
|
144
|
+
const classes = useStyles({ theme: tweakStyles });
|
|
145
|
+
|
|
146
|
+
const { shouldRenderInList: shouldRenderSearchInputInList = false, ...searchInputProps } =
|
|
147
|
+
searchInput ?? {};
|
|
148
|
+
const hasSearchInputInList = optionsMode !== 'normal' && shouldRenderSearchInputInList;
|
|
149
|
+
const hasReadonlyInput = isReadonly || optionsMode === 'normal' || shouldRenderSearchInputInList;
|
|
150
|
+
|
|
151
|
+
const tweakWithMessagesStyles = useTweakStyles({
|
|
152
|
+
tweakStyles,
|
|
153
|
+
className: 'tweakWithMessages',
|
|
154
|
+
currentComponentName: 'Select',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const tweakInputStyles = useTweakStyles({
|
|
158
|
+
innerStyles: getInputStyles({ hasReadonlyInput, isMultiSelect }),
|
|
159
|
+
tweakStyles,
|
|
160
|
+
className: 'tweakInput',
|
|
161
|
+
currentComponentName: 'Select',
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const tweakSearchInputStyles = useTweakStyles({
|
|
165
|
+
tweakStyles,
|
|
166
|
+
className: 'tweakSearchInput',
|
|
167
|
+
currentComponentName: 'Select',
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const tweakSelectListStyles = useTweakStyles({
|
|
171
|
+
tweakStyles,
|
|
172
|
+
className: 'tweakSelectList',
|
|
173
|
+
currentComponentName: 'Select',
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const isMounted = useIsMounted();
|
|
177
|
+
const [isListOpen, setIsListOpen] = useState(false);
|
|
178
|
+
const [areOptionsLoading, setAreOptionsLoading] = useState(false);
|
|
179
|
+
const hasDefaultOption = isReactNodeNotEmpty(defaultOptionLabel);
|
|
180
|
+
|
|
181
|
+
const [focusedListCellIndex, setFocusedListCellIndex] = useState(DEFAULT_OPTION_INDEX);
|
|
182
|
+
const [searchValue, setSearchValue] = useState('');
|
|
183
|
+
// если мы ввели что то в строку поиска - то этот булеан будет отключаться
|
|
184
|
+
// вынесен отдельно, из-за проблем с дебаунсом при динамич. опциях
|
|
185
|
+
const [shouldShowDefaultOption, setShouldShowDefaultOption] = useState(true);
|
|
186
|
+
|
|
187
|
+
const root = useRef<HTMLDivElement>(null);
|
|
188
|
+
const inputWrapper = useRef<HTMLDivElement>(null);
|
|
189
|
+
const list = useRef<HTMLDivElement>(null);
|
|
190
|
+
const input = useRef<HTMLInputElement>(null); // TODO ref снаружи?
|
|
191
|
+
|
|
192
|
+
const strValue = isMultiSelect ? value?.[0] : value;
|
|
193
|
+
const shouldShowAllOption =
|
|
194
|
+
isMultiSelect && isStringNotEmpty(allOptionsLabel) && searchValue === '';
|
|
195
|
+
|
|
196
|
+
const filteredOptions = useMemo(() => {
|
|
197
|
+
if (optionsMode !== 'search') {
|
|
198
|
+
return options as Value[];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const filter =
|
|
202
|
+
optionsFilter ?? createFilter<Value>((option) => [convertValueToString(option) ?? '']);
|
|
203
|
+
|
|
204
|
+
return filter(options as Value[], searchValue);
|
|
205
|
+
}, [optionsFilter, options, convertValueToString, searchValue, optionsMode]);
|
|
206
|
+
|
|
207
|
+
const availableOptions = useMemo(
|
|
208
|
+
() => options.filter((option) => !isOptionDisabled(option)),
|
|
209
|
+
[options, isOptionDisabled],
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
const areAllOptionsSelected = isMultiSelect && value?.length === availableOptions.length;
|
|
213
|
+
const shouldShowMultiSelectCounter =
|
|
214
|
+
isMultiSelect && isNotEmpty(value) && value.length > 1 && !areAllOptionsSelected;
|
|
215
|
+
|
|
216
|
+
const optionsIndexesForNavigation = useMemo(() => {
|
|
217
|
+
const result: number[] = [];
|
|
218
|
+
if (shouldShowDefaultOption && hasDefaultOption) {
|
|
219
|
+
result.push(DEFAULT_OPTION_INDEX);
|
|
220
|
+
}
|
|
221
|
+
if (shouldShowAllOption) {
|
|
222
|
+
result.push(ALL_OPTION_INDEX);
|
|
223
|
+
}
|
|
224
|
+
return result.concat(
|
|
225
|
+
filteredOptions.reduce((acc, cur, i) => {
|
|
226
|
+
if (!isOptionDisabled(cur)) {
|
|
227
|
+
acc.push(i);
|
|
228
|
+
}
|
|
229
|
+
return acc;
|
|
230
|
+
}, [] as number[]),
|
|
231
|
+
);
|
|
232
|
+
}, [
|
|
233
|
+
filteredOptions,
|
|
234
|
+
hasDefaultOption,
|
|
235
|
+
isOptionDisabled,
|
|
236
|
+
shouldShowAllOption,
|
|
237
|
+
shouldShowDefaultOption,
|
|
238
|
+
]);
|
|
239
|
+
|
|
240
|
+
const stringValue = isNotEmpty(strValue) ? convertValueToString(strValue) : undefined;
|
|
241
|
+
// Для мультиселекта пытаемся показать "Все опции" если выбраны все опции
|
|
242
|
+
const showedStringValue =
|
|
243
|
+
areAllOptionsSelected && isNotEmpty(allOptionsLabel) ? allOptionsLabel : stringValue;
|
|
244
|
+
|
|
245
|
+
const convertToId = useCallback(
|
|
246
|
+
(v: Value) => (convertValueToId ?? getDefaultConvertToIdFunction(convertValueToString))(v),
|
|
247
|
+
[convertValueToId, convertValueToString],
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
const closeList = useCallback(() => {
|
|
251
|
+
setIsListOpen(false);
|
|
252
|
+
setSearchValue('');
|
|
253
|
+
setShouldShowDefaultOption(true);
|
|
254
|
+
}, [dropdownOptions?.shouldUsePopper]);
|
|
255
|
+
|
|
256
|
+
const handleListClose = useCallback(
|
|
257
|
+
(event: Event | SyntheticEvent) => {
|
|
258
|
+
if (!isListOpen) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
closeList();
|
|
263
|
+
onBlur?.(event);
|
|
264
|
+
},
|
|
265
|
+
[isListOpen, closeList, onBlur],
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
const handleListOpen = () => {
|
|
269
|
+
if (!isReadonly && !isListOpen) {
|
|
270
|
+
setIsListOpen(true);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const handleFocus = (event: FocusEvent<HTMLInputElement>) => {
|
|
275
|
+
onFocus?.(event);
|
|
276
|
+
handleListOpen();
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const handleOnClick = () => {
|
|
280
|
+
handleListOpen();
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
|
|
284
|
+
// Когда что-то блокирует открытие листа, но блур все равно должен сработать
|
|
285
|
+
// например minSymbolsCount
|
|
286
|
+
if (isListOpen && !isOpen) {
|
|
287
|
+
handleListClose(event);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (
|
|
292
|
+
!isNotEmpty(event.relatedTarget) ||
|
|
293
|
+
!isNotEmpty(list.current) ||
|
|
294
|
+
!isNotEmpty(inputWrapper.current)
|
|
295
|
+
) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const isActionInsideSelect =
|
|
300
|
+
hasExactParent(event.relatedTarget, list.current) ||
|
|
301
|
+
hasExactParent(event.relatedTarget, inputWrapper.current);
|
|
302
|
+
|
|
303
|
+
// Ничего не делаем, если клик был внутри селекта
|
|
304
|
+
if (!isActionInsideSelect) {
|
|
305
|
+
handleListClose(event);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
const handleChange = useCallback(
|
|
310
|
+
(newValue: Value | IMultipleSelectValue<Value> | undefined, event: IChangeSelectEvent) => {
|
|
311
|
+
// Тут беда с типами, сорри
|
|
312
|
+
if (!compareValuesOnChange(value as never, newValue as never)) {
|
|
313
|
+
onChange(newValue as (Value & IMultipleSelectValue<Value>) | undefined, event);
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
[value, compareValuesOnChange, onChange],
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
const handleOptionSelect = useCallback(
|
|
320
|
+
(index: number, event: MouseEvent<HTMLElement> | KeyboardEvent) => {
|
|
321
|
+
handleChange(index === DEFAULT_OPTION_INDEX ? undefined : filteredOptions[index], event);
|
|
322
|
+
handleListClose(event);
|
|
323
|
+
input.current?.blur();
|
|
324
|
+
},
|
|
325
|
+
[handleChange, handleListClose, filteredOptions],
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
// MultiSelect
|
|
329
|
+
const handleToggleOptionCheckbox = useCallback(
|
|
330
|
+
(index: number, isSelected: boolean, event: ChangeEvent<HTMLElement> | KeyboardEvent) => {
|
|
331
|
+
if (!isMultiSelect) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Если выбрана не дефолтная опция, которая сетит андеф
|
|
336
|
+
if (index === DEFAULT_OPTION_INDEX || (index === ALL_OPTION_INDEX && !isSelected)) {
|
|
337
|
+
handleChange(undefined, event);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (index === ALL_OPTION_INDEX && isSelected) {
|
|
341
|
+
handleChange(availableOptions as IMultipleSelectValue<Value>, event);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
const option = filteredOptions[index];
|
|
345
|
+
handleChange(
|
|
346
|
+
isSelected
|
|
347
|
+
? // Добавляем
|
|
348
|
+
([...(value ?? []), option] as IMultipleSelectValue<Value>)
|
|
349
|
+
: // Убираем
|
|
350
|
+
value?.filter((o) => convertToId(o) !== convertToId(option)),
|
|
351
|
+
event,
|
|
352
|
+
);
|
|
353
|
+
},
|
|
354
|
+
[isMultiSelect, filteredOptions, handleChange, value, availableOptions, convertToId],
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
const handleOnType = useCallback(
|
|
358
|
+
async (v: string) => {
|
|
359
|
+
if (onType === undefined) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
if (isMounted()) {
|
|
363
|
+
setAreOptionsLoading(true);
|
|
364
|
+
}
|
|
365
|
+
await onType(v);
|
|
366
|
+
if (isMounted()) {
|
|
367
|
+
setAreOptionsLoading(false);
|
|
368
|
+
}
|
|
369
|
+
if (optionsMode === 'dynamic') {
|
|
370
|
+
setShouldShowDefaultOption(v === '');
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
[isMounted, onType, optionsMode],
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
const debounceHandleOnType = useMemo(
|
|
377
|
+
() => debounce(handleOnType, debounceTime, { isImmediate: debounceTime === 0 }),
|
|
378
|
+
[handleOnType, debounceTime],
|
|
379
|
+
);
|
|
380
|
+
|
|
381
|
+
const handleInputChange = (v: string, event: IChangeInputEvent) => {
|
|
382
|
+
if (onType !== undefined) {
|
|
383
|
+
debounceHandleOnType(v);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (optionsMode !== 'dynamic') {
|
|
387
|
+
setShouldShowDefaultOption(v === '');
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (v === '' && !hasSearchInputInList) {
|
|
391
|
+
handleChange(undefined, event);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
setSearchValue(v);
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
398
|
+
if (!isListOpen) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
event.stopPropagation();
|
|
403
|
+
const curIndexInNavigation = optionsIndexesForNavigation.findIndex(
|
|
404
|
+
(index) => index === focusedListCellIndex,
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
switch (event.code) {
|
|
408
|
+
case 'Enter':
|
|
409
|
+
case 'NumpadEnter': {
|
|
410
|
+
let indexToSelect = focusedListCellIndex;
|
|
411
|
+
|
|
412
|
+
// если осталась одна опция в списке,
|
|
413
|
+
// то выбираем ее нажатием на enter
|
|
414
|
+
if (indexToSelect === DEFAULT_OPTION_INDEX && filteredOptions.length === 1) {
|
|
415
|
+
indexToSelect = 0;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (isMultiSelect) {
|
|
419
|
+
let isThisValueAlreadySelected: boolean | undefined;
|
|
420
|
+
if (indexToSelect === ALL_OPTION_INDEX) {
|
|
421
|
+
isThisValueAlreadySelected = areAllOptionsSelected;
|
|
422
|
+
} else {
|
|
423
|
+
// подумать над концептом реального фокуса на опциях, а не вот эти вот focusedCell
|
|
424
|
+
const option = filteredOptions[indexToSelect];
|
|
425
|
+
const valueIdToSelect = convertToId(option);
|
|
426
|
+
isThisValueAlreadySelected =
|
|
427
|
+
value?.some((opt) => convertToId(opt) === valueIdToSelect) ?? false;
|
|
428
|
+
}
|
|
429
|
+
handleToggleOptionCheckbox(indexToSelect, !isThisValueAlreadySelected, event);
|
|
430
|
+
} else {
|
|
431
|
+
handleOptionSelect(indexToSelect, event);
|
|
432
|
+
}
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
case 'ArrowDown': {
|
|
437
|
+
// чтобы убрать перемещение курсора в инпуте
|
|
438
|
+
event.preventDefault();
|
|
439
|
+
const targetIndexInNavigation =
|
|
440
|
+
(curIndexInNavigation + 1) % optionsIndexesForNavigation.length;
|
|
441
|
+
setFocusedListCellIndex(optionsIndexesForNavigation[targetIndexInNavigation]);
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
case 'ArrowUp': {
|
|
446
|
+
// чтобы убрать перемещение курсора в инпуте
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
const targetIndexInNavigation =
|
|
449
|
+
(curIndexInNavigation - 1 + optionsIndexesForNavigation.length) %
|
|
450
|
+
optionsIndexesForNavigation.length;
|
|
451
|
+
setFocusedListCellIndex(optionsIndexesForNavigation[targetIndexInNavigation]);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const onArrowClick = () => {
|
|
458
|
+
if (isListOpen) {
|
|
459
|
+
input.current?.blur();
|
|
460
|
+
closeList();
|
|
461
|
+
} else {
|
|
462
|
+
input.current?.focus();
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
useOnClickOutsideWithRef(list, handleListClose, inputWrapper);
|
|
467
|
+
|
|
468
|
+
const hasEnoughSymbolsToSearch = searchValue.trim().length >= minSymbolsCountToOpenList;
|
|
469
|
+
|
|
470
|
+
const isOpen =
|
|
471
|
+
// Пользователь пытается открыть лист
|
|
472
|
+
isListOpen &&
|
|
473
|
+
// Нам есть что показать:
|
|
474
|
+
// Есть опции
|
|
475
|
+
(filteredOptions.length > 0 ||
|
|
476
|
+
// Дефолтная опция
|
|
477
|
+
(defaultOptionLabel !== undefined && !hasEnoughSymbolsToSearch) ||
|
|
478
|
+
// Текст "Загрузка..."
|
|
479
|
+
inputProps.isLoading ||
|
|
480
|
+
// Текст "Совпадений не найдено"
|
|
481
|
+
noMatchesLabel !== undefined ||
|
|
482
|
+
// У нас есть инпут с поиском внутри листа
|
|
483
|
+
hasSearchInputInList) &&
|
|
484
|
+
// Последняя проверка на случай, если мы че то ищем в опциях
|
|
485
|
+
(optionsMode === 'normal' || hasEnoughSymbolsToSearch);
|
|
486
|
+
|
|
487
|
+
// Эти значения ставятся в false по дефолту также в useDropdown
|
|
488
|
+
const {
|
|
489
|
+
shouldUsePopper = false,
|
|
490
|
+
shouldRenderInBody = false,
|
|
491
|
+
shouldHideOnScroll = false,
|
|
492
|
+
} = dropdownOptions ?? {};
|
|
493
|
+
|
|
494
|
+
const popperData = useDropdown({
|
|
495
|
+
isOpen,
|
|
496
|
+
onDropdownClose: handleListClose,
|
|
497
|
+
referenceElement: input.current?.parentElement ?? inputWrapper.current,
|
|
498
|
+
dropdownElement: list.current,
|
|
499
|
+
options: dropdownOptions,
|
|
500
|
+
dependenciesForPositionUpdating: [inputProps.isLoading, filteredOptions.length],
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
useEffect(() => {
|
|
504
|
+
const focusedCellIndex = isNotEmpty(strValue)
|
|
505
|
+
? optionsIndexesForNavigation.find((index) => {
|
|
506
|
+
const option = filteredOptions[index];
|
|
507
|
+
return isNotEmpty(option) && convertToId(option) === convertToId(strValue);
|
|
508
|
+
})
|
|
509
|
+
: undefined;
|
|
510
|
+
|
|
511
|
+
setFocusedListCellIndex(focusedCellIndex ?? optionsIndexesForNavigation[0]);
|
|
512
|
+
}, [strValue, filteredOptions, optionsIndexesForNavigation, convertToId]);
|
|
513
|
+
|
|
514
|
+
useEffect(() => {
|
|
515
|
+
if (isOpen) {
|
|
516
|
+
onOpen?.();
|
|
517
|
+
}
|
|
518
|
+
}, [isOpen]);
|
|
519
|
+
|
|
520
|
+
const searchInputEl = hasSearchInputInList && (
|
|
521
|
+
<SearchInput
|
|
522
|
+
value={searchValue}
|
|
523
|
+
onChange={handleInputChange}
|
|
524
|
+
tweakStyles={tweakSearchInputStyles}
|
|
525
|
+
placeholder="Поиск"
|
|
526
|
+
{...searchInputProps}
|
|
527
|
+
/>
|
|
528
|
+
);
|
|
529
|
+
|
|
530
|
+
// Т.к. используется для проверки на пустой элемент `isReactNodeNotEmpty` внутри `SelectList`, то
|
|
531
|
+
// он пропускает React.Fragment
|
|
532
|
+
const customHeader = (isReactNodeNotEmpty(searchInputEl) || isReactNodeNotEmpty(header)) && (
|
|
533
|
+
<>
|
|
534
|
+
{searchInputEl}
|
|
535
|
+
{header}
|
|
536
|
+
</>
|
|
537
|
+
);
|
|
538
|
+
|
|
539
|
+
const listEl = (
|
|
540
|
+
<div
|
|
541
|
+
className={clsx(classes.listWrapper, {
|
|
542
|
+
[classes.withoutPopper]: !shouldUsePopper,
|
|
543
|
+
[classes.listWrapperInBody]: shouldRenderInBody,
|
|
544
|
+
})}
|
|
545
|
+
ref={list}
|
|
546
|
+
style={popperData?.styles.popper as CSSProperties}
|
|
547
|
+
tabIndex={0}
|
|
548
|
+
onBlur={handleBlur} // обработка для Tab из списка
|
|
549
|
+
{...popperData?.attributes.popper}
|
|
550
|
+
>
|
|
551
|
+
{isOpen && (
|
|
552
|
+
<SelectList
|
|
553
|
+
options={filteredOptions}
|
|
554
|
+
defaultOptionLabel={hasDefaultOption && shouldShowDefaultOption && defaultOptionLabel}
|
|
555
|
+
allOptionsLabel={shouldShowAllOption && allOptionsLabel}
|
|
556
|
+
areAllOptionsSelected={areAllOptionsSelected}
|
|
557
|
+
customListHeader={customHeader}
|
|
558
|
+
customListFooter={applyAction(footer, { filteredOptions })}
|
|
559
|
+
noMatchesLabel={noMatchesLabel}
|
|
560
|
+
focusedIndex={focusedListCellIndex}
|
|
561
|
+
activeValue={value}
|
|
562
|
+
isLoading={inputProps.isLoading}
|
|
563
|
+
loadingLabel={loadingLabel}
|
|
564
|
+
tweakStyles={tweakSelectListStyles}
|
|
565
|
+
testId={getTestId(testId, 'list')}
|
|
566
|
+
isMultiSelect={isMultiSelect}
|
|
567
|
+
// скролл не работает с включеным поппером
|
|
568
|
+
shouldScrollToList={shouldScrollToList && !shouldUsePopper && !shouldHideOnScroll}
|
|
569
|
+
isOptionDisabled={isOptionDisabled}
|
|
570
|
+
convertValueToString={convertValueToString}
|
|
571
|
+
convertValueToReactNode={convertValueToReactNode}
|
|
572
|
+
convertValueToId={convertToId}
|
|
573
|
+
onOptionSelect={handleOptionSelect}
|
|
574
|
+
onToggleCheckbox={handleToggleOptionCheckbox}
|
|
575
|
+
/>
|
|
576
|
+
)}
|
|
577
|
+
</div>
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
return (
|
|
581
|
+
<WithMessages
|
|
582
|
+
errorMessage={errorMessage}
|
|
583
|
+
infoMessage={infoMessage}
|
|
584
|
+
tweakStyles={tweakWithMessagesStyles}
|
|
585
|
+
testId={getTestId(testId, 'wrapper')}
|
|
586
|
+
>
|
|
587
|
+
<div className={classes.root} onKeyDown={handleKeyDown} ref={root}>
|
|
588
|
+
<div
|
|
589
|
+
className={clsx(classes.inputWrapper, isDisabled && classes.disabled)}
|
|
590
|
+
onClick={isDisabled || isReadonly ? undefined : handleOnClick}
|
|
591
|
+
ref={inputWrapper}
|
|
592
|
+
>
|
|
593
|
+
<InputBase
|
|
594
|
+
value={
|
|
595
|
+
searchValue !== '' && !shouldRenderSearchInputInList ? searchValue : showedStringValue
|
|
596
|
+
}
|
|
597
|
+
onChange={handleInputChange}
|
|
598
|
+
isActive={isListOpen || isActive}
|
|
599
|
+
isReadonly={hasReadonlyInput}
|
|
600
|
+
onFocus={handleFocus}
|
|
601
|
+
onBlur={handleBlur}
|
|
602
|
+
isDisabled={isDisabled}
|
|
603
|
+
ref={input}
|
|
604
|
+
isLoading={areOptionsLoading}
|
|
605
|
+
tweakStyles={tweakInputStyles}
|
|
606
|
+
testId={testId}
|
|
607
|
+
icon={[
|
|
608
|
+
isMultiSelect && shouldShowMultiSelectCounter
|
|
609
|
+
? {
|
|
610
|
+
key: 'counter',
|
|
611
|
+
iconComponent: (
|
|
612
|
+
<div key="counter" className={classes.counter}>
|
|
613
|
+
(+{value.length - 1})
|
|
614
|
+
</div>
|
|
615
|
+
),
|
|
616
|
+
shouldResetSize: true,
|
|
617
|
+
}
|
|
618
|
+
: undefined,
|
|
619
|
+
|
|
620
|
+
...getArray(icon),
|
|
621
|
+
|
|
622
|
+
<div
|
|
623
|
+
key="arrow"
|
|
624
|
+
className={clsx(classes.arrow, isOpen && classes.activeArrow)}
|
|
625
|
+
onClick={onArrowClick} // клик тут, потому что onClick в ControlWrapper добавляет tabIndex={0}
|
|
626
|
+
>
|
|
627
|
+
{renderIcon(dropdownIcon)}
|
|
628
|
+
</div>,
|
|
629
|
+
].filter(isNotEmpty)}
|
|
630
|
+
{...inputProps}
|
|
631
|
+
/>
|
|
632
|
+
</div>
|
|
633
|
+
{shouldUsePopper ? (
|
|
634
|
+
<Portal container={shouldRenderInBody ? document.body : inputWrapper.current}>
|
|
635
|
+
<>{listEl}</>
|
|
636
|
+
</Portal>
|
|
637
|
+
) : (
|
|
638
|
+
<>{isOpen && listEl}</>
|
|
639
|
+
)}
|
|
640
|
+
</div>
|
|
641
|
+
</WithMessages>
|
|
642
|
+
);
|
|
643
|
+
}
|