@sooloer/pages 0.1.17 → 0.1.19
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 +1 -2
- package/dist/filter/demo/basic.js +2 -1
- package/dist/table/table/index.js +19 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @sooloer/pages
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.org/package/@sooloer/pages)
|
|
4
|
-
[](https://npmjs.org/package/@sooloer/pages)
|
|
3
|
+
[](https://npmjs.org/package/@sooloer/pages) [](https://npmjs.org/package/@sooloer/pages)
|
|
5
4
|
|
|
6
5
|
A react library developed with dumi
|
|
7
6
|
|
|
@@ -46,6 +46,7 @@ var ElTable = function ElTable(_ref) {
|
|
|
46
46
|
onGlobalCheckboxChange = _ref.onGlobalCheckboxChange,
|
|
47
47
|
extraAction = _ref.extraAction,
|
|
48
48
|
args = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
var headerRef = /*#__PURE__*/React.createRef();
|
|
49
50
|
var _useState = useState('small'),
|
|
50
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51
52
|
size = _useState2[0],
|
|
@@ -58,6 +59,10 @@ var ElTable = function ElTable(_ref) {
|
|
|
58
59
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
60
|
sortColumns = _useState6[0],
|
|
60
61
|
setSortColumns = _useState6[1];
|
|
62
|
+
var _useState7 = useState(39),
|
|
63
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
64
|
+
tableHeaderHeight = _useState8[0],
|
|
65
|
+
setTableHeaderHeight = _useState8[1];
|
|
61
66
|
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
62
67
|
getPrefixCls = _useContext.getPrefixCls;
|
|
63
68
|
useEffect(function () {
|
|
@@ -75,15 +80,11 @@ var ElTable = function ElTable(_ref) {
|
|
|
75
80
|
return !(item !== null && item !== void 0 && item.hideInTable || false);
|
|
76
81
|
});
|
|
77
82
|
}, [sortColumns]);
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
if (size === 'middle') {
|
|
83
|
-
return 48;
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
if (headerRef !== null && headerRef !== void 0 && headerRef.current) {
|
|
85
|
+
setTableHeaderHeight(headerRef.current.offsetHeight);
|
|
84
86
|
}
|
|
85
|
-
|
|
86
|
-
}, [size]);
|
|
87
|
+
}, [headerRef]);
|
|
87
88
|
var paginationConfig = useMemo(function () {
|
|
88
89
|
if (pagination !== false) {
|
|
89
90
|
return _objectSpread({
|
|
@@ -150,7 +151,7 @@ var ElTable = function ElTable(_ref) {
|
|
|
150
151
|
};
|
|
151
152
|
if (height) {
|
|
152
153
|
scrollProps = _objectSpread(_objectSpread({}, scrollProps), {}, {
|
|
153
|
-
y: height - tableHeaderHeight - (pagination === false ?
|
|
154
|
+
y: height - tableHeaderHeight - (pagination === false ? 12 : 48)
|
|
154
155
|
});
|
|
155
156
|
}
|
|
156
157
|
return scrollProps;
|
|
@@ -163,7 +164,15 @@ var ElTable = function ElTable(_ref) {
|
|
|
163
164
|
className: classnames('sooloer-table', {
|
|
164
165
|
'pagination-hidden': pagination === false
|
|
165
166
|
}),
|
|
166
|
-
columns: showColumns,
|
|
167
|
+
columns: _toConsumableArray(showColumns.map(function (row, index) {
|
|
168
|
+
return _objectSpread(_objectSpread({}, row), !index && {
|
|
169
|
+
onHeaderCell: function onHeaderCell() {
|
|
170
|
+
return {
|
|
171
|
+
ref: headerRef
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
})),
|
|
167
176
|
dataSource: dataSource,
|
|
168
177
|
style: {
|
|
169
178
|
height: height
|