@kdcloudjs/table 1.2.2-canary.14 → 1.2.2-canary.14-hotfix
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/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +16 -9
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +2 -2
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/BlankComponent.d.ts +0 -1
- package/es/table/base/BlankComponent.js +16 -9
- package/lib/table/base/BlankComponent.d.ts +0 -1
- package/lib/table/base/BlankComponent.js +15 -8
- package/package.json +2 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
2
|
-
import React, { useState, useImperativeHandle, forwardRef, memo } from 'react';
|
|
2
|
+
import React, { useState, useImperativeHandle, forwardRef, memo, useEffect } from 'react';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { Classes } from './styles';
|
|
5
5
|
var TopBlankComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var heightFromProps = _ref.height;
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
setHeight(heightFromProps);
|
|
9
|
+
}, [heightFromProps]);
|
|
10
|
+
var _useState = useState(heightFromProps),
|
|
8
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9
12
|
height = _useState2[0],
|
|
10
13
|
setHeight = _useState2[1];
|
|
@@ -18,6 +21,8 @@ var TopBlankComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18
21
|
};
|
|
19
22
|
}, [height]);
|
|
20
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
key: "top-blank",
|
|
25
|
+
className: cx(Classes.virtualBlank, 'bottom'),
|
|
21
26
|
style: {
|
|
22
27
|
height: height
|
|
23
28
|
}
|
|
@@ -25,12 +30,14 @@ var TopBlankComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
25
30
|
});
|
|
26
31
|
TopBlankComponent.displayName = 'TopBlank';
|
|
27
32
|
var BottomBlankComponent = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var _useState3 = useState(initialHeight),
|
|
33
|
+
var heightFromProps = _ref2.height;
|
|
34
|
+
var _useState3 = useState(heightFromProps),
|
|
31
35
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
36
|
height = _useState4[0],
|
|
33
37
|
setHeight = _useState4[1];
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
setHeight(heightFromProps);
|
|
40
|
+
}, [heightFromProps]);
|
|
34
41
|
useImperativeHandle(ref, function () {
|
|
35
42
|
return {
|
|
36
43
|
updateHeight: function updateHeight(newHeight) {
|
|
@@ -45,7 +52,7 @@ var BottomBlankComponent = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
45
52
|
}
|
|
46
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
54
|
key: "bottom-blank",
|
|
48
|
-
className: cx(Classes.virtualBlank, 'bottom'
|
|
55
|
+
className: cx(Classes.virtualBlank, 'bottom'),
|
|
49
56
|
style: {
|
|
50
57
|
height: height
|
|
51
58
|
}
|
|
@@ -54,8 +61,8 @@ var BottomBlankComponent = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
54
61
|
BottomBlankComponent.displayName = 'BottomBlank';
|
|
55
62
|
// 使用 memo 优化,只有当 height 或 className 改变时才重新渲染
|
|
56
63
|
export var TopBlank = /*#__PURE__*/memo(TopBlankComponent, function (prevProps, nextProps) {
|
|
57
|
-
return prevProps.height === nextProps.height
|
|
64
|
+
return prevProps.height === nextProps.height;
|
|
58
65
|
});
|
|
59
66
|
export var BottomBlank = /*#__PURE__*/memo(BottomBlankComponent, function (prevProps, nextProps) {
|
|
60
|
-
return prevProps.height === nextProps.height
|
|
67
|
+
return prevProps.height === nextProps.height;
|
|
61
68
|
});
|
|
@@ -15,8 +15,11 @@ var _styles = require("./styles");
|
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var TopBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
18
|
-
var
|
|
19
|
-
|
|
18
|
+
var heightFromProps = _ref.height;
|
|
19
|
+
(0, _react.useEffect)(function () {
|
|
20
|
+
setHeight(heightFromProps);
|
|
21
|
+
}, [heightFromProps]);
|
|
22
|
+
var _useState = (0, _react.useState)(heightFromProps),
|
|
20
23
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
24
|
height = _useState2[0],
|
|
22
25
|
setHeight = _useState2[1];
|
|
@@ -30,6 +33,8 @@ var TopBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
30
33
|
};
|
|
31
34
|
}, [height]);
|
|
32
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
key: "top-blank",
|
|
37
|
+
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'bottom'),
|
|
33
38
|
style: {
|
|
34
39
|
height: height
|
|
35
40
|
}
|
|
@@ -37,12 +42,14 @@ var TopBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
37
42
|
});
|
|
38
43
|
TopBlankComponent.displayName = 'TopBlank';
|
|
39
44
|
var BottomBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var _useState3 = (0, _react.useState)(initialHeight),
|
|
45
|
+
var heightFromProps = _ref2.height;
|
|
46
|
+
var _useState3 = (0, _react.useState)(heightFromProps),
|
|
43
47
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
44
48
|
height = _useState4[0],
|
|
45
49
|
setHeight = _useState4[1];
|
|
50
|
+
(0, _react.useEffect)(function () {
|
|
51
|
+
setHeight(heightFromProps);
|
|
52
|
+
}, [heightFromProps]);
|
|
46
53
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
47
54
|
return {
|
|
48
55
|
updateHeight: function updateHeight(newHeight) {
|
|
@@ -57,7 +64,7 @@ var BottomBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
57
64
|
}
|
|
58
65
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
59
66
|
key: "bottom-blank",
|
|
60
|
-
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'bottom'
|
|
67
|
+
className: (0, _classnames.default)(_styles.Classes.virtualBlank, 'bottom'),
|
|
61
68
|
style: {
|
|
62
69
|
height: height
|
|
63
70
|
}
|
|
@@ -66,10 +73,10 @@ var BottomBlankComponent = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2,
|
|
|
66
73
|
BottomBlankComponent.displayName = 'BottomBlank';
|
|
67
74
|
// 使用 memo 优化,只有当 height 或 className 改变时才重新渲染
|
|
68
75
|
var TopBlank = /*#__PURE__*/(0, _react.memo)(TopBlankComponent, function (prevProps, nextProps) {
|
|
69
|
-
return prevProps.height === nextProps.height
|
|
76
|
+
return prevProps.height === nextProps.height;
|
|
70
77
|
});
|
|
71
78
|
exports.TopBlank = TopBlank;
|
|
72
79
|
var BottomBlank = /*#__PURE__*/(0, _react.memo)(BottomBlankComponent, function (prevProps, nextProps) {
|
|
73
|
-
return prevProps.height === nextProps.height
|
|
80
|
+
return prevProps.height === nextProps.height;
|
|
74
81
|
});
|
|
75
82
|
exports.BottomBlank = BottomBlank;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kdcloudjs/table",
|
|
3
|
-
"version": "1.2.2-canary.14",
|
|
3
|
+
"version": "1.2.2-canary.14-hotfix",
|
|
4
4
|
"description": "金蝶 react table 组件",
|
|
5
5
|
"title": "table",
|
|
6
6
|
"keywords": [
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --skip-unstable",
|
|
57
57
|
"pub": "npm run test:all && npm run build && cross-env PUB_ENV=pub np --no-cleanup --no-tests",
|
|
58
58
|
"pub:canary": "npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=canary",
|
|
59
|
+
"pub:canary-hotfix": "npm run build && cross-env PUB_ENV=pub np --no-cleanup --anyBranch --no-tests --tag=canaryHotFix",
|
|
59
60
|
"new": "node scripts/create-component.js",
|
|
60
61
|
"kd-ui": "npm install @kingdee-ui/kui --registry http://npm.kingdee.com/"
|
|
61
62
|
},
|