@hi-ui/table 4.3.1 → 4.3.2
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/CHANGELOG.md +40 -0
- package/lib/cjs/BaseTable.js +136 -189
- package/lib/cjs/ColGroupContent.js +5 -28
- package/lib/cjs/SettingDrawer.js +76 -127
- package/lib/cjs/Table.js +107 -171
- package/lib/cjs/TableAdvancedFilter.js +49 -85
- package/lib/cjs/TableBody.js +33 -69
- package/lib/cjs/TableCell.js +56 -102
- package/lib/cjs/TableColumnMenu.js +39 -77
- package/lib/cjs/TableEmbedRow.js +11 -38
- package/lib/cjs/TableHeader.js +8 -33
- package/lib/cjs/TableRow.js +48 -88
- package/lib/cjs/TableSettingMenu.js +48 -94
- package/lib/cjs/TbodyContent.js +28 -56
- package/lib/cjs/TheadContent.js +20 -49
- package/lib/cjs/_virtual/index.js +0 -3
- package/lib/cjs/_virtual/index2.js +0 -3
- package/lib/cjs/_virtual/react-is.development.js +0 -3
- package/lib/cjs/_virtual/react-is.production.min.js +0 -3
- package/lib/cjs/context.js +0 -9
- package/lib/cjs/hooks/use-async-switch.js +13 -51
- package/lib/cjs/hooks/use-check.js +47 -77
- package/lib/cjs/hooks/use-col-hidden.js +16 -28
- package/lib/cjs/hooks/use-col-set.js +5 -18
- package/lib/cjs/hooks/use-col-sorter.js +18 -32
- package/lib/cjs/hooks/use-col-width.js +21 -57
- package/lib/cjs/hooks/use-colgroup.js +63 -85
- package/lib/cjs/hooks/use-drag.js +10 -31
- package/lib/cjs/hooks/use-embed-expand.js +23 -68
- package/lib/cjs/hooks/use-expand.js +32 -64
- package/lib/cjs/hooks/use-pagination.js +19 -50
- package/lib/cjs/hooks/use-queue.js +2 -14
- package/lib/cjs/icons/index.js +4 -21
- package/lib/cjs/index.js +0 -4
- package/lib/cjs/node_modules/classnames/index.js +2 -11
- package/lib/cjs/node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js +31 -227
- package/lib/cjs/node_modules/rc-resize-observer/es/index.js +10 -68
- package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/Children/toArray.js +1 -17
- package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/Dom/findDOMNode.js +1 -14
- package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/ref.js +1 -25
- package/lib/cjs/node_modules/rc-resize-observer/node_modules/rc-util/es/warning.js +1 -5
- package/lib/cjs/node_modules/rc-util/es/Dom/canUseDom.js +0 -2
- package/lib/cjs/node_modules/rc-util/es/Dom/findDOMNode.js +1 -14
- package/lib/cjs/node_modules/rc-util/es/hooks/useLayoutEffect.js +2 -9
- package/lib/cjs/node_modules/rc-util/es/raf.js +0 -11
- package/lib/cjs/node_modules/rc-virtual-list/es/Filler.js +6 -25
- package/lib/cjs/node_modules/rc-virtual-list/es/Item.js +3 -14
- package/lib/cjs/node_modules/rc-virtual-list/es/List.js +103 -194
- package/lib/cjs/node_modules/rc-virtual-list/es/ScrollBar.js +16 -96
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useChildren.js +2 -11
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useDiffItem.js +8 -34
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useFrameWheel.js +0 -10
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useHeights.js +6 -39
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js +0 -16
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useOriginScroll.js +4 -9
- package/lib/cjs/node_modules/rc-virtual-list/es/hooks/useScrollTo.js +3 -28
- package/lib/cjs/node_modules/rc-virtual-list/es/index.js +0 -2
- package/lib/cjs/node_modules/rc-virtual-list/es/utils/CacheMap.js +2 -9
- package/lib/cjs/node_modules/rc-virtual-list/es/utils/algorithmUtil.js +0 -15
- package/lib/cjs/node_modules/rc-virtual-list/es/utils/isFirefox.js +0 -2
- package/lib/cjs/node_modules/react-is/cjs/react-is.development.js +3 -29
- package/lib/cjs/node_modules/react-is/cjs/react-is.production.min.js +19 -45
- package/lib/cjs/node_modules/react-is/index.js +0 -5
- package/lib/cjs/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +83 -248
- package/lib/cjs/packages/hooks/use-merge-refs/lib/esm/index.js +3 -14
- package/lib/cjs/packages/ui/scrollbar/lib/esm/Scrollbar.js +48 -86
- package/lib/cjs/packages/ui/scrollbar/lib/esm/styles/index.scss.js +1 -15
- package/lib/cjs/packages/ui/scrollbar/lib/esm/utils/index.js +0 -13
- package/lib/cjs/styles/index.scss.js +1 -4
- package/lib/cjs/use-table.js +268 -355
- package/lib/cjs/utils/index.js +11 -45
- package/lib/esm/BaseTable.js +117 -138
- package/lib/esm/ColGroupContent.js +3 -9
- package/lib/esm/SettingDrawer.js +64 -83
- package/lib/esm/Table.js +97 -124
- package/lib/esm/TableAdvancedFilter.js +37 -47
- package/lib/esm/TableBody.js +24 -34
- package/lib/esm/TableCell.js +48 -72
- package/lib/esm/TableColumnMenu.js +24 -38
- package/lib/esm/TableEmbedRow.js +8 -15
- package/lib/esm/TableHeader.js +5 -11
- package/lib/esm/TableRow.js +36 -51
- package/lib/esm/TableSettingMenu.js +33 -49
- package/lib/esm/TbodyContent.js +20 -27
- package/lib/esm/TheadContent.js +14 -21
- package/lib/esm/context.js +0 -4
- package/lib/esm/hooks/use-async-switch.js +9 -28
- package/lib/esm/hooks/use-check.js +42 -55
- package/lib/esm/hooks/use-col-hidden.js +16 -21
- package/lib/esm/hooks/use-col-set.js +5 -13
- package/lib/esm/hooks/use-col-sorter.js +18 -23
- package/lib/esm/hooks/use-col-width.js +14 -34
- package/lib/esm/hooks/use-colgroup.js +60 -66
- package/lib/esm/hooks/use-drag.js +9 -13
- package/lib/esm/hooks/use-embed-expand.js +20 -42
- package/lib/esm/hooks/use-expand.js +32 -56
- package/lib/esm/hooks/use-pagination.js +13 -25
- package/lib/esm/hooks/use-queue.js +2 -10
- package/lib/esm/node_modules/classnames/index.js +2 -9
- package/lib/esm/node_modules/perfect-scrollbar/dist/perfect-scrollbar.esm.js +31 -228
- package/lib/esm/node_modules/rc-resize-observer/es/index.js +3 -26
- package/lib/esm/node_modules/rc-resize-observer/node_modules/rc-util/es/Children/toArray.js +0 -3
- package/lib/esm/node_modules/rc-resize-observer/node_modules/rc-util/es/Dom/findDOMNode.js +1 -2
- package/lib/esm/node_modules/rc-resize-observer/node_modules/rc-util/es/ref.js +0 -8
- package/lib/esm/node_modules/rc-resize-observer/node_modules/rc-util/es/warning.js +0 -5
- package/lib/esm/node_modules/rc-util/es/Dom/canUseDom.js +0 -1
- package/lib/esm/node_modules/rc-util/es/Dom/findDOMNode.js +1 -2
- package/lib/esm/node_modules/rc-util/es/hooks/useLayoutEffect.js +1 -0
- package/lib/esm/node_modules/rc-util/es/raf.js +0 -10
- package/lib/esm/node_modules/rc-virtual-list/es/Filler.js +4 -15
- package/lib/esm/node_modules/rc-virtual-list/es/Item.js +1 -3
- package/lib/esm/node_modules/rc-virtual-list/es/List.js +101 -174
- package/lib/esm/node_modules/rc-virtual-list/es/ScrollBar.js +14 -86
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useChildren.js +0 -2
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useDiffItem.js +6 -25
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useFrameWheel.js +0 -6
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useHeights.js +4 -28
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useMobileTouchMove.js +0 -13
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useOriginScroll.js +4 -8
- package/lib/esm/node_modules/rc-virtual-list/es/hooks/useScrollTo.js +1 -19
- package/lib/esm/node_modules/rc-virtual-list/es/index.js +1 -1
- package/lib/esm/node_modules/rc-virtual-list/es/utils/CacheMap.js +2 -8
- package/lib/esm/node_modules/rc-virtual-list/es/utils/algorithmUtil.js +1 -12
- package/lib/esm/node_modules/rc-virtual-list/es/utils/isFirefox.js +0 -1
- package/lib/esm/node_modules/react-is/cjs/react-is.development.js +4 -27
- package/lib/esm/node_modules/react-is/cjs/react-is.production.min.js +20 -44
- package/lib/esm/node_modules/react-is/index.js +0 -1
- package/lib/esm/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +82 -248
- package/lib/esm/packages/hooks/use-merge-refs/lib/esm/index.js +3 -9
- package/lib/esm/packages/ui/scrollbar/lib/esm/Scrollbar.js +47 -64
- package/lib/esm/packages/ui/scrollbar/lib/esm/styles/index.scss.js +1 -3
- package/lib/esm/packages/ui/scrollbar/lib/esm/utils/index.js +0 -10
- package/lib/esm/styles/index.scss.js +1 -3
- package/lib/esm/use-table.js +261 -318
- package/lib/esm/utils/index.js +11 -41
- package/lib/types/BaseTable.d.ts +2 -2
- package/package.json +33 -33
|
@@ -22,14 +22,10 @@ var INTERNAL_PREFIX_KEY = 'rc-observer-key'; // Still need to be compatible with
|
|
|
22
22
|
|
|
23
23
|
var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
24
24
|
_inherits(ReactResizeObserver, _React$Component);
|
|
25
|
-
|
|
26
25
|
var _super = _createSuper(ReactResizeObserver);
|
|
27
|
-
|
|
28
26
|
function ReactResizeObserver() {
|
|
29
27
|
var _this;
|
|
30
|
-
|
|
31
28
|
_classCallCheck(this, ReactResizeObserver);
|
|
32
|
-
|
|
33
29
|
_this = _super.apply(this, arguments);
|
|
34
30
|
_this.resizeObserver = null;
|
|
35
31
|
_this.childNode = null;
|
|
@@ -40,17 +36,14 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
40
36
|
offsetHeight: 0,
|
|
41
37
|
offsetWidth: 0
|
|
42
38
|
};
|
|
43
|
-
|
|
44
39
|
_this.onResize = function (entries) {
|
|
45
40
|
var onResize = _this.props.onResize;
|
|
46
41
|
var target = entries[0].target;
|
|
47
|
-
|
|
48
42
|
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
width = _target$getBoundingCl.width,
|
|
44
|
+
height = _target$getBoundingCl.height;
|
|
52
45
|
var offsetWidth = target.offsetWidth,
|
|
53
|
-
|
|
46
|
+
offsetHeight = target.offsetHeight;
|
|
54
47
|
/**
|
|
55
48
|
* Resize observer trigger when content size changed.
|
|
56
49
|
* In most case we just care about element size,
|
|
@@ -59,7 +52,6 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
59
52
|
|
|
60
53
|
var fixedWidth = Math.floor(width);
|
|
61
54
|
var fixedHeight = Math.floor(height);
|
|
62
|
-
|
|
63
55
|
if (_this.state.width !== fixedWidth || _this.state.height !== fixedHeight || _this.state.offsetWidth !== offsetWidth || _this.state.offsetHeight !== offsetHeight) {
|
|
64
56
|
var size = {
|
|
65
57
|
width: fixedWidth,
|
|
@@ -67,9 +59,7 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
67
59
|
offsetWidth: offsetWidth,
|
|
68
60
|
offsetHeight: offsetHeight
|
|
69
61
|
};
|
|
70
|
-
|
|
71
62
|
_this.setState(size);
|
|
72
|
-
|
|
73
63
|
if (onResize) {
|
|
74
64
|
// defer the callback but not defer to next frame
|
|
75
65
|
Promise.resolve().then(function () {
|
|
@@ -81,14 +71,11 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
81
71
|
}
|
|
82
72
|
}
|
|
83
73
|
};
|
|
84
|
-
|
|
85
74
|
_this.setChildNode = function (node) {
|
|
86
75
|
_this.childNode = node;
|
|
87
76
|
};
|
|
88
|
-
|
|
89
77
|
return _this;
|
|
90
78
|
}
|
|
91
|
-
|
|
92
79
|
_createClass(ReactResizeObserver, [{
|
|
93
80
|
key: "componentDidMount",
|
|
94
81
|
value: function componentDidMount() {
|
|
@@ -114,15 +101,12 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
114
101
|
return;
|
|
115
102
|
} // Unregister if element changed
|
|
116
103
|
|
|
117
|
-
|
|
118
104
|
var element = findDOMNode(this.childNode || this);
|
|
119
105
|
var elementChanged = element !== this.currentElement;
|
|
120
|
-
|
|
121
106
|
if (elementChanged) {
|
|
122
107
|
this.destroyObserver();
|
|
123
108
|
this.currentElement = element;
|
|
124
109
|
}
|
|
125
|
-
|
|
126
110
|
if (!this.resizeObserver && element) {
|
|
127
111
|
this.resizeObserver = new index(this.onResize);
|
|
128
112
|
this.resizeObserver.observe(element);
|
|
@@ -141,37 +125,30 @@ var ReactResizeObserver = /*#__PURE__*/function (_React$Component) {
|
|
|
141
125
|
value: function render() {
|
|
142
126
|
var children = this.props.children;
|
|
143
127
|
var childNodes = toArray(children);
|
|
144
|
-
|
|
145
128
|
if (childNodes.length > 1) {
|
|
146
129
|
warningOnce(false, 'Find more than one child node with `children` in ResizeObserver. Will only observe first one.');
|
|
147
130
|
} else if (childNodes.length === 0) {
|
|
148
131
|
warningOnce(false, '`children` of ResizeObserver is empty. Nothing is in observe.');
|
|
149
132
|
return null;
|
|
150
133
|
}
|
|
151
|
-
|
|
152
134
|
var childNode = childNodes[0];
|
|
153
|
-
|
|
154
135
|
if ( /*#__PURE__*/React.isValidElement(childNode) && supportRef(childNode)) {
|
|
155
136
|
var ref = childNode.ref;
|
|
156
137
|
childNodes[0] = /*#__PURE__*/React.cloneElement(childNode, {
|
|
157
138
|
ref: composeRef(ref, this.setChildNode)
|
|
158
139
|
});
|
|
159
140
|
}
|
|
160
|
-
|
|
161
141
|
return childNodes.length === 1 ? childNodes[0] : childNodes.map(function (node, index) {
|
|
162
142
|
if (! /*#__PURE__*/React.isValidElement(node) || 'key' in node && node.key !== null) {
|
|
163
143
|
return node;
|
|
164
144
|
}
|
|
165
|
-
|
|
166
145
|
return /*#__PURE__*/React.cloneElement(node, {
|
|
167
146
|
key: "".concat(INTERNAL_PREFIX_KEY, "-").concat(index)
|
|
168
147
|
});
|
|
169
148
|
});
|
|
170
149
|
}
|
|
171
150
|
}]);
|
|
172
|
-
|
|
173
151
|
return ReactResizeObserver;
|
|
174
152
|
}(React.Component);
|
|
175
|
-
|
|
176
153
|
ReactResizeObserver.displayName = 'ResizeObserver';
|
|
177
154
|
export { ReactResizeObserver as default };
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import '../../../../../react-is/index.js';
|
|
12
12
|
import { r as reactIs } from '../../../../../../_virtual/index2.js';
|
|
13
|
-
|
|
14
13
|
function toArray(children) {
|
|
15
14
|
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
16
15
|
var ret = [];
|
|
@@ -18,7 +17,6 @@ function toArray(children) {
|
|
|
18
17
|
if ((child === undefined || child === null) && !option.keepEmpty) {
|
|
19
18
|
return;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
if (Array.isArray(child)) {
|
|
23
21
|
ret = ret.concat(toArray(child));
|
|
24
22
|
} else if (reactIs.exports.isFragment(child) && child.props) {
|
|
@@ -29,5 +27,4 @@ function toArray(children) {
|
|
|
29
27
|
});
|
|
30
28
|
return ret;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
export { toArray as default };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
13
14
|
*/
|
|
@@ -16,8 +17,6 @@ function findDOMNode(node) {
|
|
|
16
17
|
if (node instanceof HTMLElement) {
|
|
17
18
|
return node;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
20
|
return ReactDOM.findDOMNode(node);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
export { findDOMNode as default };
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import _typeof from '@babel/runtime/helpers/esm/typeof';
|
|
11
11
|
import '../../../../react-is/index.js';
|
|
12
12
|
import { r as reactIs } from '../../../../../_virtual/index2.js';
|
|
13
|
-
|
|
14
13
|
function fillRef(ref, node) {
|
|
15
14
|
if (typeof ref === 'function') {
|
|
16
15
|
ref(node);
|
|
@@ -22,36 +21,29 @@ function fillRef(ref, node) {
|
|
|
22
21
|
* Merge refs into one ref function to support ref passing.
|
|
23
22
|
*/
|
|
24
23
|
|
|
25
|
-
|
|
26
24
|
function composeRef() {
|
|
27
25
|
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
26
|
refs[_key] = arguments[_key];
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
return function (node) {
|
|
32
29
|
refs.forEach(function (ref) {
|
|
33
30
|
fillRef(ref, node);
|
|
34
31
|
});
|
|
35
32
|
};
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
function supportRef(nodeOrComponent) {
|
|
39
35
|
var _type$prototype, _nodeOrComponent$prot;
|
|
40
|
-
|
|
41
36
|
var type = reactIs.exports.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type; // Function component node
|
|
42
37
|
|
|
43
38
|
if (typeof type === 'function' && !((_type$prototype = type.prototype) === null || _type$prototype === void 0 ? void 0 : _type$prototype.render)) {
|
|
44
39
|
return false;
|
|
45
40
|
} // Class component
|
|
46
41
|
|
|
47
|
-
|
|
48
42
|
if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) === null || _nodeOrComponent$prot === void 0 ? void 0 : _nodeOrComponent$prot.render)) {
|
|
49
43
|
return false;
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
return true;
|
|
53
46
|
}
|
|
54
47
|
/* eslint-enable */
|
|
55
48
|
|
|
56
|
-
|
|
57
49
|
export { composeRef, fillRef, supportRef };
|
|
@@ -7,28 +7,23 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
/* eslint-disable no-console */
|
|
12
11
|
var warned = {};
|
|
13
|
-
|
|
14
12
|
function warning(valid, message) {
|
|
15
13
|
// Support uglify
|
|
16
14
|
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
|
|
17
15
|
console.error("Warning: ".concat(message));
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
function call(method, valid, message) {
|
|
22
19
|
if (!valid && !warned[message]) {
|
|
23
20
|
method(false, message);
|
|
24
21
|
warned[message] = true;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
function warningOnce(valid, message) {
|
|
29
25
|
call(warning, valid, message);
|
|
30
26
|
}
|
|
31
27
|
/* eslint-enable */
|
|
32
28
|
|
|
33
|
-
|
|
34
29
|
export { call, warningOnce as default, warning, warningOnce };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* Return if a node is a DOM node. Else will return by `findDOMNode`
|
|
13
14
|
*/
|
|
@@ -16,8 +17,6 @@ function findDOMNode(node) {
|
|
|
16
17
|
if (node instanceof HTMLElement) {
|
|
17
18
|
return node;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
20
|
return ReactDOM.findDOMNode(node);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
export { findDOMNode as default };
|
|
@@ -10,33 +10,26 @@
|
|
|
10
10
|
var raf = function raf(callback) {
|
|
11
11
|
return +setTimeout(callback, 16);
|
|
12
12
|
};
|
|
13
|
-
|
|
14
13
|
var caf = function caf(num) {
|
|
15
14
|
return clearTimeout(num);
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
if (typeof window !== 'undefined' && 'requestAnimationFrame' in window) {
|
|
19
17
|
raf = function raf(callback) {
|
|
20
18
|
return window.requestAnimationFrame(callback);
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
caf = function caf(handle) {
|
|
24
21
|
return window.cancelAnimationFrame(handle);
|
|
25
22
|
};
|
|
26
23
|
}
|
|
27
|
-
|
|
28
24
|
var rafUUID = 0;
|
|
29
25
|
var rafIds = new Map();
|
|
30
|
-
|
|
31
26
|
function cleanup(id) {
|
|
32
27
|
rafIds["delete"](id);
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
function wrapperRaf(callback) {
|
|
36
30
|
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
37
31
|
rafUUID += 1;
|
|
38
32
|
var id = rafUUID;
|
|
39
|
-
|
|
40
33
|
function callRef(leftTimes) {
|
|
41
34
|
if (leftTimes === 0) {
|
|
42
35
|
// Clean up
|
|
@@ -52,15 +45,12 @@ function wrapperRaf(callback) {
|
|
|
52
45
|
rafIds.set(id, realId);
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
callRef(times);
|
|
57
49
|
return id;
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
wrapperRaf.cancel = function (id) {
|
|
61
52
|
var realId = rafIds.get(id);
|
|
62
53
|
cleanup(realId);
|
|
63
54
|
return caf(realId);
|
|
64
55
|
};
|
|
65
|
-
|
|
66
56
|
export { wrapperRaf as default };
|
|
@@ -10,20 +10,16 @@
|
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import ReactResizeObserver from '../../rc-resize-observer/es/index.js';
|
|
12
12
|
import classNames from '../../classnames/index.js';
|
|
13
|
-
|
|
14
13
|
function ownKeys(object, enumerableOnly) {
|
|
15
14
|
var keys = Object.keys(object);
|
|
16
|
-
|
|
17
15
|
if (Object.getOwnPropertySymbols) {
|
|
18
16
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
19
17
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
20
18
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
21
19
|
})), keys.push.apply(keys, symbols);
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return keys;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
function _objectSpread(target) {
|
|
28
24
|
for (var i = 1; i < arguments.length; i++) {
|
|
29
25
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -33,10 +29,8 @@ function _objectSpread(target) {
|
|
|
33
29
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
34
30
|
});
|
|
35
31
|
}
|
|
36
|
-
|
|
37
32
|
return target;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
function _defineProperty(obj, key, value) {
|
|
41
35
|
if (key in obj) {
|
|
42
36
|
Object.defineProperty(obj, key, {
|
|
@@ -48,26 +42,23 @@ function _defineProperty(obj, key, value) {
|
|
|
48
42
|
} else {
|
|
49
43
|
obj[key] = value;
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
return obj;
|
|
53
46
|
}
|
|
54
47
|
/**
|
|
55
48
|
* Fill component to provided the scroll content real height.
|
|
56
49
|
*/
|
|
57
50
|
|
|
58
|
-
|
|
59
51
|
var Filler = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
60
52
|
var height = _ref.height,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
offset = _ref.offset,
|
|
54
|
+
children = _ref.children,
|
|
55
|
+
prefixCls = _ref.prefixCls,
|
|
56
|
+
onInnerResize = _ref.onInnerResize;
|
|
65
57
|
var outerStyle = {};
|
|
66
58
|
var innerStyle = {
|
|
67
59
|
display: 'flex',
|
|
68
60
|
flexDirection: 'column'
|
|
69
61
|
};
|
|
70
|
-
|
|
71
62
|
if (offset !== undefined) {
|
|
72
63
|
outerStyle = {
|
|
73
64
|
height: height,
|
|
@@ -82,13 +73,11 @@ var Filler = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
82
73
|
top: 0
|
|
83
74
|
});
|
|
84
75
|
}
|
|
85
|
-
|
|
86
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
87
77
|
style: outerStyle
|
|
88
78
|
}, /*#__PURE__*/React.createElement(ReactResizeObserver, {
|
|
89
79
|
onResize: function onResize(_ref2) {
|
|
90
80
|
var offsetHeight = _ref2.offsetHeight;
|
|
91
|
-
|
|
92
81
|
if (offsetHeight && onInnerResize) {
|
|
93
82
|
onInnerResize();
|
|
94
83
|
}
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
import * as React from 'react';
|
|
11
|
-
|
|
12
11
|
function Item(_ref) {
|
|
13
12
|
var children = _ref.children,
|
|
14
|
-
|
|
13
|
+
setRef = _ref.setRef;
|
|
15
14
|
var refFunc = React.useCallback(function (node) {
|
|
16
15
|
setRef(node);
|
|
17
16
|
}, []);
|
|
@@ -19,5 +18,4 @@ function Item(_ref) {
|
|
|
19
18
|
ref: refFunc
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
export { Item };
|