@infinite-table/infinite-react 8.0.3 → 8.0.5

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
@@ -3411,6 +3411,10 @@ declare namespace InfiniteTableBody {
3411
3411
  var rowHoverClassName: string[];
3412
3412
  }
3413
3413
 
3414
+ declare function useInfiniteTableApi<T>(): InfiniteTableApi<T>;
3415
+
3416
+ declare function useInfiniteColumnApi<T = unknown>(columnId: string): InfiniteTableColumnApi<T> | null;
3417
+
3414
3418
  declare const InfiniteTableClassName: string;
3415
3419
  declare const InfiniteTableComponent: React$1.MemoExoticComponent<(<T>() => React$1.JSX.Element)>;
3416
3420
  type InfiniteTableComponent = {
@@ -3479,6 +3483,8 @@ declare function useDataSourceSelector<R extends unknown>(selector: (ctx: DataSo
3479
3483
 
3480
3484
  declare function useMasterRowInfo<T = any>(): InfiniteTableRowInfo<T> | undefined;
3481
3485
 
3486
+ declare function useDataSourceApi<T>(): DataSourceApi<T>;
3487
+
3482
3488
  declare const useManagedDataSource: (props: object) => {
3483
3489
  contextValue: {
3484
3490
  componentState: {
@@ -7220,6 +7226,8 @@ type ColumnCellValues = {
7220
7226
  formattedValue: any;
7221
7227
  };
7222
7228
  type InfiniteTableColumnApi<_T> = {
7229
+ getColumnId(): string | null;
7230
+ getComputedColumn(): InfiniteTableComputedColumn<_T> | null;
7223
7231
  showContextMenu: (target: EventTarget | HTMLElement) => void;
7224
7232
  toggleContextMenu: (target: EventTarget | HTMLElement) => void;
7225
7233
  hideContextMenu: () => void;
@@ -8169,4 +8177,4 @@ declare const components: {
8169
8177
  NumberFilterEditor: typeof NumberFilterEditor;
8170
8178
  };
8171
8179
 
8172
- 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, useDataSourceInternal, useDataSourceSelector, useDataSourceState, useDragDropProvider, useDragListContext, useEffectWhen, useEffectWhenSameDeps, useEffectWithChanges, useEffectWithObject, useGridScroll, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useInfinitePortalContainer, useLayoutEffectWithChanges, useManagedDataSource, useMasterRowInfo, useOverlay, useOverlayPortal, usePrevious, useRowInfoReducers, useVisibleColumnSizes, withSelectedLeafNodesOnly };
8180
+ 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 };
package/index.dev.js CHANGED
@@ -116,6 +116,7 @@ __export(index_exports, {
116
116
  queryKeyToCacheKey: () => queryKeyToCacheKey,
117
117
  toTreeDataArray: () => toTreeDataArray,
118
118
  useComponentState: () => useManagedComponentState,
119
+ useDataSourceApi: () => useDataSourceApi,
119
120
  useDataSourceInternal: () => useDataSourceInternal,
120
121
  useDataSourceSelector: () => useDataSourceSelector,
121
122
  useDataSourceState: () => useDataSourceState,
@@ -126,11 +127,13 @@ __export(index_exports, {
126
127
  useEffectWithChanges: () => useEffectWithChanges,
127
128
  useEffectWithObject: () => useEffectWithObject,
128
129
  useGridScroll: () => useGridScroll,
130
+ useInfiniteColumnApi: () => useInfiniteColumnApi,
129
131
  useInfiniteColumnCell: () => useInfiniteColumnCell,
130
132
  useInfiniteColumnEditor: () => useInfiniteColumnEditor,
131
133
  useInfiniteColumnFilterEditor: () => useInfiniteColumnFilterEditor,
132
134
  useInfiniteHeaderCell: () => useInfiniteHeaderCell,
133
135
  useInfinitePortalContainer: () => useInfinitePortalContainer,
136
+ useInfiniteTableApi: () => useInfiniteTableApi,
134
137
  useLayoutEffectWithChanges: () => useLayoutEffectWithChanges,
135
138
  useManagedDataSource: () => useManagedDataSource,
136
139
  useMasterRowInfo: () => useMasterRowInfo,
@@ -3437,6 +3440,12 @@ function getColumnApiForColumn(colOrColId, param) {
3437
3440
  },
3438
3441
  clearSort() {
3439
3442
  this.setSort(null);
3443
+ },
3444
+ getColumnId() {
3445
+ return column.id;
3446
+ },
3447
+ getComputedColumn() {
3448
+ return column;
3440
3449
  }
3441
3450
  };
3442
3451
  return columnApi;
@@ -8953,8 +8962,11 @@ var DragList = (props) => {
8953
8962
  const dragIndex = draggableItems.findIndex(
8954
8963
  (item) => item.id === dragItemId2
8955
8964
  );
8965
+ if (dragIndex === -1) {
8966
+ return;
8967
+ }
8956
8968
  const dragItem = draggableItems[dragIndex];
8957
- const dragItemNode = dragItems[dragIndex].getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}` ? dragItems[dragIndex] : dragItems.find(
8969
+ const dragItemNode = dragItems[dragIndex]?.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}` ? dragItems[dragIndex] : dragItems.find(
8958
8970
  (node) => node.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}`
8959
8971
  );
8960
8972
  setInteractionTarget(interactionTarget2);
@@ -22596,6 +22608,11 @@ function useDataSourceInternal(props) {
22596
22608
  };
22597
22609
  }
22598
22610
 
22611
+ // src/components/DataSource/publicHooks/useDataSourceApi.ts
22612
+ function useDataSourceApi() {
22613
+ return useDataSourceSelector((ctx) => ctx.dataSourceApi);
22614
+ }
22615
+
22599
22616
  // src/components/DataSource/RowDetailState.ts
22600
22617
  var RowDetailState = class extends BooleanCollectionState {
22601
22618
  constructor(state) {
@@ -23605,6 +23622,7 @@ function isSortInfoForColumn(sortInfo, col) {
23605
23622
  }
23606
23623
  var InfiniteTableApiImpl = class {
23607
23624
  constructor(context) {
23625
+ this.columnApiById = /* @__PURE__ */ new Map();
23608
23626
  this.getVisibleRenderRange = () => {
23609
23627
  return this.getState().brain.getRenderRange();
23610
23628
  };
@@ -23835,10 +23853,19 @@ var InfiniteTableApiImpl = class {
23835
23853
  return result;
23836
23854
  };
23837
23855
  this.getColumnApi = (columnIdOrIndex) => {
23838
- return getColumnApiForColumn(columnIdOrIndex, {
23856
+ const colId = typeof columnIdOrIndex === "string" ? columnIdOrIndex : this.getComputed().computedVisibleColumns[columnIdOrIndex]?.id;
23857
+ const existingApi = this.columnApiById.get(colId);
23858
+ if (existingApi) {
23859
+ return existingApi;
23860
+ }
23861
+ const columnApi = getColumnApiForColumn(columnIdOrIndex, {
23839
23862
  ...this.context,
23840
23863
  api: this
23841
23864
  });
23865
+ if (columnApi) {
23866
+ this.columnApiById.set(columnApi.getColumnId(), columnApi);
23867
+ }
23868
+ return columnApi;
23842
23869
  };
23843
23870
  this.isColumnSortable = (columnId) => {
23844
23871
  return this.getColumnApi(columnId)?.isSortable() ?? false;
@@ -26934,7 +26961,7 @@ var useLicense = (licenseKey = "") => {
26934
26961
  }
26935
26962
  let valid2 = isValidLicense(licenseKey, {
26936
26963
  publishedAt: 1624970570587,
26937
- version: "8.0.3"
26964
+ version: "8.0.5"
26938
26965
  });
26939
26966
  if (!licenseKey && !valid2 && isInsidePlayground) {
26940
26967
  return true;
@@ -31845,6 +31872,16 @@ function InfiniteTableBody(props) {
31845
31872
  }
31846
31873
  InfiniteTableBody.rowHoverClassName = _HOVERED_CLASS_NAMES;
31847
31874
 
31875
+ // src/components/InfiniteTable/hooks/useInfiniteTableApi.ts
31876
+ function useInfiniteTableApi() {
31877
+ return useInfiniteTableSelector((ctx) => ctx.api);
31878
+ }
31879
+
31880
+ // src/components/InfiniteTable/hooks/useInfiniteColumnApi.ts
31881
+ function useInfiniteColumnApi(columnId) {
31882
+ return useInfiniteTableSelector((ctx) => ctx.api.getColumnApi(columnId));
31883
+ }
31884
+
31848
31885
  // src/components/InfiniteTable/index.tsx
31849
31886
  var InfiniteTableClassName = internalProps.rootClassName;
31850
31887
  var { ManagedComponentContextProvider: InfiniteTableRoot } = buildManagedComponent({
@@ -32947,6 +32984,7 @@ var components = {
32947
32984
  queryKeyToCacheKey,
32948
32985
  toTreeDataArray,
32949
32986
  useComponentState,
32987
+ useDataSourceApi,
32950
32988
  useDataSourceInternal,
32951
32989
  useDataSourceSelector,
32952
32990
  useDataSourceState,
@@ -32957,11 +32995,13 @@ var components = {
32957
32995
  useEffectWithChanges,
32958
32996
  useEffectWithObject,
32959
32997
  useGridScroll,
32998
+ useInfiniteColumnApi,
32960
32999
  useInfiniteColumnCell,
32961
33000
  useInfiniteColumnEditor,
32962
33001
  useInfiniteColumnFilterEditor,
32963
33002
  useInfiniteHeaderCell,
32964
33003
  useInfinitePortalContainer,
33004
+ useInfiniteTableApi,
32965
33005
  useLayoutEffectWithChanges,
32966
33006
  useManagedDataSource,
32967
33007
  useMasterRowInfo,
package/index.dev.mjs CHANGED
@@ -3367,6 +3367,12 @@ function getColumnApiForColumn(colOrColId, param) {
3367
3367
  },
3368
3368
  clearSort() {
3369
3369
  this.setSort(null);
3370
+ },
3371
+ getColumnId() {
3372
+ return column.id;
3373
+ },
3374
+ getComputedColumn() {
3375
+ return column;
3370
3376
  }
3371
3377
  };
3372
3378
  return columnApi;
@@ -8883,8 +8889,11 @@ var DragList = (props) => {
8883
8889
  const dragIndex = draggableItems.findIndex(
8884
8890
  (item) => item.id === dragItemId2
8885
8891
  );
8892
+ if (dragIndex === -1) {
8893
+ return;
8894
+ }
8886
8895
  const dragItem = draggableItems[dragIndex];
8887
- const dragItemNode = dragItems[dragIndex].getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}` ? dragItems[dragIndex] : dragItems.find(
8896
+ const dragItemNode = dragItems[dragIndex]?.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}` ? dragItems[dragIndex] : dragItems.find(
8888
8897
  (node) => node.getAttribute(DRAG_ITEM_ATTRIBUTE) === `${dragItemId2}`
8889
8898
  );
8890
8899
  setInteractionTarget(interactionTarget2);
@@ -22531,6 +22540,11 @@ function useDataSourceInternal(props) {
22531
22540
  };
22532
22541
  }
22533
22542
 
22543
+ // src/components/DataSource/publicHooks/useDataSourceApi.ts
22544
+ function useDataSourceApi() {
22545
+ return useDataSourceSelector((ctx) => ctx.dataSourceApi);
22546
+ }
22547
+
22534
22548
  // src/components/DataSource/RowDetailState.ts
22535
22549
  var RowDetailState = class extends BooleanCollectionState {
22536
22550
  constructor(state) {
@@ -23540,6 +23554,7 @@ function isSortInfoForColumn(sortInfo, col) {
23540
23554
  }
23541
23555
  var InfiniteTableApiImpl = class {
23542
23556
  constructor(context) {
23557
+ this.columnApiById = /* @__PURE__ */ new Map();
23543
23558
  this.getVisibleRenderRange = () => {
23544
23559
  return this.getState().brain.getRenderRange();
23545
23560
  };
@@ -23770,10 +23785,19 @@ var InfiniteTableApiImpl = class {
23770
23785
  return result;
23771
23786
  };
23772
23787
  this.getColumnApi = (columnIdOrIndex) => {
23773
- return getColumnApiForColumn(columnIdOrIndex, {
23788
+ const colId = typeof columnIdOrIndex === "string" ? columnIdOrIndex : this.getComputed().computedVisibleColumns[columnIdOrIndex]?.id;
23789
+ const existingApi = this.columnApiById.get(colId);
23790
+ if (existingApi) {
23791
+ return existingApi;
23792
+ }
23793
+ const columnApi = getColumnApiForColumn(columnIdOrIndex, {
23774
23794
  ...this.context,
23775
23795
  api: this
23776
23796
  });
23797
+ if (columnApi) {
23798
+ this.columnApiById.set(columnApi.getColumnId(), columnApi);
23799
+ }
23800
+ return columnApi;
23777
23801
  };
23778
23802
  this.isColumnSortable = (columnId) => {
23779
23803
  return this.getColumnApi(columnId)?.isSortable() ?? false;
@@ -26873,7 +26897,7 @@ var useLicense = (licenseKey = "") => {
26873
26897
  }
26874
26898
  let valid2 = isValidLicense(licenseKey, {
26875
26899
  publishedAt: 1624970570587,
26876
- version: "8.0.3"
26900
+ version: "8.0.5"
26877
26901
  });
26878
26902
  if (!licenseKey && !valid2 && isInsidePlayground) {
26879
26903
  return true;
@@ -31794,6 +31818,16 @@ function InfiniteTableBody(props) {
31794
31818
  }
31795
31819
  InfiniteTableBody.rowHoverClassName = _HOVERED_CLASS_NAMES;
31796
31820
 
31821
+ // src/components/InfiniteTable/hooks/useInfiniteTableApi.ts
31822
+ function useInfiniteTableApi() {
31823
+ return useInfiniteTableSelector((ctx) => ctx.api);
31824
+ }
31825
+
31826
+ // src/components/InfiniteTable/hooks/useInfiniteColumnApi.ts
31827
+ function useInfiniteColumnApi(columnId) {
31828
+ return useInfiniteTableSelector((ctx) => ctx.api.getColumnApi(columnId));
31829
+ }
31830
+
31797
31831
  // src/components/InfiniteTable/index.tsx
31798
31832
  var InfiniteTableClassName = internalProps.rootClassName;
31799
31833
  var { ManagedComponentContextProvider: InfiniteTableRoot } = buildManagedComponent({
@@ -32895,6 +32929,7 @@ export {
32895
32929
  queryKeyToCacheKey,
32896
32930
  toTreeDataArray,
32897
32931
  useManagedComponentState as useComponentState,
32932
+ useDataSourceApi,
32898
32933
  useDataSourceInternal,
32899
32934
  useDataSourceSelector,
32900
32935
  useDataSourceState,
@@ -32905,11 +32940,13 @@ export {
32905
32940
  useEffectWithChanges,
32906
32941
  useEffectWithObject,
32907
32942
  useGridScroll,
32943
+ useInfiniteColumnApi,
32908
32944
  useInfiniteColumnCell,
32909
32945
  useInfiniteColumnEditor,
32910
32946
  useInfiniteColumnFilterEditor,
32911
32947
  useInfiniteHeaderCell,
32912
32948
  useInfinitePortalContainer,
32949
+ useInfiniteTableApi,
32913
32950
  useLayoutEffectWithChanges,
32914
32951
  useManagedDataSource,
32915
32952
  useMasterRowInfo,