@vuu-ui/vuu-table 0.13.114 → 0.13.115-alpha.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 (95) hide show
  1. package/cjs/Row.js +16 -19
  2. package/cjs/Row.js.map +1 -1
  3. package/cjs/Table.js +8 -15
  4. package/cjs/Table.js.map +1 -1
  5. package/cjs/bulk-edit/useBulkEditPanel.js +6 -7
  6. package/cjs/bulk-edit/useBulkEditPanel.js.map +1 -1
  7. package/cjs/cell-renderers/checkbox-cell/CheckboxCell.js +2 -3
  8. package/cjs/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
  9. package/cjs/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js +2 -3
  10. package/cjs/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js.map +1 -1
  11. package/cjs/cell-renderers/input-cell/InputCell.js +3 -5
  12. package/cjs/cell-renderers/input-cell/InputCell.js.map +1 -1
  13. package/cjs/cell-renderers/toggle-cell/ToggleCell.js +5 -6
  14. package/cjs/cell-renderers/toggle-cell/ToggleCell.js.map +1 -1
  15. package/cjs/data-row/DataRow.js +146 -0
  16. package/cjs/data-row/DataRow.js.map +1 -0
  17. package/cjs/index.js +2 -0
  18. package/cjs/index.js.map +1 -1
  19. package/cjs/table-cell/TableCell.js +6 -9
  20. package/cjs/table-cell/TableCell.js.map +1 -1
  21. package/cjs/table-cell/TableGroupCell.css.js +1 -1
  22. package/cjs/table-cell/TableGroupCell.js +7 -8
  23. package/cjs/table-cell/TableGroupCell.js.map +1 -1
  24. package/cjs/table-data-source/{moving-window.js → DataRowMovingWindow.js} +19 -29
  25. package/cjs/table-data-source/DataRowMovingWindow.js.map +1 -0
  26. package/cjs/table-data-source/useDataSource.js +77 -37
  27. package/cjs/table-data-source/useDataSource.js.map +1 -1
  28. package/cjs/useRowClassNameGenerators.js +2 -2
  29. package/cjs/useRowClassNameGenerators.js.map +1 -1
  30. package/cjs/useSelection.js +5 -6
  31. package/cjs/useSelection.js.map +1 -1
  32. package/cjs/useTable.js +26 -36
  33. package/cjs/useTable.js.map +1 -1
  34. package/cjs/useTableContextMenu.js +6 -10
  35. package/cjs/useTableContextMenu.js.map +1 -1
  36. package/cjs/useTableScroll.js +0 -1
  37. package/cjs/useTableScroll.js.map +1 -1
  38. package/cjs/useTableViewport.js +2 -2
  39. package/cjs/useTableViewport.js.map +1 -1
  40. package/esm/Row.js +17 -20
  41. package/esm/Row.js.map +1 -1
  42. package/esm/Table.js +9 -16
  43. package/esm/Table.js.map +1 -1
  44. package/esm/bulk-edit/useBulkEditPanel.js +7 -8
  45. package/esm/bulk-edit/useBulkEditPanel.js.map +1 -1
  46. package/esm/cell-renderers/checkbox-cell/CheckboxCell.js +2 -3
  47. package/esm/cell-renderers/checkbox-cell/CheckboxCell.js.map +1 -1
  48. package/esm/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js +3 -4
  49. package/esm/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.js.map +1 -1
  50. package/esm/cell-renderers/input-cell/InputCell.js +3 -5
  51. package/esm/cell-renderers/input-cell/InputCell.js.map +1 -1
  52. package/esm/cell-renderers/toggle-cell/ToggleCell.js +5 -6
  53. package/esm/cell-renderers/toggle-cell/ToggleCell.js.map +1 -1
  54. package/esm/data-row/DataRow.js +144 -0
  55. package/esm/data-row/DataRow.js.map +1 -0
  56. package/esm/index.js +1 -0
  57. package/esm/index.js.map +1 -1
  58. package/esm/table-cell/TableCell.js +6 -9
  59. package/esm/table-cell/TableCell.js.map +1 -1
  60. package/esm/table-cell/TableGroupCell.css.js +1 -1
  61. package/esm/table-cell/TableGroupCell.js +8 -9
  62. package/esm/table-cell/TableGroupCell.js.map +1 -1
  63. package/esm/table-data-source/{moving-window.js → DataRowMovingWindow.js} +20 -30
  64. package/esm/table-data-source/DataRowMovingWindow.js.map +1 -0
  65. package/esm/table-data-source/useDataSource.js +78 -38
  66. package/esm/table-data-source/useDataSource.js.map +1 -1
  67. package/esm/useRowClassNameGenerators.js +2 -2
  68. package/esm/useRowClassNameGenerators.js.map +1 -1
  69. package/esm/useSelection.js +6 -7
  70. package/esm/useSelection.js.map +1 -1
  71. package/esm/useTable.js +27 -37
  72. package/esm/useTable.js.map +1 -1
  73. package/esm/useTableContextMenu.js +7 -11
  74. package/esm/useTableContextMenu.js.map +1 -1
  75. package/esm/useTableScroll.js +0 -1
  76. package/esm/useTableScroll.js.map +1 -1
  77. package/esm/useTableViewport.js +2 -2
  78. package/esm/useTableViewport.js.map +1 -1
  79. package/package.json +10 -10
  80. package/types/Row.d.ts +1 -1
  81. package/types/Table.d.ts +1 -12
  82. package/types/cell-renderers/checkbox-cell/CheckboxCell.d.ts +1 -1
  83. package/types/cell-renderers/input-cell/InputCell.d.ts +1 -1
  84. package/types/data-row/DataRow.d.ts +16 -0
  85. package/types/index.d.ts +1 -0
  86. package/types/table-cell/TableCell.d.ts +1 -1
  87. package/types/table-cell/TableGroupCell.d.ts +1 -1
  88. package/types/table-data-source/DataRowMovingWindow.d.ts +24 -0
  89. package/types/table-data-source/useDataSource.d.ts +5 -6
  90. package/types/useTable.d.ts +5 -7
  91. package/types/useTableContextMenu.d.ts +5 -7
  92. package/types/useTableScroll.d.ts +1 -3
  93. package/cjs/table-data-source/moving-window.js.map +0 -1
  94. package/esm/table-data-source/moving-window.js.map +0 -1
  95. package/types/table-data-source/moving-window.d.ts +0 -23
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "version": "0.13.114",
2
+ "version": "0.13.115-alpha.2",
3
3
  "author": "heswell",
4
4
  "license": "Apache-2.0",
5
5
  "devDependencies": {
6
- "@vuu-ui/vuu-data-types": "0.13.114",
7
- "@vuu-ui/vuu-table-types": "0.13.114",
8
- "@vuu-ui/vuu-protocol-types": "0.13.114"
6
+ "@vuu-ui/vuu-data-types": "0.13.115-alpha.2",
7
+ "@vuu-ui/vuu-table-types": "0.13.115-alpha.2",
8
+ "@vuu-ui/vuu-protocol-types": "0.13.115-alpha.2"
9
9
  },
10
10
  "dependencies": {
11
11
  "@salt-ds/core": "1.54.1",
12
12
  "@salt-ds/styles": "0.2.1",
13
13
  "@salt-ds/window": "0.1.1",
14
- "@vuu-ui/vuu-context-menu": "0.13.114",
15
- "@vuu-ui/vuu-data-react": "0.13.114",
16
- "@vuu-ui/vuu-popups": "0.13.114",
17
- "@vuu-ui/vuu-table-extras": "0.13.114",
18
- "@vuu-ui/vuu-ui-controls": "0.13.114",
19
- "@vuu-ui/vuu-utils": "0.13.114"
14
+ "@vuu-ui/vuu-context-menu": "0.13.115-alpha.2",
15
+ "@vuu-ui/vuu-data-react": "0.13.115-alpha.2",
16
+ "@vuu-ui/vuu-popups": "0.13.115-alpha.2",
17
+ "@vuu-ui/vuu-table-extras": "0.13.115-alpha.2",
18
+ "@vuu-ui/vuu-ui-controls": "0.13.115-alpha.2",
19
+ "@vuu-ui/vuu-utils": "0.13.115-alpha.2"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "clsx": "^2.0.0",
package/types/Row.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { RowProps } from "@vuu-ui/vuu-table-types";
2
- export declare const Row: import("react").MemoExoticComponent<({ className: classNameProp, classNameGenerator, columnMap, columns, groupToggleTarget, highlighted, row, offset, onCellEdit, onClick, onDataEdited, onToggleGroup, searchPattern, showBookends, virtualColSpan, zebraStripes, ...htmlAttributes }: RowProps) => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const Row: import("react").MemoExoticComponent<({ className: classNameProp, classNameGenerator, columns, dataRow, groupToggleTarget, highlighted, offset, onCellEdit, onClick, onDataEdited, onToggleGroup, searchPattern, showBookends, virtualColSpan, zebraStripes, ...htmlAttributes }: RowProps) => import("react/jsx-runtime").JSX.Element>;
package/types/Table.d.ts CHANGED
@@ -2,7 +2,6 @@ import type { DataSource, SchemaColumn } from "@vuu-ui/vuu-data-types";
2
2
  import { CustomHeader, DataCellEditNotification, GroupToggleTarget, RowActionHandler, RowProps, SelectionChangeHandler, ShowColumnHeaderMenus, TableConfig, TableConfigChangeHandler, TableRowClickHandler, TableRowSelectHandler, TableSelectionModel } from "@vuu-ui/vuu-table-types";
3
3
  import type { DragDropState } from "@vuu-ui/vuu-ui-controls";
4
4
  import { DragStartHandler, MeasuredContainerProps, dragStrategy } from "@vuu-ui/vuu-ui-controls";
5
- import { RowToObjectMapper } from "@vuu-ui/vuu-utils";
6
5
  import { ComponentType, FC, ForwardedRef } from "react";
7
6
  import { TableCellBlock } from "./cell-block/cellblock-utils";
8
7
  import { ScrollingAPI } from "./useTableScroll";
@@ -45,7 +44,7 @@ export interface TableProps extends Omit<MeasuredContainerProps, "onDragStart" |
45
44
  /**
46
45
  * required if a fully featured column picker is to be available
47
46
  */
48
- availableColumns?: SchemaColumn[];
47
+ availableColumns?: readonly SchemaColumn[];
49
48
  /**
50
49
  * Pixel height of header cells. If specified here, this will take precedence over CSS
51
50
  * values and Table will not respond to density changes.
@@ -139,16 +138,6 @@ export interface TableProps extends Omit<MeasuredContainerProps, "onDragStart" |
139
138
  * Allows opt-in to a predefined style pattern that renders a border around a row selection block.
140
139
  */
141
140
  rowSelectionBorder?: boolean;
142
- /**
143
- * When a row is selected and onSelect provided, onSelect will be invoked with a
144
- * DataSourceRowObject, derived from the internal representation of a data row,
145
- * DataSourceRow. The data attribute of DataSourceRowObject is a simple map of
146
- * column.name : value.
147
- * This prop allows a custom function to be provided to make the conversion from
148
- * DataSourceRow to DataSourceRowObject. It will very rarely be needed. It is
149
- * used by the Treetable.
150
- */
151
- rowToObject?: RowToObjectMapper;
152
141
  /**
153
142
  * Only applicable to grouped data. If there are selected rows which are not top-level
154
143
  * items and group items above are not already expanded, expand all group items in
@@ -1,2 +1,2 @@
1
1
  import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- export declare const CheckboxCell: import("react").MemoExoticComponent<({ column, columnMap, onEdit, row }: TableCellRendererProps) => import("react/jsx-runtime").JSX.Element>;
2
+ export declare const CheckboxCell: import("react").MemoExoticComponent<({ column, dataRow, onEdit }: TableCellRendererProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,2 +1,2 @@
1
1
  import { TableCellRendererProps } from "@vuu-ui/vuu-table-types";
2
- export declare const InputCell: ({ column, columnMap, onEdit, row, }: TableCellRendererProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const InputCell: ({ column, dataRow, onEdit, }: TableCellRendererProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { DataSourceRow, SchemaColumn } from "@vuu-ui/vuu-data-types";
2
+ import { DataRow } from "@vuu-ui/vuu-table-types";
3
+ export type DataRowFunc = (data: DataSourceRow) => DataRow;
4
+ /**
5
+ *
6
+ * @param columns the names of columns included in subscription
7
+ * @param schemaColumns full schema definitions for all available columns,
8
+ * the serverDataTypes are used.
9
+ * @returns a tuple containing:
10
+ * - factory function that will create a DataRow instance from a DataSourceRow
11
+ * array.
12
+ * - a function that can be used to reset the columns, which will be used for all
13
+ * subsequently created DataRows. Used by Table when user adds or removes columns
14
+ * at runtime.
15
+ */
16
+ export declare const dataRowFactory: (columns: string[], schemaColumns: readonly SchemaColumn[]) => [DataRowFunc, (columns: string[]) => void];
package/types/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export * from "./useTableContextMenu";
16
16
  export * from "./useTableScroll";
17
17
  export * from "./useTableViewport";
18
18
  export * from "./VirtualColSpan";
19
+ export { dataRowFactory, type DataRowFunc } from "./data-row/DataRow";
@@ -1,2 +1,2 @@
1
1
  import type { TableCellProps } from "@vuu-ui/vuu-table-types";
2
- export declare const TableCell: ({ column, columnMap, onClick, onDataEdited, row, searchPattern, }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const TableCell: ({ column, dataRow, onClick, onDataEdited, searchPattern, }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { TableCellProps } from "@vuu-ui/vuu-table-types";
2
- export declare const TableGroupCell: ({ column, columnMap, onClick, row, searchPattern, }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const TableGroupCell: ({ column, dataRow, onClick, searchPattern, }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { VuuRange } from "@vuu-ui/vuu-protocol-types";
2
+ import { DataRow } from "@vuu-ui/vuu-table-types";
3
+ import { WindowRange } from "@vuu-ui/vuu-utils";
4
+ export declare class MovingDataRowWindow {
5
+ #private;
6
+ data: DataRow[];
7
+ rowCount: number;
8
+ constructor({ from, to }: VuuRange);
9
+ setRowCount: (rowCount: number) => void;
10
+ add(data: DataRow): void;
11
+ getAtIndex(index: number): DataRow | undefined;
12
+ getByKey(key: string): DataRow | undefined;
13
+ isWithinRange(index: number): boolean;
14
+ setRange({ from, to }: VuuRange): void;
15
+ getSelectedRows(): DataRow[];
16
+ get hasData(): boolean;
17
+ /**
18
+ * This will throw if there is no data. Check `hasData` first
19
+ * to guard against this, if not certain.
20
+ */
21
+ get firstRow(): DataRow;
22
+ get range(): WindowRange;
23
+ get hasAllRowsWithinRange(): boolean;
24
+ }
@@ -1,8 +1,8 @@
1
- import type { DataSourceRow, DataSourceSubscribedMessage, DataSourceSuspenseProps } from "@vuu-ui/vuu-data-types";
1
+ import type { DataSourceSubscribedMessage, DataSourceSuspenseProps } from "@vuu-ui/vuu-data-types";
2
2
  import { VuuRange } from "@vuu-ui/vuu-protocol-types";
3
3
  import { Range } from "@vuu-ui/vuu-utils";
4
4
  import { TableProps } from "../Table";
5
- import { TableRowSelectHandlerInternal } from "@vuu-ui/vuu-table-types";
5
+ import { DataRow, TableRowSelectHandlerInternal } from "@vuu-ui/vuu-table-types";
6
6
  export interface DataSourceHookProps extends Pick<TableProps, "autoSelectFirstRow" | "autoSelectRowKey" | "dataSource" | "renderBufferSize" | "revealSelected" | "selectionModel"> {
7
7
  suspenseProps?: DataSourceSuspenseProps;
8
8
  onSelect: TableRowSelectHandlerInternal;
@@ -10,10 +10,9 @@ export interface DataSourceHookProps extends Pick<TableProps, "autoSelectFirstRo
10
10
  onSubscribed: (subscription: DataSourceSubscribedMessage) => void;
11
11
  }
12
12
  export declare const useDataSource: ({ autoSelectFirstRow, autoSelectRowKey, dataSource, onSizeChange, onSubscribed, renderBufferSize, revealSelected, onSelect, selectionModel, suspenseProps, }: DataSourceHookProps) => {
13
- data: DataSourceRow[];
14
- dataRef: import("react").RefObject<DataSourceRow[]>;
15
- getSelectedRows: () => DataSourceRow[];
13
+ dataRows: DataRow[];
14
+ dataRowsRef: import("react").RefObject<DataRow[]>;
15
+ getSelectedRows: () => DataRow[];
16
16
  range: Range;
17
- removeColumnDataFromCache: (indexOfRemovedColumn: number) => void;
18
17
  setRange: (viewportRange: VuuRange) => void;
19
18
  };
@@ -1,6 +1,5 @@
1
- import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
1
  import type { RpcResult, VuuSortType } from "@vuu-ui/vuu-protocol-types";
3
- import type { ColumnDescriptor, ColumnMoveHandler, DataCellEditEvent, RuntimeColumnDescriptor, TableColumnResizeHandler, TableConfig, TableRowClickHandlerInternal, TableSelectionModel } from "@vuu-ui/vuu-table-types";
2
+ import type { ColumnDescriptor, ColumnMoveHandler, DataCellEditEvent, RuntimeColumnDescriptor, TableColumnResizeHandler, TableConfig, TableRowClickHandlerInternal, TableSelectionModel, DataRow } from "@vuu-ui/vuu-table-types";
4
3
  import { MeasuredProps, MeasuredSize } from "@vuu-ui/vuu-ui-controls";
5
4
  import { FocusEvent, KeyboardEvent, MouseEventHandler, RefObject } from "react";
6
5
  import { TableProps } from "./Table";
@@ -8,19 +7,18 @@ type HeaderState = {
8
7
  height: number;
9
8
  count: number;
10
9
  };
11
- export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowCellBlockSelection" | "allowDragDrop" | "allowSelectCheckboxRow" | "autoSelectFirstRow" | "autoSelectRowKey" | "availableColumns" | "config" | "dataSource" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDataEdited" | "onDragStart" | "onDrop" | "onHighlight" | "onSelect" | "onSelectCellBlock" | "onSelectionChange" | "onRowClick" | "renderBufferSize" | "revealSelected" | "rowToObject" | "scrollingApiRef" | "showColumnHeaderMenus" | "showColumnHeaders" | "showPaginationControls"> {
10
+ export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowCellBlockSelection" | "allowDragDrop" | "allowSelectCheckboxRow" | "autoSelectFirstRow" | "autoSelectRowKey" | "availableColumns" | "config" | "dataSource" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDataEdited" | "onDragStart" | "onDrop" | "onHighlight" | "onSelect" | "onSelectCellBlock" | "onSelectionChange" | "onRowClick" | "renderBufferSize" | "revealSelected" | "scrollingApiRef" | "showColumnHeaderMenus" | "showColumnHeaders" | "showPaginationControls"> {
12
11
  containerRef: RefObject<HTMLDivElement | null>;
13
12
  rowHeight: number;
14
13
  selectionModel: TableSelectionModel;
15
14
  size: MeasuredSize;
16
15
  }
17
- export declare const useTable: ({ allowCellBlockSelection, allowSelectCheckboxRow, allowDragDrop, autoSelectFirstRow, autoSelectRowKey, availableColumns, config, containerRef, dataSource, disableFocus, highlightedIndex: highlightedIndexProp, id, navigationStyle, onAvailableColumnsChange, onConfigChange, onDataEdited: onDataEditedProp, onDragStart, onDrop, onHighlight, onRowClick: onRowClickProp, onSelect, onSelectCellBlock, onSelectionChange, renderBufferSize, revealSelected, rowHeight, rowToObject, scrollingApiRef, selectionModel, showColumnHeaderMenus, showColumnHeaders, showPaginationControls, size, }: TableHookProps) => {
16
+ export declare const useTable: ({ allowCellBlockSelection, allowSelectCheckboxRow, allowDragDrop, autoSelectFirstRow, autoSelectRowKey, availableColumns, config, containerRef, dataSource, disableFocus, highlightedIndex: highlightedIndexProp, id, navigationStyle, onAvailableColumnsChange, onConfigChange, onDataEdited: onDataEditedProp, onDragStart, onDrop, onHighlight, onRowClick: onRowClickProp, onSelect, onSelectCellBlock, onSelectionChange, renderBufferSize, revealSelected, rowHeight, scrollingApiRef, selectionModel, showColumnHeaderMenus, showColumnHeaders, showPaginationControls, size, }: TableHookProps) => {
18
17
  allRowsSelected: boolean;
19
18
  "aria-rowcount": number;
20
19
  cellBlock: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
21
- columnMap: import("@vuu-ui/vuu-utils").ColumnMap;
22
20
  columns: RuntimeColumnDescriptor[];
23
- data: DataSourceRow[];
21
+ dataRows: DataRow[];
24
22
  draggableRow: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
25
23
  focusCellPlaceholderKeyDown: import("react").KeyboardEventHandler;
26
24
  focusCellPlaceholderRef: import("react").RefCallback<HTMLDivElement>;
@@ -44,7 +42,7 @@ export declare const useTable: ({ allowCellBlockSelection, allowSelectCheckboxRo
44
42
  onRowClick: TableRowClickHandlerInternal;
45
43
  onSortColumn: (column: ColumnDescriptor, extendSort?: boolean, sortType?: VuuSortType) => void;
46
44
  onResizeColumn: TableColumnResizeHandler;
47
- onToggleGroup: (row: DataSourceRow, column: RuntimeColumnDescriptor) => void;
45
+ onToggleGroup: (dataRow: DataRow, column: RuntimeColumnDescriptor) => void;
48
46
  rowClassNameGenerator: import("@vuu-ui/vuu-utils").RowClassNameGenerator | undefined;
49
47
  scrollProps: {
50
48
  columnsWithinViewport: RuntimeColumnDescriptor[];
@@ -1,15 +1,13 @@
1
- import { DataSource, DataSourceRow } from "@vuu-ui/vuu-data-types";
2
- import { ColumnDescriptor, TableMenuLocation } from "@vuu-ui/vuu-table-types";
3
- import { ColumnMap } from "@vuu-ui/vuu-utils";
1
+ import { DataSource } from "@vuu-ui/vuu-data-types";
2
+ import { ColumnDescriptor, DataRow, TableMenuLocation } from "@vuu-ui/vuu-table-types";
4
3
  import { MouseEvent } from "react";
5
4
  export interface TableContextMenuHookProps {
6
5
  allowContextMenu?: boolean;
7
- columnMap: ColumnMap;
8
6
  columns: ColumnDescriptor[];
9
- data: DataSourceRow[];
7
+ dataRows: DataRow[];
10
8
  dataSource: DataSource;
11
- getSelectedRows: () => DataSourceRow[];
9
+ getSelectedRows: () => DataRow[];
12
10
  headerCount?: number;
13
11
  }
14
12
  export declare const isTableLocation: (location: string) => location is TableMenuLocation;
15
- export declare const useTableContextMenu: ({ allowContextMenu, columnMap: columnMapProp, columns, data, dataSource, getSelectedRows, headerCount, }: TableContextMenuHookProps) => ((evt: MouseEvent<HTMLElement>) => void) | undefined;
13
+ export declare const useTableContextMenu: ({ allowContextMenu, columns, dataRows, dataSource, getSelectedRows, headerCount, }: TableContextMenuHookProps) => ((evt: MouseEvent<HTMLElement>) => void) | undefined;
@@ -3,7 +3,6 @@ import type { VuuRange } from "@vuu-ui/vuu-protocol-types";
3
3
  import { ForwardedRef, RefObject } from "react";
4
4
  import type { ViewportMeasurements } from "./useTableViewport";
5
5
  import type { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
6
- import { FocusCell } from "./useCellFocus";
7
6
  import { ICellFocusState } from "./CellFocusState";
8
7
  export type ScrollDirectionVertical = "up" | "down";
9
8
  export type ScrollDirectionHorizontal = "left" | "right";
@@ -41,7 +40,6 @@ export declare const noScrolling: ScrollingAPI;
41
40
  export interface TableScrollHookProps {
42
41
  cellFocusStateRef: RefObject<ICellFocusState>;
43
42
  columns: RuntimeColumnDescriptor[];
44
- focusCell?: FocusCell;
45
43
  getRowAtPosition: RowAtPositionFunc;
46
44
  onHorizontalScroll?: (scrollLeft: number) => void;
47
45
  onVerticalScroll?: (scrollTop: number, pctScrollTop: number) => void;
@@ -57,7 +55,7 @@ export interface TableScrollHookProps {
57
55
  showPaginationControls?: boolean;
58
56
  viewportMeasurements: ViewportMeasurements;
59
57
  }
60
- export declare const useTableScroll: ({ cellFocusStateRef, columns, focusCell, getRowAtPosition, onHorizontalScroll, onVerticalScroll, onVerticalScrollInSitu, rowHeight, scrollingApiRef, setRange, viewportMeasurements, }: TableScrollHookProps) => {
58
+ export declare const useTableScroll: ({ cellFocusStateRef, columns, getRowAtPosition, onHorizontalScroll, onVerticalScroll, onVerticalScrollInSitu, rowHeight, scrollingApiRef, setRange, viewportMeasurements, }: TableScrollHookProps) => {
61
59
  columnsWithinViewport: RuntimeColumnDescriptor[];
62
60
  /** Ref to be assigned to ScrollbarContainer */
63
61
  scrollbarContainerRef: (el: HTMLDivElement | null) => void;
@@ -1 +0,0 @@
1
- {"version":3,"file":"moving-window.js","sources":["../../../../packages/vuu-table/src/table-data-source/moving-window.ts"],"sourcesContent":["import { DataSourceRow } from \"@vuu-ui/vuu-data-types\";\nimport { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport { metadataKeys, WindowRange } from \"@vuu-ui/vuu-utils\";\n\nconst { SELECTED } = metadataKeys;\n\nexport class MovingWindow {\n public data: DataSourceRow[];\n public rowCount = 0;\n #range: WindowRange;\n\n constructor({ from, to }: VuuRange) {\n this.#range = new WindowRange(from, to);\n //internal data is always 0 based, we add range.from to determine an offset\n this.data = new Array(Math.max(0, to - from));\n this.rowCount = 0;\n }\n\n setRowCount = (rowCount: number) => {\n if (rowCount < this.data.length) {\n this.data.length = rowCount;\n }\n\n this.rowCount = rowCount;\n };\n\n add(data: DataSourceRow) {\n const [index] = data;\n if (this.isWithinRange(index)) {\n const internalIndex = index - this.#range.from;\n this.data[internalIndex] = data;\n }\n }\n\n getAtIndex(index: number) {\n return this.#range.isWithin(index) &&\n this.data[index - this.#range.from] != null\n ? this.data[index - this.#range.from]\n : undefined;\n }\n\n isWithinRange(index: number) {\n return this.#range.isWithin(index);\n }\n\n setRange({ from, to }: VuuRange) {\n if (from !== this.#range.from || to !== this.#range.to) {\n const [overlapFrom, overlapTo] = this.#range.overlap(from, to);\n const newData = new Array(Math.max(0, to - from));\n for (let i = overlapFrom; i < overlapTo; i++) {\n const data = this.getAtIndex(i);\n if (data) {\n const index = i - from;\n newData[index] = data;\n }\n }\n this.data = newData;\n this.#range.from = from;\n this.#range.to = to;\n }\n }\n\n getSelectedRows() {\n return this.data.filter((row) => row[SELECTED] !== 0);\n }\n\n get range() {\n return this.#range;\n }\n\n slice(): DataSourceRow[] {\n const data: DataSourceRow[] = [];\n const { from } = this.range;\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n data.push(this.data[i]);\n } else {\n data.push([from + i, from + i, true, false, 1, 0, \"\", 0, 0, false]);\n }\n }\n return data;\n }\n\n /**\n * Update all rows by splicing the supplied index. Used when a column\n * is removed.\n */\n spliceDataAtIndex(index: number) {\n if (index >= 10) {\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n this.data[i] = this.data[i].toSpliced(index, 1) as DataSourceRow;\n }\n }\n } else {\n throw Error(`[MovingWindow] canno splir metadata value from Row`);\n }\n }\n\n // TODO make this more performant, see implementation in\n // array-backed-moving-window - use same implementation\n get hasAllRowsWithinRange(): boolean {\n const { from, to } = this.#range;\n\n for (let i = from; i < to; i++) {\n if (this.getAtIndex(i) === undefined) {\n return false;\n }\n }\n return true;\n }\n}\n"],"names":["metadataKeys","WindowRange"],"mappings":";;;;;;;;;;;;;;AAAA,IAAA,MAAA;AAIA,MAAM,EAAE,UAAa,GAAAA,qBAAA;AAEd,MAAM,YAAa,CAAA;AAAA,EAKxB,WAAY,CAAA,EAAE,IAAM,EAAA,EAAA,EAAgB,EAAA;AAJpC,IAAO,aAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AACP,IAAA,aAAA,CAAA,IAAA,EAAO,UAAW,EAAA,CAAA,CAAA;AAClB,IAAA,YAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AASA,IAAA,aAAA,CAAA,IAAA,EAAA,aAAA,EAAc,CAAC,QAAqB,KAAA;AAClC,MAAI,IAAA,QAAA,GAAW,IAAK,CAAA,IAAA,CAAK,MAAQ,EAAA;AAC/B,QAAA,IAAA,CAAK,KAAK,MAAS,GAAA,QAAA;AAAA;AAGrB,MAAA,IAAA,CAAK,QAAW,GAAA,QAAA;AAAA,KAClB,CAAA;A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A,IAAA,CAAK,IAAK,CAAA,CAAC,IAAO,GAAA,CAAA,EAAG,OAAO,CAAG,EAAA,IAAA,EAAM,KAAO,EAAA,CAAA,EAAG,CAAG,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA,EAAG,KAAK,CAAC,CAAA;AAAA;AACpE;AAEF,IAAO,OAAA,IAAA;AAAA;AACT;AAAA;AAAA;AAAA;AAAA,EAMA,kBAAkB,KAAe,EAAA;AAC/B,IAAA,IAAI,SAAS,EAAI,EAAA;AACf,MAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,IAAK,CAAA,IAAA,CAAK,QAAQ,CAAK,EAAA,EAAA;AACzC,QAAI,IAAA,IAAA,CAAK,IAAK,CAAA,CAAC,CAAG,EAAA;AAChB,UAAK,IAAA,CAAA,IAAA,CAAK,CAAC,CAAI,GAAA,IAAA,CAAK,KAAK,CAAC,CAAA,CAAE,SAAU,CAAA,KAAA,EAAO,CAAC,CAAA;AAAA;AAChD;AACF,KACK,MAAA;AACL,MAAA,MAAM,MAAM,CAAoD,kDAAA,CAAA,CAAA;AAAA;AAClE;AACF;AAAA;AAAA,EAIA,IAAI,qBAAiC,GAAA;AACnC,IAAA,MAAM,EAAE,IAAA,EAAM,EAAG,EAAA,GAAI,YAAK,CAAA,IAAA,EAAA,MAAA,CAAA;AAE1B,IAAA,KAAA,IAAS,CAAI,GAAA,IAAA,EAAM,CAAI,GAAA,EAAA,EAAI,CAAK,EAAA,EAAA;AAC9B,MAAA,IAAI,IAAK,CAAA,UAAA,CAAW,CAAC,CAAA,KAAM,KAAW,CAAA,EAAA;AACpC,QAAO,OAAA,KAAA;AAAA;AACT;AAEF,IAAO,OAAA,IAAA;AAAA;AAEX;AAtGE,MAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"moving-window.js","sources":["../../../../packages/vuu-table/src/table-data-source/moving-window.ts"],"sourcesContent":["import { DataSourceRow } from \"@vuu-ui/vuu-data-types\";\nimport { VuuRange } from \"@vuu-ui/vuu-protocol-types\";\nimport { metadataKeys, WindowRange } from \"@vuu-ui/vuu-utils\";\n\nconst { SELECTED } = metadataKeys;\n\nexport class MovingWindow {\n public data: DataSourceRow[];\n public rowCount = 0;\n #range: WindowRange;\n\n constructor({ from, to }: VuuRange) {\n this.#range = new WindowRange(from, to);\n //internal data is always 0 based, we add range.from to determine an offset\n this.data = new Array(Math.max(0, to - from));\n this.rowCount = 0;\n }\n\n setRowCount = (rowCount: number) => {\n if (rowCount < this.data.length) {\n this.data.length = rowCount;\n }\n\n this.rowCount = rowCount;\n };\n\n add(data: DataSourceRow) {\n const [index] = data;\n if (this.isWithinRange(index)) {\n const internalIndex = index - this.#range.from;\n this.data[internalIndex] = data;\n }\n }\n\n getAtIndex(index: number) {\n return this.#range.isWithin(index) &&\n this.data[index - this.#range.from] != null\n ? this.data[index - this.#range.from]\n : undefined;\n }\n\n isWithinRange(index: number) {\n return this.#range.isWithin(index);\n }\n\n setRange({ from, to }: VuuRange) {\n if (from !== this.#range.from || to !== this.#range.to) {\n const [overlapFrom, overlapTo] = this.#range.overlap(from, to);\n const newData = new Array(Math.max(0, to - from));\n for (let i = overlapFrom; i < overlapTo; i++) {\n const data = this.getAtIndex(i);\n if (data) {\n const index = i - from;\n newData[index] = data;\n }\n }\n this.data = newData;\n this.#range.from = from;\n this.#range.to = to;\n }\n }\n\n getSelectedRows() {\n return this.data.filter((row) => row[SELECTED] !== 0);\n }\n\n get range() {\n return this.#range;\n }\n\n slice(): DataSourceRow[] {\n const data: DataSourceRow[] = [];\n const { from } = this.range;\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n data.push(this.data[i]);\n } else {\n data.push([from + i, from + i, true, false, 1, 0, \"\", 0, 0, false]);\n }\n }\n return data;\n }\n\n /**\n * Update all rows by splicing the supplied index. Used when a column\n * is removed.\n */\n spliceDataAtIndex(index: number) {\n if (index >= 10) {\n for (let i = 0; i < this.data.length; i++) {\n if (this.data[i]) {\n this.data[i] = this.data[i].toSpliced(index, 1) as DataSourceRow;\n }\n }\n } else {\n throw Error(`[MovingWindow] canno splir metadata value from Row`);\n }\n }\n\n // TODO make this more performant, see implementation in\n // array-backed-moving-window - use same implementation\n get hasAllRowsWithinRange(): boolean {\n const { from, to } = this.#range;\n\n for (let i = from; i < to; i++) {\n if (this.getAtIndex(i) === undefined) {\n return false;\n }\n }\n return true;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAA,MAAA;AAIA,MAAM,EAAE,UAAa,GAAA,YAAA;AAEd,MAAM,YAAa,CAAA;AAAA,EAKxB,WAAY,CAAA,EAAE,IAAM,EAAA,EAAA,EAAgB,EAAA;AAJpC,IAAO,aAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AACP,IAAA,aAAA,CAAA,IAAA,EAAO,UAAW,EAAA,CAAA,CAAA;AAClB,IAAA,YAAA,CAAA,IAAA,EAAA,MAAA,CAAA;AASA,IAAA,aAAA,CAAA,IAAA,EAAA,aAAA,EAAc,CAAC,QAAqB,KAAA;AAClC,MAAI,IAAA,QAAA,GAAW,IAAK,CAAA,IAAA,CAAK,MAAQ,EAAA;AAC/B,QAAA,IAAA,CAAK,KAAK,MAAS,GAAA,QAAA;AAAA;AAGrB,MAAA,IAAA,CAAK,QAAW,GAAA,QAAA;AAAA,KAClB,CAAA;AAZE,IAAA,YAAA,CAAA,IAAA,EAAK,MAAS,EAAA,IAAI,WAAY,CAAA,IAAA,EAAM,EAAE,CAAA,CAAA;AAEtC,IAAK,IAAA,CAAA,IAAA,GAAO,IAAI,KAAM,CAAA,IAAA,CAAK,IAAI,CAAG,EAAA,EAAA,GAAK,IAAI,CAAC,CAAA;AAC5C,IAAA,IAAA,CAAK,QAAW,GAAA,CAAA;AAAA;AAClB,EAUA,IAAI,IAAqB,EAAA;AACvB,IAAM,MAAA,CAAC,KAAK,CAAI,GAAA,IAAA;AAChB,IAAI,IAAA,IAAA,CAAK,aAAc,CAAA,KAAK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QAAQ,CAAK,EAAA,EAAA;AACzC,QAAI,IAAA,IAAA,CAAK,IAAK,CAAA,CAAC,CAAG,EAAA;AAChB,UAAK,IAAA,CAAA,IAAA,CAAK,CAAC,CAAI,GAAA,IAAA,CAAK,KAAK,CAAC,CAAA,CAAE,SAAU,CAAA,KAAA,EAAO,CAAC,CAAA;AAAA;AAChD;AACF,KACK,MAAA;AACL,MAAA,MAAM,MAAM,CAAoD,kDAAA,CAAA,CAAA;AAAA;AAClE;AACF;AAAA;AAAA,EAIA,IAAI,qBAAiC,GAAA;AACnC,IAAA,MAAM,EAAE,IAAA,EAAM,EAAG,EAAA,GAAI,YAAK,CAAA,IAAA,EAAA,MAAA,CAAA;AAE1B,IAAA,KAAA,IAAS,CAAI,GAAA,IAAA,EAAM,CAAI,GAAA,EAAA,EAAI,CAAK,EAAA,EAAA;AAC9B,MAAA,IAAI,IAAK,CAAA,UAAA,CAAW,CAAC,CAAA,KAAM,KAAW,CAAA,EAAA;AACpC,QAAO,OAAA,KAAA;AAAA;AACT;AAEF,IAAO,OAAA,IAAA;AAAA;AAEX;AAtGE,MAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
@@ -1,23 +0,0 @@
1
- import { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
- import { VuuRange } from "@vuu-ui/vuu-protocol-types";
3
- import { WindowRange } from "@vuu-ui/vuu-utils";
4
- export declare class MovingWindow {
5
- #private;
6
- data: DataSourceRow[];
7
- rowCount: number;
8
- constructor({ from, to }: VuuRange);
9
- setRowCount: (rowCount: number) => void;
10
- add(data: DataSourceRow): void;
11
- getAtIndex(index: number): DataSourceRow | undefined;
12
- isWithinRange(index: number): boolean;
13
- setRange({ from, to }: VuuRange): void;
14
- getSelectedRows(): DataSourceRow[];
15
- get range(): WindowRange;
16
- slice(): DataSourceRow[];
17
- /**
18
- * Update all rows by splicing the supplied index. Used when a column
19
- * is removed.
20
- */
21
- spliceDataAtIndex(index: number): void;
22
- get hasAllRowsWithinRange(): boolean;
23
- }