@hi-ui/table 4.0.3 → 4.0.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/lib/cjs/TableBody.js
CHANGED
|
@@ -64,6 +64,7 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
64
64
|
onTableBodyScroll = _useTableContext.onTableBodyScroll,
|
|
65
65
|
maxHeight = _useTableContext.maxHeight,
|
|
66
66
|
canScroll = _useTableContext.canScroll,
|
|
67
|
+
scrollWidth = _useTableContext.scrollWidth,
|
|
67
68
|
hasAvgColumn = _useTableContext.hasAvgColumn,
|
|
68
69
|
avgRow = _useTableContext.avgRow,
|
|
69
70
|
hasSumColumn = _useTableContext.hasSumColumn,
|
|
@@ -96,7 +97,7 @@ var TableBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
96
97
|
}, /*#__PURE__*/React__default["default"].createElement("table", {
|
|
97
98
|
ref: bodyTableRef,
|
|
98
99
|
style: {
|
|
99
|
-
width: '100%'
|
|
100
|
+
width: canScroll && scrollWidth !== undefined ? scrollWidth : '100%'
|
|
100
101
|
}
|
|
101
102
|
}, /*#__PURE__*/React__default["default"].createElement("colgroup", null, leafColumns.map(function (col, idx) {
|
|
102
103
|
return /*#__PURE__*/React__default["default"].createElement("col", Object.assign({
|
package/lib/cjs/use-table.js
CHANGED
|
@@ -529,6 +529,7 @@ var useTable = function useTable(_a) {
|
|
|
529
529
|
}, [activeSorterColumn, activeSorterType, transitionData, columns]);
|
|
530
530
|
return Object.assign(Object.assign({
|
|
531
531
|
rootProps: rootProps,
|
|
532
|
+
scrollWidth: scrollWidth,
|
|
532
533
|
activeSorterColumn: activeSorterColumn,
|
|
533
534
|
setActiveSorterColumn: setActiveSorterColumn,
|
|
534
535
|
activeSorterType: activeSorterType,
|
package/lib/esm/TableBody.js
CHANGED
|
@@ -40,6 +40,7 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40
40
|
onTableBodyScroll = _useTableContext.onTableBodyScroll,
|
|
41
41
|
maxHeight = _useTableContext.maxHeight,
|
|
42
42
|
canScroll = _useTableContext.canScroll,
|
|
43
|
+
scrollWidth = _useTableContext.scrollWidth,
|
|
43
44
|
hasAvgColumn = _useTableContext.hasAvgColumn,
|
|
44
45
|
avgRow = _useTableContext.avgRow,
|
|
45
46
|
hasSumColumn = _useTableContext.hasSumColumn,
|
|
@@ -72,7 +73,7 @@ var TableBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
72
73
|
}, /*#__PURE__*/React.createElement("table", {
|
|
73
74
|
ref: bodyTableRef,
|
|
74
75
|
style: {
|
|
75
|
-
width: '100%'
|
|
76
|
+
width: canScroll && scrollWidth !== undefined ? scrollWidth : '100%'
|
|
76
77
|
}
|
|
77
78
|
}, /*#__PURE__*/React.createElement("colgroup", null, leafColumns.map(function (col, idx) {
|
|
78
79
|
return /*#__PURE__*/React.createElement("col", Object.assign({
|
package/lib/esm/use-table.js
CHANGED
|
@@ -497,6 +497,7 @@ var useTable = function useTable(_a) {
|
|
|
497
497
|
}, [activeSorterColumn, activeSorterType, transitionData, columns]);
|
|
498
498
|
return Object.assign(Object.assign({
|
|
499
499
|
rootProps: rootProps,
|
|
500
|
+
scrollWidth: scrollWidth,
|
|
500
501
|
activeSorterColumn: activeSorterColumn,
|
|
501
502
|
setActiveSorterColumn: setActiveSorterColumn,
|
|
502
503
|
activeSorterType: activeSorterType,
|
package/lib/types/context.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare const TableProvider: import("react").Provider<(Omit<{
|
|
|
48
48
|
loading?: boolean | undefined;
|
|
49
49
|
uniqueId?: string | undefined;
|
|
50
50
|
};
|
|
51
|
+
scrollWidth: number | undefined;
|
|
51
52
|
activeSorterColumn: string | null;
|
|
52
53
|
setActiveSorterColumn: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
53
54
|
activeSorterType: string | null;
|
|
@@ -151,6 +152,7 @@ export declare const useTableContext: () => Omit<{
|
|
|
151
152
|
loading?: boolean | undefined;
|
|
152
153
|
uniqueId?: string | undefined;
|
|
153
154
|
};
|
|
155
|
+
scrollWidth: number | undefined;
|
|
154
156
|
activeSorterColumn: string | null;
|
|
155
157
|
setActiveSorterColumn: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
156
158
|
activeSorterType: string | null;
|
package/lib/types/use-table.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export declare const useTable: ({ data, columns: columnsProp, defaultFixedToColu
|
|
|
64
64
|
*/
|
|
65
65
|
uniqueId?: string | undefined;
|
|
66
66
|
};
|
|
67
|
+
scrollWidth: number | undefined;
|
|
67
68
|
activeSorterColumn: string | null;
|
|
68
69
|
setActiveSorterColumn: React.Dispatch<React.SetStateAction<string | null>>;
|
|
69
70
|
activeSorterType: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hi-ui/table",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "A sub-package for @hi-ui/hiui.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "HiUI <mi-hiui@xiaomi.com>",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"react": "^17.0.1",
|
|
89
89
|
"react-dom": "^17.0.1"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "8ffb457b2c34452a59dbde9fb8d28a8fbc2b29db"
|
|
92
92
|
}
|