@canvas-components/react-list-table 0.3.23 → 0.3.25
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 +19 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -572,6 +572,11 @@ function ReactTableContextMenuView(props) {
|
|
|
572
572
|
key: "auto-fit-all",
|
|
573
573
|
label: "\u5168\u90E8\u5217",
|
|
574
574
|
onClick: request.onAutoFitAllColumns
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
key: "auto-fit-fill-container",
|
|
578
|
+
label: "\u81EA\u52A8\u94FA\u6EE1\u5BB9\u5668",
|
|
579
|
+
onClick: request.onAutoFitFillContainer
|
|
575
580
|
}
|
|
576
581
|
]
|
|
577
582
|
}
|
|
@@ -3800,6 +3805,14 @@ function ReactTableDangerConfirmView(props) {
|
|
|
3800
3805
|
}
|
|
3801
3806
|
function ReactTableTooltipView(props) {
|
|
3802
3807
|
const { request } = props;
|
|
3808
|
+
const tooltipRef = react.useRef(null);
|
|
3809
|
+
react.useLayoutEffect(() => {
|
|
3810
|
+
const tooltip = tooltipRef.current;
|
|
3811
|
+
if (!tooltip || !request || typeof window === "undefined") return;
|
|
3812
|
+
const width = tooltip.getBoundingClientRect().width;
|
|
3813
|
+
const viewportWidth = window.innerWidth;
|
|
3814
|
+
tooltip.style.left = `${Math.max(8, Math.min(request.x - width / 2, viewportWidth - width - 8))}px`;
|
|
3815
|
+
}, [request]);
|
|
3803
3816
|
if (!request) {
|
|
3804
3817
|
return null;
|
|
3805
3818
|
}
|
|
@@ -3813,8 +3826,7 @@ function ReactTableTooltipView(props) {
|
|
|
3813
3826
|
position: "fixed",
|
|
3814
3827
|
left: request.x,
|
|
3815
3828
|
top: request.y,
|
|
3816
|
-
|
|
3817
|
-
maxWidth,
|
|
3829
|
+
maxWidth: request.variant === "resize" ? "calc(100vw - 16px)" : `min(${maxWidth}px, calc(100vw - 16px))`,
|
|
3818
3830
|
padding: `${paddingBlock}px ${paddingInline}px`,
|
|
3819
3831
|
borderRadius,
|
|
3820
3832
|
background: request.variant === "error" ? "#ffffff" : "rgba(17, 24, 39, 0.92)",
|
|
@@ -3825,10 +3837,12 @@ function ReactTableTooltipView(props) {
|
|
|
3825
3837
|
border: request.variant === "error" ? "1px solid rgba(255, 77, 79, 0.2)" : "none",
|
|
3826
3838
|
pointerEvents: "none",
|
|
3827
3839
|
zIndex: 1200,
|
|
3828
|
-
whiteSpace: "pre-wrap",
|
|
3829
|
-
wordBreak: "break-word"
|
|
3840
|
+
whiteSpace: request.variant === "resize" ? "nowrap" : "pre-wrap",
|
|
3841
|
+
wordBreak: "break-word",
|
|
3842
|
+
overflow: "hidden",
|
|
3843
|
+
textOverflow: request.variant === "resize" ? "ellipsis" : void 0
|
|
3830
3844
|
};
|
|
3831
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style, children: request.content });
|
|
3845
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: tooltipRef, style, children: request.content });
|
|
3832
3846
|
}
|
|
3833
3847
|
function ToolbarIcon(props) {
|
|
3834
3848
|
const { path, ...svgProps } = props;
|