@infinite-table/infinite-react 9.0.3 → 9.1.0

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/index.d.ts CHANGED
@@ -895,14 +895,38 @@ interface PerfMarker {
895
895
  }): PerfMarker;
896
896
  }
897
897
 
898
+ type RowInfoStoreNotifyParams<T> = {
899
+ marker?: PerfMarker;
900
+ /**
901
+ * The DataSource state that produced `newDataArray` and the state it replaces.
902
+ * Exposed to cells via `getDataSourceStates()` so `repaintCellsKey` functions
903
+ * can compare the two.
904
+ */
905
+ dataSourceState?: DataSourceState<T>;
906
+ previousDataSourceState?: DataSourceState<T>;
907
+ };
908
+ type RowInfoStoreDataSourceStates<T> = {
909
+ dataSourceState: DataSourceState<T> | undefined;
910
+ previousDataSourceState: DataSourceState<T> | undefined;
911
+ };
898
912
  interface RowInfoStore<T> {
899
913
  /**
900
914
  * Update the entire dataArray (called from reducer)
901
915
  * Compares old vs new rowInfo at each index and notifies subscribers for changed indices
902
916
  */
903
- notifyDataArray(newDataArray: InfiniteTableRowInfo<T>[], params?: {
904
- marker?: PerfMarker;
905
- }): void;
917
+ notifyDataArray(newDataArray: InfiniteTableRowInfo<T>[], params?: RowInfoStoreNotifyParams<T>): void;
918
+ /**
919
+ * Subscribe to *any* change of the dataArray reference (regardless of which
920
+ * rows changed). Used by cells whose `repaintCellsKey` is a function, so they
921
+ * can re-evaluate their key after every data change.
922
+ * Returns unsubscribe function
923
+ */
924
+ subscribeToDataArrayChange(callback: () => void): () => void;
925
+ /**
926
+ * The DataSource state that produced the current dataArray, and the one
927
+ * before it - as passed by the reducer via `notifyDataArray`.
928
+ */
929
+ getDataSourceStates(): RowInfoStoreDataSourceStates<T>;
906
930
  /**
907
931
  * Get current rowInfo at index (snapshot for useSyncExternalStore)
908
932
  */
@@ -1216,6 +1240,12 @@ type InfiniteTableColumn<DATA_TYPE> = {
1216
1240
  headerStyle?: InfiniteTableColumnHeaderStyle<DATA_TYPE>;
1217
1241
  headerClassName?: InfiniteTableColumnHeaderClassName<DATA_TYPE>;
1218
1242
  className?: InfiniteTableColumnClassName<DATA_TYPE>;
1243
+ /**
1244
+ * Forces the cells of this column to re-render when their row didn't change
1245
+ * but something they render depends on did (eg: cross-row computations).
1246
+ * Takes precedence over the `repaintCellsKey` prop of the table.
1247
+ */
1248
+ repaintCellsKey?: InfiniteTablePropRepaintCellsKey<DATA_TYPE>;
1219
1249
  rowspan?: InfiniteTableColumnRowspanFn<DATA_TYPE>;
1220
1250
  render?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
1221
1251
  renderValue?: InfiniteTableColumnRenderFunction<DATA_TYPE>;
@@ -2250,6 +2280,7 @@ interface InfiniteTableMappedState<T> {
2250
2280
  columnDefaultSortable: InfiniteTableProps<T>['columnDefaultSortable'];
2251
2281
  rowStyle: InfiniteTableProps<T>['rowStyle'];
2252
2282
  cellStyle: InfiniteTableProps<T>['cellStyle'];
2283
+ repaintCellsKey: InfiniteTableProps<T>['repaintCellsKey'];
2253
2284
  rowProps: InfiniteTableProps<T>['rowProps'];
2254
2285
  rowClassName: InfiniteTableProps<T>['rowClassName'];
2255
2286
  rowHoverClassName: InfiniteTableProps<T>['rowHoverClassName'];
@@ -7278,6 +7309,31 @@ type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStylingFnParams<T
7278
7309
  type InfiniteTableCellClassNameFn<T> = InfiniteTableColumn<T>['className'];
7279
7310
  type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
7280
7311
  type InfiniteTablePropCellStyle<T> = InfiniteTableColumn<T>['style'];
7312
+ type InfiniteTablePropRepaintCellsKeyFnParams<T> = {
7313
+ rowInfo: InfiniteTableRowInfo<T>;
7314
+ column: InfiniteTableComputedColumn<T>;
7315
+ /**
7316
+ * The DataSource state that produced the current data array.
7317
+ */
7318
+ dataSourceState: DataSourceState<T>;
7319
+ /**
7320
+ * The DataSource state before the last data change - `undefined` until the
7321
+ * first data change happens.
7322
+ */
7323
+ previousDataSourceState: DataSourceState<T> | undefined;
7324
+ };
7325
+ /**
7326
+ * Called for each cell (whenever the DataSource data array changes) - the cell
7327
+ * is re-rendered when the returned key is different (via `Object.is`) from the
7328
+ * key returned on the previous call. Return primitives or stable references.
7329
+ */
7330
+ type InfiniteTablePropRepaintCellsKeyFn<T> = (params: InfiniteTablePropRepaintCellsKeyFnParams<T>) => unknown;
7331
+ /**
7332
+ * When a string/number/object - cells re-render whenever the key changes.
7333
+ * When a function - it is called per cell after each data change and the cell
7334
+ * re-renders when the returned key changes.
7335
+ */
7336
+ type InfiniteTablePropRepaintCellsKey<T> = string | number | object | InfiniteTablePropRepaintCellsKeyFn<T>;
7281
7337
  type InfiniteTablePropRowClassName<T> = string | InfiniteTableRowClassNameFn<T>;
7282
7338
  type InfiniteTablePropCellClassName<T> = string | InfiniteTableCellClassNameFn<T>;
7283
7339
  type InfiniteTableColumnAggregator<T, AggregationResultType> = Omit<AggregationReducer<T, AggregationResultType>, 'getter' | 'id'> & {
@@ -7682,6 +7738,12 @@ interface InfiniteTableProps<T> {
7682
7738
  cellClassName?: InfiniteTablePropCellClassName<T>;
7683
7739
  rowClassName?: InfiniteTablePropRowClassName<T>;
7684
7740
  rowHoverClassName?: string;
7741
+ /**
7742
+ * Forces cells to re-render when their row didn't change but something they
7743
+ * render depends on did (eg: cross-row computations). Applies to all columns,
7744
+ * unless a column specifies its own `repaintCellsKey`, which takes precedence.
7745
+ */
7746
+ repaintCellsKey?: InfiniteTablePropRepaintCellsKey<T>;
7685
7747
  columnHeaderHeight?: number | string;
7686
7748
  onKeyDown?: (context: InfiniteTablePublicContext<T> & {
7687
7749
  actions: InfiniteTableEventHandlerContext<T>['actions'];
@@ -8293,4 +8355,4 @@ declare const components: {
8293
8355
  NumberFilterEditor: typeof NumberFilterEditor;
8294
8356
  };
8295
8357
 
8296
- export { type AdvancedAlignable, AutoScroller, type AutoScrollerConfig, CellSelectionState, type CellSelectionStateObject, type ColumnTypeWithInherit, DRAG_ITEM_ATTRIBUTE, DataClient, DataSource, type DataSourceAction, DataSourceActionType, type DataSourceAggregationReducer, type DataSourceApi, type DataSourceCRUDParam, type DataSourceCallback_BaseParam, type DataSourceComponentActions, type DataSourceContextValue, type DataSourceData, type DataSourceDataFn, type DataSourceDataParams, type DataSourceDataParamsChanges, type DataSourceDebugWarningKey, type DataSourceDerivedState, type DataSourceFilterFunctionParam, type DataSourceFilterOperator, type DataSourceFilterOperatorFunction, type DataSourceFilterOperatorFunctionParam, type DataSourceFilterType, type DataSourceFilterValueItem, type DataSourceFilterValueItemValueGetter, type DataSourceGroupBy, type DataSourceGroupRowsList, type DataSourceInsertParam, type DataSourceLivePaginationCursorFn, type DataSourceLivePaginationCursorParams, type DataSourceLivePaginationCursorValue, type DataSourceMappedState, type DataSourceMappings, type DataSourceMasterDetailContextValue, type DataSourcePivotBy, type DataSourcePropAggregationReducers, type DataSourcePropCellSelection, type DataSourcePropCellSelection_MultiCell, type DataSourcePropCellSelection_SingleCell, type DataSourcePropFilterFunction, type DataSourcePropFilterTypes, type DataSourcePropFilterValue, type DataSourcePropGroupBy, type DataSourcePropGroupRowsState, type DataSourcePropGroupRowsStateObject, type DataSourcePropIsNodeExpanded, type DataSourcePropIsNodeReadOnly, type DataSourcePropIsNodeSelectable, type DataSourcePropIsNodeSelected, type DataSourcePropIsRowSelected, type DataSourcePropLivePaginationCursor, type DataSourcePropMultiRowSelectionChangeParamType, type DataSourcePropOnCellSelectionChange, type DataSourcePropOnCellSelectionChange_MultiCell, type DataSourcePropOnCellSelectionChange_SingleCell, type DataSourcePropOnRowSelectionChange, type DataSourcePropOnRowSelectionChange_MultiRow, type DataSourcePropOnRowSelectionChange_SingleRow, type DataSourcePropOnTreeSelectionChange, type DataSourcePropOnTreeSelectionChange_MultiNode, type DataSourcePropOnTreeSelectionChange_SingleNode, type DataSourcePropPivotBy, type DataSourcePropRowInfoReducers, type DataSourcePropRowSelection, type DataSourcePropRowSelection_MultiRow, type DataSourcePropRowSelection_SingleRow, type DataSourcePropSelectionMode, type DataSourcePropShouldReloadData, type DataSourcePropShouldReloadDataObject, type DataSourcePropSortFn, type DataSourcePropSortInfo, type DataSourcePropSortTypes, type DataSourcePropTreeFilterFunction, type DataSourcePropTreeSelection, type DataSourcePropTreeSelection_MultiNode, type DataSourcePropTreeSelection_SingleNode, type DataSourceProps, type DataSourcePropsNotAvailableInTreeDataSource, type DataSourcePropsWithChildren, type DataSourceRawReducer, type DataSourceRemoteData, type DataSourceRowInfoReducer, type DataSourceSetupState, type DataSourceSingleSortInfo, type DataSourceSortInfo, type DataSourceStableContextValue, type DataSourceState, type DataSourceUpdateParam, type DebugLogger, type DebugTimingKey, type DebugWarningPayload, DeepMap, type DevToolsDataSourceOverrides, type DevToolsGenericMessage, type DevToolsHookFn, type DevToolsHookFnOptions, type DevToolsHostPageLogMessage, type DevToolsHostPageLogMessagePayload, type DevToolsHostPageMessage, type DevToolsHostPageMessagePayload, type DevToolsHostPageMessageType, type DevToolsInfiniteOverrides, type DevToolsMessageAddress, type DevToolsOverrides, DragDropProvider, type DragDropSourceAndTarget, DragInteractionTarget, DragList, type DragListProps, type DragProxyMoveParams, type DragProxyRenderParams, type DragProxySetupParams, type DragProxySetupResult, type ElementContainerGetter, type ErrorCodeKey, FixedSizeSet, FlashingColumnCell, GroupRowsState, INTERNAL_MatrixDebugger, type InfiniteColumnEditorContextType, InfiniteTable, type InfiniteTableAction, InfiniteTableActionType, type InfiniteTableApi, type InfiniteTableCellSelectionApi, InfiniteTableClassName, type InfiniteTableColumn, type InfiniteTableColumnAggregator, type InfiniteTableColumnApi, type InfiniteTableColumnCellContextType, type InfiniteTableColumnComparer, type InfiniteTableColumnGroup, type InfiniteTableColumnRenderFunctionForGroupRows, type InfiniteTableColumnRenderFunctionForNormalRows, type InfiniteTableColumnRenderValueParam, type InfiniteTableColumnRowspanParam, type InfiniteTableColumnSizingOptions, type InfiniteTableColumnValueFormatterParams, type InfiniteTableColumnValueGetterParams, InfiniteTableComponent, type InfiniteTableComputedColumn, type InfiniteTableComputedValues, type InfiniteTableContextValue, type InfiniteTableDebugWarningKey, type InfiniteTableGroupColumnBase, type InfiniteTableGroupColumnFunction, type InfiniteTableGroupColumnGetterOptions, type InfiniteTableKeyboardNavigationApi, type InfiniteTablePivotColumn, type InfiniteTablePropAutoSizeColumnsKey, type InfiniteTablePropColumnGroupVisibility, type InfiniteTablePropColumnGroups, type InfiniteTablePropColumnOrder, type InfiniteTablePropColumnPinning, type InfiniteTablePropColumnSizing, type InfiniteTablePropColumnTypes, type InfiniteTablePropColumnVisibility, type InfiniteTablePropColumns, type InfiniteTablePropComponents, type InfiniteTablePropGetCellContextMenuItems, type InfiniteTablePropGetColumnMenuItems, type InfiniteTablePropGetContextMenuItems, type InfiniteTablePropGroupColumn, type InfiniteTablePropGroupRenderStrategy, type InfiniteTablePropHeaderOptions, type InfiniteTablePropKeyboardNavigation, type InfiniteTablePropKeyboardShorcut, type InfiniteTablePropMultiSortBehavior, type InfiniteTablePropRowClassName, type InfiniteTablePropRowStyle, type InfiniteTableProps, type InfiniteTablePropsNotAvailableInTreeGrid, type InfiniteTableRowClassNameFn, type InfiniteTableRowDetailApi, type InfiniteTableRowInfo, type InfiniteTableRowSelectionApi, type InfiniteTableRowStyleFn, type InfiniteTableState, type InfiniteTable_HasGrouping_RowInfoGroup, type InfiniteTable_HasGrouping_RowInfoNormal, type InfiniteTable_Tree_RowInfoLeafNode, type InfiniteTable_Tree_RowInfoNode, type InfiniteTable_Tree_RowInfoParentNode, type LazyGroupDataDeepMap, type LazyGroupDataItem, type LazyRowInfoGroup, Menu, type MenuChildrenFnParam, type MenuColumn, type MenuColumnRenderParam, type MenuDecoration, type MenuIconProps, type MenuItemActionContext, type MenuItemDefinition, type MenuItemObject, type MenuProps, type MenuRenderable, type MenuRuntimeItem, type MenuRuntimeItemSelectable, type MenuSeparator, type OverlayShowParams, RowDetailCache, RowDetailState, type RowDetailStateObject, RowDisabledState, type RowDisabledStateObject, RowSelectionState, type ScrollStopInfo, type Scrollbars, type ShowOverlayFn, type TableRenderRange, TreeDataSource, type TreeDataSourceProps, TreeExpandState, type TreeExpandStateValue, TreeGrid, type TreeGridOnlyProps, type TreeGridProps, TreeSelectionState, type TreeSelectionStateObject, type TreeSelectionValue, type UpdateChildrenFn, type UpdateOverlayContentFn, type WaitForNodeOptions, WeakFixedSizeSet, alignNode, components, createDefaultProxy, createFlashingColumnCellComponent, debounce, debug, defaultDragProxyMove, defaultFilterTypes, eventMatchesKeyboardShortcut, filterDataArray, defaultFilterTypes as filterTypes, flatten, buildManagedComponent as getComponentStateRoot, group, interceptMap, keyboardShortcuts, multisort, multisortNested, queryKeyToCacheKey, toTreeDataArray, useManagedComponentState as useComponentState, useDataSourceApi, useDataSourceInternal, useDataSourceSelector, useDataSourceState, useDragDropProvider, useDragListContext, useEffectWhen, useEffectWhenSameDeps, useEffectWithChanges, useEffectWithObject, useGridScroll, useInfiniteColumnApi, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useInfinitePortalContainer, useInfiniteTableApi, useLayoutEffectWithChanges, useManagedDataSource, useMasterRowInfo, useOverlay, useOverlayPortal, usePrevious, useRowInfoReducers, useVisibleColumnSizes, withSelectedLeafNodesOnly };
8358
+ export { type AdvancedAlignable, AutoScroller, type AutoScrollerConfig, CellSelectionState, type CellSelectionStateObject, type ColumnTypeWithInherit, DRAG_ITEM_ATTRIBUTE, DataClient, DataSource, type DataSourceAction, DataSourceActionType, type DataSourceAggregationReducer, type DataSourceApi, type DataSourceCRUDParam, type DataSourceCallback_BaseParam, type DataSourceComponentActions, type DataSourceContextValue, type DataSourceData, type DataSourceDataFn, type DataSourceDataParams, type DataSourceDataParamsChanges, type DataSourceDebugWarningKey, type DataSourceDerivedState, type DataSourceFilterFunctionParam, type DataSourceFilterOperator, type DataSourceFilterOperatorFunction, type DataSourceFilterOperatorFunctionParam, type DataSourceFilterType, type DataSourceFilterValueItem, type DataSourceFilterValueItemValueGetter, type DataSourceGroupBy, type DataSourceGroupRowsList, type DataSourceInsertParam, type DataSourceLivePaginationCursorFn, type DataSourceLivePaginationCursorParams, type DataSourceLivePaginationCursorValue, type DataSourceMappedState, type DataSourceMappings, type DataSourceMasterDetailContextValue, type DataSourcePivotBy, type DataSourcePropAggregationReducers, type DataSourcePropCellSelection, type DataSourcePropCellSelection_MultiCell, type DataSourcePropCellSelection_SingleCell, type DataSourcePropFilterFunction, type DataSourcePropFilterTypes, type DataSourcePropFilterValue, type DataSourcePropGroupBy, type DataSourcePropGroupRowsState, type DataSourcePropGroupRowsStateObject, type DataSourcePropIsNodeExpanded, type DataSourcePropIsNodeReadOnly, type DataSourcePropIsNodeSelectable, type DataSourcePropIsNodeSelected, type DataSourcePropIsRowSelected, type DataSourcePropLivePaginationCursor, type DataSourcePropMultiRowSelectionChangeParamType, type DataSourcePropOnCellSelectionChange, type DataSourcePropOnCellSelectionChange_MultiCell, type DataSourcePropOnCellSelectionChange_SingleCell, type DataSourcePropOnRowSelectionChange, type DataSourcePropOnRowSelectionChange_MultiRow, type DataSourcePropOnRowSelectionChange_SingleRow, type DataSourcePropOnTreeSelectionChange, type DataSourcePropOnTreeSelectionChange_MultiNode, type DataSourcePropOnTreeSelectionChange_SingleNode, type DataSourcePropPivotBy, type DataSourcePropRowInfoReducers, type DataSourcePropRowSelection, type DataSourcePropRowSelection_MultiRow, type DataSourcePropRowSelection_SingleRow, type DataSourcePropSelectionMode, type DataSourcePropShouldReloadData, type DataSourcePropShouldReloadDataObject, type DataSourcePropSortFn, type DataSourcePropSortInfo, type DataSourcePropSortTypes, type DataSourcePropTreeFilterFunction, type DataSourcePropTreeSelection, type DataSourcePropTreeSelection_MultiNode, type DataSourcePropTreeSelection_SingleNode, type DataSourceProps, type DataSourcePropsNotAvailableInTreeDataSource, type DataSourcePropsWithChildren, type DataSourceRawReducer, type DataSourceRemoteData, type DataSourceRowInfoReducer, type DataSourceSetupState, type DataSourceSingleSortInfo, type DataSourceSortInfo, type DataSourceStableContextValue, type DataSourceState, type DataSourceUpdateParam, type DebugLogger, type DebugTimingKey, type DebugWarningPayload, DeepMap, type DevToolsDataSourceOverrides, type DevToolsGenericMessage, type DevToolsHookFn, type DevToolsHookFnOptions, type DevToolsHostPageLogMessage, type DevToolsHostPageLogMessagePayload, type DevToolsHostPageMessage, type DevToolsHostPageMessagePayload, type DevToolsHostPageMessageType, type DevToolsInfiniteOverrides, type DevToolsMessageAddress, type DevToolsOverrides, DragDropProvider, type DragDropSourceAndTarget, DragInteractionTarget, DragList, type DragListProps, type DragProxyMoveParams, type DragProxyRenderParams, type DragProxySetupParams, type DragProxySetupResult, type ElementContainerGetter, type ErrorCodeKey, FixedSizeSet, FlashingColumnCell, GroupRowsState, INTERNAL_MatrixDebugger, type InfiniteColumnEditorContextType, InfiniteTable, type InfiniteTableAction, InfiniteTableActionType, type InfiniteTableApi, type InfiniteTableCellSelectionApi, InfiniteTableClassName, type InfiniteTableColumn, type InfiniteTableColumnAggregator, type InfiniteTableColumnApi, type InfiniteTableColumnCellContextType, type InfiniteTableColumnComparer, type InfiniteTableColumnGroup, type InfiniteTableColumnRenderFunctionForGroupRows, type InfiniteTableColumnRenderFunctionForNormalRows, type InfiniteTableColumnRenderValueParam, type InfiniteTableColumnRowspanParam, type InfiniteTableColumnSizingOptions, type InfiniteTableColumnValueFormatterParams, type InfiniteTableColumnValueGetterParams, InfiniteTableComponent, type InfiniteTableComputedColumn, type InfiniteTableComputedValues, type InfiniteTableContextValue, type InfiniteTableDebugWarningKey, type InfiniteTableGroupColumnBase, type InfiniteTableGroupColumnFunction, type InfiniteTableGroupColumnGetterOptions, type InfiniteTableKeyboardNavigationApi, type InfiniteTablePivotColumn, type InfiniteTablePropAutoSizeColumnsKey, type InfiniteTablePropColumnGroupVisibility, type InfiniteTablePropColumnGroups, type InfiniteTablePropColumnOrder, type InfiniteTablePropColumnPinning, type InfiniteTablePropColumnSizing, type InfiniteTablePropColumnTypes, type InfiniteTablePropColumnVisibility, type InfiniteTablePropColumns, type InfiniteTablePropComponents, type InfiniteTablePropGetCellContextMenuItems, type InfiniteTablePropGetColumnMenuItems, type InfiniteTablePropGetContextMenuItems, type InfiniteTablePropGroupColumn, type InfiniteTablePropGroupRenderStrategy, type InfiniteTablePropHeaderOptions, type InfiniteTablePropKeyboardNavigation, type InfiniteTablePropKeyboardShorcut, type InfiniteTablePropMultiSortBehavior, type InfiniteTablePropRepaintCellsKey, type InfiniteTablePropRepaintCellsKeyFn, type InfiniteTablePropRepaintCellsKeyFnParams, type InfiniteTablePropRowClassName, type InfiniteTablePropRowStyle, type InfiniteTableProps, type InfiniteTablePropsNotAvailableInTreeGrid, type InfiniteTableRowClassNameFn, type InfiniteTableRowDetailApi, type InfiniteTableRowInfo, type InfiniteTableRowSelectionApi, type InfiniteTableRowStyleFn, type InfiniteTableState, type InfiniteTable_HasGrouping_RowInfoGroup, type InfiniteTable_HasGrouping_RowInfoNormal, type InfiniteTable_Tree_RowInfoLeafNode, type InfiniteTable_Tree_RowInfoNode, type InfiniteTable_Tree_RowInfoParentNode, type LazyGroupDataDeepMap, type LazyGroupDataItem, type LazyRowInfoGroup, Menu, type MenuChildrenFnParam, type MenuColumn, type MenuColumnRenderParam, type MenuDecoration, type MenuIconProps, type MenuItemActionContext, type MenuItemDefinition, type MenuItemObject, type MenuProps, type MenuRenderable, type MenuRuntimeItem, type MenuRuntimeItemSelectable, type MenuSeparator, type OverlayShowParams, RowDetailCache, RowDetailState, type RowDetailStateObject, RowDisabledState, type RowDisabledStateObject, RowSelectionState, type ScrollStopInfo, type Scrollbars, type ShowOverlayFn, type TableRenderRange, TreeDataSource, type TreeDataSourceProps, TreeExpandState, type TreeExpandStateValue, TreeGrid, type TreeGridOnlyProps, type TreeGridProps, TreeSelectionState, type TreeSelectionStateObject, type TreeSelectionValue, type UpdateChildrenFn, type UpdateOverlayContentFn, type WaitForNodeOptions, WeakFixedSizeSet, alignNode, components, createDefaultProxy, createFlashingColumnCellComponent, debounce, debug, defaultDragProxyMove, defaultFilterTypes, eventMatchesKeyboardShortcut, filterDataArray, defaultFilterTypes as filterTypes, flatten, buildManagedComponent as getComponentStateRoot, group, interceptMap, keyboardShortcuts, multisort, multisortNested, queryKeyToCacheKey, toTreeDataArray, useManagedComponentState as useComponentState, useDataSourceApi, useDataSourceInternal, useDataSourceSelector, useDataSourceState, useDragDropProvider, useDragListContext, useEffectWhen, useEffectWhenSameDeps, useEffectWithChanges, useEffectWithObject, useGridScroll, useInfiniteColumnApi, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useInfinitePortalContainer, useInfiniteTableApi, useLayoutEffectWithChanges, useManagedDataSource, useMasterRowInfo, useOverlay, useOverlayPortal, usePrevious, useRowInfoReducers, useVisibleColumnSizes, withSelectedLeafNodesOnly };
package/index.dev.js CHANGED
@@ -6365,6 +6365,39 @@ var React26 = __toESM(require("react"));
6365
6365
  var React25 = __toESM(require("react"));
6366
6366
  var import_react20 = require("react");
6367
6367
 
6368
+ // src/components/InfiniteTable/components/InfiniteTableRow/repaintCellsKey.ts
6369
+ var REPAINT_CELLS_KEY_NO_ROW = Symbol("REPAINT_CELLS_KEY_NO_ROW");
6370
+ function isRepaintCellsKeyFn(repaintCellsKey) {
6371
+ return typeof repaintCellsKey === "function";
6372
+ }
6373
+ function computeRepaintCellsKey(fn, params) {
6374
+ const { column, rowIndex, rowInfoStore, getDataSourceState } = params;
6375
+ const rowInfo = rowInfoStore.getRowInfoAtIndex(rowIndex);
6376
+ if (!rowInfo) {
6377
+ return REPAINT_CELLS_KEY_NO_ROW;
6378
+ }
6379
+ const states = rowInfoStore.getDataSourceStates();
6380
+ return fn({
6381
+ rowInfo,
6382
+ column,
6383
+ dataSourceState: states.dataSourceState ?? getDataSourceState(),
6384
+ previousDataSourceState: states.previousDataSourceState
6385
+ });
6386
+ }
6387
+ function subscribeToRepaintCellsKey(fn, params, onKeyChange) {
6388
+ let lastKey = computeRepaintCellsKey(fn, params);
6389
+ return params.rowInfoStore.subscribeToDataArrayChange(() => {
6390
+ const nextKey = computeRepaintCellsKey(fn, params);
6391
+ if (nextKey === REPAINT_CELLS_KEY_NO_ROW) {
6392
+ return;
6393
+ }
6394
+ if (!Object.is(nextKey, lastKey)) {
6395
+ lastKey = nextKey;
6396
+ onKeyChange();
6397
+ }
6398
+ });
6399
+ }
6400
+
6368
6401
  // src/components/InfiniteTable/components/cell.css.ts
6369
6402
  var ColumnCellCls = "_1eexc2a7 _1eexc2a6";
6370
6403
  var ColumnCellRecipe = createRuntimeFn({ defaultClassName: "_1eexc2an", variantClassNames: { dragging: { false: "_1eexc2ao", true: "_1eexc2ap" }, insideDisabledDraggingPage: { true: "_1eexc2aq", false: "_1eexc2ar" }, cellSelected: { false: "_1eexc2as", true: "_1eexc2at" }, treeNode: { parent: "_1eexc2au", leaf: "_1eexc2av", false: "_1eexc2aw" }, align: { start: "_1eexc2ax", end: "_1eexc2ay", center: "_1eexc2az" }, verticalAlign: { start: "_1eexc2a10", end: "_1eexc2a11", center: "_1eexc2a12" }, rowActive: { false: "_1eexc2a13", true: "_1eexc2a14" }, groupRow: { false: "_1eexc2a15", true: "_1eexc2a16" }, groupCell: { false: "_1eexc2a17", true: "_1eexc2a18" }, rowDisabled: { false: "_1eexc2a19", true: "_1eexc2a1a" }, zebra: { false: "_1eexc2a1b", even: "_1eexc2a1c", odd: "_1eexc2a1d" }, rowSelected: { true: "_1eexc2a1e", false: "_1eexc2a1f", null: "_1eexc2a1g" }, first: { true: "_1eexc2a1h", false: "_1eexc2a1i" }, last: { true: "_1eexc2a1j", false: "_1eexc2a1k" }, groupByField: { true: "_1eexc2a1l", false: "_1eexc2a1m" }, firstInCategory: { true: "_1eexc2a1n", false: "_1eexc2a1o" }, firstRow: { true: "_1eexc2a1p", false: "_1eexc2a1q" }, firstRowInHorizontalLayoutPage: { true: "_1eexc2a1r", false: "_1eexc2a1s" }, lastInCategory: { true: "_1eexc2a1t", false: "_1eexc2a1u" }, pinned: { start: "_1eexc2a1v", end: "_1eexc2a1w", false: "_1eexc2a1x" }, filtered: { true: "_1eexc2a1y", false: "_1eexc2a1z" } }, defaultVariants: {}, compoundVariants: [[{ firstRowInHorizontalLayoutPage: true, firstRow: false }, "_1eexc2a20"], [{ pinned: "start", lastInCategory: true }, "_1eexc2a21"], [{ pinned: "start", firstInCategory: true }, "_1eexc2a22"], [{ pinned: "end", firstInCategory: true }, "_1eexc2a23"], [{ pinned: "end", lastInCategory: true }, "_1eexc2a24"], [{ align: "center", groupCell: false }, "_1eexc2a25"], [{ rowDisabled: true, zebra: "odd" }, "_1eexc2a26"]] });
@@ -7376,6 +7409,21 @@ var defaultRenderSelectionCheckBox = (params) => {
7376
7409
  }
7377
7410
  );
7378
7411
  };
7412
+ function useRepaintCellsKey(params) {
7413
+ const { repaintCellsKey, column, rowIndex, rowInfoStore, getDataSourceState } = params;
7414
+ const [, forceRepaint] = (0, import_react20.useReducer)((x) => x + 1, 0);
7415
+ const repaintCellsKeyFn = isRepaintCellsKeyFn(repaintCellsKey) ? repaintCellsKey : void 0;
7416
+ (0, import_react20.useEffect)(() => {
7417
+ if (!repaintCellsKeyFn) {
7418
+ return;
7419
+ }
7420
+ return subscribeToRepaintCellsKey(
7421
+ repaintCellsKeyFn,
7422
+ { column, rowIndex, rowInfoStore, getDataSourceState },
7423
+ forceRepaint
7424
+ );
7425
+ }, [repaintCellsKeyFn, column, rowIndex, rowInfoStore, getDataSourceState]);
7426
+ }
7379
7427
  function InfiniteTableColumnCellFn(props) {
7380
7428
  const {
7381
7429
  dataSourceStatePartialForCell,
@@ -7389,6 +7437,7 @@ function InfiniteTableColumnCellFn(props) {
7389
7437
  computedColumnOrder,
7390
7438
  cellStyle,
7391
7439
  cellClassName,
7440
+ repaintCellsKey,
7392
7441
  rowDetailState,
7393
7442
  width,
7394
7443
  column,
@@ -7425,6 +7474,13 @@ function InfiniteTableColumnCellFn(props) {
7425
7474
  [rowInfoStore, rowIndex]
7426
7475
  )
7427
7476
  );
7477
+ useRepaintCellsKey({
7478
+ repaintCellsKey,
7479
+ column,
7480
+ rowIndex,
7481
+ rowInfoStore,
7482
+ getDataSourceState
7483
+ });
7428
7484
  const isEmptyRowInfo = !rowInfoFromStore;
7429
7485
  const isEmptyColumn = !column;
7430
7486
  const htmlElementRef = React25.useRef(null);
@@ -20231,9 +20287,22 @@ function deepEqualRowInfo(oldRowInfo, newRowInfo) {
20231
20287
  function createRowInfoStore() {
20232
20288
  let dataArray = [];
20233
20289
  const subscribers = /* @__PURE__ */ new Map();
20290
+ const dataArrayChangeSubscribers = /* @__PURE__ */ new Set();
20291
+ let dataSourceStates = {
20292
+ dataSourceState: void 0,
20293
+ previousDataSourceState: void 0
20294
+ };
20234
20295
  const notifyDataArray = (newDataArray, params) => {
20235
20296
  const oldDataArray = dataArray;
20236
20297
  const marker = params?.marker;
20298
+ const dataArrayChanged = newDataArray !== oldDataArray;
20299
+ const notifyDataArrayChange = dataArrayChanged && dataArrayChangeSubscribers.size > 0;
20300
+ if (notifyDataArrayChange) {
20301
+ dataSourceStates = {
20302
+ dataSourceState: params?.dataSourceState,
20303
+ previousDataSourceState: params?.previousDataSourceState
20304
+ };
20305
+ }
20237
20306
  if (marker) {
20238
20307
  marker.start({
20239
20308
  details: [
@@ -20259,7 +20328,7 @@ function createRowInfoStore() {
20259
20328
  }
20260
20329
  }
20261
20330
  dataArray = newDataArray;
20262
- if (changedIndices.length > 0) {
20331
+ if (changedIndices.length > 0 || notifyDataArrayChange) {
20263
20332
  queueMicrotask(() => {
20264
20333
  for (let i = 0, len = changedIndices.length; i < len; i++) {
20265
20334
  const index = changedIndices[i];
@@ -20270,6 +20339,11 @@ function createRowInfoStore() {
20270
20339
  }
20271
20340
  }
20272
20341
  }
20342
+ if (notifyDataArrayChange) {
20343
+ for (const callback of Array.from(dataArrayChangeSubscribers)) {
20344
+ callback();
20345
+ }
20346
+ }
20273
20347
  });
20274
20348
  }
20275
20349
  if (marker) {
@@ -20304,14 +20378,36 @@ function createRowInfoStore() {
20304
20378
  const getDataArray = () => {
20305
20379
  return dataArray;
20306
20380
  };
20381
+ const subscribeToDataArrayChange = (callback) => {
20382
+ dataArrayChangeSubscribers.add(callback);
20383
+ return () => {
20384
+ dataArrayChangeSubscribers.delete(callback);
20385
+ if (dataArrayChangeSubscribers.size === 0) {
20386
+ dataSourceStates = {
20387
+ dataSourceState: void 0,
20388
+ previousDataSourceState: void 0
20389
+ };
20390
+ }
20391
+ };
20392
+ };
20393
+ const getDataSourceStates = () => {
20394
+ return dataSourceStates;
20395
+ };
20307
20396
  const clear = () => {
20308
20397
  dataArray = [];
20309
20398
  subscribers.clear();
20399
+ dataArrayChangeSubscribers.clear();
20400
+ dataSourceStates = {
20401
+ dataSourceState: void 0,
20402
+ previousDataSourceState: void 0
20403
+ };
20310
20404
  };
20311
20405
  return {
20312
20406
  notifyDataArray,
20313
20407
  getRowInfoAtIndex,
20314
20408
  subscribeToRowIndex,
20409
+ subscribeToDataArrayChange,
20410
+ getDataSourceStates,
20315
20411
  getDataArray,
20316
20412
  clear
20317
20413
  };
@@ -21995,7 +22091,9 @@ function concludeReducer(params) {
21995
22091
  };
21996
22092
  }
21997
22093
  state.rowInfoStore.notifyDataArray(rowInfoDataArray, {
21998
- marker: debugId ? getMarker(debugId).track.DataSource.label.DiffRowInfoInStore : void 0
22094
+ marker: debugId ? getMarker(debugId).track.DataSource.label.DiffRowInfoInStore : void 0,
22095
+ dataSourceState: state,
22096
+ previousDataSourceState: previousState
21999
22097
  });
22000
22098
  if (rootMarker) {
22001
22099
  rootMarker?.track.DataSource.label.PrepareData.end({
@@ -25914,6 +26012,7 @@ var forwardProps4 = (_setupState) => {
25914
26012
  keyboardShortcuts: 1,
25915
26013
  rowStyle: 1,
25916
26014
  cellStyle: 1,
26015
+ repaintCellsKey: 1,
25917
26016
  rowProps: 1,
25918
26017
  rowClassName: 1,
25919
26018
  rowHoverClassName: 1,
@@ -27659,7 +27758,7 @@ var useLicense = (licenseKey = "") => {
27659
27758
  }
27660
27759
  let valid2 = isValidLicense(licenseKey, {
27661
27760
  publishedAt: 1624970570587,
27662
- version: "9.0.3"
27761
+ version: "9.1.0"
27663
27762
  });
27664
27763
  if (!licenseKey && !valid2 && isInsidePlayground) {
27665
27764
  return true;
@@ -32169,6 +32268,7 @@ function useCellRendering(param) {
32169
32268
  isRowDetailsEnabled,
32170
32269
  cellClassName,
32171
32270
  cellStyle,
32271
+ repaintCellsKey,
32172
32272
  rowStyle,
32173
32273
  rowDetailCache,
32174
32274
  rowClassName,
@@ -32198,6 +32298,7 @@ function useCellRendering(param) {
32198
32298
  isRowDetailsEnabled: ctx.state.isRowDetailEnabled,
32199
32299
  cellClassName: ctx.state.cellClassName,
32200
32300
  cellStyle: ctx.state.cellStyle,
32301
+ repaintCellsKey: ctx.state.repaintCellsKey,
32201
32302
  rowStyle: ctx.state.rowStyle,
32202
32303
  rowDetailCache: ctx.state.rowDetailCache,
32203
32304
  rowClassName: ctx.state.rowClassName,
@@ -32393,6 +32494,8 @@ function useCellRendering(param) {
32393
32494
  rowClassName,
32394
32495
  cellStyle,
32395
32496
  cellClassName,
32497
+ // the column-level key wins over the table-level one
32498
+ repaintCellsKey: column.repaintCellsKey !== void 0 ? column.repaintCellsKey : repaintCellsKey,
32396
32499
  visibleColumnIds,
32397
32500
  computedColumnOrder,
32398
32501
  // Whether this specific cell is in edit mode
@@ -32434,6 +32537,7 @@ function useCellRendering(param) {
32434
32537
  rowClassName,
32435
32538
  cellClassName,
32436
32539
  cellStyle,
32540
+ repaintCellsKey,
32437
32541
  getDataSourceState,
32438
32542
  dataSourceApi,
32439
32543
  dataSourceActions,