@procore/data-table 14.46.1 → 14.46.3

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.
@@ -1389,7 +1389,7 @@ ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
1389
1389
  animation-iteration-count: infinite;
1390
1390
  animation-name: ag-shake-left-to-right;
1391
1391
  }
1392
- @keyframes _ag-shake-left-to-right_1ern5_342 {
1392
+ @keyframes _ag-shake-left-to-right_pphrk_342 {
1393
1393
  from {
1394
1394
  padding-left: 6px;
1395
1395
  padding-right: 2px;
@@ -5390,7 +5390,7 @@ input[class^=ag-][type=button]:focus, button[class^=ag-]:focus {
5390
5390
  animation-iteration-count: infinite;
5391
5391
  animation-timing-function: linear;
5392
5392
  }
5393
- @keyframes _spin_1ern5_1 {
5393
+ @keyframes _spin_pphrk_1 {
5394
5394
  from {
5395
5395
  transform: rotate(0deg);
5396
5396
  }
@@ -7922,7 +7922,7 @@ input[class^=ag-][type=range]:disabled {
7922
7922
  padding-left: 16px;
7923
7923
  }
7924
7924
 
7925
- div._contextPanel_1ern5_7159 {
7925
+ div._contextPanel_pphrk_7159 {
7926
7926
  width: 400px;
7927
7927
  transition: all ease 500ms;
7928
7928
  flex: 0 0 auto;
@@ -7931,7 +7931,12 @@ div._contextPanel_1ern5_7159 {
7931
7931
  border: 1px solid #d6dadc;
7932
7932
  display: flex;
7933
7933
  }
7934
- div._contextPanel--hidden_1ern5_7168 {
7934
+ div._contextPanel_pphrk_7159:focus {
7935
+ border-color: #2066df;
7936
+ box-shadow: inset 0 0 1px 0 #2066df;
7937
+ outline: none;
7938
+ }
7939
+ div._contextPanel--hidden_pphrk_7173 {
7935
7940
  border: none;
7936
7941
  overflow: hidden;
7937
7942
  padding: 0px;
@@ -7939,50 +7944,50 @@ div._contextPanel--hidden_1ern5_7168 {
7939
7944
  width: 0px;
7940
7945
  }
7941
7946
 
7942
- ._contextPanelWrapper_1ern5_7176 {
7947
+ ._contextPanelWrapper_pphrk_7181 {
7943
7948
  position: relative;
7944
7949
  flex-grow: 1;
7945
7950
  }
7946
7951
 
7947
- ._contextPanelBody_1ern5_7181 {
7952
+ ._contextPanelBody_pphrk_7186 {
7948
7953
  width: clamp(380px, 400px, 100%);
7949
7954
  }
7950
7955
 
7951
- ._contextPanel-stickyHeader_1ern5_7185 {
7956
+ ._contextPanel-stickyHeader_pphrk_7190 {
7952
7957
  background-color: #ffffff;
7953
7958
  position: sticky;
7954
7959
  top: 0;
7955
7960
  z-index: 5;
7956
7961
  }
7957
7962
 
7958
- ._filters-list_1ern5_7192 {
7963
+ ._filters-list_pphrk_7197 {
7959
7964
  padding: 0;
7960
7965
  margin: 0;
7961
7966
  }
7962
- ._filters-list_1ern5_7192 ol {
7967
+ ._filters-list_pphrk_7197 ol {
7963
7968
  padding: 0;
7964
7969
  margin: 0;
7965
7970
  }
7966
7971
 
7967
- ._col-drag-column-icon_1ern5_7201 {
7972
+ ._col-drag-column-icon_pphrk_7206 {
7968
7973
  color: #6a767c;
7969
7974
  }
7970
7975
 
7971
- ._tabular-nums_1ern5_7205 {
7976
+ ._tabular-nums_pphrk_7210 {
7972
7977
  font-variant-numeric: tabular-nums;
7973
7978
  }`;
7974
7979
  document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
7975
7980
  var styles_default = {
7976
- "contextPanel": "_contextPanel_1ern5_7159",
7977
- "contextPanel--hidden": "_contextPanel--hidden_1ern5_7168",
7978
- "contextPanelWrapper": "_contextPanelWrapper_1ern5_7176",
7979
- "contextPanelBody": "_contextPanelBody_1ern5_7181",
7980
- "contextPanel-stickyHeader": "_contextPanel-stickyHeader_1ern5_7185",
7981
- "filters-list": "_filters-list_1ern5_7192",
7982
- "col-drag-column-icon": "_col-drag-column-icon_1ern5_7201",
7983
- "tabular-nums": "_tabular-nums_1ern5_7205",
7984
- "ag-shake-left-to-right": "_ag-shake-left-to-right_1ern5_342",
7985
- "spin": "_spin_1ern5_1"
7981
+ "contextPanel": "_contextPanel_pphrk_7159",
7982
+ "contextPanel--hidden": "_contextPanel--hidden_pphrk_7173",
7983
+ "contextPanelWrapper": "_contextPanelWrapper_pphrk_7181",
7984
+ "contextPanelBody": "_contextPanelBody_pphrk_7186",
7985
+ "contextPanel-stickyHeader": "_contextPanel-stickyHeader_pphrk_7190",
7986
+ "filters-list": "_filters-list_pphrk_7197",
7987
+ "col-drag-column-icon": "_col-drag-column-icon_pphrk_7206",
7988
+ "tabular-nums": "_tabular-nums_pphrk_7210",
7989
+ "ag-shake-left-to-right": "_ag-shake-left-to-right_pphrk_342",
7990
+ "spin": "_spin_pphrk_1"
7986
7991
  };
7987
7992
 
7988
7993
  // src/CellRenderers/BooleanCell.tsx
@@ -54325,7 +54330,7 @@ function ServerSideNumberFilterRenderer({
54325
54330
  },
54326
54331
  {
54327
54332
  id: "isEqual",
54328
- label: I18n.t("options.isEqual", {
54333
+ label: I18n.t("options.is_equal_to", {
54329
54334
  defaultValue: "Is Equal To",
54330
54335
  scope: "dataTable.filters.numberFilter"
54331
54336
  })
@@ -54823,26 +54828,19 @@ function serializeNode(node) {
54823
54828
  rowPinned: node.rowPinned
54824
54829
  };
54825
54830
  }
54826
- function transformToColDef(colDefinition, enableGroupEditAndValidation, enableDynamicRowHeight) {
54831
+ function transformToColDef(colDefinition, tableOptions) {
54827
54832
  if (isNestedColumnDefinition(colDefinition)) {
54828
54833
  return {
54829
54834
  ...colDefinition,
54830
54835
  children: colDefinition.children.map(
54831
- (childColDefinition) => transformColumnDefinitionToColDef(
54832
- childColDefinition,
54833
- enableGroupEditAndValidation,
54834
- enableDynamicRowHeight
54835
- )
54836
+ (childColDefinition) => transformColumnDefinitionToColDef(childColDefinition, tableOptions)
54836
54837
  )
54837
54838
  };
54838
54839
  }
54839
- return transformColumnDefinitionToColDef(
54840
- colDefinition,
54841
- enableGroupEditAndValidation,
54842
- enableDynamicRowHeight
54843
- );
54840
+ return transformColumnDefinitionToColDef(colDefinition, tableOptions);
54844
54841
  }
54845
- function transformColumnDefinitionToColDef(dataTableColumnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight) {
54842
+ function transformColumnDefinitionToColDef(dataTableColumnDefinition, tableOptions) {
54843
+ const { enableGroupEditAndValidation, enableDynamicRowHeight } = tableOptions;
54846
54844
  const {
54847
54845
  aggFunc,
54848
54846
  bulkEditable,
@@ -54885,7 +54883,8 @@ function transformColumnDefinitionToColDef(dataTableColumnDefinition, enableGrou
54885
54883
  };
54886
54884
  const cellClassRules = {
54887
54885
  "invalid-cell": function isValid(params) {
54888
- const shouldValidate = !params.node.group && params.data && !params.data.isAggData || enableGroupEditAndValidation && (params.node.footer || params.node.group && !params.node.expanded);
54886
+ const shouldValidateGroupHeader = tableOptions.enableGroupHeaderEdit && params.node.group;
54887
+ const shouldValidate = !params.node.group && params.data && !params.data.isAggData || enableGroupEditAndValidation && (params.node.footer || params.node.group && !params.node.expanded) || shouldValidateGroupHeader;
54889
54888
  return (shouldValidate && valueValidator && !valueValidator({
54890
54889
  columnDefinition: transformToColumnDefinition(params.colDef),
54891
54890
  data: params.data,
@@ -55228,12 +55227,8 @@ function addAutoGroupParams(columnDefinition, isRowSelectable, siblingGroupsRowS
55228
55227
  }
55229
55228
  };
55230
55229
  }
55231
- function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidation, enableDynamicRowHeight, isRowSelectable, siblingGroupsRowSelectionDisabled, groupsAlwaysExpanded, isDetailTable) {
55232
- const colDef = columnDefinition ? transformToColDef(
55233
- columnDefinition,
55234
- enableGroupEditAndValidation,
55235
- enableDynamicRowHeight
55236
- ) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55230
+ function getDecoratedAutoGroupColDef(columnDefinition, tableOptions, isRowSelectable, siblingGroupsRowSelectionDisabled, groupsAlwaysExpanded, isDetailTable) {
55231
+ const colDef = columnDefinition ? transformToColDef(columnDefinition, tableOptions) : DEFAULT_AUTO_GROUP_COLUMN_DEFINITION;
55237
55232
  return addAutoGroupParams(
55238
55233
  colDef,
55239
55234
  isRowSelectable,
@@ -55244,12 +55239,12 @@ function getDecoratedAutoGroupColDef(columnDefinition, enableGroupEditAndValidat
55244
55239
  }
55245
55240
 
55246
55241
  // src/CellRenderers/AutoGroupCell.scss
55247
- var css5 = `._autoGroupCell_1qx8z_1 {
55242
+ var css5 = `._autoGroupCell_1h6pf_1 {
55248
55243
  height: 100%;
55249
55244
  width: 100%;
55250
55245
  }
55251
55246
 
55252
- ._indent_1qx8z_6 {
55247
+ ._indent_1h6pf_6 {
55253
55248
  border-right: 1px solid #d6dadc;
55254
55249
  background: #f4f5f6;
55255
55250
  position: absolute;
@@ -55257,45 +55252,69 @@ var css5 = `._autoGroupCell_1qx8z_1 {
55257
55252
  bottom: -1px;
55258
55253
  width: 12px;
55259
55254
  }
55260
- ._indent_1qx8z_6._innermostLastIndent_1qx8z_14 {
55255
+ ._indent_1h6pf_6._innermostLastIndent_1h6pf_14 {
55261
55256
  bottom: 0px;
55262
55257
  }
55263
55258
 
55264
- ._expandableCaret_1qx8z_18 {
55259
+ ._expandableCaret_1h6pf_18 {
55265
55260
  margin-left: -8px;
55266
55261
  margin-right: 4px;
55267
55262
  width: 24px;
55268
55263
  flex-shrink: 0;
55269
55264
  }
55270
55265
 
55271
- ._expandCaret_1qx8z_25 {
55266
+ ._expandableCaretButton_1h6pf_25 {
55267
+ display: inline-flex;
55268
+ align-items: center;
55269
+ justify-content: center;
55270
+ width: 24px;
55271
+ height: 24px;
55272
+ padding: 0;
55273
+ margin-left: -8px;
55274
+ margin-right: 4px;
55275
+ border: none;
55276
+ border-radius: 2px;
55277
+ background: transparent;
55278
+ cursor: pointer;
55279
+ flex-shrink: 0;
55280
+ }
55281
+ ._expandableCaretButton_1h6pf_25:focus-visible {
55282
+ outline: 2px solid #2066df;
55283
+ outline-offset: 1px;
55284
+ }
55285
+ ._expandableCaretButton_1h6pf_25:hover {
55286
+ background-color: rgba(0, 0, 0, 0.06);
55287
+ }
55288
+
55289
+ ._expandCaret_1h6pf_48 {
55272
55290
  color: #2066df;
55273
55291
  cursor: pointer;
55274
55292
  }
55275
55293
 
55276
- ._collapseCaret_1qx8z_30 {
55294
+ ._collapseCaret_1h6pf_53 {
55277
55295
  color: #75838a;
55278
55296
  cursor: pointer;
55279
55297
  }
55280
55298
 
55281
- ._value_1qx8z_35 {
55299
+ ._value_1h6pf_58 {
55282
55300
  overflow: hidden;
55283
55301
  text-overflow: ellipsis;
55284
55302
  font-size: 12px;
55285
55303
  }
55286
- ._value_1qx8z_35._footer_1qx8z_40 {
55304
+ ._value_1h6pf_58._footer_1h6pf_63 {
55287
55305
  color: #6a767c;
55288
55306
  }`;
55289
55307
  document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css5));
55290
55308
  var AutoGroupCell_default = {
55291
- "autoGroupCell": "_autoGroupCell_1qx8z_1",
55292
- "indent": "_indent_1qx8z_6",
55293
- "innermostLastIndent": "_innermostLastIndent_1qx8z_14",
55294
- "expandableCaret": "_expandableCaret_1qx8z_18",
55295
- "expandCaret": "_expandCaret_1qx8z_25",
55296
- "collapseCaret": "_collapseCaret_1qx8z_30",
55297
- "value": "_value_1qx8z_35",
55298
- "footer": "_footer_1qx8z_40"
55309
+ "autoGroupCell": "_autoGroupCell_1h6pf_1",
55310
+ "indent": "_indent_1h6pf_6",
55311
+ "innermostLastIndent": "_innermostLastIndent_1h6pf_14",
55312
+ "expandableCaret": "_expandableCaret_1h6pf_18",
55313
+ "expandableCaretButton": "_expandableCaretButton_1h6pf_25",
55314
+ "expandCaret": "_expandCaret_1h6pf_48",
55315
+ "collapseCaret": "_collapseCaret_1h6pf_53",
55316
+ "value": "_value_1h6pf_58",
55317
+ "footer": "_footer_1h6pf_63"
55299
55318
  };
55300
55319
 
55301
55320
  // src/utils/rowSelectionHelpers.ts
@@ -55560,6 +55579,7 @@ var LevelIndents = (props) => {
55560
55579
  };
55561
55580
  function GroupCaret(props) {
55562
55581
  const mounted = React80.useRef(false);
55582
+ const buttonRef = React80.useRef(null);
55563
55583
  const [expanded, setExpanded] = useState(props.node.expanded);
55564
55584
  const ExpandableCaret = expanded ? CaretDown : CaretRight;
55565
55585
  const I18n = useI18nContext();
@@ -55570,6 +55590,16 @@ function GroupCaret(props) {
55570
55590
  }, 0);
55571
55591
  }
55572
55592
  }
55593
+ const handleToggle = () => {
55594
+ props.api.setRowNodeExpanded(props.node, !expanded);
55595
+ };
55596
+ const handleKeyDown = (event) => {
55597
+ if (event.key === "Enter" || event.key === " ") {
55598
+ event.preventDefault();
55599
+ event.stopPropagation();
55600
+ handleToggle();
55601
+ }
55602
+ };
55573
55603
  useEffect(() => {
55574
55604
  mounted.current = true;
55575
55605
  props.api.addEventListener("rowGroupOpened", handleRowGroupToggle);
@@ -55582,20 +55612,47 @@ function GroupCaret(props) {
55582
55612
  );
55583
55613
  };
55584
55614
  }, []);
55615
+ useEffect(() => {
55616
+ var _a;
55617
+ if (!props.node.isExpandable()) return;
55618
+ const cell2 = (_a = buttonRef.current) == null ? void 0 : _a.closest(".ag-cell");
55619
+ if (!cell2) return;
55620
+ const handleCellKeyDown = (event) => {
55621
+ var _a2;
55622
+ if (event.key !== "Enter" && event.key !== " ") return;
55623
+ if (!event.isTrusted) return;
55624
+ const target = event.target;
55625
+ if (target.closest("button") || target.closest("input")) return;
55626
+ event.preventDefault();
55627
+ event.stopImmediatePropagation();
55628
+ (_a2 = buttonRef.current) == null ? void 0 : _a2.click();
55629
+ };
55630
+ cell2.addEventListener("keydown", handleCellKeyDown, { capture: true });
55631
+ return () => {
55632
+ cell2.removeEventListener("keydown", handleCellKeyDown, { capture: true });
55633
+ };
55634
+ }, []);
55635
+ if (!props.node.isExpandable()) {
55636
+ return /* @__PURE__ */ React80.createElement("div", { className: AutoGroupCell_default.expandableCaret });
55637
+ }
55585
55638
  return /* @__PURE__ */ React80.createElement(
55586
- Box,
55639
+ "button",
55587
55640
  {
55641
+ type: "button",
55642
+ ref: buttonRef,
55643
+ "aria-expanded": expanded,
55588
55644
  "aria-label": I18n.t(
55589
55645
  `dataTable.groupCell.${expanded ? "collapse" : "expand"}`
55590
55646
  ),
55591
- className: AutoGroupCell_default.expandableCaret,
55592
- role: "button"
55647
+ className: AutoGroupCell_default.expandableCaretButton,
55648
+ onClick: handleToggle,
55649
+ onKeyDown: handleKeyDown,
55650
+ "data-qa": "group-expand-collapse"
55593
55651
  },
55594
- props.node.isExpandable() && /* @__PURE__ */ React80.createElement(
55652
+ /* @__PURE__ */ React80.createElement(
55595
55653
  ExpandableCaret,
55596
55654
  {
55597
- className: expanded ? AutoGroupCell_default.collapseCaret : AutoGroupCell_default.expandCaret,
55598
- onClick: () => props.api.setRowNodeExpanded(props.node, !expanded)
55655
+ className: expanded ? AutoGroupCell_default.collapseCaret : AutoGroupCell_default.expandCaret
55599
55656
  }
55600
55657
  )
55601
55658
  );
@@ -56465,10 +56522,15 @@ var css7 = `.data-table-container .ag-header-cell .data-table-header-menu {
56465
56522
  align-items: center;
56466
56523
  justify-content: center;
56467
56524
  background-color: #e3e6e8;
56525
+ border: none;
56468
56526
  border-radius: 2px;
56469
56527
  cursor: pointer;
56470
56528
  margin-right: 8px;
56471
56529
  }
56530
+ .data-table-container .ag-header-cell .expand-button:focus-visible {
56531
+ outline: 2px solid #2066df;
56532
+ outline-offset: 1px;
56533
+ }
56472
56534
  .data-table-container .ag-header-group-cell-with-group .ag-header-cell-comp-wrapper {
56473
56535
  width: 100%;
56474
56536
  overflow: hidden;
@@ -56481,10 +56543,15 @@ var css7 = `.data-table-container .ag-header-cell .data-table-header-menu {
56481
56543
  align-items: center;
56482
56544
  justify-content: center;
56483
56545
  background-color: #e3e6e8;
56546
+ border: none;
56484
56547
  border-radius: 2px;
56485
56548
  cursor: pointer;
56486
56549
  margin-left: auto;
56487
56550
  }
56551
+ .data-table-container .ag-header-group-cell-with-group .expand-button:focus-visible {
56552
+ outline: 2px solid #2066df;
56553
+ outline-offset: 1px;
56554
+ }
56488
56555
  .data-table-container .auto-column-expand-tooltip-content {
56489
56556
  width: 96px;
56490
56557
  }
@@ -56634,6 +56701,7 @@ var GenericHeaderRenderer = (props) => {
56634
56701
  I18n
56635
56702
  );
56636
56703
  const headerCellRef = useRef(null);
56704
+ const expandButtonRef = useRef(null);
56637
56705
  const menuButtonRef = useRef(null);
56638
56706
  const headerCheckboxSelection = colDef.headerCheckboxSelection;
56639
56707
  const headerCheckboxSelectionEnabled = typeof headerCheckboxSelection === "function" ? headerCheckboxSelection({
@@ -56786,6 +56854,30 @@ var GenericHeaderRenderer = (props) => {
56786
56854
  );
56787
56855
  }
56788
56856
  React80.useEffect(updateExpandedState);
56857
+ React80.useEffect(() => {
56858
+ var _a2;
56859
+ if (!isExpandable) return;
56860
+ const headerCell = (_a2 = headerCellRef.current) == null ? void 0 : _a2.closest(".ag-header-cell");
56861
+ if (!headerCell) return;
56862
+ const handleExpandKeyDown = (event) => {
56863
+ var _a3;
56864
+ if (event.key !== "Enter" && event.key !== " ") return;
56865
+ if (!event.isTrusted) return;
56866
+ const target = event.target;
56867
+ if (target.closest("button") || target.closest("input")) return;
56868
+ event.preventDefault();
56869
+ event.stopImmediatePropagation();
56870
+ (_a3 = expandButtonRef.current) == null ? void 0 : _a3.click();
56871
+ };
56872
+ headerCell.addEventListener("keydown", handleExpandKeyDown, {
56873
+ capture: true
56874
+ });
56875
+ return () => {
56876
+ headerCell.removeEventListener("keydown", handleExpandKeyDown, {
56877
+ capture: true
56878
+ });
56879
+ };
56880
+ }, [isExpandable]);
56789
56881
  const [expansionVariant, setExpansionVariant] = React80.useState("closed");
56790
56882
  React80.useEffect(() => {
56791
56883
  var _a2;
@@ -57070,12 +57162,21 @@ var GenericHeaderRenderer = (props) => {
57070
57162
  overlay: /* @__PURE__ */ React80.createElement(Tooltip.Content, { className: "auto-column-expand-tooltip-content" }, tooltipText[expansionVariant])
57071
57163
  },
57072
57164
  /* @__PURE__ */ React80.createElement(
57073
- "div",
57165
+ "button",
57074
57166
  {
57167
+ type: "button",
57168
+ ref: expandButtonRef,
57169
+ "aria-expanded": expansionVariant !== "closed",
57075
57170
  "aria-label": tooltipText[expansionVariant],
57076
57171
  className: "expand-button",
57077
57172
  onClick: onExpandToggle,
57078
- role: "button",
57173
+ onKeyDown: (e) => {
57174
+ if (e.key === "Enter" || e.key === " ") {
57175
+ e.preventDefault();
57176
+ e.stopPropagation();
57177
+ onExpandToggle(e);
57178
+ }
57179
+ },
57079
57180
  "data-qa": "expand-or-collapse-all-button"
57080
57181
  },
57081
57182
  /* @__PURE__ */ React80.createElement(ExpansionVariantIcon, { size: "sm" })
@@ -57916,6 +58017,7 @@ var InternalTableContext = React80.createContext({
57916
58017
  hide: () => {
57917
58018
  },
57918
58019
  isVisible: false,
58020
+ panelRef: React80.createRef(),
57919
58021
  show: () => {
57920
58022
  }
57921
58023
  },
@@ -59720,14 +59822,16 @@ var useRowSelectionState = () => {
59720
59822
  var BulkEditActionButton = (props) => {
59721
59823
  const { contextPanel } = useInternalTableContext();
59722
59824
  const i18n = useI18nContext();
59825
+ const buttonRef = React80.useRef(null);
59723
59826
  const editActionLabel = props.actionText ?? i18n.t("dataTable.bulkActions.editValues");
59724
59827
  return /* @__PURE__ */ React80.createElement(
59725
59828
  Button,
59726
59829
  {
59830
+ ref: buttonRef,
59727
59831
  "aria-label": i18n.t("dataTable.bulkActions.bulkEdit"),
59728
59832
  "data-qa": "bulkEditIcon",
59729
59833
  icon: /* @__PURE__ */ React80.createElement(Pencil, null),
59730
- onClick: () => contextPanel.show("bulkEdit"),
59834
+ onClick: () => contextPanel.show("bulkEdit", buttonRef.current ?? void 0),
59731
59835
  variant: "tertiary"
59732
59836
  },
59733
59837
  props.showLabel && editActionLabel
@@ -104372,11 +104476,6 @@ var BulkEditPanel = ({}) => {
104372
104476
  const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
104373
104477
  const I18n = useI18nContext();
104374
104478
  const bulkEditRef = React80.useRef(null);
104375
- const bodyRef = React80.useRef(null);
104376
- useEffect(() => {
104377
- var _a;
104378
- (_a = bodyRef.current) == null ? void 0 : _a.focus();
104379
- }, []);
104380
104479
  return /* @__PURE__ */ React80.createElement(Panel, null, /* @__PURE__ */ React80.createElement(
104381
104480
  Panel.Header,
104382
104481
  {
@@ -104387,7 +104486,7 @@ var BulkEditPanel = ({}) => {
104387
104486
  }
104388
104487
  },
104389
104488
  /* @__PURE__ */ React80.createElement(Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
104390
- ), /* @__PURE__ */ React80.createElement(Panel.Body, { ref: bodyRef }, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
104489
+ ), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
104391
104490
  BulkEdit,
104392
104491
  {
104393
104492
  ref: bulkEditRef,
@@ -104671,11 +104770,10 @@ var ConfigurationColumns = React80.forwardRef(
104671
104770
  return columnDefs;
104672
104771
  }
104673
104772
  const columnDefinitionsMappedToDefs = columnDefinitions.map(
104674
- (colDef) => transformToColDef(
104675
- colDef,
104773
+ (colDef) => transformToColDef(colDef, {
104676
104774
  enableGroupEditAndValidation,
104677
104775
  enableDynamicRowHeight
104678
- )
104776
+ })
104679
104777
  );
104680
104778
  return toGroupedCols(columnDefinitionsMappedToDefs);
104681
104779
  });
@@ -104834,18 +104932,34 @@ var ConfigurationPanel = ({
104834
104932
  function useContextPanel() {
104835
104933
  const [content, setContent] = useState();
104836
104934
  const visibility = useVisibility({ afterHide: () => setContent(void 0) });
104837
- const show = useCallback((panelContent) => {
104838
- setContent(panelContent);
104839
- visibility.show();
104840
- }, []);
104935
+ const triggerRef = useRef(null);
104936
+ const panelRef = useRef(null);
104937
+ const show = useCallback(
104938
+ (panelContent, trigger) => {
104939
+ triggerRef.current = trigger ?? null;
104940
+ setContent(panelContent);
104941
+ visibility.show();
104942
+ },
104943
+ []
104944
+ );
104841
104945
  const hide = useCallback(() => {
104946
+ const trigger = triggerRef.current;
104842
104947
  setContent(void 0);
104843
104948
  visibility.hide();
104949
+ trigger == null ? void 0 : trigger.focus();
104950
+ triggerRef.current = null;
104844
104951
  }, []);
104952
+ useEffect(() => {
104953
+ var _a;
104954
+ if (content) {
104955
+ (_a = panelRef.current) == null ? void 0 : _a.focus();
104956
+ }
104957
+ }, [content]);
104845
104958
  return {
104846
104959
  content,
104847
104960
  hide,
104848
104961
  isVisible: visibility.isVisible,
104962
+ panelRef,
104849
104963
  show
104850
104964
  };
104851
104965
  }
@@ -104983,8 +105097,10 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104983
105097
  alwaysAggregateAtRootLevel: !isServerSideRowModel,
104984
105098
  autoGroupColumnDef: getDecoratedAutoGroupColDef(
104985
105099
  detailRowConfig.autoGroupColumnDefinition,
104986
- enableGroupEditAndValidation,
104987
- enableDynamicRowHeight,
105100
+ {
105101
+ enableGroupEditAndValidation,
105102
+ enableDynamicRowHeight
105103
+ },
104988
105104
  isRowSelectable,
104989
105105
  false,
104990
105106
  detailRowConfig.groupsAlwaysExpanded ?? false,
@@ -104996,11 +105112,10 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
104996
105112
  },
104997
105113
  columnDefs: toGroupedCols(
104998
105114
  detailRowConfig.columnDefinitions.map(
104999
- (colDef) => transformToColDef(
105000
- colDef,
105115
+ (colDef) => transformToColDef(colDef, {
105001
105116
  enableGroupEditAndValidation,
105002
- colDef.autoHeight ?? enableDynamicRowHeight
105003
- )
105117
+ enableDynamicRowHeight: colDef.autoHeight ?? enableDynamicRowHeight
105118
+ })
105004
105119
  )
105005
105120
  ),
105006
105121
  groupsAlwaysExpanded: detailRowConfig.groupsAlwaysExpanded ?? false,
@@ -110155,11 +110270,16 @@ function getServerSideDatasource(onServerSideDataRequestCallbackRef, onEmptyResp
110155
110270
  };
110156
110271
  }
110157
110272
  var minimumColumnWidth = 140;
110273
+ function resolveGroupIncludeFooter(props, onSSDR) {
110274
+ if (props.enableGroupHeaderEdit) return false;
110275
+ if (!onSSDR && props.groupIncludeFooter === void 0) return true;
110276
+ return props.groupIncludeFooter;
110277
+ }
110158
110278
  function useComputeAgGridProps(props) {
110159
110279
  const internalTableContext = useInternalTableContext();
110160
110280
  const onSSDR = internalTableContext.onServerSideDataRequest;
110161
110281
  return {
110162
- groupIncludeFooter: !onSSDR && props.groupIncludeFooter === void 0 ? true : props.groupIncludeFooter,
110282
+ groupIncludeFooter: resolveGroupIncludeFooter(props, !!onSSDR),
110163
110283
  rowDragManaged: onSSDR ? false : props.rowDragManaged ?? true,
110164
110284
  rowModelType: onSSDR ? "serverSide" : void 0,
110165
110285
  groupSelectsChildren: (
@@ -110235,11 +110355,11 @@ var Table = (props) => {
110235
110355
  () => {
110236
110356
  var _a2;
110237
110357
  return (_a2 = internalTableContext.columnDefinitions) == null ? void 0 : _a2.map((colDef) => {
110238
- const newColDef = transformToColDef(
110239
- colDef,
110240
- internalTableContext.enableGroupEditAndValidation,
110241
- internalTableContext.enableDynamicRowHeight
110242
- );
110358
+ const newColDef = transformToColDef(colDef, {
110359
+ enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
110360
+ enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight,
110361
+ enableGroupHeaderEdit: props.enableGroupHeaderEdit
110362
+ });
110243
110363
  return {
110244
110364
  ...newColDef,
110245
110365
  editable: overrideEditable(colDef.editable)
@@ -110541,8 +110661,10 @@ var Table = (props) => {
110541
110661
  const decoratedAutoGroupColDef = React80.useMemo(
110542
110662
  () => getDecoratedAutoGroupColDef(
110543
110663
  props == null ? void 0 : props.autoGroupColumnDefinition,
110544
- internalTableContext.enableGroupEditAndValidation,
110545
- internalTableContext.enableDynamicRowHeight,
110664
+ {
110665
+ enableGroupEditAndValidation: internalTableContext.enableGroupEditAndValidation,
110666
+ enableDynamicRowHeight: internalTableContext.enableDynamicRowHeight
110667
+ },
110546
110668
  isRowSelectable,
110547
110669
  props.siblingGroupsRowSelectionDisabled,
110548
110670
  props.groupsAlwaysExpanded ?? false,
@@ -111157,9 +111279,26 @@ var ContextPanel = ({
111157
111279
  ...props
111158
111280
  }) => {
111159
111281
  const { contextPanel } = useInternalTableContext();
111282
+ const I18n = useI18nContext();
111283
+ const cardRef = React80.useRef(null);
111284
+ const panelLabelKeys = {
111285
+ configuration: "dataTable.tableSettings.tableSettings",
111286
+ bulkEdit: "dataTable.bulkActions.editValues"
111287
+ };
111288
+ const panelLabel = contextPanel.content ? panelLabelKeys[contextPanel.content] : void 0;
111289
+ const ariaLabel = panelLabel ? I18n.t(panelLabel) : void 0;
111290
+ React80.useLayoutEffect(() => {
111291
+ if (contextPanel.content && contextPanel.content !== "filters") {
111292
+ contextPanel.panelRef.current = cardRef.current;
111293
+ }
111294
+ }, [contextPanel.content, contextPanel.panelRef]);
111160
111295
  return /* @__PURE__ */ React80.createElement(
111161
111296
  Card,
111162
111297
  {
111298
+ ref: cardRef,
111299
+ tabIndex: -1,
111300
+ role: "region",
111301
+ "aria-label": ariaLabel,
111163
111302
  className: cx19("contextPanel", className, {
111164
111303
  "contextPanel--hidden": !contextPanel.isVisible || contextPanel.content === "filters"
111165
111304
  }),
@@ -111432,19 +111571,27 @@ var BaseFiltersPanel = ({
111432
111571
  onClearAllFilters = noop5,
111433
111572
  ...props
111434
111573
  }) => {
111435
- const ref = React80.useRef(null);
111574
+ const cardRef = React80.useRef(null);
111436
111575
  const { contextPanel, filtersBodyId, filtersPanelId } = useInternalTableContext();
111437
111576
  const I18n = useI18nContext();
111438
111577
  const hidden = !contextPanel.isVisible || contextPanel.content !== "filters";
111439
111578
  React80.useLayoutEffect(() => {
111440
- if (ref.current) {
111441
- ref.current.inert = hidden;
111579
+ if (contextPanel.content === "filters") {
111580
+ contextPanel.panelRef.current = cardRef.current;
111581
+ }
111582
+ }, [contextPanel.content, contextPanel.panelRef]);
111583
+ React80.useLayoutEffect(() => {
111584
+ if (cardRef.current) {
111585
+ cardRef.current.inert = hidden;
111442
111586
  }
111443
111587
  }, [hidden]);
111444
111588
  return /* @__PURE__ */ React80.createElement(
111445
111589
  Card,
111446
111590
  {
111447
- ref,
111591
+ ref: cardRef,
111592
+ tabIndex: -1,
111593
+ role: "region",
111594
+ "aria-label": I18n.t("dataTable.filters.filters"),
111448
111595
  style: { maxHeight: "100vh" },
111449
111596
  className: cx20("contextPanel", className, {
111450
111597
  "contextPanel--hidden": hidden
@@ -111499,6 +111646,7 @@ var ConfigPanelButton = () => {
111499
111646
  const { contextPanel } = useInternalTableContext();
111500
111647
  const hasNoContent = useTableHasNoContent();
111501
111648
  const I18n = useI18nContext();
111649
+ const buttonRef = React80.useRef(null);
111502
111650
  return /* @__PURE__ */ React80.createElement(
111503
111651
  EmptyResultsControlTooltip,
111504
111652
  {
@@ -111508,12 +111656,13 @@ var ConfigPanelButton = () => {
111508
111656
  /* @__PURE__ */ React80.createElement(
111509
111657
  ToggleButton,
111510
111658
  {
111659
+ ref: buttonRef,
111511
111660
  disabled: hasNoContent,
111512
111661
  onClick: () => {
111513
111662
  if (contextPanel.content === "configuration") {
111514
111663
  contextPanel.hide();
111515
111664
  } else {
111516
- contextPanel.show("configuration");
111665
+ contextPanel.show("configuration", buttonRef.current ?? void 0);
111517
111666
  }
111518
111667
  },
111519
111668
  icon: /* @__PURE__ */ React80.createElement(
@@ -112690,27 +112839,12 @@ var SingleSelectQuickFilterRenderer = (props) => {
112690
112839
  return /* @__PURE__ */ React80.createElement(ClientSideSingleSelectQuickFilter, { ...props });
112691
112840
  };
112692
112841
  var SingleSelectQuickFilterRenderer_default = SingleSelectQuickFilterRenderer;
112693
- var FOCUSABLE_SELECTOR2 = 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
112694
112842
  var FiltersPanelToggleButton = ({ hasDefinedFilters }) => {
112695
112843
  const I18n = useI18nContext();
112696
- const { contextPanel, filtersBodyId, filtersPanelId } = useInternalTableContext();
112844
+ const { contextPanel, filtersPanelId } = useInternalTableContext();
112697
112845
  const hasNoContent = useTableHasNoContent();
112698
112846
  const buttonRef = React80.useRef(null);
112699
112847
  const isFiltersOpen = contextPanel.content === "filters";
112700
- const isMounted = React80.useRef(false);
112701
- React80.useEffect(() => {
112702
- var _a, _b;
112703
- if (!isMounted.current) {
112704
- isMounted.current = true;
112705
- return;
112706
- }
112707
- if (isFiltersOpen) {
112708
- const panel = filtersBodyId ? document.getElementById(filtersBodyId) : null;
112709
- (_a = panel == null ? void 0 : panel.querySelector(FOCUSABLE_SELECTOR2)) == null ? void 0 : _a.focus();
112710
- } else {
112711
- (_b = buttonRef.current) == null ? void 0 : _b.focus();
112712
- }
112713
- }, [isFiltersOpen, filtersBodyId]);
112714
112848
  if (!hasDefinedFilters) {
112715
112849
  return null;
112716
112850
  }
@@ -112731,7 +112865,7 @@ var FiltersPanelToggleButton = ({ hasDefinedFilters }) => {
112731
112865
  "aria-controls": filtersPanelId,
112732
112866
  onClick: () => {
112733
112867
  if (!isFiltersOpen) {
112734
- contextPanel.show("filters");
112868
+ contextPanel.show("filters", buttonRef.current ?? void 0);
112735
112869
  } else {
112736
112870
  contextPanel.hide();
112737
112871
  }