@procore/data-table 14.35.4 → 14.36.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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Change Log
2
2
 
3
+ ## 14.36.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d1578b0: Add UNSAFE_agGridInternalOverrides prop to detailRowConfig to allow custom AG Grid configuration for detail grids (nested tables)
8
+
9
+ ### Patch Changes
10
+
11
+ - e850539: Remove deprecated `detailRowSelectionEnabled` prop and consolidate row selection logic within `detailRowConfig`.
12
+
13
+ **Changes:**
14
+
15
+ - Removed deprecated `detailRowSelectionEnabled` prop (deprecated since 11.13.0)
16
+ - Updated `DetailRowConfig.rowSelectionEnabled` type to use `RowSelectablePredicateParams` instead of `CheckboxSelectionCallbackParams`
17
+ - Refactored checkbox selection logic from `defaultColDef` to centralized `isRowSelectable` function
18
+ - Added RowSelection story demonstrating nested table row selection with parent disabled
19
+ - Added comprehensive e2e tests for nested table row selection functionality
20
+
21
+ **Migration:** If still using the deprecated `detailRowSelectionEnabled` prop, move it to `detailRowConfig.rowSelectionEnabled`:
22
+
23
+ ```tsx
24
+ // Before
25
+ <DataTable.Table
26
+ detailRowSelectionEnabled={true}
27
+ detailRowConfig={{
28
+ // ... other config
29
+ }}
30
+ />
31
+
32
+ // After
33
+ <DataTable.Table
34
+ detailRowConfig={{
35
+ rowSelectionEnabled: true,
36
+ // ... other config
37
+ }}
38
+ />
39
+ ```
40
+
3
41
  ## 14.35.4
4
42
 
5
43
  ### Patch Changes
@@ -104339,12 +104339,10 @@ var buildDetailRowsConfig = ({
104339
104339
  frameworkComponents,
104340
104340
  getRowHeight,
104341
104341
  emptyStateRenderer,
104342
- detailRowSelectionEnabled: detailRowSelectionEnabled_,
104343
104342
  enableGroupEditAndValidation,
104344
104343
  enableDynamicRowHeight,
104345
104344
  isServerSideRowModel
104346
104345
  }) => {
104347
- const detailRowSelectionEnabled = detailRowSelectionEnabled_ ?? false;
104348
104346
  if (detailRowConfig === void 0) {
104349
104347
  return {};
104350
104348
  }
@@ -104353,7 +104351,6 @@ var buildDetailRowsConfig = ({
104353
104351
  frameworkComponents,
104354
104352
  getRowHeight,
104355
104353
  emptyStateRenderer,
104356
- detailRowSelectionEnabled,
104357
104354
  enableGroupEditAndValidation,
104358
104355
  enableDynamicRowHeight,
104359
104356
  isServerSideRowModel
@@ -104364,7 +104361,6 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104364
104361
  frameworkComponents,
104365
104362
  getRowHeight,
104366
104363
  emptyStateRenderer,
104367
- detailRowSelectionEnabled: deprecatedDetailRowSelectionEnabled,
104368
104364
  enableGroupEditAndValidation,
104369
104365
  enableDynamicRowHeight,
104370
104366
  isServerSideRowModel
@@ -104379,7 +104375,18 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104379
104375
  }
104380
104376
  };
104381
104377
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
104382
- const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
104378
+ const isRowSelectable = (node) => {
104379
+ if (typeof detailRowConfig.rowSelectionEnabled === "boolean") {
104380
+ return detailRowConfig.rowSelectionEnabled;
104381
+ }
104382
+ if (typeof detailRowConfig.rowSelectionEnabled === "function") {
104383
+ return isRowSelectionEnabledForRow(
104384
+ detailRowConfig.rowSelectionEnabled,
104385
+ node
104386
+ );
104387
+ }
104388
+ return false;
104389
+ };
104383
104390
  return {
104384
104391
  isRowMaster: detailRowConfig.isExpandable,
104385
104392
  masterDetail: true,
@@ -104420,18 +104427,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104420
104427
  onRowSelected: detailRowConfig.onRowSelected ?? null,
104421
104428
  refreshStrategy: detailRowConfig.refreshStrategy || "everything",
104422
104429
  aggFuncs: aggregationFunctions_exports,
104423
- defaultColDef: {
104424
- ...defaultColDef,
104425
- checkboxSelection(params) {
104426
- var _a, _b, _c;
104427
- const rowSelectionEnabled = detailRowConfig.rowSelectionEnabled ?? deprecatedDetailRowSelectionEnabled;
104428
- const rowSelectionEnabledValue = typeof rowSelectionEnabled === "function" ? rowSelectionEnabled(params) : rowSelectionEnabled ?? false;
104429
- if (!rowSelectionEnabledValue) {
104430
- return false;
104431
- }
104432
- return ((_c = (_b = (_a = params.columnApi) == null ? void 0 : _a.getRowGroupColumns) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.length) === 0 && isFirstColumn(params);
104433
- }
104434
- },
104430
+ defaultColDef,
104435
104431
  rowSelection: detailRowConfig.rowSelection,
104436
104432
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
104437
104433
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
@@ -104451,7 +104447,8 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104451
104447
  suppressAggFuncInHeader: true,
104452
104448
  suppressContextMenu: true,
104453
104449
  suppressColumnVirtualisation: true,
104454
- getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters)
104450
+ getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters),
104451
+ ...detailRowConfig.UNSAFE_agGridInternalOverrides ?? {}
104455
104452
  },
104456
104453
  getDetailRowData: detailRowConfig.getDetailRowData
104457
104454
  };
@@ -109348,7 +109345,6 @@ var Table = (props) => {
109348
109345
  [
109349
109346
  columnGroupBordersEnabled,
109350
109347
  props.showGroupChildCount,
109351
- props.detailRowSelectionEnabled,
109352
109348
  props.detailRowConfigs,
109353
109349
  props.detailRowConfig
109354
109350
  ]
@@ -109360,13 +109356,11 @@ var Table = (props) => {
109360
109356
  frameworkComponents: frameworkComponents.detail,
109361
109357
  getRowHeight,
109362
109358
  emptyStateRenderer: props.emptyStateRenderer,
109363
- detailRowSelectionEnabled: props.detailRowSelectionEnabled,
109364
109359
  enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
109365
109360
  enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight,
109366
109361
  isServerSideRowModel: !!internalTableContext.onServerSideDataRequest
109367
109362
  });
109368
109363
  }, [
109369
- props.detailRowSelectionEnabled,
109370
109364
  props.detailRowConfigs,
109371
109365
  props.detailRowConfig,
109372
109366
  defaultColDef,
@@ -1,5 +1,5 @@
1
1
  import * as _ag_grid_community_core from '@ag-grid-community/core';
2
- import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, CheckboxSelectionCallbackParams, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
2
+ import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
5
  import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
@@ -755,11 +755,21 @@ interface DetailRowConfig<TRow = any> {
755
755
  customFooters?: CustomFooterConfig[];
756
756
  /** See ag-grid docs for more info: https://www.ag-grid.com/javascript-data-grid/master-detail-refresh/ */
757
757
  refreshStrategy?: 'everything' | 'rows' | 'nothing';
758
- rowSelectionEnabled?: boolean | ((params: CheckboxSelectionCallbackParams<TRow>) => boolean);
758
+ rowSelectionEnabled?: boolean | ((params: RowSelectablePredicateParams<TRow>) => boolean);
759
759
  rowSelection?: 'multiple' | 'single';
760
760
  rowMultiSelectWithClick?: boolean;
761
761
  suppressRowClickSelection?: boolean;
762
762
  onRowSelected?: (event: RowSelectedEvent) => void;
763
+ /**
764
+ * Overrides internal props for the detail grid's AgGridReact component. This is not guaranteed under DataTable SemVer
765
+ * and can break during any upgrade of the ag-grid-react package
766
+ *
767
+ * For documentation see: {@link https://www.ag-grid.com/react-data-grid/grid-options/}
768
+ * The ag-grid changelog can be found here: {@link https://www.ag-grid.com/changelog/}
769
+ *
770
+ * Warning: This can break normal Data Table functionality.
771
+ */
772
+ UNSAFE_agGridInternalOverrides?: AgGridReactProps | AgReactUiProps;
763
773
  }
764
774
  type CustomRendererCell = {
765
775
  component: React.ComponentType<any>;
@@ -972,11 +982,6 @@ interface TableProps<TRow = any, TBottomRow = any> {
972
982
  */
973
983
  detailRowConfigs?: DetailRowConfig<TRow>[];
974
984
  detailRowConfig?: DetailRowConfig<TRow>;
975
- /**
976
- * @deprecated Please use `detailRowConfig.rowSelectionEnabled` instead
977
- * @deprecatedSince 11.13.0
978
- */
979
- detailRowSelectionEnabled?: boolean;
980
985
  siblingGroupsRowSelectionDisabled?: boolean;
981
986
  emptyStateRenderer?: React.FunctionComponent;
982
987
  excelDataTypeFormats?: DTExcelFormats[];
@@ -1,5 +1,5 @@
1
1
  import * as _ag_grid_community_core from '@ag-grid-community/core';
2
- import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, CheckboxSelectionCallbackParams, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
2
+ import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
5
  import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
@@ -755,11 +755,21 @@ interface DetailRowConfig<TRow = any> {
755
755
  customFooters?: CustomFooterConfig[];
756
756
  /** See ag-grid docs for more info: https://www.ag-grid.com/javascript-data-grid/master-detail-refresh/ */
757
757
  refreshStrategy?: 'everything' | 'rows' | 'nothing';
758
- rowSelectionEnabled?: boolean | ((params: CheckboxSelectionCallbackParams<TRow>) => boolean);
758
+ rowSelectionEnabled?: boolean | ((params: RowSelectablePredicateParams<TRow>) => boolean);
759
759
  rowSelection?: 'multiple' | 'single';
760
760
  rowMultiSelectWithClick?: boolean;
761
761
  suppressRowClickSelection?: boolean;
762
762
  onRowSelected?: (event: RowSelectedEvent) => void;
763
+ /**
764
+ * Overrides internal props for the detail grid's AgGridReact component. This is not guaranteed under DataTable SemVer
765
+ * and can break during any upgrade of the ag-grid-react package
766
+ *
767
+ * For documentation see: {@link https://www.ag-grid.com/react-data-grid/grid-options/}
768
+ * The ag-grid changelog can be found here: {@link https://www.ag-grid.com/changelog/}
769
+ *
770
+ * Warning: This can break normal Data Table functionality.
771
+ */
772
+ UNSAFE_agGridInternalOverrides?: AgGridReactProps | AgReactUiProps;
763
773
  }
764
774
  type CustomRendererCell = {
765
775
  component: React.ComponentType<any>;
@@ -972,11 +982,6 @@ interface TableProps<TRow = any, TBottomRow = any> {
972
982
  */
973
983
  detailRowConfigs?: DetailRowConfig<TRow>[];
974
984
  detailRowConfig?: DetailRowConfig<TRow>;
975
- /**
976
- * @deprecated Please use `detailRowConfig.rowSelectionEnabled` instead
977
- * @deprecatedSince 11.13.0
978
- */
979
- detailRowSelectionEnabled?: boolean;
980
985
  siblingGroupsRowSelectionDisabled?: boolean;
981
986
  emptyStateRenderer?: React.FunctionComponent;
982
987
  excelDataTypeFormats?: DTExcelFormats[];
@@ -104326,12 +104326,10 @@ var buildDetailRowsConfig = ({
104326
104326
  frameworkComponents,
104327
104327
  getRowHeight,
104328
104328
  emptyStateRenderer,
104329
- detailRowSelectionEnabled: detailRowSelectionEnabled_,
104330
104329
  enableGroupEditAndValidation,
104331
104330
  enableDynamicRowHeight,
104332
104331
  isServerSideRowModel
104333
104332
  }) => {
104334
- const detailRowSelectionEnabled = detailRowSelectionEnabled_ ?? false;
104335
104333
  if (detailRowConfig === void 0) {
104336
104334
  return {};
104337
104335
  }
@@ -104340,7 +104338,6 @@ var buildDetailRowsConfig = ({
104340
104338
  frameworkComponents,
104341
104339
  getRowHeight,
104342
104340
  emptyStateRenderer,
104343
- detailRowSelectionEnabled,
104344
104341
  enableGroupEditAndValidation,
104345
104342
  enableDynamicRowHeight,
104346
104343
  isServerSideRowModel
@@ -104351,7 +104348,6 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104351
104348
  frameworkComponents,
104352
104349
  getRowHeight,
104353
104350
  emptyStateRenderer,
104354
- detailRowSelectionEnabled: deprecatedDetailRowSelectionEnabled,
104355
104351
  enableGroupEditAndValidation,
104356
104352
  enableDynamicRowHeight,
104357
104353
  isServerSideRowModel
@@ -104366,7 +104362,18 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104366
104362
  }
104367
104363
  };
104368
104364
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
104369
- const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
104365
+ const isRowSelectable = (node) => {
104366
+ if (typeof detailRowConfig.rowSelectionEnabled === "boolean") {
104367
+ return detailRowConfig.rowSelectionEnabled;
104368
+ }
104369
+ if (typeof detailRowConfig.rowSelectionEnabled === "function") {
104370
+ return isRowSelectionEnabledForRow(
104371
+ detailRowConfig.rowSelectionEnabled,
104372
+ node
104373
+ );
104374
+ }
104375
+ return false;
104376
+ };
104370
104377
  return {
104371
104378
  isRowMaster: detailRowConfig.isExpandable,
104372
104379
  masterDetail: true,
@@ -104407,18 +104414,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104407
104414
  onRowSelected: detailRowConfig.onRowSelected ?? null,
104408
104415
  refreshStrategy: detailRowConfig.refreshStrategy || "everything",
104409
104416
  aggFuncs: aggregationFunctions_exports,
104410
- defaultColDef: {
104411
- ...defaultColDef,
104412
- checkboxSelection(params) {
104413
- var _a, _b, _c;
104414
- const rowSelectionEnabled = detailRowConfig.rowSelectionEnabled ?? deprecatedDetailRowSelectionEnabled;
104415
- const rowSelectionEnabledValue = typeof rowSelectionEnabled === "function" ? rowSelectionEnabled(params) : rowSelectionEnabled ?? false;
104416
- if (!rowSelectionEnabledValue) {
104417
- return false;
104418
- }
104419
- return ((_c = (_b = (_a = params.columnApi) == null ? void 0 : _a.getRowGroupColumns) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.length) === 0 && isFirstColumn(params);
104420
- }
104421
- },
104417
+ defaultColDef,
104422
104418
  rowSelection: detailRowConfig.rowSelection,
104423
104419
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
104424
104420
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
@@ -104438,7 +104434,8 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104438
104434
  suppressAggFuncInHeader: true,
104439
104435
  suppressContextMenu: true,
104440
104436
  suppressColumnVirtualisation: true,
104441
- getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters)
104437
+ getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters),
104438
+ ...detailRowConfig.UNSAFE_agGridInternalOverrides ?? {}
104442
104439
  },
104443
104440
  getDetailRowData: detailRowConfig.getDetailRowData
104444
104441
  };
@@ -109335,7 +109332,6 @@ var Table = (props) => {
109335
109332
  [
109336
109333
  columnGroupBordersEnabled,
109337
109334
  props.showGroupChildCount,
109338
- props.detailRowSelectionEnabled,
109339
109335
  props.detailRowConfigs,
109340
109336
  props.detailRowConfig
109341
109337
  ]
@@ -109347,13 +109343,11 @@ var Table = (props) => {
109347
109343
  frameworkComponents: frameworkComponents.detail,
109348
109344
  getRowHeight,
109349
109345
  emptyStateRenderer: props.emptyStateRenderer,
109350
- detailRowSelectionEnabled: props.detailRowSelectionEnabled,
109351
109346
  enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
109352
109347
  enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight,
109353
109348
  isServerSideRowModel: !!internalTableContext.onServerSideDataRequest
109354
109349
  });
109355
109350
  }, [
109356
- props.detailRowSelectionEnabled,
109357
109351
  props.detailRowConfigs,
109358
109352
  props.detailRowConfig,
109359
109353
  defaultColDef,
@@ -104205,12 +104205,10 @@ var buildDetailRowsConfig = ({
104205
104205
  frameworkComponents,
104206
104206
  getRowHeight,
104207
104207
  emptyStateRenderer,
104208
- detailRowSelectionEnabled: detailRowSelectionEnabled_,
104209
104208
  enableGroupEditAndValidation,
104210
104209
  enableDynamicRowHeight,
104211
104210
  isServerSideRowModel
104212
104211
  }) => {
104213
- const detailRowSelectionEnabled = detailRowSelectionEnabled_ ?? false;
104214
104212
  if (detailRowConfig === void 0) {
104215
104213
  return {};
104216
104214
  }
@@ -104219,7 +104217,6 @@ var buildDetailRowsConfig = ({
104219
104217
  frameworkComponents,
104220
104218
  getRowHeight,
104221
104219
  emptyStateRenderer,
104222
- detailRowSelectionEnabled,
104223
104220
  enableGroupEditAndValidation,
104224
104221
  enableDynamicRowHeight,
104225
104222
  isServerSideRowModel
@@ -104230,7 +104227,6 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104230
104227
  frameworkComponents,
104231
104228
  getRowHeight,
104232
104229
  emptyStateRenderer,
104233
- detailRowSelectionEnabled: deprecatedDetailRowSelectionEnabled,
104234
104230
  enableGroupEditAndValidation,
104235
104231
  enableDynamicRowHeight,
104236
104232
  isServerSideRowModel
@@ -104245,7 +104241,18 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104245
104241
  }
104246
104242
  };
104247
104243
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
104248
- const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
104244
+ const isRowSelectable = (node) => {
104245
+ if (typeof detailRowConfig.rowSelectionEnabled === "boolean") {
104246
+ return detailRowConfig.rowSelectionEnabled;
104247
+ }
104248
+ if (typeof detailRowConfig.rowSelectionEnabled === "function") {
104249
+ return isRowSelectionEnabledForRow(
104250
+ detailRowConfig.rowSelectionEnabled,
104251
+ node
104252
+ );
104253
+ }
104254
+ return false;
104255
+ };
104249
104256
  return {
104250
104257
  isRowMaster: detailRowConfig.isExpandable,
104251
104258
  masterDetail: true,
@@ -104286,17 +104293,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104286
104293
  onRowSelected: detailRowConfig.onRowSelected ?? null,
104287
104294
  refreshStrategy: detailRowConfig.refreshStrategy || "everything",
104288
104295
  aggFuncs: aggregationFunctions_exports,
104289
- defaultColDef: {
104290
- ...defaultColDef,
104291
- checkboxSelection(params) {
104292
- const rowSelectionEnabled = detailRowConfig.rowSelectionEnabled ?? deprecatedDetailRowSelectionEnabled;
104293
- const rowSelectionEnabledValue = typeof rowSelectionEnabled === "function" ? rowSelectionEnabled(params) : rowSelectionEnabled ?? false;
104294
- if (!rowSelectionEnabledValue) {
104295
- return false;
104296
- }
104297
- return params.columnApi?.getRowGroupColumns?.()?.length === 0 && isFirstColumn(params);
104298
- }
104299
- },
104296
+ defaultColDef,
104300
104297
  rowSelection: detailRowConfig.rowSelection,
104301
104298
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
104302
104299
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
@@ -104316,7 +104313,8 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104316
104313
  suppressAggFuncInHeader: true,
104317
104314
  suppressContextMenu: true,
104318
104315
  suppressColumnVirtualisation: true,
104319
- getRowHeight: getRowHeight?.(detailRowConfig.customFooters)
104316
+ getRowHeight: getRowHeight?.(detailRowConfig.customFooters),
104317
+ ...detailRowConfig.UNSAFE_agGridInternalOverrides ?? {}
104320
104318
  },
104321
104319
  getDetailRowData: detailRowConfig.getDetailRowData
104322
104320
  };
@@ -109159,7 +109157,6 @@ var Table = (props) => {
109159
109157
  [
109160
109158
  columnGroupBordersEnabled,
109161
109159
  props.showGroupChildCount,
109162
- props.detailRowSelectionEnabled,
109163
109160
  props.detailRowConfigs,
109164
109161
  props.detailRowConfig
109165
109162
  ]
@@ -109171,13 +109168,11 @@ var Table = (props) => {
109171
109168
  frameworkComponents: frameworkComponents.detail,
109172
109169
  getRowHeight,
109173
109170
  emptyStateRenderer: props.emptyStateRenderer,
109174
- detailRowSelectionEnabled: props.detailRowSelectionEnabled,
109175
109171
  enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
109176
109172
  enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight,
109177
109173
  isServerSideRowModel: !!internalTableContext.onServerSideDataRequest
109178
109174
  });
109179
109175
  }, [
109180
- props.detailRowSelectionEnabled,
109181
109176
  props.detailRowConfigs,
109182
109177
  props.detailRowConfig,
109183
109178
  defaultColDef,
@@ -1,5 +1,5 @@
1
1
  import * as _ag_grid_community_core from '@ag-grid-community/core';
2
- import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, CheckboxSelectionCallbackParams, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
2
+ import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
5
  import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
@@ -755,11 +755,21 @@ interface DetailRowConfig<TRow = any> {
755
755
  customFooters?: CustomFooterConfig[];
756
756
  /** See ag-grid docs for more info: https://www.ag-grid.com/javascript-data-grid/master-detail-refresh/ */
757
757
  refreshStrategy?: 'everything' | 'rows' | 'nothing';
758
- rowSelectionEnabled?: boolean | ((params: CheckboxSelectionCallbackParams<TRow>) => boolean);
758
+ rowSelectionEnabled?: boolean | ((params: RowSelectablePredicateParams<TRow>) => boolean);
759
759
  rowSelection?: 'multiple' | 'single';
760
760
  rowMultiSelectWithClick?: boolean;
761
761
  suppressRowClickSelection?: boolean;
762
762
  onRowSelected?: (event: RowSelectedEvent) => void;
763
+ /**
764
+ * Overrides internal props for the detail grid's AgGridReact component. This is not guaranteed under DataTable SemVer
765
+ * and can break during any upgrade of the ag-grid-react package
766
+ *
767
+ * For documentation see: {@link https://www.ag-grid.com/react-data-grid/grid-options/}
768
+ * The ag-grid changelog can be found here: {@link https://www.ag-grid.com/changelog/}
769
+ *
770
+ * Warning: This can break normal Data Table functionality.
771
+ */
772
+ UNSAFE_agGridInternalOverrides?: AgGridReactProps | AgReactUiProps;
763
773
  }
764
774
  type CustomRendererCell = {
765
775
  component: React.ComponentType<any>;
@@ -972,11 +982,6 @@ interface TableProps<TRow = any, TBottomRow = any> {
972
982
  */
973
983
  detailRowConfigs?: DetailRowConfig<TRow>[];
974
984
  detailRowConfig?: DetailRowConfig<TRow>;
975
- /**
976
- * @deprecated Please use `detailRowConfig.rowSelectionEnabled` instead
977
- * @deprecatedSince 11.13.0
978
- */
979
- detailRowSelectionEnabled?: boolean;
980
985
  siblingGroupsRowSelectionDisabled?: boolean;
981
986
  emptyStateRenderer?: React.FunctionComponent;
982
987
  excelDataTypeFormats?: DTExcelFormats[];
@@ -1,5 +1,5 @@
1
1
  import * as _ag_grid_community_core from '@ag-grid-community/core';
2
- import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, CheckboxSelectionCallbackParams, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
2
+ import { ICellRendererParams, NumberFilterModel as NumberFilterModel$1, ColDef, IRowNode, ICellEditorParams, ColumnPinnedType, RowHeightParams, GetRowIdParams, RowDataTransaction, RowNodeTransaction, ServerSideTransaction, GridApi, ICellEditor, RefreshCellsParams, RowNode as RowNode$1, Column, SelectionEventSourceType, RowSelectedEvent, ExcelDataType, Module, RowGroupOpenedEvent, ColumnEverythingChangedEvent, CellFocusedEvent, ColumnApi, TabToNextCellParams, CellPosition, IFilter, IScalarFilterParams, ISimpleFilterParams } from '@ag-grid-community/core';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
5
  import { AgGridReactProps, AgReactUiProps } from '@ag-grid-community/react';
@@ -755,11 +755,21 @@ interface DetailRowConfig<TRow = any> {
755
755
  customFooters?: CustomFooterConfig[];
756
756
  /** See ag-grid docs for more info: https://www.ag-grid.com/javascript-data-grid/master-detail-refresh/ */
757
757
  refreshStrategy?: 'everything' | 'rows' | 'nothing';
758
- rowSelectionEnabled?: boolean | ((params: CheckboxSelectionCallbackParams<TRow>) => boolean);
758
+ rowSelectionEnabled?: boolean | ((params: RowSelectablePredicateParams<TRow>) => boolean);
759
759
  rowSelection?: 'multiple' | 'single';
760
760
  rowMultiSelectWithClick?: boolean;
761
761
  suppressRowClickSelection?: boolean;
762
762
  onRowSelected?: (event: RowSelectedEvent) => void;
763
+ /**
764
+ * Overrides internal props for the detail grid's AgGridReact component. This is not guaranteed under DataTable SemVer
765
+ * and can break during any upgrade of the ag-grid-react package
766
+ *
767
+ * For documentation see: {@link https://www.ag-grid.com/react-data-grid/grid-options/}
768
+ * The ag-grid changelog can be found here: {@link https://www.ag-grid.com/changelog/}
769
+ *
770
+ * Warning: This can break normal Data Table functionality.
771
+ */
772
+ UNSAFE_agGridInternalOverrides?: AgGridReactProps | AgReactUiProps;
763
773
  }
764
774
  type CustomRendererCell = {
765
775
  component: React.ComponentType<any>;
@@ -972,11 +982,6 @@ interface TableProps<TRow = any, TBottomRow = any> {
972
982
  */
973
983
  detailRowConfigs?: DetailRowConfig<TRow>[];
974
984
  detailRowConfig?: DetailRowConfig<TRow>;
975
- /**
976
- * @deprecated Please use `detailRowConfig.rowSelectionEnabled` instead
977
- * @deprecatedSince 11.13.0
978
- */
979
- detailRowSelectionEnabled?: boolean;
980
985
  siblingGroupsRowSelectionDisabled?: boolean;
981
986
  emptyStateRenderer?: React.FunctionComponent;
982
987
  excelDataTypeFormats?: DTExcelFormats[];
@@ -104192,12 +104192,10 @@ var buildDetailRowsConfig = ({
104192
104192
  frameworkComponents,
104193
104193
  getRowHeight,
104194
104194
  emptyStateRenderer,
104195
- detailRowSelectionEnabled: detailRowSelectionEnabled_,
104196
104195
  enableGroupEditAndValidation,
104197
104196
  enableDynamicRowHeight,
104198
104197
  isServerSideRowModel
104199
104198
  }) => {
104200
- const detailRowSelectionEnabled = detailRowSelectionEnabled_ ?? false;
104201
104199
  if (detailRowConfig === void 0) {
104202
104200
  return {};
104203
104201
  }
@@ -104206,7 +104204,6 @@ var buildDetailRowsConfig = ({
104206
104204
  frameworkComponents,
104207
104205
  getRowHeight,
104208
104206
  emptyStateRenderer,
104209
- detailRowSelectionEnabled,
104210
104207
  enableGroupEditAndValidation,
104211
104208
  enableDynamicRowHeight,
104212
104209
  isServerSideRowModel
@@ -104217,7 +104214,6 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104217
104214
  frameworkComponents,
104218
104215
  getRowHeight,
104219
104216
  emptyStateRenderer,
104220
- detailRowSelectionEnabled: deprecatedDetailRowSelectionEnabled,
104221
104217
  enableGroupEditAndValidation,
104222
104218
  enableDynamicRowHeight,
104223
104219
  isServerSideRowModel
@@ -104232,7 +104228,18 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104232
104228
  }
104233
104229
  };
104234
104230
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
104235
- const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
104231
+ const isRowSelectable = (node) => {
104232
+ if (typeof detailRowConfig.rowSelectionEnabled === "boolean") {
104233
+ return detailRowConfig.rowSelectionEnabled;
104234
+ }
104235
+ if (typeof detailRowConfig.rowSelectionEnabled === "function") {
104236
+ return isRowSelectionEnabledForRow(
104237
+ detailRowConfig.rowSelectionEnabled,
104238
+ node
104239
+ );
104240
+ }
104241
+ return false;
104242
+ };
104236
104243
  return {
104237
104244
  isRowMaster: detailRowConfig.isExpandable,
104238
104245
  masterDetail: true,
@@ -104273,17 +104280,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104273
104280
  onRowSelected: detailRowConfig.onRowSelected ?? null,
104274
104281
  refreshStrategy: detailRowConfig.refreshStrategy || "everything",
104275
104282
  aggFuncs: aggregationFunctions_exports,
104276
- defaultColDef: {
104277
- ...defaultColDef,
104278
- checkboxSelection(params) {
104279
- const rowSelectionEnabled = detailRowConfig.rowSelectionEnabled ?? deprecatedDetailRowSelectionEnabled;
104280
- const rowSelectionEnabledValue = typeof rowSelectionEnabled === "function" ? rowSelectionEnabled(params) : rowSelectionEnabled ?? false;
104281
- if (!rowSelectionEnabledValue) {
104282
- return false;
104283
- }
104284
- return params.columnApi?.getRowGroupColumns?.()?.length === 0 && isFirstColumn(params);
104285
- }
104286
- },
104283
+ defaultColDef,
104287
104284
  rowSelection: detailRowConfig.rowSelection,
104288
104285
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
104289
104286
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
@@ -104303,7 +104300,8 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104303
104300
  suppressAggFuncInHeader: true,
104304
104301
  suppressContextMenu: true,
104305
104302
  suppressColumnVirtualisation: true,
104306
- getRowHeight: getRowHeight?.(detailRowConfig.customFooters)
104303
+ getRowHeight: getRowHeight?.(detailRowConfig.customFooters),
104304
+ ...detailRowConfig.UNSAFE_agGridInternalOverrides ?? {}
104307
104305
  },
104308
104306
  getDetailRowData: detailRowConfig.getDetailRowData
104309
104307
  };
@@ -109146,7 +109144,6 @@ var Table = (props) => {
109146
109144
  [
109147
109145
  columnGroupBordersEnabled,
109148
109146
  props.showGroupChildCount,
109149
- props.detailRowSelectionEnabled,
109150
109147
  props.detailRowConfigs,
109151
109148
  props.detailRowConfig
109152
109149
  ]
@@ -109158,13 +109155,11 @@ var Table = (props) => {
109158
109155
  frameworkComponents: frameworkComponents.detail,
109159
109156
  getRowHeight,
109160
109157
  emptyStateRenderer: props.emptyStateRenderer,
109161
- detailRowSelectionEnabled: props.detailRowSelectionEnabled,
109162
109158
  enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
109163
109159
  enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight,
109164
109160
  isServerSideRowModel: !!internalTableContext.onServerSideDataRequest
109165
109161
  });
109166
109162
  }, [
109167
- props.detailRowSelectionEnabled,
109168
109163
  props.detailRowConfigs,
109169
109164
  props.detailRowConfig,
109170
109165
  defaultColDef,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "14.35.4",
3
+ "version": "14.36.0",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "author": "Procore Technologies",
6
6
  "homepage": "https://github.com/procore/core/tree/main/packages/data-table",
@@ -109,7 +109,7 @@
109
109
  "@procore/core-css": "10.17.0",
110
110
  "@procore/core-icons": "^12.10.0",
111
111
  "@procore/core-prettier": "10.2.0",
112
- "@procore/core-react": "^12.26.6",
112
+ "@procore/core-react": "^12.28.1",
113
113
  "@procore/eslint-config": "10.0.0",
114
114
  "@procore/globalization-toolkit": "3.1.0",
115
115
  "@procore/labs-financials-utils": "4.3.1",