@apcrda/ui 0.5.7 → 0.5.9
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/README.md +343 -51
- package/dist/components/AlertDialog/AlertDialog.d.ts +22 -3
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +14 -12
- package/dist/components/AlertDialog/index.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +4 -2
- package/dist/components/Card/Card.types.d.ts +4 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/FormField/FormField.d.ts +1 -1
- package/dist/components/FormField/FormField.types.d.ts +4 -1
- package/dist/components/FormField/FormFieldContext.d.ts +9 -0
- package/dist/components/FormField/index.d.ts +2 -0
- package/dist/components/Navbar/Navbar.d.ts +5 -0
- package/dist/components/Navbar/Navbar.types.d.ts +10 -0
- package/dist/components/Navbar/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +2 -0
- package/dist/components/Spinner/Spinner.types.d.ts +9 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.types.d.ts +1 -0
- package/dist/components/Table/DataTable.d.ts +1 -1
- package/dist/components/Table/DataTable.types.d.ts +62 -6
- package/dist/components/Table/DataTable.utils.d.ts +7 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -0
- package/dist/components/Textarea/Textarea.types.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +6379 -4720
- package/dist/xlsx-BNuhnZ8W.js +12387 -0
- package/package.json +3 -1
|
@@ -1,23 +1,79 @@
|
|
|
1
1
|
import type { ColumnDef, Row } from '@tanstack/react-table';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export type { ColumnDef };
|
|
4
|
+
export type DataTableDensity = 'compact' | 'normal' | 'spacious';
|
|
5
|
+
export type DataTableFilterType = 'text' | 'select' | 'range' | 'date';
|
|
6
|
+
export interface DataTableRowAction<TData> {
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly icon?: ReactNode;
|
|
9
|
+
readonly onClick: (row: TData) => void;
|
|
10
|
+
readonly variant?: 'default' | 'destructive';
|
|
11
|
+
readonly disabled?: (row: TData) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DataTableBulkAction<TData> {
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly icon?: ReactNode;
|
|
16
|
+
readonly onClick: (rows: TData[]) => void;
|
|
17
|
+
readonly variant?: 'default' | 'destructive';
|
|
18
|
+
}
|
|
19
|
+
export interface DataTableServerPagination {
|
|
20
|
+
readonly total: number;
|
|
21
|
+
readonly onPaginationChange: (pageIndex: number, pageSize: number) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface DataTableInfiniteScroll {
|
|
24
|
+
readonly onLoadMore: () => void;
|
|
25
|
+
readonly hasMore: boolean;
|
|
26
|
+
readonly isLoadingMore?: boolean;
|
|
27
|
+
}
|
|
4
28
|
export interface DataTableProps<TData> {
|
|
5
29
|
data: TData[];
|
|
6
30
|
columns: ColumnDef<TData, any>[];
|
|
31
|
+
className?: string;
|
|
7
32
|
loading?: boolean;
|
|
8
33
|
loadingRows?: number;
|
|
9
34
|
emptyMessage?: string;
|
|
10
35
|
emptyDescription?: string;
|
|
36
|
+
pagination?: boolean;
|
|
11
37
|
pageSize?: number;
|
|
12
38
|
pageSizeOptions?: number[];
|
|
13
|
-
|
|
14
|
-
|
|
39
|
+
serverPagination?: DataTableServerPagination;
|
|
40
|
+
infiniteScroll?: DataTableInfiniteScroll;
|
|
41
|
+
multiSort?: boolean;
|
|
42
|
+
columnFilters?: boolean;
|
|
15
43
|
columnVisibility?: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
44
|
+
columnResize?: boolean;
|
|
45
|
+
columnPinning?: boolean;
|
|
46
|
+
columnReorder?: boolean;
|
|
47
|
+
selectable?: boolean;
|
|
48
|
+
onSelectionChange?: (rows: TData[]) => void;
|
|
18
49
|
getRowCanExpand?: (row: Row<TData>) => boolean;
|
|
19
50
|
renderSubRow?: (row: Row<TData>) => ReactNode;
|
|
20
|
-
|
|
51
|
+
getSubRows?: (row: TData) => TData[] | undefined;
|
|
52
|
+
grouping?: boolean;
|
|
53
|
+
defaultGrouping?: string[];
|
|
54
|
+
density?: boolean;
|
|
55
|
+
defaultDensity?: DataTableDensity;
|
|
56
|
+
stickyHeader?: boolean;
|
|
57
|
+
striped?: boolean;
|
|
58
|
+
virtualize?: boolean;
|
|
59
|
+
estimatedRowHeight?: number;
|
|
60
|
+
rowActions?: DataTableRowAction<TData>[];
|
|
61
|
+
bulkActions?: DataTableBulkAction<TData>[];
|
|
62
|
+
exportCsv?: boolean;
|
|
63
|
+
exportExcel?: boolean;
|
|
64
|
+
exportFilename?: string;
|
|
65
|
+
print?: boolean;
|
|
66
|
+
copy?: boolean;
|
|
67
|
+
showFooter?: boolean;
|
|
21
68
|
onRowClick?: (row: TData) => void;
|
|
22
|
-
|
|
69
|
+
}
|
|
70
|
+
declare module '@tanstack/table-core' {
|
|
71
|
+
interface ColumnMeta<TData extends unknown | object | any[], TValue> {
|
|
72
|
+
filterType?: DataTableFilterType;
|
|
73
|
+
filterOptions?: {
|
|
74
|
+
label: string;
|
|
75
|
+
value: string;
|
|
76
|
+
}[];
|
|
77
|
+
align?: 'left' | 'center' | 'right';
|
|
78
|
+
}
|
|
23
79
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FilterFn, Table } from '@tanstack/react-table';
|
|
2
|
+
export declare const numberRangeFilterFn: FilterFn<any>;
|
|
3
|
+
export declare const dateRangeFilterFn: FilterFn<any>;
|
|
4
|
+
export declare function exportToCsv<TData>(filename: string, table: Table<TData>): void;
|
|
5
|
+
export declare function exportToExcel<TData>(filename: string, table: Table<TData>): Promise<void>;
|
|
6
|
+
export declare function printTable<TData>(filename: string, table: Table<TData>): void;
|
|
7
|
+
export declare function copyToClipboard<TData>(table: Table<TData>, selectedOnly?: boolean): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DataTable } from './DataTable';
|
|
2
|
-
export type { ColumnDef, DataTableProps } from './DataTable.types';
|
|
2
|
+
export type { ColumnDef, DataTableBulkAction, DataTableDensity, DataTableFilterType, DataTableInfiniteScroll, DataTableProps, DataTableRowAction, DataTableServerPagination, } from './DataTable.types';
|
|
3
3
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './Table';
|
|
@@ -6,4 +6,5 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<import(
|
|
|
6
6
|
readonly textareaSize?: import("./Textarea.types").TextareaSize;
|
|
7
7
|
readonly error?: boolean;
|
|
8
8
|
readonly loading?: boolean;
|
|
9
|
+
readonly showCount?: boolean;
|
|
9
10
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -24,6 +24,7 @@ export * from './Input';
|
|
|
24
24
|
export * from './Kbd';
|
|
25
25
|
export * from './Label';
|
|
26
26
|
export * from './MultiSelect';
|
|
27
|
+
export * from './Navbar';
|
|
27
28
|
export * from './NotificationCenter';
|
|
28
29
|
export * from './NumberInput';
|
|
29
30
|
export * from './Pagination';
|
|
@@ -34,6 +35,7 @@ export * from './RadioGroup';
|
|
|
34
35
|
export * from './ScrollArea';
|
|
35
36
|
export * from './Select';
|
|
36
37
|
export * from './Sidebar';
|
|
38
|
+
export * from './Spinner';
|
|
37
39
|
export * from './Skeleton';
|
|
38
40
|
export * from './StatCard';
|
|
39
41
|
export * from './Stepper';
|