@prt-ts/fluent-react-table-v2 9.36.0-build.2.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/index.d.ts +1 -0
- package/index.js +153 -0
- package/index.mjs +19192 -0
- package/lib/components/GridContainer.d.ts +8 -0
- package/lib/components/filters/Filter.d.ts +5 -0
- package/lib/components/filters/FilterMultiSelectCheckbox.d.ts +5 -0
- package/lib/components/filters/FilterMultiSelectRadio.d.ts +5 -0
- package/lib/components/filters/index.d.ts +1 -0
- package/lib/components/grid-header/GridHeader.d.ts +10 -0
- package/lib/components/grid-header/index.d.ts +1 -0
- package/lib/components/grid-header/useGridHeaderStyles.d.ts +1 -0
- package/lib/components/icon-components/GridIcons.d.ts +10 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/loading/Loading.d.ts +7 -0
- package/lib/components/loading/index.d.ts +1 -0
- package/lib/components/loading/useLoadingStyles.d.ts +1 -0
- package/lib/components/no-item/NoItemGrid.d.ts +4 -0
- package/lib/components/no-item/index.d.ts +1 -0
- package/lib/components/no-item/useNoItemGridStyles.d.ts +1 -0
- package/lib/components/no-search-result/NoSearchResult.d.ts +4 -0
- package/lib/components/no-search-result/index.d.ts +1 -0
- package/lib/components/no-search-result/useNoSearchResultStyles.d.ts +1 -0
- package/lib/components/pagination/Pagination.d.ts +7 -0
- package/lib/components/pagination/usePaginationStyles.d.ts +1 -0
- package/lib/components/table/Table.d.ts +12 -0
- package/lib/components/table/index.d.ts +1 -0
- package/lib/components/table/useTableStaticStyles.d.ts +2 -0
- package/lib/components/thead/HeaderCell.d.ts +11 -0
- package/lib/components/thead/index.d.ts +1 -0
- package/lib/components/thead/useGridContainer.d.ts +8 -0
- package/lib/index.d.ts +4 -0
- package/lib/types/TableProps.d.ts +78 -0
- package/lib/types/TableRef.d.ts +7 -0
- package/lib/types/index.d.ts +2 -0
- package/package.json +33 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TableProps, TableRef } from "../types";
|
|
3
|
+
export declare function AdvancedTable<TItem extends object>(props: TableProps<TItem>, ref: React.ForwardedRef<TableRef<TItem>>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const ForwardedAdvancedTable: <TItem extends object>(props: TableProps<TItem> & {
|
|
5
|
+
ref?: React.ForwardedRef<TableRef<TItem>> | undefined;
|
|
6
|
+
}) => React.ReactElement<TableProps<TItem> & {
|
|
7
|
+
ref?: React.ForwardedRef<TableRef<TItem>> | undefined;
|
|
8
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Filter } from "./Filter";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Table } from '@tanstack/react-table';
|
|
3
|
+
type GridHeaderProps<TItem extends object> = {
|
|
4
|
+
table: Table<TItem>;
|
|
5
|
+
gridTitle: JSX.Element | React.ReactNode;
|
|
6
|
+
globalFilter: string;
|
|
7
|
+
setGlobalFilter: (value: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const GridHeader: <TItem extends object>(props: GridHeaderProps<TItem>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GridHeader } from "./GridHeader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGridHeaderStyles: () => Record<"tableTopHeaderContainer" | "tableTopHeaderLeft" | "tableTopHeaderRight" | "tableTopHeaderColumnTogglePopover", string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SaveIcon: import("@fluentui/react-icons").FluentIcon;
|
|
2
|
+
export declare const ChangeViewIcon: import("@fluentui/react-icons").FluentIcon;
|
|
3
|
+
export declare const SearchIcon: import("@fluentui/react-icons").FluentIcon;
|
|
4
|
+
export declare const VerticalMoreIcon: import("@fluentui/react-icons").FluentIcon;
|
|
5
|
+
export declare const ClearFilterIcon: import("@fluentui/react-icons").FluentIcon;
|
|
6
|
+
export declare const ToggleSelectColumnIcon: import("@fluentui/react-icons").FluentIcon;
|
|
7
|
+
export declare const ToggleGroupColumnIcon: import("@fluentui/react-icons").FluentIcon;
|
|
8
|
+
export declare const GroupCollapsedIcon: import("@fluentui/react-icons").FluentIcon;
|
|
9
|
+
export declare const GroupExpandedIcon: import("@fluentui/react-icons").FluentIcon;
|
|
10
|
+
export declare const DragIcon: import("@fluentui/react-icons").FluentIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ForwardedAdvancedTable as Table } from "./GridContainer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading } from "./Loading";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLoadingStyles: () => Record<"row" | "invertedWrapper", string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoItemGrid } from "./NoItemGrid";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useNoItemGridStyles: () => Record<"wrapper", string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoSearchResult } from "./NoSearchResult";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useNoFilterMatchStyles: () => Record<"wrapper" | "iconWrapper", string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Table } from "@tanstack/react-table";
|
|
2
|
+
type PaginationProps<TItem extends object> = {
|
|
3
|
+
table: Table<TItem>;
|
|
4
|
+
pageSizeOptions?: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const Pagination: <TItem extends object>(props: PaginationProps<TItem>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const usePaginationStyle: () => Record<"wrapper" | "paginationContainer" | "pageBtnContainer" | "pageBtn" | "pageSelectionWrapper" | "pageSelectionDropdown" | "pageSizeInput", string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Table } from "@tanstack/react-table";
|
|
3
|
+
type TableContainerProps<TItem extends object> = {
|
|
4
|
+
rowSelectionMode?: "single" | "multiple";
|
|
5
|
+
table: Table<TItem>;
|
|
6
|
+
noItemPage?: React.ReactNode;
|
|
7
|
+
noFilterMatchPage?: React.ReactNode;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
data: TItem[];
|
|
10
|
+
};
|
|
11
|
+
export declare const TableContainer: <TItem extends object>(props: TableContainerProps<TItem>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableContainer } from "./Table";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Header, Table } from "@tanstack/react-table";
|
|
3
|
+
type HeaderCellProps = {
|
|
4
|
+
header: Header<object, unknown>;
|
|
5
|
+
table: Table<object>;
|
|
6
|
+
hideMenu?: boolean;
|
|
7
|
+
headerDepth: number;
|
|
8
|
+
totalNumberOfHeaderDepth: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const HeaderCell: React.FC<HeaderCellProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderCell } from "./HeaderCell";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableProps } from "../..";
|
|
2
|
+
import { TableRef } from "../../types";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export declare const useGridContainer: <TItem extends object>(props: TableProps<TItem>, ref: React.ForwardedRef<TableRef<TItem>>) => {
|
|
5
|
+
table: import("@tanstack/react-table").Table<TItem>;
|
|
6
|
+
globalFilter: string;
|
|
7
|
+
setGlobalFilter: React.Dispatch<React.SetStateAction<string>>;
|
|
8
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ExpandedState, GroupingState, RowSelectionState, SortingState, VisibilityState } from "@tanstack/react-table";
|
|
3
|
+
export type TableProps<TItem extends object> = {
|
|
4
|
+
/**
|
|
5
|
+
* Table Columns definitions.
|
|
6
|
+
*/
|
|
7
|
+
columns: ColumnDef<TItem>[];
|
|
8
|
+
/**
|
|
9
|
+
* Table data.
|
|
10
|
+
*/
|
|
11
|
+
data: TItem[];
|
|
12
|
+
/**
|
|
13
|
+
* Table loading state.
|
|
14
|
+
*/
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Grid title
|
|
18
|
+
*/
|
|
19
|
+
gridTitle?: JSX.Element | React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Table default page size.
|
|
22
|
+
*/
|
|
23
|
+
pageSize?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Table page size options
|
|
26
|
+
*/
|
|
27
|
+
pageSizeOptions?: number[];
|
|
28
|
+
/**
|
|
29
|
+
* Row selection mode.
|
|
30
|
+
*/
|
|
31
|
+
rowSelectionMode?: "single" | "multiple";
|
|
32
|
+
/**
|
|
33
|
+
* Default global filter value.
|
|
34
|
+
*/
|
|
35
|
+
defaultGlobalFilter?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Column filter state
|
|
38
|
+
*/
|
|
39
|
+
columnFilterState?: ColumnFiltersState;
|
|
40
|
+
/**
|
|
41
|
+
* Column Visibility
|
|
42
|
+
*/
|
|
43
|
+
columnVisibility?: VisibilityState;
|
|
44
|
+
/**
|
|
45
|
+
* Sorting state
|
|
46
|
+
*/
|
|
47
|
+
sortingState?: SortingState;
|
|
48
|
+
/**
|
|
49
|
+
* Grouping state
|
|
50
|
+
*/
|
|
51
|
+
groupingState?: GroupingState;
|
|
52
|
+
/**
|
|
53
|
+
* Grouping Expanded state
|
|
54
|
+
*/
|
|
55
|
+
expandedState?: ExpandedState;
|
|
56
|
+
/**
|
|
57
|
+
* Row selection state
|
|
58
|
+
*/
|
|
59
|
+
rowSelectionState?: RowSelectionState;
|
|
60
|
+
/**
|
|
61
|
+
* Column pinning state
|
|
62
|
+
*/
|
|
63
|
+
columnPinningState?: ColumnPinningState;
|
|
64
|
+
/**
|
|
65
|
+
* Column order state
|
|
66
|
+
*/
|
|
67
|
+
columnOrderState?: ColumnOrderState;
|
|
68
|
+
/**
|
|
69
|
+
* Component visible if the no item match the filter condition
|
|
70
|
+
* @default defaultNoItemComponent
|
|
71
|
+
*/
|
|
72
|
+
noFilterMatchPage?: React.ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Component visible in the grid body if there is no items in the list
|
|
75
|
+
* @default defaultNoItemComponent
|
|
76
|
+
*/
|
|
77
|
+
noItemPage?: React.ReactNode;
|
|
78
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Table } from "@tanstack/react-table";
|
|
2
|
+
export type TableRef<TItem extends object> = {
|
|
3
|
+
table: Table<TItem>;
|
|
4
|
+
getTableState: () => Record<string, unknown>;
|
|
5
|
+
saveCurrentTableState: (viewName: string) => boolean;
|
|
6
|
+
applySavedView: (viewName: string) => boolean;
|
|
7
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@prt-ts/fluent-react-table-v2",
|
|
3
|
+
"version": "9.36.0-build.2.0",
|
|
4
|
+
"main": "./index.js",
|
|
5
|
+
"types": "./index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./index.mjs",
|
|
9
|
+
"require": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"react": ">=17.0.0",
|
|
14
|
+
"react-dom": ">=17.0.0",
|
|
15
|
+
"@fluentui/react-components": "^9.36.0",
|
|
16
|
+
"@fluentui/react-icons": "^2.0.221"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@tanstack/react-table": "^8.10.7",
|
|
20
|
+
"react-dnd": "^16.0.1",
|
|
21
|
+
"react-dnd-html5-backend": "^16.0.1",
|
|
22
|
+
"react-virtual": "^2.10.4"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"author": "Pradeep Raj Thapaliya",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/prt-ts/spfx-workspace.git"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/prt-ts/spfx-workspace.git#readme"
|
|
33
|
+
}
|