@trackunit/react-table-base-components 1.24.12 → 1.25.0
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
CHANGED
|
@@ -12,7 +12,8 @@ var sharedUtils = require('@trackunit/shared-utils');
|
|
|
12
12
|
|
|
13
13
|
var defaultTranslations = {
|
|
14
14
|
"copyableCell.copied": "Copied!",
|
|
15
|
-
"copyableCell.copy": "Copy"
|
|
15
|
+
"copyableCell.copy": "Copy",
|
|
16
|
+
"rowActions.moreActions": "More actions"
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
const namespace = "react.table-base-components";
|
|
@@ -654,8 +655,8 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
654
655
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
655
656
|
* @returns {ReactElement} NoticeCell component
|
|
656
657
|
*/
|
|
657
|
-
const NoticeCell = ({ ref, ...rest }) => {
|
|
658
|
-
return jsxRuntime.jsx(reactComponents.Notice, { ref: ref, ...rest });
|
|
658
|
+
const NoticeCell = ({ ref, tooltipLabel, ...rest }) => {
|
|
659
|
+
return (jsxRuntime.jsx(reactComponents.Tooltip, { disabled: !tooltipLabel, label: tooltipLabel, children: jsxRuntime.jsx(reactComponents.Notice, { ref: ref, ...rest }) }));
|
|
659
660
|
};
|
|
660
661
|
|
|
661
662
|
const cvaNumberCell = cssClassVarianceUtilities.cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
|
|
@@ -917,6 +918,7 @@ const cvaResizeHandel = cssClassVarianceUtilities.cvaMerge([
|
|
|
917
918
|
* @returns {ReactElement} A React component rendering the row actions.
|
|
918
919
|
*/
|
|
919
920
|
const RowActions = ({ actions, style }) => {
|
|
921
|
+
const [t] = useTranslation();
|
|
920
922
|
const selectedActions = actions.filter(action => action.isSelected);
|
|
921
923
|
const normalActions = actions.filter(action => (action.isVisible ?? true) && action.variant !== "danger");
|
|
922
924
|
const dangerActions = actions.filter(action => (action.isVisible ?? true) && action.variant === "danger");
|
|
@@ -931,10 +933,10 @@ const RowActions = ({ actions, style }) => {
|
|
|
931
933
|
action.onClick(event);
|
|
932
934
|
}, prefix: jsxRuntime.jsx(IconWithLoader, { action: action, size: "small" }), size: "small", style: style, variant: "secondary", children: action.label })));
|
|
933
935
|
}
|
|
934
|
-
return (jsxRuntime.jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsxRuntime.jsx(reactComponents.IconButton, { className: "mr-2", icon:
|
|
936
|
+
return (jsxRuntime.jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsxRuntime.jsx(reactComponents.IconButton, { className: "mr-2", icon: jsxRuntime.jsx(reactComponents.Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
935
937
|
event.stopPropagation();
|
|
936
938
|
action.onClick(event);
|
|
937
|
-
}, 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: event => {
|
|
939
|
+
}, size: "small", title: action.label, 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", title: t("rowActions.moreActions"), 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: event => {
|
|
938
940
|
action.onClick(event);
|
|
939
941
|
close();
|
|
940
942
|
}, 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: event => {
|
package/index.esm.js
CHANGED
|
@@ -10,7 +10,8 @@ import { DateTimeFormat } from '@trackunit/shared-utils';
|
|
|
10
10
|
|
|
11
11
|
var defaultTranslations = {
|
|
12
12
|
"copyableCell.copied": "Copied!",
|
|
13
|
-
"copyableCell.copy": "Copy"
|
|
13
|
+
"copyableCell.copy": "Copy",
|
|
14
|
+
"rowActions.moreActions": "More actions"
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
const namespace = "react.table-base-components";
|
|
@@ -652,8 +653,8 @@ const MultiValueTextCell = ({ content, count, countTooltip, icon, iconTooltip, "
|
|
|
652
653
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
653
654
|
* @returns {ReactElement} NoticeCell component
|
|
654
655
|
*/
|
|
655
|
-
const NoticeCell = ({ ref, ...rest }) => {
|
|
656
|
-
return jsx(Notice, { ref: ref, ...rest });
|
|
656
|
+
const NoticeCell = ({ ref, tooltipLabel, ...rest }) => {
|
|
657
|
+
return (jsx(Tooltip, { disabled: !tooltipLabel, label: tooltipLabel, children: jsx(Notice, { ref: ref, ...rest }) }));
|
|
657
658
|
};
|
|
658
659
|
|
|
659
660
|
const cvaNumberCell = cvaMerge(["flex", "gap-1", "slashed-zero", "text-sm", "text-ellipsis"]);
|
|
@@ -915,6 +916,7 @@ const cvaResizeHandel = cvaMerge([
|
|
|
915
916
|
* @returns {ReactElement} A React component rendering the row actions.
|
|
916
917
|
*/
|
|
917
918
|
const RowActions = ({ actions, style }) => {
|
|
919
|
+
const [t] = useTranslation();
|
|
918
920
|
const selectedActions = actions.filter(action => action.isSelected);
|
|
919
921
|
const normalActions = actions.filter(action => (action.isVisible ?? true) && action.variant !== "danger");
|
|
920
922
|
const dangerActions = actions.filter(action => (action.isVisible ?? true) && action.variant === "danger");
|
|
@@ -929,10 +931,10 @@ const RowActions = ({ actions, style }) => {
|
|
|
929
931
|
action.onClick(event);
|
|
930
932
|
}, prefix: jsx(IconWithLoader, { action: action, size: "small" }), size: "small", style: style, variant: "secondary", children: action.label })));
|
|
931
933
|
}
|
|
932
|
-
return (jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsx(IconButton, { className: "mr-2", icon:
|
|
934
|
+
return (jsxs("div", { className: "flex items-center", "data-testid": "row-actions", style: style, children: [selectedActions.map((action, index) => (jsx(IconButton, { className: "mr-2", icon: jsx(Icon, { name: action.iconName ?? "QuestionMarkCircle", size: "small" }), onClick: event => {
|
|
933
935
|
event.stopPropagation();
|
|
934
936
|
action.onClick(event);
|
|
935
|
-
}, 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: event => {
|
|
937
|
+
}, size: "small", title: action.label, variant: "ghost-neutral" }, `selected-action-${index}`))), jsx(MoreMenu, { customButton: jsx(IconButton, { icon: jsx(Icon, { name: "EllipsisHorizontal", size: "medium" }), onClick: event => event.stopPropagation(), size: "small", title: t("rowActions.moreActions"), variant: "ghost-neutral" }), children: close => (jsxs(MenuList, { children: [normalActions.map((action, index) => (jsx(MenuItem, { disabled: action.disabled || action.loading, label: action.label, onClick: event => {
|
|
936
938
|
action.onClick(event);
|
|
937
939
|
close();
|
|
938
940
|
}, 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: event => {
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table-base-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.x"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@trackunit/react-components": "1.
|
|
11
|
-
"@trackunit/ui-icons": "1.13.
|
|
12
|
-
"@trackunit/react-form-components": "1.
|
|
13
|
-
"@trackunit/css-class-variance-utilities": "1.13.
|
|
14
|
-
"@trackunit/date-and-time-utils": "1.13.
|
|
15
|
-
"@trackunit/shared-utils": "1.15.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.
|
|
10
|
+
"@trackunit/react-components": "1.25.0",
|
|
11
|
+
"@trackunit/ui-icons": "1.13.5",
|
|
12
|
+
"@trackunit/react-form-components": "1.26.0",
|
|
13
|
+
"@trackunit/css-class-variance-utilities": "1.13.5",
|
|
14
|
+
"@trackunit/date-and-time-utils": "1.13.5",
|
|
15
|
+
"@trackunit/shared-utils": "1.15.5",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.22.0",
|
|
17
17
|
"tailwind-merge": "^2.0.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { NoticeProps } from "@trackunit/react-components";
|
|
2
|
-
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
export type NoticeCellProps = NoticeProps & {
|
|
4
|
+
tooltipLabel?: string;
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* NoticeCell renders a Notice component inside a table cell, displaying an inline colored message
|
|
5
8
|
* (info, warning, success, danger). It accepts the same props as Notice.
|
|
@@ -20,4 +23,4 @@ export type NoticeCellProps = NoticeProps;
|
|
|
20
23
|
* @param {NoticeCellProps} props - The props for the NoticeCell component
|
|
21
24
|
* @returns {ReactElement} NoticeCell component
|
|
22
25
|
*/
|
|
23
|
-
export declare const NoticeCell: ({ ref, ...rest }: NoticeCellProps) =>
|
|
26
|
+
export declare const NoticeCell: ({ ref, tooltipLabel, ...rest }: NoticeCellProps) => ReactElement;
|
package/src/translation.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const translations: TranslationResource<TranslationKeys>;
|
|
|
6
6
|
/**
|
|
7
7
|
* Local useTranslation for this specific library
|
|
8
8
|
*/
|
|
9
|
-
export declare const useTranslation: () => [TransForLibs<"copyableCell.copied" | "copyableCell.copy">, import("i18next").i18n, boolean] & {
|
|
10
|
-
t: TransForLibs<"copyableCell.copied" | "copyableCell.copy">;
|
|
9
|
+
export declare const useTranslation: () => [TransForLibs<"copyableCell.copied" | "copyableCell.copy" | "rowActions.moreActions">, import("i18next").i18n, boolean] & {
|
|
10
|
+
t: TransForLibs<"copyableCell.copied" | "copyableCell.copy" | "rowActions.moreActions">;
|
|
11
11
|
i18n: import("i18next").i18n;
|
|
12
12
|
ready: boolean;
|
|
13
13
|
};
|