@procore/data-table 13.0.0 → 13.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.
@@ -55090,7 +55090,7 @@ function getParentSelectionState(parent, affectedRows, parentChildrenMap) {
55090
55090
  function getAffectedRows(currentRows, selectionNode, affectedRows) {
55091
55091
  const isNodeRootLevel = isNodeRootLevelOfGrid(selectionNode.parent);
55092
55092
  const nodeId = selectionNode.id;
55093
- const isRowSelected = !!selectionNode.isSelected();
55093
+ const isRowSelected2 = !!selectionNode.isSelected();
55094
55094
  const parentChildrenMap = {};
55095
55095
  if (selectionNode.group || selectionNode.parent?.group && !isNodeRootLevel) {
55096
55096
  currentRows.forEach((row) => {
@@ -55109,7 +55109,7 @@ function getAffectedRows(currentRows, selectionNode, affectedRows) {
55109
55109
  }
55110
55110
  });
55111
55111
  }
55112
- const selectedState = isRowSelected ? rowSelectionState.selected : rowSelectionState.unselected;
55112
+ const selectedState = isRowSelected2 ? rowSelectionState.selected : rowSelectionState.unselected;
55113
55113
  affectedRows[nodeId] = {
55114
55114
  node: selectionNode,
55115
55115
  selectedState
@@ -55155,7 +55155,7 @@ function getAffectedRows(currentRows, selectionNode, affectedRows) {
55155
55155
  ).forEach((node) => {
55156
55156
  affectedRows[node.id] = {
55157
55157
  node,
55158
- selectedState: isRowSelected ? rowSelectionState.selected : rowSelectionState.unselected
55158
+ selectedState: isRowSelected2 ? rowSelectionState.selected : rowSelectionState.unselected
55159
55159
  };
55160
55160
  });
55161
55161
  }
@@ -55214,7 +55214,8 @@ function getSelectedState(node, affectedRows) {
55214
55214
  }
55215
55215
  function ServerSideRowCheckbox(props) {
55216
55216
  const { rowSelectionRef } = useInternalTableContext();
55217
- const indeterminate = rowSelectionRef.current?.affectedRows[props.node.id]?.selectedState === "indeterminate" ? true : false;
55217
+ const indeterminate = rowSelectionRef.current?.affectedRows[props.node.id]?.selectedState === "indeterminate";
55218
+ const { tableRef } = useInternalTableContext();
55218
55219
  const checked = getSelectedState(
55219
55220
  props.node,
55220
55221
  rowSelectionRef.current?.affectedRows
@@ -55228,7 +55229,7 @@ function ServerSideRowCheckbox(props) {
55228
55229
  "data-qa": "rowCheckbox",
55229
55230
  onClick: noop2,
55230
55231
  onChange: () => {
55231
- props.node.setSelected(!props.node.isSelected());
55232
+ props.node.isSelected() ? tableRef?.current?.deselectRows([props.node.id]) : tableRef?.current?.selectRows([props.node.id]);
55232
55233
  }
55233
55234
  }
55234
55235
  ));
@@ -55620,18 +55621,31 @@ var DataTableCellRenderer = ({
55620
55621
  )
55621
55622
  ));
55622
55623
  };
55624
+ function getStartingValue(eventKey, editorType, existingValue) {
55625
+ if (eventKey && editorType === "input" && eventKey !== "Enter") {
55626
+ if (eventKey === "Backspace") {
55627
+ return "";
55628
+ }
55629
+ return eventKey;
55630
+ }
55631
+ return existingValue;
55632
+ }
55623
55633
  var DataTableCellEditor = React82__default.default.forwardRef(
55624
55634
  ({
55635
+ api,
55625
55636
  colDef,
55626
55637
  Component: Component4,
55627
55638
  context,
55628
55639
  data,
55629
55640
  editorType,
55641
+ eventKey,
55630
55642
  node,
55631
55643
  parseValue,
55632
55644
  stopEditing,
55633
55645
  value
55634
55646
  }, ref) => {
55647
+ const startingValue = getStartingValue(eventKey, editorType, value);
55648
+ const [currentValue, setCurrentValue] = React82.useState(startingValue);
55635
55649
  const { rowHeight, tableRef } = useInternalTableContext();
55636
55650
  const inlineEditorRef = React82__default.default.useRef(null);
55637
55651
  const inputRef = React82__default.default.useRef(null);
@@ -55668,10 +55682,26 @@ var DataTableCellEditor = React82__default.default.forwardRef(
55668
55682
  }
55669
55683
  };
55670
55684
  });
55685
+ function handleKeyDown(event) {
55686
+ if (node.rowIndex !== null && colDef.field && editorType === "input" && !event.shiftKey && !event.metaKey && !event.altKey && !event.ctrlKey) {
55687
+ if (event.key === "ArrowUp") {
55688
+ stopEditing(true);
55689
+ api.setFocusedCell(node.rowIndex - 1, colDef.field, node.rowPinned);
55690
+ } else if (event.key === "ArrowDown" || event.key === "Enter") {
55691
+ stopEditing(true);
55692
+ api.setFocusedCell(node.rowIndex + 1, colDef.field, node.rowPinned);
55693
+ }
55694
+ }
55695
+ }
55671
55696
  React82__default.default.useEffect(() => {
55672
55697
  if (editorType === "input") {
55673
- inputRef.current?.select();
55698
+ if (eventKey) {
55699
+ inputRef.current?.focus();
55700
+ } else {
55701
+ inputRef.current?.select();
55702
+ }
55674
55703
  inlineEditorRef.current?.show();
55704
+ inputRef.current?.addEventListener("keydown", handleKeyDown);
55675
55705
  } else if (editorType === "textarea") {
55676
55706
  textAreaRef.current?.select();
55677
55707
  inlineEditorRef.current?.show();
@@ -55680,6 +55710,9 @@ var DataTableCellEditor = React82__default.default.forwardRef(
55680
55710
  selectRef.current?.focus();
55681
55711
  inlineEditorRef.current?.show();
55682
55712
  }
55713
+ return () => {
55714
+ inputRef.current?.removeEventListener("keydown", handleKeyDown);
55715
+ };
55683
55716
  }, []);
55684
55717
  const handleRefs = (editorType2) => {
55685
55718
  const getRef = (refType) => coreReact.UNSAFE_mergeRefs(refType, ref);
@@ -55710,10 +55743,13 @@ var DataTableCellEditor = React82__default.default.forwardRef(
55710
55743
  parentId: context?.parentId,
55711
55744
  rowPinned: node.rowPinned,
55712
55745
  rowHeight,
55713
- setDataValue: (field, newValue) => node.setDataValue(field, newValue),
55746
+ setDataValue: (field, newValue) => {
55747
+ node.setDataValue(field, newValue);
55748
+ setCurrentValue(newValue);
55749
+ },
55714
55750
  stopEditing,
55715
55751
  tableApi: tableRef?.current,
55716
- value,
55752
+ value: currentValue,
55717
55753
  ref: handleRefs(editorType)
55718
55754
  }
55719
55755
  )
@@ -56087,11 +56123,14 @@ var SortComponent = (props) => {
56087
56123
  }
56088
56124
  return null;
56089
56125
  };
56126
+ var isRowSelected = (rowNode) => {
56127
+ return Boolean(rowNode.selectable ? rowNode.isSelected() : true);
56128
+ };
56090
56129
  var GenericHeaderRenderer = (props) => {
56091
56130
  const colDef = props.column.getColDef();
56092
56131
  const HeaderNode = colDef.headerComponentParams?.headerNode;
56093
56132
  const I18n = coreReact.useI18nContext();
56094
- const { columnApi, gridApi, onServerSideDataRequest } = useInternalTableContext();
56133
+ const { columnApi, tableRef, gridApi, onServerSideDataRequest } = useInternalTableContext();
56095
56134
  const onSSDR = Boolean(onServerSideDataRequest);
56096
56135
  const [sortOrder, setSortOrder] = React82__default.default.useState(props.column.getSort());
56097
56136
  const [isFirstColumn2, setIsFirstColumn] = React82__default.default.useState(false);
@@ -56127,7 +56166,9 @@ var GenericHeaderRenderer = (props) => {
56127
56166
  }, []);
56128
56167
  const onSortToggled = (event) => {
56129
56168
  let currentSort = null;
56130
- if (event.target.parentElement === checkbox.current?.parentElement) {
56169
+ if (Array.from(checkbox.current?.parentElement?.children || []).includes(
56170
+ event.target?.parentElement
56171
+ )) {
56131
56172
  return;
56132
56173
  }
56133
56174
  if (props.enableSorting) {
@@ -56179,6 +56220,9 @@ var GenericHeaderRenderer = (props) => {
56179
56220
  }, [props.column]);
56180
56221
  const [isExpandable, setIsExpandable] = React82__default.default.useState(false);
56181
56222
  React82__default.default.useEffect(() => {
56223
+ if (onSSDR) {
56224
+ return;
56225
+ }
56182
56226
  const hasExpandableNodes = !!findNode(
56183
56227
  (node) => node.isExpandable(),
56184
56228
  props.api
@@ -56303,14 +56347,9 @@ var GenericHeaderRenderer = (props) => {
56303
56347
  return;
56304
56348
  }
56305
56349
  function updateSelectAllCheckbox() {
56306
- const currentPageIds = getCurrentPageIds();
56307
- const selectedRowIds = (props.api.getSelectedRows() ?? []).map(
56308
- ({ id }) => id
56309
- );
56310
- const isAllSelected = currentPageIds.every(
56311
- (id) => selectedRowIds.includes(id)
56312
- );
56313
- const isPartialSelected = !isAllSelected && currentPageIds.some((id) => selectedRowIds.includes(id));
56350
+ const currentRows = getCurrentRows(gridApi);
56351
+ const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56352
+ const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56314
56353
  if (isAllSelected) {
56315
56354
  setSelectAll("all" /* All */);
56316
56355
  } else if (isPartialSelected) {
@@ -56322,49 +56361,19 @@ var GenericHeaderRenderer = (props) => {
56322
56361
  props.api.addEventListener(selectionChanged, updateSelectAllCheckbox);
56323
56362
  props.api.addEventListener(paginationChanged, updateSelectAllCheckbox);
56324
56363
  return () => {
56325
- props.api.removeEventListener(
56326
- "selectionChanged",
56327
- updateSelectAllCheckbox
56328
- );
56329
- props.api.removeEventListener(
56330
- "paginationChanged",
56331
- updateSelectAllCheckbox
56332
- );
56364
+ props.api.removeEventListener(selectionChanged, updateSelectAllCheckbox);
56365
+ props.api.removeEventListener(paginationChanged, updateSelectAllCheckbox);
56333
56366
  };
56334
56367
  }, [isFirstColumn2, selectAll, props.selectionSSREnabled]);
56335
- const getCurrentPageIds = () => {
56336
- const rowCount = props.api.getDisplayedRowCount();
56337
- const lastGridIndex = rowCount - 1;
56338
- const currentPage = props.api.paginationGetCurrentPage();
56339
- const pageSize = props.api.paginationGetPageSize();
56340
- const startPageIndex = currentPage * pageSize;
56341
- let endPageIndex = (currentPage + 1) * pageSize - 1;
56342
- if (endPageIndex > lastGridIndex) {
56343
- endPageIndex = lastGridIndex;
56344
- }
56345
- return [...Array(endPageIndex - startPageIndex + 1).keys()].map(
56346
- (index) => props.api.getDisplayedRowAtIndex(index + startPageIndex)?.data?.id
56347
- );
56348
- };
56349
- const handleSSRSelectAll = (param) => {
56350
- if (!props.selectionSSREnabled) {
56351
- return;
56352
- }
56353
- const selectedRowIds = (props.api.getSelectedRows() ?? []).map(
56354
- ({ id }) => id
56355
- );
56356
- const currentPageIds = getCurrentPageIds();
56357
- if (param === "all" /* All */) {
56358
- [.../* @__PURE__ */ new Set([...selectedRowIds, ...currentPageIds])]?.forEach(
56359
- (id) => {
56360
- props.api.getRowNode(id.toString())?.setSelected(true);
56361
- }
56362
- );
56363
- }
56364
- if (param === "none" /* None */) {
56365
- currentPageIds.forEach((id) => {
56366
- props.api.getRowNode(id.toString())?.setSelected(false);
56367
- });
56368
+ const toggleSelectAll = () => {
56369
+ const nextSelectedState = selectAll === "all" /* All */ ? "none" /* None */ : "all" /* All */;
56370
+ setSelectAll(nextSelectedState);
56371
+ props.onSelectAll?.(nextSelectedState);
56372
+ const isSelectAll = nextSelectedState == "all" /* All */;
56373
+ if (props.selectionSSREnabled) {
56374
+ isSelectAll ? tableRef?.current?.selectAll() : tableRef?.current?.deselectAll();
56375
+ } else {
56376
+ isSelectAll ? props.api.selectAllFiltered() : props.api.deselectAllFiltered();
56368
56377
  }
56369
56378
  };
56370
56379
  return /* @__PURE__ */ React82__default.default.createElement(
@@ -56403,15 +56412,7 @@ var GenericHeaderRenderer = (props) => {
56403
56412
  indeterminate: selectAll === "partial",
56404
56413
  onClick: (e) => e.stopPropagation(),
56405
56414
  onChange: () => {
56406
- if (selectAll === "all" /* All */) {
56407
- setSelectAll("none" /* None */);
56408
- props.onSelectAll?.("none" /* None */);
56409
- onSSDR ? handleSSRSelectAll("none" /* None */) : props.api.deselectAllFiltered();
56410
- } else {
56411
- setSelectAll("all" /* All */);
56412
- props.onSelectAll?.("all" /* All */);
56413
- onSSDR ? handleSSRSelectAll("all" /* All */) : props.api.selectAllFiltered();
56414
- }
56415
+ toggleSelectAll();
56415
56416
  }
56416
56417
  }
56417
56418
  ),
@@ -58684,18 +58685,30 @@ var ClientSideRowModelModule = {
58684
58685
  rowModel: "clientSide",
58685
58686
  beans: [ClientSideRowModel, FilterStage, SortStage, FlattenStage, SortService, FilterService, ImmutableService]
58686
58687
  };
58688
+ var getSelectedRows = ({
58689
+ gridApi,
58690
+ rowSelectionRef
58691
+ }) => {
58692
+ const serverSideRows = Object.values(
58693
+ rowSelectionRef?.current?.affectedRows || {}
58694
+ ).filter(
58695
+ (affectedRow) => affectedRow.selectedState === rowSelectionState.selected
58696
+ ).map((affectedRow) => affectedRow.node);
58697
+ return gridApi?.getModel().getType() === "serverSide" ? serverSideRows : gridApi?.getSelectedNodes() ?? [];
58698
+ };
58687
58699
  var useRowSelectionState = () => {
58688
58700
  const [selectedRows, setSelectedRows] = React82__default.default.useState([]);
58689
- const { gridApi } = useInternalTableContext();
58701
+ const { gridApi, rowSelectionRef } = useInternalTableContext();
58690
58702
  React82__default.default.useEffect(() => {
58691
58703
  function selectionEventFunction() {
58692
- const rows = gridApi?.getSelectedNodes() ?? [];
58693
- setSelectedRows(rows);
58704
+ setSelectedRows(getSelectedRows({ gridApi, rowSelectionRef }));
58694
58705
  }
58695
58706
  selectionEventFunction();
58696
58707
  gridApi?.addEventListener("selectionChanged", selectionEventFunction);
58708
+ gridApi?.addEventListener("paginationChanged", selectionEventFunction);
58697
58709
  return () => {
58698
58710
  gridApi?.removeEventListener("selectionChanged", selectionEventFunction);
58711
+ gridApi?.removeEventListener("paginationChanged", selectionEventFunction);
58699
58712
  };
58700
58713
  }, [gridApi]);
58701
58714
  return selectedRows;
@@ -75551,6 +75564,7 @@ var useTableApi = ({
75551
75564
  filterStorage,
75552
75565
  onTableConfigChange,
75553
75566
  rowHeight,
75567
+ rowSelectionRef,
75554
75568
  setRowHeight: internalSetRowHeight,
75555
75569
  searchStorage
75556
75570
  } = useInternalTableContext();
@@ -75683,11 +75697,11 @@ var useTableApi = ({
75683
75697
  columnDefinition: colDef,
75684
75698
  node: { rowPinned: false },
75685
75699
  data: {}
75686
- }) === true
75700
+ })
75687
75701
  );
75688
75702
  }
75689
75703
  if (typeof colDef.bulkEditable === "boolean") {
75690
- return colDef.bulkEditable === true;
75704
+ return colDef.bulkEditable;
75691
75705
  }
75692
75706
  if (typeof colDef.editable === "function") {
75693
75707
  return (
@@ -75699,7 +75713,7 @@ var useTableApi = ({
75699
75713
  columnDefinition: colDef,
75700
75714
  node: { rowPinned: false },
75701
75715
  data: {}
75702
- }) === true
75716
+ })
75703
75717
  );
75704
75718
  }
75705
75719
  return colDef.editable === true;
@@ -75871,13 +75885,58 @@ var useTableApi = ({
75871
75885
  [internalSetRowHeight]
75872
75886
  );
75873
75887
  const gridApiMethods = React82__default.default.useMemo(
75874
- () => buildPartialTableApi({ gridApi, columnApi, rowHeight, filterStorage }),
75888
+ () => buildPartialTableApi({
75889
+ gridApi,
75890
+ columnApi,
75891
+ rowHeight,
75892
+ filterStorage,
75893
+ rowSelectionRef
75894
+ }),
75875
75895
  [columnApi, gridApi, rowHeight, filterStorage]
75876
75896
  );
75897
+ const onSelectionChanged = (rowNode) => {
75898
+ const isGrouped = rowNode.group || rowNode.parent?.group && !isNodeRootLevelOfGrid(rowNode.parent);
75899
+ const currAffectedRows = rowSelectionRef.current.affectedRows;
75900
+ if (!isGrouped) {
75901
+ rowSelectionRef.current.affectedRows = {
75902
+ ...currAffectedRows,
75903
+ [rowNode.id]: {
75904
+ node: rowNode,
75905
+ selectedState: rowNode.isSelected() ? rowSelectionState.selected : rowSelectionState.unselected
75906
+ }
75907
+ };
75908
+ gridApi?.redrawRows({ rowNodes: [rowNode] });
75909
+ return;
75910
+ }
75911
+ const rowsToUpdate = getAffectedRows(
75912
+ getCurrentRows(gridApi),
75913
+ rowNode,
75914
+ currAffectedRows
75915
+ );
75916
+ const rowValues = Object.values(rowsToUpdate);
75917
+ rowValues.forEach((row) => {
75918
+ row.node.setSelected(
75919
+ row.selectedState === rowSelectionState.selected,
75920
+ false,
75921
+ "checkboxSelected"
75922
+ );
75923
+ });
75924
+ rowSelectionRef.current.affectedRows = {
75925
+ ...currAffectedRows,
75926
+ ...rowsToUpdate
75927
+ };
75928
+ gridApi?.redrawRows({
75929
+ rowNodes: rowValues.map((rowValue) => rowValue.node)
75930
+ });
75931
+ };
75877
75932
  const selectRows = React82__default.default.useCallback(
75878
75933
  (rowIds) => {
75879
75934
  rowIds?.forEach((id) => {
75880
- gridApi?.getRowNode(id.toString())?.setSelected(true);
75935
+ const rowNode = gridApi?.getRowNode(id.toString());
75936
+ if (!rowNode)
75937
+ return;
75938
+ rowNode.setSelected(true);
75939
+ onSelectionChanged(rowNode);
75881
75940
  });
75882
75941
  },
75883
75942
  [gridApi]
@@ -75885,7 +75944,11 @@ var useTableApi = ({
75885
75944
  const deselectRows = React82__default.default.useCallback(
75886
75945
  (rowIds) => {
75887
75946
  rowIds?.forEach((id) => {
75888
- gridApi?.getRowNode(id.toString())?.setSelected(false);
75947
+ const rowNode = gridApi?.getRowNode(id.toString());
75948
+ if (!rowNode)
75949
+ return;
75950
+ rowNode.setSelected(false);
75951
+ onSelectionChanged(rowNode);
75889
75952
  });
75890
75953
  },
75891
75954
  [gridApi]
@@ -75934,7 +75997,8 @@ function buildPartialTableApi({
75934
75997
  gridApi,
75935
75998
  rowHeight,
75936
75999
  columnApi,
75937
- filterStorage
76000
+ filterStorage,
76001
+ rowSelectionRef
75938
76002
  }) {
75939
76003
  const setRowData = (rows) => {
75940
76004
  if (gridApi?.getModel().getType() === "serverSide") {
@@ -75974,7 +76038,8 @@ function buildPartialTableApi({
75974
76038
  gridApi: detailGridApi,
75975
76039
  columnApi: detailGridColumnApi,
75976
76040
  rowHeight,
75977
- filterStorage
76041
+ filterStorage,
76042
+ rowSelectionRef
75978
76043
  }) : void 0;
75979
76044
  };
75980
76045
  const getTableConfiguration = () => {
@@ -76007,44 +76072,58 @@ function buildPartialTableApi({
76007
76072
  }
76008
76073
  return {};
76009
76074
  };
76010
- const getSelectedRows = () => {
76075
+ const getSelectedRows2 = () => {
76011
76076
  return gridApi?.getSelectedRows() || [];
76012
76077
  };
76013
- const selectAll = () => {
76014
- const model = gridApi?.getModel();
76015
- if (model?.getType() === "clientSide") {
76016
- gridApi?.selectAll();
76017
- }
76018
- gridApi?.forEachNode(function(node) {
76019
- if (node.isSelected() === false) {
76020
- node.setSelected(true, void 0, "apiSelectAll");
76078
+ const rowsNeedingUpdateAfterSelectAll = (isSelectAll) => {
76079
+ const prevRowNodes = gridApi?.getRenderedNodes() || [];
76080
+ return prevRowNodes.filter((prevRowNode) => {
76081
+ if (!prevRowNode.selectable) {
76082
+ return false;
76021
76083
  }
76084
+ return isSelectAll ? !prevRowNode.isSelected() : prevRowNode.isSelected();
76022
76085
  });
76086
+ };
76087
+ const updateAffectedRowsOnToggle = (isSelected) => {
76088
+ const prevAffectedRows = rowSelectionRef.current.affectedRows;
76089
+ const currentRows = getCurrentRows(gridApi);
76090
+ rowSelectionRef.current.affectedRows = currentRows.reduce(
76091
+ (accum, rowNode) => {
76092
+ if (!rowNode.id) {
76093
+ return accum;
76094
+ }
76095
+ return {
76096
+ ...accum,
76097
+ [rowNode.id]: {
76098
+ node: rowNode,
76099
+ selectedState: isSelected ? rowSelectionState.selected : rowSelectionState.unselected
76100
+ }
76101
+ };
76102
+ },
76103
+ prevAffectedRows
76104
+ );
76105
+ };
76106
+ const selectAll = () => {
76107
+ const nodesToUpdate = rowsNeedingUpdateAfterSelectAll(true);
76108
+ gridApi?.selectAll();
76023
76109
  if (gridApi?.getModel().getType() === "serverSide") {
76024
- gridApi?.redrawRows();
76110
+ updateAffectedRowsOnToggle(true);
76111
+ gridApi?.redrawRows({ rowNodes: nodesToUpdate });
76025
76112
  }
76026
76113
  };
76027
76114
  const deselectAll = () => {
76028
- const model = gridApi?.getModel();
76029
- if (model?.getType() === "clientSide") {
76030
- gridApi?.deselectAll();
76031
- }
76032
- gridApi?.forEachNode(function(node) {
76033
- if (node.isSelected() === true) {
76034
- node.setSelected(false, void 0, "apiSelectAll");
76035
- }
76036
- });
76115
+ const nodesToUpdate = rowsNeedingUpdateAfterSelectAll(false);
76116
+ gridApi?.deselectAll();
76037
76117
  if (gridApi?.getModel().getType() === "serverSide") {
76038
- gridApi?.redrawRows();
76118
+ updateAffectedRowsOnToggle(false);
76119
+ gridApi?.redrawRows({ rowNodes: nodesToUpdate });
76039
76120
  }
76040
76121
  };
76041
76122
  const collapseAll = () => {
76042
76123
  gridApi?.collapseAll();
76043
76124
  };
76044
76125
  const expandAll = () => {
76045
- gridApi?.forEachNode((node) => {
76046
- node.setExpanded(true);
76047
- });
76126
+ gridApi?.expandAll();
76048
76127
  };
76049
76128
  const setRowNodeExpanded = (rowNode, expanded) => {
76050
76129
  return gridApi?.setRowNodeExpanded(rowNode, expanded);
@@ -76075,7 +76154,7 @@ function buildPartialTableApi({
76075
76154
  getFilteredAndSortedRowNodes,
76076
76155
  getRootAggregateData,
76077
76156
  getRowData,
76078
- getSelectedRows,
76157
+ getSelectedRows: getSelectedRows2,
76079
76158
  getTableConfiguration,
76080
76159
  refreshCells,
76081
76160
  setPinnedBottomRowData,
@@ -76995,42 +77074,6 @@ var Table = (props) => {
76995
77074
  },
76996
77075
  [props.onRowGroupOpened]
76997
77076
  );
76998
- const onSelectionChanged = (event) => {
76999
- if (!internalTableContext.onServerSideDataRequest || event.source === "apiSelectAll") {
77000
- return;
77001
- }
77002
- const previousSelectedIds = Object.keys(
77003
- rowSelectionRef.current.affectedRows
77004
- ).filter(
77005
- (nodeId) => rowSelectionRef.current.affectedRows[nodeId].selectedState === rowSelectionState.selected
77006
- );
77007
- const affectedRows = rowSelectionRef.current.affectedRows;
77008
- const eventSelectedIds = event.api.getSelectedNodes().map((node) => node.id);
77009
- const diff = ramda.symmetricDifference(eventSelectedIds, previousSelectedIds);
77010
- const selectionNode = event.api.getRowNode(diff[0]);
77011
- if (selectionNode === void 0) {
77012
- return;
77013
- }
77014
- const rowsToUpdate = getAffectedRows(
77015
- getCurrentRows(event.api),
77016
- selectionNode,
77017
- affectedRows
77018
- );
77019
- Object.values(rowsToUpdate).forEach((row) => {
77020
- row.node.setSelected(
77021
- row.selectedState === rowSelectionState.selected,
77022
- void 0,
77023
- event.source
77024
- );
77025
- });
77026
- rowSelectionRef.current.affectedRows = {
77027
- ...affectedRows,
77028
- ...rowsToUpdate
77029
- };
77030
- gridApi?.redrawRows({
77031
- rowNodes: Object.values(rowsToUpdate).map((val) => val.node)
77032
- });
77033
- };
77034
77077
  const getGroupRowAgg = React82__default.default.useCallback(
77035
77078
  (params) => {
77036
77079
  const agNodes = params.nodes;
@@ -77183,6 +77226,7 @@ var Table = (props) => {
77183
77226
  cacheBlockSize: props.paginationPageSize || defaultPaginationPageSize,
77184
77227
  defaultColDef,
77185
77228
  enableGroupEdit: internalTableContext.enableGroupEditAndValidation,
77229
+ enableCellEditingOnBackspace: true,
77186
77230
  excelStyles: transformToExcelStyles(props.excelDataTypeFormats),
77187
77231
  components: frameworkComponents,
77188
77232
  fullWidthCellRenderer: FullWidthCellRenderer(
@@ -77239,7 +77283,6 @@ var Table = (props) => {
77239
77283
  onRowDragMove,
77240
77284
  onRowGroupOpened: internalRowGroupOpened,
77241
77285
  onRowSelected: internalOnRowSelected,
77242
- onSelectionChanged,
77243
77286
  onSortChanged: onSortEventChanged,
77244
77287
  onFilterChanged,
77245
77288
  onFirstDataRendered: props.onFirstDataRendered,
@@ -77292,6 +77335,7 @@ var TablePagination = ({
77292
77335
  page: 0,
77293
77336
  items: 0
77294
77337
  });
77338
+ const { rowSelectionRef } = useInternalTableContext();
77295
77339
  React82__default.default.useEffect(() => {
77296
77340
  function onPaginationChanged(params) {
77297
77341
  if (gridApi && params.api.paginationGetCurrentPage() !== pagination.page || pagination.items !== params.api.paginationGetRowCount()) {
@@ -77299,6 +77343,10 @@ var TablePagination = ({
77299
77343
  page: params.api.paginationGetCurrentPage(),
77300
77344
  items: params.api.paginationGetRowCount()
77301
77345
  });
77346
+ if (params.api.getModel().getType() === "serverSide") {
77347
+ rowSelectionRef?.current?.affectedRows && (rowSelectionRef.current.affectedRows = {});
77348
+ gridApi?.deselectAll();
77349
+ }
77302
77350
  }
77303
77351
  }
77304
77352
  gridApi?.addEventListener("paginationChanged", onPaginationChanged);