@trackunit/react-table 1.12.0 → 1.12.2

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
@@ -201,9 +201,8 @@ const actionDataToMenuItem = (action, dataTestId) => {
201
201
  * These should be shown in the ActionSheet.
202
202
  * Should not be used outside the ActionSheet component.
203
203
  *
204
- * @param {ActionModel} action - The action model to convert.
205
- * @param {string} [dataTestId] - Optional data test ID.
206
- * @returns {ReactElement} - The ActionButton component for the given action.
204
+ * @param action - The action model to convert.
205
+ * @returns {*} The ActionButton component for the given action.
207
206
  */
208
207
  const actionDataToActionButton = (action) => (jsxRuntime.jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", "data-testid": action["data-testid"] || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
209
208
  /**
@@ -221,11 +220,8 @@ const ActionIcon = ({ action }) => {
221
220
  /**
222
221
  * `ActionContainerAndOverflow` renders a set of actions and a MoreMenu for overflow.
223
222
  * It makes use of the `useOverflowItems` hook to determine which items should go into the overflow menu.
223
+ * See ActionContainerAndOverflowProps for prop documentation.
224
224
  *
225
- * @param {object} props - Props for the component.
226
- * @param {ActionModel[]} props.actions - Array of action models to be rendered.
227
- * @param {ReactElement<SidebarItemProps>[] | ReactElement<SidebarItemProps>} props.moreActions - Additional actions that can be rendered in the MoreMenu.
228
- * @param {string} [props."data-testid"] - Data test id for the component, useful in testing.
229
225
  * @returns {ReactElement} The rendered component.
230
226
  */
231
227
  const ActionContainerAndOverflow = ({ actions, dropdownActions, moreActions, "data-testid": dataTestId, }) => {
@@ -669,10 +665,12 @@ const useCellsOffset = (headerGroups, draggingColumnId) => {
669
665
  };
670
666
 
671
667
  /**
672
- * Hook for handling column drag and drop functionality in a table
668
+ * Hook for handling column drag and drop functionality in a table.
673
669
  *
674
- * @param options - Options including the ReactTable instance and optional callbacks
675
- * @returns { object } Object containing drag state and handler functions
670
+ * @param options - Options for the hook.
671
+ * @param options.table - The ReactTable instance.
672
+ * @param options.onColumnDragStart - Optional callback when column drag starts.
673
+ * @returns {object} Object containing drag state and handler functions.
676
674
  */
677
675
  const useColumnDragDrop = ({ table, onColumnDragStart, }) => {
678
676
  const [draggingColumnId, setDraggingColumnId] = react.useState(null);
package/index.esm.js CHANGED
@@ -200,9 +200,8 @@ const actionDataToMenuItem = (action, dataTestId) => {
200
200
  * These should be shown in the ActionSheet.
201
201
  * Should not be used outside the ActionSheet component.
202
202
  *
203
- * @param {ActionModel} action - The action model to convert.
204
- * @param {string} [dataTestId] - Optional data test ID.
205
- * @returns {ReactElement} - The ActionButton component for the given action.
203
+ * @param action - The action model to convert.
204
+ * @returns {*} The ActionButton component for the given action.
206
205
  */
207
206
  const actionDataToActionButton = (action) => (jsx(ActionButton, { action: action, className: "max-w-max flex-shrink-0", "data-testid": action["data-testid"] || action.id, disabled: action.loading || action.disabled, id: action.id, variant: action.disabled ? "ghost" : undefined }, action.id));
208
207
  /**
@@ -220,11 +219,8 @@ const ActionIcon = ({ action }) => {
220
219
  /**
221
220
  * `ActionContainerAndOverflow` renders a set of actions and a MoreMenu for overflow.
222
221
  * It makes use of the `useOverflowItems` hook to determine which items should go into the overflow menu.
222
+ * See ActionContainerAndOverflowProps for prop documentation.
223
223
  *
224
- * @param {object} props - Props for the component.
225
- * @param {ActionModel[]} props.actions - Array of action models to be rendered.
226
- * @param {ReactElement<SidebarItemProps>[] | ReactElement<SidebarItemProps>} props.moreActions - Additional actions that can be rendered in the MoreMenu.
227
- * @param {string} [props."data-testid"] - Data test id for the component, useful in testing.
228
224
  * @returns {ReactElement} The rendered component.
229
225
  */
230
226
  const ActionContainerAndOverflow = ({ actions, dropdownActions, moreActions, "data-testid": dataTestId, }) => {
@@ -668,10 +664,12 @@ const useCellsOffset = (headerGroups, draggingColumnId) => {
668
664
  };
669
665
 
670
666
  /**
671
- * Hook for handling column drag and drop functionality in a table
667
+ * Hook for handling column drag and drop functionality in a table.
672
668
  *
673
- * @param options - Options including the ReactTable instance and optional callbacks
674
- * @returns { object } Object containing drag state and handler functions
669
+ * @param options - Options for the hook.
670
+ * @param options.table - The ReactTable instance.
671
+ * @param options.onColumnDragStart - Optional callback when column drag starts.
672
+ * @returns {object} Object containing drag state and handler functions.
675
673
  */
676
674
  const useColumnDragDrop = ({ table, onColumnDragStart, }) => {
677
675
  const [draggingColumnId, setDraggingColumnId] = useState(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-table",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
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.16.0",
18
- "@trackunit/shared-utils": "1.13.19",
19
- "@trackunit/css-class-variance-utilities": "1.11.19",
20
- "@trackunit/ui-icons": "1.11.18",
21
- "@trackunit/react-table-base-components": "1.12.0",
22
- "@trackunit/react-form-components": "1.13.0",
23
- "@trackunit/i18n-library-translation": "1.12.0",
24
- "@trackunit/iris-app-runtime-core-api": "1.12.0",
17
+ "@trackunit/react-components": "1.16.2",
18
+ "@trackunit/shared-utils": "1.13.21",
19
+ "@trackunit/css-class-variance-utilities": "1.11.21",
20
+ "@trackunit/ui-icons": "1.11.20",
21
+ "@trackunit/react-table-base-components": "1.12.2",
22
+ "@trackunit/react-form-components": "1.13.2",
23
+ "@trackunit/i18n-library-translation": "1.12.2",
24
+ "@trackunit/iris-app-runtime-core-api": "1.12.2",
25
25
  "graphql": "^16.10.0"
26
26
  },
27
27
  "module": "./index.esm.js",
@@ -9,12 +9,9 @@ interface ActionContainerAndOverflowProps extends CommonProps {
9
9
  /**
10
10
  * `ActionContainerAndOverflow` renders a set of actions and a MoreMenu for overflow.
11
11
  * It makes use of the `useOverflowItems` hook to determine which items should go into the overflow menu.
12
+ * See ActionContainerAndOverflowProps for prop documentation.
12
13
  *
13
- * @param {object} props - Props for the component.
14
- * @param {ActionModel[]} props.actions - Array of action models to be rendered.
15
- * @param {ReactElement<SidebarItemProps>[] | ReactElement<SidebarItemProps>} props.moreActions - Additional actions that can be rendered in the MoreMenu.
16
- * @param {string} [props."data-testid"] - Data test id for the component, useful in testing.
17
14
  * @returns {ReactElement} The rendered component.
18
15
  */
19
- export declare const ActionContainerAndOverflow: ({ actions, dropdownActions, moreActions, "data-testid": dataTestId, }: ActionContainerAndOverflowProps) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const ActionContainerAndOverflow: ({ actions, dropdownActions, moreActions, "data-testid": dataTestId, }: ActionContainerAndOverflowProps) => ReactElement;
20
17
  export {};
@@ -1,4 +1,5 @@
1
1
  import { ButtonCommonProps } from "@trackunit/react-components";
2
+ import { ReactElement } from "react";
2
3
  import { ActionModel } from "./Actions";
3
4
  interface ActionButtonProps extends ButtonCommonProps {
4
5
  /**
@@ -16,7 +17,7 @@ interface ActionButtonProps extends ButtonCommonProps {
16
17
  * @param {...any} [props.rest] - Any additional button properties.
17
18
  * @returns {ReactElement} - The action button component.
18
19
  */
19
- export declare const ActionButton: ({ action, id, ...rest }: ActionButtonProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const ActionButton: ({ action, id, ...rest }: ActionButtonProps) => ReactElement;
20
21
  /**
21
22
  * Converts an action model to a MenuItem component.
22
23
  * These should be shown in the more menu.
@@ -32,9 +33,8 @@ export declare const actionDataToMenuItem: (action: ActionModel, dataTestId?: st
32
33
  * These should be shown in the ActionSheet.
33
34
  * Should not be used outside the ActionSheet component.
34
35
  *
35
- * @param {ActionModel} action - The action model to convert.
36
- * @param {string} [dataTestId] - Optional data test ID.
37
- * @returns {ReactElement} - The ActionButton component for the given action.
36
+ * @param action - The action model to convert.
37
+ * @returns {*} The ActionButton component for the given action.
38
38
  */
39
39
  export declare const actionDataToActionButton: (action: ActionModel) => import("react/jsx-runtime").JSX.Element;
40
40
  interface InnerActionButtonProps {
@@ -8,10 +8,12 @@ type ColumnStyles = {
8
8
  [x: string]: number | string | undefined;
9
9
  };
10
10
  /**
11
- * Hook for handling column drag and drop functionality in a table
11
+ * Hook for handling column drag and drop functionality in a table.
12
12
  *
13
- * @param options - Options including the ReactTable instance and optional callbacks
14
- * @returns { object } Object containing drag state and handler functions
13
+ * @param options - Options for the hook.
14
+ * @param options.table - The ReactTable instance.
15
+ * @param options.onColumnDragStart - Optional callback when column drag starts.
16
+ * @returns {object} Object containing drag state and handler functions.
15
17
  */
16
18
  export declare const useColumnDragDrop: <TData extends object>({ table, onColumnDragStart, }: ColumnDragDropOptions<TData>) => {
17
19
  draggingColumnId: string | null;