@true-engineering/true-react-common-ui-kit 4.0.0-alpha54 → 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.
Files changed (151) hide show
  1. package/README.md +1 -0
  2. package/dist/components/AddButton/AddButton.d.ts +1 -0
  3. package/dist/components/AddButton/AddButton.styles.d.ts +1 -1
  4. package/dist/components/Button/Button.styles.d.ts +1 -1
  5. package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -1
  6. package/dist/components/ControlWrapper/ControlWrapper.d.ts +1 -1
  7. package/dist/components/ControlWrapper/ControlWrapper.styles.d.ts +1 -1
  8. package/dist/components/CssBaseline/CssBaseline.styles.d.ts +1 -1
  9. package/dist/components/DatePicker/components/DatePickerHeader/DatePickerHeader.styles.d.ts +1 -1
  10. package/dist/components/Description/Description.styles.d.ts +1 -1
  11. package/dist/components/FileInput/FileInput.styles.d.ts +1 -1
  12. package/dist/components/FileItem/FileItem.styles.d.ts +1 -1
  13. package/dist/components/FiltersPane/components/FilterInterval/FilterInterval.styles.d.ts +1 -1
  14. package/dist/components/FiltersPane/components/FilterSelect/FilterSelect.styles.d.ts +2 -2
  15. package/dist/components/FiltersPane/components/FilterWithDates/FilterWithDates.styles.d.ts +2 -2
  16. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.d.ts +1 -1
  17. package/dist/components/FiltersPane/components/FilterWrapper/FilterWrapper.styles.d.ts +1 -1
  18. package/dist/components/FiltersPane/components/FiltersPaneSearch/FiltersPaneSearch.styles.d.ts +1 -1
  19. package/dist/components/FiltersPane/types.d.ts +2 -1
  20. package/dist/components/FlexibleTable/FlexibleTable.styles.d.ts +1 -1
  21. package/dist/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.d.ts +1 -1
  22. package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +1 -3
  23. package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.d.ts +1 -1
  24. package/dist/components/FloatDocActions/components/DocActions/DocActions.styles.d.ts +1 -1
  25. package/dist/components/IconButton/IconButton.styles.d.ts +1 -1
  26. package/dist/components/List/components/ListItem/ListItem.styles.d.ts +1 -1
  27. package/dist/components/Modal/Modal.styles.d.ts +1 -1
  28. package/dist/components/MoreMenu/MoreMenu.styles.d.ts +1 -1
  29. package/dist/components/MultiSelect/MultiSelect.styles.d.ts +1 -1
  30. package/dist/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.styles.d.ts +1 -1
  31. package/dist/components/MultiSelectList/MultiSelectList.styles.d.ts +1 -1
  32. package/dist/components/NewMoreMenu/NewMoreMenu.styles.d.ts +1 -1
  33. package/dist/components/Notification/Notification.styles.d.ts +1 -1
  34. package/dist/components/PhoneInput/PhoneInput.styles.d.ts +1 -1
  35. package/dist/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.styles.d.ts +1 -1
  36. package/dist/components/RadioButton/RadioButton.styles.d.ts +1 -1
  37. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  38. package/dist/components/Select/Select.styles.d.ts +3 -3
  39. package/dist/components/Select/components/SelectList/SelectList.styles.d.ts +1 -1
  40. package/dist/components/Selector/Selector.styles.d.ts +1 -1
  41. package/dist/components/Status/Status.styles.d.ts +1 -1
  42. package/dist/components/Switch/Switch.d.ts +3 -2
  43. package/dist/components/Switch/Switch.styles.d.ts +3 -2
  44. package/dist/components/Switch/types.d.ts +3 -0
  45. package/dist/components/TextArea/TextArea.styles.d.ts +1 -1
  46. package/dist/components/TextButton/TextButton.styles.d.ts +1 -1
  47. package/dist/components/TextWithInfo/TextWithInfo.styles.d.ts +1 -1
  48. package/dist/components/TextWithTooltip/TextWithTooltip.d.ts +2 -0
  49. package/dist/components/TextWithTooltip/TextWithTooltip.styles.d.ts +1 -1
  50. package/dist/components/ThemedPreloader/ThemedPreloader.styles.d.ts +1 -1
  51. package/dist/components/ThemedPreloader/components/DotsPreloader/DotsPreloader.styles.d.ts +1 -1
  52. package/dist/components/Toaster/Toaster.styles.d.ts +1 -1
  53. package/dist/components/Tooltip/Tooltip.d.ts +3 -0
  54. package/dist/components/Tooltip/Tooltip.styles.d.ts +2 -1
  55. package/dist/components/Tooltip/types.d.ts +3 -0
  56. package/dist/components/WithMessages/WithMessages.styles.d.ts +1 -1
  57. package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
  58. package/dist/components/WithTooltip/WithTooltip.d.ts +2 -0
  59. package/dist/helpers/misc.d.ts +2 -0
  60. package/dist/hooks/index.d.ts +1 -0
  61. package/dist/hooks/use-intersection-ref.d.ts +2 -1
  62. package/dist/hooks/use-resize-ref.d.ts +7 -0
  63. package/dist/hooks/use-tweak-styles.d.ts +3 -2
  64. package/dist/theme/Provider.d.ts +2 -12
  65. package/dist/theme/common.d.ts +34 -4
  66. package/dist/theme/helpers.d.ts +3 -16
  67. package/dist/theme/index.d.ts +0 -2
  68. package/dist/theme/types.d.ts +9 -8
  69. package/dist/true-react-common-ui-kit.js +12132 -10
  70. package/dist/true-react-common-ui-kit.js.map +1 -1
  71. package/dist/true-react-common-ui-kit.umd.cjs +2 -10
  72. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  73. package/dist/types.d.ts +3 -3
  74. package/package.json +1 -3
  75. package/src/components/AccountInfo/AccountInfo.tsx +2 -3
  76. package/src/components/AddButton/AddButton.tsx +3 -5
  77. package/src/components/Button/Button.tsx +76 -77
  78. package/src/components/CloseButton/CloseButton.tsx +2 -4
  79. package/src/components/Colors/Colors.stories.tsx +3 -2
  80. package/src/components/ControlWrapper/ControlWrapper.tsx +2 -2
  81. package/src/components/CssBaseline/CssBaseline.styles.ts +2 -0
  82. package/src/components/CssBaseline/CssBaseline.tsx +2 -3
  83. package/src/components/DateInput/DateInput.tsx +59 -61
  84. package/src/components/DatePicker/DatePicker.tsx +259 -262
  85. package/src/components/Description/Description.tsx +2 -3
  86. package/src/components/FileInput/FileInput.tsx +87 -95
  87. package/src/components/FileItem/FileItem.tsx +2 -4
  88. package/src/components/FiltersPane/FiltersPane.stories.tsx +3 -0
  89. package/src/components/FiltersPane/components/FilterInterval/FilterInterval.tsx +2 -3
  90. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +6 -3
  91. package/src/components/FiltersPane/components/FilterWrapper/FilterWrapper.tsx +3 -2
  92. package/src/components/FiltersPane/types.ts +2 -0
  93. package/src/components/FlexibleTable/FlexibleTable.styles.ts +1 -0
  94. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +1 -0
  95. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.tsx +5 -2
  96. package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +9 -7
  97. package/src/components/IconButton/IconButton.tsx +44 -48
  98. package/src/components/Input/Input.tsx +26 -24
  99. package/src/components/Input/InputBase.tsx +183 -187
  100. package/src/components/List/List.tsx +2 -3
  101. package/src/components/List/components/ListItem/ListItem.tsx +2 -4
  102. package/src/components/Modal/Modal.tsx +2 -4
  103. package/src/components/MoreMenu/MoreMenu.tsx +2 -4
  104. package/src/components/MultiSelect/MultiSelect.tsx +2 -4
  105. package/src/components/NewMoreMenu/NewMoreMenu.tsx +2 -4
  106. package/src/components/Notification/Notification.tsx +2 -3
  107. package/src/components/NumberInput/NumberInput.tsx +91 -93
  108. package/src/components/PhoneInput/PhoneInput.tsx +2 -3
  109. package/src/components/SearchInput/SearchInput.tsx +20 -19
  110. package/src/components/Select/Select.tsx +1 -1
  111. package/src/components/Selector/Selector.tsx +4 -6
  112. package/src/components/SmartInput/SmartInput.tsx +85 -87
  113. package/src/components/Status/Status.tsx +5 -4
  114. package/src/components/Switch/Switch.styles.ts +21 -13
  115. package/src/components/Switch/Switch.tsx +11 -6
  116. package/src/components/Switch/types.ts +5 -0
  117. package/src/components/TextArea/TextArea.tsx +128 -130
  118. package/src/components/TextButton/TextButton.tsx +68 -69
  119. package/src/components/TextWithInfo/TextWithInfo.tsx +2 -4
  120. package/src/components/TextWithTooltip/TextWithTooltip.tsx +6 -4
  121. package/src/components/ThemedPreloader/ThemedPreloader.tsx +2 -4
  122. package/src/components/Toaster/Toaster.tsx +2 -4
  123. package/src/components/Tooltip/Tooltip.stories.tsx +10 -0
  124. package/src/components/Tooltip/Tooltip.styles.ts +2 -1
  125. package/src/components/Tooltip/Tooltip.tsx +12 -5
  126. package/src/components/Tooltip/types.ts +5 -0
  127. package/src/components/WithMessages/WithMessages.tsx +41 -40
  128. package/src/components/WithTooltip/WithTooltip.tsx +4 -0
  129. package/src/helpers/misc.ts +6 -0
  130. package/src/hooks/index.ts +1 -0
  131. package/src/hooks/use-intersection-ref.ts +24 -6
  132. package/src/hooks/use-latest-ref.ts +6 -2
  133. package/src/hooks/use-resize-ref.ts +35 -0
  134. package/src/hooks/use-tweak-styles.ts +14 -51
  135. package/src/theme/Provider.tsx +4 -21
  136. package/src/theme/common.ts +33 -36
  137. package/src/theme/helpers.ts +50 -42
  138. package/src/theme/index.ts +0 -2
  139. package/src/theme/types.ts +13 -10
  140. package/src/types.ts +3 -3
  141. package/dist/theme/create-themed-styles.d.ts +0 -2
  142. package/dist/theme/true-jss/ThemedStylesManager.d.ts +0 -18
  143. package/dist/theme/true-jss/TweakStylesManager.d.ts +0 -34
  144. package/dist/theme/true-jss/index.d.ts +0 -2
  145. package/dist/theme/true-jss/jss-context.d.ts +0 -9
  146. package/dist/true-react-common-ui-kit.css +0 -756
  147. package/src/theme/create-themed-styles.ts +0 -78
  148. package/src/theme/true-jss/ThemedStylesManager.ts +0 -93
  149. package/src/theme/true-jss/TweakStylesManager.ts +0 -156
  150. package/src/theme/true-jss/index.ts +0 -2
  151. package/src/theme/true-jss/jss-context.tsx +0 -34
@@ -8,11 +8,11 @@ import {
8
8
  } from 'react';
9
9
  import clsx from 'clsx';
10
10
  import {
11
+ addDataAttributes,
11
12
  addDataTestId,
12
13
  isEmpty,
13
14
  isReactNodeNotEmpty,
14
15
  } from '@true-engineering/true-react-platform-helpers';
15
- import { addDataAttributes } from '../../helpers';
16
16
  import { ICommonProps } from '../../types';
17
17
  import { blockEvent } from './helpers';
18
18
  import { IFileInputStyles, useStyles } from './FileInput.styles';
@@ -39,109 +39,101 @@ export interface IFileInputProps extends ICommonProps<IFileInputStyles> {
39
39
  onAdd?: (files: File[]) => void;
40
40
  }
41
41
 
42
- export const FileInput = forwardRef<HTMLInputElement, IFileInputProps>(
43
- (
44
- {
45
- fileList,
46
- label,
47
- text,
48
- description,
49
- isDragAndDropDisabled = false,
50
- isRequired = false,
51
- isReadOnly = false,
52
- isMultipleDisabled = false,
53
- isDisabled = false,
54
- isActive = false,
55
- accept,
56
- onAdd,
57
- testId,
58
- tweakStyles,
59
- data,
60
- },
61
- ref,
62
- ) => {
63
- const classes = useStyles({ theme: tweakStyles });
64
-
65
- const [isDragOver, setIsDragOver] = useState(false);
42
+ export const FileInput = forwardRef<HTMLInputElement, IFileInputProps>(function FileInput(
43
+ {
44
+ fileList,
45
+ label,
46
+ text,
47
+ description,
48
+ isDragAndDropDisabled = false,
49
+ isRequired = false,
50
+ isReadOnly = false,
51
+ isMultipleDisabled = false,
52
+ isDisabled = false,
53
+ isActive = false,
54
+ accept,
55
+ onAdd,
56
+ testId,
57
+ tweakStyles,
58
+ data,
59
+ },
60
+ ref,
61
+ ) {
62
+ const classes = useStyles({ theme: tweakStyles });
66
63
 
67
- const handleAdd = (files: FileList | null) => {
68
- if (isDisabled || isEmpty(files) || files?.length === 0) {
69
- return;
70
- }
64
+ const [isDragOver, setIsDragOver] = useState(false);
71
65
 
72
- onAdd?.([...files]);
73
- };
66
+ const handleAdd = (files: FileList | null) => {
67
+ if (isDisabled || isEmpty(files) || files?.length === 0) {
68
+ return;
69
+ }
74
70
 
75
- const handleDragStart: DragEventHandler<HTMLDivElement> = (event) => {
76
- blockEvent(event);
77
- setIsDragOver(true);
78
- };
71
+ onAdd?.([...files]);
72
+ };
79
73
 
80
- const handleDragStop: DragEventHandler<HTMLDivElement> = (event) => {
81
- blockEvent(event);
82
- setIsDragOver(false);
83
- };
74
+ const handleDragStart: DragEventHandler<HTMLDivElement> = (event) => {
75
+ blockEvent(event);
76
+ setIsDragOver(true);
77
+ };
84
78
 
85
- const handleDrop: DragEventHandler<HTMLDivElement> = (event) => {
86
- handleDragStop(event);
79
+ const handleDragStop: DragEventHandler<HTMLDivElement> = (event) => {
80
+ blockEvent(event);
81
+ setIsDragOver(false);
82
+ };
87
83
 
88
- handleAdd(event.dataTransfer.files);
89
- };
84
+ const handleDrop: DragEventHandler<HTMLDivElement> = (event) => {
85
+ handleDragStop(event);
90
86
 
91
- const handleFileChange: ChangeEventHandler<HTMLInputElement> = (event) => {
92
- handleAdd(event.target.files);
93
- };
87
+ handleAdd(event.dataTransfer.files);
88
+ };
94
89
 
95
- const dndHandlers =
96
- !isDragAndDropDisabled && !isDisabled
97
- ? {
98
- onDragOver: handleDragStart,
99
- onDragEnter: handleDragStart,
100
- onDragLeave: handleDragStop,
101
- onDrop: handleDrop,
102
- }
103
- : undefined;
90
+ const handleFileChange: ChangeEventHandler<HTMLInputElement> = (event) => {
91
+ handleAdd(event.target.files);
92
+ };
104
93
 
105
- return (
106
- <div className={classes.root} {...addDataAttributes(data)} {...addDataTestId(testId)}>
107
- {isReactNodeNotEmpty(label) && (
108
- <div className={clsx(classes.label, { [classes.requiredLabel]: isRequired })}>
109
- {label}
110
- </div>
111
- )}
112
- {!isReadOnly && (
113
- <div
114
- className={clsx(classes.inputWrapper, {
115
- [classes.dragged]: isDragOver,
116
- [classes.disabled]: isDisabled,
117
- [classes.active]: isActive,
118
- })}
119
- {...dndHandlers}
120
- >
121
- {isReactNodeNotEmpty(text) && <div className={classes.text}>{text}</div>}
122
- <label className={classes.inputLabel}>
123
- <input
124
- ref={ref}
125
- type="file"
126
- value=""
127
- onChange={handleFileChange}
128
- multiple={!isMultipleDisabled}
129
- disabled={isDisabled}
130
- accept={accept}
131
- {...addDataTestId(testId, 'input')}
132
- />
133
- </label>
134
- </div>
135
- )}
94
+ const dndHandlers =
95
+ !isDragAndDropDisabled && !isDisabled
96
+ ? {
97
+ onDragOver: handleDragStart,
98
+ onDragEnter: handleDragStart,
99
+ onDragLeave: handleDragStop,
100
+ onDrop: handleDrop,
101
+ }
102
+ : undefined;
136
103
 
137
- {isReactNodeNotEmpty(description) && (
138
- <div className={classes.description}>{description}</div>
139
- )}
104
+ return (
105
+ <div className={classes.root} {...addDataAttributes(data, testId)}>
106
+ {isReactNodeNotEmpty(label) && (
107
+ <div className={clsx(classes.label, { [classes.requiredLabel]: isRequired })}>{label}</div>
108
+ )}
109
+ {!isReadOnly && (
110
+ <div
111
+ className={clsx(classes.inputWrapper, {
112
+ [classes.dragged]: isDragOver,
113
+ [classes.disabled]: isDisabled,
114
+ [classes.active]: isActive,
115
+ })}
116
+ {...dndHandlers}
117
+ >
118
+ {isReactNodeNotEmpty(text) && <div className={classes.text}>{text}</div>}
119
+ <label className={classes.inputLabel}>
120
+ <input
121
+ ref={ref}
122
+ type="file"
123
+ value=""
124
+ onChange={handleFileChange}
125
+ multiple={!isMultipleDisabled}
126
+ disabled={isDisabled}
127
+ accept={accept}
128
+ {...addDataTestId(testId, 'input')}
129
+ />
130
+ </label>
131
+ </div>
132
+ )}
140
133
 
141
- <div className={classes.fileList}>{fileList}</div>
142
- </div>
143
- );
144
- },
145
- );
134
+ {isReactNodeNotEmpty(description) && <div className={classes.description}>{description}</div>}
146
135
 
147
- FileInput.displayName = 'FileInput';
136
+ <div className={classes.fileList}>{fileList}</div>
137
+ </div>
138
+ );
139
+ });
@@ -3,12 +3,11 @@ import clsx from 'clsx';
3
3
  import { filesize } from 'filesize';
4
4
  import {
5
5
  addClickHandler,
6
- addDataTestId,
6
+ addDataAttributes,
7
7
  isFunction,
8
8
  isNotEmpty,
9
9
  isReactNodeNotEmpty,
10
10
  } from '@true-engineering/true-react-platform-helpers';
11
- import { addDataAttributes } from '../../helpers';
12
11
  import { useTweakStyles } from '../../hooks';
13
12
  import { ICommonProps } from '../../types';
14
13
  import { IIcon, renderIcon } from '../Icon';
@@ -104,8 +103,7 @@ export const FileItem: FC<IFileItemProps> = ({
104
103
  className={clsx(classes.fileItemWrapper, classes[itemSize], {
105
104
  [classes.disabled]: isDisabled,
106
105
  })}
107
- {...addDataTestId(testId)}
108
- {...addDataAttributes(data)}
106
+ {...addDataAttributes(data, testId)}
109
107
  {...addClickHandler(handleClick, !isDisabled)}
110
108
  >
111
109
  <div className={classes.fileIcon}>{renderIcon(icon)}</div>
@@ -83,6 +83,8 @@ interface IFiltersPaneCustomProps<Values extends Record<string, unknown>, Conten
83
83
  isSearchAutoSized: boolean;
84
84
  }
85
85
 
86
+ const tweakWrapperStyles = { name: { color: 'tomato' } };
87
+
86
88
  const Story: FC<IFiltersPaneCustomProps<ConfigValues, unknown>> = ({
87
89
  containerWidth,
88
90
  isSearchDisabled,
@@ -216,6 +218,7 @@ const Story: FC<IFiltersPaneCustomProps<ConfigValues, unknown>> = ({
216
218
  isClearable: isClearableFields,
217
219
  options: [LONG_STRING, '2', '3'],
218
220
  component: ({ filter, ...props }) => <FilterSelect {...props} {...filter} />,
221
+ tweakWrapperStyles,
219
222
  },
220
223
  };
221
224
 
@@ -1,6 +1,5 @@
1
1
  import { FC, useMemo } from 'react';
2
- import { getTestId } from '@true-engineering/true-react-platform-helpers';
3
- import { addDataAttributes } from '../../../../helpers';
2
+ import { getTestId, addDataAttributes } from '@true-engineering/true-react-platform-helpers';
4
3
  import { useTweakStyles } from '../../../../hooks';
5
4
  import { ICommonProps } from '../../../../types';
6
5
  import { Button } from '../../../Button';
@@ -79,7 +78,7 @@ export const FilterInterval: FC<IFilterIntervalProps> = ({
79
78
  });
80
79
 
81
80
  return (
82
- <div className={classes.root} {...addDataAttributes(data)}>
81
+ <div className={classes.root} {...addDataAttributes(data, testId)}>
83
82
  <div className={classes.inputWrapper}>
84
83
  <div>
85
84
  <NumberInput
@@ -1,8 +1,11 @@
1
1
  import { FC, useMemo, useRef, useState } from 'react';
2
2
  import { isAfter, isBefore } from 'date-fns';
3
3
  import { enUS, ru } from 'date-fns/locale';
4
- import { getTestId, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
5
- import { addDataAttributes } from '../../../../helpers';
4
+ import {
5
+ getTestId,
6
+ isNotEmpty,
7
+ addDataAttributes,
8
+ } from '@true-engineering/true-react-platform-helpers';
6
9
  import { useTweakStyles } from '../../../../hooks';
7
10
  import { ICommonProps } from '../../../../types';
8
11
  import { Button } from '../../../Button';
@@ -127,7 +130,7 @@ export const FilterWithDates: FC<IFilterWithDatesProps> = ({
127
130
  };
128
131
 
129
132
  return (
130
- <div className={classes.root} {...addDataAttributes(data)}>
133
+ <div className={classes.root} {...addDataAttributes(data, testId)}>
131
134
  <div className={classes.container}>
132
135
  <div className={classes.containerItem}>
133
136
  <DatePicker
@@ -5,7 +5,7 @@ import {
5
5
  getTestId,
6
6
  isNotEmpty,
7
7
  } from '@true-engineering/true-react-platform-helpers';
8
- import { useTweakStyles } from '../../../../hooks';
8
+ import { useMixedStyles, useTweakStyles } from '../../../../hooks';
9
9
  import { ICommonProps } from '../../../../types';
10
10
  import { Icon } from '../../../Icon';
11
11
  import { WithPopup } from '../../../WithPopup';
@@ -35,9 +35,10 @@ export function FilterWrapper<Values extends Record<string, unknown>, Key extend
35
35
  localeKey,
36
36
  data,
37
37
  testId,
38
- tweakStyles,
38
+ tweakStyles: baseTweakStyles,
39
39
  onChange,
40
40
  }: IFilterWrapperProps<Values, Key>): JSX.Element {
41
+ const tweakStyles = useMixedStyles(baseTweakStyles, filter.tweakWrapperStyles);
41
42
  const classes = useStyles({ theme: tweakStyles });
42
43
 
43
44
  const tweakWithPopupStyles = useTweakStyles({
@@ -9,6 +9,7 @@ import type {
9
9
  IFilterSelectProps,
10
10
  IFilterWithDatesProps,
11
11
  IFilterWithPeriodProps,
12
+ IFilterWrapperStyles,
12
13
  } from './components';
13
14
  import { FilterLocales, PERIODS, SelectLocales } from './constants';
14
15
 
@@ -56,6 +57,7 @@ export interface IConfigItemBasicBase<Value> {
56
57
  localeKey?: IFilterLocaleKey;
57
58
  locale?: IPartialFilterLocale;
58
59
  getSelectedValueView?: (v: Value) => ReactNode;
60
+ tweakWrapperStyles?: IFilterWrapperStyles;
59
61
  }
60
62
 
61
63
  export type IIntervalConfigItem<Value> = IConfigItemBasicBase<Value> & {
@@ -98,6 +98,7 @@ export const useStyles = createThemedStyles('FlexibleTable', {
98
98
  },
99
99
  },
100
100
 
101
+ /** @deprecated удалить вместе с isFirstColumnSticky */
101
102
  headerSecond: {
102
103
  paddingLeft: STICKY_SHADOW_PADDING,
103
104
  },
@@ -25,6 +25,7 @@ export const useStyles = createThemedStyles('FlexibleTableCell', {
25
25
  },
26
26
  },
27
27
 
28
+ /** @deprecated удалить вместе с isFirstColumnSticky */
28
29
  second: {
29
30
  paddingLeft: STICKY_SHADOW_PADDING,
30
31
  },
@@ -1,7 +1,10 @@
1
1
  import { ReactNode, useCallback } from 'react';
2
2
  import clsx from 'clsx';
3
- import { applyAction, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
4
- import { addDataAttributes } from '../../../../helpers';
3
+ import {
4
+ applyAction,
5
+ isNotEmpty,
6
+ addDataAttributes,
7
+ } from '@true-engineering/true-react-platform-helpers';
5
8
  import { ICommonProps } from '../../../../types';
6
9
  import { Skeleton } from '../../../Skeleton';
7
10
  import { TableRenders } from '../../constants';
@@ -1,7 +1,11 @@
1
- import { ReactNode, useState, memo, MouseEvent, RefCallback, useCallback } from 'react';
1
+ import { ReactNode, useState, MouseEvent, RefCallback, useCallback } from 'react';
2
2
  import clsx from 'clsx';
3
- import { isEmpty, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
4
- import { addDataAttributes } from '../../../../helpers';
3
+ import {
4
+ isEmpty,
5
+ isNotEmpty,
6
+ addDataAttributes,
7
+ } from '@true-engineering/true-react-platform-helpers';
8
+ import { genericMemo } from '../../../../helpers';
5
9
  import { useTweakStyles } from '../../../../hooks';
6
10
  import { IDataAttributes, ITweakStylesProps } from '../../../../types';
7
11
  import { TableRenders } from '../../constants';
@@ -44,7 +48,7 @@ export interface IFlexibleTableRowProps<
44
48
  onRowClick?: (id: Row[UniqueField]) => void;
45
49
  }
46
50
 
47
- function FlexibleTableRowInner<
51
+ export const FlexibleTableRow = genericMemo(function FlexibleTableRow<
48
52
  Row extends ITableRow,
49
53
  HeaderContent extends IHeaderContent<Row>,
50
54
  UniqueField extends keyof Row,
@@ -189,6 +193,4 @@ function FlexibleTableRowInner<
189
193
  )}
190
194
  </>
191
195
  );
192
- }
193
-
194
- export const FlexibleTableRow = memo(FlexibleTableRowInner) as typeof FlexibleTableRowInner;
196
+ });
@@ -1,7 +1,6 @@
1
1
  import { forwardRef } from 'react';
2
2
  import clsx from 'clsx';
3
- import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
4
- import { addDataAttributes } from '../../helpers';
3
+ import { addDataAttributes } from '@true-engineering/true-react-platform-helpers';
5
4
  import { ICommonProps } from '../../types';
6
5
  import { renderIcon, IIcon } from '../Icon';
7
6
  import { ThemedPreloader } from '../ThemedPreloader';
@@ -24,51 +23,48 @@ export interface IIconButtonProps
24
23
  isLoading?: boolean;
25
24
  }
26
25
 
27
- export const IconButton = forwardRef<HTMLButtonElement, IIconButtonProps>(
28
- (
29
- {
30
- icon,
31
- size = 'm',
32
- view = 'cancel-light',
33
- isDisabled = false,
34
- isActive = false,
35
- isLoading = false,
36
- type = 'button',
37
- testId,
38
- tweakStyles,
39
- data,
40
- onClick,
41
- ...restProps
42
- },
43
- ref,
44
- ) => {
45
- const classes = useStyles({ theme: tweakStyles });
26
+ export const IconButton = forwardRef<HTMLButtonElement, IIconButtonProps>(function IconButton(
27
+ {
28
+ icon,
29
+ size = 'm',
30
+ view = 'cancel-light',
31
+ isDisabled = false,
32
+ isActive = false,
33
+ isLoading = false,
34
+ type = 'button',
35
+ testId,
36
+ tweakStyles,
37
+ data,
38
+ onClick,
39
+ ...restProps
40
+ },
41
+ ref,
42
+ ) {
43
+ const classes = useStyles({ theme: tweakStyles });
46
44
 
47
- const hasNoAction = isDisabled || isLoading;
45
+ const hasNoAction = isDisabled || isLoading;
48
46
 
49
- return (
50
- <button
51
- ref={ref}
52
- className={clsx(classes.root, classes[view], classes[size], {
53
- [classes.disabled]: isDisabled,
54
- [classes.active]: isActive,
55
- [classes.loading]: isLoading,
56
- })}
57
- type={type}
58
- disabled={isDisabled}
59
- onClick={hasNoAction ? undefined : onClick}
60
- {...restProps}
61
- {...addDataTestId(testId)}
62
- {...addDataAttributes(data)}
63
- >
64
- {isLoading ? (
65
- <span className={classes.loader}>
66
- <ThemedPreloader type="default" useCurrentColor />
67
- </span>
68
- ) : (
69
- <span className={classes.icon}>{renderIcon(icon)}</span>
70
- )}
71
- </button>
72
- );
73
- },
74
- );
47
+ return (
48
+ <button
49
+ ref={ref}
50
+ className={clsx(classes.root, classes[view], classes[size], {
51
+ [classes.disabled]: isDisabled,
52
+ [classes.active]: isActive,
53
+ [classes.loading]: isLoading,
54
+ })}
55
+ type={type}
56
+ disabled={isDisabled}
57
+ onClick={hasNoAction ? undefined : onClick}
58
+ {...restProps}
59
+ {...addDataAttributes(data, testId)}
60
+ >
61
+ {isLoading ? (
62
+ <span className={classes.loader}>
63
+ <ThemedPreloader type="default" useCurrentColor />
64
+ </span>
65
+ ) : (
66
+ <span className={classes.icon}>{renderIcon(icon)}</span>
67
+ )}
68
+ </button>
69
+ );
70
+ });
@@ -8,28 +8,30 @@ export interface IInputProps
8
8
  extends IInputBaseProps,
9
9
  Pick<IWithMessagesProps, 'infoMessage' | 'errorMessage'> {}
10
10
 
11
- export const Input = forwardRef<HTMLInputElement, IInputProps>(
12
- ({ infoMessage, errorMessage, isInvalid, testId, tweakStyles, ...inputProps }, ref) => {
13
- const tweakWithMessagesStyles = useTweakStyles({
14
- tweakStyles,
15
- className: 'tweakWithMessages',
16
- });
11
+ export const Input = forwardRef<HTMLInputElement, IInputProps>(function Input(
12
+ { infoMessage, errorMessage, isInvalid, testId, tweakStyles, ...inputProps },
13
+ ref,
14
+ ) {
15
+ const tweakWithMessagesStyles = useTweakStyles({
16
+ tweakStyles,
17
+ className: 'tweakWithMessages',
18
+ currentComponentName: 'Input',
19
+ });
17
20
 
18
- return (
19
- <WithMessages
20
- errorMessage={errorMessage}
21
- infoMessage={infoMessage}
22
- testId={getTestId(testId, 'wrapper')}
23
- tweakStyles={tweakWithMessagesStyles}
24
- >
25
- <InputBase
26
- {...inputProps}
27
- ref={ref}
28
- testId={testId}
29
- tweakStyles={tweakStyles}
30
- isInvalid={isInvalid}
31
- />
32
- </WithMessages>
33
- );
34
- },
35
- );
21
+ return (
22
+ <WithMessages
23
+ errorMessage={errorMessage}
24
+ infoMessage={infoMessage}
25
+ testId={getTestId(testId, 'wrapper')}
26
+ tweakStyles={tweakWithMessagesStyles}
27
+ >
28
+ <InputBase
29
+ {...inputProps}
30
+ ref={ref}
31
+ testId={testId}
32
+ tweakStyles={tweakStyles}
33
+ isInvalid={isInvalid}
34
+ />
35
+ </WithMessages>
36
+ );
37
+ });