react-base-data-table 0.5.12 → 0.5.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.
@@ -1,8 +1,8 @@
1
1
  import { useTableInteractions, type TableInteractionsProps } from "../hooks/useTableInteractions";
2
2
  import type TableItem from "../models/TableItem";
3
3
  import { useRowDragDrop } from "../hooks/useRowDragDrop";
4
- type TableInteractionContextValue<T extends TableItem = TableItem> = ReturnType<typeof useTableInteractions<T>> & ReturnType<typeof useRowDragDrop<T>>;
5
- export declare const TableInteractionProvider: <T extends TableItem>({ children, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onRowsReordered, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T> & {
4
+ type TableInteractionContextValue<T> = ReturnType<typeof useTableInteractions<T>> & ReturnType<typeof useRowDragDrop<T>>;
5
+ export declare const TableInteractionProvider: <T>({ children, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onRowsReordered, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T> & {
6
6
  children: React.ReactNode;
7
7
  } & {
8
8
  onRowsReordered?: ((fromIndex: number, toIndex: number) => void) | undefined;
@@ -1,10 +1,9 @@
1
- import type TableItem from "../models/TableItem";
2
- interface UseRowDragDropProps<T extends TableItem> {
1
+ interface UseRowDragDropProps<T> {
3
2
  items: T[];
4
3
  onRowsReordered?: (fromIndex: number, toIndex: number, draggedItem: T, targetItem: T) => void;
5
4
  groupBy?: string;
6
5
  }
7
- export declare const useRowDragDrop: <T extends TableItem>({ items, onRowsReordered, groupBy, }: UseRowDragDropProps<T>) => {
6
+ export declare const useRowDragDrop: <T>({ items, onRowsReordered, groupBy, }: UseRowDragDropProps<T>) => {
8
7
  draggedRowIndex: number | null;
9
8
  dropTargetIndex: number | null;
10
9
  isDraggingRow: boolean;
@@ -4,7 +4,7 @@ import type TableItem from "../models/TableItem";
4
4
  import type CellCoordinate from "../models/CellCordinate";
5
5
  import type HighlightCondition from "../models/HighlightCondition";
6
6
  import type CommentData from "../models/CommentData";
7
- export interface TableInteractionsProps<T extends TableItem> {
7
+ export interface TableInteractionsProps<T> {
8
8
  items: TableItem[];
9
9
  groupedItemsEntries?: [string, {
10
10
  rowIndex: number;
@@ -34,7 +34,7 @@ export interface TableInteractionsProps<T extends TableItem> {
34
34
  onRemoveHighlightCondition?: (highlightCondition: HighlightCondition, cssPropertyToRemove: keyof CSSProperties, item: T) => Promise<void> | void;
35
35
  onAddListOption?: (newOption: string, header: BaseTableHeader) => Promise<void> | void;
36
36
  }
37
- export declare function useTableInteractions<T extends TableItem>({ items, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T>): {
37
+ export declare function useTableInteractions<T>({ items, groupedItemsEntries, onChange, onBulkChange, onBulkFieldChange, onRowDoubleClick, onSaveComment, onDeleteComment, onSetHighlightCondition, onRemoveHighlightCondition, onAddListOption, }: TableInteractionsProps<T>): {
38
38
  setExpandedSelection: (cells: CellCoordinate[]) => void;
39
39
  onHeaderClick: (event: React.MouseEvent<HTMLTableCellElement>, headerId: string) => void;
40
40
  onHeaderRightClick: (event: React.MouseEvent<HTMLTableCellElement>, headerId: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-base-data-table",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "types": "dist/types/index.d.ts",