@trackunit/react-table-base-components 1.6.64 → 1.6.66
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/index.cjs.js +5 -5
- package/index.esm.js +5 -5
- package/package.json +8 -8
package/index.cjs.js
CHANGED
|
@@ -308,7 +308,7 @@ const RowActions = ({ actions }) => {
|
|
|
308
308
|
(action.isVisible ?? true) && (jsxRuntime.jsx(reactComponents.Button, { disabled: action.disabled || action.loading, onClick: event => {
|
|
309
309
|
event.stopPropagation();
|
|
310
310
|
action.onClick();
|
|
311
|
-
}, prefix: jsxRuntime.jsx(
|
|
311
|
+
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "small" }), size: "small", variant: "secondary", children: action.label })));
|
|
312
312
|
}
|
|
313
313
|
return (jsxRuntime.jsxs("div", { className: "flex items-center", "data-testid": "row-actions", children: [selectedActions.map((action, index) => (jsxRuntime.jsx(reactComponents.IconButton, { className: "mr-2", icon: action.iconName ? jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName, size: "small" }) : undefined, onClick: event => {
|
|
314
314
|
event.stopPropagation();
|
|
@@ -316,17 +316,17 @@ const RowActions = ({ actions }) => {
|
|
|
316
316
|
}, size: "small", variant: "ghost-neutral" }, `selected-action-${index}`))), jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.IconButton, { icon: jsxRuntime.jsx(reactComponents.Icon, { name: "EllipsisHorizontal", size: "medium" }), onClick: event => event.stopPropagation(), size: "small", variant: "ghost-neutral" }), children: close => (jsxRuntime.jsxs(reactComponents.MenuList, { children: [normalActions.map((action, index) => (jsxRuntime.jsx(reactComponents.MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: () => {
|
|
317
317
|
action.onClick();
|
|
318
318
|
close();
|
|
319
|
-
}, prefix: jsxRuntime.jsx(
|
|
319
|
+
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "medium" }), variant: action.variant }, `action-${index}`))), normalActions.length > 0 && dangerActions.length > 0 && jsxRuntime.jsx(reactComponents.MenuDivider, {}), dangerActions.map((action, index) => (jsxRuntime.jsx(reactComponents.MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: () => {
|
|
320
320
|
action.onClick();
|
|
321
321
|
close();
|
|
322
|
-
}, prefix: jsxRuntime.jsx(
|
|
322
|
+
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "medium" }), variant: action.variant }, `danger-action-${index}`)))] })) })] }));
|
|
323
323
|
};
|
|
324
|
-
const
|
|
324
|
+
const IconWithLoader = ({ action, size }) => {
|
|
325
325
|
if (action.loading) {
|
|
326
326
|
return jsxRuntime.jsx(reactComponents.Spinner, { size: "small" });
|
|
327
327
|
}
|
|
328
328
|
if (action.iconName) {
|
|
329
|
-
return jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName, size:
|
|
329
|
+
return jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName, size: size });
|
|
330
330
|
}
|
|
331
331
|
return null;
|
|
332
332
|
};
|
package/index.esm.js
CHANGED
|
@@ -306,7 +306,7 @@ const RowActions = ({ actions }) => {
|
|
|
306
306
|
(action.isVisible ?? true) && (jsx(Button, { disabled: action.disabled || action.loading, onClick: event => {
|
|
307
307
|
event.stopPropagation();
|
|
308
308
|
action.onClick();
|
|
309
|
-
}, prefix: jsx(
|
|
309
|
+
}, prefix: jsx(IconWithLoader, { action: action, size: "small" }), size: "small", variant: "secondary", children: action.label })));
|
|
310
310
|
}
|
|
311
311
|
return (jsxs("div", { className: "flex items-center", "data-testid": "row-actions", children: [selectedActions.map((action, index) => (jsx(IconButton, { className: "mr-2", icon: action.iconName ? jsx(Icon, { name: action.iconName, size: "small" }) : undefined, onClick: event => {
|
|
312
312
|
event.stopPropagation();
|
|
@@ -314,17 +314,17 @@ const RowActions = ({ actions }) => {
|
|
|
314
314
|
}, size: "small", variant: "ghost-neutral" }, `selected-action-${index}`))), jsx(MoreMenu, { customButton: jsx(IconButton, { icon: jsx(Icon, { name: "EllipsisHorizontal", size: "medium" }), onClick: event => event.stopPropagation(), size: "small", variant: "ghost-neutral" }), children: close => (jsxs(MenuList, { children: [normalActions.map((action, index) => (jsx(MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: () => {
|
|
315
315
|
action.onClick();
|
|
316
316
|
close();
|
|
317
|
-
}, prefix: jsx(
|
|
317
|
+
}, prefix: jsx(IconWithLoader, { action: action, size: "medium" }), variant: action.variant }, `action-${index}`))), normalActions.length > 0 && dangerActions.length > 0 && jsx(MenuDivider, {}), dangerActions.map((action, index) => (jsx(MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: () => {
|
|
318
318
|
action.onClick();
|
|
319
319
|
close();
|
|
320
|
-
}, prefix: jsx(
|
|
320
|
+
}, prefix: jsx(IconWithLoader, { action: action, size: "medium" }), variant: action.variant }, `danger-action-${index}`)))] })) })] }));
|
|
321
321
|
};
|
|
322
|
-
const
|
|
322
|
+
const IconWithLoader = ({ action, size }) => {
|
|
323
323
|
if (action.loading) {
|
|
324
324
|
return jsx(Spinner, { size: "small" });
|
|
325
325
|
}
|
|
326
326
|
if (action.iconName) {
|
|
327
|
-
return jsx(Icon, { name: action.iconName, size:
|
|
327
|
+
return jsx(Icon, { name: action.iconName, size: size });
|
|
328
328
|
}
|
|
329
329
|
return null;
|
|
330
330
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.66",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"@trackunit/react-components": "1.8.
|
|
12
|
-
"@trackunit/ui-icons": "1.6.
|
|
13
|
-
"@trackunit/react-form-components": "1.7.
|
|
14
|
-
"@trackunit/css-class-variance-utilities": "1.6.
|
|
15
|
-
"@trackunit/date-and-time-utils": "1.6.
|
|
16
|
-
"@trackunit/shared-utils": "1.8.
|
|
17
|
-
"@trackunit/react-test-setup": "1.3.
|
|
11
|
+
"@trackunit/react-components": "1.8.14",
|
|
12
|
+
"@trackunit/ui-icons": "1.6.41",
|
|
13
|
+
"@trackunit/react-form-components": "1.7.30",
|
|
14
|
+
"@trackunit/css-class-variance-utilities": "1.6.42",
|
|
15
|
+
"@trackunit/date-and-time-utils": "1.6.42",
|
|
16
|
+
"@trackunit/shared-utils": "1.8.42",
|
|
17
|
+
"@trackunit/react-test-setup": "1.3.42",
|
|
18
18
|
"tailwind-merge": "^2.0.0",
|
|
19
19
|
"@js-temporal/polyfill": "^0.5.1"
|
|
20
20
|
},
|