@procore/data-table 13.1.1 → 13.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 13.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 15f03dbed4: Fix keyboard interactions for editors that format the value
8
+
9
+ ## 13.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 04d6c4f48c: Allow autoGroupColumnDefinition to be added to nested tables and fix nested table column header icons to display correctly
14
+
3
15
  ## 13.1.1
4
16
 
5
17
  ### Patch Changes
@@ -154,6 +154,7 @@ interface DataTableCellRendererProps<TValue = any, TColumnDefinition extends Col
154
154
  rowIndex?: number;
155
155
  }
156
156
  interface DataTableCellEditorProps<TValue = any, TColumnDefinition extends ColumnDefinition = ColumnDefinition<TValue>> extends DataTableCellRendererProps<TValue, TColumnDefinition> {
157
+ eventKey: string | null;
157
158
  ref?: ((instance: HTMLElement | null) => void) | React__default.MutableRefObject<HTMLElement | null> | null;
158
159
  setDataValue: (field: string, newValue: TValue) => void;
159
160
  stopEditing: () => void;
@@ -669,6 +670,7 @@ interface GetDetailRowDataParams<TRow = any> extends Omit<AgGetDetailRowDataPara
669
670
  }
670
671
  type GetRowHeightWithFooters = (customFooters: CustomFooterConfig[] | undefined) => (params: Partial<RowHeightParams>) => number;
671
672
  interface DetailRowConfig<TRow = any> {
673
+ autoGroupColumnDefinition?: ColumnDefinition;
672
674
  columnDefinitions: ColumnDefinition[];
673
675
  getDetailRowData: (params: GetDetailRowDataParams<TRow>) => void;
674
676
  height?: 'auto' | number;
@@ -154,6 +154,7 @@ interface DataTableCellRendererProps<TValue = any, TColumnDefinition extends Col
154
154
  rowIndex?: number;
155
155
  }
156
156
  interface DataTableCellEditorProps<TValue = any, TColumnDefinition extends ColumnDefinition = ColumnDefinition<TValue>> extends DataTableCellRendererProps<TValue, TColumnDefinition> {
157
+ eventKey: string | null;
157
158
  ref?: ((instance: HTMLElement | null) => void) | React__default.MutableRefObject<HTMLElement | null> | null;
158
159
  setDataValue: (field: string, newValue: TValue) => void;
159
160
  stopEditing: () => void;
@@ -669,6 +670,7 @@ interface GetDetailRowDataParams<TRow = any> extends Omit<AgGetDetailRowDataPara
669
670
  }
670
671
  type GetRowHeightWithFooters = (customFooters: CustomFooterConfig[] | undefined) => (params: Partial<RowHeightParams>) => number;
671
672
  interface DetailRowConfig<TRow = any> {
673
+ autoGroupColumnDefinition?: ColumnDefinition;
672
674
  columnDefinitions: ColumnDefinition[];
673
675
  getDetailRowData: (params: GetDetailRowDataParams<TRow>) => void;
674
676
  height?: 'auto' | number;
@@ -8182,7 +8182,7 @@ var Renderer3 = ({
8182
8182
  };
8183
8183
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8184
8184
  var Editor = React82__default.default.forwardRef(
8185
- ({ columnDefinition, stopEditing, value }, ref) => {
8185
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8186
8186
  var _a, _b, _c, _d, _e;
8187
8187
  const I18n = coreReact.useI18nContext();
8188
8188
  if (isEmptyValue(value) && !columnDefinition.editable) {
@@ -8191,7 +8191,7 @@ var Editor = React82__default.default.forwardRef(
8191
8191
  function onBlur() {
8192
8192
  stopEditing();
8193
8193
  }
8194
- const defaultValue = labsFinancialsUtils.formatNumber(value, {
8194
+ const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
8195
8195
  ...((_a = columnDefinition.cellEditorParams) == null ? void 0 : _a.formatConfig) ?? ((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.formatConfig) ?? {},
8196
8196
  symbol: void 0,
8197
8197
  symbolAfterValue: void 0
@@ -53243,7 +53243,7 @@ var Renderer7 = ({
53243
53243
  );
53244
53244
  };
53245
53245
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
53246
- var Editor4 = React82__default.default.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
53246
+ var Editor4 = React82__default.default.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53247
53247
  var _a, _b, _c, _d, _e;
53248
53248
  const I18n = coreReact.useI18nContext();
53249
53249
  function onBlur() {
@@ -53252,7 +53252,7 @@ var Editor4 = React82__default.default.forwardRef(({ columnDefinition, stopEditi
53252
53252
  if (isEmptyValue(value) && !columnDefinition.editable) {
53253
53253
  return null;
53254
53254
  }
53255
- const defaultValue = labsFinancialsUtils.formatNumber(value, {
53255
+ const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
53256
53256
  ...((_a = columnDefinition.cellEditorParams) == null ? void 0 : _a.formatConfig) ?? ((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.formatConfig) ?? {},
53257
53257
  symbol: void 0,
53258
53258
  symbolAfterValue: void 0
@@ -53607,13 +53607,13 @@ var Renderer11 = ({
53607
53607
  };
53608
53608
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53609
53609
  var Editor7 = React82__default.default.forwardRef(
53610
- ({ columnDefinition, stopEditing, value }, ref) => {
53610
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53611
53611
  var _a, _b, _c, _d;
53612
53612
  function onBlur() {
53613
53613
  stopEditing();
53614
53614
  }
53615
53615
  const I18n = coreReact.useI18nContext();
53616
- const internalValue = ((_a = columnDefinition.getStringFormattedValue) == null ? void 0 : _a.call(columnDefinition, value)) ?? value;
53616
+ const internalValue = eventKey ? value : ((_a = columnDefinition.getStringFormattedValue) == null ? void 0 : _a.call(columnDefinition, value)) ?? value;
53617
53617
  return /* @__PURE__ */ React82__default.default.createElement(
53618
53618
  coreReact.Input,
53619
53619
  {
@@ -54589,6 +54589,15 @@ function getCheckboxColumn(columnApi) {
54589
54589
 
54590
54590
  // src/utils/transformers.ts
54591
54591
  var emptyObject = {};
54592
+ var DEFAULT_AUTO_GROUP_COLUMN_DEFINITION = {
54593
+ headerName: "",
54594
+ cellRendererSelector(params) {
54595
+ return {
54596
+ component: (params == null ? void 0 : params.node.rowPinned) ? GrandTotalsLabelRenderer : void 0
54597
+ };
54598
+ },
54599
+ lockPosition: true
54600
+ };
54592
54601
  function isColGroupDef(colDef) {
54593
54602
  var _a;
54594
54603
  return ((_a = colDef.children) == null ? void 0 : _a.length) > 0;
@@ -55041,6 +55050,44 @@ function getFilterParams(columnDefinition) {
55041
55050
  }
55042
55051
  return filterProps;
55043
55052
  }
55053
+ function addAutoGroupParams(columnDefinition, isRowSelectable, siblingGroupsRowSelectionDisabled) {
55054
+ return {
55055
+ ...columnDefinition,
55056
+ cellRendererSelector: (params) => {
55057
+ var _a;
55058
+ const cellRendererSelector = (_a = columnDefinition.cellRendererSelector) == null ? void 0 : _a.call(columnDefinition, params);
55059
+ return {
55060
+ component: (cellRendererSelector == null ? void 0 : cellRendererSelector.component) ?? AutoGroupCellRenderer,
55061
+ params: {
55062
+ ...columnDefinition.cellRendererParams,
55063
+ ...cellRendererSelector == null ? void 0 : cellRendererSelector.params,
55064
+ checkbox(_params) {
55065
+ if (_params.node) {
55066
+ return isRowSelectable({
55067
+ ..._params.node,
55068
+ data: _params.node.data ?? _params.node.aggData
55069
+ });
55070
+ }
55071
+ return false;
55072
+ },
55073
+ siblingGroupsRowSelectionDisabled
55074
+ }
55075
+ };
55076
+ }
55077
+ };
55078
+ }
55079
+ function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight, isRowSelectable, siblingGroupsRowSelectionDisabled) {
55080
+ const colDef = columnDefinition ? transformToColDef(
55081
+ columnDefinition,
55082
+ enableGroupEditAndValidation,
55083
+ enableDynamicRowHeight
55084
+ ) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55085
+ return addAutoGroupParams(
55086
+ colDef,
55087
+ isRowSelectable,
55088
+ siblingGroupsRowSelectionDisabled
55089
+ );
55090
+ }
55044
55091
 
55045
55092
  // src/CellRenderers/AutoGroupCell.scss
55046
55093
  var css5 = `._autoGroupCell_15e3f_1 {
@@ -55822,6 +55869,7 @@ var DataTableCellEditor = React82__default.default.forwardRef(
55822
55869
  {
55823
55870
  columnDefinition,
55824
55871
  data,
55872
+ eventKey,
55825
55873
  field: node.field,
55826
55874
  isGroup: node.group || false,
55827
55875
  parentData: context == null ? void 0 : context.parentData,
@@ -56218,7 +56266,7 @@ var GenericHeaderRenderer = (props) => {
56218
56266
  const colDef = props.column.getColDef();
56219
56267
  const HeaderNode = (_a = colDef.headerComponentParams) == null ? void 0 : _a.headerNode;
56220
56268
  const I18n = coreReact.useI18nContext();
56221
- const { columnApi, tableRef, gridApi, onServerSideDataRequest } = useInternalTableContext();
56269
+ const { columnApi, tableRef, onServerSideDataRequest } = useInternalTableContext();
56222
56270
  const onSSDR = Boolean(onServerSideDataRequest);
56223
56271
  const [sortOrder, setSortOrder] = React82__default.default.useState(props.column.getSort());
56224
56272
  const [isFirstColumn2, setIsFirstColumn] = React82__default.default.useState(false);
@@ -56226,7 +56274,7 @@ var GenericHeaderRenderer = (props) => {
56226
56274
  const headerCellRef = React82.useRef(null);
56227
56275
  const headerCheckboxSelection = colDef.headerCheckboxSelection;
56228
56276
  const headerCheckboxSelectionEnabled = typeof headerCheckboxSelection === "function" ? headerCheckboxSelection({
56229
- api: gridApi,
56277
+ api: props.api,
56230
56278
  colDef,
56231
56279
  column: props.column,
56232
56280
  columnApi,
@@ -56322,14 +56370,16 @@ var GenericHeaderRenderer = (props) => {
56322
56370
  });
56323
56371
  const [expansionVariant, setExpansionVariant] = React82__default.default.useState("closed");
56324
56372
  React82__default.default.useEffect(() => {
56373
+ var _a2;
56325
56374
  const onExpandAllChange = (event) => {
56326
56375
  setExpansionVariant(event.source === "expandAll" ? "all" : "closed");
56327
56376
  };
56328
- gridApi == null ? void 0 : gridApi.addEventListener("expandOrCollapseAll", onExpandAllChange);
56377
+ (_a2 = props.api) == null ? void 0 : _a2.addEventListener("expandOrCollapseAll", onExpandAllChange);
56329
56378
  return () => {
56330
- gridApi == null ? void 0 : gridApi.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56379
+ var _a3;
56380
+ (_a3 = props.api) == null ? void 0 : _a3.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56331
56381
  };
56332
- }, [gridApi]);
56382
+ }, [props.api]);
56333
56383
  React82__default.default.useEffect(() => {
56334
56384
  const hasTierOneCollapsedNodes = !!findNode(
56335
56385
  (node) => node.level === 0 && !node.expanded,
@@ -56439,7 +56489,7 @@ var GenericHeaderRenderer = (props) => {
56439
56489
  return;
56440
56490
  }
56441
56491
  function updateSelectAllCheckbox() {
56442
- const currentRows = getCurrentRows(gridApi);
56492
+ const currentRows = getCurrentRows(props.api);
56443
56493
  const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56444
56494
  const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56445
56495
  if (isAllSelected) {
@@ -73511,6 +73561,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73511
73561
  }
73512
73562
  };
73513
73563
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
73564
+ const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
73514
73565
  return {
73515
73566
  isRowMaster: detailRowConfig.isExpandable,
73516
73567
  masterDetail: true,
@@ -73519,6 +73570,13 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73519
73570
  return {
73520
73571
  detailGridOptions: {
73521
73572
  alwaysAggregateAtRootLevel: !isServerSideRowModel,
73573
+ autoGroupColumnDef: getDecoratedAutoGroupColDef(
73574
+ detailRowConfig.autoGroupColumnDefinition,
73575
+ enableGroupEditAndValidation,
73576
+ enableDynamicRowHeight,
73577
+ isRowSelectable,
73578
+ false
73579
+ ),
73522
73580
  context: {
73523
73581
  parentId: masterGridParams.node.id.replace("detail_", ""),
73524
73582
  parentData: masterGridParams.node.data
@@ -73532,6 +73590,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73532
73590
  )
73533
73591
  )
73534
73592
  ),
73593
+ isRowSelectable,
73535
73594
  onGridReady: onGridReadyOrValueChange,
73536
73595
  onCellValueChanged: onGridReadyOrValueChange,
73537
73596
  onRowDataChanged: onGridReadyOrValueChange,
@@ -73554,7 +73613,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73554
73613
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
73555
73614
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
73556
73615
  ensureDomOrder: true,
73557
- frameworkComponents,
73616
+ components: frameworkComponents,
73558
73617
  icons: tableIcons,
73559
73618
  loadingOverlayComponent: "loadingOverlayRenderer",
73560
73619
  loadingOverlayComponentParams: {
@@ -73566,6 +73625,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73566
73625
  },
73567
73626
  rowDragManaged: true,
73568
73627
  singleClickEdit: true,
73628
+ suppressAggFuncInHeader: true,
73569
73629
  suppressContextMenu: true,
73570
73630
  suppressColumnVirtualisation: true,
73571
73631
  getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters)
@@ -76982,61 +77042,16 @@ var Table = (props) => {
76982
77042
  },
76983
77043
  [props]
76984
77044
  );
76985
- const addAutoGroupParams = React82__default.default.useCallback(
76986
- function addAutoGroupParams2(columnDefinition) {
76987
- return {
76988
- ...columnDefinition,
76989
- cellRendererSelector: (params) => {
76990
- var _a2;
76991
- const cellRendererSelector = (_a2 = columnDefinition.cellRendererSelector) == null ? void 0 : _a2.call(columnDefinition, params);
76992
- let component = (cellRendererSelector == null ? void 0 : cellRendererSelector.component) ?? "autoGroupCellRenderer";
76993
- return {
76994
- component,
76995
- params: {
76996
- ...columnDefinition.cellRendererParams,
76997
- ...cellRendererSelector == null ? void 0 : cellRendererSelector.params,
76998
- checkbox(_params) {
76999
- if (_params.node) {
77000
- return isRowSelectable({
77001
- ..._params.node,
77002
- data: _params.node.data ?? _params.node.aggData
77003
- });
77004
- }
77005
- return false;
77006
- },
77007
- siblingGroupsRowSelectionDisabled: props.siblingGroupsRowSelectionDisabled
77008
- }
77009
- };
77010
- }
77011
- };
77012
- },
77013
- [isRowSelectable]
77045
+ const decoratedAutoGroupColDef = React82__default.default.useMemo(
77046
+ () => getDecoratedAutoGroupColDef(
77047
+ props == null ? void 0 : props.autoGroupColumnDefinition,
77048
+ internalTableContext.enableGroupEditAndValidation,
77049
+ internalTableContext.enableDynamicRowHeight,
77050
+ isRowSelectable,
77051
+ props.siblingGroupsRowSelectionDisabled
77052
+ ),
77053
+ [props == null ? void 0 : props.autoGroupColumnDefinition]
77014
77054
  );
77015
- const decoratedAutoGroupColDef = React82__default.default.useMemo(() => {
77016
- if (props == null ? void 0 : props.autoGroupColumnDefinition) {
77017
- return addAutoGroupParams(
77018
- transformToColDef(
77019
- props == null ? void 0 : props.autoGroupColumnDefinition,
77020
- internalTableContext.enableGroupEditAndValidation,
77021
- internalTableContext.enableDynamicRowHeight
77022
- )
77023
- );
77024
- }
77025
- return addAutoGroupParams({
77026
- headerName: "",
77027
- cellRendererSelector: (params) => {
77028
- if (params == null ? void 0 : params.node.rowPinned) {
77029
- return {
77030
- component: GrandTotalsLabelRenderer
77031
- };
77032
- }
77033
- return {
77034
- component: void 0
77035
- };
77036
- },
77037
- lockPosition: true
77038
- });
77039
- }, [props == null ? void 0 : props.autoGroupColumnDefinition, addAutoGroupParams]);
77040
77055
  const onColumnGroupOpened = React82__default.default.useCallback(
77041
77056
  (event) => {
77042
77057
  var _a2, _b2, _c;
@@ -2,7 +2,7 @@ import React82, { useState, forwardRef, useContext, useRef, useImperativeHandle,
2
2
  import { startsWith, equals, omit, isNil, mergeDeepLeft, intersection, isEmpty, groupBy } from 'ramda';
3
3
  import { useI18nContext, Select, Input, UNSAFE_useOverlayTriggerContext, Card, Flex, Box, SegmentedController, Calendar, useDateTime, OverlayTrigger, isEventSource, DateInput, UNSAFE_isValidYearRange, DateSelect, PillSelect, TextArea, UNSAFE_useMenuImperativeControlNavigation, UNSAFE_Menu, UNSAFE_menuItemsWrapperAttribute, Spinner, FlexList, Typography, Tooltip, Button, Required, colors, Form, spacing, Switch, Panel, UNSAFE_StyledFilterTokenLabel, typographyWeights, SelectButton, StyledSelectButton, StyledSelectButtonLabel, StyledButton, StyledSelectArrow, Popover, UNSAFE_StyledSuperSelectTrigger, UNSAFE_StyledSuperSelectLabel, UNSAFE_StyledSuperSelectArrow, DateTimeProvider, useField, Label, UNSAFE_mergeRefs, ContactItem as ContactItem$1, ToggleButton, Pagination, Link, AvatarStack, Pill, Typeahead, UNSAFE_FilterToken, useI18n, I18nContext, UNSAFE_SuperSelect, Avatar, MultiSelect, H3, Checkbox, useVisibility, UNSAFE_useSuperSelectContext, DropdownFlyout, StyledDropdownFlyoutLabel, StyledDropdownFlyoutExpandIcon, EmptyState as EmptyState$1 } from '@procore/core-react';
4
4
  import classnames from 'classnames/bind';
5
- import { Error as Error$1, Grip, Pencil, Building, Calendar as Calendar$1, CaretsInVertical, CaretsOutVertical, CaretsOutVerticalWithLine, CaretsIn, CaretsOut, ArrowDown, ArrowUp, CaretDown, CaretRight } from '@procore/core-icons';
5
+ import { Error as Error$1, Grip, Pencil, Building, Calendar as Calendar$1, CaretsInVertical, CaretsOutVertical, CaretsOutVerticalWithLine, CaretsIn, CaretsOut, CaretDown, CaretRight, ArrowDown, ArrowUp } from '@procore/core-icons';
6
6
  import classNames from 'classnames';
7
7
  import { isDate, parseISO, isSameDay, formatISO, isBefore } from 'date-fns';
8
8
  import { formatNumber, formatCurrency, formatPercentage } from '@procore/labs-financials-utils';
@@ -8167,7 +8167,7 @@ var Renderer3 = ({
8167
8167
  };
8168
8168
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8169
8169
  var Editor = React82.forwardRef(
8170
- ({ columnDefinition, stopEditing, value }, ref) => {
8170
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8171
8171
  var _a, _b, _c, _d, _e;
8172
8172
  const I18n = useI18nContext();
8173
8173
  if (isEmptyValue(value) && !columnDefinition.editable) {
@@ -8176,7 +8176,7 @@ var Editor = React82.forwardRef(
8176
8176
  function onBlur() {
8177
8177
  stopEditing();
8178
8178
  }
8179
- const defaultValue = formatNumber(value, {
8179
+ const defaultValue = eventKey ? value : formatNumber(value, {
8180
8180
  ...((_a = columnDefinition.cellEditorParams) == null ? void 0 : _a.formatConfig) ?? ((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.formatConfig) ?? {},
8181
8181
  symbol: void 0,
8182
8182
  symbolAfterValue: void 0
@@ -53228,7 +53228,7 @@ var Renderer7 = ({
53228
53228
  );
53229
53229
  };
53230
53230
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
53231
- var Editor4 = React82.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
53231
+ var Editor4 = React82.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53232
53232
  var _a, _b, _c, _d, _e;
53233
53233
  const I18n = useI18nContext();
53234
53234
  function onBlur() {
@@ -53237,7 +53237,7 @@ var Editor4 = React82.forwardRef(({ columnDefinition, stopEditing, value }, ref)
53237
53237
  if (isEmptyValue(value) && !columnDefinition.editable) {
53238
53238
  return null;
53239
53239
  }
53240
- const defaultValue = formatNumber(value, {
53240
+ const defaultValue = eventKey ? value : formatNumber(value, {
53241
53241
  ...((_a = columnDefinition.cellEditorParams) == null ? void 0 : _a.formatConfig) ?? ((_b = columnDefinition.cellRendererParams) == null ? void 0 : _b.formatConfig) ?? {},
53242
53242
  symbol: void 0,
53243
53243
  symbolAfterValue: void 0
@@ -53592,13 +53592,13 @@ var Renderer11 = ({
53592
53592
  };
53593
53593
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53594
53594
  var Editor7 = React82.forwardRef(
53595
- ({ columnDefinition, stopEditing, value }, ref) => {
53595
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53596
53596
  var _a, _b, _c, _d;
53597
53597
  function onBlur() {
53598
53598
  stopEditing();
53599
53599
  }
53600
53600
  const I18n = useI18nContext();
53601
- const internalValue = ((_a = columnDefinition.getStringFormattedValue) == null ? void 0 : _a.call(columnDefinition, value)) ?? value;
53601
+ const internalValue = eventKey ? value : ((_a = columnDefinition.getStringFormattedValue) == null ? void 0 : _a.call(columnDefinition, value)) ?? value;
53602
53602
  return /* @__PURE__ */ React82.createElement(
53603
53603
  Input,
53604
53604
  {
@@ -54574,6 +54574,15 @@ function getCheckboxColumn(columnApi) {
54574
54574
 
54575
54575
  // src/utils/transformers.ts
54576
54576
  var emptyObject = {};
54577
+ var DEFAULT_AUTO_GROUP_COLUMN_DEFINITION = {
54578
+ headerName: "",
54579
+ cellRendererSelector(params) {
54580
+ return {
54581
+ component: (params == null ? void 0 : params.node.rowPinned) ? GrandTotalsLabelRenderer : void 0
54582
+ };
54583
+ },
54584
+ lockPosition: true
54585
+ };
54577
54586
  function isColGroupDef(colDef) {
54578
54587
  var _a;
54579
54588
  return ((_a = colDef.children) == null ? void 0 : _a.length) > 0;
@@ -55026,6 +55035,44 @@ function getFilterParams(columnDefinition) {
55026
55035
  }
55027
55036
  return filterProps;
55028
55037
  }
55038
+ function addAutoGroupParams(columnDefinition, isRowSelectable, siblingGroupsRowSelectionDisabled) {
55039
+ return {
55040
+ ...columnDefinition,
55041
+ cellRendererSelector: (params) => {
55042
+ var _a;
55043
+ const cellRendererSelector = (_a = columnDefinition.cellRendererSelector) == null ? void 0 : _a.call(columnDefinition, params);
55044
+ return {
55045
+ component: (cellRendererSelector == null ? void 0 : cellRendererSelector.component) ?? AutoGroupCellRenderer,
55046
+ params: {
55047
+ ...columnDefinition.cellRendererParams,
55048
+ ...cellRendererSelector == null ? void 0 : cellRendererSelector.params,
55049
+ checkbox(_params) {
55050
+ if (_params.node) {
55051
+ return isRowSelectable({
55052
+ ..._params.node,
55053
+ data: _params.node.data ?? _params.node.aggData
55054
+ });
55055
+ }
55056
+ return false;
55057
+ },
55058
+ siblingGroupsRowSelectionDisabled
55059
+ }
55060
+ };
55061
+ }
55062
+ };
55063
+ }
55064
+ function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight, isRowSelectable, siblingGroupsRowSelectionDisabled) {
55065
+ const colDef = columnDefinition ? transformToColDef(
55066
+ columnDefinition,
55067
+ enableGroupEditAndValidation,
55068
+ enableDynamicRowHeight
55069
+ ) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55070
+ return addAutoGroupParams(
55071
+ colDef,
55072
+ isRowSelectable,
55073
+ siblingGroupsRowSelectionDisabled
55074
+ );
55075
+ }
55029
55076
 
55030
55077
  // src/CellRenderers/AutoGroupCell.scss
55031
55078
  var css5 = `._autoGroupCell_15e3f_1 {
@@ -55807,6 +55854,7 @@ var DataTableCellEditor = React82.forwardRef(
55807
55854
  {
55808
55855
  columnDefinition,
55809
55856
  data,
55857
+ eventKey,
55810
55858
  field: node.field,
55811
55859
  isGroup: node.group || false,
55812
55860
  parentData: context == null ? void 0 : context.parentData,
@@ -56203,7 +56251,7 @@ var GenericHeaderRenderer = (props) => {
56203
56251
  const colDef = props.column.getColDef();
56204
56252
  const HeaderNode = (_a = colDef.headerComponentParams) == null ? void 0 : _a.headerNode;
56205
56253
  const I18n = useI18nContext();
56206
- const { columnApi, tableRef, gridApi, onServerSideDataRequest } = useInternalTableContext();
56254
+ const { columnApi, tableRef, onServerSideDataRequest } = useInternalTableContext();
56207
56255
  const onSSDR = Boolean(onServerSideDataRequest);
56208
56256
  const [sortOrder, setSortOrder] = React82.useState(props.column.getSort());
56209
56257
  const [isFirstColumn2, setIsFirstColumn] = React82.useState(false);
@@ -56211,7 +56259,7 @@ var GenericHeaderRenderer = (props) => {
56211
56259
  const headerCellRef = useRef(null);
56212
56260
  const headerCheckboxSelection = colDef.headerCheckboxSelection;
56213
56261
  const headerCheckboxSelectionEnabled = typeof headerCheckboxSelection === "function" ? headerCheckboxSelection({
56214
- api: gridApi,
56262
+ api: props.api,
56215
56263
  colDef,
56216
56264
  column: props.column,
56217
56265
  columnApi,
@@ -56307,14 +56355,16 @@ var GenericHeaderRenderer = (props) => {
56307
56355
  });
56308
56356
  const [expansionVariant, setExpansionVariant] = React82.useState("closed");
56309
56357
  React82.useEffect(() => {
56358
+ var _a2;
56310
56359
  const onExpandAllChange = (event) => {
56311
56360
  setExpansionVariant(event.source === "expandAll" ? "all" : "closed");
56312
56361
  };
56313
- gridApi == null ? void 0 : gridApi.addEventListener("expandOrCollapseAll", onExpandAllChange);
56362
+ (_a2 = props.api) == null ? void 0 : _a2.addEventListener("expandOrCollapseAll", onExpandAllChange);
56314
56363
  return () => {
56315
- gridApi == null ? void 0 : gridApi.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56364
+ var _a3;
56365
+ (_a3 = props.api) == null ? void 0 : _a3.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56316
56366
  };
56317
- }, [gridApi]);
56367
+ }, [props.api]);
56318
56368
  React82.useEffect(() => {
56319
56369
  const hasTierOneCollapsedNodes = !!findNode(
56320
56370
  (node) => node.level === 0 && !node.expanded,
@@ -56424,7 +56474,7 @@ var GenericHeaderRenderer = (props) => {
56424
56474
  return;
56425
56475
  }
56426
56476
  function updateSelectAllCheckbox() {
56427
- const currentRows = getCurrentRows(gridApi);
56477
+ const currentRows = getCurrentRows(props.api);
56428
56478
  const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56429
56479
  const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56430
56480
  if (isAllSelected) {
@@ -73496,6 +73546,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73496
73546
  }
73497
73547
  };
73498
73548
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
73549
+ const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
73499
73550
  return {
73500
73551
  isRowMaster: detailRowConfig.isExpandable,
73501
73552
  masterDetail: true,
@@ -73504,6 +73555,13 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73504
73555
  return {
73505
73556
  detailGridOptions: {
73506
73557
  alwaysAggregateAtRootLevel: !isServerSideRowModel,
73558
+ autoGroupColumnDef: getDecoratedAutoGroupColDef(
73559
+ detailRowConfig.autoGroupColumnDefinition,
73560
+ enableGroupEditAndValidation,
73561
+ enableDynamicRowHeight,
73562
+ isRowSelectable,
73563
+ false
73564
+ ),
73507
73565
  context: {
73508
73566
  parentId: masterGridParams.node.id.replace("detail_", ""),
73509
73567
  parentData: masterGridParams.node.data
@@ -73517,6 +73575,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73517
73575
  )
73518
73576
  )
73519
73577
  ),
73578
+ isRowSelectable,
73520
73579
  onGridReady: onGridReadyOrValueChange,
73521
73580
  onCellValueChanged: onGridReadyOrValueChange,
73522
73581
  onRowDataChanged: onGridReadyOrValueChange,
@@ -73539,7 +73598,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73539
73598
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
73540
73599
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
73541
73600
  ensureDomOrder: true,
73542
- frameworkComponents,
73601
+ components: frameworkComponents,
73543
73602
  icons: tableIcons,
73544
73603
  loadingOverlayComponent: "loadingOverlayRenderer",
73545
73604
  loadingOverlayComponentParams: {
@@ -73551,6 +73610,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73551
73610
  },
73552
73611
  rowDragManaged: true,
73553
73612
  singleClickEdit: true,
73613
+ suppressAggFuncInHeader: true,
73554
73614
  suppressContextMenu: true,
73555
73615
  suppressColumnVirtualisation: true,
73556
73616
  getRowHeight: getRowHeight == null ? void 0 : getRowHeight(detailRowConfig.customFooters)
@@ -76967,61 +77027,16 @@ var Table = (props) => {
76967
77027
  },
76968
77028
  [props]
76969
77029
  );
76970
- const addAutoGroupParams = React82.useCallback(
76971
- function addAutoGroupParams2(columnDefinition) {
76972
- return {
76973
- ...columnDefinition,
76974
- cellRendererSelector: (params) => {
76975
- var _a2;
76976
- const cellRendererSelector = (_a2 = columnDefinition.cellRendererSelector) == null ? void 0 : _a2.call(columnDefinition, params);
76977
- let component = (cellRendererSelector == null ? void 0 : cellRendererSelector.component) ?? "autoGroupCellRenderer";
76978
- return {
76979
- component,
76980
- params: {
76981
- ...columnDefinition.cellRendererParams,
76982
- ...cellRendererSelector == null ? void 0 : cellRendererSelector.params,
76983
- checkbox(_params) {
76984
- if (_params.node) {
76985
- return isRowSelectable({
76986
- ..._params.node,
76987
- data: _params.node.data ?? _params.node.aggData
76988
- });
76989
- }
76990
- return false;
76991
- },
76992
- siblingGroupsRowSelectionDisabled: props.siblingGroupsRowSelectionDisabled
76993
- }
76994
- };
76995
- }
76996
- };
76997
- },
76998
- [isRowSelectable]
77030
+ const decoratedAutoGroupColDef = React82.useMemo(
77031
+ () => getDecoratedAutoGroupColDef(
77032
+ props == null ? void 0 : props.autoGroupColumnDefinition,
77033
+ internalTableContext.enableGroupEditAndValidation,
77034
+ internalTableContext.enableDynamicRowHeight,
77035
+ isRowSelectable,
77036
+ props.siblingGroupsRowSelectionDisabled
77037
+ ),
77038
+ [props == null ? void 0 : props.autoGroupColumnDefinition]
76999
77039
  );
77000
- const decoratedAutoGroupColDef = React82.useMemo(() => {
77001
- if (props == null ? void 0 : props.autoGroupColumnDefinition) {
77002
- return addAutoGroupParams(
77003
- transformToColDef(
77004
- props == null ? void 0 : props.autoGroupColumnDefinition,
77005
- internalTableContext.enableGroupEditAndValidation,
77006
- internalTableContext.enableDynamicRowHeight
77007
- )
77008
- );
77009
- }
77010
- return addAutoGroupParams({
77011
- headerName: "",
77012
- cellRendererSelector: (params) => {
77013
- if (params == null ? void 0 : params.node.rowPinned) {
77014
- return {
77015
- component: GrandTotalsLabelRenderer
77016
- };
77017
- }
77018
- return {
77019
- component: void 0
77020
- };
77021
- },
77022
- lockPosition: true
77023
- });
77024
- }, [props == null ? void 0 : props.autoGroupColumnDefinition, addAutoGroupParams]);
77025
77040
  const onColumnGroupOpened = React82.useCallback(
77026
77041
  (event) => {
77027
77042
  var _a2, _b2, _c;
@@ -154,6 +154,7 @@ interface DataTableCellRendererProps<TValue = any, TColumnDefinition extends Col
154
154
  rowIndex?: number;
155
155
  }
156
156
  interface DataTableCellEditorProps<TValue = any, TColumnDefinition extends ColumnDefinition = ColumnDefinition<TValue>> extends DataTableCellRendererProps<TValue, TColumnDefinition> {
157
+ eventKey: string | null;
157
158
  ref?: ((instance: HTMLElement | null) => void) | React__default.MutableRefObject<HTMLElement | null> | null;
158
159
  setDataValue: (field: string, newValue: TValue) => void;
159
160
  stopEditing: () => void;
@@ -669,6 +670,7 @@ interface GetDetailRowDataParams<TRow = any> extends Omit<AgGetDetailRowDataPara
669
670
  }
670
671
  type GetRowHeightWithFooters = (customFooters: CustomFooterConfig[] | undefined) => (params: Partial<RowHeightParams>) => number;
671
672
  interface DetailRowConfig<TRow = any> {
673
+ autoGroupColumnDefinition?: ColumnDefinition;
672
674
  columnDefinitions: ColumnDefinition[];
673
675
  getDetailRowData: (params: GetDetailRowDataParams<TRow>) => void;
674
676
  height?: 'auto' | number;
@@ -154,6 +154,7 @@ interface DataTableCellRendererProps<TValue = any, TColumnDefinition extends Col
154
154
  rowIndex?: number;
155
155
  }
156
156
  interface DataTableCellEditorProps<TValue = any, TColumnDefinition extends ColumnDefinition = ColumnDefinition<TValue>> extends DataTableCellRendererProps<TValue, TColumnDefinition> {
157
+ eventKey: string | null;
157
158
  ref?: ((instance: HTMLElement | null) => void) | React__default.MutableRefObject<HTMLElement | null> | null;
158
159
  setDataValue: (field: string, newValue: TValue) => void;
159
160
  stopEditing: () => void;
@@ -669,6 +670,7 @@ interface GetDetailRowDataParams<TRow = any> extends Omit<AgGetDetailRowDataPara
669
670
  }
670
671
  type GetRowHeightWithFooters = (customFooters: CustomFooterConfig[] | undefined) => (params: Partial<RowHeightParams>) => number;
671
672
  interface DetailRowConfig<TRow = any> {
673
+ autoGroupColumnDefinition?: ColumnDefinition;
672
674
  columnDefinitions: ColumnDefinition[];
673
675
  getDetailRowData: (params: GetDetailRowDataParams<TRow>) => void;
674
676
  height?: 'auto' | number;
@@ -8179,7 +8179,7 @@ var Renderer3 = ({
8179
8179
  };
8180
8180
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8181
8181
  var Editor = React82__default.default.forwardRef(
8182
- ({ columnDefinition, stopEditing, value }, ref) => {
8182
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8183
8183
  const I18n = coreReact.useI18nContext();
8184
8184
  if (isEmptyValue(value) && !columnDefinition.editable) {
8185
8185
  return null;
@@ -8187,7 +8187,7 @@ var Editor = React82__default.default.forwardRef(
8187
8187
  function onBlur() {
8188
8188
  stopEditing();
8189
8189
  }
8190
- const defaultValue = labsFinancialsUtils.formatNumber(value, {
8190
+ const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
8191
8191
  ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
8192
8192
  symbol: void 0,
8193
8193
  symbolAfterValue: void 0
@@ -53221,7 +53221,7 @@ var Renderer7 = ({
53221
53221
  );
53222
53222
  };
53223
53223
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
53224
- var Editor4 = React82__default.default.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
53224
+ var Editor4 = React82__default.default.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53225
53225
  const I18n = coreReact.useI18nContext();
53226
53226
  function onBlur() {
53227
53227
  stopEditing();
@@ -53229,7 +53229,7 @@ var Editor4 = React82__default.default.forwardRef(({ columnDefinition, stopEditi
53229
53229
  if (isEmptyValue(value) && !columnDefinition.editable) {
53230
53230
  return null;
53231
53231
  }
53232
- const defaultValue = labsFinancialsUtils.formatNumber(value, {
53232
+ const defaultValue = eventKey ? value : labsFinancialsUtils.formatNumber(value, {
53233
53233
  ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
53234
53234
  symbol: void 0,
53235
53235
  symbolAfterValue: void 0
@@ -53571,12 +53571,12 @@ var Renderer11 = ({
53571
53571
  };
53572
53572
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53573
53573
  var Editor7 = React82__default.default.forwardRef(
53574
- ({ columnDefinition, stopEditing, value }, ref) => {
53574
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53575
53575
  function onBlur() {
53576
53576
  stopEditing();
53577
53577
  }
53578
53578
  const I18n = coreReact.useI18nContext();
53579
- const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53579
+ const internalValue = eventKey ? value : columnDefinition.getStringFormattedValue?.(value) ?? value;
53580
53580
  return /* @__PURE__ */ React82__default.default.createElement(
53581
53581
  coreReact.Input,
53582
53582
  {
@@ -54532,6 +54532,15 @@ function getCheckboxColumn(columnApi) {
54532
54532
 
54533
54533
  // src/utils/transformers.ts
54534
54534
  var emptyObject = {};
54535
+ var DEFAULT_AUTO_GROUP_COLUMN_DEFINITION = {
54536
+ headerName: "",
54537
+ cellRendererSelector(params) {
54538
+ return {
54539
+ component: params?.node.rowPinned ? GrandTotalsLabelRenderer : void 0
54540
+ };
54541
+ },
54542
+ lockPosition: true
54543
+ };
54535
54544
  function isColGroupDef(colDef) {
54536
54545
  return colDef.children?.length > 0;
54537
54546
  }
@@ -54974,6 +54983,43 @@ function getFilterParams(columnDefinition) {
54974
54983
  }
54975
54984
  return filterProps;
54976
54985
  }
54986
+ function addAutoGroupParams(columnDefinition, isRowSelectable, siblingGroupsRowSelectionDisabled) {
54987
+ return {
54988
+ ...columnDefinition,
54989
+ cellRendererSelector: (params) => {
54990
+ const cellRendererSelector = columnDefinition.cellRendererSelector?.(params);
54991
+ return {
54992
+ component: cellRendererSelector?.component ?? AutoGroupCellRenderer,
54993
+ params: {
54994
+ ...columnDefinition.cellRendererParams,
54995
+ ...cellRendererSelector?.params,
54996
+ checkbox(_params) {
54997
+ if (_params.node) {
54998
+ return isRowSelectable({
54999
+ ..._params.node,
55000
+ data: _params.node.data ?? _params.node.aggData
55001
+ });
55002
+ }
55003
+ return false;
55004
+ },
55005
+ siblingGroupsRowSelectionDisabled
55006
+ }
55007
+ };
55008
+ }
55009
+ };
55010
+ }
55011
+ function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight, isRowSelectable, siblingGroupsRowSelectionDisabled) {
55012
+ const colDef = columnDefinition ? transformToColDef(
55013
+ columnDefinition,
55014
+ enableGroupEditAndValidation,
55015
+ enableDynamicRowHeight
55016
+ ) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55017
+ return addAutoGroupParams(
55018
+ colDef,
55019
+ isRowSelectable,
55020
+ siblingGroupsRowSelectionDisabled
55021
+ );
55022
+ }
54977
55023
 
54978
55024
  // src/CellRenderers/AutoGroupCell.scss
54979
55025
  var css5 = `._autoGroupCell_15e3f_1 {
@@ -55737,6 +55783,7 @@ var DataTableCellEditor = React82__default.default.forwardRef(
55737
55783
  {
55738
55784
  columnDefinition,
55739
55785
  data,
55786
+ eventKey,
55740
55787
  field: node.field,
55741
55788
  isGroup: node.group || false,
55742
55789
  parentData: context?.parentData,
@@ -56130,7 +56177,7 @@ var GenericHeaderRenderer = (props) => {
56130
56177
  const colDef = props.column.getColDef();
56131
56178
  const HeaderNode = colDef.headerComponentParams?.headerNode;
56132
56179
  const I18n = coreReact.useI18nContext();
56133
- const { columnApi, tableRef, gridApi, onServerSideDataRequest } = useInternalTableContext();
56180
+ const { columnApi, tableRef, onServerSideDataRequest } = useInternalTableContext();
56134
56181
  const onSSDR = Boolean(onServerSideDataRequest);
56135
56182
  const [sortOrder, setSortOrder] = React82__default.default.useState(props.column.getSort());
56136
56183
  const [isFirstColumn2, setIsFirstColumn] = React82__default.default.useState(false);
@@ -56138,7 +56185,7 @@ var GenericHeaderRenderer = (props) => {
56138
56185
  const headerCellRef = React82.useRef(null);
56139
56186
  const headerCheckboxSelection = colDef.headerCheckboxSelection;
56140
56187
  const headerCheckboxSelectionEnabled = typeof headerCheckboxSelection === "function" ? headerCheckboxSelection({
56141
- api: gridApi,
56188
+ api: props.api,
56142
56189
  colDef,
56143
56190
  column: props.column,
56144
56191
  columnApi,
@@ -56236,11 +56283,11 @@ var GenericHeaderRenderer = (props) => {
56236
56283
  const onExpandAllChange = (event) => {
56237
56284
  setExpansionVariant(event.source === "expandAll" ? "all" : "closed");
56238
56285
  };
56239
- gridApi?.addEventListener("expandOrCollapseAll", onExpandAllChange);
56286
+ props.api?.addEventListener("expandOrCollapseAll", onExpandAllChange);
56240
56287
  return () => {
56241
- gridApi?.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56288
+ props.api?.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56242
56289
  };
56243
- }, [gridApi]);
56290
+ }, [props.api]);
56244
56291
  React82__default.default.useEffect(() => {
56245
56292
  const hasTierOneCollapsedNodes = !!findNode(
56246
56293
  (node) => node.level === 0 && !node.expanded,
@@ -56347,7 +56394,7 @@ var GenericHeaderRenderer = (props) => {
56347
56394
  return;
56348
56395
  }
56349
56396
  function updateSelectAllCheckbox() {
56350
- const currentRows = getCurrentRows(gridApi);
56397
+ const currentRows = getCurrentRows(props.api);
56351
56398
  const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56352
56399
  const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56353
56400
  if (isAllSelected) {
@@ -73356,6 +73403,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73356
73403
  }
73357
73404
  };
73358
73405
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
73406
+ const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
73359
73407
  return {
73360
73408
  isRowMaster: detailRowConfig.isExpandable,
73361
73409
  masterDetail: true,
@@ -73364,6 +73412,13 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73364
73412
  return {
73365
73413
  detailGridOptions: {
73366
73414
  alwaysAggregateAtRootLevel: !isServerSideRowModel,
73415
+ autoGroupColumnDef: getDecoratedAutoGroupColDef(
73416
+ detailRowConfig.autoGroupColumnDefinition,
73417
+ enableGroupEditAndValidation,
73418
+ enableDynamicRowHeight,
73419
+ isRowSelectable,
73420
+ false
73421
+ ),
73367
73422
  context: {
73368
73423
  parentId: masterGridParams.node.id.replace("detail_", ""),
73369
73424
  parentData: masterGridParams.node.data
@@ -73377,6 +73432,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73377
73432
  )
73378
73433
  )
73379
73434
  ),
73435
+ isRowSelectable,
73380
73436
  onGridReady: onGridReadyOrValueChange,
73381
73437
  onCellValueChanged: onGridReadyOrValueChange,
73382
73438
  onRowDataChanged: onGridReadyOrValueChange,
@@ -73398,7 +73454,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73398
73454
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
73399
73455
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
73400
73456
  ensureDomOrder: true,
73401
- frameworkComponents,
73457
+ components: frameworkComponents,
73402
73458
  icons: tableIcons,
73403
73459
  loadingOverlayComponent: "loadingOverlayRenderer",
73404
73460
  loadingOverlayComponentParams: {
@@ -73410,6 +73466,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73410
73466
  },
73411
73467
  rowDragManaged: true,
73412
73468
  singleClickEdit: true,
73469
+ suppressAggFuncInHeader: true,
73413
73470
  suppressContextMenu: true,
73414
73471
  suppressColumnVirtualisation: true,
73415
73472
  getRowHeight: getRowHeight?.(detailRowConfig.customFooters)
@@ -76792,60 +76849,16 @@ var Table = (props) => {
76792
76849
  },
76793
76850
  [props]
76794
76851
  );
76795
- const addAutoGroupParams = React82__default.default.useCallback(
76796
- function addAutoGroupParams2(columnDefinition) {
76797
- return {
76798
- ...columnDefinition,
76799
- cellRendererSelector: (params) => {
76800
- const cellRendererSelector = columnDefinition.cellRendererSelector?.(params);
76801
- let component = cellRendererSelector?.component ?? "autoGroupCellRenderer";
76802
- return {
76803
- component,
76804
- params: {
76805
- ...columnDefinition.cellRendererParams,
76806
- ...cellRendererSelector?.params,
76807
- checkbox(_params) {
76808
- if (_params.node) {
76809
- return isRowSelectable({
76810
- ..._params.node,
76811
- data: _params.node.data ?? _params.node.aggData
76812
- });
76813
- }
76814
- return false;
76815
- },
76816
- siblingGroupsRowSelectionDisabled: props.siblingGroupsRowSelectionDisabled
76817
- }
76818
- };
76819
- }
76820
- };
76821
- },
76822
- [isRowSelectable]
76852
+ const decoratedAutoGroupColDef = React82__default.default.useMemo(
76853
+ () => getDecoratedAutoGroupColDef(
76854
+ props?.autoGroupColumnDefinition,
76855
+ internalTableContext.enableGroupEditAndValidation,
76856
+ internalTableContext.enableDynamicRowHeight,
76857
+ isRowSelectable,
76858
+ props.siblingGroupsRowSelectionDisabled
76859
+ ),
76860
+ [props?.autoGroupColumnDefinition]
76823
76861
  );
76824
- const decoratedAutoGroupColDef = React82__default.default.useMemo(() => {
76825
- if (props?.autoGroupColumnDefinition) {
76826
- return addAutoGroupParams(
76827
- transformToColDef(
76828
- props?.autoGroupColumnDefinition,
76829
- internalTableContext.enableGroupEditAndValidation,
76830
- internalTableContext.enableDynamicRowHeight
76831
- )
76832
- );
76833
- }
76834
- return addAutoGroupParams({
76835
- headerName: "",
76836
- cellRendererSelector: (params) => {
76837
- if (params?.node.rowPinned) {
76838
- return {
76839
- component: GrandTotalsLabelRenderer
76840
- };
76841
- }
76842
- return {
76843
- component: void 0
76844
- };
76845
- },
76846
- lockPosition: true
76847
- });
76848
- }, [props?.autoGroupColumnDefinition, addAutoGroupParams]);
76849
76862
  const onColumnGroupOpened = React82__default.default.useCallback(
76850
76863
  (event) => {
76851
76864
  internalTableContext.analytics?.client.addEvent(
@@ -2,7 +2,7 @@ import React82, { useState, forwardRef, useContext, useRef, useImperativeHandle,
2
2
  import { startsWith, equals, omit, isNil, mergeDeepLeft, intersection, isEmpty, groupBy } from 'ramda';
3
3
  import { useI18nContext, Select, Input, UNSAFE_useOverlayTriggerContext, Card, Flex, Box, SegmentedController, Calendar, useDateTime, OverlayTrigger, isEventSource, DateInput, UNSAFE_isValidYearRange, DateSelect, PillSelect, TextArea, UNSAFE_useMenuImperativeControlNavigation, UNSAFE_Menu, UNSAFE_menuItemsWrapperAttribute, Spinner, FlexList, Typography, Tooltip, Button, Required, colors, Form, spacing, Switch, Panel, UNSAFE_StyledFilterTokenLabel, typographyWeights, SelectButton, StyledSelectButton, StyledSelectButtonLabel, StyledButton, StyledSelectArrow, Popover, UNSAFE_StyledSuperSelectTrigger, UNSAFE_StyledSuperSelectLabel, UNSAFE_StyledSuperSelectArrow, DateTimeProvider, useField, Label, UNSAFE_mergeRefs, ContactItem as ContactItem$1, ToggleButton, Pagination, Link, AvatarStack, Pill, Typeahead, UNSAFE_FilterToken, useI18n, I18nContext, UNSAFE_SuperSelect, Avatar, MultiSelect, H3, Checkbox, useVisibility, UNSAFE_useSuperSelectContext, DropdownFlyout, StyledDropdownFlyoutLabel, StyledDropdownFlyoutExpandIcon, EmptyState as EmptyState$1 } from '@procore/core-react';
4
4
  import classnames from 'classnames/bind';
5
- import { Error as Error$1, Grip, Pencil, Building, Calendar as Calendar$1, CaretsInVertical, CaretsOutVertical, CaretsOutVerticalWithLine, CaretsIn, CaretsOut, ArrowDown, ArrowUp, CaretDown, CaretRight } from '@procore/core-icons';
5
+ import { Error as Error$1, Grip, Pencil, Building, Calendar as Calendar$1, CaretsInVertical, CaretsOutVertical, CaretsOutVerticalWithLine, CaretsIn, CaretsOut, CaretDown, CaretRight, ArrowDown, ArrowUp } from '@procore/core-icons';
6
6
  import classNames from 'classnames';
7
7
  import { isDate, parseISO, isSameDay, formatISO, isBefore } from 'date-fns';
8
8
  import { formatNumber, formatCurrency, formatPercentage } from '@procore/labs-financials-utils';
@@ -8164,7 +8164,7 @@ var Renderer3 = ({
8164
8164
  };
8165
8165
  var CurrencyCellRenderer = withDataTableRenderer(Renderer3, "input");
8166
8166
  var Editor = React82.forwardRef(
8167
- ({ columnDefinition, stopEditing, value }, ref) => {
8167
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
8168
8168
  const I18n = useI18nContext();
8169
8169
  if (isEmptyValue(value) && !columnDefinition.editable) {
8170
8170
  return null;
@@ -8172,7 +8172,7 @@ var Editor = React82.forwardRef(
8172
8172
  function onBlur() {
8173
8173
  stopEditing();
8174
8174
  }
8175
- const defaultValue = formatNumber(value, {
8175
+ const defaultValue = eventKey ? value : formatNumber(value, {
8176
8176
  ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
8177
8177
  symbol: void 0,
8178
8178
  symbolAfterValue: void 0
@@ -53206,7 +53206,7 @@ var Renderer7 = ({
53206
53206
  );
53207
53207
  };
53208
53208
  var PercentCellRenderer = withDataTableRenderer(Renderer7, "input");
53209
- var Editor4 = React82.forwardRef(({ columnDefinition, stopEditing, value }, ref) => {
53209
+ var Editor4 = React82.forwardRef(({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53210
53210
  const I18n = useI18nContext();
53211
53211
  function onBlur() {
53212
53212
  stopEditing();
@@ -53214,7 +53214,7 @@ var Editor4 = React82.forwardRef(({ columnDefinition, stopEditing, value }, ref)
53214
53214
  if (isEmptyValue(value) && !columnDefinition.editable) {
53215
53215
  return null;
53216
53216
  }
53217
- const defaultValue = formatNumber(value, {
53217
+ const defaultValue = eventKey ? value : formatNumber(value, {
53218
53218
  ...columnDefinition.cellEditorParams?.formatConfig ?? columnDefinition.cellRendererParams?.formatConfig ?? {},
53219
53219
  symbol: void 0,
53220
53220
  symbolAfterValue: void 0
@@ -53556,12 +53556,12 @@ var Renderer11 = ({
53556
53556
  };
53557
53557
  var TextCellRenderer = withDataTableRenderer(Renderer11, "input");
53558
53558
  var Editor7 = React82.forwardRef(
53559
- ({ columnDefinition, stopEditing, value }, ref) => {
53559
+ ({ columnDefinition, eventKey, stopEditing, value }, ref) => {
53560
53560
  function onBlur() {
53561
53561
  stopEditing();
53562
53562
  }
53563
53563
  const I18n = useI18nContext();
53564
- const internalValue = columnDefinition.getStringFormattedValue?.(value) ?? value;
53564
+ const internalValue = eventKey ? value : columnDefinition.getStringFormattedValue?.(value) ?? value;
53565
53565
  return /* @__PURE__ */ React82.createElement(
53566
53566
  Input,
53567
53567
  {
@@ -54517,6 +54517,15 @@ function getCheckboxColumn(columnApi) {
54517
54517
 
54518
54518
  // src/utils/transformers.ts
54519
54519
  var emptyObject = {};
54520
+ var DEFAULT_AUTO_GROUP_COLUMN_DEFINITION = {
54521
+ headerName: "",
54522
+ cellRendererSelector(params) {
54523
+ return {
54524
+ component: params?.node.rowPinned ? GrandTotalsLabelRenderer : void 0
54525
+ };
54526
+ },
54527
+ lockPosition: true
54528
+ };
54520
54529
  function isColGroupDef(colDef) {
54521
54530
  return colDef.children?.length > 0;
54522
54531
  }
@@ -54959,6 +54968,43 @@ function getFilterParams(columnDefinition) {
54959
54968
  }
54960
54969
  return filterProps;
54961
54970
  }
54971
+ function addAutoGroupParams(columnDefinition, isRowSelectable, siblingGroupsRowSelectionDisabled) {
54972
+ return {
54973
+ ...columnDefinition,
54974
+ cellRendererSelector: (params) => {
54975
+ const cellRendererSelector = columnDefinition.cellRendererSelector?.(params);
54976
+ return {
54977
+ component: cellRendererSelector?.component ?? AutoGroupCellRenderer,
54978
+ params: {
54979
+ ...columnDefinition.cellRendererParams,
54980
+ ...cellRendererSelector?.params,
54981
+ checkbox(_params) {
54982
+ if (_params.node) {
54983
+ return isRowSelectable({
54984
+ ..._params.node,
54985
+ data: _params.node.data ?? _params.node.aggData
54986
+ });
54987
+ }
54988
+ return false;
54989
+ },
54990
+ siblingGroupsRowSelectionDisabled
54991
+ }
54992
+ };
54993
+ }
54994
+ };
54995
+ }
54996
+ function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight, isRowSelectable, siblingGroupsRowSelectionDisabled) {
54997
+ const colDef = columnDefinition ? transformToColDef(
54998
+ columnDefinition,
54999
+ enableGroupEditAndValidation,
55000
+ enableDynamicRowHeight
55001
+ ) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55002
+ return addAutoGroupParams(
55003
+ colDef,
55004
+ isRowSelectable,
55005
+ siblingGroupsRowSelectionDisabled
55006
+ );
55007
+ }
54962
55008
 
54963
55009
  // src/CellRenderers/AutoGroupCell.scss
54964
55010
  var css5 = `._autoGroupCell_15e3f_1 {
@@ -55722,6 +55768,7 @@ var DataTableCellEditor = React82.forwardRef(
55722
55768
  {
55723
55769
  columnDefinition,
55724
55770
  data,
55771
+ eventKey,
55725
55772
  field: node.field,
55726
55773
  isGroup: node.group || false,
55727
55774
  parentData: context?.parentData,
@@ -56115,7 +56162,7 @@ var GenericHeaderRenderer = (props) => {
56115
56162
  const colDef = props.column.getColDef();
56116
56163
  const HeaderNode = colDef.headerComponentParams?.headerNode;
56117
56164
  const I18n = useI18nContext();
56118
- const { columnApi, tableRef, gridApi, onServerSideDataRequest } = useInternalTableContext();
56165
+ const { columnApi, tableRef, onServerSideDataRequest } = useInternalTableContext();
56119
56166
  const onSSDR = Boolean(onServerSideDataRequest);
56120
56167
  const [sortOrder, setSortOrder] = React82.useState(props.column.getSort());
56121
56168
  const [isFirstColumn2, setIsFirstColumn] = React82.useState(false);
@@ -56123,7 +56170,7 @@ var GenericHeaderRenderer = (props) => {
56123
56170
  const headerCellRef = useRef(null);
56124
56171
  const headerCheckboxSelection = colDef.headerCheckboxSelection;
56125
56172
  const headerCheckboxSelectionEnabled = typeof headerCheckboxSelection === "function" ? headerCheckboxSelection({
56126
- api: gridApi,
56173
+ api: props.api,
56127
56174
  colDef,
56128
56175
  column: props.column,
56129
56176
  columnApi,
@@ -56221,11 +56268,11 @@ var GenericHeaderRenderer = (props) => {
56221
56268
  const onExpandAllChange = (event) => {
56222
56269
  setExpansionVariant(event.source === "expandAll" ? "all" : "closed");
56223
56270
  };
56224
- gridApi?.addEventListener("expandOrCollapseAll", onExpandAllChange);
56271
+ props.api?.addEventListener("expandOrCollapseAll", onExpandAllChange);
56225
56272
  return () => {
56226
- gridApi?.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56273
+ props.api?.removeEventListener("expandOrCollapseAll", onExpandAllChange);
56227
56274
  };
56228
- }, [gridApi]);
56275
+ }, [props.api]);
56229
56276
  React82.useEffect(() => {
56230
56277
  const hasTierOneCollapsedNodes = !!findNode(
56231
56278
  (node) => node.level === 0 && !node.expanded,
@@ -56332,7 +56379,7 @@ var GenericHeaderRenderer = (props) => {
56332
56379
  return;
56333
56380
  }
56334
56381
  function updateSelectAllCheckbox() {
56335
- const currentRows = getCurrentRows(gridApi);
56382
+ const currentRows = getCurrentRows(props.api);
56336
56383
  const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56337
56384
  const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56338
56385
  if (isAllSelected) {
@@ -73341,6 +73388,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73341
73388
  }
73342
73389
  };
73343
73390
  const rowHeightConfig = detailRowConfig.height === "auto" || detailRowConfig.height === void 0 ? { detailRowAutoHeight: true } : { detailRowHeight: detailRowConfig.height };
73391
+ const isRowSelectable = () => deprecatedDetailRowSelectionEnabled ?? false;
73344
73392
  return {
73345
73393
  isRowMaster: detailRowConfig.isExpandable,
73346
73394
  masterDetail: true,
@@ -73349,6 +73397,13 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73349
73397
  return {
73350
73398
  detailGridOptions: {
73351
73399
  alwaysAggregateAtRootLevel: !isServerSideRowModel,
73400
+ autoGroupColumnDef: getDecoratedAutoGroupColDef(
73401
+ detailRowConfig.autoGroupColumnDefinition,
73402
+ enableGroupEditAndValidation,
73403
+ enableDynamicRowHeight,
73404
+ isRowSelectable,
73405
+ false
73406
+ ),
73352
73407
  context: {
73353
73408
  parentId: masterGridParams.node.id.replace("detail_", ""),
73354
73409
  parentData: masterGridParams.node.data
@@ -73362,6 +73417,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73362
73417
  )
73363
73418
  )
73364
73419
  ),
73420
+ isRowSelectable,
73365
73421
  onGridReady: onGridReadyOrValueChange,
73366
73422
  onCellValueChanged: onGridReadyOrValueChange,
73367
73423
  onRowDataChanged: onGridReadyOrValueChange,
@@ -73383,7 +73439,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73383
73439
  rowMultiSelectWithClick: detailRowConfig.rowMultiSelectWithClick,
73384
73440
  suppressRowClickSelection: detailRowConfig.suppressRowClickSelection ?? true,
73385
73441
  ensureDomOrder: true,
73386
- frameworkComponents,
73442
+ components: frameworkComponents,
73387
73443
  icons: tableIcons,
73388
73444
  loadingOverlayComponent: "loadingOverlayRenderer",
73389
73445
  loadingOverlayComponentParams: {
@@ -73395,6 +73451,7 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
73395
73451
  },
73396
73452
  rowDragManaged: true,
73397
73453
  singleClickEdit: true,
73454
+ suppressAggFuncInHeader: true,
73398
73455
  suppressContextMenu: true,
73399
73456
  suppressColumnVirtualisation: true,
73400
73457
  getRowHeight: getRowHeight?.(detailRowConfig.customFooters)
@@ -76777,60 +76834,16 @@ var Table = (props) => {
76777
76834
  },
76778
76835
  [props]
76779
76836
  );
76780
- const addAutoGroupParams = React82.useCallback(
76781
- function addAutoGroupParams2(columnDefinition) {
76782
- return {
76783
- ...columnDefinition,
76784
- cellRendererSelector: (params) => {
76785
- const cellRendererSelector = columnDefinition.cellRendererSelector?.(params);
76786
- let component = cellRendererSelector?.component ?? "autoGroupCellRenderer";
76787
- return {
76788
- component,
76789
- params: {
76790
- ...columnDefinition.cellRendererParams,
76791
- ...cellRendererSelector?.params,
76792
- checkbox(_params) {
76793
- if (_params.node) {
76794
- return isRowSelectable({
76795
- ..._params.node,
76796
- data: _params.node.data ?? _params.node.aggData
76797
- });
76798
- }
76799
- return false;
76800
- },
76801
- siblingGroupsRowSelectionDisabled: props.siblingGroupsRowSelectionDisabled
76802
- }
76803
- };
76804
- }
76805
- };
76806
- },
76807
- [isRowSelectable]
76837
+ const decoratedAutoGroupColDef = React82.useMemo(
76838
+ () => getDecoratedAutoGroupColDef(
76839
+ props?.autoGroupColumnDefinition,
76840
+ internalTableContext.enableGroupEditAndValidation,
76841
+ internalTableContext.enableDynamicRowHeight,
76842
+ isRowSelectable,
76843
+ props.siblingGroupsRowSelectionDisabled
76844
+ ),
76845
+ [props?.autoGroupColumnDefinition]
76808
76846
  );
76809
- const decoratedAutoGroupColDef = React82.useMemo(() => {
76810
- if (props?.autoGroupColumnDefinition) {
76811
- return addAutoGroupParams(
76812
- transformToColDef(
76813
- props?.autoGroupColumnDefinition,
76814
- internalTableContext.enableGroupEditAndValidation,
76815
- internalTableContext.enableDynamicRowHeight
76816
- )
76817
- );
76818
- }
76819
- return addAutoGroupParams({
76820
- headerName: "",
76821
- cellRendererSelector: (params) => {
76822
- if (params?.node.rowPinned) {
76823
- return {
76824
- component: GrandTotalsLabelRenderer
76825
- };
76826
- }
76827
- return {
76828
- component: void 0
76829
- };
76830
- },
76831
- lockPosition: true
76832
- });
76833
- }, [props?.autoGroupColumnDefinition, addAutoGroupParams]);
76834
76847
  const onColumnGroupOpened = React82.useCallback(
76835
76848
  (event) => {
76836
76849
  internalTableContext.analytics?.client.addEvent(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "13.1.1",
3
+ "version": "13.2.1",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "main": "dist/legacy/index.js",
6
6
  "module": "dist/legacy/index.mjs",
@@ -101,7 +101,7 @@
101
101
  "@procore/core-css": "10.17.0",
102
102
  "@procore/core-icons": "12.0.0",
103
103
  "@procore/core-prettier": "10.2.0",
104
- "@procore/core-react": "11.30.0",
104
+ "@procore/core-react": "11.31.0",
105
105
  "@procore/eslint-config": "10.0.0",
106
106
  "@procore/labs-financials-utils": "3.0.1",
107
107
  "@procore/labs-procore-environment": "3.2.0",