bhd-components 0.9.7 → 0.9.8
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 -1
- package/dist/index.esm.es5.development.js +7 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/dist/vendor.esm.es5.development.js +6 -1
- package/dist/vendor.esm.es5.production.js +3 -3
- package/es2017/table/index.js +7 -1
- package/esm/table/index.js +7 -1
- package/package.json +1 -1
package/es2017/table/index.js
CHANGED
|
@@ -53,6 +53,7 @@ const Table = (props)=>{
|
|
|
53
53
|
const timerRef = useRef({
|
|
54
54
|
timer: null
|
|
55
55
|
});
|
|
56
|
+
const scrollObjectRef = useRef(null);
|
|
56
57
|
const { defaultWidthRang = [
|
|
57
58
|
180,
|
|
58
59
|
240,
|
|
@@ -75,7 +76,7 @@ const Table = (props)=>{
|
|
|
75
76
|
}
|
|
76
77
|
let { columns: selfColumns } = initColumnsWidth(props.columns, tableWidth);
|
|
77
78
|
setColumns(selfColumns);
|
|
78
|
-
let obj =
|
|
79
|
+
let obj = scrollObjectRef.current ? scrollObjectRef.current : {};
|
|
79
80
|
obj = _object_spread_props(_object_spread({}, obj), {
|
|
80
81
|
x: tableWidth
|
|
81
82
|
});
|
|
@@ -224,6 +225,11 @@ const Table = (props)=>{
|
|
|
224
225
|
}, [
|
|
225
226
|
props.scroll
|
|
226
227
|
]);
|
|
228
|
+
useEffect(()=>{
|
|
229
|
+
scrollObjectRef.current = scrollObject;
|
|
230
|
+
}, [
|
|
231
|
+
scrollObject
|
|
232
|
+
]);
|
|
227
233
|
let config = _object_spread_props(_object_spread({
|
|
228
234
|
bordered: false
|
|
229
235
|
}, props), {
|
package/esm/table/index.js
CHANGED
|
@@ -54,6 +54,7 @@ var Table = function(props) {
|
|
|
54
54
|
var timerRef = useRef({
|
|
55
55
|
timer: null
|
|
56
56
|
});
|
|
57
|
+
var scrollObjectRef = useRef(null);
|
|
57
58
|
var _props_defaultWidthRang = props.defaultWidthRang, defaultWidthRang = _props_defaultWidthRang === void 0 ? [
|
|
58
59
|
180,
|
|
59
60
|
240,
|
|
@@ -76,7 +77,7 @@ var Table = function(props) {
|
|
|
76
77
|
}
|
|
77
78
|
var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
|
|
78
79
|
setColumns(selfColumns);
|
|
79
|
-
var obj =
|
|
80
|
+
var obj = scrollObjectRef.current ? scrollObjectRef.current : {};
|
|
80
81
|
obj = _object_spread_props(_object_spread({}, obj), {
|
|
81
82
|
x: tableWidth
|
|
82
83
|
});
|
|
@@ -229,6 +230,11 @@ var Table = function(props) {
|
|
|
229
230
|
}, [
|
|
230
231
|
props.scroll
|
|
231
232
|
]);
|
|
233
|
+
useEffect(function() {
|
|
234
|
+
scrollObjectRef.current = scrollObject;
|
|
235
|
+
}, [
|
|
236
|
+
scrollObject
|
|
237
|
+
]);
|
|
232
238
|
var config = _object_spread_props(_object_spread({
|
|
233
239
|
bordered: false
|
|
234
240
|
}, props), {
|