@lensui/lens-table 0.1.45 → 0.1.46

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.cjs CHANGED
@@ -3894,13 +3894,15 @@ function TableInner({
3894
3894
  anchorLeft = anchorX;
3895
3895
  anchorY = rowTop + headerLeafTop + (column.renderHeader ? 8 + Math.max(0, (16 - headerActionSize) / 2) : (headerLeafHeight - headerActionSize) / 2) + headerActionSize / 2 + 1;
3896
3896
  }
3897
- const placement = anchorX + 328 > viewport.width ? "left" : "right";
3897
+ const isActionTooltip = action === "drag" || action === "sort" || action === "filter";
3898
+ const horizontalPlacement = anchorX + 328 > viewport.width ? "left" : "right";
3899
+ const placement = isActionTooltip ? "above" : horizontalPlacement;
3898
3900
  return {
3899
3901
  key: `${action}:${cell ? `cell:${cell.key}:${cell.level}` : `column:${column.key}`}:${Math.round(anchorX)}:${Math.round(rowTop)}`,
3900
3902
  columnIndex,
3901
3903
  action,
3902
- left: placement === "right" ? anchorX + 8 : Math.max(8, anchorLeft - 8),
3903
- top: anchorY,
3904
+ left: placement === "above" ? anchorX : placement === "right" ? anchorX + 8 : Math.max(8, anchorLeft - 8),
3905
+ top: placement === "above" ? anchorY - 8 : anchorY,
3904
3906
  label,
3905
3907
  placement
3906
3908
  };
package/dist/index.css CHANGED
@@ -954,6 +954,18 @@
954
954
  right: -4px;
955
955
  border-left: 5px solid var(--rvg-color-tooltip-bg);
956
956
  }
957
+ .rvg-header-tooltip.is-above {
958
+ transform: translate(-50%, -100%);
959
+ }
960
+ .rvg-header-tooltip.is-above::after {
961
+ bottom: -4px;
962
+ left: 50%;
963
+ transform: translateX(-50%);
964
+ border-right: 5px solid transparent;
965
+ border-top: 5px solid var(--rvg-color-tooltip-bg);
966
+ border-bottom: 0;
967
+ border-left: 5px solid transparent;
968
+ }
957
969
  .rvg-header-tooltip.is-below,
958
970
  .rvg-cell-tooltip.is-below {
959
971
  transform: none;
package/dist/index.js CHANGED
@@ -3864,13 +3864,15 @@ function TableInner({
3864
3864
  anchorLeft = anchorX;
3865
3865
  anchorY = rowTop + headerLeafTop + (column.renderHeader ? 8 + Math.max(0, (16 - headerActionSize) / 2) : (headerLeafHeight - headerActionSize) / 2) + headerActionSize / 2 + 1;
3866
3866
  }
3867
- const placement = anchorX + 328 > viewport.width ? "left" : "right";
3867
+ const isActionTooltip = action === "drag" || action === "sort" || action === "filter";
3868
+ const horizontalPlacement = anchorX + 328 > viewport.width ? "left" : "right";
3869
+ const placement = isActionTooltip ? "above" : horizontalPlacement;
3868
3870
  return {
3869
3871
  key: `${action}:${cell ? `cell:${cell.key}:${cell.level}` : `column:${column.key}`}:${Math.round(anchorX)}:${Math.round(rowTop)}`,
3870
3872
  columnIndex,
3871
3873
  action,
3872
- left: placement === "right" ? anchorX + 8 : Math.max(8, anchorLeft - 8),
3873
- top: anchorY,
3874
+ left: placement === "above" ? anchorX : placement === "right" ? anchorX + 8 : Math.max(8, anchorLeft - 8),
3875
+ top: placement === "above" ? anchorY - 8 : anchorY,
3874
3876
  label,
3875
3877
  placement
3876
3878
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensui/lens-table",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "description": "A lightweight, canvas-rendered React table component for LensUI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",