@vuu-ui/vuu-table 0.13.2 → 0.13.4
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/cjs/Table.js +3 -2
- package/cjs/Table.js.map +1 -1
- package/cjs/header-cell/HeaderCell.js +11 -15
- package/cjs/header-cell/HeaderCell.js.map +1 -1
- package/cjs/table-header/TableHeader.js +1 -1
- package/cjs/table-header/TableHeader.js.map +1 -1
- package/cjs/useTable.js +10 -2
- package/cjs/useTable.js.map +1 -1
- package/esm/Table.js +5 -4
- package/esm/Table.js.map +1 -1
- package/esm/header-cell/HeaderCell.js +11 -15
- package/esm/header-cell/HeaderCell.js.map +1 -1
- package/esm/table-header/TableHeader.js +1 -1
- package/esm/table-header/TableHeader.js.map +1 -1
- package/esm/useTable.js +10 -2
- package/esm/useTable.js.map +1 -1
- package/package.json +13 -17
- package/cjs/useTableAndColumnSettings.js +0 -135
- package/cjs/useTableAndColumnSettings.js.map +0 -1
- package/esm/useTableAndColumnSettings.js +0 -133
- package/esm/useTableAndColumnSettings.js.map +0 -1
- package/types/CellFocusState.d.ts +0 -26
- package/types/Row.d.ts +0 -5
- package/types/Table.d.ts +0 -195
- package/types/VirtualColSpan.d.ts +0 -3
- package/types/bulk-edit/BulkEditDialog.d.ts +0 -9
- package/types/bulk-edit/BulkEditPanel.d.ts +0 -12
- package/types/bulk-edit/BulkEditRow.d.ts +0 -11
- package/types/bulk-edit/index.d.ts +0 -4
- package/types/bulk-edit/useBulkEditPanel.d.ts +0 -10
- package/types/bulk-edit/useBulkEditRow.d.ts +0 -20
- package/types/cell-block/CellBlock.d.ts +0 -6
- package/types/cell-block/cellblock-utils.d.ts +0 -37
- package/types/cell-block/useCellBlockSelection.d.ts +0 -14
- package/types/cell-renderers/checkbox-cell/CheckboxCell.d.ts +0 -2
- package/types/cell-renderers/checkbox-cell/index.d.ts +0 -1
- package/types/cell-renderers/checkbox-row-selector/CheckboxRowSelectorCell.d.ts +0 -2
- package/types/cell-renderers/checkbox-row-selector/index.d.ts +0 -1
- package/types/cell-renderers/index.d.ts +0 -4
- package/types/cell-renderers/input-cell/InputCell.d.ts +0 -2
- package/types/cell-renderers/input-cell/index.d.ts +0 -1
- package/types/cell-renderers/toggle-cell/ToggleCell.d.ts +0 -2
- package/types/cell-renderers/toggle-cell/index.d.ts +0 -1
- package/types/column-header-pill/ColumnHeaderPill.d.ts +0 -8
- package/types/column-header-pill/GroupColumnPill.d.ts +0 -6
- package/types/column-header-pill/SortIndicator.d.ts +0 -5
- package/types/column-header-pill/index.d.ts +0 -3
- package/types/column-menu/ColumnMenu.d.ts +0 -6
- package/types/column-menu/index.d.ts +0 -1
- package/types/column-resizing/ColumnResizer.d.ts +0 -6
- package/types/column-resizing/index.d.ts +0 -2
- package/types/column-resizing/useTableColumnResize.d.ts +0 -15
- package/types/header-cell/GroupHeaderCell.d.ts +0 -7
- package/types/header-cell/HeaderCell.d.ts +0 -2
- package/types/header-cell/index.d.ts +0 -2
- package/types/index.d.ts +0 -18
- package/types/pagination/PaginationControl.d.ts +0 -6
- package/types/pagination/index.d.ts +0 -1
- package/types/pagination/usePagination.d.ts +0 -9
- package/types/table-cell/TableCell.d.ts +0 -2
- package/types/table-cell/TableGroupCell.d.ts +0 -2
- package/types/table-cell/index.d.ts +0 -2
- package/types/table-config.d.ts +0 -26
- package/types/table-dom-utils.d.ts +0 -23
- package/types/table-header/HeaderProvider.d.ts +0 -6
- package/types/table-header/TableHeader.d.ts +0 -21
- package/types/table-header/index.d.ts +0 -2
- package/types/table-header/useTableHeader.d.ts +0 -17
- package/types/useCell.d.ts +0 -5
- package/types/useCellEditing.d.ts +0 -10
- package/types/useCellFocus.d.ts +0 -17
- package/types/useControlledTableNavigation.d.ts +0 -8
- package/types/useDataSource.d.ts +0 -15
- package/types/useEditableCell.d.ts +0 -4
- package/types/useHighlighting.d.ts +0 -2
- package/types/useInitialValue.d.ts +0 -1
- package/types/useKeyboardNavigation.d.ts +0 -41
- package/types/useMeasuredHeight.d.ts +0 -10
- package/types/useResizeObserver.d.ts +0 -15
- package/types/useRowClassNameGenerators.d.ts +0 -3
- package/types/useSelection.d.ts +0 -14
- package/types/useTable.d.ts +0 -83
- package/types/useTableAndColumnSettings.d.ts +0 -15
- package/types/useTableContextMenu.d.ts +0 -23
- package/types/useTableModel.d.ts +0 -85
- package/types/useTableScroll.d.ts +0 -69
- package/types/useTableViewport.d.ts +0 -42
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FocusEventHandler, KeyboardEvent as ReactKeyboardEvent, MouseEvent } from "react";
|
|
2
|
-
export interface CellEditingHookProps {
|
|
3
|
-
navigate: () => void;
|
|
4
|
-
}
|
|
5
|
-
export declare const useCellEditing: ({ navigate }: CellEditingHookProps) => {
|
|
6
|
-
onBlur: FocusEventHandler;
|
|
7
|
-
onDoubleClick: (e: MouseEvent<HTMLElement>) => void;
|
|
8
|
-
onFocus: FocusEventHandler;
|
|
9
|
-
onKeyDown: (e: ReactKeyboardEvent<HTMLElement>) => void;
|
|
10
|
-
};
|
package/types/useCellFocus.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { KeyboardEventHandler, RefCallback, RefObject } from "react";
|
|
2
|
-
import { ScrollRequestHandler } from "./useTableScroll";
|
|
3
|
-
import { CellPos } from "@vuu-ui/vuu-table-types";
|
|
4
|
-
import type { ICellFocusState } from "./CellFocusState";
|
|
5
|
-
export interface CellFocusHookProps {
|
|
6
|
-
cellFocusStateRef: RefObject<ICellFocusState>;
|
|
7
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
8
|
-
disableFocus?: boolean;
|
|
9
|
-
requestScroll?: ScrollRequestHandler;
|
|
10
|
-
}
|
|
11
|
-
export type FocusCell = (cellPos: CellPos, fromKeyboard?: boolean) => void;
|
|
12
|
-
export declare const useCellFocus: ({ cellFocusStateRef, containerRef, disableFocus, requestScroll, }: CellFocusHookProps) => {
|
|
13
|
-
focusCell: FocusCell;
|
|
14
|
-
focusCellPlaceholderKeyDown: KeyboardEventHandler;
|
|
15
|
-
focusCellPlaceholderRef: RefCallback<HTMLDivElement>;
|
|
16
|
-
setTableBodyRef: RefCallback<HTMLDivElement>;
|
|
17
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { KeyboardEventHandler } from "react";
|
|
2
|
-
export declare const isRowSelectionKey: (key: string) => key is "Enter" | " ";
|
|
3
|
-
export declare const useControlledTableNavigation: (initialValue: number, rowCount: number) => {
|
|
4
|
-
highlightedIndexRef: import("react").MutableRefObject<number | undefined>;
|
|
5
|
-
onHighlight: (idx: number) => void;
|
|
6
|
-
onKeyDown: KeyboardEventHandler;
|
|
7
|
-
tableRef: import("react").RefObject<HTMLDivElement | null>;
|
|
8
|
-
};
|
package/types/useDataSource.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DataSourceRow, DataSourceSubscribedMessage } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { Range } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { TableProps } from "./Table";
|
|
4
|
-
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
5
|
-
export interface DataSourceHookProps extends Pick<TableProps, "dataSource" | "defaultSelectedIndexValues" | "defaultSelectedKeyValues" | "renderBufferSize" | "revealSelected"> {
|
|
6
|
-
onSizeChange: (size: number) => void;
|
|
7
|
-
onSubscribed: (subscription: DataSourceSubscribedMessage) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const useDataSource: ({ dataSource, defaultSelectedIndexValues, defaultSelectedKeyValues, onSizeChange, onSubscribed, renderBufferSize, revealSelected, }: DataSourceHookProps) => {
|
|
10
|
-
data: DataSourceRow[];
|
|
11
|
-
dataRef: import("react").RefObject<DataSourceRow[]>;
|
|
12
|
-
getSelectedRows: () => DataSourceRow[];
|
|
13
|
-
range: Range;
|
|
14
|
-
setRange: (viewportRange: VuuRange) => void;
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useInitialValue: <T = unknown>(value: T) => T;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
-
import { PageKey } from "@vuu-ui/vuu-utils";
|
|
3
|
-
import { KeyboardEvent, MouseEvent, MutableRefObject, RefObject } from "react";
|
|
4
|
-
import { TableNavigationStyle } from "./Table";
|
|
5
|
-
import { NavigationKey } from "./table-dom-utils";
|
|
6
|
-
import { ScrollRequestHandler } from "./useTableScroll";
|
|
7
|
-
import { FocusCell } from "./useCellFocus";
|
|
8
|
-
import { CellFocusState } from "./CellFocusState";
|
|
9
|
-
export declare const isNavigationKey: (key: string, navigationStyle: TableNavigationStyle) => key is NavigationKey;
|
|
10
|
-
export declare const isPagingKey: (key: string) => key is PageKey;
|
|
11
|
-
export type GroupToggleHandler = (treeNodeOperation: "expand" | "collapse", rowIndex: number) => void;
|
|
12
|
-
export interface NavigationHookProps {
|
|
13
|
-
cellFocusStateRef: MutableRefObject<CellFocusState>;
|
|
14
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
15
|
-
columnCount?: number;
|
|
16
|
-
headerCount: number;
|
|
17
|
-
defaultHighlightedIndex?: number;
|
|
18
|
-
disableFocus?: boolean;
|
|
19
|
-
disableHighlightOnFocus?: boolean;
|
|
20
|
-
focusCell: FocusCell;
|
|
21
|
-
highlightedIndex?: number;
|
|
22
|
-
label?: string;
|
|
23
|
-
navigationStyle: TableNavigationStyle;
|
|
24
|
-
viewportRange: VuuRange;
|
|
25
|
-
onHighlight?: (idx: number) => void;
|
|
26
|
-
onToggleGroup: GroupToggleHandler;
|
|
27
|
-
requestScroll?: ScrollRequestHandler;
|
|
28
|
-
restoreLastFocus?: boolean;
|
|
29
|
-
rowCount?: number;
|
|
30
|
-
selected?: unknown;
|
|
31
|
-
viewportRowCount: number;
|
|
32
|
-
}
|
|
33
|
-
export declare const useKeyboardNavigation: ({ cellFocusStateRef, columnCount, containerRef, defaultHighlightedIndex, disableHighlightOnFocus, focusCell, headerCount, highlightedIndex: highlightedIndexProp, navigationStyle, requestScroll, onHighlight, onToggleGroup, rowCount, viewportRowCount, }: NavigationHookProps) => {
|
|
34
|
-
highlightedIndexRef: RefObject<number | undefined>;
|
|
35
|
-
navigateCell: () => void;
|
|
36
|
-
onClick: (evt: MouseEvent) => void;
|
|
37
|
-
onFocus: () => void;
|
|
38
|
-
onKeyDown: (e: KeyboardEvent) => void;
|
|
39
|
-
onMouseLeave: (() => void) | undefined;
|
|
40
|
-
onMouseMove: ((evt: MouseEvent) => void) | undefined;
|
|
41
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RefCallback } from "react";
|
|
2
|
-
interface MeasuredHeightHookProps {
|
|
3
|
-
onHeightMeasured?: (height: number) => void;
|
|
4
|
-
height?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const useMeasuredHeight: ({ onHeightMeasured, height: heightProp, }: MeasuredHeightHookProps) => {
|
|
7
|
-
measuredHeight: number;
|
|
8
|
-
measuredRef: RefCallback<HTMLDivElement>;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
export declare const WidthHeight: string[];
|
|
3
|
-
export declare const WidthOnly: string[];
|
|
4
|
-
export type measurements<T = string | number> = {
|
|
5
|
-
height?: T;
|
|
6
|
-
clientHeight?: number;
|
|
7
|
-
clientWidth?: number;
|
|
8
|
-
contentHeight?: number;
|
|
9
|
-
contentWidth?: number;
|
|
10
|
-
scrollHeight?: number;
|
|
11
|
-
scrollWidth?: number;
|
|
12
|
-
width?: T;
|
|
13
|
-
};
|
|
14
|
-
export type ResizeHandler = (measurements: measurements<number>) => void;
|
|
15
|
-
export declare function useResizeObserver(ref: RefObject<Element | HTMLElement | null>, dimensions: string[], onResize: ResizeHandler, reportInitialSize?: boolean): void;
|
package/types/useSelection.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TableRowClickHandlerInternal, TableRowSelectHandlerInternal, TableSelectionModel } from "@vuu-ui/vuu-table-types";
|
|
2
|
-
import { KeyboardEventHandler, RefObject } from "react";
|
|
3
|
-
import { TableProps } from "./Table";
|
|
4
|
-
export interface SelectionHookProps extends Pick<TableProps, "defaultSelectedIndexValues" | "onSelectionChange"> {
|
|
5
|
-
containerRef: RefObject<HTMLElement | null>;
|
|
6
|
-
highlightedIndexRef: RefObject<number | undefined>;
|
|
7
|
-
selectionKeys?: string[];
|
|
8
|
-
selectionModel: TableSelectionModel;
|
|
9
|
-
onSelect?: TableRowSelectHandlerInternal;
|
|
10
|
-
}
|
|
11
|
-
export declare const useSelection: ({ containerRef, defaultSelectedIndexValues, highlightedIndexRef, selectionKeys, selectionModel, onSelect, onSelectionChange, }: SelectionHookProps) => {
|
|
12
|
-
onKeyDown: KeyboardEventHandler<HTMLElement>;
|
|
13
|
-
onRowClick: TableRowClickHandlerInternal;
|
|
14
|
-
};
|
package/types/useTable.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { VuuSortType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { ColumnDescriptor, DataCellEditEvent, RuntimeColumnDescriptor, TableColumnResizeHandler, TableConfig, TableRowClickHandlerInternal, TableSelectionModel } from "@vuu-ui/vuu-table-types";
|
|
4
|
-
import { MeasuredProps, MeasuredSize } from "@vuu-ui/vuu-ui-controls";
|
|
5
|
-
import { FocusEvent, KeyboardEvent, MouseEventHandler, RefObject } from "react";
|
|
6
|
-
import { TableProps } from "./Table";
|
|
7
|
-
type HeaderState = {
|
|
8
|
-
height: number;
|
|
9
|
-
count: number;
|
|
10
|
-
};
|
|
11
|
-
export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowCellBlockSelection" | "allowDragDrop" | "availableColumns" | "config" | "dataSource" | "defaultSelectedIndexValues" | "defaultSelectedKeyValues" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDataEdited" | "onDragStart" | "onDrop" | "onHighlight" | "onSelect" | "onSelectCellBlock" | "onSelectionChange" | "onRowClick" | "renderBufferSize" | "revealSelected" | "rowToObject" | "scrollingApiRef" | "selectionBookendWidth" | "showColumnHeaders" | "showPaginationControls"> {
|
|
12
|
-
containerRef: RefObject<HTMLDivElement | null>;
|
|
13
|
-
rowHeight: number;
|
|
14
|
-
selectionModel: TableSelectionModel;
|
|
15
|
-
size: MeasuredSize;
|
|
16
|
-
}
|
|
17
|
-
export declare const useTable: ({ allowCellBlockSelection, allowDragDrop, availableColumns, config, containerRef, dataSource, defaultSelectedIndexValues, defaultSelectedKeyValues, disableFocus, highlightedIndex: highlightedIndexProp, id, navigationStyle, onAvailableColumnsChange, onConfigChange, onDataEdited: onDataEditedProp, onDragStart, onDrop, onHighlight, onRowClick: onRowClickProp, onSelect, onSelectCellBlock, onSelectionChange, renderBufferSize, revealSelected, rowHeight, rowToObject, scrollingApiRef, selectionBookendWidth, selectionModel, showColumnHeaders, showPaginationControls, size, }: TableHookProps) => {
|
|
18
|
-
"aria-rowcount": number;
|
|
19
|
-
cellBlock: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
|
|
20
|
-
columnMap: import("@vuu-ui/vuu-utils").ColumnMap;
|
|
21
|
-
columns: RuntimeColumnDescriptor[];
|
|
22
|
-
data: DataSourceRow[];
|
|
23
|
-
draggableRow: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
24
|
-
focusCellPlaceholderKeyDown: import("react").KeyboardEventHandler;
|
|
25
|
-
focusCellPlaceholderRef: import("react").RefCallback<HTMLDivElement>;
|
|
26
|
-
getRowOffset: import("@vuu-ui/vuu-utils").RowOffsetFunc;
|
|
27
|
-
handleColumnAction: import("@vuu-ui/vuu-context-menu").MenuActionHandler<import("@vuu-ui/vuu-table-extras/src/column-menu/column-menu-utils").ColumnMenuActionType, ColumnDescriptor>;
|
|
28
|
-
headerState: HeaderState;
|
|
29
|
-
headings: import("@vuu-ui/vuu-table-types").TableHeadings;
|
|
30
|
-
highlightedIndex: number | undefined;
|
|
31
|
-
onBlur: import("react").FocusEventHandler;
|
|
32
|
-
onDoubleClick: (e: import("react").MouseEvent<HTMLElement>) => void;
|
|
33
|
-
onFocus: (e: FocusEvent<HTMLElement>) => void;
|
|
34
|
-
onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
|
|
35
|
-
onMouseDown: MouseEventHandler;
|
|
36
|
-
onContextMenu: ((evt: import("react").MouseEvent<HTMLElement>) => void) | undefined;
|
|
37
|
-
onDataEdited: (editState: DataCellEditEvent) => Promise<string | true | undefined>;
|
|
38
|
-
onHeaderHeightMeasured: (height: number, count: number) => void;
|
|
39
|
-
onMoveColumn: (columns: ColumnDescriptor[]) => void;
|
|
40
|
-
onMoveGroupColumn: (columns: ColumnDescriptor[]) => void;
|
|
41
|
-
onRemoveGroupColumn: (column: RuntimeColumnDescriptor) => void;
|
|
42
|
-
onRowClick: TableRowClickHandlerInternal;
|
|
43
|
-
onSortColumn: (column: ColumnDescriptor, extendSort?: boolean, sortType?: VuuSortType) => void;
|
|
44
|
-
onResizeColumn: TableColumnResizeHandler;
|
|
45
|
-
onToggleGroup: (row: DataSourceRow, column: RuntimeColumnDescriptor) => void;
|
|
46
|
-
rowClassNameGenerator: import("@vuu-ui/vuu-utils").RowClassNameGenerator | undefined;
|
|
47
|
-
scrollProps: {
|
|
48
|
-
columnsWithinViewport: RuntimeColumnDescriptor[];
|
|
49
|
-
scrollbarContainerRef: (el: HTMLDivElement | null) => void;
|
|
50
|
-
contentContainerRef: (el: HTMLDivElement | null) => void;
|
|
51
|
-
virtualColSpan: number;
|
|
52
|
-
};
|
|
53
|
-
tableAttributes: {
|
|
54
|
-
availableWidth: number;
|
|
55
|
-
columnDefaultWidth?: number;
|
|
56
|
-
columnFormatHeader?: "capitalize" | "uppercase";
|
|
57
|
-
columnLayout?: import("@vuu-ui/vuu-table-types").ColumnLayout;
|
|
58
|
-
columnSeparators?: boolean;
|
|
59
|
-
rowSeparators?: boolean;
|
|
60
|
-
zebraStripes?: boolean;
|
|
61
|
-
};
|
|
62
|
-
tableBodyRef: import("react").RefCallback<HTMLDivElement>;
|
|
63
|
-
tableConfig: Readonly<TableConfig>;
|
|
64
|
-
viewportMeasurements: {
|
|
65
|
-
appliedPageSize: number;
|
|
66
|
-
contentHeight: number;
|
|
67
|
-
horizontalScrollbarHeight: number;
|
|
68
|
-
isVirtualScroll: boolean;
|
|
69
|
-
pinnedWidthLeft: number;
|
|
70
|
-
pinnedWidthRight: number;
|
|
71
|
-
rowCount: number;
|
|
72
|
-
contentWidth: number;
|
|
73
|
-
totalHeaderHeight: number;
|
|
74
|
-
usesMeasuredHeaderHeight: boolean;
|
|
75
|
-
verticalScrollbarWidth: number;
|
|
76
|
-
viewportBodyHeight: number;
|
|
77
|
-
viewportWidth: number;
|
|
78
|
-
};
|
|
79
|
-
onClick: (evt: import("react").MouseEvent) => void;
|
|
80
|
-
onMouseLeave: (() => void) | undefined;
|
|
81
|
-
onMouseMove: ((evt: import("react").MouseEvent) => void) | undefined;
|
|
82
|
-
};
|
|
83
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DataSourceConfig, SchemaColumn } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ColumnDescriptor, TableConfig } from "@vuu-ui/vuu-table-types";
|
|
3
|
-
import { DisplayColumnSettingsAction } from "@vuu-ui/vuu-table-extras/src/column-menu/column-action-types";
|
|
4
|
-
export interface TableAndColumnSettingsHookProps {
|
|
5
|
-
availableColumns: SchemaColumn[];
|
|
6
|
-
onAvailableColumnsChange?: (columns: SchemaColumn[]) => void;
|
|
7
|
-
onConfigChange: (config: TableConfig) => void;
|
|
8
|
-
onCreateCalculatedColumn: (column: ColumnDescriptor) => void;
|
|
9
|
-
onDataSourceConfigChange: (dataSourceConfig: DataSourceConfig) => void;
|
|
10
|
-
tableConfig: TableConfig;
|
|
11
|
-
}
|
|
12
|
-
export declare const useTableAndColumnSettings: ({ availableColumns: availableColumnsProps, onAvailableColumnsChange, onConfigChange, onCreateCalculatedColumn, onDataSourceConfigChange, tableConfig, }: TableAndColumnSettingsHookProps) => {
|
|
13
|
-
showColumnSettingsPanel: (action: DisplayColumnSettingsAction) => void;
|
|
14
|
-
showTableSettingsPanel: () => void;
|
|
15
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DataSource, DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
-
import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
3
|
-
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
4
|
-
import { MouseEvent } from "react";
|
|
5
|
-
export interface TableContextMenuHookProps {
|
|
6
|
-
allowContextMenu?: boolean;
|
|
7
|
-
columns: ColumnDescriptor[];
|
|
8
|
-
data: DataSourceRow[];
|
|
9
|
-
dataSource: DataSource;
|
|
10
|
-
getSelectedRows: () => DataSourceRow[];
|
|
11
|
-
headerCount?: number;
|
|
12
|
-
}
|
|
13
|
-
export type TableMenuLocation = "grid" | "header" | "filter";
|
|
14
|
-
export interface TableContextMenuOptions {
|
|
15
|
-
columnMap: ColumnMap;
|
|
16
|
-
column: ColumnDescriptor;
|
|
17
|
-
columns?: ColumnDescriptor[];
|
|
18
|
-
row: DataSourceRow;
|
|
19
|
-
selectedRows: DataSourceRow[];
|
|
20
|
-
viewport?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare const isTableLocation: (location: string) => location is TableMenuLocation;
|
|
23
|
-
export declare const useTableContextMenu: ({ allowContextMenu, columns, data, dataSource, getSelectedRows, headerCount, }: TableContextMenuHookProps) => ((evt: MouseEvent<HTMLElement>) => void) | undefined;
|
package/types/useTableModel.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ColumnDescriptor, ColumnLayout, PinLocation, ResizePhase, RuntimeColumnDescriptor, TableAttributes, TableConfig, TableHeadings, TableSelectionModel } from "@vuu-ui/vuu-table-types";
|
|
2
|
-
import { DataSource, TableSchema, WithBaseFilter, WithFullConfig } from "@vuu-ui/vuu-data-types";
|
|
3
|
-
/**
|
|
4
|
-
* TableModel represents state used internally to manage Table. It is
|
|
5
|
-
* derived initially from the TableConfig provided by user, along with the
|
|
6
|
-
* data-related config from DataSource.
|
|
7
|
-
*/
|
|
8
|
-
export interface TableModel extends TableAttributes {
|
|
9
|
-
columns: RuntimeColumnDescriptor[];
|
|
10
|
-
headings: TableHeadings;
|
|
11
|
-
}
|
|
12
|
-
export interface ColumnActionInit {
|
|
13
|
-
availableWidth: number;
|
|
14
|
-
type: "init";
|
|
15
|
-
tableConfig: TableConfig;
|
|
16
|
-
dataSource: DataSource;
|
|
17
|
-
}
|
|
18
|
-
export interface ColumnActionHide {
|
|
19
|
-
type: "hideColumns";
|
|
20
|
-
columns: ColumnDescriptor[];
|
|
21
|
-
}
|
|
22
|
-
export interface ColumnActionShow {
|
|
23
|
-
type: "showColumns";
|
|
24
|
-
columns: RuntimeColumnDescriptor[];
|
|
25
|
-
}
|
|
26
|
-
export interface ColumnActionMove {
|
|
27
|
-
type: "moveColumn";
|
|
28
|
-
column: RuntimeColumnDescriptor;
|
|
29
|
-
moveBy?: 1 | -1;
|
|
30
|
-
}
|
|
31
|
-
export interface ColumnActionPin {
|
|
32
|
-
type: "pinColumn";
|
|
33
|
-
column: ColumnDescriptor;
|
|
34
|
-
pin: PinLocation | false;
|
|
35
|
-
}
|
|
36
|
-
export interface ColumnActionResize {
|
|
37
|
-
type: "resizeColumn";
|
|
38
|
-
column: RuntimeColumnDescriptor;
|
|
39
|
-
phase: ResizePhase;
|
|
40
|
-
width?: number;
|
|
41
|
-
}
|
|
42
|
-
export interface ColumnActionSetTableSchema {
|
|
43
|
-
type: "setTableSchema";
|
|
44
|
-
tableSchema: TableSchema;
|
|
45
|
-
}
|
|
46
|
-
export interface ColumnActionUpdate {
|
|
47
|
-
type: "updateColumn";
|
|
48
|
-
column: ColumnDescriptor;
|
|
49
|
-
}
|
|
50
|
-
export interface ColumnActionUpdateProp {
|
|
51
|
-
align?: ColumnDescriptor["align"];
|
|
52
|
-
column: ColumnDescriptor;
|
|
53
|
-
hidden?: ColumnDescriptor["hidden"];
|
|
54
|
-
label?: ColumnDescriptor["label"];
|
|
55
|
-
resizing?: RuntimeColumnDescriptor["resizing"];
|
|
56
|
-
type: "updateColumnProp";
|
|
57
|
-
width?: ColumnDescriptor["width"];
|
|
58
|
-
}
|
|
59
|
-
export interface ColumnActionTableConfig extends WithBaseFilter<WithFullConfig> {
|
|
60
|
-
confirmed?: boolean;
|
|
61
|
-
type: "tableConfig";
|
|
62
|
-
}
|
|
63
|
-
export type TableModelAction = ColumnActionHide | ColumnActionInit | ColumnActionMove | ColumnActionPin | ColumnActionResize | ColumnActionSetTableSchema | ColumnActionShow | ColumnActionUpdate | ColumnActionUpdateProp | ColumnActionTableConfig;
|
|
64
|
-
export type TableModelActionDispatch = (action: TableModelAction) => void;
|
|
65
|
-
export interface TableModelHookProps {
|
|
66
|
-
config: TableConfig;
|
|
67
|
-
dataSource: DataSource;
|
|
68
|
-
selectionModel: TableSelectionModel;
|
|
69
|
-
availableWidth: number;
|
|
70
|
-
}
|
|
71
|
-
export declare const useTableModel: ({ config: tableConfigProp, dataSource, selectionModel, availableWidth, }: TableModelHookProps) => {
|
|
72
|
-
columns: RuntimeColumnDescriptor[];
|
|
73
|
-
dispatchTableModelAction: import("react").ActionDispatch<[action: TableModelAction]>;
|
|
74
|
-
headings: TableHeadings;
|
|
75
|
-
tableAttributes: {
|
|
76
|
-
availableWidth: number;
|
|
77
|
-
columnDefaultWidth?: number;
|
|
78
|
-
columnFormatHeader?: "capitalize" | "uppercase";
|
|
79
|
-
columnLayout?: ColumnLayout;
|
|
80
|
-
columnSeparators?: boolean;
|
|
81
|
-
rowSeparators?: boolean;
|
|
82
|
-
zebraStripes?: boolean;
|
|
83
|
-
};
|
|
84
|
-
tableConfig: Readonly<TableConfig>;
|
|
85
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { RowAtPositionFunc } from "@vuu-ui/vuu-utils";
|
|
2
|
-
import type { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
-
import { ForwardedRef, MutableRefObject } from "react";
|
|
4
|
-
import type { ViewportMeasurements } from "./useTableViewport";
|
|
5
|
-
import type { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
6
|
-
import { FocusCell } from "./useCellFocus";
|
|
7
|
-
import { ICellFocusState } from "./CellFocusState";
|
|
8
|
-
export type ScrollDirectionVertical = "up" | "down";
|
|
9
|
-
export type ScrollDirectionHorizontal = "left" | "right";
|
|
10
|
-
export type ScrollDirection = ScrollDirectionVertical | ScrollDirectionHorizontal;
|
|
11
|
-
/**
|
|
12
|
-
* scroll into view the row at given pixel offset.
|
|
13
|
-
*/
|
|
14
|
-
export interface ScrollRequestPosition {
|
|
15
|
-
scrollPos: number;
|
|
16
|
-
type: "scroll-top" | "scroll-bottom";
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* scroll into view the row at given row index posiiton.
|
|
20
|
-
*/
|
|
21
|
-
export interface ScrollRequestRow {
|
|
22
|
-
rowIndex: number;
|
|
23
|
-
type: "scroll-row";
|
|
24
|
-
}
|
|
25
|
-
export interface ScrollRequestEnd {
|
|
26
|
-
type: "scroll-end";
|
|
27
|
-
direction: "home" | "end";
|
|
28
|
-
}
|
|
29
|
-
export interface ScrollRequestPage {
|
|
30
|
-
type: "scroll-page";
|
|
31
|
-
direction: ScrollDirectionVertical;
|
|
32
|
-
}
|
|
33
|
-
export type ScrollRequest = ScrollRequestPage | ScrollRequestEnd | ScrollRequestRow | ScrollRequestPosition;
|
|
34
|
-
export type ScrollRequestHandler = (request: ScrollRequest) => void;
|
|
35
|
-
export interface ScrollingAPI {
|
|
36
|
-
scrollToIndex: (itemIndex: number) => void;
|
|
37
|
-
scrollToKey: (rowKey: string) => void;
|
|
38
|
-
}
|
|
39
|
-
export declare const noScrolling: ScrollingAPI;
|
|
40
|
-
export interface TableScrollHookProps {
|
|
41
|
-
cellFocusStateRef: MutableRefObject<ICellFocusState>;
|
|
42
|
-
columns: RuntimeColumnDescriptor[];
|
|
43
|
-
focusCell?: FocusCell;
|
|
44
|
-
getRowAtPosition: RowAtPositionFunc;
|
|
45
|
-
onHorizontalScroll?: (scrollLeft: number) => void;
|
|
46
|
-
onVerticalScroll?: (scrollTop: number, pctScrollTop: number) => void;
|
|
47
|
-
/**
|
|
48
|
-
* When we have a virtualized scroll container, keyboard navigation is
|
|
49
|
-
* performed `in situ`. We shift the range of rows rendered within the
|
|
50
|
-
* viewport, whithout actually moving the scroll position
|
|
51
|
-
*/
|
|
52
|
-
onVerticalScrollInSitu?: (rowIndexOffsetCount: number) => void;
|
|
53
|
-
rowHeight: number;
|
|
54
|
-
scrollingApiRef?: ForwardedRef<ScrollingAPI>;
|
|
55
|
-
setRange: (range: VuuRange) => void;
|
|
56
|
-
showPaginationControls?: boolean;
|
|
57
|
-
viewportMeasurements: ViewportMeasurements;
|
|
58
|
-
}
|
|
59
|
-
export declare const useTableScroll: ({ cellFocusStateRef, columns, focusCell, getRowAtPosition, onHorizontalScroll, onVerticalScroll, onVerticalScrollInSitu, rowHeight, scrollingApiRef, setRange, viewportMeasurements, }: TableScrollHookProps) => {
|
|
60
|
-
columnsWithinViewport: RuntimeColumnDescriptor[];
|
|
61
|
-
/** Ref to be assigned to ScrollbarContainer */
|
|
62
|
-
scrollbarContainerRef: (el: HTMLDivElement | null) => void;
|
|
63
|
-
/** Ref to be assigned to ContentContainer */
|
|
64
|
-
contentContainerRef: (el: HTMLDivElement | null) => void;
|
|
65
|
-
/** Scroll the table */
|
|
66
|
-
requestScroll: ScrollRequestHandler;
|
|
67
|
-
/** number of leading columns not rendered because of virtualization */
|
|
68
|
-
virtualColSpan: number;
|
|
69
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This hook measures and calculates the values needed to manage layout
|
|
3
|
-
* and virtualisation of the table. This includes measurements required
|
|
4
|
-
* to support pinned columns.
|
|
5
|
-
*/
|
|
6
|
-
import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
7
|
-
import { MeasuredSize } from "@vuu-ui/vuu-ui-controls";
|
|
8
|
-
import { RowAtPositionFunc, RowOffsetFunc } from "@vuu-ui/vuu-utils";
|
|
9
|
-
export interface TableViewportHookProps {
|
|
10
|
-
columns: RuntimeColumnDescriptor[];
|
|
11
|
-
headerHeight: number;
|
|
12
|
-
rowCount: number;
|
|
13
|
-
rowHeight: number;
|
|
14
|
-
/**
|
|
15
|
-
* this is the solid left/right `border` rendered on the selection block
|
|
16
|
-
*/
|
|
17
|
-
selectionEndSize?: number;
|
|
18
|
-
showPaginationControls?: boolean;
|
|
19
|
-
size: MeasuredSize;
|
|
20
|
-
}
|
|
21
|
-
export interface ViewportMeasurements {
|
|
22
|
-
appliedPageSize: number;
|
|
23
|
-
contentHeight: number;
|
|
24
|
-
horizontalScrollbarHeight: number;
|
|
25
|
-
isVirtualScroll: boolean;
|
|
26
|
-
pinnedWidthLeft: number;
|
|
27
|
-
pinnedWidthRight: number;
|
|
28
|
-
rowCount: number;
|
|
29
|
-
contentWidth: number;
|
|
30
|
-
totalHeaderHeight: number;
|
|
31
|
-
usesMeasuredHeaderHeight: boolean;
|
|
32
|
-
verticalScrollbarWidth: number;
|
|
33
|
-
viewportBodyHeight: number;
|
|
34
|
-
viewportWidth: number;
|
|
35
|
-
}
|
|
36
|
-
export interface TableViewportHookResult extends ViewportMeasurements {
|
|
37
|
-
getRowAtPosition: RowAtPositionFunc;
|
|
38
|
-
getRowOffset: RowOffsetFunc;
|
|
39
|
-
setInSituRowOffset: (rowIndexOffset: number) => void;
|
|
40
|
-
setScrollTop: (scrollTop: number, scrollPct: number) => void;
|
|
41
|
-
}
|
|
42
|
-
export declare const useTableViewport: ({ columns, headerHeight, rowCount, rowHeight, selectionEndSize, showPaginationControls, size, }: TableViewportHookProps) => TableViewportHookResult;
|