@procore/data-table 14.46.2 → 14.46.4

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.
@@ -1387,7 +1387,7 @@ ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
1387
1387
  animation-iteration-count: infinite;
1388
1388
  animation-name: ag-shake-left-to-right;
1389
1389
  }
1390
- @keyframes _ag-shake-left-to-right_1ern5_342 {
1390
+ @keyframes _ag-shake-left-to-right_pphrk_342 {
1391
1391
  from {
1392
1392
  padding-left: 6px;
1393
1393
  padding-right: 2px;
@@ -5388,7 +5388,7 @@ input[class^=ag-][type=button]:focus, button[class^=ag-]:focus {
5388
5388
  animation-iteration-count: infinite;
5389
5389
  animation-timing-function: linear;
5390
5390
  }
5391
- @keyframes _spin_1ern5_1 {
5391
+ @keyframes _spin_pphrk_1 {
5392
5392
  from {
5393
5393
  transform: rotate(0deg);
5394
5394
  }
@@ -7920,7 +7920,7 @@ input[class^=ag-][type=range]:disabled {
7920
7920
  padding-left: 16px;
7921
7921
  }
7922
7922
 
7923
- div._contextPanel_1ern5_7159 {
7923
+ div._contextPanel_pphrk_7159 {
7924
7924
  width: 400px;
7925
7925
  transition: all ease 500ms;
7926
7926
  flex: 0 0 auto;
@@ -7929,7 +7929,12 @@ div._contextPanel_1ern5_7159 {
7929
7929
  border: 1px solid #d6dadc;
7930
7930
  display: flex;
7931
7931
  }
7932
- div._contextPanel--hidden_1ern5_7168 {
7932
+ div._contextPanel_pphrk_7159:focus {
7933
+ border-color: #2066df;
7934
+ box-shadow: inset 0 0 1px 0 #2066df;
7935
+ outline: none;
7936
+ }
7937
+ div._contextPanel--hidden_pphrk_7173 {
7933
7938
  border: none;
7934
7939
  overflow: hidden;
7935
7940
  padding: 0px;
@@ -7937,50 +7942,50 @@ div._contextPanel--hidden_1ern5_7168 {
7937
7942
  width: 0px;
7938
7943
  }
7939
7944
 
7940
- ._contextPanelWrapper_1ern5_7176 {
7945
+ ._contextPanelWrapper_pphrk_7181 {
7941
7946
  position: relative;
7942
7947
  flex-grow: 1;
7943
7948
  }
7944
7949
 
7945
- ._contextPanelBody_1ern5_7181 {
7950
+ ._contextPanelBody_pphrk_7186 {
7946
7951
  width: clamp(380px, 400px, 100%);
7947
7952
  }
7948
7953
 
7949
- ._contextPanel-stickyHeader_1ern5_7185 {
7954
+ ._contextPanel-stickyHeader_pphrk_7190 {
7950
7955
  background-color: #ffffff;
7951
7956
  position: sticky;
7952
7957
  top: 0;
7953
7958
  z-index: 5;
7954
7959
  }
7955
7960
 
7956
- ._filters-list_1ern5_7192 {
7961
+ ._filters-list_pphrk_7197 {
7957
7962
  padding: 0;
7958
7963
  margin: 0;
7959
7964
  }
7960
- ._filters-list_1ern5_7192 ol {
7965
+ ._filters-list_pphrk_7197 ol {
7961
7966
  padding: 0;
7962
7967
  margin: 0;
7963
7968
  }
7964
7969
 
7965
- ._col-drag-column-icon_1ern5_7201 {
7970
+ ._col-drag-column-icon_pphrk_7206 {
7966
7971
  color: #6a767c;
7967
7972
  }
7968
7973
 
7969
- ._tabular-nums_1ern5_7205 {
7974
+ ._tabular-nums_pphrk_7210 {
7970
7975
  font-variant-numeric: tabular-nums;
7971
7976
  }`;
7972
7977
  document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
7973
7978
  var styles_default = {
7974
- "contextPanel": "_contextPanel_1ern5_7159",
7975
- "contextPanel--hidden": "_contextPanel--hidden_1ern5_7168",
7976
- "contextPanelWrapper": "_contextPanelWrapper_1ern5_7176",
7977
- "contextPanelBody": "_contextPanelBody_1ern5_7181",
7978
- "contextPanel-stickyHeader": "_contextPanel-stickyHeader_1ern5_7185",
7979
- "filters-list": "_filters-list_1ern5_7192",
7980
- "col-drag-column-icon": "_col-drag-column-icon_1ern5_7201",
7981
- "tabular-nums": "_tabular-nums_1ern5_7205",
7982
- "ag-shake-left-to-right": "_ag-shake-left-to-right_1ern5_342",
7983
- "spin": "_spin_1ern5_1"
7979
+ "contextPanel": "_contextPanel_pphrk_7159",
7980
+ "contextPanel--hidden": "_contextPanel--hidden_pphrk_7173",
7981
+ "contextPanelWrapper": "_contextPanelWrapper_pphrk_7181",
7982
+ "contextPanelBody": "_contextPanelBody_pphrk_7186",
7983
+ "contextPanel-stickyHeader": "_contextPanel-stickyHeader_pphrk_7190",
7984
+ "filters-list": "_filters-list_pphrk_7197",
7985
+ "col-drag-column-icon": "_col-drag-column-icon_pphrk_7206",
7986
+ "tabular-nums": "_tabular-nums_pphrk_7210",
7987
+ "ag-shake-left-to-right": "_ag-shake-left-to-right_pphrk_342",
7988
+ "spin": "_spin_pphrk_1"
7984
7989
  };
7985
7990
 
7986
7991
  // src/CellRenderers/BooleanCell.tsx
@@ -54720,6 +54725,7 @@ function transformToColumnDefinition(colDef = emptyObject) {
54720
54725
  getStringFormattedValue,
54721
54726
  columnHeaderParams: colDef.headerComponentParams,
54722
54727
  headerName: colDef.headerName,
54728
+ headerClass: colDef.headerClass,
54723
54729
  hidden: colDef.hide,
54724
54730
  filterRenderer: colDef.filterRenderer,
54725
54731
  lockVisible: colDef.lockVisible,
@@ -57903,6 +57909,7 @@ var InternalTableContext = React80.createContext({
57903
57909
  hide: () => {
57904
57910
  },
57905
57911
  isVisible: false,
57912
+ panelRef: React80.createRef(),
57906
57913
  show: () => {
57907
57914
  }
57908
57915
  },
@@ -59706,14 +59713,16 @@ var useRowSelectionState = () => {
59706
59713
  var BulkEditActionButton = (props) => {
59707
59714
  const { contextPanel } = useInternalTableContext();
59708
59715
  const i18n = useI18nContext();
59716
+ const buttonRef = React80.useRef(null);
59709
59717
  const editActionLabel = props.actionText ?? i18n.t("dataTable.bulkActions.editValues");
59710
59718
  return /* @__PURE__ */ React80.createElement(
59711
59719
  Button,
59712
59720
  {
59721
+ ref: buttonRef,
59713
59722
  "aria-label": i18n.t("dataTable.bulkActions.bulkEdit"),
59714
59723
  "data-qa": "bulkEditIcon",
59715
59724
  icon: /* @__PURE__ */ React80.createElement(Pencil, null),
59716
- onClick: () => contextPanel.show("bulkEdit"),
59725
+ onClick: () => contextPanel.show("bulkEdit", buttonRef.current ?? void 0),
59717
59726
  variant: "tertiary"
59718
59727
  },
59719
59728
  props.showLabel && editActionLabel
@@ -104340,10 +104349,6 @@ var BulkEditPanel = ({}) => {
104340
104349
  const { contextPanel, suppressBulkEditToasts } = useInternalTableContext();
104341
104350
  const I18n = useI18nContext();
104342
104351
  const bulkEditRef = React80.useRef(null);
104343
- const bodyRef = React80.useRef(null);
104344
- useEffect(() => {
104345
- bodyRef.current?.focus();
104346
- }, []);
104347
104352
  return /* @__PURE__ */ React80.createElement(Panel, null, /* @__PURE__ */ React80.createElement(
104348
104353
  Panel.Header,
104349
104354
  {
@@ -104353,7 +104358,7 @@ var BulkEditPanel = ({}) => {
104353
104358
  }
104354
104359
  },
104355
104360
  /* @__PURE__ */ React80.createElement(Panel.Title, null, I18n.t("dataTable.bulkActions.editValues"))
104356
- ), /* @__PURE__ */ React80.createElement(Panel.Body, { ref: bodyRef }, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
104361
+ ), /* @__PURE__ */ React80.createElement(Panel.Body, null, /* @__PURE__ */ React80.createElement(Panel.Section, null, /* @__PURE__ */ React80.createElement(
104357
104362
  BulkEdit,
104358
104363
  {
104359
104364
  ref: bulkEditRef,
@@ -104788,18 +104793,33 @@ var ConfigurationPanel = ({
104788
104793
  function useContextPanel() {
104789
104794
  const [content, setContent] = useState();
104790
104795
  const visibility = useVisibility({ afterHide: () => setContent(void 0) });
104791
- const show = useCallback((panelContent) => {
104792
- setContent(panelContent);
104793
- visibility.show();
104794
- }, []);
104796
+ const triggerRef = useRef(null);
104797
+ const panelRef = useRef(null);
104798
+ const show = useCallback(
104799
+ (panelContent, trigger) => {
104800
+ triggerRef.current = trigger ?? null;
104801
+ setContent(panelContent);
104802
+ visibility.show();
104803
+ },
104804
+ []
104805
+ );
104795
104806
  const hide = useCallback(() => {
104807
+ const trigger = triggerRef.current;
104796
104808
  setContent(void 0);
104797
104809
  visibility.hide();
104810
+ trigger?.focus();
104811
+ triggerRef.current = null;
104798
104812
  }, []);
104813
+ useEffect(() => {
104814
+ if (content) {
104815
+ panelRef.current?.focus();
104816
+ }
104817
+ }, [content]);
104799
104818
  return {
104800
104819
  content,
104801
104820
  hide,
104802
104821
  isVisible: visibility.isVisible,
104822
+ panelRef,
104803
104823
  show
104804
104824
  };
104805
104825
  }
@@ -111063,9 +111083,26 @@ var ContextPanel = ({
111063
111083
  ...props
111064
111084
  }) => {
111065
111085
  const { contextPanel } = useInternalTableContext();
111086
+ const I18n = useI18nContext();
111087
+ const cardRef = React80.useRef(null);
111088
+ const panelLabelKeys = {
111089
+ configuration: "dataTable.tableSettings.tableSettings",
111090
+ bulkEdit: "dataTable.bulkActions.editValues"
111091
+ };
111092
+ const panelLabel = contextPanel.content ? panelLabelKeys[contextPanel.content] : void 0;
111093
+ const ariaLabel = panelLabel ? I18n.t(panelLabel) : void 0;
111094
+ React80.useLayoutEffect(() => {
111095
+ if (contextPanel.content && contextPanel.content !== "filters") {
111096
+ contextPanel.panelRef.current = cardRef.current;
111097
+ }
111098
+ }, [contextPanel.content, contextPanel.panelRef]);
111066
111099
  return /* @__PURE__ */ React80.createElement(
111067
111100
  Card,
111068
111101
  {
111102
+ ref: cardRef,
111103
+ tabIndex: -1,
111104
+ role: "region",
111105
+ "aria-label": ariaLabel,
111069
111106
  className: cx19("contextPanel", className, {
111070
111107
  "contextPanel--hidden": !contextPanel.isVisible || contextPanel.content === "filters"
111071
111108
  }),
@@ -111337,19 +111374,27 @@ var BaseFiltersPanel = ({
111337
111374
  onClearAllFilters = noop5,
111338
111375
  ...props
111339
111376
  }) => {
111340
- const ref = React80.useRef(null);
111377
+ const cardRef = React80.useRef(null);
111341
111378
  const { contextPanel, filtersBodyId, filtersPanelId } = useInternalTableContext();
111342
111379
  const I18n = useI18nContext();
111343
111380
  const hidden = !contextPanel.isVisible || contextPanel.content !== "filters";
111344
111381
  React80.useLayoutEffect(() => {
111345
- if (ref.current) {
111346
- ref.current.inert = hidden;
111382
+ if (contextPanel.content === "filters") {
111383
+ contextPanel.panelRef.current = cardRef.current;
111384
+ }
111385
+ }, [contextPanel.content, contextPanel.panelRef]);
111386
+ React80.useLayoutEffect(() => {
111387
+ if (cardRef.current) {
111388
+ cardRef.current.inert = hidden;
111347
111389
  }
111348
111390
  }, [hidden]);
111349
111391
  return /* @__PURE__ */ React80.createElement(
111350
111392
  Card,
111351
111393
  {
111352
- ref,
111394
+ ref: cardRef,
111395
+ tabIndex: -1,
111396
+ role: "region",
111397
+ "aria-label": I18n.t("dataTable.filters.filters"),
111353
111398
  style: { maxHeight: "100vh" },
111354
111399
  className: cx20("contextPanel", className, {
111355
111400
  "contextPanel--hidden": hidden
@@ -111403,6 +111448,7 @@ var ConfigPanelButton = () => {
111403
111448
  const { contextPanel } = useInternalTableContext();
111404
111449
  const hasNoContent = useTableHasNoContent();
111405
111450
  const I18n = useI18nContext();
111451
+ const buttonRef = React80.useRef(null);
111406
111452
  return /* @__PURE__ */ React80.createElement(
111407
111453
  EmptyResultsControlTooltip,
111408
111454
  {
@@ -111412,12 +111458,13 @@ var ConfigPanelButton = () => {
111412
111458
  /* @__PURE__ */ React80.createElement(
111413
111459
  ToggleButton,
111414
111460
  {
111461
+ ref: buttonRef,
111415
111462
  disabled: hasNoContent,
111416
111463
  onClick: () => {
111417
111464
  if (contextPanel.content === "configuration") {
111418
111465
  contextPanel.hide();
111419
111466
  } else {
111420
- contextPanel.show("configuration");
111467
+ contextPanel.show("configuration", buttonRef.current ?? void 0);
111421
111468
  }
111422
111469
  },
111423
111470
  icon: /* @__PURE__ */ React80.createElement(
@@ -112570,26 +112617,12 @@ var SingleSelectQuickFilterRenderer = (props) => {
112570
112617
  return /* @__PURE__ */ React80.createElement(ClientSideSingleSelectQuickFilter, { ...props });
112571
112618
  };
112572
112619
  var SingleSelectQuickFilterRenderer_default = SingleSelectQuickFilterRenderer;
112573
- var FOCUSABLE_SELECTOR2 = 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
112574
112620
  var FiltersPanelToggleButton = ({ hasDefinedFilters }) => {
112575
112621
  const I18n = useI18nContext();
112576
- const { contextPanel, filtersBodyId, filtersPanelId } = useInternalTableContext();
112622
+ const { contextPanel, filtersPanelId } = useInternalTableContext();
112577
112623
  const hasNoContent = useTableHasNoContent();
112578
112624
  const buttonRef = React80.useRef(null);
112579
112625
  const isFiltersOpen = contextPanel.content === "filters";
112580
- const isMounted = React80.useRef(false);
112581
- React80.useEffect(() => {
112582
- if (!isMounted.current) {
112583
- isMounted.current = true;
112584
- return;
112585
- }
112586
- if (isFiltersOpen) {
112587
- const panel = filtersBodyId ? document.getElementById(filtersBodyId) : null;
112588
- panel?.querySelector(FOCUSABLE_SELECTOR2)?.focus();
112589
- } else {
112590
- buttonRef.current?.focus();
112591
- }
112592
- }, [isFiltersOpen, filtersBodyId]);
112593
112626
  if (!hasDefinedFilters) {
112594
112627
  return null;
112595
112628
  }
@@ -112610,7 +112643,7 @@ var FiltersPanelToggleButton = ({ hasDefinedFilters }) => {
112610
112643
  "aria-controls": filtersPanelId,
112611
112644
  onClick: () => {
112612
112645
  if (!isFiltersOpen) {
112613
- contextPanel.show("filters");
112646
+ contextPanel.show("filters", buttonRef.current ?? void 0);
112614
112647
  } else {
112615
112648
  contextPanel.hide();
112616
112649
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "14.46.2",
3
+ "version": "14.46.4",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "author": "Procore Technologies",
6
6
  "homepage": "https://github.com/procore/core/tree/main/packages/data-table",
@@ -77,7 +77,7 @@
77
77
  "@procore/error-pages": "^0.2.3",
78
78
  "@procore/labs-datetime-select": "^0.2.2",
79
79
  "@procore/labs-group-by-select": "4.1.0",
80
- "@procore/toast-alert": "^5.1.3",
80
+ "@procore/toast-alert": "^5.2.0",
81
81
  "@procore/web-sdk-storage": "^0.1.0",
82
82
  "classnames": "2.5.1",
83
83
  "date-fns": "2.29.1",
@@ -106,9 +106,9 @@
106
106
  "@dotenvx/dotenvx": "1.6.4",
107
107
  "@ngneat/falso": "6.4.0",
108
108
  "@procore/core-css": "10.17.0",
109
- "@procore/core-icons": "^12.17.0",
109
+ "@procore/core-icons": "^12.18.0",
110
110
  "@procore/core-prettier": "10.2.0",
111
- "@procore/core-react": "^12.48.2",
111
+ "@procore/core-react": "^12.49.1",
112
112
  "@procore/eslint-config": "10.0.0",
113
113
  "@procore/globalization-toolkit": "3.1.0",
114
114
  "@procore/labs-financials-utils": "4.3.1",
@@ -161,7 +161,7 @@
161
161
  "safe-json-stringify": "^1.2.0",
162
162
  "sass": "1.57.1",
163
163
  "sass-loader": "13.2.0",
164
- "start-server-and-test": "2.1.5",
164
+ "start-server-and-test": "3.0.5",
165
165
  "storybook": "^9.1.17",
166
166
  "style-loader": "3.3.1",
167
167
  "styled-components": "6.1.18",