asma-ui-table 1.4.1 → 1.4.2
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/dist/asma-ui-table.es.js +21 -2
- package/package.json +1 -1
package/dist/asma-ui-table.es.js
CHANGED
|
@@ -14136,8 +14136,12 @@ function useProxyHorizontalScrollSync(enabled) {
|
|
|
14136
14136
|
syncProxyFromTable();
|
|
14137
14137
|
tableXEl.addEventListener("scroll", syncProxyFromTable, { passive: true });
|
|
14138
14138
|
hScrollEl.addEventListener("scroll", syncTableFromProxy, { passive: true });
|
|
14139
|
+
const content = tableXEl.querySelector("table");
|
|
14139
14140
|
const ro = new ResizeObserver(syncWidth);
|
|
14140
14141
|
ro.observe(tableXEl);
|
|
14142
|
+
if (content) {
|
|
14143
|
+
ro.observe(content);
|
|
14144
|
+
}
|
|
14141
14145
|
return () => {
|
|
14142
14146
|
tableXEl.removeEventListener("scroll", syncProxyFromTable);
|
|
14143
14147
|
hScrollEl.removeEventListener("scroll", syncTableFromProxy);
|
|
@@ -15243,8 +15247,23 @@ const StyledTable = (props) => {
|
|
|
15243
15247
|
setHasInternalOverflow(false);
|
|
15244
15248
|
return;
|
|
15245
15249
|
}
|
|
15246
|
-
|
|
15247
|
-
|
|
15250
|
+
const content = host.querySelector("table");
|
|
15251
|
+
const updateOverflow = () => {
|
|
15252
|
+
const nextHasOverflow = host.scrollWidth > host.clientWidth;
|
|
15253
|
+
setHasInternalOverflow(
|
|
15254
|
+
(prevHasOverflow) => prevHasOverflow === nextHasOverflow ? prevHasOverflow : nextHasOverflow
|
|
15255
|
+
);
|
|
15256
|
+
};
|
|
15257
|
+
updateOverflow();
|
|
15258
|
+
const resizeObserver = new ResizeObserver(updateOverflow);
|
|
15259
|
+
resizeObserver.observe(host);
|
|
15260
|
+
if (content) {
|
|
15261
|
+
resizeObserver.observe(content);
|
|
15262
|
+
}
|
|
15263
|
+
return () => {
|
|
15264
|
+
resizeObserver.disconnect();
|
|
15265
|
+
};
|
|
15266
|
+
}, [canShowStickyFooter, tableXRef, tableScrollRef]);
|
|
15248
15267
|
const { ref: containerRef, heightPx: rowsAreaPx } = useElementHeightPx();
|
|
15249
15268
|
const rowHeightPx = options.rowHeight ?? 48;
|
|
15250
15269
|
const visibleRows = table.getRowModel().rows.length;
|