@true-engineering/true-react-common-ui-kit 2.3.1 → 2.4.0
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 -0
- package/dist/components/AccountInfo/constants.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +1 -3
- package/dist/components/Button/constants.d.ts +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/types.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/DatePickerHeader.styles.d.ts +1 -1
- package/dist/components/DatePicker/components/PopperContainer/PopperContainer.d.ts +4 -0
- package/dist/components/DatePicker/components/PopperContainer/index.d.ts +1 -0
- package/dist/components/DatePicker/components/index.d.ts +2 -0
- package/dist/components/DatePicker/constants.d.ts +2 -0
- package/dist/components/DatePicker/index.d.ts +2 -1
- package/dist/components/Description/constants.d.ts +1 -0
- package/dist/components/FiltersPane/FiltersPane.d.ts +2 -3
- package/dist/components/FiltersPane/components/Filter/Filter.d.ts +12 -0
- package/dist/components/FiltersPane/components/Filter/index.d.ts +1 -0
- package/dist/components/FiltersPane/{FilterInterval → components/FilterInterval}/FilterInterval.d.ts +2 -2
- package/dist/components/FiltersPane/{FilterInterval → components/FilterInterval}/FilterInterval.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterInterval/index.d.ts +2 -0
- package/dist/components/FiltersPane/{FilterMultiSelect → components/FilterMultiSelect}/FilterMultiSelect.d.ts +2 -2
- package/dist/components/FiltersPane/{FilterSelect → components/FilterSelect}/FilterSelect.d.ts +2 -4
- package/dist/components/FiltersPane/{FilterSelect → components/FilterSelect}/FilterSelect.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterSelect/index.d.ts +2 -0
- package/dist/components/FiltersPane/{FilterValueView → components/FilterValueView}/FilterValueView.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterValueView/index.d.ts +2 -0
- package/dist/components/FiltersPane/{FilterWithDates → components/FilterWithDates}/FilterWithDates.d.ts +4 -9
- package/dist/components/FiltersPane/{FilterWithDates → components/FilterWithDates}/FilterWithDates.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithDates/index.d.ts +2 -0
- package/dist/components/FiltersPane/{FilterWithPeriod → components/FilterWithPeriod}/FilterWithPeriod.d.ts +2 -3
- package/dist/components/FiltersPane/{FilterWithPeriod → components/FilterWithPeriod}/FilterWithPeriod.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWithPeriod/index.d.ts +2 -0
- package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +15 -0
- package/dist/components/FiltersPane/{FilterWrapper → components/FilterWrapper}/FilterWrapper.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FilterWrapper/index.d.ts +2 -0
- package/dist/components/FiltersPane/{FiltersPaneSearch → components/FiltersPaneSearch}/FiltersPaneSearch.d.ts +2 -3
- package/dist/components/FiltersPane/{FiltersPaneSearch → components/FiltersPaneSearch}/FiltersPaneSearch.styles.d.ts +1 -1
- package/dist/components/FiltersPane/components/FiltersPaneSearch/index.d.ts +2 -0
- package/dist/components/FiltersPane/components/index.d.ts +9 -0
- package/dist/components/FiltersPane/constants.d.ts +9 -0
- package/dist/components/FiltersPane/helpers.d.ts +5 -0
- package/dist/components/FiltersPane/index.d.ts +1 -14
- package/dist/components/FiltersPane/types.d.ts +37 -7
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +4 -4
- package/dist/components/FlexibleTable/{TableRow.d.ts → components/TableRow/TableRow.d.ts} +8 -8
- package/dist/components/FlexibleTable/components/TableRow/index.d.ts +1 -0
- package/dist/components/FlexibleTable/{TableValue.d.ts → components/TableValue/TableValue.d.ts} +3 -3
- package/dist/components/FlexibleTable/components/TableValue/index.d.ts +1 -0
- package/dist/components/FlexibleTable/components/index.d.ts +2 -0
- package/dist/components/FlexibleTable/constants.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +3 -5
- package/dist/components/Icon/complexIcons/icons.d.ts +0 -1
- package/dist/components/Icon/components/ComplexIconBoilerplate/ComplexIconBoilerplate.d.ts +6 -0
- package/dist/components/Icon/components/ComplexIconBoilerplate/index.d.ts +1 -0
- package/dist/components/Icon/{IconBoilerplate.d.ts → components/IconBolerplate/IconBoilerplate.d.ts} +1 -1
- package/dist/components/Icon/components/IconBolerplate/index.d.ts +1 -0
- package/dist/components/Icon/components/index.d.ts +2 -0
- package/dist/components/Icon/helpers.d.ts +6 -0
- package/dist/components/Icon/icons-list.d.ts +1 -0
- package/dist/components/Icon/index.d.ts +2 -2
- package/dist/components/Icon/types.d.ts +12 -0
- package/dist/components/IncrementInput/{ChangeButton.d.ts → components/ChangeButton/ChangeButton.d.ts} +1 -2
- package/dist/components/IncrementInput/components/ChangeButton/index.d.ts +1 -0
- package/dist/components/IncrementInput/components/index.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +1 -4
- package/dist/components/Input/constants.d.ts +1 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/types.d.ts +2 -0
- package/dist/components/List/List.d.ts +3 -12
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/List/types.d.ts +12 -0
- package/dist/components/Modal/Modal.d.ts +1 -3
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Modal/types.d.ts +3 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -3
- package/dist/components/MultiSelect/{MultiSelectInput → components/MultiSelectInput}/MultiSelectInput.d.ts +2 -2
- package/dist/components/MultiSelect/{MultiSelectInput → components/MultiSelectInput}/MultiSelectInput.styles.d.ts +1 -1
- package/dist/components/MultiSelect/components/MultiSelectInput/index.d.ts +2 -0
- package/dist/components/MultiSelect/index.d.ts +2 -1
- package/dist/components/MultiSelect/types.d.ts +1 -0
- package/dist/components/MultiSelectList/MultiSelectList.d.ts +1 -4
- package/dist/components/MultiSelectList/constants.d.ts +3 -0
- package/dist/components/MultiSelectList/helpers.d.ts +3 -0
- package/dist/components/MultiSelectList/index.d.ts +1 -0
- package/dist/components/MultiSelectList/types.d.ts +12 -0
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/Notification/Notification.styles.d.ts +1 -1
- package/dist/components/Notification/index.d.ts +1 -0
- package/dist/components/Notification/types.d.ts +1 -0
- package/dist/components/PhoneInput/PhoneInput.d.ts +3 -3
- package/dist/components/PhoneInput/{PhoneInputCountryList → components/PhoneInputCountryList}/PhoneInputCountryList.d.ts +2 -3
- package/dist/components/PhoneInput/{PhoneInputCountryList → components/PhoneInputCountryList}/PhoneInputCountryList.styles.d.ts +1 -1
- package/dist/components/PhoneInput/components/PhoneInputCountryList/index.d.ts +2 -0
- package/dist/components/PhoneInput/components/index.d.ts +1 -0
- package/dist/components/PhoneInput/constants.d.ts +2 -0
- package/dist/components/PhoneInput/index.d.ts +2 -2
- package/dist/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.d.ts +2 -2
- package/dist/components/ScrollIntoViewIfNeeded/constants.d.ts +3 -0
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/{SelectList → components/SelectList}/SelectList.d.ts +1 -1
- package/dist/components/Select/{SelectList → components/SelectList}/SelectList.styles.d.ts +1 -1
- package/dist/components/Select/components/SelectList/index.d.ts +2 -0
- package/dist/components/Select/{SelectListItem → components/SelectListItem}/SelectListItem.styles.d.ts +1 -1
- package/dist/components/Select/components/SelectListItem/index.d.ts +1 -0
- package/dist/components/Select/components/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/SmartInput/SmartInput.d.ts +3 -15
- package/dist/components/SmartInput/constants.d.ts +18 -0
- package/dist/components/SmartInput/helpers.d.ts +1 -7
- package/dist/components/SmartInput/index.d.ts +1 -0
- package/dist/components/SmartInput/types.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +1 -4
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/types.d.ts +4 -0
- package/dist/components/TextArea/TextArea.d.ts +5 -5
- package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -2
- package/dist/components/ThemedPreloader/ThemedPreloader.d.ts +1 -3
- package/dist/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.d.ts +1 -1
- package/dist/components/ThemedPreloader/components/index.d.ts +3 -2
- package/dist/components/ThemedPreloader/constants.d.ts +1 -0
- package/dist/components/ThemedPreloader/index.d.ts +2 -0
- package/dist/components/ThemedPreloader/types.d.ts +2 -0
- package/dist/components/Toaster/Toaster.d.ts +1 -1
- package/dist/components/Toaster/constants.d.ts +1 -0
- package/dist/components/Toaster/index.d.ts +1 -0
- package/dist/components/Toaster/types.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +1603 -1550
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +1602 -1549
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AccountInfo/AccountInfo.tsx +3 -4
- package/src/components/AccountInfo/constants.ts +1 -0
- package/src/components/Button/Button.stories.tsx +8 -4
- package/src/components/Button/Button.tsx +1 -14
- package/src/components/Button/constants.ts +9 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/types.ts +5 -0
- package/src/components/DateInput/DateInput.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +4 -22
- package/src/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/DatePickerHeader.styles.ts +1 -1
- package/src/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/DatePickerHeader.tsx +3 -3
- package/src/components/DatePicker/components/PopperContainer/PopperContainer.tsx +6 -0
- package/src/components/DatePicker/components/PopperContainer/index.ts +1 -0
- package/src/components/DatePicker/components/index.ts +2 -0
- package/src/components/DatePicker/constants.ts +5 -0
- package/src/components/DatePicker/index.ts +2 -1
- package/src/components/Description/Description.tsx +1 -2
- package/src/components/Description/constants.ts +1 -0
- package/src/components/FiltersPane/FiltersPane.stories.tsx +1 -1
- package/src/components/FiltersPane/FiltersPane.tsx +3 -4
- package/src/components/FiltersPane/{FilterWrapper/FilterWrapper.tsx → components/Filter/Filter.tsx} +8 -151
- package/src/components/FiltersPane/components/Filter/index.ts +1 -0
- package/src/components/FiltersPane/{FilterInterval → components/FilterInterval}/FilterInterval.styles.ts +2 -2
- package/src/components/FiltersPane/{FilterInterval → components/FilterInterval}/FilterInterval.tsx +7 -9
- package/src/components/FiltersPane/components/FilterInterval/index.ts +2 -0
- package/src/components/FiltersPane/{FilterMultiSelect → components/FilterMultiSelect}/FilterMultiSelect.tsx +2 -2
- package/src/components/FiltersPane/{FilterSelect → components/FilterSelect}/FilterSelect.styles.ts +2 -2
- package/src/components/FiltersPane/{FilterSelect → components/FilterSelect}/FilterSelect.tsx +11 -13
- package/src/components/FiltersPane/components/FilterSelect/index.ts +2 -0
- package/src/components/FiltersPane/{FilterValueView → components/FilterValueView}/FilterValueView.styles.tsx +1 -1
- package/src/components/FiltersPane/{FilterValueView → components/FilterValueView}/FilterValueView.tsx +8 -11
- package/src/components/FiltersPane/components/FilterValueView/index.tsx +2 -0
- package/src/components/FiltersPane/{FilterWithDates → components/FilterWithDates}/FilterWithDates.styles.ts +2 -2
- package/src/components/FiltersPane/{FilterWithDates → components/FilterWithDates}/FilterWithDates.tsx +17 -20
- package/src/components/FiltersPane/components/FilterWithDates/index.ts +2 -0
- package/src/components/FiltersPane/{FilterWithPeriod → components/FilterWithPeriod}/FilterWithPeriod.styles.ts +1 -1
- package/src/components/FiltersPane/{FilterWithPeriod → components/FilterWithPeriod}/FilterWithPeriod.tsx +12 -36
- package/src/components/FiltersPane/components/FilterWithPeriod/index.ts +2 -0
- package/src/components/FiltersPane/{FilterWrapper → components/FilterWrapper}/FilterWrapper.styles.ts +3 -3
- package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +149 -0
- package/src/components/FiltersPane/components/FilterWrapper/index.ts +2 -0
- package/src/components/FiltersPane/{FiltersPaneSearch → components/FiltersPaneSearch}/FiltersPaneSearch.styles.ts +4 -4
- package/src/components/FiltersPane/{FiltersPaneSearch → components/FiltersPaneSearch}/FiltersPaneSearch.tsx +7 -7
- package/src/components/FiltersPane/components/FiltersPaneSearch/index.ts +2 -0
- package/src/components/FiltersPane/components/index.ts +9 -0
- package/src/components/FiltersPane/constants.ts +137 -0
- package/src/components/FiltersPane/helpers.ts +26 -0
- package/src/components/FiltersPane/index.ts +1 -17
- package/src/components/FiltersPane/types.ts +52 -8
- package/src/components/FlexibleTable/FlexibleTable.stories.tsx +255 -1
- package/src/components/FlexibleTable/FlexibleTable.tsx +5 -5
- package/src/components/FlexibleTable/{TableRow.tsx → components/TableRow/TableRow.tsx} +9 -9
- package/src/components/FlexibleTable/components/TableRow/index.ts +1 -0
- package/src/components/FlexibleTable/{TableValue.tsx → components/TableValue/TableValue.tsx} +4 -5
- package/src/components/FlexibleTable/components/TableValue/index.ts +1 -0
- package/src/components/FlexibleTable/components/index.ts +2 -0
- package/src/components/FlexibleTable/constants.ts +1 -0
- package/src/components/Icon/Icon.stories.tsx +4 -3
- package/src/components/Icon/Icon.tsx +5 -10
- package/src/components/Icon/complexIcons/icons.ts +0 -2
- package/src/components/Icon/{ComplexIconBoilerplate.tsx → components/ComplexIconBoilerplate/ComplexIconBoilerplate.tsx} +5 -6
- package/src/components/Icon/components/ComplexIconBoilerplate/index.ts +1 -0
- package/src/components/Icon/{IconBoilerplate.tsx → components/IconBolerplate/IconBoilerplate.tsx} +3 -2
- package/src/components/Icon/components/IconBolerplate/index.ts +1 -0
- package/src/components/Icon/components/index.ts +2 -0
- package/src/components/Icon/helpers.ts +9 -0
- package/src/components/Icon/{icons/icons.ts → icons-list.ts} +2 -14
- package/src/components/Icon/index.ts +2 -2
- package/src/components/Icon/types.ts +16 -0
- package/src/components/IncrementInput/IncrementInput.tsx +1 -1
- package/src/components/IncrementInput/{ChangeButton.tsx → components/ChangeButton/ChangeButton.tsx} +3 -3
- package/src/components/IncrementInput/components/ChangeButton/index.ts +1 -0
- package/src/components/IncrementInput/components/index.ts +1 -0
- package/src/components/Input/Input.stories.tsx +2 -2
- package/src/components/Input/Input.tsx +3 -8
- package/src/components/Input/constants.ts +1 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Input/types.ts +6 -0
- package/src/components/List/List.stories.tsx +2 -1
- package/src/components/List/List.tsx +3 -13
- package/src/components/List/index.ts +1 -0
- package/src/components/List/types.ts +13 -0
- package/src/components/Modal/Modal.tsx +2 -18
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Modal/types.ts +17 -0
- package/src/components/MultiSelect/MultiSelect.tsx +8 -5
- package/src/components/MultiSelect/{MultiSelectInput → components/MultiSelectInput}/MultiSelectInput.styles.ts +1 -1
- package/src/components/MultiSelect/{MultiSelectInput → components/MultiSelectInput}/MultiSelectInput.tsx +3 -3
- package/src/components/MultiSelect/components/MultiSelectInput/index.ts +2 -0
- package/src/components/MultiSelect/index.ts +2 -1
- package/src/components/MultiSelect/types.ts +1 -0
- package/src/components/MultiSelectList/MultiSelectList.tsx +3 -13
- package/src/components/MultiSelectList/constants.ts +21 -0
- package/src/components/MultiSelectList/helpers.ts +11 -0
- package/src/components/MultiSelectList/index.ts +1 -0
- package/src/components/MultiSelectList/types.ts +15 -0
- package/src/components/Notification/Notification.styles.ts +1 -1
- package/src/components/Notification/Notification.tsx +1 -2
- package/src/components/Notification/index.ts +1 -0
- package/src/components/Notification/types.ts +1 -0
- package/src/components/PhoneInput/PhoneInput.stories.tsx +2 -2
- package/src/components/PhoneInput/PhoneInput.tsx +11 -12
- package/src/components/PhoneInput/{PhoneInputCountryList → components/PhoneInputCountryList}/PhoneInputCountryList.stories.tsx +1 -1
- package/src/components/PhoneInput/{PhoneInputCountryList → components/PhoneInputCountryList}/PhoneInputCountryList.styles.ts +2 -2
- package/src/components/PhoneInput/{PhoneInputCountryList → components/PhoneInputCountryList}/PhoneInputCountryList.tsx +9 -11
- package/src/components/PhoneInput/components/PhoneInputCountryList/index.ts +2 -0
- package/src/components/PhoneInput/components/index.ts +1 -0
- package/src/components/PhoneInput/constants.ts +3 -0
- package/src/components/PhoneInput/index.ts +2 -3
- package/src/components/ScrollIntoViewIfNeeded/ScrollIntoViewIfNeeded.ts +5 -12
- package/src/components/ScrollIntoViewIfNeeded/constants.ts +12 -0
- package/src/components/SearchInput/SearchInput.tsx +1 -0
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/Select/{SelectList → components/SelectList}/SelectList.styles.ts +2 -2
- package/src/components/Select/{SelectList → components/SelectList}/SelectList.tsx +6 -6
- package/src/components/Select/components/SelectList/index.ts +2 -0
- package/src/components/Select/{SelectListItem → components/SelectListItem}/SelectListItem.styles.ts +1 -1
- package/src/components/Select/{SelectListItem → components/SelectListItem}/SelectListItem.tsx +3 -3
- package/src/components/Select/components/SelectListItem/index.ts +1 -0
- package/src/components/Select/components/index.ts +2 -0
- package/src/components/Select/index.ts +2 -2
- package/src/components/SmartInput/SmartInput.stories.tsx +2 -1
- package/src/components/SmartInput/SmartInput.tsx +6 -29
- package/src/components/SmartInput/constants.ts +84 -0
- package/src/components/SmartInput/helpers.ts +1 -73
- package/src/components/SmartInput/index.ts +1 -0
- package/src/components/SmartInput/types.ts +11 -0
- package/src/components/Switch/Switch.tsx +1 -5
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Switch/types.ts +4 -0
- package/src/components/TextArea/TextArea.tsx +21 -12
- package/src/components/TextWithTooltip/TextWithTooltip.tsx +2 -2
- package/src/components/ThemedPreloader/ThemedPreloader.tsx +2 -5
- package/src/components/ThemedPreloader/components/SvgPreloader/SvgPreloader.tsx +1 -1
- package/src/components/ThemedPreloader/components/index.ts +3 -2
- package/src/components/ThemedPreloader/constants.ts +1 -0
- package/src/components/ThemedPreloader/index.ts +2 -0
- package/src/components/ThemedPreloader/types.ts +3 -0
- package/src/components/Toaster/Toaster.tsx +2 -4
- package/src/components/Toaster/constants.ts +1 -0
- package/src/components/Toaster/index.ts +1 -0
- package/src/components/Toaster/types.ts +1 -0
- package/src/components/Tooltip/index.ts +1 -1
- package/src/types.ts +1 -0
- package/dist/components/FiltersPane/FilterInterval/index.d.ts +0 -1
- package/dist/components/FiltersPane/FilterSelect/index.d.ts +0 -1
- package/dist/components/FiltersPane/FilterSelect/locales.d.ts +0 -11
- package/dist/components/FiltersPane/FilterValueView/index.d.ts +0 -1
- package/dist/components/FiltersPane/FilterWithDates/index.d.ts +0 -1
- package/dist/components/FiltersPane/FilterWithPeriod/index.d.ts +0 -1
- package/dist/components/FiltersPane/FilterWrapper/FilterWrapper.d.ts +0 -27
- package/dist/components/FiltersPane/FilterWrapper/index.d.ts +0 -1
- package/dist/components/FiltersPane/FiltersPaneSearch/index.d.ts +0 -1
- package/dist/components/FiltersPane/locales.d.ts +0 -28
- package/dist/components/Icon/ComplexIconBoilerplate.d.ts +0 -7
- package/dist/components/Icon/icons/icons.d.ts +0 -9
- package/dist/components/Icon/icons/index.d.ts +0 -1
- package/dist/components/MultiSelectList/locales.d.ts +0 -11
- package/dist/components/PhoneInput/PhoneInputCountryList/index.d.ts +0 -2
- package/dist/components/Select/SelectList/index.d.ts +0 -1
- package/src/components/FiltersPane/FilterInterval/index.ts +0 -1
- package/src/components/FiltersPane/FilterSelect/index.ts +0 -1
- package/src/components/FiltersPane/FilterSelect/locales.ts +0 -37
- package/src/components/FiltersPane/FilterValueView/index.tsx +0 -1
- package/src/components/FiltersPane/FilterWithDates/index.ts +0 -1
- package/src/components/FiltersPane/FilterWithPeriod/index.ts +0 -1
- package/src/components/FiltersPane/FilterWrapper/index.ts +0 -1
- package/src/components/FiltersPane/FiltersPaneSearch/index.ts +0 -1
- package/src/components/FiltersPane/locales.ts +0 -107
- package/src/components/FlexibleTable/fixture-test.ts +0 -254
- package/src/components/Icon/icons/index.ts +0 -1
- package/src/components/MultiSelectList/locales.ts +0 -37
- package/src/components/PhoneInput/PhoneInputCountryList/index.ts +0 -2
- package/src/components/Select/SelectList/index.ts +0 -1
- /package/dist/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/DatePickerHeader.d.ts +0 -0
- /package/dist/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/index.d.ts +0 -0
- /package/dist/components/FiltersPane/{FilterMultiSelect → components/FilterMultiSelect}/index.d.ts +0 -0
- /package/dist/components/FiltersPane/{FilterValueView → components/FilterValueView}/FilterValueView.d.ts +0 -0
- /package/dist/components/MultiSelect/{MultiSelectInput → components}/index.d.ts +0 -0
- /package/dist/components/Select/{SelectListItem → components/SelectListItem}/SelectListItem.d.ts +0 -0
- /package/src/components/DatePicker/{DatePickerHeader → components/DatePickerHeader}/index.ts +0 -0
- /package/src/components/FiltersPane/{FilterMultiSelect → components/FilterMultiSelect}/index.ts +0 -0
- /package/src/components/MultiSelect/{MultiSelectInput → components}/index.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, Fragment
|
|
1
|
+
import { FC, Fragment } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import {
|
|
4
4
|
addDataTestId,
|
|
@@ -8,20 +8,10 @@ import {
|
|
|
8
8
|
import { addDataAttributes } from '../../helpers';
|
|
9
9
|
import { renderIcon } from '../../helpers/snippets';
|
|
10
10
|
import { useTheme } from '../../hooks';
|
|
11
|
-
import { ICommonProps
|
|
11
|
+
import { ICommonProps } from '../../types';
|
|
12
|
+
import { IListItem } from './types';
|
|
12
13
|
import { ListStyles, styles } from './List.styles';
|
|
13
14
|
|
|
14
|
-
export interface IListItem {
|
|
15
|
-
item: ReactNode;
|
|
16
|
-
icon?: IIcon;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
shouldDrawSpacerAbove?: boolean;
|
|
19
|
-
shouldDrawSpacerBelow?: boolean;
|
|
20
|
-
withIconGap?: boolean;
|
|
21
|
-
testId?: string;
|
|
22
|
-
onClick(): void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
export interface IListProps extends ICommonProps {
|
|
26
16
|
tweakStyles?: ListStyles;
|
|
27
17
|
items: IListItem[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { IIcon } from '../../types';
|
|
3
|
+
|
|
4
|
+
export interface IListItem {
|
|
5
|
+
item: ReactNode;
|
|
6
|
+
icon?: IIcon;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
shouldDrawSpacerAbove?: boolean;
|
|
9
|
+
shouldDrawSpacerBelow?: boolean;
|
|
10
|
+
withIconGap?: boolean;
|
|
11
|
+
testId?: string;
|
|
12
|
+
onClick(): void;
|
|
13
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC, ReactNode, MouseEvent, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { RemoveScroll } from 'react-remove-scroll';
|
|
3
3
|
import { CSSTransition } from 'react-transition-group';
|
|
4
|
-
import { TransitionProps } from 'react-transition-group/Transition';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import {
|
|
7
6
|
addDataTestId,
|
|
@@ -12,24 +11,9 @@ import { addDataAttributes } from '../../helpers';
|
|
|
12
11
|
import { useTheme, useTweakStyles } from '../../hooks';
|
|
13
12
|
import { ICommonProps } from '../../types';
|
|
14
13
|
import { CloseButton } from '../CloseButton';
|
|
14
|
+
import { IModalPosition, IModalTransitionProps } from './types';
|
|
15
15
|
import { ModalStyles, styles } from './Modal.styles';
|
|
16
16
|
|
|
17
|
-
export type IModalPosition = 'center' | 'left' | 'right' | 'static';
|
|
18
|
-
|
|
19
|
-
export type IModalTransitionProps = Pick<
|
|
20
|
-
TransitionProps<HTMLDivElement>,
|
|
21
|
-
| 'in' // Аналог isOpen, но это свойство нужно для корректной отрисовки Modal внутри TransitionGroup
|
|
22
|
-
| 'mountOnEnter'
|
|
23
|
-
| 'unmountOnExit'
|
|
24
|
-
| 'timeout'
|
|
25
|
-
| 'onEnter'
|
|
26
|
-
| 'onEntering'
|
|
27
|
-
| 'onEntered'
|
|
28
|
-
| 'onExit'
|
|
29
|
-
| 'onExiting'
|
|
30
|
-
| 'onExited'
|
|
31
|
-
>;
|
|
32
|
-
|
|
33
17
|
export interface IModalProps extends ICommonProps, IModalTransitionProps {
|
|
34
18
|
tweakStyles?: ModalStyles;
|
|
35
19
|
title?: ReactNode;
|
|
@@ -73,7 +57,7 @@ export const Modal: FC<IModalProps> = ({
|
|
|
73
57
|
onClose,
|
|
74
58
|
...restProps
|
|
75
59
|
}) => {
|
|
76
|
-
const isModalOpen =
|
|
60
|
+
const isModalOpen = restProps.in ?? isOpen;
|
|
77
61
|
const { classes, componentStyles } = useTheme('Modal', styles, tweakStyles);
|
|
78
62
|
|
|
79
63
|
const tweakCloseButtonStyles = useTweakStyles(componentStyles, tweakStyles, 'tweakCloseButton');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TransitionProps } from 'react-transition-group/Transition';
|
|
2
|
+
|
|
3
|
+
export type IModalPosition = 'center' | 'left' | 'right' | 'static';
|
|
4
|
+
|
|
5
|
+
export type IModalTransitionProps = Pick<
|
|
6
|
+
TransitionProps<HTMLDivElement>,
|
|
7
|
+
| 'in' // Аналог isOpen, но это свойство нужно для корректной отрисовки Modal внутри TransitionGroup
|
|
8
|
+
| 'mountOnEnter'
|
|
9
|
+
| 'unmountOnExit'
|
|
10
|
+
| 'timeout'
|
|
11
|
+
| 'onEnter'
|
|
12
|
+
| 'onEntering'
|
|
13
|
+
| 'onEntered'
|
|
14
|
+
| 'onExit'
|
|
15
|
+
| 'onExiting'
|
|
16
|
+
| 'onExited'
|
|
17
|
+
>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useOnClickOutside, useTheme, useTweakStyles } from '../../hooks';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
MultiSelectList,
|
|
6
|
+
IMultiSelectListValues,
|
|
7
|
+
IMultiSelectLocale,
|
|
8
|
+
IMultiSelectLocaleKey,
|
|
9
|
+
} from '../MultiSelectList';
|
|
10
|
+
import { MultiSelectInput } from './components';
|
|
11
|
+
import { THorizontalCornerConnection } from './types';
|
|
6
12
|
import { styles, MultiSelectStyles } from './MultiSelect.styles';
|
|
7
|
-
import { MultiSelectInput } from './MultiSelectInput';
|
|
8
|
-
|
|
9
|
-
export type THorizontalCornerConnection = 'full' | 'left' | 'right';
|
|
10
13
|
|
|
11
14
|
export interface IMultiSelectProps<Value = string> {
|
|
12
15
|
tweakStyles?: MultiSelectStyles;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useTheme } from '
|
|
4
|
-
import { ICommonProps } from '
|
|
5
|
-
import { Icon, IMultiSelectListValues } from '
|
|
3
|
+
import { useTheme } from '../../../../hooks';
|
|
4
|
+
import { ICommonProps } from '../../../../types';
|
|
5
|
+
import { Icon, IMultiSelectListValues } from '../../../index';
|
|
6
6
|
import { styles } from './MultiSelectInput.styles';
|
|
7
7
|
|
|
8
8
|
export interface IMultiSelectInputProps<Value> extends ICommonProps {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './MultiSelect';
|
|
2
|
+
export * from './types';
|
|
2
3
|
export type { MultiSelectStyles } from './MultiSelect.styles';
|
|
3
|
-
export type { MultiSelectInputStyles } from './
|
|
4
|
+
export type { MultiSelectInputStyles } from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type THorizontalCornerConnection = 'full' | 'left' | 'right';
|
|
@@ -8,18 +8,10 @@ import { Button } from '../Button';
|
|
|
8
8
|
import { Checkbox, ICheckboxProps } from '../Checkbox';
|
|
9
9
|
import { SearchInput } from '../SearchInput';
|
|
10
10
|
import { ThemedPreloader } from '../ThemedPreloader';
|
|
11
|
+
import { DEFAULT_LOCALE, MultiSelectLocales } from './constants';
|
|
12
|
+
import { defaultConvertFunction, getLocale } from './helpers';
|
|
13
|
+
import { IMultiSelectListValues, IMultiSelectLocale, IMultiSelectLocaleKey } from './types';
|
|
11
14
|
import { MultiSelectListStyles, styles } from './MultiSelectList.styles';
|
|
12
|
-
import {
|
|
13
|
-
DEFAULT_LOCALE,
|
|
14
|
-
getLocale,
|
|
15
|
-
IMultiSelectLocale,
|
|
16
|
-
IMultiSelectLocaleKey,
|
|
17
|
-
MultiSelectLocales,
|
|
18
|
-
} from './locales';
|
|
19
|
-
|
|
20
|
-
export interface IMultiSelectListValues<Option> {
|
|
21
|
-
include: Option[];
|
|
22
|
-
}
|
|
23
15
|
|
|
24
16
|
export interface IMultiSelectListProps<Value, Option> extends ICommonProps {
|
|
25
17
|
tweakStyles?: MultiSelectListStyles;
|
|
@@ -42,8 +34,6 @@ export interface IMultiSelectListProps<Value, Option> extends ICommonProps {
|
|
|
42
34
|
testId?: string;
|
|
43
35
|
}
|
|
44
36
|
|
|
45
|
-
const defaultConvertFunction = (val: unknown) => String(val);
|
|
46
|
-
|
|
47
37
|
export function MultiSelectList<Value extends IMultiSelectListValues<Option>, Option = string>({
|
|
48
38
|
value,
|
|
49
39
|
tweakStyles,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IMultiSelectLocale, IMultiSelectLocaleKey } from './types';
|
|
2
|
+
|
|
3
|
+
export const MultiSelectLocales: Record<string, IMultiSelectLocale> = {
|
|
4
|
+
ru: {
|
|
5
|
+
clear: 'Очистить',
|
|
6
|
+
all: 'Все',
|
|
7
|
+
chosen: 'Выбранные',
|
|
8
|
+
nothingFound: 'Не найдено',
|
|
9
|
+
searchPlaceholder: 'Поиск',
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
en: {
|
|
13
|
+
clear: 'Clear',
|
|
14
|
+
all: 'All',
|
|
15
|
+
chosen: 'Chosen',
|
|
16
|
+
nothingFound: 'Nothing found',
|
|
17
|
+
searchPlaceholder: 'Search',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const DEFAULT_LOCALE: IMultiSelectLocaleKey = 'en';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import merge from 'lodash-es/merge';
|
|
2
|
+
import { DEFAULT_LOCALE, MultiSelectLocales } from './constants';
|
|
3
|
+
import type { IMultiSelectLocale, IMultiSelectLocaleKey } from './types';
|
|
4
|
+
|
|
5
|
+
export const defaultConvertFunction = (val: unknown) => String(val);
|
|
6
|
+
|
|
7
|
+
export const getLocale = (
|
|
8
|
+
key: IMultiSelectLocaleKey = DEFAULT_LOCALE,
|
|
9
|
+
custom?: Partial<IMultiSelectLocale>,
|
|
10
|
+
custom2?: Partial<IMultiSelectLocale>,
|
|
11
|
+
): IMultiSelectLocale => merge({}, MultiSelectLocales[key], custom, custom2);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MultiSelectLocales } from './constants';
|
|
2
|
+
|
|
3
|
+
export interface IMultiSelectListValues<Option> {
|
|
4
|
+
include: Option[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IMultiSelectLocale {
|
|
8
|
+
clear: string;
|
|
9
|
+
all: string;
|
|
10
|
+
chosen: string;
|
|
11
|
+
searchPlaceholder: string;
|
|
12
|
+
nothingFound: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type IMultiSelectLocaleKey = keyof typeof MultiSelectLocales;
|
|
@@ -9,10 +9,9 @@ import { addDataAttributes } from '../../helpers';
|
|
|
9
9
|
import { useTheme } from '../../hooks';
|
|
10
10
|
import { ICommonProps } from '../../types';
|
|
11
11
|
import { Icon } from '../Icon';
|
|
12
|
+
import { NotificationType } from './types';
|
|
12
13
|
import { NotificationStyles, styles } from './Notification.styles';
|
|
13
14
|
|
|
14
|
-
export type NotificationType = 'error' | 'info' | 'warning' | 'ok' | 'not-ok';
|
|
15
|
-
|
|
16
15
|
export interface INotificationProps extends ICommonProps {
|
|
17
16
|
tweakStyles?: NotificationStyles;
|
|
18
17
|
type: NotificationType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type NotificationType = 'error' | 'info' | 'warning' | 'ok' | 'not-ok';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { ComponentStory } from '@storybook/react';
|
|
3
|
-
import {
|
|
3
|
+
import { iconsList } from '../Icon';
|
|
4
4
|
import { PhoneInput } from './PhoneInput';
|
|
5
5
|
import { phoneInfo } from './phone-info';
|
|
6
6
|
import { IPhoneValue } from './types';
|
|
7
7
|
|
|
8
|
-
const iconTypes = [undefined, ...Object.keys(
|
|
8
|
+
const iconTypes = [undefined, ...Object.keys(iconsList)];
|
|
9
9
|
const inlineStyles = [undefined, 'left', 'right', 'middle'];
|
|
10
10
|
const borders = [undefined, 'left', 'top', 'right', 'bottom'];
|
|
11
11
|
const errorPositions = ['bottom', 'top'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, useState, useRef, useMemo } from 'react';
|
|
1
|
+
import { FC, useState, useRef, useMemo, MouseEvent, FocusEvent, FormEvent } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import {
|
|
4
4
|
getCountryCodeFromPhone,
|
|
@@ -11,9 +11,10 @@ import { useOnClickOutsideWithRef, useTheme, useTweakStyles } from '../../hooks'
|
|
|
11
11
|
import { Flag } from '../Flag';
|
|
12
12
|
import { Icon } from '../Icon';
|
|
13
13
|
import { IInputProps, Input } from '../Input';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { PhoneInputCountryList } from './components';
|
|
15
|
+
import { DEFAULT_VALUE } from './constants';
|
|
16
16
|
import { IPhoneInfo, IPhoneValue } from './types';
|
|
17
|
+
import { PhoneInputStyles, styles } from './PhoneInput.styles';
|
|
17
18
|
|
|
18
19
|
export interface IPhoneInputProps
|
|
19
20
|
extends Omit<IInputProps, 'value' | 'onChange' | 'type' | 'mask' | 'units' | 'placeholder'> {
|
|
@@ -22,14 +23,12 @@ export interface IPhoneInputProps
|
|
|
22
23
|
codeSearchPlaceholder?: string;
|
|
23
24
|
noMatchesLabel?: string;
|
|
24
25
|
value?: IPhoneValue;
|
|
25
|
-
onChange
|
|
26
|
+
onChange(
|
|
26
27
|
phone: IPhoneValue,
|
|
27
|
-
event:
|
|
28
|
-
)
|
|
28
|
+
event: MouseEvent | KeyboardEvent | FormEvent<HTMLInputElement>,
|
|
29
|
+
): void;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const DEFAULT_VALUE: IPhoneValue = { phoneNumber: '', dialCode: '' };
|
|
32
|
-
|
|
33
32
|
export const PhoneInput: FC<IPhoneInputProps> = ({
|
|
34
33
|
locale = 'ru',
|
|
35
34
|
value = DEFAULT_VALUE,
|
|
@@ -62,7 +61,7 @@ export const PhoneInput: FC<IPhoneInputProps> = ({
|
|
|
62
61
|
setIsListOpen(false);
|
|
63
62
|
};
|
|
64
63
|
|
|
65
|
-
const handleChange = (inputValue: string, event:
|
|
64
|
+
const handleChange = (inputValue: string, event: FormEvent<HTMLInputElement>) => {
|
|
66
65
|
// if (event.type === 'change') - нужно из-за InputMask
|
|
67
66
|
// Помимо change, еще могут приходить focus и blur, когда input пустой и тогда происходят неприятные сайд-эффекты
|
|
68
67
|
if (event.type === 'change') {
|
|
@@ -97,7 +96,7 @@ export const PhoneInput: FC<IPhoneInputProps> = ({
|
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
98
|
|
|
100
|
-
const handleSelect = (newPhoneInfo: IPhoneInfo, event:
|
|
99
|
+
const handleSelect = (newPhoneInfo: IPhoneInfo, event: MouseEvent | KeyboardEvent) => {
|
|
101
100
|
if (newPhoneInfo.countryCode !== countryCode) {
|
|
102
101
|
onChange(
|
|
103
102
|
{
|
|
@@ -116,14 +115,14 @@ export const PhoneInput: FC<IPhoneInputProps> = ({
|
|
|
116
115
|
}
|
|
117
116
|
};
|
|
118
117
|
|
|
119
|
-
const handleFocus = (event:
|
|
118
|
+
const handleFocus = (event: FocusEvent<HTMLInputElement>) => {
|
|
120
119
|
setFocused(true);
|
|
121
120
|
if (inputProps.onFocus !== undefined) {
|
|
122
121
|
inputProps?.onFocus(event);
|
|
123
122
|
}
|
|
124
123
|
};
|
|
125
124
|
|
|
126
|
-
const handleBlur = (event:
|
|
125
|
+
const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
|
|
127
126
|
setFocused(false);
|
|
128
127
|
if (inputProps.onBlur !== undefined) {
|
|
129
128
|
inputProps?.onBlur(event);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colors, dimensions, helpers } from '
|
|
2
|
-
import { ComponentStyles } from '
|
|
1
|
+
import { colors, dimensions, helpers } from '../../../../theme';
|
|
2
|
+
import { ComponentStyles } from '../../../../types';
|
|
3
3
|
|
|
4
4
|
const ROW_HEIGHT = 40;
|
|
5
5
|
const LIST_PADDING = 10;
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
getCountryTextByLocale,
|
|
6
6
|
findCountryIndexByCode,
|
|
7
7
|
sortCountriesByLocale,
|
|
8
|
-
} from '
|
|
9
|
-
import { useTheme, useTweakStyles } from '
|
|
10
|
-
import { ICommonProps } from '
|
|
11
|
-
import { Flag } from '
|
|
12
|
-
import { Icon } from '
|
|
13
|
-
import { Input } from '
|
|
14
|
-
import { ScrollIntoViewIfNeeded } from '
|
|
15
|
-
import { phoneInfo } from '
|
|
16
|
-
import { IPhoneInfo } from '
|
|
8
|
+
} from '../../../../helpers';
|
|
9
|
+
import { useTheme, useTweakStyles } from '../../../../hooks';
|
|
10
|
+
import { ICommonProps } from '../../../../types';
|
|
11
|
+
import { Flag } from '../../../Flag';
|
|
12
|
+
import { Icon } from '../../../Icon';
|
|
13
|
+
import { Input } from '../../../Input';
|
|
14
|
+
import { ScrollIntoViewIfNeeded } from '../../../ScrollIntoViewIfNeeded';
|
|
15
|
+
import { phoneInfo } from '../../phone-info';
|
|
16
|
+
import { IPhoneInfo } from '../../types';
|
|
17
17
|
import { PhoneInputCountryListStyles, styles } from './PhoneInputCountryList.styles';
|
|
18
18
|
|
|
19
19
|
export interface IPhoneInputCountryListProps extends ICommonProps {
|
|
@@ -143,5 +143,3 @@ export const PhoneInputCountryList: FC<IPhoneInputCountryListProps> = ({
|
|
|
143
143
|
</div>
|
|
144
144
|
);
|
|
145
145
|
};
|
|
146
|
-
|
|
147
|
-
export default PhoneInputCountryList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PhoneInputCountryList';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from './PhoneInput';
|
|
2
|
-
export type { PhoneInputStyles } from './PhoneInput.styles';
|
|
3
|
-
export type { PhoneInputCountryListStyles } from './PhoneInputCountryList/PhoneInputCountryList.styles';
|
|
4
|
-
|
|
5
2
|
export { phoneInfo } from './phone-info';
|
|
6
3
|
export * from './types';
|
|
4
|
+
export type { PhoneInputStyles } from './PhoneInput.styles';
|
|
5
|
+
export type { PhoneInputCountryListStyles } from './components';
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { createElement, createRef, HTMLProps, PureComponent, ReactNode, RefObject } from 'react';
|
|
2
2
|
import scrollIntoViewIfNeeded, { StandardBehaviorOptions } from 'scroll-into-view-if-needed';
|
|
3
|
+
import {
|
|
4
|
+
ScrollIntoViewIfNeededDefaultElementType,
|
|
5
|
+
ScrollIntoViewIfNeededDefaultProps,
|
|
6
|
+
} from './constants';
|
|
3
7
|
|
|
4
|
-
interface IScrollIntoViewIfNeededProps extends HTMLProps<HTMLElement> {
|
|
8
|
+
export interface IScrollIntoViewIfNeededProps extends HTMLProps<HTMLElement> {
|
|
5
9
|
active?: boolean;
|
|
6
10
|
children?: ReactNode;
|
|
7
11
|
elementType?: string;
|
|
8
12
|
options?: StandardBehaviorOptions;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
const ScrollIntoViewIfNeededDefaultElementType = 'div';
|
|
12
|
-
|
|
13
|
-
const ScrollIntoViewIfNeededDefaultProps: IScrollIntoViewIfNeededProps = {
|
|
14
|
-
active: true,
|
|
15
|
-
elementType: ScrollIntoViewIfNeededDefaultElementType,
|
|
16
|
-
options: {
|
|
17
|
-
behavior: 'smooth',
|
|
18
|
-
scrollMode: 'if-needed',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
15
|
export class ScrollIntoViewIfNeeded extends PureComponent<IScrollIntoViewIfNeededProps> {
|
|
23
16
|
node: RefObject<HTMLElement> = createRef();
|
|
24
17
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IScrollIntoViewIfNeededProps } from './ScrollIntoViewIfNeeded';
|
|
2
|
+
|
|
3
|
+
export const ScrollIntoViewIfNeededDefaultElementType = 'div';
|
|
4
|
+
|
|
5
|
+
export const ScrollIntoViewIfNeededDefaultProps: IScrollIntoViewIfNeededProps = {
|
|
6
|
+
active: true,
|
|
7
|
+
elementType: ScrollIntoViewIfNeededDefaultElementType,
|
|
8
|
+
options: {
|
|
9
|
+
behavior: 'smooth',
|
|
10
|
+
scrollMode: 'if-needed',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -33,8 +33,7 @@ import {
|
|
|
33
33
|
import { IDropdownWithPopperOptions, IIcon } from '../../types';
|
|
34
34
|
import { IInputProps, Input } from '../Input';
|
|
35
35
|
import { ISearchInputProps, SearchInput } from '../SearchInput';
|
|
36
|
-
import {
|
|
37
|
-
import { SelectList } from './SelectList';
|
|
36
|
+
import { SelectList } from './components';
|
|
38
37
|
import { ALL_OPTION_INDEX, DEFAULT_OPTION_INDEX } from './constants';
|
|
39
38
|
import {
|
|
40
39
|
defaultConvertFunction,
|
|
@@ -44,6 +43,7 @@ import {
|
|
|
44
43
|
isMultiSelectValue,
|
|
45
44
|
} from './helpers';
|
|
46
45
|
import { IMultipleSelectValue } from './types';
|
|
46
|
+
import { SelectStyles, styles } from './Select.styles';
|
|
47
47
|
|
|
48
48
|
export interface ISelectProps<Value>
|
|
49
49
|
extends Omit<IInputProps, 'value' | 'onChange' | 'onBlur' | 'type'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colors, dimensions, helpers } from '
|
|
2
|
-
import { ComponentStyles } from '
|
|
1
|
+
import { colors, dimensions, helpers } from '../../../../theme';
|
|
2
|
+
import { ComponentStyles } from '../../../../types';
|
|
3
3
|
|
|
4
4
|
export const ROW_HEIGHT = 40;
|
|
5
5
|
export const CONTAINER_PADDING = 10;
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
isReactNodeNotEmpty,
|
|
6
6
|
isStringNotEmpty,
|
|
7
7
|
} from '@true-engineering/true-react-platform-helpers';
|
|
8
|
-
import { useTheme } from '
|
|
9
|
-
import { ICommonProps } from '
|
|
10
|
-
import { ScrollIntoViewIfNeeded } from '
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { useTheme } from '../../../../hooks';
|
|
9
|
+
import { ICommonProps } from '../../../../types';
|
|
10
|
+
import { ScrollIntoViewIfNeeded } from '../../../ScrollIntoViewIfNeeded';
|
|
11
|
+
import { ALL_OPTION_INDEX, DEFAULT_OPTION_INDEX } from '../../constants';
|
|
12
|
+
import { IMultipleSelectValue } from '../../types';
|
|
13
|
+
import { SelectListItem } from '../SelectListItem';
|
|
14
14
|
import { SelectListStyles, styles } from './SelectList.styles';
|
|
15
15
|
|
|
16
16
|
export interface ISelectListProps<Value> extends ICommonProps {
|
package/src/components/Select/{SelectListItem → components/SelectListItem}/SelectListItem.tsx
RENAMED
|
@@ -2,9 +2,9 @@ import { ReactNode, MouseEvent, FC } from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Classes } from 'jss';
|
|
4
4
|
import { isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
5
|
-
import { addDataAttributes } from '
|
|
6
|
-
import { Checkbox } from '
|
|
7
|
-
import { ScrollIntoViewIfNeeded } from '
|
|
5
|
+
import { addDataAttributes } from '../../../../helpers';
|
|
6
|
+
import { Checkbox } from '../../../Checkbox';
|
|
7
|
+
import { ScrollIntoViewIfNeeded } from '../../../ScrollIntoViewIfNeeded';
|
|
8
8
|
import { checkboxStyles } from './SelectListItem.styles';
|
|
9
9
|
|
|
10
10
|
export interface ISelectListItemProps {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SelectListItem';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './Select';
|
|
2
|
-
export
|
|
2
|
+
export * from './types';
|
|
3
3
|
export type { SelectStyles } from './Select.styles';
|
|
4
|
-
export type { SelectListStyles } from './
|
|
4
|
+
export type { SelectListStyles } from './components';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { ComponentStory } from '@storybook/react';
|
|
3
3
|
import { IInputProps } from '../Input';
|
|
4
|
-
import { SmartInput
|
|
4
|
+
import { SmartInput } from './SmartInput';
|
|
5
|
+
import { TSmartType } from './types';
|
|
5
6
|
|
|
6
7
|
const types: Array<IInputProps['type']> = ['text', 'password', 'email', 'number'];
|
|
7
8
|
const smartTypes: TSmartType[] = ['default', 'agencyName', 'surname', 'name', 'email'];
|