@redis-ui/table 2.18.0 → 2.23.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.
Files changed (83) hide show
  1. package/dist/Table/Table.cjs +30 -4
  2. package/dist/Table/Table.context.d.ts +1 -0
  3. package/dist/Table/Table.d.ts +26 -21
  4. package/dist/Table/Table.js +30 -4
  5. package/dist/Table/Table.style.cjs +37 -9
  6. package/dist/Table/Table.style.d.ts +277 -5
  7. package/dist/Table/Table.style.js +37 -9
  8. package/dist/Table/Table.types.d.ts +3 -1
  9. package/dist/Table/components/Compose/Compose.cjs +4 -1
  10. package/dist/Table/components/Compose/Compose.d.ts +1 -1
  11. package/dist/Table/components/Compose/Compose.js +4 -1
  12. package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.cjs +20 -0
  13. package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.d.ts +8 -0
  14. package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.js +20 -0
  15. package/dist/Table/components/ExpandRowButton/ExpandAllRowsButton.test.d.ts +1 -0
  16. package/dist/Table/components/ExpandRowButton/useExpanderColumn.cjs +19 -0
  17. package/dist/Table/components/ExpandRowButton/useExpanderColumn.d.ts +6 -0
  18. package/dist/Table/components/ExpandRowButton/useExpanderColumn.js +19 -0
  19. package/dist/Table/components/ExpandRowButton/useExpanderColumn.test.d.ts +1 -0
  20. package/dist/Table/components/PluggableTable/compositionComponents.d.ts +6 -6
  21. package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.cjs +1 -0
  22. package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.d.ts +1 -1
  23. package/dist/Table/components/RowSelection/HeaderMultiRowSelectionButton.js +1 -0
  24. package/dist/Table/components/RowSelection/useRowSelectionColumn.cjs +26 -0
  25. package/dist/Table/components/RowSelection/useRowSelectionColumn.d.ts +8 -0
  26. package/dist/Table/components/RowSelection/useRowSelectionColumn.js +26 -0
  27. package/dist/Table/components/RowSelection/useRowSelectionColumn.test.d.ts +1 -0
  28. package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.cjs +3 -1
  29. package/dist/Table/components/ShowOnRowHover/ShowOnRowHover.style.js +3 -1
  30. package/dist/Table/components/TableBody/TableBody.d.ts +1 -1
  31. package/dist/Table/components/TableBody/components/Compose/Compose.cjs +2 -3
  32. package/dist/Table/components/TableBody/components/Compose/Compose.js +2 -3
  33. package/dist/Table/components/TableBodyCell/TableBodyCell.cjs +1 -5
  34. package/dist/Table/components/TableBodyCell/TableBodyCell.d.ts +4 -7
  35. package/dist/Table/components/TableBodyCell/TableBodyCell.js +1 -5
  36. package/dist/Table/components/TableBodyCell/components/Compose/Compose.cjs +21 -1
  37. package/dist/Table/components/TableBodyCell/components/Compose/Compose.d.ts +8 -2
  38. package/dist/Table/components/TableBodyCell/components/Compose/Compose.js +21 -1
  39. package/dist/Table/components/TableBodyCell/components/Compose/Compose.test.d.ts +1 -0
  40. package/dist/Table/components/TableBodyRow/TableBodyRow.cjs +12 -2
  41. package/dist/Table/components/TableBodyRow/TableBodyRow.d.ts +3 -3
  42. package/dist/Table/components/TableBodyRow/TableBodyRow.js +12 -2
  43. package/dist/Table/components/TableBodyRow/components/Compose/Compose.d.ts +2 -1
  44. package/dist/Table/components/TableHeader/TableHeader.d.ts +3 -3
  45. package/dist/Table/components/TableHeader/components/Compose/Compose.d.ts +2 -1
  46. package/dist/Table/components/TableHeaderCell/SRSortingNotification.cjs +4 -5
  47. package/dist/Table/components/TableHeaderCell/SRSortingNotification.d.ts +1 -1
  48. package/dist/Table/components/TableHeaderCell/SRSortingNotification.js +4 -5
  49. package/dist/Table/components/TableHeaderCell/TableHeaderCell.cjs +2 -6
  50. package/dist/Table/components/TableHeaderCell/TableHeaderCell.d.ts +2 -2
  51. package/dist/Table/components/TableHeaderCell/TableHeaderCell.js +2 -6
  52. package/dist/Table/components/TableHeaderCell/components/Compose/Compose.cjs +13 -5
  53. package/dist/Table/components/TableHeaderCell/components/Compose/Compose.js +13 -5
  54. package/dist/Table/components/TableHeaderCell/components/Compose/Compose.test.d.ts +1 -0
  55. package/dist/Table/components/TableHeaderCell/components/Heading/Heading.cjs +6 -5
  56. package/dist/Table/components/TableHeaderCell/components/Heading/Heading.js +7 -6
  57. package/dist/Table/components/TableHeaderCell/components/SortableHeading/SortableHeading.d.ts +1 -1
  58. package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.cjs +1 -0
  59. package/dist/Table/components/TableHeaderCell/components/SortableHeading/components/Compose/Compose.js +1 -0
  60. package/dist/Table/components/TablePagination/TablePagination.cjs +4 -2
  61. package/dist/Table/components/TablePagination/TablePagination.js +4 -2
  62. package/dist/Table/components/TableRoot/TableRoot.cjs +9 -1
  63. package/dist/Table/components/TableRoot/TableRoot.d.ts +2 -1
  64. package/dist/Table/components/TableRoot/TableRoot.js +9 -1
  65. package/dist/Table/plugins/ExpandableRowPlugin.cjs +11 -5
  66. package/dist/Table/plugins/ExpandableRowPlugin.d.ts +7 -1
  67. package/dist/Table/plugins/ExpandableRowPlugin.js +11 -5
  68. package/dist/Table/plugins/PaginationPlugin.cjs +2 -0
  69. package/dist/Table/plugins/PaginationPlugin.d.ts +2 -1
  70. package/dist/Table/plugins/PaginationPlugin.js +2 -0
  71. package/dist/Table/plugins/RowNavigationPlugin.cjs +139 -0
  72. package/dist/Table/plugins/RowNavigationPlugin.d.ts +44 -0
  73. package/dist/Table/plugins/RowNavigationPlugin.js +139 -0
  74. package/dist/Table/plugins/SortingPlugin.cjs +1 -1
  75. package/dist/Table/plugins/SortingPlugin.d.ts +1 -1
  76. package/dist/Table/plugins/SortingPlugin.js +1 -1
  77. package/dist/Table/tanStackExtendedTypes.d.ts +9 -0
  78. package/dist/Table/utils/plugin.utils.d.ts +1 -1
  79. package/dist/Table/utils/table.utils.cjs +13 -0
  80. package/dist/Table/utils/table.utils.d.ts +2 -0
  81. package/dist/Table/utils/table.utils.js +13 -0
  82. package/dist/Table/utils/table.utils.test.d.ts +1 -0
  83. package/package.json +5 -5
@@ -14,6 +14,11 @@ const ClickableRowPlugin = require("./plugins/ClickableRowPlugin.cjs");
14
14
  const Table_context = require("./Table.context.cjs");
15
15
  const PluggableTable = require("./components/PluggableTable/PluggableTable.cjs");
16
16
  const compositionComponents = require("./components/PluggableTable/compositionComponents.cjs");
17
+ const RowNavigationPlugin = require("./plugins/RowNavigationPlugin.cjs");
18
+ const ShowOnRowHover_style = require("./components/ShowOnRowHover/ShowOnRowHover.style.cjs");
19
+ const ExpandAllRowsButton = require("./components/ExpandRowButton/ExpandAllRowsButton.cjs");
20
+ const useExpanderColumn = require("./components/ExpandRowButton/useExpanderColumn.cjs");
21
+ const useRowSelectionColumn = require("./components/RowSelection/useRowSelectionColumn.cjs");
17
22
  const Table = Object.assign(({
18
23
  columns,
19
24
  caption,
@@ -22,6 +27,7 @@ const Table = Object.assign(({
22
27
  getRowId,
23
28
  emptyState,
24
29
  maxHeight,
30
+ minWidth,
25
31
  stripedRows = false,
26
32
  // sorting
27
33
  enableSorting,
@@ -30,16 +36,19 @@ const Table = Object.assign(({
30
36
  sorting,
31
37
  manualSorting,
32
38
  // row expansion
39
+ defaultExpanded,
33
40
  getIsRowExpandable,
34
41
  renderExpandedRow,
35
42
  expandRowOnClick,
36
43
  expandedRowComponent,
44
+ getSubRows,
37
45
  // pagination
38
46
  pagination,
39
47
  defaultPagination,
40
48
  onPaginationChange,
41
49
  manualPagination,
42
50
  totalRowCount,
51
+ totalPageCount,
43
52
  pageSizes,
44
53
  paginationEnabled,
45
54
  // row selection
@@ -47,7 +56,9 @@ const Table = Object.assign(({
47
56
  defaultRowSelection,
48
57
  onRowSelectionChange,
49
58
  rowSelectionMode,
50
- getRowCanSelect
59
+ getRowCanSelect,
60
+ // row navigation
61
+ enableRowNavigation = false
51
62
  }) => {
52
63
  const clickableRowPluginData = ClickableRowPlugin.useClickableRowPlugin({
53
64
  onRowClick: onRowClick && ((row) => onRowClick(row.original)),
@@ -66,14 +77,20 @@ const Table = Object.assign(({
66
77
  onPaginationChange,
67
78
  manualPagination,
68
79
  totalRowCount,
80
+ totalPageCount,
69
81
  pageSizes,
70
82
  paginationEnabled
71
83
  });
72
84
  const expandableRowPluginData = ExpandableRowPlugin.useExpandableRowPlugin({
85
+ defaultExpanded,
73
86
  expandRowOnClick,
74
- getRowCanExpand: getIsRowExpandable && ((row) => getIsRowExpandable(row.original)),
87
+ getRowCanExpand: getIsRowExpandable && ((row) => {
88
+ var _a;
89
+ return getIsRowExpandable(row.original) && (!getSubRows || !!((_a = getSubRows(row.original, row.index)) == null ? void 0 : _a.length));
90
+ }),
75
91
  renderExpandedRow,
76
- expandedRowComponent
92
+ expandedRowComponent,
93
+ getSubRows
77
94
  });
78
95
  const rowSelectionPluginData = RowSelectionPlugin.useRowSelectionPlugin({
79
96
  rowSelection,
@@ -82,11 +99,15 @@ const Table = Object.assign(({
82
99
  rowSelectionMode,
83
100
  getRowCanSelect
84
101
  });
102
+ const rowNavigationPluginData = RowNavigationPlugin.useRowNavigationPlugin({
103
+ enableRowNavigation
104
+ });
85
105
  return jsxRuntime.jsxRuntimeExports.jsx(Table.PluggableTable, {
86
106
  ...{
87
107
  data,
88
108
  columns,
89
109
  maxHeight,
110
+ minWidth,
90
111
  stripedRows,
91
112
  caption,
92
113
  emptyStateRender: emptyState
@@ -94,20 +115,25 @@ const Table = Object.assign(({
94
115
  tableOptions: {
95
116
  getRowId
96
117
  },
97
- pluginsData: [clickableRowPluginData, sortingPluginData, paginationPluginData, expandableRowPluginData, rowSelectionPluginData]
118
+ pluginsData: [clickableRowPluginData, sortingPluginData, paginationPluginData, expandableRowPluginData, rowSelectionPluginData, rowNavigationPluginData]
98
119
  });
99
120
  }, {
100
121
  ExpandRowButton: ExpandRowButton.ExpandRowButton,
122
+ ExpandAllRowsButton: ExpandAllRowsButton.ExpandAllRowsButton,
123
+ useExpanderColumn: useExpanderColumn.useExpanderColumn,
101
124
  ExpandedRow: TableExpandedRow.TableExpandedRow,
102
125
  AnimatedExpandedRow: TableAnimatedExpandedRow.TableAnimatedExpandedRow,
103
126
  RowSelectionButton: RowSelectionButton.RowSelectionButton,
104
127
  HeaderMultiRowSelectionButton: HeaderMultiRowSelectionButton.HeaderMultiRowSelectionButton,
128
+ useRowSelectionColumn: useRowSelectionColumn.useRowSelectionColumn,
129
+ ShowOnActiveRow: ShowOnRowHover_style.ShowOnRowHover,
105
130
  // plugins
106
131
  useClickableRowPlugin: ClickableRowPlugin.useClickableRowPlugin,
107
132
  useSortingPlugin: SortingPlugin.useSortingPlugin,
108
133
  usePaginationPlugin: PaginationPlugin.usePaginationPlugin,
109
134
  useExpandableRowPlugin: ExpandableRowPlugin.useExpandableRowPlugin,
110
135
  useRowSelectionPlugin: RowSelectionPlugin.useRowSelectionPlugin,
136
+ useRowNavigationPlugin: RowNavigationPlugin.useRowNavigationPlugin,
111
137
  // contexts
112
138
  useTableContext: Table_context.useTableContext,
113
139
  useComposeContext: Table_context.useComposeContext,
@@ -13,6 +13,7 @@ export type CompositionContextProps<T extends object> = {
13
13
  export type TableMainContextProps = {
14
14
  stripedRows?: boolean;
15
15
  maxHeight?: string;
16
+ minWidth?: string;
16
17
  };
17
18
  export type TableContextProps<T extends object> = TableMainContextProps & {
18
19
  table: Table<T>;
@@ -2,21 +2,21 @@
2
2
  import './tanStackExtendedTypes';
3
3
  import type { Row } from '@tanstack/react-table';
4
4
  import { TableProps } from './Table.types';
5
- declare const Table: (<T extends object>({ columns, caption, onRowClick, data, getRowId, emptyState, maxHeight, stripedRows, enableSorting, defaultSorting, onSortingChange, sorting, manualSorting, getIsRowExpandable, renderExpandedRow, expandRowOnClick, expandedRowComponent, pagination, defaultPagination, onPaginationChange, manualPagination, totalRowCount, pageSizes, paginationEnabled, rowSelection, defaultRowSelection, onRowSelectionChange, rowSelectionMode, getRowCanSelect }: TableProps<T>) => import("react/jsx-runtime").JSX.Element) & {
6
- Compose: <T_1 extends object>({ data, columns, pluginsData, tableOptions, components, maxHeight, stripedRows, ...restProps }: import("./components/Compose/Compose").TableComposeProps<T_1>) => import("react/jsx-runtime").JSX.Element;
7
- Root: import("styled-components").StyledComponent<"table", any, {}, never>;
5
+ declare const Table: (<T extends object>({ columns, caption, onRowClick, data, getRowId, emptyState, maxHeight, minWidth, stripedRows, enableSorting, defaultSorting, onSortingChange, sorting, manualSorting, defaultExpanded, getIsRowExpandable, renderExpandedRow, expandRowOnClick, expandedRowComponent, getSubRows, pagination, defaultPagination, onPaginationChange, manualPagination, totalRowCount, totalPageCount, pageSizes, paginationEnabled, rowSelection, defaultRowSelection, onRowSelectionChange, rowSelectionMode, getRowCanSelect, enableRowNavigation }: TableProps<T>) => import("react/jsx-runtime").JSX.Element) & {
6
+ Compose: <T_1 extends object>({ data, columns, pluginsData, tableOptions, components, maxHeight, minWidth, stripedRows, ...restProps }: import("./components/Compose/Compose").TableComposeProps<T_1>) => import("react/jsx-runtime").JSX.Element;
7
+ Root: (props: import("react").HTMLAttributes<HTMLTableElement>) => import("react/jsx-runtime").JSX.Element;
8
8
  SRCaption: ({ caption }: {
9
9
  caption?: string | undefined;
10
10
  }) => import("react/jsx-runtime").JSX.Element | null;
11
11
  Header: (<T_2 extends object>(props: import("./components/TableHeader/TableHeader").RestTableHeaderProps) => import("react/jsx-runtime").JSX.Element) & {
12
- Compose: import("styled-components").StyledComponent<"thead", any, {}, never>;
12
+ Compose: import("react").FC<import("./components/TableHeader/components/Compose/Compose").TableHeaderComposeProps>;
13
13
  Row: (<T_3 extends object>(props: import("./components/TableHeaderRow/TableHeaderRow").OwnTableHeaderRowProps<T_3> & import("./components/TableHeaderRow/TableHeaderRow").RestTableHeaderRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null) & {
14
14
  Compose: import("styled-components").StyledComponent<"tr", any, {}, never>;
15
15
  };
16
16
  Cell: (<T_4 extends object>(props: import("./components/TableHeaderCell/TableHeaderCell").OwnTableHeaderCellProps<T_4> & import("./components/TableHeaderCell/TableHeaderCell").RestTableHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
17
17
  Compose: <T_5 extends object>(props: import("./components/TableHeaderCell/components/Compose/Compose").OwnTableHeaderCellComposeProps<T_5> & import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "content" | "children"> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
18
- SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element) & {
19
- Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element) & {
18
+ SortableHeading: (({ children, ...restProps }: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
19
+ Compose: ((props: import("@redislabsdev/redis-ui-components").ComposeElementProps<HTMLElement>) => import("react/jsx-runtime").JSX.Element) & {
20
20
  SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
21
21
  };
22
22
  SortIndicator: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
@@ -40,7 +40,7 @@ declare const Table: (<T extends object>({ columns, caption, onRowClick, data, g
40
40
  };
41
41
  ExpandableRow: <T_9 extends object>(props: import("./components/TableBodyRow/TableBodyRow").OwnTableBodyRowProps<T_9> & import("./components/TableBodyRow/TableBodyRow").RestTableBodyRowProps & import("react").RefAttributes<HTMLTableRowElement>) => import("react").ReactElement<any, any> | null;
42
42
  Cell: (<T_10 extends object>(props: import("./components/TableBodyCell/TableBodyCell").OwnTableBodyCellProps<T_10> & import("./components/TableBodyCell/TableBodyCell").RestTableBodyCellProps & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null) & {
43
- Compose: import("styled-components").StyledComponent<"td", any, {}, never>;
43
+ Compose: <T_11 extends object>(props: import("@redislabsdev/redis-ui-components").ComposeChildrenProps & Omit<import("react").HTMLAttributes<HTMLTableCellElement>, "content" | "children"> & import("./components/TableBodyCell/components/Compose/Compose").OwnTableBodyCellComposeProps<T_11> & import("react").RefAttributes<HTMLTableCellElement>) => import("react").ReactElement<any, any> | null;
44
44
  };
45
45
  };
46
46
  Pagination: (() => import("react/jsx-runtime").JSX.Element | null) & {
@@ -67,21 +67,26 @@ declare const Table: (<T extends object>({ columns, caption, onRowClick, data, g
67
67
  };
68
68
  SRSortingNotification: typeof import("./components/TableHeaderCell/SRSortingNotification").SRSortingNotification;
69
69
  ExpandRowButton: ({ row, expandedIcon, collapsedIcon, ...restProps }: import("./components/ExpandRowButton/ExpandRowButton").ExpandRowButtonProps) => import("react/jsx-runtime").JSX.Element | null;
70
- ExpandedRow: <T_11 extends object>({ row, keepInDom, rowRef, ...restProps }: import("./components/TableExpandedRow").TableExpandedRowProps<T_11>) => import("react/jsx-runtime").JSX.Element | null;
71
- AnimatedExpandedRow: <T_12 extends object>({ rowRef, ...restProps }: import("./components/TableExpandedRow").TableExpandedRowProps<T_12>) => import("react/jsx-runtime").JSX.Element;
72
- RowSelectionButton: <T_13 extends object>({ row, ...restProps }: import("./components/RowSelection/RowSelectionButton").RowSelectionButtonProps<T_13>) => import("react/jsx-runtime").JSX.Element;
73
- HeaderMultiRowSelectionButton: <T_14 extends object>({ table, managePage, ...restProps }: import("./components/RowSelection/HeaderMultiRowSelectionButton").HeaderMultiRowSelectionButtonProps<T_14>) => import("react/jsx-runtime").JSX.Element;
74
- useClickableRowPlugin: <T_15 extends object>({ getCanRowClick, onRowClick, shouldClickOnEnter }: Partial<import("./plugins/ClickableRowPlugin").TableClickableRowContext<T_15>>) => import(".").TablePluginData<T_15>;
75
- useSortingPlugin: <T_16 extends object>({ defaultSorting, onSortingChange, sorting, manualSorting, enableSorting }: import("./plugins/SortingPlugin").TableSortingParams) => import(".").TablePluginData<T_16>;
76
- usePaginationPlugin: <T_17 extends object>({ pagination, defaultPagination, onPaginationChange, manualPagination, totalRowCount, pageSizes, paginationEnabled }: import("./plugins/PaginationPlugin").TablePaginationParams) => import(".").TablePluginData<T_17>;
77
- useExpandableRowPlugin: <T_18 extends object>({ getRowCanExpand, renderExpandedRow, expandRowOnClick, expandedRowComponent }: import("./plugins/ExpandableRowPlugin").TableExpandableRowParams<T_18>) => import(".").TablePluginData<T_18>;
78
- useRowSelectionPlugin: <T_19 extends object>({ rowSelection, defaultRowSelection, onRowSelectionChange, rowSelectionMode, getRowCanSelect }: import("./plugins/RowSelectionPlugin").TableRowSelectionParams<T_19>) => import(".").TablePluginData<T_19>;
79
- useTableContext: <T_20 extends object = object>() => import("./Table.context").TableContextProps<T_20>;
80
- useComposeContext: <T_21 extends object, C extends import("./Table.context").CompositionContextProps<T_21> = import("./Table.context").CompositionContextProps<T_21>>(defaults: Partial<C>) => C;
81
- useClickableRowContext: <T_22 extends object>() => import("./plugins/ClickableRowPlugin").TableClickableRowContext<T_22> | undefined;
82
- useExpandableRowContext: <T_23 extends object>() => import("./plugins/ExpandableRowPlugin").TableExpandableRowContext<T_23> | undefined;
70
+ ExpandAllRowsButton: ({ table, expandedIcon, collapsedIcon, ...restProps }: import("./components/ExpandRowButton/ExpandAllRowsButton").ExpandAllRowsButtonProps) => import("react/jsx-runtime").JSX.Element | null;
71
+ useExpanderColumn: <T_12 extends object>({ allowExpandAll, ...colDef }?: import("./components/ExpandRowButton/useExpanderColumn").UseExpanderColumnParams<T_12>) => import("@tanstack/react-table").ColumnDef<T_12, unknown>;
72
+ ExpandedRow: <T_13 extends object>({ row, keepInDom, rowRef, ...restProps }: import("./components/TableExpandedRow").TableExpandedRowProps<T_13>) => import("react/jsx-runtime").JSX.Element | null;
73
+ AnimatedExpandedRow: <T_14 extends object>({ rowRef, ...restProps }: import("./components/TableExpandedRow").TableExpandedRowProps<T_14>) => import("react/jsx-runtime").JSX.Element;
74
+ RowSelectionButton: <T_15 extends object>({ row, ...restProps }: import("./components/RowSelection/RowSelectionButton").RowSelectionButtonProps<T_15>) => import("react/jsx-runtime").JSX.Element;
75
+ HeaderMultiRowSelectionButton: <T_16 extends object>({ table, managePage, ...restProps }: import("./components/RowSelection/HeaderMultiRowSelectionButton").HeaderMultiRowSelectionButtonProps<T_16>) => import("react/jsx-runtime").JSX.Element | null;
76
+ useRowSelectionColumn: <T_17 extends object>({ disableSelectAll, managePage, ...colDef }?: import("./components/RowSelection/useRowSelectionColumn").UseRowSelectionColumnParams<T_17>) => import("@tanstack/react-table").ColumnDef<T_17, unknown>;
77
+ ShowOnActiveRow: import("styled-components").StyledComponent<"div", any, {}, never>;
78
+ useClickableRowPlugin: <T_18 extends object>({ getCanRowClick, onRowClick, shouldClickOnEnter }: Partial<import("./plugins/ClickableRowPlugin").TableClickableRowContext<T_18>>) => import(".").TablePluginData<T_18>;
79
+ useSortingPlugin: <T_19 extends object>({ defaultSorting, onSortingChange, sorting, manualSorting, enableSorting }?: import("./plugins/SortingPlugin").TableSortingParams) => import(".").TablePluginData<T_19>;
80
+ usePaginationPlugin: <T_20 extends object>({ pagination, defaultPagination, onPaginationChange, manualPagination, totalRowCount, totalPageCount, pageSizes, paginationEnabled }: import("./plugins/PaginationPlugin").TablePaginationParams) => import(".").TablePluginData<T_20>;
81
+ useExpandableRowPlugin: <T_21 extends object>({ defaultExpanded, getRowCanExpand, renderExpandedRow, expandRowOnClick, expandedRowComponent, getSubRows }: import("./plugins/ExpandableRowPlugin").TableExpandableRowParams<T_21>) => import(".").TablePluginData<T_21>;
82
+ useRowSelectionPlugin: <T_22 extends object>({ rowSelection, defaultRowSelection, onRowSelectionChange, rowSelectionMode, getRowCanSelect }: import("./plugins/RowSelectionPlugin").TableRowSelectionParams<T_22>) => import(".").TablePluginData<T_22>;
83
+ useRowNavigationPlugin: <T_23 extends object>({ enableRowNavigation }: import("./plugins/RowNavigationPlugin").TableRowNavigationParams) => import(".").TablePluginData<T_23>;
84
+ useTableContext: <T_24 extends object = object>() => import("./Table.context").TableContextProps<T_24>;
85
+ useComposeContext: <T_25 extends object, C extends import("./Table.context").CompositionContextProps<T_25> = import("./Table.context").CompositionContextProps<T_25>>(defaults: Partial<C>) => C;
86
+ useClickableRowContext: <T_26 extends object>() => import("./plugins/ClickableRowPlugin").TableClickableRowContext<T_26> | undefined;
87
+ useExpandableRowContext: <T_27 extends object>() => import("./plugins/ExpandableRowPlugin").TableExpandableRowContext<T_27> | undefined;
83
88
  usePaginationContext: () => import("./plugins/PaginationPlugin").TablePaginationContext | undefined;
84
89
  useSortingContext: () => import("./plugins/SortingPlugin").TableSortingContext | undefined;
85
- PluggableTable: <T_24 extends object>({ caption, emptyStateRender, ...restProps }: import("./components/PluggableTable/PluggableTable").PluggableTableProps<T_24>) => import("react/jsx-runtime").JSX.Element;
90
+ PluggableTable: <T_28 extends object>({ caption, emptyStateRender, ...restProps }: import("./components/PluggableTable/PluggableTable").PluggableTableProps<T_28>) => import("react/jsx-runtime").JSX.Element;
86
91
  };
87
92
  export default Table;
@@ -12,6 +12,11 @@ import { useClickableRowPlugin, useClickableRowContext } from "./plugins/Clickab
12
12
  import { useTableContext, useComposeContext } from "./Table.context.js";
13
13
  import { PluggableTable } from "./components/PluggableTable/PluggableTable.js";
14
14
  import { compositionComponents } from "./components/PluggableTable/compositionComponents.js";
15
+ import { useRowNavigationPlugin } from "./plugins/RowNavigationPlugin.js";
16
+ import { ShowOnRowHover } from "./components/ShowOnRowHover/ShowOnRowHover.style.js";
17
+ import { ExpandAllRowsButton } from "./components/ExpandRowButton/ExpandAllRowsButton.js";
18
+ import { useExpanderColumn } from "./components/ExpandRowButton/useExpanderColumn.js";
19
+ import { useRowSelectionColumn } from "./components/RowSelection/useRowSelectionColumn.js";
15
20
  const Table = Object.assign(({
16
21
  columns,
17
22
  caption,
@@ -20,6 +25,7 @@ const Table = Object.assign(({
20
25
  getRowId,
21
26
  emptyState,
22
27
  maxHeight,
28
+ minWidth,
23
29
  stripedRows = false,
24
30
  // sorting
25
31
  enableSorting,
@@ -28,16 +34,19 @@ const Table = Object.assign(({
28
34
  sorting,
29
35
  manualSorting,
30
36
  // row expansion
37
+ defaultExpanded,
31
38
  getIsRowExpandable,
32
39
  renderExpandedRow,
33
40
  expandRowOnClick,
34
41
  expandedRowComponent,
42
+ getSubRows,
35
43
  // pagination
36
44
  pagination,
37
45
  defaultPagination,
38
46
  onPaginationChange,
39
47
  manualPagination,
40
48
  totalRowCount,
49
+ totalPageCount,
41
50
  pageSizes,
42
51
  paginationEnabled,
43
52
  // row selection
@@ -45,7 +54,9 @@ const Table = Object.assign(({
45
54
  defaultRowSelection,
46
55
  onRowSelectionChange,
47
56
  rowSelectionMode,
48
- getRowCanSelect
57
+ getRowCanSelect,
58
+ // row navigation
59
+ enableRowNavigation = false
49
60
  }) => {
50
61
  const clickableRowPluginData = useClickableRowPlugin({
51
62
  onRowClick: onRowClick && ((row) => onRowClick(row.original)),
@@ -64,14 +75,20 @@ const Table = Object.assign(({
64
75
  onPaginationChange,
65
76
  manualPagination,
66
77
  totalRowCount,
78
+ totalPageCount,
67
79
  pageSizes,
68
80
  paginationEnabled
69
81
  });
70
82
  const expandableRowPluginData = useExpandableRowPlugin({
83
+ defaultExpanded,
71
84
  expandRowOnClick,
72
- getRowCanExpand: getIsRowExpandable && ((row) => getIsRowExpandable(row.original)),
85
+ getRowCanExpand: getIsRowExpandable && ((row) => {
86
+ var _a;
87
+ return getIsRowExpandable(row.original) && (!getSubRows || !!((_a = getSubRows(row.original, row.index)) == null ? void 0 : _a.length));
88
+ }),
73
89
  renderExpandedRow,
74
- expandedRowComponent
90
+ expandedRowComponent,
91
+ getSubRows
75
92
  });
76
93
  const rowSelectionPluginData = useRowSelectionPlugin({
77
94
  rowSelection,
@@ -80,11 +97,15 @@ const Table = Object.assign(({
80
97
  rowSelectionMode,
81
98
  getRowCanSelect
82
99
  });
100
+ const rowNavigationPluginData = useRowNavigationPlugin({
101
+ enableRowNavigation
102
+ });
83
103
  return jsxRuntimeExports.jsx(Table.PluggableTable, {
84
104
  ...{
85
105
  data,
86
106
  columns,
87
107
  maxHeight,
108
+ minWidth,
88
109
  stripedRows,
89
110
  caption,
90
111
  emptyStateRender: emptyState
@@ -92,20 +113,25 @@ const Table = Object.assign(({
92
113
  tableOptions: {
93
114
  getRowId
94
115
  },
95
- pluginsData: [clickableRowPluginData, sortingPluginData, paginationPluginData, expandableRowPluginData, rowSelectionPluginData]
116
+ pluginsData: [clickableRowPluginData, sortingPluginData, paginationPluginData, expandableRowPluginData, rowSelectionPluginData, rowNavigationPluginData]
96
117
  });
97
118
  }, {
98
119
  ExpandRowButton,
120
+ ExpandAllRowsButton,
121
+ useExpanderColumn,
99
122
  ExpandedRow: TableExpandedRow,
100
123
  AnimatedExpandedRow: TableAnimatedExpandedRow,
101
124
  RowSelectionButton,
102
125
  HeaderMultiRowSelectionButton,
126
+ useRowSelectionColumn,
127
+ ShowOnActiveRow: ShowOnRowHover,
103
128
  // plugins
104
129
  useClickableRowPlugin,
105
130
  useSortingPlugin,
106
131
  usePaginationPlugin,
107
132
  useExpandableRowPlugin,
108
133
  useRowSelectionPlugin,
134
+ useRowNavigationPlugin,
109
135
  // contexts
110
136
  useTableContext,
111
137
  useComposeContext,
@@ -4,6 +4,7 @@ const _styled = require("styled-components");
4
4
  const redisUiStyles = require("@redislabsdev/redis-ui-styles");
5
5
  const redisUiComponents = require("@redislabsdev/redis-ui-components");
6
6
  const ShowOnRowHover_style = require("./components/ShowOnRowHover/ShowOnRowHover.style.cjs");
7
+ const Table_context = require("./Table.context.cjs");
7
8
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
8
9
  const _styled__default = /* @__PURE__ */ _interopDefault(_styled);
9
10
  const TableContainer = _styled__default.default.div.withConfig({
@@ -13,11 +14,28 @@ const TableContainer = _styled__default.default.div.withConfig({
13
14
  const Table = _styled__default.default.table.withConfig({
14
15
  displayName: "Tablestyle__Table",
15
16
  componentId: "RedisUI__sc-o0xfty-1"
16
- })(["width:100%;border-collapse:collapse;border-spacing:0;overflow-x:auto;display:block;table-layout:fixed;"]);
17
- const TableHead = _styled__default.default.thead.withConfig({
17
+ })(["width:100%;border-collapse:collapse;border-spacing:0;overflow-x:auto;display:block;table-layout:fixed;", ""], () => {
18
+ const {
19
+ table
20
+ } = Table_context.useTableContext();
21
+ return _styled.css`
22
+ overflow-x: ${table.getRowModel().rows.length ? "auto" : "hidden"};
23
+ `;
24
+ });
25
+ const TableHead = _styled__default.default.thead.attrs((props) => ({
26
+ "data-role": "table-header",
27
+ ...props
28
+ })).withConfig({
18
29
  displayName: "Tablestyle__TableHead",
19
30
  componentId: "RedisUI__sc-o0xfty-2"
20
- })(["display:table;table-layout:fixed;"]);
31
+ })(["display:table;table-layout:fixed;", ""], () => {
32
+ const {
33
+ minWidth
34
+ } = Table_context.useTableContext();
35
+ return _styled.css`
36
+ min-width: ${minWidth || void 0};
37
+ `;
38
+ });
21
39
  const TableHeaderRow = _styled__default.default.tr.withConfig({
22
40
  displayName: "Tablestyle__TableHeaderRow",
23
41
  componentId: "RedisUI__sc-o0xfty-3"
@@ -25,7 +43,9 @@ const TableHeaderRow = _styled__default.default.tr.withConfig({
25
43
  const SortableHeadingCompose = _styled__default.default.button.withConfig({
26
44
  displayName: "Tablestyle__SortableHeadingCompose",
27
45
  componentId: "RedisUI__sc-o0xfty-4"
28
- })(["all:unset;border-radius:0.03rem;display:flex;align-items:center;justify-content:flex-start;gap:0.8rem;height:100%;width:100%;min-height:35px;max-width:100%;overflow:hidden;", " svg{flex:none;}"], redisUiStyles.getFocusStyle("0.6rem"));
46
+ })(["all:unset;border-radius:0.03rem;display:flex;align-items:center;justify-content:flex-start;gap:0.8rem;height:100%;width:100%;min-height:35px;max-width:100%;overflow:", ";", " svg{flex:none;}"], ({
47
+ $custom
48
+ }) => $custom ? void 0 : "hidden", redisUiStyles.getFocusStyle("0.6rem"));
29
49
  const HeaderTitleWrapper = _styled__default.default(redisUiComponents.Typography.Body).withConfig({
30
50
  displayName: "Tablestyle__HeaderTitleWrapper",
31
51
  componentId: "RedisUI__sc-o0xfty-5"
@@ -39,17 +59,25 @@ const HeaderTitleWrapper = _styled__default.default(redisUiComponents.Typography
39
59
  const TableTh = _styled__default.default.th.withConfig({
40
60
  displayName: "Tablestyle__TableTh",
41
61
  componentId: "RedisUI__sc-o0xfty-6"
42
- })(["padding:1.05rem 1.2rem;color:", ";user-select:none;white-space:nowrap;word-break:break-word;line-height:normal;position:relative;&:not(:last-child)::after{content:'';position:absolute;inset:1.05rem 0 1.05rem auto;border-right:1px solid ", ";}"], () => redisUiStyles.useTheme().components.table.table.tableTh.color, () => redisUiStyles.useTheme().components.table.table.tableTh.borderRight);
62
+ })(["padding:1.05rem 1.2rem;color:", ";user-select:none;white-space:nowrap;word-break:break-word;line-height:normal;position:relative;overflow:hidden;&[aria-sort]{cursor:pointer;}&:not(:last-child)::after{content:'';position:absolute;inset:1.05rem 0 1.05rem auto;border-right:1px solid ", ";}"], () => redisUiStyles.useTheme().components.table.table.tableTh.color, () => redisUiStyles.useTheme().components.table.table.tableTh.borderRight);
43
63
  const TableBody = _styled__default.default.tbody.withConfig({
44
64
  displayName: "Tablestyle__TableBody",
45
65
  componentId: "RedisUI__sc-o0xfty-7"
46
- })(["max-height:", ";overflow-y:auto;overflow-x:hidden;display:inline-block;table-layout:fixed;"], ({
47
- maxHeight
48
- }) => maxHeight);
66
+ })(["", " overflow-y:auto;overflow-x:hidden;display:inline-block;table-layout:fixed;"], () => {
67
+ const {
68
+ maxHeight,
69
+ minWidth,
70
+ table
71
+ } = Table_context.useTableContext();
72
+ return _styled.css`
73
+ max-height: ${maxHeight};
74
+ min-width: ${table.getRowModel().rows.length && minWidth || void 0};
75
+ `;
76
+ });
49
77
  const TableBodyRow = _styled__default.default.tr.withConfig({
50
78
  displayName: "Tablestyle__TableBodyRow",
51
79
  componentId: "RedisUI__sc-o0xfty-8"
52
- })(["border-top:1px solid ", ";height:4.8rem;transition:box-shadow 0.2s ease-in-out;position:relative;&:hover,&:focus{cursor:", ";z-index:1;box-shadow:", ";", "{opacity:1;visibility:visible;}}", " display:table;width:100%;table-layout:fixed;"], () => redisUiStyles.useTheme().components.table.table.tableBodyRow.borderTop, ({
80
+ })(["border-top:1px solid ", ";height:4.8rem;transition:box-shadow 0.2s ease-in-out;position:relative;&:hover,&:focus,&:focus-within{cursor:", ";z-index:1;box-shadow:", ";", "{opacity:1;visibility:visible;}}", " display:table;width:100%;table-layout:fixed;"], () => redisUiStyles.useTheme().components.table.table.tableBodyRow.borderTop, ({
53
81
  onClick
54
82
  }) => onClick ? "pointer" : "default", () => redisUiStyles.useTheme().components.table.table.tableBodyRow.hoverBoxShadow, ShowOnRowHover_style.ShowOnRowHover, ({
55
83
  $stripedRows