@procore/data-table 14.14.0 → 14.16.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.
@@ -3,10 +3,11 @@ import { uniqBy, prop, startsWith, mergeDeepRight, equals, omit, intersection, i
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 as Spinner$1, FlexList, Typography, Tooltip, Button, Required, MultiSelect, 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, Link, AvatarStack, Pill, Typeahead, Pagination, UNSAFE_FilterToken, UNSAFE_SuperSelect, Avatar, H3, Checkbox, useI18n, I18nContext, UNSAFE_useSuperSelectContext, DropdownFlyout, useVisibility, StyledDropdownFlyoutLabel, StyledDropdownFlyoutExpandIcon, EmptyState as EmptyState$1 } from '@procore/core-react';
4
4
  import classnames from 'classnames/bind';
5
5
  import debounce5 from 'lodash.debounce';
6
- import { Error as Error$1, Grip, Pencil, Building, Clear, Calendar as Calendar$1, ArrowDown, ArrowUp, CaretDown, CaretRight, CaretsInVertical, CaretsOutVerticalWithLine, CaretsOutVertical, CaretsIn, CaretsOut } from '@procore/core-icons';
6
+ import { Error as Error$1, Grip, ExternalLink, Pencil, Building, Clear, Calendar as Calendar$1, ArrowDown, ArrowUp, CaretDown, CaretRight, CaretsInVertical, CaretsOutVerticalWithLine, CaretsOutVertical, CaretsIn, CaretsOut } from '@procore/core-icons';
7
7
  import classNames from 'classnames';
8
8
  import { isDate, parseISO, isSameDay, formatISO, isBefore } from 'date-fns';
9
9
  import { formatNumber, formatCurrency, formatPercentage } from '@procore/labs-financials-utils';
10
+ import { format } from '@procore/labs-financials-utils/dist/format';
10
11
  import { detectPrng, factory } from 'ulid';
11
12
  import { useToastAlertContext, ToastAlertProvider } from '@procore/toast-alert';
12
13
  import ReactDOM, { createPortal } from 'react-dom';
@@ -1407,7 +1408,7 @@ ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
1407
1408
  animation-iteration-count: infinite;
1408
1409
  animation-name: ag-shake-left-to-right;
1409
1410
  }
1410
- @keyframes _ag-shake-left-to-right_1c24o_369 {
1411
+ @keyframes _ag-shake-left-to-right_1t4e8_369 {
1411
1412
  from {
1412
1413
  padding-left: 6px;
1413
1414
  padding-right: 2px;
@@ -5408,7 +5409,7 @@ input[class^=ag-][type=button]:focus, button[class^=ag-]:focus {
5408
5409
  animation-iteration-count: infinite;
5409
5410
  animation-timing-function: linear;
5410
5411
  }
5411
- @keyframes _spin_1c24o_1 {
5412
+ @keyframes _spin_1t4e8_1 {
5412
5413
  from {
5413
5414
  transform: rotate(0deg);
5414
5415
  }
@@ -7493,10 +7494,15 @@ input[class^=ag-][type=range]:disabled {
7493
7494
  }
7494
7495
  .ag-theme-alpine.ag-theme-alpine .ag-row--dt-active {
7495
7496
  background-color: #e4ecfb;
7496
- border-left: 4px solid #2066df;
7497
7497
  }
7498
- .ag-theme-alpine.ag-theme-alpine .ag-row--dt-active > .ag-cell {
7499
- padding-left: 12px;
7498
+ .ag-theme-alpine.ag-theme-alpine .ag-row--dt-active::before {
7499
+ background-color: #2066df;
7500
+ content: "";
7501
+ width: 4px;
7502
+ height: 100%;
7503
+ position: absolute;
7504
+ top: 0;
7505
+ left: 0;
7500
7506
  }
7501
7507
  .ag-theme-alpine.ag-theme-alpine .ag-row--dt-overdue span {
7502
7508
  color: #e61920;
@@ -7534,11 +7540,11 @@ input[class^=ag-][type=range]:disabled {
7534
7540
  }
7535
7541
  .ag-theme-alpine.ag-theme-alpine .ag-floating-bottom .ag-pinned-left-floating-bottom {
7536
7542
  z-index: 1;
7537
- box-shadow: 3px 0px 12px 0.5px hsl(200, 8%, 90%);
7543
+ box-shadow: 3px -10px 12px 0.5px hsl(200, 8%, 90%);
7538
7544
  border-right: 1px solid #d6dadc;
7539
7545
  }
7540
7546
  .ag-theme-alpine.ag-theme-alpine .ag-floating-bottom .ag-pinned-right-floating-bottom {
7541
- box-shadow: -3px 0px 12px 0.5px hsl(200, 8%, 90%);
7547
+ box-shadow: -3px -10px 12px 0.5px hsl(200, 8%, 90%);
7542
7548
  border-left: 1px solid #d6dadc;
7543
7549
  }
7544
7550
  .ag-theme-alpine.ag-theme-alpine .ag-group-value {
@@ -7553,17 +7559,17 @@ input[class^=ag-][type=range]:disabled {
7553
7559
  overflow: visible;
7554
7560
  }
7555
7561
  .ag-theme-alpine.ag-theme-alpine .ag-header .ag-pinned-left-header {
7556
- box-shadow: 3px 0px 12px 0.5px hsl(200, 8%, 90%);
7562
+ box-shadow: 3px -10px 12px 0.5px hsl(200, 8%, 90%);
7557
7563
  }
7558
7564
  .ag-theme-alpine.ag-theme-alpine .ag-pinned-left-cols-container {
7559
- box-shadow: 3px 0px 12px 0.5px hsl(200, 8%, 90%);
7565
+ box-shadow: 3px -10px 12px 0.5px hsl(200, 8%, 90%);
7560
7566
  border-right: 1px solid #d6dadc;
7561
7567
  }
7562
7568
  .ag-theme-alpine.ag-theme-alpine .ag-header .ag-pinned-right-header {
7563
- box-shadow: -3px 0px 12px 0.5px hsl(200, 8%, 90%);
7569
+ box-shadow: -3px -10px 12px 0.5px hsl(200, 8%, 90%);
7564
7570
  }
7565
7571
  .ag-theme-alpine.ag-theme-alpine .ag-pinned-right-cols-container {
7566
- box-shadow: -3px 0px 12px 0.5px hsl(200, 8%, 90%);
7572
+ box-shadow: -3px -10px 12px 0.5px hsl(200, 8%, 90%);
7567
7573
  border-left: 1px solid #d6dadc;
7568
7574
  }
7569
7575
  .ag-theme-alpine.ag-theme-alpine .ag-pinned-left-cols-container, .ag-theme-alpine.ag-theme-alpine .ag-pinned-right-cols-container {
@@ -7709,7 +7715,7 @@ input[class^=ag-][type=range]:disabled {
7709
7715
  .ag-theme-alpine.ag-theme-alpine .ag-details-row-auto-height .ag-center-cols-viewport, .ag-theme-alpine.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-viewport {
7710
7716
  min-height: 0px;
7711
7717
  }
7712
- .ag-theme-alpine.ag-theme-alpine .ag-overlay {
7718
+ .ag-theme-alpine.ag-theme-alpine .ag-overlay button {
7713
7719
  pointer-events: initial;
7714
7720
  }
7715
7721
  .ag-theme-alpine.ag-theme-alpine .ag-menu, .ag-theme-alpine.ag-theme-alpine .ag-menu-header {
@@ -7908,7 +7914,7 @@ input[class^=ag-][type=range]:disabled {
7908
7914
  padding-left: 16px;
7909
7915
  }
7910
7916
 
7911
- div._contextPanel_1c24o_7148 {
7917
+ div._contextPanel_1t4e8_7153 {
7912
7918
  width: 400px;
7913
7919
  transition: all ease 500ms;
7914
7920
  flex: 0 0 auto;
@@ -7917,7 +7923,7 @@ div._contextPanel_1c24o_7148 {
7917
7923
  border: 1px solid #d6dadc;
7918
7924
  display: flex;
7919
7925
  }
7920
- div._contextPanel--hidden_1c24o_7157 {
7926
+ div._contextPanel--hidden_1t4e8_7162 {
7921
7927
  border: none;
7922
7928
  overflow: hidden;
7923
7929
  padding: 0px;
@@ -7925,50 +7931,50 @@ div._contextPanel--hidden_1c24o_7157 {
7925
7931
  width: 0px;
7926
7932
  }
7927
7933
 
7928
- ._contextPanelWrapper_1c24o_7165 {
7934
+ ._contextPanelWrapper_1t4e8_7170 {
7929
7935
  position: relative;
7930
7936
  flex-grow: 1;
7931
7937
  }
7932
7938
 
7933
- ._contextPanelBody_1c24o_7170 {
7939
+ ._contextPanelBody_1t4e8_7175 {
7934
7940
  width: clamp(380px, 400px, 100%);
7935
7941
  }
7936
7942
 
7937
- ._contextPanel-stickyHeader_1c24o_7174 {
7943
+ ._contextPanel-stickyHeader_1t4e8_7179 {
7938
7944
  background-color: #ffffff;
7939
7945
  position: sticky;
7940
7946
  top: 0;
7941
7947
  z-index: 5;
7942
7948
  }
7943
7949
 
7944
- ._filters-list_1c24o_7181 {
7950
+ ._filters-list_1t4e8_7186 {
7945
7951
  padding: 0;
7946
7952
  margin: 0;
7947
7953
  }
7948
- ._filters-list_1c24o_7181 ol {
7954
+ ._filters-list_1t4e8_7186 ol {
7949
7955
  padding: 0;
7950
7956
  margin: 0;
7951
7957
  }
7952
7958
 
7953
- ._col-drag-column-icon_1c24o_7190 {
7959
+ ._col-drag-column-icon_1t4e8_7195 {
7954
7960
  color: #6a767c;
7955
7961
  }
7956
7962
 
7957
- ._tabular-nums_1c24o_7194 {
7963
+ ._tabular-nums_1t4e8_7199 {
7958
7964
  font-variant-numeric: tabular-nums;
7959
7965
  }`;
7960
7966
  document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
7961
7967
  var styles_default = {
7962
- "contextPanel": "_contextPanel_1c24o_7148",
7963
- "contextPanel--hidden": "_contextPanel--hidden_1c24o_7157",
7964
- "contextPanelWrapper": "_contextPanelWrapper_1c24o_7165",
7965
- "contextPanelBody": "_contextPanelBody_1c24o_7170",
7966
- "contextPanel-stickyHeader": "_contextPanel-stickyHeader_1c24o_7174",
7967
- "filters-list": "_filters-list_1c24o_7181",
7968
- "col-drag-column-icon": "_col-drag-column-icon_1c24o_7190",
7969
- "tabular-nums": "_tabular-nums_1c24o_7194",
7970
- "ag-shake-left-to-right": "_ag-shake-left-to-right_1c24o_369",
7971
- "spin": "_spin_1c24o_1"
7968
+ "contextPanel": "_contextPanel_1t4e8_7153",
7969
+ "contextPanel--hidden": "_contextPanel--hidden_1t4e8_7162",
7970
+ "contextPanelWrapper": "_contextPanelWrapper_1t4e8_7170",
7971
+ "contextPanelBody": "_contextPanelBody_1t4e8_7175",
7972
+ "contextPanel-stickyHeader": "_contextPanel-stickyHeader_1t4e8_7179",
7973
+ "filters-list": "_filters-list_1t4e8_7186",
7974
+ "col-drag-column-icon": "_col-drag-column-icon_1t4e8_7195",
7975
+ "tabular-nums": "_tabular-nums_1t4e8_7199",
7976
+ "ag-shake-left-to-right": "_ag-shake-left-to-right_1t4e8_369",
7977
+ "spin": "_spin_1t4e8_1"
7972
7978
  };
7973
7979
 
7974
7980
  // src/utils/getCellValueTypographyProps.ts
@@ -8642,12 +8648,12 @@ var DateCellValue = ({
8642
8648
  isGroup,
8643
8649
  value
8644
8650
  }) => {
8645
- const { format } = useDateTime();
8651
+ const { format: format2 } = useDateTime();
8646
8652
  if (isGroup || isEmptyValue(value)) {
8647
8653
  return null;
8648
8654
  }
8649
8655
  const parsedValue = getDateObject(value);
8650
- const internalValue = parsedValue ? format(
8656
+ const internalValue = parsedValue ? format2(
8651
8657
  parsedValue,
8652
8658
  columnDefinition.cellRendererParams?.dateFormatType || "numeric-date"
8653
8659
  ) : void 0;
@@ -8713,12 +8719,12 @@ var DateTimeCellValue = ({
8713
8719
  isGroup,
8714
8720
  value
8715
8721
  }) => {
8716
- const { format } = useDateTime();
8722
+ const { format: format2 } = useDateTime();
8717
8723
  if (isGroup || isEmptyValue(value)) {
8718
8724
  return null;
8719
8725
  }
8720
8726
  const parsedValue = getDateObject2(value);
8721
- const internalValue = parsedValue ? format(
8727
+ const internalValue = parsedValue ? format2(
8722
8728
  parsedValue,
8723
8729
  columnDefinition.cellRendererParams?.dateFormatType || "abbr-weekday-abbr-date-at-time"
8724
8730
  ) : void 0;
@@ -16639,7 +16645,7 @@ var calculateOrdinal = (value) => {
16639
16645
  }
16640
16646
  return "th";
16641
16647
  };
16642
- function dateToFormattedString(date, format = "YYYY-MM-DD") {
16648
+ function dateToFormattedString(date, format2 = "YYYY-MM-DD") {
16643
16649
  const fullYear = padStartWidthZeros(date.getFullYear(), 4);
16644
16650
  const months = [
16645
16651
  "January",
@@ -16683,7 +16689,7 @@ function dateToFormattedString(date, format = "YYYY-MM-DD") {
16683
16689
  d: () => `${date.getDay()}`
16684
16690
  };
16685
16691
  const regexp = new RegExp(Object.keys(replace).join("|"), "g");
16686
- return format.replace(regexp, (match) => {
16692
+ return format2.replace(regexp, (match) => {
16687
16693
  if (match in replace) {
16688
16694
  return replace[match]();
16689
16695
  }
@@ -21326,14 +21332,14 @@ var DateFilterModelFormatter = class extends SimpleFilterModelFormatter {
21326
21332
  const isRange = type == SimpleFilter.IN_RANGE || numberOfInputs === 2;
21327
21333
  const dateFrom = parseDateTimeFromString(condition.dateFrom);
21328
21334
  const dateTo = parseDateTimeFromString(condition.dateTo);
21329
- const format = this.dateFilterParams.inRangeFloatingFilterDateFormat;
21335
+ const format2 = this.dateFilterParams.inRangeFloatingFilterDateFormat;
21330
21336
  if (isRange) {
21331
- const formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom, format) : "null";
21332
- const formattedTo = dateTo !== null ? dateToFormattedString(dateTo, format) : "null";
21337
+ const formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom, format2) : "null";
21338
+ const formattedTo = dateTo !== null ? dateToFormattedString(dateTo, format2) : "null";
21333
21339
  return `${formattedFrom}-${formattedTo}`;
21334
21340
  }
21335
21341
  if (dateFrom != null) {
21336
- return dateToFormattedString(dateFrom, format);
21342
+ return dateToFormattedString(dateFrom, format2);
21337
21343
  }
21338
21344
  return `${type}`;
21339
21345
  }
@@ -52955,7 +52961,27 @@ var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, va
52955
52961
  if (isGroup) {
52956
52962
  return /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, className, weight: "semibold" }, value);
52957
52963
  }
52964
+ const isExternalLink = columnDefinition.cellRendererParams.isExternalLink ?? false;
52958
52965
  const URL = columnDefinition.cellRendererParams.getURL(value, data);
52966
+ if (isExternalLink && value && URL) {
52967
+ return /* @__PURE__ */ React76.createElement(
52968
+ Typography,
52969
+ {
52970
+ ...typographyProps,
52971
+ className,
52972
+ style: { display: "flex", alignItems: "center", gap: "5px" }
52973
+ },
52974
+ internalValue,
52975
+ /* @__PURE__ */ React76.createElement(
52976
+ ExternalLink,
52977
+ {
52978
+ cursor: "pointer",
52979
+ size: "sm",
52980
+ onClick: () => window.open(URL, "_blank")
52981
+ }
52982
+ )
52983
+ );
52984
+ }
52959
52985
  return URL ? /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, className }, /* @__PURE__ */ React76.createElement(Link, { href: URL }, internalValue)) : /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps }, internalValue);
52960
52986
  };
52961
52987
  var LinkCellRenderer = withDataTableRenderer(
@@ -52983,9 +53009,10 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
52983
53009
  }
52984
53010
  return /* @__PURE__ */ React76.createElement(React76.Fragment, null);
52985
53011
  }
52986
- const internalValue = formatNumber(value, {
53012
+ const internalValue = format(value, {
52987
53013
  maxDecimalPrecision: 15,
52988
53014
  minDecimalPrecision: 0,
53015
+ shouldUseGtk: true,
52989
53016
  symbol: "",
52990
53017
  ...columnDefinition.cellRendererParams?.formatConfig
52991
53018
  });
@@ -53366,7 +53393,7 @@ var Renderer9 = ({
53366
53393
  value,
53367
53394
  rowPinned
53368
53395
  }) => {
53369
- const { getColor } = columnDefinition.cellRendererParams;
53396
+ const { getColor, displayAsPill } = columnDefinition.cellRendererParams;
53370
53397
  const I18n = useI18nContext();
53371
53398
  if (isEmptyValue(value)) {
53372
53399
  if (isGroup) {
@@ -53392,7 +53419,7 @@ var Renderer9 = ({
53392
53419
  const typographyProps = getCellValueTypographyProps(
53393
53420
  columnDefinition.cellRendererParams?.typographyProps
53394
53421
  );
53395
- if (isGroup || rowPinned && columnDefinition.aggFunc) {
53422
+ if ((isGroup || rowPinned && columnDefinition.aggFunc) && !displayAsPill) {
53396
53423
  return /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, weight: "semibold" }, label);
53397
53424
  }
53398
53425
  return /* @__PURE__ */ React76.createElement(Pill, { color: getColor(value), className: cx10("pill-cell") }, label);
@@ -54796,8 +54823,8 @@ function transformToExcelStyles(excelDataFormats) {
54796
54823
  if (excelDataFormats === void 0) {
54797
54824
  return void 0;
54798
54825
  }
54799
- return excelDataFormats.map((format) => {
54800
- const { id, ...rest } = format;
54826
+ return excelDataFormats.map((format2) => {
54827
+ const { id, ...rest } = format2;
54801
54828
  return {
54802
54829
  id: toExcelCellClass(id),
54803
54830
  ...rest
@@ -55853,6 +55880,8 @@ var DataTableCellRenderer = ({
55853
55880
  value
55854
55881
  };
55855
55882
  const hasValue = value !== void 0 && value !== null && value !== "";
55883
+ const isSelectCellComponent = columnDefinition.cellEditor?.render?.displayName === "SelectCellEditor";
55884
+ const URL = isSelectCellComponent && columnDefinition?.cellRendererParams?.getURL ? columnDefinition.cellRendererParams.getURL(value) : null;
55856
55885
  const startEditing = useCallback(
55857
55886
  () => api.startEditingCell({
55858
55887
  rowIndex: node.rowIndex,
@@ -55860,34 +55889,54 @@ var DataTableCellRenderer = ({
55860
55889
  }),
55861
55890
  [column2, node]
55862
55891
  );
55863
- return /* @__PURE__ */ React76.createElement(React76.Fragment, null, shouldDisplayRowCheckbox(columnApi, column2, node) && /* @__PURE__ */ React76.createElement(Box, { paddingLeft: "sm" }, /* @__PURE__ */ React76.createElement(RowCheckbox, { api, data, node })), columnDefinition.editable ? /* @__PURE__ */ React76.createElement(
55864
- PseudoInlineEditorWrapper,
55865
- {
55866
- showArrow: editorType === "select",
55867
- onClick: startEditing,
55868
- onClear: columnDefinition.cellEditorParams?.clearable && hasValue ? () => {
55869
- setValue?.(null);
55870
- } : void 0,
55871
- showCalendar: editorType === "date",
55872
- rightAligned: colDef.type === "rightAligned",
55873
- hasValue,
55874
- alwaysShowEditors: columnDefinition.cellEditorParams?.alwaysShowPseudoEditors,
55875
- ...validationOutput
55876
- },
55877
- /* @__PURE__ */ React76.createElement(Component4, { ...componentParams })
55878
- ) : /* @__PURE__ */ React76.createElement(
55879
- NonEditorWrapper,
55892
+ return /* @__PURE__ */ React76.createElement(React76.Fragment, null, shouldDisplayRowCheckbox(columnApi, column2, node) && /* @__PURE__ */ React76.createElement(Box, { paddingLeft: "sm" }, /* @__PURE__ */ React76.createElement(RowCheckbox, { api, data, node })), /* @__PURE__ */ React76.createElement(
55893
+ Flex,
55880
55894
  {
55881
- rightAligned: colDef.type === "rightAligned",
55882
- ...validationOutput,
55883
- rowPinned: Boolean(componentParams.rowPinned),
55884
- isGroup: Boolean(componentParams.isGroup)
55895
+ gap: "5px",
55896
+ alignItems: "center",
55897
+ justifyContent: "center",
55898
+ style: { width: "100%" }
55885
55899
  },
55886
- /* @__PURE__ */ React76.createElement(
55887
- Component4,
55900
+ columnDefinition.editable ? /* @__PURE__ */ React76.createElement(
55901
+ PseudoInlineEditorWrapper,
55902
+ {
55903
+ showArrow: editorType === "select",
55904
+ onClick: startEditing,
55905
+ onClear: columnDefinition.cellEditorParams?.clearable && hasValue ? () => {
55906
+ setValue?.(null);
55907
+ } : void 0,
55908
+ showCalendar: editorType === "date",
55909
+ rightAligned: colDef.type === "rightAligned",
55910
+ hasValue,
55911
+ alwaysShowEditors: columnDefinition.cellEditorParams?.alwaysShowPseudoEditors,
55912
+ ...validationOutput
55913
+ },
55914
+ /* @__PURE__ */ React76.createElement(Component4, { ...componentParams })
55915
+ ) : /* @__PURE__ */ React76.createElement(
55916
+ NonEditorWrapper,
55917
+ {
55918
+ rightAligned: colDef.type === "rightAligned",
55919
+ ...validationOutput,
55920
+ rowPinned: Boolean(componentParams.rowPinned),
55921
+ isGroup: Boolean(componentParams.isGroup)
55922
+ },
55923
+ /* @__PURE__ */ React76.createElement(
55924
+ Component4,
55925
+ {
55926
+ ...componentParams,
55927
+ tableRef: columnDefinition.cellRendererParams.tableRef
55928
+ }
55929
+ )
55930
+ ),
55931
+ URL && /* @__PURE__ */ React76.createElement(
55932
+ ExternalLink,
55888
55933
  {
55889
- ...componentParams,
55890
- tableRef: columnDefinition.cellRendererParams.tableRef
55934
+ cursor: "pointer",
55935
+ size: "sm",
55936
+ onClick: (e) => {
55937
+ e.stopPropagation();
55938
+ window.open(URL, "_blank");
55939
+ }
55891
55940
  }
55892
55941
  )
55893
55942
  ));
@@ -56164,6 +56213,7 @@ var getMainMenuItems = (props, I18n) => {
56164
56213
  }),
56165
56214
  value: "rowUnGroup",
56166
56215
  action() {
56216
+ props.columnApi.resetColumnState();
56167
56217
  props.columnApi.removeRowGroupColumn(props.column);
56168
56218
  }
56169
56219
  };
@@ -56173,6 +56223,7 @@ var getMainMenuItems = (props, I18n) => {
56173
56223
  }),
56174
56224
  value: "rowGroup",
56175
56225
  action() {
56226
+ props.columnApi.resetColumnState();
56176
56227
  props.columnApi.addRowGroupColumn(props.column);
56177
56228
  }
56178
56229
  };
@@ -61429,14 +61480,14 @@ var protection_default = protection;
61429
61480
  // ../../node_modules/@ag-grid-enterprise/excel-export/dist/esm/es6/excelExport/files/xml/styles/numberFormat.mjs
61430
61481
  var numberFormat = {
61431
61482
  getTemplate(styleProperties) {
61432
- const { format } = styleProperties.numberFormat;
61483
+ const { format: format2 } = styleProperties.numberFormat;
61433
61484
  return {
61434
61485
  name: "NumberFormat",
61435
61486
  properties: {
61436
61487
  prefixedAttributes: [{
61437
61488
  prefix: "ss:",
61438
61489
  map: {
61439
- Format: format
61490
+ Format: format2
61440
61491
  }
61441
61492
  }]
61442
61493
  }
@@ -63387,15 +63438,15 @@ var registerFill = (fill) => {
63387
63438
  }
63388
63439
  return pos;
63389
63440
  };
63390
- var registerNumberFmt = (format) => {
63391
- format = _.utf8_encode(format);
63392
- if (numberFormatMap[format]) {
63393
- return numberFormatMap[format];
63441
+ var registerNumberFmt = (format2) => {
63442
+ format2 = _.utf8_encode(format2);
63443
+ if (numberFormatMap[format2]) {
63444
+ return numberFormatMap[format2];
63394
63445
  }
63395
- let pos = registeredNumberFmts.findIndex((currentFormat) => currentFormat.formatCode === format);
63446
+ let pos = registeredNumberFmts.findIndex((currentFormat) => currentFormat.formatCode === format2);
63396
63447
  if (pos === -1) {
63397
63448
  pos = registeredNumberFmts.length + 164;
63398
- registeredNumberFmts.push({ formatCode: format, numFmtId: pos });
63449
+ registeredNumberFmts.push({ formatCode: format2, numFmtId: pos });
63399
63450
  } else {
63400
63451
  pos = registeredNumberFmts[pos].numFmtId;
63401
63452
  }
@@ -80515,44 +80566,73 @@ function generateHTMLString({
80515
80566
  if (exportedDocument.querySelector(".ag-header-container") && showTableHeaderOnEveryPage) {
80516
80567
  const tableHeaderStylesElement = exportedDocument.createElement("style");
80517
80568
  tableHeaderStylesElement.innerHTML = `
80569
+ /* Original header styles */
80518
80570
  .ag-header-container {
80519
80571
  height: ${TABLE_HEADER_HEIGHT}px;
80520
80572
  background: ${colors.gray96};
80521
80573
  border-bottom: 1px solid #d6dadc;
80522
- break-before: page;
80574
+ }
80575
+ /* Cloned header styles */
80576
+ .paginated-header {
80577
+ height: ${TABLE_HEADER_HEIGHT}px;
80578
+ background: ${colors.gray96};
80579
+ border-bottom: 1px solid #d6dadc;
80580
+ /* Ensure cloned headers start on a new page */
80581
+ page-break-before: always;
80523
80582
  }
80524
80583
  `;
80525
80584
  exportedDocument.head.appendChild(tableHeaderStylesElement);
80526
- const tableHeader = exportedDocument.querySelector(".ag-header-container").cloneNode(true);
80585
+ const tableHeaderElement = exportedDocument.querySelector(
80586
+ ".ag-header-container"
80587
+ );
80588
+ if (!tableHeaderElement) {
80589
+ return reject(new Error("Table header container not found."));
80590
+ }
80591
+ const tableHeader = tableHeaderElement.cloneNode(true);
80592
+ tableHeader.classList.add("paginated-header");
80527
80593
  const tableRowsContainer = exportedDocument.querySelector(
80528
80594
  ".ag-center-cols-container"
80529
80595
  );
80530
- const totalRows = tableRowsContainer.children.length;
80531
- const maxPageContentHeight = pageHeight - pageFormat.marginInPixels.top - pageFormat.marginInPixels.bottom;
80532
- let pageContentHeight = TABLE_HEADER_HEIGHT;
80533
- let currentPage = 1;
80534
- for (let index = 0; index < totalRows; index++) {
80535
- const getScaledRowHeight = (row3) => {
80536
- const scale = pageHeight / tableWidth;
80537
- let rowHeight2 = Number(row3.style.height.replace("px", ""));
80538
- if (scale < 1) {
80539
- rowHeight2 *= scale;
80596
+ if (!tableRowsContainer) {
80597
+ console.error("Table rows container not found.");
80598
+ return;
80599
+ }
80600
+ const allRows = Array.from(
80601
+ tableRowsContainer.children
80602
+ );
80603
+ tableRowsContainer.innerHTML = "";
80604
+ const maxPageContentHeight = pageHeight - (pageFormat.marginInPixels?.top ?? DEFAULT_PAGE_MARGIN) - (pageFormat.marginInPixels?.bottom ?? DEFAULT_PAGE_MARGIN) - TABLE_HEADER_HEIGHT;
80605
+ let currentPageContentHeight = 0;
80606
+ let rowsInCurrentPage = [];
80607
+ let isFirstPage = true;
80608
+ const appendPage = () => {
80609
+ if (rowsInCurrentPage.length > 0) {
80610
+ if (!isFirstPage) {
80611
+ tableRowsContainer.appendChild(tableHeader.cloneNode(true));
80612
+ } else {
80613
+ isFirstPage = false;
80540
80614
  }
80541
- return rowHeight2;
80542
- };
80543
- const row2 = tableRowsContainer.children[index + currentPage - 1];
80544
- const rowHeight = getScaledRowHeight(row2);
80545
- if (pageContentHeight + rowHeight >= maxPageContentHeight) {
80546
- tableRowsContainer.insertBefore(
80547
- tableHeader.cloneNode(true),
80548
- row2
80615
+ rowsInCurrentPage.forEach(
80616
+ (row2) => tableRowsContainer.appendChild(row2)
80549
80617
  );
80550
- currentPage += 1;
80551
- pageContentHeight = TABLE_HEADER_HEIGHT;
80552
- } else {
80553
- pageContentHeight += rowHeight;
80618
+ rowsInCurrentPage = [];
80619
+ currentPageContentHeight = 0;
80554
80620
  }
80555
- }
80621
+ };
80622
+ allRows.forEach((row2) => {
80623
+ let rowHeight = parseFloat(row2.style.height.replace("px", "")) || row2.offsetHeight;
80624
+ const scale = pageHeight / tableWidth;
80625
+ if (scale < 1) {
80626
+ rowHeight *= scale;
80627
+ }
80628
+ if (currentPageContentHeight + rowHeight > maxPageContentHeight) {
80629
+ appendPage();
80630
+ isFirstPage = false;
80631
+ }
80632
+ rowsInCurrentPage.push(row2);
80633
+ currentPageContentHeight += rowHeight;
80634
+ });
80635
+ appendPage();
80556
80636
  }
80557
80637
  resolve(exportedDocument.getElementsByTagName("html")[0].outerHTML);
80558
80638
  }, 2e3);
@@ -82392,7 +82472,7 @@ var Table = (props) => {
82392
82472
  groupDefaultExpanded: props.groupsAlwaysExpanded ? -1 : props.groupDefaultExpanded,
82393
82473
  groupIncludeFooter: !onSSDR && props.groupIncludeFooter === void 0 ? true : props.groupIncludeFooter,
82394
82474
  getGroupRowAgg: props.getGroupRowAgg ? getGroupRowAgg : void 0,
82395
- groupSelectsChildren: props.groupSelectsChildren || !onSSDR,
82475
+ groupSelectsChildren: internalTableContext.totalRowCount > 0 && props.groupSelectsChildren || !onSSDR,
82396
82476
  groupSelectsFiltered: true,
82397
82477
  headerHeight: props.headerHeight,
82398
82478
  icons: tableIcons,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/data-table",
3
- "version": "14.14.0",
3
+ "version": "14.16.0",
4
4
  "description": "Complex data grid built on top of ag-grid, with DST components and styles.",
5
5
  "type": "module",
6
6
  "main": "dist/legacy/index.cjs",
@@ -111,7 +111,7 @@
111
111
  "@procore/core-css": "10.17.0",
112
112
  "@procore/core-icons": "12.2.0",
113
113
  "@procore/core-prettier": "10.2.0",
114
- "@procore/core-react": "12.11.0",
114
+ "@procore/core-react": "12.12.1",
115
115
  "@procore/eslint-config": "10.0.0",
116
116
  "@procore/globalization-toolkit": "3.1.0",
117
117
  "@procore/labs-financials-utils": "3.0.1",