1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | "use strict";
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | var utils_1 = require("./utils");
|
10 | function defaultGroupComparator(valueA, valueB, nodeA, nodeB, accentedCompare) {
|
11 | if (accentedCompare === void 0) { accentedCompare = false; }
|
12 | console.warn('ag-Grid: Since ag-grid 11.0.0 defaultGroupComparator is not necessary. You can remove this from your colDef');
|
13 | var nodeAIsGroup = utils_1.Utils.exists(nodeA) && nodeA.group;
|
14 | var nodeBIsGroup = utils_1.Utils.exists(nodeB) && nodeB.group;
|
15 | var bothAreGroups = nodeAIsGroup && nodeBIsGroup;
|
16 | var bothAreNormal = !nodeAIsGroup && !nodeBIsGroup;
|
17 | if (bothAreGroups) {
|
18 | return utils_1.Utils.defaultComparator(nodeA.key, nodeB.key, accentedCompare);
|
19 | }
|
20 | else if (bothAreNormal) {
|
21 | return utils_1.Utils.defaultComparator(valueA, valueB, accentedCompare);
|
22 | }
|
23 | else if (nodeAIsGroup) {
|
24 | return 1;
|
25 | }
|
26 | else {
|
27 | return -1;
|
28 | }
|
29 | }
|
30 | exports.defaultGroupComparator = defaultGroupComparator;
|