@popmenu/table 0.45.0 → 0.47.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/ColumnFilterChip/ColumnFilterChip.d.ts +9 -0
- package/build/components/ColumnFilterChip/index.d.ts +1 -0
- package/build/components/ColumnFilterResetButton/ColumnFilterResetButton.d.ts +3 -0
- package/build/components/ColumnFilterResetButton/index.d.ts +1 -0
- package/build/components/FilterPanel/FilterControl/FilterControl.d.ts +3 -0
- package/build/components/FilterPanel/FilterControl/SelectFilter/SelectFilter.d.ts +5 -0
- package/build/components/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.d.ts +1 -0
- package/build/components/FilterPanel/FilterControl/SelectFilter/index.d.ts +1 -0
- package/build/components/FilterPanel/FilterControl/index.d.ts +1 -0
- package/build/components/FilterPanel/FilterPanel.d.ts +2 -0
- package/build/components/FilterPanel/FilterPanelProps.d.ts +11 -0
- package/build/components/FilterPanel/Panel/Panel.d.ts +7 -0
- package/build/components/FilterPanel/Panel/PanelStyles.d.ts +1 -0
- package/build/components/FilterPanel/Panel/index.d.ts +1 -0
- package/build/components/FilterPanel/Trigger/Trigger.d.ts +7 -0
- package/build/components/FilterPanel/Trigger/TriggerStyles.d.ts +1 -0
- package/build/components/FilterPanel/Trigger/index.d.ts +1 -0
- package/build/components/FilterPanel/index.d.ts +1 -0
- package/build/components/GlobalFilter/GlobalFilterStyles.d.ts +1 -0
- package/build/components/RowActions/RowActions.d.ts +3 -0
- package/build/components/RowActions/RowActionsProps.d.ts +11 -0
- package/build/components/RowActions/index.d.ts +2 -0
- package/build/components/Table/Table.d.ts +16 -2
- package/build/components/Table/TableProps.d.ts +28 -40
- package/build/components/Table/TableStyles.d.ts +1 -1
- package/build/components/Table/index.d.ts +1 -1
- package/build/components/TableBody/TableBody.d.ts +4 -2
- package/build/components/TableBody/index.d.ts +1 -1
- package/build/components/TableCell/TableCell.d.ts +4 -2
- package/build/components/TableCell/index.d.ts +1 -1
- package/build/components/TableContext/index.d.ts +3 -0
- package/build/components/TableFooter/TableFooter.d.ts +4 -2
- package/build/components/TableFooter/index.d.ts +1 -1
- package/build/components/TableHeader/TableHeader.d.ts +4 -2
- package/build/components/TableHeader/index.d.ts +1 -1
- package/build/components/TableHeaderCell/TableHeaderCell.d.ts +2 -2
- package/build/components/TableHeaderCell/TableHeaderCellProps.d.ts +5 -7
- package/build/components/TableHeaderCell/TableHeaderCellStyles.d.ts +3 -1
- package/build/components/TableHeaderCell/index.d.ts +2 -1
- package/build/components/TableHeaderRow/TableHeaderRow.d.ts +4 -2
- package/build/components/TableHeaderRow/index.d.ts +1 -1
- package/build/components/TableRow/TableRow.d.ts +4 -2
- package/build/components/TableRow/index.d.ts +1 -1
- package/build/components/index.d.ts +10 -1
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/useColumnFilters.d.ts +9 -0
- package/build/index.d.ts +0 -1
- package/build/index.es.js +2560 -397
- package/build/index.es.js.map +1 -1
- package/build/index.js +2575 -396
- package/build/index.js.map +1 -1
- package/build/util/coercedValueIncludesString.d.ts +2 -0
- package/build/util/getTableMinHeight.d.ts +2 -0
- package/build/util/index.d.ts +2 -0
- package/build/util/validateRowAction.d.ts +2 -0
- package/package.json +4 -4
- package/build/components/Table/util/makeColumns.d.ts +0 -7
- package/build/components/TableActionsCell/TableActionsCell.d.ts +0 -3
- package/build/components/TableActionsCell/TableActionsCellProps.d.ts +0 -10
- package/build/components/TableActionsCell/index.d.ts +0 -2
- package/build/hooks/useManualPagination/index.d.ts +0 -1
- package/build/hooks/useManualPagination/useManualPagination.d.ts +0 -5
- package/build/hooks/useManualPagination/useManualPaginationTypes.d.ts +0 -52
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnFilter } from '@tanstack/react-table';
|
|
3
|
+
interface ColumnFilterChipProps {
|
|
4
|
+
columnFilter: ColumnFilter;
|
|
5
|
+
label: [string, string];
|
|
6
|
+
onClick: (columnFilter: ColumnFilter) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const ColumnFilterChip: (props: ColumnFilterChipProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColumnFilterChip } from './ColumnFilterChip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColumnFilterResetButton } from './ColumnFilterResetButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectFilter } from './SelectFilter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterControl } from './FilterControl';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare type ColumnFilterInput = 'text' | 'number' | 'radio' | 'select' | 'multi-select';
|
|
2
|
+
export declare type ColumnFilter = {
|
|
3
|
+
columnId: string;
|
|
4
|
+
input: ColumnFilterInput;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
options: Array<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: string | number;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Panel } from './Panel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Trigger } from './Trigger';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterPanel } from './FilterPanel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, SVGProps } from 'react';
|
|
2
|
+
import { CellContext } from '@tanstack/react-table';
|
|
3
|
+
export interface RowAction {
|
|
4
|
+
icon: FC<SVGProps<SVGSVGElement>>;
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: (props: CellContext<any, any>) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface RowActionsProps {
|
|
9
|
+
context: CellContext<any, any>;
|
|
10
|
+
actions: Array<RowAction>;
|
|
11
|
+
}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TableProps } from './TableProps';
|
|
3
|
-
|
|
3
|
+
declare const defaultTableProps: {
|
|
4
|
+
fullWidth: boolean;
|
|
5
|
+
sortable: boolean;
|
|
6
|
+
searchable: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare type DefaultTableProps = TableProps & typeof defaultTableProps;
|
|
9
|
+
export declare const Table: {
|
|
10
|
+
(props: DefaultTableProps): JSX.Element;
|
|
11
|
+
defaultProps: {
|
|
12
|
+
fullWidth: boolean;
|
|
13
|
+
sortable: boolean;
|
|
14
|
+
searchable: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -1,44 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
action: (cell: Cell) => void;
|
|
16
|
-
}>;
|
|
17
|
-
/** Styles the table to maintain the height of a fully populated page (entries in a table, not the window). */
|
|
18
|
-
fullHeight?: boolean;
|
|
19
|
-
/** Styles the table to take up its containers full width. */
|
|
1
|
+
import { Column, ColumnFiltersState, PaginationState } from '@tanstack/react-table';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export interface ColumnFilter {
|
|
4
|
+
id: string;
|
|
5
|
+
value: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface TableProps<T = unknown> {
|
|
8
|
+
/** List of objects representing the rows of a Table. */
|
|
9
|
+
data: Array<T>;
|
|
10
|
+
/** List of column definitions. */
|
|
11
|
+
columns: Array<Column<T>>;
|
|
12
|
+
/** Controls table loading state. */
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
/** Forces a table to take up the width of its container when true. */
|
|
20
15
|
fullWidth?: boolean;
|
|
21
|
-
/**
|
|
16
|
+
/** Adds a global filter to the table. for uncontrolled global filtering only. */
|
|
22
17
|
searchable?: boolean;
|
|
23
|
-
/**
|
|
18
|
+
/** Makes columns sortable. For uncontrolled sorting only. */
|
|
24
19
|
sortable?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
initialState: Partial<{
|
|
38
|
-
pageSize: number;
|
|
39
|
-
pageIndex: number;
|
|
40
|
-
}>;
|
|
41
|
-
}>;
|
|
42
|
-
/** Added to the main parameter of the useTable hook. */
|
|
43
|
-
tableOptions?: Record<string, unknown>;
|
|
20
|
+
/** Pagination state. Expects the result of a React useState hook. Used only for manual pagination. */
|
|
21
|
+
paginationState?: [PaginationState, Dispatch<SetStateAction<PaginationState>>];
|
|
22
|
+
/** GlobalFiltering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
23
|
+
globalFilterState?: [string, Dispatch<SetStateAction<string>>];
|
|
24
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
25
|
+
filterState?: [ColumnFiltersState, Dispatch<SetStateAction<Array<ColumnFilter>>>];
|
|
26
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
27
|
+
visibilityState?: [Record<string, boolean>, Dispatch<SetStateAction<Record<string, boolean>>>];
|
|
28
|
+
/** Number of pages. Used only for manual pagination. */
|
|
29
|
+
pageCount?: number;
|
|
30
|
+
/** A React Component to be rendered when the data set is empty. */
|
|
31
|
+
Empty?: () => JSX.Element;
|
|
44
32
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TableProps } from './TableProps';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useStyles: (props: TableProps<unknown>) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Table
|
|
1
|
+
export { Table } from './Table';
|
|
2
2
|
export { TableProps } from './TableProps';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type TableBodyProps = PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>;
|
|
3
|
+
export declare const TableBody: (props: TableBodyProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableBody
|
|
1
|
+
export { TableBody } from './TableBody';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type TableCellProps = PropsWithChildren<HTMLAttributes<HTMLTableCellElement>>;
|
|
3
|
+
export declare const TableCell: (props: TableCellProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableCell
|
|
1
|
+
export { TableCell } from './TableCell';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type TableFooterProps = PropsWithChildren<HTMLAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const TableFooter: (props: TableFooterProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableFooter
|
|
1
|
+
export { TableFooter } from './TableFooter';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type TableHeadProps = PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>;
|
|
3
|
+
export declare const TableHeader: (props: TableHeadProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableHeader
|
|
1
|
+
export { TableHeader } from './TableHeader';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { TableHeaderCellProps } from './TableHeaderCellProps';
|
|
3
|
-
export declare const TableHeaderCell:
|
|
3
|
+
export declare const TableHeaderCell: (props: TableHeaderCellProps) => JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
tableProps: TableProps;
|
|
1
|
+
import { HeaderContext } from '@tanstack/react-table';
|
|
2
|
+
import { PropsWithChildren, HTMLAttributes } from 'react';
|
|
3
|
+
export declare type ChildrenAndAttributes = PropsWithChildren<HTMLAttributes<HTMLTableCellElement>>;
|
|
4
|
+
export interface TableHeaderCellProps extends ChildrenAndAttributes {
|
|
5
|
+
context: HeaderContext<unknown, unknown>;
|
|
8
6
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { TableHeaderCellProps } from './TableHeaderCellProps';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useStyles: (props: TableHeaderCellProps & {
|
|
3
|
+
sortable: boolean;
|
|
4
|
+
}) => import("@material-ui/styles").ClassNameMap<string>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { TableHeaderCell
|
|
1
|
+
export { TableHeaderCell } from './TableHeaderCell';
|
|
2
|
+
export { TableHeaderCellProps } from './TableHeaderCellProps';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren, HTMLAttributes } from 'react';
|
|
2
|
+
declare type TableHaderRowProps = PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>;
|
|
3
|
+
export declare const TableHeaderRow: (props: TableHaderRowProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableHeaderRow
|
|
1
|
+
export { TableHeaderRow } from './TableHeaderRow';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type TableRowProps = PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>;
|
|
3
|
+
export declare const TableRow: (props: TableRowProps) => JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TableRow
|
|
1
|
+
export { TableRow } from './TableRow';
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Table, TableProps } from './Table';
|
|
2
|
+
export { RowActions, RowActionsProps } from './RowActions';
|
|
3
|
+
export { GlobalFilter } from './GlobalFilter';
|
|
4
|
+
export { TableBody } from './TableBody';
|
|
5
|
+
export { TableCell } from './TableCell';
|
|
6
|
+
export { TableFooter } from './TableFooter';
|
|
7
|
+
export { TableHeader } from './TableHeader';
|
|
8
|
+
export { TableHeaderCell, TableHeaderCellProps } from './TableHeaderCell';
|
|
9
|
+
export { TableHeaderRow } from './TableHeaderRow';
|
|
10
|
+
export { TableRow } from './TableRow';
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { useColumnFilters } from './useColumnFilters';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColumnFilter, Table } from '@tanstack/react-table';
|
|
2
|
+
export declare const useColumnFilters: (table: Table<unknown>) => {
|
|
3
|
+
selectedColumnFilters: ColumnFilter[];
|
|
4
|
+
columnFilters: any[];
|
|
5
|
+
hasColumnFilters: boolean;
|
|
6
|
+
deselectColumnFilter: (columnFilter: ColumnFilter) => void;
|
|
7
|
+
formatSelectedFilterText: (columnFilter: ColumnFilter) => [string, string];
|
|
8
|
+
resetColumnFilters: (defaultState?: boolean | undefined) => void;
|
|
9
|
+
};
|
package/build/index.d.ts
CHANGED