@procore/data-table 14.13.0 → 14.15.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.
- package/CHANGELOG.md +24 -0
- package/dist/legacy/index.cjs +337 -118
- package/dist/legacy/index.d.cts +12 -0
- package/dist/legacy/index.d.ts +12 -0
- package/dist/legacy/index.js +338 -119
- package/dist/modern/index.cjs +322 -106
- package/dist/modern/index.d.cts +12 -0
- package/dist/modern/index.d.ts +12 -0
- package/dist/modern/index.js +323 -107
- package/package.json +3 -3
package/dist/legacy/index.js
CHANGED
|
@@ -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';
|
|
@@ -1409,7 +1410,7 @@ ag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {
|
|
|
1409
1410
|
animation-iteration-count: infinite;
|
|
1410
1411
|
animation-name: ag-shake-left-to-right;
|
|
1411
1412
|
}
|
|
1412
|
-
@keyframes _ag-shake-left-to-
|
|
1413
|
+
@keyframes _ag-shake-left-to-right_ye2ai_369 {
|
|
1413
1414
|
from {
|
|
1414
1415
|
padding-left: 6px;
|
|
1415
1416
|
padding-right: 2px;
|
|
@@ -5410,7 +5411,7 @@ input[class^=ag-][type=button]:focus, button[class^=ag-]:focus {
|
|
|
5410
5411
|
animation-iteration-count: infinite;
|
|
5411
5412
|
animation-timing-function: linear;
|
|
5412
5413
|
}
|
|
5413
|
-
@keyframes
|
|
5414
|
+
@keyframes _spin_ye2ai_1 {
|
|
5414
5415
|
from {
|
|
5415
5416
|
transform: rotate(0deg);
|
|
5416
5417
|
}
|
|
@@ -7495,10 +7496,15 @@ input[class^=ag-][type=range]:disabled {
|
|
|
7495
7496
|
}
|
|
7496
7497
|
.ag-theme-alpine.ag-theme-alpine .ag-row--dt-active {
|
|
7497
7498
|
background-color: #e4ecfb;
|
|
7498
|
-
border-left: 4px solid #2066df;
|
|
7499
7499
|
}
|
|
7500
|
-
.ag-theme-alpine.ag-theme-alpine .ag-row--dt-active
|
|
7501
|
-
|
|
7500
|
+
.ag-theme-alpine.ag-theme-alpine .ag-row--dt-active::before {
|
|
7501
|
+
background-color: #2066df;
|
|
7502
|
+
content: "";
|
|
7503
|
+
width: 4px;
|
|
7504
|
+
height: 100%;
|
|
7505
|
+
position: absolute;
|
|
7506
|
+
top: 0;
|
|
7507
|
+
left: 0;
|
|
7502
7508
|
}
|
|
7503
7509
|
.ag-theme-alpine.ag-theme-alpine .ag-row--dt-overdue span {
|
|
7504
7510
|
color: #e61920;
|
|
@@ -7910,7 +7916,7 @@ input[class^=ag-][type=range]:disabled {
|
|
|
7910
7916
|
padding-left: 16px;
|
|
7911
7917
|
}
|
|
7912
7918
|
|
|
7913
|
-
div.
|
|
7919
|
+
div._contextPanel_ye2ai_7153 {
|
|
7914
7920
|
width: 400px;
|
|
7915
7921
|
transition: all ease 500ms;
|
|
7916
7922
|
flex: 0 0 auto;
|
|
@@ -7919,7 +7925,7 @@ div._contextPanel_1c24o_7148 {
|
|
|
7919
7925
|
border: 1px solid #d6dadc;
|
|
7920
7926
|
display: flex;
|
|
7921
7927
|
}
|
|
7922
|
-
div._contextPanel--
|
|
7928
|
+
div._contextPanel--hidden_ye2ai_7162 {
|
|
7923
7929
|
border: none;
|
|
7924
7930
|
overflow: hidden;
|
|
7925
7931
|
padding: 0px;
|
|
@@ -7927,50 +7933,50 @@ div._contextPanel--hidden_1c24o_7157 {
|
|
|
7927
7933
|
width: 0px;
|
|
7928
7934
|
}
|
|
7929
7935
|
|
|
7930
|
-
.
|
|
7936
|
+
._contextPanelWrapper_ye2ai_7170 {
|
|
7931
7937
|
position: relative;
|
|
7932
7938
|
flex-grow: 1;
|
|
7933
7939
|
}
|
|
7934
7940
|
|
|
7935
|
-
.
|
|
7941
|
+
._contextPanelBody_ye2ai_7175 {
|
|
7936
7942
|
width: clamp(380px, 400px, 100%);
|
|
7937
7943
|
}
|
|
7938
7944
|
|
|
7939
|
-
._contextPanel-
|
|
7945
|
+
._contextPanel-stickyHeader_ye2ai_7179 {
|
|
7940
7946
|
background-color: #ffffff;
|
|
7941
7947
|
position: sticky;
|
|
7942
7948
|
top: 0;
|
|
7943
7949
|
z-index: 5;
|
|
7944
7950
|
}
|
|
7945
7951
|
|
|
7946
|
-
._filters-
|
|
7952
|
+
._filters-list_ye2ai_7186 {
|
|
7947
7953
|
padding: 0;
|
|
7948
7954
|
margin: 0;
|
|
7949
7955
|
}
|
|
7950
|
-
._filters-
|
|
7956
|
+
._filters-list_ye2ai_7186 ol {
|
|
7951
7957
|
padding: 0;
|
|
7952
7958
|
margin: 0;
|
|
7953
7959
|
}
|
|
7954
7960
|
|
|
7955
|
-
._col-drag-column-
|
|
7961
|
+
._col-drag-column-icon_ye2ai_7195 {
|
|
7956
7962
|
color: #6a767c;
|
|
7957
7963
|
}
|
|
7958
7964
|
|
|
7959
|
-
._tabular-
|
|
7965
|
+
._tabular-nums_ye2ai_7199 {
|
|
7960
7966
|
font-variant-numeric: tabular-nums;
|
|
7961
7967
|
}`;
|
|
7962
7968
|
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
7963
7969
|
var styles_default = {
|
|
7964
|
-
"contextPanel": "
|
|
7965
|
-
"contextPanel--hidden": "_contextPanel--
|
|
7966
|
-
"contextPanelWrapper": "
|
|
7967
|
-
"contextPanelBody": "
|
|
7968
|
-
"contextPanel-stickyHeader": "_contextPanel-
|
|
7969
|
-
"filters-list": "_filters-
|
|
7970
|
-
"col-drag-column-icon": "_col-drag-column-
|
|
7971
|
-
"tabular-nums": "_tabular-
|
|
7972
|
-
"ag-shake-left-to-right": "_ag-shake-left-to-
|
|
7973
|
-
"spin": "
|
|
7970
|
+
"contextPanel": "_contextPanel_ye2ai_7153",
|
|
7971
|
+
"contextPanel--hidden": "_contextPanel--hidden_ye2ai_7162",
|
|
7972
|
+
"contextPanelWrapper": "_contextPanelWrapper_ye2ai_7170",
|
|
7973
|
+
"contextPanelBody": "_contextPanelBody_ye2ai_7175",
|
|
7974
|
+
"contextPanel-stickyHeader": "_contextPanel-stickyHeader_ye2ai_7179",
|
|
7975
|
+
"filters-list": "_filters-list_ye2ai_7186",
|
|
7976
|
+
"col-drag-column-icon": "_col-drag-column-icon_ye2ai_7195",
|
|
7977
|
+
"tabular-nums": "_tabular-nums_ye2ai_7199",
|
|
7978
|
+
"ag-shake-left-to-right": "_ag-shake-left-to-right_ye2ai_369",
|
|
7979
|
+
"spin": "_spin_ye2ai_1"
|
|
7974
7980
|
};
|
|
7975
7981
|
|
|
7976
7982
|
// src/utils/getCellValueTypographyProps.ts
|
|
@@ -8651,12 +8657,12 @@ var DateCellValue = ({
|
|
|
8651
8657
|
value
|
|
8652
8658
|
}) => {
|
|
8653
8659
|
var _a, _b;
|
|
8654
|
-
const { format } = useDateTime();
|
|
8660
|
+
const { format: format2 } = useDateTime();
|
|
8655
8661
|
if (isGroup || isEmptyValue(value)) {
|
|
8656
8662
|
return null;
|
|
8657
8663
|
}
|
|
8658
8664
|
const parsedValue = getDateObject(value);
|
|
8659
|
-
const internalValue = parsedValue ?
|
|
8665
|
+
const internalValue = parsedValue ? format2(
|
|
8660
8666
|
parsedValue,
|
|
8661
8667
|
((_a = columnDefinition.cellRendererParams) == null ? void 0 : _a.dateFormatType) || "numeric-date"
|
|
8662
8668
|
) : void 0;
|
|
@@ -8725,12 +8731,12 @@ var DateTimeCellValue = ({
|
|
|
8725
8731
|
value
|
|
8726
8732
|
}) => {
|
|
8727
8733
|
var _a, _b;
|
|
8728
|
-
const { format } = useDateTime();
|
|
8734
|
+
const { format: format2 } = useDateTime();
|
|
8729
8735
|
if (isGroup || isEmptyValue(value)) {
|
|
8730
8736
|
return null;
|
|
8731
8737
|
}
|
|
8732
8738
|
const parsedValue = getDateObject2(value);
|
|
8733
|
-
const internalValue = parsedValue ?
|
|
8739
|
+
const internalValue = parsedValue ? format2(
|
|
8734
8740
|
parsedValue,
|
|
8735
8741
|
((_a = columnDefinition.cellRendererParams) == null ? void 0 : _a.dateFormatType) || "abbr-weekday-abbr-date-at-time"
|
|
8736
8742
|
) : void 0;
|
|
@@ -16653,7 +16659,7 @@ var calculateOrdinal = (value) => {
|
|
|
16653
16659
|
}
|
|
16654
16660
|
return "th";
|
|
16655
16661
|
};
|
|
16656
|
-
function dateToFormattedString(date,
|
|
16662
|
+
function dateToFormattedString(date, format2 = "YYYY-MM-DD") {
|
|
16657
16663
|
const fullYear = padStartWidthZeros(date.getFullYear(), 4);
|
|
16658
16664
|
const months = [
|
|
16659
16665
|
"January",
|
|
@@ -16697,7 +16703,7 @@ function dateToFormattedString(date, format = "YYYY-MM-DD") {
|
|
|
16697
16703
|
d: () => `${date.getDay()}`
|
|
16698
16704
|
};
|
|
16699
16705
|
const regexp = new RegExp(Object.keys(replace).join("|"), "g");
|
|
16700
|
-
return
|
|
16706
|
+
return format2.replace(regexp, (match) => {
|
|
16701
16707
|
if (match in replace) {
|
|
16702
16708
|
return replace[match]();
|
|
16703
16709
|
}
|
|
@@ -21340,14 +21346,14 @@ var DateFilterModelFormatter = class extends SimpleFilterModelFormatter {
|
|
|
21340
21346
|
const isRange = type == SimpleFilter.IN_RANGE || numberOfInputs === 2;
|
|
21341
21347
|
const dateFrom = parseDateTimeFromString(condition.dateFrom);
|
|
21342
21348
|
const dateTo = parseDateTimeFromString(condition.dateTo);
|
|
21343
|
-
const
|
|
21349
|
+
const format2 = this.dateFilterParams.inRangeFloatingFilterDateFormat;
|
|
21344
21350
|
if (isRange) {
|
|
21345
|
-
const formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom,
|
|
21346
|
-
const formattedTo = dateTo !== null ? dateToFormattedString(dateTo,
|
|
21351
|
+
const formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom, format2) : "null";
|
|
21352
|
+
const formattedTo = dateTo !== null ? dateToFormattedString(dateTo, format2) : "null";
|
|
21347
21353
|
return `${formattedFrom}-${formattedTo}`;
|
|
21348
21354
|
}
|
|
21349
21355
|
if (dateFrom != null) {
|
|
21350
|
-
return dateToFormattedString(dateFrom,
|
|
21356
|
+
return dateToFormattedString(dateFrom, format2);
|
|
21351
21357
|
}
|
|
21352
21358
|
return `${type}`;
|
|
21353
21359
|
}
|
|
@@ -52970,7 +52976,27 @@ var InternalLinkCellRenderer = ({ columnDefinition, isGroup, data, rowHeight, va
|
|
|
52970
52976
|
if (isGroup) {
|
|
52971
52977
|
return /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, className, weight: "semibold" }, value);
|
|
52972
52978
|
}
|
|
52979
|
+
const isExternalLink = columnDefinition.cellRendererParams.isExternalLink ?? false;
|
|
52973
52980
|
const URL = columnDefinition.cellRendererParams.getURL(value, data);
|
|
52981
|
+
if (isExternalLink && value && URL) {
|
|
52982
|
+
return /* @__PURE__ */ React76.createElement(
|
|
52983
|
+
Typography,
|
|
52984
|
+
{
|
|
52985
|
+
...typographyProps,
|
|
52986
|
+
className,
|
|
52987
|
+
style: { display: "flex", alignItems: "center", gap: "5px" }
|
|
52988
|
+
},
|
|
52989
|
+
internalValue,
|
|
52990
|
+
/* @__PURE__ */ React76.createElement(
|
|
52991
|
+
ExternalLink,
|
|
52992
|
+
{
|
|
52993
|
+
cursor: "pointer",
|
|
52994
|
+
size: "sm",
|
|
52995
|
+
onClick: () => window.open(URL, "_blank")
|
|
52996
|
+
}
|
|
52997
|
+
)
|
|
52998
|
+
);
|
|
52999
|
+
}
|
|
52974
53000
|
return URL ? /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, className }, /* @__PURE__ */ React76.createElement(Link, { href: URL }, internalValue)) : /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps }, internalValue);
|
|
52975
53001
|
};
|
|
52976
53002
|
var LinkCellRenderer = withDataTableRenderer(
|
|
@@ -52999,9 +53025,10 @@ var InternalNumberCellRenderer = ({ columnDefinition, rowPinned, isGroup, value
|
|
|
52999
53025
|
}
|
|
53000
53026
|
return /* @__PURE__ */ React76.createElement(React76.Fragment, null);
|
|
53001
53027
|
}
|
|
53002
|
-
const internalValue =
|
|
53028
|
+
const internalValue = format(value, {
|
|
53003
53029
|
maxDecimalPrecision: 15,
|
|
53004
53030
|
minDecimalPrecision: 0,
|
|
53031
|
+
shouldUseGtk: true,
|
|
53005
53032
|
symbol: "",
|
|
53006
53033
|
...(_d = columnDefinition.cellRendererParams) == null ? void 0 : _d.formatConfig
|
|
53007
53034
|
});
|
|
@@ -53393,7 +53420,7 @@ var Renderer9 = ({
|
|
|
53393
53420
|
rowPinned
|
|
53394
53421
|
}) => {
|
|
53395
53422
|
var _a, _b, _c, _d;
|
|
53396
|
-
const { getColor } = columnDefinition.cellRendererParams;
|
|
53423
|
+
const { getColor, displayAsPill } = columnDefinition.cellRendererParams;
|
|
53397
53424
|
const I18n = useI18nContext();
|
|
53398
53425
|
if (isEmptyValue(value)) {
|
|
53399
53426
|
if (isGroup) {
|
|
@@ -53419,10 +53446,10 @@ var Renderer9 = ({
|
|
|
53419
53446
|
const typographyProps = getCellValueTypographyProps(
|
|
53420
53447
|
(_d = columnDefinition.cellRendererParams) == null ? void 0 : _d.typographyProps
|
|
53421
53448
|
);
|
|
53422
|
-
if (isGroup || rowPinned && columnDefinition.aggFunc) {
|
|
53449
|
+
if ((isGroup || rowPinned && columnDefinition.aggFunc) && !displayAsPill) {
|
|
53423
53450
|
return /* @__PURE__ */ React76.createElement(Typography, { ...typographyProps, weight: "semibold" }, label);
|
|
53424
53451
|
}
|
|
53425
|
-
return /* @__PURE__ */ React76.createElement(Pill, { color: getColor(value), className: cx10("pill-cell") }, label
|
|
53452
|
+
return /* @__PURE__ */ React76.createElement(Pill, { color: getColor(value), className: cx10("pill-cell") }, label);
|
|
53426
53453
|
};
|
|
53427
53454
|
var PillCellRenderer = withDataTableRenderer(Renderer9, "select");
|
|
53428
53455
|
var Editor5 = React76.forwardRef(
|
|
@@ -53459,7 +53486,7 @@ var Editor5 = React76.forwardRef(
|
|
|
53459
53486
|
function getLabel3(item) {
|
|
53460
53487
|
var _a2;
|
|
53461
53488
|
const unformattedLabel = ((_a2 = columnDefinition.getStringFormattedValue) == null ? void 0 : _a2.call(columnDefinition, item)) || "";
|
|
53462
|
-
return unformattedLabel
|
|
53489
|
+
return unformattedLabel;
|
|
53463
53490
|
}
|
|
53464
53491
|
return /* @__PURE__ */ React76.createElement(
|
|
53465
53492
|
PillSelect,
|
|
@@ -54858,8 +54885,8 @@ function transformToExcelStyles(excelDataFormats) {
|
|
|
54858
54885
|
if (excelDataFormats === void 0) {
|
|
54859
54886
|
return void 0;
|
|
54860
54887
|
}
|
|
54861
|
-
return excelDataFormats.map((
|
|
54862
|
-
const { id, ...rest } =
|
|
54888
|
+
return excelDataFormats.map((format2) => {
|
|
54889
|
+
const { id, ...rest } = format2;
|
|
54863
54890
|
return {
|
|
54864
54891
|
id: toExcelCellClass(id),
|
|
54865
54892
|
...rest
|
|
@@ -55900,7 +55927,7 @@ var DataTableCellRenderer = ({
|
|
|
55900
55927
|
value,
|
|
55901
55928
|
setValue
|
|
55902
55929
|
}) => {
|
|
55903
|
-
var _a, _b, _c;
|
|
55930
|
+
var _a, _b, _c, _d, _e, _f;
|
|
55904
55931
|
const { columnApi } = useInternalTableContext();
|
|
55905
55932
|
const columnDefinition = transformToColumnDefinition(colDef);
|
|
55906
55933
|
const validationOutput = ((_a = colDef.valueValidator) == null ? void 0 : _a.call(colDef, {
|
|
@@ -55935,6 +55962,8 @@ var DataTableCellRenderer = ({
|
|
|
55935
55962
|
value
|
|
55936
55963
|
};
|
|
55937
55964
|
const hasValue = value !== void 0 && value !== null && value !== "";
|
|
55965
|
+
const isSelectCellComponent = ((_c = (_b = columnDefinition.cellEditor) == null ? void 0 : _b.render) == null ? void 0 : _c.displayName) === "SelectCellEditor";
|
|
55966
|
+
const URL = isSelectCellComponent && ((_d = columnDefinition == null ? void 0 : columnDefinition.cellRendererParams) == null ? void 0 : _d.getURL) ? columnDefinition.cellRendererParams.getURL(value) : null;
|
|
55938
55967
|
const startEditing = useCallback(
|
|
55939
55968
|
() => api.startEditingCell({
|
|
55940
55969
|
rowIndex: node.rowIndex,
|
|
@@ -55942,34 +55971,54 @@ var DataTableCellRenderer = ({
|
|
|
55942
55971
|
}),
|
|
55943
55972
|
[column2, node]
|
|
55944
55973
|
);
|
|
55945
|
-
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, shouldDisplayRowCheckbox(columnApi, column2, node) && /* @__PURE__ */ React76.createElement(Box, { paddingLeft: "sm" }, /* @__PURE__ */ React76.createElement(RowCheckbox, { api, data, node })),
|
|
55946
|
-
|
|
55947
|
-
{
|
|
55948
|
-
showArrow: editorType === "select",
|
|
55949
|
-
onClick: startEditing,
|
|
55950
|
-
onClear: ((_b = columnDefinition.cellEditorParams) == null ? void 0 : _b.clearable) && hasValue ? () => {
|
|
55951
|
-
setValue == null ? void 0 : setValue(null);
|
|
55952
|
-
} : void 0,
|
|
55953
|
-
showCalendar: editorType === "date",
|
|
55954
|
-
rightAligned: colDef.type === "rightAligned",
|
|
55955
|
-
hasValue,
|
|
55956
|
-
alwaysShowEditors: (_c = columnDefinition.cellEditorParams) == null ? void 0 : _c.alwaysShowPseudoEditors,
|
|
55957
|
-
...validationOutput
|
|
55958
|
-
},
|
|
55959
|
-
/* @__PURE__ */ React76.createElement(Component4, { ...componentParams })
|
|
55960
|
-
) : /* @__PURE__ */ React76.createElement(
|
|
55961
|
-
NonEditorWrapper,
|
|
55974
|
+
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(
|
|
55975
|
+
Flex,
|
|
55962
55976
|
{
|
|
55963
|
-
|
|
55964
|
-
|
|
55965
|
-
|
|
55966
|
-
|
|
55977
|
+
gap: "5px",
|
|
55978
|
+
alignItems: "center",
|
|
55979
|
+
justifyContent: "center",
|
|
55980
|
+
style: { width: "100%" }
|
|
55967
55981
|
},
|
|
55968
|
-
/* @__PURE__ */ React76.createElement(
|
|
55969
|
-
|
|
55982
|
+
columnDefinition.editable ? /* @__PURE__ */ React76.createElement(
|
|
55983
|
+
PseudoInlineEditorWrapper,
|
|
55984
|
+
{
|
|
55985
|
+
showArrow: editorType === "select",
|
|
55986
|
+
onClick: startEditing,
|
|
55987
|
+
onClear: ((_e = columnDefinition.cellEditorParams) == null ? void 0 : _e.clearable) && hasValue ? () => {
|
|
55988
|
+
setValue == null ? void 0 : setValue(null);
|
|
55989
|
+
} : void 0,
|
|
55990
|
+
showCalendar: editorType === "date",
|
|
55991
|
+
rightAligned: colDef.type === "rightAligned",
|
|
55992
|
+
hasValue,
|
|
55993
|
+
alwaysShowEditors: (_f = columnDefinition.cellEditorParams) == null ? void 0 : _f.alwaysShowPseudoEditors,
|
|
55994
|
+
...validationOutput
|
|
55995
|
+
},
|
|
55996
|
+
/* @__PURE__ */ React76.createElement(Component4, { ...componentParams })
|
|
55997
|
+
) : /* @__PURE__ */ React76.createElement(
|
|
55998
|
+
NonEditorWrapper,
|
|
55999
|
+
{
|
|
56000
|
+
rightAligned: colDef.type === "rightAligned",
|
|
56001
|
+
...validationOutput,
|
|
56002
|
+
rowPinned: Boolean(componentParams.rowPinned),
|
|
56003
|
+
isGroup: Boolean(componentParams.isGroup)
|
|
56004
|
+
},
|
|
56005
|
+
/* @__PURE__ */ React76.createElement(
|
|
56006
|
+
Component4,
|
|
56007
|
+
{
|
|
56008
|
+
...componentParams,
|
|
56009
|
+
tableRef: columnDefinition.cellRendererParams.tableRef
|
|
56010
|
+
}
|
|
56011
|
+
)
|
|
56012
|
+
),
|
|
56013
|
+
URL && /* @__PURE__ */ React76.createElement(
|
|
56014
|
+
ExternalLink,
|
|
55970
56015
|
{
|
|
55971
|
-
|
|
55972
|
-
|
|
56016
|
+
cursor: "pointer",
|
|
56017
|
+
size: "sm",
|
|
56018
|
+
onClick: (e) => {
|
|
56019
|
+
e.stopPropagation();
|
|
56020
|
+
window.open(URL, "_blank");
|
|
56021
|
+
}
|
|
55973
56022
|
}
|
|
55974
56023
|
)
|
|
55975
56024
|
));
|
|
@@ -56611,9 +56660,10 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56611
56660
|
props.api.addEventListener("columnRowGroupChanged", updateExpandedState);
|
|
56612
56661
|
return () => {
|
|
56613
56662
|
props.column.removeEventListener("sortChanged", onSortChanged);
|
|
56614
|
-
|
|
56663
|
+
removeEventListenerFromGrid(
|
|
56615
56664
|
"columnRowGroupChanged",
|
|
56616
|
-
updateExpandedState
|
|
56665
|
+
updateExpandedState,
|
|
56666
|
+
props.api
|
|
56617
56667
|
);
|
|
56618
56668
|
};
|
|
56619
56669
|
}, [props.column]);
|
|
@@ -57708,6 +57758,7 @@ var InternalTableContext = React76.createContext({
|
|
|
57708
57758
|
getRowHeight: () => () => rowSize.md,
|
|
57709
57759
|
grandTotalsLabelInnerRenderer: void 0,
|
|
57710
57760
|
gridApi: void 0,
|
|
57761
|
+
localStoragePersistenceKey: void 0,
|
|
57711
57762
|
onBulkEditUpdate: () => Promise.resolve(),
|
|
57712
57763
|
onServerSideDataRequest: void 0,
|
|
57713
57764
|
onTableConfigChange: () => {
|
|
@@ -57724,6 +57775,7 @@ var InternalTableContext = React76.createContext({
|
|
|
57724
57775
|
setRowHeight: () => {
|
|
57725
57776
|
},
|
|
57726
57777
|
showExpandCollapseAllToggle: false,
|
|
57778
|
+
expandCollapseStateRef: null,
|
|
57727
57779
|
tableRef: null,
|
|
57728
57780
|
getColumnDefinition: () => void 0,
|
|
57729
57781
|
setSelectedGroupIndex: () => {
|
|
@@ -61546,14 +61598,14 @@ var protection_default = protection;
|
|
|
61546
61598
|
// ../../node_modules/@ag-grid-enterprise/excel-export/dist/esm/es6/excelExport/files/xml/styles/numberFormat.mjs
|
|
61547
61599
|
var numberFormat = {
|
|
61548
61600
|
getTemplate(styleProperties) {
|
|
61549
|
-
const { format } = styleProperties.numberFormat;
|
|
61601
|
+
const { format: format2 } = styleProperties.numberFormat;
|
|
61550
61602
|
return {
|
|
61551
61603
|
name: "NumberFormat",
|
|
61552
61604
|
properties: {
|
|
61553
61605
|
prefixedAttributes: [{
|
|
61554
61606
|
prefix: "ss:",
|
|
61555
61607
|
map: {
|
|
61556
|
-
Format:
|
|
61608
|
+
Format: format2
|
|
61557
61609
|
}
|
|
61558
61610
|
}]
|
|
61559
61611
|
}
|
|
@@ -63504,15 +63556,15 @@ var registerFill = (fill) => {
|
|
|
63504
63556
|
}
|
|
63505
63557
|
return pos;
|
|
63506
63558
|
};
|
|
63507
|
-
var registerNumberFmt = (
|
|
63508
|
-
|
|
63509
|
-
if (numberFormatMap[
|
|
63510
|
-
return numberFormatMap[
|
|
63559
|
+
var registerNumberFmt = (format2) => {
|
|
63560
|
+
format2 = _.utf8_encode(format2);
|
|
63561
|
+
if (numberFormatMap[format2]) {
|
|
63562
|
+
return numberFormatMap[format2];
|
|
63511
63563
|
}
|
|
63512
|
-
let pos = registeredNumberFmts.findIndex((currentFormat) => currentFormat.formatCode ===
|
|
63564
|
+
let pos = registeredNumberFmts.findIndex((currentFormat) => currentFormat.formatCode === format2);
|
|
63513
63565
|
if (pos === -1) {
|
|
63514
63566
|
pos = registeredNumberFmts.length + 164;
|
|
63515
|
-
registeredNumberFmts.push({ formatCode:
|
|
63567
|
+
registeredNumberFmts.push({ formatCode: format2, numFmtId: pos });
|
|
63516
63568
|
} else {
|
|
63517
63569
|
pos = registeredNumberFmts[pos].numFmtId;
|
|
63518
63570
|
}
|
|
@@ -78171,6 +78223,63 @@ var buildDetailRowsConfig_ = (detailRowConfig, {
|
|
|
78171
78223
|
};
|
|
78172
78224
|
};
|
|
78173
78225
|
|
|
78226
|
+
// src/utils/expandRows.ts
|
|
78227
|
+
var getGroupRowState = (gridApi, groupDefaultExpanded = 0) => {
|
|
78228
|
+
const expandedRoutes = [];
|
|
78229
|
+
const collapsedRoutes = [];
|
|
78230
|
+
if (gridApi) {
|
|
78231
|
+
gridApi.forEachNode((node) => {
|
|
78232
|
+
const route = node.getRoute();
|
|
78233
|
+
if (route) {
|
|
78234
|
+
const routePath = route.join(",");
|
|
78235
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78236
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78237
|
+
if (node.expanded) {
|
|
78238
|
+
expandedRoutes.push(routePath);
|
|
78239
|
+
}
|
|
78240
|
+
} else if (!node.expanded) {
|
|
78241
|
+
collapsedRoutes.push(routePath);
|
|
78242
|
+
}
|
|
78243
|
+
}
|
|
78244
|
+
});
|
|
78245
|
+
}
|
|
78246
|
+
return { expandedRoutes, collapsedRoutes };
|
|
78247
|
+
};
|
|
78248
|
+
var setExpandCollapseRow = (gridApi, tableConfig, groupDefaultExpanded = 0) => {
|
|
78249
|
+
var _a, _b;
|
|
78250
|
+
const expandedRoutes = ((_a = tableConfig.groupRowState) == null ? void 0 : _a.expandedRoutes) ?? [];
|
|
78251
|
+
const collapsedRoutes = ((_b = tableConfig.groupRowState) == null ? void 0 : _b.collapsedRoutes) ?? [];
|
|
78252
|
+
gridApi.forEachNode((node) => {
|
|
78253
|
+
const route = node.getRoute();
|
|
78254
|
+
if (route) {
|
|
78255
|
+
const routePath = route.join(",");
|
|
78256
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78257
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78258
|
+
if (expandedRoutes.includes(routePath)) {
|
|
78259
|
+
node.setExpanded(true);
|
|
78260
|
+
}
|
|
78261
|
+
} else if (collapsedRoutes.includes(routePath)) {
|
|
78262
|
+
node.setExpanded(false);
|
|
78263
|
+
}
|
|
78264
|
+
}
|
|
78265
|
+
});
|
|
78266
|
+
};
|
|
78267
|
+
var isRowOpenedByDefault = (node, tableConfig, groupDefaultExpanded = 0) => {
|
|
78268
|
+
var _a, _b;
|
|
78269
|
+
const expandedRoutes = ((_a = tableConfig == null ? void 0 : tableConfig.groupRowState) == null ? void 0 : _a.expandedRoutes) ?? [];
|
|
78270
|
+
const collapsedRoutes = ((_b = tableConfig == null ? void 0 : tableConfig.groupRowState) == null ? void 0 : _b.collapsedRoutes) ?? [];
|
|
78271
|
+
const route = node.getRoute();
|
|
78272
|
+
if (!route) {
|
|
78273
|
+
return false;
|
|
78274
|
+
}
|
|
78275
|
+
const routePath = route.join(",");
|
|
78276
|
+
const defaultExpandLevel = groupDefaultExpanded === -1 ? Infinity : groupDefaultExpanded;
|
|
78277
|
+
if (node.level > defaultExpandLevel - 1) {
|
|
78278
|
+
return expandedRoutes.includes(routePath);
|
|
78279
|
+
} else
|
|
78280
|
+
return !collapsedRoutes.includes(routePath);
|
|
78281
|
+
};
|
|
78282
|
+
|
|
78174
78283
|
// src/utils/getRootRowNode.ts
|
|
78175
78284
|
function getRootRowNode(rowNode) {
|
|
78176
78285
|
return rowNode.level > 0 && rowNode.parent ? getRootRowNode(rowNode.parent) : rowNode;
|
|
@@ -80532,6 +80641,7 @@ function generateHTMLString({
|
|
|
80532
80641
|
clearTimeout(exportTimeoutId);
|
|
80533
80642
|
}
|
|
80534
80643
|
exportTimeoutId = setTimeout(() => {
|
|
80644
|
+
var _a2, _b2;
|
|
80535
80645
|
const exportedDocument = document.implementation.createHTMLDocument();
|
|
80536
80646
|
const printStylesElement = exportedDocument.createElement("style");
|
|
80537
80647
|
tableContainer.querySelectorAll(
|
|
@@ -80610,44 +80720,73 @@ function generateHTMLString({
|
|
|
80610
80720
|
if (exportedDocument.querySelector(".ag-header-container") && showTableHeaderOnEveryPage) {
|
|
80611
80721
|
const tableHeaderStylesElement = exportedDocument.createElement("style");
|
|
80612
80722
|
tableHeaderStylesElement.innerHTML = `
|
|
80723
|
+
/* Original header styles */
|
|
80613
80724
|
.ag-header-container {
|
|
80614
80725
|
height: ${TABLE_HEADER_HEIGHT}px;
|
|
80615
80726
|
background: ${colors.gray96};
|
|
80616
80727
|
border-bottom: 1px solid #d6dadc;
|
|
80617
|
-
|
|
80728
|
+
}
|
|
80729
|
+
/* Cloned header styles */
|
|
80730
|
+
.paginated-header {
|
|
80731
|
+
height: ${TABLE_HEADER_HEIGHT}px;
|
|
80732
|
+
background: ${colors.gray96};
|
|
80733
|
+
border-bottom: 1px solid #d6dadc;
|
|
80734
|
+
/* Ensure cloned headers start on a new page */
|
|
80735
|
+
page-break-before: always;
|
|
80618
80736
|
}
|
|
80619
80737
|
`;
|
|
80620
80738
|
exportedDocument.head.appendChild(tableHeaderStylesElement);
|
|
80621
|
-
const
|
|
80739
|
+
const tableHeaderElement = exportedDocument.querySelector(
|
|
80740
|
+
".ag-header-container"
|
|
80741
|
+
);
|
|
80742
|
+
if (!tableHeaderElement) {
|
|
80743
|
+
return reject(new Error("Table header container not found."));
|
|
80744
|
+
}
|
|
80745
|
+
const tableHeader = tableHeaderElement.cloneNode(true);
|
|
80746
|
+
tableHeader.classList.add("paginated-header");
|
|
80622
80747
|
const tableRowsContainer = exportedDocument.querySelector(
|
|
80623
80748
|
".ag-center-cols-container"
|
|
80624
80749
|
);
|
|
80625
|
-
|
|
80626
|
-
|
|
80627
|
-
|
|
80628
|
-
|
|
80629
|
-
|
|
80630
|
-
|
|
80631
|
-
|
|
80632
|
-
|
|
80633
|
-
|
|
80634
|
-
|
|
80750
|
+
if (!tableRowsContainer) {
|
|
80751
|
+
console.error("Table rows container not found.");
|
|
80752
|
+
return;
|
|
80753
|
+
}
|
|
80754
|
+
const allRows = Array.from(
|
|
80755
|
+
tableRowsContainer.children
|
|
80756
|
+
);
|
|
80757
|
+
tableRowsContainer.innerHTML = "";
|
|
80758
|
+
const maxPageContentHeight = pageHeight - (((_a2 = pageFormat.marginInPixels) == null ? void 0 : _a2.top) ?? DEFAULT_PAGE_MARGIN) - (((_b2 = pageFormat.marginInPixels) == null ? void 0 : _b2.bottom) ?? DEFAULT_PAGE_MARGIN) - TABLE_HEADER_HEIGHT;
|
|
80759
|
+
let currentPageContentHeight = 0;
|
|
80760
|
+
let rowsInCurrentPage = [];
|
|
80761
|
+
let isFirstPage = true;
|
|
80762
|
+
const appendPage = () => {
|
|
80763
|
+
if (rowsInCurrentPage.length > 0) {
|
|
80764
|
+
if (!isFirstPage) {
|
|
80765
|
+
tableRowsContainer.appendChild(tableHeader.cloneNode(true));
|
|
80766
|
+
} else {
|
|
80767
|
+
isFirstPage = false;
|
|
80635
80768
|
}
|
|
80636
|
-
|
|
80637
|
-
|
|
80638
|
-
const row2 = tableRowsContainer.children[index + currentPage - 1];
|
|
80639
|
-
const rowHeight = getScaledRowHeight(row2);
|
|
80640
|
-
if (pageContentHeight + rowHeight >= maxPageContentHeight) {
|
|
80641
|
-
tableRowsContainer.insertBefore(
|
|
80642
|
-
tableHeader.cloneNode(true),
|
|
80643
|
-
row2
|
|
80769
|
+
rowsInCurrentPage.forEach(
|
|
80770
|
+
(row2) => tableRowsContainer.appendChild(row2)
|
|
80644
80771
|
);
|
|
80645
|
-
|
|
80646
|
-
|
|
80647
|
-
} else {
|
|
80648
|
-
pageContentHeight += rowHeight;
|
|
80772
|
+
rowsInCurrentPage = [];
|
|
80773
|
+
currentPageContentHeight = 0;
|
|
80649
80774
|
}
|
|
80650
|
-
}
|
|
80775
|
+
};
|
|
80776
|
+
allRows.forEach((row2) => {
|
|
80777
|
+
let rowHeight = parseFloat(row2.style.height.replace("px", "")) || row2.offsetHeight;
|
|
80778
|
+
const scale = pageHeight / tableWidth;
|
|
80779
|
+
if (scale < 1) {
|
|
80780
|
+
rowHeight *= scale;
|
|
80781
|
+
}
|
|
80782
|
+
if (currentPageContentHeight + rowHeight > maxPageContentHeight) {
|
|
80783
|
+
appendPage();
|
|
80784
|
+
isFirstPage = false;
|
|
80785
|
+
}
|
|
80786
|
+
rowsInCurrentPage.push(row2);
|
|
80787
|
+
currentPageContentHeight += rowHeight;
|
|
80788
|
+
});
|
|
80789
|
+
appendPage();
|
|
80651
80790
|
}
|
|
80652
80791
|
resolve(exportedDocument.getElementsByTagName("html")[0].outerHTML);
|
|
80653
80792
|
}, 2e3);
|
|
@@ -80693,6 +80832,7 @@ var useTableApi = ({
|
|
|
80693
80832
|
columnApi,
|
|
80694
80833
|
columnDefinitions,
|
|
80695
80834
|
gridApi,
|
|
80835
|
+
groupDefaultExpanded,
|
|
80696
80836
|
setLoadingStatus,
|
|
80697
80837
|
wrapperRef
|
|
80698
80838
|
}) => {
|
|
@@ -80886,10 +81026,33 @@ var useTableApi = ({
|
|
|
80886
81026
|
const setSearchValue = React76.useCallback(
|
|
80887
81027
|
(value) => {
|
|
80888
81028
|
gridApi == null ? void 0 : gridApi.setQuickFilter(value);
|
|
81029
|
+
gridApi == null ? void 0 : gridApi.forEachNodeAfterFilterAndSort((node) => {
|
|
81030
|
+
if (node.id) {
|
|
81031
|
+
const currentNode = rowSelectionRef == null ? void 0 : rowSelectionRef.current.affectedRows[node.id];
|
|
81032
|
+
if (currentNode && currentNode.selectedState === rowSelectionState.selected) {
|
|
81033
|
+
node.setSelected(true, false, "checkboxSelected");
|
|
81034
|
+
}
|
|
81035
|
+
}
|
|
81036
|
+
});
|
|
80889
81037
|
resetPagination();
|
|
81038
|
+
gridApi == null ? void 0 : gridApi.redrawRows();
|
|
80890
81039
|
},
|
|
80891
|
-
[gridApi]
|
|
81040
|
+
[gridApi, rowSelectionRef.current]
|
|
80892
81041
|
);
|
|
81042
|
+
React76.useEffect(() => {
|
|
81043
|
+
function handleRowSelection(event) {
|
|
81044
|
+
if (event.node.displayed && event.node.id) {
|
|
81045
|
+
rowSelectionRef.current.affectedRows[event.node.id] = {
|
|
81046
|
+
node: event.node,
|
|
81047
|
+
selectedState: event.node.isSelected() ? rowSelectionState.selected : rowSelectionState.unselected
|
|
81048
|
+
};
|
|
81049
|
+
}
|
|
81050
|
+
}
|
|
81051
|
+
(gridApi == null ? void 0 : gridApi.addEventListener) && gridApi.addEventListener("rowSelected", handleRowSelection);
|
|
81052
|
+
return () => {
|
|
81053
|
+
removeEventListenerFromGrid("rowSelected", handleRowSelection, gridApi);
|
|
81054
|
+
};
|
|
81055
|
+
}, [gridApi]);
|
|
80893
81056
|
const setLoading = React76.useCallback((loading, message = "") => {
|
|
80894
81057
|
setLoadingStatus({
|
|
80895
81058
|
loading,
|
|
@@ -80951,6 +81114,7 @@ var useTableApi = ({
|
|
|
80951
81114
|
adjustRowDragIcon(gridApi, columnApi);
|
|
80952
81115
|
});
|
|
80953
81116
|
}
|
|
81117
|
+
setExpandCollapseRow(gridApi, config, groupDefaultExpanded);
|
|
80954
81118
|
},
|
|
80955
81119
|
[columnApi, gridApi, internalSetRowHeight, filterStorage.setSelectedFilters]
|
|
80956
81120
|
);
|
|
@@ -81044,7 +81208,8 @@ var useTableApi = ({
|
|
|
81044
81208
|
columnApi,
|
|
81045
81209
|
rowHeight,
|
|
81046
81210
|
filterStorage,
|
|
81047
|
-
rowSelectionRef
|
|
81211
|
+
rowSelectionRef,
|
|
81212
|
+
groupDefaultExpanded
|
|
81048
81213
|
}),
|
|
81049
81214
|
[columnApi, gridApi, rowHeight, filterStorage]
|
|
81050
81215
|
);
|
|
@@ -81318,7 +81483,6 @@ function buildPartialTableApi({
|
|
|
81318
81483
|
focusField && (gridApi == null ? void 0 : gridApi.setFocusedCell(rowIndex, focusField));
|
|
81319
81484
|
};
|
|
81320
81485
|
return {
|
|
81321
|
-
getVisibleRowNodes,
|
|
81322
81486
|
applyTransaction,
|
|
81323
81487
|
applyServerSideTransaction,
|
|
81324
81488
|
collapseAll,
|
|
@@ -81333,6 +81497,7 @@ function buildPartialTableApi({
|
|
|
81333
81497
|
getSelectedRows: getSelectedRows2,
|
|
81334
81498
|
getServerSideSelectionState,
|
|
81335
81499
|
getTableConfiguration,
|
|
81500
|
+
getVisibleRowNodes,
|
|
81336
81501
|
refreshCells,
|
|
81337
81502
|
setPinnedBottomRowData,
|
|
81338
81503
|
setRowData,
|
|
@@ -81450,6 +81615,12 @@ var DataTable = ({
|
|
|
81450
81615
|
const [rowHeight, setRowHeight] = React76.useState(
|
|
81451
81616
|
(initialTableConfig == null ? void 0 : initialTableConfig.rowHeight) || rowSize.md
|
|
81452
81617
|
);
|
|
81618
|
+
const expandCollapseStateRef = React76.useRef(
|
|
81619
|
+
(initialTableConfig == null ? void 0 : initialTableConfig.groupRowState) || {
|
|
81620
|
+
expandedRoutes: [],
|
|
81621
|
+
collapsedRoutes: []
|
|
81622
|
+
}
|
|
81623
|
+
);
|
|
81453
81624
|
const rowHeightRef = React76.useRef(
|
|
81454
81625
|
(initialTableConfig == null ? void 0 : initialTableConfig.rowHeight) || rowSize.md
|
|
81455
81626
|
);
|
|
@@ -81497,12 +81668,14 @@ var DataTable = ({
|
|
|
81497
81668
|
if (localStoragePersistenceKey) {
|
|
81498
81669
|
storage.local.setItem(localStoragePersistenceKey, {
|
|
81499
81670
|
...config,
|
|
81671
|
+
groupRowState: expandCollapseStateRef.current,
|
|
81500
81672
|
rowHeight: rowHeightRef.current,
|
|
81501
81673
|
serverFilters: filterStorage.filtersState
|
|
81502
81674
|
});
|
|
81503
81675
|
}
|
|
81504
81676
|
onTableConfigChange == null ? void 0 : onTableConfigChange({
|
|
81505
81677
|
...config,
|
|
81678
|
+
groupRowState: expandCollapseStateRef.current,
|
|
81506
81679
|
rowHeight: rowHeightRef.current,
|
|
81507
81680
|
serverFilters: filterStorage.filtersState
|
|
81508
81681
|
});
|
|
@@ -81613,6 +81786,7 @@ var DataTable = ({
|
|
|
81613
81786
|
onServerSideDataRequest,
|
|
81614
81787
|
onTableConfigChange: internalOnTableConfigChange,
|
|
81615
81788
|
rowSelectionRef,
|
|
81789
|
+
expandCollapseStateRef,
|
|
81616
81790
|
rowHeight,
|
|
81617
81791
|
searchStorage,
|
|
81618
81792
|
selectedGroupIndex,
|
|
@@ -81673,7 +81847,7 @@ function getServerSideDatasource(onServerSideDataRequestCallbackRef, onEmptyResp
|
|
|
81673
81847
|
}
|
|
81674
81848
|
var minimumColumnWidth = 140;
|
|
81675
81849
|
var Table = (props) => {
|
|
81676
|
-
var _a, _b;
|
|
81850
|
+
var _a, _b, _c;
|
|
81677
81851
|
const { suppressColumnVirtualisation = true, rowActionsConfig = {} } = props;
|
|
81678
81852
|
const I18n = useI18nContext();
|
|
81679
81853
|
const internalTableContext = useInternalTableContext();
|
|
@@ -81715,8 +81889,10 @@ var Table = (props) => {
|
|
|
81715
81889
|
columnDefinitions: internalTableContext.columnDefinitions,
|
|
81716
81890
|
gridApi,
|
|
81717
81891
|
setLoadingStatus,
|
|
81718
|
-
wrapperRef
|
|
81892
|
+
wrapperRef,
|
|
81893
|
+
groupDefaultExpanded: props.groupDefaultExpanded
|
|
81719
81894
|
});
|
|
81895
|
+
const initialTableConfig = internalTableContext.initialTableConfig;
|
|
81720
81896
|
React76.useImperativeHandle(internalTableContext.tableRef, () => tableApi, [
|
|
81721
81897
|
tableApi
|
|
81722
81898
|
]);
|
|
@@ -82030,8 +82206,8 @@ var Table = (props) => {
|
|
|
82030
82206
|
);
|
|
82031
82207
|
const onColumnGroupOpened = React76.useCallback(
|
|
82032
82208
|
(event) => {
|
|
82033
|
-
var _a2, _b2,
|
|
82034
|
-
(
|
|
82209
|
+
var _a2, _b2, _c2;
|
|
82210
|
+
(_c2 = internalTableContext.analytics) == null ? void 0 : _c2.client.addEvent(
|
|
82035
82211
|
"design_system.data_table.column.expand_toggled",
|
|
82036
82212
|
{
|
|
82037
82213
|
client: internalTableContext.analytics.clientName,
|
|
@@ -82048,14 +82224,14 @@ var Table = (props) => {
|
|
|
82048
82224
|
);
|
|
82049
82225
|
const onColumnPinned = React76.useCallback(
|
|
82050
82226
|
(event) => {
|
|
82051
|
-
var _a2, _b2,
|
|
82227
|
+
var _a2, _b2, _c2, _d;
|
|
82052
82228
|
(_d = internalTableContext.analytics) == null ? void 0 : _d.client.addEvent(
|
|
82053
82229
|
"design_system.data_table.column.pinned",
|
|
82054
82230
|
{
|
|
82055
82231
|
client: internalTableContext.analytics.clientName,
|
|
82056
82232
|
column: (_a2 = event.column) == null ? void 0 : _a2.getColId(),
|
|
82057
82233
|
side: (_b2 = event.column) == null ? void 0 : _b2.getPinned(),
|
|
82058
|
-
position: (
|
|
82234
|
+
position: (_c2 = columnApi == null ? void 0 : columnApi.getColumns()) == null ? void 0 : _c2.findIndex(
|
|
82059
82235
|
(col) => {
|
|
82060
82236
|
var _a3;
|
|
82061
82237
|
return col.getId() === ((_a3 = event.column) == null ? void 0 : _a3.getColId());
|
|
@@ -82154,7 +82330,7 @@ var Table = (props) => {
|
|
|
82154
82330
|
const onDragStopped = React76.useCallback(
|
|
82155
82331
|
// eslint-disable-next-line complexity
|
|
82156
82332
|
(event) => {
|
|
82157
|
-
var _a2, _b2,
|
|
82333
|
+
var _a2, _b2, _c2;
|
|
82158
82334
|
if (event.target.className.includes("ag-header-cell")) {
|
|
82159
82335
|
internalTableContext.onTableConfigChange();
|
|
82160
82336
|
}
|
|
@@ -82172,7 +82348,7 @@ var Table = (props) => {
|
|
|
82172
82348
|
const firstVisibleColumnIndex = allColumns.findIndex(
|
|
82173
82349
|
(col) => col.isVisible()
|
|
82174
82350
|
);
|
|
82175
|
-
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((
|
|
82351
|
+
if (moveColumnEvent.toIndex === firstVisibleColumnIndex || ((_c2 = moveColumnEvent.column) == null ? void 0 : _c2.getColDef().rowDrag)) {
|
|
82176
82352
|
adjustRowDragIcon(event.api, event.columnApi);
|
|
82177
82353
|
}
|
|
82178
82354
|
}
|
|
@@ -82251,27 +82427,55 @@ var Table = (props) => {
|
|
|
82251
82427
|
(_a2 = document.getElementsByClassName("ag-body-viewport")[0]) == null ? void 0 : _a2.clientWidth
|
|
82252
82428
|
);
|
|
82253
82429
|
}, [setViewportWidth]);
|
|
82430
|
+
const isClientSideGroupOpenByDefault = React76.useCallback(
|
|
82431
|
+
(params) => {
|
|
82432
|
+
const node = params.rowNode;
|
|
82433
|
+
if (!node) {
|
|
82434
|
+
return false;
|
|
82435
|
+
}
|
|
82436
|
+
return isRowOpenedByDefault(
|
|
82437
|
+
node,
|
|
82438
|
+
initialTableConfig,
|
|
82439
|
+
props.groupsAlwaysExpanded ? -1 : props.groupDefaultExpanded
|
|
82440
|
+
);
|
|
82441
|
+
},
|
|
82442
|
+
[initialTableConfig, props.groupDefaultExpanded]
|
|
82443
|
+
);
|
|
82444
|
+
const isServerSideGroupOpenByDefault = React76.useCallback(
|
|
82445
|
+
(params) => {
|
|
82446
|
+
const node = params.rowNode;
|
|
82447
|
+
if (!node) {
|
|
82448
|
+
return false;
|
|
82449
|
+
}
|
|
82450
|
+
return isRowOpenedByDefault(
|
|
82451
|
+
node,
|
|
82452
|
+
initialTableConfig,
|
|
82453
|
+
props.groupsAlwaysExpanded ? -1 : props.groupDefaultExpanded
|
|
82454
|
+
);
|
|
82455
|
+
},
|
|
82456
|
+
[initialTableConfig, props.groupDefaultExpanded]
|
|
82457
|
+
);
|
|
82254
82458
|
const onGridReady = (params) => {
|
|
82255
|
-
var _a2, _b2,
|
|
82459
|
+
var _a2, _b2, _c2;
|
|
82256
82460
|
internalTableContext.setGridApi(params.api);
|
|
82257
82461
|
internalTableContext.setColumnApi(params.columnApi);
|
|
82258
82462
|
setViewportWidth(
|
|
82259
82463
|
(_a2 = document.getElementsByClassName("ag-body-viewport")[0]) == null ? void 0 : _a2.clientWidth
|
|
82260
82464
|
);
|
|
82261
|
-
(
|
|
82465
|
+
(_c2 = (_b2 = props.UNSAFE_internalAGGridOverrides) == null ? void 0 : _b2.onGridReady) == null ? void 0 : _c2.call(_b2, params);
|
|
82262
82466
|
};
|
|
82263
82467
|
const postProcessPopup = (params) => {
|
|
82264
82468
|
params.ePopup.style.top = `${HEADER_HEIGHT}px`;
|
|
82265
82469
|
};
|
|
82266
82470
|
const internalOnRowSelected = (event) => {
|
|
82267
|
-
var _a2, _b2,
|
|
82471
|
+
var _a2, _b2, _c2;
|
|
82268
82472
|
(_a2 = props.onRowSelected) == null ? void 0 : _a2.call(props, event);
|
|
82269
82473
|
if (props.siblingGroupsRowSelectionDisabled) {
|
|
82270
82474
|
const rootRowNode = getRootRowNode(event.node);
|
|
82271
82475
|
if (!event.node.isSelected() && internalTableContext.selectedGroupIndex !== null && (rootRowNode == null ? void 0 : rootRowNode.id) === internalTableContext.selectedGroupIndex && event.api.getSelectedNodes().length === 0) {
|
|
82272
82476
|
(_b2 = internalTableContext == null ? void 0 : internalTableContext.setSelectedGroupIndex) == null ? void 0 : _b2.call(internalTableContext, null);
|
|
82273
82477
|
} else {
|
|
82274
|
-
(
|
|
82478
|
+
(_c2 = internalTableContext == null ? void 0 : internalTableContext.setSelectedGroupIndex) == null ? void 0 : _c2.call(internalTableContext, (prevState) => {
|
|
82275
82479
|
return prevState ?? (rootRowNode == null ? void 0 : rootRowNode.id) ?? null;
|
|
82276
82480
|
});
|
|
82277
82481
|
}
|
|
@@ -82280,13 +82484,26 @@ var Table = (props) => {
|
|
|
82280
82484
|
const internalRowGroupOpened = React76.useCallback(
|
|
82281
82485
|
(event) => {
|
|
82282
82486
|
var _a2;
|
|
82487
|
+
if (internalTableContext.expandCollapseStateRef) {
|
|
82488
|
+
internalTableContext.expandCollapseStateRef.current = getGroupRowState(
|
|
82489
|
+
gridApi,
|
|
82490
|
+
props.groupDefaultExpanded
|
|
82491
|
+
);
|
|
82492
|
+
}
|
|
82493
|
+
internalTableContext.onTableConfigChange();
|
|
82283
82494
|
(_a2 = props.onRowGroupOpened) == null ? void 0 : _a2.call(props, {
|
|
82284
82495
|
expanded: event.expanded,
|
|
82285
82496
|
node: serializeNode(event.node),
|
|
82286
82497
|
rowIndex: event.rowIndex
|
|
82287
82498
|
});
|
|
82288
82499
|
},
|
|
82289
|
-
[
|
|
82500
|
+
[
|
|
82501
|
+
props.onRowGroupOpened,
|
|
82502
|
+
internalTableContext.onTableConfigChange,
|
|
82503
|
+
tableApi == null ? void 0 : tableApi.getTableConfiguration(),
|
|
82504
|
+
(_c = internalTableContext.expandCollapseStateRef) == null ? void 0 : _c.current,
|
|
82505
|
+
gridApi
|
|
82506
|
+
]
|
|
82290
82507
|
);
|
|
82291
82508
|
const getGroupRowAgg = React76.useCallback(
|
|
82292
82509
|
(params) => {
|
|
@@ -82439,6 +82656,8 @@ var Table = (props) => {
|
|
|
82439
82656
|
alwaysAggregateAtRootLevel: !onSSDR,
|
|
82440
82657
|
autoGroupColumnDef: decoratedAutoGroupColDef,
|
|
82441
82658
|
cacheBlockSize: props.paginationPageSize || defaultPaginationPageSize,
|
|
82659
|
+
isGroupOpenByDefault: isClientSideGroupOpenByDefault,
|
|
82660
|
+
isServerSideGroupOpenByDefault,
|
|
82442
82661
|
defaultColDef,
|
|
82443
82662
|
enableGroupEdit: internalTableContext.enableGroupEditAndValidation,
|
|
82444
82663
|
enableCellTextSelection: internalTableContext.enableCellTextSelection,
|