@tanstack/svelte-table 8.0.0-alpha.84 → 8.0.0-alpha.87
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/build/cjs/svelte-table/src/index.js +0 -1
- package/build/cjs/svelte-table/src/index.js.map +1 -1
- package/build/cjs/table-core/build/esm/index.js +117 -131
- package/build/cjs/table-core/build/esm/index.js.map +1 -1
- package/build/esm/index.js +118 -131
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +38 -38
- package/build/umd/index.development.js +117 -131
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
package/build/stats-html.html
CHANGED
|
@@ -2669,7 +2669,7 @@ var drawChart = (function (exports) {
|
|
|
2669
2669
|
</script>
|
|
2670
2670
|
<script>
|
|
2671
2671
|
/*<!--*/
|
|
2672
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"
|
|
2672
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"packages","children":[{"name":"table-core/build/esm/index.js","uid":"3258-163"},{"name":"svelte-table/src","children":[{"uid":"3258-165","name":"placeholder.svelte"},{"uid":"3258-167","name":"render-component.ts"},{"uid":"3258-169","name":"index.ts"}]}]}]}],"isRoot":true},"nodeParts":{"3258-163":{"renderedLength":137397,"gzipLength":23365,"brotliLength":0,"mainUid":"3258-162"},"3258-165":{"renderedLength":925,"gzipLength":444,"brotliLength":0,"mainUid":"3258-164"},"3258-167":{"renderedLength":1365,"gzipLength":519,"brotliLength":0,"mainUid":"3258-166"},"3258-169":{"renderedLength":2729,"gzipLength":868,"brotliLength":0,"mainUid":"3258-168"}},"nodeMetas":{"3258-162":{"id":"/packages/table-core/build/esm/index.js","moduleParts":{"index.production.js":"3258-163"},"imported":[],"importedBy":[{"uid":"3258-168"}]},"3258-164":{"id":"/packages/svelte-table/src/placeholder.svelte","moduleParts":{"index.production.js":"3258-165"},"imported":[{"uid":"3258-170"}],"importedBy":[{"uid":"3258-168"}]},"3258-166":{"id":"/packages/svelte-table/src/render-component.ts","moduleParts":{"index.production.js":"3258-167"},"imported":[{"uid":"3258-170"}],"importedBy":[{"uid":"3258-168"}]},"3258-168":{"id":"/packages/svelte-table/src/index.ts","moduleParts":{"index.production.js":"3258-169"},"imported":[{"uid":"3258-162"},{"uid":"3258-164"},{"uid":"3258-170"},{"uid":"3258-171"},{"uid":"3258-166"}],"importedBy":[],"isEntry":true},"3258-170":{"id":"svelte/internal","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-168"},{"uid":"3258-164"},{"uid":"3258-166"}],"isExternal":true},"3258-171":{"id":"svelte/store","moduleParts":{},"imported":[],"importedBy":[{"uid":"3258-168"}],"isExternal":true}},"env":{"rollup":"2.70.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
2673
2673
|
|
|
2674
2674
|
const run = () => {
|
|
2675
2675
|
const width = window.innerWidth;
|
package/build/stats-react.json
CHANGED
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "table-core/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "3258-173"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "svelte-table/src",
|
|
18
18
|
"children": [
|
|
19
19
|
{
|
|
20
|
-
"uid": "
|
|
20
|
+
"uid": "3258-175",
|
|
21
21
|
"name": "placeholder.svelte"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"uid": "
|
|
24
|
+
"uid": "3258-177",
|
|
25
25
|
"name": "render-component.ts"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"uid": "
|
|
28
|
+
"uid": "3258-179",
|
|
29
29
|
"name": "index.ts"
|
|
30
30
|
}
|
|
31
31
|
]
|
|
@@ -38,125 +38,125 @@
|
|
|
38
38
|
"isRoot": true
|
|
39
39
|
},
|
|
40
40
|
"nodeParts": {
|
|
41
|
-
"
|
|
42
|
-
"renderedLength":
|
|
43
|
-
"gzipLength":
|
|
41
|
+
"3258-173": {
|
|
42
|
+
"renderedLength": 137397,
|
|
43
|
+
"gzipLength": 23365,
|
|
44
44
|
"brotliLength": 0,
|
|
45
|
-
"mainUid": "
|
|
45
|
+
"mainUid": "3258-172"
|
|
46
46
|
},
|
|
47
|
-
"
|
|
47
|
+
"3258-175": {
|
|
48
48
|
"renderedLength": 925,
|
|
49
49
|
"gzipLength": 444,
|
|
50
50
|
"brotliLength": 0,
|
|
51
|
-
"mainUid": "
|
|
51
|
+
"mainUid": "3258-174"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
53
|
+
"3258-177": {
|
|
54
54
|
"renderedLength": 1365,
|
|
55
55
|
"gzipLength": 519,
|
|
56
56
|
"brotliLength": 0,
|
|
57
|
-
"mainUid": "
|
|
57
|
+
"mainUid": "3258-176"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"3258-179": {
|
|
60
60
|
"renderedLength": 2729,
|
|
61
61
|
"gzipLength": 868,
|
|
62
62
|
"brotliLength": 0,
|
|
63
|
-
"mainUid": "
|
|
63
|
+
"mainUid": "3258-178"
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"nodeMetas": {
|
|
67
|
-
"
|
|
67
|
+
"3258-172": {
|
|
68
68
|
"id": "/packages/table-core/build/esm/index.js",
|
|
69
69
|
"moduleParts": {
|
|
70
|
-
"index.production.js": "
|
|
70
|
+
"index.production.js": "3258-173"
|
|
71
71
|
},
|
|
72
72
|
"imported": [],
|
|
73
73
|
"importedBy": [
|
|
74
74
|
{
|
|
75
|
-
"uid": "
|
|
75
|
+
"uid": "3258-178"
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"3258-174": {
|
|
80
80
|
"id": "/packages/svelte-table/src/placeholder.svelte",
|
|
81
81
|
"moduleParts": {
|
|
82
|
-
"index.production.js": "
|
|
82
|
+
"index.production.js": "3258-175"
|
|
83
83
|
},
|
|
84
84
|
"imported": [
|
|
85
85
|
{
|
|
86
|
-
"uid": "
|
|
86
|
+
"uid": "3258-180"
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
"importedBy": [
|
|
90
90
|
{
|
|
91
|
-
"uid": "
|
|
91
|
+
"uid": "3258-178"
|
|
92
92
|
}
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"
|
|
95
|
+
"3258-176": {
|
|
96
96
|
"id": "/packages/svelte-table/src/render-component.ts",
|
|
97
97
|
"moduleParts": {
|
|
98
|
-
"index.production.js": "
|
|
98
|
+
"index.production.js": "3258-177"
|
|
99
99
|
},
|
|
100
100
|
"imported": [
|
|
101
101
|
{
|
|
102
|
-
"uid": "
|
|
102
|
+
"uid": "3258-180"
|
|
103
103
|
}
|
|
104
104
|
],
|
|
105
105
|
"importedBy": [
|
|
106
106
|
{
|
|
107
|
-
"uid": "
|
|
107
|
+
"uid": "3258-178"
|
|
108
108
|
}
|
|
109
109
|
]
|
|
110
110
|
},
|
|
111
|
-
"
|
|
111
|
+
"3258-178": {
|
|
112
112
|
"id": "/packages/svelte-table/src/index.ts",
|
|
113
113
|
"moduleParts": {
|
|
114
|
-
"index.production.js": "
|
|
114
|
+
"index.production.js": "3258-179"
|
|
115
115
|
},
|
|
116
116
|
"imported": [
|
|
117
117
|
{
|
|
118
|
-
"uid": "
|
|
118
|
+
"uid": "3258-172"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
"uid": "
|
|
121
|
+
"uid": "3258-174"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"uid": "
|
|
124
|
+
"uid": "3258-180"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
|
-
"uid": "
|
|
127
|
+
"uid": "3258-181"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
"uid": "
|
|
130
|
+
"uid": "3258-176"
|
|
131
131
|
}
|
|
132
132
|
],
|
|
133
133
|
"importedBy": [],
|
|
134
134
|
"isEntry": true
|
|
135
135
|
},
|
|
136
|
-
"
|
|
136
|
+
"3258-180": {
|
|
137
137
|
"id": "svelte/internal",
|
|
138
138
|
"moduleParts": {},
|
|
139
139
|
"imported": [],
|
|
140
140
|
"importedBy": [
|
|
141
141
|
{
|
|
142
|
-
"uid": "
|
|
142
|
+
"uid": "3258-178"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
|
-
"uid": "
|
|
145
|
+
"uid": "3258-174"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
|
-
"uid": "
|
|
148
|
+
"uid": "3258-176"
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
"isExternal": true
|
|
152
152
|
},
|
|
153
|
-
"
|
|
153
|
+
"3258-181": {
|
|
154
154
|
"id": "svelte/store",
|
|
155
155
|
"moduleParts": {},
|
|
156
156
|
"imported": [],
|
|
157
157
|
"importedBy": [
|
|
158
158
|
{
|
|
159
|
-
"uid": "
|
|
159
|
+
"uid": "3258-178"
|
|
160
160
|
}
|
|
161
161
|
],
|
|
162
162
|
"isExternal": true
|
|
@@ -829,7 +829,6 @@
|
|
|
829
829
|
return {
|
|
830
830
|
onExpandedChange: makeStateUpdater('expanded', instance),
|
|
831
831
|
autoResetExpanded: true,
|
|
832
|
-
expandSubRows: true,
|
|
833
832
|
paginateExpandedRows: true
|
|
834
833
|
};
|
|
835
834
|
},
|
|
@@ -1226,8 +1225,7 @@
|
|
|
1226
1225
|
createRow: (row, instance) => {
|
|
1227
1226
|
return {
|
|
1228
1227
|
columnFilters: {},
|
|
1229
|
-
columnFiltersMeta: {}
|
|
1230
|
-
subRowsByFacetId: {}
|
|
1228
|
+
columnFiltersMeta: {}
|
|
1231
1229
|
};
|
|
1232
1230
|
},
|
|
1233
1231
|
createInstance: instance => {
|
|
@@ -1318,53 +1316,42 @@
|
|
|
1318
1316
|
return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column) : false) || typeof value === 'undefined' || typeof value === 'string' && !value;
|
|
1319
1317
|
}
|
|
1320
1318
|
|
|
1321
|
-
const
|
|
1322
|
-
sum,
|
|
1323
|
-
min,
|
|
1324
|
-
max,
|
|
1325
|
-
extent,
|
|
1326
|
-
mean,
|
|
1327
|
-
median,
|
|
1328
|
-
unique,
|
|
1329
|
-
uniqueCount,
|
|
1330
|
-
count
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
function sum(_getLeafValues, getChildValues) {
|
|
1319
|
+
const sum = (columnId, _leafRows, childRows) => {
|
|
1334
1320
|
// It's faster to just add the aggregations together instead of
|
|
1335
1321
|
// process leaf nodes individually
|
|
1336
|
-
return
|
|
1337
|
-
}
|
|
1322
|
+
return childRows.reduce((sum, next) => sum + (typeof next === 'number' ? next : 0), 0);
|
|
1323
|
+
};
|
|
1338
1324
|
|
|
1339
|
-
|
|
1325
|
+
const min = (columnId, _leafRows, childRows) => {
|
|
1340
1326
|
let min;
|
|
1327
|
+
childRows.forEach(row => {
|
|
1328
|
+
const value = row.getValue(columnId);
|
|
1341
1329
|
|
|
1342
|
-
for (const value of getChildValues()) {
|
|
1343
1330
|
if (value != null && (min > value || min === undefined && value >= value)) {
|
|
1344
1331
|
min = value;
|
|
1345
1332
|
}
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1333
|
+
});
|
|
1348
1334
|
return min;
|
|
1349
|
-
}
|
|
1335
|
+
};
|
|
1350
1336
|
|
|
1351
|
-
|
|
1337
|
+
const max = (columnId, _leafRows, childRows) => {
|
|
1352
1338
|
let max;
|
|
1339
|
+
childRows.forEach(row => {
|
|
1340
|
+
const value = row.getValue(columnId);
|
|
1353
1341
|
|
|
1354
|
-
for (const value of getChildValues()) {
|
|
1355
1342
|
if (value != null && (max < value || max === undefined && value >= value)) {
|
|
1356
1343
|
max = value;
|
|
1357
1344
|
}
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1345
|
+
});
|
|
1360
1346
|
return max;
|
|
1361
|
-
}
|
|
1347
|
+
};
|
|
1362
1348
|
|
|
1363
|
-
|
|
1349
|
+
const extent = (columnId, _leafRows, childRows) => {
|
|
1364
1350
|
let min;
|
|
1365
1351
|
let max;
|
|
1352
|
+
childRows.forEach(row => {
|
|
1353
|
+
const value = row.getValue(columnId);
|
|
1366
1354
|
|
|
1367
|
-
for (const value of getChildValues()) {
|
|
1368
1355
|
if (value != null) {
|
|
1369
1356
|
if (min === undefined) {
|
|
1370
1357
|
if (value >= value) min = max = value;
|
|
@@ -1373,54 +1360,65 @@
|
|
|
1373
1360
|
if (max < value) max = value;
|
|
1374
1361
|
}
|
|
1375
1362
|
}
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1363
|
+
});
|
|
1378
1364
|
return [min, max];
|
|
1379
|
-
}
|
|
1365
|
+
};
|
|
1380
1366
|
|
|
1381
|
-
|
|
1367
|
+
const mean = (columnId, leafRows) => {
|
|
1382
1368
|
let count = 0;
|
|
1383
1369
|
let sum = 0;
|
|
1370
|
+
leafRows.forEach(row => {
|
|
1371
|
+
let value = row.getValue(columnId);
|
|
1384
1372
|
|
|
1385
|
-
for (let value of getLeafValues()) {
|
|
1386
1373
|
if (value != null && (value = +value) >= value) {
|
|
1387
1374
|
++count, sum += value;
|
|
1388
1375
|
}
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1376
|
+
});
|
|
1391
1377
|
if (count) return sum / count;
|
|
1392
1378
|
return;
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
function median(getLeafValues) {
|
|
1396
|
-
const leafValues = getLeafValues();
|
|
1379
|
+
};
|
|
1397
1380
|
|
|
1398
|
-
|
|
1381
|
+
const median = (columnId, leafRows) => {
|
|
1382
|
+
if (!leafRows.length) {
|
|
1399
1383
|
return;
|
|
1400
1384
|
}
|
|
1401
1385
|
|
|
1402
1386
|
let min = 0;
|
|
1403
1387
|
let max = 0;
|
|
1404
|
-
|
|
1388
|
+
leafRows.forEach(row => {
|
|
1389
|
+
let value = row.getValue(columnId);
|
|
1390
|
+
|
|
1405
1391
|
if (typeof value === 'number') {
|
|
1406
1392
|
min = Math.min(min, value);
|
|
1407
1393
|
max = Math.max(max, value);
|
|
1408
1394
|
}
|
|
1409
1395
|
});
|
|
1410
1396
|
return (min + max) / 2;
|
|
1411
|
-
}
|
|
1397
|
+
};
|
|
1412
1398
|
|
|
1413
|
-
|
|
1414
|
-
return Array.from(new Set(
|
|
1415
|
-
}
|
|
1399
|
+
const unique = (columnId, leafRows) => {
|
|
1400
|
+
return Array.from(new Set(leafRows.map(d => d.getValue(columnId))).values());
|
|
1401
|
+
};
|
|
1416
1402
|
|
|
1417
|
-
|
|
1418
|
-
return new Set(
|
|
1419
|
-
}
|
|
1403
|
+
const uniqueCount = (columnId, leafRows) => {
|
|
1404
|
+
return new Set(leafRows.map(d => d.getValue(columnId))).size;
|
|
1405
|
+
};
|
|
1420
1406
|
|
|
1421
|
-
|
|
1422
|
-
return
|
|
1423
|
-
}
|
|
1407
|
+
const count = (_columnId, leafRows) => {
|
|
1408
|
+
return leafRows.length;
|
|
1409
|
+
};
|
|
1410
|
+
|
|
1411
|
+
const aggregationFns = {
|
|
1412
|
+
sum,
|
|
1413
|
+
min,
|
|
1414
|
+
max,
|
|
1415
|
+
extent,
|
|
1416
|
+
mean,
|
|
1417
|
+
median,
|
|
1418
|
+
unique,
|
|
1419
|
+
uniqueCount,
|
|
1420
|
+
count
|
|
1421
|
+
};
|
|
1424
1422
|
|
|
1425
1423
|
//
|
|
1426
1424
|
const Grouping = {
|
|
@@ -1475,7 +1473,7 @@
|
|
|
1475
1473
|
column.toggleGrouping();
|
|
1476
1474
|
};
|
|
1477
1475
|
},
|
|
1478
|
-
|
|
1476
|
+
getAutoAggregationFn: () => {
|
|
1479
1477
|
const firstRow = instance.getCoreRowModel().flatRows[0];
|
|
1480
1478
|
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
1481
1479
|
|
|
@@ -1489,7 +1487,7 @@
|
|
|
1489
1487
|
|
|
1490
1488
|
return aggregationFns.count;
|
|
1491
1489
|
},
|
|
1492
|
-
|
|
1490
|
+
getAggregationFn: () => {
|
|
1493
1491
|
var _ref4;
|
|
1494
1492
|
|
|
1495
1493
|
const userAggregationFns = instance.options.aggregationFns;
|
|
@@ -1498,7 +1496,7 @@
|
|
|
1498
1496
|
throw new Error();
|
|
1499
1497
|
}
|
|
1500
1498
|
|
|
1501
|
-
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.
|
|
1499
|
+
return isFunction(column.aggregationFn) ? column.aggregationFn : column.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.aggregationFn]) != null ? _ref4 : aggregationFns[column.aggregationFn];
|
|
1502
1500
|
}
|
|
1503
1501
|
};
|
|
1504
1502
|
},
|
|
@@ -1524,10 +1522,10 @@
|
|
|
1524
1522
|
}
|
|
1525
1523
|
};
|
|
1526
1524
|
},
|
|
1527
|
-
createRow:
|
|
1525
|
+
createRow: row => {
|
|
1528
1526
|
return {
|
|
1529
1527
|
getIsGrouped: () => !!row.groupingColumnId,
|
|
1530
|
-
|
|
1528
|
+
_groupingValuesCache: {}
|
|
1531
1529
|
};
|
|
1532
1530
|
},
|
|
1533
1531
|
createCell: (cell, column, row, instance) => {
|
|
@@ -2346,21 +2344,54 @@
|
|
|
2346
2344
|
}
|
|
2347
2345
|
|
|
2348
2346
|
const reSplitAlphaNumeric = /([0-9]+)/gm;
|
|
2349
|
-
const sortingFns = {
|
|
2350
|
-
alphanumeric,
|
|
2351
|
-
alphanumericCaseSensitive,
|
|
2352
|
-
text,
|
|
2353
|
-
textCaseSensitive,
|
|
2354
|
-
datetime,
|
|
2355
|
-
basic
|
|
2356
|
-
};
|
|
2357
2347
|
|
|
2358
|
-
|
|
2348
|
+
const alphanumeric = (rowA, rowB, columnId) => {
|
|
2359
2349
|
return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
2360
|
-
}
|
|
2350
|
+
};
|
|
2361
2351
|
|
|
2362
|
-
|
|
2352
|
+
const alphanumericCaseSensitive = (rowA, rowB, columnId) => {
|
|
2363
2353
|
return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
2354
|
+
}; // The text filter is more basic (less numeric support)
|
|
2355
|
+
// but is much faster
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
const text = (rowA, rowB, columnId) => {
|
|
2359
|
+
return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
2360
|
+
}; // The text filter is more basic (less numeric support)
|
|
2361
|
+
// but is much faster
|
|
2362
|
+
|
|
2363
|
+
|
|
2364
|
+
const textCaseSensitive = (rowA, rowB, columnId) => {
|
|
2365
|
+
return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2368
|
+
const datetime = (rowA, rowB, columnId) => {
|
|
2369
|
+
return compareBasic(rowA.getValue(columnId).getTime(), rowB.getValue(columnId).getTime());
|
|
2370
|
+
};
|
|
2371
|
+
|
|
2372
|
+
const basic = (rowA, rowB, columnId) => {
|
|
2373
|
+
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
|
|
2374
|
+
}; // Utils
|
|
2375
|
+
|
|
2376
|
+
|
|
2377
|
+
function compareBasic(a, b) {
|
|
2378
|
+
return a === b ? 0 : a > b ? 1 : -1;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
function toString(a) {
|
|
2382
|
+
if (typeof a === 'number') {
|
|
2383
|
+
if (isNaN(a) || a === Infinity || a === -Infinity) {
|
|
2384
|
+
return '';
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
return String(a);
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
if (typeof a === 'string') {
|
|
2391
|
+
return a;
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
return '';
|
|
2364
2395
|
} // Mixed sorting is slow, but very inclusive of many edge cases.
|
|
2365
2396
|
// It handles numbers, mixed alphanumeric combinations, and even
|
|
2366
2397
|
// null, undefined, and Infinity
|
|
@@ -2407,48 +2438,17 @@
|
|
|
2407
2438
|
}
|
|
2408
2439
|
|
|
2409
2440
|
return a.length - b.length;
|
|
2410
|
-
} //
|
|
2411
|
-
// but is much faster
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
function text(rowA, rowB, columnId) {
|
|
2415
|
-
return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
|
|
2416
|
-
} // The text filter is more basic (less numeric support)
|
|
2417
|
-
// but is much faster
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
function textCaseSensitive(rowA, rowB, columnId) {
|
|
2421
|
-
return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
function datetime(rowA, rowB, columnId) {
|
|
2425
|
-
return compareBasic(rowA.getValue(columnId).getTime(), rowB.getValue(columnId).getTime());
|
|
2426
|
-
}
|
|
2427
|
-
|
|
2428
|
-
function basic(rowA, rowB, columnId) {
|
|
2429
|
-
return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
|
|
2430
|
-
} // Utils
|
|
2441
|
+
} // Exports
|
|
2431
2442
|
|
|
2432
2443
|
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
return String(a);
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
|
-
if (typeof a === 'string') {
|
|
2447
|
-
return a;
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
|
-
return '';
|
|
2451
|
-
}
|
|
2444
|
+
const sortingFns = {
|
|
2445
|
+
alphanumeric,
|
|
2446
|
+
alphanumericCaseSensitive,
|
|
2447
|
+
text,
|
|
2448
|
+
textCaseSensitive,
|
|
2449
|
+
datetime,
|
|
2450
|
+
basic
|
|
2451
|
+
};
|
|
2452
2452
|
|
|
2453
2453
|
//
|
|
2454
2454
|
const Sorting = {
|
|
@@ -2672,11 +2672,6 @@
|
|
|
2672
2672
|
onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
|
|
2673
2673
|
};
|
|
2674
2674
|
},
|
|
2675
|
-
getDefaultColumnDef: () => {
|
|
2676
|
-
return {
|
|
2677
|
-
defaultIsVisible: true
|
|
2678
|
-
};
|
|
2679
|
-
},
|
|
2680
2675
|
createColumn: (column, instance) => {
|
|
2681
2676
|
return {
|
|
2682
2677
|
toggleVisibility: value => {
|
|
@@ -3660,25 +3655,17 @@
|
|
|
3660
3655
|
return row._valuesCache[columnId];
|
|
3661
3656
|
}
|
|
3662
3657
|
|
|
3663
|
-
if (row.
|
|
3664
|
-
return row.
|
|
3658
|
+
if (row._groupingValuesCache.hasOwnProperty(columnId)) {
|
|
3659
|
+
return row._groupingValuesCache[columnId];
|
|
3665
3660
|
} // Aggregate the values
|
|
3666
3661
|
|
|
3667
3662
|
|
|
3668
3663
|
const column = instance.getColumn(columnId);
|
|
3669
|
-
const aggregateFn = column.
|
|
3664
|
+
const aggregateFn = column.getAggregationFn();
|
|
3670
3665
|
|
|
3671
3666
|
if (aggregateFn) {
|
|
3672
|
-
row.
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
if (!depth && column.columnDef.aggregateValue) {
|
|
3676
|
-
columnValue = column.columnDef.aggregateValue(columnValue);
|
|
3677
|
-
}
|
|
3678
|
-
|
|
3679
|
-
return columnValue;
|
|
3680
|
-
}), () => groupedRows.map(row => row.getValue(columnId)));
|
|
3681
|
-
return row.groupingValuesCache[columnId];
|
|
3667
|
+
row._groupingValuesCache[columnId] = aggregateFn(columnId, leafRows, groupedRows);
|
|
3668
|
+
return row._groupingValuesCache[columnId];
|
|
3682
3669
|
} else if (column.aggregationFn) {
|
|
3683
3670
|
console.info({
|
|
3684
3671
|
column
|
|
@@ -3758,7 +3745,7 @@
|
|
|
3758
3745
|
return rowModel;
|
|
3759
3746
|
}
|
|
3760
3747
|
|
|
3761
|
-
return expandRows(rowModel
|
|
3748
|
+
return expandRows(rowModel);
|
|
3762
3749
|
}, {
|
|
3763
3750
|
key: 'getExpandedRowModel',
|
|
3764
3751
|
debug: () => {
|
|
@@ -3776,7 +3763,7 @@
|
|
|
3776
3763
|
|
|
3777
3764
|
expandedRows.push(row);
|
|
3778
3765
|
|
|
3779
|
-
if (
|
|
3766
|
+
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
|
|
3780
3767
|
row.subRows.forEach(handleRow);
|
|
3781
3768
|
}
|
|
3782
3769
|
};
|
|
@@ -3813,7 +3800,7 @@
|
|
|
3813
3800
|
rows,
|
|
3814
3801
|
flatRows,
|
|
3815
3802
|
rowsById
|
|
3816
|
-
}
|
|
3803
|
+
});
|
|
3817
3804
|
}
|
|
3818
3805
|
|
|
3819
3806
|
return {
|
|
@@ -4062,7 +4049,6 @@
|
|
|
4062
4049
|
exports.isFunction = isFunction;
|
|
4063
4050
|
exports.isRowSelected = isRowSelected;
|
|
4064
4051
|
exports.makeStateUpdater = makeStateUpdater;
|
|
4065
|
-
exports.mean = mean;
|
|
4066
4052
|
exports.memo = memo;
|
|
4067
4053
|
exports.noop = noop;
|
|
4068
4054
|
exports.orderColumns = orderColumns;
|