@true-engineering/true-react-common-ui-kit 3.47.0 → 3.48.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 +6 -0
- package/dist/components/FlexibleTable/FlexibleTable.d.ts +1 -1
- package/dist/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.d.ts +5 -4
- package/dist/components/FlexibleTable/constants.d.ts +18 -2
- package/dist/components/FlexibleTable/types.d.ts +1 -1
- package/dist/true-react-common-ui-kit.js +2 -1
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +2 -1
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/FlexibleTable/FlexibleTable.tsx +1 -0
- package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.tsx +6 -3
- package/src/components/FlexibleTable/constants.ts +6 -3
- package/src/components/FlexibleTable/types.ts +1 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ import { ICommonProps } from '../../types';
|
|
|
3
3
|
import { IFlexibleTableRowProps } from './components';
|
|
4
4
|
import { ITableRow, IFlexibleTableConfigType, IInfinityScrollConfig, IFlexibleTableRenderMode, IHeaderContent } from './types';
|
|
5
5
|
import { IFlexibleTableStyles } from './FlexibleTable.styles';
|
|
6
|
-
export interface IFlexibleTableProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ICommonProps<IFlexibleTableStyles>, Pick<IFlexibleTableRowProps<Row, HeaderContent, UniqueField>, 'uniqueField' | 'rowAttributes' | 'isFirstColumnSticky' | 'isExpandableRowComponentInitiallyOpen' | 'expandableRowComponent' | 'onRowClick' | 'onRowHover'> {
|
|
6
|
+
export interface IFlexibleTableProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ICommonProps<IFlexibleTableStyles>, Pick<IFlexibleTableRowProps<Row, HeaderContent, UniqueField>, 'uniqueField' | 'rowAttributes' | 'isFirstColumnSticky' | 'isExpandableRowComponentInitiallyOpen' | 'expandableRowComponent' | 'onRowClick' | 'onRowHover' | 'rowRef'> {
|
|
7
7
|
content: Row[];
|
|
8
8
|
/** @default 'table' */
|
|
9
9
|
renderMode?: IFlexibleTableRenderMode;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode, RefCallback } from 'react';
|
|
2
|
+
import { ITweakStylesProps } from '../../../../types';
|
|
3
3
|
import { ITableRow, IFlexibleTableConfigType, IFlexibleTableRenderMode, IHeaderContent } from '../../types';
|
|
4
4
|
import { IFlexibleTableRowStyles } from './FlexibleTableRow.styles';
|
|
5
|
-
export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends
|
|
5
|
+
export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row> extends ITweakStylesProps<IFlexibleTableRowStyles> {
|
|
6
6
|
item: Row;
|
|
7
7
|
index: number;
|
|
8
8
|
uniqueField?: UniqueField;
|
|
@@ -21,11 +21,12 @@ export interface IFlexibleTableRowProps<Row extends ITableRow, HeaderContent ext
|
|
|
21
21
|
rowAttributes?: Array<keyof Row>;
|
|
22
22
|
/** @default false */
|
|
23
23
|
isExpandableRowComponentInitiallyOpen?: boolean | ((row: Row, index: number) => boolean);
|
|
24
|
+
rowRef?: RefCallback<HTMLTableRowElement>;
|
|
24
25
|
/** Возвращает React-элемент, который отрисуется под строкой при нажатии на неё */
|
|
25
26
|
expandableRowComponent?: (item: Row, isOpen: boolean, close: () => void) => ReactNode;
|
|
26
27
|
onRowHover?: (id?: Row[UniqueField]) => void;
|
|
27
28
|
onRowClick?: (id: Row[UniqueField]) => void;
|
|
28
29
|
}
|
|
29
|
-
declare function FlexibleTableRowInner<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row>({ item, index, config, columns, uniqueField, renderMode, isActive, isFocusable, isFirstColumnSticky, isLoading, rowAttributes, isExpandableRowComponentInitiallyOpen, tweakStyles, expandableRowComponent, onRowHover, onRowClick, }: IFlexibleTableRowProps<Row, HeaderContent, UniqueField>): JSX.Element;
|
|
30
|
+
declare function FlexibleTableRowInner<Row extends ITableRow, HeaderContent extends IHeaderContent<Row>, UniqueField extends keyof Row>({ item, index, config, columns, uniqueField, renderMode, isActive, isFocusable, isFirstColumnSticky, isLoading, rowAttributes, isExpandableRowComponentInitiallyOpen, rowRef, tweakStyles, expandableRowComponent, onRowHover, onRowClick, }: IFlexibleTableRowProps<Row, HeaderContent, UniqueField>): JSX.Element;
|
|
30
31
|
export declare const FlexibleTableRow: typeof FlexibleTableRowInner;
|
|
31
32
|
export {};
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import { IFlexibleTableRenderMode, IFlexibleTableRender } from './types';
|
|
2
1
|
export declare const DEFAULT_DATE_FORMAT = "dd.MM.yyyy";
|
|
3
|
-
export declare const TableRenders:
|
|
2
|
+
export declare const TableRenders: {
|
|
3
|
+
table: {
|
|
4
|
+
Root: "table";
|
|
5
|
+
Head: "thead";
|
|
6
|
+
Body: "tbody";
|
|
7
|
+
Row: "tr";
|
|
8
|
+
Header: "th";
|
|
9
|
+
Cell: "td";
|
|
10
|
+
};
|
|
11
|
+
divs: {
|
|
12
|
+
Root: "div";
|
|
13
|
+
Head: "div";
|
|
14
|
+
Body: "div";
|
|
15
|
+
Row: "div";
|
|
16
|
+
Header: "div";
|
|
17
|
+
Cell: "div";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { IRenderNode } from '../../types';
|
|
3
3
|
export type IFlexibleTableRenderMode = 'table' | 'divs';
|
|
4
|
-
export type
|
|
4
|
+
export type IFlexibleTableRenderElement = 'Root' | 'Head' | 'Body' | 'Row' | 'Header' | 'Cell';
|
|
5
5
|
export type ITableRow = Record<string, any>;
|
|
6
6
|
export type IHeaderContent<T extends ITableRow> = Partial<Record<keyof T, unknown>>;
|
|
7
7
|
export interface ITitleComponentProps<Value> {
|
|
@@ -26296,7 +26296,7 @@ function _unsupported_iterable_to_array$7(o, minLen) {
|
|
|
26296
26296
|
return _array_like_to_array$7(o, minLen);
|
|
26297
26297
|
}
|
|
26298
26298
|
function FlexibleTableRowInner(param) {
|
|
26299
|
-
var item = param.item, index = param.index, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
|
|
26299
|
+
var item = param.item, index = param.index, config = param.config, columns = param.columns, uniqueField = param.uniqueField, renderMode = param.renderMode, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isFocusable = param.isFocusable, isFocusable = _param_isFocusable === void 0 ? false : _param_isFocusable, _param_isFirstColumnSticky = param.isFirstColumnSticky, isFirstColumnSticky = _param_isFirstColumnSticky === void 0 ? false : _param_isFirstColumnSticky, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, rowAttributes = param.rowAttributes, _param_isExpandableRowComponentInitiallyOpen = param.isExpandableRowComponentInitiallyOpen, isExpandableRowComponentInitiallyOpen = _param_isExpandableRowComponentInitiallyOpen === void 0 ? false : _param_isExpandableRowComponentInitiallyOpen, rowRef = param.rowRef, tweakStyles = param.tweakStyles, expandableRowComponent = param.expandableRowComponent, onRowHover = param.onRowHover, onRowClick = param.onRowClick;
|
|
26300
26300
|
var classes = useStyles$h({
|
|
26301
26301
|
theme: tweakStyles
|
|
26302
26302
|
});
|
|
@@ -26373,6 +26373,7 @@ function FlexibleTableRowInner(param) {
|
|
|
26373
26373
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
26374
26374
|
children: [
|
|
26375
26375
|
/* @__PURE__ */ jsx(Table.Row, _object_spread_props$k(_object_spread$l({
|
|
26376
|
+
ref: rowRef,
|
|
26376
26377
|
className: clsx(classes.root, (_obj2 = {}, _define_property$m(_obj2, classes.active, isActive), _define_property$m(_obj2, classes.editable, isEditable), _define_property$m(_obj2, classes.clickable, isClickable), _obj2))
|
|
26377
26378
|
}, !isLoading && {
|
|
26378
26379
|
onClick: handleRowClick,
|