@canonical/maas-react-components 1.33.4 → 1.35.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.
@@ -1,5 +1,5 @@
1
1
  import { Dispatch, ReactElement, ReactNode, RefObject, SetStateAction, DetailedHTMLProps, HTMLAttributes } from 'react';
2
- import { Column, ColumnDef, ColumnSort, Header, Row, RowSelectionState } from '@tanstack/react-table';
2
+ import { Column, ColumnDef, ColumnSort, Header, Row, RowSelectionState, SortingState } from '@tanstack/react-table';
3
3
  import { PaginationBarProps } from './PaginationBar';
4
4
  type GenericTableProps<T extends {
5
5
  id: number | string;
@@ -21,7 +21,8 @@ type GenericTableProps<T extends {
21
21
  value: string;
22
22
  isTop: boolean;
23
23
  }[];
24
- sortBy?: ColumnSort[];
24
+ sorting?: ColumnSort[];
25
+ setSorting?: Dispatch<SetStateAction<SortingState>>;
25
26
  rowSelection?: RowSelectionState;
26
27
  setRowSelection?: Dispatch<SetStateAction<RowSelectionState>>;
27
28
  showChevron?: boolean;
@@ -51,7 +52,8 @@ type GenericTableProps<T extends {
51
52
  * @param {ReactNode} [props.noData] - Content to display when no data is available
52
53
  * @param {PaginationBarProps} [props.pagination] - Pagination configuration
53
54
  * @param {{ value: string; isTop: boolean }[]} [props.pinGroup] - Group pinning configuration
54
- * @param {ColumnSort[]} [props.sortBy] - Initial sort configuration
55
+ * @param {ColumnSort[]} [props.sorting] - Initial sort configuration
56
+ * @param {Dispatch<SetStateAction<SortingState>>} [props.setSorting] - Sorting state setter
55
57
  * @param {RowSelectionState} [props.rowSelection] - Selected rows state
56
58
  * @param {Dispatch<SetStateAction<RowSelectionState>>} [props.setRowSelection] - Selection state setter
57
59
  * @param {boolean} [props.showChevron=false] - Show group row expansion state chevrons
@@ -79,5 +81,5 @@ type GenericTableProps<T extends {
79
81
  */
80
82
  export declare const GenericTable: <T extends {
81
83
  id: number | string;
82
- }>({ className, canSelect, disabledSelectionTooltip, columns: initialColumns, containerRef, data: initialData, filterCells, filterHeaders, getSubRows, groupBy, isLoading, noData, pagination, pinGroup, sortBy, rowSelection, setRowSelection, showChevron, variant, ...props }: GenericTableProps<T>) => ReactElement;
84
+ }>({ className, canSelect, disabledSelectionTooltip, columns: initialColumns, containerRef, data: initialData, filterCells, filterHeaders, getSubRows, groupBy, isLoading, noData, pagination, pinGroup, sorting, setSorting, rowSelection, setRowSelection, showChevron, variant, ...props }: GenericTableProps<T>) => ReactElement;
83
85
  export {};
@@ -23,3 +23,4 @@ export declare const GroupedNested: Story;
23
23
  export declare const Paginated: Story;
24
24
  export declare const Searchable: Story;
25
25
  export declare const Scrollable: Story;
26
+ export declare const SortableExternal: Story;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/maas-react-components",
3
3
  "description": "React components for use in MAAS UI projects.",
4
- "version": "1.33.4",
4
+ "version": "1.35.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/canonical/maas-react-components.git"