@canvas-components/list-table 0.3.20 → 0.3.21

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.d.cts CHANGED
@@ -1245,7 +1245,7 @@ interface ListTableTooltipRequest {
1245
1245
  x: number;
1246
1246
  y: number;
1247
1247
  content: string;
1248
- variant?: "default" | "error";
1248
+ variant?: "default" | "error" | "resize";
1249
1249
  /**
1250
1250
  * 表格内容缩放(1 = 100%),用于 tooltip 与画布视觉同步。
1251
1251
  */
package/dist/index.d.ts CHANGED
@@ -1245,7 +1245,7 @@ interface ListTableTooltipRequest {
1245
1245
  x: number;
1246
1246
  y: number;
1247
1247
  content: string;
1248
- variant?: "default" | "error";
1248
+ variant?: "default" | "error" | "resize";
1249
1249
  /**
1250
1250
  * 表格内容缩放(1 = 100%),用于 tooltip 与画布视觉同步。
1251
1251
  */
package/dist/index.js CHANGED
@@ -8337,7 +8337,7 @@ function resolveHeaderTextLayout(params) {
8337
8337
  Math.min(baseX - textLeft, textRight - baseX) * 2,
8338
8338
  0
8339
8339
  );
8340
- if (centeredWidth >= 12) {
8340
+ if (centeredWidth >= Math.max(params.contentWidth ?? 0, 12)) {
8341
8341
  return {
8342
8342
  align,
8343
8343
  x: baseX,
@@ -26919,9 +26919,9 @@ function updateHeaderActionTooltip(params) {
26919
26919
  tooltip.show(tooltipPoint.x, tooltipPoint.y, text);
26920
26920
  }
26921
26921
  function showDragTooltip(params) {
26922
- const { tooltip, toViewportPoint, x, y, text } = params;
26922
+ const { tooltip, toViewportPoint, x, y, text, variant } = params;
26923
26923
  const point = toViewportPoint(x, y + 16);
26924
- tooltip.show(point.x, point.y, text);
26924
+ tooltip.show(point.x, point.y, text, variant);
26925
26925
  }
26926
26926
 
26927
26927
  // src/shared/utils/hit-result.ts
@@ -29116,7 +29116,8 @@ var ListTableEventController = class {
29116
29116
  toViewportPoint: (x, y) => this.host.toViewportPoint(x, y),
29117
29117
  x: dragPos.x,
29118
29118
  y: dragPos.y,
29119
- text: `${resizeResult.column.title}: ${resizeResult.nextWidth}px`
29119
+ text: `${resizeResult.column.title}: ${resizeResult.nextWidth}px`,
29120
+ variant: "resize"
29120
29121
  });
29121
29122
  }
29122
29123
  this.host.scheduleRender();