@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.
- package/dist/@canonical/maas-react-components.es.js +1222 -1212
- package/dist/@canonical/maas-react-components.umd.js +16 -16
- package/dist/maas-react-components.css +1 -1
- package/dist/src/lib/components/GenericTable/GenericTable.d.ts +6 -4
- package/dist/src/lib/components/GenericTable/GenericTable.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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.
|
|
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,
|
|
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 {};
|
package/package.json
CHANGED