ehscan-react-table 0.0.23 → 0.0.25

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.
@@ -30,7 +30,12 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
30
30
  }, [searchTermArraySetter]);
31
31
  useEffect(() => {
32
32
  const calculateHeight = () => {
33
+ var _a;
34
+ if ((_a = colRefs === null || colRefs === void 0 ? void 0 : colRefs.current) === null || _a === void 0 ? void 0 : _a['duedate']) {
35
+ console.log(colRefs.current['duedate'].getBoundingClientRect());
36
+ }
33
37
  if (headerRef.current) {
38
+ console.log(headerRef.current.getBoundingClientRect());
34
39
  const { bottom } = headerRef.current.getBoundingClientRect();
35
40
  setWrapperBottom(bottom - 20);
36
41
  }
@@ -105,25 +110,6 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
105
110
  ? _jsx(HeadSearchBar, { content: colTitle, tag: tag })
106
111
  : _jsx("div", { onClick: () => setOpenCol(tag), children: colTitle }) })] }) }));
107
112
  };
108
- useEffect(() => {
109
- const timeout = setTimeout(() => {
110
- const observer = new ResizeObserver((entries) => {
111
- entries.forEach((entry) => {
112
- const tag = Object.keys(colRefs.current).find(k => colRefs.current[k] === entry.target);
113
- if (tag) {
114
- const width = entry.contentRect.width;
115
- console.log(`Column "${tag}" resized to:`, width);
116
- }
117
- });
118
- });
119
- Object.values(colRefs.current).forEach((el) => {
120
- if (el)
121
- observer.observe(el);
122
- });
123
- return () => observer.disconnect();
124
- }, 50); // 50ms is usually enough
125
- return () => clearTimeout(timeout);
126
- }, []);
127
113
  const HeadCols = () => {
128
114
  return (_jsxs(_Fragment, { children: [columns.map((col, i) => {
129
115
  const { tag, type, width } = col;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-table",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",