@mtes-mct/monitor-ui 10.13.0 → 10.14.1
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 +27 -0
- package/cypress/index.js +1 -0
- package/cypress/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +1677 -1535
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/utils/isEmptyish.d.ts +5 -0
- package/utils/isEmptyish.d.ts.map +1 -0
- package/utils/sortCollectionByLocalizedProps.d.ts +6 -0
- package/utils/sortCollectionByLocalizedProps.d.ts.map +1 -0
package/index.js
CHANGED
|
@@ -459,6 +459,7 @@ function _curryN(length, received, fn) {
|
|
|
459
459
|
var argsIdx = 0;
|
|
460
460
|
var left = length;
|
|
461
461
|
var combinedIdx = 0;
|
|
462
|
+
var hasPlaceholder = false;
|
|
462
463
|
|
|
463
464
|
while (combinedIdx < received.length || argsIdx < arguments.length) {
|
|
464
465
|
var result;
|
|
@@ -474,12 +475,14 @@ function _curryN(length, received, fn) {
|
|
|
474
475
|
|
|
475
476
|
if (!_isPlaceholder(result)) {
|
|
476
477
|
left -= 1;
|
|
478
|
+
} else {
|
|
479
|
+
hasPlaceholder = true;
|
|
477
480
|
}
|
|
478
481
|
|
|
479
482
|
combinedIdx += 1;
|
|
480
483
|
}
|
|
481
484
|
|
|
482
|
-
return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
|
|
485
|
+
return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));
|
|
483
486
|
};
|
|
484
487
|
}
|
|
485
488
|
|
|
@@ -836,6 +839,7 @@ _curry1(function keys(obj) {
|
|
|
836
839
|
* R.type([]); //=> "Array"
|
|
837
840
|
* R.type(/[A-z]/); //=> "RegExp"
|
|
838
841
|
* R.type(() => {}); //=> "Function"
|
|
842
|
+
* R.type(async () => {}); //=> "AsyncFunction"
|
|
839
843
|
* R.type(undefined); //=> "Undefined"
|
|
840
844
|
*/
|
|
841
845
|
|
|
@@ -72852,7 +72856,7 @@ function memo(getDeps, fn, opts) {
|
|
|
72852
72856
|
let resultTime;
|
|
72853
72857
|
if (opts.key && opts.debug) resultTime = Date.now();
|
|
72854
72858
|
result = fn(...newDeps);
|
|
72855
|
-
opts == null
|
|
72859
|
+
opts == null || opts.onChange == null || opts.onChange(result);
|
|
72856
72860
|
if (opts.key && opts.debug) {
|
|
72857
72861
|
if (opts != null && opts.debug()) {
|
|
72858
72862
|
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
@@ -72943,9 +72947,9 @@ function createColumn(table, columnDef, depth, parent) {
|
|
|
72943
72947
|
}
|
|
72944
72948
|
})
|
|
72945
72949
|
};
|
|
72946
|
-
|
|
72947
|
-
|
|
72948
|
-
}
|
|
72950
|
+
for (const feature of table._features) {
|
|
72951
|
+
feature.createColumn == null || feature.createColumn(column, table);
|
|
72952
|
+
}
|
|
72949
72953
|
|
|
72950
72954
|
// Yes, we have to convert table to uknown, because we know more than the compiler here.
|
|
72951
72955
|
return column;
|
|
@@ -72985,196 +72989,197 @@ function createHeader(table, column, options) {
|
|
|
72985
72989
|
})
|
|
72986
72990
|
};
|
|
72987
72991
|
table._features.forEach(feature => {
|
|
72988
|
-
|
|
72992
|
+
feature.createHeader == null || feature.createHeader(header, table);
|
|
72989
72993
|
});
|
|
72990
72994
|
return header;
|
|
72991
72995
|
}
|
|
72992
72996
|
const Headers = {
|
|
72993
72997
|
createTable: table => {
|
|
72994
|
-
|
|
72995
|
-
|
|
72996
|
-
|
|
72997
|
-
|
|
72998
|
-
|
|
72999
|
-
|
|
73000
|
-
|
|
73001
|
-
|
|
73002
|
-
|
|
73003
|
-
|
|
73004
|
-
|
|
73005
|
-
|
|
73006
|
-
|
|
73007
|
-
|
|
73008
|
-
|
|
73009
|
-
|
|
73010
|
-
|
|
73011
|
-
|
|
73012
|
-
|
|
73013
|
-
|
|
73014
|
-
|
|
73015
|
-
|
|
73016
|
-
|
|
73017
|
-
|
|
73018
|
-
|
|
73019
|
-
|
|
73020
|
-
|
|
73021
|
-
|
|
73022
|
-
|
|
73023
|
-
|
|
73024
|
-
|
|
73025
|
-
|
|
73026
|
-
|
|
73027
|
-
|
|
73028
|
-
|
|
73029
|
-
|
|
73030
|
-
|
|
73031
|
-
|
|
73032
|
-
|
|
73033
|
-
|
|
73034
|
-
|
|
73035
|
-
|
|
73036
|
-
|
|
73037
|
-
|
|
73038
|
-
|
|
73039
|
-
|
|
73040
|
-
|
|
73041
|
-
|
|
73042
|
-
}),
|
|
73043
|
-
// Footer Groups
|
|
72998
|
+
// Header Groups
|
|
72999
|
+
|
|
73000
|
+
table.getHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
73001
|
+
var _left$map$filter, _right$map$filter;
|
|
73002
|
+
const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
|
|
73003
|
+
const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
|
|
73004
|
+
const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
73005
|
+
const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
|
|
73006
|
+
return headerGroups;
|
|
73007
|
+
}, {
|
|
73008
|
+
key: process.env.NODE_ENV === 'development' && 'getHeaderGroups',
|
|
73009
|
+
debug: () => {
|
|
73010
|
+
var _table$options$debugA;
|
|
73011
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
|
|
73012
|
+
}
|
|
73013
|
+
});
|
|
73014
|
+
table.getCenterHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
|
|
73015
|
+
leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
|
|
73016
|
+
return buildHeaderGroups(allColumns, leafColumns, table, 'center');
|
|
73017
|
+
}, {
|
|
73018
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterHeaderGroups',
|
|
73019
|
+
debug: () => {
|
|
73020
|
+
var _table$options$debugA2;
|
|
73021
|
+
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
|
|
73022
|
+
}
|
|
73023
|
+
});
|
|
73024
|
+
table.getLeftHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
|
|
73025
|
+
var _left$map$filter2;
|
|
73026
|
+
const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
|
|
73027
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
|
|
73028
|
+
}, {
|
|
73029
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftHeaderGroups',
|
|
73030
|
+
debug: () => {
|
|
73031
|
+
var _table$options$debugA3;
|
|
73032
|
+
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
|
|
73033
|
+
}
|
|
73034
|
+
});
|
|
73035
|
+
table.getRightHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
|
|
73036
|
+
var _right$map$filter2;
|
|
73037
|
+
const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
|
|
73038
|
+
return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
|
|
73039
|
+
}, {
|
|
73040
|
+
key: process.env.NODE_ENV === 'development' && 'getRightHeaderGroups',
|
|
73041
|
+
debug: () => {
|
|
73042
|
+
var _table$options$debugA4;
|
|
73043
|
+
return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
|
|
73044
|
+
}
|
|
73045
|
+
});
|
|
73044
73046
|
|
|
73045
|
-
|
|
73046
|
-
return [...headerGroups].reverse();
|
|
73047
|
-
}, {
|
|
73048
|
-
key: process.env.NODE_ENV === 'development' && 'getFooterGroups',
|
|
73049
|
-
debug: () => {
|
|
73050
|
-
var _table$options$debugA5;
|
|
73051
|
-
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
|
|
73052
|
-
}
|
|
73053
|
-
}),
|
|
73054
|
-
getLeftFooterGroups: memo(() => [table.getLeftHeaderGroups()], headerGroups => {
|
|
73055
|
-
return [...headerGroups].reverse();
|
|
73056
|
-
}, {
|
|
73057
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',
|
|
73058
|
-
debug: () => {
|
|
73059
|
-
var _table$options$debugA6;
|
|
73060
|
-
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
|
|
73061
|
-
}
|
|
73062
|
-
}),
|
|
73063
|
-
getCenterFooterGroups: memo(() => [table.getCenterHeaderGroups()], headerGroups => {
|
|
73064
|
-
return [...headerGroups].reverse();
|
|
73065
|
-
}, {
|
|
73066
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',
|
|
73067
|
-
debug: () => {
|
|
73068
|
-
var _table$options$debugA7;
|
|
73069
|
-
return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
|
|
73070
|
-
}
|
|
73071
|
-
}),
|
|
73072
|
-
getRightFooterGroups: memo(() => [table.getRightHeaderGroups()], headerGroups => {
|
|
73073
|
-
return [...headerGroups].reverse();
|
|
73074
|
-
}, {
|
|
73075
|
-
key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',
|
|
73076
|
-
debug: () => {
|
|
73077
|
-
var _table$options$debugA8;
|
|
73078
|
-
return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
|
|
73079
|
-
}
|
|
73080
|
-
}),
|
|
73081
|
-
// Flat Headers
|
|
73047
|
+
// Footer Groups
|
|
73082
73048
|
|
|
73083
|
-
|
|
73084
|
-
|
|
73085
|
-
|
|
73086
|
-
|
|
73087
|
-
|
|
73088
|
-
|
|
73089
|
-
|
|
73090
|
-
|
|
73091
|
-
|
|
73092
|
-
|
|
73093
|
-
|
|
73094
|
-
|
|
73095
|
-
|
|
73096
|
-
|
|
73097
|
-
|
|
73098
|
-
|
|
73099
|
-
|
|
73100
|
-
|
|
73101
|
-
|
|
73102
|
-
|
|
73103
|
-
|
|
73104
|
-
|
|
73105
|
-
|
|
73106
|
-
|
|
73107
|
-
|
|
73108
|
-
|
|
73109
|
-
|
|
73110
|
-
|
|
73111
|
-
|
|
73112
|
-
|
|
73113
|
-
|
|
73114
|
-
|
|
73115
|
-
|
|
73116
|
-
|
|
73117
|
-
|
|
73118
|
-
|
|
73119
|
-
}).flat();
|
|
73120
|
-
}, {
|
|
73121
|
-
key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',
|
|
73122
|
-
debug: () => {
|
|
73123
|
-
var _table$options$debugA12;
|
|
73124
|
-
return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
|
|
73125
|
-
}
|
|
73126
|
-
}),
|
|
73127
|
-
// Leaf Headers
|
|
73049
|
+
table.getFooterGroups = memo(() => [table.getHeaderGroups()], headerGroups => {
|
|
73050
|
+
return [...headerGroups].reverse();
|
|
73051
|
+
}, {
|
|
73052
|
+
key: process.env.NODE_ENV === 'development' && 'getFooterGroups',
|
|
73053
|
+
debug: () => {
|
|
73054
|
+
var _table$options$debugA5;
|
|
73055
|
+
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
|
|
73056
|
+
}
|
|
73057
|
+
});
|
|
73058
|
+
table.getLeftFooterGroups = memo(() => [table.getLeftHeaderGroups()], headerGroups => {
|
|
73059
|
+
return [...headerGroups].reverse();
|
|
73060
|
+
}, {
|
|
73061
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftFooterGroups',
|
|
73062
|
+
debug: () => {
|
|
73063
|
+
var _table$options$debugA6;
|
|
73064
|
+
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
|
|
73065
|
+
}
|
|
73066
|
+
});
|
|
73067
|
+
table.getCenterFooterGroups = memo(() => [table.getCenterHeaderGroups()], headerGroups => {
|
|
73068
|
+
return [...headerGroups].reverse();
|
|
73069
|
+
}, {
|
|
73070
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterFooterGroups',
|
|
73071
|
+
debug: () => {
|
|
73072
|
+
var _table$options$debugA7;
|
|
73073
|
+
return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
|
|
73074
|
+
}
|
|
73075
|
+
});
|
|
73076
|
+
table.getRightFooterGroups = memo(() => [table.getRightHeaderGroups()], headerGroups => {
|
|
73077
|
+
return [...headerGroups].reverse();
|
|
73078
|
+
}, {
|
|
73079
|
+
key: process.env.NODE_ENV === 'development' && 'getRightFooterGroups',
|
|
73080
|
+
debug: () => {
|
|
73081
|
+
var _table$options$debugA8;
|
|
73082
|
+
return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
|
|
73083
|
+
}
|
|
73084
|
+
});
|
|
73128
73085
|
|
|
73129
|
-
|
|
73130
|
-
|
|
73131
|
-
|
|
73132
|
-
|
|
73133
|
-
|
|
73134
|
-
}
|
|
73135
|
-
|
|
73136
|
-
|
|
73137
|
-
|
|
73138
|
-
|
|
73139
|
-
|
|
73140
|
-
}
|
|
73141
|
-
|
|
73142
|
-
|
|
73143
|
-
|
|
73144
|
-
|
|
73145
|
-
|
|
73146
|
-
|
|
73147
|
-
|
|
73148
|
-
|
|
73149
|
-
|
|
73150
|
-
|
|
73151
|
-
|
|
73152
|
-
|
|
73153
|
-
|
|
73154
|
-
|
|
73155
|
-
|
|
73156
|
-
|
|
73157
|
-
|
|
73158
|
-
|
|
73159
|
-
|
|
73160
|
-
|
|
73161
|
-
|
|
73162
|
-
|
|
73163
|
-
|
|
73164
|
-
|
|
73165
|
-
|
|
73166
|
-
|
|
73167
|
-
|
|
73168
|
-
|
|
73169
|
-
|
|
73170
|
-
|
|
73171
|
-
|
|
73172
|
-
|
|
73173
|
-
|
|
73174
|
-
|
|
73175
|
-
|
|
73176
|
-
|
|
73177
|
-
|
|
73086
|
+
// Flat Headers
|
|
73087
|
+
|
|
73088
|
+
table.getFlatHeaders = memo(() => [table.getHeaderGroups()], headerGroups => {
|
|
73089
|
+
return headerGroups.map(headerGroup => {
|
|
73090
|
+
return headerGroup.headers;
|
|
73091
|
+
}).flat();
|
|
73092
|
+
}, {
|
|
73093
|
+
key: process.env.NODE_ENV === 'development' && 'getFlatHeaders',
|
|
73094
|
+
debug: () => {
|
|
73095
|
+
var _table$options$debugA9;
|
|
73096
|
+
return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
|
|
73097
|
+
}
|
|
73098
|
+
});
|
|
73099
|
+
table.getLeftFlatHeaders = memo(() => [table.getLeftHeaderGroups()], left => {
|
|
73100
|
+
return left.map(headerGroup => {
|
|
73101
|
+
return headerGroup.headers;
|
|
73102
|
+
}).flat();
|
|
73103
|
+
}, {
|
|
73104
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftFlatHeaders',
|
|
73105
|
+
debug: () => {
|
|
73106
|
+
var _table$options$debugA10;
|
|
73107
|
+
return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
|
|
73108
|
+
}
|
|
73109
|
+
});
|
|
73110
|
+
table.getCenterFlatHeaders = memo(() => [table.getCenterHeaderGroups()], left => {
|
|
73111
|
+
return left.map(headerGroup => {
|
|
73112
|
+
return headerGroup.headers;
|
|
73113
|
+
}).flat();
|
|
73114
|
+
}, {
|
|
73115
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterFlatHeaders',
|
|
73116
|
+
debug: () => {
|
|
73117
|
+
var _table$options$debugA11;
|
|
73118
|
+
return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
|
|
73119
|
+
}
|
|
73120
|
+
});
|
|
73121
|
+
table.getRightFlatHeaders = memo(() => [table.getRightHeaderGroups()], left => {
|
|
73122
|
+
return left.map(headerGroup => {
|
|
73123
|
+
return headerGroup.headers;
|
|
73124
|
+
}).flat();
|
|
73125
|
+
}, {
|
|
73126
|
+
key: process.env.NODE_ENV === 'development' && 'getRightFlatHeaders',
|
|
73127
|
+
debug: () => {
|
|
73128
|
+
var _table$options$debugA12;
|
|
73129
|
+
return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
|
|
73130
|
+
}
|
|
73131
|
+
});
|
|
73132
|
+
|
|
73133
|
+
// Leaf Headers
|
|
73134
|
+
|
|
73135
|
+
table.getCenterLeafHeaders = memo(() => [table.getCenterFlatHeaders()], flatHeaders => {
|
|
73136
|
+
return flatHeaders.filter(header => {
|
|
73137
|
+
var _header$subHeaders;
|
|
73138
|
+
return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
|
|
73139
|
+
});
|
|
73140
|
+
}, {
|
|
73141
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterLeafHeaders',
|
|
73142
|
+
debug: () => {
|
|
73143
|
+
var _table$options$debugA13;
|
|
73144
|
+
return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
|
|
73145
|
+
}
|
|
73146
|
+
});
|
|
73147
|
+
table.getLeftLeafHeaders = memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
|
|
73148
|
+
return flatHeaders.filter(header => {
|
|
73149
|
+
var _header$subHeaders2;
|
|
73150
|
+
return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
|
|
73151
|
+
});
|
|
73152
|
+
}, {
|
|
73153
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftLeafHeaders',
|
|
73154
|
+
debug: () => {
|
|
73155
|
+
var _table$options$debugA14;
|
|
73156
|
+
return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
|
|
73157
|
+
}
|
|
73158
|
+
});
|
|
73159
|
+
table.getRightLeafHeaders = memo(() => [table.getRightFlatHeaders()], flatHeaders => {
|
|
73160
|
+
return flatHeaders.filter(header => {
|
|
73161
|
+
var _header$subHeaders3;
|
|
73162
|
+
return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
|
|
73163
|
+
});
|
|
73164
|
+
}, {
|
|
73165
|
+
key: process.env.NODE_ENV === 'development' && 'getRightLeafHeaders',
|
|
73166
|
+
debug: () => {
|
|
73167
|
+
var _table$options$debugA15;
|
|
73168
|
+
return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
|
|
73169
|
+
}
|
|
73170
|
+
});
|
|
73171
|
+
table.getLeafHeaders = memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
|
|
73172
|
+
var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
|
|
73173
|
+
return [...((_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : []), ...((_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : []), ...((_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : [])].map(header => {
|
|
73174
|
+
return header.getLeafHeaders();
|
|
73175
|
+
}).flat();
|
|
73176
|
+
}, {
|
|
73177
|
+
key: process.env.NODE_ENV === 'development' && 'getLeafHeaders',
|
|
73178
|
+
debug: () => {
|
|
73179
|
+
var _table$options$debugA16;
|
|
73180
|
+
return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
|
|
73181
|
+
}
|
|
73182
|
+
});
|
|
73178
73183
|
}
|
|
73179
73184
|
};
|
|
73180
73185
|
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
|
|
@@ -73334,204 +73339,198 @@ const ColumnSizing = {
|
|
|
73334
73339
|
};
|
|
73335
73340
|
},
|
|
73336
73341
|
createColumn: (column, table) => {
|
|
73337
|
-
|
|
73338
|
-
|
|
73339
|
-
|
|
73340
|
-
|
|
73341
|
-
|
|
73342
|
-
|
|
73343
|
-
|
|
73344
|
-
|
|
73345
|
-
|
|
73346
|
-
|
|
73347
|
-
|
|
73348
|
-
return prevSiblingColumn.getStart(position) + prevSiblingColumn.getSize();
|
|
73349
|
-
}
|
|
73350
|
-
return 0;
|
|
73351
|
-
},
|
|
73352
|
-
resetSize: () => {
|
|
73353
|
-
table.setColumnSizing(_ref2 => {
|
|
73354
|
-
let {
|
|
73355
|
-
[column.id]: _,
|
|
73356
|
-
...rest
|
|
73357
|
-
} = _ref2;
|
|
73358
|
-
return rest;
|
|
73359
|
-
});
|
|
73360
|
-
},
|
|
73361
|
-
getCanResize: () => {
|
|
73362
|
-
var _column$columnDef$ena, _table$options$enable;
|
|
73363
|
-
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
|
|
73364
|
-
},
|
|
73365
|
-
getIsResizing: () => {
|
|
73366
|
-
return table.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
73342
|
+
column.getSize = () => {
|
|
73343
|
+
var _column$columnDef$min, _ref, _column$columnDef$max;
|
|
73344
|
+
const columnSize = table.getState().columnSizing[column.id];
|
|
73345
|
+
return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
|
|
73346
|
+
};
|
|
73347
|
+
column.getStart = position => {
|
|
73348
|
+
const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
|
|
73349
|
+
const index = columns.findIndex(d => d.id === column.id);
|
|
73350
|
+
if (index > 0) {
|
|
73351
|
+
const prevSiblingColumn = columns[index - 1];
|
|
73352
|
+
return prevSiblingColumn.getStart(position) + prevSiblingColumn.getSize();
|
|
73367
73353
|
}
|
|
73354
|
+
return 0;
|
|
73355
|
+
};
|
|
73356
|
+
column.resetSize = () => {
|
|
73357
|
+
table.setColumnSizing(_ref2 => {
|
|
73358
|
+
let {
|
|
73359
|
+
[column.id]: _,
|
|
73360
|
+
...rest
|
|
73361
|
+
} = _ref2;
|
|
73362
|
+
return rest;
|
|
73363
|
+
});
|
|
73364
|
+
};
|
|
73365
|
+
column.getCanResize = () => {
|
|
73366
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
73367
|
+
return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
|
|
73368
|
+
};
|
|
73369
|
+
column.getIsResizing = () => {
|
|
73370
|
+
return table.getState().columnSizingInfo.isResizingColumn === column.id;
|
|
73368
73371
|
};
|
|
73369
73372
|
},
|
|
73370
73373
|
createHeader: (header, table) => {
|
|
73371
|
-
|
|
73372
|
-
|
|
73373
|
-
|
|
73374
|
-
|
|
73375
|
-
|
|
73376
|
-
|
|
73377
|
-
|
|
73378
|
-
|
|
73379
|
-
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
73380
|
-
}
|
|
73381
|
-
};
|
|
73382
|
-
recurse(header);
|
|
73383
|
-
return sum;
|
|
73384
|
-
},
|
|
73385
|
-
getStart: () => {
|
|
73386
|
-
if (header.index > 0) {
|
|
73387
|
-
const prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
73388
|
-
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
73374
|
+
header.getSize = () => {
|
|
73375
|
+
let sum = 0;
|
|
73376
|
+
const recurse = header => {
|
|
73377
|
+
if (header.subHeaders.length) {
|
|
73378
|
+
header.subHeaders.forEach(recurse);
|
|
73379
|
+
} else {
|
|
73380
|
+
var _header$column$getSiz;
|
|
73381
|
+
sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
|
|
73389
73382
|
}
|
|
73390
|
-
|
|
73391
|
-
|
|
73392
|
-
|
|
73393
|
-
|
|
73394
|
-
|
|
73395
|
-
|
|
73396
|
-
|
|
73383
|
+
};
|
|
73384
|
+
recurse(header);
|
|
73385
|
+
return sum;
|
|
73386
|
+
};
|
|
73387
|
+
header.getStart = () => {
|
|
73388
|
+
if (header.index > 0) {
|
|
73389
|
+
const prevSiblingHeader = header.headerGroup.headers[header.index - 1];
|
|
73390
|
+
return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
|
|
73391
|
+
}
|
|
73392
|
+
return 0;
|
|
73393
|
+
};
|
|
73394
|
+
header.getResizeHandler = () => {
|
|
73395
|
+
const column = table.getColumn(header.column.id);
|
|
73396
|
+
const canResize = column == null ? void 0 : column.getCanResize();
|
|
73397
|
+
return e => {
|
|
73398
|
+
if (!column || !canResize) {
|
|
73399
|
+
return;
|
|
73400
|
+
}
|
|
73401
|
+
e.persist == null || e.persist();
|
|
73402
|
+
if (isTouchStartEvent(e)) {
|
|
73403
|
+
// lets not respond to multiple touches (e.g. 2 or 3 fingers)
|
|
73404
|
+
if (e.touches && e.touches.length > 1) {
|
|
73397
73405
|
return;
|
|
73398
73406
|
}
|
|
73399
|
-
|
|
73400
|
-
|
|
73401
|
-
|
|
73402
|
-
|
|
73403
|
-
|
|
73404
|
-
|
|
73407
|
+
}
|
|
73408
|
+
const startSize = header.getSize();
|
|
73409
|
+
const columnSizingStart = header ? header.getLeafHeaders().map(d => [d.column.id, d.column.getSize()]) : [[column.id, column.getSize()]];
|
|
73410
|
+
const clientX = isTouchStartEvent(e) ? Math.round(e.touches[0].clientX) : e.clientX;
|
|
73411
|
+
const newColumnSizing = {};
|
|
73412
|
+
const updateOffset = (eventType, clientXPos) => {
|
|
73413
|
+
if (typeof clientXPos !== 'number') {
|
|
73414
|
+
return;
|
|
73405
73415
|
}
|
|
73406
|
-
|
|
73407
|
-
|
|
73408
|
-
|
|
73409
|
-
|
|
73410
|
-
|
|
73411
|
-
|
|
73412
|
-
|
|
73413
|
-
}
|
|
73414
|
-
table.setColumnSizingInfo(old => {
|
|
73415
|
-
var _old$startOffset, _old$startSize;
|
|
73416
|
-
const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
|
|
73417
|
-
const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
73418
|
-
old.columnSizingStart.forEach(_ref3 => {
|
|
73419
|
-
let [columnId, headerSize] = _ref3;
|
|
73420
|
-
newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
|
|
73421
|
-
});
|
|
73422
|
-
return {
|
|
73423
|
-
...old,
|
|
73424
|
-
deltaOffset,
|
|
73425
|
-
deltaPercentage
|
|
73426
|
-
};
|
|
73416
|
+
table.setColumnSizingInfo(old => {
|
|
73417
|
+
var _old$startOffset, _old$startSize;
|
|
73418
|
+
const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
|
|
73419
|
+
const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
73420
|
+
old.columnSizingStart.forEach(_ref3 => {
|
|
73421
|
+
let [columnId, headerSize] = _ref3;
|
|
73422
|
+
newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
|
|
73427
73423
|
});
|
|
73428
|
-
|
|
73429
|
-
table.setColumnSizing(old => ({
|
|
73430
|
-
...old,
|
|
73431
|
-
...newColumnSizing
|
|
73432
|
-
}));
|
|
73433
|
-
}
|
|
73434
|
-
};
|
|
73435
|
-
const onMove = clientXPos => updateOffset('move', clientXPos);
|
|
73436
|
-
const onEnd = clientXPos => {
|
|
73437
|
-
updateOffset('end', clientXPos);
|
|
73438
|
-
table.setColumnSizingInfo(old => ({
|
|
73424
|
+
return {
|
|
73439
73425
|
...old,
|
|
73440
|
-
|
|
73441
|
-
|
|
73442
|
-
|
|
73443
|
-
|
|
73444
|
-
|
|
73445
|
-
|
|
73426
|
+
deltaOffset,
|
|
73427
|
+
deltaPercentage
|
|
73428
|
+
};
|
|
73429
|
+
});
|
|
73430
|
+
if (table.options.columnResizeMode === 'onChange' || eventType === 'end') {
|
|
73431
|
+
table.setColumnSizing(old => ({
|
|
73432
|
+
...old,
|
|
73433
|
+
...newColumnSizing
|
|
73446
73434
|
}));
|
|
73447
|
-
};
|
|
73448
|
-
const mouseEvents = {
|
|
73449
|
-
moveHandler: e => onMove(e.clientX),
|
|
73450
|
-
upHandler: e => {
|
|
73451
|
-
document.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
73452
|
-
document.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
73453
|
-
onEnd(e.clientX);
|
|
73454
|
-
}
|
|
73455
|
-
};
|
|
73456
|
-
const touchEvents = {
|
|
73457
|
-
moveHandler: e => {
|
|
73458
|
-
if (e.cancelable) {
|
|
73459
|
-
e.preventDefault();
|
|
73460
|
-
e.stopPropagation();
|
|
73461
|
-
}
|
|
73462
|
-
onMove(e.touches[0].clientX);
|
|
73463
|
-
return false;
|
|
73464
|
-
},
|
|
73465
|
-
upHandler: e => {
|
|
73466
|
-
var _e$touches$;
|
|
73467
|
-
document.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
73468
|
-
document.removeEventListener('touchend', touchEvents.upHandler);
|
|
73469
|
-
if (e.cancelable) {
|
|
73470
|
-
e.preventDefault();
|
|
73471
|
-
e.stopPropagation();
|
|
73472
|
-
}
|
|
73473
|
-
onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);
|
|
73474
|
-
}
|
|
73475
|
-
};
|
|
73476
|
-
const passiveIfSupported = passiveEventSupported() ? {
|
|
73477
|
-
passive: false
|
|
73478
|
-
} : false;
|
|
73479
|
-
if (isTouchStartEvent(e)) {
|
|
73480
|
-
document.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
73481
|
-
document.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
73482
|
-
} else {
|
|
73483
|
-
document.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
73484
|
-
document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
73485
73435
|
}
|
|
73436
|
+
};
|
|
73437
|
+
const onMove = clientXPos => updateOffset('move', clientXPos);
|
|
73438
|
+
const onEnd = clientXPos => {
|
|
73439
|
+
updateOffset('end', clientXPos);
|
|
73486
73440
|
table.setColumnSizingInfo(old => ({
|
|
73487
73441
|
...old,
|
|
73488
|
-
|
|
73489
|
-
|
|
73490
|
-
|
|
73491
|
-
|
|
73492
|
-
|
|
73493
|
-
|
|
73442
|
+
isResizingColumn: false,
|
|
73443
|
+
startOffset: null,
|
|
73444
|
+
startSize: null,
|
|
73445
|
+
deltaOffset: null,
|
|
73446
|
+
deltaPercentage: null,
|
|
73447
|
+
columnSizingStart: []
|
|
73494
73448
|
}));
|
|
73495
73449
|
};
|
|
73496
|
-
|
|
73450
|
+
const mouseEvents = {
|
|
73451
|
+
moveHandler: e => onMove(e.clientX),
|
|
73452
|
+
upHandler: e => {
|
|
73453
|
+
document.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
73454
|
+
document.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
73455
|
+
onEnd(e.clientX);
|
|
73456
|
+
}
|
|
73457
|
+
};
|
|
73458
|
+
const touchEvents = {
|
|
73459
|
+
moveHandler: e => {
|
|
73460
|
+
if (e.cancelable) {
|
|
73461
|
+
e.preventDefault();
|
|
73462
|
+
e.stopPropagation();
|
|
73463
|
+
}
|
|
73464
|
+
onMove(e.touches[0].clientX);
|
|
73465
|
+
return false;
|
|
73466
|
+
},
|
|
73467
|
+
upHandler: e => {
|
|
73468
|
+
var _e$touches$;
|
|
73469
|
+
document.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
73470
|
+
document.removeEventListener('touchend', touchEvents.upHandler);
|
|
73471
|
+
if (e.cancelable) {
|
|
73472
|
+
e.preventDefault();
|
|
73473
|
+
e.stopPropagation();
|
|
73474
|
+
}
|
|
73475
|
+
onEnd((_e$touches$ = e.touches[0]) == null ? void 0 : _e$touches$.clientX);
|
|
73476
|
+
}
|
|
73477
|
+
};
|
|
73478
|
+
const passiveIfSupported = passiveEventSupported() ? {
|
|
73479
|
+
passive: false
|
|
73480
|
+
} : false;
|
|
73481
|
+
if (isTouchStartEvent(e)) {
|
|
73482
|
+
document.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
73483
|
+
document.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
73484
|
+
} else {
|
|
73485
|
+
document.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
73486
|
+
document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
73487
|
+
}
|
|
73488
|
+
table.setColumnSizingInfo(old => ({
|
|
73489
|
+
...old,
|
|
73490
|
+
startOffset: clientX,
|
|
73491
|
+
startSize,
|
|
73492
|
+
deltaOffset: 0,
|
|
73493
|
+
deltaPercentage: 0,
|
|
73494
|
+
columnSizingStart,
|
|
73495
|
+
isResizingColumn: column.id
|
|
73496
|
+
}));
|
|
73497
|
+
};
|
|
73497
73498
|
};
|
|
73498
73499
|
},
|
|
73499
73500
|
createTable: table => {
|
|
73500
|
-
|
|
73501
|
-
|
|
73502
|
-
|
|
73503
|
-
|
|
73504
|
-
|
|
73505
|
-
|
|
73506
|
-
|
|
73507
|
-
|
|
73508
|
-
|
|
73509
|
-
|
|
73510
|
-
|
|
73511
|
-
|
|
73512
|
-
|
|
73513
|
-
return
|
|
73514
|
-
|
|
73515
|
-
|
|
73516
|
-
|
|
73517
|
-
|
|
73518
|
-
|
|
73519
|
-
return
|
|
73520
|
-
|
|
73521
|
-
|
|
73522
|
-
|
|
73523
|
-
|
|
73524
|
-
|
|
73525
|
-
return
|
|
73526
|
-
|
|
73527
|
-
|
|
73528
|
-
|
|
73529
|
-
|
|
73530
|
-
|
|
73531
|
-
return
|
|
73532
|
-
|
|
73533
|
-
}, 0)) != null ? _table$getRightHeader : 0;
|
|
73534
|
-
}
|
|
73501
|
+
table.setColumnSizing = updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater);
|
|
73502
|
+
table.setColumnSizingInfo = updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater);
|
|
73503
|
+
table.resetColumnSizing = defaultState => {
|
|
73504
|
+
var _table$initialState$c;
|
|
73505
|
+
table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
|
|
73506
|
+
};
|
|
73507
|
+
table.resetHeaderSizeInfo = defaultState => {
|
|
73508
|
+
var _table$initialState$c2;
|
|
73509
|
+
table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
|
|
73510
|
+
};
|
|
73511
|
+
table.getTotalSize = () => {
|
|
73512
|
+
var _table$getHeaderGroup, _table$getHeaderGroup2;
|
|
73513
|
+
return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
|
|
73514
|
+
return sum + header.getSize();
|
|
73515
|
+
}, 0)) != null ? _table$getHeaderGroup : 0;
|
|
73516
|
+
};
|
|
73517
|
+
table.getLeftTotalSize = () => {
|
|
73518
|
+
var _table$getLeftHeaderG, _table$getLeftHeaderG2;
|
|
73519
|
+
return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
|
|
73520
|
+
return sum + header.getSize();
|
|
73521
|
+
}, 0)) != null ? _table$getLeftHeaderG : 0;
|
|
73522
|
+
};
|
|
73523
|
+
table.getCenterTotalSize = () => {
|
|
73524
|
+
var _table$getCenterHeade, _table$getCenterHeade2;
|
|
73525
|
+
return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
|
|
73526
|
+
return sum + header.getSize();
|
|
73527
|
+
}, 0)) != null ? _table$getCenterHeade : 0;
|
|
73528
|
+
};
|
|
73529
|
+
table.getRightTotalSize = () => {
|
|
73530
|
+
var _table$getRightHeader, _table$getRightHeader2;
|
|
73531
|
+
return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
|
|
73532
|
+
return sum + header.getSize();
|
|
73533
|
+
}, 0)) != null ? _table$getRightHeader : 0;
|
|
73535
73534
|
};
|
|
73536
73535
|
}
|
|
73537
73536
|
};
|
|
@@ -73577,154 +73576,159 @@ const Expanding = {
|
|
|
73577
73576
|
createTable: table => {
|
|
73578
73577
|
let registered = false;
|
|
73579
73578
|
let queued = false;
|
|
73580
|
-
|
|
73581
|
-
|
|
73582
|
-
|
|
73583
|
-
|
|
73584
|
-
|
|
73585
|
-
|
|
73586
|
-
|
|
73587
|
-
|
|
73588
|
-
|
|
73589
|
-
if (
|
|
73590
|
-
|
|
73591
|
-
|
|
73592
|
-
table.
|
|
73593
|
-
|
|
73594
|
-
|
|
73595
|
-
|
|
73596
|
-
|
|
73597
|
-
|
|
73598
|
-
|
|
73599
|
-
|
|
73600
|
-
|
|
73601
|
-
|
|
73602
|
-
}
|
|
73603
|
-
|
|
73604
|
-
|
|
73605
|
-
|
|
73606
|
-
|
|
73607
|
-
|
|
73608
|
-
|
|
73609
|
-
|
|
73610
|
-
|
|
73611
|
-
|
|
73612
|
-
|
|
73613
|
-
|
|
73614
|
-
|
|
73615
|
-
|
|
73616
|
-
|
|
73617
|
-
|
|
73618
|
-
|
|
73619
|
-
|
|
73620
|
-
|
|
73621
|
-
|
|
73622
|
-
|
|
73623
|
-
|
|
73624
|
-
const expanded = table.getState().expanded;
|
|
73579
|
+
table._autoResetExpanded = () => {
|
|
73580
|
+
var _ref, _table$options$autoRe;
|
|
73581
|
+
if (!registered) {
|
|
73582
|
+
table._queue(() => {
|
|
73583
|
+
registered = true;
|
|
73584
|
+
});
|
|
73585
|
+
return;
|
|
73586
|
+
}
|
|
73587
|
+
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
|
|
73588
|
+
if (queued) return;
|
|
73589
|
+
queued = true;
|
|
73590
|
+
table._queue(() => {
|
|
73591
|
+
table.resetExpanded();
|
|
73592
|
+
queued = false;
|
|
73593
|
+
});
|
|
73594
|
+
}
|
|
73595
|
+
};
|
|
73596
|
+
table.setExpanded = updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater);
|
|
73597
|
+
table.toggleAllRowsExpanded = expanded => {
|
|
73598
|
+
if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
|
|
73599
|
+
table.setExpanded(true);
|
|
73600
|
+
} else {
|
|
73601
|
+
table.setExpanded({});
|
|
73602
|
+
}
|
|
73603
|
+
};
|
|
73604
|
+
table.resetExpanded = defaultState => {
|
|
73605
|
+
var _table$initialState$e, _table$initialState;
|
|
73606
|
+
table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
|
|
73607
|
+
};
|
|
73608
|
+
table.getCanSomeRowsExpand = () => {
|
|
73609
|
+
return table.getPrePaginationRowModel().flatRows.some(row => row.getCanExpand());
|
|
73610
|
+
};
|
|
73611
|
+
table.getToggleAllRowsExpandedHandler = () => {
|
|
73612
|
+
return e => {
|
|
73613
|
+
e.persist == null || e.persist();
|
|
73614
|
+
table.toggleAllRowsExpanded();
|
|
73615
|
+
};
|
|
73616
|
+
};
|
|
73617
|
+
table.getIsSomeRowsExpanded = () => {
|
|
73618
|
+
const expanded = table.getState().expanded;
|
|
73619
|
+
return expanded === true || Object.values(expanded).some(Boolean);
|
|
73620
|
+
};
|
|
73621
|
+
table.getIsAllRowsExpanded = () => {
|
|
73622
|
+
const expanded = table.getState().expanded;
|
|
73625
73623
|
|
|
73626
|
-
|
|
73627
|
-
|
|
73628
|
-
|
|
73629
|
-
|
|
73630
|
-
|
|
73631
|
-
|
|
73632
|
-
|
|
73624
|
+
// If expanded is true, save some cycles and return true
|
|
73625
|
+
if (typeof expanded === 'boolean') {
|
|
73626
|
+
return expanded === true;
|
|
73627
|
+
}
|
|
73628
|
+
if (!Object.keys(expanded).length) {
|
|
73629
|
+
return false;
|
|
73630
|
+
}
|
|
73633
73631
|
|
|
73634
|
-
|
|
73635
|
-
|
|
73636
|
-
|
|
73637
|
-
|
|
73632
|
+
// If any row is not expanded, return false
|
|
73633
|
+
if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) {
|
|
73634
|
+
return false;
|
|
73635
|
+
}
|
|
73638
73636
|
|
|
73639
|
-
|
|
73640
|
-
|
|
73641
|
-
|
|
73642
|
-
|
|
73643
|
-
|
|
73644
|
-
|
|
73645
|
-
|
|
73646
|
-
|
|
73647
|
-
|
|
73648
|
-
|
|
73649
|
-
|
|
73650
|
-
|
|
73651
|
-
|
|
73652
|
-
|
|
73653
|
-
|
|
73654
|
-
|
|
73655
|
-
|
|
73656
|
-
|
|
73657
|
-
|
|
73658
|
-
}
|
|
73659
|
-
return table._getExpandedRowModel();
|
|
73637
|
+
// They must all be expanded :shrug:
|
|
73638
|
+
return true;
|
|
73639
|
+
};
|
|
73640
|
+
table.getExpandedDepth = () => {
|
|
73641
|
+
let maxDepth = 0;
|
|
73642
|
+
const rowIds = table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded);
|
|
73643
|
+
rowIds.forEach(id => {
|
|
73644
|
+
const splitId = id.split('.');
|
|
73645
|
+
maxDepth = Math.max(maxDepth, splitId.length);
|
|
73646
|
+
});
|
|
73647
|
+
return maxDepth;
|
|
73648
|
+
};
|
|
73649
|
+
table.getPreExpandedRowModel = () => table.getSortedRowModel();
|
|
73650
|
+
table.getExpandedRowModel = () => {
|
|
73651
|
+
if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {
|
|
73652
|
+
table._getExpandedRowModel = table.options.getExpandedRowModel(table);
|
|
73653
|
+
}
|
|
73654
|
+
if (table.options.manualExpanding || !table._getExpandedRowModel) {
|
|
73655
|
+
return table.getPreExpandedRowModel();
|
|
73660
73656
|
}
|
|
73657
|
+
return table._getExpandedRowModel();
|
|
73661
73658
|
};
|
|
73662
73659
|
},
|
|
73663
73660
|
createRow: (row, table) => {
|
|
73664
|
-
|
|
73665
|
-
|
|
73666
|
-
|
|
73667
|
-
|
|
73668
|
-
|
|
73669
|
-
|
|
73670
|
-
|
|
73671
|
-
|
|
73672
|
-
|
|
73673
|
-
|
|
73674
|
-
|
|
73675
|
-
|
|
73676
|
-
|
|
73677
|
-
|
|
73678
|
-
|
|
73679
|
-
|
|
73680
|
-
|
|
73681
|
-
|
|
73682
|
-
|
|
73683
|
-
|
|
73684
|
-
|
|
73685
|
-
|
|
73686
|
-
|
|
73687
|
-
|
|
73688
|
-
|
|
73689
|
-
|
|
73690
|
-
|
|
73691
|
-
|
|
73692
|
-
|
|
73693
|
-
|
|
73694
|
-
|
|
73695
|
-
|
|
73696
|
-
|
|
73697
|
-
|
|
73698
|
-
|
|
73699
|
-
|
|
73700
|
-
|
|
73701
|
-
|
|
73702
|
-
|
|
73703
|
-
|
|
73704
|
-
|
|
73705
|
-
|
|
73706
|
-
|
|
73707
|
-
|
|
73708
|
-
};
|
|
73661
|
+
row.toggleExpanded = expanded => {
|
|
73662
|
+
table.setExpanded(old => {
|
|
73663
|
+
var _expanded;
|
|
73664
|
+
const exists = old === true ? true : !!(old != null && old[row.id]);
|
|
73665
|
+
let oldExpanded = {};
|
|
73666
|
+
if (old === true) {
|
|
73667
|
+
Object.keys(table.getRowModel().rowsById).forEach(rowId => {
|
|
73668
|
+
oldExpanded[rowId] = true;
|
|
73669
|
+
});
|
|
73670
|
+
} else {
|
|
73671
|
+
oldExpanded = old;
|
|
73672
|
+
}
|
|
73673
|
+
expanded = (_expanded = expanded) != null ? _expanded : !exists;
|
|
73674
|
+
if (!exists && expanded) {
|
|
73675
|
+
return {
|
|
73676
|
+
...oldExpanded,
|
|
73677
|
+
[row.id]: true
|
|
73678
|
+
};
|
|
73679
|
+
}
|
|
73680
|
+
if (exists && !expanded) {
|
|
73681
|
+
const {
|
|
73682
|
+
[row.id]: _,
|
|
73683
|
+
...rest
|
|
73684
|
+
} = oldExpanded;
|
|
73685
|
+
return rest;
|
|
73686
|
+
}
|
|
73687
|
+
return old;
|
|
73688
|
+
});
|
|
73689
|
+
};
|
|
73690
|
+
row.getIsExpanded = () => {
|
|
73691
|
+
var _table$options$getIsR;
|
|
73692
|
+
const expanded = table.getState().expanded;
|
|
73693
|
+
return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
|
|
73694
|
+
};
|
|
73695
|
+
row.getCanExpand = () => {
|
|
73696
|
+
var _table$options$getRow, _table$options$enable, _row$subRows;
|
|
73697
|
+
return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
73698
|
+
};
|
|
73699
|
+
row.getIsAllParentsExpanded = () => {
|
|
73700
|
+
let isFullyExpanded = true;
|
|
73701
|
+
let currentRow = row;
|
|
73702
|
+
while (isFullyExpanded && currentRow.parentId) {
|
|
73703
|
+
currentRow = table.getRow(currentRow.parentId, true);
|
|
73704
|
+
isFullyExpanded = currentRow.getIsExpanded();
|
|
73709
73705
|
}
|
|
73706
|
+
return isFullyExpanded;
|
|
73707
|
+
};
|
|
73708
|
+
row.getToggleExpandedHandler = () => {
|
|
73709
|
+
const canExpand = row.getCanExpand();
|
|
73710
|
+
return () => {
|
|
73711
|
+
if (!canExpand) return;
|
|
73712
|
+
row.toggleExpanded();
|
|
73713
|
+
};
|
|
73710
73714
|
};
|
|
73711
73715
|
}
|
|
73712
73716
|
};
|
|
73713
73717
|
|
|
73714
73718
|
const includesString = (row, columnId, filterValue) => {
|
|
73715
|
-
var _row$getValue
|
|
73719
|
+
var _row$getValue;
|
|
73716
73720
|
const search = filterValue.toLowerCase();
|
|
73717
|
-
return Boolean((_row$getValue = row.getValue(columnId)) == null
|
|
73721
|
+
return Boolean((_row$getValue = row.getValue(columnId)) == null || (_row$getValue = _row$getValue.toString()) == null || (_row$getValue = _row$getValue.toLowerCase()) == null ? void 0 : _row$getValue.includes(search));
|
|
73718
73722
|
};
|
|
73719
73723
|
includesString.autoRemove = val => testFalsey(val);
|
|
73720
73724
|
const includesStringSensitive = (row, columnId, filterValue) => {
|
|
73721
|
-
var _row$getValue2
|
|
73722
|
-
return Boolean((_row$getValue2 = row.getValue(columnId)) == null
|
|
73725
|
+
var _row$getValue2;
|
|
73726
|
+
return Boolean((_row$getValue2 = row.getValue(columnId)) == null || (_row$getValue2 = _row$getValue2.toString()) == null ? void 0 : _row$getValue2.includes(filterValue));
|
|
73723
73727
|
};
|
|
73724
73728
|
includesStringSensitive.autoRemove = val => testFalsey(val);
|
|
73725
73729
|
const equalsString = (row, columnId, filterValue) => {
|
|
73726
|
-
var _row$getValue3
|
|
73727
|
-
return ((_row$getValue3 = row.getValue(columnId)) == null
|
|
73730
|
+
var _row$getValue3;
|
|
73731
|
+
return ((_row$getValue3 = row.getValue(columnId)) == null || (_row$getValue3 = _row$getValue3.toString()) == null ? void 0 : _row$getValue3.toLowerCase()) === (filterValue == null ? void 0 : filterValue.toLowerCase());
|
|
73728
73732
|
};
|
|
73729
73733
|
equalsString.autoRemove = val => testFalsey(val);
|
|
73730
73734
|
const arrIncludes = (row, columnId, filterValue) => {
|
|
@@ -73818,191 +73822,183 @@ const Filters = {
|
|
|
73818
73822
|
maxLeafRowFilterDepth: 100,
|
|
73819
73823
|
globalFilterFn: 'auto',
|
|
73820
73824
|
getColumnCanGlobalFilter: column => {
|
|
73821
|
-
var _table$getCoreRowMode
|
|
73822
|
-
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null
|
|
73825
|
+
var _table$getCoreRowMode;
|
|
73826
|
+
const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null || (_table$getCoreRowMode = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode.getValue();
|
|
73823
73827
|
return typeof value === 'string' || typeof value === 'number';
|
|
73824
73828
|
}
|
|
73825
73829
|
};
|
|
73826
73830
|
},
|
|
73827
73831
|
createColumn: (column, table) => {
|
|
73828
|
-
|
|
73829
|
-
|
|
73830
|
-
|
|
73831
|
-
|
|
73832
|
-
|
|
73833
|
-
|
|
73834
|
-
|
|
73835
|
-
|
|
73836
|
-
|
|
73837
|
-
|
|
73838
|
-
|
|
73839
|
-
|
|
73840
|
-
|
|
73841
|
-
|
|
73842
|
-
|
|
73843
|
-
|
|
73844
|
-
|
|
73845
|
-
|
|
73846
|
-
|
|
73847
|
-
|
|
73848
|
-
|
|
73849
|
-
|
|
73850
|
-
|
|
73851
|
-
|
|
73852
|
-
|
|
73853
|
-
|
|
73854
|
-
|
|
73855
|
-
|
|
73856
|
-
|
|
73857
|
-
|
|
73858
|
-
|
|
73859
|
-
|
|
73860
|
-
|
|
73861
|
-
|
|
73862
|
-
|
|
73863
|
-
|
|
73864
|
-
|
|
73865
|
-
|
|
73866
|
-
|
|
73867
|
-
|
|
73868
|
-
|
|
73869
|
-
|
|
73870
|
-
|
|
73871
|
-
|
|
73872
|
-
|
|
73873
|
-
|
|
73874
|
-
|
|
73875
|
-
|
|
73876
|
-
|
|
73877
|
-
|
|
73878
|
-
|
|
73879
|
-
|
|
73880
|
-
var _old$filter;
|
|
73881
|
-
return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
|
|
73882
|
-
}
|
|
73883
|
-
const newFilterObj = {
|
|
73884
|
-
id: column.id,
|
|
73885
|
-
value: newFilter
|
|
73886
|
-
};
|
|
73887
|
-
if (previousfilter) {
|
|
73888
|
-
var _old$map;
|
|
73889
|
-
return (_old$map = old == null ? void 0 : old.map(d => {
|
|
73890
|
-
if (d.id === column.id) {
|
|
73891
|
-
return newFilterObj;
|
|
73892
|
-
}
|
|
73893
|
-
return d;
|
|
73894
|
-
})) != null ? _old$map : [];
|
|
73895
|
-
}
|
|
73896
|
-
if (old != null && old.length) {
|
|
73897
|
-
return [...old, newFilterObj];
|
|
73898
|
-
}
|
|
73899
|
-
return [newFilterObj];
|
|
73900
|
-
});
|
|
73901
|
-
},
|
|
73902
|
-
_getFacetedRowModel: table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id),
|
|
73903
|
-
getFacetedRowModel: () => {
|
|
73904
|
-
if (!column._getFacetedRowModel) {
|
|
73905
|
-
return table.getPreFilteredRowModel();
|
|
73832
|
+
column.getAutoFilterFn = () => {
|
|
73833
|
+
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
73834
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
73835
|
+
if (typeof value === 'string') {
|
|
73836
|
+
return filterFns.includesString;
|
|
73837
|
+
}
|
|
73838
|
+
if (typeof value === 'number') {
|
|
73839
|
+
return filterFns.inNumberRange;
|
|
73840
|
+
}
|
|
73841
|
+
if (typeof value === 'boolean') {
|
|
73842
|
+
return filterFns.equals;
|
|
73843
|
+
}
|
|
73844
|
+
if (value !== null && typeof value === 'object') {
|
|
73845
|
+
return filterFns.equals;
|
|
73846
|
+
}
|
|
73847
|
+
if (Array.isArray(value)) {
|
|
73848
|
+
return filterFns.arrIncludes;
|
|
73849
|
+
}
|
|
73850
|
+
return filterFns.weakEquals;
|
|
73851
|
+
};
|
|
73852
|
+
column.getFilterFn = () => {
|
|
73853
|
+
var _table$options$filter, _table$options$filter2;
|
|
73854
|
+
return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : // @ts-ignore
|
|
73855
|
+
(_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
|
|
73856
|
+
};
|
|
73857
|
+
column.getCanFilter = () => {
|
|
73858
|
+
var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
|
|
73859
|
+
return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column.accessorFn;
|
|
73860
|
+
};
|
|
73861
|
+
column.getCanGlobalFilter = () => {
|
|
73862
|
+
var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
|
|
73863
|
+
return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_table$options$enable3 = table.options.enableGlobalFilter) != null ? _table$options$enable3 : true) && ((_table$options$enable4 = table.options.enableFilters) != null ? _table$options$enable4 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
|
|
73864
|
+
};
|
|
73865
|
+
column.getIsFiltered = () => column.getFilterIndex() > -1;
|
|
73866
|
+
column.getFilterValue = () => {
|
|
73867
|
+
var _table$getState$colum;
|
|
73868
|
+
return (_table$getState$colum = table.getState().columnFilters) == null || (_table$getState$colum = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum.value;
|
|
73869
|
+
};
|
|
73870
|
+
column.getFilterIndex = () => {
|
|
73871
|
+
var _table$getState$colum2, _table$getState$colum3;
|
|
73872
|
+
return (_table$getState$colum2 = (_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) != null ? _table$getState$colum2 : -1;
|
|
73873
|
+
};
|
|
73874
|
+
column.setFilterValue = value => {
|
|
73875
|
+
table.setColumnFilters(old => {
|
|
73876
|
+
const filterFn = column.getFilterFn();
|
|
73877
|
+
const previousfilter = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
73878
|
+
const newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined);
|
|
73879
|
+
|
|
73880
|
+
//
|
|
73881
|
+
if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
|
|
73882
|
+
var _old$filter;
|
|
73883
|
+
return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
|
|
73906
73884
|
}
|
|
73907
|
-
|
|
73908
|
-
|
|
73909
|
-
|
|
73910
|
-
|
|
73911
|
-
if (
|
|
73912
|
-
|
|
73885
|
+
const newFilterObj = {
|
|
73886
|
+
id: column.id,
|
|
73887
|
+
value: newFilter
|
|
73888
|
+
};
|
|
73889
|
+
if (previousfilter) {
|
|
73890
|
+
var _old$map;
|
|
73891
|
+
return (_old$map = old == null ? void 0 : old.map(d => {
|
|
73892
|
+
if (d.id === column.id) {
|
|
73893
|
+
return newFilterObj;
|
|
73894
|
+
}
|
|
73895
|
+
return d;
|
|
73896
|
+
})) != null ? _old$map : [];
|
|
73913
73897
|
}
|
|
73914
|
-
|
|
73915
|
-
|
|
73916
|
-
_getFacetedMinMaxValues: table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id),
|
|
73917
|
-
getFacetedMinMaxValues: () => {
|
|
73918
|
-
if (!column._getFacetedMinMaxValues) {
|
|
73919
|
-
return undefined;
|
|
73898
|
+
if (old != null && old.length) {
|
|
73899
|
+
return [...old, newFilterObj];
|
|
73920
73900
|
}
|
|
73921
|
-
return
|
|
73901
|
+
return [newFilterObj];
|
|
73902
|
+
});
|
|
73903
|
+
};
|
|
73904
|
+
column._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id);
|
|
73905
|
+
column.getFacetedRowModel = () => {
|
|
73906
|
+
if (!column._getFacetedRowModel) {
|
|
73907
|
+
return table.getPreFilteredRowModel();
|
|
73908
|
+
}
|
|
73909
|
+
return column._getFacetedRowModel();
|
|
73910
|
+
};
|
|
73911
|
+
column._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id);
|
|
73912
|
+
column.getFacetedUniqueValues = () => {
|
|
73913
|
+
if (!column._getFacetedUniqueValues) {
|
|
73914
|
+
return new Map();
|
|
73922
73915
|
}
|
|
73923
|
-
|
|
73924
|
-
// facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id),
|
|
73916
|
+
return column._getFacetedUniqueValues();
|
|
73925
73917
|
};
|
|
73918
|
+
column._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id);
|
|
73919
|
+
column.getFacetedMinMaxValues = () => {
|
|
73920
|
+
if (!column._getFacetedMinMaxValues) {
|
|
73921
|
+
return undefined;
|
|
73922
|
+
}
|
|
73923
|
+
return column._getFacetedMinMaxValues();
|
|
73924
|
+
};
|
|
73925
|
+
// () => [column.getFacetedRowModel()],
|
|
73926
|
+
// facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id),
|
|
73926
73927
|
},
|
|
73927
73928
|
|
|
73928
73929
|
createRow: (row, table) => {
|
|
73929
|
-
|
|
73930
|
-
|
|
73931
|
-
columnFiltersMeta: {}
|
|
73932
|
-
};
|
|
73930
|
+
row.columnFilters = {};
|
|
73931
|
+
row.columnFiltersMeta = {};
|
|
73933
73932
|
},
|
|
73934
73933
|
createTable: table => {
|
|
73935
|
-
|
|
73936
|
-
|
|
73937
|
-
|
|
73938
|
-
|
|
73939
|
-
|
|
73940
|
-
|
|
73941
|
-
|
|
73942
|
-
|
|
73943
|
-
|
|
73944
|
-
|
|
73945
|
-
|
|
73946
|
-
|
|
73947
|
-
|
|
73948
|
-
|
|
73949
|
-
|
|
73950
|
-
|
|
73951
|
-
|
|
73952
|
-
|
|
73953
|
-
const
|
|
73954
|
-
if (column) {
|
|
73955
|
-
|
|
73956
|
-
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {
|
|
73957
|
-
return false;
|
|
73958
|
-
}
|
|
73934
|
+
table.getGlobalAutoFilterFn = () => {
|
|
73935
|
+
return filterFns.includesString;
|
|
73936
|
+
};
|
|
73937
|
+
table.getGlobalFilterFn = () => {
|
|
73938
|
+
var _table$options$filter3, _table$options$filter4;
|
|
73939
|
+
const {
|
|
73940
|
+
globalFilterFn: globalFilterFn
|
|
73941
|
+
} = table.options;
|
|
73942
|
+
return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : // @ts-ignore
|
|
73943
|
+
(_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn];
|
|
73944
|
+
};
|
|
73945
|
+
table.setColumnFilters = updater => {
|
|
73946
|
+
const leafColumns = table.getAllLeafColumns();
|
|
73947
|
+
const updateFn = old => {
|
|
73948
|
+
var _functionalUpdate;
|
|
73949
|
+
return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter(filter => {
|
|
73950
|
+
const column = leafColumns.find(d => d.id === filter.id);
|
|
73951
|
+
if (column) {
|
|
73952
|
+
const filterFn = column.getFilterFn();
|
|
73953
|
+
if (shouldAutoRemoveFilter(filterFn, filter.value, column)) {
|
|
73954
|
+
return false;
|
|
73959
73955
|
}
|
|
73960
|
-
|
|
73961
|
-
|
|
73962
|
-
};
|
|
73963
|
-
|
|
73964
|
-
|
|
73965
|
-
|
|
73966
|
-
|
|
73967
|
-
|
|
73968
|
-
|
|
73969
|
-
|
|
73970
|
-
|
|
73971
|
-
|
|
73972
|
-
|
|
73973
|
-
|
|
73974
|
-
|
|
73975
|
-
|
|
73976
|
-
|
|
73977
|
-
|
|
73978
|
-
|
|
73979
|
-
|
|
73980
|
-
|
|
73981
|
-
|
|
73982
|
-
|
|
73983
|
-
|
|
73984
|
-
|
|
73985
|
-
|
|
73986
|
-
|
|
73987
|
-
|
|
73988
|
-
|
|
73989
|
-
|
|
73990
|
-
return table._getGlobalFacetedRowModel();
|
|
73991
|
-
},
|
|
73992
|
-
_getGlobalFacetedUniqueValues: table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__'),
|
|
73993
|
-
getGlobalFacetedUniqueValues: () => {
|
|
73994
|
-
if (!table._getGlobalFacetedUniqueValues) {
|
|
73995
|
-
return new Map();
|
|
73996
|
-
}
|
|
73997
|
-
return table._getGlobalFacetedUniqueValues();
|
|
73998
|
-
},
|
|
73999
|
-
_getGlobalFacetedMinMaxValues: table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__'),
|
|
74000
|
-
getGlobalFacetedMinMaxValues: () => {
|
|
74001
|
-
if (!table._getGlobalFacetedMinMaxValues) {
|
|
74002
|
-
return;
|
|
74003
|
-
}
|
|
74004
|
-
return table._getGlobalFacetedMinMaxValues();
|
|
73956
|
+
}
|
|
73957
|
+
return true;
|
|
73958
|
+
});
|
|
73959
|
+
};
|
|
73960
|
+
table.options.onColumnFiltersChange == null || table.options.onColumnFiltersChange(updateFn);
|
|
73961
|
+
};
|
|
73962
|
+
table.setGlobalFilter = updater => {
|
|
73963
|
+
table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);
|
|
73964
|
+
};
|
|
73965
|
+
table.resetGlobalFilter = defaultState => {
|
|
73966
|
+
table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
|
|
73967
|
+
};
|
|
73968
|
+
table.resetColumnFilters = defaultState => {
|
|
73969
|
+
var _table$initialState$c, _table$initialState;
|
|
73970
|
+
table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
|
|
73971
|
+
};
|
|
73972
|
+
table.getPreFilteredRowModel = () => table.getCoreRowModel();
|
|
73973
|
+
table.getFilteredRowModel = () => {
|
|
73974
|
+
if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {
|
|
73975
|
+
table._getFilteredRowModel = table.options.getFilteredRowModel(table);
|
|
73976
|
+
}
|
|
73977
|
+
if (table.options.manualFiltering || !table._getFilteredRowModel) {
|
|
73978
|
+
return table.getPreFilteredRowModel();
|
|
73979
|
+
}
|
|
73980
|
+
return table._getFilteredRowModel();
|
|
73981
|
+
};
|
|
73982
|
+
table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__');
|
|
73983
|
+
table.getGlobalFacetedRowModel = () => {
|
|
73984
|
+
if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
|
|
73985
|
+
return table.getPreFilteredRowModel();
|
|
74005
73986
|
}
|
|
73987
|
+
return table._getGlobalFacetedRowModel();
|
|
73988
|
+
};
|
|
73989
|
+
table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__');
|
|
73990
|
+
table.getGlobalFacetedUniqueValues = () => {
|
|
73991
|
+
if (!table._getGlobalFacetedUniqueValues) {
|
|
73992
|
+
return new Map();
|
|
73993
|
+
}
|
|
73994
|
+
return table._getGlobalFacetedUniqueValues();
|
|
73995
|
+
};
|
|
73996
|
+
table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__');
|
|
73997
|
+
table.getGlobalFacetedMinMaxValues = () => {
|
|
73998
|
+
if (!table._getGlobalFacetedMinMaxValues) {
|
|
73999
|
+
return;
|
|
74000
|
+
}
|
|
74001
|
+
return table._getGlobalFacetedMinMaxValues();
|
|
74006
74002
|
};
|
|
74007
74003
|
}
|
|
74008
74004
|
};
|
|
@@ -74109,7 +74105,7 @@ const Grouping = {
|
|
|
74109
74105
|
return {
|
|
74110
74106
|
aggregatedCell: props => {
|
|
74111
74107
|
var _toString, _props$getValue;
|
|
74112
|
-
return (_toString = (_props$getValue = props.getValue()) == null
|
|
74108
|
+
return (_toString = (_props$getValue = props.getValue()) == null || _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
|
|
74113
74109
|
},
|
|
74114
74110
|
aggregationFn: 'auto'
|
|
74115
74111
|
};
|
|
@@ -74127,98 +74123,90 @@ const Grouping = {
|
|
|
74127
74123
|
};
|
|
74128
74124
|
},
|
|
74129
74125
|
createColumn: (column, table) => {
|
|
74130
|
-
|
|
74131
|
-
|
|
74132
|
-
|
|
74133
|
-
|
|
74134
|
-
|
|
74135
|
-
return old.filter(d => d !== column.id);
|
|
74136
|
-
}
|
|
74137
|
-
return [...(old != null ? old : []), column.id];
|
|
74138
|
-
});
|
|
74139
|
-
},
|
|
74140
|
-
getCanGroup: () => {
|
|
74141
|
-
var _ref, _ref2, _ref3, _column$columnDef$ena;
|
|
74142
|
-
return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : table.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
|
|
74143
|
-
},
|
|
74144
|
-
getIsGrouped: () => {
|
|
74145
|
-
var _table$getState$group;
|
|
74146
|
-
return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
|
|
74147
|
-
},
|
|
74148
|
-
getGroupedIndex: () => {
|
|
74149
|
-
var _table$getState$group2;
|
|
74150
|
-
return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
|
|
74151
|
-
},
|
|
74152
|
-
getToggleGroupingHandler: () => {
|
|
74153
|
-
const canGroup = column.getCanGroup();
|
|
74154
|
-
return () => {
|
|
74155
|
-
if (!canGroup) return;
|
|
74156
|
-
column.toggleGrouping();
|
|
74157
|
-
};
|
|
74158
|
-
},
|
|
74159
|
-
getAutoAggregationFn: () => {
|
|
74160
|
-
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
74161
|
-
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
74162
|
-
if (typeof value === 'number') {
|
|
74163
|
-
return aggregationFns.sum;
|
|
74164
|
-
}
|
|
74165
|
-
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
74166
|
-
return aggregationFns.extent;
|
|
74126
|
+
column.toggleGrouping = () => {
|
|
74127
|
+
table.setGrouping(old => {
|
|
74128
|
+
// Find any existing grouping for this column
|
|
74129
|
+
if (old != null && old.includes(column.id)) {
|
|
74130
|
+
return old.filter(d => d !== column.id);
|
|
74167
74131
|
}
|
|
74168
|
-
|
|
74169
|
-
|
|
74170
|
-
|
|
74171
|
-
|
|
74172
|
-
|
|
74173
|
-
|
|
74174
|
-
|
|
74132
|
+
return [...(old != null ? old : []), column.id];
|
|
74133
|
+
});
|
|
74134
|
+
};
|
|
74135
|
+
column.getCanGroup = () => {
|
|
74136
|
+
var _ref, _ref2, _ref3, _column$columnDef$ena;
|
|
74137
|
+
return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : table.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
|
|
74138
|
+
};
|
|
74139
|
+
column.getIsGrouped = () => {
|
|
74140
|
+
var _table$getState$group;
|
|
74141
|
+
return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
|
|
74142
|
+
};
|
|
74143
|
+
column.getGroupedIndex = () => {
|
|
74144
|
+
var _table$getState$group2;
|
|
74145
|
+
return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
|
|
74146
|
+
};
|
|
74147
|
+
column.getToggleGroupingHandler = () => {
|
|
74148
|
+
const canGroup = column.getCanGroup();
|
|
74149
|
+
return () => {
|
|
74150
|
+
if (!canGroup) return;
|
|
74151
|
+
column.toggleGrouping();
|
|
74152
|
+
};
|
|
74153
|
+
};
|
|
74154
|
+
column.getAutoAggregationFn = () => {
|
|
74155
|
+
const firstRow = table.getCoreRowModel().flatRows[0];
|
|
74156
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
74157
|
+
if (typeof value === 'number') {
|
|
74158
|
+
return aggregationFns.sum;
|
|
74159
|
+
}
|
|
74160
|
+
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
74161
|
+
return aggregationFns.extent;
|
|
74175
74162
|
}
|
|
74176
74163
|
};
|
|
74164
|
+
column.getAggregationFn = () => {
|
|
74165
|
+
var _table$options$aggreg, _table$options$aggreg2;
|
|
74166
|
+
if (!column) {
|
|
74167
|
+
throw new Error();
|
|
74168
|
+
}
|
|
74169
|
+
return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
|
|
74170
|
+
};
|
|
74177
74171
|
},
|
|
74178
74172
|
createTable: table => {
|
|
74179
|
-
|
|
74180
|
-
|
|
74181
|
-
|
|
74182
|
-
|
|
74183
|
-
|
|
74184
|
-
|
|
74185
|
-
|
|
74186
|
-
|
|
74187
|
-
|
|
74188
|
-
table._getGroupedRowModel = table.options.getGroupedRowModel(table);
|
|
74189
|
-
}
|
|
74190
|
-
if (table.options.manualGrouping || !table._getGroupedRowModel) {
|
|
74191
|
-
return table.getPreGroupedRowModel();
|
|
74192
|
-
}
|
|
74193
|
-
return table._getGroupedRowModel();
|
|
74173
|
+
table.setGrouping = updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater);
|
|
74174
|
+
table.resetGrouping = defaultState => {
|
|
74175
|
+
var _table$initialState$g, _table$initialState;
|
|
74176
|
+
table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
|
|
74177
|
+
};
|
|
74178
|
+
table.getPreGroupedRowModel = () => table.getFilteredRowModel();
|
|
74179
|
+
table.getGroupedRowModel = () => {
|
|
74180
|
+
if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {
|
|
74181
|
+
table._getGroupedRowModel = table.options.getGroupedRowModel(table);
|
|
74194
74182
|
}
|
|
74183
|
+
if (table.options.manualGrouping || !table._getGroupedRowModel) {
|
|
74184
|
+
return table.getPreGroupedRowModel();
|
|
74185
|
+
}
|
|
74186
|
+
return table._getGroupedRowModel();
|
|
74195
74187
|
};
|
|
74196
74188
|
},
|
|
74197
74189
|
createRow: (row, table) => {
|
|
74198
|
-
|
|
74199
|
-
|
|
74200
|
-
|
|
74201
|
-
if (row._groupingValuesCache.hasOwnProperty(columnId)) {
|
|
74202
|
-
return row._groupingValuesCache[columnId];
|
|
74203
|
-
}
|
|
74204
|
-
const column = table.getColumn(columnId);
|
|
74205
|
-
if (!(column != null && column.columnDef.getGroupingValue)) {
|
|
74206
|
-
return row.getValue(columnId);
|
|
74207
|
-
}
|
|
74208
|
-
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);
|
|
74190
|
+
row.getIsGrouped = () => !!row.groupingColumnId;
|
|
74191
|
+
row.getGroupingValue = columnId => {
|
|
74192
|
+
if (row._groupingValuesCache.hasOwnProperty(columnId)) {
|
|
74209
74193
|
return row._groupingValuesCache[columnId];
|
|
74210
|
-
}
|
|
74211
|
-
|
|
74194
|
+
}
|
|
74195
|
+
const column = table.getColumn(columnId);
|
|
74196
|
+
if (!(column != null && column.columnDef.getGroupingValue)) {
|
|
74197
|
+
return row.getValue(columnId);
|
|
74198
|
+
}
|
|
74199
|
+
row._groupingValuesCache[columnId] = column.columnDef.getGroupingValue(row.original);
|
|
74200
|
+
return row._groupingValuesCache[columnId];
|
|
74212
74201
|
};
|
|
74202
|
+
row._groupingValuesCache = {};
|
|
74213
74203
|
},
|
|
74214
74204
|
createCell: (cell, column, row, table) => {
|
|
74215
|
-
|
|
74216
|
-
|
|
74217
|
-
|
|
74218
|
-
|
|
74219
|
-
|
|
74220
|
-
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
74221
|
-
}
|
|
74205
|
+
cell.getIsGrouped = () => column.getIsGrouped() && column.id === row.groupingColumnId;
|
|
74206
|
+
cell.getIsPlaceholder = () => !cell.getIsGrouped() && column.getIsGrouped();
|
|
74207
|
+
cell.getIsAggregated = () => {
|
|
74208
|
+
var _row$subRows;
|
|
74209
|
+
return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
|
|
74222
74210
|
};
|
|
74223
74211
|
}
|
|
74224
74212
|
};
|
|
@@ -74249,46 +74237,44 @@ const Ordering = {
|
|
|
74249
74237
|
};
|
|
74250
74238
|
},
|
|
74251
74239
|
createTable: table => {
|
|
74252
|
-
|
|
74253
|
-
|
|
74254
|
-
|
|
74255
|
-
|
|
74256
|
-
|
|
74257
|
-
|
|
74258
|
-
|
|
74259
|
-
|
|
74260
|
-
|
|
74261
|
-
|
|
74262
|
-
|
|
74263
|
-
|
|
74264
|
-
|
|
74265
|
-
|
|
74266
|
-
|
|
74267
|
-
const columnOrderCopy = [...columnOrder];
|
|
74240
|
+
table.setColumnOrder = updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
|
|
74241
|
+
table.resetColumnOrder = defaultState => {
|
|
74242
|
+
var _table$initialState$c;
|
|
74243
|
+
table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
|
|
74244
|
+
};
|
|
74245
|
+
table._getOrderColumnsFn = memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
|
|
74246
|
+
// Sort grouped columns to the start of the column list
|
|
74247
|
+
// before the headers are built
|
|
74248
|
+
let orderedColumns = [];
|
|
74249
|
+
|
|
74250
|
+
// If there is no order, return the normal columns
|
|
74251
|
+
if (!(columnOrder != null && columnOrder.length)) {
|
|
74252
|
+
orderedColumns = columns;
|
|
74253
|
+
} else {
|
|
74254
|
+
const columnOrderCopy = [...columnOrder];
|
|
74268
74255
|
|
|
74269
|
-
|
|
74270
|
-
|
|
74256
|
+
// If there is an order, make a copy of the columns
|
|
74257
|
+
const columnsCopy = [...columns];
|
|
74271
74258
|
|
|
74272
|
-
|
|
74259
|
+
// And make a new ordered array of the columns
|
|
74273
74260
|
|
|
74274
|
-
|
|
74275
|
-
|
|
74276
|
-
|
|
74277
|
-
|
|
74278
|
-
|
|
74279
|
-
|
|
74280
|
-
}
|
|
74261
|
+
// Loop over the columns and place them in order into the new array
|
|
74262
|
+
while (columnsCopy.length && columnOrderCopy.length) {
|
|
74263
|
+
const targetColumnId = columnOrderCopy.shift();
|
|
74264
|
+
const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId);
|
|
74265
|
+
if (foundIndex > -1) {
|
|
74266
|
+
orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]);
|
|
74281
74267
|
}
|
|
74282
|
-
|
|
74283
|
-
// If there are any columns left, add them to the end
|
|
74284
|
-
orderedColumns = [...orderedColumns, ...columnsCopy];
|
|
74285
74268
|
}
|
|
74286
|
-
|
|
74287
|
-
|
|
74288
|
-
|
|
74289
|
-
|
|
74290
|
-
|
|
74291
|
-
}
|
|
74269
|
+
|
|
74270
|
+
// If there are any columns left, add them to the end
|
|
74271
|
+
orderedColumns = [...orderedColumns, ...columnsCopy];
|
|
74272
|
+
}
|
|
74273
|
+
return orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
74274
|
+
}, {
|
|
74275
|
+
key: process.env.NODE_ENV === 'development' && 'getOrderColumnsFn'
|
|
74276
|
+
// debug: () => table.options.debugAll ?? table.options.debugTable,
|
|
74277
|
+
});
|
|
74292
74278
|
}
|
|
74293
74279
|
};
|
|
74294
74280
|
|
|
@@ -74318,283 +74304,398 @@ const Pagination = {
|
|
|
74318
74304
|
createTable: table => {
|
|
74319
74305
|
let registered = false;
|
|
74320
74306
|
let queued = false;
|
|
74321
|
-
|
|
74322
|
-
|
|
74323
|
-
|
|
74324
|
-
|
|
74325
|
-
|
|
74326
|
-
registered = true;
|
|
74327
|
-
});
|
|
74328
|
-
return;
|
|
74329
|
-
}
|
|
74330
|
-
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
|
|
74331
|
-
if (queued) return;
|
|
74332
|
-
queued = true;
|
|
74333
|
-
table._queue(() => {
|
|
74334
|
-
table.resetPageIndex();
|
|
74335
|
-
queued = false;
|
|
74336
|
-
});
|
|
74337
|
-
}
|
|
74338
|
-
},
|
|
74339
|
-
setPagination: updater => {
|
|
74340
|
-
const safeUpdater = old => {
|
|
74341
|
-
let newState = functionalUpdate(updater, old);
|
|
74342
|
-
return newState;
|
|
74343
|
-
};
|
|
74344
|
-
return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
|
|
74345
|
-
},
|
|
74346
|
-
resetPagination: defaultState => {
|
|
74347
|
-
var _table$initialState$p;
|
|
74348
|
-
table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
|
|
74349
|
-
},
|
|
74350
|
-
setPageIndex: updater => {
|
|
74351
|
-
table.setPagination(old => {
|
|
74352
|
-
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
74353
|
-
const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
|
|
74354
|
-
pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
|
|
74355
|
-
return {
|
|
74356
|
-
...old,
|
|
74357
|
-
pageIndex
|
|
74358
|
-
};
|
|
74307
|
+
table._autoResetPageIndex = () => {
|
|
74308
|
+
var _ref, _table$options$autoRe;
|
|
74309
|
+
if (!registered) {
|
|
74310
|
+
table._queue(() => {
|
|
74311
|
+
registered = true;
|
|
74359
74312
|
});
|
|
74360
|
-
|
|
74361
|
-
|
|
74362
|
-
|
|
74363
|
-
|
|
74364
|
-
|
|
74365
|
-
|
|
74366
|
-
|
|
74367
|
-
|
|
74368
|
-
},
|
|
74369
|
-
setPageSize: updater => {
|
|
74370
|
-
table.setPagination(old => {
|
|
74371
|
-
const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
|
|
74372
|
-
const topRowIndex = old.pageSize * old.pageIndex;
|
|
74373
|
-
const pageIndex = Math.floor(topRowIndex / pageSize);
|
|
74374
|
-
return {
|
|
74375
|
-
...old,
|
|
74376
|
-
pageIndex,
|
|
74377
|
-
pageSize
|
|
74378
|
-
};
|
|
74313
|
+
return;
|
|
74314
|
+
}
|
|
74315
|
+
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
|
|
74316
|
+
if (queued) return;
|
|
74317
|
+
queued = true;
|
|
74318
|
+
table._queue(() => {
|
|
74319
|
+
table.resetPageIndex();
|
|
74320
|
+
queued = false;
|
|
74379
74321
|
});
|
|
74380
|
-
}
|
|
74381
|
-
|
|
74382
|
-
|
|
74383
|
-
|
|
74384
|
-
|
|
74385
|
-
|
|
74386
|
-
|
|
74322
|
+
}
|
|
74323
|
+
};
|
|
74324
|
+
table.setPagination = updater => {
|
|
74325
|
+
const safeUpdater = old => {
|
|
74326
|
+
let newState = functionalUpdate(updater, old);
|
|
74327
|
+
return newState;
|
|
74328
|
+
};
|
|
74329
|
+
return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
|
|
74330
|
+
};
|
|
74331
|
+
table.resetPagination = defaultState => {
|
|
74332
|
+
var _table$initialState$p;
|
|
74333
|
+
table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
|
|
74334
|
+
};
|
|
74335
|
+
table.setPageIndex = updater => {
|
|
74336
|
+
table.setPagination(old => {
|
|
74337
|
+
let pageIndex = functionalUpdate(updater, old.pageIndex);
|
|
74338
|
+
const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
|
|
74339
|
+
pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
|
|
74387
74340
|
return {
|
|
74388
74341
|
...old,
|
|
74389
|
-
pageCount: newPageCount
|
|
74390
|
-
};
|
|
74391
|
-
}),
|
|
74392
|
-
getPageOptions: memo(() => [table.getPageCount()], pageCount => {
|
|
74393
|
-
let pageOptions = [];
|
|
74394
|
-
if (pageCount && pageCount > 0) {
|
|
74395
|
-
pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
74396
|
-
}
|
|
74397
|
-
return pageOptions;
|
|
74398
|
-
}, {
|
|
74399
|
-
key: process.env.NODE_ENV === 'development' && 'getPageOptions',
|
|
74400
|
-
debug: () => {
|
|
74401
|
-
var _table$options$debugA;
|
|
74402
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
74403
|
-
}
|
|
74404
|
-
}),
|
|
74405
|
-
getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
|
|
74406
|
-
getCanNextPage: () => {
|
|
74407
|
-
const {
|
|
74408
74342
|
pageIndex
|
|
74409
|
-
}
|
|
74410
|
-
|
|
74411
|
-
|
|
74412
|
-
|
|
74413
|
-
|
|
74414
|
-
|
|
74415
|
-
|
|
74416
|
-
|
|
74417
|
-
|
|
74418
|
-
|
|
74419
|
-
|
|
74420
|
-
|
|
74421
|
-
|
|
74422
|
-
|
|
74423
|
-
|
|
74424
|
-
|
|
74425
|
-
|
|
74426
|
-
|
|
74427
|
-
|
|
74428
|
-
|
|
74429
|
-
|
|
74430
|
-
|
|
74431
|
-
|
|
74432
|
-
|
|
74433
|
-
|
|
74434
|
-
|
|
74435
|
-
|
|
74436
|
-
|
|
74437
|
-
getPageCount: () => {
|
|
74438
|
-
var _table$options$pageCo2;
|
|
74439
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
|
|
74343
|
+
};
|
|
74344
|
+
});
|
|
74345
|
+
};
|
|
74346
|
+
table.resetPageIndex = defaultState => {
|
|
74347
|
+
var _table$initialState$p2, _table$initialState;
|
|
74348
|
+
table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null || (_table$initialState = _table$initialState.pagination) == null ? void 0 : _table$initialState.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
|
|
74349
|
+
};
|
|
74350
|
+
table.resetPageSize = defaultState => {
|
|
74351
|
+
var _table$initialState$p3, _table$initialState2;
|
|
74352
|
+
table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = (_table$initialState2 = table.initialState) == null || (_table$initialState2 = _table$initialState2.pagination) == null ? void 0 : _table$initialState2.pageSize) != null ? _table$initialState$p3 : defaultPageSize);
|
|
74353
|
+
};
|
|
74354
|
+
table.setPageSize = updater => {
|
|
74355
|
+
table.setPagination(old => {
|
|
74356
|
+
const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
|
|
74357
|
+
const topRowIndex = old.pageSize * old.pageIndex;
|
|
74358
|
+
const pageIndex = Math.floor(topRowIndex / pageSize);
|
|
74359
|
+
return {
|
|
74360
|
+
...old,
|
|
74361
|
+
pageIndex,
|
|
74362
|
+
pageSize
|
|
74363
|
+
};
|
|
74364
|
+
});
|
|
74365
|
+
};
|
|
74366
|
+
table.setPageCount = updater => table.setPagination(old => {
|
|
74367
|
+
var _table$options$pageCo;
|
|
74368
|
+
let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
74369
|
+
if (typeof newPageCount === 'number') {
|
|
74370
|
+
newPageCount = Math.max(-1, newPageCount);
|
|
74440
74371
|
}
|
|
74372
|
+
return {
|
|
74373
|
+
...old,
|
|
74374
|
+
pageCount: newPageCount
|
|
74375
|
+
};
|
|
74376
|
+
});
|
|
74377
|
+
table.getPageOptions = memo(() => [table.getPageCount()], pageCount => {
|
|
74378
|
+
let pageOptions = [];
|
|
74379
|
+
if (pageCount && pageCount > 0) {
|
|
74380
|
+
pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
74381
|
+
}
|
|
74382
|
+
return pageOptions;
|
|
74383
|
+
}, {
|
|
74384
|
+
key: process.env.NODE_ENV === 'development' && 'getPageOptions',
|
|
74385
|
+
debug: () => {
|
|
74386
|
+
var _table$options$debugA;
|
|
74387
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
74388
|
+
}
|
|
74389
|
+
});
|
|
74390
|
+
table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
|
|
74391
|
+
table.getCanNextPage = () => {
|
|
74392
|
+
const {
|
|
74393
|
+
pageIndex
|
|
74394
|
+
} = table.getState().pagination;
|
|
74395
|
+
const pageCount = table.getPageCount();
|
|
74396
|
+
if (pageCount === -1) {
|
|
74397
|
+
return true;
|
|
74398
|
+
}
|
|
74399
|
+
if (pageCount === 0) {
|
|
74400
|
+
return false;
|
|
74401
|
+
}
|
|
74402
|
+
return pageIndex < pageCount - 1;
|
|
74403
|
+
};
|
|
74404
|
+
table.previousPage = () => {
|
|
74405
|
+
return table.setPageIndex(old => old - 1);
|
|
74406
|
+
};
|
|
74407
|
+
table.nextPage = () => {
|
|
74408
|
+
return table.setPageIndex(old => {
|
|
74409
|
+
return old + 1;
|
|
74410
|
+
});
|
|
74411
|
+
};
|
|
74412
|
+
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
74413
|
+
table.getPaginationRowModel = () => {
|
|
74414
|
+
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
74415
|
+
table._getPaginationRowModel = table.options.getPaginationRowModel(table);
|
|
74416
|
+
}
|
|
74417
|
+
if (table.options.manualPagination || !table._getPaginationRowModel) {
|
|
74418
|
+
return table.getPrePaginationRowModel();
|
|
74419
|
+
}
|
|
74420
|
+
return table._getPaginationRowModel();
|
|
74421
|
+
};
|
|
74422
|
+
table.getPageCount = () => {
|
|
74423
|
+
var _table$options$pageCo2;
|
|
74424
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
|
|
74441
74425
|
};
|
|
74442
74426
|
}
|
|
74443
74427
|
};
|
|
74444
74428
|
|
|
74445
74429
|
//
|
|
74446
74430
|
|
|
74447
|
-
const
|
|
74431
|
+
const getDefaultColumnPinningState = () => ({
|
|
74448
74432
|
left: [],
|
|
74449
74433
|
right: []
|
|
74450
74434
|
});
|
|
74435
|
+
const getDefaultRowPinningState = () => ({
|
|
74436
|
+
top: [],
|
|
74437
|
+
bottom: []
|
|
74438
|
+
});
|
|
74451
74439
|
const Pinning = {
|
|
74452
74440
|
getInitialState: state => {
|
|
74453
74441
|
return {
|
|
74454
|
-
columnPinning:
|
|
74442
|
+
columnPinning: getDefaultColumnPinningState(),
|
|
74443
|
+
rowPinning: getDefaultRowPinningState(),
|
|
74455
74444
|
...state
|
|
74456
74445
|
};
|
|
74457
74446
|
},
|
|
74458
74447
|
getDefaultOptions: table => {
|
|
74459
74448
|
return {
|
|
74460
|
-
onColumnPinningChange: makeStateUpdater('columnPinning', table)
|
|
74449
|
+
onColumnPinningChange: makeStateUpdater('columnPinning', table),
|
|
74450
|
+
onRowPinningChange: makeStateUpdater('rowPinning', table)
|
|
74461
74451
|
};
|
|
74462
74452
|
},
|
|
74463
74453
|
createColumn: (column, table) => {
|
|
74464
|
-
|
|
74465
|
-
|
|
74466
|
-
|
|
74467
|
-
|
|
74468
|
-
|
|
74469
|
-
|
|
74470
|
-
var _old$left, _old$right;
|
|
74471
|
-
return {
|
|
74472
|
-
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
|
|
74473
|
-
right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
|
|
74474
|
-
};
|
|
74475
|
-
}
|
|
74476
|
-
if (position === 'left') {
|
|
74477
|
-
var _old$left2, _old$right2;
|
|
74478
|
-
return {
|
|
74479
|
-
left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
|
|
74480
|
-
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
|
|
74481
|
-
};
|
|
74482
|
-
}
|
|
74454
|
+
column.pin = position => {
|
|
74455
|
+
const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
|
|
74456
|
+
table.setColumnPinning(old => {
|
|
74457
|
+
var _old$left3, _old$right3;
|
|
74458
|
+
if (position === 'right') {
|
|
74459
|
+
var _old$left, _old$right;
|
|
74483
74460
|
return {
|
|
74484
|
-
left: ((_old$
|
|
74485
|
-
right: ((_old$
|
|
74461
|
+
left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
|
|
74462
|
+
right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
|
|
74486
74463
|
};
|
|
74487
|
-
}
|
|
74488
|
-
|
|
74489
|
-
|
|
74490
|
-
|
|
74491
|
-
|
|
74492
|
-
|
|
74493
|
-
|
|
74494
|
-
}
|
|
74495
|
-
|
|
74496
|
-
|
|
74497
|
-
|
|
74498
|
-
|
|
74499
|
-
|
|
74500
|
-
|
|
74501
|
-
|
|
74502
|
-
|
|
74503
|
-
|
|
74504
|
-
|
|
74505
|
-
|
|
74506
|
-
|
|
74507
|
-
|
|
74508
|
-
|
|
74509
|
-
|
|
74510
|
-
|
|
74464
|
+
}
|
|
74465
|
+
if (position === 'left') {
|
|
74466
|
+
var _old$left2, _old$right2;
|
|
74467
|
+
return {
|
|
74468
|
+
left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
|
|
74469
|
+
right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
|
|
74470
|
+
};
|
|
74471
|
+
}
|
|
74472
|
+
return {
|
|
74473
|
+
left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
|
|
74474
|
+
right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
|
|
74475
|
+
};
|
|
74476
|
+
});
|
|
74477
|
+
};
|
|
74478
|
+
column.getCanPin = () => {
|
|
74479
|
+
const leafColumns = column.getLeafColumns();
|
|
74480
|
+
return leafColumns.some(d => {
|
|
74481
|
+
var _d$columnDef$enablePi, _ref, _table$options$enable;
|
|
74482
|
+
return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_ref = (_table$options$enable = table.options.enableColumnPinning) != null ? _table$options$enable : table.options.enablePinning) != null ? _ref : true);
|
|
74483
|
+
});
|
|
74484
|
+
};
|
|
74485
|
+
column.getIsPinned = () => {
|
|
74486
|
+
const leafColumnIds = column.getLeafColumns().map(d => d.id);
|
|
74487
|
+
const {
|
|
74488
|
+
left,
|
|
74489
|
+
right
|
|
74490
|
+
} = table.getState().columnPinning;
|
|
74491
|
+
const isLeft = leafColumnIds.some(d => left == null ? void 0 : left.includes(d));
|
|
74492
|
+
const isRight = leafColumnIds.some(d => right == null ? void 0 : right.includes(d));
|
|
74493
|
+
return isLeft ? 'left' : isRight ? 'right' : false;
|
|
74494
|
+
};
|
|
74495
|
+
column.getPinnedIndex = () => {
|
|
74496
|
+
var _table$getState$colum, _table$getState$colum2;
|
|
74497
|
+
const position = column.getIsPinned();
|
|
74498
|
+
return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null || (_table$getState$colum2 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
|
|
74511
74499
|
};
|
|
74512
74500
|
},
|
|
74513
74501
|
createRow: (row, table) => {
|
|
74514
|
-
|
|
74515
|
-
|
|
74516
|
-
|
|
74517
|
-
|
|
74518
|
-
|
|
74519
|
-
|
|
74520
|
-
|
|
74521
|
-
|
|
74522
|
-
|
|
74523
|
-
|
|
74524
|
-
|
|
74525
|
-
|
|
74526
|
-
|
|
74527
|
-
|
|
74528
|
-
|
|
74529
|
-
|
|
74530
|
-
|
|
74531
|
-
|
|
74532
|
-
|
|
74533
|
-
|
|
74534
|
-
|
|
74535
|
-
|
|
74502
|
+
row.pin = (position, includeLeafRows, includeParentRows) => {
|
|
74503
|
+
const leafRowIds = includeLeafRows ? row.getLeafRows().map(_ref2 => {
|
|
74504
|
+
let {
|
|
74505
|
+
id
|
|
74506
|
+
} = _ref2;
|
|
74507
|
+
return id;
|
|
74508
|
+
}) : [];
|
|
74509
|
+
const parentRowIds = includeParentRows ? row.getParentRows().map(_ref3 => {
|
|
74510
|
+
let {
|
|
74511
|
+
id
|
|
74512
|
+
} = _ref3;
|
|
74513
|
+
return id;
|
|
74514
|
+
}) : [];
|
|
74515
|
+
const rowIds = new Set([...parentRowIds, row.id, ...leafRowIds]);
|
|
74516
|
+
table.setRowPinning(old => {
|
|
74517
|
+
var _old$top3, _old$bottom3;
|
|
74518
|
+
if (position === 'bottom') {
|
|
74519
|
+
var _old$top, _old$bottom;
|
|
74520
|
+
return {
|
|
74521
|
+
top: ((_old$top = old == null ? void 0 : old.top) != null ? _old$top : []).filter(d => !(rowIds != null && rowIds.has(d))),
|
|
74522
|
+
bottom: [...((_old$bottom = old == null ? void 0 : old.bottom) != null ? _old$bottom : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)]
|
|
74523
|
+
};
|
|
74536
74524
|
}
|
|
74537
|
-
|
|
74538
|
-
|
|
74539
|
-
|
|
74540
|
-
|
|
74541
|
-
|
|
74542
|
-
|
|
74543
|
-
return cells;
|
|
74544
|
-
}, {
|
|
74545
|
-
key: process.env.NODE_ENV === 'production' && 'row.getRightVisibleCells',
|
|
74546
|
-
debug: () => {
|
|
74547
|
-
var _table$options$debugA3;
|
|
74548
|
-
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
|
|
74525
|
+
if (position === 'top') {
|
|
74526
|
+
var _old$top2, _old$bottom2;
|
|
74527
|
+
return {
|
|
74528
|
+
top: [...((_old$top2 = old == null ? void 0 : old.top) != null ? _old$top2 : []).filter(d => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)],
|
|
74529
|
+
bottom: ((_old$bottom2 = old == null ? void 0 : old.bottom) != null ? _old$bottom2 : []).filter(d => !(rowIds != null && rowIds.has(d)))
|
|
74530
|
+
};
|
|
74549
74531
|
}
|
|
74550
|
-
|
|
74532
|
+
return {
|
|
74533
|
+
top: ((_old$top3 = old == null ? void 0 : old.top) != null ? _old$top3 : []).filter(d => !(rowIds != null && rowIds.has(d))),
|
|
74534
|
+
bottom: ((_old$bottom3 = old == null ? void 0 : old.bottom) != null ? _old$bottom3 : []).filter(d => !(rowIds != null && rowIds.has(d)))
|
|
74535
|
+
};
|
|
74536
|
+
});
|
|
74551
74537
|
};
|
|
74538
|
+
row.getCanPin = () => {
|
|
74539
|
+
var _ref4;
|
|
74540
|
+
const {
|
|
74541
|
+
enableRowPinning,
|
|
74542
|
+
enablePinning
|
|
74543
|
+
} = table.options;
|
|
74544
|
+
if (typeof enableRowPinning === 'function') {
|
|
74545
|
+
return enableRowPinning(row);
|
|
74546
|
+
}
|
|
74547
|
+
return (_ref4 = enableRowPinning != null ? enableRowPinning : enablePinning) != null ? _ref4 : true;
|
|
74548
|
+
};
|
|
74549
|
+
row.getIsPinned = () => {
|
|
74550
|
+
const rowIds = [row.id];
|
|
74551
|
+
const {
|
|
74552
|
+
top,
|
|
74553
|
+
bottom
|
|
74554
|
+
} = table.getState().rowPinning;
|
|
74555
|
+
const isTop = rowIds.some(d => top == null ? void 0 : top.includes(d));
|
|
74556
|
+
const isBottom = rowIds.some(d => bottom == null ? void 0 : bottom.includes(d));
|
|
74557
|
+
return isTop ? 'top' : isBottom ? 'bottom' : false;
|
|
74558
|
+
};
|
|
74559
|
+
row.getPinnedIndex = () => {
|
|
74560
|
+
var _table$_getPinnedRows, _visiblePinnedRowIds$;
|
|
74561
|
+
const position = row.getIsPinned();
|
|
74562
|
+
if (!position) return -1;
|
|
74563
|
+
const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position)) == null ? void 0 : _table$_getPinnedRows.map(_ref5 => {
|
|
74564
|
+
let {
|
|
74565
|
+
id
|
|
74566
|
+
} = _ref5;
|
|
74567
|
+
return id;
|
|
74568
|
+
});
|
|
74569
|
+
return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
|
|
74570
|
+
};
|
|
74571
|
+
row.getCenterVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
|
|
74572
|
+
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
74573
|
+
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
74574
|
+
}, {
|
|
74575
|
+
key: process.env.NODE_ENV === 'development' && 'row.getCenterVisibleCells',
|
|
74576
|
+
debug: () => {
|
|
74577
|
+
var _table$options$debugA;
|
|
74578
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
|
|
74579
|
+
}
|
|
74580
|
+
});
|
|
74581
|
+
row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
|
|
74582
|
+
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
74583
|
+
...d,
|
|
74584
|
+
position: 'left'
|
|
74585
|
+
}));
|
|
74586
|
+
return cells;
|
|
74587
|
+
}, {
|
|
74588
|
+
key: process.env.NODE_ENV === 'development' && 'row.getLeftVisibleCells',
|
|
74589
|
+
debug: () => {
|
|
74590
|
+
var _table$options$debugA2;
|
|
74591
|
+
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
|
|
74592
|
+
}
|
|
74593
|
+
});
|
|
74594
|
+
row.getRightVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
|
|
74595
|
+
const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
74596
|
+
...d,
|
|
74597
|
+
position: 'right'
|
|
74598
|
+
}));
|
|
74599
|
+
return cells;
|
|
74600
|
+
}, {
|
|
74601
|
+
key: process.env.NODE_ENV === 'development' && 'row.getRightVisibleCells',
|
|
74602
|
+
debug: () => {
|
|
74603
|
+
var _table$options$debugA3;
|
|
74604
|
+
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
|
|
74605
|
+
}
|
|
74606
|
+
});
|
|
74552
74607
|
},
|
|
74553
74608
|
createTable: table => {
|
|
74554
|
-
|
|
74555
|
-
|
|
74556
|
-
|
|
74557
|
-
|
|
74558
|
-
return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
|
|
74559
|
-
},
|
|
74560
|
-
getIsSomeColumnsPinned: position => {
|
|
74561
|
-
var _pinningState$positio;
|
|
74562
|
-
const pinningState = table.getState().columnPinning;
|
|
74563
|
-
if (!position) {
|
|
74564
|
-
var _pinningState$left, _pinningState$right;
|
|
74565
|
-
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
74566
|
-
}
|
|
74567
|
-
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
74568
|
-
},
|
|
74569
|
-
getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
|
|
74570
|
-
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
74571
|
-
}, {
|
|
74572
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftLeafColumns',
|
|
74573
|
-
debug: () => {
|
|
74574
|
-
var _table$options$debugA4;
|
|
74575
|
-
return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
|
|
74576
|
-
}
|
|
74577
|
-
}),
|
|
74578
|
-
getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
|
|
74579
|
-
return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
74580
|
-
}, {
|
|
74581
|
-
key: process.env.NODE_ENV === 'development' && 'getRightLeafColumns',
|
|
74582
|
-
debug: () => {
|
|
74583
|
-
var _table$options$debugA5;
|
|
74584
|
-
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
|
|
74585
|
-
}
|
|
74586
|
-
}),
|
|
74587
|
-
getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
|
|
74588
|
-
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
74589
|
-
return allColumns.filter(d => !leftAndRight.includes(d.id));
|
|
74590
|
-
}, {
|
|
74591
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterLeafColumns',
|
|
74592
|
-
debug: () => {
|
|
74593
|
-
var _table$options$debugA6;
|
|
74594
|
-
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
|
|
74595
|
-
}
|
|
74596
|
-
})
|
|
74609
|
+
table.setColumnPinning = updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
|
|
74610
|
+
table.resetColumnPinning = defaultState => {
|
|
74611
|
+
var _table$initialState$c, _table$initialState;
|
|
74612
|
+
return table.setColumnPinning(defaultState ? getDefaultColumnPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultColumnPinningState());
|
|
74597
74613
|
};
|
|
74614
|
+
table.getIsSomeColumnsPinned = position => {
|
|
74615
|
+
var _pinningState$positio;
|
|
74616
|
+
const pinningState = table.getState().columnPinning;
|
|
74617
|
+
if (!position) {
|
|
74618
|
+
var _pinningState$left, _pinningState$right;
|
|
74619
|
+
return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
|
|
74620
|
+
}
|
|
74621
|
+
return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
|
|
74622
|
+
};
|
|
74623
|
+
table.getLeftLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
|
|
74624
|
+
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
74625
|
+
}, {
|
|
74626
|
+
key: process.env.NODE_ENV === 'development' && 'getLeftLeafColumns',
|
|
74627
|
+
debug: () => {
|
|
74628
|
+
var _table$options$debugA4;
|
|
74629
|
+
return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
|
|
74630
|
+
}
|
|
74631
|
+
});
|
|
74632
|
+
table.getRightLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
|
|
74633
|
+
return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
74634
|
+
}, {
|
|
74635
|
+
key: process.env.NODE_ENV === 'development' && 'getRightLeafColumns',
|
|
74636
|
+
debug: () => {
|
|
74637
|
+
var _table$options$debugA5;
|
|
74638
|
+
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
|
|
74639
|
+
}
|
|
74640
|
+
});
|
|
74641
|
+
table.getCenterLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
|
|
74642
|
+
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
74643
|
+
return allColumns.filter(d => !leftAndRight.includes(d.id));
|
|
74644
|
+
}, {
|
|
74645
|
+
key: process.env.NODE_ENV === 'development' && 'getCenterLeafColumns',
|
|
74646
|
+
debug: () => {
|
|
74647
|
+
var _table$options$debugA6;
|
|
74648
|
+
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
|
|
74649
|
+
}
|
|
74650
|
+
});
|
|
74651
|
+
table.setRowPinning = updater => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
|
|
74652
|
+
table.resetRowPinning = defaultState => {
|
|
74653
|
+
var _table$initialState$r, _table$initialState2;
|
|
74654
|
+
return table.setRowPinning(defaultState ? getDefaultRowPinningState() : (_table$initialState$r = (_table$initialState2 = table.initialState) == null ? void 0 : _table$initialState2.rowPinning) != null ? _table$initialState$r : getDefaultRowPinningState());
|
|
74655
|
+
};
|
|
74656
|
+
table.getIsSomeRowsPinned = position => {
|
|
74657
|
+
var _pinningState$positio2;
|
|
74658
|
+
const pinningState = table.getState().rowPinning;
|
|
74659
|
+
if (!position) {
|
|
74660
|
+
var _pinningState$top, _pinningState$bottom;
|
|
74661
|
+
return Boolean(((_pinningState$top = pinningState.top) == null ? void 0 : _pinningState$top.length) || ((_pinningState$bottom = pinningState.bottom) == null ? void 0 : _pinningState$bottom.length));
|
|
74662
|
+
}
|
|
74663
|
+
return Boolean((_pinningState$positio2 = pinningState[position]) == null ? void 0 : _pinningState$positio2.length);
|
|
74664
|
+
};
|
|
74665
|
+
table._getPinnedRows = position => memo(() => [table.getRowModel().rows, table.getState().rowPinning[position]], (visibleRows, pinnedRowIds) => {
|
|
74666
|
+
var _table$options$keepPi;
|
|
74667
|
+
const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
|
|
74668
|
+
//get all rows that are pinned even if they would not be otherwise visible
|
|
74669
|
+
//account for expanded parent rows, but not pagination or filtering
|
|
74670
|
+
(pinnedRowIds != null ? pinnedRowIds : []).map(rowId => {
|
|
74671
|
+
const row = table.getRow(rowId, true);
|
|
74672
|
+
return row.getIsAllParentsExpanded() ? row : null;
|
|
74673
|
+
}) :
|
|
74674
|
+
//else get only visible rows that are pinned
|
|
74675
|
+
(pinnedRowIds != null ? pinnedRowIds : []).map(rowId => visibleRows.find(row => row.id === rowId));
|
|
74676
|
+
return rows.filter(Boolean).map(d => ({
|
|
74677
|
+
...d,
|
|
74678
|
+
position
|
|
74679
|
+
}));
|
|
74680
|
+
}, {
|
|
74681
|
+
key: process.env.NODE_ENV === 'development' && `row.get${position === 'top' ? 'Top' : 'Bottom'}Rows`,
|
|
74682
|
+
debug: () => {
|
|
74683
|
+
var _table$options$debugA7;
|
|
74684
|
+
return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugRows;
|
|
74685
|
+
}
|
|
74686
|
+
})();
|
|
74687
|
+
table.getTopRows = () => table._getPinnedRows('top');
|
|
74688
|
+
table.getBottomRows = () => table._getPinnedRows('bottom');
|
|
74689
|
+
table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
|
|
74690
|
+
const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
|
|
74691
|
+
return allRows.filter(d => !topAndBottom.has(d.id));
|
|
74692
|
+
}, {
|
|
74693
|
+
key: process.env.NODE_ENV === 'development' && 'row.getCenterRows',
|
|
74694
|
+
debug: () => {
|
|
74695
|
+
var _table$options$debugA8;
|
|
74696
|
+
return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugRows;
|
|
74697
|
+
}
|
|
74698
|
+
});
|
|
74598
74699
|
}
|
|
74599
74700
|
};
|
|
74600
74701
|
|
|
@@ -74620,282 +74721,281 @@ const RowSelection = {
|
|
|
74620
74721
|
},
|
|
74621
74722
|
|
|
74622
74723
|
createTable: table => {
|
|
74623
|
-
|
|
74624
|
-
|
|
74625
|
-
|
|
74626
|
-
|
|
74627
|
-
|
|
74628
|
-
|
|
74629
|
-
|
|
74630
|
-
table.
|
|
74631
|
-
value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
|
|
74632
|
-
const rowSelection = {
|
|
74633
|
-
...old
|
|
74634
|
-
};
|
|
74635
|
-
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
|
|
74636
|
-
|
|
74637
|
-
// We don't use `mutateRowIsSelected` here for performance reasons.
|
|
74638
|
-
// All of the rows are flat already, so it wouldn't be worth it
|
|
74639
|
-
if (value) {
|
|
74640
|
-
preGroupedFlatRows.forEach(row => {
|
|
74641
|
-
if (!row.getCanSelect()) {
|
|
74642
|
-
return;
|
|
74643
|
-
}
|
|
74644
|
-
rowSelection[row.id] = true;
|
|
74645
|
-
});
|
|
74646
|
-
} else {
|
|
74647
|
-
preGroupedFlatRows.forEach(row => {
|
|
74648
|
-
delete rowSelection[row.id];
|
|
74649
|
-
});
|
|
74650
|
-
}
|
|
74651
|
-
return rowSelection;
|
|
74652
|
-
});
|
|
74653
|
-
},
|
|
74654
|
-
toggleAllPageRowsSelected: value => table.setRowSelection(old => {
|
|
74655
|
-
const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected();
|
|
74724
|
+
table.setRowSelection = updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
|
|
74725
|
+
table.resetRowSelection = defaultState => {
|
|
74726
|
+
var _table$initialState$r;
|
|
74727
|
+
return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
|
|
74728
|
+
};
|
|
74729
|
+
table.toggleAllRowsSelected = value => {
|
|
74730
|
+
table.setRowSelection(old => {
|
|
74731
|
+
value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
|
|
74656
74732
|
const rowSelection = {
|
|
74657
74733
|
...old
|
|
74658
74734
|
};
|
|
74659
|
-
table.
|
|
74660
|
-
|
|
74661
|
-
|
|
74735
|
+
const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
|
|
74736
|
+
|
|
74737
|
+
// We don't use `mutateRowIsSelected` here for performance reasons.
|
|
74738
|
+
// All of the rows are flat already, so it wouldn't be worth it
|
|
74739
|
+
if (value) {
|
|
74740
|
+
preGroupedFlatRows.forEach(row => {
|
|
74741
|
+
if (!row.getCanSelect()) {
|
|
74742
|
+
return;
|
|
74743
|
+
}
|
|
74744
|
+
rowSelection[row.id] = true;
|
|
74745
|
+
});
|
|
74746
|
+
} else {
|
|
74747
|
+
preGroupedFlatRows.forEach(row => {
|
|
74748
|
+
delete rowSelection[row.id];
|
|
74749
|
+
});
|
|
74750
|
+
}
|
|
74662
74751
|
return rowSelection;
|
|
74663
|
-
})
|
|
74664
|
-
|
|
74665
|
-
|
|
74666
|
-
|
|
74667
|
-
|
|
74668
|
-
|
|
74669
|
-
|
|
74670
|
-
|
|
74671
|
-
|
|
74672
|
-
|
|
74673
|
-
|
|
74674
|
-
|
|
74675
|
-
// found = d
|
|
74676
|
-
// return true
|
|
74677
|
-
// }
|
|
74678
|
-
// const subFound = findSelectedRow(d.subRows || [])
|
|
74679
|
-
// if (subFound) {
|
|
74680
|
-
// found = subFound
|
|
74681
|
-
// return true
|
|
74682
|
-
// }
|
|
74683
|
-
// return false
|
|
74684
|
-
// })
|
|
74685
|
-
// return found
|
|
74686
|
-
// }
|
|
74687
|
-
|
|
74688
|
-
// const firstRow = findSelectedRow(rows) || rows[0]
|
|
74689
|
-
// const lastRow = rowsById[rowId]
|
|
74690
|
-
|
|
74691
|
-
// let include = false
|
|
74692
|
-
// const selectedRowIds = {}
|
|
74693
|
-
|
|
74694
|
-
// const addRow = (row: Row) => {
|
|
74695
|
-
// mutateRowIsSelected(selectedRowIds, row.id, true, {
|
|
74696
|
-
// rowsById,
|
|
74697
|
-
// selectGroupingRows: selectGroupingRows!,
|
|
74698
|
-
// selectSubRows: selectSubRows!,
|
|
74699
|
-
// })
|
|
74700
|
-
// }
|
|
74701
|
-
|
|
74702
|
-
// table.rows.forEach(row => {
|
|
74703
|
-
// const isFirstRow = row.id === firstRow.id
|
|
74704
|
-
// const isLastRow = row.id === lastRow.id
|
|
74705
|
-
|
|
74706
|
-
// if (isFirstRow || isLastRow) {
|
|
74707
|
-
// if (!include) {
|
|
74708
|
-
// include = true
|
|
74709
|
-
// } else if (include) {
|
|
74710
|
-
// addRow(row)
|
|
74711
|
-
// include = false
|
|
74712
|
-
// }
|
|
74713
|
-
// }
|
|
74752
|
+
});
|
|
74753
|
+
};
|
|
74754
|
+
table.toggleAllPageRowsSelected = value => table.setRowSelection(old => {
|
|
74755
|
+
const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected();
|
|
74756
|
+
const rowSelection = {
|
|
74757
|
+
...old
|
|
74758
|
+
};
|
|
74759
|
+
table.getRowModel().rows.forEach(row => {
|
|
74760
|
+
mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);
|
|
74761
|
+
});
|
|
74762
|
+
return rowSelection;
|
|
74763
|
+
});
|
|
74714
74764
|
|
|
74715
|
-
|
|
74716
|
-
|
|
74717
|
-
|
|
74718
|
-
|
|
74765
|
+
// addRowSelectionRange: rowId => {
|
|
74766
|
+
// const {
|
|
74767
|
+
// rows,
|
|
74768
|
+
// rowsById,
|
|
74769
|
+
// options: { selectGroupingRows, selectSubRows },
|
|
74770
|
+
// } = table
|
|
74771
|
+
|
|
74772
|
+
// const findSelectedRow = (rows: Row[]) => {
|
|
74773
|
+
// let found
|
|
74774
|
+
// rows.find(d => {
|
|
74775
|
+
// if (d.getIsSelected()) {
|
|
74776
|
+
// found = d
|
|
74777
|
+
// return true
|
|
74778
|
+
// }
|
|
74779
|
+
// const subFound = findSelectedRow(d.subRows || [])
|
|
74780
|
+
// if (subFound) {
|
|
74781
|
+
// found = subFound
|
|
74782
|
+
// return true
|
|
74783
|
+
// }
|
|
74784
|
+
// return false
|
|
74785
|
+
// })
|
|
74786
|
+
// return found
|
|
74787
|
+
// }
|
|
74788
|
+
|
|
74789
|
+
// const firstRow = findSelectedRow(rows) || rows[0]
|
|
74790
|
+
// const lastRow = rowsById[rowId]
|
|
74791
|
+
|
|
74792
|
+
// let include = false
|
|
74793
|
+
// const selectedRowIds = {}
|
|
74794
|
+
|
|
74795
|
+
// const addRow = (row: Row) => {
|
|
74796
|
+
// mutateRowIsSelected(selectedRowIds, row.id, true, {
|
|
74797
|
+
// rowsById,
|
|
74798
|
+
// selectGroupingRows: selectGroupingRows!,
|
|
74799
|
+
// selectSubRows: selectSubRows!,
|
|
74800
|
+
// })
|
|
74801
|
+
// }
|
|
74802
|
+
|
|
74803
|
+
// table.rows.forEach(row => {
|
|
74804
|
+
// const isFirstRow = row.id === firstRow.id
|
|
74805
|
+
// const isLastRow = row.id === lastRow.id
|
|
74806
|
+
|
|
74807
|
+
// if (isFirstRow || isLastRow) {
|
|
74808
|
+
// if (!include) {
|
|
74809
|
+
// include = true
|
|
74810
|
+
// } else if (include) {
|
|
74811
|
+
// addRow(row)
|
|
74812
|
+
// include = false
|
|
74813
|
+
// }
|
|
74814
|
+
// }
|
|
74815
|
+
|
|
74816
|
+
// if (include) {
|
|
74817
|
+
// addRow(row)
|
|
74818
|
+
// }
|
|
74819
|
+
// })
|
|
74820
|
+
|
|
74821
|
+
// table.setRowSelection(selectedRowIds)
|
|
74822
|
+
// },
|
|
74823
|
+
table.getPreSelectedRowModel = () => table.getCoreRowModel();
|
|
74824
|
+
table.getSelectedRowModel = memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
|
|
74825
|
+
if (!Object.keys(rowSelection).length) {
|
|
74826
|
+
return {
|
|
74827
|
+
rows: [],
|
|
74828
|
+
flatRows: [],
|
|
74829
|
+
rowsById: {}
|
|
74830
|
+
};
|
|
74831
|
+
}
|
|
74832
|
+
return selectRowsFn(table, rowModel);
|
|
74833
|
+
}, {
|
|
74834
|
+
key: process.env.NODE_ENV === 'development' && 'getSelectedRowModel',
|
|
74835
|
+
debug: () => {
|
|
74836
|
+
var _table$options$debugA;
|
|
74837
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
74838
|
+
}
|
|
74839
|
+
});
|
|
74840
|
+
table.getFilteredSelectedRowModel = memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
|
|
74841
|
+
if (!Object.keys(rowSelection).length) {
|
|
74842
|
+
return {
|
|
74843
|
+
rows: [],
|
|
74844
|
+
flatRows: [],
|
|
74845
|
+
rowsById: {}
|
|
74846
|
+
};
|
|
74847
|
+
}
|
|
74848
|
+
return selectRowsFn(table, rowModel);
|
|
74849
|
+
}, {
|
|
74850
|
+
key: process.env.NODE_ENV === 'production' && 'getFilteredSelectedRowModel',
|
|
74851
|
+
debug: () => {
|
|
74852
|
+
var _table$options$debugA2;
|
|
74853
|
+
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
|
|
74854
|
+
}
|
|
74855
|
+
});
|
|
74856
|
+
table.getGroupedSelectedRowModel = memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
|
|
74857
|
+
if (!Object.keys(rowSelection).length) {
|
|
74858
|
+
return {
|
|
74859
|
+
rows: [],
|
|
74860
|
+
flatRows: [],
|
|
74861
|
+
rowsById: {}
|
|
74862
|
+
};
|
|
74863
|
+
}
|
|
74864
|
+
return selectRowsFn(table, rowModel);
|
|
74865
|
+
}, {
|
|
74866
|
+
key: process.env.NODE_ENV === 'production' && 'getGroupedSelectedRowModel',
|
|
74867
|
+
debug: () => {
|
|
74868
|
+
var _table$options$debugA3;
|
|
74869
|
+
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
|
|
74870
|
+
}
|
|
74871
|
+
});
|
|
74719
74872
|
|
|
74720
|
-
|
|
74721
|
-
// },
|
|
74722
|
-
getPreSelectedRowModel: () => table.getCoreRowModel(),
|
|
74723
|
-
getSelectedRowModel: memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
|
|
74724
|
-
if (!Object.keys(rowSelection).length) {
|
|
74725
|
-
return {
|
|
74726
|
-
rows: [],
|
|
74727
|
-
flatRows: [],
|
|
74728
|
-
rowsById: {}
|
|
74729
|
-
};
|
|
74730
|
-
}
|
|
74731
|
-
return selectRowsFn(table, rowModel);
|
|
74732
|
-
}, {
|
|
74733
|
-
key: process.env.NODE_ENV === 'development' && 'getSelectedRowModel',
|
|
74734
|
-
debug: () => {
|
|
74735
|
-
var _table$options$debugA;
|
|
74736
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
74737
|
-
}
|
|
74738
|
-
}),
|
|
74739
|
-
getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
|
|
74740
|
-
if (!Object.keys(rowSelection).length) {
|
|
74741
|
-
return {
|
|
74742
|
-
rows: [],
|
|
74743
|
-
flatRows: [],
|
|
74744
|
-
rowsById: {}
|
|
74745
|
-
};
|
|
74746
|
-
}
|
|
74747
|
-
return selectRowsFn(table, rowModel);
|
|
74748
|
-
}, {
|
|
74749
|
-
key: process.env.NODE_ENV === 'production' && 'getFilteredSelectedRowModel',
|
|
74750
|
-
debug: () => {
|
|
74751
|
-
var _table$options$debugA2;
|
|
74752
|
-
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
|
|
74753
|
-
}
|
|
74754
|
-
}),
|
|
74755
|
-
getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
|
|
74756
|
-
if (!Object.keys(rowSelection).length) {
|
|
74757
|
-
return {
|
|
74758
|
-
rows: [],
|
|
74759
|
-
flatRows: [],
|
|
74760
|
-
rowsById: {}
|
|
74761
|
-
};
|
|
74762
|
-
}
|
|
74763
|
-
return selectRowsFn(table, rowModel);
|
|
74764
|
-
}, {
|
|
74765
|
-
key: process.env.NODE_ENV === 'production' && 'getGroupedSelectedRowModel',
|
|
74766
|
-
debug: () => {
|
|
74767
|
-
var _table$options$debugA3;
|
|
74768
|
-
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
|
|
74769
|
-
}
|
|
74770
|
-
}),
|
|
74771
|
-
///
|
|
74873
|
+
///
|
|
74772
74874
|
|
|
74773
|
-
|
|
74774
|
-
|
|
74875
|
+
// getGroupingRowCanSelect: rowId => {
|
|
74876
|
+
// const row = table.getRow(rowId)
|
|
74775
74877
|
|
|
74776
|
-
|
|
74777
|
-
|
|
74778
|
-
|
|
74878
|
+
// if (!row) {
|
|
74879
|
+
// throw new Error()
|
|
74880
|
+
// }
|
|
74779
74881
|
|
|
74780
|
-
|
|
74781
|
-
|
|
74782
|
-
|
|
74882
|
+
// if (typeof table.options.enableGroupingRowSelection === 'function') {
|
|
74883
|
+
// return table.options.enableGroupingRowSelection(row)
|
|
74884
|
+
// }
|
|
74783
74885
|
|
|
74784
|
-
|
|
74785
|
-
|
|
74886
|
+
// return table.options.enableGroupingRowSelection ?? false
|
|
74887
|
+
// },
|
|
74786
74888
|
|
|
74787
|
-
|
|
74788
|
-
|
|
74789
|
-
|
|
74790
|
-
|
|
74791
|
-
|
|
74792
|
-
|
|
74793
|
-
|
|
74794
|
-
|
|
74795
|
-
|
|
74796
|
-
}
|
|
74797
|
-
}
|
|
74798
|
-
return isAllRowsSelected;
|
|
74799
|
-
},
|
|
74800
|
-
getIsAllPageRowsSelected: () => {
|
|
74801
|
-
const paginationFlatRows = table.getPaginationRowModel().flatRows.filter(row => row.getCanSelect());
|
|
74802
|
-
const {
|
|
74803
|
-
rowSelection
|
|
74804
|
-
} = table.getState();
|
|
74805
|
-
let isAllPageRowsSelected = !!paginationFlatRows.length;
|
|
74806
|
-
if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) {
|
|
74807
|
-
isAllPageRowsSelected = false;
|
|
74889
|
+
table.getIsAllRowsSelected = () => {
|
|
74890
|
+
const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
|
|
74891
|
+
const {
|
|
74892
|
+
rowSelection
|
|
74893
|
+
} = table.getState();
|
|
74894
|
+
let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
|
|
74895
|
+
if (isAllRowsSelected) {
|
|
74896
|
+
if (preGroupedFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
74897
|
+
isAllRowsSelected = false;
|
|
74808
74898
|
}
|
|
74809
|
-
return isAllPageRowsSelected;
|
|
74810
|
-
},
|
|
74811
|
-
getIsSomeRowsSelected: () => {
|
|
74812
|
-
var _table$getState$rowSe;
|
|
74813
|
-
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
74814
|
-
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
74815
|
-
},
|
|
74816
|
-
getIsSomePageRowsSelected: () => {
|
|
74817
|
-
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
74818
|
-
return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter(row => row.getCanSelect()).some(d => d.getIsSelected() || d.getIsSomeSelected());
|
|
74819
|
-
},
|
|
74820
|
-
getToggleAllRowsSelectedHandler: () => {
|
|
74821
|
-
return e => {
|
|
74822
|
-
table.toggleAllRowsSelected(e.target.checked);
|
|
74823
|
-
};
|
|
74824
|
-
},
|
|
74825
|
-
getToggleAllPageRowsSelectedHandler: () => {
|
|
74826
|
-
return e => {
|
|
74827
|
-
table.toggleAllPageRowsSelected(e.target.checked);
|
|
74828
|
-
};
|
|
74829
74899
|
}
|
|
74900
|
+
return isAllRowsSelected;
|
|
74901
|
+
};
|
|
74902
|
+
table.getIsAllPageRowsSelected = () => {
|
|
74903
|
+
const paginationFlatRows = table.getPaginationRowModel().flatRows.filter(row => row.getCanSelect());
|
|
74904
|
+
const {
|
|
74905
|
+
rowSelection
|
|
74906
|
+
} = table.getState();
|
|
74907
|
+
let isAllPageRowsSelected = !!paginationFlatRows.length;
|
|
74908
|
+
if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) {
|
|
74909
|
+
isAllPageRowsSelected = false;
|
|
74910
|
+
}
|
|
74911
|
+
return isAllPageRowsSelected;
|
|
74912
|
+
};
|
|
74913
|
+
table.getIsSomeRowsSelected = () => {
|
|
74914
|
+
var _table$getState$rowSe;
|
|
74915
|
+
const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
|
|
74916
|
+
return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
|
|
74917
|
+
};
|
|
74918
|
+
table.getIsSomePageRowsSelected = () => {
|
|
74919
|
+
const paginationFlatRows = table.getPaginationRowModel().flatRows;
|
|
74920
|
+
return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter(row => row.getCanSelect()).some(d => d.getIsSelected() || d.getIsSomeSelected());
|
|
74921
|
+
};
|
|
74922
|
+
table.getToggleAllRowsSelectedHandler = () => {
|
|
74923
|
+
return e => {
|
|
74924
|
+
table.toggleAllRowsSelected(e.target.checked);
|
|
74925
|
+
};
|
|
74926
|
+
};
|
|
74927
|
+
table.getToggleAllPageRowsSelectedHandler = () => {
|
|
74928
|
+
return e => {
|
|
74929
|
+
table.toggleAllPageRowsSelected(e.target.checked);
|
|
74930
|
+
};
|
|
74830
74931
|
};
|
|
74831
74932
|
},
|
|
74832
74933
|
createRow: (row, table) => {
|
|
74833
|
-
|
|
74834
|
-
|
|
74835
|
-
|
|
74836
|
-
|
|
74837
|
-
|
|
74838
|
-
|
|
74839
|
-
|
|
74840
|
-
}
|
|
74841
|
-
const selectedRowIds = {
|
|
74842
|
-
...old
|
|
74843
|
-
};
|
|
74844
|
-
mutateRowIsSelected(selectedRowIds, row.id, value, table);
|
|
74845
|
-
return selectedRowIds;
|
|
74846
|
-
});
|
|
74847
|
-
},
|
|
74848
|
-
getIsSelected: () => {
|
|
74849
|
-
const {
|
|
74850
|
-
rowSelection
|
|
74851
|
-
} = table.getState();
|
|
74852
|
-
return isRowSelected(row, rowSelection);
|
|
74853
|
-
},
|
|
74854
|
-
getIsSomeSelected: () => {
|
|
74855
|
-
const {
|
|
74856
|
-
rowSelection
|
|
74857
|
-
} = table.getState();
|
|
74858
|
-
return isSubRowSelected(row, rowSelection) === 'some';
|
|
74859
|
-
},
|
|
74860
|
-
getIsAllSubRowsSelected: () => {
|
|
74861
|
-
const {
|
|
74862
|
-
rowSelection
|
|
74863
|
-
} = table.getState();
|
|
74864
|
-
return isSubRowSelected(row, rowSelection) === 'all';
|
|
74865
|
-
},
|
|
74866
|
-
getCanSelect: () => {
|
|
74867
|
-
var _table$options$enable;
|
|
74868
|
-
if (typeof table.options.enableRowSelection === 'function') {
|
|
74869
|
-
return table.options.enableRowSelection(row);
|
|
74870
|
-
}
|
|
74871
|
-
return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
|
|
74872
|
-
},
|
|
74873
|
-
getCanSelectSubRows: () => {
|
|
74874
|
-
var _table$options$enable2;
|
|
74875
|
-
if (typeof table.options.enableSubRowSelection === 'function') {
|
|
74876
|
-
return table.options.enableSubRowSelection(row);
|
|
74877
|
-
}
|
|
74878
|
-
return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
|
|
74879
|
-
},
|
|
74880
|
-
getCanMultiSelect: () => {
|
|
74881
|
-
var _table$options$enable3;
|
|
74882
|
-
if (typeof table.options.enableMultiRowSelection === 'function') {
|
|
74883
|
-
return table.options.enableMultiRowSelection(row);
|
|
74934
|
+
row.toggleSelected = (value, opts) => {
|
|
74935
|
+
const isSelected = row.getIsSelected();
|
|
74936
|
+
table.setRowSelection(old => {
|
|
74937
|
+
var _opts$selectChildren;
|
|
74938
|
+
value = typeof value !== 'undefined' ? value : !isSelected;
|
|
74939
|
+
if (row.getCanSelect() && isSelected === value) {
|
|
74940
|
+
return old;
|
|
74884
74941
|
}
|
|
74885
|
-
|
|
74886
|
-
|
|
74887
|
-
getToggleSelectedHandler: () => {
|
|
74888
|
-
const canSelect = row.getCanSelect();
|
|
74889
|
-
return e => {
|
|
74890
|
-
var _target;
|
|
74891
|
-
if (!canSelect) return;
|
|
74892
|
-
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
74942
|
+
const selectedRowIds = {
|
|
74943
|
+
...old
|
|
74893
74944
|
};
|
|
74945
|
+
mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
|
|
74946
|
+
return selectedRowIds;
|
|
74947
|
+
});
|
|
74948
|
+
};
|
|
74949
|
+
row.getIsSelected = () => {
|
|
74950
|
+
const {
|
|
74951
|
+
rowSelection
|
|
74952
|
+
} = table.getState();
|
|
74953
|
+
return isRowSelected(row, rowSelection);
|
|
74954
|
+
};
|
|
74955
|
+
row.getIsSomeSelected = () => {
|
|
74956
|
+
const {
|
|
74957
|
+
rowSelection
|
|
74958
|
+
} = table.getState();
|
|
74959
|
+
return isSubRowSelected(row, rowSelection) === 'some';
|
|
74960
|
+
};
|
|
74961
|
+
row.getIsAllSubRowsSelected = () => {
|
|
74962
|
+
const {
|
|
74963
|
+
rowSelection
|
|
74964
|
+
} = table.getState();
|
|
74965
|
+
return isSubRowSelected(row, rowSelection) === 'all';
|
|
74966
|
+
};
|
|
74967
|
+
row.getCanSelect = () => {
|
|
74968
|
+
var _table$options$enable;
|
|
74969
|
+
if (typeof table.options.enableRowSelection === 'function') {
|
|
74970
|
+
return table.options.enableRowSelection(row);
|
|
74894
74971
|
}
|
|
74972
|
+
return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
|
|
74973
|
+
};
|
|
74974
|
+
row.getCanSelectSubRows = () => {
|
|
74975
|
+
var _table$options$enable2;
|
|
74976
|
+
if (typeof table.options.enableSubRowSelection === 'function') {
|
|
74977
|
+
return table.options.enableSubRowSelection(row);
|
|
74978
|
+
}
|
|
74979
|
+
return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
|
|
74980
|
+
};
|
|
74981
|
+
row.getCanMultiSelect = () => {
|
|
74982
|
+
var _table$options$enable3;
|
|
74983
|
+
if (typeof table.options.enableMultiRowSelection === 'function') {
|
|
74984
|
+
return table.options.enableMultiRowSelection(row);
|
|
74985
|
+
}
|
|
74986
|
+
return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
|
|
74987
|
+
};
|
|
74988
|
+
row.getToggleSelectedHandler = () => {
|
|
74989
|
+
const canSelect = row.getCanSelect();
|
|
74990
|
+
return e => {
|
|
74991
|
+
var _target;
|
|
74992
|
+
if (!canSelect) return;
|
|
74993
|
+
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
74994
|
+
};
|
|
74895
74995
|
};
|
|
74896
74996
|
}
|
|
74897
74997
|
};
|
|
74898
|
-
const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
|
|
74998
|
+
const mutateRowIsSelected = (selectedRowIds, id, value, includeChildren, table) => {
|
|
74899
74999
|
var _row$subRows;
|
|
74900
75000
|
const row = table.getRow(id);
|
|
74901
75001
|
|
|
@@ -74917,8 +75017,8 @@ const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
|
|
|
74917
75017
|
}
|
|
74918
75018
|
// }
|
|
74919
75019
|
|
|
74920
|
-
if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
|
|
74921
|
-
row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table));
|
|
75020
|
+
if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
|
|
75021
|
+
row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, includeChildren, table));
|
|
74922
75022
|
}
|
|
74923
75023
|
};
|
|
74924
75024
|
function selectRowsFn(table, rowModel) {
|
|
@@ -74957,23 +75057,37 @@ function isRowSelected(row, selection) {
|
|
|
74957
75057
|
return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
|
|
74958
75058
|
}
|
|
74959
75059
|
function isSubRowSelected(row, selection, table) {
|
|
74960
|
-
|
|
74961
|
-
|
|
74962
|
-
|
|
74963
|
-
|
|
74964
|
-
|
|
74965
|
-
|
|
74966
|
-
|
|
74967
|
-
|
|
75060
|
+
var _row$subRows3;
|
|
75061
|
+
if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length)) return false;
|
|
75062
|
+
let allChildrenSelected = true;
|
|
75063
|
+
let someSelected = false;
|
|
75064
|
+
row.subRows.forEach(subRow => {
|
|
75065
|
+
// Bail out early if we know both of these
|
|
75066
|
+
if (someSelected && !allChildrenSelected) {
|
|
75067
|
+
return;
|
|
75068
|
+
}
|
|
75069
|
+
if (subRow.getCanSelect()) {
|
|
74968
75070
|
if (isRowSelected(subRow, selection)) {
|
|
74969
75071
|
someSelected = true;
|
|
74970
75072
|
} else {
|
|
74971
75073
|
allChildrenSelected = false;
|
|
74972
75074
|
}
|
|
74973
|
-
}
|
|
74974
|
-
|
|
74975
|
-
|
|
74976
|
-
|
|
75075
|
+
}
|
|
75076
|
+
|
|
75077
|
+
// Check row selection of nested subrows
|
|
75078
|
+
if (subRow.subRows && subRow.subRows.length) {
|
|
75079
|
+
const subRowChildrenSelected = isSubRowSelected(subRow, selection);
|
|
75080
|
+
if (subRowChildrenSelected === 'all') {
|
|
75081
|
+
someSelected = true;
|
|
75082
|
+
} else if (subRowChildrenSelected === 'some') {
|
|
75083
|
+
someSelected = true;
|
|
75084
|
+
allChildrenSelected = false;
|
|
75085
|
+
} else {
|
|
75086
|
+
allChildrenSelected = false;
|
|
75087
|
+
}
|
|
75088
|
+
}
|
|
75089
|
+
});
|
|
75090
|
+
return allChildrenSelected ? 'all' : someSelected ? 'some' : false;
|
|
74977
75091
|
}
|
|
74978
75092
|
|
|
74979
75093
|
const reSplitAlphaNumeric = /([0-9]+)/gm;
|
|
@@ -75105,191 +75219,187 @@ const Sorting = {
|
|
|
75105
75219
|
};
|
|
75106
75220
|
},
|
|
75107
75221
|
createColumn: (column, table) => {
|
|
75108
|
-
|
|
75109
|
-
|
|
75110
|
-
|
|
75111
|
-
|
|
75112
|
-
|
|
75113
|
-
|
|
75114
|
-
|
|
75115
|
-
return sortingFns.datetime;
|
|
75116
|
-
}
|
|
75117
|
-
if (typeof value === 'string') {
|
|
75118
|
-
isString = true;
|
|
75119
|
-
if (value.split(reSplitAlphaNumeric).length > 1) {
|
|
75120
|
-
return sortingFns.alphanumeric;
|
|
75121
|
-
}
|
|
75122
|
-
}
|
|
75123
|
-
}
|
|
75124
|
-
if (isString) {
|
|
75125
|
-
return sortingFns.text;
|
|
75222
|
+
column.getAutoSortingFn = () => {
|
|
75223
|
+
const firstRows = table.getFilteredRowModel().flatRows.slice(10);
|
|
75224
|
+
let isString = false;
|
|
75225
|
+
for (const row of firstRows) {
|
|
75226
|
+
const value = row == null ? void 0 : row.getValue(column.id);
|
|
75227
|
+
if (Object.prototype.toString.call(value) === '[object Date]') {
|
|
75228
|
+
return sortingFns.datetime;
|
|
75126
75229
|
}
|
|
75127
|
-
return sortingFns.basic;
|
|
75128
|
-
},
|
|
75129
|
-
getAutoSortDir: () => {
|
|
75130
|
-
const firstRow = table.getFilteredRowModel().flatRows[0];
|
|
75131
|
-
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
75132
75230
|
if (typeof value === 'string') {
|
|
75133
|
-
|
|
75134
|
-
|
|
75135
|
-
|
|
75136
|
-
|
|
75137
|
-
getSortingFn: () => {
|
|
75138
|
-
var _table$options$sortin, _table$options$sortin2;
|
|
75139
|
-
if (!column) {
|
|
75140
|
-
throw new Error();
|
|
75231
|
+
isString = true;
|
|
75232
|
+
if (value.split(reSplitAlphaNumeric).length > 1) {
|
|
75233
|
+
return sortingFns.alphanumeric;
|
|
75234
|
+
}
|
|
75141
75235
|
}
|
|
75142
|
-
|
|
75143
|
-
|
|
75144
|
-
|
|
75145
|
-
|
|
75146
|
-
|
|
75147
|
-
|
|
75148
|
-
|
|
75149
|
-
|
|
75150
|
-
|
|
75151
|
-
|
|
75152
|
-
|
|
75153
|
-
|
|
75154
|
-
|
|
75155
|
-
|
|
75156
|
-
|
|
75157
|
-
|
|
75158
|
-
|
|
75159
|
-
|
|
75160
|
-
|
|
75161
|
-
|
|
75162
|
-
|
|
75163
|
-
|
|
75164
|
-
|
|
75165
|
-
|
|
75166
|
-
|
|
75167
|
-
|
|
75168
|
-
|
|
75169
|
-
|
|
75170
|
-
|
|
75171
|
-
|
|
75172
|
-
|
|
75173
|
-
|
|
75236
|
+
}
|
|
75237
|
+
if (isString) {
|
|
75238
|
+
return sortingFns.text;
|
|
75239
|
+
}
|
|
75240
|
+
return sortingFns.basic;
|
|
75241
|
+
};
|
|
75242
|
+
column.getAutoSortDir = () => {
|
|
75243
|
+
const firstRow = table.getFilteredRowModel().flatRows[0];
|
|
75244
|
+
const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
|
|
75245
|
+
if (typeof value === 'string') {
|
|
75246
|
+
return 'asc';
|
|
75247
|
+
}
|
|
75248
|
+
return 'desc';
|
|
75249
|
+
};
|
|
75250
|
+
column.getSortingFn = () => {
|
|
75251
|
+
var _table$options$sortin, _table$options$sortin2;
|
|
75252
|
+
if (!column) {
|
|
75253
|
+
throw new Error();
|
|
75254
|
+
}
|
|
75255
|
+
return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
|
|
75256
|
+
};
|
|
75257
|
+
column.toggleSorting = (desc, multi) => {
|
|
75258
|
+
// if (column.columns.length) {
|
|
75259
|
+
// column.columns.forEach((c, i) => {
|
|
75260
|
+
// if (c.id) {
|
|
75261
|
+
// table.toggleColumnSorting(c.id, undefined, multi || !!i)
|
|
75262
|
+
// }
|
|
75263
|
+
// })
|
|
75264
|
+
// return
|
|
75265
|
+
// }
|
|
75266
|
+
|
|
75267
|
+
// this needs to be outside of table.setSorting to be in sync with rerender
|
|
75268
|
+
const nextSortingOrder = column.getNextSortingOrder();
|
|
75269
|
+
const hasManualValue = typeof desc !== 'undefined' && desc !== null;
|
|
75270
|
+
table.setSorting(old => {
|
|
75271
|
+
// Find any existing sorting for this column
|
|
75272
|
+
const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
|
|
75273
|
+
const existingIndex = old == null ? void 0 : old.findIndex(d => d.id === column.id);
|
|
75274
|
+
let newSorting = [];
|
|
75275
|
+
|
|
75276
|
+
// What should we do with this sort action?
|
|
75277
|
+
let sortAction;
|
|
75278
|
+
let nextDesc = hasManualValue ? desc : nextSortingOrder === 'desc';
|
|
75279
|
+
|
|
75280
|
+
// Multi-mode
|
|
75281
|
+
if (old != null && old.length && column.getCanMultiSort() && multi) {
|
|
75282
|
+
if (existingSorting) {
|
|
75283
|
+
sortAction = 'toggle';
|
|
75174
75284
|
} else {
|
|
75175
|
-
|
|
75176
|
-
|
|
75177
|
-
|
|
75178
|
-
|
|
75179
|
-
|
|
75180
|
-
|
|
75181
|
-
|
|
75182
|
-
|
|
75285
|
+
sortAction = 'add';
|
|
75286
|
+
}
|
|
75287
|
+
} else {
|
|
75288
|
+
// Normal mode
|
|
75289
|
+
if (old != null && old.length && existingIndex !== old.length - 1) {
|
|
75290
|
+
sortAction = 'replace';
|
|
75291
|
+
} else if (existingSorting) {
|
|
75292
|
+
sortAction = 'toggle';
|
|
75293
|
+
} else {
|
|
75294
|
+
sortAction = 'replace';
|
|
75183
75295
|
}
|
|
75296
|
+
}
|
|
75184
75297
|
|
|
75185
|
-
|
|
75186
|
-
|
|
75187
|
-
|
|
75188
|
-
|
|
75189
|
-
|
|
75190
|
-
|
|
75191
|
-
|
|
75192
|
-
}
|
|
75298
|
+
// Handle toggle states that will remove the sorting
|
|
75299
|
+
if (sortAction === 'toggle') {
|
|
75300
|
+
// If we are "actually" toggling (not a manual set value), should we remove the sorting?
|
|
75301
|
+
if (!hasManualValue) {
|
|
75302
|
+
// Is our intention to remove?
|
|
75303
|
+
if (!nextSortingOrder) {
|
|
75304
|
+
sortAction = 'remove';
|
|
75193
75305
|
}
|
|
75194
75306
|
}
|
|
75195
|
-
if (sortAction === 'add') {
|
|
75196
|
-
var _table$options$maxMul;
|
|
75197
|
-
newSorting = [...old, {
|
|
75198
|
-
id: column.id,
|
|
75199
|
-
desc: nextDesc
|
|
75200
|
-
}];
|
|
75201
|
-
// Take latest n columns
|
|
75202
|
-
newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
|
|
75203
|
-
} else if (sortAction === 'toggle') {
|
|
75204
|
-
// This flips (or sets) the
|
|
75205
|
-
newSorting = old.map(d => {
|
|
75206
|
-
if (d.id === column.id) {
|
|
75207
|
-
return {
|
|
75208
|
-
...d,
|
|
75209
|
-
desc: nextDesc
|
|
75210
|
-
};
|
|
75211
|
-
}
|
|
75212
|
-
return d;
|
|
75213
|
-
});
|
|
75214
|
-
} else if (sortAction === 'remove') {
|
|
75215
|
-
newSorting = old.filter(d => d.id !== column.id);
|
|
75216
|
-
} else {
|
|
75217
|
-
newSorting = [{
|
|
75218
|
-
id: column.id,
|
|
75219
|
-
desc: nextDesc
|
|
75220
|
-
}];
|
|
75221
|
-
}
|
|
75222
|
-
return newSorting;
|
|
75223
|
-
});
|
|
75224
|
-
},
|
|
75225
|
-
getFirstSortDir: () => {
|
|
75226
|
-
var _ref, _column$columnDef$sor;
|
|
75227
|
-
const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
|
|
75228
|
-
return sortDescFirst ? 'desc' : 'asc';
|
|
75229
|
-
},
|
|
75230
|
-
getNextSortingOrder: multi => {
|
|
75231
|
-
var _table$options$enable, _table$options$enable2;
|
|
75232
|
-
const firstSortDirection = column.getFirstSortDir();
|
|
75233
|
-
const isSorted = column.getIsSorted();
|
|
75234
|
-
if (!isSorted) {
|
|
75235
|
-
return firstSortDirection;
|
|
75236
75307
|
}
|
|
75237
|
-
if (
|
|
75238
|
-
|
|
75239
|
-
|
|
75240
|
-
|
|
75241
|
-
|
|
75308
|
+
if (sortAction === 'add') {
|
|
75309
|
+
var _table$options$maxMul;
|
|
75310
|
+
newSorting = [...old, {
|
|
75311
|
+
id: column.id,
|
|
75312
|
+
desc: nextDesc
|
|
75313
|
+
}];
|
|
75314
|
+
// Take latest n columns
|
|
75315
|
+
newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
|
|
75316
|
+
} else if (sortAction === 'toggle') {
|
|
75317
|
+
// This flips (or sets) the
|
|
75318
|
+
newSorting = old.map(d => {
|
|
75319
|
+
if (d.id === column.id) {
|
|
75320
|
+
return {
|
|
75321
|
+
...d,
|
|
75322
|
+
desc: nextDesc
|
|
75323
|
+
};
|
|
75324
|
+
}
|
|
75325
|
+
return d;
|
|
75326
|
+
});
|
|
75327
|
+
} else if (sortAction === 'remove') {
|
|
75328
|
+
newSorting = old.filter(d => d.id !== column.id);
|
|
75329
|
+
} else {
|
|
75330
|
+
newSorting = [{
|
|
75331
|
+
id: column.id,
|
|
75332
|
+
desc: nextDesc
|
|
75333
|
+
}];
|
|
75242
75334
|
}
|
|
75243
|
-
return
|
|
75244
|
-
}
|
|
75245
|
-
|
|
75246
|
-
|
|
75247
|
-
|
|
75248
|
-
|
|
75249
|
-
|
|
75250
|
-
|
|
75251
|
-
|
|
75252
|
-
|
|
75253
|
-
|
|
75254
|
-
|
|
75255
|
-
|
|
75256
|
-
return
|
|
75257
|
-
}
|
|
75258
|
-
|
|
75259
|
-
|
|
75260
|
-
|
|
75261
|
-
|
|
75262
|
-
|
|
75263
|
-
//clear sorting for just 1 column
|
|
75264
|
-
table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
|
|
75265
|
-
},
|
|
75266
|
-
getToggleSortingHandler: () => {
|
|
75267
|
-
const canSort = column.getCanSort();
|
|
75268
|
-
return e => {
|
|
75269
|
-
if (!canSort) return;
|
|
75270
|
-
e.persist == null ? void 0 : e.persist();
|
|
75271
|
-
column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
|
|
75272
|
-
};
|
|
75335
|
+
return newSorting;
|
|
75336
|
+
});
|
|
75337
|
+
};
|
|
75338
|
+
column.getFirstSortDir = () => {
|
|
75339
|
+
var _ref, _column$columnDef$sor;
|
|
75340
|
+
const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
|
|
75341
|
+
return sortDescFirst ? 'desc' : 'asc';
|
|
75342
|
+
};
|
|
75343
|
+
column.getNextSortingOrder = multi => {
|
|
75344
|
+
var _table$options$enable, _table$options$enable2;
|
|
75345
|
+
const firstSortDirection = column.getFirstSortDir();
|
|
75346
|
+
const isSorted = column.getIsSorted();
|
|
75347
|
+
if (!isSorted) {
|
|
75348
|
+
return firstSortDirection;
|
|
75349
|
+
}
|
|
75350
|
+
if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (
|
|
75351
|
+
// If enableSortRemove, enable in general
|
|
75352
|
+
multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))
|
|
75353
|
+
) {
|
|
75354
|
+
return false;
|
|
75273
75355
|
}
|
|
75356
|
+
return isSorted === 'desc' ? 'asc' : 'desc';
|
|
75357
|
+
};
|
|
75358
|
+
column.getCanSort = () => {
|
|
75359
|
+
var _column$columnDef$ena, _table$options$enable3;
|
|
75360
|
+
return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column.accessorFn;
|
|
75361
|
+
};
|
|
75362
|
+
column.getCanMultiSort = () => {
|
|
75363
|
+
var _ref2, _column$columnDef$ena2;
|
|
75364
|
+
return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
|
|
75365
|
+
};
|
|
75366
|
+
column.getIsSorted = () => {
|
|
75367
|
+
var _table$getState$sorti;
|
|
75368
|
+
const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);
|
|
75369
|
+
return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
|
|
75370
|
+
};
|
|
75371
|
+
column.getSortIndex = () => {
|
|
75372
|
+
var _table$getState$sorti2, _table$getState$sorti3;
|
|
75373
|
+
return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex(d => d.id === column.id)) != null ? _table$getState$sorti2 : -1;
|
|
75374
|
+
};
|
|
75375
|
+
column.clearSorting = () => {
|
|
75376
|
+
//clear sorting for just 1 column
|
|
75377
|
+
table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
|
|
75378
|
+
};
|
|
75379
|
+
column.getToggleSortingHandler = () => {
|
|
75380
|
+
const canSort = column.getCanSort();
|
|
75381
|
+
return e => {
|
|
75382
|
+
if (!canSort) return;
|
|
75383
|
+
e.persist == null || e.persist();
|
|
75384
|
+
column.toggleSorting == null || column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
|
|
75385
|
+
};
|
|
75274
75386
|
};
|
|
75275
75387
|
},
|
|
75276
75388
|
createTable: table => {
|
|
75277
|
-
|
|
75278
|
-
|
|
75279
|
-
|
|
75280
|
-
|
|
75281
|
-
|
|
75282
|
-
|
|
75283
|
-
|
|
75284
|
-
|
|
75285
|
-
|
|
75286
|
-
|
|
75287
|
-
|
|
75288
|
-
|
|
75289
|
-
return table.getPreSortedRowModel();
|
|
75290
|
-
}
|
|
75291
|
-
return table._getSortedRowModel();
|
|
75389
|
+
table.setSorting = updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater);
|
|
75390
|
+
table.resetSorting = defaultState => {
|
|
75391
|
+
var _table$initialState$s, _table$initialState;
|
|
75392
|
+
table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
|
|
75393
|
+
};
|
|
75394
|
+
table.getPreSortedRowModel = () => table.getGroupedRowModel();
|
|
75395
|
+
table.getSortedRowModel = () => {
|
|
75396
|
+
if (!table._getSortedRowModel && table.options.getSortedRowModel) {
|
|
75397
|
+
table._getSortedRowModel = table.options.getSortedRowModel(table);
|
|
75398
|
+
}
|
|
75399
|
+
if (table.options.manualSorting || !table._getSortedRowModel) {
|
|
75400
|
+
return table.getPreSortedRowModel();
|
|
75292
75401
|
}
|
|
75402
|
+
return table._getSortedRowModel();
|
|
75293
75403
|
};
|
|
75294
75404
|
}
|
|
75295
75405
|
};
|
|
@@ -75309,49 +75419,45 @@ const Visibility = {
|
|
|
75309
75419
|
};
|
|
75310
75420
|
},
|
|
75311
75421
|
createColumn: (column, table) => {
|
|
75312
|
-
|
|
75313
|
-
|
|
75314
|
-
|
|
75315
|
-
|
|
75316
|
-
|
|
75317
|
-
|
|
75318
|
-
}));
|
|
75319
|
-
}
|
|
75320
|
-
},
|
|
75321
|
-
getIsVisible: () => {
|
|
75322
|
-
var _table$getState$colum, _table$getState$colum2;
|
|
75323
|
-
return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
|
|
75324
|
-
},
|
|
75325
|
-
getCanHide: () => {
|
|
75326
|
-
var _column$columnDef$ena, _table$options$enable;
|
|
75327
|
-
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
|
|
75328
|
-
},
|
|
75329
|
-
getToggleVisibilityHandler: () => {
|
|
75330
|
-
return e => {
|
|
75331
|
-
column.toggleVisibility == null ? void 0 : column.toggleVisibility(e.target.checked);
|
|
75332
|
-
};
|
|
75422
|
+
column.toggleVisibility = value => {
|
|
75423
|
+
if (column.getCanHide()) {
|
|
75424
|
+
table.setColumnVisibility(old => ({
|
|
75425
|
+
...old,
|
|
75426
|
+
[column.id]: value != null ? value : !column.getIsVisible()
|
|
75427
|
+
}));
|
|
75333
75428
|
}
|
|
75334
75429
|
};
|
|
75430
|
+
column.getIsVisible = () => {
|
|
75431
|
+
var _table$getState$colum, _table$getState$colum2;
|
|
75432
|
+
return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
|
|
75433
|
+
};
|
|
75434
|
+
column.getCanHide = () => {
|
|
75435
|
+
var _column$columnDef$ena, _table$options$enable;
|
|
75436
|
+
return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
|
|
75437
|
+
};
|
|
75438
|
+
column.getToggleVisibilityHandler = () => {
|
|
75439
|
+
return e => {
|
|
75440
|
+
column.toggleVisibility == null || column.toggleVisibility(e.target.checked);
|
|
75441
|
+
};
|
|
75442
|
+
};
|
|
75335
75443
|
},
|
|
75336
75444
|
createRow: (row, table) => {
|
|
75337
|
-
|
|
75338
|
-
|
|
75339
|
-
|
|
75340
|
-
|
|
75341
|
-
|
|
75342
|
-
|
|
75343
|
-
|
|
75344
|
-
|
|
75345
|
-
|
|
75346
|
-
|
|
75347
|
-
|
|
75348
|
-
|
|
75349
|
-
|
|
75350
|
-
|
|
75351
|
-
|
|
75352
|
-
|
|
75353
|
-
})
|
|
75354
|
-
};
|
|
75445
|
+
row._getAllVisibleCells = memo(() => [row.getAllCells(), table.getState().columnVisibility], cells => {
|
|
75446
|
+
return cells.filter(cell => cell.column.getIsVisible());
|
|
75447
|
+
}, {
|
|
75448
|
+
key: process.env.NODE_ENV === 'production' && 'row._getAllVisibleCells',
|
|
75449
|
+
debug: () => {
|
|
75450
|
+
var _table$options$debugA;
|
|
75451
|
+
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
|
|
75452
|
+
}
|
|
75453
|
+
});
|
|
75454
|
+
row.getVisibleCells = memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
|
|
75455
|
+
key: process.env.NODE_ENV === 'development' && 'row.getVisibleCells',
|
|
75456
|
+
debug: () => {
|
|
75457
|
+
var _table$options$debugA2;
|
|
75458
|
+
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
|
|
75459
|
+
}
|
|
75460
|
+
});
|
|
75355
75461
|
},
|
|
75356
75462
|
createTable: table => {
|
|
75357
75463
|
const makeVisibleColumnsMethod = (key, getColumns) => {
|
|
@@ -75365,33 +75471,31 @@ const Visibility = {
|
|
|
75365
75471
|
}
|
|
75366
75472
|
});
|
|
75367
75473
|
};
|
|
75368
|
-
|
|
75369
|
-
|
|
75370
|
-
|
|
75371
|
-
|
|
75372
|
-
|
|
75373
|
-
|
|
75374
|
-
|
|
75375
|
-
|
|
75376
|
-
|
|
75377
|
-
|
|
75378
|
-
|
|
75379
|
-
|
|
75380
|
-
|
|
75381
|
-
|
|
75382
|
-
|
|
75383
|
-
|
|
75384
|
-
|
|
75385
|
-
|
|
75386
|
-
|
|
75387
|
-
|
|
75388
|
-
|
|
75389
|
-
|
|
75390
|
-
|
|
75391
|
-
|
|
75392
|
-
|
|
75393
|
-
};
|
|
75394
|
-
}
|
|
75474
|
+
table.getVisibleFlatColumns = makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns());
|
|
75475
|
+
table.getVisibleLeafColumns = makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns());
|
|
75476
|
+
table.getLeftVisibleLeafColumns = makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns());
|
|
75477
|
+
table.getRightVisibleLeafColumns = makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns());
|
|
75478
|
+
table.getCenterVisibleLeafColumns = makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns());
|
|
75479
|
+
table.setColumnVisibility = updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater);
|
|
75480
|
+
table.resetColumnVisibility = defaultState => {
|
|
75481
|
+
var _table$initialState$c;
|
|
75482
|
+
table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
|
|
75483
|
+
};
|
|
75484
|
+
table.toggleAllColumnsVisible = value => {
|
|
75485
|
+
var _value;
|
|
75486
|
+
value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
|
|
75487
|
+
table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
|
|
75488
|
+
...obj,
|
|
75489
|
+
[column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
|
|
75490
|
+
}), {}));
|
|
75491
|
+
};
|
|
75492
|
+
table.getIsAllColumnsVisible = () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible()));
|
|
75493
|
+
table.getIsSomeColumnsVisible = () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible());
|
|
75494
|
+
table.getToggleAllColumnsVisibilityHandler = () => {
|
|
75495
|
+
return e => {
|
|
75496
|
+
var _target;
|
|
75497
|
+
table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
|
|
75498
|
+
};
|
|
75395
75499
|
};
|
|
75396
75500
|
}
|
|
75397
75501
|
};
|
|
@@ -75466,7 +75570,7 @@ function createTable(options) {
|
|
|
75466
75570
|
return table.options.state;
|
|
75467
75571
|
},
|
|
75468
75572
|
setState: updater => {
|
|
75469
|
-
table.options.onStateChange == null
|
|
75573
|
+
table.options.onStateChange == null || table.options.onStateChange(updater);
|
|
75470
75574
|
},
|
|
75471
75575
|
_getRowId: (row, index, parent) => {
|
|
75472
75576
|
var _table$options$getRow;
|
|
@@ -75484,8 +75588,8 @@ function createTable(options) {
|
|
|
75484
75588
|
getRowModel: () => {
|
|
75485
75589
|
return table.getPaginationRowModel();
|
|
75486
75590
|
},
|
|
75487
|
-
getRow: id => {
|
|
75488
|
-
const row = table.getRowModel().rowsById[id];
|
|
75591
|
+
getRow: (id, searchAll) => {
|
|
75592
|
+
const row = (searchAll ? table.getCoreRowModel() : table.getRowModel()).rowsById[id];
|
|
75489
75593
|
if (!row) {
|
|
75490
75594
|
if (process.env.NODE_ENV !== 'production') {
|
|
75491
75595
|
throw new Error(`getRow expected an ID, but got ${id}`);
|
|
@@ -75511,7 +75615,7 @@ function createTable(options) {
|
|
|
75511
75615
|
// footer: props => props.header.column.id,
|
|
75512
75616
|
cell: props => {
|
|
75513
75617
|
var _props$renderValue$to, _props$renderValue;
|
|
75514
|
-
return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null
|
|
75618
|
+
return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null || _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
|
|
75515
75619
|
},
|
|
75516
75620
|
...table._features.reduce((obj, feature) => {
|
|
75517
75621
|
return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
|
|
@@ -75588,9 +75692,10 @@ function createTable(options) {
|
|
|
75588
75692
|
}
|
|
75589
75693
|
};
|
|
75590
75694
|
Object.assign(table, coreInstance);
|
|
75591
|
-
table._features.
|
|
75592
|
-
|
|
75593
|
-
|
|
75695
|
+
for (let index = 0; index < table._features.length; index++) {
|
|
75696
|
+
const feature = table._features[index];
|
|
75697
|
+
feature == null || feature.createTable == null || feature.createTable(table);
|
|
75698
|
+
}
|
|
75594
75699
|
return table;
|
|
75595
75700
|
}
|
|
75596
75701
|
|
|
@@ -75618,7 +75723,7 @@ function createCell(table, row, column, columnId) {
|
|
|
75618
75723
|
})
|
|
75619
75724
|
};
|
|
75620
75725
|
table._features.forEach(feature => {
|
|
75621
|
-
|
|
75726
|
+
feature.createCell == null || feature.createCell(cell, column, row, table);
|
|
75622
75727
|
}, {});
|
|
75623
75728
|
return cell;
|
|
75624
75729
|
}
|
|
@@ -75664,7 +75769,7 @@ const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
75664
75769
|
},
|
|
75665
75770
|
subRows: subRows != null ? subRows : [],
|
|
75666
75771
|
getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
|
|
75667
|
-
getParentRow: () => row.parentId ? table.getRow(row.parentId) : undefined,
|
|
75772
|
+
getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : undefined,
|
|
75668
75773
|
getParentRows: () => {
|
|
75669
75774
|
let parentRows = [];
|
|
75670
75775
|
let currentRow = row;
|
|
@@ -75702,7 +75807,7 @@ const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
75702
75807
|
};
|
|
75703
75808
|
for (let i = 0; i < table._features.length; i++) {
|
|
75704
75809
|
const feature = table._features[i];
|
|
75705
|
-
|
|
75810
|
+
feature == null || feature.createRow == null || feature.createRow(row, table);
|
|
75706
75811
|
}
|
|
75707
75812
|
return row;
|
|
75708
75813
|
};
|
|
@@ -75790,7 +75895,9 @@ function getSortedRowModel() {
|
|
|
75790
75895
|
const sortData = rows => {
|
|
75791
75896
|
// This will also perform a stable sorting using the row index
|
|
75792
75897
|
// if needed.
|
|
75793
|
-
const sortedData =
|
|
75898
|
+
const sortedData = rows.map(row => ({
|
|
75899
|
+
...row
|
|
75900
|
+
}));
|
|
75794
75901
|
sortedData.sort((rowA, rowB) => {
|
|
75795
75902
|
for (let i = 0; i < availableSorting.length; i += 1) {
|
|
75796
75903
|
var _sortEntry$desc;
|
|
@@ -75866,7 +75973,9 @@ function getSortedRowModel() {
|
|
|
75866
75973
|
*/
|
|
75867
75974
|
|
|
75868
75975
|
//
|
|
75869
|
-
|
|
75976
|
+
/**
|
|
75977
|
+
* If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.
|
|
75978
|
+
*/
|
|
75870
75979
|
function flexRender(Comp, props) {
|
|
75871
75980
|
return !Comp ? null : isReactComponent(Comp) ? /*#__PURE__*/t.createElement(Comp, props) : Comp;
|
|
75872
75981
|
}
|
|
@@ -75914,7 +76023,7 @@ function useReactTable(options) {
|
|
|
75914
76023
|
// state.
|
|
75915
76024
|
onStateChange: updater => {
|
|
75916
76025
|
setState(updater);
|
|
75917
|
-
options.onStateChange == null
|
|
76026
|
+
options.onStateChange == null || options.onStateChange(updater);
|
|
75918
76027
|
}
|
|
75919
76028
|
}));
|
|
75920
76029
|
return tableRef.current;
|
|
@@ -76176,6 +76285,15 @@ function isArray(value) {
|
|
|
76176
76285
|
return value !== undefined && value !== null;
|
|
76177
76286
|
}
|
|
76178
76287
|
|
|
76288
|
+
/**
|
|
76289
|
+
* Checks if a value is empty or not, including strings with only whitespaces.
|
|
76290
|
+
*/ function isEmptyish(value) {
|
|
76291
|
+
if (typeof value === 'string') {
|
|
76292
|
+
return !value.trim().length;
|
|
76293
|
+
}
|
|
76294
|
+
return fp.isEmpty(value);
|
|
76295
|
+
}
|
|
76296
|
+
|
|
76179
76297
|
function isObject(value) {
|
|
76180
76298
|
// eslint-disable-next-line no-null/no-null
|
|
76181
76299
|
return typeof value === 'object' && value !== null && !Array.isArray(value) && value.constructor.name === 'Object';
|
|
@@ -76237,6 +76355,30 @@ const nullifyObjectPropPair = ([key, value])=>[
|
|
|
76237
76355
|
return text + (count > 1 ? 's' : '');
|
|
76238
76356
|
}
|
|
76239
76357
|
|
|
76358
|
+
/**
|
|
76359
|
+
* Same as Lodash `sortBy()` but for collections of objects with localized properties.
|
|
76360
|
+
*/ function sortCollectionByLocalizedProps(propPaths, collection) {
|
|
76361
|
+
return collection.sort((a, b)=>{
|
|
76362
|
+
const aPropValues = propPaths.map((propPath)=>fp.property(propPath, a));
|
|
76363
|
+
const bPropValues = propPaths.map((propPath)=>fp.property(propPath, b));
|
|
76364
|
+
const comparisonResult = aPropValues.reduce((result, aNextPropValue, index)=>{
|
|
76365
|
+
// If a previous comparison already found a difference, we don't need to compare the next prop values.
|
|
76366
|
+
if (result !== 0) {
|
|
76367
|
+
return result;
|
|
76368
|
+
}
|
|
76369
|
+
const bNextPropValue = bPropValues[index];
|
|
76370
|
+
if (typeof aNextPropValue === 'number' && typeof bNextPropValue === 'number') {
|
|
76371
|
+
return aNextPropValue - bNextPropValue;
|
|
76372
|
+
}
|
|
76373
|
+
if (typeof aNextPropValue === 'string' && typeof bNextPropValue === 'string') {
|
|
76374
|
+
return aNextPropValue.localeCompare(bNextPropValue);
|
|
76375
|
+
}
|
|
76376
|
+
throw new Error('utils/sortCollectionByLocalizedProps(): Property values must either be numbers or strings.');
|
|
76377
|
+
}, 0);
|
|
76378
|
+
return comparisonResult;
|
|
76379
|
+
});
|
|
76380
|
+
}
|
|
76381
|
+
|
|
76240
76382
|
const undefineArrayValues = (list)=>list.map(undefine);
|
|
76241
76383
|
const undefineObjectProps = (record)=>pipe$1(toPairs$1, map$1(undefineObjectPropPair), fromPairs$1)(record);
|
|
76242
76384
|
const undefineObjectPropPair = ([key, value])=>[
|
|
@@ -76264,5 +76406,5 @@ const undefineObjectPropPair = ([key, value])=>[
|
|
|
76264
76406
|
return value;
|
|
76265
76407
|
}
|
|
76266
76408
|
|
|
76267
|
-
export { Accent, Button$1 as Button, CheckPicker, Checkbox, ControlUnit, CoordinatesFormat, CoordinatesInput, CustomSearch, DataTable, DatePicker, DateRangePicker, Dialog, Dropdown, ExclamationPoint, Field$2 as Field, FieldError, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, Level, MapMenuDialog, Message, Mission, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, cleanString, coordinatesAreDistinct, customDayjs, getCoordinates, getHashFromCollection, getLocalizedDayjs, getOptionsFromIdAndName, getOptionsFromLabelledEnum, getPseudoRandomString, getUtcizedDayjs, isArray, isDefined, isNumeric, isObject, logSoftError, normalizeString, nullify, pluralize, stopMouseEventPropagation, undefine, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
|
|
76409
|
+
export { Accent, Button$1 as Button, CheckPicker, Checkbox, ControlUnit, CoordinatesFormat, CoordinatesInput, CustomSearch, DataTable, DatePicker, DateRangePicker, Dialog, Dropdown, ExclamationPoint, Field$2 as Field, FieldError, Fieldset, FormikCheckbox, FormikCoordinatesInput, FormikDatePicker, FormikDateRangePicker, FormikEffect, FormikMultiCheckbox, FormikMultiRadio, FormikMultiSelect, FormikNumberInput, FormikSearch, FormikSelect, FormikTextInput, FormikTextarea, GlobalStyle, index as Icon, IconButton, Label, Legend, Level, MapMenuDialog, Message, Mission, MultiCheckbox, MultiRadio, MultiSelect, MultiZoneEditor, NewWindow, NewWindowContext, NotificationEvent, Notifier, NumberInput, OPENLAYERS_PROJECTION, OnlyFontGlobalStyle, Search, Select, SideMenu, SimpleTable, SingleTag, Size, THEME, TableWithSelectableRows, Tag, TagBullet, TagGroup, TextInput, Textarea, ThemeProvider, WSG84_PROJECTION, cleanString, coordinatesAreDistinct, customDayjs, getCoordinates, getHashFromCollection, getLocalizedDayjs, getOptionsFromIdAndName, getOptionsFromLabelledEnum, getPseudoRandomString, getUtcizedDayjs, isArray, isDefined, isEmptyish, isNumeric, isObject, logSoftError, normalizeString, nullify, pluralize, sortCollectionByLocalizedProps, stopMouseEventPropagation, undefine, useClickOutsideEffect, useFieldControl, useForceUpdate, useKey, useNewWindow, usePrevious };
|
|
76268
76410
|
//# sourceMappingURL=index.js.map
|