@7shifts/sous-chef 3.57.3-beta0 → 3.57.3-beta1

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.
@@ -6399,17 +6399,27 @@ 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
+ return;
6409
+ }
6410
+ const header = tableRef.current.getElementsByTagName('thead')[0];
6411
+ setHeaderHeight(header.clientHeight);
6412
+ }, [setHeaderHeight, tableRef]);
6404
6413
  const backgroundColor = useBackgroundColor();
6405
6414
  return React__default.createElement("div", {
6406
6415
  className: classnames(styles$19['data-table-scroll-fake-border'], {
6407
6416
  [styles$19['data-table-scroll-fake-border--top']]: placement === 'top',
6408
6417
  [styles$19['data-table-scroll-fake-border--bottom']]: placement === 'bottom'
6409
6418
  }),
6410
- // @ts-expect-error This difines a custom CSS variable
6411
6419
  style: {
6412
- '--corner-background-color': backgroundColor
6420
+ // @ts-expect-error This difines a custom CSS variable
6421
+ '--corner-background-color': backgroundColor,
6422
+ top: placement === 'top' ? headerheight : undefined
6413
6423
  }
6414
6424
  }, React__default.createElement("div", {
6415
6425
  className: classnames(styles$19['data-table-scroll-fake-border__left'], {
@@ -9493,7 +9503,8 @@ const DataTable = _ref => {
9493
9503
  isShowingFooter: !!isShowingFooter,
9494
9504
  tableRef: tableRef
9495
9505
  }, isShowingColumns && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
9496
- placement: "top"
9506
+ placement: "top",
9507
+ tableRef: tableRef
9497
9508
  }), React__default.createElement("div", {
9498
9509
  className: classnames(styles$1a['data-table__content'], {
9499
9510
  [styles$1a['data-table__content--with-scroll']]: isScrollableTable
@@ -9532,7 +9543,8 @@ const DataTable = _ref => {
9532
9543
  className: styles$1a['data-table__footer'],
9533
9544
  "data-testid": testId && `${testId}-footer`
9534
9545
  }, footerComponent)))), !isShowingFooter && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
9535
- placement: "bottom"
9546
+ placement: "bottom",
9547
+ tableRef: tableRef
9536
9548
  })), React__default.createElement(Pagination, null));
9537
9549
  };
9538
9550