elseware-ui 2.23.2 → 2.24.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/build/components/data-display/data-view/com/DataViewContent.d.ts +6 -0
- package/build/components/data-display/data-view/com/DataViewHeader.d.ts +6 -0
- package/build/components/data-display/data-view/com/DataViewPagination.d.ts +7 -0
- package/build/components/data-display/data-view/com/DataViewSidebar.d.ts +6 -0
- package/build/components/data-display/data-view/controls/DataViewFilterGroup.d.ts +12 -0
- package/build/components/data-display/data-view/controls/DataViewSearch.d.ts +7 -0
- package/build/components/data-display/data-view/controls/DataViewSort.d.ts +11 -0
- package/build/components/data-display/data-view/core/DataViewContext.d.ts +3 -0
- package/build/components/data-display/data-view/core/DataViewProvider.d.ts +10 -0
- package/build/components/data-display/data-view/core/types.d.ts +22 -0
- package/build/components/data-display/data-view/hooks/useDataView.d.ts +2 -0
- package/build/components/data-display/data-view/index.d.ts +17 -0
- package/build/components/data-display/data-view/utils/filterData.d.ts +1 -0
- package/build/components/data-display/data-view/utils/searchData.d.ts +1 -0
- package/build/components/data-display/data-view/utils/sortData.d.ts +2 -0
- package/build/components/data-display/index.d.ts +1 -0
- package/build/index.es.js +6754 -6571
- package/build/index.js +6753 -6569
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Shape } from "../../../../types";
|
|
2
|
+
type DataViewPaginationProps = {
|
|
3
|
+
pageSizeOptions?: (number | "All")[];
|
|
4
|
+
shape?: Shape;
|
|
5
|
+
};
|
|
6
|
+
declare function DataViewPagination({ pageSizeOptions, shape, }: DataViewPaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default DataViewPagination;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FilterOption = {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
dotClass?: string;
|
|
5
|
+
};
|
|
6
|
+
type DataViewFilterGroupProps<T = any> = {
|
|
7
|
+
filterKey: keyof T;
|
|
8
|
+
options: FilterOption[];
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function DataViewFilterGroup<T extends Record<string, any>>({ filterKey, options, title, }: DataViewFilterGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default DataViewFilterGroup;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Shape } from "../../../../types";
|
|
2
|
+
type DataViewSearchProps = {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
shape?: Shape;
|
|
5
|
+
};
|
|
6
|
+
declare function DataViewSearch({ placeholder, shape, }: DataViewSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default DataViewSearch;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Shape } from "../../../../types";
|
|
2
|
+
type SortOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type DataViewSortProps = {
|
|
7
|
+
options: SortOption[];
|
|
8
|
+
shape?: Shape;
|
|
9
|
+
};
|
|
10
|
+
declare function DataViewSort({ options, shape }: DataViewSortProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default DataViewSort;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SortConfig } from "./types";
|
|
3
|
+
interface Props<T> {
|
|
4
|
+
data: T[];
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
defaultPageSize?: number;
|
|
7
|
+
sortConfig?: Record<string, SortConfig<T>>;
|
|
8
|
+
}
|
|
9
|
+
declare function DataViewProvider<T extends Record<string, any>>({ data, children, defaultPageSize, sortConfig, }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default DataViewProvider;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
export type SortDirection = "asc" | "desc";
|
|
3
|
+
export type SortConfig<T, K extends keyof T = keyof T> = {
|
|
4
|
+
key: K;
|
|
5
|
+
direction?: "asc" | "desc";
|
|
6
|
+
transform?: (value: T[K]) => number | string;
|
|
7
|
+
};
|
|
8
|
+
export interface DataViewContextType<T = any> {
|
|
9
|
+
rawData: T[];
|
|
10
|
+
data: T[];
|
|
11
|
+
search: string;
|
|
12
|
+
setSearch: (v: string) => void;
|
|
13
|
+
filters: Record<string, any>;
|
|
14
|
+
setFilters: Dispatch<SetStateAction<Record<string, any>>>;
|
|
15
|
+
sort: string;
|
|
16
|
+
setSort: (v: string) => void;
|
|
17
|
+
page: number;
|
|
18
|
+
setPage: (v: number) => void;
|
|
19
|
+
pageSize: number | "All";
|
|
20
|
+
setPageSize: (v: number | "All") => void;
|
|
21
|
+
totalPages: number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DataViewProvider from "./core/DataViewProvider";
|
|
2
|
+
import DataViewHeader from "./com/DataViewHeader";
|
|
3
|
+
import DataViewSidebar from "./com/DataViewSidebar";
|
|
4
|
+
import DataViewContent from "./com/DataViewContent";
|
|
5
|
+
import DataViewPagination from "./com/DataViewPagination";
|
|
6
|
+
import DataViewSearch from "./controls/DataViewSearch";
|
|
7
|
+
import DataViewSort from "./controls/DataViewSort";
|
|
8
|
+
import DataViewFilterGroup from "./controls/DataViewFilterGroup";
|
|
9
|
+
export declare const DataView: typeof DataViewProvider & {
|
|
10
|
+
Header: typeof DataViewHeader;
|
|
11
|
+
Sidebar: typeof DataViewSidebar;
|
|
12
|
+
Content: typeof DataViewContent;
|
|
13
|
+
Pagination: typeof DataViewPagination;
|
|
14
|
+
Search: typeof DataViewSearch;
|
|
15
|
+
Sort: typeof DataViewSort;
|
|
16
|
+
FilterGroup: typeof DataViewFilterGroup;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterData<T extends Record<string, any>>(data: T[], filters: Record<string, any>): T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function searchData<T extends Record<string, any>>(data: T[], search: string): T[];
|