@trackunit/react-table 1.1.0 → 1.2.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 +5 -2
- package/index.esm.js +7 -4
- package/package.json +10 -10
package/index.cjs.js
CHANGED
|
@@ -347,7 +347,7 @@ const ColumnFiltersDragAndDrop = ({ columns, setColumnOrder, onUserEvent, defaul
|
|
|
347
347
|
columnReordered: dragColumn?.columnDef.header ?? "",
|
|
348
348
|
});
|
|
349
349
|
}, [localColumns, onUserEvent]);
|
|
350
|
-
return (jsxRuntime.jsx("div", { className: "flex max-h-full max-w-[400px] flex-col
|
|
350
|
+
return (jsxRuntime.jsx("div", { className: "flex max-h-full max-w-[400px] flex-col overflow-y-auto overflow-x-hidden whitespace-nowrap", children: localColumns.map((column, index) => {
|
|
351
351
|
const { columnDef } = column;
|
|
352
352
|
if (!columnDef.meta?.columnFilterLabel &&
|
|
353
353
|
(!columnDef.header || columnDef.header.length === 0 || typeof columnDef.header === "function")) {
|
|
@@ -410,7 +410,10 @@ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn
|
|
|
410
410
|
});
|
|
411
411
|
const opacity = isDragging ? 0 : 1;
|
|
412
412
|
drag(drop(ref));
|
|
413
|
-
return (jsxRuntime.jsxs("div", { className:
|
|
413
|
+
return (jsxRuntime.jsxs("div", { className: reactComponents.cvaInteractableItem({
|
|
414
|
+
selected: false,
|
|
415
|
+
className: "grid w-full grid-cols-[min-content,1fr,min-content] items-center gap-2 py-1",
|
|
416
|
+
}), ref: ref, style: { opacity: opacity }, children: [jsxRuntime.jsx("div", { className: cvaColumnFilterGrabbable({ disabled: false }), 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 })] })] }));
|
|
414
417
|
};
|
|
415
418
|
|
|
416
419
|
/**
|
package/index.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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, Tooltip, Popover, PopoverTrigger, PopoverContent, Text,
|
|
3
|
+
import { MenuItem, Icon, Button, useOverflowItems, MoreMenu, MenuList, Spacer, Tooltip, Popover, PopoverTrigger, PopoverContent, Text, cvaInteractableItem, Card, Spinner, EmptyState } from '@trackunit/react-components';
|
|
4
4
|
import { objectValues, nonNullable, objectKeys, objectEntries } from '@trackunit/shared-utils';
|
|
5
5
|
import { useMemo, Children, cloneElement, useEffect, useCallback, useState, useRef } from 'react';
|
|
6
6
|
import { cvaMerge } from '@trackunit/css-class-variance-utilities';
|
|
7
7
|
import { Link } from '@tanstack/react-router';
|
|
8
|
-
import {
|
|
8
|
+
import { cvaLabel, ToggleSwitch, RadioGroup, RadioItem, Checkbox } from '@trackunit/react-form-components';
|
|
9
9
|
import update from 'immutability-helper';
|
|
10
10
|
import { DndProvider, useDrop, useDrag } from 'react-dnd';
|
|
11
11
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
@@ -346,7 +346,7 @@ const ColumnFiltersDragAndDrop = ({ columns, setColumnOrder, onUserEvent, defaul
|
|
|
346
346
|
columnReordered: dragColumn?.columnDef.header ?? "",
|
|
347
347
|
});
|
|
348
348
|
}, [localColumns, onUserEvent]);
|
|
349
|
-
return (jsx("div", { className: "flex max-h-full max-w-[400px] flex-col
|
|
349
|
+
return (jsx("div", { className: "flex max-h-full max-w-[400px] flex-col overflow-y-auto overflow-x-hidden whitespace-nowrap", children: localColumns.map((column, index) => {
|
|
350
350
|
const { columnDef } = column;
|
|
351
351
|
if (!columnDef.meta?.columnFilterLabel &&
|
|
352
352
|
(!columnDef.header || columnDef.header.length === 0 || typeof columnDef.header === "function")) {
|
|
@@ -409,7 +409,10 @@ const ColumnFilterItem = ({ name, onToggle, toggled, disabled, index, moveColumn
|
|
|
409
409
|
});
|
|
410
410
|
const opacity = isDragging ? 0 : 1;
|
|
411
411
|
drag(drop(ref));
|
|
412
|
-
return (jsxs("div", { className:
|
|
412
|
+
return (jsxs("div", { className: cvaInteractableItem({
|
|
413
|
+
selected: false,
|
|
414
|
+
className: "grid w-full grid-cols-[min-content,1fr,min-content] items-center gap-2 py-1",
|
|
415
|
+
}), ref: ref, style: { opacity: opacity }, children: [jsx("div", { className: cvaColumnFilterGrabbable({ disabled: false }), 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 })] })] }));
|
|
413
416
|
};
|
|
414
417
|
|
|
415
418
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-table",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"jest-fetch-mock": "^3.0.3",
|
|
16
16
|
"@tanstack/react-router": "1.47.1",
|
|
17
17
|
"tailwind-merge": "^2.0.0",
|
|
18
|
-
"@trackunit/react-components": "1.
|
|
19
|
-
"@trackunit/shared-utils": "1.
|
|
20
|
-
"@trackunit/css-class-variance-utilities": "1.
|
|
21
|
-
"@trackunit/ui-icons": "1.
|
|
22
|
-
"@trackunit/react-table-base-components": "1.
|
|
23
|
-
"@trackunit/react-table-pagination": "1.
|
|
24
|
-
"@trackunit/react-form-components": "1.
|
|
25
|
-
"@trackunit/i18n-library-translation": "1.
|
|
26
|
-
"@trackunit/react-core-contexts-api": "1.
|
|
18
|
+
"@trackunit/react-components": "1.3.0",
|
|
19
|
+
"@trackunit/shared-utils": "1.4.0",
|
|
20
|
+
"@trackunit/css-class-variance-utilities": "1.2.0",
|
|
21
|
+
"@trackunit/ui-icons": "1.2.0",
|
|
22
|
+
"@trackunit/react-table-base-components": "1.2.0",
|
|
23
|
+
"@trackunit/react-table-pagination": "1.2.0",
|
|
24
|
+
"@trackunit/react-form-components": "1.2.0",
|
|
25
|
+
"@trackunit/i18n-library-translation": "1.2.0",
|
|
26
|
+
"@trackunit/react-core-contexts-api": "1.2.0"
|
|
27
27
|
},
|
|
28
28
|
"module": "./index.esm.js",
|
|
29
29
|
"main": "./index.cjs.js",
|