@procore/data-table 13.3.1 → 13.3.2
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 +6 -0
- package/README.md +1 -1
- package/dist/legacy/index.js +115 -58
- package/dist/legacy/index.mjs +119 -62
- package/dist/modern/index.js +112 -55
- package/dist/modern/index.mjs +116 -59
- package/package.json +1 -1
package/dist/legacy/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React82, { useState, forwardRef, useContext, useRef, useImperativeHandle, useLayoutEffect, useCallback, useMemo, memo, useEffect, Component as Component$1, createElement } from 'react';
|
|
2
2
|
import { startsWith, equals, omit, isNil, mergeDeepLeft, intersection, isEmpty, groupBy } from 'ramda';
|
|
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, FlexList, Typography, Tooltip, Button, Required, 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, Pagination, Link, AvatarStack, Pill, Typeahead, UNSAFE_FilterToken, useI18n, I18nContext, UNSAFE_SuperSelect, Avatar, MultiSelect, H3, Checkbox, useVisibility, UNSAFE_useSuperSelectContext, DropdownFlyout, StyledDropdownFlyoutLabel, StyledDropdownFlyoutExpandIcon, EmptyState as EmptyState$1 } from '@procore/core-react';
|
|
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, 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, Pagination, Link, AvatarStack, Pill, Typeahead, UNSAFE_FilterToken, useI18n, I18nContext, UNSAFE_SuperSelect, Avatar, MultiSelect, H3, Checkbox, useVisibility, UNSAFE_useSuperSelectContext, DropdownFlyout, StyledDropdownFlyoutLabel, StyledDropdownFlyoutExpandIcon, EmptyState as EmptyState$1 } from '@procore/core-react';
|
|
4
4
|
import classnames from 'classnames/bind';
|
|
5
5
|
import { Error as Error$1, Grip, Pencil, Building, Calendar as Calendar$1, CaretsInVertical, CaretsOutVertical, CaretsOutVerticalWithLine, CaretsIn, CaretsOut, CaretDown, CaretRight, ArrowDown, ArrowUp } from '@procore/core-icons';
|
|
6
6
|
import classNames from 'classnames';
|
|
@@ -996,6 +996,43 @@ var rowHeightMap = {
|
|
|
996
996
|
[rowSize.md]: "medium",
|
|
997
997
|
[rowSize.lg]: "large"
|
|
998
998
|
};
|
|
999
|
+
var Spinner = ({
|
|
1000
|
+
loading,
|
|
1001
|
+
...rest
|
|
1002
|
+
}) => /* @__PURE__ */ React82.createElement(Box, { "data-qa": loading ? "loading" : "loaded", display: "flex-row", flex: 1 }, /* @__PURE__ */ React82.createElement(Spinner$1, { loading, size: "md", centered: true, ...rest }));
|
|
1003
|
+
function isNestedColumnDefinition(Column2) {
|
|
1004
|
+
return "children" in Column2;
|
|
1005
|
+
}
|
|
1006
|
+
function isNestedColDef(colDef) {
|
|
1007
|
+
if (!colDef.groupId) {
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
return "groupId" in colDef;
|
|
1011
|
+
}
|
|
1012
|
+
function getLeafColDefs(columnDefinitions) {
|
|
1013
|
+
return columnDefinitions.flatMap((colDef) => {
|
|
1014
|
+
return isNestedColDef(colDef) ? getLeafColDefs(colDef.children) : [colDef];
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
function isFirstColumn(params) {
|
|
1018
|
+
var _a;
|
|
1019
|
+
const displayedColumns = ((_a = params == null ? void 0 : params.columnApi) == null ? void 0 : _a.getAllDisplayedColumns()) || [];
|
|
1020
|
+
return displayedColumns.length ? displayedColumns[0] === params.column : false;
|
|
1021
|
+
}
|
|
1022
|
+
function getCheckboxColumn(columnApi) {
|
|
1023
|
+
var _a, _b;
|
|
1024
|
+
const isGrouping = ((_b = (_a = columnApi == null ? void 0 : columnApi.getRowGroupColumns) == null ? void 0 : _a.call(columnApi)) == null ? void 0 : _b.length) !== 0;
|
|
1025
|
+
if (isGrouping) {
|
|
1026
|
+
return null;
|
|
1027
|
+
}
|
|
1028
|
+
const displayedColumns = (columnApi == null ? void 0 : columnApi.getAllDisplayedColumns()) || [];
|
|
1029
|
+
return displayedColumns.length ? displayedColumns[0] : null;
|
|
1030
|
+
}
|
|
1031
|
+
function removeEventListenerFromGrid(event, listener, gridApi) {
|
|
1032
|
+
if (!gridApi || (gridApi == null ? void 0 : gridApi.destroyCalled))
|
|
1033
|
+
return;
|
|
1034
|
+
gridApi == null ? void 0 : gridApi.removeEventListener(event, listener);
|
|
1035
|
+
}
|
|
999
1036
|
|
|
1000
1037
|
// src/styles.scss
|
|
1001
1038
|
var styles_exports = {};
|
|
@@ -53833,7 +53870,7 @@ var LocationFilterOverlay = React82.forwardRef(
|
|
|
53833
53870
|
getLabel3(item)
|
|
53834
53871
|
);
|
|
53835
53872
|
})),
|
|
53836
|
-
loading && /* @__PURE__ */ React82.createElement(UNSAFE_Menu.Footer, null, /* @__PURE__ */ React82.createElement(Flex, { justifyContent: "center" }, /* @__PURE__ */ React82.createElement(Spinner, { size: "sm" })))
|
|
53873
|
+
loading && /* @__PURE__ */ React82.createElement(UNSAFE_Menu.Footer, null, /* @__PURE__ */ React82.createElement(Flex, { justifyContent: "center" }, /* @__PURE__ */ React82.createElement(Spinner$1, { size: "sm" })))
|
|
53837
53874
|
));
|
|
53838
53875
|
}
|
|
53839
53876
|
);
|
|
@@ -54038,8 +54075,16 @@ function useFilterState({
|
|
|
54038
54075
|
}
|
|
54039
54076
|
return () => {
|
|
54040
54077
|
listenersEnabled.current = false;
|
|
54041
|
-
|
|
54042
|
-
|
|
54078
|
+
removeEventListenerFromGrid(
|
|
54079
|
+
"filterChanged",
|
|
54080
|
+
filterEventFunction,
|
|
54081
|
+
gridApi
|
|
54082
|
+
);
|
|
54083
|
+
removeEventListenerFromGrid(
|
|
54084
|
+
"rowDataUpdated",
|
|
54085
|
+
filterEventFunction,
|
|
54086
|
+
gridApi
|
|
54087
|
+
);
|
|
54043
54088
|
};
|
|
54044
54089
|
}, [gridApi, columnDefinitions]);
|
|
54045
54090
|
return { allAvailableFilters, changeFilterValue, filterableColumns };
|
|
@@ -54533,38 +54578,6 @@ var ServerSideFilter = ({
|
|
|
54533
54578
|
)
|
|
54534
54579
|
);
|
|
54535
54580
|
};
|
|
54536
|
-
var Spinner2 = ({
|
|
54537
|
-
loading,
|
|
54538
|
-
...rest
|
|
54539
|
-
}) => /* @__PURE__ */ React82.createElement(Box, { "data-qa": loading ? "loading" : "loaded", display: "flex-row", flex: 1 }, /* @__PURE__ */ React82.createElement(Spinner, { loading, size: "md", centered: true, ...rest }));
|
|
54540
|
-
function isNestedColumnDefinition(Column2) {
|
|
54541
|
-
return "children" in Column2;
|
|
54542
|
-
}
|
|
54543
|
-
function isNestedColDef(colDef) {
|
|
54544
|
-
if (!colDef.groupId) {
|
|
54545
|
-
return false;
|
|
54546
|
-
}
|
|
54547
|
-
return "groupId" in colDef;
|
|
54548
|
-
}
|
|
54549
|
-
function getLeafColDefs(columnDefinitions) {
|
|
54550
|
-
return columnDefinitions.flatMap((colDef) => {
|
|
54551
|
-
return isNestedColDef(colDef) ? getLeafColDefs(colDef.children) : [colDef];
|
|
54552
|
-
});
|
|
54553
|
-
}
|
|
54554
|
-
function isFirstColumn(params) {
|
|
54555
|
-
var _a;
|
|
54556
|
-
const displayedColumns = ((_a = params == null ? void 0 : params.columnApi) == null ? void 0 : _a.getAllDisplayedColumns()) || [];
|
|
54557
|
-
return displayedColumns.length ? displayedColumns[0] === params.column : false;
|
|
54558
|
-
}
|
|
54559
|
-
function getCheckboxColumn(columnApi) {
|
|
54560
|
-
var _a, _b;
|
|
54561
|
-
const isGrouping = ((_b = (_a = columnApi == null ? void 0 : columnApi.getRowGroupColumns) == null ? void 0 : _a.call(columnApi)) == null ? void 0 : _b.length) !== 0;
|
|
54562
|
-
if (isGrouping) {
|
|
54563
|
-
return null;
|
|
54564
|
-
}
|
|
54565
|
-
const displayedColumns = (columnApi == null ? void 0 : columnApi.getAllDisplayedColumns()) || [];
|
|
54566
|
-
return displayedColumns.length ? displayedColumns[0] : null;
|
|
54567
|
-
}
|
|
54568
54581
|
|
|
54569
54582
|
// src/utils/transformers.ts
|
|
54570
54583
|
var emptyObject = {};
|
|
@@ -55279,7 +55292,7 @@ function ClientSideRowCheckbox(props) {
|
|
|
55279
55292
|
useEffect(() => {
|
|
55280
55293
|
props.api.addEventListener("rowSelected", handleRowSelection);
|
|
55281
55294
|
return () => {
|
|
55282
|
-
|
|
55295
|
+
removeEventListenerFromGrid("rowSelected", handleRowSelection, props.api);
|
|
55283
55296
|
};
|
|
55284
55297
|
}, []);
|
|
55285
55298
|
return /* @__PURE__ */ React82.createElement(Box, { paddingRight: "md" }, /* @__PURE__ */ React82.createElement(
|
|
@@ -55393,7 +55406,11 @@ function GroupCaret(props) {
|
|
|
55393
55406
|
props.api.addEventListener("rowGroupOpened", handleRowGroupToggle);
|
|
55394
55407
|
return () => {
|
|
55395
55408
|
mounted.current = false;
|
|
55396
|
-
|
|
55409
|
+
removeEventListenerFromGrid(
|
|
55410
|
+
"rowGroupOpened",
|
|
55411
|
+
handleRowGroupToggle,
|
|
55412
|
+
props.api
|
|
55413
|
+
);
|
|
55397
55414
|
};
|
|
55398
55415
|
}, []);
|
|
55399
55416
|
return /* @__PURE__ */ React82.createElement(Box, { className: AutoGroupCell_default.expandableCaret }, props.node.isExpandable() && /* @__PURE__ */ React82.createElement(
|
|
@@ -55420,7 +55437,11 @@ var AutoGroupCellRenderer = (props) => {
|
|
|
55420
55437
|
useEffect(() => {
|
|
55421
55438
|
props.api.addEventListener("cellValueChanged", handleCellValueChange);
|
|
55422
55439
|
return () => {
|
|
55423
|
-
|
|
55440
|
+
removeEventListenerFromGrid(
|
|
55441
|
+
"cellValueChanged",
|
|
55442
|
+
handleCellValueChange,
|
|
55443
|
+
props.api
|
|
55444
|
+
);
|
|
55424
55445
|
};
|
|
55425
55446
|
}, []);
|
|
55426
55447
|
const adjustedLevel = props.node.footer ? props.node.level + 1 : props.node.level;
|
|
@@ -56282,7 +56303,7 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56282
56303
|
props.api.addEventListener("columnMoved", calculatePosition);
|
|
56283
56304
|
calculatePosition();
|
|
56284
56305
|
return () => {
|
|
56285
|
-
|
|
56306
|
+
removeEventListenerFromGrid("columnMoved", calculatePosition, props.api);
|
|
56286
56307
|
};
|
|
56287
56308
|
}, []);
|
|
56288
56309
|
const onSortToggled = (event) => {
|
|
@@ -56361,8 +56382,11 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56361
56382
|
};
|
|
56362
56383
|
(_a2 = props.api) == null ? void 0 : _a2.addEventListener("expandOrCollapseAll", onExpandAllChange);
|
|
56363
56384
|
return () => {
|
|
56364
|
-
|
|
56365
|
-
|
|
56385
|
+
removeEventListenerFromGrid(
|
|
56386
|
+
"expandOrCollapseAll",
|
|
56387
|
+
onExpandAllChange,
|
|
56388
|
+
props.api
|
|
56389
|
+
);
|
|
56366
56390
|
};
|
|
56367
56391
|
}, [props.api]);
|
|
56368
56392
|
React82.useEffect(() => {
|
|
@@ -56453,7 +56477,11 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56453
56477
|
props.api.addEventListener(selectionChanged, onSelectionChanged);
|
|
56454
56478
|
onSelectionChanged();
|
|
56455
56479
|
return () => {
|
|
56456
|
-
|
|
56480
|
+
removeEventListenerFromGrid(
|
|
56481
|
+
selectionChanged,
|
|
56482
|
+
onSelectionChanged,
|
|
56483
|
+
props.api
|
|
56484
|
+
);
|
|
56457
56485
|
};
|
|
56458
56486
|
}, [isFirstColumn2, selectAll]);
|
|
56459
56487
|
const { ref, isOverflowing, recalculate } = useOverflowObserver();
|
|
@@ -56465,8 +56493,8 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56465
56493
|
props.api.addEventListener("cellMouseOver", handler);
|
|
56466
56494
|
props.api.addEventListener("columnResized", handler);
|
|
56467
56495
|
return () => {
|
|
56468
|
-
|
|
56469
|
-
|
|
56496
|
+
removeEventListenerFromGrid("cellMouseOver", handler, props.api);
|
|
56497
|
+
removeEventListenerFromGrid("columnResized", handler, props.api);
|
|
56470
56498
|
};
|
|
56471
56499
|
}, []);
|
|
56472
56500
|
React82.useEffect(() => {
|
|
@@ -56492,8 +56520,16 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56492
56520
|
props.api.addEventListener(selectionChanged, updateSelectAllCheckbox);
|
|
56493
56521
|
props.api.addEventListener(paginationChanged, updateSelectAllCheckbox);
|
|
56494
56522
|
return () => {
|
|
56495
|
-
|
|
56496
|
-
|
|
56523
|
+
removeEventListenerFromGrid(
|
|
56524
|
+
selectionChanged,
|
|
56525
|
+
updateSelectAllCheckbox,
|
|
56526
|
+
props.api
|
|
56527
|
+
);
|
|
56528
|
+
removeEventListenerFromGrid(
|
|
56529
|
+
paginationChanged,
|
|
56530
|
+
updateSelectAllCheckbox,
|
|
56531
|
+
props.api
|
|
56532
|
+
);
|
|
56497
56533
|
};
|
|
56498
56534
|
}, [isFirstColumn2, props.selectionSSREnabled, props.api, onSSDR]);
|
|
56499
56535
|
const toggleSelectAll = React82.useCallback(() => {
|
|
@@ -56704,7 +56740,7 @@ function CustomLoader(params) {
|
|
|
56704
56740
|
level: params.node.level,
|
|
56705
56741
|
lastRowInGroup: params.node === groupNodes.last
|
|
56706
56742
|
}
|
|
56707
|
-
), /* @__PURE__ */ React82.createElement(
|
|
56743
|
+
), /* @__PURE__ */ React82.createElement(Spinner, { loading: true, size: "sm" }), /* @__PURE__ */ React82.createElement(Box, { paddingLeft: "sm" }, /* @__PURE__ */ React82.createElement(Typography, { color: "gray15", italic: true, intent: "small" }, I18n.t(
|
|
56708
56744
|
`dataTable.loading.${params.node === groupNodes.first ? "initial" : "secondary"}`
|
|
56709
56745
|
))));
|
|
56710
56746
|
}
|
|
@@ -56714,7 +56750,7 @@ var DefaultFrameworkComponents = {
|
|
|
56714
56750
|
agColumnHeader: GenericHeaderRenderer,
|
|
56715
56751
|
agLoadingCellRenderer: CustomLoader,
|
|
56716
56752
|
agColumnGroupHeader: GenericColumnGroupHeader,
|
|
56717
|
-
loadingOverlayRenderer:
|
|
56753
|
+
loadingOverlayRenderer: Spinner,
|
|
56718
56754
|
emptyStateRenderer: EmptyState
|
|
56719
56755
|
};
|
|
56720
56756
|
function getFrameworkComponents(headerMenuConfig, onSelectAll, selectionSSREnabled) {
|
|
@@ -58861,12 +58897,18 @@ var useRowSelectionState = () => {
|
|
|
58861
58897
|
const { gridApi, rowSelectionRef } = useInternalTableContext();
|
|
58862
58898
|
React82.useEffect(() => {
|
|
58863
58899
|
function selectionEventFunction() {
|
|
58864
|
-
|
|
58900
|
+
if (!(gridApi == null ? void 0 : gridApi.destroyCalled)) {
|
|
58901
|
+
setSelectedRows(getSelectedRows({ gridApi, rowSelectionRef }));
|
|
58902
|
+
}
|
|
58865
58903
|
}
|
|
58866
58904
|
selectionEventFunction();
|
|
58867
58905
|
gridApi == null ? void 0 : gridApi.addEventListener("selectionChanged", selectionEventFunction);
|
|
58868
58906
|
return () => {
|
|
58869
|
-
|
|
58907
|
+
removeEventListenerFromGrid(
|
|
58908
|
+
"selectionChanged",
|
|
58909
|
+
selectionEventFunction,
|
|
58910
|
+
gridApi
|
|
58911
|
+
);
|
|
58870
58912
|
};
|
|
58871
58913
|
}, [gridApi]);
|
|
58872
58914
|
return selectedRows;
|
|
@@ -76369,7 +76411,7 @@ function personOptionRenderer(editorParams) {
|
|
|
76369
76411
|
};
|
|
76370
76412
|
}
|
|
76371
76413
|
function LoadingField() {
|
|
76372
|
-
return /* @__PURE__ */ React82.createElement(Box, { marginTop: "md" }, /* @__PURE__ */ React82.createElement(Spinner, { size: "sm", loading: true }));
|
|
76414
|
+
return /* @__PURE__ */ React82.createElement(Box, { marginTop: "md" }, /* @__PURE__ */ React82.createElement(Spinner$1, { size: "sm", loading: true }));
|
|
76373
76415
|
}
|
|
76374
76416
|
function RadioList({
|
|
76375
76417
|
getId: getId3,
|
|
@@ -76704,7 +76746,7 @@ var BulkEditInput = (props) => {
|
|
|
76704
76746
|
);
|
|
76705
76747
|
} else {
|
|
76706
76748
|
console.warn(
|
|
76707
|
-
`@procore/
|
|
76749
|
+
`@procore/data-table: Unable to find the field for ${props.editor}. Will fallback to a Form.Text.`
|
|
76708
76750
|
);
|
|
76709
76751
|
return defaultField;
|
|
76710
76752
|
}
|
|
@@ -77179,9 +77221,10 @@ var ConfigurationColumns = React82.forwardRef(
|
|
|
77179
77221
|
onDisplayedColumnsChanged
|
|
77180
77222
|
);
|
|
77181
77223
|
return () => {
|
|
77182
|
-
|
|
77224
|
+
removeEventListenerFromGrid(
|
|
77183
77225
|
"displayedColumnsChanged",
|
|
77184
|
-
onDisplayedColumnsChanged
|
|
77226
|
+
onDisplayedColumnsChanged,
|
|
77227
|
+
gridApi
|
|
77185
77228
|
);
|
|
77186
77229
|
};
|
|
77187
77230
|
}, [gridApi, colDefs]);
|
|
@@ -78050,9 +78093,10 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
78050
78093
|
onDisplayedColumnsChanged
|
|
78051
78094
|
);
|
|
78052
78095
|
return () => {
|
|
78053
|
-
|
|
78096
|
+
removeEventListenerFromGrid(
|
|
78054
78097
|
"displayedColumnsChanged",
|
|
78055
|
-
onDisplayedColumnsChanged
|
|
78098
|
+
onDisplayedColumnsChanged,
|
|
78099
|
+
gridApi
|
|
78056
78100
|
);
|
|
78057
78101
|
};
|
|
78058
78102
|
}, [gridApi]);
|
|
@@ -81735,7 +81779,9 @@ var Table = (props) => {
|
|
|
81735
81779
|
maxHeight = nodeHeight;
|
|
81736
81780
|
}
|
|
81737
81781
|
});
|
|
81738
|
-
gridApi == null ? void 0 : gridApi.
|
|
81782
|
+
if (!(gridApi == null ? void 0 : gridApi.destroyCalled)) {
|
|
81783
|
+
gridApi == null ? void 0 : gridApi.setHeaderHeight(maxHeight);
|
|
81784
|
+
}
|
|
81739
81785
|
}
|
|
81740
81786
|
React82.useEffect(() => {
|
|
81741
81787
|
var _a2, _b2;
|
|
@@ -81748,7 +81794,11 @@ var Table = (props) => {
|
|
|
81748
81794
|
gridApi.addEventListener("firstDataRendered", setHeaderHeight);
|
|
81749
81795
|
setHeaderHeight();
|
|
81750
81796
|
return () => {
|
|
81751
|
-
|
|
81797
|
+
removeEventListenerFromGrid(
|
|
81798
|
+
"firstDataRendered",
|
|
81799
|
+
setHeaderHeight,
|
|
81800
|
+
gridApi
|
|
81801
|
+
);
|
|
81752
81802
|
};
|
|
81753
81803
|
}
|
|
81754
81804
|
return;
|
|
@@ -81990,7 +82040,10 @@ var Table = (props) => {
|
|
|
81990
82040
|
}, [internalTableContext.onTableConfigChange]);
|
|
81991
82041
|
const onDisplayedColumnsChanged = React82.useCallback(
|
|
81992
82042
|
(event) => {
|
|
82043
|
+
var _a2;
|
|
81993
82044
|
if (props.onRowDragEnd) {
|
|
82045
|
+
if ((_a2 = event.columnApi) == null ? void 0 : _a2.destroyCalled)
|
|
82046
|
+
return;
|
|
81994
82047
|
const firstVisibleColumn = event.columnApi.getAllGridColumns().find((col) => col.isVisible());
|
|
81995
82048
|
if (!(firstVisibleColumn == null ? void 0 : firstVisibleColumn.getColDef().rowDrag)) {
|
|
81996
82049
|
adjustRowDragIcon(event.api, event.columnApi);
|
|
@@ -82292,7 +82345,7 @@ var Table = (props) => {
|
|
|
82292
82345
|
props.UNSAFE_internalAGGridOverrides ?? {}
|
|
82293
82346
|
);
|
|
82294
82347
|
return /* @__PURE__ */ React82.createElement(
|
|
82295
|
-
|
|
82348
|
+
Spinner,
|
|
82296
82349
|
{
|
|
82297
82350
|
loading: loadingStatus.loading,
|
|
82298
82351
|
label: loadingStatus.message,
|
|
@@ -82459,7 +82512,11 @@ var TablePagination = ({
|
|
|
82459
82512
|
}
|
|
82460
82513
|
gridApi == null ? void 0 : gridApi.addEventListener("paginationChanged", onPaginationChanged);
|
|
82461
82514
|
return () => {
|
|
82462
|
-
|
|
82515
|
+
removeEventListenerFromGrid(
|
|
82516
|
+
"paginationChanged",
|
|
82517
|
+
onPaginationChanged,
|
|
82518
|
+
gridApi
|
|
82519
|
+
);
|
|
82463
82520
|
};
|
|
82464
82521
|
}, []);
|
|
82465
82522
|
return /* @__PURE__ */ React82.createElement(
|
|
@@ -83024,7 +83081,7 @@ var LocationQuickFilterOverlay = React82.forwardRef(
|
|
|
83024
83081
|
getLabel3(item)
|
|
83025
83082
|
);
|
|
83026
83083
|
})),
|
|
83027
|
-
loading && /* @__PURE__ */ React82.createElement(UNSAFE_Menu.Footer, null, /* @__PURE__ */ React82.createElement(Flex, { justifyContent: "center" }, /* @__PURE__ */ React82.createElement(Spinner, { size: "sm" })))
|
|
83084
|
+
loading && /* @__PURE__ */ React82.createElement(UNSAFE_Menu.Footer, null, /* @__PURE__ */ React82.createElement(Flex, { justifyContent: "center" }, /* @__PURE__ */ React82.createElement(Spinner$1, { size: "sm" })))
|
|
83028
83085
|
));
|
|
83029
83086
|
}
|
|
83030
83087
|
);
|
package/dist/modern/index.js
CHANGED
|
@@ -1011,6 +1011,41 @@ var rowHeightMap = {
|
|
|
1011
1011
|
[rowSize.md]: "medium",
|
|
1012
1012
|
[rowSize.lg]: "large"
|
|
1013
1013
|
};
|
|
1014
|
+
var Spinner = ({
|
|
1015
|
+
loading,
|
|
1016
|
+
...rest
|
|
1017
|
+
}) => /* @__PURE__ */ React82__default.default.createElement(coreReact.Box, { "data-qa": loading ? "loading" : "loaded", display: "flex-row", flex: 1 }, /* @__PURE__ */ React82__default.default.createElement(coreReact.Spinner, { loading, size: "md", centered: true, ...rest }));
|
|
1018
|
+
function isNestedColumnDefinition(Column2) {
|
|
1019
|
+
return "children" in Column2;
|
|
1020
|
+
}
|
|
1021
|
+
function isNestedColDef(colDef) {
|
|
1022
|
+
if (!colDef.groupId) {
|
|
1023
|
+
return false;
|
|
1024
|
+
}
|
|
1025
|
+
return "groupId" in colDef;
|
|
1026
|
+
}
|
|
1027
|
+
function getLeafColDefs(columnDefinitions) {
|
|
1028
|
+
return columnDefinitions.flatMap((colDef) => {
|
|
1029
|
+
return isNestedColDef(colDef) ? getLeafColDefs(colDef.children) : [colDef];
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function isFirstColumn(params) {
|
|
1033
|
+
const displayedColumns = params?.columnApi?.getAllDisplayedColumns() || [];
|
|
1034
|
+
return displayedColumns.length ? displayedColumns[0] === params.column : false;
|
|
1035
|
+
}
|
|
1036
|
+
function getCheckboxColumn(columnApi) {
|
|
1037
|
+
const isGrouping = columnApi?.getRowGroupColumns?.()?.length !== 0;
|
|
1038
|
+
if (isGrouping) {
|
|
1039
|
+
return null;
|
|
1040
|
+
}
|
|
1041
|
+
const displayedColumns = columnApi?.getAllDisplayedColumns() || [];
|
|
1042
|
+
return displayedColumns.length ? displayedColumns[0] : null;
|
|
1043
|
+
}
|
|
1044
|
+
function removeEventListenerFromGrid(event, listener, gridApi) {
|
|
1045
|
+
if (!gridApi || gridApi?.destroyCalled)
|
|
1046
|
+
return;
|
|
1047
|
+
gridApi?.removeEventListener(event, listener);
|
|
1048
|
+
}
|
|
1014
1049
|
|
|
1015
1050
|
// src/styles.scss
|
|
1016
1051
|
var styles_exports = {};
|
|
@@ -54010,8 +54045,16 @@ function useFilterState({
|
|
|
54010
54045
|
}
|
|
54011
54046
|
return () => {
|
|
54012
54047
|
listenersEnabled.current = false;
|
|
54013
|
-
|
|
54014
|
-
|
|
54048
|
+
removeEventListenerFromGrid(
|
|
54049
|
+
"filterChanged",
|
|
54050
|
+
filterEventFunction,
|
|
54051
|
+
gridApi
|
|
54052
|
+
);
|
|
54053
|
+
removeEventListenerFromGrid(
|
|
54054
|
+
"rowDataUpdated",
|
|
54055
|
+
filterEventFunction,
|
|
54056
|
+
gridApi
|
|
54057
|
+
);
|
|
54015
54058
|
};
|
|
54016
54059
|
}, [gridApi, columnDefinitions]);
|
|
54017
54060
|
return { allAvailableFilters, changeFilterValue, filterableColumns };
|
|
@@ -54493,36 +54536,6 @@ var ServerSideFilter = ({
|
|
|
54493
54536
|
)
|
|
54494
54537
|
);
|
|
54495
54538
|
};
|
|
54496
|
-
var Spinner2 = ({
|
|
54497
|
-
loading,
|
|
54498
|
-
...rest
|
|
54499
|
-
}) => /* @__PURE__ */ React82__default.default.createElement(coreReact.Box, { "data-qa": loading ? "loading" : "loaded", display: "flex-row", flex: 1 }, /* @__PURE__ */ React82__default.default.createElement(coreReact.Spinner, { loading, size: "md", centered: true, ...rest }));
|
|
54500
|
-
function isNestedColumnDefinition(Column2) {
|
|
54501
|
-
return "children" in Column2;
|
|
54502
|
-
}
|
|
54503
|
-
function isNestedColDef(colDef) {
|
|
54504
|
-
if (!colDef.groupId) {
|
|
54505
|
-
return false;
|
|
54506
|
-
}
|
|
54507
|
-
return "groupId" in colDef;
|
|
54508
|
-
}
|
|
54509
|
-
function getLeafColDefs(columnDefinitions) {
|
|
54510
|
-
return columnDefinitions.flatMap((colDef) => {
|
|
54511
|
-
return isNestedColDef(colDef) ? getLeafColDefs(colDef.children) : [colDef];
|
|
54512
|
-
});
|
|
54513
|
-
}
|
|
54514
|
-
function isFirstColumn(params) {
|
|
54515
|
-
const displayedColumns = params?.columnApi?.getAllDisplayedColumns() || [];
|
|
54516
|
-
return displayedColumns.length ? displayedColumns[0] === params.column : false;
|
|
54517
|
-
}
|
|
54518
|
-
function getCheckboxColumn(columnApi) {
|
|
54519
|
-
const isGrouping = columnApi?.getRowGroupColumns?.()?.length !== 0;
|
|
54520
|
-
if (isGrouping) {
|
|
54521
|
-
return null;
|
|
54522
|
-
}
|
|
54523
|
-
const displayedColumns = columnApi?.getAllDisplayedColumns() || [];
|
|
54524
|
-
return displayedColumns.length ? displayedColumns[0] : null;
|
|
54525
|
-
}
|
|
54526
54539
|
|
|
54527
54540
|
// src/utils/transformers.ts
|
|
54528
54541
|
var emptyObject = {};
|
|
@@ -55220,7 +55233,7 @@ function ClientSideRowCheckbox(props) {
|
|
|
55220
55233
|
React82.useEffect(() => {
|
|
55221
55234
|
props.api.addEventListener("rowSelected", handleRowSelection);
|
|
55222
55235
|
return () => {
|
|
55223
|
-
|
|
55236
|
+
removeEventListenerFromGrid("rowSelected", handleRowSelection, props.api);
|
|
55224
55237
|
};
|
|
55225
55238
|
}, []);
|
|
55226
55239
|
return /* @__PURE__ */ React82__default.default.createElement(coreReact.Box, { paddingRight: "md" }, /* @__PURE__ */ React82__default.default.createElement(
|
|
@@ -55331,7 +55344,11 @@ function GroupCaret(props) {
|
|
|
55331
55344
|
props.api.addEventListener("rowGroupOpened", handleRowGroupToggle);
|
|
55332
55345
|
return () => {
|
|
55333
55346
|
mounted.current = false;
|
|
55334
|
-
|
|
55347
|
+
removeEventListenerFromGrid(
|
|
55348
|
+
"rowGroupOpened",
|
|
55349
|
+
handleRowGroupToggle,
|
|
55350
|
+
props.api
|
|
55351
|
+
);
|
|
55335
55352
|
};
|
|
55336
55353
|
}, []);
|
|
55337
55354
|
return /* @__PURE__ */ React82__default.default.createElement(coreReact.Box, { className: AutoGroupCell_default.expandableCaret }, props.node.isExpandable() && /* @__PURE__ */ React82__default.default.createElement(
|
|
@@ -55357,7 +55374,11 @@ var AutoGroupCellRenderer = (props) => {
|
|
|
55357
55374
|
React82.useEffect(() => {
|
|
55358
55375
|
props.api.addEventListener("cellValueChanged", handleCellValueChange);
|
|
55359
55376
|
return () => {
|
|
55360
|
-
|
|
55377
|
+
removeEventListenerFromGrid(
|
|
55378
|
+
"cellValueChanged",
|
|
55379
|
+
handleCellValueChange,
|
|
55380
|
+
props.api
|
|
55381
|
+
);
|
|
55361
55382
|
};
|
|
55362
55383
|
}, []);
|
|
55363
55384
|
const adjustedLevel = props.node.footer ? props.node.level + 1 : props.node.level;
|
|
@@ -56208,7 +56229,7 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56208
56229
|
props.api.addEventListener("columnMoved", calculatePosition);
|
|
56209
56230
|
calculatePosition();
|
|
56210
56231
|
return () => {
|
|
56211
|
-
|
|
56232
|
+
removeEventListenerFromGrid("columnMoved", calculatePosition, props.api);
|
|
56212
56233
|
};
|
|
56213
56234
|
}, []);
|
|
56214
56235
|
const onSortToggled = (event) => {
|
|
@@ -56285,7 +56306,11 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56285
56306
|
};
|
|
56286
56307
|
props.api?.addEventListener("expandOrCollapseAll", onExpandAllChange);
|
|
56287
56308
|
return () => {
|
|
56288
|
-
|
|
56309
|
+
removeEventListenerFromGrid(
|
|
56310
|
+
"expandOrCollapseAll",
|
|
56311
|
+
onExpandAllChange,
|
|
56312
|
+
props.api
|
|
56313
|
+
);
|
|
56289
56314
|
};
|
|
56290
56315
|
}, [props.api]);
|
|
56291
56316
|
React82__default.default.useEffect(() => {
|
|
@@ -56376,7 +56401,11 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56376
56401
|
props.api.addEventListener(selectionChanged, onSelectionChanged);
|
|
56377
56402
|
onSelectionChanged();
|
|
56378
56403
|
return () => {
|
|
56379
|
-
|
|
56404
|
+
removeEventListenerFromGrid(
|
|
56405
|
+
selectionChanged,
|
|
56406
|
+
onSelectionChanged,
|
|
56407
|
+
props.api
|
|
56408
|
+
);
|
|
56380
56409
|
};
|
|
56381
56410
|
}, [isFirstColumn2, selectAll]);
|
|
56382
56411
|
const { ref, isOverflowing, recalculate } = useOverflowObserver();
|
|
@@ -56385,8 +56414,8 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56385
56414
|
props.api.addEventListener("cellMouseOver", handler);
|
|
56386
56415
|
props.api.addEventListener("columnResized", handler);
|
|
56387
56416
|
return () => {
|
|
56388
|
-
|
|
56389
|
-
|
|
56417
|
+
removeEventListenerFromGrid("cellMouseOver", handler, props.api);
|
|
56418
|
+
removeEventListenerFromGrid("columnResized", handler, props.api);
|
|
56390
56419
|
};
|
|
56391
56420
|
}, []);
|
|
56392
56421
|
React82__default.default.useEffect(() => {
|
|
@@ -56412,8 +56441,16 @@ var GenericHeaderRenderer = (props) => {
|
|
|
56412
56441
|
props.api.addEventListener(selectionChanged, updateSelectAllCheckbox);
|
|
56413
56442
|
props.api.addEventListener(paginationChanged, updateSelectAllCheckbox);
|
|
56414
56443
|
return () => {
|
|
56415
|
-
|
|
56416
|
-
|
|
56444
|
+
removeEventListenerFromGrid(
|
|
56445
|
+
selectionChanged,
|
|
56446
|
+
updateSelectAllCheckbox,
|
|
56447
|
+
props.api
|
|
56448
|
+
);
|
|
56449
|
+
removeEventListenerFromGrid(
|
|
56450
|
+
paginationChanged,
|
|
56451
|
+
updateSelectAllCheckbox,
|
|
56452
|
+
props.api
|
|
56453
|
+
);
|
|
56417
56454
|
};
|
|
56418
56455
|
}, [isFirstColumn2, props.selectionSSREnabled, props.api, onSSDR]);
|
|
56419
56456
|
const toggleSelectAll = React82__default.default.useCallback(() => {
|
|
@@ -56621,7 +56658,7 @@ function CustomLoader(params) {
|
|
|
56621
56658
|
level: params.node.level,
|
|
56622
56659
|
lastRowInGroup: params.node === groupNodes.last
|
|
56623
56660
|
}
|
|
56624
|
-
), /* @__PURE__ */ React82__default.default.createElement(
|
|
56661
|
+
), /* @__PURE__ */ React82__default.default.createElement(Spinner, { loading: true, size: "sm" }), /* @__PURE__ */ React82__default.default.createElement(coreReact.Box, { paddingLeft: "sm" }, /* @__PURE__ */ React82__default.default.createElement(coreReact.Typography, { color: "gray15", italic: true, intent: "small" }, I18n.t(
|
|
56625
56662
|
`dataTable.loading.${params.node === groupNodes.first ? "initial" : "secondary"}`
|
|
56626
56663
|
))));
|
|
56627
56664
|
}
|
|
@@ -56631,7 +56668,7 @@ var DefaultFrameworkComponents = {
|
|
|
56631
56668
|
agColumnHeader: GenericHeaderRenderer,
|
|
56632
56669
|
agLoadingCellRenderer: CustomLoader,
|
|
56633
56670
|
agColumnGroupHeader: GenericColumnGroupHeader,
|
|
56634
|
-
loadingOverlayRenderer:
|
|
56671
|
+
loadingOverlayRenderer: Spinner,
|
|
56635
56672
|
emptyStateRenderer: EmptyState
|
|
56636
56673
|
};
|
|
56637
56674
|
function getFrameworkComponents(headerMenuConfig, onSelectAll, selectionSSREnabled) {
|
|
@@ -58768,12 +58805,18 @@ var useRowSelectionState = () => {
|
|
|
58768
58805
|
const { gridApi, rowSelectionRef } = useInternalTableContext();
|
|
58769
58806
|
React82__default.default.useEffect(() => {
|
|
58770
58807
|
function selectionEventFunction() {
|
|
58771
|
-
|
|
58808
|
+
if (!gridApi?.destroyCalled) {
|
|
58809
|
+
setSelectedRows(getSelectedRows({ gridApi, rowSelectionRef }));
|
|
58810
|
+
}
|
|
58772
58811
|
}
|
|
58773
58812
|
selectionEventFunction();
|
|
58774
58813
|
gridApi?.addEventListener("selectionChanged", selectionEventFunction);
|
|
58775
58814
|
return () => {
|
|
58776
|
-
|
|
58815
|
+
removeEventListenerFromGrid(
|
|
58816
|
+
"selectionChanged",
|
|
58817
|
+
selectionEventFunction,
|
|
58818
|
+
gridApi
|
|
58819
|
+
);
|
|
58777
58820
|
};
|
|
58778
58821
|
}, [gridApi]);
|
|
58779
58822
|
return selectedRows;
|
|
@@ -76602,7 +76645,7 @@ var BulkEditInput = (props) => {
|
|
|
76602
76645
|
);
|
|
76603
76646
|
} else {
|
|
76604
76647
|
console.warn(
|
|
76605
|
-
`@procore/
|
|
76648
|
+
`@procore/data-table: Unable to find the field for ${props.editor}. Will fallback to a Form.Text.`
|
|
76606
76649
|
);
|
|
76607
76650
|
return defaultField;
|
|
76608
76651
|
}
|
|
@@ -77063,9 +77106,10 @@ var ConfigurationColumns = React82__default.default.forwardRef(
|
|
|
77063
77106
|
onDisplayedColumnsChanged
|
|
77064
77107
|
);
|
|
77065
77108
|
return () => {
|
|
77066
|
-
|
|
77109
|
+
removeEventListenerFromGrid(
|
|
77067
77110
|
"displayedColumnsChanged",
|
|
77068
|
-
onDisplayedColumnsChanged
|
|
77111
|
+
onDisplayedColumnsChanged,
|
|
77112
|
+
gridApi
|
|
77069
77113
|
);
|
|
77070
77114
|
};
|
|
77071
77115
|
}, [gridApi, colDefs]);
|
|
@@ -77910,9 +77954,10 @@ var RowGroupSelector = ({ localeText }) => {
|
|
|
77910
77954
|
onDisplayedColumnsChanged
|
|
77911
77955
|
);
|
|
77912
77956
|
return () => {
|
|
77913
|
-
|
|
77957
|
+
removeEventListenerFromGrid(
|
|
77914
77958
|
"displayedColumnsChanged",
|
|
77915
|
-
onDisplayedColumnsChanged
|
|
77959
|
+
onDisplayedColumnsChanged,
|
|
77960
|
+
gridApi
|
|
77916
77961
|
);
|
|
77917
77962
|
};
|
|
77918
77963
|
}, [gridApi]);
|
|
@@ -81565,7 +81610,9 @@ var Table = (props) => {
|
|
|
81565
81610
|
maxHeight = nodeHeight;
|
|
81566
81611
|
}
|
|
81567
81612
|
});
|
|
81568
|
-
gridApi?.
|
|
81613
|
+
if (!gridApi?.destroyCalled) {
|
|
81614
|
+
gridApi?.setHeaderHeight(maxHeight);
|
|
81615
|
+
}
|
|
81569
81616
|
}
|
|
81570
81617
|
React82__default.default.useEffect(() => {
|
|
81571
81618
|
if (gridApi && columnApi && internalTableContext.tableRef?.current) {
|
|
@@ -81576,7 +81623,11 @@ var Table = (props) => {
|
|
|
81576
81623
|
gridApi.addEventListener("firstDataRendered", setHeaderHeight);
|
|
81577
81624
|
setHeaderHeight();
|
|
81578
81625
|
return () => {
|
|
81579
|
-
|
|
81626
|
+
removeEventListenerFromGrid(
|
|
81627
|
+
"firstDataRendered",
|
|
81628
|
+
setHeaderHeight,
|
|
81629
|
+
gridApi
|
|
81630
|
+
);
|
|
81580
81631
|
};
|
|
81581
81632
|
}
|
|
81582
81633
|
return;
|
|
@@ -81808,6 +81859,8 @@ var Table = (props) => {
|
|
|
81808
81859
|
const onDisplayedColumnsChanged = React82__default.default.useCallback(
|
|
81809
81860
|
(event) => {
|
|
81810
81861
|
if (props.onRowDragEnd) {
|
|
81862
|
+
if (event.columnApi?.destroyCalled)
|
|
81863
|
+
return;
|
|
81811
81864
|
const firstVisibleColumn = event.columnApi.getAllGridColumns().find((col) => col.isVisible());
|
|
81812
81865
|
if (!firstVisibleColumn?.getColDef().rowDrag) {
|
|
81813
81866
|
adjustRowDragIcon(event.api, event.columnApi);
|
|
@@ -82101,7 +82154,7 @@ var Table = (props) => {
|
|
|
82101
82154
|
props.UNSAFE_internalAGGridOverrides ?? {}
|
|
82102
82155
|
);
|
|
82103
82156
|
return /* @__PURE__ */ React82__default.default.createElement(
|
|
82104
|
-
|
|
82157
|
+
Spinner,
|
|
82105
82158
|
{
|
|
82106
82159
|
loading: loadingStatus.loading,
|
|
82107
82160
|
label: loadingStatus.message,
|
|
@@ -82268,7 +82321,11 @@ var TablePagination = ({
|
|
|
82268
82321
|
}
|
|
82269
82322
|
gridApi?.addEventListener("paginationChanged", onPaginationChanged);
|
|
82270
82323
|
return () => {
|
|
82271
|
-
|
|
82324
|
+
removeEventListenerFromGrid(
|
|
82325
|
+
"paginationChanged",
|
|
82326
|
+
onPaginationChanged,
|
|
82327
|
+
gridApi
|
|
82328
|
+
);
|
|
82272
82329
|
};
|
|
82273
82330
|
}, []);
|
|
82274
82331
|
return /* @__PURE__ */ React82__default.default.createElement(
|