linkmore-design 1.0.20 → 1.0.21
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/index.umd.js +18 -20
- package/dist/index.umd.min.js +1 -1
- package/es/LmTable/Table.js +18 -20
- package/lib/LmTable/Table.js +18 -20
- package/package.json +1 -1
package/es/LmTable/Table.js
CHANGED
|
@@ -162,7 +162,6 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
162
162
|
checkConfig: checkConfig,
|
|
163
163
|
// components: vComponents,
|
|
164
164
|
scroll: (0, _objectSpread2.default)({
|
|
165
|
-
x: '100%',
|
|
166
165
|
y: autoSize.height
|
|
167
166
|
}, props.scroll),
|
|
168
167
|
pagination: !hiddenPage && (0, _objectSpread2.default)({
|
|
@@ -304,32 +303,31 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
304
303
|
var defaultRef = ref || (0, _react.useRef)(null);
|
|
305
304
|
var tableWarpRef = (0, _react.useRef)(null);
|
|
306
305
|
var resizeRef = (0, _react.useRef)(null);
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
var resetHeight = function resetHeight() {
|
|
313
|
-
var h = height - 48;
|
|
306
|
+
var resetHeight = (0, _react.useMemo)(function () {
|
|
307
|
+
var height = tableSize.height;
|
|
308
|
+
console.log(3);
|
|
309
|
+
var h = height - 48;
|
|
314
310
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (props.columns.some(function (v) {
|
|
320
|
-
return v.children;
|
|
321
|
-
})) {
|
|
322
|
-
h -= 32;
|
|
323
|
-
}
|
|
311
|
+
if (!props.hiddenPage || props.customCheck) {
|
|
312
|
+
h -= 32;
|
|
313
|
+
}
|
|
324
314
|
|
|
325
|
-
|
|
326
|
-
|
|
315
|
+
if (props.columns.some(function (v) {
|
|
316
|
+
return v.children;
|
|
317
|
+
})) {
|
|
318
|
+
h -= 32;
|
|
319
|
+
}
|
|
327
320
|
|
|
321
|
+
return h;
|
|
322
|
+
}, [props.hiddenPage, props.customCheck, props.column, tableSize]);
|
|
323
|
+
var throttleSize = (0, _react.useCallback)(function () {
|
|
324
|
+
var width = tableSize.width,
|
|
325
|
+
height = tableSize.height;
|
|
328
326
|
return /*#__PURE__*/_react.default.createElement(ResetTable, (0, _extends2.default)({
|
|
329
327
|
ref: defaultRef
|
|
330
328
|
}, props, {
|
|
331
329
|
autoSize: {
|
|
332
|
-
height: resetHeight
|
|
330
|
+
height: resetHeight,
|
|
333
331
|
width: width
|
|
334
332
|
}
|
|
335
333
|
}));
|
package/lib/LmTable/Table.js
CHANGED
|
@@ -162,7 +162,6 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
162
162
|
checkConfig: checkConfig,
|
|
163
163
|
// components: vComponents,
|
|
164
164
|
scroll: (0, _objectSpread2.default)({
|
|
165
|
-
x: '100%',
|
|
166
165
|
y: autoSize.height
|
|
167
166
|
}, props.scroll),
|
|
168
167
|
pagination: !hiddenPage && (0, _objectSpread2.default)({
|
|
@@ -304,32 +303,31 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
304
303
|
var defaultRef = ref || (0, _react.useRef)(null);
|
|
305
304
|
var tableWarpRef = (0, _react.useRef)(null);
|
|
306
305
|
var resizeRef = (0, _react.useRef)(null);
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
var resetHeight = function resetHeight() {
|
|
313
|
-
var h = height - 48;
|
|
306
|
+
var resetHeight = (0, _react.useMemo)(function () {
|
|
307
|
+
var height = tableSize.height;
|
|
308
|
+
console.log(3);
|
|
309
|
+
var h = height - 48;
|
|
314
310
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (props.columns.some(function (v) {
|
|
320
|
-
return v.children;
|
|
321
|
-
})) {
|
|
322
|
-
h -= 32;
|
|
323
|
-
}
|
|
311
|
+
if (!props.hiddenPage || props.customCheck) {
|
|
312
|
+
h -= 32;
|
|
313
|
+
}
|
|
324
314
|
|
|
325
|
-
|
|
326
|
-
|
|
315
|
+
if (props.columns.some(function (v) {
|
|
316
|
+
return v.children;
|
|
317
|
+
})) {
|
|
318
|
+
h -= 32;
|
|
319
|
+
}
|
|
327
320
|
|
|
321
|
+
return h;
|
|
322
|
+
}, [props.hiddenPage, props.customCheck, props.column, tableSize]);
|
|
323
|
+
var throttleSize = (0, _react.useCallback)(function () {
|
|
324
|
+
var width = tableSize.width,
|
|
325
|
+
height = tableSize.height;
|
|
328
326
|
return /*#__PURE__*/_react.default.createElement(ResetTable, (0, _extends2.default)({
|
|
329
327
|
ref: defaultRef
|
|
330
328
|
}, props, {
|
|
331
329
|
autoSize: {
|
|
332
|
-
height: resetHeight
|
|
330
|
+
height: resetHeight,
|
|
333
331
|
width: width
|
|
334
332
|
}
|
|
335
333
|
}));
|