@true-engineering/true-react-common-ui-kit 4.0.0-alpha6 → 4.0.0-alpha61
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/README.md +12 -660
- package/dist/components/AccountInfo/AccountInfo.styles.d.ts +1 -1
- package/dist/components/AddButton/AddButton.d.ts +1 -0
- package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.styles.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +3 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/types.d.ts +3 -0
- package/dist/components/CloseButton/CloseButton.styles.d.ts +1 -1
- package/dist/components/ControlWrapper/ControlWrapper.d.ts +10 -3
- package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +3 -2
- package/dist/components/ControlWrapper/constants.d.ts +1 -0
- package/dist/components/ControlWrapper/helpers.d.ts +4 -0
- package/dist/components/ControlWrapper/index.d.ts +3 -0
- package/dist/components/ControlWrapper/types.d.ts +14 -0
- package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
- package/dist/components/DateInput/DateInput.d.ts +1 -3
- package/dist/components/DateInput/DateInput.styles.d.ts +1 -1
- package/dist/components/DateInput/constants.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +4 -4
- package/dist/components/DatePicker/DatePicker.styles.d.ts +1 -1
- 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.styles.d.ts +1 -1
- package/dist/components/DatePicker/components/PopperContainer/PopperContainer.d.ts +2 -4
- package/dist/components/DatePicker/components/index.d.ts +1 -0
- package/dist/components/DatePicker/constants.d.ts +7 -2
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/types.d.ts +2 -2
- package/dist/components/Description/Description.styles.d.ts +1 -1
- package/dist/components/FileInput/FileInput.d.ts +1 -1
- package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
- package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
- package/dist/components/FileItem/constants.d.ts +3 -4
- package/dist/components/FileItem/helpers.d.ts +3 -2
- package/dist/components/FileItem/types.d.ts +1 -2
- package/dist/components/FiltersPane/FiltersPane.d.ts +7 -3
- package/dist/components/FiltersPane/FiltersPane.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +3 -4
- package/dist/components/FiltersPane/components/Filter/helpers.d.ts +4 -0
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.d.ts +3 -11
- package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterMultiSelect/FilterMultiSelect.d.ts +0 -1
- package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +3 -6
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.d.ts +4 -3
- package/dist/components/FiltersPane/components/FilterValueView/FilterValueView.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +5 -11
- package/dist/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +2 -3
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +2 -2
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.d.ts +2 -1
- package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
- package/dist/components/FiltersPane/constants.d.ts +1 -1
- package/dist/components/FiltersPane/helpers.d.ts +1 -1
- package/dist/components/FiltersPane/index.d.ts +1 -0
- package/dist/components/FiltersPane/types.d.ts +8 -3
- package/dist/components/Flag/Flag.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +4 -2
- package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +2 -2
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.d.ts +4 -3
- package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +2 -5
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
- package/dist/components/FlexibleTable/helpers.d.ts +2 -2
- package/dist/components/FlexibleTable/types.d.ts +19 -11
- 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.styles.d.ts +1 -1
- package/dist/components/Icon/icons/index.d.ts +31 -0
- package/dist/components/Icon/index.d.ts +1 -1
- package/dist/components/Icon/types.d.ts +7 -11
- package/dist/components/IconButton/IconButton.d.ts +1 -2
- package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
- package/dist/components/IconButton/constants.d.ts +1 -1
- package/dist/components/IncrementInput/IncrementInput.styles.d.ts +1 -3
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Input/Input.styles.d.ts +1 -1
- package/dist/components/Input/InputBase.d.ts +3 -3
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.styles.d.ts +1 -1
- package/dist/components/List/components/ListItem/ListItem.styles.d.ts +1 -1
- package/dist/components/List/index.d.ts +2 -1
- package/dist/components/List/types.d.ts +4 -0
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.styles.d.ts +1 -1
- package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
- package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
- package/dist/components/MultiSelectList/constants.d.ts +1 -1
- package/dist/components/MultiSelectList/helpers.d.ts +1 -1
- package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
- package/dist/components/Notification/Notification.styles.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.d.ts +1 -2
- package/dist/components/NumberInput/helpers.d.ts +2 -2
- package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
- package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +3 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +3 -2
- package/dist/components/RadioButton/index.d.ts +1 -0
- package/dist/components/RadioButton/types.d.ts +3 -0
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +3 -373
- package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +2 -3
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.styles.d.ts +12 -22
- package/dist/components/Select/components/SelectList/SelectList.d.ts +8 -6
- package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +3 -2
- package/dist/components/Select/components/SelectListItem/SelectListItem.d.ts +4 -3
- package/dist/components/Select/helpers.d.ts +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/types.d.ts +4 -0
- package/dist/components/Selector/Selector.d.ts +0 -1
- package/dist/components/Selector/Selector.styles.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/components/SmartInput/SmartInput.d.ts +1 -1
- package/dist/components/Status/Status.styles.d.ts +3 -2
- package/dist/components/Status/constants.d.ts +0 -1
- package/dist/components/Status/index.d.ts +1 -0
- package/dist/components/Status/types.d.ts +5 -2
- package/dist/components/Switch/Switch.d.ts +3 -2
- package/dist/components/Switch/Switch.styles.d.ts +3 -2
- package/dist/components/Switch/types.d.ts +3 -0
- package/dist/components/TextArea/TextArea.d.ts +5 -6
- package/dist/components/TextArea/TextArea.styles.d.ts +5 -4
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextArea/types.d.ts +4 -2
- package/dist/components/TextButton/TextButton.d.ts +1 -1
- package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
- package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -0
- package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.styles.d.ts +1 -1
- package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.styles.d.ts +3 -2
- package/dist/components/Tooltip/types.d.ts +3 -0
- package/dist/components/WithMessages/WithMessages.d.ts +1 -1
- package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
- package/dist/components/WithPopup/WithPopup.d.ts +11 -3
- package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
- package/dist/components/WithPopup/types.d.ts +4 -4
- package/dist/components/WithTooltip/WithTooltip.d.ts +2 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/constants/phone-info.d.ts +1 -1
- package/dist/helpers/misc.d.ts +5 -3
- package/dist/helpers/phone.d.ts +1 -1
- package/dist/hooks/index.d.ts +8 -4
- package/dist/hooks/use-dropdown.d.ts +3 -3
- package/dist/hooks/use-intersection-ref.d.ts +9 -0
- package/dist/hooks/use-latest-ref.d.ts +2 -0
- package/dist/hooks/use-merge.d.ts +1 -0
- package/dist/hooks/use-mixed-styles.d.ts +3 -1
- package/dist/hooks/use-on-click-outside.d.ts +2 -2
- package/dist/hooks/use-resize-ref.d.ts +7 -0
- package/dist/hooks/use-tweak-styles.d.ts +8 -7
- package/dist/theme/Provider.d.ts +3 -10
- package/dist/theme/common.d.ts +34 -4
- package/dist/theme/helpers.d.ts +2 -9
- package/dist/theme/types.d.ts +13 -10
- package/dist/true-react-common-ui-kit.js +7906 -27407
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1 -31620
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +9 -2
- package/package.json +36 -39
- package/src/components/AccountInfo/AccountInfo.stories.tsx +19 -27
- package/src/components/AccountInfo/AccountInfo.tsx +2 -3
- package/src/components/AddButton/AddButton.stories.tsx +14 -17
- package/src/components/AddButton/AddButton.tsx +3 -5
- package/src/components/Button/Button.stories.tsx +8 -26
- package/src/components/Button/Button.tsx +76 -77
- package/src/components/Checkbox/Checkbox.stories.tsx +27 -16
- package/src/components/Checkbox/Checkbox.styles.ts +3 -1
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Checkbox/types.ts +4 -0
- package/src/components/CloseButton/CloseButton.stories.tsx +5 -6
- package/src/components/CloseButton/CloseButton.tsx +2 -4
- package/src/components/Colors/Colors.stories.tsx +64 -3
- package/src/components/ControlWrapper/ControlWrapper.stories.tsx +46 -35
- package/src/components/ControlWrapper/ControlWrapper.styles.ts +15 -6
- package/src/components/ControlWrapper/ControlWrapper.tsx +73 -44
- package/src/components/ControlWrapper/constants.ts +11 -0
- package/src/components/ControlWrapper/helpers.ts +11 -0
- package/src/components/ControlWrapper/index.ts +3 -0
- package/src/components/ControlWrapper/types.ts +19 -0
- package/src/components/CssBaseline/CssBaseline.styles.ts +2 -0
- package/src/components/CssBaseline/CssBaseline.tsx +2 -3
- package/src/components/DateInput/DateInput.stories.tsx +13 -31
- package/src/components/DateInput/DateInput.tsx +61 -64
- package/src/components/DatePicker/DatePicker.stories.tsx +18 -42
- package/src/components/DatePicker/DatePicker.styles.ts +3 -1
- package/src/components/DatePicker/DatePicker.tsx +284 -256
- 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/PopperContainer/PopperContainer.tsx +4 -4
- package/src/components/DatePicker/components/index.ts +1 -0
- package/src/components/DatePicker/constants.ts +9 -3
- package/src/components/DatePicker/helpers.ts +1 -1
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/DatePicker/types.ts +6 -4
- package/src/components/Description/Description.stories.tsx +11 -16
- package/src/components/Description/Description.tsx +2 -3
- package/src/components/FileInput/FileInput.stories.tsx +59 -63
- package/src/components/FileInput/FileInput.tsx +87 -95
- package/src/components/FileItem/FileItem.stories.tsx +48 -48
- package/src/components/FileItem/FileItem.tsx +2 -4
- package/src/components/FileItem/constants.ts +3 -14
- package/src/components/FileItem/helpers.ts +3 -2
- package/src/components/FileItem/types.ts +1 -3
- package/src/components/FiltersPane/FiltersPane.stories.tsx +34 -28
- package/src/components/FiltersPane/FiltersPane.tsx +28 -19
- package/src/components/FiltersPane/components/Filter/Filter.tsx +36 -30
- package/src/components/FiltersPane/components/Filter/helpers.ts +18 -0
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +7 -20
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.styles.ts +1 -2
- package/src/components/FiltersPane/components/FilterSelect/FilterSelect.tsx +22 -23
- package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +8 -5
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.ts +3 -3
- package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +9 -7
- package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +4 -3
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +17 -12
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.ts +5 -0
- package/src/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.tsx +19 -19
- package/src/components/FiltersPane/helpers.ts +3 -3
- package/src/components/FiltersPane/index.ts +1 -0
- package/src/components/FiltersPane/types.ts +12 -4
- package/src/components/Flag/Flag.stories.tsx +15 -20
- package/src/components/Flag/Flag.tsx +2 -2
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +47 -50
- package/src/components/FlexibleTable/FlexibleTable.styles.ts +5 -2
- package/src/components/FlexibleTable/FlexibleTable.tsx +43 -64
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +1 -0
- package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +13 -7
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +15 -15
- package/src/components/FlexibleTable/types.ts +19 -11
- package/src/components/FloatDocActions/FloatDocActions.stories.tsx +111 -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 +80 -67
- package/src/components/Icon/Icon.styles.ts +1 -1
- package/src/components/Icon/Icon.tsx +17 -12
- 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/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 +1 -1
- package/src/components/Icon/types.ts +7 -13
- package/src/components/IconButton/IconButton.stories.tsx +7 -12
- package/src/components/IconButton/IconButton.styles.ts +15 -13
- package/src/components/IconButton/IconButton.tsx +44 -48
- package/src/components/IconButton/constants.ts +1 -1
- package/src/components/IncrementInput/IncrementInput.stories.tsx +25 -23
- package/src/components/IncrementInput/IncrementInput.styles.ts +31 -39
- package/src/components/IncrementInput/IncrementInput.tsx +28 -25
- package/src/components/Input/Input.stories.tsx +38 -68
- package/src/components/Input/Input.styles.ts +5 -2
- package/src/components/Input/Input.tsx +29 -26
- package/src/components/Input/InputBase.tsx +172 -172
- package/src/components/List/List.stories.tsx +22 -17
- package/src/components/List/List.styles.ts +2 -1
- package/src/components/List/List.tsx +7 -5
- package/src/components/List/components/ListItem/ListItem.tsx +2 -4
- package/src/components/List/index.ts +2 -1
- package/src/components/List/types.ts +5 -0
- package/src/components/Modal/Modal.stories.tsx +50 -59
- package/src/components/Modal/Modal.tsx +3 -5
- package/src/components/MoreMenu/MoreMenu.stories.tsx +24 -15
- package/src/components/MoreMenu/MoreMenu.tsx +2 -4
- package/src/components/MultiSelect/MultiSelect.stories.tsx +23 -20
- package/src/components/MultiSelect/MultiSelect.tsx +2 -4
- package/src/components/MultiSelectList/MultiSelectList.tsx +15 -11
- package/src/components/MultiSelectList/helpers.ts +2 -2
- package/src/components/NewMoreMenu/NewMoreMenu.stories.tsx +42 -40
- package/src/components/NewMoreMenu/NewMoreMenu.tsx +2 -4
- package/src/components/Notification/Notification.stories.tsx +35 -34
- package/src/components/Notification/Notification.tsx +2 -3
- package/src/components/NumberInput/NumberInput.stories.tsx +32 -28
- package/src/components/NumberInput/NumberInput.tsx +91 -93
- package/src/components/PhoneInput/PhoneInput.stories.tsx +29 -55
- package/src/components/PhoneInput/PhoneInput.tsx +3 -4
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.stories.tsx +5 -11
- package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +1 -4
- package/src/components/RadioButton/RadioButton.stories.tsx +31 -21
- package/src/components/RadioButton/RadioButton.styles.ts +2 -1
- package/src/components/RadioButton/RadioButton.tsx +12 -5
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/RadioButton/types.ts +4 -0
- package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +15 -9
- package/src/components/SearchInput/SearchInput.stories.tsx +19 -14
- package/src/components/SearchInput/SearchInput.styles.ts +6 -12
- package/src/components/SearchInput/SearchInput.tsx +21 -24
- package/src/components/Select/CustomSelect.stories.tsx +29 -32
- package/src/components/Select/MultiSelect.stories.tsx +45 -45
- package/src/components/Select/Select.stories.tsx +45 -44
- package/src/components/Select/Select.styles.ts +5 -40
- package/src/components/Select/Select.tsx +62 -52
- package/src/components/Select/components/SelectList/SelectList.styles.ts +2 -1
- package/src/components/Select/components/SelectList/SelectList.tsx +13 -7
- package/src/components/Select/components/SelectListItem/SelectListItem.tsx +5 -2
- package/src/components/Select/index.ts +1 -1
- package/src/components/Select/types.ts +3 -0
- package/src/components/Selector/Selector.stories.tsx +25 -27
- package/src/components/Selector/Selector.tsx +5 -8
- package/src/components/Skeleton/Skeleton.stories.tsx +13 -12
- package/src/components/SmartInput/SmartInput.stories.tsx +23 -23
- package/src/components/SmartInput/SmartInput.tsx +85 -87
- package/src/components/Status/Status.stories.tsx +79 -28
- package/src/components/Status/Status.styles.ts +2 -37
- package/src/components/Status/Status.tsx +5 -4
- package/src/components/Status/constants.ts +0 -10
- package/src/components/Status/index.ts +1 -1
- package/src/components/Status/types.ts +7 -3
- package/src/components/Switch/Switch.stories.tsx +19 -26
- package/src/components/Switch/Switch.styles.ts +21 -13
- package/src/components/Switch/Switch.tsx +11 -6
- package/src/components/Switch/types.ts +5 -0
- package/src/components/TextArea/TextArea.stories.tsx +37 -26
- package/src/components/TextArea/TextArea.styles.ts +15 -8
- package/src/components/TextArea/TextArea.tsx +114 -83
- package/src/components/TextArea/index.ts +1 -1
- package/src/components/TextArea/types.ts +5 -5
- package/src/components/TextButton/TextButton.stories.tsx +8 -19
- package/src/components/TextButton/TextButton.styles.ts +1 -0
- package/src/components/TextButton/TextButton.tsx +68 -69
- package/src/components/TextWithInfo/TextWithInfo.stories.tsx +13 -21
- package/src/components/TextWithInfo/TextWithInfo.tsx +2 -4
- package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +26 -25
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +7 -6
- package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +12 -23
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +2 -4
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +4 -4
- package/src/components/Toaster/Toaster.stories.tsx +16 -14
- package/src/components/Toaster/Toaster.tsx +2 -4
- package/src/components/Tooltip/Tooltip.stories.tsx +15 -4
- package/src/components/Tooltip/Tooltip.styles.ts +2 -1
- package/src/components/Tooltip/Tooltip.tsx +12 -5
- package/src/components/Tooltip/types.ts +5 -0
- package/src/components/WithMessages/WithMessages.stories.tsx +16 -20
- package/src/components/WithMessages/WithMessages.tsx +41 -40
- package/src/components/WithPopup/WithPopup.stories.tsx +27 -26
- package/src/components/WithPopup/WithPopup.tsx +36 -15
- package/src/components/WithTooltip/WithTooltip.stories.tsx +28 -28
- package/src/components/WithTooltip/WithTooltip.tsx +4 -0
- package/src/components/index.ts +1 -1
- package/src/helpers/misc.ts +15 -7
- package/src/helpers/popper-helpers.ts +0 -1
- package/src/hooks/index.ts +8 -4
- package/src/hooks/use-intersection-ref.ts +48 -0
- package/src/hooks/use-latest-ref.ts +11 -0
- package/src/hooks/use-merge.ts +8 -0
- package/src/hooks/use-mixed-styles.ts +9 -11
- package/src/hooks/use-on-click-outside.ts +22 -14
- package/src/hooks/use-resize-ref.ts +35 -0
- package/src/hooks/use-tweak-styles.ts +18 -33
- package/src/theme/Provider.tsx +5 -17
- package/src/theme/common.ts +33 -36
- package/src/theme/helpers.ts +60 -50
- package/src/theme/types.ts +19 -15
- package/src/types.ts +17 -6
- 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.d.ts +0 -2
- package/dist/components/Colors/Colors.stories.d.ts +0 -5
- package/dist/components/Colors/Colors.styles.d.ts +0 -1
- package/dist/components/Colors/index.d.ts +0 -1
- 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 -7
- 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/dist/style.css +0 -820
- package/src/components/Colors/Colors.styles.ts +0 -36
- package/src/components/Colors/Colors.tsx +0 -26
- package/src/components/Colors/index.ts +0 -1
- package/src/components/Flag/augment.d.ts +0 -1
- package/src/components/Flag/customFlags/augment.d.ts +0 -1
- package/src/components/Icon/complexIcons/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
- /package/src/components/Icon/{complexIcons/avatarGreen.svg → icons/avatar.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileExcel.svg → icons/file-excel.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileImage.svg → icons/file-image.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileOther.svg → icons/file-other.svg} +0 -0
- /package/src/components/Icon/{complexIcons/filePdf.svg → icons/file-pdf.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileWord.svg → icons/file-word.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileXml.svg → icons/file-xml.svg} +0 -0
- /package/src/components/Icon/{complexIcons/fileZip.svg → icons/file-zip.svg} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import cloneDeep from 'lodash-es/cloneDeep';
|
|
2
1
|
import { colors, createThemedStyles, ITweakStyles } from '../../../../theme';
|
|
3
2
|
import { IButtonStyles } from '../../../Button';
|
|
4
3
|
import { IDatePickerStyles } from '../../../DatePicker';
|
|
@@ -6,6 +5,7 @@ import { innerTextButtonStyles } from '../../FiltersPane.styles';
|
|
|
6
5
|
|
|
7
6
|
export const useStyles = createThemedStyles('FilterWithDates', {
|
|
8
7
|
root: {
|
|
8
|
+
width: 320,
|
|
9
9
|
background: colors.CLASSIC_WHITE,
|
|
10
10
|
position: 'relative',
|
|
11
11
|
zIndex: 20,
|
|
@@ -32,12 +32,12 @@ export const useStyles = createThemedStyles('FilterWithDates', {
|
|
|
32
32
|
datepicker: {},
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
export const clearButtonStyles =
|
|
35
|
+
export const clearButtonStyles = structuredClone(innerTextButtonStyles);
|
|
36
36
|
|
|
37
37
|
export const backButtonStyles = innerTextButtonStyles;
|
|
38
38
|
|
|
39
39
|
const PICKER_TOP_MARGIN = 28;
|
|
40
|
-
const PICKER_WITH_BUTTONS_TOP_MARGIN =
|
|
40
|
+
const PICKER_WITH_BUTTONS_TOP_MARGIN = 56;
|
|
41
41
|
const START_PICKER_LEFT_MARGIN = -20;
|
|
42
42
|
const END_PICKER_LEFT_MARGIN = -170;
|
|
43
43
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { FC, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { isAfter, isBefore } from 'date-fns';
|
|
3
|
-
import enUS from 'date-fns/locale
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { enUS, ru } from 'date-fns/locale';
|
|
4
|
+
import {
|
|
5
|
+
getTestId,
|
|
6
|
+
isNotEmpty,
|
|
7
|
+
addDataAttributes,
|
|
8
|
+
} from '@true-engineering/true-react-platform-helpers';
|
|
7
9
|
import { useTweakStyles } from '../../../../hooks';
|
|
8
10
|
import { ICommonProps } from '../../../../types';
|
|
9
11
|
import { Button } from '../../../Button';
|
|
@@ -128,12 +130,12 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
128
130
|
};
|
|
129
131
|
|
|
130
132
|
return (
|
|
131
|
-
<div className={classes.root} {...addDataAttributes(data)}>
|
|
133
|
+
<div className={classes.root} {...addDataAttributes(data, testId)}>
|
|
132
134
|
<div className={classes.container}>
|
|
133
135
|
<div className={classes.containerItem}>
|
|
134
136
|
<DatePicker
|
|
135
137
|
selectedDate={value?.from}
|
|
136
|
-
maxDate={value?.to}
|
|
138
|
+
maxDate={value?.to ?? undefined}
|
|
137
139
|
label={translates.from}
|
|
138
140
|
months={translates.months}
|
|
139
141
|
locale={dateLocale}
|
|
@@ -149,7 +151,7 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
|
|
|
149
151
|
selectedDate={value?.to}
|
|
150
152
|
label={translates.to}
|
|
151
153
|
months={translates.months}
|
|
152
|
-
minDate={value?.from}
|
|
154
|
+
minDate={value?.from ?? undefined}
|
|
153
155
|
locale={dateLocale}
|
|
154
156
|
onChangeDate={handleChangeTo}
|
|
155
157
|
tweakStyles={tweakEndDatePickerStyles}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { getTestId } from '@true-engineering/true-react-platform-helpers';
|
|
2
3
|
import { useOnClickOutside, useTweakStyles } from '../../../../hooks';
|
|
3
4
|
import { ICommonProps } from '../../../../types';
|
|
4
5
|
import { PERIODS, PERIODS_GETTERS } from '../../constants';
|
|
@@ -146,12 +147,12 @@ export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
|
146
147
|
locale={translates}
|
|
147
148
|
tweakStyles={tweakSelectStyles}
|
|
148
149
|
getValueView={getPeriodTranslate}
|
|
149
|
-
testId={testId
|
|
150
|
+
testId={getTestId(testId, 'select')}
|
|
150
151
|
/>
|
|
151
152
|
</div>
|
|
152
153
|
)}
|
|
153
154
|
{isDatePickerShown && (
|
|
154
|
-
<div className={classes.picker}
|
|
155
|
+
<div className={classes.picker} ref={refDatePicker}>
|
|
155
156
|
<FilterWithDates
|
|
156
157
|
onStartBtnSubmit={() => {
|
|
157
158
|
setIsDatePickerShown(false);
|
|
@@ -168,7 +169,7 @@ export const FilterWithPeriod: FC<IFilterWithPeriodProps> = ({
|
|
|
168
169
|
onChange={handleCustomDateChange}
|
|
169
170
|
localeKey={localeKey}
|
|
170
171
|
locale={translates}
|
|
171
|
-
testId={testId
|
|
172
|
+
testId={getTestId(testId, 'dates')}
|
|
172
173
|
/>
|
|
173
174
|
</div>
|
|
174
175
|
)}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { MouseEventHandler } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
addDataAttributes,
|
|
5
|
+
getTestId,
|
|
6
|
+
isNotEmpty,
|
|
7
|
+
} from '@true-engineering/true-react-platform-helpers';
|
|
8
|
+
import { useMixedStyles, useTweakStyles } from '../../../../hooks';
|
|
6
9
|
import { ICommonProps } from '../../../../types';
|
|
7
10
|
import { Icon } from '../../../Icon';
|
|
8
11
|
import { WithPopup } from '../../../WithPopup';
|
|
@@ -12,8 +15,10 @@ import { FilterValueView } from '../FilterValueView';
|
|
|
12
15
|
import { isContentNotEmpty } from './helpers';
|
|
13
16
|
import { useStyles, IFilterWrapperStyles } from './FilterWrapper.styles';
|
|
14
17
|
|
|
15
|
-
export interface IFilterWrapperProps<
|
|
16
|
-
extends
|
|
18
|
+
export interface IFilterWrapperProps<
|
|
19
|
+
Values extends Record<string, unknown>,
|
|
20
|
+
Key extends keyof Values,
|
|
21
|
+
> extends ICommonProps<IFilterWrapperStyles> {
|
|
17
22
|
filter: ConfigItem<Values[Key]>;
|
|
18
23
|
value?: Values[Key];
|
|
19
24
|
isDisabled?: boolean;
|
|
@@ -22,7 +27,7 @@ export interface IFilterWrapperProps<Values, Key extends keyof Values>
|
|
|
22
27
|
onChange: <V>(value: V) => void;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
export function FilterWrapper<Values, Key extends keyof Values>({
|
|
30
|
+
export function FilterWrapper<Values extends Record<string, unknown>, Key extends keyof Values>({
|
|
26
31
|
filter,
|
|
27
32
|
value,
|
|
28
33
|
isDisabled,
|
|
@@ -30,9 +35,10 @@ export function FilterWrapper<Values, Key extends keyof Values>({
|
|
|
30
35
|
localeKey,
|
|
31
36
|
data,
|
|
32
37
|
testId,
|
|
33
|
-
tweakStyles,
|
|
38
|
+
tweakStyles: baseTweakStyles,
|
|
34
39
|
onChange,
|
|
35
40
|
}: IFilterWrapperProps<Values, Key>): JSX.Element {
|
|
41
|
+
const tweakStyles = useMixedStyles(baseTweakStyles, filter.tweakWrapperStyles);
|
|
36
42
|
const classes = useStyles({ theme: tweakStyles });
|
|
37
43
|
|
|
38
44
|
const tweakWithPopupStyles = useTweakStyles({
|
|
@@ -91,8 +97,7 @@ export function FilterWrapper<Values, Key extends keyof Values>({
|
|
|
91
97
|
[classes.boolean]: isBoolean,
|
|
92
98
|
[classes.disabled]: isDisabled,
|
|
93
99
|
})}
|
|
94
|
-
{...
|
|
95
|
-
{...addDataAttributes(data)}
|
|
100
|
+
{...addDataAttributes(data, testId)}
|
|
96
101
|
{...referenceProps}
|
|
97
102
|
>
|
|
98
103
|
<div
|
|
@@ -100,13 +105,13 @@ export function FilterWrapper<Values, Key extends keyof Values>({
|
|
|
100
105
|
className={clsx(classes.item, { [classes.booleanItem]: isBoolean })}
|
|
101
106
|
>
|
|
102
107
|
<div className={classes.name}>{filter.name}</div>
|
|
103
|
-
{!isBoolean && value
|
|
108
|
+
{!isBoolean && isNotEmpty(value) && (
|
|
104
109
|
<div className={classes.value}>
|
|
105
110
|
<FilterValueView
|
|
106
111
|
value={value}
|
|
107
112
|
filter={filter}
|
|
108
|
-
localeKey={localeKey}
|
|
109
113
|
locale={locale}
|
|
114
|
+
localeKey={localeKey}
|
|
110
115
|
testId={getTestId(testId, 'value')}
|
|
111
116
|
tweakStyles={tweakFilterValueViewStyles}
|
|
112
117
|
/>
|
|
@@ -137,8 +142,8 @@ export function FilterWrapper<Values, Key extends keyof Values>({
|
|
|
137
142
|
<Filter
|
|
138
143
|
value={value}
|
|
139
144
|
filter={filter}
|
|
140
|
-
localeKey={localeKey}
|
|
141
145
|
locale={locale}
|
|
146
|
+
localeKey={localeKey}
|
|
142
147
|
onClose={onClose}
|
|
143
148
|
onChange={onChange}
|
|
144
149
|
testId={testId}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ReactNode, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
addDataAttributes,
|
|
5
|
+
addDataTestId,
|
|
6
|
+
getTestId,
|
|
7
|
+
isArrayLikeNotEmpty,
|
|
8
|
+
isArrayNotEmpty,
|
|
9
|
+
isNotEmpty,
|
|
10
|
+
} from '@true-engineering/true-react-platform-helpers';
|
|
4
11
|
import { useOnClickOutside, useTweakStyles } from '../../../../hooks';
|
|
5
12
|
import { ICommonProps } from '../../../../types';
|
|
6
13
|
import { Icon } from '../../../Icon';
|
|
@@ -29,6 +36,7 @@ export interface IFiltersPaneSearchProps<Value> extends ICommonProps<IFiltersPan
|
|
|
29
36
|
hasClearSelectButton?: boolean;
|
|
30
37
|
isDisabled?: boolean;
|
|
31
38
|
isSelectSearchEnabled?: boolean;
|
|
39
|
+
isAutoSized?: boolean;
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export function FiltersPaneSearch<Value>({
|
|
@@ -44,6 +52,7 @@ export function FiltersPaneSearch<Value>({
|
|
|
44
52
|
hasClearSelectButton,
|
|
45
53
|
isDisabled = false,
|
|
46
54
|
isSelectSearchEnabled = true,
|
|
55
|
+
isAutoSized = false,
|
|
47
56
|
maxLength,
|
|
48
57
|
data,
|
|
49
58
|
tweakStyles,
|
|
@@ -89,20 +98,15 @@ export function FiltersPaneSearch<Value>({
|
|
|
89
98
|
setIsOpen(false);
|
|
90
99
|
};
|
|
91
100
|
|
|
92
|
-
const selectedFieldLabel = useMemo(
|
|
93
|
-
() => (field !== undefined && getValueView !== undefined ? getValueView(field) : undefined),
|
|
94
|
-
[field],
|
|
95
|
-
);
|
|
96
|
-
|
|
97
101
|
return (
|
|
98
102
|
<div
|
|
99
103
|
className={clsx(classes.root, {
|
|
100
104
|
[classes.focused]: isInputFocused,
|
|
101
105
|
[classes.disabled]: isDisabled,
|
|
106
|
+
[classes.hasValue]: isArrayLikeNotEmpty(value),
|
|
102
107
|
})}
|
|
103
108
|
ref={refRoot}
|
|
104
|
-
data
|
|
105
|
-
{...addDataAttributes(data)}
|
|
109
|
+
{...addDataAttributes(data, testId)}
|
|
106
110
|
>
|
|
107
111
|
<SearchInput
|
|
108
112
|
value={value}
|
|
@@ -111,26 +115,22 @@ export function FiltersPaneSearch<Value>({
|
|
|
111
115
|
tweakStyles={tweakSearchInputStyles}
|
|
112
116
|
onFocus={() => setIsInputFocused(true)}
|
|
113
117
|
onBlur={() => setIsInputFocused(false)}
|
|
114
|
-
testId={testId
|
|
118
|
+
testId={getTestId(testId, 'input')}
|
|
115
119
|
maxLength={maxLength}
|
|
116
120
|
isDisabled={isDisabled}
|
|
121
|
+
isAutoSized={isAutoSized}
|
|
117
122
|
/>
|
|
118
123
|
|
|
119
124
|
<div className={classes.selectWrapper}>
|
|
120
125
|
{/* Select block */}
|
|
121
|
-
{fields
|
|
126
|
+
{isArrayNotEmpty(fields) && (
|
|
122
127
|
<div
|
|
123
128
|
className={classes.selectBlock}
|
|
124
129
|
onClick={!isDisabled ? () => setIsOpen(!isOpen) : undefined}
|
|
125
|
-
|
|
130
|
+
{...addDataTestId(testId, 'select')}
|
|
126
131
|
>
|
|
127
|
-
<div
|
|
128
|
-
|
|
129
|
-
classes.selectLabel,
|
|
130
|
-
selectedFieldLabel !== undefined && classes.active,
|
|
131
|
-
)}
|
|
132
|
-
>
|
|
133
|
-
{selectedFieldLabel ?? translates.displayedFields}
|
|
132
|
+
<div className={clsx(classes.selectLabel, { [classes.active]: isNotEmpty(field) })}>
|
|
133
|
+
{isNotEmpty(field) ? getValueView?.(field) : translates.displayedFields}
|
|
134
134
|
</div>
|
|
135
135
|
<div className={clsx(classes.chevronIcon, isOpen && classes.open)}>
|
|
136
136
|
<Icon type="chevron-down" />
|
|
@@ -152,7 +152,7 @@ export function FiltersPaneSearch<Value>({
|
|
|
152
152
|
onChange={handleFieldsChange}
|
|
153
153
|
isSearchEnabled={isSelectSearchEnabled}
|
|
154
154
|
hasClearButton={hasClearSelectButton}
|
|
155
|
-
testId={testId
|
|
155
|
+
testId={getTestId(testId, 'dropdown')}
|
|
156
156
|
/>
|
|
157
157
|
</div>
|
|
158
158
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import merge from '
|
|
1
|
+
import { merge } from '@true-engineering/true-react-platform-helpers';
|
|
2
2
|
import { DEFAULT_LOCALE, DEFAULT_SELECT_LOCALE, FilterLocales, SelectLocales } from './constants';
|
|
3
3
|
import {
|
|
4
4
|
type IFilterLocale,
|
|
@@ -12,13 +12,13 @@ export const getLocale = (
|
|
|
12
12
|
key: IFilterLocaleKey = DEFAULT_LOCALE,
|
|
13
13
|
custom?: IPartialFilterLocale,
|
|
14
14
|
custom2?: IPartialFilterLocale,
|
|
15
|
-
): IFilterLocale => merge(
|
|
15
|
+
): IFilterLocale => merge(FilterLocales[key], custom, custom2);
|
|
16
16
|
|
|
17
17
|
export const getSelectLocale = (
|
|
18
18
|
key: ISelectLocaleKey = DEFAULT_SELECT_LOCALE,
|
|
19
19
|
custom?: Partial<ISelectLocale>,
|
|
20
20
|
custom2?: Partial<ISelectLocale>,
|
|
21
|
-
): ISelectLocale => merge(
|
|
21
|
+
): ISelectLocale => merge(SelectLocales[key], custom, custom2);
|
|
22
22
|
|
|
23
23
|
export const sortValues = (arr: Array<number | undefined>): Array<number | undefined> =>
|
|
24
24
|
arr.includes(undefined) ? arr : (arr as number[]).sort((a, b) => (a < b ? -1 : 1));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './FiltersPane';
|
|
2
2
|
export type { IFiltersPaneStyles } from './FiltersPane.styles';
|
|
3
3
|
export * from './types';
|
|
4
|
+
export { PERIODS, PERIODS_GETTERS } from './constants';
|
|
4
5
|
// TODO : подумать над тем чтобы вынести это все наружу
|
|
5
6
|
export * from './components';
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ITestIdProps } from '../../types';
|
|
2
3
|
import { IDatePickerProps } from '../DatePicker';
|
|
3
4
|
import { IMultiSelectListValues } from '../MultiSelectList';
|
|
5
|
+
import { INumberInputProps } from '../NumberInput';
|
|
4
6
|
import type {
|
|
5
7
|
IFilterIntervalProps,
|
|
6
8
|
IFilterMultiSelectProps,
|
|
7
9
|
IFilterSelectProps,
|
|
8
10
|
IFilterWithDatesProps,
|
|
9
11
|
IFilterWithPeriodProps,
|
|
12
|
+
IFilterWrapperStyles,
|
|
10
13
|
} from './components';
|
|
11
14
|
import { FilterLocales, PERIODS, SelectLocales } from './constants';
|
|
12
15
|
|
|
@@ -47,17 +50,19 @@ export type MultiSelectOptionType<Value> = Value | undefined extends
|
|
|
47
50
|
: unknown;
|
|
48
51
|
|
|
49
52
|
export interface IConfigItemBasicBase<Value> {
|
|
50
|
-
name:
|
|
53
|
+
name: ReactNode;
|
|
51
54
|
isInline?: boolean;
|
|
52
55
|
isClearable?: boolean;
|
|
53
56
|
requiredFilledFilters?: string[];
|
|
54
57
|
localeKey?: IFilterLocaleKey;
|
|
55
58
|
locale?: IPartialFilterLocale;
|
|
56
59
|
getSelectedValueView?: (v: Value) => ReactNode;
|
|
60
|
+
tweakWrapperStyles?: IFilterWrapperStyles;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export type IIntervalConfigItem<Value> = IConfigItemBasicBase<Value> & {
|
|
60
64
|
type: 'interval';
|
|
65
|
+
name: string;
|
|
61
66
|
} & Omit<IFilterIntervalProps, 'value' | 'onChange' | 'labelName'>;
|
|
62
67
|
|
|
63
68
|
export interface IBooleanConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
@@ -84,7 +89,7 @@ export type IDateRangeConfigItem<Value> = IConfigItemBasicBase<Value> & {
|
|
|
84
89
|
dateFormat?: string;
|
|
85
90
|
} & Omit<IFilterWithPeriodProps, 'value' | 'onChange' | 'setIsOpen'>;
|
|
86
91
|
|
|
87
|
-
export interface ICustomComponentProps<Value> {
|
|
92
|
+
export interface ICustomComponentProps<Value> extends ITestIdProps {
|
|
88
93
|
value?: Value;
|
|
89
94
|
onChange: (v?: Value) => void;
|
|
90
95
|
onClose?: () => void;
|
|
@@ -98,7 +103,6 @@ export type CustomComponent<Value> = FC<ICustomComponentProps<Value>>;
|
|
|
98
103
|
export type ICustomValue<V> = V extends Array<infer T> ? T : never;
|
|
99
104
|
|
|
100
105
|
export interface ICustomRangeConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
102
106
|
[key: string & {}]: any;
|
|
103
107
|
type: 'custom';
|
|
104
108
|
component: CustomComponent<Value>;
|
|
@@ -106,7 +110,6 @@ export interface ICustomRangeConfigItem<Value> extends IConfigItemBasicBase<Valu
|
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
export interface ICustomMultipleConfigItem<Value> extends IConfigItemBasicBase<Value> {
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
110
113
|
[key: string & {}]: any;
|
|
111
114
|
type: 'custom';
|
|
112
115
|
component: CustomComponent<Value>;
|
|
@@ -173,3 +176,8 @@ export type IFilterWithDateDatePickerProps = Omit<
|
|
|
173
176
|
IDatePickerProps,
|
|
174
177
|
'onChange' | 'value' | 'locale' | 'months' | 'selectedDate' | 'tweakStyles'
|
|
175
178
|
>;
|
|
179
|
+
|
|
180
|
+
export type IFilterNumberInputProps = Omit<
|
|
181
|
+
INumberInputProps,
|
|
182
|
+
'onChange' | 'value' | 'label' | 'testId' | 'tweakStyles'
|
|
183
|
+
>;
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { countries } from 'country-flag-icons';
|
|
2
|
-
import {
|
|
3
|
-
import { Flag } from './Flag';
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
4
|
+
import { Flag, IFlagProps } from './Flag';
|
|
4
5
|
import { customFlags } from './customFlags';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
title: 'Data Display/Flag',
|
|
8
|
-
component: Flag,
|
|
9
|
-
argTypes: {
|
|
10
|
-
countryCode: { control: 'select', options: [...countries, ...Object.keys(customFlags)] },
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Template: ComponentStory<typeof Flag> = (args) => (
|
|
7
|
+
const Story: FC<IFlagProps> = (args) => (
|
|
15
8
|
<div style={{ width: 60, height: 40 }}>
|
|
16
9
|
<Flag {...args} />
|
|
17
10
|
</div>
|
|
18
11
|
);
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
exclude: ['data'],
|
|
13
|
+
const meta: Meta<typeof Story> = {
|
|
14
|
+
title: 'Data Display/Flag',
|
|
15
|
+
component: Story,
|
|
16
|
+
args: {
|
|
17
|
+
countryCode: 'ug',
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
countryCode: { control: 'select', options: [...countries, ...Object.keys(customFlags)] },
|
|
29
21
|
},
|
|
30
22
|
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
export const Default = {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { hasFlag } from 'country-flag-icons';
|
|
3
|
-
import Flags from 'country-flag-icons/react/3x2';
|
|
3
|
+
import * as Flags from 'country-flag-icons/react/3x2';
|
|
4
4
|
import { ICommonProps } from '../../types';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
6
|
import { customFlags } from './customFlags';
|
|
7
|
-
import {
|
|
7
|
+
import { IFlagStyles, useStyles } from './Flag.styles';
|
|
8
8
|
|
|
9
9
|
export interface IFlagProps extends Pick<ICommonProps<IFlagStyles>, 'tweakStyles'> {
|
|
10
10
|
/** @default '' */
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
3
|
-
import {
|
|
4
|
-
import { FlexibleTable } from './FlexibleTable';
|
|
3
|
+
import { type Meta } from '@storybook/react';
|
|
4
|
+
import { FlexibleTable, IFlexibleTableProps } from './FlexibleTable';
|
|
5
5
|
import { IFlexibleTableConfigType, IValueComponentProps } from './types';
|
|
6
6
|
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Table/FlexibleTable',
|
|
9
|
-
component: FlexibleTable,
|
|
10
|
-
} as ComponentMeta<typeof FlexibleTable>;
|
|
11
|
-
|
|
12
7
|
interface ITableContent {
|
|
13
8
|
contractCode: string;
|
|
14
9
|
validFrom: Date;
|
|
@@ -77,7 +72,7 @@ const config: IFlexibleTableConfigType<ITableContent> = {
|
|
|
77
72
|
|
|
78
73
|
const content: ITableContent[] = [
|
|
79
74
|
{
|
|
80
|
-
contractCode: '
|
|
75
|
+
contractCode: 'SOME_CODE1',
|
|
81
76
|
validFrom: new Date('2015-05-18'),
|
|
82
77
|
validTo: new Date('2020-05-18'),
|
|
83
78
|
title: 'Название',
|
|
@@ -91,7 +86,7 @@ const content: ITableContent[] = [
|
|
|
91
86
|
publicNote: 'Public Note',
|
|
92
87
|
},
|
|
93
88
|
{
|
|
94
|
-
contractCode: '
|
|
89
|
+
contractCode: 'SOME_CODE2',
|
|
95
90
|
validFrom: new Date('2015-05-18'),
|
|
96
91
|
validTo: new Date('2020-05-18'),
|
|
97
92
|
title: 'Название',
|
|
@@ -104,7 +99,7 @@ const content: ITableContent[] = [
|
|
|
104
99
|
note: 'Only Note',
|
|
105
100
|
},
|
|
106
101
|
{
|
|
107
|
-
contractCode: '
|
|
102
|
+
contractCode: 'SOME_CODE3',
|
|
108
103
|
validFrom: new Date('2015-05-18'),
|
|
109
104
|
validTo: new Date('2020-05-18'),
|
|
110
105
|
title: 'Название',
|
|
@@ -117,7 +112,7 @@ const content: ITableContent[] = [
|
|
|
117
112
|
publicNote: 'Only Public Note',
|
|
118
113
|
},
|
|
119
114
|
{
|
|
120
|
-
contractCode: '
|
|
115
|
+
contractCode: 'SOME_CODE4',
|
|
121
116
|
validFrom: new Date('2015-05-18'),
|
|
122
117
|
validTo: new Date('2020-05-18'),
|
|
123
118
|
title: 'Название',
|
|
@@ -129,7 +124,7 @@ const content: ITableContent[] = [
|
|
|
129
124
|
status: 'Active',
|
|
130
125
|
},
|
|
131
126
|
{
|
|
132
|
-
contractCode: '
|
|
127
|
+
contractCode: 'SOME_CODE5',
|
|
133
128
|
validFrom: new Date('2015-05-18'),
|
|
134
129
|
validTo: new Date('2020-05-18'),
|
|
135
130
|
title: 'Название',
|
|
@@ -141,7 +136,7 @@ const content: ITableContent[] = [
|
|
|
141
136
|
status: 'Active',
|
|
142
137
|
},
|
|
143
138
|
{
|
|
144
|
-
contractCode: '
|
|
139
|
+
contractCode: 'SOME_CODE6',
|
|
145
140
|
validFrom: new Date('2015-05-18'),
|
|
146
141
|
validTo: new Date('2020-05-18'),
|
|
147
142
|
title: 'Название',
|
|
@@ -153,7 +148,7 @@ const content: ITableContent[] = [
|
|
|
153
148
|
status: 'Active',
|
|
154
149
|
},
|
|
155
150
|
{
|
|
156
|
-
contractCode: '
|
|
151
|
+
contractCode: 'SOME_CODE7',
|
|
157
152
|
validFrom: new Date('2015-05-18'),
|
|
158
153
|
validTo: new Date('2020-05-18'),
|
|
159
154
|
title: 'Название',
|
|
@@ -165,7 +160,7 @@ const content: ITableContent[] = [
|
|
|
165
160
|
status: 'Active',
|
|
166
161
|
},
|
|
167
162
|
{
|
|
168
|
-
contractCode: '
|
|
163
|
+
contractCode: 'SOME_CODE8',
|
|
169
164
|
validFrom: new Date('2015-05-18'),
|
|
170
165
|
validTo: new Date('2020-05-18'),
|
|
171
166
|
title: 'Название',
|
|
@@ -177,7 +172,7 @@ const content: ITableContent[] = [
|
|
|
177
172
|
status: 'Active',
|
|
178
173
|
},
|
|
179
174
|
{
|
|
180
|
-
contractCode: '
|
|
175
|
+
contractCode: 'SOME_CODE9',
|
|
181
176
|
validFrom: new Date('2015-05-18'),
|
|
182
177
|
validTo: new Date('2020-05-18'),
|
|
183
178
|
title: 'Название',
|
|
@@ -189,7 +184,7 @@ const content: ITableContent[] = [
|
|
|
189
184
|
status: 'Active',
|
|
190
185
|
},
|
|
191
186
|
{
|
|
192
|
-
contractCode: '
|
|
187
|
+
contractCode: 'SOME_CODE10',
|
|
193
188
|
validFrom: new Date('2015-05-18'),
|
|
194
189
|
validTo: new Date('2020-05-18'),
|
|
195
190
|
title: 'Название',
|
|
@@ -201,7 +196,7 @@ const content: ITableContent[] = [
|
|
|
201
196
|
status: 'Active',
|
|
202
197
|
},
|
|
203
198
|
{
|
|
204
|
-
contractCode: '
|
|
199
|
+
contractCode: 'SOME_CODE11',
|
|
205
200
|
validFrom: new Date('2015-05-18'),
|
|
206
201
|
validTo: new Date('2020-05-18'),
|
|
207
202
|
title: 'Название',
|
|
@@ -213,7 +208,7 @@ const content: ITableContent[] = [
|
|
|
213
208
|
status: 'Active',
|
|
214
209
|
},
|
|
215
210
|
{
|
|
216
|
-
contractCode: '
|
|
211
|
+
contractCode: 'SOME_CODE12',
|
|
217
212
|
validFrom: new Date('2015-05-18'),
|
|
218
213
|
validTo: new Date('2020-05-18'),
|
|
219
214
|
title: 'Название',
|
|
@@ -225,7 +220,7 @@ const content: ITableContent[] = [
|
|
|
225
220
|
status: 'Active',
|
|
226
221
|
},
|
|
227
222
|
{
|
|
228
|
-
contractCode: '
|
|
223
|
+
contractCode: 'OB_UT_M13',
|
|
229
224
|
validFrom: new Date('2015-05-18'),
|
|
230
225
|
validTo: new Date('2020-05-18'),
|
|
231
226
|
title: 'Название',
|
|
@@ -237,7 +232,7 @@ const content: ITableContent[] = [
|
|
|
237
232
|
status: 'Active',
|
|
238
233
|
},
|
|
239
234
|
{
|
|
240
|
-
contractCode: '
|
|
235
|
+
contractCode: 'SOME_CODE14',
|
|
241
236
|
validFrom: new Date('2015-05-18'),
|
|
242
237
|
validTo: new Date('2020-05-18'),
|
|
243
238
|
title: 'Название',
|
|
@@ -250,13 +245,15 @@ const content: ITableContent[] = [
|
|
|
250
245
|
},
|
|
251
246
|
];
|
|
252
247
|
|
|
253
|
-
const
|
|
248
|
+
const Story: FC<IFlexibleTableProps<ITableContent, unknown, 'contractCode'>> = (args) => (
|
|
254
249
|
<div style={{ width: 700, overflow: 'auto' }}>
|
|
255
250
|
<FlexibleTable<ITableContent>
|
|
256
251
|
{...args}
|
|
257
252
|
config={config}
|
|
258
253
|
content={content}
|
|
259
254
|
rowAttributes={['contractCode']}
|
|
255
|
+
enabledColumns={undefined}
|
|
256
|
+
uniqueField="contractCode"
|
|
260
257
|
expandableRowComponent={(_0, _1, close) => (
|
|
261
258
|
<div onClick={close}>
|
|
262
259
|
всем привет :)
|
|
@@ -268,33 +265,33 @@ const Template: ComponentStory<typeof FlexibleTable<ITableContent>> = (args) =>
|
|
|
268
265
|
</div>
|
|
269
266
|
);
|
|
270
267
|
|
|
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
|
-
'onRowHover',
|
|
297
|
-
'expandableRowComponent',
|
|
298
|
-
],
|
|
268
|
+
const meta: Meta<typeof Story> = {
|
|
269
|
+
title: 'Table/FlexibleTable',
|
|
270
|
+
component: Story,
|
|
271
|
+
args: {
|
|
272
|
+
isLoading: false,
|
|
273
|
+
isFirstColumnSticky: true,
|
|
274
|
+
isHorizontallyScrollable: true,
|
|
275
|
+
isExpandableRowComponentInitiallyOpen: false,
|
|
276
|
+
},
|
|
277
|
+
parameters: {
|
|
278
|
+
controls: {
|
|
279
|
+
exclude: [
|
|
280
|
+
'data',
|
|
281
|
+
'testId',
|
|
282
|
+
'content',
|
|
283
|
+
'config',
|
|
284
|
+
'rowAttributes',
|
|
285
|
+
'headerContent',
|
|
286
|
+
'tweakStyles',
|
|
287
|
+
'onHeadClick',
|
|
288
|
+
'onRowClick',
|
|
289
|
+
'onRowHover',
|
|
290
|
+
'expandableRowComponent',
|
|
291
|
+
],
|
|
292
|
+
},
|
|
299
293
|
},
|
|
300
294
|
};
|
|
295
|
+
|
|
296
|
+
export default meta;
|
|
297
|
+
export const Default = {};
|