@true-engineering/true-react-common-ui-kit 3.0.0-alpha.5 → 3.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +3 -0
- package/dist/true-react-common-ui-kit.js +3 -3
- package/dist/true-react-common-ui-kit.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +1 -0
- package/src/components/FlexibleTable/FlexibleTable.tsx +6 -3
|
@@ -11,6 +11,9 @@ export interface IFlexibleTableProps<Values extends Record<string, any>> extends
|
|
|
11
11
|
isHorizontallyScrollable?: boolean;
|
|
12
12
|
isFirstColumnSticky?: boolean;
|
|
13
13
|
infinityScrollConfig?: IInfinityScrollConfig;
|
|
14
|
+
/**
|
|
15
|
+
* @default Индекс строки
|
|
16
|
+
*/
|
|
14
17
|
uniqueField?: keyof Values;
|
|
15
18
|
onHeadClick?: (column: keyof Values) => void;
|
|
16
19
|
onRowClick?: (id: string) => void;
|
|
@@ -22026,7 +22026,7 @@ function _unsupported_iterable_to_array$8(o, minLen) {
|
|
|
22026
22026
|
return _array_like_to_array$8(o, minLen);
|
|
22027
22027
|
}
|
|
22028
22028
|
function FlexibleTable(param) {
|
|
22029
|
-
var data = param.data, tweakStyles = param.tweakStyles, content = param.content, headerContent = param.headerContent, config = param.config, activeRows = param.activeRows, enabledColumns = param.enabledColumns, isHorizontallyScrollable = param.isHorizontallyScrollable, isFirstColumnSticky = param.isFirstColumnSticky, infinityScrollConfig = param.infinityScrollConfig,
|
|
22029
|
+
var data = param.data, tweakStyles = param.tweakStyles, content = param.content, headerContent = param.headerContent, config = param.config, activeRows = param.activeRows, enabledColumns = param.enabledColumns, isHorizontallyScrollable = param.isHorizontallyScrollable, isFirstColumnSticky = param.isFirstColumnSticky, infinityScrollConfig = param.infinityScrollConfig, uniqueField = param.uniqueField, onHeadClick = param.onHeadClick, onRowHover = param.onRowHover, onRowClick = param.onRowClick, refForScroll = param.refForScroll, rowAttributes = param.rowAttributes, nothingFoundContent = param.nothingFoundContent, testId = param.testId, expandableRowComponent = param.expandableRowComponent;
|
|
22030
22030
|
var classes = useStyles$h({
|
|
22031
22031
|
theme: tweakStyles
|
|
22032
22032
|
});
|
|
@@ -22075,7 +22075,7 @@ function FlexibleTable(param) {
|
|
|
22075
22075
|
}, [
|
|
22076
22076
|
scrollRef
|
|
22077
22077
|
]);
|
|
22078
|
-
var _activeRows_includes
|
|
22078
|
+
var _activeRows_includes;
|
|
22079
22079
|
return /* @__PURE__ */ jsx("div", {
|
|
22080
22080
|
ref: refForScroll !== null && refForScroll !== void 0 ? refForScroll : scrollRef,
|
|
22081
22081
|
className: clsx(_define_property$g({}, classes.scroll, isHorizontallyScrollable)),
|
|
@@ -22136,7 +22136,7 @@ function FlexibleTable(param) {
|
|
|
22136
22136
|
rowAttributes,
|
|
22137
22137
|
tweakStyles: tweakTableRowStyles,
|
|
22138
22138
|
expandableRowComponent
|
|
22139
|
-
}, (
|
|
22139
|
+
}, isNotEmpty(uniqueField) ? item[uniqueField] : i);
|
|
22140
22140
|
}),
|
|
22141
22141
|
infinityScrollConfig !== void 0 && !infinityScrollConfig.isLastPage && /* @__PURE__ */ jsx("tr", {
|
|
22142
22142
|
children: /* @__PURE__ */ jsx("td", {
|
|
@@ -22016,7 +22016,7 @@
|
|
|
22016
22016
|
return _array_like_to_array$8(o, minLen);
|
|
22017
22017
|
}
|
|
22018
22018
|
function FlexibleTable(param) {
|
|
22019
|
-
var data = param.data, tweakStyles = param.tweakStyles, content = param.content, headerContent = param.headerContent, config = param.config, activeRows = param.activeRows, enabledColumns = param.enabledColumns, isHorizontallyScrollable = param.isHorizontallyScrollable, isFirstColumnSticky = param.isFirstColumnSticky, infinityScrollConfig = param.infinityScrollConfig,
|
|
22019
|
+
var data = param.data, tweakStyles = param.tweakStyles, content = param.content, headerContent = param.headerContent, config = param.config, activeRows = param.activeRows, enabledColumns = param.enabledColumns, isHorizontallyScrollable = param.isHorizontallyScrollable, isFirstColumnSticky = param.isFirstColumnSticky, infinityScrollConfig = param.infinityScrollConfig, uniqueField = param.uniqueField, onHeadClick = param.onHeadClick, onRowHover = param.onRowHover, onRowClick = param.onRowClick, refForScroll = param.refForScroll, rowAttributes = param.rowAttributes, nothingFoundContent = param.nothingFoundContent, testId = param.testId, expandableRowComponent = param.expandableRowComponent;
|
|
22020
22020
|
var classes = useStyles$h({
|
|
22021
22021
|
theme: tweakStyles
|
|
22022
22022
|
});
|
|
@@ -22065,7 +22065,7 @@
|
|
|
22065
22065
|
}, [
|
|
22066
22066
|
scrollRef
|
|
22067
22067
|
]);
|
|
22068
|
-
var _activeRows_includes
|
|
22068
|
+
var _activeRows_includes;
|
|
22069
22069
|
return /* @__PURE__ */ jsx("div", {
|
|
22070
22070
|
ref: refForScroll !== null && refForScroll !== void 0 ? refForScroll : scrollRef,
|
|
22071
22071
|
className: clsx(_define_property$g({}, classes.scroll, isHorizontallyScrollable)),
|
|
@@ -22126,7 +22126,7 @@
|
|
|
22126
22126
|
rowAttributes,
|
|
22127
22127
|
tweakStyles: tweakTableRowStyles,
|
|
22128
22128
|
expandableRowComponent
|
|
22129
|
-
}, (
|
|
22129
|
+
}, trueReactPlatformHelpers.isNotEmpty(uniqueField) ? item[uniqueField] : i);
|
|
22130
22130
|
}),
|
|
22131
22131
|
infinityScrollConfig !== void 0 && !infinityScrollConfig.isLastPage && /* @__PURE__ */ jsx("tr", {
|
|
22132
22132
|
children: /* @__PURE__ */ jsx("td", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode, RefObject, useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { addDataTestId } from '@true-engineering/true-react-platform-helpers';
|
|
3
|
+
import { addDataTestId, isNotEmpty } from '@true-engineering/true-react-platform-helpers';
|
|
4
4
|
import { addDataAttributes } from '../../helpers';
|
|
5
5
|
import { useTweakStyles } from '../../hooks';
|
|
6
6
|
import { ICommonProps } from '../../types';
|
|
@@ -20,6 +20,9 @@ export interface IFlexibleTableProps<Values extends Record<string, any>>
|
|
|
20
20
|
isHorizontallyScrollable?: boolean;
|
|
21
21
|
isFirstColumnSticky?: boolean;
|
|
22
22
|
infinityScrollConfig?: IInfinityScrollConfig;
|
|
23
|
+
/**
|
|
24
|
+
* @default Индекс строки
|
|
25
|
+
*/
|
|
23
26
|
uniqueField?: keyof Values;
|
|
24
27
|
onHeadClick?: (column: keyof Values) => void;
|
|
25
28
|
// TODO: Заменить string на Generic Values[uniqueField]
|
|
@@ -42,7 +45,7 @@ export function FlexibleTable<Values extends Record<string, any>>({
|
|
|
42
45
|
isHorizontallyScrollable,
|
|
43
46
|
isFirstColumnSticky,
|
|
44
47
|
infinityScrollConfig,
|
|
45
|
-
uniqueField
|
|
48
|
+
uniqueField,
|
|
46
49
|
onHeadClick,
|
|
47
50
|
onRowHover,
|
|
48
51
|
onRowClick,
|
|
@@ -171,7 +174,7 @@ export function FlexibleTable<Values extends Record<string, any>>({
|
|
|
171
174
|
onRowHover={onRowHover}
|
|
172
175
|
enabledColumns={enabledColumns}
|
|
173
176
|
config={config}
|
|
174
|
-
key={item[uniqueField]
|
|
177
|
+
key={isNotEmpty(uniqueField) ? item[uniqueField] : i}
|
|
175
178
|
rowAttributes={rowAttributes}
|
|
176
179
|
tweakStyles={tweakTableRowStyles}
|
|
177
180
|
expandableRowComponent={expandableRowComponent}
|