@trackunit/react-table 1.7.118 → 1.7.120
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 +1 -1
- package/index.esm.js +1 -1
- package/package.json +9 -9
- package/src/types.d.ts +12 -0
package/index.cjs.js
CHANGED
|
@@ -837,7 +837,7 @@ const ColumnActions = ({ header, visibleColumnsCount, setSorting, getColumn }) =
|
|
|
837
837
|
if (!isAnyActionAvailable) {
|
|
838
838
|
return null;
|
|
839
839
|
}
|
|
840
|
-
return (jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.IconButton, { icon: jsxRuntime.jsx(reactComponents.Icon, { name: "EllipsisVertical", size: "small" }), onClick: event => event.stopPropagation(),
|
|
840
|
+
return (jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.IconButton, { className: "h-8 w-5 p-0", icon: jsxRuntime.jsx(reactComponents.Icon, { name: "EllipsisVertical", size: "small" }), onClick: event => event.stopPropagation(), variant: "ghost-neutral" }), children: close => (jsxRuntime.jsxs(reactComponents.MenuList, { children: [showSortAscending ? (jsxRuntime.jsx(reactComponents.MenuItem, { label: t("table.columnActions.sortAscending"), onClick: handleSortAscending, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "ArrowUp", size: "medium" }) })) : null, showSortDescending ? (jsxRuntime.jsx(reactComponents.MenuItem, { label: t("table.columnActions.sortDescending"), onClick: handleSortDescending, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "ArrowDown", size: "medium" }) })) : null, showClearSorting ? (jsxRuntime.jsx(reactComponents.MenuItem, { label: t("table.columnActions.clearSorting"), onClick: handleClearSorting, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "ArrowsUpDown", size: "medium" }) })) : null, showHideColumn ? (jsxRuntime.jsx(reactComponents.MenuItem, { label: t("table.columnActions.hideColumn"), onClick: () => header.column.toggleVisibility(false), prefix: jsxRuntime.jsx(reactComponents.Icon, { name: "EyeSlash", size: "medium" }) })) : null, canPin ? (jsxRuntime.jsx(reactComponents.MenuItem, { label: t(isPinned ? "table.columnActions.unPinColumn" : "table.columnActions.pinColumn"), onClick: () => {
|
|
841
841
|
header.column.pin(isPinned ? false : "left");
|
|
842
842
|
close();
|
|
843
843
|
}, prefix: jsxRuntime.jsx(reactComponents.Icon, { name: isPinned ? "Unpin" : "Pin", size: "medium" }) })) : null] })) }));
|
package/index.esm.js
CHANGED
|
@@ -836,7 +836,7 @@ const ColumnActions = ({ header, visibleColumnsCount, setSorting, getColumn }) =
|
|
|
836
836
|
if (!isAnyActionAvailable) {
|
|
837
837
|
return null;
|
|
838
838
|
}
|
|
839
|
-
return (jsx(MoreMenu, { customButton: jsx(IconButton, { icon: jsx(Icon, { name: "EllipsisVertical", size: "small" }), onClick: event => event.stopPropagation(),
|
|
839
|
+
return (jsx(MoreMenu, { customButton: jsx(IconButton, { className: "h-8 w-5 p-0", icon: jsx(Icon, { name: "EllipsisVertical", size: "small" }), onClick: event => event.stopPropagation(), variant: "ghost-neutral" }), children: close => (jsxs(MenuList, { children: [showSortAscending ? (jsx(MenuItem, { label: t("table.columnActions.sortAscending"), onClick: handleSortAscending, prefix: jsx(Icon, { name: "ArrowUp", size: "medium" }) })) : null, showSortDescending ? (jsx(MenuItem, { label: t("table.columnActions.sortDescending"), onClick: handleSortDescending, prefix: jsx(Icon, { name: "ArrowDown", size: "medium" }) })) : null, showClearSorting ? (jsx(MenuItem, { label: t("table.columnActions.clearSorting"), onClick: handleClearSorting, prefix: jsx(Icon, { name: "ArrowsUpDown", size: "medium" }) })) : null, showHideColumn ? (jsx(MenuItem, { label: t("table.columnActions.hideColumn"), onClick: () => header.column.toggleVisibility(false), prefix: jsx(Icon, { name: "EyeSlash", size: "medium" }) })) : null, canPin ? (jsx(MenuItem, { label: t(isPinned ? "table.columnActions.unPinColumn" : "table.columnActions.pinColumn"), onClick: () => {
|
|
840
840
|
header.column.pin(isPinned ? false : "left");
|
|
841
841
|
close();
|
|
842
842
|
}, prefix: jsx(Icon, { name: isPinned ? "Unpin" : "Pin", size: "medium" }) })) : null] })) }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.120",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"react-dnd-html5-backend": "16.0.1",
|
|
15
15
|
"@tanstack/react-router": "1.114.29",
|
|
16
16
|
"tailwind-merge": "^2.0.0",
|
|
17
|
-
"@trackunit/react-components": "1.10.
|
|
18
|
-
"@trackunit/shared-utils": "1.9.
|
|
19
|
-
"@trackunit/css-class-variance-utilities": "1.7.
|
|
20
|
-
"@trackunit/ui-icons": "1.7.
|
|
21
|
-
"@trackunit/react-table-base-components": "1.7.
|
|
22
|
-
"@trackunit/react-form-components": "1.8.
|
|
23
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
24
|
-
"@trackunit/iris-app-runtime-core-api": "1.7.
|
|
17
|
+
"@trackunit/react-components": "1.10.48",
|
|
18
|
+
"@trackunit/shared-utils": "1.9.74",
|
|
19
|
+
"@trackunit/css-class-variance-utilities": "1.7.74",
|
|
20
|
+
"@trackunit/ui-icons": "1.7.75",
|
|
21
|
+
"@trackunit/react-table-base-components": "1.7.116",
|
|
22
|
+
"@trackunit/react-form-components": "1.8.114",
|
|
23
|
+
"@trackunit/i18n-library-translation": "1.7.91",
|
|
24
|
+
"@trackunit/iris-app-runtime-core-api": "1.7.83",
|
|
25
25
|
"graphql": "^16.10.0"
|
|
26
26
|
},
|
|
27
27
|
"module": "./index.esm.js",
|
package/src/types.d.ts
CHANGED
|
@@ -13,6 +13,18 @@ export interface BaseExportable {
|
|
|
13
13
|
} | {
|
|
14
14
|
type: "date";
|
|
15
15
|
format: DateTimeFormatType;
|
|
16
|
+
} | {
|
|
17
|
+
type: "math";
|
|
18
|
+
operation: "add" | "subtract" | "multiply" | "divide" | "modulo" | "power";
|
|
19
|
+
decimalPlaces?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Optional constant value to use as the second operand in the math operation.
|
|
22
|
+
* Use this when the second value is a client-side constant not available in the GraphQL response.
|
|
23
|
+
* If not provided, accessor must be an array with 2 elements to access both operands from data.
|
|
24
|
+
* Example: To calculate price (quantity × unitPrice) where unitPrice is client-side:
|
|
25
|
+
* { accessor: "quantity", transformer: { type: "math", operation: "multiply", constantValue: 3.50 } }
|
|
26
|
+
*/
|
|
27
|
+
constantValue?: number;
|
|
16
28
|
};
|
|
17
29
|
prefix?: string;
|
|
18
30
|
postfix?: string;
|