@infomaximum/ui-kit 0.17.2 → 0.17.4
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/Button/Button.js +3 -3
- package/dist/components/Button/Button.types.d.ts +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.js +11 -4
- package/dist/components/Switch/Switch.js +4 -4
- package/dist/components/Switch/Switch.styles.js +7 -3
- package/dist/components/Switch/Switch.types.d.ts +1 -1
- package/dist/components/Table/Table.js +15 -23
- package/dist/components/Table/Table.styles.d.ts +1 -1
- package/dist/components/Table/Table.styles.js +2 -2
- package/dist/components/Table/Table.types.d.ts +28 -8
- package/dist/components/Table/components/Body/Body.js +1 -1
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.js +8 -4
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.d.ts +2 -2
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.js +3 -3
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.types.d.ts +3 -1
- package/dist/components/Table/components/Body/components/BodyRow/BodyRow.js +7 -4
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.js +11 -3
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.types.d.ts +1 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.js +2 -2
- package/dist/components/Table/components/Cell/Cell.styles.d.ts +2 -2
- package/dist/components/Table/components/Cell/Cell.styles.js +3 -3
- package/dist/components/Table/components/Cell/Cell.types.d.ts +2 -2
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.js +5 -5
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.d.ts +2 -2
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.js +4 -9
- package/dist/components/Table/components/FixedHeader/FixedHeader.js +1 -1
- package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.js +18 -12
- package/dist/components/Table/components/Header/Header.js +1 -1
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.js +2 -2
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.d.ts +2 -2
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.js +3 -3
- package/dist/components/Table/contexts/tableContext/TableContext.js +9 -1
- package/dist/components/Table/contexts/tableContext/TableContext.types.d.ts +3 -2
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.js +1 -1
- package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.js +1 -1
- package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.js +1 -1
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js +4 -1
- package/dist/components/Table/features/tableRowSelection/types.d.ts +3 -1
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.js +2 -2
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.d.ts +1 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.js +2 -1
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.types.d.ts +1 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.d.ts +1 -1
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.js +1 -1
- package/dist/components/Table/hooks/useTableBordered/getBorderedInfo.d.ts +3 -0
- package/dist/components/Table/hooks/useTableBordered/getBorderedInfo.js +41 -0
- package/dist/components/Table/hooks/useTableBordered/index.d.ts +1 -0
- package/dist/components/Table/hooks/useTableBordered/useTableBordered.d.ts +4 -0
- package/dist/components/Table/hooks/useTableBordered/useTableBordered.js +14 -0
- package/dist/components/Table/hooks/useTableBordered/useTableBordered.types.d.ts +3 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/index.d.ts +1 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/types.d.ts +6 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/useTableVisualParamsChange.js +17 -4
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.d.ts +1 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.js +3 -1
- package/dist/components/Table/interfaces/tableComponents.types.d.ts +2 -2
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/Tabs.types.d.ts +3 -1
- package/dist/components/Tabs/Tabs.utils.d.ts +3 -0
- package/dist/components/Tabs/Tabs.utils.js +29 -1
- package/dist/components/Tabs/components/TabBar/TabBar.js +12 -10
- package/dist/components/Tabs/components/TabBar/TabBar.styles.d.ts +1 -1
- package/dist/components/Tabs/components/TabBar/TabBar.styles.js +3 -9
- package/dist/components/Tabs/components/TabItem/TabItem.js +24 -8
- package/dist/components/Tabs/components/TabItem/TabItem.types.d.ts +2 -0
- package/dist/components/Tabs/hooks/useMoreTabsController.d.ts +4 -1
- package/dist/components/Tabs/hooks/useMoreTabsController.js +37 -6
- package/dist/components/Tabs/hooks/useTabsDndController.d.ts +1 -2
- package/dist/components/Tabs/hooks/useTabsDndController.js +7 -4
- package/package.json +1 -1
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
import { ComponentProps, CSSProperties, ReactNode
|
|
1
|
+
import { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { GetComponentProps, TableComponents } from './interfaces/tableComponents.types';
|
|
3
3
|
import { Column, Columns } from './interfaces/tableColumns.types';
|
|
4
4
|
import { SortOrder, SorterResult } from './features/tableSort';
|
|
5
5
|
import { TableRowSelection } from './features/tableRowSelection';
|
|
6
6
|
import { ExpandableConfig } from './features/tableExpand';
|
|
7
|
-
import { Theme } from 'themes';
|
|
7
|
+
import { Theme } from '../../themes';
|
|
8
8
|
import { Interpolation } from '@emotion/react';
|
|
9
9
|
import { TableTokens } from './Table.tokens';
|
|
10
10
|
import { SpinProps } from 'components/Spin';
|
|
11
|
+
import { ScrollParams } from './hooks/useTableVisualParamsChange';
|
|
11
12
|
export type Key = string | number;
|
|
13
|
+
export interface Bordered {
|
|
14
|
+
baseBorder: boolean;
|
|
15
|
+
firstColumnCellInlineStart: boolean;
|
|
16
|
+
lastColumnCellInlineEnd: boolean;
|
|
17
|
+
emptyInline: boolean;
|
|
18
|
+
emptyBlockEnd: boolean;
|
|
19
|
+
}
|
|
12
20
|
export interface BorderedConfig {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
table?: boolean | {
|
|
22
|
+
baseBorder?: boolean;
|
|
23
|
+
firstColumnCellInlineStart?: boolean;
|
|
24
|
+
lastColumnCellInlineEnd?: boolean;
|
|
25
|
+
};
|
|
26
|
+
empty?: boolean | {
|
|
27
|
+
inline?: boolean;
|
|
28
|
+
blockEnd?: boolean;
|
|
29
|
+
};
|
|
17
30
|
}
|
|
18
31
|
type GetStyle = (tableTokens: TableTokens, theme: Theme) => Interpolation;
|
|
19
32
|
export interface DefaultRecord<R extends DefaultRecord<R> = any> extends Record<string | number | symbol, any> {
|
|
@@ -28,26 +41,33 @@ export interface TableProps<Record extends DefaultRecord | null = DefaultRecord>
|
|
|
28
41
|
rowSelection?: TableRowSelection<Record>;
|
|
29
42
|
sortDirections?: SortOrder[];
|
|
30
43
|
onChange?: (sorter: SorterResult<Record>) => void;
|
|
31
|
-
onRow?: GetComponentProps<Record, ComponentProps<"tr"
|
|
44
|
+
onRow?: GetComponentProps<Record, ComponentProps<"tr"> & {
|
|
45
|
+
rowHoverable?: boolean;
|
|
46
|
+
}>;
|
|
32
47
|
onHeaderRow?: GetComponentProps<readonly Column<Record>[], ComponentProps<"tr">>;
|
|
33
48
|
tableLayout?: TableLayout;
|
|
34
49
|
scroll?: {
|
|
35
50
|
x?: CSSProperties["width"] | true;
|
|
36
51
|
y?: CSSProperties["maxHeight"];
|
|
37
52
|
};
|
|
53
|
+
/** @default true */
|
|
38
54
|
showHeader?: boolean;
|
|
39
|
-
onScroll?:
|
|
55
|
+
onScroll?: (params: ScrollParams) => void;
|
|
40
56
|
bordered?: boolean | BorderedConfig;
|
|
41
57
|
styles?: {
|
|
42
58
|
table?: GetStyle;
|
|
43
59
|
tableContainer?: GetStyle;
|
|
44
60
|
tableBodyComponentWrapper?: GetStyle;
|
|
61
|
+
tableContentComponent?: GetStyle;
|
|
45
62
|
};
|
|
46
63
|
footer?: (data: readonly Record[], info: {
|
|
47
64
|
verticalScrollBarWidth: number;
|
|
48
65
|
hasHorizontalScroll: boolean;
|
|
49
66
|
}) => ReactNode;
|
|
67
|
+
/** @default false */
|
|
50
68
|
loading?: boolean | Omit<SpinProps, "children" | "fullscreen">;
|
|
69
|
+
/** @default true */
|
|
70
|
+
rowHoverable?: boolean;
|
|
51
71
|
}
|
|
52
72
|
export type TableLayout = "auto" | "fixed";
|
|
53
73
|
export {};
|
|
@@ -58,7 +58,7 @@ const BodyComponent = (props) => {
|
|
|
58
58
|
}
|
|
59
59
|
return /* @__PURE__ */ jsx(EmptyDataRow, {});
|
|
60
60
|
})();
|
|
61
|
-
return /* @__PURE__ */ jsx(TableExpandedContext.Provider, { value: tableExpandedContextValue, children: /* @__PURE__ */ jsxs(BodyWrapperComponent, { css: tBodyStyle(theme), className: "
|
|
61
|
+
return /* @__PURE__ */ jsx(TableExpandedContext.Provider, { value: tableExpandedContextValue, children: /* @__PURE__ */ jsxs(BodyWrapperComponent, { css: tBodyStyle(theme), className: "ui-kit-table-tbody", children: [
|
|
62
62
|
needMeasureColumnWidth && /* @__PURE__ */ jsx(MeasureRow, {}),
|
|
63
63
|
rows
|
|
64
64
|
] }) });
|
|
@@ -22,7 +22,9 @@ const BodyCellComponent = (props) => {
|
|
|
22
22
|
rowKey,
|
|
23
23
|
intent,
|
|
24
24
|
renderIndex,
|
|
25
|
-
isRowSelected
|
|
25
|
+
isRowSelected,
|
|
26
|
+
rowHoverable: rowHoverableProp,
|
|
27
|
+
children: childrenProp
|
|
26
28
|
} = props;
|
|
27
29
|
const {
|
|
28
30
|
rowScope,
|
|
@@ -37,9 +39,11 @@ const BodyCellComponent = (props) => {
|
|
|
37
39
|
expandIconColumnIndex,
|
|
38
40
|
bordered,
|
|
39
41
|
tableTokens,
|
|
40
|
-
showHeader
|
|
42
|
+
showHeader,
|
|
43
|
+
rowHoverable: contextRowHoverable
|
|
41
44
|
} = useTableContext();
|
|
42
45
|
const staticContextRef = useTableStaticContext();
|
|
46
|
+
const rowHoverable = rowHoverableProp ?? contextRowHoverable;
|
|
43
47
|
const {
|
|
44
48
|
isFixStart,
|
|
45
49
|
isFixEnd,
|
|
@@ -104,7 +108,7 @@ const BodyCellComponent = (props) => {
|
|
|
104
108
|
prefixNode,
|
|
105
109
|
children
|
|
106
110
|
] }), [CellInnerWrapper, children, indentSize, intent, prefixNode, theme]);
|
|
107
|
-
return /* @__PURE__ */ jsx(Cell, { component: rowScope ? getComponent(["body", "cell"], "th") : getComponent(["body", "cell"], "td"), align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [bodyCellStyle(tableTokens), bordered ? getBorderedBodyCellStyle(bordered) : void 0, bordered && !showHeader ? nonHeaderBorderedBodyCellStyle(tableTokens) : void 0, ...getFixedCellStyle({
|
|
111
|
+
return /* @__PURE__ */ jsx(Cell, { component: rowScope ? getComponent(["body", "cell"], "th") : getComponent(["body", "cell"], "td"), align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [bodyCellStyle(tableTokens), bordered.baseBorder ? getBorderedBodyCellStyle(bordered) : void 0, bordered.baseBorder && !showHeader ? nonHeaderBorderedBodyCellStyle(tableTokens) : void 0, ...getFixedCellStyle({
|
|
108
112
|
columnKey: column.key,
|
|
109
113
|
isFixStart,
|
|
110
114
|
isFixEnd,
|
|
@@ -115,7 +119,7 @@ const BodyCellComponent = (props) => {
|
|
|
115
119
|
fixedEndShadow,
|
|
116
120
|
showFixStartShadow,
|
|
117
121
|
showFixEndShadow
|
|
118
|
-
}), cellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
122
|
+
}), cellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9Cb2R5L2NvbXBvbmVudHMvQm9keUNlbGwvQm9keUNlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVKTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvQm9keS9jb21wb25lbnRzL0JvZHlDZWxsL0JvZHlDZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZyYWdtZW50LCB1c2VNZW1vLCB0eXBlIE1vdXNlRXZlbnRIYW5kbGVyIH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgdHlwZSB7IEJvZHlDZWxsUHJvcHMgfSBmcm9tIFwiLi9Cb2R5Q2VsbC50eXBlc1wiO1xuaW1wb3J0IHsgQ2VsbCB9IGZyb20gXCIuLi8uLi8uLi9DZWxsL0NlbGxcIjtcbmltcG9ydCB7IHVzZUNlbGxIb3ZlciB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2hvb2tzL3VzZUNlbGxIb3ZlclwiO1xuaW1wb3J0IHsgdXNlQm9keUNlbGxSZW5kZXIgfSBmcm9tIFwiY29tcG9uZW50cy9UYWJsZS9ob29rcy91c2VCb2R5Q2VsbFJlbmRlclwiO1xuaW1wb3J0IHR5cGUgeyBEZWZhdWx0UmVjb3JkIH0gZnJvbSBcImNvbXBvbmVudHMvVGFibGUvVGFibGUudHlwZXNcIjtcbmltcG9ydCB7IHVzZVRhYmxlQ29udGV4dCB9IGZyb20gXCJjb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4gICAgICAgICAgOiB1bmRlZmluZWQsXG4gICAgICAgIC4uLmdldEZpeGVkQ2VsbFN0eWxlKHtcbiAgICAgICAgICBjb2x1bW5LZXk6IGNvbHVtbi5rZXksXG4gICAgICAgICAgaXNGaXhTdGFydCxcbiAgICAgICAgICBpc0ZpeEVuZCxcbiAgICAgICAgICBmaXhTdGFydCxcbiAgICAgICAgICBmaXhFbmQsXG4gICAgICAgICAgekluZGV4UmV2ZXJzZSxcbiAgICAgICAgICBmaXhlZFN0YXJ0U2hhZG93LFxuICAgICAgICAgIGZpeGVkRW5kU2hhZG93LFxuICAgICAgICAgIHNob3dGaXhTdGFydFNoYWRvdyxcbiAgICAgICAgICBzaG93Rml4RW5kU2hhZG93LFxuICAgICAgICB9KSxcbiAgICAgICAgY2VsbENzcyxcbiAgICAgIF19XG4gICAgICByb3dTcGFuPXtjZWxsUm93U3Bhbn1cbiAgICAgIGNvbFNwYW49e2NlbGxDb2xTcGFufVxuICAgICAgb25Nb3VzZUVudGVyPXtyb3dIb3ZlcmFibGUgPyBoYW5kbGVNb3VzZUVudGVyIDogdW5kZWZpbmVkfVxuICAgICAgb25Nb3VzZUxlYXZlPXtyb3dIb3ZlcmFibGUgPyBoYW5kbGVNb3VzZUxlYXZlIDogdW5kZWZpbmVkfVxuICAgICAgey4uLnJlc3RBZGRpdGlvbmFsQ2VsbFByb3BzfVxuICAgICAgc2NvcGU9e3Jvd1Njb3BlfVxuICAgICAgaXNIb3ZlcmVkPXtpc0hvdmVyZWR9XG4gICAgICBpc1Jvd1NlbGVjdGVkPXtpc1Jvd1NlbGVjdGVkfVxuICAgID5cbiAgICAgIHtjaGlsZHJlblByb3AgfHwgY29udGVudH1cbiAgICA8L0NlbGw+XG4gICk7XG59O1xuXG5leHBvcnQgY29uc3QgQm9keUNlbGwgPSBCb2R5Q2VsbENvbXBvbmVudDtcbiJdfQ== */"], rowSpan: cellRowSpan, colSpan: cellColSpan, onMouseEnter: rowHoverable ? handleMouseEnter : void 0, onMouseLeave: rowHoverable ? handleMouseLeave : void 0, ...restAdditionalCellProps, scope: rowScope, isHovered, isRowSelected, children: childrenProp || content });
|
|
119
123
|
};
|
|
120
124
|
const BodyCell = BodyCellComponent;
|
|
121
125
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
-
import {
|
|
2
|
+
import { Bordered } from 'components/Table/Table.types';
|
|
3
3
|
import { Theme } from 'themes';
|
|
4
4
|
export declare const getCellInnerWrapperStyle: (indentSize: number, intent: number) => (theme: Theme) => {
|
|
5
5
|
display: string;
|
|
@@ -10,7 +10,7 @@ export declare const bodyCellStyle: (tableTokens: TableTokens) => {
|
|
|
10
10
|
borderColor: "#E5E5E5";
|
|
11
11
|
backgroundColor: "#FFFFFF";
|
|
12
12
|
};
|
|
13
|
-
export declare const getBorderedBodyCellStyle: (
|
|
13
|
+
export declare const getBorderedBodyCellStyle: (bordered: Bordered) => {
|
|
14
14
|
":last-of-type": {
|
|
15
15
|
borderInlineEndWidth: number;
|
|
16
16
|
};
|
|
@@ -7,15 +7,15 @@ const bodyCellStyle = (tableTokens) => ({
|
|
|
7
7
|
borderColor: tableTokens.tableRowBorder,
|
|
8
8
|
backgroundColor: tableTokens.tableRowBg
|
|
9
9
|
});
|
|
10
|
-
const getBorderedBodyCellStyle = (
|
|
10
|
+
const getBorderedBodyCellStyle = (bordered) => ({
|
|
11
11
|
borderInlineEndWidth: 1,
|
|
12
|
-
...
|
|
12
|
+
...bordered.firstColumnCellInlineStart ? {
|
|
13
13
|
":first-of-type": {
|
|
14
14
|
borderInlineStartWidth: 1
|
|
15
15
|
}
|
|
16
16
|
} : {},
|
|
17
17
|
":last-of-type": {
|
|
18
|
-
borderInlineEndWidth:
|
|
18
|
+
borderInlineEndWidth: bordered.lastColumnCellInlineEnd ? 1 : 0
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
const nonHeaderBorderedBodyCellStyle = (tableTokens) => ({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Column } from 'components/Table/interfaces/tableColumns.types';
|
|
2
2
|
import { Key } from 'components/Table/Table.types';
|
|
3
|
-
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
export interface BodyCellProps<Record> extends PropsWithChildren {
|
|
4
5
|
column: Column<Record>;
|
|
5
6
|
record: Record;
|
|
6
7
|
index: number;
|
|
@@ -9,4 +10,5 @@ export interface BodyCellProps<Record> {
|
|
|
9
10
|
intent: number;
|
|
10
11
|
renderIndex: number;
|
|
11
12
|
isRowSelected: boolean;
|
|
13
|
+
rowHoverable?: boolean;
|
|
12
14
|
}
|
|
@@ -30,10 +30,13 @@ const BodyRowComponent = (props) => {
|
|
|
30
30
|
} = value;
|
|
31
31
|
setRowSelected(selectedKeySet.has(rowKey));
|
|
32
32
|
}, false, [rowKey]);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}) }
|
|
33
|
+
const {
|
|
34
|
+
key,
|
|
35
|
+
...restRowProps
|
|
36
|
+
} = (onRow == null ? void 0 : onRow(record, index)) || {};
|
|
37
|
+
return /* @__PURE__ */ jsx(BodyRowComponent2, { ...restRowProps, "data-row-key": rowKey, children: flattedColumns.map((column, colIndex) => {
|
|
38
|
+
return /* @__PURE__ */ jsx(BodyCell, { colIndex, column, record, index, rowKey, intent, renderIndex, isRowSelected, rowHoverable: restRowProps == null ? void 0 : restRowProps.rowHoverable }, column.key || colIndex);
|
|
39
|
+
}) }, key);
|
|
37
40
|
};
|
|
38
41
|
const BodyRow = memo(BodyRowComponent);
|
|
39
42
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useRef, useLayoutEffect } from "react";
|
|
2
|
+
import { useRef, useLayoutEffect, useCallback } from "react";
|
|
3
3
|
import ResizeObserver from "rc-resize-observer";
|
|
4
4
|
import { measureCellStyle, titleWrapperStyle } from "./MeasureCell.styles.js";
|
|
5
5
|
import { roundToHundredths } from "../MeasureRow/MeasureRow.utils.js";
|
|
@@ -8,7 +8,8 @@ import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
|
8
8
|
const MeasureCellComponent = (props) => {
|
|
9
9
|
const {
|
|
10
10
|
columnKey,
|
|
11
|
-
title
|
|
11
|
+
title,
|
|
12
|
+
index
|
|
12
13
|
} = props;
|
|
13
14
|
const staticContextRef = useTableStaticContext();
|
|
14
15
|
const tdRef = useRef(null);
|
|
@@ -26,7 +27,14 @@ const MeasureCellComponent = (props) => {
|
|
|
26
27
|
colsWidthsMap.delete(columnKey);
|
|
27
28
|
};
|
|
28
29
|
}, [columnKey, staticContextRef]);
|
|
29
|
-
|
|
30
|
+
const handleResize = useCallback((size) => {
|
|
31
|
+
const headerColgroupRef = getRefValue(staticContextRef, "headerColgroupRef");
|
|
32
|
+
if (!headerColgroupRef) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
headerColgroupRef.style.setProperty(`--col${index}-width`, `${roundToHundredths(size.offsetWidth)}px`);
|
|
36
|
+
}, [index, staticContextRef]);
|
|
37
|
+
return /* @__PURE__ */ jsx(ResizeObserver, { data: columnKey, onResize: handleResize, children: /* @__PURE__ */ jsx("td", { ref: tdRef, css: measureCellStyle, children: /* @__PURE__ */ jsx("div", { css: titleWrapperStyle, children: title }) }) });
|
|
30
38
|
};
|
|
31
39
|
const MeasureCell = MeasureCellComponent;
|
|
32
40
|
export {
|
|
@@ -83,8 +83,8 @@ const MeasureRowComponent = () => {
|
|
|
83
83
|
key,
|
|
84
84
|
title,
|
|
85
85
|
colSpan
|
|
86
|
-
}) => {
|
|
87
|
-
return /* @__PURE__ */ jsx(MeasureCell, { columnKey: key, title: key === selectionColumnKey || isNumber(colSpan) && colSpan !== 1 ? void 0 : title }, key);
|
|
86
|
+
}, index) => {
|
|
87
|
+
return /* @__PURE__ */ jsx(MeasureCell, { index, columnKey: key, title: key === selectionColumnKey || isNumber(colSpan) && colSpan !== 1 ? void 0 : title }, key);
|
|
88
88
|
}) }) });
|
|
89
89
|
};
|
|
90
90
|
const MeasureRow = MeasureRowComponent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
-
import {
|
|
2
|
+
import { Bordered } from 'components/Table/Table.types';
|
|
3
3
|
import { CellProps } from './Cell.types';
|
|
4
|
-
export declare const getCellStyle: (tableTokens: TableTokens, bordered
|
|
4
|
+
export declare const getCellStyle: (tableTokens: TableTokens, bordered: Bordered) => {
|
|
5
5
|
readonly boxSizing: "border-box";
|
|
6
6
|
readonly padding: 0;
|
|
7
7
|
readonly borderWidth: 0;
|
|
@@ -6,12 +6,12 @@ const getCellStyle = (tableTokens, bordered) => ({
|
|
|
6
6
|
borderBottomWidth: 1,
|
|
7
7
|
paddingTop: tableTokens.tableCellPaddingVertical,
|
|
8
8
|
paddingBottom: tableTokens.tableCellPaddingVertical - 1,
|
|
9
|
-
paddingInline: bordered ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal,
|
|
9
|
+
paddingInline: bordered.baseBorder ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal,
|
|
10
10
|
":first-of-type": {
|
|
11
|
-
paddingInlineStart: bordered && bordered.firstColumnCellInlineStart ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
11
|
+
paddingInlineStart: bordered.baseBorder && bordered.firstColumnCellInlineStart ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
12
12
|
},
|
|
13
13
|
":last-of-type": {
|
|
14
|
-
paddingInlineEnd: bordered && bordered.lastColumnCellInlineEnd ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
14
|
+
paddingInlineEnd: bordered.baseBorder && bordered.lastColumnCellInlineEnd ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
const getCellBackgroundStyle = (tableTokens, isRowSelected, isHovered) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType, CSSProperties, PropsWithChildren, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
2
|
import { CellEllipsisType, ScopeType } from '../../interfaces/tableColumns.types';
|
|
3
3
|
import { TableTokens } from 'components/Table/Table.tokens';
|
|
4
|
-
import {
|
|
4
|
+
import { Bordered } from 'components/Table/Table.types';
|
|
5
5
|
export interface CellProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, "align">, Omit<TdHTMLAttributes<HTMLTableCellElement>, "align">, PropsWithChildren {
|
|
6
6
|
component: "th" | "td" | ComponentType<JSX.IntrinsicElements["td"] | JSX.IntrinsicElements["th"]>;
|
|
7
7
|
colSpan?: number;
|
|
@@ -11,6 +11,6 @@ export interface CellProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>,
|
|
|
11
11
|
isRowSelected?: boolean;
|
|
12
12
|
align?: CSSProperties["textAlign"];
|
|
13
13
|
ellipsis?: CellEllipsisType;
|
|
14
|
-
bordered
|
|
14
|
+
bordered: Bordered;
|
|
15
15
|
tableTokens: TableTokens;
|
|
16
16
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { memo, useContext, useState, useMemo } from "react";
|
|
3
3
|
import { useSubscribe } from "../../features/typedEventBus/hooks.js";
|
|
4
|
-
import { isUndefined,
|
|
5
|
-
import { getCellStyle,
|
|
4
|
+
import { isUndefined, isNumber } from "lodash-es";
|
|
5
|
+
import { getCellStyle, borderedCellStyle, emptyWrapperStyle } from "./EmptyDataRow.styles.js";
|
|
6
6
|
import { getEndRangeInfo } from "./EmptyDataRow.utils.js";
|
|
7
7
|
import { ConfigContext } from "../../../ConfigProvider/contexts/ConfigContext.js";
|
|
8
8
|
import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
@@ -54,11 +54,11 @@ const EmptyDataRowComponent = () => {
|
|
|
54
54
|
}
|
|
55
55
|
return /* @__PURE__ */ jsx(Empty, {});
|
|
56
56
|
}, [renderEmpty]);
|
|
57
|
-
const hasInlineBorder =
|
|
58
|
-
const hasBlockEndBorder =
|
|
57
|
+
const hasInlineBorder = bordered.emptyInline;
|
|
58
|
+
const hasBlockEndBorder = bordered.emptyBlockEnd;
|
|
59
59
|
return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { css: [cellOverflowX ? {
|
|
60
60
|
overflowX: cellOverflowX
|
|
61
|
-
} : void 0, getCellStyle(tableTokens, hasBlockEndBorder),
|
|
61
|
+
} : void 0, getCellStyle(tableTokens, hasBlockEndBorder), hasInlineBorder ? borderedCellStyle : void 0, process.env.NODE_ENV === "production" ? "" : ";label:EmptyDataRowComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9FbXB0eURhdGFSb3cvRW1wdHlEYXRhUm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrRVEiLCJmaWxlIjoiL2J1aWxkcy9mcm9udGVuZC9saWJzL3VpLWtpdC9zcmMvY29tcG9uZW50cy9UYWJsZS9jb21wb25lbnRzL0VtcHR5RGF0YVJvdy9FbXB0eURhdGFSb3cudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgbWVtbywgdXNlQ29udGV4dCwgdXNlTWVtbywgdXNlU3RhdGUsIHR5cGUgQ1NTUHJvcGVydGllcywgdHlwZSBGQyB9IGZyb20gXCJyZWFjdFwiO1xuaW1wb3J0IHR5cGUgeyBFbXB0eURhdGFSb3dQcm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uICAgICAgICAgIGdldENlbGxTdHlsZSh0YWJsZVRva2VucywgaGFzQmxvY2tFbmRCb3JkZXIpLFxuICAgICAgICAgIGhhc0lubGluZUJvcmRlciA/IGJvcmRlcmVkQ2VsbFN0eWxlIDogdW5kZWZpbmVkLFxuICAgICAgICBdfVxuICAgICAgICBjb2xTcGFuPXtmbGF0dGVkQ29sdW1ucy5sZW5ndGh9XG4gICAgICA+XG4gICAgICAgIDxkaXZcbiAgICAgICAgICBzdHlsZT17XG4gICAgICAgICAgICBob3Jpem9uU2Nyb2xsXG4gICAgICAgICAgICAgID8ge1xuICAgICAgICAgICAgICAgICAgd2lkdGg6XG4gICAgICAgICAgICAgICAgICAgIGlzTnVtYmVyKGNsaWVudFdpZHRoKSAmJiBjbGllbnRXaWR0aCA+IDAgJiYgaGFzSW5saW5lQm9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgPyBjbGllbnRXaWR0aCAtIDJcbiAgICAgICAgICAgICAgICAgICAgICA6IGNsaWVudFdpZHRoLFxuICAgICAgICAgICAgICAgICAgbGVmdDogaGFzSW5saW5lQm9yZGVyID8gMSA6IDAsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICA6IHVuZGVmaW5lZFxuICAgICAgICAgIH1cbiAgICAgICAgICBjc3M9e2hvcml6b25TY3JvbGwgPyBlbXB0eVdyYXBwZXJTdHlsZSA6IHVuZGVmaW5lZH1cbiAgICAgICAgPlxuICAgICAgICAgIHtlbXB0eX1cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L3RkPlxuICAgIDwvdHI+XG4gICk7XG59O1xuXG5leHBvcnQgY29uc3QgRW1wdHlEYXRhUm93ID0gbWVtbyhFbXB0eURhdGFSb3dDb21wb25lbnQpO1xuIl19 */"], colSpan: flattedColumns.length, children: /* @__PURE__ */ jsx("div", { style: horizonScroll ? {
|
|
62
62
|
width: isNumber(clientWidth) && clientWidth > 0 && hasInlineBorder ? clientWidth - 2 : clientWidth,
|
|
63
63
|
left: hasInlineBorder ? 1 : 0
|
|
64
64
|
} : void 0, css: horizonScroll ? emptyWrapperStyle : void 0, children: empty }) }) });
|
|
@@ -7,10 +7,10 @@ export declare const getCellStyle: (tableTokens: TableTokens, hasBlockEndBorder:
|
|
|
7
7
|
borderWidth: number;
|
|
8
8
|
backgroundColor: "#FFFFFF";
|
|
9
9
|
};
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const borderedCellStyle: {
|
|
11
11
|
borderInlineStartWidth: number;
|
|
12
12
|
borderInlineEndWidth: number;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
export declare const emptyWrapperStyle: {
|
|
15
15
|
readonly position: "sticky";
|
|
16
16
|
};
|
|
@@ -8,20 +8,15 @@ const getCellStyle = (tableTokens, hasBlockEndBorder) => ({
|
|
|
8
8
|
borderBlockEndWidth: 1
|
|
9
9
|
} : {}
|
|
10
10
|
});
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
borderInlineStartWidth: 1,
|
|
17
|
-
borderInlineEndWidth: 1
|
|
18
|
-
};
|
|
11
|
+
const borderedCellStyle = {
|
|
12
|
+
borderInlineStartWidth: 1,
|
|
13
|
+
borderInlineEndWidth: 1
|
|
19
14
|
};
|
|
20
15
|
const emptyWrapperStyle = {
|
|
21
16
|
position: "sticky"
|
|
22
17
|
};
|
|
23
18
|
export {
|
|
19
|
+
borderedCellStyle,
|
|
24
20
|
emptyWrapperStyle,
|
|
25
|
-
getBorderedCellStyle,
|
|
26
21
|
getCellStyle
|
|
27
22
|
};
|
|
@@ -14,7 +14,7 @@ const FixedHeaderComponent = (props, ref) => {
|
|
|
14
14
|
tableLayout
|
|
15
15
|
} = useTableContext();
|
|
16
16
|
const HeaderTableComponent = getComponent(["header", "table"], "table");
|
|
17
|
-
return /* @__PURE__ */ jsx("div", { className: "
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { className: "ui-kit-table-header", ref, onScroll, css: getTableComponentWrapperStyle("header"), children: /* @__PURE__ */ jsxs(HeaderTableComponent, { css: getTableComponentStyle("header", tableLayout, scrollX, void 0), children: [
|
|
18
18
|
/* @__PURE__ */ jsx(FixedHeaderColGroup, {}),
|
|
19
19
|
/* @__PURE__ */ jsx(Header, { fixedHeader: true })
|
|
20
20
|
] }) });
|
|
@@ -2,30 +2,36 @@ import { jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
|
|
4
4
|
import { isNumber } from "lodash-es";
|
|
5
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
5
6
|
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
6
|
-
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
7
|
+
import { getRefValue, updateRefValue } from "../../../../utils/ref/ref.js";
|
|
7
8
|
const FixedHeaderColGroupComponent = () => {
|
|
9
|
+
const {
|
|
10
|
+
flattedColumns
|
|
11
|
+
} = useTableContext();
|
|
8
12
|
const staticContextRef = useTableStaticContext();
|
|
9
|
-
const [widths, setWidths] = useState(() => getRefValue(staticContextRef, "measureCellsInfo.widths"));
|
|
10
13
|
const [verticalScrollBarWidth, setVerticalScrollBarWidth] = useState(() => getRefValue(staticContextRef, "scrollableTableSectionInfo.verticalScrollBarWidth"));
|
|
11
14
|
useSubscribe("table-visual-params:change", (value) => {
|
|
12
15
|
const {
|
|
13
|
-
measureCellsInfo,
|
|
14
16
|
verticalScrollBarWidth: verticalScrollBarWidth2
|
|
15
17
|
} = value;
|
|
16
18
|
if (isNumber(verticalScrollBarWidth2)) {
|
|
17
19
|
setVerticalScrollBarWidth(verticalScrollBarWidth2);
|
|
18
20
|
}
|
|
19
|
-
if (measureCellsInfo) {
|
|
20
|
-
const {
|
|
21
|
-
widths: widths2
|
|
22
|
-
} = measureCellsInfo;
|
|
23
|
-
setWidths(widths2);
|
|
24
|
-
}
|
|
25
21
|
}, false, [], true);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const setColgroupRef = (el) => {
|
|
23
|
+
updateRefValue(staticContextRef, {
|
|
24
|
+
headerColgroupRef: el
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ jsx("colgroup", { ref: setColgroupRef, children: Array.from({
|
|
28
|
+
length: flattedColumns.length
|
|
29
|
+
}).map((_, i, arr) => {
|
|
30
|
+
const baseTemplate = `var(--col${i}-width)`;
|
|
31
|
+
return /* @__PURE__ */ jsx("col", { style: {
|
|
32
|
+
width: arr.length - 1 === i ? `calc(${baseTemplate} + ${verticalScrollBarWidth}px)` : baseTemplate
|
|
33
|
+
} }, i);
|
|
34
|
+
}) });
|
|
29
35
|
};
|
|
30
36
|
const FixedHeaderColGroup = FixedHeaderColGroupComponent;
|
|
31
37
|
export {
|
|
@@ -15,7 +15,7 @@ const HeaderComponent = (props) => {
|
|
|
15
15
|
} = useTableContext();
|
|
16
16
|
const HeaderWrapperComponent = getComponent(["header", "wrapper"], "thead");
|
|
17
17
|
const rows = useMemo(() => parseHeaderRows(columns), [columns]);
|
|
18
|
-
return /* @__PURE__ */ jsx(HeaderWrapperComponent, { css: tHeadStyle(tableTokens), className: "
|
|
18
|
+
return /* @__PURE__ */ jsx(HeaderWrapperComponent, { css: tHeadStyle(tableTokens), className: "ui-kit-table-thead", children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx(HeaderRow, { index: rowIndex, cells: row, fixedHeader }, rowIndex)) });
|
|
19
19
|
};
|
|
20
20
|
const Header = memo(HeaderComponent);
|
|
21
21
|
export {
|
|
@@ -44,7 +44,7 @@ const HeaderCellComponent = (props) => {
|
|
|
44
44
|
colStart,
|
|
45
45
|
colEnd
|
|
46
46
|
});
|
|
47
|
-
return /* @__PURE__ */ jsx(Cell, { component: HeaderCellComponent2, align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [headerCellStyle(tableTokens), bordered ? borderedHeaderCellStyle(tableTokens, bordered) : void 0, ...getFixedCellStyle({
|
|
47
|
+
return /* @__PURE__ */ jsx(Cell, { component: HeaderCellComponent2, align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [headerCellStyle(tableTokens), bordered.baseBorder ? borderedHeaderCellStyle(tableTokens, bordered) : void 0, ...getFixedCellStyle({
|
|
48
48
|
columnKey: column.key,
|
|
49
49
|
isFixStart,
|
|
50
50
|
isFixEnd,
|
|
@@ -55,7 +55,7 @@ const HeaderCellComponent = (props) => {
|
|
|
55
55
|
fixedEndShadow,
|
|
56
56
|
showFixStartShadow,
|
|
57
57
|
showFixEndShadow
|
|
58
|
-
}), headerCellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9IZWFkZXIvY29tcG9uZW50cy9IZWFkZXJDZWxsL0hlYWRlckNlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJDTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvSGVhZGVyL2NvbXBvbmVudHMvSGVhZGVyQ2VsbC9IZWFkZXJDZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgSGVhZGVyQ2VsbFByb3BzIH0gZnJvbSBcIi4vSGVhZGVyQ2VsbC50eXBlc1wiO1xuaW1wb3J0IHsgQ2VsbCB9IGZyb20gXCIuLi8uLi8uLi9DZWxsL0NlbGxcIjtcbmltcG9ydCB7IHVzZVRhYmxlQ29udGV4dCB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2NvbnRleHRzXCI7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YWRlckNlbGw/
|
|
58
|
+
}), headerCellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9IZWFkZXIvY29tcG9uZW50cy9IZWFkZXJDZWxsL0hlYWRlckNlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJDTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvSGVhZGVyL2NvbXBvbmVudHMvSGVhZGVyQ2VsbC9IZWFkZXJDZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgSGVhZGVyQ2VsbFByb3BzIH0gZnJvbSBcIi4vSGVhZGVyQ2VsbC50eXBlc1wiO1xuaW1wb3J0IHsgQ2VsbCB9IGZyb20gXCIuLi8uLi8uLi9DZWxsL0NlbGxcIjtcbmltcG9ydCB7IHVzZVRhYmxlQ29udGV4dCB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2NvbnRleHRzXCI7XG5pbXBvcnQgeyB1c2VDZWxsRml4ZWRJbmZvLCBnZXRGaXhlZENlbGxTdHlsZSB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2hvb2tzL3VzZUNlbGxGaXhlZEluZm9cIjtcbmltcG9ydCB0eXBlIHsgRGVmYXVsdFJlY29yZCB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL1RhYmxlLnR5cGVzXCI7XG5pbXBvcnQgeyBib3JkZXJlZEhlYWRlckNlbGxTdHlsZSwgaGVhZGVyQ2VsbFN0eWxlIH0gZnJvbSBcIi4vSGVhZGVyQ2VsbC5zdHlsZXNcIjtcbmltcG9ydCB7IGdldEhlYWRlckNl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sbENvbFNwYW4pfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0NlbGw+XG4gICk7XG59O1xuXG5leHBvcnQgY29uc3QgSGVhZGVyQ2VsbCA9IEhlYWRlckNlbGxDb21wb25lbnQ7XG4iXX0= */"], ...restAdditionalHeaderCellProps, colSpan: colSpan ?? cellColSpan, rowSpan: rowSpan ?? cellRowSpan, scope: getHeaderCellScope(column.title, cellColSpan), children });
|
|
59
59
|
};
|
|
60
60
|
const HeaderCell = HeaderCellComponent;
|
|
61
61
|
export {
|
package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
-
import {
|
|
2
|
+
import { Bordered } from 'components/Table/Table.types';
|
|
3
3
|
export declare const headerCellStyle: (tableTokens: TableTokens) => {
|
|
4
4
|
readonly fontWeight: 400;
|
|
5
5
|
readonly textAlign: "left";
|
|
6
6
|
readonly borderColor: "#D9D9D9";
|
|
7
7
|
readonly backgroundColor: "#FAFAFA";
|
|
8
8
|
};
|
|
9
|
-
export declare const borderedHeaderCellStyle: (tableTokens: TableTokens,
|
|
9
|
+
export declare const borderedHeaderCellStyle: (tableTokens: TableTokens, bordered: Bordered) => {
|
|
10
10
|
"tr:first-of-type > &:last-of-type": {
|
|
11
11
|
borderInlineEndWidth: number;
|
|
12
12
|
};
|
|
@@ -4,19 +4,19 @@ const headerCellStyle = (tableTokens) => ({
|
|
|
4
4
|
borderColor: tableTokens.tableHeaderBorder,
|
|
5
5
|
backgroundColor: tableTokens.tableHeaderBg
|
|
6
6
|
});
|
|
7
|
-
const borderedHeaderCellStyle = (tableTokens,
|
|
7
|
+
const borderedHeaderCellStyle = (tableTokens, bordered) => ({
|
|
8
8
|
borderInlineEndWidth: 1,
|
|
9
9
|
"tr:first-of-type > &": {
|
|
10
10
|
paddingTop: tableTokens.tableCellPaddingVertical - 1,
|
|
11
11
|
borderTopWidth: 1
|
|
12
12
|
},
|
|
13
|
-
...
|
|
13
|
+
...bordered.firstColumnCellInlineStart ? {
|
|
14
14
|
"tr:first-of-type > &:first-of-type": {
|
|
15
15
|
borderInlineStartWidth: 1
|
|
16
16
|
}
|
|
17
17
|
} : {},
|
|
18
18
|
"tr:first-of-type > &:last-of-type": {
|
|
19
|
-
borderInlineEndWidth:
|
|
19
|
+
borderInlineEndWidth: bordered.lastColumnCellInlineEnd ? 1 : 0
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
export {
|
|
@@ -13,7 +13,15 @@ const createTableContext = once(() => {
|
|
|
13
13
|
sortDirections: [],
|
|
14
14
|
tableLayout: "auto",
|
|
15
15
|
tableTokens: {},
|
|
16
|
-
showHeader: true
|
|
16
|
+
showHeader: true,
|
|
17
|
+
rowHoverable: true,
|
|
18
|
+
bordered: {
|
|
19
|
+
baseBorder: false,
|
|
20
|
+
firstColumnCellInlineStart: false,
|
|
21
|
+
lastColumnCellInlineEnd: false,
|
|
22
|
+
emptyInline: false,
|
|
23
|
+
emptyBlockEnd: false
|
|
24
|
+
}
|
|
17
25
|
});
|
|
18
26
|
});
|
|
19
27
|
export {
|
|
@@ -2,7 +2,7 @@ import { TableTokens } from 'components/Table/Table.tokens';
|
|
|
2
2
|
import { useTableExpand } from '../../features/tableExpand';
|
|
3
3
|
import { useTableColumns } from '../../hooks/useTableColumns';
|
|
4
4
|
import { useTableComponents } from '../../hooks/useTableComponents';
|
|
5
|
-
import {
|
|
5
|
+
import { Bordered, DefaultRecord, TableProps } from 'components/Table/Table.types';
|
|
6
6
|
type UseTableComponentsReturnType = ReturnType<typeof useTableComponents>;
|
|
7
7
|
type UseTableColumnsReturnType<Record extends DefaultRecord> = ReturnType<typeof useTableColumns<Record>>;
|
|
8
8
|
type UseTableExpandReturnType<Record extends DefaultRecord> = ReturnType<typeof useTableExpand<Record>>;
|
|
@@ -21,7 +21,8 @@ export interface TableContextValue<Record extends DefaultRecord> {
|
|
|
21
21
|
tableLayout: Exclude<TableProps["tableLayout"], undefined>;
|
|
22
22
|
onHeaderRow?: TableProps<Record>["onHeaderRow"];
|
|
23
23
|
onRow?: TableProps<Record>["onRow"];
|
|
24
|
-
bordered
|
|
24
|
+
bordered: Bordered;
|
|
25
|
+
rowHoverable: TableProps<Record>["rowHoverable"];
|
|
25
26
|
horizonScroll?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export {};
|