@lensui/lens-table 0.1.5 → 0.1.6

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/dist/index.css CHANGED
@@ -15,6 +15,7 @@
15
15
  --rvg-color-primary-soft: #edf4ff;
16
16
  --rvg-color-selection-fill: #edf4ff;
17
17
  --rvg-color-axis-selection-fill: #e8f2ff;
18
+ --rvg-color-column-drop-target-fill: #eeeeee;
18
19
  --rvg-color-range-fill: #e8f1ff;
19
20
  --rvg-color-row-hover-fill: #f6f9fc;
20
21
  --rvg-color-hover: #f1f4f8;
@@ -218,9 +219,7 @@
218
219
  .rvg-cell-text {
219
220
  transition: transform 140ms ease, opacity 100ms ease;
220
221
  }
221
- .rvg-row-drop-settling .rvg-cell-text,
222
- .rvg-row-drop-settling .rvg-row-drag-icon,
223
- .rvg-row-drop-settling .rvg-row-selection-icon {
222
+ .rvg-row-drop-settling .rvg-cell-text {
224
223
  transition: none;
225
224
  }
226
225
  .rvg-cell-text > span,
@@ -240,20 +239,6 @@
240
239
  white-space: normal;
241
240
  text-overflow: clip;
242
241
  }
243
- .rvg-row-drag-icon {
244
- position: absolute;
245
- display: grid;
246
- place-items: center;
247
- pointer-events: none;
248
- transition: transform 140ms ease, opacity 100ms ease;
249
- }
250
- .rvg-row-drag-icon svg {
251
- display: block;
252
- width: 16px;
253
- height: 16px;
254
- overflow: visible;
255
- fill: var(--rvg-color-icon);
256
- }
257
242
  .rvg-cell-render {
258
243
  position: absolute;
259
244
  z-index: 1;
@@ -436,16 +421,12 @@
436
421
  background: #fce8e6;
437
422
  color: #d93025;
438
423
  }
439
- .rvg-row-selection-icon,
440
424
  .rvg-header-selection-icon {
441
425
  position: absolute;
442
426
  display: grid;
443
427
  place-items: center;
444
428
  pointer-events: none;
445
429
  }
446
- .rvg-row-selection-icon {
447
- transition: transform 140ms ease, opacity 100ms ease;
448
- }
449
430
  .rvg-selection-svg {
450
431
  display: block;
451
432
  width: 16px;
@@ -482,6 +463,7 @@
482
463
  border: 2px solid var(--rvg-color-primary);
483
464
  box-sizing: border-box;
484
465
  pointer-events: none;
466
+ transition: transform 140ms ease;
485
467
  }
486
468
  .rvg-selection-edge-target {
487
469
  position: absolute;
@@ -767,6 +749,9 @@
767
749
  .rvg-header-group.is-leaf {
768
750
  z-index: 2;
769
751
  }
752
+ .rvg-header-title.is-drop-target {
753
+ background: var(--rvg-color-column-drop-target-fill);
754
+ }
770
755
  .rvg-text-fixed-shadow {
771
756
  position: absolute;
772
757
  z-index: 4;
@@ -1479,6 +1464,38 @@
1479
1464
  color: var(--rvg-color-muted);
1480
1465
  font-weight: 600;
1481
1466
  }
1467
+ .rvg-column-drag-preview-header .rvg-preview-header-icon {
1468
+ position: absolute;
1469
+ top: 50%;
1470
+ width: 14px;
1471
+ height: 14px;
1472
+ transform: translateY(-50%);
1473
+ overflow: visible;
1474
+ color: var(--rvg-color-icon);
1475
+ }
1476
+ .rvg-column-drag-preview-header .rvg-preview-header-icon path,
1477
+ .rvg-column-drag-preview-header .rvg-preview-header-icon circle {
1478
+ fill: currentColor;
1479
+ }
1480
+ .rvg-column-drag-preview-header .rvg-preview-header-icon path.is-active,
1481
+ .rvg-column-drag-preview-header .rvg-preview-header-icon.is-active {
1482
+ color: var(--rvg-color-primary);
1483
+ }
1484
+ .rvg-column-drag-preview-header .rvg-preview-header-search-icon {
1485
+ fill: none;
1486
+ stroke: currentColor;
1487
+ stroke-width: 1.5;
1488
+ stroke-linecap: round;
1489
+ stroke-linejoin: round;
1490
+ }
1491
+ .rvg-column-drag-preview-header .rvg-preview-header-search-icon path,
1492
+ .rvg-column-drag-preview-header .rvg-preview-header-search-icon circle {
1493
+ fill: none;
1494
+ }
1495
+ .rvg-is-dragging,
1496
+ .rvg-is-dragging * {
1497
+ cursor: move !important;
1498
+ }
1482
1499
  .rvg-column-drag-preview-cell.is-axis-selected {
1483
1500
  background: var(--rvg-color-axis-selection-fill);
1484
1501
  }
@@ -1488,12 +1505,18 @@
1488
1505
  .rvg-column-drag-preview-cell.is-selected {
1489
1506
  background: var(--rvg-color-selection-fill);
1490
1507
  }
1491
- .rvg-row-drag-preview {
1508
+ .rvg-row-drag-preview-frame {
1492
1509
  position: relative;
1493
1510
  overflow: hidden;
1511
+ }
1512
+ .rvg-row-drag-preview {
1513
+ position: absolute;
1514
+ top: 2px;
1515
+ left: 2px;
1516
+ overflow: visible;
1494
1517
  border: 1px solid #a9c8f5;
1495
1518
  background: #fff;
1496
- box-shadow: var(--rvg-shadow-popover);
1519
+ box-shadow: 0 2px 6px rgba(5, 5, 5, 0.08);
1497
1520
  box-sizing: border-box;
1498
1521
  }
1499
1522
  .rvg-row-drag-preview-cell {
@@ -1520,6 +1543,11 @@
1520
1543
  height: 16px;
1521
1544
  fill: var(--rvg-color-icon);
1522
1545
  }
1546
+ .rvg-row-drag-preview-cell.is-selected {
1547
+ z-index: 1;
1548
+ background: var(--rvg-color-selection-fill);
1549
+ box-shadow: 0 0 0 2px var(--rvg-color-primary);
1550
+ }
1523
1551
  .rvg-preview-checkbox {
1524
1552
  display: grid;
1525
1553
  width: 14px;
@@ -1539,7 +1567,7 @@
1539
1567
  position: absolute;
1540
1568
  z-index: 2;
1541
1569
  margin: 0;
1542
- padding: 0 9px;
1570
+ padding: 0 10px;
1543
1571
  border: 0;
1544
1572
  border-radius: 0;
1545
1573
  outline: 0;
@@ -1576,7 +1604,7 @@
1576
1604
  position: absolute;
1577
1605
  z-index: 6;
1578
1606
  display: flex;
1579
- padding: 0 28px 0 9px;
1607
+ padding: 0 28px 0 10px;
1580
1608
  align-items: center;
1581
1609
  gap: 3px;
1582
1610
  background: var(--rvg-color-bg);
@@ -1607,7 +1635,7 @@
1607
1635
  position: absolute;
1608
1636
  z-index: 6;
1609
1637
  display: flex;
1610
- padding: 0 9px;
1638
+ padding: 0 10px;
1611
1639
  align-items: center;
1612
1640
  gap: 6px;
1613
1641
  overflow: hidden;
@@ -1872,11 +1900,11 @@
1872
1900
  text-align: left;
1873
1901
  }
1874
1902
  .rvg-choice-editor [data-part=trigger] {
1875
- padding: 0 28px 0 9px;
1903
+ padding: 0 28px 0 10px;
1876
1904
  line-height: 1;
1877
1905
  }
1878
1906
  .rvg-date-value {
1879
- padding: 0 8px 2px 9px;
1907
+ padding: 0 8px 2px 10px;
1880
1908
  }
1881
1909
  .rvg-choice-editor [data-part=value-text] {
1882
1910
  min-width: 0;
package/dist/index.d.cts CHANGED
@@ -219,6 +219,22 @@ interface GridSelection extends GridCellPosition {
219
219
  rowKey: GridKey;
220
220
  columnKey: string;
221
221
  }
222
+ /** Cell locator accepted by controlled and default selection props. */
223
+ type GridSelectionTarget = {
224
+ columnKey: string;
225
+ rowKey: GridKey;
226
+ rowIndex?: number;
227
+ columnIndex?: number;
228
+ } | {
229
+ columnKey: string;
230
+ rowIndex: number;
231
+ rowKey?: GridKey;
232
+ columnIndex?: number;
233
+ };
234
+ /** Fully resolved selected cell returned by onSelectedCellChange. */
235
+ interface SelectedCellChange extends GridSelection {
236
+ value: unknown;
237
+ }
222
238
  /** Fired after a cell editor commits a value. */
223
239
  interface CellChange<Row> extends GridSelection {
224
240
  value: unknown;
@@ -271,24 +287,6 @@ interface TableContextMenuConfig<Row> {
271
287
  range?: ContextMenuSection<Row, RangeContextMenuBuiltin, RangeContextMenuContext<Row>>;
272
288
  }
273
289
  type TableContextMenu<Row> = boolean | TableContextMenuConfig<Row>;
274
- /** Payload for inserting one or more rows around a target row. */
275
- interface InsertRowsEvent<Row> {
276
- rowIndex: number;
277
- row: Row;
278
- position: 'before' | 'after';
279
- count: number;
280
- /** Rows created by the grid for the optimistic visible insert. Consumers can persist these directly. */
281
- insertedRows?: Row[];
282
- }
283
- /** Payload for deleting the selected rows. */
284
- interface DeleteRowsEvent<Row> {
285
- rows: Array<{
286
- rowIndex: number;
287
- row: Row;
288
- }>;
289
- /** Current rendered viewport, including virtual overscan. Useful for fast optimistic updates before rebuilding large datasets. */
290
- viewportRange?: ViewportRange;
291
- }
292
290
  /**
293
291
  * Public props for Table.
294
292
  *
@@ -334,22 +332,24 @@ interface TableProps<Row extends object> {
334
332
  summary?: TableSummaryConfig;
335
333
  /** Show an automatically generated row number column on the left. */
336
334
  rowNumber?: boolean;
337
- selectedCell?: GridSelection | null;
338
- defaultSelectedCell?: GridSelection | null;
339
- onSelectedCellChange?: (selection: GridSelection | null) => void;
335
+ selectedCell?: GridSelectionTarget | null;
336
+ defaultSelectedCell?: GridSelectionTarget | null;
337
+ onSelectedCellChange?: (selection: SelectedCellChange | null) => void;
340
338
  /** Enable spreadsheet-style mouse drag selection across multiple body cells. Defaults to false. */
341
339
  rangeSelection?: boolean;
342
340
  rowSelection?: boolean | AxisSelectionConfig;
343
341
  selectedRowKeys?: GridKey[];
344
342
  defaultSelectedRowKeys?: GridKey[];
345
- onSelectedRowKeysChange?: (keys: GridKey[], rows: Row[], indices: number[]) => void;
343
+ onSelectedRowChange?: (keys: GridKey[], rows: Row[], indices: number[]) => void;
346
344
  columnSelection?: boolean | AxisSelectionConfig;
347
345
  selectedColumnKeys?: string[];
348
346
  defaultSelectedColumnKeys?: string[];
349
- onSelectedColumnKeysChange?: (keys: string[]) => void;
347
+ onSelectedColumnChange?: (keys: string[]) => void;
350
348
  columnDraggable?: boolean;
351
349
  columnResizable?: boolean;
352
- onColumnOrderChange?: (sourceIndex: number, targetIndex: number, detail?: {
350
+ onColumnsReorder?: (columns: GridColumn<Row>[], detail: {
351
+ sourceIndex: number;
352
+ targetIndex: number;
353
353
  type: 'column' | 'group';
354
354
  sourceKey: string;
355
355
  targetKey: string;
@@ -358,13 +358,18 @@ interface TableProps<Row extends object> {
358
358
  }) => void;
359
359
  onColumnResize?: (columnKey: string, width: number) => void;
360
360
  rowDraggable?: boolean;
361
- onRowOrderChange?: (sourceIndex: number, targetIndex: number) => void;
362
- onInsertRows?: (event: InsertRowsEvent<Row>) => void | Promise<void>;
363
- onDeleteRows?: (event: DeleteRowsEvent<Row>) => void | Promise<void>;
364
- sortState?: GridSortState | null;
365
- onSortStateChange?: (state: GridSortState | null) => void;
366
- filterValues?: Record<string, string>;
367
- onFilterValuesChange?: (values: Record<string, string>) => void;
361
+ onRowsReorder?: (rows: Row[], detail: {
362
+ sourceIndex: number;
363
+ targetIndex: number;
364
+ }) => void;
365
+ /** Receives the complete rows array and the rows added by the built-in insert operation. */
366
+ onInsertRows?: (rows: Row[], insertedRows: Row[]) => void | Promise<void>;
367
+ /** Receives the complete rows array and the rows removed by the built-in delete operation. */
368
+ onDeleteRows?: (rows: Row[], deletedRows: Row[]) => void | Promise<void>;
369
+ /** Overrides the built-in value sorting. Return rows ordered for the internally managed sort state. */
370
+ onSortChange?: (rows: Row[], state: GridSortState) => Row[];
371
+ /** Overrides the built-in text filtering. Return the rows that match the internally managed filter values. */
372
+ onFilterChange?: (rows: Row[], values: Readonly<Record<string, string>>) => Row[];
368
373
  onCellChange?: (change: CellChange<Row>) => void | Promise<void>;
369
374
  onCellContextMenu?: (event: ContextMenuEvent<Row>) => void;
370
375
  /** true uses the built-in menu, false disables custom menus, object customizes menu content and order. */
@@ -381,7 +386,7 @@ interface ViewportRange {
381
386
  columnEnd: number;
382
387
  }
383
388
 
384
- declare function Table<Row extends object>({ columns: sourceColumns, rows: sourceRows, rowKey, width, height, autoHeight, layout, rowHeight: rowHeightProp, headerHeight: headerHeightProp, fixedHeader, locale, borderless, verticalBorderless, striped, highlight, cellSpans, loading, loadingContent, virtualized, tooltip, summary, rowNumber, selectedCell, defaultSelectedCell, onSelectedCellChange, rangeSelection, rowSelection, selectedRowKeys, defaultSelectedRowKeys, onSelectedRowKeysChange, columnSelection, selectedColumnKeys, defaultSelectedColumnKeys, onSelectedColumnKeysChange, columnDraggable, columnResizable, onColumnOrderChange, onColumnResize, rowDraggable, onRowOrderChange, onInsertRows, onDeleteRows, sortState, onSortStateChange, filterValues, onFilterValuesChange, onCellChange, onCellContextMenu, contextMenu: contextMenuConfig, emptyContent, className, style, ariaLabel, }: TableProps<Row>): react.JSX.Element;
389
+ declare function Table<Row extends object>({ columns: columnProps, rows: sourceRows, rowKey, width, height, autoHeight, layout, rowHeight: rowHeightProp, headerHeight: headerHeightProp, fixedHeader, locale, borderless, verticalBorderless, striped, highlight, cellSpans, loading, loadingContent, virtualized, tooltip, summary, rowNumber, selectedCell, defaultSelectedCell, onSelectedCellChange, rangeSelection, rowSelection, selectedRowKeys, defaultSelectedRowKeys, onSelectedRowChange, columnSelection, selectedColumnKeys, defaultSelectedColumnKeys, onSelectedColumnChange, columnDraggable, columnResizable, onColumnsReorder, onColumnResize, rowDraggable, onRowsReorder, onInsertRows, onDeleteRows, onSortChange, onFilterChange, onCellChange, onCellContextMenu, contextMenu: contextMenuConfig, emptyContent, className, style, ariaLabel, }: TableProps<Row>): react.JSX.Element;
385
390
 
386
391
  type LayoutColumn<Row> = GridColumn<Row> & {
387
392
  rowSelection?: boolean;
@@ -428,4 +433,4 @@ declare function hitTestColumn(metrics: ColumnMetric[], contentX: number): numbe
428
433
 
429
434
  type TableFilterValues = Record<string, string>;
430
435
 
431
- export { type AxisSelectionConfig, type CellChange, type ContextMenuEvent, type DeleteRowsEvent, type GridCellPosition, type GridColumn, type GridKey, type GridSelection, type GridSortState, type InsertRowsEvent, type SelectionMode, type SortDirection, Table, type CellChange as TableCellChange, type GridCellPosition as TableCellPosition, type TableCellSpan, type TableCellSpanRule, type TableCellSpanRuleContext, type TableCellSpans, type GridColumn as TableColumn, type TableContextMenu, type TableContextMenuConfig, type ContextMenuEvent as TableContextMenuEvent, type DeleteRowsEvent as TableDeleteRowsEvent, type GridSelection as TableEditingCell, type TableFilterValues, type TableHighlightConfig, type InsertRowsEvent as TableInsertRowsEvent, type GridKey as TableKey, type TableLabels, type TableLayoutConfig, type TableLocaleCode, type TableLocaleConfig, type TableProps, type TableResolvedCellSpan, type GridSortState as TableSorter, type TableSummaryConfig, type TableTooltipConfig, type ViewportRange as TableViewportRange, type TableVirtualizedConfig, Table as VelocityGrid, type TableCellSpan as VelocityGridCellSpan, type TableCellSpanRule as VelocityGridCellSpanRule, type TableCellSpanRuleContext as VelocityGridCellSpanRuleContext, type TableCellSpans as VelocityGridCellSpans, type TableContextMenu as VelocityGridContextMenu, type TableContextMenuConfig as VelocityGridContextMenuConfig, type TableHighlightConfig as VelocityGridHighlightConfig, type TableLabels as VelocityGridLabels, type TableLayoutConfig as VelocityGridLayoutConfig, type TableLocaleCode as VelocityGridLocaleCode, type TableLocaleConfig as VelocityGridLocaleConfig, type TableProps as VelocityGridProps, type TableResolvedCellSpan as VelocityGridResolvedCellSpan, type TableSummaryConfig as VelocityGridSummaryConfig, type TableTooltipConfig as VelocityGridTooltipConfig, type TableVirtualizedConfig as VelocityGridVirtualizedConfig, type ViewportRange, buildColumnMetrics, getViewportRange, hitTestColumn };
436
+ export { type AxisSelectionConfig, type CellChange, type ContextMenuEvent, type GridCellPosition, type GridColumn, type GridKey, type GridSelection, type GridSelectionTarget, type GridSortState, type SelectedCellChange, type SelectionMode, type SortDirection, Table, type CellChange as TableCellChange, type GridCellPosition as TableCellPosition, type TableCellSpan, type TableCellSpanRule, type TableCellSpanRuleContext, type TableCellSpans, type GridColumn as TableColumn, type TableContextMenu, type TableContextMenuConfig, type ContextMenuEvent as TableContextMenuEvent, type GridSelection as TableEditingCell, type TableFilterValues, type TableHighlightConfig, type GridKey as TableKey, type TableLabels, type TableLayoutConfig, type TableLocaleCode, type TableLocaleConfig, type TableProps, type TableResolvedCellSpan, type GridSortState as TableSorter, type TableSummaryConfig, type TableTooltipConfig, type ViewportRange as TableViewportRange, type TableVirtualizedConfig, Table as VelocityGrid, type TableCellSpan as VelocityGridCellSpan, type TableCellSpanRule as VelocityGridCellSpanRule, type TableCellSpanRuleContext as VelocityGridCellSpanRuleContext, type TableCellSpans as VelocityGridCellSpans, type TableContextMenu as VelocityGridContextMenu, type TableContextMenuConfig as VelocityGridContextMenuConfig, type TableHighlightConfig as VelocityGridHighlightConfig, type TableLabels as VelocityGridLabels, type TableLayoutConfig as VelocityGridLayoutConfig, type TableLocaleCode as VelocityGridLocaleCode, type TableLocaleConfig as VelocityGridLocaleConfig, type TableProps as VelocityGridProps, type TableResolvedCellSpan as VelocityGridResolvedCellSpan, type TableSummaryConfig as VelocityGridSummaryConfig, type TableTooltipConfig as VelocityGridTooltipConfig, type TableVirtualizedConfig as VelocityGridVirtualizedConfig, type ViewportRange, buildColumnMetrics, getViewportRange, hitTestColumn };
package/dist/index.d.ts CHANGED
@@ -219,6 +219,22 @@ interface GridSelection extends GridCellPosition {
219
219
  rowKey: GridKey;
220
220
  columnKey: string;
221
221
  }
222
+ /** Cell locator accepted by controlled and default selection props. */
223
+ type GridSelectionTarget = {
224
+ columnKey: string;
225
+ rowKey: GridKey;
226
+ rowIndex?: number;
227
+ columnIndex?: number;
228
+ } | {
229
+ columnKey: string;
230
+ rowIndex: number;
231
+ rowKey?: GridKey;
232
+ columnIndex?: number;
233
+ };
234
+ /** Fully resolved selected cell returned by onSelectedCellChange. */
235
+ interface SelectedCellChange extends GridSelection {
236
+ value: unknown;
237
+ }
222
238
  /** Fired after a cell editor commits a value. */
223
239
  interface CellChange<Row> extends GridSelection {
224
240
  value: unknown;
@@ -271,24 +287,6 @@ interface TableContextMenuConfig<Row> {
271
287
  range?: ContextMenuSection<Row, RangeContextMenuBuiltin, RangeContextMenuContext<Row>>;
272
288
  }
273
289
  type TableContextMenu<Row> = boolean | TableContextMenuConfig<Row>;
274
- /** Payload for inserting one or more rows around a target row. */
275
- interface InsertRowsEvent<Row> {
276
- rowIndex: number;
277
- row: Row;
278
- position: 'before' | 'after';
279
- count: number;
280
- /** Rows created by the grid for the optimistic visible insert. Consumers can persist these directly. */
281
- insertedRows?: Row[];
282
- }
283
- /** Payload for deleting the selected rows. */
284
- interface DeleteRowsEvent<Row> {
285
- rows: Array<{
286
- rowIndex: number;
287
- row: Row;
288
- }>;
289
- /** Current rendered viewport, including virtual overscan. Useful for fast optimistic updates before rebuilding large datasets. */
290
- viewportRange?: ViewportRange;
291
- }
292
290
  /**
293
291
  * Public props for Table.
294
292
  *
@@ -334,22 +332,24 @@ interface TableProps<Row extends object> {
334
332
  summary?: TableSummaryConfig;
335
333
  /** Show an automatically generated row number column on the left. */
336
334
  rowNumber?: boolean;
337
- selectedCell?: GridSelection | null;
338
- defaultSelectedCell?: GridSelection | null;
339
- onSelectedCellChange?: (selection: GridSelection | null) => void;
335
+ selectedCell?: GridSelectionTarget | null;
336
+ defaultSelectedCell?: GridSelectionTarget | null;
337
+ onSelectedCellChange?: (selection: SelectedCellChange | null) => void;
340
338
  /** Enable spreadsheet-style mouse drag selection across multiple body cells. Defaults to false. */
341
339
  rangeSelection?: boolean;
342
340
  rowSelection?: boolean | AxisSelectionConfig;
343
341
  selectedRowKeys?: GridKey[];
344
342
  defaultSelectedRowKeys?: GridKey[];
345
- onSelectedRowKeysChange?: (keys: GridKey[], rows: Row[], indices: number[]) => void;
343
+ onSelectedRowChange?: (keys: GridKey[], rows: Row[], indices: number[]) => void;
346
344
  columnSelection?: boolean | AxisSelectionConfig;
347
345
  selectedColumnKeys?: string[];
348
346
  defaultSelectedColumnKeys?: string[];
349
- onSelectedColumnKeysChange?: (keys: string[]) => void;
347
+ onSelectedColumnChange?: (keys: string[]) => void;
350
348
  columnDraggable?: boolean;
351
349
  columnResizable?: boolean;
352
- onColumnOrderChange?: (sourceIndex: number, targetIndex: number, detail?: {
350
+ onColumnsReorder?: (columns: GridColumn<Row>[], detail: {
351
+ sourceIndex: number;
352
+ targetIndex: number;
353
353
  type: 'column' | 'group';
354
354
  sourceKey: string;
355
355
  targetKey: string;
@@ -358,13 +358,18 @@ interface TableProps<Row extends object> {
358
358
  }) => void;
359
359
  onColumnResize?: (columnKey: string, width: number) => void;
360
360
  rowDraggable?: boolean;
361
- onRowOrderChange?: (sourceIndex: number, targetIndex: number) => void;
362
- onInsertRows?: (event: InsertRowsEvent<Row>) => void | Promise<void>;
363
- onDeleteRows?: (event: DeleteRowsEvent<Row>) => void | Promise<void>;
364
- sortState?: GridSortState | null;
365
- onSortStateChange?: (state: GridSortState | null) => void;
366
- filterValues?: Record<string, string>;
367
- onFilterValuesChange?: (values: Record<string, string>) => void;
361
+ onRowsReorder?: (rows: Row[], detail: {
362
+ sourceIndex: number;
363
+ targetIndex: number;
364
+ }) => void;
365
+ /** Receives the complete rows array and the rows added by the built-in insert operation. */
366
+ onInsertRows?: (rows: Row[], insertedRows: Row[]) => void | Promise<void>;
367
+ /** Receives the complete rows array and the rows removed by the built-in delete operation. */
368
+ onDeleteRows?: (rows: Row[], deletedRows: Row[]) => void | Promise<void>;
369
+ /** Overrides the built-in value sorting. Return rows ordered for the internally managed sort state. */
370
+ onSortChange?: (rows: Row[], state: GridSortState) => Row[];
371
+ /** Overrides the built-in text filtering. Return the rows that match the internally managed filter values. */
372
+ onFilterChange?: (rows: Row[], values: Readonly<Record<string, string>>) => Row[];
368
373
  onCellChange?: (change: CellChange<Row>) => void | Promise<void>;
369
374
  onCellContextMenu?: (event: ContextMenuEvent<Row>) => void;
370
375
  /** true uses the built-in menu, false disables custom menus, object customizes menu content and order. */
@@ -381,7 +386,7 @@ interface ViewportRange {
381
386
  columnEnd: number;
382
387
  }
383
388
 
384
- declare function Table<Row extends object>({ columns: sourceColumns, rows: sourceRows, rowKey, width, height, autoHeight, layout, rowHeight: rowHeightProp, headerHeight: headerHeightProp, fixedHeader, locale, borderless, verticalBorderless, striped, highlight, cellSpans, loading, loadingContent, virtualized, tooltip, summary, rowNumber, selectedCell, defaultSelectedCell, onSelectedCellChange, rangeSelection, rowSelection, selectedRowKeys, defaultSelectedRowKeys, onSelectedRowKeysChange, columnSelection, selectedColumnKeys, defaultSelectedColumnKeys, onSelectedColumnKeysChange, columnDraggable, columnResizable, onColumnOrderChange, onColumnResize, rowDraggable, onRowOrderChange, onInsertRows, onDeleteRows, sortState, onSortStateChange, filterValues, onFilterValuesChange, onCellChange, onCellContextMenu, contextMenu: contextMenuConfig, emptyContent, className, style, ariaLabel, }: TableProps<Row>): react.JSX.Element;
389
+ declare function Table<Row extends object>({ columns: columnProps, rows: sourceRows, rowKey, width, height, autoHeight, layout, rowHeight: rowHeightProp, headerHeight: headerHeightProp, fixedHeader, locale, borderless, verticalBorderless, striped, highlight, cellSpans, loading, loadingContent, virtualized, tooltip, summary, rowNumber, selectedCell, defaultSelectedCell, onSelectedCellChange, rangeSelection, rowSelection, selectedRowKeys, defaultSelectedRowKeys, onSelectedRowChange, columnSelection, selectedColumnKeys, defaultSelectedColumnKeys, onSelectedColumnChange, columnDraggable, columnResizable, onColumnsReorder, onColumnResize, rowDraggable, onRowsReorder, onInsertRows, onDeleteRows, onSortChange, onFilterChange, onCellChange, onCellContextMenu, contextMenu: contextMenuConfig, emptyContent, className, style, ariaLabel, }: TableProps<Row>): react.JSX.Element;
385
390
 
386
391
  type LayoutColumn<Row> = GridColumn<Row> & {
387
392
  rowSelection?: boolean;
@@ -428,4 +433,4 @@ declare function hitTestColumn(metrics: ColumnMetric[], contentX: number): numbe
428
433
 
429
434
  type TableFilterValues = Record<string, string>;
430
435
 
431
- export { type AxisSelectionConfig, type CellChange, type ContextMenuEvent, type DeleteRowsEvent, type GridCellPosition, type GridColumn, type GridKey, type GridSelection, type GridSortState, type InsertRowsEvent, type SelectionMode, type SortDirection, Table, type CellChange as TableCellChange, type GridCellPosition as TableCellPosition, type TableCellSpan, type TableCellSpanRule, type TableCellSpanRuleContext, type TableCellSpans, type GridColumn as TableColumn, type TableContextMenu, type TableContextMenuConfig, type ContextMenuEvent as TableContextMenuEvent, type DeleteRowsEvent as TableDeleteRowsEvent, type GridSelection as TableEditingCell, type TableFilterValues, type TableHighlightConfig, type InsertRowsEvent as TableInsertRowsEvent, type GridKey as TableKey, type TableLabels, type TableLayoutConfig, type TableLocaleCode, type TableLocaleConfig, type TableProps, type TableResolvedCellSpan, type GridSortState as TableSorter, type TableSummaryConfig, type TableTooltipConfig, type ViewportRange as TableViewportRange, type TableVirtualizedConfig, Table as VelocityGrid, type TableCellSpan as VelocityGridCellSpan, type TableCellSpanRule as VelocityGridCellSpanRule, type TableCellSpanRuleContext as VelocityGridCellSpanRuleContext, type TableCellSpans as VelocityGridCellSpans, type TableContextMenu as VelocityGridContextMenu, type TableContextMenuConfig as VelocityGridContextMenuConfig, type TableHighlightConfig as VelocityGridHighlightConfig, type TableLabels as VelocityGridLabels, type TableLayoutConfig as VelocityGridLayoutConfig, type TableLocaleCode as VelocityGridLocaleCode, type TableLocaleConfig as VelocityGridLocaleConfig, type TableProps as VelocityGridProps, type TableResolvedCellSpan as VelocityGridResolvedCellSpan, type TableSummaryConfig as VelocityGridSummaryConfig, type TableTooltipConfig as VelocityGridTooltipConfig, type TableVirtualizedConfig as VelocityGridVirtualizedConfig, type ViewportRange, buildColumnMetrics, getViewportRange, hitTestColumn };
436
+ export { type AxisSelectionConfig, type CellChange, type ContextMenuEvent, type GridCellPosition, type GridColumn, type GridKey, type GridSelection, type GridSelectionTarget, type GridSortState, type SelectedCellChange, type SelectionMode, type SortDirection, Table, type CellChange as TableCellChange, type GridCellPosition as TableCellPosition, type TableCellSpan, type TableCellSpanRule, type TableCellSpanRuleContext, type TableCellSpans, type GridColumn as TableColumn, type TableContextMenu, type TableContextMenuConfig, type ContextMenuEvent as TableContextMenuEvent, type GridSelection as TableEditingCell, type TableFilterValues, type TableHighlightConfig, type GridKey as TableKey, type TableLabels, type TableLayoutConfig, type TableLocaleCode, type TableLocaleConfig, type TableProps, type TableResolvedCellSpan, type GridSortState as TableSorter, type TableSummaryConfig, type TableTooltipConfig, type ViewportRange as TableViewportRange, type TableVirtualizedConfig, Table as VelocityGrid, type TableCellSpan as VelocityGridCellSpan, type TableCellSpanRule as VelocityGridCellSpanRule, type TableCellSpanRuleContext as VelocityGridCellSpanRuleContext, type TableCellSpans as VelocityGridCellSpans, type TableContextMenu as VelocityGridContextMenu, type TableContextMenuConfig as VelocityGridContextMenuConfig, type TableHighlightConfig as VelocityGridHighlightConfig, type TableLabels as VelocityGridLabels, type TableLayoutConfig as VelocityGridLayoutConfig, type TableLocaleCode as VelocityGridLocaleCode, type TableLocaleConfig as VelocityGridLocaleConfig, type TableProps as VelocityGridProps, type TableResolvedCellSpan as VelocityGridResolvedCellSpan, type TableSummaryConfig as VelocityGridSummaryConfig, type TableTooltipConfig as VelocityGridTooltipConfig, type TableVirtualizedConfig as VelocityGridVirtualizedConfig, type ViewportRange, buildColumnMetrics, getViewportRange, hitTestColumn };