@procore/data-table 14.5.0 → 14.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1403,7 +1403,7 @@ ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
1403
1403
  animation-iteration-count: infinite;
1404
1404
  animation-name: ag-shake-left-to-right;
1405
1405
  }
1406
- @keyframes _ag-shake-left-to-right_qs3ag_366 {
1406
+ @keyframes _ag-shake-left-to-right_taxt5_366 {
1407
1407
  from {
1408
1408
  padding-left: 6px;
1409
1409
  padding-right: 2px;
@@ -5404,7 +5404,7 @@ input[class^=ag-][type=button]:focus, button[class^=ag-]:focus {
5404
5404
  animation-iteration-count: infinite;
5405
5405
  animation-timing-function: linear;
5406
5406
  }
5407
- @keyframes _spin_qs3ag_1 {
5407
+ @keyframes _spin_taxt5_1 {
5408
5408
  from {
5409
5409
  transform: rotate(0deg);
5410
5410
  }
@@ -7576,8 +7576,11 @@ input[class^=ag-][type=range]:disabled {
7576
7576
  .ag-theme-alpine.ag-theme-alpine.ag-theme-alpine .ag-ltr .ag-header-cell .ag-header-cell-comp-wrapper .ag-header-cell-label {
7577
7577
  padding: 8px 0;
7578
7578
  }
7579
+ .ag-theme-alpine.ag-theme-alpine.ag-theme-alpine .ag-ltr .ag-header-cell .ag-header-cell-comp-wrapper .ag-header-cell-label .data-table-header-display-name-container {
7580
+ width: 100%;
7581
+ }
7579
7582
  .ag-theme-alpine.ag-theme-alpine.ag-theme-alpine .ag-ltr .ag-header-cell .ag-header-cell-comp-wrapper .ag-header-cell-label .data-table-header-display-name {
7580
- white-space: nowrap;
7583
+ word-wrap: break-word;
7581
7584
  text-overflow: ellipsis;
7582
7585
  overflow: hidden;
7583
7586
  }
@@ -7883,7 +7886,7 @@ input[class^=ag-][type=range]:disabled {
7883
7886
  padding-left: 16px;
7884
7887
  }
7885
7888
 
7886
- div._contextPanel_qs3ag_7123 {
7889
+ div._contextPanel_taxt5_7126 {
7887
7890
  width: 400px;
7888
7891
  transition: all ease 500ms;
7889
7892
  flex: 0 0 auto;
@@ -7892,7 +7895,7 @@ div._contextPanel_qs3ag_7123 {
7892
7895
  border: 1px solid #d6dadc;
7893
7896
  display: flex;
7894
7897
  }
7895
- div._contextPanel--hidden_qs3ag_7132 {
7898
+ div._contextPanel--hidden_taxt5_7135 {
7896
7899
  border: none;
7897
7900
  overflow: hidden;
7898
7901
  padding: 0px;
@@ -7900,50 +7903,50 @@ div._contextPanel--hidden_qs3ag_7132 {
7900
7903
  width: 0px;
7901
7904
  }
7902
7905
 
7903
- ._contextPanelWrapper_qs3ag_7140 {
7906
+ ._contextPanelWrapper_taxt5_7143 {
7904
7907
  position: relative;
7905
7908
  flex-grow: 1;
7906
7909
  }
7907
7910
 
7908
- ._contextPanelBody_qs3ag_7145 {
7911
+ ._contextPanelBody_taxt5_7148 {
7909
7912
  width: clamp(380px, 400px, 100%);
7910
7913
  }
7911
7914
 
7912
- ._contextPanel-stickyHeader_qs3ag_7149 {
7915
+ ._contextPanel-stickyHeader_taxt5_7152 {
7913
7916
  background-color: #ffffff;
7914
7917
  position: sticky;
7915
7918
  top: 0;
7916
7919
  z-index: 5;
7917
7920
  }
7918
7921
 
7919
- ._filters-list_qs3ag_7156 {
7922
+ ._filters-list_taxt5_7159 {
7920
7923
  padding: 0;
7921
7924
  margin: 0;
7922
7925
  }
7923
- ._filters-list_qs3ag_7156 ol {
7926
+ ._filters-list_taxt5_7159 ol {
7924
7927
  padding: 0;
7925
7928
  margin: 0;
7926
7929
  }
7927
7930
 
7928
- ._col-drag-column-icon_qs3ag_7165 {
7931
+ ._col-drag-column-icon_taxt5_7168 {
7929
7932
  color: #6a767c;
7930
7933
  }
7931
7934
 
7932
- ._tabular-nums_qs3ag_7169 {
7935
+ ._tabular-nums_taxt5_7172 {
7933
7936
  font-variant-numeric: tabular-nums;
7934
7937
  }`;
7935
7938
  document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
7936
7939
  var styles_default = {
7937
- "contextPanel": "_contextPanel_qs3ag_7123",
7938
- "contextPanel--hidden": "_contextPanel--hidden_qs3ag_7132",
7939
- "contextPanelWrapper": "_contextPanelWrapper_qs3ag_7140",
7940
- "contextPanelBody": "_contextPanelBody_qs3ag_7145",
7941
- "contextPanel-stickyHeader": "_contextPanel-stickyHeader_qs3ag_7149",
7942
- "filters-list": "_filters-list_qs3ag_7156",
7943
- "col-drag-column-icon": "_col-drag-column-icon_qs3ag_7165",
7944
- "tabular-nums": "_tabular-nums_qs3ag_7169",
7945
- "ag-shake-left-to-right": "_ag-shake-left-to-right_qs3ag_366",
7946
- "spin": "_spin_qs3ag_1"
7940
+ "contextPanel": "_contextPanel_taxt5_7126",
7941
+ "contextPanel--hidden": "_contextPanel--hidden_taxt5_7135",
7942
+ "contextPanelWrapper": "_contextPanelWrapper_taxt5_7143",
7943
+ "contextPanelBody": "_contextPanelBody_taxt5_7148",
7944
+ "contextPanel-stickyHeader": "_contextPanel-stickyHeader_taxt5_7152",
7945
+ "filters-list": "_filters-list_taxt5_7159",
7946
+ "col-drag-column-icon": "_col-drag-column-icon_taxt5_7168",
7947
+ "tabular-nums": "_tabular-nums_taxt5_7172",
7948
+ "ag-shake-left-to-right": "_ag-shake-left-to-right_taxt5_366",
7949
+ "spin": "_spin_taxt5_1"
7947
7950
  };
7948
7951
 
7949
7952
  // src/utils/getCellValueTypographyProps.ts
@@ -8129,19 +8132,19 @@ var CompanyCellRenderer = withDataTableRenderer(Renderer2, "select");
8129
8132
 
8130
8133
  // src/utils/isEmptyValue.ts
8131
8134
  var isEmptyValue = (value) => {
8132
- if (typeof value === "boolean") {
8135
+ if (typeof value === "boolean" || typeof value === "number") {
8133
8136
  return false;
8134
8137
  }
8135
- if (Array.isArray(value)) {
8136
- return !value.length;
8138
+ if (!value) {
8139
+ return true;
8137
8140
  }
8138
- if (value === 0) {
8139
- return false;
8141
+ if (Array.isArray(value)) {
8142
+ return value.length === 0;
8140
8143
  }
8141
- if (value && Object.keys(value).length === 0 && Object.getPrototypeOf(value) === Object.prototype) {
8142
- return !!value;
8144
+ if (Object.getPrototypeOf(value) === Object.prototype) {
8145
+ return Object.keys(value).length === 0;
8143
8146
  }
8144
- return !value;
8147
+ return false;
8145
8148
  };
8146
8149
 
8147
8150
  // src/CellRenderers/CurrencyCell.tsx
@@ -56029,6 +56032,14 @@ function findNode(predicate, gridApi) {
56029
56032
  return searchTarget;
56030
56033
  }
56031
56034
 
56035
+ // src/utils/isServerSideGroupSelectionState.ts
56036
+ function isServerSideGroupSelectionState(value) {
56037
+ if (value === null) {
56038
+ return false;
56039
+ }
56040
+ return value.selectAll === void 0;
56041
+ }
56042
+
56032
56043
  // src/GenericHeader/genericHeader.scss
56033
56044
  var css7 = `.ag-header-cell .data-table-header-menu {
56034
56045
  opacity: 1;
@@ -56438,10 +56449,18 @@ var GenericHeaderRenderer = (props) => {
56438
56449
  if (e.source === "uiSelectAll") {
56439
56450
  return;
56440
56451
  }
56452
+ const selectionState = props.api.getServerSideSelectionState();
56453
+ const isGroupSelection = isServerSideGroupSelectionState(selectionState);
56454
+ const isSelectionStatePartialSelected = Boolean(
56455
+ selectionState?.toggledNodes?.length
56456
+ );
56457
+ const isSelectionStateSelectAll = !isSelectionStatePartialSelected && Boolean(
56458
+ isGroupSelection ? selectionState.selectAllChildren : selectionState?.selectAll
56459
+ );
56441
56460
  const isPagination = Boolean(props.api.paginationGetRowCount());
56442
56461
  const currentRows = getCurrentRows(props.api, isPagination);
56443
- const isAllSelected = currentRows.length && currentRows.every(isRowSelected);
56444
- const isPartialSelected = !isAllSelected && currentRows.some(isRowSelected);
56462
+ const isAllSelected = isPagination ? currentRows.length && currentRows.every(isRowSelected) : isSelectionStateSelectAll;
56463
+ const isPartialSelected = isPagination ? !isAllSelected && currentRows.some(isRowSelected) : isSelectionStatePartialSelected;
56445
56464
  if (isAllSelected) {
56446
56465
  setSelectAll("all" /* All */);
56447
56466
  } else if (isPartialSelected) {
@@ -56472,17 +56491,21 @@ var GenericHeaderRenderer = (props) => {
56472
56491
  const isSelectAll = nextSelectedState == "all" /* All */;
56473
56492
  if (props.selectionSSREnabled) {
56474
56493
  const isPagination = Boolean(props.api.paginationGetRowCount());
56475
- const rowsIdsToSelectOrDeselect = getCurrentRows(
56476
- props.api,
56477
- isPagination
56478
- ).map((node) => node.id);
56479
- isSelectAll ? tableRef?.current?.selectRows(
56480
- rowsIdsToSelectOrDeselect,
56481
- "uiSelectAll"
56482
- ) : tableRef?.current?.deselectRows(
56483
- rowsIdsToSelectOrDeselect,
56484
- "uiSelectAll"
56485
- );
56494
+ if (isPagination) {
56495
+ const rowsIdsToSelectOrDeselect = getCurrentRows(
56496
+ props.api,
56497
+ isPagination
56498
+ ).map((node) => node.id);
56499
+ isSelectAll ? tableRef?.current?.selectRows(
56500
+ rowsIdsToSelectOrDeselect,
56501
+ "uiSelectAll"
56502
+ ) : tableRef?.current?.deselectRows(
56503
+ rowsIdsToSelectOrDeselect,
56504
+ "uiSelectAll"
56505
+ );
56506
+ } else {
56507
+ isSelectAll ? tableRef?.current?.selectAll() : tableRef?.current?.deselectAll();
56508
+ }
56486
56509
  } else {
56487
56510
  isSelectAll ? props.api.selectAllFiltered() : props.api.deselectAllFiltered();
56488
56511
  }
@@ -56536,7 +56559,7 @@ var GenericHeaderRenderer = (props) => {
56536
56559
  trigger: isOverflowing ? "hover" : "none",
56537
56560
  overlay: /* @__PURE__ */ React83.createElement(Tooltip.Content, null, /* @__PURE__ */ React83.createElement("span", null, props.displayName))
56538
56561
  },
56539
- /* @__PURE__ */ React83.createElement("div", null, /* @__PURE__ */ React83.createElement("span", { ref, className: "data-table-header-display-name" }, props.displayName))
56562
+ /* @__PURE__ */ React83.createElement("div", { className: "data-table-header-display-name-container" }, /* @__PURE__ */ React83.createElement("span", { ref, className: "data-table-header-display-name" }, props.displayName))
56540
56563
  ), HeaderNode && /* @__PURE__ */ React83.createElement(
56541
56564
  Flex,
56542
56565
  {
@@ -56855,7 +56878,7 @@ function shapeActiveFilters(filters = emptyArray2) {
56855
56878
  field
56856
56879
  };
56857
56880
  });
56858
- return { state };
56881
+ return state;
56859
56882
  }
56860
56883
  function useFilterStorage({
56861
56884
  columnDefinitions,
@@ -56866,7 +56889,7 @@ function useFilterStorage({
56866
56889
  filterable: emptyObj,
56867
56890
  filterOptions: emptyObj,
56868
56891
  possibleFilters: emptyArray2,
56869
- selectedFilters: emptyObj
56892
+ selectedFilters: shapeActiveFilters(initialSelectedFilters)
56870
56893
  });
56871
56894
  function getOptions(field) {
56872
56895
  return filtersState.filterOptions[field];
@@ -56889,16 +56912,25 @@ function useFilterStorage({
56889
56912
  const filterableColumns = columnDefinitions.filter(
56890
56913
  (col) => col.filterRenderer
56891
56914
  );
56892
- const { state } = shapeActiveFilters(initialSelectedFilters);
56915
+ const filterableMap = filterableColumns.reduce((acc, curr) => {
56916
+ return {
56917
+ ...acc,
56918
+ [curr.field]: curr
56919
+ };
56920
+ }, {});
56921
+ const selectedFiltersState = Object.entries(
56922
+ filtersState.selectedFilters ?? {}
56923
+ ).filter(([field]) => Object.keys(filterableMap).includes(field)).reduce(
56924
+ (acc, [field, filterState]) => ({
56925
+ ...acc,
56926
+ [field]: filterState
56927
+ }),
56928
+ {}
56929
+ );
56893
56930
  setFiltersState((prev) => ({
56894
56931
  ...prev,
56895
- filterable: filterableColumns.reduce((acc, curr) => {
56896
- return {
56897
- ...acc,
56898
- [curr.field]: curr
56899
- };
56900
- }, {}),
56901
- selectedFilters: state,
56932
+ filterable: filterableMap,
56933
+ selectedFilters: selectedFiltersState,
56902
56934
  possibleFilters: filterableColumns.sort(sortColumnDefinitionsByFilterIndex).map(getFieldAttr)
56903
56935
  }));
56904
56936
  }, [columnDefinitions]);
@@ -56912,7 +56944,7 @@ function useFilterStorage({
56912
56944
  (selectedFilters) => {
56913
56945
  setFiltersState((prev) => ({
56914
56946
  ...prev,
56915
- selectedFilters: shapeActiveFilters(selectedFilters).state
56947
+ selectedFilters: shapeActiveFilters(selectedFilters)
56916
56948
  }));
56917
56949
  },
56918
56950
  []
@@ -77682,6 +77714,7 @@ function useContextPanel() {
77682
77714
  }
77683
77715
  var ConfigPanelButton = () => {
77684
77716
  const { contextPanel, totalRowCount } = useInternalTableContext();
77717
+ const I18n = useI18nContext();
77685
77718
  return /* @__PURE__ */ React83.createElement(
77686
77719
  EmptyResultsControlTooltip,
77687
77720
  {
@@ -77699,28 +77732,29 @@ var ConfigPanelButton = () => {
77699
77732
  contextPanel.show("configuration");
77700
77733
  }
77701
77734
  },
77735
+ icon: /* @__PURE__ */ React83.createElement(
77736
+ "svg",
77737
+ {
77738
+ style: { marginTop: "6px" },
77739
+ focusable: false,
77740
+ width: "15",
77741
+ height: "15",
77742
+ viewBox: "0 0 20 20",
77743
+ fill: "none",
77744
+ xmlns: "http://www.w3.org/2000/svg"
77745
+ },
77746
+ /* @__PURE__ */ React83.createElement(
77747
+ "path",
77748
+ {
77749
+ d: "M0 11.5V13.5H4.5V11.5H0ZM0 1.5V3.5H7.5V1.5H0ZM8.5 15V13.5H15V11.5H8.5V10H6.66667V15H8.5ZM3.5 5V6.5H0V8.5H3.5V10H5.5V5H3.5ZM15 8.5V6.5H7.5V8.5H15ZM9.5 5H11.6667V3.5H15V1.5H11.6667V0H9.5V5Z",
77750
+ fill: "currentColor"
77751
+ }
77752
+ )
77753
+ ),
77702
77754
  selected: contextPanel.content === "configuration",
77703
77755
  "data-qa": "table-config-button"
77704
77756
  },
77705
- /* @__PURE__ */ React83.createElement(
77706
- "svg",
77707
- {
77708
- style: { marginTop: "6px" },
77709
- focusable: false,
77710
- width: "15",
77711
- height: "15",
77712
- viewBox: "0 0 15 15",
77713
- fill: "none",
77714
- xmlns: "http://www.w3.org/2000/svg"
77715
- },
77716
- /* @__PURE__ */ React83.createElement(
77717
- "path",
77718
- {
77719
- d: "M0 11.5V13.5H4.5V11.5H0ZM0 1.5V3.5H7.5V1.5H0ZM8.5 15V13.5H15V11.5H8.5V10H6.66667V15H8.5ZM3.5 5V6.5H0V8.5H3.5V10H5.5V5H3.5ZM15 8.5V6.5H7.5V8.5H15ZM9.5 5H11.6667V3.5H15V1.5H11.6667V0H9.5V5Z",
77720
- fill: "currentColor"
77721
- }
77722
- )
77723
- )
77757
+ I18n.t("dataTable.tableSettings.configure")
77724
77758
  )
77725
77759
  );
77726
77760
  };
@@ -78539,7 +78573,8 @@ var de_DE_default = {
78539
78573
  tableSettings: "Tabelleneinstellungen",
78540
78574
  groupBy: "Gruppieren nach:",
78541
78575
  reset: "Zur\xFCcksetzen",
78542
- selectColumnGroup: "W\xE4hlen Sie eine Spalte zum Gruppieren."
78576
+ selectColumnGroup: "W\xE4hlen Sie eine Spalte zum Gruppieren.",
78577
+ configure: "Konfigurieren"
78543
78578
  },
78544
78579
  rowGroupToggle: {
78545
78580
  expandTierOne: "\xD6ffnen Sie die ersten Gruppen in der Tabelle.",
@@ -78683,7 +78718,8 @@ var en_AU_default = {
78683
78718
  tableSettings: "Table Settings",
78684
78719
  groupBy: "Group by:",
78685
78720
  reset: "Reset",
78686
- selectColumnGroup: "Select a column to group"
78721
+ selectColumnGroup: "Select a column to group",
78722
+ configure: "Configure"
78687
78723
  },
78688
78724
  rowGroupToggle: {
78689
78725
  expandTierOne: "Open first groups in the table.",
@@ -78827,7 +78863,8 @@ var en_CA_default = {
78827
78863
  tableSettings: "Table Settings",
78828
78864
  groupBy: "Group by:",
78829
78865
  reset: "Reset",
78830
- selectColumnGroup: "Select a column to group"
78866
+ selectColumnGroup: "Select a column to group",
78867
+ configure: "Configure"
78831
78868
  },
78832
78869
  rowGroupToggle: {
78833
78870
  expandTierOne: "Open first groups in the table.",
@@ -78971,7 +79008,8 @@ var en_GB_default = {
78971
79008
  tableSettings: "Table Settings",
78972
79009
  groupBy: "Group by:",
78973
79010
  reset: "Reset",
78974
- selectColumnGroup: "Select a column to group"
79011
+ selectColumnGroup: "Select a column to group",
79012
+ configure: "Configure"
78975
79013
  },
78976
79014
  rowGroupToggle: {
78977
79015
  expandTierOne: "Open first groups in the table.",
@@ -79115,7 +79153,8 @@ var en_default = {
79115
79153
  tableSettings: "Table Settings",
79116
79154
  groupBy: "Group by:",
79117
79155
  reset: "Reset",
79118
- selectColumnGroup: "Select a column to group"
79156
+ selectColumnGroup: "Select a column to group",
79157
+ configure: "Configure"
79119
79158
  },
79120
79159
  rowGroupToggle: {
79121
79160
  expandTierOne: "Open first groups in the table.",
@@ -79259,7 +79298,8 @@ var es_ES_default = {
79259
79298
  tableSettings: "Configuraci\xF3n de la tabla",
79260
79299
  groupBy: "Agrupar por:",
79261
79300
  reset: "Restablecer",
79262
- selectColumnGroup: "Seleccione una columna para agrupar"
79301
+ selectColumnGroup: "Seleccione una columna para agrupar",
79302
+ configure: "Configurar"
79263
79303
  },
79264
79304
  rowGroupToggle: {
79265
79305
  expandTierOne: "Abrir los primeros grupos de la tabla.",
@@ -79403,7 +79443,8 @@ var es_default = {
79403
79443
  tableSettings: "Configuraci\xF3n de la tabla",
79404
79444
  groupBy: "Agrupar por:",
79405
79445
  reset: "Restablecer",
79406
- selectColumnGroup: "Selecciona una columna para agrupar"
79446
+ selectColumnGroup: "Selecciona una columna para agrupar",
79447
+ configure: "Configurar"
79407
79448
  },
79408
79449
  rowGroupToggle: {
79409
79450
  expandTierOne: "Abrir los primeros grupos de la tabla.",
@@ -79547,7 +79588,8 @@ var fr_CA_default = {
79547
79588
  tableSettings: "Param\xE8tres du tableau",
79548
79589
  groupBy: "Regrouper par :",
79549
79590
  reset: "R\xE9initialiser",
79550
- selectColumnGroup: "S\xE9lectionnez une colonne \xE0 grouper"
79591
+ selectColumnGroup: "S\xE9lectionnez une colonne \xE0 grouper",
79592
+ configure: "Configurer"
79551
79593
  },
79552
79594
  rowGroupToggle: {
79553
79595
  expandTierOne: "Ouvrez les premiers groupes du tableau.",
@@ -79691,7 +79733,8 @@ var fr_FR_default = {
79691
79733
  tableSettings: "Param\xE8tres du tableau",
79692
79734
  groupBy: "Regrouper par\xA0:",
79693
79735
  reset: "R\xE9initialiser",
79694
- selectColumnGroup: "S\xE9lectionner une colonne \xE0 regrouper"
79736
+ selectColumnGroup: "S\xE9lectionner une colonne \xE0 regrouper",
79737
+ configure: "Configurer"
79695
79738
  },
79696
79739
  rowGroupToggle: {
79697
79740
  expandTierOne: "Ouvrez les premiers groupes du tableau.",
@@ -79835,7 +79878,8 @@ var is_IS_default = {
79835
79878
  tableSettings: "Tafla stillingar",
79836
79879
  groupBy: "H\xF3pur eftir:",
79837
79880
  reset: "Endurstilla",
79838
- selectColumnGroup: "Veldu d\xE1lk til a\xF0 flokka"
79881
+ selectColumnGroup: "Veldu d\xE1lk til a\xF0 flokka",
79882
+ configure: "Stilla"
79839
79883
  },
79840
79884
  rowGroupToggle: {
79841
79885
  expandTierOne: "Opna\xF0u fyrstu h\xF3pa \xED t\xF6flunni.",
@@ -79979,7 +80023,8 @@ var ja_JP_default = {
79979
80023
  tableSettings: "\u8868\u306E\u8A2D\u5B9A",
79980
80024
  groupBy: "\u30B0\u30EB\u30FC\u30D7\u5316:",
79981
80025
  reset: "\u30EA\u30BB\u30C3\u30C8",
79982
- selectColumnGroup: "\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\u5217\u3092\u9078\u629E"
80026
+ selectColumnGroup: "\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\u5217\u3092\u9078\u629E",
80027
+ configure: "\u69CB\u6210"
79983
80028
  },
79984
80029
  rowGroupToggle: {
79985
80030
  expandTierOne: "\u8868\u306E\u6700\u521D\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u958B\u304D\u307E\u3059\u3002",
@@ -80123,7 +80168,8 @@ var pt_BR_default = {
80123
80168
  tableSettings: "Configura\xE7\xF5es da Tabela",
80124
80169
  groupBy: "Agrupar por:",
80125
80170
  reset: "Redefinir",
80126
- selectColumnGroup: "Selecionar uma coluna para agrupar"
80171
+ selectColumnGroup: "Selecionar uma coluna para agrupar",
80172
+ configure: "Configurar"
80127
80173
  },
80128
80174
  rowGroupToggle: {
80129
80175
  expandTierOne: "Abra os primeiros grupos na tabela.",
@@ -80267,7 +80313,8 @@ var th_TH_default = {
80267
80313
  tableSettings: "\u0E01\u0E32\u0E23\u0E15\u0E31\u0E49\u0E07\u0E04\u0E48\u0E32\u0E15\u0E32\u0E23\u0E32\u0E07",
80268
80314
  groupBy: "\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E15\u0E32\u0E21:",
80269
80315
  reset: "\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15",
80270
- selectColumnGroup: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E17\u0E35\u0E48\u0E08\u0E30\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21"
80316
+ selectColumnGroup: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E17\u0E35\u0E48\u0E08\u0E30\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",
80317
+ configure: "\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E04\u0E48\u0E32"
80271
80318
  },
80272
80319
  rowGroupToggle: {
80273
80320
  expandTierOne: "\u0E40\u0E1B\u0E34\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E23\u0E01\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07",
@@ -80411,7 +80458,8 @@ var zh_SG_default = {
80411
80458
  tableSettings: "\u8868\u683C\u8BBE\u7F6E",
80412
80459
  groupBy: "\u5206\u7EC4\u4F9D\u636E\uFF1A",
80413
80460
  reset: "\u91CD\u7F6E",
80414
- selectColumnGroup: "\u9009\u62E9\u8981\u5206\u7C7B\u7684\u5217"
80461
+ selectColumnGroup: "\u9009\u62E9\u8981\u5206\u7C7B\u7684\u5217",
80462
+ configure: "\u914D\u7F6E"
80415
80463
  },
80416
80464
  rowGroupToggle: {
80417
80465
  expandTierOne: "\u6253\u5F00\u8868\u4E2D\u7684\u7B2C\u4E00\u4E2A\u7EC4\u3002",
@@ -81036,6 +81084,14 @@ var useTableApi = ({
81036
81084
  }),
81037
81085
  [columnApi, gridApi, rowHeight, filterStorage]
81038
81086
  );
81087
+ function deselectParentsWithoutChildrenOrSelectAll(state, gridApi2) {
81088
+ if (state.selectAllChildren === false && !state.toggledNodes?.length) {
81089
+ gridApi2.getRowNode(state.nodeId || "")?.setSelected(false);
81090
+ }
81091
+ state.toggledNodes?.forEach(
81092
+ (node) => deselectParentsWithoutChildrenOrSelectAll(node, gridApi2)
81093
+ );
81094
+ }
81039
81095
  const onSelectionChanged = (rowNode) => {
81040
81096
  const isGrouped = rowNode.group || rowNode.parent?.group && !isNodeRootLevelOfGrid(rowNode.parent);
81041
81097
  const currAffectedRows = rowSelectionRef.current.affectedRows;
@@ -81056,13 +81112,18 @@ var useTableApi = ({
81056
81112
  currAffectedRows
81057
81113
  );
81058
81114
  const rowValues = Object.values(rowsToUpdate);
81059
- rowValues.forEach((row2) => {
81060
- row2.node.setSelected(
81061
- row2.selectedState === rowSelectionState.selected,
81062
- false,
81063
- "checkboxSelected"
81064
- );
81065
- });
81115
+ const selectionState = gridApi?.getServerSideSelectionState();
81116
+ if (selectionState && isServerSideGroupSelectionState(selectionState) && gridApi) {
81117
+ deselectParentsWithoutChildrenOrSelectAll(selectionState, gridApi);
81118
+ } else {
81119
+ rowValues.forEach((row2) => {
81120
+ row2.node.setSelected(
81121
+ row2.selectedState === rowSelectionState.selected,
81122
+ false,
81123
+ "checkboxSelected"
81124
+ );
81125
+ });
81126
+ }
81066
81127
  rowSelectionRef.current.affectedRows = {
81067
81128
  ...currAffectedRows,
81068
81129
  ...rowsToUpdate
@@ -81184,6 +81245,7 @@ function buildPartialTableApi({
81184
81245
  rowSelectionRef
81185
81246
  }) : void 0;
81186
81247
  };
81248
+ const getServerSideSelectionState = () => gridApi?.getServerSideSelectionState();
81187
81249
  const getTableConfiguration = () => {
81188
81250
  const columnState = columnApi?.getColumnState().filter(
81189
81251
  (column2) => !["rowActions", "rowActions-pinned"].includes(
@@ -81297,6 +81359,7 @@ function buildPartialTableApi({
81297
81359
  getRootAggregateData,
81298
81360
  getRowData,
81299
81361
  getSelectedRows: getSelectedRows2,
81362
+ getServerSideSelectionState,
81300
81363
  getTableConfiguration,
81301
81364
  refreshCells,
81302
81365
  setPinnedBottomRowData,
@@ -82348,7 +82411,7 @@ var Table = (props) => {
82348
82411
  groupDefaultExpanded: props.groupDefaultExpanded,
82349
82412
  groupIncludeFooter: !onSSDR && props.groupIncludeFooter === void 0 ? true : props.groupIncludeFooter,
82350
82413
  getGroupRowAgg: props.getGroupRowAgg ? getGroupRowAgg : void 0,
82351
- groupSelectsChildren: !onSSDR,
82414
+ groupSelectsChildren: props.groupSelectsChildren || !onSSDR,
82352
82415
  groupSelectsFiltered: true,
82353
82416
  headerHeight: props.headerHeight,
82354
82417
  icons: tableIcons,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "14.5.0",
3
+ "version": "14.6.0",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "main": "dist/modern/index.js",
6
6
  "module": "dist/modern/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "cypress:run": "cypress run -b ${CYPRESS_BROWSER-chrome} --spec ${CYPRESS_SPEC-cypress/e2e/**/*.e2e.ts}",
37
37
  "cypress:run:all": "start-server-and-test storybook-static:server http://127.0.0.1:6006 'yarn cypress:run'",
38
38
  "cypress:install": "cypress install",
39
- "dev": "NODE_ENV=development webpack --mode=development --watch",
39
+ "lint:types": "tsc --noEmit",
40
40
  "prettier": "prettier --write",
41
41
  "prettier:check": "prettier --check",
42
42
  "storybook": "storybook dev -p 6006",
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@procore/labs-datetime-select": "0.1.0",
79
- "@procore/labs-group-by-select": "3.1.1",
79
+ "@procore/labs-group-by-select": "3.1.2",
80
80
  "@procore/toast-alert": "5.1.0",
81
81
  "classnames": "2.5.1",
82
82
  "date-fns": "2.29.1",
@@ -133,20 +133,11 @@
133
133
  "@typescript-eslint/eslint-plugin": "5.48.2",
134
134
  "@typescript-eslint/parser": "5.48.1",
135
135
  "@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
136
- "assert": "2.0.0",
137
- "browserify-zlib": "0.2.0",
138
- "buffer": "6.0.3",
139
- "console-browserify": "1.2.0",
140
- "constants-browserify": "1.0.0",
141
- "copy-webpack-plugin": "11.0.0",
142
- "crypto-browserify": "3.12.0",
143
136
  "css-loader": "6.7.1",
144
- "css-minimizer-webpack-plugin": "4.2.2",
145
137
  "cypress": "13.6.1",
146
138
  "cypress-multi-reporters": "1.6.4",
147
139
  "cypress-real-events": "^1.11.0",
148
140
  "cypress-web-vitals": "^4.1.2",
149
- "domain-browser": "4.22.0",
150
141
  "enzyme": "3.11.0",
151
142
  "esbuild-sass-plugin": "^2.16.1",
152
143
  "eslint": "8.31.0",
@@ -158,44 +149,23 @@
158
149
  "eslint-plugin-prettier": "4.2.1",
159
150
  "eslint-plugin-react": "7.32.0",
160
151
  "eslint-plugin-react-hooks": "4.6.0",
161
- "events": "3.3.0",
162
152
  "http-server": "^14.1.1",
163
- "https-browserify": "1.0.0",
164
153
  "jest": "29.5.0",
165
- "mini-css-extract-plugin": "2.6.1",
166
154
  "miragejs": "0.1.45",
167
155
  "mocha-junit-reporter": "^2.2.1",
168
156
  "mochawesome": "^7.1.3",
169
- "os-browserify": "0.3.0",
170
- "path-browserify": "1.0.1",
171
157
  "postcss-modules": "^6.0.0",
172
- "process": "0.11.10",
173
- "punycode": "2.3.0",
174
- "querystring-es3": "0.2.1",
175
158
  "react": "17.0.2",
176
159
  "react-dom": "17.0.2",
177
- "readable-stream": "4.1.0",
178
160
  "rimraf": "3.0.2",
179
161
  "safe-json-stringify": "^1.2.0",
180
162
  "sass": "1.57.1",
181
163
  "sass-loader": "13.2.0",
182
164
  "start-server-and-test": "1.15.4",
183
165
  "storybook": "^7.5.3",
184
- "stream-browserify": "3.0.0",
185
- "stream-http": "3.2.0",
186
- "string_decoder": "1.3.0",
187
166
  "style-loader": "3.3.1",
188
167
  "styled-components": "5.3.9",
189
- "terser-webpack-plugin": "5.3.5",
190
- "timers-browserify": "2.0.12",
191
- "ts-loader": "9.4.2",
192
168
  "tsup": "^8.0.1",
193
- "tty-browserify": "0.0.1",
194
- "typescript": "^4.9.5",
195
- "url": "0.11.0",
196
- "util": "0.12.5",
197
- "vm-browserify": "1.1.2",
198
- "webpack": "5.74.0",
199
- "webpack-cli": "4.10.0"
169
+ "typescript": "^4.9.5"
200
170
  }
201
171
  }