@trackunit/react-table 1.6.74 → 1.6.76
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 -11
- package/index.esm.js +5 -11
- package/package.json +11 -11
package/index.cjs.js
CHANGED
|
@@ -167,13 +167,9 @@ const cvaMoreContainer = cssClassVarianceUtilities.cvaMerge([
|
|
|
167
167
|
*/
|
|
168
168
|
const ActionButton = ({ action, id, ...rest }) => {
|
|
169
169
|
if (action.type === "route") {
|
|
170
|
-
return (
|
|
171
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
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 }) }));
|
|
170
|
+
return (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
171
|
}
|
|
174
|
-
const content = (jsxRuntime.jsx(reactComponents.Button, { id: id, loading: action.loading, onClick: e => action.method(e),
|
|
175
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
176
|
-
prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
172
|
+
const content = (jsxRuntime.jsx(reactComponents.Button, { id: id, loading: action.loading, onClick: e => action.method(e), prefix: jsxRuntime.jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
177
173
|
return action.tip ? jsxRuntime.jsx(reactComponents.Tooltip, { label: action.tip, children: content }) : content;
|
|
178
174
|
};
|
|
179
175
|
/**
|
|
@@ -253,9 +249,7 @@ const ActionContainerAndOverflow = ({ actions, dropdownActions, moreActions, dat
|
|
|
253
249
|
});
|
|
254
250
|
}) }), jsxRuntime.jsxs("div", { className: cvaMoreContainer({ isDropdown: dropdownActions !== undefined }), children: [dropdownActions
|
|
255
251
|
? dropdownActions.map(action => {
|
|
256
|
-
return (jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.Button, { dataTestId: action.dataTestId, id: action.id, loading: action.loading, onClick: action.method,
|
|
257
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
258
|
-
prefix: jsxRuntime.jsx(ActionIcon, { action: action }), children: action.label }), dataTestId: `${dataTestId}-dropdown-more-menu`, popoverProps: { placement: "top-end" }, children: !action.loading ? action.dropdown : null }, action.id));
|
|
252
|
+
return (jsxRuntime.jsx(reactComponents.MoreMenu, { customButton: jsxRuntime.jsx(reactComponents.Button, { dataTestId: action.dataTestId, id: action.id, loading: action.loading, onClick: action.method, prefix: jsxRuntime.jsx(ActionIcon, { action: action }), children: action.label }), dataTestId: `${dataTestId}-dropdown-more-menu`, popoverProps: { placement: "top-end" }, children: !action.loading ? action.dropdown : null }, action.id));
|
|
259
253
|
})
|
|
260
254
|
: null, react.Children.count(moreActions) > 0 || overflowItemCount ? (jsxRuntime.jsx(reactComponents.MoreMenu, { dataTestId: `${dataTestId}-more-menu`, iconButtonProps: { variant: "primary" }, iconProps: { color: "white" }, popoverProps: { placement: "top-end" }, children: close => (jsxRuntime.jsxs(reactComponents.MenuList, { className: "relative -right-2", onClick: close, children: [moreActions ? moreActions : null, actions.map(action => {
|
|
261
255
|
return itemOverflowMap[action.id] ? actionDataToMenuItem(action, dataTestId) : null;
|
|
@@ -353,7 +347,7 @@ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn
|
|
|
353
347
|
const opacity = isDragging ? 0 : 1;
|
|
354
348
|
drag(drop(ref));
|
|
355
349
|
return (jsxRuntime.jsxs("div", { className: reactComponents.cvaInteractableItem({
|
|
356
|
-
|
|
350
|
+
selection: "unselected",
|
|
357
351
|
className: "grid w-full grid-cols-[min-content,1fr,min-content] items-center gap-2 py-1",
|
|
358
352
|
}), ref: ref, style: { opacity: opacity }, children: [jsxRuntime.jsx("div", { className: cvaColumnFilterGrabbable({ disabled: isSortDisabled }), children: jsxRuntime.jsx(reactComponents.Icon, { color: "secondary", name: "EllipsisDrag", size: "small" }) }), jsxRuntime.jsxs("label", { className: "grid w-full grid-cols-[1fr,min-content] items-center gap-2", htmlFor: id, children: [jsxRuntime.jsxs("div", { className: "grid w-full grid-cols-[1fr,min-content] items-center", children: [jsxRuntime.jsx(reactComponents.Text, { className: reactFormComponents.cvaLabel(), children: name }), disabled ? jsxRuntime.jsx(reactComponents.Icon, { name: "LockClosed", size: "small" }) : null] }), jsxRuntime.jsx(reactFormComponents.ToggleSwitch, { disabled: disabled, id: id, onChange: (isToggled, event) => event && onToggle(isToggled, event), showInputFocus: false, size: "small", toggled: toggled })] })] }));
|
|
359
353
|
};
|
|
@@ -994,7 +988,7 @@ const Table = ({ rowHeight = 50, ...props }) => {
|
|
|
994
988
|
(props.isRowClickable ? props.isRowClickable(row.original) : true)
|
|
995
989
|
? "pointer"
|
|
996
990
|
: "default",
|
|
997
|
-
|
|
991
|
+
selection: "auto",
|
|
998
992
|
})), dataTestId: `table-body-row-${virtualRow.index}`, layout: "flex", onClick: () => {
|
|
999
993
|
if (props.onRowClick) {
|
|
1000
994
|
props.onRowClick(row);
|
package/index.esm.js
CHANGED
|
@@ -166,13 +166,9 @@ const cvaMoreContainer = cvaMerge([
|
|
|
166
166
|
*/
|
|
167
167
|
const ActionButton = ({ action, id, ...rest }) => {
|
|
168
168
|
if (action.type === "route") {
|
|
169
|
-
return (
|
|
170
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
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 }) }));
|
|
169
|
+
return (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
170
|
}
|
|
173
|
-
const content = (jsx(Button, { id: id, loading: action.loading, onClick: e => action.method(e),
|
|
174
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
175
|
-
prefix: jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
171
|
+
const content = (jsx(Button, { id: id, loading: action.loading, onClick: e => action.method(e), prefix: jsx(ActionIcon, { action: action }), ...rest, children: action.label }));
|
|
176
172
|
return action.tip ? jsx(Tooltip, { label: action.tip, children: content }) : content;
|
|
177
173
|
};
|
|
178
174
|
/**
|
|
@@ -252,9 +248,7 @@ const ActionContainerAndOverflow = ({ actions, dropdownActions, moreActions, dat
|
|
|
252
248
|
});
|
|
253
249
|
}) }), jsxs("div", { className: cvaMoreContainer({ isDropdown: dropdownActions !== undefined }), children: [dropdownActions
|
|
254
250
|
? dropdownActions.map(action => {
|
|
255
|
-
return (jsx(MoreMenu, { customButton: jsx(Button, { dataTestId: action.dataTestId, id: action.id, loading: action.loading, onClick: action.method,
|
|
256
|
-
// eslint-disable-next-line local-rules/design-guideline-button-icon-size-match
|
|
257
|
-
prefix: jsx(ActionIcon, { action: action }), children: action.label }), dataTestId: `${dataTestId}-dropdown-more-menu`, popoverProps: { placement: "top-end" }, children: !action.loading ? action.dropdown : null }, action.id));
|
|
251
|
+
return (jsx(MoreMenu, { customButton: jsx(Button, { dataTestId: action.dataTestId, id: action.id, loading: action.loading, onClick: action.method, prefix: jsx(ActionIcon, { action: action }), children: action.label }), dataTestId: `${dataTestId}-dropdown-more-menu`, popoverProps: { placement: "top-end" }, children: !action.loading ? action.dropdown : null }, action.id));
|
|
258
252
|
})
|
|
259
253
|
: null, Children.count(moreActions) > 0 || overflowItemCount ? (jsx(MoreMenu, { dataTestId: `${dataTestId}-more-menu`, iconButtonProps: { variant: "primary" }, iconProps: { color: "white" }, popoverProps: { placement: "top-end" }, children: close => (jsxs(MenuList, { className: "relative -right-2", onClick: close, children: [moreActions ? moreActions : null, actions.map(action => {
|
|
260
254
|
return itemOverflowMap[action.id] ? actionDataToMenuItem(action, dataTestId) : null;
|
|
@@ -352,7 +346,7 @@ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn
|
|
|
352
346
|
const opacity = isDragging ? 0 : 1;
|
|
353
347
|
drag(drop(ref));
|
|
354
348
|
return (jsxs("div", { className: cvaInteractableItem({
|
|
355
|
-
|
|
349
|
+
selection: "unselected",
|
|
356
350
|
className: "grid w-full grid-cols-[min-content,1fr,min-content] items-center gap-2 py-1",
|
|
357
351
|
}), ref: ref, style: { opacity: opacity }, children: [jsx("div", { className: cvaColumnFilterGrabbable({ disabled: isSortDisabled }), children: jsx(Icon, { color: "secondary", name: "EllipsisDrag", size: "small" }) }), jsxs("label", { className: "grid w-full grid-cols-[1fr,min-content] items-center gap-2", htmlFor: id, children: [jsxs("div", { className: "grid w-full grid-cols-[1fr,min-content] items-center", children: [jsx(Text, { className: cvaLabel(), children: name }), disabled ? jsx(Icon, { name: "LockClosed", size: "small" }) : null] }), jsx(ToggleSwitch, { disabled: disabled, id: id, onChange: (isToggled, event) => event && onToggle(isToggled, event), showInputFocus: false, size: "small", toggled: toggled })] })] }));
|
|
358
352
|
};
|
|
@@ -993,7 +987,7 @@ const Table = ({ rowHeight = 50, ...props }) => {
|
|
|
993
987
|
(props.isRowClickable ? props.isRowClickable(row.original) : true)
|
|
994
988
|
? "pointer"
|
|
995
989
|
: "default",
|
|
996
|
-
|
|
990
|
+
selection: "auto",
|
|
997
991
|
})), dataTestId: `table-body-row-${virtualRow.index}`, layout: "flex", onClick: () => {
|
|
998
992
|
if (props.onRowClick) {
|
|
999
993
|
props.onRowClick(row);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.76",
|
|
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.8.
|
|
19
|
-
"@trackunit/shared-utils": "1.8.
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.6.
|
|
21
|
-
"@trackunit/ui-icons": "1.6.
|
|
22
|
-
"@trackunit/react-table-base-components": "1.6.
|
|
23
|
-
"@trackunit/react-table-pagination": "1.6.
|
|
24
|
-
"@trackunit/react-form-components": "1.7.
|
|
25
|
-
"@trackunit/i18n-library-translation": "1.6.
|
|
26
|
-
"@trackunit/react-core-contexts-api": "1.7.
|
|
27
|
-
"@trackunit/react-test-setup": "1.3.
|
|
18
|
+
"@trackunit/react-components": "1.8.24",
|
|
19
|
+
"@trackunit/shared-utils": "1.8.50",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.6.50",
|
|
21
|
+
"@trackunit/ui-icons": "1.6.49",
|
|
22
|
+
"@trackunit/react-table-base-components": "1.6.76",
|
|
23
|
+
"@trackunit/react-table-pagination": "1.6.49",
|
|
24
|
+
"@trackunit/react-form-components": "1.7.40",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.6.54",
|
|
26
|
+
"@trackunit/react-core-contexts-api": "1.7.51",
|
|
27
|
+
"@trackunit/react-test-setup": "1.3.50"
|
|
28
28
|
},
|
|
29
29
|
"module": "./index.esm.js",
|
|
30
30
|
"main": "./index.cjs.js",
|