ehscan-react-table 0.0.22 → 0.0.24

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,10 +30,13 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
30
30
  }, [searchTermArraySetter]);
31
31
  useEffect(() => {
32
32
  const calculateHeight = () => {
33
+ if (colRefs.current) {
34
+ console.log(colRefs.current);
35
+ }
33
36
  if (headerRef.current) {
37
+ console.log(headerRef.current);
34
38
  const { bottom } = headerRef.current.getBoundingClientRect();
35
- console.log(bottom);
36
- setWrapperBottom(bottom + 20);
39
+ setWrapperBottom(bottom - 20);
37
40
  }
38
41
  };
39
42
  calculateHeight();
@@ -106,22 +109,6 @@ export const Table = ({ columns, rows, sortOrder, setSortOrder, cellComponents,
106
109
  ? _jsx(HeadSearchBar, { content: colTitle, tag: tag })
107
110
  : _jsx("div", { onClick: () => setOpenCol(tag), children: colTitle }) })] }) }));
108
111
  };
109
- useEffect(() => {
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
- }, []);
125
112
  const HeadCols = () => {
126
113
  return (_jsxs(_Fragment, { children: [columns.map((col, i) => {
127
114
  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.22",
3
+ "version": "0.0.24",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",