@eztrak/shared 0.15.1 → 0.15.3
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/{chunk-HQPQ6TOE.mjs → chunk-QM2TGUZN.mjs} +24 -7
- package/dist/{chunk-HQPQ6TOE.mjs.map → chunk-QM2TGUZN.mjs.map} +1 -1
- package/dist/components/index.d.mts +12 -2
- package/dist/components/index.d.ts +12 -2
- package/dist/components/index.js +22 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2158,23 +2158,34 @@ function PopupCellRenderer({
|
|
|
2158
2158
|
onAction,
|
|
2159
2159
|
placement = "bottom-end",
|
|
2160
2160
|
tippyProps,
|
|
2161
|
-
ariaLabel = "Row actions"
|
|
2161
|
+
ariaLabel = "Row actions",
|
|
2162
|
+
openOnHover = false
|
|
2162
2163
|
}) {
|
|
2163
2164
|
const [visible, setVisible] = (0, import_react9.useState)(false);
|
|
2165
|
+
const instanceRef = (0, import_react9.useRef)(null);
|
|
2164
2166
|
const show = () => setVisible(true);
|
|
2165
|
-
const hide = () =>
|
|
2167
|
+
const hide = () => {
|
|
2168
|
+
setVisible(false);
|
|
2169
|
+
instanceRef.current?.hide();
|
|
2170
|
+
};
|
|
2166
2171
|
const rowData = params?.data;
|
|
2167
2172
|
const handleAction = (actionType, actionRowData) => {
|
|
2168
2173
|
onAction?.(actionType, actionRowData ?? rowData, hide);
|
|
2169
2174
|
hide();
|
|
2170
2175
|
};
|
|
2171
2176
|
const content = typeof dropDownContent === "function" ? dropDownContent(handleAction) : dropDownContent;
|
|
2177
|
+
const hoverOrClickProps = openOnHover ? {
|
|
2178
|
+
trigger: "mouseenter",
|
|
2179
|
+
delay: [0, 150],
|
|
2180
|
+
hideOnClick: false
|
|
2181
|
+
} : {
|
|
2182
|
+
visible,
|
|
2183
|
+
onClickOutside: hide
|
|
2184
|
+
};
|
|
2172
2185
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex h-full", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2173
2186
|
import_react10.default,
|
|
2174
2187
|
{
|
|
2175
2188
|
content,
|
|
2176
|
-
visible,
|
|
2177
|
-
onClickOutside: hide,
|
|
2178
2189
|
allowHTML: true,
|
|
2179
2190
|
arrow: false,
|
|
2180
2191
|
appendTo: () => document.body,
|
|
@@ -2184,12 +2195,16 @@ function PopupCellRenderer({
|
|
|
2184
2195
|
theme: "light",
|
|
2185
2196
|
maxWidth: "none",
|
|
2186
2197
|
offset: [0, 5],
|
|
2198
|
+
onCreate: (instance) => {
|
|
2199
|
+
instanceRef.current = instance;
|
|
2200
|
+
},
|
|
2201
|
+
...hoverOrClickProps,
|
|
2187
2202
|
...tippyProps,
|
|
2188
2203
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2189
2204
|
"button",
|
|
2190
2205
|
{
|
|
2191
2206
|
type: "button",
|
|
2192
|
-
onClick: visible ? hide : show,
|
|
2207
|
+
onClick: openOnHover ? void 0 : visible ? hide : show,
|
|
2193
2208
|
className: cn(
|
|
2194
2209
|
"flex items-center justify-center gap-2 rounded-full text-gray-500 hover:text-gray-800",
|
|
2195
2210
|
className
|
|
@@ -2374,6 +2389,7 @@ function RowActions({
|
|
|
2374
2389
|
triggerAriaLabel = "Row actions",
|
|
2375
2390
|
hasPermission,
|
|
2376
2391
|
placement = "bottom-end",
|
|
2392
|
+
openOnHover = false,
|
|
2377
2393
|
tippyProps,
|
|
2378
2394
|
presets,
|
|
2379
2395
|
confirmFn = confirmationAlert,
|
|
@@ -2488,6 +2504,7 @@ function RowActions({
|
|
|
2488
2504
|
hideTitle: true,
|
|
2489
2505
|
className,
|
|
2490
2506
|
placement,
|
|
2507
|
+
openOnHover,
|
|
2491
2508
|
tippyProps,
|
|
2492
2509
|
ariaLabel: triggerAriaLabel,
|
|
2493
2510
|
dropDownContent: (handleAction) => buildMenu(() => handleAction("close"))
|