baseui 0.0.0-alpha-29a759d → 0.0.0-alpha-0ccfc47

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.
@@ -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]);
@@ -726,6 +726,7 @@ export function DataTable({
726
726
  );
727
727
  const handleWidthsChange = React.useCallback(
728
728
  nextWidths => {
729
+ console.log('next widths', nextWidths);
729
730
  setMeasuredWidths(nextWidths);
730
731
  resetAfterColumnIndex(0);
731
732
  },
@@ -44,29 +44,14 @@ function MeasureColumn(_ref) {
44
44
  _useStyletron2 = _slicedToArray(_useStyletron, 1),
45
45
  css = _useStyletron2[0];
46
46
 
47
- var _React$useState = React.useState(null),
48
- _React$useState2 = _slicedToArray(_React$useState, 2),
49
- node = _React$useState2[0],
50
- setNode = _React$useState2[1];
51
-
52
- var ref = React.useCallback(function (node) {
53
- setNode(node);
54
- }, []);
47
+ var ref = React.useRef();
55
48
  React.useEffect(function () {
56
49
  if (typeof document !== 'undefined') {
57
- if (node) {
58
- onLayout(columnIndex, node.getBoundingClientRect());
50
+ if (ref.current) {
51
+ onLayout(columnIndex, ref.current.getBoundingClientRect());
59
52
  }
60
53
  }
61
- }, [node, onLayout]); // const ref = React.useRef();
62
- // React.useEffect(() => {
63
- // if (__BROWSER__) {
64
- // if (ref.current) {
65
- // onLayout(columnIndex, ref.current.getBoundingClientRect());
66
- // }
67
- // }
68
- // }, []);
69
-
54
+ }, []);
70
55
  return /*#__PURE__*/React.createElement("div", {
71
56
  ref: ref,
72
57
  className: css({
@@ -154,7 +139,6 @@ function MeasureColumnWidths(_ref2) {
154
139
  return generateSampleIndices(0, rows.length - 1, sampleSize);
155
140
  }, [columns, rows, widths, sampleSize]);
156
141
  var handleDimensionsChange = React.useCallback(function (columnIndex, dimensions) {
157
- console.log('handle dimensions change', columnIndex, dimensions);
158
142
  var nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
159
143
 
160
144
  if (nextWidth !== widthMap.get(columnIndex)) {
@@ -173,10 +157,9 @@ function MeasureColumnWidths(_ref2) {
173
157
  overflow: 'hidden',
174
158
  height: 0
175
159
  }); // Remove the measurement nodes after we are done updating our column width
176
-
177
- if (widthMap.size === columns.length) {
178
- return null;
179
- }
160
+ // if (widthMap.size === columns.length) {
161
+ // return null;
162
+ // }
180
163
 
181
164
  return (
182
165
  /*#__PURE__*/
@@ -25,26 +25,14 @@ function MeasureColumn({
25
25
  }) {
26
26
  const [css] = useStyletron();
27
27
 
28
- const [node, setNode] = React.useState(null);
29
- const ref = React.useCallback(node => {
30
- setNode(node);
31
- }, []);
28
+ const ref = React.useRef();
32
29
  React.useEffect(() => {
33
30
  if (__BROWSER__) {
34
- if (node) {
35
- onLayout(columnIndex, node.getBoundingClientRect());
31
+ if (ref.current) {
32
+ onLayout(columnIndex, ref.current.getBoundingClientRect());
36
33
  }
37
34
  }
38
- }, [node, onLayout]);
39
-
40
- // const ref = React.useRef();
41
- // React.useEffect(() => {
42
- // if (__BROWSER__) {
43
- // if (ref.current) {
44
- // onLayout(columnIndex, ref.current.getBoundingClientRect());
45
- // }
46
- // }
47
- // }, []);
35
+ }, []);
48
36
 
49
37
  return (
50
38
  <div
@@ -145,7 +133,6 @@ export default function MeasureColumnWidths({
145
133
 
146
134
  const handleDimensionsChange = React.useCallback(
147
135
  (columnIndex, dimensions) => {
148
- console.log('handle dimensions change', columnIndex, dimensions);
149
136
  const nextWidth = Math.min(
150
137
  Math.max(
151
138
  columns[columnIndex].minWidth || 0,
@@ -158,6 +145,7 @@ export default function MeasureColumnWidths({
158
145
  if (nextWidth !== widthMap.get(columnIndex)) {
159
146
  widthMap.set(columnIndex, nextWidth);
160
147
  }
148
+
161
149
  if (
162
150
  // Refresh at 100% of done
163
151
  widthMap.size === columns.length ||
@@ -179,9 +167,9 @@ export default function MeasureColumnWidths({
179
167
  });
180
168
 
181
169
  // Remove the measurement nodes after we are done updating our column width
182
- if (widthMap.size === columns.length) {
183
- return null;
184
- }
170
+ // if (widthMap.size === columns.length) {
171
+ // return null;
172
+ // }
185
173
 
186
174
  return (
187
175
  // eslint-disable-next-line jsx-a11y/role-supports-aria-props
@@ -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,25 +18,14 @@ function MeasureColumn({
18
18
  onLayout
19
19
  }) {
20
20
  const [css] = useStyletron();
21
- const [node, setNode] = React.useState(null);
22
- const ref = React.useCallback(node => {
23
- setNode(node);
24
- }, []);
21
+ const ref = React.useRef();
25
22
  React.useEffect(() => {
26
23
  if (typeof document !== 'undefined') {
27
- if (node) {
28
- onLayout(columnIndex, node.getBoundingClientRect());
24
+ if (ref.current) {
25
+ onLayout(columnIndex, ref.current.getBoundingClientRect());
29
26
  }
30
27
  }
31
- }, [node, onLayout]); // const ref = React.useRef();
32
- // React.useEffect(() => {
33
- // if (__BROWSER__) {
34
- // if (ref.current) {
35
- // onLayout(columnIndex, ref.current.getBoundingClientRect());
36
- // }
37
- // }
38
- // }, []);
39
-
28
+ }, []);
40
29
  return /*#__PURE__*/React.createElement("div", {
41
30
  ref: ref,
42
31
  className: css({
@@ -118,7 +107,6 @@ export default function MeasureColumnWidths({
118
107
  return generateSampleIndices(0, rows.length - 1, sampleSize);
119
108
  }, [columns, rows, widths, sampleSize]);
120
109
  const handleDimensionsChange = React.useCallback((columnIndex, dimensions) => {
121
- console.log('handle dimensions change', columnIndex, dimensions);
122
110
  const nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
123
111
 
124
112
  if (nextWidth !== widthMap.get(columnIndex)) {
@@ -137,10 +125,9 @@ export default function MeasureColumnWidths({
137
125
  overflow: 'hidden',
138
126
  height: 0
139
127
  }); // Remove the measurement nodes after we are done updating our column width
140
-
141
- if (widthMap.size === columns.length) {
142
- return null;
143
- }
128
+ // if (widthMap.size === columns.length) {
129
+ // return null;
130
+ // }
144
131
 
145
132
  return (
146
133
  /*#__PURE__*/
@@ -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,29 +33,14 @@ function MeasureColumn(_ref) {
33
33
  _useStyletron2 = _slicedToArray(_useStyletron, 1),
34
34
  css = _useStyletron2[0];
35
35
 
36
- var _React$useState = React.useState(null),
37
- _React$useState2 = _slicedToArray(_React$useState, 2),
38
- node = _React$useState2[0],
39
- setNode = _React$useState2[1];
40
-
41
- var ref = React.useCallback(function (node) {
42
- setNode(node);
43
- }, []);
36
+ var ref = React.useRef();
44
37
  React.useEffect(function () {
45
38
  if (typeof document !== 'undefined') {
46
- if (node) {
47
- onLayout(columnIndex, node.getBoundingClientRect());
39
+ if (ref.current) {
40
+ onLayout(columnIndex, ref.current.getBoundingClientRect());
48
41
  }
49
42
  }
50
- }, [node, onLayout]); // const ref = React.useRef();
51
- // React.useEffect(() => {
52
- // if (__BROWSER__) {
53
- // if (ref.current) {
54
- // onLayout(columnIndex, ref.current.getBoundingClientRect());
55
- // }
56
- // }
57
- // }, []);
58
-
43
+ }, []);
59
44
  return /*#__PURE__*/React.createElement("div", {
60
45
  ref: ref,
61
46
  className: css({
@@ -143,7 +128,6 @@ export default function MeasureColumnWidths(_ref2) {
143
128
  return generateSampleIndices(0, rows.length - 1, sampleSize);
144
129
  }, [columns, rows, widths, sampleSize]);
145
130
  var handleDimensionsChange = React.useCallback(function (columnIndex, dimensions) {
146
- console.log('handle dimensions change', columnIndex, dimensions);
147
131
  var nextWidth = Math.min(Math.max(columns[columnIndex].minWidth || 0, widthMap.get(columnIndex) || 0, dimensions.width + 1), columns[columnIndex].maxWidth || Infinity);
148
132
 
149
133
  if (nextWidth !== widthMap.get(columnIndex)) {
@@ -162,10 +146,9 @@ export default function MeasureColumnWidths(_ref2) {
162
146
  overflow: 'hidden',
163
147
  height: 0
164
148
  }); // Remove the measurement nodes after we are done updating our column width
165
-
166
- if (widthMap.size === columns.length) {
167
- return null;
168
- }
149
+ // if (widthMap.size === columns.length) {
150
+ // return null;
151
+ // }
169
152
 
170
153
  return (
171
154
  /*#__PURE__*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "0.0.0-alpha-29a759d",
3
+ "version": "0.0.0-alpha-0ccfc47",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",