@popmenu/table 0.126.1 → 0.126.2
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/cjs/components/ColumnFilterChip/ColumnFilterChip.d.ts +9 -0
- package/build/cjs/components/ColumnFilterChip/ColumnFilterChipStyles.d.ts +1 -0
- package/build/cjs/components/ColumnFilterChip/index.d.ts +1 -0
- package/build/cjs/components/ColumnFilterResetButton/ColumnFilterResetButton.d.ts +3 -0
- package/build/cjs/components/ColumnFilterResetButton/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterControl/FilterControl.d.ts +3 -0
- package/build/cjs/components/FilterPanel/FilterControl/SelectFilter/SelectFilter.d.ts +5 -0
- package/build/cjs/components/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterControl/SelectFilter/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterControl/ToggleFilter/ToggleFilter.d.ts +4 -0
- package/build/cjs/components/FilterPanel/FilterControl/ToggleFilter/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterControl/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterPanel.d.ts +2 -0
- package/build/cjs/components/FilterPanel/FilterPanelContext/FilterPanelContext.d.ts +7 -0
- package/build/cjs/components/FilterPanel/FilterPanelContext/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/FilterPanelProps.d.ts +11 -0
- package/build/cjs/components/FilterPanel/Panel/Panel.d.ts +7 -0
- package/build/cjs/components/FilterPanel/Panel/PanelStyles.d.ts +1 -0
- package/build/cjs/components/FilterPanel/Panel/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/Trigger/Trigger.d.ts +7 -0
- package/build/cjs/components/FilterPanel/Trigger/TriggerStyles.d.ts +1 -0
- package/build/cjs/components/FilterPanel/Trigger/index.d.ts +1 -0
- package/build/cjs/components/FilterPanel/index.d.ts +1 -0
- package/build/cjs/components/GlobalFilter/GlobalFilter.d.ts +3 -0
- package/build/cjs/components/GlobalFilter/GlobalFilterProps.d.ts +7 -0
- package/build/cjs/components/GlobalFilter/GlobalFilterStyles.d.ts +1 -0
- package/build/cjs/components/GlobalFilter/index.d.ts +2 -0
- package/build/cjs/components/RowActions/RowActions.d.ts +3 -0
- package/build/cjs/components/RowActions/RowActionsProps.d.ts +13 -0
- package/build/cjs/components/RowActions/index.d.ts +2 -0
- package/build/cjs/components/Table/Table.d.ts +21 -0
- package/build/cjs/components/Table/TableProps.d.ts +47 -0
- package/build/cjs/components/Table/TableStyles.d.ts +2 -0
- package/build/cjs/components/Table/index.d.ts +2 -0
- package/build/cjs/components/TableBody/TableBody.d.ts +4 -0
- package/build/cjs/components/TableBody/index.d.ts +1 -0
- package/build/cjs/components/TableCell/TableCell.d.ts +4 -0
- package/build/cjs/components/TableCell/TableCellStyles.d.ts +1 -0
- package/build/cjs/components/TableCell/index.d.ts +1 -0
- package/build/cjs/components/TableContext/index.d.ts +16 -0
- package/build/cjs/components/TableControlsContainer/TableControlsContainer.d.ts +3 -0
- package/build/cjs/components/TableControlsContainer/TableControlsContainerProps.d.ts +6 -0
- package/build/cjs/components/TableControlsContainer/index.d.ts +1 -0
- package/build/cjs/components/TableFooter/TableFooter.d.ts +4 -0
- package/build/cjs/components/TableFooter/index.d.ts +1 -0
- package/build/cjs/components/TableHeader/TableHeader.d.ts +4 -0
- package/build/cjs/components/TableHeader/index.d.ts +1 -0
- package/build/cjs/components/TableHeaderCell/TableHeaderCell.d.ts +3 -0
- package/build/cjs/components/TableHeaderCell/TableHeaderCellProps.d.ts +6 -0
- package/build/cjs/components/TableHeaderCell/TableHeaderCellStyles.d.ts +4 -0
- package/build/cjs/components/TableHeaderCell/index.d.ts +2 -0
- package/build/cjs/components/TableHeaderRow/TableHeaderRow.d.ts +4 -0
- package/build/cjs/components/TableHeaderRow/index.d.ts +1 -0
- package/build/cjs/components/TableRow/TableRow.d.ts +4 -0
- package/build/cjs/components/TableRow/TableRowStyles.d.ts +1 -0
- package/build/cjs/components/TableRow/index.d.ts +1 -0
- package/build/cjs/components/index.d.ts +10 -0
- package/build/cjs/hooks/index.d.ts +2 -0
- package/build/cjs/hooks/useColumnFilters.d.ts +9 -0
- package/build/cjs/hooks/useStagedColumnFilters.d.ts +8 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/{index.js → cjs/index.js} +3 -659
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/util/coercedValueIncludesString.d.ts +2 -0
- package/build/cjs/util/getTableMinHeight.d.ts +2 -0
- package/build/cjs/util/index.d.ts +3 -0
- package/build/cjs/util/tableConstants.d.ts +5 -0
- package/build/cjs/util/validateRowAction.d.ts +2 -0
- package/build/esm/components/GlobalFilter/GlobalFilterProps.d.ts +1 -1
- package/build/esm/components/TableHeaderCell/TableHeaderCell.js +5 -4
- package/build/esm/components/TableHeaderCell/TableHeaderCell.js.map +1 -1
- package/package.json +3 -3
- package/build/esm/_virtual/_commonjsHelpers.js +0 -4
- package/build/esm/_virtual/_commonjsHelpers.js.map +0 -1
- package/build/esm/node_modules/lodash/_Symbol.js +0 -11
- package/build/esm/node_modules/lodash/_Symbol.js.map +0 -1
- package/build/esm/node_modules/lodash/_arrayMap.js +0 -25
- package/build/esm/node_modules/lodash/_arrayMap.js.map +0 -1
- package/build/esm/node_modules/lodash/_arrayReduce.js +0 -30
- package/build/esm/node_modules/lodash/_arrayReduce.js.map +0 -1
- package/build/esm/node_modules/lodash/_asciiWords.js +0 -19
- package/build/esm/node_modules/lodash/_asciiWords.js.map +0 -1
- package/build/esm/node_modules/lodash/_baseGetTag.js +0 -35
- package/build/esm/node_modules/lodash/_baseGetTag.js.map +0 -1
- package/build/esm/node_modules/lodash/_basePropertyOf.js +0 -18
- package/build/esm/node_modules/lodash/_basePropertyOf.js.map +0 -1
- package/build/esm/node_modules/lodash/_baseToString.js +0 -42
- package/build/esm/node_modules/lodash/_baseToString.js.map +0 -1
- package/build/esm/node_modules/lodash/_createCompounder.js +0 -31
- package/build/esm/node_modules/lodash/_createCompounder.js.map +0 -1
- package/build/esm/node_modules/lodash/_deburrLetter.js +0 -76
- package/build/esm/node_modules/lodash/_deburrLetter.js.map +0 -1
- package/build/esm/node_modules/lodash/_freeGlobal.js +0 -10
- package/build/esm/node_modules/lodash/_freeGlobal.js.map +0 -1
- package/build/esm/node_modules/lodash/_getRawTag.js +0 -51
- package/build/esm/node_modules/lodash/_getRawTag.js.map +0 -1
- package/build/esm/node_modules/lodash/_hasUnicodeWord.js +0 -19
- package/build/esm/node_modules/lodash/_hasUnicodeWord.js.map +0 -1
- package/build/esm/node_modules/lodash/_objectToString.js +0 -26
- package/build/esm/node_modules/lodash/_objectToString.js.map +0 -1
- package/build/esm/node_modules/lodash/_root.js +0 -14
- package/build/esm/node_modules/lodash/_root.js.map +0 -1
- package/build/esm/node_modules/lodash/_unicodeWords.js +0 -73
- package/build/esm/node_modules/lodash/_unicodeWords.js.map +0 -1
- package/build/esm/node_modules/lodash/deburr.js +0 -51
- package/build/esm/node_modules/lodash/deburr.js.map +0 -1
- package/build/esm/node_modules/lodash/isArray.js +0 -30
- package/build/esm/node_modules/lodash/isArray.js.map +0 -1
- package/build/esm/node_modules/lodash/isObjectLike.js +0 -33
- package/build/esm/node_modules/lodash/isObjectLike.js.map +0 -1
- package/build/esm/node_modules/lodash/isSymbol.js +0 -35
- package/build/esm/node_modules/lodash/isSymbol.js.map +0 -1
- package/build/esm/node_modules/lodash/kebabCase.js +0 -33
- package/build/esm/node_modules/lodash/kebabCase.js.map +0 -1
- package/build/esm/node_modules/lodash/toString.js +0 -33
- package/build/esm/node_modules/lodash/toString.js.map +0 -1
- package/build/esm/node_modules/lodash/words.js +0 -43
- package/build/esm/node_modules/lodash/words.js.map +0 -1
- package/build/index.js.map +0 -1
|
@@ -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 declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"label" | "chip">;
|
|
@@ -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 { ToggleFilter } from './ToggleFilter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterControl } from './FilterControl';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type FilterPanelContextValue = {
|
|
3
|
+
anchorState: [Element | null, React.Dispatch<React.SetStateAction<Element | null>>];
|
|
4
|
+
};
|
|
5
|
+
export declare const FilterPanelContext: React.Context<FilterPanelContextValue | null>;
|
|
6
|
+
export declare const useFilterPanelContext: () => FilterPanelContextValue;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FilterPanelContext, useFilterPanelContext } from './FilterPanelContext';
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { OutlinedTextFieldProps } from '@material-ui/core';
|
|
2
|
+
export interface GlobalFilterProps extends Omit<OutlinedTextFieldProps, 'variant'> {
|
|
3
|
+
/** the value of global filter from table instance */
|
|
4
|
+
value: string;
|
|
5
|
+
/** the setter for value of global filter from table instance */
|
|
6
|
+
setValue: (value: string) => void;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
/** Expects cellContext from react-table and is passed through to action components */
|
|
10
|
+
context: CellContext<any, any>;
|
|
11
|
+
/** List of actions for a given row */
|
|
12
|
+
actions: Array<RowAction>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TableProps } from './TableProps';
|
|
3
|
+
declare const defaultTableProps: {
|
|
4
|
+
enableSortingRemoval: boolean;
|
|
5
|
+
fullWidth: boolean;
|
|
6
|
+
paginated: boolean;
|
|
7
|
+
sortable: boolean;
|
|
8
|
+
searchable: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare type DefaultTableProps<T> = TableProps<T> & typeof defaultTableProps;
|
|
11
|
+
export declare const Table: {
|
|
12
|
+
<T>(props: DefaultTableProps<T>): JSX.Element;
|
|
13
|
+
defaultProps: {
|
|
14
|
+
enableSortingRemoval: boolean;
|
|
15
|
+
fullWidth: boolean;
|
|
16
|
+
paginated: boolean;
|
|
17
|
+
sortable: boolean;
|
|
18
|
+
searchable: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { TextFieldProps } from '@material-ui/core';
|
|
2
|
+
import { ColumnDef, ColumnFiltersState, PaginationState, SortingState } from '@tanstack/react-table';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
|
+
export interface ColumnFilter {
|
|
5
|
+
id: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface TableProps<T = unknown> {
|
|
9
|
+
/** The table's title. */
|
|
10
|
+
title?: string;
|
|
11
|
+
/** List of objects representing the rows of a Table. */
|
|
12
|
+
data: Array<T>;
|
|
13
|
+
/** List of column definitions. */
|
|
14
|
+
columns: Array<ColumnDef<T, any>>;
|
|
15
|
+
/** Change column sorting change pattern - true: 'none' -> 'desc' -> 'asc' -> 'none' -> ..., false: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... */
|
|
16
|
+
enableSortingRemoval?: boolean;
|
|
17
|
+
/** Controls table loading state. */
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/** Forces a table to take up the width of its container when true. */
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
/** Adds a global filter to the table. for uncontrolled global filtering only. */
|
|
22
|
+
searchable?: boolean;
|
|
23
|
+
/** Makes columns sortable. For uncontrolled sorting only. */
|
|
24
|
+
sortable?: boolean;
|
|
25
|
+
/** Enables and disables pagination all together for the table. */
|
|
26
|
+
paginated?: boolean;
|
|
27
|
+
/** Sorting state. Expects the result of a React useState hook. Used only for manual sorting. */
|
|
28
|
+
sortingState?: [SortingState, Dispatch<SetStateAction<SortingState>>];
|
|
29
|
+
/** Pagination state. Expects the result of a React useState hook. Used only for manual pagination. */
|
|
30
|
+
paginationState?: [PaginationState, Dispatch<SetStateAction<PaginationState>>];
|
|
31
|
+
/** GlobalFiltering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
32
|
+
globalFilterState?: [string, Dispatch<SetStateAction<string>>];
|
|
33
|
+
/** Props applied to the TextField for global filtering. */
|
|
34
|
+
GlobalFilterProps?: TextFieldProps;
|
|
35
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
36
|
+
filterState?: [ColumnFiltersState, Dispatch<SetStateAction<Array<ColumnFilter>>>];
|
|
37
|
+
/** Filtering state. Expects the result of a React useState hook. Used only for manual filtering. */
|
|
38
|
+
visibilityState?: [Record<string, boolean>, Dispatch<SetStateAction<Record<string, boolean>>>];
|
|
39
|
+
/** Number of pages. Used only for manual pagination. */
|
|
40
|
+
pageCount?: number;
|
|
41
|
+
/** A React Component to be rendered when the data set is empty. */
|
|
42
|
+
Empty?: () => JSX.Element;
|
|
43
|
+
/** A string used to construct ids and tags used throughout the table for tagging inner elements. ie: data-tour-id. */
|
|
44
|
+
idBase?: string;
|
|
45
|
+
/** Controls which filter should be used for the application, automatic or manual. */
|
|
46
|
+
stageFilterSelections?: boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableBody } from './TableBody';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTableCellStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableCell } from './TableCell';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnFilter, Table } from '@tanstack/react-table';
|
|
3
|
+
export declare type StagedColumnFilter = {
|
|
4
|
+
update: (columnId: string, value: string | Array<string>) => void;
|
|
5
|
+
get: (columnId: string) => string | Array<string> | undefined;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
delete: (columnFilter: ColumnFilter) => void;
|
|
8
|
+
exist: () => boolean;
|
|
9
|
+
};
|
|
10
|
+
declare type TabelContextValue = {
|
|
11
|
+
table: Table<any>;
|
|
12
|
+
stagedColumnFilters: StagedColumnFilter;
|
|
13
|
+
stageFilterSelections: boolean | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const TableContext: import("react").Context<TabelContextValue>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableControlsContainer } from './TableControlsContainer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableFooter } from './TableFooter';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableHeader } from './TableHeader';
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableHeaderRow } from './TableHeaderRow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useTableRowStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"root">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableRow } from './TableRow';
|
|
@@ -0,0 +1,10 @@
|
|
|
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';
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColumnFilter } from '@tanstack/react-table';
|
|
2
|
+
export declare const useStagedColumnFilters: (selectedColumnFilters: ColumnFilter[]) => {
|
|
3
|
+
update: (columnId: string, value: string | Array<string>) => void;
|
|
4
|
+
get: (columnId: string) => string | string[] | undefined;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
delete: (columnFilter: ColumnFilter) => void;
|
|
7
|
+
exist: () => boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|