baseui 0.0.0-alpha-48d2ddc → 0.0.0-alpha-d3f908b
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/data-table/data-table.js +1 -0
- package/data-table/data-table.js.flow +1 -0
- package/data-table/measure-column-widths.js +7 -2
- package/data-table/measure-column-widths.js.flow +6 -3
- package/es/data-table/data-table.js +1 -0
- package/es/data-table/measure-column-widths.js +7 -2
- package/esm/data-table/data-table.js +1 -0
- package/esm/data-table/measure-column-widths.js +7 -2
- package/package.json +1 -1
package/data-table/data-table.js
CHANGED
|
@@ -609,6 +609,7 @@ function DataTable(_ref2) {
|
|
|
609
609
|
}
|
|
610
610
|
}, [gridRef]);
|
|
611
611
|
var handleWidthsChange = React.useCallback(function (nextWidths) {
|
|
612
|
+
console.log('next widths', nextWidths);
|
|
612
613
|
setMeasuredWidths(nextWidths);
|
|
613
614
|
resetAfterColumnIndex(0);
|
|
614
615
|
}, [setMeasuredWidths, resetAfterColumnIndex]);
|
|
@@ -44,11 +44,14 @@ function MeasureColumn(_ref) {
|
|
|
44
44
|
_useStyletron2 = _slicedToArray(_useStyletron, 1),
|
|
45
45
|
css = _useStyletron2[0];
|
|
46
46
|
|
|
47
|
-
var ref =
|
|
47
|
+
var ref = React.useRef();
|
|
48
48
|
React.useEffect(function () {
|
|
49
49
|
if (typeof document !== 'undefined') {
|
|
50
50
|
if (ref.current) {
|
|
51
|
-
onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
51
|
+
// onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
52
|
+
onLayout(columnIndex, {
|
|
53
|
+
width: 0
|
|
54
|
+
});
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
}, []);
|
|
@@ -139,7 +142,9 @@ function MeasureColumnWidths(_ref2) {
|
|
|
139
142
|
return generateSampleIndices(0, rows.length - 1, sampleSize);
|
|
140
143
|
}, [columns, rows, widths, sampleSize]);
|
|
141
144
|
var handleDimensionsChange = React.useCallback(function (columnIndex, dimensions) {
|
|
145
|
+
console.log('handle dimensions change', columnIndex, dimensions);
|
|
142
146
|
var nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
|
|
147
|
+
console.log('next width', columnIndex, nextWidth);
|
|
143
148
|
|
|
144
149
|
if (nextWidth !== widthMap.get(columnIndex)) {
|
|
145
150
|
widthMap.set(columnIndex, nextWidth);
|
|
@@ -25,12 +25,12 @@ function MeasureColumn({
|
|
|
25
25
|
}) {
|
|
26
26
|
const [css] = useStyletron();
|
|
27
27
|
|
|
28
|
-
const ref = useRef();
|
|
29
|
-
|
|
28
|
+
const ref = React.useRef();
|
|
30
29
|
React.useEffect(() => {
|
|
31
30
|
if (__BROWSER__) {
|
|
32
31
|
if (ref.current) {
|
|
33
|
-
onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
32
|
+
// onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
33
|
+
onLayout(columnIndex, {width: 0});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}, []);
|
|
@@ -134,6 +134,7 @@ export default function MeasureColumnWidths({
|
|
|
134
134
|
|
|
135
135
|
const handleDimensionsChange = React.useCallback(
|
|
136
136
|
(columnIndex, dimensions) => {
|
|
137
|
+
console.log('handle dimensions change', columnIndex, dimensions);
|
|
137
138
|
const nextWidth = Math.min(
|
|
138
139
|
Math.max(
|
|
139
140
|
columns[columnIndex].minWidth || 0,
|
|
@@ -142,10 +143,12 @@ export default function MeasureColumnWidths({
|
|
|
142
143
|
),
|
|
143
144
|
columns[columnIndex].maxWidth || Infinity,
|
|
144
145
|
);
|
|
146
|
+
console.log('next width', columnIndex, nextWidth);
|
|
145
147
|
|
|
146
148
|
if (nextWidth !== widthMap.get(columnIndex)) {
|
|
147
149
|
widthMap.set(columnIndex, nextWidth);
|
|
148
150
|
}
|
|
151
|
+
|
|
149
152
|
if (
|
|
150
153
|
// Refresh at 100% of done
|
|
151
154
|
widthMap.size === columns.length ||
|
|
@@ -490,6 +490,7 @@ export function DataTable({
|
|
|
490
490
|
}
|
|
491
491
|
}, [gridRef]);
|
|
492
492
|
const handleWidthsChange = React.useCallback(nextWidths => {
|
|
493
|
+
console.log('next widths', nextWidths);
|
|
493
494
|
setMeasuredWidths(nextWidths);
|
|
494
495
|
resetAfterColumnIndex(0);
|
|
495
496
|
}, [setMeasuredWidths, resetAfterColumnIndex]);
|
|
@@ -18,11 +18,14 @@ function MeasureColumn({
|
|
|
18
18
|
onLayout
|
|
19
19
|
}) {
|
|
20
20
|
const [css] = useStyletron();
|
|
21
|
-
const ref = useRef();
|
|
21
|
+
const ref = React.useRef();
|
|
22
22
|
React.useEffect(() => {
|
|
23
23
|
if (typeof document !== 'undefined') {
|
|
24
24
|
if (ref.current) {
|
|
25
|
-
onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
25
|
+
// onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
26
|
+
onLayout(columnIndex, {
|
|
27
|
+
width: 0
|
|
28
|
+
});
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
}, []);
|
|
@@ -107,7 +110,9 @@ export default function MeasureColumnWidths({
|
|
|
107
110
|
return generateSampleIndices(0, rows.length - 1, sampleSize);
|
|
108
111
|
}, [columns, rows, widths, sampleSize]);
|
|
109
112
|
const handleDimensionsChange = React.useCallback((columnIndex, dimensions) => {
|
|
113
|
+
console.log('handle dimensions change', columnIndex, dimensions);
|
|
110
114
|
const nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
|
|
115
|
+
console.log('next width', columnIndex, nextWidth);
|
|
111
116
|
|
|
112
117
|
if (nextWidth !== widthMap.get(columnIndex)) {
|
|
113
118
|
widthMap.set(columnIndex, nextWidth);
|
|
@@ -590,6 +590,7 @@ export function DataTable(_ref2) {
|
|
|
590
590
|
}
|
|
591
591
|
}, [gridRef]);
|
|
592
592
|
var handleWidthsChange = React.useCallback(function (nextWidths) {
|
|
593
|
+
console.log('next widths', nextWidths);
|
|
593
594
|
setMeasuredWidths(nextWidths);
|
|
594
595
|
resetAfterColumnIndex(0);
|
|
595
596
|
}, [setMeasuredWidths, resetAfterColumnIndex]);
|
|
@@ -33,11 +33,14 @@ function MeasureColumn(_ref) {
|
|
|
33
33
|
_useStyletron2 = _slicedToArray(_useStyletron, 1),
|
|
34
34
|
css = _useStyletron2[0];
|
|
35
35
|
|
|
36
|
-
var ref = useRef();
|
|
36
|
+
var ref = React.useRef();
|
|
37
37
|
React.useEffect(function () {
|
|
38
38
|
if (typeof document !== 'undefined') {
|
|
39
39
|
if (ref.current) {
|
|
40
|
-
onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
40
|
+
// onLayout(columnIndex, ref.current.getBoundingClientRect());
|
|
41
|
+
onLayout(columnIndex, {
|
|
42
|
+
width: 0
|
|
43
|
+
});
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
}, []);
|
|
@@ -128,7 +131,9 @@ export default function MeasureColumnWidths(_ref2) {
|
|
|
128
131
|
return generateSampleIndices(0, rows.length - 1, sampleSize);
|
|
129
132
|
}, [columns, rows, widths, sampleSize]);
|
|
130
133
|
var handleDimensionsChange = React.useCallback(function (columnIndex, dimensions) {
|
|
134
|
+
console.log('handle dimensions change', columnIndex, dimensions);
|
|
131
135
|
var nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
|
|
136
|
+
console.log('next width', columnIndex, nextWidth);
|
|
132
137
|
|
|
133
138
|
if (nextWidth !== widthMap.get(columnIndex)) {
|
|
134
139
|
widthMap.set(columnIndex, nextWidth);
|