@7shifts/sous-chef 3.57.3-beta0 → 3.57.3-beta2
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/index.modern.js
CHANGED
|
@@ -6399,17 +6399,29 @@ var styles$19 = {"data-table-scroll-fake-border":"_wZ8Xg","data-table-scroll-fak
|
|
|
6399
6399
|
* It creates fake borders with radius corners to hide the table borders when scrolling
|
|
6400
6400
|
*/
|
|
6401
6401
|
const DataTableScrollFakeBorder = ({
|
|
6402
|
-
placement
|
|
6402
|
+
placement,
|
|
6403
|
+
tableRef
|
|
6403
6404
|
}) => {
|
|
6405
|
+
const [headerheight, setHeaderHeight] = React__default.useState(24);
|
|
6406
|
+
useLayoutEffect(() => {
|
|
6407
|
+
if (!tableRef.current) {
|
|
6408
|
+
console.log('ref not available');
|
|
6409
|
+
return;
|
|
6410
|
+
}
|
|
6411
|
+
const header = tableRef.current.getElementsByTagName('thead')[0];
|
|
6412
|
+
console.log('header height', header.clientHeight);
|
|
6413
|
+
setHeaderHeight(header.clientHeight);
|
|
6414
|
+
}, [setHeaderHeight, tableRef]);
|
|
6404
6415
|
const backgroundColor = useBackgroundColor();
|
|
6405
6416
|
return React__default.createElement("div", {
|
|
6406
6417
|
className: classnames(styles$19['data-table-scroll-fake-border'], {
|
|
6407
6418
|
[styles$19['data-table-scroll-fake-border--top']]: placement === 'top',
|
|
6408
6419
|
[styles$19['data-table-scroll-fake-border--bottom']]: placement === 'bottom'
|
|
6409
6420
|
}),
|
|
6410
|
-
// @ts-expect-error This difines a custom CSS variable
|
|
6411
6421
|
style: {
|
|
6412
|
-
|
|
6422
|
+
// @ts-expect-error This difines a custom CSS variable
|
|
6423
|
+
'--corner-background-color': backgroundColor,
|
|
6424
|
+
top: placement === 'top' ? headerheight : undefined
|
|
6413
6425
|
}
|
|
6414
6426
|
}, React__default.createElement("div", {
|
|
6415
6427
|
className: classnames(styles$19['data-table-scroll-fake-border__left'], {
|
|
@@ -9493,7 +9505,8 @@ const DataTable = _ref => {
|
|
|
9493
9505
|
isShowingFooter: !!isShowingFooter,
|
|
9494
9506
|
tableRef: tableRef
|
|
9495
9507
|
}, isShowingColumns && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
9496
|
-
placement: "top"
|
|
9508
|
+
placement: "top",
|
|
9509
|
+
tableRef: tableRef
|
|
9497
9510
|
}), React__default.createElement("div", {
|
|
9498
9511
|
className: classnames(styles$1a['data-table__content'], {
|
|
9499
9512
|
[styles$1a['data-table__content--with-scroll']]: isScrollableTable
|
|
@@ -9532,7 +9545,8 @@ const DataTable = _ref => {
|
|
|
9532
9545
|
className: styles$1a['data-table__footer'],
|
|
9533
9546
|
"data-testid": testId && `${testId}-footer`
|
|
9534
9547
|
}, footerComponent)))), !isShowingFooter && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
9535
|
-
placement: "bottom"
|
|
9548
|
+
placement: "bottom",
|
|
9549
|
+
tableRef: tableRef
|
|
9536
9550
|
})), React__default.createElement(Pagination, null));
|
|
9537
9551
|
};
|
|
9538
9552
|
|