@infomaximum/ui-kit 0.17.1 → 0.17.3
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/BaseTooltip/BaseTooltip.js +14 -4
- package/dist/components/BaseTooltip/BaseTooltip.utils.d.ts +2 -1
- package/dist/components/BaseTooltip/BaseTooltip.utils.js +15 -2
- package/dist/components/Button/Button.types.d.ts +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.js +11 -4
- package/dist/components/Dropdown/Dropdown.js +2 -1
- package/dist/components/Dropdown/components/Menu/Menu.js +10 -7
- package/dist/components/Dropdown/contexts/dropdownContext.d.ts +0 -1
- package/dist/components/Dropdown/hooks/useSelectedKeysController.d.ts +0 -1
- package/dist/components/Dropdown/hooks/useSelectedKeysController.js +0 -4
- package/dist/components/Empty/components/images/BookmarkImg.js +8 -4
- package/dist/components/Empty/components/images/DefaultImg.js +8 -4
- package/dist/components/Empty/components/images/FilterImg.js +8 -4
- package/dist/components/Empty/components/images/LockedImg.js +8 -4
- package/dist/components/Empty/components/images/SearchImg.js +8 -4
- package/dist/components/Empty/components/images/TestingImg.js +8 -4
- package/dist/components/Empty/components/images/_404Img.js +8 -4
- package/dist/components/Spin/Spin.js +19 -32
- 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 +35 -37
- 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 +29 -8
- package/dist/components/Table/components/Body/Body.js +19 -10
- package/dist/components/Table/components/Body/Body.types.d.ts +1 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.js +25 -18
- 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/MeasureCell/MeasureCell.js +13 -4
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.types.d.ts +1 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.js +24 -18
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.d.ts +1 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.js +3 -1
- package/dist/components/Table/components/Cell/Cell.d.ts +1 -2
- package/dist/components/Table/components/Cell/Cell.js +4 -3
- package/dist/components/Table/components/Cell/Cell.styles.d.ts +8 -2
- package/dist/components/Table/components/Cell/Cell.styles.js +9 -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 +3 -2
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.js +5 -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/Footer/FooterWrapper.d.ts +3 -0
- package/dist/components/Table/components/Footer/FooterWrapper.js +36 -0
- package/dist/components/Table/components/Footer/FooterWrapper.types.d.ts +5 -0
- 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 +3 -2
- package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.js +1 -1
- package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.js +3 -2
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js +51 -40
- package/dist/components/Table/features/tableRowSelection/types.d.ts +3 -2
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.js +2 -2
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.d.ts +2 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.js +3 -1
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.types.d.ts +3 -0
- package/dist/components/Table/features/tableStaticContext/hocs/withTableStaticContext.js +6 -1
- package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.js +5 -2
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.js +20 -22
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.d.ts +4 -2
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.js +4 -3
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.d.ts +12 -1
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.js +43 -1
- package/dist/components/Table/hooks/useCellHover/useCellHover.d.ts +0 -4
- package/dist/components/Table/hooks/useCellHover/useCellHover.js +2 -4
- 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 +25 -8
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.d.ts +1 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.js +3 -1
- 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/dist/utils/eventBus/eventBus.d.ts +2 -1
- package/dist/utils/eventBus/eventBus.js +3 -0
- 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> {
|
|
@@ -35,16 +48,24 @@ export interface TableProps<Record extends DefaultRecord | null = DefaultRecord>
|
|
|
35
48
|
x?: CSSProperties["width"] | true;
|
|
36
49
|
y?: CSSProperties["maxHeight"];
|
|
37
50
|
};
|
|
51
|
+
/** @default true */
|
|
38
52
|
showHeader?: boolean;
|
|
39
|
-
onScroll?:
|
|
53
|
+
onScroll?: (params: ScrollParams) => void;
|
|
40
54
|
bordered?: boolean | BorderedConfig;
|
|
41
55
|
styles?: {
|
|
42
56
|
table?: GetStyle;
|
|
43
57
|
tableContainer?: GetStyle;
|
|
44
58
|
tableBodyComponentWrapper?: GetStyle;
|
|
59
|
+
tableContentComponent?: GetStyle;
|
|
45
60
|
};
|
|
46
|
-
footer?: (data: readonly Record[]
|
|
61
|
+
footer?: (data: readonly Record[], info: {
|
|
62
|
+
verticalScrollBarWidth: number;
|
|
63
|
+
hasHorizontalScroll: boolean;
|
|
64
|
+
}) => ReactNode;
|
|
65
|
+
/** @default false */
|
|
47
66
|
loading?: boolean | Omit<SpinProps, "children" | "fullscreen">;
|
|
67
|
+
/** @default true */
|
|
68
|
+
rowHoverable?: boolean;
|
|
48
69
|
}
|
|
49
70
|
export type TableLayout = "auto" | "fixed";
|
|
50
71
|
export {};
|
|
@@ -14,6 +14,7 @@ const BodyComponent = (props) => {
|
|
|
14
14
|
sortedData,
|
|
15
15
|
needMeasureColumnWidth,
|
|
16
16
|
expandable,
|
|
17
|
+
spinning,
|
|
17
18
|
renderNullifyBody
|
|
18
19
|
} = props;
|
|
19
20
|
const theme = useTheme();
|
|
@@ -40,16 +41,24 @@ const BodyComponent = (props) => {
|
|
|
40
41
|
if (renderNullifyBody) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
const rows =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
const rows = (() => {
|
|
45
|
+
if (flattedData.length === 0 && spinning) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (flattedData.length) {
|
|
49
|
+
return flattedData.map((item, idx) => {
|
|
50
|
+
const {
|
|
51
|
+
record,
|
|
52
|
+
indent,
|
|
53
|
+
index: renderIndex,
|
|
54
|
+
rowKey
|
|
55
|
+
} = item;
|
|
56
|
+
return /* @__PURE__ */ jsx(BodyRow, { index: idx, renderIndex, intent: indent, rowKey, record }, rowKey);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsx(EmptyDataRow, {});
|
|
60
|
+
})();
|
|
61
|
+
return /* @__PURE__ */ jsx(TableExpandedContext.Provider, { value: tableExpandedContextValue, children: /* @__PURE__ */ jsxs(BodyWrapperComponent, { css: tBodyStyle(theme), className: "ui-kit-table-tbody", children: [
|
|
53
62
|
needMeasureColumnWidth && /* @__PURE__ */ jsx(MeasureRow, {}),
|
|
54
63
|
rows
|
|
55
64
|
] }) });
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { Fragment } from "react";
|
|
2
|
+
import { useMemo, Fragment } from "react";
|
|
3
3
|
import { Cell } from "../../../Cell/Cell.js";
|
|
4
4
|
import { useCellHover } from "../../../../hooks/useCellHover/useCellHover.js";
|
|
5
5
|
import { useBodyCellRender } from "../../../../hooks/useBodyCellRender/useBodyCellRender.js";
|
|
6
6
|
import { useCellFixedInfo } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.js";
|
|
7
7
|
import { getFixedCellStyle } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.styles.js";
|
|
8
|
-
import { bodyCellStyle, getBorderedBodyCellStyle, nonHeaderBorderedBodyCellStyle
|
|
8
|
+
import { getCellInnerWrapperStyle, bodyCellStyle, getBorderedBodyCellStyle, nonHeaderBorderedBodyCellStyle } from "./BodyCell.styles.js";
|
|
9
|
+
import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
|
|
9
10
|
import { useTheme } from "../../../../../../hooks/useTheme/useTheme.js";
|
|
10
11
|
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
12
|
+
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
11
13
|
import { ExpandIconWrapper } from "../../../../features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.js";
|
|
14
|
+
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
12
15
|
const BodyCellComponent = (props) => {
|
|
13
16
|
var _a;
|
|
14
17
|
const {
|
|
@@ -34,8 +37,10 @@ const BodyCellComponent = (props) => {
|
|
|
34
37
|
expandIconColumnIndex,
|
|
35
38
|
bordered,
|
|
36
39
|
tableTokens,
|
|
37
|
-
showHeader
|
|
40
|
+
showHeader,
|
|
41
|
+
rowHoverable
|
|
38
42
|
} = useTableContext();
|
|
43
|
+
const staticContextRef = useTableStaticContext();
|
|
39
44
|
const {
|
|
40
45
|
isFixStart,
|
|
41
46
|
isFixEnd,
|
|
@@ -60,10 +65,9 @@ const BodyCellComponent = (props) => {
|
|
|
60
65
|
} = ((_a = column.onCell) == null ? void 0 : _a.call(column, record, index)) || {};
|
|
61
66
|
const notRenderedCell = cellColSpan === 0 || cellRowSpan === 0;
|
|
62
67
|
const rowSpan = cellRowSpan ?? 1;
|
|
63
|
-
const prefixNode = colIndex === expandIconColumnIndex && isSomeRecordHasChildren && /* @__PURE__ */ jsx(ExpandIconWrapper, { rowKey, record, expandable: record && Boolean(record.children) });
|
|
68
|
+
const prefixNode = useMemo(() => colIndex === expandIconColumnIndex && isSomeRecordHasChildren && /* @__PURE__ */ jsx(ExpandIconWrapper, { rowKey, record, expandable: record && Boolean(record.children) }), [colIndex, expandIconColumnIndex, isSomeRecordHasChildren, record, rowKey]);
|
|
64
69
|
const {
|
|
65
|
-
isHovered
|
|
66
|
-
emitCellHover
|
|
70
|
+
isHovered
|
|
67
71
|
} = useCellHover({
|
|
68
72
|
index,
|
|
69
73
|
rowSpan,
|
|
@@ -77,22 +81,31 @@ const BodyCellComponent = (props) => {
|
|
|
77
81
|
renderIndex,
|
|
78
82
|
render
|
|
79
83
|
});
|
|
80
|
-
const handleMouseEnter = (e) => {
|
|
84
|
+
const handleMouseEnter = useEvent((e) => {
|
|
85
|
+
const emitCellHover = getRefValue(staticContextRef, "emitCellHover");
|
|
81
86
|
emitCellHover({
|
|
82
87
|
start: index,
|
|
83
88
|
end: index + rowSpan - 1
|
|
84
89
|
});
|
|
85
90
|
cellOnMouseEnter == null ? void 0 : cellOnMouseEnter(e);
|
|
86
|
-
};
|
|
87
|
-
const handleMouseLeave = (e) => {
|
|
91
|
+
});
|
|
92
|
+
const handleMouseLeave = useEvent((e) => {
|
|
93
|
+
const emitCellHover = getRefValue(staticContextRef, "emitCellHover");
|
|
88
94
|
emitCellHover({
|
|
89
95
|
start: -1,
|
|
90
96
|
end: -1
|
|
91
97
|
});
|
|
92
98
|
cellOnMouseLeave == null ? void 0 : cellOnMouseLeave(e);
|
|
93
|
-
};
|
|
99
|
+
});
|
|
94
100
|
const CellInnerWrapper = prefixNode ? "div" : Fragment;
|
|
95
|
-
|
|
101
|
+
const content = useMemo(() => /* @__PURE__ */ jsxs(CellInnerWrapper, { ...prefixNode ? {
|
|
102
|
+
"data-indent-level": intent,
|
|
103
|
+
css: getCellInnerWrapperStyle(indentSize, intent)(theme)
|
|
104
|
+
} : {}, children: [
|
|
105
|
+
prefixNode,
|
|
106
|
+
children
|
|
107
|
+
] }), [CellInnerWrapper, children, indentSize, intent, prefixNode, theme]);
|
|
108
|
+
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({
|
|
96
109
|
columnKey: column.key,
|
|
97
110
|
isFixStart,
|
|
98
111
|
isFixEnd,
|
|
@@ -103,13 +116,7 @@ const BodyCellComponent = (props) => {
|
|
|
103
116
|
fixedEndShadow,
|
|
104
117
|
showFixStartShadow,
|
|
105
118
|
showFixEndShadow
|
|
106
|
-
}), cellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
107
|
-
"data-indent-level": intent,
|
|
108
|
-
css: getCellInnerWrapperStyle(indentSize, intent)(theme)
|
|
109
|
-
} : {}, children: [
|
|
110
|
-
prefixNode,
|
|
111
|
-
children
|
|
112
|
-
] }) });
|
|
119
|
+
}), cellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRl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XX1cbiAgICAgIHJvd1NwYW49e2NlbGxSb3dTcGFufVxuICAgICAgY29sU3Bhbj17Y2VsbENvbFNwYW59XG4gICAgICBvbk1vdXNlRW50ZXI9e3Jvd0hvdmVyYWJsZSA/IGhhbmRsZU1vdXNlRW50ZXIgOiB1bmRlZmluZWR9XG4gICAgICBvbk1vdXNlTGVhdmU9e3Jvd0hvdmVyYWJsZSA/IGhhbmRsZU1vdXNlTGVhdmUgOiB1bmRlZmluZWR9XG4gICAgICB7Li4ucmVzdEFkZGl0aW9uYWxDZWxsUHJvcHN9XG4gICAgICBzY29wZT17cm93U2NvcGV9XG4gICAgICBpc0hvdmVyZWQ9e2lzSG92ZXJlZH1cbiAgICAgIGlzUm93U2VsZWN0ZWQ9e2lzUm93U2VsZWN0ZWR9XG4gICAgPlxuICAgICAge2NvbnRlbnR9XG4gICAgPC9DZWxsPlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IEJvZHlDZWxsID0gQm9keUNlbGxDb21wb25lbnQ7XG4iXX0= */"], rowSpan: cellRowSpan, colSpan: cellColSpan, onMouseEnter: rowHoverable ? handleMouseEnter : void 0, onMouseLeave: rowHoverable ? handleMouseLeave : void 0, ...restAdditionalCellProps, scope: rowScope, isHovered, isRowSelected, children: content });
|
|
113
120
|
};
|
|
114
121
|
const BodyCell = BodyCellComponent;
|
|
115
122
|
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,13 +1,15 @@
|
|
|
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
|
+
import { roundToHundredths } from "../MeasureRow/MeasureRow.utils.js";
|
|
5
6
|
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
6
7
|
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
7
8
|
const MeasureCellComponent = (props) => {
|
|
8
9
|
const {
|
|
9
10
|
columnKey,
|
|
10
|
-
title
|
|
11
|
+
title,
|
|
12
|
+
index
|
|
11
13
|
} = props;
|
|
12
14
|
const staticContextRef = useTableStaticContext();
|
|
13
15
|
const tdRef = useRef(null);
|
|
@@ -20,12 +22,19 @@ const MeasureCellComponent = (props) => {
|
|
|
20
22
|
const {
|
|
21
23
|
width
|
|
22
24
|
} = td.getBoundingClientRect();
|
|
23
|
-
colsWidthsMap.set(columnKey, width);
|
|
25
|
+
colsWidthsMap.set(columnKey, roundToHundredths(width));
|
|
24
26
|
return () => {
|
|
25
27
|
colsWidthsMap.delete(columnKey);
|
|
26
28
|
};
|
|
27
29
|
}, [columnKey, staticContextRef]);
|
|
28
|
-
|
|
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 }) }) });
|
|
29
38
|
};
|
|
30
39
|
const MeasureCell = MeasureCellComponent;
|
|
31
40
|
export {
|
|
@@ -4,10 +4,12 @@ import { MeasureCell } from "../MeasureCell/MeasureCell.js";
|
|
|
4
4
|
import ResizeObserver from "rc-resize-observer";
|
|
5
5
|
import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
|
|
6
6
|
import { useEmitter } from "../../../../features/typedEventBus/hooks.js";
|
|
7
|
-
import { getColumnsKeys } from "./MeasureRow.utils.js";
|
|
7
|
+
import { getColumnsKeys, roundToHundredths } from "./MeasureRow.utils.js";
|
|
8
|
+
import { isNumber } from "lodash-es";
|
|
8
9
|
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
9
10
|
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
10
11
|
import { getRefValue, updateRefValue } from "../../../../utils/ref/ref.js";
|
|
12
|
+
import { selectionColumnKey } from "../../../../features/tableRowSelection/utils/const.js";
|
|
11
13
|
const MeasureRowComponent = () => {
|
|
12
14
|
const {
|
|
13
15
|
flattedColumns
|
|
@@ -24,11 +26,12 @@ const MeasureRowComponent = () => {
|
|
|
24
26
|
const {
|
|
25
27
|
offsetWidth
|
|
26
28
|
} = size;
|
|
29
|
+
const roundedOffsetWidth = roundToHundredths(offsetWidth);
|
|
27
30
|
if (!colsWidthsMap.has(data)) {
|
|
28
|
-
colsWidthsMap.set(data,
|
|
31
|
+
colsWidthsMap.set(data, roundedOffsetWidth);
|
|
29
32
|
}
|
|
30
|
-
if (
|
|
31
|
-
colsWidthsMap.set(data,
|
|
33
|
+
if (roundedOffsetWidth !== colsWidthsMap.get(data)) {
|
|
34
|
+
colsWidthsMap.set(data, roundedOffsetWidth);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
const colWidths = colsKeys.map((columnKey) => colsWidthsMap.get(columnKey) ?? -1);
|
|
@@ -57,28 +60,31 @@ const MeasureRowComponent = () => {
|
|
|
57
60
|
return measureCellsInfo;
|
|
58
61
|
}, [colsKeys, flattedColumns, staticContextRef]);
|
|
59
62
|
useLayoutEffect(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (isTableFirstMount) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
emitTableVisualParamsChange({
|
|
66
|
-
measureCellsInfo
|
|
67
|
-
});
|
|
68
|
-
}, [emitTableVisualParamsChange, staticContextRef, updateMeasureCellsInfo]);
|
|
63
|
+
updateMeasureCellsInfo([]);
|
|
64
|
+
}, [updateMeasureCellsInfo]);
|
|
69
65
|
const firstCallRef = useRef(true);
|
|
70
66
|
const handleBatchResize = useCallback((resizeInfo) => {
|
|
67
|
+
const measureCellsInfo = updateMeasureCellsInfo(resizeInfo);
|
|
68
|
+
const isTableFirstMount = getRefValue(staticContextRef, "isTableFirstMount");
|
|
69
|
+
const horizontalScrollPositionRange = getRefValue(staticContextRef, "scrollableTableSectionInfo.horizontalScrollPositionRange");
|
|
70
|
+
if (!isTableFirstMount) {
|
|
71
|
+
firstCallRef.current = false;
|
|
72
|
+
}
|
|
71
73
|
if (firstCallRef.current) {
|
|
72
74
|
firstCallRef.current = false;
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
|
-
const measureCellsInfo = updateMeasureCellsInfo(resizeInfo);
|
|
76
77
|
emitTableVisualParamsChange({
|
|
77
|
-
measureCellsInfo
|
|
78
|
+
measureCellsInfo,
|
|
79
|
+
horizontalScrollPositionRange
|
|
78
80
|
});
|
|
79
|
-
}, [emitTableVisualParamsChange, updateMeasureCellsInfo]);
|
|
80
|
-
return /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(ResizeObserver.Collection, { onBatchResize: handleBatchResize, children: flattedColumns.map((
|
|
81
|
-
|
|
81
|
+
}, [emitTableVisualParamsChange, staticContextRef, updateMeasureCellsInfo]);
|
|
82
|
+
return /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(ResizeObserver.Collection, { onBatchResize: handleBatchResize, children: flattedColumns.map(({
|
|
83
|
+
key,
|
|
84
|
+
title,
|
|
85
|
+
colSpan
|
|
86
|
+
}, index) => {
|
|
87
|
+
return /* @__PURE__ */ jsx(MeasureCell, { index, columnKey: key, title: key === selectionColumnKey || isNumber(colSpan) && colSpan !== 1 ? void 0 : title }, key);
|
|
82
88
|
}) }) });
|
|
83
89
|
};
|
|
84
90
|
const MeasureRow = MeasureRowComponent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { getCellStyle, getCellBackgroundStyle, ellipsisStyle, getAlignStyle } from "./Cell.styles.js";
|
|
3
4
|
const CellComponent = (props) => {
|
|
4
5
|
const {
|
|
5
6
|
component: Component,
|
|
@@ -17,9 +18,9 @@ const CellComponent = (props) => {
|
|
|
17
18
|
if (colSpan === 0 || rowSpan === 0) {
|
|
18
19
|
return null;
|
|
19
20
|
}
|
|
20
|
-
return /* @__PURE__ */ jsx(Component, { colSpan: colSpan === 1 ? void 0 : colSpan, rowSpan: rowSpan === 1 ? void 0 : rowSpan, ...rest, css: [getCellStyle(tableTokens, bordered), getCellBackgroundStyle(tableTokens, isRowSelected, isHovered), ellipsis ? ellipsisStyle : void 0, process.env.NODE_ENV === "production" ? "" : ";label:CellComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
21
|
+
return /* @__PURE__ */ jsx(Component, { colSpan: colSpan === 1 ? void 0 : colSpan, rowSpan: rowSpan === 1 ? void 0 : rowSpan, ...rest, css: [getCellStyle(tableTokens, bordered), getCellBackgroundStyle(tableTokens, isRowSelected, isHovered), ellipsis ? ellipsisStyle : void 0, getAlignStyle(align), process.env.NODE_ENV === "production" ? "" : ";label:CellComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9DZWxsL0NlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRCTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvQ2VsbC9DZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IG1lbW8sIHR5cGUgRkMgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB0eX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UoYWxpZ24pLFxuICAgICAgXX1cbiAgICA+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9Db21wb25lbnQ+XG4gICk7XG59O1xuXG5leHBvcnQgY29uc3QgQ2VsbCA9IG1lbW8oQ2VsbENvbXBvbmVudCk7XG4iXX0= */"], children });
|
|
21
22
|
};
|
|
22
|
-
const Cell = CellComponent;
|
|
23
|
+
const Cell = memo(CellComponent);
|
|
23
24
|
export {
|
|
24
25
|
Cell
|
|
25
26
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { Bordered } from 'components/Table/Table.types';
|
|
3
|
+
import { CellProps } from './Cell.types';
|
|
4
|
+
export declare const getCellStyle: (tableTokens: TableTokens, bordered: Bordered) => {
|
|
4
5
|
readonly boxSizing: "border-box";
|
|
5
6
|
readonly padding: 0;
|
|
6
7
|
readonly borderWidth: 0;
|
|
@@ -26,3 +27,8 @@ export declare const ellipsisStyle: {
|
|
|
26
27
|
whiteSpace: string;
|
|
27
28
|
overflow: string;
|
|
28
29
|
};
|
|
30
|
+
export declare const getAlignStyle: (align: CellProps["align"]) => {
|
|
31
|
+
"&": {
|
|
32
|
+
textAlign: import("csstype").Property.TextAlign | undefined;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -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) => ({
|
|
@@ -24,8 +24,14 @@ const ellipsisStyle = {
|
|
|
24
24
|
whiteSpace: "nowrap",
|
|
25
25
|
overflow: "hidden"
|
|
26
26
|
};
|
|
27
|
+
const getAlignStyle = (align) => ({
|
|
28
|
+
"&": {
|
|
29
|
+
textAlign: align
|
|
30
|
+
}
|
|
31
|
+
});
|
|
27
32
|
export {
|
|
28
33
|
ellipsisStyle,
|
|
34
|
+
getAlignStyle,
|
|
29
35
|
getCellBackgroundStyle,
|
|
30
36
|
getCellStyle
|
|
31
37
|
};
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9FbXB0eURhdGFSb3cvRW1wdHlEYXRhUm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrRVEiLCJmaWxlIjoiL2J1aWxkcy9mcm9udGVuZC9saWJzL3VpLWtpdC9zcmMvY29tcG9uZW50cy9UYWJsZS9jb21wb25lbnRzL0VtcHR5RGF0YVJvdy9FbXB0eURhdGFSb3cudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgbWVtbywgdXNlQ29udGV4dCwgdXNlTWVtbywgdXNlU3RhdGUsIHR5cGUgQ1NTUHJvcGVydGllcywgdHlwZSBGQyB9IGZyb20gXCJyZWFjdFwiO1xuaW1wb3J0IHR5cGUgeyBFbXB0eURhdGFSb3dQcm9wcyB9IGZyb20gXCIuL0VtcHR5RGF0YVJvdy50eXBlc1wiO1xuaW1wb3J0IHsgdXNlU3Vic2NyaWJlIH0gZnJvbSBcImNvbXBvbmVudHMvVGFibGUvZmVhdHVyZXMvdHlwZWRFdmVudEJ1c1wiO1xuaW1wb3J0IHsgaXNOdW1iZXIsIGlzVW5kZWZpbmVkIH0gZnJvbSBcImxvZGFzaC1lc1wiO1xuaW1wb3J0IHsgRW1wdHkgfSBmcm9tIFwiY29tcG9uZW50cy9FbXB0eVwiO1xuaW1wb3J0IHsgdXNlVGFibGVTdGF0aWNDb250ZXh0IH0gZnJvbSBcImNvbXBvbmVudHMvVGFibGUvZmVhdHVyZXMvdGFibGVTdGF0aWNDb250ZXh0XCI7XG5pbXBvcnQgeyBnZXRSZ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A+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 }) }) });
|
|
@@ -5,11 +5,12 @@ export declare const getCellStyle: (tableTokens: TableTokens, hasBlockEndBorder:
|
|
|
5
5
|
borderStyle: string;
|
|
6
6
|
borderColor: "#E5E5E5";
|
|
7
7
|
borderWidth: number;
|
|
8
|
+
backgroundColor: "#FFFFFF";
|
|
8
9
|
};
|
|
9
|
-
export declare const
|
|
10
|
+
export declare const borderedCellStyle: {
|
|
10
11
|
borderInlineStartWidth: number;
|
|
11
12
|
borderInlineEndWidth: number;
|
|
12
|
-
}
|
|
13
|
+
};
|
|
13
14
|
export declare const emptyWrapperStyle: {
|
|
14
15
|
readonly position: "sticky";
|
|
15
16
|
};
|
|
@@ -3,24 +3,20 @@ const getCellStyle = (tableTokens, hasBlockEndBorder) => ({
|
|
|
3
3
|
borderStyle: "solid",
|
|
4
4
|
borderColor: tableTokens.tableRowBorder,
|
|
5
5
|
borderWidth: 0,
|
|
6
|
+
backgroundColor: tableTokens.tableRowBg,
|
|
6
7
|
...hasBlockEndBorder ? {
|
|
7
8
|
borderBlockEndWidth: 1
|
|
8
9
|
} : {}
|
|
9
10
|
});
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
borderInlineStartWidth: 1,
|
|
16
|
-
borderInlineEndWidth: 1
|
|
17
|
-
};
|
|
11
|
+
const borderedCellStyle = {
|
|
12
|
+
borderInlineStartWidth: 1,
|
|
13
|
+
borderInlineEndWidth: 1
|
|
18
14
|
};
|
|
19
15
|
const emptyWrapperStyle = {
|
|
20
16
|
position: "sticky"
|
|
21
17
|
};
|
|
22
18
|
export {
|
|
19
|
+
borderedCellStyle,
|
|
23
20
|
emptyWrapperStyle,
|
|
24
|
-
getBorderedCellStyle,
|
|
25
21
|
getCellStyle
|
|
26
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
|
] }) });
|