@popmenu/table 0.46.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.
Files changed (63) hide show
  1. package/build/components/ColumnFilterChip/ColumnFilterChip.d.ts +9 -0
  2. package/build/components/ColumnFilterChip/index.d.ts +1 -0
  3. package/build/components/ColumnFilterResetButton/ColumnFilterResetButton.d.ts +3 -0
  4. package/build/components/ColumnFilterResetButton/index.d.ts +1 -0
  5. package/build/components/FilterPanel/FilterControl/FilterControl.d.ts +3 -0
  6. package/build/components/FilterPanel/FilterControl/SelectFilter/SelectFilter.d.ts +5 -0
  7. package/build/components/FilterPanel/FilterControl/SelectFilter/SelectFilterStyles.d.ts +1 -0
  8. package/build/components/FilterPanel/FilterControl/SelectFilter/index.d.ts +1 -0
  9. package/build/components/FilterPanel/FilterControl/index.d.ts +1 -0
  10. package/build/components/FilterPanel/FilterPanel.d.ts +2 -0
  11. package/build/components/FilterPanel/FilterPanelProps.d.ts +11 -0
  12. package/build/components/FilterPanel/Panel/Panel.d.ts +7 -0
  13. package/build/components/FilterPanel/Panel/PanelStyles.d.ts +1 -0
  14. package/build/components/FilterPanel/Panel/index.d.ts +1 -0
  15. package/build/components/FilterPanel/Trigger/Trigger.d.ts +7 -0
  16. package/build/components/FilterPanel/Trigger/TriggerStyles.d.ts +1 -0
  17. package/build/components/FilterPanel/Trigger/index.d.ts +1 -0
  18. package/build/components/FilterPanel/index.d.ts +1 -0
  19. package/build/components/GlobalFilter/GlobalFilterStyles.d.ts +1 -0
  20. package/build/components/RowActions/RowActions.d.ts +3 -0
  21. package/build/components/RowActions/RowActionsProps.d.ts +11 -0
  22. package/build/components/RowActions/index.d.ts +2 -0
  23. package/build/components/Table/Table.d.ts +16 -2
  24. package/build/components/Table/TableProps.d.ts +28 -40
  25. package/build/components/Table/TableStyles.d.ts +1 -1
  26. package/build/components/Table/index.d.ts +1 -1
  27. package/build/components/TableBody/TableBody.d.ts +4 -2
  28. package/build/components/TableBody/index.d.ts +1 -1
  29. package/build/components/TableCell/TableCell.d.ts +4 -2
  30. package/build/components/TableCell/index.d.ts +1 -1
  31. package/build/components/TableContext/index.d.ts +3 -0
  32. package/build/components/TableFooter/TableFooter.d.ts +4 -2
  33. package/build/components/TableFooter/index.d.ts +1 -1
  34. package/build/components/TableHeader/TableHeader.d.ts +4 -2
  35. package/build/components/TableHeader/index.d.ts +1 -1
  36. package/build/components/TableHeaderCell/TableHeaderCell.d.ts +2 -2
  37. package/build/components/TableHeaderCell/TableHeaderCellProps.d.ts +5 -7
  38. package/build/components/TableHeaderCell/TableHeaderCellStyles.d.ts +3 -1
  39. package/build/components/TableHeaderCell/index.d.ts +2 -1
  40. package/build/components/TableHeaderRow/TableHeaderRow.d.ts +4 -2
  41. package/build/components/TableHeaderRow/index.d.ts +1 -1
  42. package/build/components/TableRow/TableRow.d.ts +4 -2
  43. package/build/components/TableRow/index.d.ts +1 -1
  44. package/build/components/index.d.ts +10 -1
  45. package/build/hooks/index.d.ts +1 -1
  46. package/build/hooks/useColumnFilters.d.ts +9 -0
  47. package/build/index.d.ts +0 -1
  48. package/build/index.es.js +2553 -390
  49. package/build/index.es.js.map +1 -1
  50. package/build/index.js +2576 -397
  51. package/build/index.js.map +1 -1
  52. package/build/util/coercedValueIncludesString.d.ts +2 -0
  53. package/build/util/getTableMinHeight.d.ts +2 -0
  54. package/build/util/index.d.ts +2 -0
  55. package/build/util/validateRowAction.d.ts +2 -0
  56. package/package.json +4 -4
  57. package/build/components/Table/util/makeColumns.d.ts +0 -7
  58. package/build/components/TableActionsCell/TableActionsCell.d.ts +0 -3
  59. package/build/components/TableActionsCell/TableActionsCellProps.d.ts +0 -10
  60. package/build/components/TableActionsCell/index.d.ts +0 -2
  61. package/build/hooks/useManualPagination/index.d.ts +0 -1
  62. package/build/hooks/useManualPagination/useManualPagination.d.ts +0 -5
  63. package/build/hooks/useManualPagination/useManualPaginationTypes.d.ts +0 -52
@@ -0,0 +1,2 @@
1
+ import { FilterFn } from '@tanstack/react-table';
2
+ export declare const coercedValueIncludesString: FilterFn<any>;
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare const getTableMinHeight: (rootRef: RefObject<HTMLDivElement>, pageSize: number) => number;
@@ -1 +1,3 @@
1
1
  export { tableConstants } from './tableConstants';
2
+ export { coercedValueIncludesString } from './coercedValueIncludesString';
3
+ export { getTableMinHeight } from './getTableMinHeight';
@@ -0,0 +1,2 @@
1
+ import { RowAction } from '../components/RowActions/RowActionsProps';
2
+ export declare const validateAction: (action: Partial<RowAction>) => boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popmenu/table",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "license": "MIT",
5
5
  "author": "Popmenu Design System Team",
6
6
  "description": "React components for all Popmenu apps on the web.",
@@ -24,9 +24,9 @@
24
24
  "peerDependencies": {
25
25
  "@material-ui/core": "^4.12.2",
26
26
  "@material-ui/lab": "^4.0.0-alpha.60",
27
- "react": "17.x",
28
- "react-table": "^7.7.0"
27
+ "@tanstack/react-table": "^8.7.4",
28
+ "react": "17.x"
29
29
  },
30
30
  "sideEffects": false,
31
- "gitHead": "d916d424974e2b83aa74e38973851fbab2cda638"
31
+ "gitHead": "a6eee5eee4880b5278ab49bece98d40d18000f56"
32
32
  }
@@ -1,7 +0,0 @@
1
- import { Column } from 'react-table';
2
- import { TableProps } from '../TableProps';
3
- interface MakeColumnsConfig extends Pick<TableProps, 'columns' | 'actions'> {
4
- actionColumnId: string;
5
- }
6
- export declare const makeColumns: (config: MakeColumnsConfig) => Array<Column>;
7
- export {};
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- import { TableActionsCellProps } from './TableActionsCellProps';
3
- export declare const TableActionsCell: FC<TableActionsCellProps>;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { Cell, TableInstance } from 'react-table';
3
- export interface TableActionsCellProps extends TableInstance {
4
- cell: Cell;
5
- actions: Record<string, {
6
- icon?: string | React.FC<React.SVGProps<SVGSVGElement>>;
7
- label: string;
8
- action: (cell: Cell) => void;
9
- }>;
10
- }
@@ -1,2 +0,0 @@
1
- export { TableActionsCell as default } from './TableActionsCell';
2
- export { TableActionsCellProps } from './TableActionsCellProps';
@@ -1 +0,0 @@
1
- export { useManualPagination } from './useManualPagination';
@@ -1,5 +0,0 @@
1
- import { UseManualPaginationConfig, UseManualPaginationResult } from './useManualPaginationTypes';
2
- /**
3
- * Makes props for the Table component that will enable manual pagination and also provides page state.
4
- */
5
- export declare const useManualPagination: (config: UseManualPaginationConfig) => UseManualPaginationResult;
@@ -1,52 +0,0 @@
1
- import { TableInstance } from 'react-table';
2
- interface PaginationEvent {
3
- /** Index of the page a user has selected. */
4
- index: number;
5
- /** The entire table instance by react-table. */
6
- instance: TableInstance;
7
- }
8
- export interface UseManualPaginationConfig {
9
- /** The total number of records available. */
10
- total: number;
11
- /** Sets the default page to show when the table is first presented. */
12
- initialPageIndex?: number;
13
- /** Sets the default page size to show when the table is first presented. */
14
- initialPageSize?: number;
15
- /** Callback triggered when a pagination even occurs. setPageIndex, which is the second arg of the callback,
16
- * is required to be called manually. */
17
- onPaginate?: (paginationEvent: PaginationEvent, setPageIndex: (index: number) => void) => void;
18
- }
19
- interface ManualPaginationProps {
20
- /** A callback for pagination events. Should map to the Table component's onPaginate prop */
21
- onPaginate: (index: number, instance: TableInstance) => void;
22
- /** Additional configuration for the Table component. Should map to the Table component's tableOptions prop */
23
- tableOptions: {
24
- useControlledState: (state: Record<string, unknown>) => Record<string, unknown>;
25
- };
26
- /** Additional configuration for the Table component. Should map to the Table component's paginationOptions prop */
27
- paginationOptions: {
28
- initialState: {
29
- pageIndex: number;
30
- pageSize: number;
31
- };
32
- manualPagination: boolean;
33
- pageCount: number;
34
- };
35
- }
36
- interface PageState {
37
- /** The number of rows a Table shows per page */
38
- pageSize: number;
39
- /** The page index a Table will show */
40
- pageIndex: number;
41
- /** Updates pageSize */
42
- setPageSize: (size: number) => void;
43
- /** Updates pageIndex */
44
- setPageIndex: (index: number) => void;
45
- }
46
- export interface UseManualPaginationResult {
47
- /** A collection of props for the Table component that will enable manual pagination. Apply with spread operator. */
48
- manualPaginationProps: ManualPaginationProps;
49
- /** Stateful values for controlling pages of a Table */
50
- pageState: PageState;
51
- }
52
- export {};