@vuu-ui/vuu-table 0.13.49 → 0.13.51

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/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "version": "0.13.49",
2
+ "version": "0.13.51",
3
3
  "author": "heswell",
4
4
  "license": "Apache-2.0",
5
5
  "devDependencies": {
6
- "@vuu-ui/vuu-data-types": "0.13.49",
7
- "@vuu-ui/vuu-table-types": "0.13.49",
8
- "@vuu-ui/vuu-protocol-types": "0.13.49"
6
+ "@vuu-ui/vuu-data-types": "0.13.51",
7
+ "@vuu-ui/vuu-table-types": "0.13.51",
8
+ "@vuu-ui/vuu-protocol-types": "0.13.51"
9
9
  },
10
10
  "dependencies": {
11
11
  "@salt-ds/core": "1.48.0",
12
12
  "@salt-ds/styles": "0.2.1",
13
13
  "@salt-ds/window": "0.1.1",
14
- "@vuu-ui/vuu-context-menu": "0.13.49",
15
- "@vuu-ui/vuu-data-react": "0.13.49",
16
- "@vuu-ui/vuu-popups": "0.13.49",
17
- "@vuu-ui/vuu-table-extras": "0.13.49",
18
- "@vuu-ui/vuu-ui-controls": "0.13.49",
19
- "@vuu-ui/vuu-utils": "0.13.49"
14
+ "@vuu-ui/vuu-context-menu": "0.13.51",
15
+ "@vuu-ui/vuu-data-react": "0.13.51",
16
+ "@vuu-ui/vuu-popups": "0.13.51",
17
+ "@vuu-ui/vuu-table-extras": "0.13.51",
18
+ "@vuu-ui/vuu-ui-controls": "0.13.51",
19
+ "@vuu-ui/vuu-utils": "0.13.51"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "clsx": "^2.0.0",
package/types/Table.d.ts CHANGED
@@ -25,6 +25,15 @@ export interface TableProps extends Omit<MeasuredContainerProps, "onDragStart" |
25
25
  * Allow rows to be draggable
26
26
  */
27
27
  allowDragDrop?: boolean | dragStrategy;
28
+ /**
29
+ * Allow all rows be selected, use with checkbox coliumn.
30
+ */
31
+ allowSelectAll?: boolean;
32
+ /**
33
+ * If checkbox selection is in effect, can user select row by clicking row. If
34
+ * false, checkbox must be clicked explicitly.
35
+ */
36
+ allowSelectCheckboxRow?: boolean;
28
37
  /**
29
38
  * required if a fully featured column picker is to be available
30
39
  */
@@ -1,2 +1,2 @@
1
1
  import { HeaderCellProps } from "@vuu-ui/vuu-table-types";
2
- export declare const HeaderCell: ({ allowDragColumnHeader, className: classNameProp, column, id, index, onClick, onResize, showColumnHeaderMenus, ...htmlAttributes }: HeaderCellProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const HeaderCell: ({ allowDragColumnHeader, allowSelectAll, allRowsSelected, className: classNameProp, column, id, index, onCheckBoxColumnHeaderClick, onClick, onResize, showColumnHeaderMenus, ...htmlAttributes }: HeaderCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
1
  import { VuuSortType } from "@vuu-ui/vuu-protocol-types";
2
- import { ColumnDescriptor, ColumnMoveHandler, CustomHeader, RuntimeColumnDescriptor, ShowColumnHeaderMenus, TableColumnResizeHandler, TableConfig, TableHeadings } from "@vuu-ui/vuu-table-types";
2
+ import { ColumnDescriptor, ColumnMoveHandler, CustomHeader, HeaderCellProps, RuntimeColumnDescriptor, TableColumnResizeHandler, TableConfig, TableHeadings } from "@vuu-ui/vuu-table-types";
3
3
  export type ColumnSortHandler = (column: ColumnDescriptor, addToExistingSort: boolean, sortType?: VuuSortType) => void;
4
- export interface TableHeaderProps {
5
- allowDragColumnHeader: boolean;
4
+ export interface TableHeaderProps extends Pick<HeaderCellProps, "allRowsSelected" | "allowDragColumnHeader" | "allowSelectAll" | "onCheckBoxColumnHeaderClick" | "showColumnHeaderMenus"> {
6
5
  classBase?: string;
7
6
  columns: RuntimeColumnDescriptor[];
8
7
  customHeader?: CustomHeader | CustomHeader[];
@@ -13,9 +12,8 @@ export interface TableHeaderProps {
13
12
  onMoveGroupColumn: (columns: ColumnDescriptor[]) => void;
14
13
  onRemoveGroupColumn: (column: RuntimeColumnDescriptor) => void;
15
14
  onSortColumn: ColumnSortHandler;
16
- showColumnHeaderMenus?: ShowColumnHeaderMenus;
17
15
  tableConfig: TableConfig;
18
16
  tableId: string;
19
17
  virtualColSpan?: number;
20
18
  }
21
- export declare const TableHeader: import("react").MemoExoticComponent<({ allowDragColumnHeader, classBase, columns, customHeader, headings, onHeightMeasured, onMoveColumn, onMoveGroupColumn, onRemoveGroupColumn, onResizeColumn, onSortColumn, showColumnHeaderMenus, tableConfig, tableId, virtualColSpan, }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element>;
19
+ export declare const TableHeader: import("react").MemoExoticComponent<({ allowDragColumnHeader, allowSelectAll, allRowsSelected, classBase, columns, customHeader, headings, onCheckBoxColumnHeaderClick, onHeightMeasured, onMoveColumn, onMoveGroupColumn, onRemoveGroupColumn, onResizeColumn, onSortColumn, showColumnHeaderMenus, tableConfig, tableId, virtualColSpan, }: TableHeaderProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,7 +1,7 @@
1
1
  import { TableRowClickHandlerInternal, TableRowSelectHandlerInternal, SelectionChangeHandler, TableSelectionModel } from "@vuu-ui/vuu-table-types";
2
2
  import { KeyboardEventHandler, RefObject } from "react";
3
3
  import { TableProps } from "./Table";
4
- export interface SelectionHookProps extends Pick<TableProps, "onSelectionChange"> {
4
+ export interface SelectionHookProps extends Pick<TableProps, "allowSelectCheckboxRow" | "onSelectionChange"> {
5
5
  containerRef: RefObject<HTMLElement | null>;
6
6
  highlightedIndexRef: RefObject<number | undefined>;
7
7
  selectionKeys?: string[];
@@ -9,7 +9,9 @@ export interface SelectionHookProps extends Pick<TableProps, "onSelectionChange"
9
9
  onSelectionChange: SelectionChangeHandler;
10
10
  onSelect?: TableRowSelectHandlerInternal;
11
11
  }
12
- export declare const useSelection: ({ containerRef, highlightedIndexRef, selectionKeys, selectionModel, onSelect, onSelectionChange, }: SelectionHookProps) => {
12
+ export declare const useSelection: ({ allowSelectCheckboxRow, containerRef, highlightedIndexRef, selectionKeys, selectionModel, onSelect, onSelectionChange, }: SelectionHookProps) => {
13
+ allRowsSelected: boolean;
14
+ onCheckBoxColumnHeaderClick: () => void;
13
15
  onKeyDown: KeyboardEventHandler<HTMLElement>;
14
16
  onRowClick: TableRowClickHandlerInternal;
15
17
  };
@@ -8,13 +8,14 @@ type HeaderState = {
8
8
  height: number;
9
9
  count: number;
10
10
  };
11
- export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowCellBlockSelection" | "allowDragDrop" | "availableColumns" | "config" | "dataSource" | "defaultSelectedKeyValues" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDataEdited" | "onDragStart" | "onDrop" | "onHighlight" | "onSelect" | "onSelectCellBlock" | "onSelectionChange" | "onRowClick" | "renderBufferSize" | "revealSelected" | "rowToObject" | "scrollingApiRef" | "selectionBookendWidth" | "showColumnHeaderMenus" | "showColumnHeaders" | "showPaginationControls"> {
11
+ export interface TableHookProps extends MeasuredProps, Pick<TableProps, "allowCellBlockSelection" | "allowDragDrop" | "allowSelectCheckboxRow" | "availableColumns" | "config" | "dataSource" | "defaultSelectedKeyValues" | "disableFocus" | "highlightedIndex" | "id" | "navigationStyle" | "onAvailableColumnsChange" | "onConfigChange" | "onDataEdited" | "onDragStart" | "onDrop" | "onHighlight" | "onSelect" | "onSelectCellBlock" | "onSelectionChange" | "onRowClick" | "renderBufferSize" | "revealSelected" | "rowToObject" | "scrollingApiRef" | "selectionBookendWidth" | "showColumnHeaderMenus" | "showColumnHeaders" | "showPaginationControls"> {
12
12
  containerRef: RefObject<HTMLDivElement | null>;
13
13
  rowHeight: number;
14
14
  selectionModel: TableSelectionModel;
15
15
  size: MeasuredSize;
16
16
  }
17
- export declare const useTable: ({ allowCellBlockSelection, allowDragDrop, availableColumns, config, containerRef, dataSource, 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, showColumnHeaderMenus, showColumnHeaders, showPaginationControls, size, }: TableHookProps) => {
17
+ export declare const useTable: ({ allowCellBlockSelection, allowSelectCheckboxRow, allowDragDrop, availableColumns, config, containerRef, dataSource, 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, showColumnHeaderMenus, showColumnHeaders, showPaginationControls, size, }: TableHookProps) => {
18
+ allRowsSelected: boolean;
18
19
  "aria-rowcount": number;
19
20
  cellBlock: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
20
21
  columnMap: import("@vuu-ui/vuu-utils").ColumnMap;
@@ -29,6 +30,7 @@ export declare const useTable: ({ allowCellBlockSelection, allowDragDrop, availa
29
30
  headings: import("@vuu-ui/vuu-table-types").TableHeadings;
30
31
  highlightedIndex: number | undefined;
31
32
  onBlur: import("react").FocusEventHandler;
33
+ onCheckBoxColumnHeaderClick: () => void;
32
34
  onDoubleClick: (e: import("react").MouseEvent<HTMLElement>) => void;
33
35
  onFocus: (e: FocusEvent<HTMLElement>) => void;
34
36
  onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;