@starasia/admin 3.2.2 → 3.2.5
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/components/RightDrawer/index.d.ts +3 -0
- package/dist/components/TableSection/components/DataTable.d.ts +1 -1
- package/dist/components/TableSection/index.d.ts +1 -1
- package/dist/components/TableSection/types.d.ts +11 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1834 -1744
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
|
@@ -13,6 +13,9 @@ export interface RightDrawerProps {
|
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
closeButton?: CloseButton | null | false;
|
|
15
15
|
paddingHorizontal?: boolean;
|
|
16
|
+
width?: CSSProperties["width"];
|
|
17
|
+
minWidth?: CSSProperties["minWidth"];
|
|
18
|
+
maxWidth?: CSSProperties["maxWidth"];
|
|
16
19
|
}
|
|
17
20
|
export declare const RightDrawer: React.ForwardRefExoticComponent<RightDrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BaseRecord, DataTableProps } from '../types';
|
|
3
3
|
|
|
4
|
-
export declare const DataTable: <T extends BaseRecord>({ columns, records, handleDetail, handleUpdate, handleDelete, isLoading, visibleHandleDelete, visibleHandleUpdate, visibleHandleDetail, showHeadBorder, scrollParentRef, frozenCount, onFrozenCountChange, customActions, actionsOrder, customEmptyState, enableColumnResize, defaultColumnWidths, onColumnWidthsChange, defaultMinColumnWidth }: DataTableProps<T>) => React.JSX.Element;
|
|
4
|
+
export declare const DataTable: <T extends BaseRecord>({ columns, records, handleDetail, handleUpdate, handleDelete, isLoading, visibleHandleDelete, visibleHandleUpdate, visibleHandleDetail, showHeadBorder, scrollParentRef, frozenCount, onFrozenCountChange, customActions, actionsOrder, customEmptyState, enableColumnResize, defaultColumnWidths, onColumnWidthsChange, defaultMinColumnWidth, sort, defaultSort, onSortChange, showActionDivider }: DataTableProps<T>) => React.JSX.Element;
|
|
@@ -4,4 +4,4 @@ export { TableHeader } from './components/Header';
|
|
|
4
4
|
export { TableFooter } from './components/Footer';
|
|
5
5
|
export { DataTable } from './components/DataTable';
|
|
6
6
|
export { ColumnFilterDropdown } from './components/ColumnFilterDropdown';
|
|
7
|
-
export type { TableSectionProps, BaseRecord, Column, ColumnFilter, DataTableProps, WrapperProps, TableHeaderProps, TableFooterProps } from './types';
|
|
7
|
+
export type { TableSectionProps, BaseRecord, Column, ColumnFilter, DataTableProps, WrapperProps, TableHeaderProps, TableFooterProps, SortDirection, SortState } from './types';
|
|
@@ -29,6 +29,11 @@ export interface ColumnFilter {
|
|
|
29
29
|
hideSearch?: boolean;
|
|
30
30
|
onOpen?: () => void;
|
|
31
31
|
}
|
|
32
|
+
export type SortDirection = 'asc' | 'desc';
|
|
33
|
+
export interface SortState {
|
|
34
|
+
key: string;
|
|
35
|
+
direction: SortDirection;
|
|
36
|
+
}
|
|
32
37
|
export interface Column<T> {
|
|
33
38
|
accessor?: Accessor<T>;
|
|
34
39
|
title: string;
|
|
@@ -41,6 +46,8 @@ export interface Column<T> {
|
|
|
41
46
|
filter?: ColumnFilter;
|
|
42
47
|
resizable?: boolean;
|
|
43
48
|
minWidth?: number;
|
|
49
|
+
sortable?: boolean;
|
|
50
|
+
sortKey?: string;
|
|
44
51
|
}
|
|
45
52
|
export interface DataTableProps<T extends BaseRecord> {
|
|
46
53
|
columns: Column<T>[];
|
|
@@ -70,6 +77,10 @@ export interface DataTableProps<T extends BaseRecord> {
|
|
|
70
77
|
defaultColumnWidths?: Record<number, number>;
|
|
71
78
|
onColumnWidthsChange?: (widths: Record<number, number>) => void;
|
|
72
79
|
defaultMinColumnWidth?: number;
|
|
80
|
+
sort?: SortState | null;
|
|
81
|
+
defaultSort?: SortState | null;
|
|
82
|
+
onSortChange?: (sort: SortState | null) => void;
|
|
83
|
+
showActionDivider?: boolean;
|
|
73
84
|
}
|
|
74
85
|
export type WrapperProps = {
|
|
75
86
|
children: React.ReactNode;
|