@infinite-table/infinite-react 3.0.16 → 3.1.1

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/README.md CHANGED
@@ -84,7 +84,7 @@ It's fully typed and offers you great developer experience to help you get up an
84
84
 
85
85
  ## 🏢 Enterprise-ready
86
86
 
87
- Infinite Table is ready to power your enterprise apps, as it supports advanced [data fetching](https://infinite-table.com/docs/learn/working-with-data#data-loading-strategies), [filtering](https://infinite-table.com/docs/learn/filtering), [sorting](https://infinite-table.com/docs/learn/sorting/overview), [grouping](https://infinite-table.com/docs/learn/grouping-and-pivoting/grouping-rows), [pivoting](https://infinite-table.com/docs/learn/grouping-and-pivoting/pivoting/overview), [aggregations](https://infinite-table.com/docs/learn/grouping-and-pivoting/group-aggregations), [https://infinite-table.com/docs/learn/selection/row-selection](row & cell selection), [live pagination](https://infinite-table.com/docs/learn/working-with-data/live-pagination), [lazy loading](https://infinite-table.com/docs/learn/working-with-data/lazy-loading) - all of those with support for both client-side and server-side implementations.
87
+ Infinite Table is ready to power your enterprise apps, as it supports advanced [data fetching](https://infinite-table.com/docs/learn/working-with-data#data-loading-strategies), [filtering](https://infinite-table.com/docs/learn/filtering), [sorting](https://infinite-table.com/docs/learn/sorting/overview), [grouping](https://infinite-table.com/docs/learn/grouping-and-pivoting/grouping-rows), [pivoting](https://infinite-table.com/docs/learn/grouping-and-pivoting/pivoting/overview), [aggregations](https://infinite-table.com/docs/learn/grouping-and-pivoting/group-aggregations), [row & cell selection](https://infinite-table.com/docs/learn/selection/row-selection), [live pagination](https://infinite-table.com/docs/learn/working-with-data/live-pagination), [lazy loading](https://infinite-table.com/docs/learn/working-with-data/lazy-loading) - all of those with support for both client-side and server-side implementations.
88
88
 
89
89
  You can choose to leverage our built-in implementations in the browser or you can process your data on the server with full support from our-side.
90
90
 
package/index.d.ts CHANGED
@@ -301,6 +301,7 @@ declare type InfiniteTableColumnRenderParamBase<DATA_TYPE, COL_TYPE = InfiniteTa
301
301
  toggleGroupRow: InfiniteTableToggleGroupRowFn;
302
302
  toggleCurrentGroupRowSelection: () => void;
303
303
  toggleCurrentRowSelection: () => void;
304
+ rowHasSelectedCells: boolean;
304
305
  cellSelected: boolean;
305
306
  selectCurrentRow: () => void;
306
307
  selectRow: InfiniteTableSelectRowFn;
@@ -345,16 +346,17 @@ declare type InfiniteTableColumnVerticalAlignValues = 'start' | 'center' | 'end'
345
346
  declare type InfiniteTableColumnHeader<T> = Renderable | InfiniteTableColumnHeaderRenderFunction<T>;
346
347
  declare type InfiniteTableDataTypeNames = 'string' | 'number' | 'date' | string;
347
348
  declare type InfiniteTableColumnTypeNames = 'string' | 'number' | 'date' | string;
348
- declare type InfiniteTableColumnStyleFnParams<T> = {
349
+ declare type InfiniteTableColumnStylingFnParams<T> = {
349
350
  value: Renderable;
350
351
  column: InfiniteTableComputedColumn<T>;
351
352
  inEdit: boolean;
353
+ rowHasSelectedCells: boolean;
352
354
  editError: InfiniteTableColumnRenderParamBase<T>['editError'];
353
355
  } & InfiniteTableRowInfoDataDiscriminator<T>;
354
- declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | React__default.CSSProperties;
356
+ declare type InfiniteTableColumnStyleFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | React__default.CSSProperties;
355
357
  declare type InfiniteTableColumnHeaderClassNameFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | string;
356
358
  declare type InfiniteTableColumnHeaderStyleFn<T> = (params: InfiniteTableColumnHeaderParam<T>) => undefined | React__default.CSSProperties;
357
- declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStyleFnParams<T>) => undefined | string;
359
+ declare type InfiniteTableColumnClassNameFn<T> = (params: InfiniteTableColumnStylingFnParams<T>) => undefined | string;
358
360
  declare type InfiniteTableColumnStyle<T> = CSSProperties | InfiniteTableColumnStyleFn<T>;
359
361
  declare type InfiniteTableColumnAlign<T> = InfiniteTableColumnAlignValues | InfiniteTableColumnAlignFn<T>;
360
362
  declare type InfiniteTableColumnVerticalAlign<T> = InfiniteTableColumnVerticalAlignValues | InfiniteTableColumnVerticalAlignFn<T>;
@@ -362,7 +364,7 @@ declare type InfiniteTableColumnAlignFn<T> = (params: InfiniteTableColumnAlignFn
362
364
  declare type InfiniteTableColumnAlignFnParams<T> = XOR<{
363
365
  isHeader: true;
364
366
  column: InfiniteTableComputedColumn<T>;
365
- }, InfiniteTableColumnStyleFnParams<T> & {
367
+ }, InfiniteTableColumnStylingFnParams<T> & {
366
368
  isHeader: false;
367
369
  }>;
368
370
  declare type InfiniteTableColumnVerticalAlignFn<T> = (params: InfiniteTableColumnAlignFnParams<T>) => InfiniteTableColumnVerticalAlignValues;
@@ -819,7 +821,16 @@ declare class CellSelectionState {
819
821
  private setCellInDeselection;
820
822
  private setCellInSelection;
821
823
  update(stateObject: CellSelectionStateObject): void;
824
+ /**
825
+ * Returns whether there is at least one selected cell in the row
826
+ *
827
+ * @param rowId the row id
828
+ * @param columnIds the columns currently available in the grid
829
+ * @returns boolean
830
+ */
831
+ isCellSelectionInRow(rowId: any, columnIds: string[]): boolean;
822
832
  isCellSelected(rowId: any, colId: string): boolean;
833
+ private isCellSelected_Internal;
823
834
  getState(): CellSelectionStateObject;
824
835
  }
825
836
 
@@ -2027,6 +2038,7 @@ declare type InfiniteTable_RowInfoBase<_T> = {
2027
2038
  indexInAll: number;
2028
2039
  rowSelected: boolean | null;
2029
2040
  isCellSelected: (columnId: string) => boolean;
2041
+ hasSelectedCells: (columnIds: string[]) => boolean;
2030
2042
  };
2031
2043
  declare type InfiniteTable_HasGrouping_RowInfoNormal<T> = {
2032
2044
  dataSourceHasGrouping: true;
@@ -2360,6 +2372,10 @@ interface MenuState extends MenuMappedState, MenuDerivedState, MenuSetupState {
2360
2372
  }
2361
2373
  declare type MenuApi = {
2362
2374
  focus: VoidFunction;
2375
+ /**
2376
+ * hides this and all parent menus
2377
+ */
2378
+ hideMenu: VoidFunction;
2363
2379
  getMenuId: () => string;
2364
2380
  getParentMenuId: () => string | undefined;
2365
2381
  };
@@ -2403,7 +2419,7 @@ declare type MenuProps = {
2403
2419
  onHideIntent?: (state: MenuState) => void;
2404
2420
  bubbleActionsFromSubmenus?: boolean;
2405
2421
  addSubmenuColumnIfNeeded?: boolean;
2406
- onAction?: (key: string, item: MenuItemObject) => void;
2422
+ onAction?: (param: MenuItemActionContext) => void;
2407
2423
  parentMenuId?: string;
2408
2424
  parentMenuItemKey?: string;
2409
2425
  autoFocus?: boolean;
@@ -2413,6 +2429,11 @@ declare type MenuItemDefinition = MenuItemObject | MenuDecoration | MenuSeparato
2413
2429
  declare type MenuItemSubMenu = Omit<MenuProps, 'children' | 'items'> & {
2414
2430
  items: (MenuItemObject | MenuSeparator)[];
2415
2431
  };
2432
+ declare type MenuItemActionContext = {
2433
+ hideMenu: () => void;
2434
+ key: string;
2435
+ item: MenuItemObject;
2436
+ };
2416
2437
  declare type MenuItemObject = {
2417
2438
  key: string;
2418
2439
  label: NonUndefined<MenuRenderable>;
@@ -2423,7 +2444,8 @@ declare type MenuItemObject = {
2423
2444
  style?: CSSProperties;
2424
2445
  className?: string;
2425
2446
  onClick?: (event: React.MouseEvent) => void;
2426
- onAction?: (key: string, item: MenuItemObject) => void;
2447
+ onAction?: (params: MenuItemActionContext) => void;
2448
+ hideMenuOnAction?: boolean;
2427
2449
  [k: string]: any;
2428
2450
  };
2429
2451
  declare type MenuDecoration = MenuRenderable;
@@ -2451,11 +2473,14 @@ declare type InfiniteTablePropColumnOrder = InfiniteTablePropColumnOrderNormaliz
2451
2473
  declare type InfiniteTablePropColumnVisibility = Record<string, false>;
2452
2474
  declare type InfiniteTableColumnPinnedValues = false | 'start' | 'end';
2453
2475
  declare type InfiniteTablePropColumnPinning = Record<string, true | 'start' | 'end'>;
2454
- declare type InfiniteTableRowStyleFnParams<T> = {
2476
+ declare type InfiniteTableRowStylingFnParams<T> = {
2455
2477
  rowIndex: number;
2478
+ rowHasSelectedCells: boolean;
2479
+ visibleColumnIds: string[];
2480
+ allColumnIds: string[];
2456
2481
  } & InfiniteTableRowInfoDataDiscriminator<T>;
2457
- declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => undefined | React$1.CSSProperties;
2458
- declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStyleFnParams<T>) => string | undefined;
2482
+ declare type InfiniteTableRowStyleFn<T> = (params: InfiniteTableRowStylingFnParams<T>) => undefined | React$1.CSSProperties;
2483
+ declare type InfiniteTableRowClassNameFn<T> = (params: InfiniteTableRowStylingFnParams<T>) => string | undefined;
2459
2484
  declare type InfiniteTableCellClassNameFn<T> = InfiniteTableColumn<T>['className'];
2460
2485
  declare type InfiniteTablePropRowStyle<T> = React$1.CSSProperties | InfiniteTableRowStyleFn<T>;
2461
2486
  declare type InfiniteTablePropCellStyle<T> = InfiniteTableColumn<T>['style'];
@@ -2873,7 +2898,7 @@ interface InfiniteTableProps<T> {
2873
2898
  api: InfiniteTableApi<T>;
2874
2899
  dataSourceApi: DataSourceApi<T>;
2875
2900
  }) => void;
2876
- rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStyleFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
2901
+ rowProps?: React$1.HTMLProps<HTMLDivElement> | ((rowArgs: InfiniteTableRowStylingFnParams<T>) => React$1.HTMLProps<HTMLDivElement>);
2877
2902
  licenseKey?: string;
2878
2903
  scrollTopKey?: string | number;
2879
2904
  autoSizeColumnsKey?: InfiniteTablePropAutoSizeColumnsKey;
@@ -3034,4 +3059,4 @@ declare const components: {
3034
3059
  NumberFilterEditor: typeof NumberFilterEditor;
3035
3060
  };
3036
3061
 
3037
- export { AdvancedAlignable, CellSelectionState, ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceApi, DataSourceCRUDParam, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceInsertParam, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropCellSelection_MultiCell, DataSourcePropCellSelection_SingleCell, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnCellSelectionChange_MultiCell, DataSourcePropOnCellSelectionChange_SingleCell, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowInfoReducers, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropSortFn, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourceRawReducer, DataSourceRemoteData, DataSourceRowInfoReducer, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, DebugLogger, DeepMap, ElementContainerGetter, GroupRowsState, InfiniteColumnEditorContextType, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnApi, InfiniteTableColumnCellContextType, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderFunctionForGroupRows, InfiniteTableColumnRenderFunctionForNormalRows, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnValueFormatterParams, InfiniteTableColumnValueGetterParams, InfiniteTableColumnsMap, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropGetCellContextMenuItems, InfiniteTablePropGetColumnMenuItems, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropMultiSortBehavior, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Menu, MenuChildrenFnParam, MenuColumn, MenuColumnRenderParam, MenuDecoration, MenuIconProps, MenuItemDefinition, MenuItemObject, MenuProps, MenuRenderable, MenuRuntimeItem, MenuRuntimeItemSelectable, MenuSeparator, OverlayShowParams, RowSelectionState, Scrollbars, ShowOverlayFn, components, debounce, debug, defaultFilterTypes, defaultFilterTypes as filterTypes, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useOverlay, useOverlayPortal, useRowInfoReducers };
3062
+ export { AdvancedAlignable, CellSelectionState, ColumnTypeWithInherit, DataSource, DataSourceAction, DataSourceActionType, DataSourceAggregationReducer, DataSourceApi, DataSourceCRUDParam, DataSourceComponentActions, DataSourceContextValue, DataSourceData, DataSourceDataParams, DataSourceDataParamsChanges, DataSourceDerivedState, DataSourceFilterFunctionParam, DataSourceFilterOperator, DataSourceFilterOperatorFunction, DataSourceFilterOperatorFunctionParam, DataSourceFilterType, DataSourceFilterValueItem, DataSourceFilterValueItemValueGetter, DataSourceGroupBy, DataSourceGroupRowsList, DataSourceInsertParam, DataSourceLivePaginationCursorFn, DataSourceLivePaginationCursorParams, DataSourceLivePaginationCursorValue, DataSourceMappedState, DataSourceMappings, DataSourcePivotBy, DataSourcePropAggregationReducers, DataSourcePropCellSelection, DataSourcePropCellSelection_MultiCell, DataSourcePropCellSelection_SingleCell, DataSourcePropFilterFunction, DataSourcePropFilterTypes, DataSourcePropFilterValue, DataSourcePropGroupBy, DataSourcePropGroupRowsStateObject, DataSourcePropIsRowSelected, DataSourcePropLivePaginationCursor, DataSourcePropMultiRowSelectionChangeParamType, DataSourcePropOnCellSelectionChange, DataSourcePropOnCellSelectionChange_MultiCell, DataSourcePropOnCellSelectionChange_SingleCell, DataSourcePropOnRowSelectionChange, DataSourcePropOnRowSelectionChange_MultiRow, DataSourcePropOnRowSelectionChange_SingleRow, DataSourcePropPivotBy, DataSourcePropRowInfoReducers, DataSourcePropRowSelection, DataSourcePropRowSelection_MultiRow, DataSourcePropRowSelection_SingleRow, DataSourcePropSelectionMode, DataSourcePropSortFn, DataSourcePropSortInfo, DataSourcePropSortTypes, DataSourceProps, DataSourceRawReducer, DataSourceRemoteData, DataSourceRowInfoReducer, DataSourceSetupState, DataSourceSingleSortInfo, DataSourceSortInfo, DataSourceState, DebugLogger, DeepMap, ElementContainerGetter, GroupRowsState, InfiniteColumnEditorContextType, InfiniteTable, InfiniteTableAction, InfiniteTableActionType, InfiniteTableApi, InfiniteTableClassName, InfiniteTableColumn, InfiniteTableColumnAggregator, InfiniteTableColumnApi, InfiniteTableColumnCellContextType, InfiniteTableColumnComparer, InfiniteTableColumnGroup, InfiniteTableColumnRenderFunctionForGroupRows, InfiniteTableColumnRenderFunctionForNormalRows, InfiniteTableColumnRenderValueParam, InfiniteTableColumnRowspanParam, InfiniteTableColumnSizingOptions, InfiniteTableColumnValueFormatterParams, InfiniteTableColumnValueGetterParams, InfiniteTableColumnsMap, InfiniteTableComponent, InfiniteTableComputedColumn, InfiniteTableComputedValues, InfiniteTableContextValue, InfiniteTableGroupColumnBase, InfiniteTableGroupColumnFunction, InfiniteTableGroupColumnGetterOptions, InfiniteTablePivotColumn, InfiniteTablePropAutoSizeColumnsKey, InfiniteTablePropColumnGroups, InfiniteTablePropColumnOrder, InfiniteTablePropColumnPinning, InfiniteTablePropColumnSizing, InfiniteTablePropColumnTypes, InfiniteTablePropColumnVisibility, InfiniteTablePropColumns, InfiniteTablePropComponents, InfiniteTablePropGetCellContextMenuItems, InfiniteTablePropGetColumnMenuItems, InfiniteTablePropGroupColumn, InfiniteTablePropGroupRenderStrategy, InfiniteTablePropHeaderOptions, InfiniteTablePropKeyboardNavigation, InfiniteTablePropMultiSortBehavior, InfiniteTablePropRowClassName, InfiniteTablePropRowStyle, InfiniteTableProps, InfiniteTableRowClassNameFn, InfiniteTableRowInfo, InfiniteTableRowStyleFn, InfiniteTableState, LazyGroupDataDeepMap, LazyGroupDataItem, LazyRowInfoGroup, Menu, MenuChildrenFnParam, MenuColumn, MenuColumnRenderParam, MenuDecoration, MenuIconProps, MenuItemActionContext, MenuItemDefinition, MenuItemObject, MenuProps, MenuRenderable, MenuRuntimeItem, MenuRuntimeItemSelectable, MenuSeparator, OverlayShowParams, RowSelectionState, Scrollbars, ShowOverlayFn, components, debounce, debug, defaultFilterTypes, defaultFilterTypes as filterTypes, flatten, getComponentStateRoot, group, interceptMap, multisort, useComponentState, useDataSource, useEffectWithChanges, useInfiniteColumnCell, useInfiniteColumnEditor, useInfiniteColumnFilterEditor, useInfiniteHeaderCell, useOverlay, useOverlayPortal, useRowInfoReducers };
package/index.dev.js CHANGED
@@ -7520,7 +7520,7 @@ function getColumnValueToEdit(options) {
7520
7520
  }
7521
7521
  function getColumnRenderingParams(options) {
7522
7522
  var _a, _b;
7523
- const { column, context, rowInfo } = options;
7523
+ const { column, context, rowInfo, visibleColumnsIds } = options;
7524
7524
  const groupByColumnReference = getGroupByColumnReference({
7525
7525
  rowInfo,
7526
7526
  column,
@@ -7540,10 +7540,16 @@ function getColumnRenderingParams(options) {
7540
7540
  });
7541
7541
  const stylingParam = __spreadProps(__spreadValues({
7542
7542
  column: options.column,
7543
- inEdit
7543
+ inEdit,
7544
+ rowHasSelectedCells: false
7544
7545
  }, formattedValueContext), {
7545
7546
  editError: editingCell && editingCell.primaryKey === rowInfo.id && editingCell.columnId === column.id && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0
7546
7547
  });
7548
+ Object.defineProperty(stylingParam, "rowHasSelectedCells", {
7549
+ get() {
7550
+ return rowInfo.hasSelectedCells(visibleColumnsIds);
7551
+ }
7552
+ });
7547
7553
  const align2 = typeof column.align === "function" ? column.align(__spreadValues({ isHeader: false }, stylingParam)) : (_a = column.align) != null ? _a : "start";
7548
7554
  const verticalAlign = typeof column.verticalAlign === "function" ? column.verticalAlign(__spreadValues({ isHeader: false }, stylingParam)) : (_b = column.verticalAlign) != null ? _b : "center";
7549
7555
  return {
@@ -7573,6 +7579,7 @@ function getColumnRenderParam(options) {
7573
7579
  rowInfo,
7574
7580
  align: align2,
7575
7581
  verticalAlign,
7582
+ visibleColumnsIds,
7576
7583
  columnsMap,
7577
7584
  fieldsToColumn,
7578
7585
  formattedValueContext
@@ -7597,7 +7604,8 @@ function getColumnRenderParam(options) {
7597
7604
  fieldsToColumn,
7598
7605
  align: align2,
7599
7606
  verticalAlign,
7600
- cellSelected
7607
+ cellSelected,
7608
+ rowHasSelectedCells: false
7601
7609
  }, formattedValueContext), {
7602
7610
  editError: editingCell && editingCell.primaryKey === rowInfo.id && editingCell.columnId === column.id && !editingCell.active && editingCell.accepted instanceof Error ? editingCell.accepted : void 0,
7603
7611
  groupByColumn,
@@ -7662,6 +7670,11 @@ function getColumnRenderParam(options) {
7662
7670
  rootGroupBy: dataSourceState.groupBy,
7663
7671
  pivotBy: dataSourceState.pivotBy
7664
7672
  });
7673
+ Object.defineProperty(renderParam, "rowHasSelectedCells", {
7674
+ get() {
7675
+ return rowInfo.hasSelectedCells(visibleColumnsIds);
7676
+ }
7677
+ });
7665
7678
  return renderParam;
7666
7679
  }
7667
7680
  function getRawValueForCell(column, rowInfo) {
@@ -7937,10 +7950,12 @@ function InfiniteTableColumnCellFn(props) {
7937
7950
  api: imperativeApi,
7938
7951
  dataSourceApi
7939
7952
  };
7953
+ const visibleColumnsIds = computed.computedVisibleColumns.map((x) => x.id);
7940
7954
  const colRenderingParams = getColumnRenderingParams({
7941
7955
  column,
7942
7956
  rowInfo,
7943
7957
  columnsMap,
7958
+ visibleColumnsIds,
7944
7959
  fieldsToColumn,
7945
7960
  context: renderingContext
7946
7961
  });
@@ -8104,8 +8119,19 @@ function InfiniteTableColumnCellFn(props) {
8104
8119
  renderBag: true
8105
8120
  })
8106
8121
  ]);
8122
+ const visibleColumnIds = computed.computedVisibleColumns.map((x) => x.id);
8123
+ const allColumnIds = computed.computedColumnOrder;
8107
8124
  const rowPropsAndStyleArgs = __spreadProps(__spreadValues({}, formattedValueContext), {
8108
- rowIndex
8125
+ visibleColumnIds,
8126
+ allColumnIds,
8127
+ rowIndex,
8128
+ // we put it as false by default
8129
+ rowHasSelectedCells: false
8130
+ });
8131
+ Object.defineProperty(rowPropsAndStyleArgs, "rowHasSelectedCells", {
8132
+ get() {
8133
+ return rowInfo.hasSelectedCells(visibleColumnIds);
8134
+ }
8109
8135
  });
8110
8136
  const rowComputedClassName = typeof rowClassName === "function" ? rowClassName(rowPropsAndStyleArgs) : rowClassName;
8111
8137
  let colClassName = void 0;
@@ -10311,6 +10337,7 @@ function getEnhancedGroupData(options, deepMapValue) {
10311
10337
  collapsed: false,
10312
10338
  dataSourceHasGrouping: true,
10313
10339
  isCellSelected: returnFalse,
10340
+ hasSelectedCells: returnFalse,
10314
10341
  selfLoaded,
10315
10342
  error: options.error,
10316
10343
  parents,
@@ -10447,6 +10474,7 @@ function enhancedFlatten(param) {
10447
10474
  id: itemId,
10448
10475
  data: item,
10449
10476
  isCellSelected: returnFalse,
10477
+ hasSelectedCells: returnFalse,
10450
10478
  dataSourceHasGrouping: true,
10451
10479
  isGroupRow: false,
10452
10480
  selfLoaded: !!item,
@@ -11741,6 +11769,7 @@ function getRowSelectionApi(param) {
11741
11769
  }
11742
11770
 
11743
11771
  // src/components/DataSource/CellSelectionState.ts
11772
+ var debug4 = dbg("CellSelectionState");
11744
11773
  var WILDCARD = "*";
11745
11774
  var CellSelectionState = class {
11746
11775
  constructor(clone) {
@@ -11783,7 +11812,7 @@ var CellSelectionState = class {
11783
11812
  setCellSelected(rowId, colId, selected) {
11784
11813
  const wildcardRow = rowId === this.wildcard;
11785
11814
  const wildcardColumn = colId === this.wildcard;
11786
- const isSelected = this.isCellSelected(rowId, colId);
11815
+ const isSelected = this.isCellSelected_Internal(rowId, colId);
11787
11816
  if (isSelected === selected) {
11788
11817
  return;
11789
11818
  }
@@ -11961,7 +11990,54 @@ var CellSelectionState = class {
11961
11990
  }
11962
11991
  this.defaultSelection = stateObject.defaultSelection;
11963
11992
  }
11993
+ /**
11994
+ * Returns whether there is at least one selected cell in the row
11995
+ *
11996
+ * @param rowId the row id
11997
+ * @param columnIds the columns currently available in the grid
11998
+ * @returns boolean
11999
+ */
12000
+ isCellSelectionInRow(rowId, columnIds) {
12001
+ if (this.defaultSelection) {
12002
+ const cols2 = this.deselectedRowsToColumns.get(rowId);
12003
+ if (cols2) {
12004
+ if (cols2.has(this.wildcard)) {
12005
+ const explicitlySelectedCols = this.selectedRowsToColumns.get(rowId);
12006
+ return explicitlySelectedCols && explicitlySelectedCols.size > 0 ? columnIds.some((colId) => explicitlySelectedCols.has(colId)) : false;
12007
+ }
12008
+ return columnIds.some((colId) => !cols2.has(colId));
12009
+ }
12010
+ return true;
12011
+ }
12012
+ const cols = this.selectedRowsToColumns.get(rowId);
12013
+ if (cols) {
12014
+ if (cols.has(this.wildcard)) {
12015
+ const explicitlyDeselectedCols = this.deselectedRowsToColumns.get(rowId);
12016
+ if (explicitlyDeselectedCols && explicitlyDeselectedCols.size > 0) {
12017
+ const allDeselected = columnIds.every(
12018
+ (colId) => explicitlyDeselectedCols.has(colId)
12019
+ );
12020
+ return !allDeselected;
12021
+ }
12022
+ return true;
12023
+ }
12024
+ return columnIds ? columnIds.some((colId) => cols.has(colId)) : false;
12025
+ }
12026
+ return false;
12027
+ }
11964
12028
  isCellSelected(rowId, colId) {
12029
+ if (rowId === this.wildcard || colId === this.wildcard) {
12030
+ console.error(
12031
+ `CellSelectionState.isCellSelected should not be called with wildcard`
12032
+ );
12033
+ debug4(
12034
+ `CellSelectionState.isCellSelected should not be called with wildcard`
12035
+ );
12036
+ return false;
12037
+ }
12038
+ return this.isCellSelected_Internal(rowId, colId);
12039
+ }
12040
+ isCellSelected_Internal(rowId, colId) {
11965
12041
  var _a, _b;
11966
12042
  const cacheKey = [rowId, colId];
11967
12043
  const { cache } = this;
@@ -12609,7 +12685,8 @@ function toRowInfo(data, id, index, isRowSelected, cellSelectionState) {
12609
12685
  isGroupRow: false,
12610
12686
  selfLoaded: true,
12611
12687
  rowSelected: false,
12612
- isCellSelected: returnFalse2
12688
+ isCellSelected: returnFalse2,
12689
+ hasSelectedCells: returnFalse2
12613
12690
  };
12614
12691
  if (isRowSelected) {
12615
12692
  rowInfo.rowSelected = isRowSelected(rowInfo);
@@ -12618,6 +12695,9 @@ function toRowInfo(data, id, index, isRowSelected, cellSelectionState) {
12618
12695
  rowInfo.isCellSelected = (colId) => {
12619
12696
  return cellSelectionState.isCellSelected(rowInfo.id, colId);
12620
12697
  };
12698
+ rowInfo.hasSelectedCells = (columnIds) => {
12699
+ return cellSelectionState.isCellSelectionInRow(rowInfo.id, columnIds);
12700
+ };
12621
12701
  }
12622
12702
  return rowInfo;
12623
12703
  }
@@ -12748,6 +12828,7 @@ function concludeReducer(params) {
12748
12828
  const shouldGroup = groupBy.length > 0 || !!pivotBy;
12749
12829
  const selectionDepsChanged = haveDepsChanged(previousState, state, [
12750
12830
  "rowSelection",
12831
+ "cellSelection",
12751
12832
  "isRowSelected",
12752
12833
  "originalLazyGroupDataChangeDetect"
12753
12834
  ]);
@@ -15879,13 +15960,13 @@ function useColumnRowspan(computedVisibleColumns) {
15879
15960
 
15880
15961
  // src/components/InfiniteTable/hooks/useColumnSizeFn.ts
15881
15962
  var import_react42 = require("react");
15882
- var debug4 = dbg("useColumnSizeFn");
15963
+ var debug5 = dbg("useColumnSizeFn");
15883
15964
  function useColumnSizeFn(columns) {
15884
15965
  const columnSize = (0, import_react42.useCallback)(
15885
15966
  (index) => {
15886
15967
  const column = columns[index];
15887
15968
  if (false) {
15888
- debug4("cannot find column at index", index, columns);
15969
+ debug5("cannot find column at index", index, columns);
15889
15970
  }
15890
15971
  return column ? column.computedWidth : 0;
15891
15972
  },
@@ -17260,7 +17341,7 @@ var useLicense = (licenseKey = "") => {
17260
17341
  const valid = (0, import_react50.useMemo)(() => {
17261
17342
  let valid2 = isValidLicense(licenseKey, {
17262
17343
  publishedAt: 1624970570587,
17263
- version: "3.0.16"
17344
+ version: "3.1.1"
17264
17345
  });
17265
17346
  if (!licenseKey && !valid2 && isInsidePlayground) {
17266
17347
  return true;
@@ -19136,6 +19217,7 @@ function renderSubmenuForItem(item, config) {
19136
19217
  setActiveItemKey,
19137
19218
  setKeyboardActiveItemKey,
19138
19219
  constrainTo,
19220
+ onHideIntent,
19139
19221
  api
19140
19222
  } = config;
19141
19223
  const overlayId = `${parentMenuId}-submenu`;
@@ -19160,6 +19242,11 @@ function renderSubmenuForItem(item, config) {
19160
19242
  (_a = itemMenu == null ? void 0 : itemMenu.onShow) == null ? void 0 : _a.call(itemMenu, state, api2);
19161
19243
  setSubmenuApi(api2);
19162
19244
  },
19245
+ onHideIntent: (state) => {
19246
+ var _a;
19247
+ (_a = itemMenu == null ? void 0 : itemMenu.onHideIntent) == null ? void 0 : _a.call(itemMenu, state);
19248
+ onHideIntent(state);
19249
+ },
19163
19250
  onHide: (state) => {
19164
19251
  if (state.focused) {
19165
19252
  setActiveItemKey(null);
@@ -19298,6 +19385,7 @@ function MenuComponent(props) {
19298
19385
  setActiveItemKey,
19299
19386
  setKeyboardActiveItemKey,
19300
19387
  parentMenuId: menuId,
19388
+ onHideIntent: hideAll,
19301
19389
  api
19302
19390
  });
19303
19391
  if (alignTo) {
@@ -19320,11 +19408,19 @@ function MenuComponent(props) {
19320
19408
  if (item.originalMenuItem.onClick) {
19321
19409
  item.originalMenuItem.onClick(event);
19322
19410
  }
19411
+ const onActionParam = {
19412
+ key: item.key,
19413
+ item: item.originalMenuItem,
19414
+ hideMenu: hideAll
19415
+ };
19323
19416
  if (item.originalMenuItem.onAction) {
19324
- item.originalMenuItem.onAction(item.key, item.originalMenuItem);
19417
+ item.originalMenuItem.onAction(onActionParam);
19325
19418
  }
19326
19419
  if (onAction) {
19327
- onAction(item.key, item.originalMenuItem);
19420
+ onAction(onActionParam);
19421
+ }
19422
+ if (item.originalMenuItem.hideMenuOnAction) {
19423
+ hideAll();
19328
19424
  }
19329
19425
  };
19330
19426
  const {
@@ -19494,8 +19590,14 @@ function MenuComponent(props) {
19494
19590
  });
19495
19591
  }, []);
19496
19592
  const shouldSelectFirstItemOnFocus = (0, import_react57.useRef)(true);
19593
+ const hideAll = (0, import_react57.useCallback)(() => {
19594
+ var _a;
19595
+ const state = getState();
19596
+ (_a = state.onHideIntent) == null ? void 0 : _a.call(state, state);
19597
+ }, [getState]);
19497
19598
  const [api] = (0, import_react57.useState)(() => {
19498
19599
  const result2 = {
19600
+ hideMenu: hideAll,
19499
19601
  focus: () => {
19500
19602
  if (domRef.current) {
19501
19603
  domRef.current.focus();