@vuu-ui/vuu-table 0.8.12 → 0.8.13

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 (199) hide show
  1. package/cjs/index.js +1 -1
  2. package/cjs/index.js.map +4 -4
  3. package/esm/index.js +1 -1
  4. package/esm/index.js.map +4 -4
  5. package/index.css +1 -1
  6. package/index.css.map +3 -3
  7. package/package.json +9 -9
  8. package/types/vuu-table/src/{table-next/Row.d.ts → Row.d.ts} +5 -5
  9. package/types/vuu-table/src/Table.d.ts +72 -0
  10. package/types/vuu-table/src/cell-renderers/cell-utils.d.ts +7 -0
  11. package/types/vuu-table/src/cell-renderers/checkbox-cell/CheckboxCell.d.ts +3 -0
  12. package/types/vuu-table/src/cell-renderers/checkbox-cell/index.d.ts +1 -0
  13. package/types/vuu-table/src/cell-renderers/dropdown-cell/DropdownCell.d.ts +4 -0
  14. package/types/vuu-table/src/cell-renderers/index.d.ts +5 -0
  15. package/types/vuu-table/src/{table-next/cell-renderers → cell-renderers}/input-cell/InputCell.d.ts +1 -1
  16. package/types/vuu-table/src/cell-renderers/lookup-cell/LookupCell.d.ts +3 -0
  17. package/types/vuu-table/src/cell-renderers/lookup-cell/index.d.ts +1 -0
  18. package/types/vuu-table/src/cell-renderers/toggle-cell/ToggleCell.d.ts +4 -0
  19. package/types/vuu-table/src/cell-renderers/toggle-cell/index.d.ts +1 -0
  20. package/types/vuu-table/src/{table-next/column-header-pill → column-header-pill}/ColumnHeaderPill.d.ts +3 -3
  21. package/types/vuu-table/src/{table-next/column-header-pill → column-header-pill}/GroupColumnPill.d.ts +2 -2
  22. package/types/vuu-table/src/{table-next/column-header-pill → column-header-pill}/SortIndicator.d.ts +2 -2
  23. package/types/vuu-table/src/{table-next/column-menu → column-menu}/ColumnMenu.d.ts +2 -2
  24. package/types/vuu-table/src/{table-next/column-resizing → column-resizing}/useTableColumnResize.d.ts +2 -2
  25. package/types/vuu-table/src/{table-next/context-menu → context-menu}/index.d.ts +1 -1
  26. package/types/vuu-table/src/{table-next/context-menu/useTableContextMenu.d.ts → context-menu/useHandleTableContextMenu.d.ts} +3 -3
  27. package/types/vuu-table/src/header-cell/GroupHeaderCellNext.d.ts +10 -0
  28. package/types/vuu-table/src/{table-next/header-cell → header-cell}/HeaderCell.d.ts +2 -2
  29. package/types/vuu-table/src/{table-next/header-cell → header-cell}/index.d.ts +0 -1
  30. package/types/vuu-table/src/index.d.ts +9 -4
  31. package/types/vuu-table/src/{table-next/table-cell → table-cell}/TableCell.d.ts +1 -1
  32. package/types/vuu-table/src/{table-next/table-cell → table-cell}/TableGroupCell.d.ts +1 -1
  33. package/types/vuu-table/src/{table-next/table-config.d.ts → table-config.d.ts} +1 -1
  34. package/types/vuu-table/src/{table-next/table-dom-utils.d.ts → table-dom-utils.d.ts} +3 -1
  35. package/types/vuu-table/src/table-header/TableHeader.d.ts +18 -0
  36. package/types/vuu-table/src/table-header/useTableHeader.d.ts +15 -0
  37. package/types/vuu-table/src/useCell.d.ts +6 -0
  38. package/types/vuu-table/src/useCellEditing.d.ts +10 -0
  39. package/types/vuu-table/src/useControlledTableNavigation.d.ts +7 -0
  40. package/types/vuu-table/src/{table-next/useDataSource.d.ts → useDataSource.d.ts} +5 -3
  41. package/types/vuu-table/src/{table-next/useKeyboardNavigation.d.ts → useKeyboardNavigation.d.ts} +9 -2
  42. package/types/vuu-table/src/useSelection.d.ts +14 -0
  43. package/types/vuu-table/src/useTable.d.ts +66 -0
  44. package/types/vuu-table/src/useTableContextMenu.d.ts +11 -0
  45. package/types/vuu-table/src/{table-next/useTableModel.d.ts → useTableModel.d.ts} +12 -14
  46. package/types/vuu-table/src/{table-next/useTableViewport.d.ts → useTableViewport.d.ts} +2 -2
  47. package/types/vuu-table/src/{table-next/useVirtualViewport.d.ts → useVirtualViewport.d.ts} +2 -2
  48. package/types/vuu-ui-controls/src/drag-drop/DragDropState.d.ts +15 -0
  49. package/types/vuu-ui-controls/src/drag-drop/dragDropTypesNext.d.ts +91 -0
  50. package/types/vuu-layout/src/Component.d.ts +0 -7
  51. package/types/vuu-layout/src/DraggableLayout.d.ts +0 -7
  52. package/types/vuu-layout/src/dock-layout/DockLayout.d.ts +0 -10
  53. package/types/vuu-layout/src/dock-layout/Drawer.d.ts +0 -18
  54. package/types/vuu-layout/src/dock-layout/index.d.ts +0 -2
  55. package/types/vuu-layout/src/drag-drop/BoxModel.d.ts +0 -143
  56. package/types/vuu-layout/src/drag-drop/DragState.d.ts +0 -46
  57. package/types/vuu-layout/src/drag-drop/Draggable.d.ts +0 -24
  58. package/types/vuu-layout/src/drag-drop/DropMenu.d.ts +0 -10
  59. package/types/vuu-layout/src/drag-drop/DropTarget.d.ts +0 -61
  60. package/types/vuu-layout/src/drag-drop/DropTargetRenderer.d.ts +0 -18
  61. package/types/vuu-layout/src/drag-drop/dragDropTypes.d.ts +0 -51
  62. package/types/vuu-layout/src/drag-drop/index.d.ts +0 -4
  63. package/types/vuu-layout/src/flexbox/Flexbox.d.ts +0 -5
  64. package/types/vuu-layout/src/flexbox/FlexboxLayout.d.ts +0 -6
  65. package/types/vuu-layout/src/flexbox/FluidGrid.d.ts +0 -7
  66. package/types/vuu-layout/src/flexbox/FluidGridLayout.d.ts +0 -6
  67. package/types/vuu-layout/src/flexbox/Splitter.d.ts +0 -13
  68. package/types/vuu-layout/src/flexbox/flexbox-utils.d.ts +0 -12
  69. package/types/vuu-layout/src/flexbox/flexboxTypes.d.ts +0 -51
  70. package/types/vuu-layout/src/flexbox/index.d.ts +0 -4
  71. package/types/vuu-layout/src/flexbox/useResponsiveSizing.d.ts +0 -10
  72. package/types/vuu-layout/src/flexbox/useSplitterResizing.d.ts +0 -2
  73. package/types/vuu-layout/src/index.d.ts +0 -22
  74. package/types/vuu-layout/src/layout-action.d.ts +0 -22
  75. package/types/vuu-layout/src/layout-header/Header.d.ts +0 -13
  76. package/types/vuu-layout/src/layout-header/index.d.ts +0 -1
  77. package/types/vuu-layout/src/layout-persistence/LayoutPersistenceManager.d.ts +0 -53
  78. package/types/vuu-layout/src/layout-persistence/LocalLayoutPersistenceManager.d.ts +0 -18
  79. package/types/vuu-layout/src/layout-persistence/data.d.ts +0 -3
  80. package/types/vuu-layout/src/layout-persistence/index.d.ts +0 -4
  81. package/types/vuu-layout/src/layout-persistence/useLayoutContextMenuItems.d.ts +0 -8
  82. package/types/vuu-layout/src/layout-provider/LayoutProvider.d.ts +0 -15
  83. package/types/vuu-layout/src/layout-provider/LayoutProviderContext.d.ts +0 -9
  84. package/types/vuu-layout/src/layout-provider/index.d.ts +0 -2
  85. package/types/vuu-layout/src/layout-provider/useLayoutDragDrop.d.ts +0 -4
  86. package/types/vuu-layout/src/layout-reducer/flexUtils.d.ts +0 -22
  87. package/types/vuu-layout/src/layout-reducer/index.d.ts +0 -4
  88. package/types/vuu-layout/src/layout-reducer/insert-layout-element.d.ts +0 -8
  89. package/types/vuu-layout/src/layout-reducer/layout-reducer.d.ts +0 -3
  90. package/types/vuu-layout/src/layout-reducer/layoutTypes.d.ts +0 -168
  91. package/types/vuu-layout/src/layout-reducer/layoutUtils.d.ts +0 -31
  92. package/types/vuu-layout/src/layout-reducer/move-layout-element.d.ts +0 -3
  93. package/types/vuu-layout/src/layout-reducer/remove-layout-element.d.ts +0 -3
  94. package/types/vuu-layout/src/layout-reducer/replace-layout-element.d.ts +0 -6
  95. package/types/vuu-layout/src/layout-reducer/resize-flex-children.d.ts +0 -4
  96. package/types/vuu-layout/src/layout-reducer/wrap-layout-element.d.ts +0 -9
  97. package/types/vuu-layout/src/layout-view/View.d.ts +0 -11
  98. package/types/vuu-layout/src/layout-view/ViewContext.d.ts +0 -30
  99. package/types/vuu-layout/src/layout-view/index.d.ts +0 -4
  100. package/types/vuu-layout/src/layout-view/useView.d.ts +0 -21
  101. package/types/vuu-layout/src/layout-view/useViewActionDispatcher.d.ts +0 -9
  102. package/types/vuu-layout/src/layout-view/useViewResize.d.ts +0 -7
  103. package/types/vuu-layout/src/layout-view/viewTypes.d.ts +0 -21
  104. package/types/vuu-layout/src/measured-container/MeasuredContainer.d.ts +0 -9
  105. package/types/vuu-layout/src/measured-container/index.d.ts +0 -2
  106. package/types/vuu-layout/src/measured-container/useMeasuredContainer.d.ts +0 -22
  107. package/types/vuu-layout/src/measured-container/useResizeObserver.d.ts +0 -15
  108. package/types/vuu-layout/src/overflow-container/OverflowContainer.d.ts +0 -17
  109. package/types/vuu-layout/src/overflow-container/index.d.ts +0 -2
  110. package/types/vuu-layout/src/overflow-container/overflow-utils.d.ts +0 -49
  111. package/types/vuu-layout/src/overflow-container/useOverflowContainer.d.ts +0 -20
  112. package/types/vuu-layout/src/palette/Palette.d.ts +0 -22
  113. package/types/vuu-layout/src/palette/index.d.ts +0 -1
  114. package/types/vuu-layout/src/placeholder/Placeholder.d.ts +0 -12
  115. package/types/vuu-layout/src/placeholder/index.d.ts +0 -1
  116. package/types/vuu-layout/src/registry/ComponentRegistry.d.ts +0 -13
  117. package/types/vuu-layout/src/registry/index.d.ts +0 -1
  118. package/types/vuu-layout/src/responsive/breakpoints.d.ts +0 -4
  119. package/types/vuu-layout/src/responsive/index.d.ts +0 -3
  120. package/types/vuu-layout/src/responsive/use-breakpoints.d.ts +0 -7
  121. package/types/vuu-layout/src/responsive/useResizeObserver.d.ts +0 -13
  122. package/types/vuu-layout/src/responsive/utils.d.ts +0 -6
  123. package/types/vuu-layout/src/stack/Stack.d.ts +0 -4
  124. package/types/vuu-layout/src/stack/StackLayout.d.ts +0 -7
  125. package/types/vuu-layout/src/stack/index.d.ts +0 -3
  126. package/types/vuu-layout/src/stack/stackTypes.d.ts +0 -21
  127. package/types/vuu-layout/src/toolbar/Toolbar.d.ts +0 -19
  128. package/types/vuu-layout/src/toolbar/index.d.ts +0 -1
  129. package/types/vuu-layout/src/toolbar/toolbar-dom-utils.d.ts +0 -3
  130. package/types/vuu-layout/src/toolbar/useKeyboardNavigation.d.ts +0 -32
  131. package/types/vuu-layout/src/toolbar/useSelection.d.ts +0 -22
  132. package/types/vuu-layout/src/toolbar/useToolbar.d.ts +0 -28
  133. package/types/vuu-layout/src/tools/config-wrapper/ConfigWrapper.d.ts +0 -2
  134. package/types/vuu-layout/src/tools/config-wrapper/index.d.ts +0 -1
  135. package/types/vuu-layout/src/tools/devtools-box/layout-configurator.d.ts +0 -31
  136. package/types/vuu-layout/src/tools/devtools-tree/layout-tree-viewer.d.ts +0 -5
  137. package/types/vuu-layout/src/tools/index.d.ts +0 -3
  138. package/types/vuu-layout/src/use-persistent-state.d.ts +0 -11
  139. package/types/vuu-layout/src/utils/index.d.ts +0 -6
  140. package/types/vuu-layout/src/utils/pathUtils.d.ts +0 -31
  141. package/types/vuu-layout/src/utils/propUtils.d.ts +0 -5
  142. package/types/vuu-layout/src/utils/react-utils.d.ts +0 -4
  143. package/types/vuu-layout/src/utils/refUtils.d.ts +0 -2
  144. package/types/vuu-layout/src/utils/styleUtils.d.ts +0 -3
  145. package/types/vuu-layout/src/utils/typeOf.d.ts +0 -4
  146. package/types/vuu-table/src/table/ColumnResizer.d.ts +0 -8
  147. package/types/vuu-table/src/table/DragVisualizer.d.ts +0 -8
  148. package/types/vuu-table/src/table/RowBasedTable.d.ts +0 -4
  149. package/types/vuu-table/src/table/SortIndicator.d.ts +0 -7
  150. package/types/vuu-table/src/table/Table.d.ts +0 -9
  151. package/types/vuu-table/src/table/TableCell.d.ts +0 -4
  152. package/types/vuu-table/src/table/TableGroupCell.d.ts +0 -4
  153. package/types/vuu-table/src/table/TableGroupHeaderCell.d.ts +0 -13
  154. package/types/vuu-table/src/table/TableHeaderCell.d.ts +0 -11
  155. package/types/vuu-table/src/table/TableRow.d.ts +0 -16
  156. package/types/vuu-table/src/table/cell-renderers/index.d.ts +0 -1
  157. package/types/vuu-table/src/table/cell-renderers/json-cell/JsonCell.d.ts +0 -1
  158. package/types/vuu-table/src/table/cell-renderers/json-cell/index.d.ts +0 -1
  159. package/types/vuu-table/src/table/context-menu/buildContextMenuDescriptors.d.ts +0 -4
  160. package/types/vuu-table/src/table/context-menu/index.d.ts +0 -2
  161. package/types/vuu-table/src/table/context-menu/useTableContextMenu.d.ts +0 -16
  162. package/types/vuu-table/src/table/dataTableTypes.d.ts +0 -109
  163. package/types/vuu-table/src/table/filter-indicator.d.ts +0 -13
  164. package/types/vuu-table/src/table/index.d.ts +0 -10
  165. package/types/vuu-table/src/table/keyUtils.d.ts +0 -19
  166. package/types/vuu-table/src/table/useDataSource.d.ts +0 -41
  167. package/types/vuu-table/src/table/useDraggableColumn.d.ts +0 -9
  168. package/types/vuu-table/src/table/useKeyboardNavigation.d.ts +0 -22
  169. package/types/vuu-table/src/table/useMeasuredContainer.d.ts +0 -30
  170. package/types/vuu-table/src/table/useMeasuredSize.d.ts +0 -26
  171. package/types/vuu-table/src/table/useResizeObserver.d.ts +0 -15
  172. package/types/vuu-table/src/table/useSelection.d.ts +0 -9
  173. package/types/vuu-table/src/table/useTable.d.ts +0 -62
  174. package/types/vuu-table/src/table/useTableColumnResize.d.ts +0 -17
  175. package/types/vuu-table/src/table/useTableModel.d.ts +0 -80
  176. package/types/vuu-table/src/table/useTableScroll.d.ts +0 -29
  177. package/types/vuu-table/src/table/useVirtualViewport.d.ts +0 -17
  178. package/types/vuu-table/src/table-next/TableNext.d.ts +0 -4
  179. package/types/vuu-table/src/table-next/cell-renderers/dropdown-cell/DropdownCell.d.ts +0 -4
  180. package/types/vuu-table/src/table-next/cell-renderers/index.d.ts +0 -2
  181. package/types/vuu-table/src/table-next/header-cell/GroupHeaderCell.d.ts +0 -9
  182. package/types/vuu-table/src/table-next/header-cell/GroupHeaderCellNext.d.ts +0 -9
  183. package/types/vuu-table/src/table-next/index.d.ts +0 -5
  184. package/types/vuu-table/src/table-next/useCell.d.ts +0 -6
  185. package/types/vuu-table/src/table-next/useCellEditing.d.ts +0 -7
  186. package/types/vuu-table/src/table-next/useTableContextMenu.d.ts +0 -8
  187. package/types/vuu-table/src/table-next/useTableNext.d.ts +0 -66
  188. /package/types/vuu-table/src/{table-next/cell-renderers → cell-renderers}/dropdown-cell/index.d.ts +0 -0
  189. /package/types/vuu-table/src/{table-next/cell-renderers → cell-renderers}/input-cell/index.d.ts +0 -0
  190. /package/types/vuu-table/src/{table-next/column-header-pill → column-header-pill}/index.d.ts +0 -0
  191. /package/types/vuu-table/src/{table-next/column-menu → column-menu}/index.d.ts +0 -0
  192. /package/types/vuu-table/src/{table-next/column-resizing → column-resizing}/ColumnResizer.d.ts +0 -0
  193. /package/types/vuu-table/src/{table-next/column-resizing → column-resizing}/index.d.ts +0 -0
  194. /package/types/vuu-table/src/{table-next/context-menu → context-menu}/buildContextMenuDescriptors.d.ts +0 -0
  195. /package/types/vuu-table/src/{table-next/moving-window.d.ts → moving-window.d.ts} +0 -0
  196. /package/types/vuu-table/src/{table-next/table-cell → table-cell}/index.d.ts +0 -0
  197. /package/types/vuu-table/src/{table-next/useInitialValue.d.ts → useInitialValue.d.ts} +0 -0
  198. /package/types/vuu-table/src/{table-next/useResizeObserver.d.ts → useResizeObserver.d.ts} +0 -0
  199. /package/types/vuu-table/src/{table-next/useTableScroll.d.ts → useTableScroll.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { TableCellProps } from "@vuu-ui/vuu-datagrid-types";
2
+ import { TableCellProps } from "@vuu-ui/vuu-table-types";
3
3
  import "./TableGroupCell.css";
4
4
  export declare const TableGroupCell: ({ column, onClick, row }: TableCellProps) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ColumnDescriptor, TableConfig } from "@vuu-ui/vuu-datagrid-types";
1
+ import { ColumnDescriptor, TableConfig } from "@vuu-ui/vuu-table-types";
2
2
  export type MoveColumnTableConfigAction = {
3
3
  type: "col-move";
4
4
  column: ColumnDescriptor;
@@ -4,4 +4,6 @@ export declare const headerCellQuery: (colIdx: number) => string;
4
4
  export declare const dataCellQuery: (rowIdx: number, colIdx: number) => string;
5
5
  export declare const getTableCell: (containerRef: RefObject<HTMLElement>, [rowIdx, colIdx]: CellPos) => HTMLElement;
6
6
  export declare const cellIsEditable: (cell: HTMLDivElement) => boolean;
7
- export declare const cellIsTextInput: (cell: HTMLDivElement) => boolean;
7
+ export declare const cellIsTextInput: (cell: HTMLElement) => boolean;
8
+ export declare function getRowIndex(rowEl?: HTMLElement): number;
9
+ export declare const closestRowIndex: (el: HTMLElement) => number;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { ColumnDescriptor, RuntimeColumnDescriptor, TableConfig, TableHeadings } from "@vuu-ui/vuu-table-types";
3
+ import { VuuSortType } from "packages/vuu-protocol-types";
4
+ import { TableColumnResizeHandler } from "../column-resizing";
5
+ export type ColumnSortHandler = (column: ColumnDescriptor, addToExistingSort: boolean, sortType?: VuuSortType) => void;
6
+ export interface TableHeaderProps {
7
+ classBase?: string;
8
+ columns: RuntimeColumnDescriptor[];
9
+ headings: TableHeadings;
10
+ onResizeColumn: TableColumnResizeHandler;
11
+ onMoveColumn: (columns: ColumnDescriptor[]) => void;
12
+ onMoveGroupColumn: (columns: ColumnDescriptor[]) => void;
13
+ onRemoveGroupColumn: (column: RuntimeColumnDescriptor) => void;
14
+ onSortColumn: ColumnSortHandler;
15
+ tableConfig: TableConfig;
16
+ tableId: string;
17
+ }
18
+ export declare const TableHeader: ({ classBase, columns, headings, onMoveColumn, onMoveGroupColumn, onRemoveGroupColumn, onResizeColumn, onSortColumn, tableConfig, tableId, }: TableHeaderProps) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
+ import { MouseEventHandler } from "react";
3
+ import { TableHeaderProps } from "./TableHeader";
4
+ export interface TableHeaderHookProps extends Pick<TableHeaderProps, "columns" | "onMoveColumn" | "onSortColumn" | "tableConfig"> {
5
+ label?: string;
6
+ onMoveColumn: (columns: ColumnDescriptor[]) => void;
7
+ onSortColumn: (column: ColumnDescriptor, addToExistingSort: boolean) => void;
8
+ }
9
+ export declare const useTableHeader: ({ columns, onMoveColumn, onSortColumn, tableConfig, }: TableHeaderHookProps) => {
10
+ containerRef: import("react").RefObject<HTMLDivElement>;
11
+ draggableColumn: JSX.Element | undefined;
12
+ draggedColumnIndex: number | undefined;
13
+ onClick: MouseEventHandler<HTMLDivElement>;
14
+ onMouseDown: MouseEventHandler<Element> | undefined;
15
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
3
+ export declare const useCell: (column: RuntimeColumnDescriptor, classBase: string, isHeader?: boolean) => {
4
+ className: string;
5
+ style: import("react").CSSProperties;
6
+ };
@@ -0,0 +1,10 @@
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<Element>;
7
+ onDoubleClick: (e: MouseEvent<HTMLElement>) => void;
8
+ onFocus: FocusEventHandler<Element>;
9
+ onKeyDown: (e: ReactKeyboardEvent<HTMLElement>) => void;
10
+ };
@@ -0,0 +1,7 @@
1
+ import { KeyboardEventHandler } from "react";
2
+ export declare const useControlledTableNavigation: (initialValue: number, rowCount: number) => {
3
+ highlightedIndexRef: import("react").MutableRefObject<number | undefined>;
4
+ onHighlight: (idx: number) => void;
5
+ onKeyDown: KeyboardEventHandler<Element>;
6
+ tableRef: import("react").RefObject<HTMLDivElement>;
7
+ };
@@ -1,17 +1,19 @@
1
- import { DataSource, DataSourceSubscribedMessage, VuuFeatureInvocationMessage, VuuFeatureMessage } from "@vuu-ui/vuu-data";
1
+ /// <reference types="react" />
2
+ import { DataSource, DataSourceSubscribedMessage, VuuFeatureInvocationMessage } from "@vuu-ui/vuu-data";
2
3
  import { DataSourceRow } from "@vuu-ui/vuu-data-types";
3
4
  import { VuuRange } from "@vuu-ui/vuu-protocol-types";
4
5
  export interface DataSourceHookProps {
5
6
  dataSource: DataSource;
6
- onFeatureEnabled?: (message: VuuFeatureMessage) => void;
7
7
  onFeatureInvocation?: (message: VuuFeatureInvocationMessage) => void;
8
8
  onSizeChange: (size: number) => void;
9
9
  onSubscribed: (subscription: DataSourceSubscribedMessage) => void;
10
10
  range?: VuuRange;
11
11
  renderBufferSize?: number;
12
12
  }
13
- export declare const useDataSource: ({ dataSource, onFeatureEnabled, onFeatureInvocation, onSizeChange, onSubscribed, range, renderBufferSize, }: DataSourceHookProps) => {
13
+ export declare const useDataSource: ({ dataSource, onFeatureInvocation, onSizeChange, onSubscribed, range, renderBufferSize, }: DataSourceHookProps) => {
14
14
  data: DataSourceRow[];
15
+ dataRef: import("react").MutableRefObject<DataSourceRow[]>;
16
+ getSelectedRows: () => DataSourceRow[];
15
17
  range: VuuRange;
16
18
  setRange: (range: VuuRange) => void;
17
19
  };
@@ -1,7 +1,7 @@
1
1
  import { VuuRange } from "@vuu-ui/vuu-protocol-types";
2
2
  import { KeyboardEvent, MouseEvent, RefObject } from "react";
3
3
  import { ScrollRequestHandler } from "./useTableScroll";
4
- import { TableNavigationStyle } from "../table/dataTableTypes";
4
+ import { TableNavigationStyle } from "./Table";
5
5
  export declare const isNavigationKey: (key: string, navigationStyle: TableNavigationStyle) => key is NavigationKey;
6
6
  type ArrowKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight";
7
7
  type PageKey = "Home" | "End" | "PageUp" | "PageDown";
@@ -10,20 +10,27 @@ export declare const isPagingKey: (key: string) => key is PageKey;
10
10
  export interface NavigationHookProps {
11
11
  containerRef: RefObject<HTMLElement>;
12
12
  columnCount?: number;
13
+ defaultHighlightedIndex?: number;
14
+ disableFocus?: boolean;
13
15
  disableHighlightOnFocus?: boolean;
16
+ highlightedIndex?: number;
14
17
  label?: string;
15
18
  navigationStyle: TableNavigationStyle;
16
19
  viewportRange: VuuRange;
20
+ onHighlight?: (idx: number) => void;
17
21
  requestScroll?: ScrollRequestHandler;
18
22
  restoreLastFocus?: boolean;
19
23
  rowCount?: number;
20
24
  selected?: unknown;
21
25
  viewportRowCount: number;
22
26
  }
23
- export declare const useKeyboardNavigation: ({ columnCount, containerRef, disableHighlightOnFocus, navigationStyle, requestScroll, rowCount, viewportRowCount, }: NavigationHookProps) => {
27
+ export declare const useKeyboardNavigation: ({ columnCount, containerRef, disableFocus, defaultHighlightedIndex, disableHighlightOnFocus, highlightedIndex: highlightedIndexProp, navigationStyle, requestScroll, onHighlight, rowCount, viewportRowCount, }: NavigationHookProps) => {
28
+ highlightedIndexRef: import("react").MutableRefObject<number | undefined>;
24
29
  navigate: () => void;
25
30
  onClick: (evt: MouseEvent) => void;
26
31
  onFocus: () => void;
27
32
  onKeyDown: (e: KeyboardEvent) => void;
33
+ onMouseLeave: (() => void) | undefined;
34
+ onMouseMove: ((evt: MouseEvent) => void) | undefined;
28
35
  };
29
36
  export {};
@@ -0,0 +1,14 @@
1
+ import { RowClickHandler, SelectionChangeHandler, TableSelectionModel } from "@vuu-ui/vuu-table-types";
2
+ import { DataSourceRow } from "packages/vuu-data-types";
3
+ import { KeyboardEventHandler, MutableRefObject } from "react";
4
+ export interface SelectionHookProps {
5
+ highlightedIndexRef: MutableRefObject<number | undefined>;
6
+ selectionKeys?: string[];
7
+ selectionModel: TableSelectionModel;
8
+ onSelect?: (row: DataSourceRow) => void;
9
+ onSelectionChange: SelectionChangeHandler;
10
+ }
11
+ export declare const useSelection: ({ highlightedIndexRef, selectionKeys, selectionModel, onSelect, onSelectionChange, }: SelectionHookProps) => {
12
+ onKeyDown: KeyboardEventHandler<HTMLElement>;
13
+ onRowClick: RowClickHandler;
14
+ };
@@ -0,0 +1,66 @@
1
+ import { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
+ import { ColumnDescriptor, DataCellEditHandler, RowClickHandler, RuntimeColumnDescriptor, TableConfig, TableSelectionModel } from "@vuu-ui/vuu-table-types";
3
+ import { MeasuredProps, MeasuredSize } from "@vuu-ui/vuu-layout";
4
+ import { VuuSortType } from "@vuu-ui/vuu-protocol-types";
5
+ import { FocusEvent, KeyboardEvent, RefObject } from "react";
6
+ import { TableColumnResizeHandler } from "./column-resizing";
7
+ import { TableProps } from "./Table";
8
+ export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowDragDrop" | "availableColumns" | "config" | "dataSource" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDragStart" | "onDrop" | "onFeatureInvocation" | "onHighlight" | "onSelect" | "onSelectionChange" | "onRowClick" | "renderBufferSize"> {
9
+ containerRef: RefObject<HTMLDivElement>;
10
+ headerHeight: number;
11
+ rowHeight: number;
12
+ selectionModel: TableSelectionModel;
13
+ size: MeasuredSize;
14
+ }
15
+ export declare const useTable: ({ allowDragDrop, availableColumns, config, containerRef, dataSource, disableFocus, headerHeight, highlightedIndex: highlightedIndexProp, id, navigationStyle, onAvailableColumnsChange, onConfigChange, onDragStart, onDrop, onFeatureInvocation, onHighlight, onRowClick: onRowClickProp, onSelect, onSelectionChange, renderBufferSize, rowHeight, selectionModel, size, }: TableHookProps) => {
16
+ draggableRow: JSX.Element | undefined;
17
+ onBlur: import("react").FocusEventHandler<Element>;
18
+ onDoubleClick: (e: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
19
+ onFocus: (e: FocusEvent<HTMLElement>) => void;
20
+ onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
21
+ onMouseDown: import("react").MouseEventHandler<Element> | undefined;
22
+ columnMap: import("@vuu-ui/vuu-utils").ColumnMap;
23
+ columns: RuntimeColumnDescriptor[];
24
+ data: DataSourceRow[];
25
+ handleContextMenuAction: import("@vuu-ui/vuu-data-types").MenuActionHandler;
26
+ headings: import("@vuu-ui/vuu-table-types").TableHeadings;
27
+ highlightedIndex: number | undefined;
28
+ menuBuilder: import("@vuu-ui/vuu-data-types").MenuBuilder<string, unknown>;
29
+ onContextMenu: (evt: import("react").MouseEvent<HTMLElement, MouseEvent>) => void;
30
+ onDataEdited: DataCellEditHandler;
31
+ onMoveColumn: (columns: ColumnDescriptor[]) => void;
32
+ onMoveGroupColumn: (columns: ColumnDescriptor[]) => void;
33
+ onRemoveGroupColumn: (column: RuntimeColumnDescriptor) => void;
34
+ onRowClick: RowClickHandler;
35
+ onSortColumn: (column: ColumnDescriptor, extendSort?: any, sortType?: VuuSortType) => void;
36
+ onResizeColumn: TableColumnResizeHandler;
37
+ onToggleGroup: (row: DataSourceRow, column: RuntimeColumnDescriptor) => void;
38
+ scrollProps: {
39
+ scrollbarContainerRef: (el: HTMLDivElement | null) => void;
40
+ contentContainerRef: (el: HTMLDivElement | null) => void;
41
+ };
42
+ tableAttributes: {
43
+ columnDefaultWidth?: number | undefined;
44
+ columnFormatHeader?: "capitalize" | "uppercase" | undefined;
45
+ columnSeparators?: boolean | undefined;
46
+ rowSeparators?: boolean | undefined;
47
+ zebraStripes?: boolean | undefined;
48
+ };
49
+ tableConfig: Readonly<TableConfig>;
50
+ viewportMeasurements: {
51
+ contentHeight: number;
52
+ horizontalScrollbarHeight: number;
53
+ maxScrollContainerScrollHorizontal: number;
54
+ maxScrollContainerScrollVertical: number;
55
+ pinnedWidthLeft: number;
56
+ pinnedWidthRight: number;
57
+ rowCount: number;
58
+ contentWidth: number;
59
+ totalHeaderHeight: number;
60
+ verticalScrollbarWidth: number;
61
+ viewportBodyHeight: number;
62
+ };
63
+ onClick: (evt: import("react").MouseEvent<Element, MouseEvent>) => void;
64
+ onMouseLeave: (() => void) | undefined;
65
+ onMouseMove: ((evt: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
66
+ };
@@ -0,0 +1,11 @@
1
+ import { DataSource } from "@vuu-ui/vuu-data";
2
+ import { DataSourceRow } from "@vuu-ui/vuu-data-types";
3
+ import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
4
+ import { MouseEvent } from "react";
5
+ export interface TableContextMenuHookProps {
6
+ columns: RuntimeColumnDescriptor[];
7
+ data: DataSourceRow[];
8
+ dataSource: DataSource;
9
+ getSelectedRows: () => DataSourceRow[];
10
+ }
11
+ export declare const useTableContextMenu: ({ columns, data, dataSource, getSelectedRows, }: TableContextMenuHookProps) => (evt: MouseEvent<HTMLElement>) => void;
@@ -1,5 +1,5 @@
1
- import { ColumnDescriptor, KeyedColumnDescriptor, PinLocation, TableAttributes, TableConfig, TableHeadings } from "@vuu-ui/vuu-datagrid-types";
2
- import { DataSourceConfig } from "@vuu-ui/vuu-data";
1
+ import { ColumnDescriptor, RuntimeColumnDescriptor, PinLocation, TableAttributes, TableConfig, TableHeadings } from "@vuu-ui/vuu-table-types";
2
+ import { DataSource, DataSourceConfig } from "@vuu-ui/vuu-data";
3
3
  import { TableSchema } from "@vuu-ui/vuu-data/src/message-utils";
4
4
  import { VuuTable } from "@vuu-ui/vuu-protocol-types";
5
5
  import { Reducer } from "react";
@@ -9,7 +9,7 @@ import { Reducer } from "react";
9
9
  * data-related config from DataSource.
10
10
  */
11
11
  export interface TableModel extends TableAttributes {
12
- columns: KeyedColumnDescriptor[];
12
+ columns: RuntimeColumnDescriptor[];
13
13
  headings: TableHeadings;
14
14
  }
15
15
  /**
@@ -23,21 +23,20 @@ interface InternalTableModel extends TableModel {
23
23
  export interface ColumnActionInit {
24
24
  type: "init";
25
25
  tableConfig: TableConfig;
26
- dataSourceConfig?: DataSourceConfig;
26
+ dataSource: DataSource;
27
27
  }
28
28
  export interface ColumnActionHide {
29
29
  type: "hideColumns";
30
- columns: KeyedColumnDescriptor[];
30
+ columns: RuntimeColumnDescriptor[];
31
31
  }
32
32
  export interface ColumnActionShow {
33
33
  type: "showColumns";
34
- columns: KeyedColumnDescriptor[];
34
+ columns: RuntimeColumnDescriptor[];
35
35
  }
36
36
  export interface ColumnActionMove {
37
37
  type: "moveColumn";
38
- column: KeyedColumnDescriptor;
38
+ column: RuntimeColumnDescriptor;
39
39
  moveBy?: 1 | -1;
40
- moveTo?: number;
41
40
  }
42
41
  export interface ColumnActionPin {
43
42
  type: "pinColumn";
@@ -47,7 +46,7 @@ export interface ColumnActionPin {
47
46
  export type ResizePhase = "begin" | "resize" | "end";
48
47
  export interface ColumnActionResize {
49
48
  type: "resizeColumn";
50
- column: KeyedColumnDescriptor;
49
+ column: RuntimeColumnDescriptor;
51
50
  phase: ResizePhase;
52
51
  width?: number;
53
52
  }
@@ -61,10 +60,10 @@ export interface ColumnActionUpdate {
61
60
  }
62
61
  export interface ColumnActionUpdateProp {
63
62
  align?: ColumnDescriptor["align"];
64
- column: KeyedColumnDescriptor;
63
+ column: RuntimeColumnDescriptor;
65
64
  hidden?: ColumnDescriptor["hidden"];
66
65
  label?: ColumnDescriptor["label"];
67
- resizing?: KeyedColumnDescriptor["resizing"];
66
+ resizing?: RuntimeColumnDescriptor["resizing"];
68
67
  type: "updateColumnProp";
69
68
  width?: ColumnDescriptor["width"];
70
69
  }
@@ -90,15 +89,14 @@ export type PersistentColumnAction = ColumnActionPin | ColumnActionHide | Column
90
89
  export type GridModelAction = ColumnActionHide | ColumnActionInit | ColumnActionMove | ColumnActionPin | ColumnActionResize | ColumnActionSetTableSchema | ColumnActionShow | ColumnActionUpdate | ColumnActionUpdateProp | ColumnActionTableConfig;
91
90
  export type GridModelReducer = Reducer<InternalTableModel, GridModelAction>;
92
91
  export type ColumnActionDispatch = (action: GridModelAction) => void;
93
- export declare const useTableModel: (tableConfigProp: TableConfig, dataSourceConfig?: DataSourceConfig) => {
94
- columns: KeyedColumnDescriptor[];
92
+ export declare const useTableModel: (tableConfigProp: TableConfig, dataSource: DataSource) => {
93
+ columns: RuntimeColumnDescriptor[];
95
94
  dispatchColumnAction: import("react").Dispatch<GridModelAction>;
96
95
  headings: TableHeadings;
97
96
  tableAttributes: {
98
97
  columnDefaultWidth?: number | undefined;
99
98
  columnFormatHeader?: "capitalize" | "uppercase" | undefined;
100
99
  columnSeparators?: boolean | undefined;
101
- showHighlightedRow?: boolean | undefined;
102
100
  rowSeparators?: boolean | undefined;
103
101
  zebraStripes?: boolean | undefined;
104
102
  };
@@ -3,11 +3,11 @@
3
3
  * and virtualisation of the table. This includes measurements required
4
4
  * to support pinned columns.
5
5
  */
6
- import { KeyedColumnDescriptor, TableHeadings } from "@vuu-ui/vuu-datagrid-types";
6
+ import { RuntimeColumnDescriptor, TableHeadings } from "@vuu-ui/vuu-table-types";
7
7
  import { MeasuredSize } from "@vuu-ui/vuu-layout";
8
8
  import { RowAtPositionFunc, RowOffsetFunc } from "@vuu-ui/vuu-utils";
9
9
  export interface TableViewportHookProps {
10
- columns: KeyedColumnDescriptor[];
10
+ columns: RuntimeColumnDescriptor[];
11
11
  headerHeight: number;
12
12
  headings: TableHeadings;
13
13
  rowCount: number;
@@ -1,9 +1,9 @@
1
- import { KeyedColumnDescriptor } from "@vuu-ui/vuu-datagrid-types";
1
+ import { RuntimeColumnDescriptor } from "@vuu-ui/vuu-table-types";
2
2
  import { VuuRange } from "@vuu-ui/vuu-protocol-types";
3
3
  import { RowAtPositionFunc } from "@vuu-ui/vuu-utils";
4
4
  import { ViewportMeasurements } from "@vuu-ui/vuu-table";
5
5
  export interface VirtualViewportHookProps {
6
- columns: KeyedColumnDescriptor[];
6
+ columns: RuntimeColumnDescriptor[];
7
7
  getRowAtPosition: RowAtPositionFunc;
8
8
  setRange: (range: VuuRange) => void;
9
9
  viewportMeasurements: ViewportMeasurements;
@@ -0,0 +1,15 @@
1
+ import { MouseOffset } from "./dragDropTypesNext";
2
+ export declare class DragDropState {
3
+ /** Distance between start (top | left) of dragged element and point where user pressed to drag */
4
+ readonly mouseOffset: MouseOffset;
5
+ /** Element where the initial mousedown triggered the drag operation */
6
+ readonly initialDragElement: HTMLElement;
7
+ /** Element being dragged, (initial element cloned and rendered in portal). */
8
+ draggableElement: HTMLElement | null;
9
+ payload: unknown;
10
+ constructor(evt: MouseEvent, dragElement: HTMLElement);
11
+ /** Used to capture a ref to the Draggable JSX.Element */
12
+ setDraggable: (el: HTMLElement | null) => void;
13
+ setPayload(payload: unknown): void;
14
+ private getMouseOffset;
15
+ }
@@ -0,0 +1,91 @@
1
+ import { MouseEventHandler, RefObject } from "react";
2
+ import { orientationType } from "@vuu-ui/vuu-utils";
3
+ import { DragDropState } from "./DragDropState";
4
+ export type ViewportRange = {
5
+ atEnd: boolean;
6
+ atStart: boolean;
7
+ from: number;
8
+ to: number;
9
+ };
10
+ type dimension = "width" | "height" | "scrollWidth" | "scrollHeight";
11
+ type dimensions = {
12
+ size: dimension;
13
+ depth: dimension;
14
+ scrollDepth: dimension;
15
+ };
16
+ export type dimensionsType = {
17
+ horizontal: dimensions;
18
+ vertical: dimensions;
19
+ };
20
+ export type dragStrategy = "drop-indicator" | "natural-movement" | "drag-copy" | "drop-only";
21
+ export type Direction = "fwd" | "bwd";
22
+ export declare const FWD: Direction;
23
+ export declare const BWD: Direction;
24
+ export interface MouseOffset {
25
+ x: number;
26
+ y: number;
27
+ }
28
+ export type Rect = {
29
+ height: number;
30
+ left: number;
31
+ top: number;
32
+ width: number;
33
+ };
34
+ export interface DragHookResult {
35
+ draggable?: JSX.Element;
36
+ dropIndicator?: JSX.Element;
37
+ draggedItemIndex?: number;
38
+ isDragging: boolean;
39
+ isScrolling: RefObject<boolean>;
40
+ onMouseDown?: MouseEventHandler;
41
+ revealOverflowedItems?: boolean;
42
+ }
43
+ export interface InternalDragHookResult extends Omit<DragHookResult, "isDragging" | "isScrolling"> {
44
+ beginDrag: (dragElement: HTMLElement) => void;
45
+ drag: (dragPos: number, mouseMoveDirection: "fwd" | "bwd") => void;
46
+ drop: () => void;
47
+ handleScrollStart?: () => void;
48
+ handleScrollStop?: (scrollDirection: "fwd" | "bwd", _scrollPos: number, atEnd: boolean) => void;
49
+ /**
50
+ * Draggable item has been dragged out of container. Remove any local drop
51
+ * indicators. Dragged element itself should not yet be removed from DOM.
52
+ */
53
+ releaseDrag?: () => void;
54
+ }
55
+ export interface DropOptions {
56
+ fromIndex?: number;
57
+ toIndex: number;
58
+ isExternal?: boolean;
59
+ payload?: unknown;
60
+ }
61
+ export type DragStartHandler = (dragDropState: DragDropState) => void;
62
+ export type DropHandler = (fromIndex: number, toIndex: number, options: DropOptions) => void;
63
+ export interface DragDropProps {
64
+ allowDragDrop?: boolean | dragStrategy;
65
+ /** this is the className that will be assigned during drag to the dragged element */
66
+ draggableClassName: string;
67
+ extendedDropZone?: boolean;
68
+ getDragPayload?: (dragElement: HTMLElement) => unknown;
69
+ id?: string;
70
+ isDragSource?: boolean;
71
+ isDropTarget?: boolean;
72
+ onDragStart?: DragStartHandler;
73
+ onDrop: DropHandler;
74
+ onDropSettle?: (toIndex: number) => void;
75
+ orientation: orientationType;
76
+ containerRef: RefObject<HTMLElement>;
77
+ itemQuery?: string;
78
+ viewportRange?: ViewportRange;
79
+ }
80
+ export type DragDropHook = (props: DragDropProps) => DragHookResult;
81
+ export interface InternalDragDropProps extends Omit<DragDropProps, "draggableClassName" | "id"> {
82
+ isDragSource?: boolean;
83
+ isDropTarget?: boolean;
84
+ selected?: unknown;
85
+ }
86
+ export type DragDropContext = {
87
+ dragElement: HTMLElement;
88
+ dragPayload: unknown;
89
+ mouseOffset: MouseOffset;
90
+ };
91
+ export {};
@@ -1,7 +0,0 @@
1
- import React, { HTMLAttributes } from 'react';
2
- import './Component.css';
3
- export interface ComponentProps extends HTMLAttributes<HTMLDivElement> {
4
- resizeable?: boolean;
5
- }
6
- declare const Component: React.FunctionComponent<ComponentProps>;
7
- export default Component;
@@ -1,7 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- import "./DraggableLayout.css";
3
- export interface DraggableLayoutProps extends HTMLAttributes<HTMLDivElement> {
4
- dropTarget?: boolean;
5
- resizeable?: boolean;
6
- }
7
- export declare const DraggableLayout: import("react").ForwardRefExoticComponent<DraggableLayoutProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,10 +0,0 @@
1
- import { HTMLAttributes, ReactElement } from "react";
2
- import "./DockLayout.css";
3
- export interface DockLayoutProps extends HTMLAttributes<HTMLDivElement> {
4
- children: ReactElement[];
5
- }
6
- declare const DockLayout: {
7
- (props: DockLayoutProps): JSX.Element;
8
- displayName: string;
9
- };
10
- export default DockLayout;
@@ -1,18 +0,0 @@
1
- import { HTMLAttributes } from "react";
2
- import "./Drawer.css";
3
- export interface DrawerProps extends HTMLAttributes<HTMLDivElement> {
4
- clickToOpen?: boolean;
5
- defaultOpen?: boolean;
6
- inline?: boolean;
7
- open?: boolean;
8
- peekaboo?: boolean;
9
- position?: "left" | "right" | "top" | "bottom";
10
- sizeOpen?: number;
11
- sizeClosed?: number;
12
- toggleButton?: "start" | "end";
13
- }
14
- declare const Drawer: {
15
- ({ children, className: classNameProp, clickToOpen, defaultOpen, sizeOpen, sizeClosed, style: styleProp, open: openProp, position, inline, onClick, peekaboo, toggleButton, ...props }: DrawerProps): JSX.Element;
16
- displayName: string;
17
- };
18
- export default Drawer;
@@ -1,2 +0,0 @@
1
- export { default as DockLayout } from "./DockLayout";
2
- export { default as Drawer } from "./Drawer";