@trackunit/react-table 1.3.259 → 1.3.260
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 +3 -2
- package/index.esm.js +4 -3
- package/package.json +11 -11
- package/src/ActionSheet/Actions.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -171,9 +171,10 @@ const ActionButton = ({ action, id, ...rest }) => {
|
|
|
171
171
|
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
172
172
|
jsxRuntime.jsx(reactComponents.Button, { asChild: true, id: id, loading: action.loading, prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: jsxRuntime.jsx(reactRouter.Link, { to: action.url, children: action.label }) }));
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
const content = (jsxRuntime.jsx(reactComponents.Button, { id: id, loading: action.loading, onClick: e => action.method(e),
|
|
175
175
|
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
176
176
|
prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
177
|
+
return action.tip ? jsxRuntime.jsx(reactComponents.Tooltip, { label: action.tip, children: content }) : content;
|
|
177
178
|
};
|
|
178
179
|
/**
|
|
179
180
|
* Converts an action model to a MenuItem component.
|
|
@@ -209,7 +210,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
|
|
|
209
210
|
* @param {string} [dataTestId] - Optional data test ID.
|
|
210
211
|
* @returns {ReactElement} - The ActionButton component for the given action.
|
|
211
212
|
*/
|
|
212
|
-
const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading, id: action.id }, action.id));
|
|
213
|
+
const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
|
|
213
214
|
/**
|
|
214
215
|
* Renders the icon for an action button.
|
|
215
216
|
* Should not be used outside the ActionSheet component.
|
package/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
|
|
3
|
-
import { MenuItem, Icon, Button, useOverflowItems, MoreMenu, MenuList, Spacer, cvaInteractableItem, Text,
|
|
3
|
+
import { MenuItem, Icon, Button, Tooltip, useOverflowItems, MoreMenu, MenuList, Spacer, cvaInteractableItem, Text, Popover, PopoverTrigger, PopoverContent, IconButton, Card, Spinner, EmptyState } from '@trackunit/react-components';
|
|
4
4
|
import { objectValues, nonNullable, objectKeys, objectEntries } from '@trackunit/shared-utils';
|
|
5
5
|
import { useMemo, Children, cloneElement, useRef, useState, useEffect, useCallback, createElement } from 'react';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
@@ -170,9 +170,10 @@ const ActionButton = ({ action, id, ...rest }) => {
|
|
|
170
170
|
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
171
171
|
jsx(Button, { asChild: true, id: id, loading: action.loading, prefix: jsx(ActionIcon, { action: action }), ...rest, children: jsx(Link, { to: action.url, children: action.label }) }));
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
const content = (jsx(Button, { id: id, loading: action.loading, onClick: e => action.method(e),
|
|
174
174
|
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
175
175
|
prefix: jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
176
|
+
return action.tip ? jsx(Tooltip, { label: action.tip, children: content }) : content;
|
|
176
177
|
};
|
|
177
178
|
/**
|
|
178
179
|
* Converts an action model to a MenuItem component.
|
|
@@ -208,7 +209,7 @@ const actionDataToMenuItem = (action, dataTestId) => {
|
|
|
208
209
|
* @param {string} [dataTestId] - Optional data test ID.
|
|
209
210
|
* @returns {ReactElement} - The ActionButton component for the given action.
|
|
210
211
|
*/
|
|
211
|
-
const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading, id: action.id }, action.id));
|
|
212
|
+
const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", dataTestId: action.dataTestId || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
|
|
212
213
|
/**
|
|
213
214
|
* Renders the icon for an action button.
|
|
214
215
|
* Should not be used outside the ActionSheet component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.260",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"jest-fetch-mock": "^3.0.3",
|
|
16
16
|
"@tanstack/react-router": "1.114.29",
|
|
17
17
|
"tailwind-merge": "^2.0.0",
|
|
18
|
-
"@trackunit/react-components": "1.4.
|
|
19
|
-
"@trackunit/shared-utils": "1.5.
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.3.
|
|
21
|
-
"@trackunit/ui-icons": "1.3.
|
|
22
|
-
"@trackunit/react-table-base-components": "1.3.
|
|
23
|
-
"@trackunit/react-table-pagination": "1.3.
|
|
24
|
-
"@trackunit/react-form-components": "1.3.
|
|
25
|
-
"@trackunit/i18n-library-translation": "1.3.
|
|
26
|
-
"@trackunit/react-core-contexts-api": "1.4.
|
|
27
|
-
"@trackunit/react-test-setup": "1.0.
|
|
18
|
+
"@trackunit/react-components": "1.4.204",
|
|
19
|
+
"@trackunit/shared-utils": "1.5.166",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.3.166",
|
|
21
|
+
"@trackunit/ui-icons": "1.3.167",
|
|
22
|
+
"@trackunit/react-table-base-components": "1.3.228",
|
|
23
|
+
"@trackunit/react-table-pagination": "1.3.166",
|
|
24
|
+
"@trackunit/react-form-components": "1.3.230",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.3.190",
|
|
26
|
+
"@trackunit/react-core-contexts-api": "1.4.174",
|
|
27
|
+
"@trackunit/react-test-setup": "1.0.56"
|
|
28
28
|
},
|
|
29
29
|
"module": "./index.esm.js",
|
|
30
30
|
"main": "./index.cjs.js",
|