datatables.net-columncontrol 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ColumnControl 1.
|
|
1
|
+
/*! ColumnControl 1.2.0
|
|
2
2
|
* Copyright (c) SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*
|
|
4
4
|
* SVG icons: ISC License
|
|
@@ -965,13 +965,9 @@ var reorder = {
|
|
|
965
965
|
var btn = new Button(dt, this)
|
|
966
966
|
.text(dt.i18n('columnControl.reorder', config.text))
|
|
967
967
|
.icon(config.icon)
|
|
968
|
-
.className(config.className)
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
if (idx > 0) {
|
|
972
|
-
dt.colReorder.move(idx, idx - 1);
|
|
973
|
-
}
|
|
974
|
-
});
|
|
968
|
+
.className(config.className);
|
|
969
|
+
// The event handling for this is done in ColReorder._addListener - no event
|
|
970
|
+
// handler needed here for click / drag
|
|
975
971
|
if (this.idx() === 0) {
|
|
976
972
|
btn.enable(false);
|
|
977
973
|
}
|
|
@@ -1525,6 +1521,10 @@ var SearchInput = /** @class */ (function () {
|
|
|
1525
1521
|
// Data for server-side processing
|
|
1526
1522
|
if (dt.page.info().serverSide) {
|
|
1527
1523
|
dt.on('preXhr.DT', function (e, s, d) {
|
|
1524
|
+
// The column has been removed from the submit data - can't do anything
|
|
1525
|
+
if (!d.columns || !d.columns[_this._idx]) {
|
|
1526
|
+
return;
|
|
1527
|
+
}
|
|
1528
1528
|
if (!d.columns[_this._idx].columnControl) {
|
|
1529
1529
|
d.columns[_this._idx].columnControl = {};
|
|
1530
1530
|
}
|
|
@@ -1743,6 +1743,7 @@ var SearchInput = /** @class */ (function () {
|
|
|
1743
1743
|
var searchDateTime = {
|
|
1744
1744
|
defaults: {
|
|
1745
1745
|
clear: true,
|
|
1746
|
+
excludeLogic: [],
|
|
1746
1747
|
format: '',
|
|
1747
1748
|
mask: '',
|
|
1748
1749
|
placeholder: '',
|
|
@@ -1775,17 +1776,28 @@ var searchDateTime = {
|
|
|
1775
1776
|
{ label: dt.i18n(i18nBase + 'less', 'Before'), value: 'less' },
|
|
1776
1777
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
1777
1778
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
1778
|
-
])
|
|
1779
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
1779
1780
|
.search(function (searchType, searchTerm, loadingState) {
|
|
1781
|
+
// If in a dropdown, set the parent levels as active
|
|
1782
|
+
if (config._parents) {
|
|
1783
|
+
config._parents.forEach(function (btn) {
|
|
1784
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
var column = dt.column(_this.idx());
|
|
1780
1788
|
// When SSP, don't apply a filter here, SearchInput will add to the submit data
|
|
1781
1789
|
if (dt.page.info().serverSide) {
|
|
1790
|
+
// Need to let the searchClear button know if we have a filter
|
|
1791
|
+
// applied though.
|
|
1792
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
1793
|
+
searchType === 'notEmpty' ||
|
|
1794
|
+
searchTerm);
|
|
1782
1795
|
if (!loadingState) {
|
|
1783
1796
|
dt.draw();
|
|
1784
1797
|
}
|
|
1785
1798
|
return;
|
|
1786
1799
|
}
|
|
1787
1800
|
var mask = config.mask;
|
|
1788
|
-
var column = dt.column(_this.idx());
|
|
1789
1801
|
var search = searchTerm === ''
|
|
1790
1802
|
? ''
|
|
1791
1803
|
: dateToNum(dateTime && fromPicker ? dateTime.val() : searchTerm.trim(), pickerFormat, moment, luxon, mask);
|
|
@@ -1826,12 +1838,6 @@ var searchDateTime = {
|
|
|
1826
1838
|
return dateToNum(haystack, dataSrcFormat, moment, luxon, mask) < search;
|
|
1827
1839
|
});
|
|
1828
1840
|
}
|
|
1829
|
-
// If in a dropdown, set the parent levels as active
|
|
1830
|
-
if (config._parents) {
|
|
1831
|
-
config._parents.forEach(function (btn) {
|
|
1832
|
-
return btn.activeList(_this.unique(), !!column.search.fixed('dtcc'));
|
|
1833
|
-
});
|
|
1834
|
-
}
|
|
1835
1841
|
if (!loadingState) {
|
|
1836
1842
|
column.draw();
|
|
1837
1843
|
}
|
|
@@ -1840,9 +1846,7 @@ var searchDateTime = {
|
|
|
1840
1846
|
dt.ready(function () {
|
|
1841
1847
|
var DateTime = DataTable.use('datetime');
|
|
1842
1848
|
dataSrcFormat = getFormat(dt, _this.idx());
|
|
1843
|
-
pickerFormat = config.format
|
|
1844
|
-
? config.format
|
|
1845
|
-
: dataSrcFormat;
|
|
1849
|
+
pickerFormat = config.format ? config.format : dataSrcFormat;
|
|
1846
1850
|
if (DateTime) {
|
|
1847
1851
|
dateTime = new DateTime(searchInput.input(), {
|
|
1848
1852
|
format: pickerFormat,
|
|
@@ -2131,11 +2135,18 @@ var searchList = {
|
|
|
2131
2135
|
// The search can be applied from a stored start at start up before the options are
|
|
2132
2136
|
// available. It can also be applied by user input, so it is generalised into this function.
|
|
2133
2137
|
var applySearch = function (values) {
|
|
2138
|
+
// If in a dropdown, set the parent levels as active
|
|
2139
|
+
if (config._parents) {
|
|
2140
|
+
config._parents.forEach(function (btn) { return btn.activeList(_this.unique(), values && !!values.length); });
|
|
2141
|
+
}
|
|
2142
|
+
var col = dt.column(_this.idx());
|
|
2134
2143
|
// When SSP, don't do any client-side filtering
|
|
2135
2144
|
if (dt.page.info().serverSide) {
|
|
2145
|
+
// Need to let the searchClear button know if we have a filter
|
|
2146
|
+
// applied though.
|
|
2147
|
+
col.init().__ccList = values && values.length !== 0;
|
|
2136
2148
|
return;
|
|
2137
2149
|
}
|
|
2138
|
-
var col = dt.column(_this.idx());
|
|
2139
2150
|
if (!values) {
|
|
2140
2151
|
return;
|
|
2141
2152
|
}
|
|
@@ -2149,10 +2160,6 @@ var searchList = {
|
|
|
2149
2160
|
return values.includes(val);
|
|
2150
2161
|
});
|
|
2151
2162
|
}
|
|
2152
|
-
// If in a dropdown, set the parent levels as active
|
|
2153
|
-
if (config._parents) {
|
|
2154
|
-
config._parents.forEach(function (btn) { return btn.activeList(_this.unique(), !!values.length); });
|
|
2155
|
-
}
|
|
2156
2163
|
};
|
|
2157
2164
|
var checkList = new CheckList(dt, this, {
|
|
2158
2165
|
search: config.search,
|
|
@@ -2183,17 +2190,25 @@ var searchList = {
|
|
|
2183
2190
|
// Need to wait for the draw to complete so the table has the latest data
|
|
2184
2191
|
dt.one('draw', function () {
|
|
2185
2192
|
reloadOptions(dt, config, _this.idx(), checkList, loadedValues);
|
|
2193
|
+
loadedValues = null;
|
|
2186
2194
|
});
|
|
2187
2195
|
});
|
|
2188
2196
|
}
|
|
2197
|
+
var sspValues = [];
|
|
2189
2198
|
// Data for server-side processing
|
|
2190
2199
|
if (dt.page.info().serverSide) {
|
|
2191
2200
|
dt.on('preXhr.DT', function (e, s, d) {
|
|
2201
|
+
// The column has been removed from the submit data - can't do anything
|
|
2202
|
+
if (!d.columns || !d.columns[_this.idx()]) {
|
|
2203
|
+
return;
|
|
2204
|
+
}
|
|
2192
2205
|
if (!d.columns[_this.idx()].columnControl) {
|
|
2193
2206
|
d.columns[_this.idx()].columnControl = {};
|
|
2194
2207
|
}
|
|
2208
|
+
var values = sspValues.length ? sspValues : checkList.values();
|
|
2209
|
+
sspValues = [];
|
|
2195
2210
|
// We need the indexes in the HTTP parameter names (for .NET), so use an object.
|
|
2196
|
-
d.columns[_this.idx()].columnControl.list = Object.assign({},
|
|
2211
|
+
d.columns[_this.idx()].columnControl.list = Object.assign({}, values);
|
|
2197
2212
|
});
|
|
2198
2213
|
}
|
|
2199
2214
|
// Unlike the SearchInput based search contents, CheckList does not handle state saving
|
|
@@ -2231,6 +2246,11 @@ var searchList = {
|
|
|
2231
2246
|
};
|
|
2232
2247
|
loadedValues = getState(this.idx(), dt.state.loaded());
|
|
2233
2248
|
applySearch(loadedValues);
|
|
2249
|
+
// If SSP, then there are no options yet, so for a saved state we need
|
|
2250
|
+
// to use the values from the state in a temporary variable
|
|
2251
|
+
if (dt.page.info().serverSide && loadedValues && loadedValues.length) {
|
|
2252
|
+
sspValues = loadedValues;
|
|
2253
|
+
}
|
|
2234
2254
|
return checkList.element();
|
|
2235
2255
|
}
|
|
2236
2256
|
};
|
|
@@ -2238,6 +2258,7 @@ var searchList = {
|
|
|
2238
2258
|
var searchNumber = {
|
|
2239
2259
|
defaults: {
|
|
2240
2260
|
clear: true,
|
|
2261
|
+
excludeLogic: [],
|
|
2241
2262
|
placeholder: '',
|
|
2242
2263
|
title: '',
|
|
2243
2264
|
titleAttr: ''
|
|
@@ -2262,19 +2283,34 @@ var searchNumber = {
|
|
|
2262
2283
|
value: 'greaterOrEqual'
|
|
2263
2284
|
},
|
|
2264
2285
|
{ label: dt.i18n(i18nBase + 'less', 'Less than'), value: 'less' },
|
|
2265
|
-
{
|
|
2286
|
+
{
|
|
2287
|
+
label: dt.i18n(i18nBase + 'lessOrEqual', 'Less or equal'),
|
|
2288
|
+
value: 'lessOrEqual'
|
|
2289
|
+
},
|
|
2266
2290
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
2267
2291
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
2268
|
-
])
|
|
2292
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
2269
2293
|
.search(function (searchType, searchTerm, loadingState) {
|
|
2270
|
-
//
|
|
2294
|
+
// If in a dropdown, set the parent levels as active
|
|
2295
|
+
if (config._parents) {
|
|
2296
|
+
config._parents.forEach(function (btn) {
|
|
2297
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
var column = dt.column(_this.idx());
|
|
2301
|
+
// When SSP, don't apply a filter here, SearchInput will add to
|
|
2302
|
+
// the submit data
|
|
2271
2303
|
if (dt.page.info().serverSide) {
|
|
2304
|
+
// Need to let the searchClear button know if we have a filter
|
|
2305
|
+
// applied though.
|
|
2306
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
2307
|
+
searchType === 'notEmpty' ||
|
|
2308
|
+
searchTerm);
|
|
2272
2309
|
if (!loadingState) {
|
|
2273
2310
|
dt.draw();
|
|
2274
2311
|
}
|
|
2275
2312
|
return;
|
|
2276
2313
|
}
|
|
2277
|
-
var column = dt.column(_this.idx());
|
|
2278
2314
|
if (searchType === 'empty') {
|
|
2279
2315
|
column.search.fixed('dtcc', function (haystack) { return !haystack; });
|
|
2280
2316
|
}
|
|
@@ -2308,12 +2344,6 @@ var searchNumber = {
|
|
|
2308
2344
|
else if (searchType === 'lessOrEqual') {
|
|
2309
2345
|
column.search.fixed('dtcc', function (haystack) { return stringToNum(haystack) <= searchTerm; });
|
|
2310
2346
|
}
|
|
2311
|
-
// If in a dropdown, set the parents as active
|
|
2312
|
-
if (config._parents) {
|
|
2313
|
-
config._parents.forEach(function (btn) {
|
|
2314
|
-
return btn.activeList(_this.unique(), !!column.search.fixed('dtcc'));
|
|
2315
|
-
});
|
|
2316
|
-
}
|
|
2317
2347
|
if (!loadingState) {
|
|
2318
2348
|
column.draw();
|
|
2319
2349
|
}
|
|
@@ -2343,6 +2373,7 @@ function stringToNum(d) {
|
|
|
2343
2373
|
var searchText = {
|
|
2344
2374
|
defaults: {
|
|
2345
2375
|
clear: true,
|
|
2376
|
+
excludeLogic: [],
|
|
2346
2377
|
placeholder: '',
|
|
2347
2378
|
title: '',
|
|
2348
2379
|
titleAttr: ''
|
|
@@ -2369,16 +2400,27 @@ var searchText = {
|
|
|
2369
2400
|
{ label: dt.i18n(i18nBase + 'ends', 'Ends'), value: 'ends' },
|
|
2370
2401
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
2371
2402
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
2372
|
-
])
|
|
2403
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
2373
2404
|
.search(function (searchType, searchTerm, loadingState) {
|
|
2405
|
+
// If in a dropdown, set the parent levels as active
|
|
2406
|
+
if (config._parents) {
|
|
2407
|
+
config._parents.forEach(function (btn) {
|
|
2408
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
var column = dt.column(_this.idx());
|
|
2374
2412
|
// When SSP, don't apply a filter here, SearchInput will add to the submit data
|
|
2375
2413
|
if (dt.page.info().serverSide) {
|
|
2414
|
+
// Need to let the searchClear button know if we have a filter
|
|
2415
|
+
// applied though.
|
|
2416
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
2417
|
+
searchType === 'notEmpty' ||
|
|
2418
|
+
searchTerm);
|
|
2376
2419
|
if (!loadingState) {
|
|
2377
2420
|
dt.draw();
|
|
2378
2421
|
}
|
|
2379
2422
|
return;
|
|
2380
2423
|
}
|
|
2381
|
-
var column = dt.column(_this.idx());
|
|
2382
2424
|
searchTerm = searchTerm.toLowerCase();
|
|
2383
2425
|
if (searchType === 'empty') {
|
|
2384
2426
|
column.search.fixed('dtcc', function (haystack) { return !haystack; });
|
|
@@ -2440,15 +2482,15 @@ var search = {
|
|
|
2440
2482
|
},
|
|
2441
2483
|
init: function (config) {
|
|
2442
2484
|
var _this = this;
|
|
2443
|
-
var _a, _b
|
|
2485
|
+
var _a, _b;
|
|
2444
2486
|
var dt = this.dt();
|
|
2445
2487
|
var idx = this.idx();
|
|
2446
2488
|
var displayEl;
|
|
2447
|
-
var loadedState = (
|
|
2489
|
+
var loadedState = (_b = (_a = dt.state.loaded()) === null || _a === void 0 ? void 0 : _a.columnControl) === null || _b === void 0 ? void 0 : _b[idx];
|
|
2448
2490
|
var initType = function (type) {
|
|
2449
2491
|
var json = getJsonOptions(dt, idx);
|
|
2450
2492
|
// Attempt to match what type of search should be shown
|
|
2451
|
-
if (config.allowSearchList && json) {
|
|
2493
|
+
if (type === 'list' || (config.allowSearchList && json)) {
|
|
2452
2494
|
// We've got a list of JSON options, and are allowed to show the searchList
|
|
2453
2495
|
return searchList.init.call(_this, Object.assign({}, searchList.defaults, config));
|
|
2454
2496
|
}
|
|
@@ -2469,7 +2511,12 @@ var search = {
|
|
|
2469
2511
|
// to allow the state to be applied to the table and the first draw to have a filter
|
|
2470
2512
|
// applied (if it is needed).
|
|
2471
2513
|
if (loadedState) {
|
|
2472
|
-
|
|
2514
|
+
if (loadedState.searchInput) {
|
|
2515
|
+
displayEl = initType(loadedState.searchInput.type);
|
|
2516
|
+
}
|
|
2517
|
+
else if (loadedState.searchList) {
|
|
2518
|
+
displayEl = initType('list');
|
|
2519
|
+
}
|
|
2473
2520
|
}
|
|
2474
2521
|
else {
|
|
2475
2522
|
// Wait until we can get the data type for the column and the run the corresponding type
|
|
@@ -2503,9 +2550,12 @@ var searchClear$1 = {
|
|
|
2503
2550
|
.enable(false);
|
|
2504
2551
|
dt.on('draw', function () {
|
|
2505
2552
|
// change enable state
|
|
2506
|
-
var
|
|
2507
|
-
var
|
|
2508
|
-
|
|
2553
|
+
var col = dt.column(_this.idx());
|
|
2554
|
+
var search = col.search.fixed('dtcc');
|
|
2555
|
+
var searchList = col.search.fixed('dtcc-list');
|
|
2556
|
+
var searchSearchSsp = col.init().__ccSearch;
|
|
2557
|
+
var searchListSsp = col.init().__ccList;
|
|
2558
|
+
btn.enable(!!(search || searchList || searchSearchSsp || searchListSsp));
|
|
2509
2559
|
});
|
|
2510
2560
|
return btn.element();
|
|
2511
2561
|
}
|
|
@@ -2784,7 +2834,7 @@ var ColumnControl = /** @class */ (function () {
|
|
|
2784
2834
|
/** SVG icons that can be used by the content plugins */
|
|
2785
2835
|
ColumnControl.icons = icons;
|
|
2786
2836
|
/** Version */
|
|
2787
|
-
ColumnControl.version = '1.
|
|
2837
|
+
ColumnControl.version = '1.2.0';
|
|
2788
2838
|
return ColumnControl;
|
|
2789
2839
|
}());
|
|
2790
2840
|
|
|
@@ -2868,7 +2918,10 @@ DataTable.Api.registerPlural('columns().columnControl.searchClear()', 'column().
|
|
|
2868
2918
|
DataTable.Api.registerPlural('columns().ccSearchClear()', 'column().ccSearchClear()', searchClear);
|
|
2869
2919
|
DataTable.Api.registerPlural('columns().columnControl.searchList()', 'column().columnControl.searchList()', function (options) {
|
|
2870
2920
|
return this.iterator('column', function (settings, idx) {
|
|
2871
|
-
settings.aoColumns[idx].columnControlSearchList
|
|
2921
|
+
var fn = settings.aoColumns[idx].columnControlSearchList;
|
|
2922
|
+
if (fn) {
|
|
2923
|
+
fn(options);
|
|
2924
|
+
}
|
|
2872
2925
|
});
|
|
2873
2926
|
});
|
|
2874
2927
|
DataTable.ext.buttons.ccSearchClear = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! ColumnControl 1.
|
|
1
|
+
/*! ColumnControl 1.2.0
|
|
2
2
|
* Copyright (c) SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*
|
|
4
4
|
* SVG icons: ISC License
|
|
5
5
|
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).
|
|
6
6
|
* All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
7
|
*/
|
|
8
|
-
(n=>{var r,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),o=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||r(t),o(t,e),n(e,0,t.document)}:(o(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)})(function(t,o,u){var x=t.fn.dataTable;function y(t,e,n,r){void 0===e&&(e=[]),void 0===n&&(n=null),void 0===r&&(r=[]);var o=u.createElement(t);return i(o,e),n&&(o.innerHTML=n),r.forEach(function(t){o.appendChild(t)}),o}function i(e,t){t&&(t=Array.isArray(t)?t:[t]).forEach(function(t){e&&t&&e.classList.add(t)})}function e(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+t+"</svg>"}var c={chevronRight:e('<path d="m9 18 6-6-6-6"/>'),columns:e('<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="M15 3v18"/>'),contains:e('<path d="M10 3h4v18h-4z"/><path d="M18 8h3v9h-3"/><path d="M6 17H3V8h3"/>'),empty:e('<circle cx="12" cy="12" r="10"/>'),ends:e('<path d="M21 3h-4v18h4z"/><path d="M13 8H3v9h10"/>'),equal:e('<line x1="5" x2="19" y1="9" y2="9"/><line x1="5" x2="19" y1="15" y2="15"/>'),greater:e('<path d="m9 18 6-6-6-6"/>'),greaterOrEqual:e('<path d="m9 16 6-6-6-6"/><path d="m9 21 6-6"/>'),groupAdd:e('<path d="M6 21v-7.5m-3.549 3.75H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" fill="currentColor" rx="1.5"/>'),groupClear:e('<rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupTop:e('<rect width="13.5" height="7.5" x="3" y="3" fill="currentColor" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupRemove:e('<path d="M2.451 17.25H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),less:e('<path d="m15 18-6-6 6-6"/>'),lessOrEqual:e('<path d="m15 16-6-6 6-6"/><path d="m15 21-6-6"/>'),menu:e('<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>'),move:e('<line x1="12" x2="12" y1="3" y2="21"/><polyline points="8 8 4 12 8 16"/><polyline points="16 16 20 12 16 8"/>'),moveLeft:e('<path d="m9 6-6 6 6 6"/><path d="M3 12h14"/><path d="M21 19V5"/>'),moveRight:e('<path d="M3 5v14"/><path d="M21 12H7"/><path d="m15 18 6-6-6-6"/>'),notContains:e('<path d="M15 4 9 20"/><path d="M3 8h18v9H3z"/>'),notEmpty:e('<circle cx="12" cy="12" r="10"/><line x1="9" x2="15" y1="15" y2="9"/>'),notEqual:e('<path d="M5 9h14"/><path d="M5 15h14"/><path d="M15 5 9 19"/>'),orderAddAsc:e('<path d="M17 21v-8"/><path d="M3 4h6"/><path d="M3 8h9"/><path d="M3 12h10"/><path d="M13 17h8"/>'),orderAddDesc:e('<path d="M17 21v-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderAsc:e('<path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h4"/><path d="M11 16h7"/><path d="M11 20h10"/>'),orderClear:e('<path d="m21 21-8-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="m13 21 8-8"/>'),orderDesc:e('<path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/>'),orderRemove:e('<path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderNone:e('<path d="m3 8 4-4 4 4"/><path d="m11 16-4 4-4-4"/><path d="M7 4v16"/><path d="M15 8h6"/><path d="M15 16h6"/><path d="M13 12h8"/>'),search:e('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),searchClear:e('<path d="m13.5 8.5-5 5"/><path d="m8.5 8.5 5 5"/><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),starts:e('<path d="M3 3h4v18H3z"/><path d="M11 8h10v9H11"/>'),tick:e('<path d="M20 6 9 17l-5-5"/>'),x:e('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')};function a(t,e){return e.closest("div.dtfh-floatingparent")||t.table().container()}function d(t,e,n){var r=n.closest("div.dt-column-header"),e=a(e,n),r=getComputedStyle(r),o=t.offsetWidth,i=((t,e)=>{for(var n=0,r=0;e&&e!==t&&e!==u.body;)n+=e.offsetTop,r+=e.offsetLeft,e.scrollTop&&(r-=e.scrollTop),e.scrollLeft&&(r-=e.scrollLeft),e=e.offsetParent;return{top:n,left:r}})(e,n),s=i.top+n.offsetHeight,r="row-reverse"===r.flexDirection?i.left:i.left-o+n.offsetWidth,i=e.offsetWidth;i<r+o&&(r-=r+o-i),r<0&&(r=0),t.style.top=s+"px",t.style.left=r+"px"}function h(n,t,e){function r(t){var e;n._shown?t.target===n||n.contains(t.target)||(e=u.querySelector("div.dt-datetime"))&&(t.target===e||e.contains(t.target))||(n._close(),u.body.removeEventListener("click",r)):u.body.removeEventListener("click",r)}var o=a(t,e.element());n._shown=!0,o.append(n),d(n,t,e.element()),e.element().setAttribute("aria-expanded","true");u.body.addEventListener("click",r)}var p={classes:{container:"dtcc-dropdown",liner:"dtcc-dropdown-liner"},defaults:{className:"dropdown",content:[],icon:"menu",text:"More..."},init:function(n){var r=this.dt(),o=y("div",p.classes.container,"",[y("div",p.classes.liner)]),t=(o._shown=!1,o._close=function(){o.remove(),o._shown=!1,i.element().setAttribute("aria-expanded","false")},o.setAttribute("role","dialog"),o.setAttribute("aria-label",r.i18n("columnControl.dropdown",n.text)),r.on("fixedheader-mode",function(){o._shown&&h(o,r,n._parents?n._parents[0]:i)}),o.childNodes[0]),i=new f(r,this).text(r.i18n("columnControl.dropdown",n.text)).icon(n.icon).className(n.className).dropdownDisplay(t).handler(function(t){var e;t._closed&&t._closed.includes(o)||(h(o,r,n._parents?n._parents[0]:i),(e=o.querySelector("input, a, button"))&&"keypress"===t.type&&e.focus())});i.element().setAttribute("aria-haspopup","dialog"),i.element().setAttribute("aria-expanded","false");for(var e=0;e<n.content.length;e++){var s=this.resolve(n.content[e]),s=(s.config._parents||(s.config._parents=[]),s.config._parents.push(i),s.plugin.init.call(this,s.config));t.appendChild(s)}n._parents&&n._parents.length&&i.extra("chevronRight"),r.on("columns-reordered",function(){d(o,r,i.element())});function a(t){var e,n;c._shown&&(e=Array.from(c.querySelectorAll("a, button, input, select")),n=u.activeElement,"Escape"===t.key?(c._close(),l.focus()):"Tab"===t.key&&0!==e.length&&(e.includes(n)?t.shiftKey?n===e[0]&&(e[e.length-1].focus(),t.preventDefault()):n===e[e.length-1]&&(e[0].focus(),t.preventDefault()):(e[0].focus(),t.preventDefault())))}var c,l;c=o,l=i.element();return u.body.addEventListener("keydown",a),r.on("destroy",function(){u.body.removeEventListener("keydown",a)}),i.element()}},Y=0,f=(n.prototype.active=function(t){return void 0===t?this._s.active:(this._s.active=t,this._checkActive(),this)},n.prototype.activeList=function(t,e){return this._s.activeList[t]=e,this._checkActive(),this},n.prototype.checkDisplay=function(){for(var t=0,e=this._dom.dropdownDisplay.childNodes,n=0;n<e.length;n++)"none"!==e[n].style.display&&t++;return 0===t&&(this._dom.button.style.display="none"),this},n.prototype.className=function(t){return this._dom.button.classList.add("dtcc-button_"+t),this},n.prototype.destroy=function(){this._s.buttonClick&&(this._dom.button.removeEventListener("click",this._s.buttonClick),this._dom.button.removeEventListener("keypress",this._s.buttonClick)),this._s.host.destroyRemove(this)},n.prototype.dropdownDisplay=function(t){return this._dom.dropdownDisplay=t,this},n.prototype.element=function(){return this._dom.button},n.prototype.enable=function(t){return void 0===t?this._s.enabled:(this._dom.button.classList.toggle("dtcc-button_disabled",!t),this._s.enabled=t,this)},n.prototype.extra=function(t){return this._dom.extra.innerHTML=t?c[t]:"",this},n.prototype.handler=function(n){function t(t){var e;void 0===(e=t)&&(e=null),u.querySelectorAll("div.dtcc-dropdown").forEach(function(t){null!==e&&t.contains(e.target)||(t._close(),e._closed||(e._closed=[]),e._closed.push(t))}),t.stopPropagation(),t.preventDefault(),r._s.enabled&&n(t)}var r=this;return this._s.buttonClick=t,this._s.namespace="dtcc-"+Y++,this._dom.button.addEventListener("click",t),this._dom.button.addEventListener("keypress",t),this._s.host.destroyAdd(this),this},n.prototype.icon=function(t){return this._dom.icon.innerHTML=t?c[t]:"",this},n.prototype.text=function(t){return void 0===t?this._s.label:(this._dom.text.innerHTML=t,this._s.label=t,this._dom.button.setAttribute("aria-label",t),this)},n.prototype.value=function(t){return void 0===t?this._s.value:(this._s.value=t,this)},n.prototype._checkActive=function(){return!0===this._s.active||Object.values(this._s.activeList).includes(!0)?(this._dom.state.innerHTML=c.tick,this._dom.button.classList.add("dtcc-button_active")):(this._dom.state.innerHTML="",this._dom.button.classList.remove("dtcc-button_active")),this},n.classes={container:"dtcc-button"},n);function n(t,e){this._s={active:!1,activeList:[],buttonClick:null,dt:null,enabled:!0,host:null,label:"",namespace:"",value:null},this._s.dt=t,this._s.host=e,this._dom={button:y("button",n.classes.container),dropdownDisplay:null,extra:y("span","dtcc-button-extra"),icon:y("span","dtcc-button-icon"),state:y("span","dtcc-button-state"),text:y("span","dtcc-button-text")},this._dom.button.setAttribute("type","button"),this._dom.button.append(this._dom.icon),this._dom.button.append(this._dom.text),this._dom.button.append(this._dom.state),this._dom.button.append(this._dom.extra),this.enable(!0)}m.prototype.add=function(n,t){for(var r=this,o=(Array.isArray(n)||(n=[n]),this),e=0;e<n.length;e++)(t=>{var t=n[t],e=new f(o._s.dt,o._s.host).active(t.active||!1).handler(function(t){r._s.handler(t,e,r._s.buttons,!0),r._updateCount()}).icon(t.icon||"").text(""!==t.label?t.label:o._s.dt.i18n("columnControl.list.empty","Empty")).value(t.value);""===t.label&&e.className("empty"),o._s.buttons.push(e)})(e);var i=this._s.buttons.length;return!0!==t&&void 0!==t||(this._dom.selectAllCount.innerHTML=i?"("+i+")":"",this._redraw()),this},m.prototype.button=function(t){for(var e=this._s.buttons,n=0;n<e.length;n++)if(e[n].value()===t)return e[n];return null},m.prototype.clear=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].destroy();return this._dom.buttons.replaceChildren(),this._s.buttons.length=0,this},m.prototype.element=function(){return this._dom.container},m.prototype.handler=function(t){return this._s.handler=t,this},m.prototype.searchListener=function(t){var n=this;return t.on("cc-search-clear",function(t,e){e===n._s.host.idx()&&(n.selectNone(),n._s.handler(t,null,n._s.buttons,!1),n._s.search="",n._dom.search.value="",n._redraw(),n._updateCount())}),this},m.prototype.selectAll=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!0);return this},m.prototype.selectNone=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!1);return this},m.prototype.title=function(t){return this._dom.title.innerHTML=t,this},m.prototype.values=function(t){var e,n=[],r=this._s.buttons;if(void 0!==t){for(e=0;e<r.length;e++)t.includes(r[e].value())&&r[e].active(!0);return this._updateCount(),this}for(e=0;e<r.length;e++)r[e].active()&&n.push(r[e].value());return n},m.prototype._updateCount=function(){var t=this.values().length;this._dom.selectNoneCount.innerHTML=t?"("+t+")":""},m.prototype._redraw=function(){var t=this._s.buttons,e=this._dom.buttons,n=this._s.search.toLowerCase();e.replaceChildren();for(var r=0;r<t.length;r++){var o=t[r];n&&!o.text().toLowerCase().includes(n)||e.appendChild(o.element())}this._dom.empty.style.display=0===t.length?"block":"none",e.style.display=0<t.length?"block":"none"},m.classes={container:"dtcc-list",input:"dtcc-list-search"};var l=m;function m(t,e,n){function r(){s._s.search=a.search.value,s._redraw()}function o(t){s.selectAll(),s._s.handler(t,null,s._s.buttons,!0),s._updateCount()}function i(t){s.selectNone(),s._s.handler(t,null,s._s.buttons,!0),s._updateCount()}var s=this,a=(this._s={buttons:[],dt:null,handler:function(){},host:null,search:""},this._s.dt=t,this._s.host=e,this._dom={buttons:y("div","dtcc-list-buttons"),container:y("div",m.classes.container),controls:y("div","dtcc-list-controls"),empty:y("div","dtcc-list-empty",t.i18n("columnControl.list.empty","No options")),title:y("div","dtcc-list-title"),selectAll:y("button","dtcc-list-selectAll",t.i18n("columnControl.list.all","Select all")),selectAllCount:y("span"),selectNone:y("button","dtcc-list-selectNone",t.i18n("columnControl.list.none","Deselect")),selectNoneCount:y("span"),search:y("input",m.classes.input)},this._dom);a.search.setAttribute("type","text"),a.container.append(a.title),a.container.append(a.controls),a.container.append(a.empty),a.container.append(a.buttons),n.select&&(a.controls.append(a.selectAll),a.controls.append(a.selectNone),a.selectAll.append(a.selectAllCount),a.selectNone.append(a.selectNoneCount),a.selectAll.setAttribute("type","button"),a.selectNone.setAttribute("type","button"));n.search&&(a.controls.append(a.search),a.search.setAttribute("placeholder",t.i18n("columnControl.list.search","Search...")),a.search.addEventListener("input",r)),a.selectAll.addEventListener("click",o),a.selectNone.addEventListener("click",i),t.on("destroy",function(){a.selectAll.removeEventListener("click",o),a.selectNone.removeEventListener("click",i),a.search.removeEventListener("input",r)})}var r={defaults:{className:"colVis",columns:"",search:!1,select:!1,title:"Column visibility"},init:function(t){function n(){o.columns(t.columns).every(function(){i.add({active:this.visible(),label:this.title(),value:this.index()})})}var o=this.dt(),i=new l(o,this,{search:t.search,select:t.select}).title(o.i18n("columnControl.colVis",t.title)).handler(function(t,e,n){e&&e.active(!e.active()),r(n)}),r=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.value(),r=o.column(r);n.active()&&!r.visible()?r.visible(!0):!n.active()&&r.visible()&&r.visible(!1)}};return n(),o.on("column-visibility",function(t,e,n,r){n=i.button(n);n&&n.active(r)}),o.on("columns-reordered",function(t,e){i.clear(),n()}),i.element()}},H={defaults:{className:"colVis",columns:"",search:!1,select:!1,text:"Column visibility",title:"Column visibility"},extend:function(t){return{extend:"dropdown",icon:"columns",text:this.dt().i18n("columnControl.colVisDropdown",t.text),content:[Object.assign(t,{extend:"colVis"})]}}},I={defaults:{className:"reorder",icon:"move",text:"Reorder columns"},init:function(t){var n=this,e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.reorder",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),e.init().colReorder||new x.ColReorder(e,{}),r.element()}},G={defaults:{className:"reorderLeft",icon:"moveLeft",text:"Move column left"},init:function(t){var n=this,e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.reorderLeft",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),r.element()}},V={defaults:{className:"reorderRight",icon:"moveRight",text:"Move column right"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.reorderRight",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();t<r.columns().count()-1&&r.colReorder.move(t,t+1)});return this.idx()===r.columns().count()-1&&o.enable(!1),r.on("columns-reordered",function(t,e){o.enable(n.idx()<r.columns().count()-1)}),o.element()}},P={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!1,text:"Toggle ordering"},init:function(r){var o=this,t=this.dt(),i=new f(t,this).text(t.i18n("columnControl.order",r.text)).icon("orderAsc").className(r.className);return r.statusOnly||t.order.listener(i.element(),x.versionCheck("2.3.2")?function(){return[o.idx()]}:this.idx(),function(){}),t.on("order",function(t,e,n){n=n.find(function(t){return t.col===o.idx()});n?"asc"===n.dir?i.active(!0).icon(r.iconAsc):"desc"===n.dir&&i.active(!0).icon(r.iconDesc):i.active(!1).icon(r.iconNone)}),i.element()}},U={defaults:{className:"orderAddAsc",icon:"orderAddAsc",text:"Add Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAddAsc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"asc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},W={defaults:{className:"orderAddDesc",icon:"orderAddDesc",text:"Add Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAddDesc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"desc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},B={defaults:{className:"orderAsc",icon:"orderAsc",text:"Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAsc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"asc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"asc"===t.dir});o.active(n)}),o.element()}},z={defaults:{className:"orderClear",icon:"orderClear",text:"Clear sort"},init:function(t){var e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.orderClear",t.text)).icon(t.icon).className(t.className).handler(function(){e.order([]).draw()});return e.on("order",function(t,e,n){r.enable(0<n.length)}),0===e.order().length&&r.enable(!1),r.element()}},F={defaults:{className:"orderDesc",icon:"orderDesc",text:"Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderDesc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"desc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"desc"===t.dir});o.active(n)}),o.element()}},X={defaults:{className:"orderRemove",icon:"orderRemove",text:"Remove from sort"},init:function(t){var r=this,n=this.dt(),o=new f(n,this).text(n.i18n("columnControl.orderRemove",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.order(),e=t.findIndex(function(t){return t[0]===r.idx()});t.splice(e,1),n.order(t).draw()});return n.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(n)}),o.enable(!1),o.element()}},Z={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!0,text:"Sort status"},extend:function(t){return Object.assign(t,{extend:"order"})}};function s(t,e){var n=v(t);-1===n.indexOf(e)&&(n.push(e),t.rowGroup().dataSrc(n))}function v(t){t=t.rowGroup().dataSrc();return Array.isArray(t)?t:[t]}function _(t){t.rowGroup().dataSrc([])}function b(t,e){var n=v(t),e=n.indexOf(e);-1!==e&&(n.splice(e,1),t.rowGroup().dataSrc(n))}var K={defaults:{className:"rowGroup",icon:"groupTop",order:!0,text:"Group rows"},init:function(e){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",e.text)).icon(e.icon).className(e.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.active()?b(r,t):(_(r),s(r,t),!1!==e.order&&r.order([n.idx(),"asc"])),r.draw()});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.active(t.includes(e))}),o.element()}},Q={defaults:{className:"rowGroupAdd",icon:"groupAdd",order:!0,text:"Add to grouping"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&s(r,t),r.draw()});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.enable(!t.includes(e))}),o.element()}},$={defaults:{className:"rowGroupClear",icon:"groupClear",text:"Clear all grouping"},init:function(t){var e=this.dt(),n=new f(e,this).text(e.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){_(e),e.draw()});return e.on("rowgroup-datasrc",function(){n.enable(0<v(e).length)}),n.enable(0<v(e).length),n.element()}},J={defaults:{className:"rowGroupRemove",icon:"groupRemove",order:!0,text:"Remove from grouping"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&(b(r,t),r.draw())});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.enable(t.includes(e))}),o.enable(!1),o.element()}},g=(w.prototype.addClass=function(t){return this._dom.container.classList.add(t),this},w.prototype.clear=function(){return this.set(this._dom.select.children[0].getAttribute("value"),""),this},w.prototype.clearable=function(t){return t||this._dom.clear.remove(),this},w.prototype.element=function(){return this._dom.container},w.prototype.input=function(){return this._dom.input},w.prototype.options=function(t){for(var e=this._dom.select,n=0;n<t.length;n++)e.add(new Option(t[n].label,t[n].value));return this._dom.typeIcon.innerHTML=c[t[0].value],this},w.prototype.placeholder=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.placeholder=t.replace("[title]",e)),this},w.prototype.runSearch=function(){var t=this._dom,e="empty"===t.select.value||"notEmpty"===t.select.value||""!==t.input.value;t.container.classList.toggle("dtcc-search_active",e),!this._search||this._lastValue===t.input.value&&this._lastType===t.select.value||(this._search(t.select.value,t.input.value,this._loadingState),this._lastValue=t.input.value,this._lastType=t.select.value)},w.prototype.search=function(t){return this._search=t,this._stateLoad(this._dt.state.loaded()),this},w.prototype.set=function(t,e){var n=this._dom;return n.input.value=e,n.select.value=t,n.typeIcon.innerHTML=c[n.select.value],this.runSearch(),this},w.prototype.sspTransform=function(t){return this._sspTransform=t,this},w.prototype.sspData=function(t){return this._sspData=t,this},w.prototype.title=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.title.innerHTML=t.replace("[title]",e)),this},w.prototype.titleAttr=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.title=t.replace("[title]",e)),this},w.prototype.type=function(t){return this._type=t,this},w.prototype._stateLoad=function(t){var e=this._dom,n=this._idx,n=null==(t=null==(t=null==t?void 0:t.columnControl)?void 0:t[n])?void 0:t.searchInput;n&&(this._loadingState=!0,e.select.value=n.logic,e.input.value=n.value,e.select.dispatchEvent(new Event("input")),this._loadingState=!1)},w.classes={container:["dtcc-content","dtcc-search"],input:"",select:""},w);function w(n,t){function e(){i.runSearch()}function r(){s.typeIcon.innerHTML=c[s.select.value],i.runSearch()}function o(){i.clear()}var i=this,s=(this._type="text",this._sspTransform=null,this._sspData={},this._dt=n,this._idx=t,this._dom={clear:y("span","dtcc-search-clear",c.x),container:y("div",w.classes.container),typeIcon:y("div","dtcc-search-type-icon"),searchIcon:y("div","dtcc-search-icon",c.search),input:y("input",w.classes.input),inputs:y("div"),select:y("select",w.classes.select),title:y("div","dtcc-search-title")},this._dom),a=t;s.input.setAttribute("type","text"),s.container.append(s.title,s.inputs),s.inputs.append(s.typeIcon,s.select,s.searchIcon,s.clear,s.input);s.input.addEventListener("input",e),s.select.addEventListener("input",r),s.clear.addEventListener("click",o),n.on("destroy",function(){s.input.removeEventListener("input",e),s.select.removeEventListener("input",r),s.clear.removeEventListener("click",o)}),n.on("stateSaveParams.DT",function(t,e,n){n.columnControl||(n.columnControl={}),n.columnControl[i._idx]||(n.columnControl[i._idx]={}),n.columnControl[i._idx].searchInput={logic:s.select.value,type:i._type,value:s.input.value}}),n.on("stateLoaded.DT",function(t,e,n){i._stateLoad(n)}),n.on("columns-reordered.DT",function(t,e){i._idx=n.colReorder.transpose(a,"fromOriginal")}),n.on("cc-search-clear.DT",function(t,e){e===i._idx&&(i._loadingState=!0,i.clear(),i._loadingState=!1)}),n.page.info().serverSide&&n.on("preXhr.DT",function(t,e,n){n.columns[i._idx].columnControl||(n.columns[i._idx].columnControl={});var r=i._dom.input.value;i._sspTransform&&(r=i._sspTransform(r)),n.columns[i._idx].columnControl.search=Object.assign({value:r,logic:i._dom.select.value,type:i._type},i._sspData)})}var C={defaults:{clear:!0,format:"",mask:"",placeholder:"",title:"",titleAttr:""},init:function(s){var a,c=this,l=!1,u=x.use("moment"),d=x.use("luxon"),h=this.dt(),t="columnControl.search.datetime.",p="",f="",e=new g(h,this.idx()).type("date").addClass("dtcc-searchDateTime").sspTransform(function(t){var e=p,n=u,r=d;return""===t?"":"YYYY-MM-DD"!==e&&n?n.utc(t,e).toISOString():"YYYY-MM-DD"!==e&&r?r.DateTime.fromFormat(t,e).toISO():t=t.replace(/\//g,"-")}).sspData({mask:s.mask}).clearable(s.clear).placeholder(s.placeholder).title(s.title).titleAttr(s.titleAttr).options([{label:h.i18n(t+"equal","Equals"),value:"equal"},{label:h.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:h.i18n(t+"greater","After"),value:"greater"},{label:h.i18n(t+"less","Before"),value:"less"},{label:h.i18n(t+"empty","Empty"),value:"empty"},{label:h.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(h.page.info().serverSide)n||h.draw();else{var r=s.mask,o=h.column(c.idx()),i=""===e?"":A(a&&l?a.val():e.trim(),p,u,d,r);if("empty"===t)o.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)o.search.fixed("dtcc",function(t){return!!t});else{if(""===o.search.fixed("dtcc")&&""===i)return;i?"equal"===t?o.search.fixed("dtcc",function(t){return A(t,f,u,d,r)==i}):"notEqual"===t?o.search.fixed("dtcc",function(t){return A(t,f,u,d,r)!=i}):"greater"===t?o.search.fixed("dtcc",function(t){return A(t,f,u,d,r)>i}):"less"===t&&o.search.fixed("dtcc",function(t){return A(t,f,u,d,r)<i}):o.search.fixed("dtcc","")}s._parents&&s._parents.forEach(function(t){return t.activeList(c.unique(),!!o.search.fixed("dtcc"))}),n||o.draw()}});return h.ready(function(){var t=x.use("datetime");f=((t,e)=>{var n=t.column(e).type();if(n)if("datetime"===n){t=t.settings()[0].aoColumns[e].mRender,e=t("1999-08-07T23:05:04Z","display"),t=t("1999-08-07T03:05:04Z","display").includes("03");if(x.use("moment"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","A").replace("pm","a").replace("07","DD").replace("7","D").replace("08","MM").replace("8","M").replace("1999","YYYY").replace("99","YY");if(x.use("luxon"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","a").replace("07","dd").replace("7","d").replace("08","MM").replace("8","M").replace("1999","yyyy").replace("99","yy");if(e.includes("23")&&e.includes("1999"))return"YYYY-MM-DD hh:mm:ss";if(e.includes("23"))return"hh:mm:ss"}else{if(n.includes("datetime-"))return n.replace(/datetime-/g,"");if(n.includes("moment"))return n.replace(/moment-/g,"");if(n.includes("luxon"))return n.replace(/luxon-/g,"")}return"YYYY-MM-DD"})(h,c.idx()),p=s.format||f,t&&(a=new t(e.input(),{format:p,i18n:h.settings()[0].oLanguage.datetime,onChange:function(){l=!0,e.runSearch(),l=!1}}))}),e.element()}};function A(t,e,n,r,o){return""===t?"":(n=t instanceof Date?t:"YYYY-MM-DD"!==e&&(n||r)?new Date(n?1e3*n(t,e).unix():r.DateTime.fromFormat(t,e).toMillis()):new Date(t.replace(/\//g,"-")),o&&(o.includes("YYYY")||n.setFullYear(1970),o.includes("MM")||n.setUTCMonth(0),o.includes("DD")||n.setUTCDate(1),o.includes("hh")||n.setUTCHours(0),o.includes("mm")||n.setUTCMinutes(0),o.includes("ss")||n.setUTCSeconds(0),o.includes("sss")||n.setUTCMilliseconds(0)),n.getTime())}function M(t,e){var n=t.values();t.clear();for(var r=0;r<e.length;r++)"object"==typeof e[r]?t.add({active:!1,label:e[r].label,value:e[r].value},r===e.length-1):t.add({active:!1,label:e[r],value:e[r]},r===e.length-1);n.length&&t.values(n)}function L(t,e){t=null==(e=null==(e=null==e?void 0:e.columnControl)?void 0:e[t])?void 0:e.searchList;if(t)return t}function tt(t,e){var n=null==(n=t.ajax.json())?void 0:n.columnControl,t=t.column(e),r=t.name(),t=t.dataSrc();return n&&n[r]?n[r]:n&&"string"==typeof t&&n[t]?n[t]:n&&n[e]?n[e]:null}function N(t,e,n,r,o){var i=null==(i=t.ajax.json())?void 0:i.columnControl,s=[],a=tt(t,n);if(a)s=a;else{if(i&&e.ajaxOnly)return void(e.hidable&&(r.element().style.display="none",e._parents)&&e._parents.forEach(function(t){return t.checkDisplay()}));if(!t.page.info().serverSide)for(var c={},l=t.rows({order:n}).indexes().toArray(),u=t.settings()[0],d=0;d<l.length;d++){var h=u.fastData(l[d],n,"filter"),h=null!=h?h.toString():"";c[h]||(c[h]=!0,s.push({label:u.fastData(l[d],n,e.orthogonal),value:h}))}}M(r,s),o&&r.values(o)}var D={defaults:{ajaxOnly:!0,className:"searchList",hidable:!0,options:null,orthogonal:"display",search:!0,select:!0,title:""},init:function(r){function o(e){var t;a.page.info().serverSide||(t=a.column(i.idx()),e&&(0===e.length?t.search.fixed("dtcc-list",""):t.search.fixed("dtcc-list",function(t){return e.includes(t)}),r._parents)&&r._parents.forEach(function(t){return t.activeList(i.unique(),!!e.length)}))}var i=this,s=null,a=this.dt(),c=new l(a,this,{search:r.search,select:r.select}).searchListener(a).title(a.i18n("columnControl.searchList",r.title).replace("[title]",a.column(this.idx()).title())).handler(function(t,e,n,r){e&&e.active(!e.active()),o(c.values()),r&&a.draw()});return r.options?M(c,r.options):(a.ready(function(){N(a,r,i.idx(),c,s)}),a.on("xhr",function(t,e,n){a.one("draw",function(){N(a,r,i.idx(),c,s)})})),a.page.info().serverSide&&a.on("preXhr.DT",function(t,e,n){n.columns[i.idx()].columnControl||(n.columns[i.idx()].columnControl={}),n.columns[i.idx()].columnControl.list=Object.assign({},c.values())}),a.on("stateLoaded",function(t,e,n){n=L(i.idx(),n);n&&(c.values(n),o(n))}),a.on("stateSaveParams",function(t,e,n){var r=i.idx();n.columnControl||(n.columnControl={}),n.columnControl[r]||(n.columnControl[r]={}),n.columnControl[r].searchList=a.ready()?c.values():s}),a.settings()[0].aoColumns[this.idx()].columnControlSearchList=function(t){"refresh"===t?N(a,r,i.idx(),c,null):M(c,t)},s=L(this.idx(),a.state.loaded()),o(s),c.element()}},E={defaults:{clear:!0,placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,s=this.dt(),t="columnControl.search.number.",t=new g(s,this.idx()).type("num").addClass("dtcc-searchNumber").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:s.i18n(t+"equal","Equals"),value:"equal"},{label:s.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:s.i18n(t+"greater","Greater than"),value:"greater"},{label:s.i18n(t+"greaterOrEqual","Greater or equal"),value:"greaterOrEqual"},{label:s.i18n(t+"less","Less than"),value:"less"},{label:s.i18n(t+"lessOrEqual","Less or equal"),value:"lessOrEqual"},{label:s.i18n(t+"empty","Empty"),value:"empty"},{label:s.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(s.page.info().serverSide)n||s.draw();else{var r=s.column(i.idx());if("empty"===t)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===e)return;""===e?r.search.fixed("dtcc",""):"equal"===t?r.search.fixed("dtcc",function(t){return S(t)==e}):"notEqual"===t?r.search.fixed("dtcc",function(t){return S(t)!=e}):"greater"===t?r.search.fixed("dtcc",function(t){return S(t)>e}):"greaterOrEqual"===t?r.search.fixed("dtcc",function(t){return S(t)>=e}):"less"===t?r.search.fixed("dtcc",function(t){return S(t)<e}):"lessOrEqual"===t&&r.search.fixed("dtcc",function(t){return S(t)<=e})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),n||r.draw()}});return t.input().setAttribute("inputmode","numeric"),t.input().setAttribute("pattern","[0-9]*"),t.element()}},et=/<([^>]*>)/g,nt=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;function S(t){var e;return 0===t||t&&"-"!==t?"number"==(e=typeof t)||"bigint"==e?t:+(t=t.replace?t.replace(et,"").replace(nt,""):t):-1/0}var q={defaults:{clear:!0,placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,s=this.dt(),t="columnControl.search.text.";return new g(s,this.idx()).addClass("dtcc-searchText").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:s.i18n(t+"contains","Contains"),value:"contains"},{label:s.i18n(t+"notContains","Does not contain"),value:"notContains"},{label:s.i18n(t+"equal","Equals"),value:"equal"},{label:s.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:s.i18n(t+"starts","Starts"),value:"starts"},{label:s.i18n(t+"ends","Ends"),value:"ends"},{label:s.i18n(t+"empty","Empty"),value:"empty"},{label:s.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(s.page.info().serverSide)n||s.draw();else{var r=s.column(i.idx());if(e=e.toLowerCase(),"empty"===t)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===e)return;""===e?r.search.fixed("dtcc",""):"equal"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase()==e}):"notEqual"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase()!=e}):"contains"===t?r.search.fixed("dtcc",e):"notContains"===t?r.search.fixed("dtcc",function(t){return!t.toLowerCase().includes(e)}):"starts"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase().startsWith(e)}):"ends"===t&&r.search.fixed("dtcc",function(t){return t.toLowerCase().endsWith(e)})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),n||r.draw()}}).element()}},r={colVis:r,colVisDropdown:H,dropdown:p,reorder:I,reorderLeft:G,reorderRight:V,rowGroup:K,rowGroupAdd:Q,rowGroupClear:$,rowGroupRemove:J,order:P,orderAddAsc:U,orderAddDesc:W,orderAsc:B,orderClear:z,orderDesc:F,orderRemove:X,orderStatus:Z,search:{defaults:{allowSearchList:!1},init:function(n){function e(t){var e=tt(i,s);return n.allowSearchList&&e?D.init.call(o,Object.assign({},D.defaults,n)):"date"===t||t.startsWith("datetime")?C.init.call(o,Object.assign({},C.defaults,n)):t.includes("num")?E.init.call(o,Object.assign({},E.defaults,n)):q.init.call(o,Object.assign({},q.defaults,n))}var r,o=this,i=this.dt(),s=this.idx(),t=null==(t=null==(t=null==(t=i.state.loaded())?void 0:t.columnControl)?void 0:t[s])?void 0:t.searchInput;return t?r=e(t.type):(r=u.createElement("div"),i.ready(function(){var t=i.column(s),t=e(t.type());r.replaceWith(t)})),r}},searchClear:{defaults:{className:"searchClear",icon:"searchClear",text:"Clear Search"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.searchClear",t.text)).icon(t.icon).className(t.className).handler(function(){r.column(n.idx()).columnControl.searchClear().draw()}).enable(!1);return r.on("draw",function(){var t=r.column(n.idx()).search.fixed("dtcc"),e=r.column(n.idx()).search.fixed("dtcc-list");o.enable(!(!t&&!e))}),o.element()}},searchDropdown:{defaults:{ajaxOnly:!0,allowSearchList:!0,className:"searchDropdown",clear:!0,columns:"",hidable:!0,options:null,orthogonal:"display",placeholder:"",search:!0,select:!0,text:"Search",title:"",titleAttr:""},extend:function(t){return{extend:"dropdown",icon:"search",text:this.dt().i18n("columnControl.searchDropdown",t.text),content:[Object.assign(t,{extend:"search"})]}}},searchDateTime:C,searchList:D,searchNumber:E,searchText:q,spacer:{defaults:{className:"dtcc-spacer",text:""},init:function(t){var e=this.dt(),e=y("div",t.className,e.i18n("columnControl.spacer",t.text));return e.setAttribute("role","separator"),e}},title:{defaults:{className:"dtcc-title",text:null},init:function(t){var e=this.dt().column(this.idx()).title(),n=null===t.text?"[title]":t.text;return y("div",t.className,n.replace("[title]",e))}}},T=(k.prototype.destroyAdd=function(t){this._s.toDestroy.push(t)},k.prototype.destroyRemove=function(t){t=this._s.toDestroy.indexOf(t);-1!==t&&this._s.toDestroy.splice(t,1)},k.prototype.dt=function(){return this._dt},k.prototype.idx=function(){return this._s.columnIdx},k.prototype.resolve=function(t){var e=null,n=null,r=null;if("string"==typeof t?(e=k.content[r=t],n=Object.assign({},null==e?void 0:e.defaults)):Array.isArray(t)?(e=k.content[r="dropdown"],n=Object.assign({},null==e?void 0:e.defaults,{content:t})):t.extend&&(r=t.extend,e=k.content[r],n=Object.assign({},null==e?void 0:e.defaults,t)),e)return e.extend?(t=e.extend.call(this,n),this.resolve(t)):{config:n,type:r,plugin:e};throw new Error("Unknown ColumnControl content type: "+r)},k.prototype.unique=function(){return this._s.unique},k.prototype._target=function(){var t,e,n=this._c.target,r=this._dt.column(this._s.columnIdx),o="header";return"number"==typeof n?t=r.header(n):(e="tfoot"!==(n=n.split(":"))[0],n=n[1]?parseInt(n[1]):0,e?t=r.header(n):(t=r.footer(n),o="footer")),t.querySelector("div.dt-column-"+o)},k.Button=f,k.CheckList=l,k.SearchInput=g,k.content=r,k.defaults={className:"",content:null,target:0},k.icons=c,k.version="1.1.0",k);function k(n,t,e){var r=this,o=(this._dom={target:null,wrapper:null},this._c={},this._s={columnIdx:null,unique:null,toDestroy:[]},this._dt=n,this._s.columnIdx=t,this._s.unique=Math.random(),t);Object.assign(this._c,k.defaults,e),this._dom.target=this._target(),e.className&&i(this._dom.target.closest("tr"),e.className),this._c.content&&(n.on("columns-reordered",function(t,e){r._s.columnIdx=n.colReorder.transpose(o,"fromOriginal")}),this._dom.wrapper=u.createElement("span"),this._dom.wrapper.classList.add("dtcc"),this._dom.target.appendChild(this._dom.wrapper),this._c.content.forEach(function(t){t=r.resolve(t),t=t.plugin.init.call(r,t.config);r._dom.wrapper.appendChild(t)}),n.on("destroy",function(){r._s.toDestroy.slice().forEach(function(t){t.destroy()}),r._dom.wrapper.remove()}))}function rt(){var n=this;return this.iterator("column",function(t,e){n.trigger("cc-search-clear",[e])})}function O(t,e){var n=T.defaults.target;if(ot(e)){if(n===t)return{target:n,content:e}}else if(Array.isArray(e))for(var r=0;r<e.length;r++){var o=e[r];if(ot(o)){if(n===t)return{target:n,content:o}}else if(R(o)){if(t===(void 0!==o.target?o.target:n))return o}else if(t===n)return{target:n,content:e}}else if("object"==typeof e)if(R(e)){if(t===(void 0!==e.target?e.target:n))return e}else if(t===n)return{target:n,content:e}}function j(e,t){function n(t){e.includes(t)||e.push(t)}return Array.isArray(t)?0===t.length?n(T.defaults.target):t.forEach(function(t){n(("object"==typeof t&&void 0!==t.target?t:T.defaults).target)}):"object"==typeof t&&n((void 0!==t.target?t:T.defaults).target),e}function R(t){return"object"==typeof t&&void 0!==t.target}function ot(t){var e=!1;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(R(t[n])){e=!0;break}return!e}}return x.ColumnControl=T,t(u).on("i18n.dt",function(t,e){if("dt"===t.namespace){var n=new x.Api(e),t=n.table().header(),r=e.oInit.columnControl,o=T.defaults,i=[],s={};t.querySelectorAll("tr").length<=1&&null===e.titleRow&&(e.titleRow=0),j(i,r),T.defaults.content&&j(i,o),n.columns().every(function(t){var e=this.init().columnControl;j(i,e)});for(var a=0;a<i.length;a++){v=m=f=p=h=d=u=l=c=void 0;var c=s,l=i[a],u=n;if(!c[l]){var d=!0,h=0,p=("number"==typeof l?h=l:("tfoot"===(p=l.split(":"))[0]&&(d=!1),p[1]&&(h=parseInt(p[1]))),d?u.table().header():u.table().footer());if(!p.querySelectorAll("tr")[h]){var f=u.columns().count(),m=y("tr");m.setAttribute("data-dt-order","disable");for(var v=0;v<f;v++)m.appendChild(y("td"));p.appendChild(m)}c[l]=!0}}}}),t(u).on("preInit.dt",function(t,e){var a,c,l,u;"dt"===t.namespace&&(a=new x.Api(e),c=e.oInit.columnControl,l=T.defaults,j(u=[],c),T.defaults.content&&j(u,l),a.columns().every(function(t){for(var e=this.init().columnControl,n=j(u.slice(),e),r=0;r<n.length;r++){var o=O(n[r],e),i=O(n[r],c),s=O(n[r],l);(s||i||o)&&new T(a,this.index(),Object.assign({},s||{},i||{},o||{}))}}))}),x.Api.registerPlural("columns().columnControl.searchClear()","column().columnControl.searchClear()",rt),x.Api.registerPlural("columns().ccSearchClear()","column().ccSearchClear()",rt),x.Api.registerPlural("columns().columnControl.searchList()","column().columnControl.searchList()",function(n){return this.iterator("column",function(t,e){t.aoColumns[e].columnControlSearchList(n)})}),x.ext.buttons.ccSearchClear={text:function(t){return t.i18n("columnControl.buttons.searchClear","Clear search")},init:function(n,t,e){var r=this;n.on("draw.DT",function(){var t=!1,e=!!n.search();e||n.columns().every(function(){(this.search.fixed("dtcc")||this.search.fixed("dtcc-list"))&&(t=!0)}),r.enable(e||t)}),this.enable(!1)},action:function(t,e,n,r){e.search(""),e.columns().columnControl.searchClear(),e.draw()}},x});
|
|
8
|
+
(n=>{var r,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),o=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||r(t),o(t,e),n(e,0,t.document)}:(o(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)})(function(t,o,u){var x=t.fn.dataTable;function y(t,e,n,r){void 0===e&&(e=[]),void 0===n&&(n=null),void 0===r&&(r=[]);var o=u.createElement(t);return i(o,e),n&&(o.innerHTML=n),r.forEach(function(t){o.appendChild(t)}),o}function i(e,t){t&&(t=Array.isArray(t)?t:[t]).forEach(function(t){e&&t&&e.classList.add(t)})}function e(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+t+"</svg>"}var c={chevronRight:e('<path d="m9 18 6-6-6-6"/>'),columns:e('<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="M15 3v18"/>'),contains:e('<path d="M10 3h4v18h-4z"/><path d="M18 8h3v9h-3"/><path d="M6 17H3V8h3"/>'),empty:e('<circle cx="12" cy="12" r="10"/>'),ends:e('<path d="M21 3h-4v18h4z"/><path d="M13 8H3v9h10"/>'),equal:e('<line x1="5" x2="19" y1="9" y2="9"/><line x1="5" x2="19" y1="15" y2="15"/>'),greater:e('<path d="m9 18 6-6-6-6"/>'),greaterOrEqual:e('<path d="m9 16 6-6-6-6"/><path d="m9 21 6-6"/>'),groupAdd:e('<path d="M6 21v-7.5m-3.549 3.75H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" fill="currentColor" rx="1.5"/>'),groupClear:e('<rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupTop:e('<rect width="13.5" height="7.5" x="3" y="3" fill="currentColor" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupRemove:e('<path d="M2.451 17.25H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),less:e('<path d="m15 18-6-6 6-6"/>'),lessOrEqual:e('<path d="m15 16-6-6 6-6"/><path d="m15 21-6-6"/>'),menu:e('<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>'),move:e('<line x1="12" x2="12" y1="3" y2="21"/><polyline points="8 8 4 12 8 16"/><polyline points="16 16 20 12 16 8"/>'),moveLeft:e('<path d="m9 6-6 6 6 6"/><path d="M3 12h14"/><path d="M21 19V5"/>'),moveRight:e('<path d="M3 5v14"/><path d="M21 12H7"/><path d="m15 18 6-6-6-6"/>'),notContains:e('<path d="M15 4 9 20"/><path d="M3 8h18v9H3z"/>'),notEmpty:e('<circle cx="12" cy="12" r="10"/><line x1="9" x2="15" y1="15" y2="9"/>'),notEqual:e('<path d="M5 9h14"/><path d="M5 15h14"/><path d="M15 5 9 19"/>'),orderAddAsc:e('<path d="M17 21v-8"/><path d="M3 4h6"/><path d="M3 8h9"/><path d="M3 12h10"/><path d="M13 17h8"/>'),orderAddDesc:e('<path d="M17 21v-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderAsc:e('<path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h4"/><path d="M11 16h7"/><path d="M11 20h10"/>'),orderClear:e('<path d="m21 21-8-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="m13 21 8-8"/>'),orderDesc:e('<path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/>'),orderRemove:e('<path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderNone:e('<path d="m3 8 4-4 4 4"/><path d="m11 16-4 4-4-4"/><path d="M7 4v16"/><path d="M15 8h6"/><path d="M15 16h6"/><path d="M13 12h8"/>'),search:e('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),searchClear:e('<path d="m13.5 8.5-5 5"/><path d="m8.5 8.5 5 5"/><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),starts:e('<path d="M3 3h4v18H3z"/><path d="M11 8h10v9H11"/>'),tick:e('<path d="M20 6 9 17l-5-5"/>'),x:e('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')};function a(t,e){return e.closest("div.dtfh-floatingparent")||t.table().container()}function d(t,e,n){var r=n.closest("div.dt-column-header"),e=a(e,n),r=getComputedStyle(r),o=t.offsetWidth,i=((t,e)=>{for(var n=0,r=0;e&&e!==t&&e!==u.body;)n+=e.offsetTop,r+=e.offsetLeft,e.scrollTop&&(r-=e.scrollTop),e.scrollLeft&&(r-=e.scrollLeft),e=e.offsetParent;return{top:n,left:r}})(e,n),s=i.top+n.offsetHeight,r="row-reverse"===r.flexDirection?i.left:i.left-o+n.offsetWidth,i=e.offsetWidth;i<r+o&&(r-=r+o-i),r<0&&(r=0),t.style.top=s+"px",t.style.left=r+"px"}function h(n,t,e){function r(t){var e;n._shown?t.target===n||n.contains(t.target)||(e=u.querySelector("div.dt-datetime"))&&(t.target===e||e.contains(t.target))||(n._close(),u.body.removeEventListener("click",r)):u.body.removeEventListener("click",r)}var o=a(t,e.element());n._shown=!0,o.append(n),d(n,t,e.element()),e.element().setAttribute("aria-expanded","true");u.body.addEventListener("click",r)}var p={classes:{container:"dtcc-dropdown",liner:"dtcc-dropdown-liner"},defaults:{className:"dropdown",content:[],icon:"menu",text:"More..."},init:function(n){var r=this.dt(),o=y("div",p.classes.container,"",[y("div",p.classes.liner)]),t=(o._shown=!1,o._close=function(){o.remove(),o._shown=!1,i.element().setAttribute("aria-expanded","false")},o.setAttribute("role","dialog"),o.setAttribute("aria-label",r.i18n("columnControl.dropdown",n.text)),r.on("fixedheader-mode",function(){o._shown&&h(o,r,n._parents?n._parents[0]:i)}),o.childNodes[0]),i=new f(r,this).text(r.i18n("columnControl.dropdown",n.text)).icon(n.icon).className(n.className).dropdownDisplay(t).handler(function(t){var e;t._closed&&t._closed.includes(o)||(h(o,r,n._parents?n._parents[0]:i),(e=o.querySelector("input, a, button"))&&"keypress"===t.type&&e.focus())});i.element().setAttribute("aria-haspopup","dialog"),i.element().setAttribute("aria-expanded","false");for(var e=0;e<n.content.length;e++){var s=this.resolve(n.content[e]),s=(s.config._parents||(s.config._parents=[]),s.config._parents.push(i),s.plugin.init.call(this,s.config));t.appendChild(s)}n._parents&&n._parents.length&&i.extra("chevronRight"),r.on("columns-reordered",function(){d(o,r,i.element())});function a(t){var e,n;c._shown&&(e=Array.from(c.querySelectorAll("a, button, input, select")),n=u.activeElement,"Escape"===t.key?(c._close(),l.focus()):"Tab"===t.key&&0!==e.length&&(e.includes(n)?t.shiftKey?n===e[0]&&(e[e.length-1].focus(),t.preventDefault()):n===e[e.length-1]&&(e[0].focus(),t.preventDefault()):(e[0].focus(),t.preventDefault())))}var c,l;c=o,l=i.element();return u.body.addEventListener("keydown",a),r.on("destroy",function(){u.body.removeEventListener("keydown",a)}),i.element()}},R=0,f=(n.prototype.active=function(t){return void 0===t?this._s.active:(this._s.active=t,this._checkActive(),this)},n.prototype.activeList=function(t,e){return this._s.activeList[t]=e,this._checkActive(),this},n.prototype.checkDisplay=function(){for(var t=0,e=this._dom.dropdownDisplay.childNodes,n=0;n<e.length;n++)"none"!==e[n].style.display&&t++;return 0===t&&(this._dom.button.style.display="none"),this},n.prototype.className=function(t){return this._dom.button.classList.add("dtcc-button_"+t),this},n.prototype.destroy=function(){this._s.buttonClick&&(this._dom.button.removeEventListener("click",this._s.buttonClick),this._dom.button.removeEventListener("keypress",this._s.buttonClick)),this._s.host.destroyRemove(this)},n.prototype.dropdownDisplay=function(t){return this._dom.dropdownDisplay=t,this},n.prototype.element=function(){return this._dom.button},n.prototype.enable=function(t){return void 0===t?this._s.enabled:(this._dom.button.classList.toggle("dtcc-button_disabled",!t),this._s.enabled=t,this)},n.prototype.extra=function(t){return this._dom.extra.innerHTML=t?c[t]:"",this},n.prototype.handler=function(n){function t(t){var e;void 0===(e=t)&&(e=null),u.querySelectorAll("div.dtcc-dropdown").forEach(function(t){null!==e&&t.contains(e.target)||(t._close(),e._closed||(e._closed=[]),e._closed.push(t))}),t.stopPropagation(),t.preventDefault(),r._s.enabled&&n(t)}var r=this;return this._s.buttonClick=t,this._s.namespace="dtcc-"+R++,this._dom.button.addEventListener("click",t),this._dom.button.addEventListener("keypress",t),this._s.host.destroyAdd(this),this},n.prototype.icon=function(t){return this._dom.icon.innerHTML=t?c[t]:"",this},n.prototype.text=function(t){return void 0===t?this._s.label:(this._dom.text.innerHTML=t,this._s.label=t,this._dom.button.setAttribute("aria-label",t),this)},n.prototype.value=function(t){return void 0===t?this._s.value:(this._s.value=t,this)},n.prototype._checkActive=function(){return!0===this._s.active||Object.values(this._s.activeList).includes(!0)?(this._dom.state.innerHTML=c.tick,this._dom.button.classList.add("dtcc-button_active")):(this._dom.state.innerHTML="",this._dom.button.classList.remove("dtcc-button_active")),this},n.classes={container:"dtcc-button"},n);function n(t,e){this._s={active:!1,activeList:[],buttonClick:null,dt:null,enabled:!0,host:null,label:"",namespace:"",value:null},this._s.dt=t,this._s.host=e,this._dom={button:y("button",n.classes.container),dropdownDisplay:null,extra:y("span","dtcc-button-extra"),icon:y("span","dtcc-button-icon"),state:y("span","dtcc-button-state"),text:y("span","dtcc-button-text")},this._dom.button.setAttribute("type","button"),this._dom.button.append(this._dom.icon),this._dom.button.append(this._dom.text),this._dom.button.append(this._dom.state),this._dom.button.append(this._dom.extra),this.enable(!0)}l.prototype.add=function(n,t){for(var r=this,o=(Array.isArray(n)||(n=[n]),this),e=0;e<n.length;e++)(t=>{var t=n[t],e=new f(o._s.dt,o._s.host).active(t.active||!1).handler(function(t){r._s.handler(t,e,r._s.buttons,!0),r._updateCount()}).icon(t.icon||"").text(""!==t.label?t.label:o._s.dt.i18n("columnControl.list.empty","Empty")).value(t.value);""===t.label&&e.className("empty"),o._s.buttons.push(e)})(e);var i=this._s.buttons.length;return!0!==t&&void 0!==t||(this._dom.selectAllCount.innerHTML=i?"("+i+")":"",this._redraw()),this},l.prototype.button=function(t){for(var e=this._s.buttons,n=0;n<e.length;n++)if(e[n].value()===t)return e[n];return null},l.prototype.clear=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].destroy();return this._dom.buttons.replaceChildren(),this._s.buttons.length=0,this},l.prototype.element=function(){return this._dom.container},l.prototype.handler=function(t){return this._s.handler=t,this},l.prototype.searchListener=function(t){var n=this;return t.on("cc-search-clear",function(t,e){e===n._s.host.idx()&&(n.selectNone(),n._s.handler(t,null,n._s.buttons,!1),n._s.search="",n._dom.search.value="",n._redraw(),n._updateCount())}),this},l.prototype.selectAll=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!0);return this},l.prototype.selectNone=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!1);return this},l.prototype.title=function(t){return this._dom.title.innerHTML=t,this},l.prototype.values=function(t){var e,n=[],r=this._s.buttons;if(void 0!==t){for(e=0;e<r.length;e++)t.includes(r[e].value())&&r[e].active(!0);return this._updateCount(),this}for(e=0;e<r.length;e++)r[e].active()&&n.push(r[e].value());return n},l.prototype._updateCount=function(){var t=this.values().length;this._dom.selectNoneCount.innerHTML=t?"("+t+")":""},l.prototype._redraw=function(){var t=this._s.buttons,e=this._dom.buttons,n=this._s.search.toLowerCase();e.replaceChildren();for(var r=0;r<t.length;r++){var o=t[r];n&&!o.text().toLowerCase().includes(n)||e.appendChild(o.element())}this._dom.empty.style.display=0===t.length?"block":"none",e.style.display=0<t.length?"block":"none"},l.classes={container:"dtcc-list",input:"dtcc-list-search"};var m=l;function l(t,e,n){function r(){s._s.search=a.search.value,s._redraw()}function o(t){s.selectAll(),s._s.handler(t,null,s._s.buttons,!0),s._updateCount()}function i(t){s.selectNone(),s._s.handler(t,null,s._s.buttons,!0),s._updateCount()}var s=this,a=(this._s={buttons:[],dt:null,handler:function(){},host:null,search:""},this._s.dt=t,this._s.host=e,this._dom={buttons:y("div","dtcc-list-buttons"),container:y("div",l.classes.container),controls:y("div","dtcc-list-controls"),empty:y("div","dtcc-list-empty",t.i18n("columnControl.list.empty","No options")),title:y("div","dtcc-list-title"),selectAll:y("button","dtcc-list-selectAll",t.i18n("columnControl.list.all","Select all")),selectAllCount:y("span"),selectNone:y("button","dtcc-list-selectNone",t.i18n("columnControl.list.none","Deselect")),selectNoneCount:y("span"),search:y("input",l.classes.input)},this._dom);a.search.setAttribute("type","text"),a.container.append(a.title),a.container.append(a.controls),a.container.append(a.empty),a.container.append(a.buttons),n.select&&(a.controls.append(a.selectAll),a.controls.append(a.selectNone),a.selectAll.append(a.selectAllCount),a.selectNone.append(a.selectNoneCount),a.selectAll.setAttribute("type","button"),a.selectNone.setAttribute("type","button"));n.search&&(a.controls.append(a.search),a.search.setAttribute("placeholder",t.i18n("columnControl.list.search","Search...")),a.search.addEventListener("input",r)),a.selectAll.addEventListener("click",o),a.selectNone.addEventListener("click",i),t.on("destroy",function(){a.selectAll.removeEventListener("click",o),a.selectNone.removeEventListener("click",i),a.search.removeEventListener("input",r)})}var r={defaults:{className:"colVis",columns:"",search:!1,select:!1,title:"Column visibility"},init:function(t){function n(){o.columns(t.columns).every(function(){i.add({active:this.visible(),label:this.title(),value:this.index()})})}var o=this.dt(),i=new m(o,this,{search:t.search,select:t.select}).title(o.i18n("columnControl.colVis",t.title)).handler(function(t,e,n){e&&e.active(!e.active()),r(n)}),r=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.value(),r=o.column(r);n.active()&&!r.visible()?r.visible(!0):!n.active()&&r.visible()&&r.visible(!1)}};return n(),o.on("column-visibility",function(t,e,n,r){n=i.button(n);n&&n.active(r)}),o.on("columns-reordered",function(t,e){i.clear(),n()}),i.element()}},H={defaults:{className:"colVis",columns:"",search:!1,select:!1,text:"Column visibility",title:"Column visibility"},extend:function(t){return{extend:"dropdown",icon:"columns",text:this.dt().i18n("columnControl.colVisDropdown",t.text),content:[Object.assign(t,{extend:"colVis"})]}}},I={defaults:{className:"reorder",icon:"move",text:"Reorder columns"},init:function(t){var n=this,e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.reorder",t.text)).icon(t.icon).className(t.className);return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),e.init().colReorder||new x.ColReorder(e,{}),r.element()}},G={defaults:{className:"reorderLeft",icon:"moveLeft",text:"Move column left"},init:function(t){var n=this,e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.reorderLeft",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),r.element()}},V={defaults:{className:"reorderRight",icon:"moveRight",text:"Move column right"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.reorderRight",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();t<r.columns().count()-1&&r.colReorder.move(t,t+1)});return this.idx()===r.columns().count()-1&&o.enable(!1),r.on("columns-reordered",function(t,e){o.enable(n.idx()<r.columns().count()-1)}),o.element()}},P={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!1,text:"Toggle ordering"},init:function(r){var o=this,t=this.dt(),i=new f(t,this).text(t.i18n("columnControl.order",r.text)).icon("orderAsc").className(r.className);return r.statusOnly||t.order.listener(i.element(),x.versionCheck("2.3.2")?function(){return[o.idx()]}:this.idx(),function(){}),t.on("order",function(t,e,n){n=n.find(function(t){return t.col===o.idx()});n?"asc"===n.dir?i.active(!0).icon(r.iconAsc):"desc"===n.dir&&i.active(!0).icon(r.iconDesc):i.active(!1).icon(r.iconNone)}),i.element()}},U={defaults:{className:"orderAddAsc",icon:"orderAddAsc",text:"Add Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAddAsc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"asc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},W={defaults:{className:"orderAddDesc",icon:"orderAddDesc",text:"Add Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAddDesc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"desc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},B={defaults:{className:"orderAsc",icon:"orderAsc",text:"Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderAsc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"asc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"asc"===t.dir});o.active(n)}),o.element()}},z={defaults:{className:"orderClear",icon:"orderClear",text:"Clear sort"},init:function(t){var e=this.dt(),r=new f(e,this).text(e.i18n("columnControl.orderClear",t.text)).icon(t.icon).className(t.className).handler(function(){e.order([]).draw()});return e.on("order",function(t,e,n){r.enable(0<n.length)}),0===e.order().length&&r.enable(!1),r.element()}},F={defaults:{className:"orderDesc",icon:"orderDesc",text:"Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new f(e,this).text(e.i18n("columnControl.orderDesc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"desc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"desc"===t.dir});o.active(n)}),o.element()}},X={defaults:{className:"orderRemove",icon:"orderRemove",text:"Remove from sort"},init:function(t){var r=this,n=this.dt(),o=new f(n,this).text(n.i18n("columnControl.orderRemove",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.order(),e=t.findIndex(function(t){return t[0]===r.idx()});t.splice(e,1),n.order(t).draw()});return n.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(n)}),o.enable(!1),o.element()}},Z={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!0,text:"Sort status"},extend:function(t){return Object.assign(t,{extend:"order"})}};function s(t,e){var n=v(t);-1===n.indexOf(e)&&(n.push(e),t.rowGroup().dataSrc(n))}function v(t){t=t.rowGroup().dataSrc();return Array.isArray(t)?t:[t]}function _(t){t.rowGroup().dataSrc([])}function g(t,e){var n=v(t),e=n.indexOf(e);-1!==e&&(n.splice(e,1),t.rowGroup().dataSrc(n))}var K={defaults:{className:"rowGroup",icon:"groupTop",order:!0,text:"Group rows"},init:function(e){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",e.text)).icon(e.icon).className(e.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.active()?g(r,t):(_(r),s(r,t),!1!==e.order&&r.order([n.idx(),"asc"])),r.draw()});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.active(t.includes(e))}),o.element()}},Q={defaults:{className:"rowGroupAdd",icon:"groupAdd",order:!0,text:"Add to grouping"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&s(r,t),r.draw()});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.enable(!t.includes(e))}),o.element()}},$={defaults:{className:"rowGroupClear",icon:"groupClear",text:"Clear all grouping"},init:function(t){var e=this.dt(),n=new f(e,this).text(e.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){_(e),e.draw()});return e.on("rowgroup-datasrc",function(){n.enable(0<v(e).length)}),n.enable(0<v(e).length),n.element()}},J={defaults:{className:"rowGroupRemove",icon:"groupRemove",order:!0,text:"Remove from grouping"},init:function(t){var n=this,r=this.dt(),o=new f(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&(g(r,t),r.draw())});return r.on("rowgroup-datasrc",function(){var t=v(r),e=r.column(n.idx()).dataSrc();o.enable(t.includes(e))}),o.enable(!1),o.element()}},b=(w.prototype.addClass=function(t){return this._dom.container.classList.add(t),this},w.prototype.clear=function(){return this.set(this._dom.select.children[0].getAttribute("value"),""),this},w.prototype.clearable=function(t){return t||this._dom.clear.remove(),this},w.prototype.element=function(){return this._dom.container},w.prototype.input=function(){return this._dom.input},w.prototype.options=function(t){for(var e=this._dom.select,n=0;n<t.length;n++)e.add(new Option(t[n].label,t[n].value));return this._dom.typeIcon.innerHTML=c[t[0].value],this},w.prototype.placeholder=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.placeholder=t.replace("[title]",e)),this},w.prototype.runSearch=function(){var t=this._dom,e="empty"===t.select.value||"notEmpty"===t.select.value||""!==t.input.value;t.container.classList.toggle("dtcc-search_active",e),!this._search||this._lastValue===t.input.value&&this._lastType===t.select.value||(this._search(t.select.value,t.input.value,this._loadingState),this._lastValue=t.input.value,this._lastType=t.select.value)},w.prototype.search=function(t){return this._search=t,this._stateLoad(this._dt.state.loaded()),this},w.prototype.set=function(t,e){var n=this._dom;return n.input.value=e,n.select.value=t,n.typeIcon.innerHTML=c[n.select.value],this.runSearch(),this},w.prototype.sspTransform=function(t){return this._sspTransform=t,this},w.prototype.sspData=function(t){return this._sspData=t,this},w.prototype.title=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.title.innerHTML=t.replace("[title]",e)),this},w.prototype.titleAttr=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.title=t.replace("[title]",e)),this},w.prototype.type=function(t){return this._type=t,this},w.prototype._stateLoad=function(t){var e=this._dom,n=this._idx,n=null==(t=null==(t=null==t?void 0:t.columnControl)?void 0:t[n])?void 0:t.searchInput;n&&(this._loadingState=!0,e.select.value=n.logic,e.input.value=n.value,e.select.dispatchEvent(new Event("input")),this._loadingState=!1)},w.classes={container:["dtcc-content","dtcc-search"],input:"",select:""},w);function w(n,t){function e(){i.runSearch()}function r(){s.typeIcon.innerHTML=c[s.select.value],i.runSearch()}function o(){i.clear()}var i=this,s=(this._type="text",this._sspTransform=null,this._sspData={},this._dt=n,this._idx=t,this._dom={clear:y("span","dtcc-search-clear",c.x),container:y("div",w.classes.container),typeIcon:y("div","dtcc-search-type-icon"),searchIcon:y("div","dtcc-search-icon",c.search),input:y("input",w.classes.input),inputs:y("div"),select:y("select",w.classes.select),title:y("div","dtcc-search-title")},this._dom),a=t;s.input.setAttribute("type","text"),s.container.append(s.title,s.inputs),s.inputs.append(s.typeIcon,s.select,s.searchIcon,s.clear,s.input);s.input.addEventListener("input",e),s.select.addEventListener("input",r),s.clear.addEventListener("click",o),n.on("destroy",function(){s.input.removeEventListener("input",e),s.select.removeEventListener("input",r),s.clear.removeEventListener("click",o)}),n.on("stateSaveParams.DT",function(t,e,n){n.columnControl||(n.columnControl={}),n.columnControl[i._idx]||(n.columnControl[i._idx]={}),n.columnControl[i._idx].searchInput={logic:s.select.value,type:i._type,value:s.input.value}}),n.on("stateLoaded.DT",function(t,e,n){i._stateLoad(n)}),n.on("columns-reordered.DT",function(t,e){i._idx=n.colReorder.transpose(a,"fromOriginal")}),n.on("cc-search-clear.DT",function(t,e){e===i._idx&&(i._loadingState=!0,i.clear(),i._loadingState=!1)}),n.page.info().serverSide&&n.on("preXhr.DT",function(t,e,n){var r;n.columns&&n.columns[i._idx]&&(n.columns[i._idx].columnControl||(n.columns[i._idx].columnControl={}),r=i._dom.input.value,i._sspTransform&&(r=i._sspTransform(r)),n.columns[i._idx].columnControl.search=Object.assign({value:r,logic:i._dom.select.value,type:i._type},i._sspData))})}var C={defaults:{clear:!0,excludeLogic:[],format:"",mask:"",placeholder:"",title:"",titleAttr:""},init:function(s){var a,c=this,l=!1,u=x.use("moment"),d=x.use("luxon"),h=this.dt(),t="columnControl.search.datetime.",p="",f="",e=new b(h,this.idx()).type("date").addClass("dtcc-searchDateTime").sspTransform(function(t){var e=p,n=u,r=d;return""===t?"":"YYYY-MM-DD"!==e&&n?n.utc(t,e).toISOString():"YYYY-MM-DD"!==e&&r?r.DateTime.fromFormat(t,e).toISO():t=t.replace(/\//g,"-")}).sspData({mask:s.mask}).clearable(s.clear).placeholder(s.placeholder).title(s.title).titleAttr(s.titleAttr).options([{label:h.i18n(t+"equal","Equals"),value:"equal"},{label:h.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:h.i18n(t+"greater","After"),value:"greater"},{label:h.i18n(t+"less","Before"),value:"less"},{label:h.i18n(t+"empty","Empty"),value:"empty"},{label:h.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!s.excludeLogic.includes(t.value)})).search(function(e,n,t){s._parents&&s._parents.forEach(function(t){return t.activeList(c.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=h.column(c.idx());if(h.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||h.draw();else{var o=s.mask,i=""===n?"":A(a&&l?a.val():n.trim(),p,u,d,o);if("empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===i)return;i?"equal"===e?r.search.fixed("dtcc",function(t){return A(t,f,u,d,o)==i}):"notEqual"===e?r.search.fixed("dtcc",function(t){return A(t,f,u,d,o)!=i}):"greater"===e?r.search.fixed("dtcc",function(t){return A(t,f,u,d,o)>i}):"less"===e&&r.search.fixed("dtcc",function(t){return A(t,f,u,d,o)<i}):r.search.fixed("dtcc","")}t||r.draw()}});return h.ready(function(){var t=x.use("datetime");f=((t,e)=>{var n=t.column(e).type();if(n)if("datetime"===n){t=t.settings()[0].aoColumns[e].mRender,e=t("1999-08-07T23:05:04Z","display"),t=t("1999-08-07T03:05:04Z","display").includes("03");if(x.use("moment"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","A").replace("pm","a").replace("07","DD").replace("7","D").replace("08","MM").replace("8","M").replace("1999","YYYY").replace("99","YY");if(x.use("luxon"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","a").replace("07","dd").replace("7","d").replace("08","MM").replace("8","M").replace("1999","yyyy").replace("99","yy");if(e.includes("23")&&e.includes("1999"))return"YYYY-MM-DD hh:mm:ss";if(e.includes("23"))return"hh:mm:ss"}else{if(n.includes("datetime-"))return n.replace(/datetime-/g,"");if(n.includes("moment"))return n.replace(/moment-/g,"");if(n.includes("luxon"))return n.replace(/luxon-/g,"")}return"YYYY-MM-DD"})(h,c.idx()),p=s.format||f,t&&(a=new t(e.input(),{format:p,i18n:h.settings()[0].oLanguage.datetime,onChange:function(){l=!0,e.runSearch(),l=!1}}))}),e.element()}};function A(t,e,n,r,o){return""===t?"":(n=t instanceof Date?t:"YYYY-MM-DD"!==e&&(n||r)?new Date(n?1e3*n(t,e).unix():r.DateTime.fromFormat(t,e).toMillis()):new Date(t.replace(/\//g,"-")),o&&(o.includes("YYYY")||n.setFullYear(1970),o.includes("MM")||n.setUTCMonth(0),o.includes("DD")||n.setUTCDate(1),o.includes("hh")||n.setUTCHours(0),o.includes("mm")||n.setUTCMinutes(0),o.includes("ss")||n.setUTCSeconds(0),o.includes("sss")||n.setUTCMilliseconds(0)),n.getTime())}function L(t,e){var n=t.values();t.clear();for(var r=0;r<e.length;r++)"object"==typeof e[r]?t.add({active:!1,label:e[r].label,value:e[r].value},r===e.length-1):t.add({active:!1,label:e[r],value:e[r]},r===e.length-1);n.length&&t.values(n)}function M(t,e){t=null==(e=null==(e=null==e?void 0:e.columnControl)?void 0:e[t])?void 0:e.searchList;if(t)return t}function tt(t,e){var n=null==(n=t.ajax.json())?void 0:n.columnControl,t=t.column(e),r=t.name(),t=t.dataSrc();return n&&n[r]?n[r]:n&&"string"==typeof t&&n[t]?n[t]:n&&n[e]?n[e]:null}function N(t,e,n,r,o){var i=null==(i=t.ajax.json())?void 0:i.columnControl,s=[],a=tt(t,n);if(a)s=a;else{if(i&&e.ajaxOnly)return void(e.hidable&&(r.element().style.display="none",e._parents)&&e._parents.forEach(function(t){return t.checkDisplay()}));if(!t.page.info().serverSide)for(var c={},l=t.rows({order:n}).indexes().toArray(),u=t.settings()[0],d=0;d<l.length;d++){var h=u.fastData(l[d],n,"filter"),h=null!=h?h.toString():"";c[h]||(c[h]=!0,s.push({label:u.fastData(l[d],n,e.orthogonal),value:h}))}}L(r,s),o&&r.values(o)}var E={defaults:{ajaxOnly:!0,className:"searchList",hidable:!0,options:null,orthogonal:"display",search:!0,select:!0,title:""},init:function(r){function o(e){r._parents&&r._parents.forEach(function(t){return t.activeList(i.unique(),e&&!!e.length)});var t=a.column(i.idx());a.page.info().serverSide?t.init().__ccList=e&&0!==e.length:e&&(0===e.length?t.search.fixed("dtcc-list",""):t.search.fixed("dtcc-list",function(t){return e.includes(t)}))}var i=this,s=null,a=this.dt(),c=new m(a,this,{search:r.search,select:r.select}).searchListener(a).title(a.i18n("columnControl.searchList",r.title).replace("[title]",a.column(this.idx()).title())).handler(function(t,e,n,r){e&&e.active(!e.active()),o(c.values()),r&&a.draw()}),l=(r.options?L(c,r.options):(a.ready(function(){N(a,r,i.idx(),c,s)}),a.on("xhr",function(t,e,n){a.one("draw",function(){N(a,r,i.idx(),c,s),s=null})})),[]);return a.page.info().serverSide&&a.on("preXhr.DT",function(t,e,n){var r;n.columns&&n.columns[i.idx()]&&(n.columns[i.idx()].columnControl||(n.columns[i.idx()].columnControl={}),r=l.length?l:c.values(),l=[],n.columns[i.idx()].columnControl.list=Object.assign({},r))}),a.on("stateLoaded",function(t,e,n){n=M(i.idx(),n);n&&(c.values(n),o(n))}),a.on("stateSaveParams",function(t,e,n){var r=i.idx();n.columnControl||(n.columnControl={}),n.columnControl[r]||(n.columnControl[r]={}),n.columnControl[r].searchList=a.ready()?c.values():s}),a.settings()[0].aoColumns[this.idx()].columnControlSearchList=function(t){"refresh"===t?N(a,r,i.idx(),c,null):L(c,t)},s=M(this.idx(),a.state.loaded()),o(s),a.page.info().serverSide&&s&&s.length&&(l=s),c.element()}},D={defaults:{clear:!0,excludeLogic:[],placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,s=this.dt(),t="columnControl.search.number.",t=new b(s,this.idx()).type("num").addClass("dtcc-searchNumber").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:s.i18n(t+"equal","Equals"),value:"equal"},{label:s.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:s.i18n(t+"greater","Greater than"),value:"greater"},{label:s.i18n(t+"greaterOrEqual","Greater or equal"),value:"greaterOrEqual"},{label:s.i18n(t+"less","Less than"),value:"less"},{label:s.i18n(t+"lessOrEqual","Less or equal"),value:"lessOrEqual"},{label:s.i18n(t+"empty","Empty"),value:"empty"},{label:s.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!o.excludeLogic.includes(t.value)})).search(function(e,n,t){o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=s.column(i.idx());if(s.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||s.draw();else{if("empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===n)return;""===n?r.search.fixed("dtcc",""):"equal"===e?r.search.fixed("dtcc",function(t){return S(t)==n}):"notEqual"===e?r.search.fixed("dtcc",function(t){return S(t)!=n}):"greater"===e?r.search.fixed("dtcc",function(t){return S(t)>n}):"greaterOrEqual"===e?r.search.fixed("dtcc",function(t){return S(t)>=n}):"less"===e?r.search.fixed("dtcc",function(t){return S(t)<n}):"lessOrEqual"===e&&r.search.fixed("dtcc",function(t){return S(t)<=n})}t||r.draw()}});return t.input().setAttribute("inputmode","numeric"),t.input().setAttribute("pattern","[0-9]*"),t.element()}},et=/<([^>]*>)/g,nt=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;function S(t){var e;return 0===t||t&&"-"!==t?"number"==(e=typeof t)||"bigint"==e?t:+(t=t.replace?t.replace(et,"").replace(nt,""):t):-1/0}var q={defaults:{clear:!0,excludeLogic:[],placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,s=this.dt(),t="columnControl.search.text.";return new b(s,this.idx()).addClass("dtcc-searchText").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:s.i18n(t+"contains","Contains"),value:"contains"},{label:s.i18n(t+"notContains","Does not contain"),value:"notContains"},{label:s.i18n(t+"equal","Equals"),value:"equal"},{label:s.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:s.i18n(t+"starts","Starts"),value:"starts"},{label:s.i18n(t+"ends","Ends"),value:"ends"},{label:s.i18n(t+"empty","Empty"),value:"empty"},{label:s.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!o.excludeLogic.includes(t.value)})).search(function(e,n,t){o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=s.column(i.idx());if(s.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||s.draw();else{if(n=n.toLowerCase(),"empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===n)return;""===n?r.search.fixed("dtcc",""):"equal"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase()==n}):"notEqual"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase()!=n}):"contains"===e?r.search.fixed("dtcc",n):"notContains"===e?r.search.fixed("dtcc",function(t){return!t.toLowerCase().includes(n)}):"starts"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase().startsWith(n)}):"ends"===e&&r.search.fixed("dtcc",function(t){return t.toLowerCase().endsWith(n)})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),t||r.draw()}}).element()}},r={colVis:r,colVisDropdown:H,dropdown:p,reorder:I,reorderLeft:G,reorderRight:V,rowGroup:K,rowGroupAdd:Q,rowGroupClear:$,rowGroupRemove:J,order:P,orderAddAsc:U,orderAddDesc:W,orderAsc:B,orderClear:z,orderDesc:F,orderRemove:X,orderStatus:Z,search:{defaults:{allowSearchList:!1},init:function(n){function e(t){var e=tt(i,s);return"list"===t||n.allowSearchList&&e?E.init.call(o,Object.assign({},E.defaults,n)):"date"===t||t.startsWith("datetime")?C.init.call(o,Object.assign({},C.defaults,n)):t.includes("num")?D.init.call(o,Object.assign({},D.defaults,n)):q.init.call(o,Object.assign({},q.defaults,n))}var r,o=this,i=this.dt(),s=this.idx(),t=null==(t=null==(t=i.state.loaded())?void 0:t.columnControl)?void 0:t[s];return t?t.searchInput?r=e(t.searchInput.type):t.searchList&&(r=e("list")):(r=u.createElement("div"),i.ready(function(){var t=i.column(s),t=e(t.type());r.replaceWith(t)})),r}},searchClear:{defaults:{className:"searchClear",icon:"searchClear",text:"Clear Search"},init:function(t){var o=this,i=this.dt(),s=new f(i,this).text(i.i18n("columnControl.searchClear",t.text)).icon(t.icon).className(t.className).handler(function(){i.column(o.idx()).columnControl.searchClear().draw()}).enable(!1);return i.on("draw",function(){var t=i.column(o.idx()),e=t.search.fixed("dtcc"),n=t.search.fixed("dtcc-list"),r=t.init().__ccSearch,t=t.init().__ccList;s.enable(!!(e||n||r||t))}),s.element()}},searchDropdown:{defaults:{ajaxOnly:!0,allowSearchList:!0,className:"searchDropdown",clear:!0,columns:"",hidable:!0,options:null,orthogonal:"display",placeholder:"",search:!0,select:!0,text:"Search",title:"",titleAttr:""},extend:function(t){return{extend:"dropdown",icon:"search",text:this.dt().i18n("columnControl.searchDropdown",t.text),content:[Object.assign(t,{extend:"search"})]}}},searchDateTime:C,searchList:E,searchNumber:D,searchText:q,spacer:{defaults:{className:"dtcc-spacer",text:""},init:function(t){var e=this.dt(),e=y("div",t.className,e.i18n("columnControl.spacer",t.text));return e.setAttribute("role","separator"),e}},title:{defaults:{className:"dtcc-title",text:null},init:function(t){var e=this.dt().column(this.idx()).title(),n=null===t.text?"[title]":t.text;return y("div",t.className,n.replace("[title]",e))}}},T=(k.prototype.destroyAdd=function(t){this._s.toDestroy.push(t)},k.prototype.destroyRemove=function(t){t=this._s.toDestroy.indexOf(t);-1!==t&&this._s.toDestroy.splice(t,1)},k.prototype.dt=function(){return this._dt},k.prototype.idx=function(){return this._s.columnIdx},k.prototype.resolve=function(t){var e=null,n=null,r=null;if("string"==typeof t?(e=k.content[r=t],n=Object.assign({},null==e?void 0:e.defaults)):Array.isArray(t)?(e=k.content[r="dropdown"],n=Object.assign({},null==e?void 0:e.defaults,{content:t})):t.extend&&(r=t.extend,e=k.content[r],n=Object.assign({},null==e?void 0:e.defaults,t)),e)return e.extend?(t=e.extend.call(this,n),this.resolve(t)):{config:n,type:r,plugin:e};throw new Error("Unknown ColumnControl content type: "+r)},k.prototype.unique=function(){return this._s.unique},k.prototype._target=function(){var t,e,n=this._c.target,r=this._dt.column(this._s.columnIdx),o="header";return"number"==typeof n?t=r.header(n):(e="tfoot"!==(n=n.split(":"))[0],n=n[1]?parseInt(n[1]):0,e?t=r.header(n):(t=r.footer(n),o="footer")),t.querySelector("div.dt-column-"+o)},k.Button=f,k.CheckList=m,k.SearchInput=b,k.content=r,k.defaults={className:"",content:null,target:0},k.icons=c,k.version="1.2.0",k);function k(n,t,e){var r=this,o=(this._dom={target:null,wrapper:null},this._c={},this._s={columnIdx:null,unique:null,toDestroy:[]},this._dt=n,this._s.columnIdx=t,this._s.unique=Math.random(),t);Object.assign(this._c,k.defaults,e),this._dom.target=this._target(),e.className&&i(this._dom.target.closest("tr"),e.className),this._c.content&&(n.on("columns-reordered",function(t,e){r._s.columnIdx=n.colReorder.transpose(o,"fromOriginal")}),this._dom.wrapper=u.createElement("span"),this._dom.wrapper.classList.add("dtcc"),this._dom.target.appendChild(this._dom.wrapper),this._c.content.forEach(function(t){t=r.resolve(t),t=t.plugin.init.call(r,t.config);r._dom.wrapper.appendChild(t)}),n.on("destroy",function(){r._s.toDestroy.slice().forEach(function(t){t.destroy()}),r._dom.wrapper.remove()}))}function rt(){var n=this;return this.iterator("column",function(t,e){n.trigger("cc-search-clear",[e])})}function O(t,e){var n=T.defaults.target;if(ot(e)){if(n===t)return{target:n,content:e}}else if(Array.isArray(e))for(var r=0;r<e.length;r++){var o=e[r];if(ot(o)){if(n===t)return{target:n,content:o}}else if(Y(o)){if(t===(void 0!==o.target?o.target:n))return o}else if(t===n)return{target:n,content:e}}else if("object"==typeof e)if(Y(e)){if(t===(void 0!==e.target?e.target:n))return e}else if(t===n)return{target:n,content:e}}function j(e,t){function n(t){e.includes(t)||e.push(t)}return Array.isArray(t)?0===t.length?n(T.defaults.target):t.forEach(function(t){n(("object"==typeof t&&void 0!==t.target?t:T.defaults).target)}):"object"==typeof t&&n((void 0!==t.target?t:T.defaults).target),e}function Y(t){return"object"==typeof t&&void 0!==t.target}function ot(t){var e=!1;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(Y(t[n])){e=!0;break}return!e}}return x.ColumnControl=T,t(u).on("i18n.dt",function(t,e){if("dt"===t.namespace){var n=new x.Api(e),t=n.table().header(),r=e.oInit.columnControl,o=T.defaults,i=[],s={};t.querySelectorAll("tr").length<=1&&null===e.titleRow&&(e.titleRow=0),j(i,r),T.defaults.content&&j(i,o),n.columns().every(function(t){var e=this.init().columnControl;j(i,e)});for(var a=0;a<i.length;a++){v=m=f=p=h=d=u=l=c=void 0;var c=s,l=i[a],u=n;if(!c[l]){var d=!0,h=0,p=("number"==typeof l?h=l:("tfoot"===(p=l.split(":"))[0]&&(d=!1),p[1]&&(h=parseInt(p[1]))),d?u.table().header():u.table().footer());if(!p.querySelectorAll("tr")[h]){var f=u.columns().count(),m=y("tr");m.setAttribute("data-dt-order","disable");for(var v=0;v<f;v++)m.appendChild(y("td"));p.appendChild(m)}c[l]=!0}}}}),t(u).on("preInit.dt",function(t,e){var a,c,l,u;"dt"===t.namespace&&(a=new x.Api(e),c=e.oInit.columnControl,l=T.defaults,j(u=[],c),T.defaults.content&&j(u,l),a.columns().every(function(t){for(var e=this.init().columnControl,n=j(u.slice(),e),r=0;r<n.length;r++){var o=O(n[r],e),i=O(n[r],c),s=O(n[r],l);(s||i||o)&&new T(a,this.index(),Object.assign({},s||{},i||{},o||{}))}}))}),x.Api.registerPlural("columns().columnControl.searchClear()","column().columnControl.searchClear()",rt),x.Api.registerPlural("columns().ccSearchClear()","column().ccSearchClear()",rt),x.Api.registerPlural("columns().columnControl.searchList()","column().columnControl.searchList()",function(n){return this.iterator("column",function(t,e){t=t.aoColumns[e].columnControlSearchList;t&&t(n)})}),x.ext.buttons.ccSearchClear={text:function(t){return t.i18n("columnControl.buttons.searchClear","Clear search")},init:function(n,t,e){var r=this;n.on("draw.DT",function(){var t=!1,e=!!n.search();e||n.columns().every(function(){(this.search.fixed("dtcc")||this.search.fixed("dtcc-list"))&&(t=!0)}),r.enable(e||t)}),this.enable(!1)},action:function(t,e,n,r){e.search(""),e.columns().columnControl.searchClear(),e.draw()}},x});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! ColumnControl 1.
|
|
1
|
+
/*! ColumnControl 1.2.0
|
|
2
2
|
* Copyright (c) SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*
|
|
4
4
|
* SVG icons: ISC License
|
|
5
5
|
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT).
|
|
6
6
|
* All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
7
7
|
*/
|
|
8
|
-
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function createElement(t,e,n,r){void 0===e&&(e=[]),void 0===n&&(n=null),void 0===r&&(r=[]);var o=document.createElement(t);return addClass(o,e),n&&(o.innerHTML=n),r.forEach(function(t){o.appendChild(t)}),o}function addClass(e,t){t&&(t=Array.isArray(t)?t:[t]).forEach(function(t){e&&t&&e.classList.add(t)})}function wrap(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+t+"</svg>"}var icons={chevronRight:wrap('<path d="m9 18 6-6-6-6"/>'),columns:wrap('<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="M15 3v18"/>'),contains:wrap('<path d="M10 3h4v18h-4z"/><path d="M18 8h3v9h-3"/><path d="M6 17H3V8h3"/>'),empty:wrap('<circle cx="12" cy="12" r="10"/>'),ends:wrap('<path d="M21 3h-4v18h4z"/><path d="M13 8H3v9h10"/>'),equal:wrap('<line x1="5" x2="19" y1="9" y2="9"/><line x1="5" x2="19" y1="15" y2="15"/>'),greater:wrap('<path d="m9 18 6-6-6-6"/>'),greaterOrEqual:wrap('<path d="m9 16 6-6-6-6"/><path d="m9 21 6-6"/>'),groupAdd:wrap('<path d="M6 21v-7.5m-3.549 3.75H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" fill="currentColor" rx="1.5"/>'),groupClear:wrap('<rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupTop:wrap('<rect width="13.5" height="7.5" x="3" y="3" fill="currentColor" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupRemove:wrap('<path d="M2.451 17.25H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),less:wrap('<path d="m15 18-6-6 6-6"/>'),lessOrEqual:wrap('<path d="m15 16-6-6 6-6"/><path d="m15 21-6-6"/>'),menu:wrap('<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>'),move:wrap('<line x1="12" x2="12" y1="3" y2="21"/><polyline points="8 8 4 12 8 16"/><polyline points="16 16 20 12 16 8"/>'),moveLeft:wrap('<path d="m9 6-6 6 6 6"/><path d="M3 12h14"/><path d="M21 19V5"/>'),moveRight:wrap('<path d="M3 5v14"/><path d="M21 12H7"/><path d="m15 18 6-6-6-6"/>'),notContains:wrap('<path d="M15 4 9 20"/><path d="M3 8h18v9H3z"/>'),notEmpty:wrap('<circle cx="12" cy="12" r="10"/><line x1="9" x2="15" y1="15" y2="9"/>'),notEqual:wrap('<path d="M5 9h14"/><path d="M5 15h14"/><path d="M15 5 9 19"/>'),orderAddAsc:wrap('<path d="M17 21v-8"/><path d="M3 4h6"/><path d="M3 8h9"/><path d="M3 12h10"/><path d="M13 17h8"/>'),orderAddDesc:wrap('<path d="M17 21v-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderAsc:wrap('<path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h4"/><path d="M11 16h7"/><path d="M11 20h10"/>'),orderClear:wrap('<path d="m21 21-8-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="m13 21 8-8"/>'),orderDesc:wrap('<path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/>'),orderRemove:wrap('<path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderNone:wrap('<path d="m3 8 4-4 4 4"/><path d="m11 16-4 4-4-4"/><path d="M7 4v16"/><path d="M15 8h6"/><path d="M15 16h6"/><path d="M13 12h8"/>'),search:wrap('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),searchClear:wrap('<path d="m13.5 8.5-5 5"/><path d="m8.5 8.5 5 5"/><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),starts:wrap('<path d="M3 3h4v18H3z"/><path d="M11 8h10v9H11"/>'),tick:wrap('<path d="M20 6 9 17l-5-5"/>'),x:wrap('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')};function close(e){void 0===e&&(e=null),document.querySelectorAll("div.dtcc-dropdown").forEach(function(t){null!==e&&t.contains(e.target)||(t._close(),e._closed||(e._closed=[]),e._closed.push(t))})}function getContainer(t,e){return e.closest("div.dtfh-floatingparent")||t.table().container()}function positionDropdown(t,e,n){var r=n.closest("div.dt-column-header"),e=getContainer(e,n),r=getComputedStyle(r),o=t.offsetWidth,i=relativePosition(e,n),a=i.top+n.offsetHeight,r="row-reverse"===r.flexDirection?i.left:i.left-o+n.offsetWidth,i=e.offsetWidth;i<r+o&&(r-=r+o-i),r<0&&(r=0),t.style.top=a+"px",t.style.left=r+"px"}function attachDropdown(n,t,e){function r(t){var e;n._shown?t.target===n||n.contains(t.target)||(e=document.querySelector("div.dt-datetime"))&&(t.target===e||e.contains(t.target))||(n._close(),document.body.removeEventListener("click",r)):document.body.removeEventListener("click",r)}var o=getContainer(t,e.element());n._shown=!0,o.append(n),positionDropdown(n,t,e.element()),e.element().setAttribute("aria-expanded","true");return document.body.addEventListener("click",r),r}function relativePosition(t,e){for(var n=0,r=0;e&&e!==t&&e!==document.body;)n+=e.offsetTop,r+=e.offsetLeft,e.scrollTop&&(r-=e.scrollTop),e.scrollLeft&&(r-=e.scrollLeft),e=e.offsetParent;return{top:n,left:r}}function focusCapture(r,o){return function(t){var e,n;r._shown&&(e=Array.from(r.querySelectorAll("a, button, input, select")),n=document.activeElement,"Escape"===t.key?(r._close(),o.focus()):"Tab"===t.key&&0!==e.length&&(e.includes(n)?t.shiftKey?n===e[0]&&(e[e.length-1].focus(),t.preventDefault()):n===e[e.length-1]&&(e[0].focus(),t.preventDefault()):(e[0].focus(),t.preventDefault())))}}var dropdownContent={classes:{container:"dtcc-dropdown",liner:"dtcc-dropdown-liner"},defaults:{className:"dropdown",content:[],icon:"menu",text:"More..."},init:function(n){var r=this.dt(),o=createElement("div",dropdownContent.classes.container,"",[createElement("div",dropdownContent.classes.liner)]),t=(o._shown=!1,o._close=function(){o.remove(),o._shown=!1,i.element().setAttribute("aria-expanded","false")},o.setAttribute("role","dialog"),o.setAttribute("aria-label",r.i18n("columnControl.dropdown",n.text)),r.on("fixedheader-mode",function(){o._shown&&attachDropdown(o,r,n._parents?n._parents[0]:i)}),o.childNodes[0]),i=new Button(r,this).text(r.i18n("columnControl.dropdown",n.text)).icon(n.icon).className(n.className).dropdownDisplay(t).handler(function(t){var e;t._closed&&t._closed.includes(o)||(attachDropdown(o,r,n._parents?n._parents[0]:i),(e=o.querySelector("input, a, button"))&&"keypress"===t.type&&e.focus())});i.element().setAttribute("aria-haspopup","dialog"),i.element().setAttribute("aria-expanded","false");for(var e=0;e<n.content.length;e++){var a=this.resolve(n.content[e]),a=(a.config._parents||(a.config._parents=[]),a.config._parents.push(i),a.plugin.init.call(this,a.config));t.appendChild(a)}n._parents&&n._parents.length&&i.extra("chevronRight"),r.on("columns-reordered",function(){positionDropdown(o,r,i.element())});var s=focusCapture(o,i.element());return document.body.addEventListener("keydown",s),r.on("destroy",function(){document.body.removeEventListener("keydown",s)}),i.element()}},_namespace=0,Button=(()=>{function n(t,e){this._s={active:!1,activeList:[],buttonClick:null,dt:null,enabled:!0,host:null,label:"",namespace:"",value:null},this._s.dt=t,this._s.host=e,this._dom={button:createElement("button",n.classes.container),dropdownDisplay:null,extra:createElement("span","dtcc-button-extra"),icon:createElement("span","dtcc-button-icon"),state:createElement("span","dtcc-button-state"),text:createElement("span","dtcc-button-text")},this._dom.button.setAttribute("type","button"),this._dom.button.append(this._dom.icon),this._dom.button.append(this._dom.text),this._dom.button.append(this._dom.state),this._dom.button.append(this._dom.extra),this.enable(!0)}return n.prototype.active=function(t){return void 0===t?this._s.active:(this._s.active=t,this._checkActive(),this)},n.prototype.activeList=function(t,e){return this._s.activeList[t]=e,this._checkActive(),this},n.prototype.checkDisplay=function(){for(var t=0,e=this._dom.dropdownDisplay.childNodes,n=0;n<e.length;n++)"none"!==e[n].style.display&&t++;return 0===t&&(this._dom.button.style.display="none"),this},n.prototype.className=function(t){return this._dom.button.classList.add("dtcc-button_"+t),this},n.prototype.destroy=function(){this._s.buttonClick&&(this._dom.button.removeEventListener("click",this._s.buttonClick),this._dom.button.removeEventListener("keypress",this._s.buttonClick)),this._s.host.destroyRemove(this)},n.prototype.dropdownDisplay=function(t){return this._dom.dropdownDisplay=t,this},n.prototype.element=function(){return this._dom.button},n.prototype.enable=function(t){return void 0===t?this._s.enabled:(this._dom.button.classList.toggle("dtcc-button_disabled",!t),this._s.enabled=t,this)},n.prototype.extra=function(t){return this._dom.extra.innerHTML=t?icons[t]:"",this},n.prototype.handler=function(e){function t(t){close(t),t.stopPropagation(),t.preventDefault(),n._s.enabled&&e(t)}var n=this;return this._s.buttonClick=t,this._s.namespace="dtcc-"+_namespace++,this._dom.button.addEventListener("click",t),this._dom.button.addEventListener("keypress",t),this._s.host.destroyAdd(this),this},n.prototype.icon=function(t){return this._dom.icon.innerHTML=t?icons[t]:"",this},n.prototype.text=function(t){return void 0===t?this._s.label:(this._dom.text.innerHTML=t,this._s.label=t,this._dom.button.setAttribute("aria-label",t),this)},n.prototype.value=function(t){return void 0===t?this._s.value:(this._s.value=t,this)},n.prototype._checkActive=function(){return!0===this._s.active||Object.values(this._s.activeList).includes(!0)?(this._dom.state.innerHTML=icons.tick,this._dom.button.classList.add("dtcc-button_active")):(this._dom.state.innerHTML="",this._dom.button.classList.remove("dtcc-button_active")),this},n.classes={container:"dtcc-button"},n})(),CheckList=(()=>{function c(t,e,n){function r(){a._s.search=s.search.value,a._redraw()}function o(t){a.selectAll(),a._s.handler(t,null,a._s.buttons,!0),a._updateCount()}function i(t){a.selectNone(),a._s.handler(t,null,a._s.buttons,!0),a._updateCount()}var a=this,s=(this._s={buttons:[],dt:null,handler:function(){},host:null,search:""},this._s.dt=t,this._s.host=e,this._dom={buttons:createElement("div","dtcc-list-buttons"),container:createElement("div",c.classes.container),controls:createElement("div","dtcc-list-controls"),empty:createElement("div","dtcc-list-empty",t.i18n("columnControl.list.empty","No options")),title:createElement("div","dtcc-list-title"),selectAll:createElement("button","dtcc-list-selectAll",t.i18n("columnControl.list.all","Select all")),selectAllCount:createElement("span"),selectNone:createElement("button","dtcc-list-selectNone",t.i18n("columnControl.list.none","Deselect")),selectNoneCount:createElement("span"),search:createElement("input",c.classes.input)},this._dom);s.search.setAttribute("type","text"),s.container.append(s.title),s.container.append(s.controls),s.container.append(s.empty),s.container.append(s.buttons),n.select&&(s.controls.append(s.selectAll),s.controls.append(s.selectNone),s.selectAll.append(s.selectAllCount),s.selectNone.append(s.selectNoneCount),s.selectAll.setAttribute("type","button"),s.selectNone.setAttribute("type","button"));n.search&&(s.controls.append(s.search),s.search.setAttribute("placeholder",t.i18n("columnControl.list.search","Search...")),s.search.addEventListener("input",r)),s.selectAll.addEventListener("click",o),s.selectNone.addEventListener("click",i),t.on("destroy",function(){s.selectAll.removeEventListener("click",o),s.selectNone.removeEventListener("click",i),s.search.removeEventListener("input",r)})}return c.prototype.add=function(n,t){for(var r=this,o=(Array.isArray(n)||(n=[n]),this),e=0;e<n.length;e++)(t=>{var t=n[t],e=new Button(o._s.dt,o._s.host).active(t.active||!1).handler(function(t){r._s.handler(t,e,r._s.buttons,!0),r._updateCount()}).icon(t.icon||"").text(""!==t.label?t.label:o._s.dt.i18n("columnControl.list.empty","Empty")).value(t.value);""===t.label&&e.className("empty"),o._s.buttons.push(e)})(e);var i=this._s.buttons.length;return!0!==t&&void 0!==t||(this._dom.selectAllCount.innerHTML=i?"("+i+")":"",this._redraw()),this},c.prototype.button=function(t){for(var e=this._s.buttons,n=0;n<e.length;n++)if(e[n].value()===t)return e[n];return null},c.prototype.clear=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].destroy();return this._dom.buttons.replaceChildren(),this._s.buttons.length=0,this},c.prototype.element=function(){return this._dom.container},c.prototype.handler=function(t){return this._s.handler=t,this},c.prototype.searchListener=function(t){var n=this;return t.on("cc-search-clear",function(t,e){e===n._s.host.idx()&&(n.selectNone(),n._s.handler(t,null,n._s.buttons,!1),n._s.search="",n._dom.search.value="",n._redraw(),n._updateCount())}),this},c.prototype.selectAll=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!0);return this},c.prototype.selectNone=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!1);return this},c.prototype.title=function(t){return this._dom.title.innerHTML=t,this},c.prototype.values=function(t){var e,n=[],r=this._s.buttons;if(void 0!==t){for(e=0;e<r.length;e++)t.includes(r[e].value())&&r[e].active(!0);return this._updateCount(),this}for(e=0;e<r.length;e++)r[e].active()&&n.push(r[e].value());return n},c.prototype._updateCount=function(){var t=this.values().length;this._dom.selectNoneCount.innerHTML=t?"("+t+")":""},c.prototype._redraw=function(){var t=this._s.buttons,e=this._dom.buttons,n=this._s.search.toLowerCase();e.replaceChildren();for(var r=0;r<t.length;r++){var o=t[r];n&&!o.text().toLowerCase().includes(n)||e.appendChild(o.element())}this._dom.empty.style.display=0===t.length?"block":"none",e.style.display=0<t.length?"block":"none"},c.classes={container:"dtcc-list",input:"dtcc-list-search"},c})(),colVis={defaults:{className:"colVis",columns:"",search:!1,select:!1,title:"Column visibility"},init:function(t){function n(){o.columns(t.columns).every(function(){i.add({active:this.visible(),label:this.title(),value:this.index()})})}var o=this.dt(),i=new CheckList(o,this,{search:t.search,select:t.select}).title(o.i18n("columnControl.colVis",t.title)).handler(function(t,e,n){e&&e.active(!e.active()),r(n)}),r=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.value(),r=o.column(r);n.active()&&!r.visible()?r.visible(!0):!n.active()&&r.visible()&&r.visible(!1)}};return n(),o.on("column-visibility",function(t,e,n,r){n=i.button(n);n&&n.active(r)}),o.on("columns-reordered",function(t,e){i.clear(),n()}),i.element()}},colVisDropdown={defaults:{className:"colVis",columns:"",search:!1,select:!1,text:"Column visibility",title:"Column visibility"},extend:function(t){return{extend:"dropdown",icon:"columns",text:this.dt().i18n("columnControl.colVisDropdown",t.text),content:[Object.assign(t,{extend:"colVis"})]}}},reorder={defaults:{className:"reorder",icon:"move",text:"Reorder columns"},init:function(t){var n=this,e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.reorder",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),e.init().colReorder||new DataTable.ColReorder(e,{}),r.element()}},reorderLeft={defaults:{className:"reorderLeft",icon:"moveLeft",text:"Move column left"},init:function(t){var n=this,e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.reorderLeft",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),r.element()}},reorderRight={defaults:{className:"reorderRight",icon:"moveRight",text:"Move column right"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.reorderRight",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();t<r.columns().count()-1&&r.colReorder.move(t,t+1)});return this.idx()===r.columns().count()-1&&o.enable(!1),r.on("columns-reordered",function(t,e){o.enable(n.idx()<r.columns().count()-1)}),o.element()}},order={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!1,text:"Toggle ordering"},init:function(r){var o=this,t=this.dt(),i=new Button(t,this).text(t.i18n("columnControl.order",r.text)).icon("orderAsc").className(r.className);return r.statusOnly||t.order.listener(i.element(),DataTable.versionCheck("2.3.2")?function(){return[o.idx()]}:this.idx(),function(){}),t.on("order",function(t,e,n){n=n.find(function(t){return t.col===o.idx()});n?"asc"===n.dir?i.active(!0).icon(r.iconAsc):"desc"===n.dir&&i.active(!0).icon(r.iconDesc):i.active(!1).icon(r.iconNone)}),i.element()}},orderAddAsc={defaults:{className:"orderAddAsc",icon:"orderAddAsc",text:"Add Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAddAsc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"asc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},orderAddDesc={defaults:{className:"orderAddDesc",icon:"orderAddDesc",text:"Add Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAddDesc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"desc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},orderAsc={defaults:{className:"orderAsc",icon:"orderAsc",text:"Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAsc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"asc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"asc"===t.dir});o.active(n)}),o.element()}},orderClear={defaults:{className:"orderClear",icon:"orderClear",text:"Clear sort"},init:function(t){var e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.orderClear",t.text)).icon(t.icon).className(t.className).handler(function(){e.order([]).draw()});return e.on("order",function(t,e,n){r.enable(0<n.length)}),0===e.order().length&&r.enable(!1),r.element()}},orderDesc={defaults:{className:"orderDesc",icon:"orderDesc",text:"Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderDesc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"desc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"desc"===t.dir});o.active(n)}),o.element()}},orderRemove={defaults:{className:"orderRemove",icon:"orderRemove",text:"Remove from sort"},init:function(t){var r=this,n=this.dt(),o=new Button(n,this).text(n.i18n("columnControl.orderRemove",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.order(),e=t.findIndex(function(t){return t[0]===r.idx()});t.splice(e,1),n.order(t).draw()});return n.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(n)}),o.enable(!1),o.element()}},orderStatus={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!0,text:"Sort status"},extend:function(t){return Object.assign(t,{extend:"order"})}};function rowGroupAdd$1(t,e){var n=rowGroupApplied(t);return-1===n.indexOf(e)&&(n.push(e),t.rowGroup().dataSrc(n)),n}function rowGroupApplied(t){t=t.rowGroup().dataSrc();return Array.isArray(t)?t:[t]}function rowGroupClear$1(t){t.rowGroup().dataSrc([])}function rowGroupRemove$1(t,e){var n=rowGroupApplied(t),e=n.indexOf(e);return-1!==e&&(n.splice(e,1),t.rowGroup().dataSrc(n)),n}var rowGroup={defaults:{className:"rowGroup",icon:"groupTop",order:!0,text:"Group rows"},init:function(e){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",e.text)).icon(e.icon).className(e.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.active()?rowGroupRemove$1(r,t):(rowGroupClear$1(r),rowGroupAdd$1(r,t),!1!==e.order&&r.order([n.idx(),"asc"])),r.draw()});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.active(t.includes(e))}),o.element()}},rowGroupAdd={defaults:{className:"rowGroupAdd",icon:"groupAdd",order:!0,text:"Add to grouping"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&rowGroupAdd$1(r,t),r.draw()});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.enable(!t.includes(e))}),o.element()}},rowGroupClear={defaults:{className:"rowGroupClear",icon:"groupClear",text:"Clear all grouping"},init:function(t){var e=this.dt(),n=new Button(e,this).text(e.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){rowGroupClear$1(e),e.draw()});return e.on("rowgroup-datasrc",function(){n.enable(0<rowGroupApplied(e).length)}),n.enable(0<rowGroupApplied(e).length),n.element()}},rowGroupRemove={defaults:{className:"rowGroupRemove",icon:"groupRemove",order:!0,text:"Remove from grouping"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&(rowGroupRemove$1(r,t),r.draw())});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.enable(t.includes(e))}),o.enable(!1),o.element()}},SearchInput=(()=>{function c(n,t){function e(){i.runSearch()}function r(){a.typeIcon.innerHTML=icons[a.select.value],i.runSearch()}function o(){i.clear()}var i=this,a=(this._type="text",this._sspTransform=null,this._sspData={},this._dt=n,this._idx=t,this._dom={clear:createElement("span","dtcc-search-clear",icons.x),container:createElement("div",c.classes.container),typeIcon:createElement("div","dtcc-search-type-icon"),searchIcon:createElement("div","dtcc-search-icon",icons.search),input:createElement("input",c.classes.input),inputs:createElement("div"),select:createElement("select",c.classes.select),title:createElement("div","dtcc-search-title")},this._dom),s=t;a.input.setAttribute("type","text"),a.container.append(a.title,a.inputs),a.inputs.append(a.typeIcon,a.select,a.searchIcon,a.clear,a.input);a.input.addEventListener("input",e),a.select.addEventListener("input",r),a.clear.addEventListener("click",o),n.on("destroy",function(){a.input.removeEventListener("input",e),a.select.removeEventListener("input",r),a.clear.removeEventListener("click",o)}),n.on("stateSaveParams.DT",function(t,e,n){n.columnControl||(n.columnControl={}),n.columnControl[i._idx]||(n.columnControl[i._idx]={}),n.columnControl[i._idx].searchInput={logic:a.select.value,type:i._type,value:a.input.value}}),n.on("stateLoaded.DT",function(t,e,n){i._stateLoad(n)}),n.on("columns-reordered.DT",function(t,e){i._idx=n.colReorder.transpose(s,"fromOriginal")}),n.on("cc-search-clear.DT",function(t,e){e===i._idx&&(i._loadingState=!0,i.clear(),i._loadingState=!1)}),n.page.info().serverSide&&n.on("preXhr.DT",function(t,e,n){n.columns[i._idx].columnControl||(n.columns[i._idx].columnControl={});var r=i._dom.input.value;i._sspTransform&&(r=i._sspTransform(r)),n.columns[i._idx].columnControl.search=Object.assign({value:r,logic:i._dom.select.value,type:i._type},i._sspData)})}return c.prototype.addClass=function(t){return this._dom.container.classList.add(t),this},c.prototype.clear=function(){return this.set(this._dom.select.children[0].getAttribute("value"),""),this},c.prototype.clearable=function(t){return t||this._dom.clear.remove(),this},c.prototype.element=function(){return this._dom.container},c.prototype.input=function(){return this._dom.input},c.prototype.options=function(t){for(var e=this._dom.select,n=0;n<t.length;n++)e.add(new Option(t[n].label,t[n].value));return this._dom.typeIcon.innerHTML=icons[t[0].value],this},c.prototype.placeholder=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.placeholder=t.replace("[title]",e)),this},c.prototype.runSearch=function(){var t=this._dom,e="empty"===t.select.value||"notEmpty"===t.select.value||""!==t.input.value;t.container.classList.toggle("dtcc-search_active",e),!this._search||this._lastValue===t.input.value&&this._lastType===t.select.value||(this._search(t.select.value,t.input.value,this._loadingState),this._lastValue=t.input.value,this._lastType=t.select.value)},c.prototype.search=function(t){return this._search=t,this._stateLoad(this._dt.state.loaded()),this},c.prototype.set=function(t,e){var n=this._dom;return n.input.value=e,n.select.value=t,n.typeIcon.innerHTML=icons[n.select.value],this.runSearch(),this},c.prototype.sspTransform=function(t){return this._sspTransform=t,this},c.prototype.sspData=function(t){return this._sspData=t,this},c.prototype.title=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.title.innerHTML=t.replace("[title]",e)),this},c.prototype.titleAttr=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.title=t.replace("[title]",e)),this},c.prototype.type=function(t){return this._type=t,this},c.prototype._stateLoad=function(t){var e=this._dom,n=this._idx,n=null==(t=null==(t=null==t?void 0:t.columnControl)?void 0:t[n])?void 0:t.searchInput;n&&(this._loadingState=!0,e.select.value=n.logic,e.input.value=n.value,e.select.dispatchEvent(new Event("input")),this._loadingState=!1)},c.classes={container:["dtcc-content","dtcc-search"],input:"",select:""},c})(),searchDateTime={defaults:{clear:!0,format:"",mask:"",placeholder:"",title:"",titleAttr:""},init:function(a){var s,c=this,l=!1,u=DataTable.use("moment"),d=DataTable.use("luxon"),h=this.dt(),t="columnControl.search.datetime.",p="",m="",e=new SearchInput(h,this.idx()).type("date").addClass("dtcc-searchDateTime").sspTransform(function(t){return toISO(t,p,u,d)}).sspData({mask:a.mask}).clearable(a.clear).placeholder(a.placeholder).title(a.title).titleAttr(a.titleAttr).options([{label:h.i18n(t+"equal","Equals"),value:"equal"},{label:h.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:h.i18n(t+"greater","After"),value:"greater"},{label:h.i18n(t+"less","Before"),value:"less"},{label:h.i18n(t+"empty","Empty"),value:"empty"},{label:h.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(h.page.info().serverSide)n||h.draw();else{var r=a.mask,o=h.column(c.idx()),i=""===e?"":dateToNum(s&&l?s.val():e.trim(),p,u,d,r);if("empty"===t)o.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)o.search.fixed("dtcc",function(t){return!!t});else{if(""===o.search.fixed("dtcc")&&""===i)return;i?"equal"===t?o.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,r)==i}):"notEqual"===t?o.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,r)!=i}):"greater"===t?o.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,r)>i}):"less"===t&&o.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,r)<i}):o.search.fixed("dtcc","")}a._parents&&a._parents.forEach(function(t){return t.activeList(c.unique(),!!o.search.fixed("dtcc"))}),n||o.draw()}});return h.ready(function(){var t=DataTable.use("datetime");m=getFormat(h,c.idx()),p=a.format||m,t&&(s=new t(e.input(),{format:p,i18n:h.settings()[0].oLanguage.datetime,onChange:function(){l=!0,e.runSearch(),l=!1}}))}),e.element()}};function getFormat(t,e){var n=t.column(e).type();if(n)if("datetime"===n){t=t.settings()[0].aoColumns[e].mRender,e=t("1999-08-07T23:05:04Z","display"),t=t("1999-08-07T03:05:04Z","display").includes("03");if(DataTable.use("moment"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","A").replace("pm","a").replace("07","DD").replace("7","D").replace("08","MM").replace("8","M").replace("1999","YYYY").replace("99","YY");if(DataTable.use("luxon"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","a").replace("07","dd").replace("7","d").replace("08","MM").replace("8","M").replace("1999","yyyy").replace("99","yy");if(e.includes("23")&&e.includes("1999"))return"YYYY-MM-DD hh:mm:ss";if(e.includes("23"))return"hh:mm:ss"}else{if(n.includes("datetime-"))return n.replace(/datetime-/g,"");if(n.includes("moment"))return n.replace(/moment-/g,"");if(n.includes("luxon"))return n.replace(/luxon-/g,"")}return"YYYY-MM-DD"}function dateToNum(t,e,n,r,o){return""===t?"":(n=t instanceof Date?t:"YYYY-MM-DD"!==e&&(n||r)?new Date(n?1e3*n(t,e).unix():r.DateTime.fromFormat(t,e).toMillis()):new Date(t.replace(/\//g,"-")),o&&(o.includes("YYYY")||n.setFullYear(1970),o.includes("MM")||n.setUTCMonth(0),o.includes("DD")||n.setUTCDate(1),o.includes("hh")||n.setUTCHours(0),o.includes("mm")||n.setUTCMinutes(0),o.includes("ss")||n.setUTCSeconds(0),o.includes("sss")||n.setUTCMilliseconds(0)),n.getTime())}function toISO(t,e,n,r){return""===t?"":"YYYY-MM-DD"!==e&&n?n.utc(t,e).toISOString():"YYYY-MM-DD"!==e&&r?r.DateTime.fromFormat(t,e).toISO():t.replace(/\//g,"-")}function setOptions(t,e){var n=t.values();t.clear();for(var r=0;r<e.length;r++)"object"==typeof e[r]?t.add({active:!1,label:e[r].label,value:e[r].value},r===e.length-1):t.add({active:!1,label:e[r],value:e[r]},r===e.length-1);n.length&&t.values(n)}function getState(t,e){t=null==(e=null==(e=null==e?void 0:e.columnControl)?void 0:e[t])?void 0:e.searchList;if(t)return t}function getJsonOptions(t,e){var n=null==(n=t.ajax.json())?void 0:n.columnControl,t=t.column(e),r=t.name(),t=t.dataSrc();return n&&n[r]?n[r]:n&&"string"==typeof t&&n[t]?n[t]:n&&n[e]?n[e]:null}function reloadOptions(t,e,n,r,o){var i=null==(i=t.ajax.json())?void 0:i.columnControl,a=[],s=getJsonOptions(t,n);if(s)a=s;else{if(i&&e.ajaxOnly)return void(e.hidable&&(r.element().style.display="none",e._parents)&&e._parents.forEach(function(t){return t.checkDisplay()}));if(!t.page.info().serverSide)for(var c={},l=t.rows({order:n}).indexes().toArray(),u=t.settings()[0],d=0;d<l.length;d++){var h=u.fastData(l[d],n,"filter"),h=null!=h?h.toString():"";c[h]||(c[h]=!0,a.push({label:u.fastData(l[d],n,e.orthogonal),value:h}))}}setOptions(r,a),o&&r.values(o)}var searchList={defaults:{ajaxOnly:!0,className:"searchList",hidable:!0,options:null,orthogonal:"display",search:!0,select:!0,title:""},init:function(r){function o(e){var t;s.page.info().serverSide||(t=s.column(i.idx()),e&&(0===e.length?t.search.fixed("dtcc-list",""):t.search.fixed("dtcc-list",function(t){return e.includes(t)}),r._parents)&&r._parents.forEach(function(t){return t.activeList(i.unique(),!!e.length)}))}var i=this,a=null,s=this.dt(),c=new CheckList(s,this,{search:r.search,select:r.select}).searchListener(s).title(s.i18n("columnControl.searchList",r.title).replace("[title]",s.column(this.idx()).title())).handler(function(t,e,n,r){e&&e.active(!e.active()),o(c.values()),r&&s.draw()});return r.options?setOptions(c,r.options):(s.ready(function(){reloadOptions(s,r,i.idx(),c,a)}),s.on("xhr",function(t,e,n){s.one("draw",function(){reloadOptions(s,r,i.idx(),c,a)})})),s.page.info().serverSide&&s.on("preXhr.DT",function(t,e,n){n.columns[i.idx()].columnControl||(n.columns[i.idx()].columnControl={}),n.columns[i.idx()].columnControl.list=Object.assign({},c.values())}),s.on("stateLoaded",function(t,e,n){n=getState(i.idx(),n);n&&(c.values(n),o(n))}),s.on("stateSaveParams",function(t,e,n){var r=i.idx();n.columnControl||(n.columnControl={}),n.columnControl[r]||(n.columnControl[r]={}),n.columnControl[r].searchList=s.ready()?c.values():a}),s.settings()[0].aoColumns[this.idx()].columnControlSearchList=function(t){"refresh"===t?reloadOptions(s,r,i.idx(),c,null):setOptions(c,t)},a=getState(this.idx(),s.state.loaded()),o(a),c.element()}},searchNumber={defaults:{clear:!0,placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,a=this.dt(),t="columnControl.search.number.",t=new SearchInput(a,this.idx()).type("num").addClass("dtcc-searchNumber").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:a.i18n(t+"equal","Equals"),value:"equal"},{label:a.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:a.i18n(t+"greater","Greater than"),value:"greater"},{label:a.i18n(t+"greaterOrEqual","Greater or equal"),value:"greaterOrEqual"},{label:a.i18n(t+"less","Less than"),value:"less"},{label:a.i18n(t+"lessOrEqual","Less or equal"),value:"lessOrEqual"},{label:a.i18n(t+"empty","Empty"),value:"empty"},{label:a.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(a.page.info().serverSide)n||a.draw();else{var r=a.column(i.idx());if("empty"===t)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===e)return;""===e?r.search.fixed("dtcc",""):"equal"===t?r.search.fixed("dtcc",function(t){return stringToNum(t)==e}):"notEqual"===t?r.search.fixed("dtcc",function(t){return stringToNum(t)!=e}):"greater"===t?r.search.fixed("dtcc",function(t){return stringToNum(t)>e}):"greaterOrEqual"===t?r.search.fixed("dtcc",function(t){return stringToNum(t)>=e}):"less"===t?r.search.fixed("dtcc",function(t){return stringToNum(t)<e}):"lessOrEqual"===t&&r.search.fixed("dtcc",function(t){return stringToNum(t)<=e})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),n||r.draw()}});return t.input().setAttribute("inputmode","numeric"),t.input().setAttribute("pattern","[0-9]*"),t.element()}},_re_html=/<([^>]*>)/g,_re_formatted_numeric=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;function stringToNum(t){var e;return 0===t||t&&"-"!==t?"number"==(e=typeof t)||"bigint"==e?t:+(t=t.replace?t.replace(_re_html,"").replace(_re_formatted_numeric,""):t):-1/0}var searchText={defaults:{clear:!0,placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,a=this.dt(),t="columnControl.search.text.";return new SearchInput(a,this.idx()).addClass("dtcc-searchText").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:a.i18n(t+"contains","Contains"),value:"contains"},{label:a.i18n(t+"notContains","Does not contain"),value:"notContains"},{label:a.i18n(t+"equal","Equals"),value:"equal"},{label:a.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:a.i18n(t+"starts","Starts"),value:"starts"},{label:a.i18n(t+"ends","Ends"),value:"ends"},{label:a.i18n(t+"empty","Empty"),value:"empty"},{label:a.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}]).search(function(t,e,n){if(a.page.info().serverSide)n||a.draw();else{var r=a.column(i.idx());if(e=e.toLowerCase(),"empty"===t)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===t)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===e)return;""===e?r.search.fixed("dtcc",""):"equal"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase()==e}):"notEqual"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase()!=e}):"contains"===t?r.search.fixed("dtcc",e):"notContains"===t?r.search.fixed("dtcc",function(t){return!t.toLowerCase().includes(e)}):"starts"===t?r.search.fixed("dtcc",function(t){return t.toLowerCase().startsWith(e)}):"ends"===t&&r.search.fixed("dtcc",function(t){return t.toLowerCase().endsWith(e)})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),n||r.draw()}}).element()}},search={defaults:{allowSearchList:!1},init:function(n){function e(t){var e=getJsonOptions(i,a);return n.allowSearchList&&e?searchList.init.call(o,Object.assign({},searchList.defaults,n)):"date"===t||t.startsWith("datetime")?searchDateTime.init.call(o,Object.assign({},searchDateTime.defaults,n)):t.includes("num")?searchNumber.init.call(o,Object.assign({},searchNumber.defaults,n)):searchText.init.call(o,Object.assign({},searchText.defaults,n))}var r,o=this,i=this.dt(),a=this.idx(),t=null==(t=null==(t=null==(t=i.state.loaded())?void 0:t.columnControl)?void 0:t[a])?void 0:t.searchInput;return t?r=e(t.type):(r=document.createElement("div"),i.ready(function(){var t=i.column(a),t=e(t.type());r.replaceWith(t)})),r}},searchClear$1={defaults:{className:"searchClear",icon:"searchClear",text:"Clear Search"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.searchClear",t.text)).icon(t.icon).className(t.className).handler(function(){r.column(n.idx()).columnControl.searchClear().draw()}).enable(!1);return r.on("draw",function(){var t=r.column(n.idx()).search.fixed("dtcc"),e=r.column(n.idx()).search.fixed("dtcc-list");o.enable(!(!t&&!e))}),o.element()}},searchDropdown={defaults:{ajaxOnly:!0,allowSearchList:!0,className:"searchDropdown",clear:!0,columns:"",hidable:!0,options:null,orthogonal:"display",placeholder:"",search:!0,select:!0,text:"Search",title:"",titleAttr:""},extend:function(t){return{extend:"dropdown",icon:"search",text:this.dt().i18n("columnControl.searchDropdown",t.text),content:[Object.assign(t,{extend:"search"})]}}},spacer={defaults:{className:"dtcc-spacer",text:""},init:function(t){var e=this.dt(),e=createElement("div",t.className,e.i18n("columnControl.spacer",t.text));return e.setAttribute("role","separator"),e}},title={defaults:{className:"dtcc-title",text:null},init:function(t){var e=this.dt().column(this.idx()).title(),n=null===t.text?"[title]":t.text;return createElement("div",t.className,n.replace("[title]",e))}},contentTypes={colVis:colVis,colVisDropdown:colVisDropdown,dropdown:dropdownContent,reorder:reorder,reorderLeft:reorderLeft,reorderRight:reorderRight,rowGroup:rowGroup,rowGroupAdd:rowGroupAdd,rowGroupClear:rowGroupClear,rowGroupRemove:rowGroupRemove,order:order,orderAddAsc:orderAddAsc,orderAddDesc:orderAddDesc,orderAsc:orderAsc,orderClear:orderClear,orderDesc:orderDesc,orderRemove:orderRemove,orderStatus:orderStatus,search:search,searchClear:searchClear$1,searchDropdown:searchDropdown,searchDateTime:searchDateTime,searchList:searchList,searchNumber:searchNumber,searchText:searchText,spacer:spacer,title:title},ColumnControl=(()=>{function i(n,t,e){var r=this,o=(this._dom={target:null,wrapper:null},this._c={},this._s={columnIdx:null,unique:null,toDestroy:[]},this._dt=n,this._s.columnIdx=t,this._s.unique=Math.random(),t);Object.assign(this._c,i.defaults,e),this._dom.target=this._target(),e.className&&addClass(this._dom.target.closest("tr"),e.className),this._c.content&&(n.on("columns-reordered",function(t,e){r._s.columnIdx=n.colReorder.transpose(o,"fromOriginal")}),this._dom.wrapper=document.createElement("span"),this._dom.wrapper.classList.add("dtcc"),this._dom.target.appendChild(this._dom.wrapper),this._c.content.forEach(function(t){t=r.resolve(t),t=t.plugin.init.call(r,t.config);r._dom.wrapper.appendChild(t)}),n.on("destroy",function(){r._s.toDestroy.slice().forEach(function(t){t.destroy()}),r._dom.wrapper.remove()}))}return i.prototype.destroyAdd=function(t){this._s.toDestroy.push(t)},i.prototype.destroyRemove=function(t){t=this._s.toDestroy.indexOf(t);-1!==t&&this._s.toDestroy.splice(t,1)},i.prototype.dt=function(){return this._dt},i.prototype.idx=function(){return this._s.columnIdx},i.prototype.resolve=function(t){var e=null,n=null,r=null;if("string"==typeof t?(e=i.content[r=t],n=Object.assign({},null==e?void 0:e.defaults)):Array.isArray(t)?(e=i.content[r="dropdown"],n=Object.assign({},null==e?void 0:e.defaults,{content:t})):t.extend&&(r=t.extend,e=i.content[r],n=Object.assign({},null==e?void 0:e.defaults,t)),e)return e.extend?(t=e.extend.call(this,n),this.resolve(t)):{config:n,type:r,plugin:e};throw new Error("Unknown ColumnControl content type: "+r)},i.prototype.unique=function(){return this._s.unique},i.prototype._target=function(){var t,e,n=this._c.target,r=this._dt.column(this._s.columnIdx),o="header";return"number"==typeof n?t=r.header(n):(e="tfoot"!==(n=n.split(":"))[0],n=n[1]?parseInt(n[1]):0,e?t=r.header(n):(t=r.footer(n),o="footer")),t.querySelector("div.dt-column-"+o)},i.Button=Button,i.CheckList=CheckList,i.SearchInput=SearchInput,i.content=contentTypes,i.defaults={className:"",content:null,target:0},i.icons=icons,i.version="1.1.0",i})();function searchClear(){var n=this;return this.iterator("column",function(t,e){n.trigger("cc-search-clear",[e])})}function assetTarget(t,e,n){if(!t[e]){var r=!0,o=0,i=("number"==typeof e?o=e:("tfoot"===(i=e.split(":"))[0]&&(r=!1),i[1]&&(o=parseInt(i[1]))),r?n.table().header():n.table().footer());if(!i.querySelectorAll("tr")[o]){var a=n.columns().count(),s=createElement("tr");s.setAttribute("data-dt-order","disable");for(var c=0;c<a;c++)s.appendChild(createElement("td"));i.appendChild(s)}t[e]=!0}}function getOptionsForTarget(t,e){var n=ColumnControl.defaults.target;if(isIContentArray(e)){if(n===t)return{target:n,content:e}}else if(Array.isArray(e))for(var r=0;r<e.length;r++){var o=e[r];if(isIContentArray(o)){if(n===t)return{target:n,content:o}}else if(isIConfig(o)){if(t===(void 0!==o.target?o.target:n))return o}else if(t===n)return{target:n,content:e}}else if("object"==typeof e)if(isIConfig(e)){if(t===(void 0!==e.target?e.target:n))return e}else if(t===n)return{target:n,content:e}}function identifyTargets(e,t){function n(t){e.includes(t)||e.push(t)}return Array.isArray(t)?0===t.length?n(ColumnControl.defaults.target):t.forEach(function(t){n(("object"==typeof t&&void 0!==t.target?t:ColumnControl.defaults).target)}):"object"==typeof t&&n((void 0!==t.target?t:ColumnControl.defaults).target),e}function isIConfig(t){return"object"==typeof t&&void 0!==t.target}function isIContentArray(t){var e=!1;if(!Array.isArray(t))return!1;for(var n=0;n<t.length;n++)if(isIConfig(t[n])){e=!0;break}return!e}DataTable.ColumnControl=ColumnControl,$(document).on("i18n.dt",function(t,e){if("dt"===t.namespace){var n=new DataTable.Api(e),t=n.table().header(),r=e.oInit.columnControl,o=ColumnControl.defaults,i=[],a={};t.querySelectorAll("tr").length<=1&&null===e.titleRow&&(e.titleRow=0),identifyTargets(i,r),ColumnControl.defaults.content&&identifyTargets(i,o),n.columns().every(function(t){var e=this.init().columnControl;identifyTargets(i,e)});for(var s=0;s<i.length;s++)assetTarget(a,i[s],n)}}),$(document).on("preInit.dt",function(t,e){var s,c,l,u;"dt"===t.namespace&&(s=new DataTable.Api(e),c=e.oInit.columnControl,l=ColumnControl.defaults,identifyTargets(u=[],c),ColumnControl.defaults.content&&identifyTargets(u,l),s.columns().every(function(t){for(var e=this.init().columnControl,n=identifyTargets(u.slice(),e),r=0;r<n.length;r++){var o=getOptionsForTarget(n[r],e),i=getOptionsForTarget(n[r],c),a=getOptionsForTarget(n[r],l);(a||i||o)&&new ColumnControl(s,this.index(),Object.assign({},a||{},i||{},o||{}))}}))}),DataTable.Api.registerPlural("columns().columnControl.searchClear()","column().columnControl.searchClear()",searchClear),DataTable.Api.registerPlural("columns().ccSearchClear()","column().ccSearchClear()",searchClear),DataTable.Api.registerPlural("columns().columnControl.searchList()","column().columnControl.searchList()",function(n){return this.iterator("column",function(t,e){t.aoColumns[e].columnControlSearchList(n)})}),DataTable.ext.buttons.ccSearchClear={text:function(t){return t.i18n("columnControl.buttons.searchClear","Clear search")},init:function(n,t,e){var r=this;n.on("draw.DT",function(){var t=!1,e=!!n.search();e||n.columns().every(function(){(this.search.fixed("dtcc")||this.search.fixed("dtcc-list"))&&(t=!0)}),r.enable(e||t)}),this.enable(!1)},action:function(t,e,n,r){e.search(""),e.columns().columnControl.searchClear(),e.draw()}};export default DataTable;
|
|
8
|
+
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;function createElement(t,e,n,r){void 0===e&&(e=[]),void 0===n&&(n=null),void 0===r&&(r=[]);var o=document.createElement(t);return addClass(o,e),n&&(o.innerHTML=n),r.forEach(function(t){o.appendChild(t)}),o}function addClass(e,t){t&&(t=Array.isArray(t)?t:[t]).forEach(function(t){e&&t&&e.classList.add(t)})}function wrap(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">'+t+"</svg>"}var icons={chevronRight:wrap('<path d="m9 18 6-6-6-6"/>'),columns:wrap('<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="M15 3v18"/>'),contains:wrap('<path d="M10 3h4v18h-4z"/><path d="M18 8h3v9h-3"/><path d="M6 17H3V8h3"/>'),empty:wrap('<circle cx="12" cy="12" r="10"/>'),ends:wrap('<path d="M21 3h-4v18h4z"/><path d="M13 8H3v9h10"/>'),equal:wrap('<line x1="5" x2="19" y1="9" y2="9"/><line x1="5" x2="19" y1="15" y2="15"/>'),greater:wrap('<path d="m9 18 6-6-6-6"/>'),greaterOrEqual:wrap('<path d="m9 16 6-6-6-6"/><path d="m9 21 6-6"/>'),groupAdd:wrap('<path d="M6 21v-7.5m-3.549 3.75H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" fill="currentColor" rx="1.5"/>'),groupClear:wrap('<rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupTop:wrap('<rect width="13.5" height="7.5" x="3" y="3" fill="currentColor" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),groupRemove:wrap('<path d="M2.451 17.25H9.75"/><rect width="13.5" height="7.5" x="3" y="3" rx="1.5"/><rect width="7.5" height="7.5" x="13.5" y="13.5" rx="1.5"/>'),less:wrap('<path d="m15 18-6-6 6-6"/>'),lessOrEqual:wrap('<path d="m15 16-6-6 6-6"/><path d="m15 21-6-6"/>'),menu:wrap('<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>'),move:wrap('<line x1="12" x2="12" y1="3" y2="21"/><polyline points="8 8 4 12 8 16"/><polyline points="16 16 20 12 16 8"/>'),moveLeft:wrap('<path d="m9 6-6 6 6 6"/><path d="M3 12h14"/><path d="M21 19V5"/>'),moveRight:wrap('<path d="M3 5v14"/><path d="M21 12H7"/><path d="m15 18 6-6-6-6"/>'),notContains:wrap('<path d="M15 4 9 20"/><path d="M3 8h18v9H3z"/>'),notEmpty:wrap('<circle cx="12" cy="12" r="10"/><line x1="9" x2="15" y1="15" y2="9"/>'),notEqual:wrap('<path d="M5 9h14"/><path d="M5 15h14"/><path d="M15 5 9 19"/>'),orderAddAsc:wrap('<path d="M17 21v-8"/><path d="M3 4h6"/><path d="M3 8h9"/><path d="M3 12h10"/><path d="M13 17h8"/>'),orderAddDesc:wrap('<path d="M17 21v-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderAsc:wrap('<path d="m3 8 4-4 4 4"/><path d="M7 4v16"/><path d="M11 12h4"/><path d="M11 16h7"/><path d="M11 20h10"/>'),orderClear:wrap('<path d="m21 21-8-8"/><path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="m13 21 8-8"/>'),orderDesc:wrap('<path d="m3 16 4 4 4-4"/><path d="M7 20V4"/><path d="M11 4h10"/><path d="M11 8h7"/><path d="M11 12h4"/>'),orderRemove:wrap('<path d="M3 4h12"/><path d="M3 8h9"/><path d="M3 12h6"/><path d="M13 17h8"/>'),orderNone:wrap('<path d="m3 8 4-4 4 4"/><path d="m11 16-4 4-4-4"/><path d="M7 4v16"/><path d="M15 8h6"/><path d="M15 16h6"/><path d="M13 12h8"/>'),search:wrap('<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),searchClear:wrap('<path d="m13.5 8.5-5 5"/><path d="m8.5 8.5 5 5"/><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>'),starts:wrap('<path d="M3 3h4v18H3z"/><path d="M11 8h10v9H11"/>'),tick:wrap('<path d="M20 6 9 17l-5-5"/>'),x:wrap('<path d="M18 6 6 18"/><path d="m6 6 12 12"/>')};function close(e){void 0===e&&(e=null),document.querySelectorAll("div.dtcc-dropdown").forEach(function(t){null!==e&&t.contains(e.target)||(t._close(),e._closed||(e._closed=[]),e._closed.push(t))})}function getContainer(t,e){return e.closest("div.dtfh-floatingparent")||t.table().container()}function positionDropdown(t,e,n){var r=n.closest("div.dt-column-header"),e=getContainer(e,n),r=getComputedStyle(r),o=t.offsetWidth,i=relativePosition(e,n),a=i.top+n.offsetHeight,r="row-reverse"===r.flexDirection?i.left:i.left-o+n.offsetWidth,i=e.offsetWidth;i<r+o&&(r-=r+o-i),r<0&&(r=0),t.style.top=a+"px",t.style.left=r+"px"}function attachDropdown(n,t,e){function r(t){var e;n._shown?t.target===n||n.contains(t.target)||(e=document.querySelector("div.dt-datetime"))&&(t.target===e||e.contains(t.target))||(n._close(),document.body.removeEventListener("click",r)):document.body.removeEventListener("click",r)}var o=getContainer(t,e.element());n._shown=!0,o.append(n),positionDropdown(n,t,e.element()),e.element().setAttribute("aria-expanded","true");return document.body.addEventListener("click",r),r}function relativePosition(t,e){for(var n=0,r=0;e&&e!==t&&e!==document.body;)n+=e.offsetTop,r+=e.offsetLeft,e.scrollTop&&(r-=e.scrollTop),e.scrollLeft&&(r-=e.scrollLeft),e=e.offsetParent;return{top:n,left:r}}function focusCapture(r,o){return function(t){var e,n;r._shown&&(e=Array.from(r.querySelectorAll("a, button, input, select")),n=document.activeElement,"Escape"===t.key?(r._close(),o.focus()):"Tab"===t.key&&0!==e.length&&(e.includes(n)?t.shiftKey?n===e[0]&&(e[e.length-1].focus(),t.preventDefault()):n===e[e.length-1]&&(e[0].focus(),t.preventDefault()):(e[0].focus(),t.preventDefault())))}}var dropdownContent={classes:{container:"dtcc-dropdown",liner:"dtcc-dropdown-liner"},defaults:{className:"dropdown",content:[],icon:"menu",text:"More..."},init:function(n){var r=this.dt(),o=createElement("div",dropdownContent.classes.container,"",[createElement("div",dropdownContent.classes.liner)]),t=(o._shown=!1,o._close=function(){o.remove(),o._shown=!1,i.element().setAttribute("aria-expanded","false")},o.setAttribute("role","dialog"),o.setAttribute("aria-label",r.i18n("columnControl.dropdown",n.text)),r.on("fixedheader-mode",function(){o._shown&&attachDropdown(o,r,n._parents?n._parents[0]:i)}),o.childNodes[0]),i=new Button(r,this).text(r.i18n("columnControl.dropdown",n.text)).icon(n.icon).className(n.className).dropdownDisplay(t).handler(function(t){var e;t._closed&&t._closed.includes(o)||(attachDropdown(o,r,n._parents?n._parents[0]:i),(e=o.querySelector("input, a, button"))&&"keypress"===t.type&&e.focus())});i.element().setAttribute("aria-haspopup","dialog"),i.element().setAttribute("aria-expanded","false");for(var e=0;e<n.content.length;e++){var a=this.resolve(n.content[e]),a=(a.config._parents||(a.config._parents=[]),a.config._parents.push(i),a.plugin.init.call(this,a.config));t.appendChild(a)}n._parents&&n._parents.length&&i.extra("chevronRight"),r.on("columns-reordered",function(){positionDropdown(o,r,i.element())});var s=focusCapture(o,i.element());return document.body.addEventListener("keydown",s),r.on("destroy",function(){document.body.removeEventListener("keydown",s)}),i.element()}},_namespace=0,Button=(()=>{function n(t,e){this._s={active:!1,activeList:[],buttonClick:null,dt:null,enabled:!0,host:null,label:"",namespace:"",value:null},this._s.dt=t,this._s.host=e,this._dom={button:createElement("button",n.classes.container),dropdownDisplay:null,extra:createElement("span","dtcc-button-extra"),icon:createElement("span","dtcc-button-icon"),state:createElement("span","dtcc-button-state"),text:createElement("span","dtcc-button-text")},this._dom.button.setAttribute("type","button"),this._dom.button.append(this._dom.icon),this._dom.button.append(this._dom.text),this._dom.button.append(this._dom.state),this._dom.button.append(this._dom.extra),this.enable(!0)}return n.prototype.active=function(t){return void 0===t?this._s.active:(this._s.active=t,this._checkActive(),this)},n.prototype.activeList=function(t,e){return this._s.activeList[t]=e,this._checkActive(),this},n.prototype.checkDisplay=function(){for(var t=0,e=this._dom.dropdownDisplay.childNodes,n=0;n<e.length;n++)"none"!==e[n].style.display&&t++;return 0===t&&(this._dom.button.style.display="none"),this},n.prototype.className=function(t){return this._dom.button.classList.add("dtcc-button_"+t),this},n.prototype.destroy=function(){this._s.buttonClick&&(this._dom.button.removeEventListener("click",this._s.buttonClick),this._dom.button.removeEventListener("keypress",this._s.buttonClick)),this._s.host.destroyRemove(this)},n.prototype.dropdownDisplay=function(t){return this._dom.dropdownDisplay=t,this},n.prototype.element=function(){return this._dom.button},n.prototype.enable=function(t){return void 0===t?this._s.enabled:(this._dom.button.classList.toggle("dtcc-button_disabled",!t),this._s.enabled=t,this)},n.prototype.extra=function(t){return this._dom.extra.innerHTML=t?icons[t]:"",this},n.prototype.handler=function(e){function t(t){close(t),t.stopPropagation(),t.preventDefault(),n._s.enabled&&e(t)}var n=this;return this._s.buttonClick=t,this._s.namespace="dtcc-"+_namespace++,this._dom.button.addEventListener("click",t),this._dom.button.addEventListener("keypress",t),this._s.host.destroyAdd(this),this},n.prototype.icon=function(t){return this._dom.icon.innerHTML=t?icons[t]:"",this},n.prototype.text=function(t){return void 0===t?this._s.label:(this._dom.text.innerHTML=t,this._s.label=t,this._dom.button.setAttribute("aria-label",t),this)},n.prototype.value=function(t){return void 0===t?this._s.value:(this._s.value=t,this)},n.prototype._checkActive=function(){return!0===this._s.active||Object.values(this._s.activeList).includes(!0)?(this._dom.state.innerHTML=icons.tick,this._dom.button.classList.add("dtcc-button_active")):(this._dom.state.innerHTML="",this._dom.button.classList.remove("dtcc-button_active")),this},n.classes={container:"dtcc-button"},n})(),CheckList=(()=>{function c(t,e,n){function r(){a._s.search=s.search.value,a._redraw()}function o(t){a.selectAll(),a._s.handler(t,null,a._s.buttons,!0),a._updateCount()}function i(t){a.selectNone(),a._s.handler(t,null,a._s.buttons,!0),a._updateCount()}var a=this,s=(this._s={buttons:[],dt:null,handler:function(){},host:null,search:""},this._s.dt=t,this._s.host=e,this._dom={buttons:createElement("div","dtcc-list-buttons"),container:createElement("div",c.classes.container),controls:createElement("div","dtcc-list-controls"),empty:createElement("div","dtcc-list-empty",t.i18n("columnControl.list.empty","No options")),title:createElement("div","dtcc-list-title"),selectAll:createElement("button","dtcc-list-selectAll",t.i18n("columnControl.list.all","Select all")),selectAllCount:createElement("span"),selectNone:createElement("button","dtcc-list-selectNone",t.i18n("columnControl.list.none","Deselect")),selectNoneCount:createElement("span"),search:createElement("input",c.classes.input)},this._dom);s.search.setAttribute("type","text"),s.container.append(s.title),s.container.append(s.controls),s.container.append(s.empty),s.container.append(s.buttons),n.select&&(s.controls.append(s.selectAll),s.controls.append(s.selectNone),s.selectAll.append(s.selectAllCount),s.selectNone.append(s.selectNoneCount),s.selectAll.setAttribute("type","button"),s.selectNone.setAttribute("type","button"));n.search&&(s.controls.append(s.search),s.search.setAttribute("placeholder",t.i18n("columnControl.list.search","Search...")),s.search.addEventListener("input",r)),s.selectAll.addEventListener("click",o),s.selectNone.addEventListener("click",i),t.on("destroy",function(){s.selectAll.removeEventListener("click",o),s.selectNone.removeEventListener("click",i),s.search.removeEventListener("input",r)})}return c.prototype.add=function(n,t){for(var r=this,o=(Array.isArray(n)||(n=[n]),this),e=0;e<n.length;e++)(t=>{var t=n[t],e=new Button(o._s.dt,o._s.host).active(t.active||!1).handler(function(t){r._s.handler(t,e,r._s.buttons,!0),r._updateCount()}).icon(t.icon||"").text(""!==t.label?t.label:o._s.dt.i18n("columnControl.list.empty","Empty")).value(t.value);""===t.label&&e.className("empty"),o._s.buttons.push(e)})(e);var i=this._s.buttons.length;return!0!==t&&void 0!==t||(this._dom.selectAllCount.innerHTML=i?"("+i+")":"",this._redraw()),this},c.prototype.button=function(t){for(var e=this._s.buttons,n=0;n<e.length;n++)if(e[n].value()===t)return e[n];return null},c.prototype.clear=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].destroy();return this._dom.buttons.replaceChildren(),this._s.buttons.length=0,this},c.prototype.element=function(){return this._dom.container},c.prototype.handler=function(t){return this._s.handler=t,this},c.prototype.searchListener=function(t){var n=this;return t.on("cc-search-clear",function(t,e){e===n._s.host.idx()&&(n.selectNone(),n._s.handler(t,null,n._s.buttons,!1),n._s.search="",n._dom.search.value="",n._redraw(),n._updateCount())}),this},c.prototype.selectAll=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!0);return this},c.prototype.selectNone=function(){for(var t=0;t<this._s.buttons.length;t++)this._s.buttons[t].active(!1);return this},c.prototype.title=function(t){return this._dom.title.innerHTML=t,this},c.prototype.values=function(t){var e,n=[],r=this._s.buttons;if(void 0!==t){for(e=0;e<r.length;e++)t.includes(r[e].value())&&r[e].active(!0);return this._updateCount(),this}for(e=0;e<r.length;e++)r[e].active()&&n.push(r[e].value());return n},c.prototype._updateCount=function(){var t=this.values().length;this._dom.selectNoneCount.innerHTML=t?"("+t+")":""},c.prototype._redraw=function(){var t=this._s.buttons,e=this._dom.buttons,n=this._s.search.toLowerCase();e.replaceChildren();for(var r=0;r<t.length;r++){var o=t[r];n&&!o.text().toLowerCase().includes(n)||e.appendChild(o.element())}this._dom.empty.style.display=0===t.length?"block":"none",e.style.display=0<t.length?"block":"none"},c.classes={container:"dtcc-list",input:"dtcc-list-search"},c})(),colVis={defaults:{className:"colVis",columns:"",search:!1,select:!1,title:"Column visibility"},init:function(t){function n(){o.columns(t.columns).every(function(){i.add({active:this.visible(),label:this.title(),value:this.index()})})}var o=this.dt(),i=new CheckList(o,this,{search:t.search,select:t.select}).title(o.i18n("columnControl.colVis",t.title)).handler(function(t,e,n){e&&e.active(!e.active()),r(n)}),r=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.value(),r=o.column(r);n.active()&&!r.visible()?r.visible(!0):!n.active()&&r.visible()&&r.visible(!1)}};return n(),o.on("column-visibility",function(t,e,n,r){n=i.button(n);n&&n.active(r)}),o.on("columns-reordered",function(t,e){i.clear(),n()}),i.element()}},colVisDropdown={defaults:{className:"colVis",columns:"",search:!1,select:!1,text:"Column visibility",title:"Column visibility"},extend:function(t){return{extend:"dropdown",icon:"columns",text:this.dt().i18n("columnControl.colVisDropdown",t.text),content:[Object.assign(t,{extend:"colVis"})]}}},reorder={defaults:{className:"reorder",icon:"move",text:"Reorder columns"},init:function(t){var n=this,e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.reorder",t.text)).icon(t.icon).className(t.className);return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),e.init().colReorder||new DataTable.ColReorder(e,{}),r.element()}},reorderLeft={defaults:{className:"reorderLeft",icon:"moveLeft",text:"Move column left"},init:function(t){var n=this,e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.reorderLeft",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();0<t&&e.colReorder.move(t,t-1)});return 0===this.idx()&&r.enable(!1),e.on("columns-reordered",function(t,e){r.enable(0<n.idx())}),r.element()}},reorderRight={defaults:{className:"reorderRight",icon:"moveRight",text:"Move column right"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.reorderRight",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.idx();t<r.columns().count()-1&&r.colReorder.move(t,t+1)});return this.idx()===r.columns().count()-1&&o.enable(!1),r.on("columns-reordered",function(t,e){o.enable(n.idx()<r.columns().count()-1)}),o.element()}},order={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!1,text:"Toggle ordering"},init:function(r){var o=this,t=this.dt(),i=new Button(t,this).text(t.i18n("columnControl.order",r.text)).icon("orderAsc").className(r.className);return r.statusOnly||t.order.listener(i.element(),DataTable.versionCheck("2.3.2")?function(){return[o.idx()]}:this.idx(),function(){}),t.on("order",function(t,e,n){n=n.find(function(t){return t.col===o.idx()});n?"asc"===n.dir?i.active(!0).icon(r.iconAsc):"desc"===n.dir&&i.active(!0).icon(r.iconDesc):i.active(!1).icon(r.iconNone)}),i.element()}},orderAddAsc={defaults:{className:"orderAddAsc",icon:"orderAddAsc",text:"Add Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAddAsc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"asc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},orderAddDesc={defaults:{className:"orderAddDesc",icon:"orderAddDesc",text:"Add Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAddDesc",t.text)).icon(t.icon).className(t.className).handler(function(){e.order().push([r.idx(),"desc"]),e.draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(!n)}),o.element()}},orderAsc={defaults:{className:"orderAsc",icon:"orderAsc",text:"Sort Ascending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderAsc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"asc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"asc"===t.dir});o.active(n)}),o.element()}},orderClear={defaults:{className:"orderClear",icon:"orderClear",text:"Clear sort"},init:function(t){var e=this.dt(),r=new Button(e,this).text(e.i18n("columnControl.orderClear",t.text)).icon(t.icon).className(t.className).handler(function(){e.order([]).draw()});return e.on("order",function(t,e,n){r.enable(0<n.length)}),0===e.order().length&&r.enable(!1),r.element()}},orderDesc={defaults:{className:"orderDesc",icon:"orderDesc",text:"Sort Descending"},init:function(t){var r=this,e=this.dt(),o=new Button(e,this).text(e.i18n("columnControl.orderDesc",t.text)).icon(t.icon).className(t.className).handler(function(){r.dt().order([{idx:r.idx(),dir:"desc"}]).draw()});return e.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()&&"desc"===t.dir});o.active(n)}),o.element()}},orderRemove={defaults:{className:"orderRemove",icon:"orderRemove",text:"Remove from sort"},init:function(t){var r=this,n=this.dt(),o=new Button(n,this).text(n.i18n("columnControl.orderRemove",t.text)).icon(t.icon).className(t.className).handler(function(){var t=n.order(),e=t.findIndex(function(t){return t[0]===r.idx()});t.splice(e,1),n.order(t).draw()});return n.on("order",function(t,e,n){n=n.some(function(t){return t.col===r.idx()});o.enable(n)}),o.enable(!1),o.element()}},orderStatus={defaults:{className:"order",iconAsc:"orderAsc",iconDesc:"orderDesc",iconNone:"orderNone",statusOnly:!0,text:"Sort status"},extend:function(t){return Object.assign(t,{extend:"order"})}};function rowGroupAdd$1(t,e){var n=rowGroupApplied(t);return-1===n.indexOf(e)&&(n.push(e),t.rowGroup().dataSrc(n)),n}function rowGroupApplied(t){t=t.rowGroup().dataSrc();return Array.isArray(t)?t:[t]}function rowGroupClear$1(t){t.rowGroup().dataSrc([])}function rowGroupRemove$1(t,e){var n=rowGroupApplied(t),e=n.indexOf(e);return-1!==e&&(n.splice(e,1),t.rowGroup().dataSrc(n)),n}var rowGroup={defaults:{className:"rowGroup",icon:"groupTop",order:!0,text:"Group rows"},init:function(e){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",e.text)).icon(e.icon).className(e.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.active()?rowGroupRemove$1(r,t):(rowGroupClear$1(r),rowGroupAdd$1(r,t),!1!==e.order&&r.order([n.idx(),"asc"])),r.draw()});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.active(t.includes(e))}),o.element()}},rowGroupAdd={defaults:{className:"rowGroupAdd",icon:"groupAdd",order:!0,text:"Add to grouping"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&rowGroupAdd$1(r,t),r.draw()});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.enable(!t.includes(e))}),o.element()}},rowGroupClear={defaults:{className:"rowGroupClear",icon:"groupClear",text:"Clear all grouping"},init:function(t){var e=this.dt(),n=new Button(e,this).text(e.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){rowGroupClear$1(e),e.draw()});return e.on("rowgroup-datasrc",function(){n.enable(0<rowGroupApplied(e).length)}),n.enable(0<rowGroupApplied(e).length),n.element()}},rowGroupRemove={defaults:{className:"rowGroupRemove",icon:"groupRemove",order:!0,text:"Remove from grouping"},init:function(t){var n=this,r=this.dt(),o=new Button(r,this).text(r.i18n("columnControl.rowGroup",t.text)).icon(t.icon).className(t.className).handler(function(){var t=r.column(n.idx()).dataSrc();o.enable()&&(rowGroupRemove$1(r,t),r.draw())});return r.on("rowgroup-datasrc",function(){var t=rowGroupApplied(r),e=r.column(n.idx()).dataSrc();o.enable(t.includes(e))}),o.enable(!1),o.element()}},SearchInput=(()=>{function c(n,t){function e(){i.runSearch()}function r(){a.typeIcon.innerHTML=icons[a.select.value],i.runSearch()}function o(){i.clear()}var i=this,a=(this._type="text",this._sspTransform=null,this._sspData={},this._dt=n,this._idx=t,this._dom={clear:createElement("span","dtcc-search-clear",icons.x),container:createElement("div",c.classes.container),typeIcon:createElement("div","dtcc-search-type-icon"),searchIcon:createElement("div","dtcc-search-icon",icons.search),input:createElement("input",c.classes.input),inputs:createElement("div"),select:createElement("select",c.classes.select),title:createElement("div","dtcc-search-title")},this._dom),s=t;a.input.setAttribute("type","text"),a.container.append(a.title,a.inputs),a.inputs.append(a.typeIcon,a.select,a.searchIcon,a.clear,a.input);a.input.addEventListener("input",e),a.select.addEventListener("input",r),a.clear.addEventListener("click",o),n.on("destroy",function(){a.input.removeEventListener("input",e),a.select.removeEventListener("input",r),a.clear.removeEventListener("click",o)}),n.on("stateSaveParams.DT",function(t,e,n){n.columnControl||(n.columnControl={}),n.columnControl[i._idx]||(n.columnControl[i._idx]={}),n.columnControl[i._idx].searchInput={logic:a.select.value,type:i._type,value:a.input.value}}),n.on("stateLoaded.DT",function(t,e,n){i._stateLoad(n)}),n.on("columns-reordered.DT",function(t,e){i._idx=n.colReorder.transpose(s,"fromOriginal")}),n.on("cc-search-clear.DT",function(t,e){e===i._idx&&(i._loadingState=!0,i.clear(),i._loadingState=!1)}),n.page.info().serverSide&&n.on("preXhr.DT",function(t,e,n){var r;n.columns&&n.columns[i._idx]&&(n.columns[i._idx].columnControl||(n.columns[i._idx].columnControl={}),r=i._dom.input.value,i._sspTransform&&(r=i._sspTransform(r)),n.columns[i._idx].columnControl.search=Object.assign({value:r,logic:i._dom.select.value,type:i._type},i._sspData))})}return c.prototype.addClass=function(t){return this._dom.container.classList.add(t),this},c.prototype.clear=function(){return this.set(this._dom.select.children[0].getAttribute("value"),""),this},c.prototype.clearable=function(t){return t||this._dom.clear.remove(),this},c.prototype.element=function(){return this._dom.container},c.prototype.input=function(){return this._dom.input},c.prototype.options=function(t){for(var e=this._dom.select,n=0;n<t.length;n++)e.add(new Option(t[n].label,t[n].value));return this._dom.typeIcon.innerHTML=icons[t[0].value],this},c.prototype.placeholder=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.placeholder=t.replace("[title]",e)),this},c.prototype.runSearch=function(){var t=this._dom,e="empty"===t.select.value||"notEmpty"===t.select.value||""!==t.input.value;t.container.classList.toggle("dtcc-search_active",e),!this._search||this._lastValue===t.input.value&&this._lastType===t.select.value||(this._search(t.select.value,t.input.value,this._loadingState),this._lastValue=t.input.value,this._lastType=t.select.value)},c.prototype.search=function(t){return this._search=t,this._stateLoad(this._dt.state.loaded()),this},c.prototype.set=function(t,e){var n=this._dom;return n.input.value=e,n.select.value=t,n.typeIcon.innerHTML=icons[n.select.value],this.runSearch(),this},c.prototype.sspTransform=function(t){return this._sspTransform=t,this},c.prototype.sspData=function(t){return this._sspData=t,this},c.prototype.title=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.title.innerHTML=t.replace("[title]",e)),this},c.prototype.titleAttr=function(t){var e;return t&&(e=this._dt.column(this._idx).title(),this._dom.input.title=t.replace("[title]",e)),this},c.prototype.type=function(t){return this._type=t,this},c.prototype._stateLoad=function(t){var e=this._dom,n=this._idx,n=null==(t=null==(t=null==t?void 0:t.columnControl)?void 0:t[n])?void 0:t.searchInput;n&&(this._loadingState=!0,e.select.value=n.logic,e.input.value=n.value,e.select.dispatchEvent(new Event("input")),this._loadingState=!1)},c.classes={container:["dtcc-content","dtcc-search"],input:"",select:""},c})(),searchDateTime={defaults:{clear:!0,excludeLogic:[],format:"",mask:"",placeholder:"",title:"",titleAttr:""},init:function(a){var s,c=this,l=!1,u=DataTable.use("moment"),d=DataTable.use("luxon"),h=this.dt(),t="columnControl.search.datetime.",p="",m="",e=new SearchInput(h,this.idx()).type("date").addClass("dtcc-searchDateTime").sspTransform(function(t){return toISO(t,p,u,d)}).sspData({mask:a.mask}).clearable(a.clear).placeholder(a.placeholder).title(a.title).titleAttr(a.titleAttr).options([{label:h.i18n(t+"equal","Equals"),value:"equal"},{label:h.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:h.i18n(t+"greater","After"),value:"greater"},{label:h.i18n(t+"less","Before"),value:"less"},{label:h.i18n(t+"empty","Empty"),value:"empty"},{label:h.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!a.excludeLogic.includes(t.value)})).search(function(e,n,t){a._parents&&a._parents.forEach(function(t){return t.activeList(c.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=h.column(c.idx());if(h.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||h.draw();else{var o=a.mask,i=""===n?"":dateToNum(s&&l?s.val():n.trim(),p,u,d,o);if("empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===i)return;i?"equal"===e?r.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,o)==i}):"notEqual"===e?r.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,o)!=i}):"greater"===e?r.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,o)>i}):"less"===e&&r.search.fixed("dtcc",function(t){return dateToNum(t,m,u,d,o)<i}):r.search.fixed("dtcc","")}t||r.draw()}});return h.ready(function(){var t=DataTable.use("datetime");m=getFormat(h,c.idx()),p=a.format||m,t&&(s=new t(e.input(),{format:p,i18n:h.settings()[0].oLanguage.datetime,onChange:function(){l=!0,e.runSearch(),l=!1}}))}),e.element()}};function getFormat(t,e){var n=t.column(e).type();if(n)if("datetime"===n){t=t.settings()[0].aoColumns[e].mRender,e=t("1999-08-07T23:05:04Z","display"),t=t("1999-08-07T03:05:04Z","display").includes("03");if(DataTable.use("moment"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","A").replace("pm","a").replace("07","DD").replace("7","D").replace("08","MM").replace("8","M").replace("1999","YYYY").replace("99","YY");if(DataTable.use("luxon"))return e.replace("23",t?"HH":"H").replace("11",t?"hh":"h").replace("05","mm").replace("04","ss").replace("PM","a").replace("07","dd").replace("7","d").replace("08","MM").replace("8","M").replace("1999","yyyy").replace("99","yy");if(e.includes("23")&&e.includes("1999"))return"YYYY-MM-DD hh:mm:ss";if(e.includes("23"))return"hh:mm:ss"}else{if(n.includes("datetime-"))return n.replace(/datetime-/g,"");if(n.includes("moment"))return n.replace(/moment-/g,"");if(n.includes("luxon"))return n.replace(/luxon-/g,"")}return"YYYY-MM-DD"}function dateToNum(t,e,n,r,o){return""===t?"":(n=t instanceof Date?t:"YYYY-MM-DD"!==e&&(n||r)?new Date(n?1e3*n(t,e).unix():r.DateTime.fromFormat(t,e).toMillis()):new Date(t.replace(/\//g,"-")),o&&(o.includes("YYYY")||n.setFullYear(1970),o.includes("MM")||n.setUTCMonth(0),o.includes("DD")||n.setUTCDate(1),o.includes("hh")||n.setUTCHours(0),o.includes("mm")||n.setUTCMinutes(0),o.includes("ss")||n.setUTCSeconds(0),o.includes("sss")||n.setUTCMilliseconds(0)),n.getTime())}function toISO(t,e,n,r){return""===t?"":"YYYY-MM-DD"!==e&&n?n.utc(t,e).toISOString():"YYYY-MM-DD"!==e&&r?r.DateTime.fromFormat(t,e).toISO():t.replace(/\//g,"-")}function setOptions(t,e){var n=t.values();t.clear();for(var r=0;r<e.length;r++)"object"==typeof e[r]?t.add({active:!1,label:e[r].label,value:e[r].value},r===e.length-1):t.add({active:!1,label:e[r],value:e[r]},r===e.length-1);n.length&&t.values(n)}function getState(t,e){t=null==(e=null==(e=null==e?void 0:e.columnControl)?void 0:e[t])?void 0:e.searchList;if(t)return t}function getJsonOptions(t,e){var n=null==(n=t.ajax.json())?void 0:n.columnControl,t=t.column(e),r=t.name(),t=t.dataSrc();return n&&n[r]?n[r]:n&&"string"==typeof t&&n[t]?n[t]:n&&n[e]?n[e]:null}function reloadOptions(t,e,n,r,o){var i=null==(i=t.ajax.json())?void 0:i.columnControl,a=[],s=getJsonOptions(t,n);if(s)a=s;else{if(i&&e.ajaxOnly)return void(e.hidable&&(r.element().style.display="none",e._parents)&&e._parents.forEach(function(t){return t.checkDisplay()}));if(!t.page.info().serverSide)for(var c={},l=t.rows({order:n}).indexes().toArray(),u=t.settings()[0],d=0;d<l.length;d++){var h=u.fastData(l[d],n,"filter"),h=null!=h?h.toString():"";c[h]||(c[h]=!0,a.push({label:u.fastData(l[d],n,e.orthogonal),value:h}))}}setOptions(r,a),o&&r.values(o)}var searchList={defaults:{ajaxOnly:!0,className:"searchList",hidable:!0,options:null,orthogonal:"display",search:!0,select:!0,title:""},init:function(r){function o(e){r._parents&&r._parents.forEach(function(t){return t.activeList(i.unique(),e&&!!e.length)});var t=s.column(i.idx());s.page.info().serverSide?t.init().__ccList=e&&0!==e.length:e&&(0===e.length?t.search.fixed("dtcc-list",""):t.search.fixed("dtcc-list",function(t){return e.includes(t)}))}var i=this,a=null,s=this.dt(),c=new CheckList(s,this,{search:r.search,select:r.select}).searchListener(s).title(s.i18n("columnControl.searchList",r.title).replace("[title]",s.column(this.idx()).title())).handler(function(t,e,n,r){e&&e.active(!e.active()),o(c.values()),r&&s.draw()}),l=(r.options?setOptions(c,r.options):(s.ready(function(){reloadOptions(s,r,i.idx(),c,a)}),s.on("xhr",function(t,e,n){s.one("draw",function(){reloadOptions(s,r,i.idx(),c,a),a=null})})),[]);return s.page.info().serverSide&&s.on("preXhr.DT",function(t,e,n){var r;n.columns&&n.columns[i.idx()]&&(n.columns[i.idx()].columnControl||(n.columns[i.idx()].columnControl={}),r=l.length?l:c.values(),l=[],n.columns[i.idx()].columnControl.list=Object.assign({},r))}),s.on("stateLoaded",function(t,e,n){n=getState(i.idx(),n);n&&(c.values(n),o(n))}),s.on("stateSaveParams",function(t,e,n){var r=i.idx();n.columnControl||(n.columnControl={}),n.columnControl[r]||(n.columnControl[r]={}),n.columnControl[r].searchList=s.ready()?c.values():a}),s.settings()[0].aoColumns[this.idx()].columnControlSearchList=function(t){"refresh"===t?reloadOptions(s,r,i.idx(),c,null):setOptions(c,t)},a=getState(this.idx(),s.state.loaded()),o(a),s.page.info().serverSide&&a&&a.length&&(l=a),c.element()}},searchNumber={defaults:{clear:!0,excludeLogic:[],placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,a=this.dt(),t="columnControl.search.number.",t=new SearchInput(a,this.idx()).type("num").addClass("dtcc-searchNumber").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:a.i18n(t+"equal","Equals"),value:"equal"},{label:a.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:a.i18n(t+"greater","Greater than"),value:"greater"},{label:a.i18n(t+"greaterOrEqual","Greater or equal"),value:"greaterOrEqual"},{label:a.i18n(t+"less","Less than"),value:"less"},{label:a.i18n(t+"lessOrEqual","Less or equal"),value:"lessOrEqual"},{label:a.i18n(t+"empty","Empty"),value:"empty"},{label:a.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!o.excludeLogic.includes(t.value)})).search(function(e,n,t){o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=a.column(i.idx());if(a.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||a.draw();else{if("empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===n)return;""===n?r.search.fixed("dtcc",""):"equal"===e?r.search.fixed("dtcc",function(t){return stringToNum(t)==n}):"notEqual"===e?r.search.fixed("dtcc",function(t){return stringToNum(t)!=n}):"greater"===e?r.search.fixed("dtcc",function(t){return stringToNum(t)>n}):"greaterOrEqual"===e?r.search.fixed("dtcc",function(t){return stringToNum(t)>=n}):"less"===e?r.search.fixed("dtcc",function(t){return stringToNum(t)<n}):"lessOrEqual"===e&&r.search.fixed("dtcc",function(t){return stringToNum(t)<=n})}t||r.draw()}});return t.input().setAttribute("inputmode","numeric"),t.input().setAttribute("pattern","[0-9]*"),t.element()}},_re_html=/<([^>]*>)/g,_re_formatted_numeric=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;function stringToNum(t){var e;return 0===t||t&&"-"!==t?"number"==(e=typeof t)||"bigint"==e?t:+(t=t.replace?t.replace(_re_html,"").replace(_re_formatted_numeric,""):t):-1/0}var searchText={defaults:{clear:!0,excludeLogic:[],placeholder:"",title:"",titleAttr:""},init:function(o){var i=this,a=this.dt(),t="columnControl.search.text.";return new SearchInput(a,this.idx()).addClass("dtcc-searchText").clearable(o.clear).placeholder(o.placeholder).title(o.title).titleAttr(o.titleAttr).options([{label:a.i18n(t+"contains","Contains"),value:"contains"},{label:a.i18n(t+"notContains","Does not contain"),value:"notContains"},{label:a.i18n(t+"equal","Equals"),value:"equal"},{label:a.i18n(t+"notEqual","Does not equal"),value:"notEqual"},{label:a.i18n(t+"starts","Starts"),value:"starts"},{label:a.i18n(t+"ends","Ends"),value:"ends"},{label:a.i18n(t+"empty","Empty"),value:"empty"},{label:a.i18n(t+"notEmpty","Not empty"),value:"notEmpty"}].filter(function(t){return!o.excludeLogic.includes(t.value)})).search(function(e,n,t){o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),"empty"===e||"notEmpty"===e||!!n)});var r=a.column(i.idx());if(a.page.info().serverSide)r.init().__ccList=!("empty"!==e&&"notEmpty"!==e&&!n),t||a.draw();else{if(n=n.toLowerCase(),"empty"===e)r.search.fixed("dtcc",function(t){return!t});else if("notEmpty"===e)r.search.fixed("dtcc",function(t){return!!t});else{if(""===r.search.fixed("dtcc")&&""===n)return;""===n?r.search.fixed("dtcc",""):"equal"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase()==n}):"notEqual"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase()!=n}):"contains"===e?r.search.fixed("dtcc",n):"notContains"===e?r.search.fixed("dtcc",function(t){return!t.toLowerCase().includes(n)}):"starts"===e?r.search.fixed("dtcc",function(t){return t.toLowerCase().startsWith(n)}):"ends"===e&&r.search.fixed("dtcc",function(t){return t.toLowerCase().endsWith(n)})}o._parents&&o._parents.forEach(function(t){return t.activeList(i.unique(),!!r.search.fixed("dtcc"))}),t||r.draw()}}).element()}},search={defaults:{allowSearchList:!1},init:function(n){function e(t){var e=getJsonOptions(i,a);return"list"===t||n.allowSearchList&&e?searchList.init.call(o,Object.assign({},searchList.defaults,n)):"date"===t||t.startsWith("datetime")?searchDateTime.init.call(o,Object.assign({},searchDateTime.defaults,n)):t.includes("num")?searchNumber.init.call(o,Object.assign({},searchNumber.defaults,n)):searchText.init.call(o,Object.assign({},searchText.defaults,n))}var r,o=this,i=this.dt(),a=this.idx(),t=null==(t=null==(t=i.state.loaded())?void 0:t.columnControl)?void 0:t[a];return t?t.searchInput?r=e(t.searchInput.type):t.searchList&&(r=e("list")):(r=document.createElement("div"),i.ready(function(){var t=i.column(a),t=e(t.type());r.replaceWith(t)})),r}},searchClear$1={defaults:{className:"searchClear",icon:"searchClear",text:"Clear Search"},init:function(t){var o=this,i=this.dt(),a=new Button(i,this).text(i.i18n("columnControl.searchClear",t.text)).icon(t.icon).className(t.className).handler(function(){i.column(o.idx()).columnControl.searchClear().draw()}).enable(!1);return i.on("draw",function(){var t=i.column(o.idx()),e=t.search.fixed("dtcc"),n=t.search.fixed("dtcc-list"),r=t.init().__ccSearch,t=t.init().__ccList;a.enable(!!(e||n||r||t))}),a.element()}},searchDropdown={defaults:{ajaxOnly:!0,allowSearchList:!0,className:"searchDropdown",clear:!0,columns:"",hidable:!0,options:null,orthogonal:"display",placeholder:"",search:!0,select:!0,text:"Search",title:"",titleAttr:""},extend:function(t){return{extend:"dropdown",icon:"search",text:this.dt().i18n("columnControl.searchDropdown",t.text),content:[Object.assign(t,{extend:"search"})]}}},spacer={defaults:{className:"dtcc-spacer",text:""},init:function(t){var e=this.dt(),e=createElement("div",t.className,e.i18n("columnControl.spacer",t.text));return e.setAttribute("role","separator"),e}},title={defaults:{className:"dtcc-title",text:null},init:function(t){var e=this.dt().column(this.idx()).title(),n=null===t.text?"[title]":t.text;return createElement("div",t.className,n.replace("[title]",e))}},contentTypes={colVis:colVis,colVisDropdown:colVisDropdown,dropdown:dropdownContent,reorder:reorder,reorderLeft:reorderLeft,reorderRight:reorderRight,rowGroup:rowGroup,rowGroupAdd:rowGroupAdd,rowGroupClear:rowGroupClear,rowGroupRemove:rowGroupRemove,order:order,orderAddAsc:orderAddAsc,orderAddDesc:orderAddDesc,orderAsc:orderAsc,orderClear:orderClear,orderDesc:orderDesc,orderRemove:orderRemove,orderStatus:orderStatus,search:search,searchClear:searchClear$1,searchDropdown:searchDropdown,searchDateTime:searchDateTime,searchList:searchList,searchNumber:searchNumber,searchText:searchText,spacer:spacer,title:title},ColumnControl=(()=>{function i(n,t,e){var r=this,o=(this._dom={target:null,wrapper:null},this._c={},this._s={columnIdx:null,unique:null,toDestroy:[]},this._dt=n,this._s.columnIdx=t,this._s.unique=Math.random(),t);Object.assign(this._c,i.defaults,e),this._dom.target=this._target(),e.className&&addClass(this._dom.target.closest("tr"),e.className),this._c.content&&(n.on("columns-reordered",function(t,e){r._s.columnIdx=n.colReorder.transpose(o,"fromOriginal")}),this._dom.wrapper=document.createElement("span"),this._dom.wrapper.classList.add("dtcc"),this._dom.target.appendChild(this._dom.wrapper),this._c.content.forEach(function(t){t=r.resolve(t),t=t.plugin.init.call(r,t.config);r._dom.wrapper.appendChild(t)}),n.on("destroy",function(){r._s.toDestroy.slice().forEach(function(t){t.destroy()}),r._dom.wrapper.remove()}))}return i.prototype.destroyAdd=function(t){this._s.toDestroy.push(t)},i.prototype.destroyRemove=function(t){t=this._s.toDestroy.indexOf(t);-1!==t&&this._s.toDestroy.splice(t,1)},i.prototype.dt=function(){return this._dt},i.prototype.idx=function(){return this._s.columnIdx},i.prototype.resolve=function(t){var e=null,n=null,r=null;if("string"==typeof t?(e=i.content[r=t],n=Object.assign({},null==e?void 0:e.defaults)):Array.isArray(t)?(e=i.content[r="dropdown"],n=Object.assign({},null==e?void 0:e.defaults,{content:t})):t.extend&&(r=t.extend,e=i.content[r],n=Object.assign({},null==e?void 0:e.defaults,t)),e)return e.extend?(t=e.extend.call(this,n),this.resolve(t)):{config:n,type:r,plugin:e};throw new Error("Unknown ColumnControl content type: "+r)},i.prototype.unique=function(){return this._s.unique},i.prototype._target=function(){var t,e,n=this._c.target,r=this._dt.column(this._s.columnIdx),o="header";return"number"==typeof n?t=r.header(n):(e="tfoot"!==(n=n.split(":"))[0],n=n[1]?parseInt(n[1]):0,e?t=r.header(n):(t=r.footer(n),o="footer")),t.querySelector("div.dt-column-"+o)},i.Button=Button,i.CheckList=CheckList,i.SearchInput=SearchInput,i.content=contentTypes,i.defaults={className:"",content:null,target:0},i.icons=icons,i.version="1.2.0",i})();function searchClear(){var n=this;return this.iterator("column",function(t,e){n.trigger("cc-search-clear",[e])})}function assetTarget(t,e,n){if(!t[e]){var r=!0,o=0,i=("number"==typeof e?o=e:("tfoot"===(i=e.split(":"))[0]&&(r=!1),i[1]&&(o=parseInt(i[1]))),r?n.table().header():n.table().footer());if(!i.querySelectorAll("tr")[o]){var a=n.columns().count(),s=createElement("tr");s.setAttribute("data-dt-order","disable");for(var c=0;c<a;c++)s.appendChild(createElement("td"));i.appendChild(s)}t[e]=!0}}function getOptionsForTarget(t,e){var n=ColumnControl.defaults.target;if(isIContentArray(e)){if(n===t)return{target:n,content:e}}else if(Array.isArray(e))for(var r=0;r<e.length;r++){var o=e[r];if(isIContentArray(o)){if(n===t)return{target:n,content:o}}else if(isIConfig(o)){if(t===(void 0!==o.target?o.target:n))return o}else if(t===n)return{target:n,content:e}}else if("object"==typeof e)if(isIConfig(e)){if(t===(void 0!==e.target?e.target:n))return e}else if(t===n)return{target:n,content:e}}function identifyTargets(e,t){function n(t){e.includes(t)||e.push(t)}return Array.isArray(t)?0===t.length?n(ColumnControl.defaults.target):t.forEach(function(t){n(("object"==typeof t&&void 0!==t.target?t:ColumnControl.defaults).target)}):"object"==typeof t&&n((void 0!==t.target?t:ColumnControl.defaults).target),e}function isIConfig(t){return"object"==typeof t&&void 0!==t.target}function isIContentArray(t){var e=!1;if(!Array.isArray(t))return!1;for(var n=0;n<t.length;n++)if(isIConfig(t[n])){e=!0;break}return!e}DataTable.ColumnControl=ColumnControl,$(document).on("i18n.dt",function(t,e){if("dt"===t.namespace){var n=new DataTable.Api(e),t=n.table().header(),r=e.oInit.columnControl,o=ColumnControl.defaults,i=[],a={};t.querySelectorAll("tr").length<=1&&null===e.titleRow&&(e.titleRow=0),identifyTargets(i,r),ColumnControl.defaults.content&&identifyTargets(i,o),n.columns().every(function(t){var e=this.init().columnControl;identifyTargets(i,e)});for(var s=0;s<i.length;s++)assetTarget(a,i[s],n)}}),$(document).on("preInit.dt",function(t,e){var s,c,l,u;"dt"===t.namespace&&(s=new DataTable.Api(e),c=e.oInit.columnControl,l=ColumnControl.defaults,identifyTargets(u=[],c),ColumnControl.defaults.content&&identifyTargets(u,l),s.columns().every(function(t){for(var e=this.init().columnControl,n=identifyTargets(u.slice(),e),r=0;r<n.length;r++){var o=getOptionsForTarget(n[r],e),i=getOptionsForTarget(n[r],c),a=getOptionsForTarget(n[r],l);(a||i||o)&&new ColumnControl(s,this.index(),Object.assign({},a||{},i||{},o||{}))}}))}),DataTable.Api.registerPlural("columns().columnControl.searchClear()","column().columnControl.searchClear()",searchClear),DataTable.Api.registerPlural("columns().ccSearchClear()","column().ccSearchClear()",searchClear),DataTable.Api.registerPlural("columns().columnControl.searchList()","column().columnControl.searchList()",function(n){return this.iterator("column",function(t,e){t=t.aoColumns[e].columnControlSearchList;t&&t(n)})}),DataTable.ext.buttons.ccSearchClear={text:function(t){return t.i18n("columnControl.buttons.searchClear","Clear search")},init:function(n,t,e){var r=this;n.on("draw.DT",function(){var t=!1,e=!!n.search();e||n.columns().every(function(){(this.search.fixed("dtcc")||this.search.fixed("dtcc-list"))&&(t=!0)}),r.enable(e||t)}),this.enable(!1)},action:function(t,e,n,r){e.search(""),e.columns().columnControl.searchClear(),e.draw()}};export default DataTable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ColumnControl 1.
|
|
1
|
+
/*! ColumnControl 1.2.0
|
|
2
2
|
* Copyright (c) SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*
|
|
4
4
|
* SVG icons: ISC License
|
|
@@ -925,13 +925,9 @@ var reorder = {
|
|
|
925
925
|
var btn = new Button(dt, this)
|
|
926
926
|
.text(dt.i18n('columnControl.reorder', config.text))
|
|
927
927
|
.icon(config.icon)
|
|
928
|
-
.className(config.className)
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
if (idx > 0) {
|
|
932
|
-
dt.colReorder.move(idx, idx - 1);
|
|
933
|
-
}
|
|
934
|
-
});
|
|
928
|
+
.className(config.className);
|
|
929
|
+
// The event handling for this is done in ColReorder._addListener - no event
|
|
930
|
+
// handler needed here for click / drag
|
|
935
931
|
if (this.idx() === 0) {
|
|
936
932
|
btn.enable(false);
|
|
937
933
|
}
|
|
@@ -1485,6 +1481,10 @@ var SearchInput = /** @class */ (function () {
|
|
|
1485
1481
|
// Data for server-side processing
|
|
1486
1482
|
if (dt.page.info().serverSide) {
|
|
1487
1483
|
dt.on('preXhr.DT', function (e, s, d) {
|
|
1484
|
+
// The column has been removed from the submit data - can't do anything
|
|
1485
|
+
if (!d.columns || !d.columns[_this._idx]) {
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
1488
|
if (!d.columns[_this._idx].columnControl) {
|
|
1489
1489
|
d.columns[_this._idx].columnControl = {};
|
|
1490
1490
|
}
|
|
@@ -1703,6 +1703,7 @@ var SearchInput = /** @class */ (function () {
|
|
|
1703
1703
|
var searchDateTime = {
|
|
1704
1704
|
defaults: {
|
|
1705
1705
|
clear: true,
|
|
1706
|
+
excludeLogic: [],
|
|
1706
1707
|
format: '',
|
|
1707
1708
|
mask: '',
|
|
1708
1709
|
placeholder: '',
|
|
@@ -1735,17 +1736,28 @@ var searchDateTime = {
|
|
|
1735
1736
|
{ label: dt.i18n(i18nBase + 'less', 'Before'), value: 'less' },
|
|
1736
1737
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
1737
1738
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
1738
|
-
])
|
|
1739
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
1739
1740
|
.search(function (searchType, searchTerm, loadingState) {
|
|
1741
|
+
// If in a dropdown, set the parent levels as active
|
|
1742
|
+
if (config._parents) {
|
|
1743
|
+
config._parents.forEach(function (btn) {
|
|
1744
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
var column = dt.column(_this.idx());
|
|
1740
1748
|
// When SSP, don't apply a filter here, SearchInput will add to the submit data
|
|
1741
1749
|
if (dt.page.info().serverSide) {
|
|
1750
|
+
// Need to let the searchClear button know if we have a filter
|
|
1751
|
+
// applied though.
|
|
1752
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
1753
|
+
searchType === 'notEmpty' ||
|
|
1754
|
+
searchTerm);
|
|
1742
1755
|
if (!loadingState) {
|
|
1743
1756
|
dt.draw();
|
|
1744
1757
|
}
|
|
1745
1758
|
return;
|
|
1746
1759
|
}
|
|
1747
1760
|
var mask = config.mask;
|
|
1748
|
-
var column = dt.column(_this.idx());
|
|
1749
1761
|
var search = searchTerm === ''
|
|
1750
1762
|
? ''
|
|
1751
1763
|
: dateToNum(dateTime && fromPicker ? dateTime.val() : searchTerm.trim(), pickerFormat, moment, luxon, mask);
|
|
@@ -1786,12 +1798,6 @@ var searchDateTime = {
|
|
|
1786
1798
|
return dateToNum(haystack, dataSrcFormat, moment, luxon, mask) < search;
|
|
1787
1799
|
});
|
|
1788
1800
|
}
|
|
1789
|
-
// If in a dropdown, set the parent levels as active
|
|
1790
|
-
if (config._parents) {
|
|
1791
|
-
config._parents.forEach(function (btn) {
|
|
1792
|
-
return btn.activeList(_this.unique(), !!column.search.fixed('dtcc'));
|
|
1793
|
-
});
|
|
1794
|
-
}
|
|
1795
1801
|
if (!loadingState) {
|
|
1796
1802
|
column.draw();
|
|
1797
1803
|
}
|
|
@@ -1800,9 +1806,7 @@ var searchDateTime = {
|
|
|
1800
1806
|
dt.ready(function () {
|
|
1801
1807
|
var DateTime = DataTable.use('datetime');
|
|
1802
1808
|
dataSrcFormat = getFormat(dt, _this.idx());
|
|
1803
|
-
pickerFormat = config.format
|
|
1804
|
-
? config.format
|
|
1805
|
-
: dataSrcFormat;
|
|
1809
|
+
pickerFormat = config.format ? config.format : dataSrcFormat;
|
|
1806
1810
|
if (DateTime) {
|
|
1807
1811
|
dateTime = new DateTime(searchInput.input(), {
|
|
1808
1812
|
format: pickerFormat,
|
|
@@ -2091,11 +2095,18 @@ var searchList = {
|
|
|
2091
2095
|
// The search can be applied from a stored start at start up before the options are
|
|
2092
2096
|
// available. It can also be applied by user input, so it is generalised into this function.
|
|
2093
2097
|
var applySearch = function (values) {
|
|
2098
|
+
// If in a dropdown, set the parent levels as active
|
|
2099
|
+
if (config._parents) {
|
|
2100
|
+
config._parents.forEach(function (btn) { return btn.activeList(_this.unique(), values && !!values.length); });
|
|
2101
|
+
}
|
|
2102
|
+
var col = dt.column(_this.idx());
|
|
2094
2103
|
// When SSP, don't do any client-side filtering
|
|
2095
2104
|
if (dt.page.info().serverSide) {
|
|
2105
|
+
// Need to let the searchClear button know if we have a filter
|
|
2106
|
+
// applied though.
|
|
2107
|
+
col.init().__ccList = values && values.length !== 0;
|
|
2096
2108
|
return;
|
|
2097
2109
|
}
|
|
2098
|
-
var col = dt.column(_this.idx());
|
|
2099
2110
|
if (!values) {
|
|
2100
2111
|
return;
|
|
2101
2112
|
}
|
|
@@ -2109,10 +2120,6 @@ var searchList = {
|
|
|
2109
2120
|
return values.includes(val);
|
|
2110
2121
|
});
|
|
2111
2122
|
}
|
|
2112
|
-
// If in a dropdown, set the parent levels as active
|
|
2113
|
-
if (config._parents) {
|
|
2114
|
-
config._parents.forEach(function (btn) { return btn.activeList(_this.unique(), !!values.length); });
|
|
2115
|
-
}
|
|
2116
2123
|
};
|
|
2117
2124
|
var checkList = new CheckList(dt, this, {
|
|
2118
2125
|
search: config.search,
|
|
@@ -2143,17 +2150,25 @@ var searchList = {
|
|
|
2143
2150
|
// Need to wait for the draw to complete so the table has the latest data
|
|
2144
2151
|
dt.one('draw', function () {
|
|
2145
2152
|
reloadOptions(dt, config, _this.idx(), checkList, loadedValues);
|
|
2153
|
+
loadedValues = null;
|
|
2146
2154
|
});
|
|
2147
2155
|
});
|
|
2148
2156
|
}
|
|
2157
|
+
var sspValues = [];
|
|
2149
2158
|
// Data for server-side processing
|
|
2150
2159
|
if (dt.page.info().serverSide) {
|
|
2151
2160
|
dt.on('preXhr.DT', function (e, s, d) {
|
|
2161
|
+
// The column has been removed from the submit data - can't do anything
|
|
2162
|
+
if (!d.columns || !d.columns[_this.idx()]) {
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2152
2165
|
if (!d.columns[_this.idx()].columnControl) {
|
|
2153
2166
|
d.columns[_this.idx()].columnControl = {};
|
|
2154
2167
|
}
|
|
2168
|
+
var values = sspValues.length ? sspValues : checkList.values();
|
|
2169
|
+
sspValues = [];
|
|
2155
2170
|
// We need the indexes in the HTTP parameter names (for .NET), so use an object.
|
|
2156
|
-
d.columns[_this.idx()].columnControl.list = Object.assign({},
|
|
2171
|
+
d.columns[_this.idx()].columnControl.list = Object.assign({}, values);
|
|
2157
2172
|
});
|
|
2158
2173
|
}
|
|
2159
2174
|
// Unlike the SearchInput based search contents, CheckList does not handle state saving
|
|
@@ -2191,6 +2206,11 @@ var searchList = {
|
|
|
2191
2206
|
};
|
|
2192
2207
|
loadedValues = getState(this.idx(), dt.state.loaded());
|
|
2193
2208
|
applySearch(loadedValues);
|
|
2209
|
+
// If SSP, then there are no options yet, so for a saved state we need
|
|
2210
|
+
// to use the values from the state in a temporary variable
|
|
2211
|
+
if (dt.page.info().serverSide && loadedValues && loadedValues.length) {
|
|
2212
|
+
sspValues = loadedValues;
|
|
2213
|
+
}
|
|
2194
2214
|
return checkList.element();
|
|
2195
2215
|
}
|
|
2196
2216
|
};
|
|
@@ -2198,6 +2218,7 @@ var searchList = {
|
|
|
2198
2218
|
var searchNumber = {
|
|
2199
2219
|
defaults: {
|
|
2200
2220
|
clear: true,
|
|
2221
|
+
excludeLogic: [],
|
|
2201
2222
|
placeholder: '',
|
|
2202
2223
|
title: '',
|
|
2203
2224
|
titleAttr: ''
|
|
@@ -2222,19 +2243,34 @@ var searchNumber = {
|
|
|
2222
2243
|
value: 'greaterOrEqual'
|
|
2223
2244
|
},
|
|
2224
2245
|
{ label: dt.i18n(i18nBase + 'less', 'Less than'), value: 'less' },
|
|
2225
|
-
{
|
|
2246
|
+
{
|
|
2247
|
+
label: dt.i18n(i18nBase + 'lessOrEqual', 'Less or equal'),
|
|
2248
|
+
value: 'lessOrEqual'
|
|
2249
|
+
},
|
|
2226
2250
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
2227
2251
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
2228
|
-
])
|
|
2252
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
2229
2253
|
.search(function (searchType, searchTerm, loadingState) {
|
|
2230
|
-
//
|
|
2254
|
+
// If in a dropdown, set the parent levels as active
|
|
2255
|
+
if (config._parents) {
|
|
2256
|
+
config._parents.forEach(function (btn) {
|
|
2257
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
var column = dt.column(_this.idx());
|
|
2261
|
+
// When SSP, don't apply a filter here, SearchInput will add to
|
|
2262
|
+
// the submit data
|
|
2231
2263
|
if (dt.page.info().serverSide) {
|
|
2264
|
+
// Need to let the searchClear button know if we have a filter
|
|
2265
|
+
// applied though.
|
|
2266
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
2267
|
+
searchType === 'notEmpty' ||
|
|
2268
|
+
searchTerm);
|
|
2232
2269
|
if (!loadingState) {
|
|
2233
2270
|
dt.draw();
|
|
2234
2271
|
}
|
|
2235
2272
|
return;
|
|
2236
2273
|
}
|
|
2237
|
-
var column = dt.column(_this.idx());
|
|
2238
2274
|
if (searchType === 'empty') {
|
|
2239
2275
|
column.search.fixed('dtcc', function (haystack) { return !haystack; });
|
|
2240
2276
|
}
|
|
@@ -2268,12 +2304,6 @@ var searchNumber = {
|
|
|
2268
2304
|
else if (searchType === 'lessOrEqual') {
|
|
2269
2305
|
column.search.fixed('dtcc', function (haystack) { return stringToNum(haystack) <= searchTerm; });
|
|
2270
2306
|
}
|
|
2271
|
-
// If in a dropdown, set the parents as active
|
|
2272
|
-
if (config._parents) {
|
|
2273
|
-
config._parents.forEach(function (btn) {
|
|
2274
|
-
return btn.activeList(_this.unique(), !!column.search.fixed('dtcc'));
|
|
2275
|
-
});
|
|
2276
|
-
}
|
|
2277
2307
|
if (!loadingState) {
|
|
2278
2308
|
column.draw();
|
|
2279
2309
|
}
|
|
@@ -2303,6 +2333,7 @@ function stringToNum(d) {
|
|
|
2303
2333
|
var searchText = {
|
|
2304
2334
|
defaults: {
|
|
2305
2335
|
clear: true,
|
|
2336
|
+
excludeLogic: [],
|
|
2306
2337
|
placeholder: '',
|
|
2307
2338
|
title: '',
|
|
2308
2339
|
titleAttr: ''
|
|
@@ -2329,16 +2360,27 @@ var searchText = {
|
|
|
2329
2360
|
{ label: dt.i18n(i18nBase + 'ends', 'Ends'), value: 'ends' },
|
|
2330
2361
|
{ label: dt.i18n(i18nBase + 'empty', 'Empty'), value: 'empty' },
|
|
2331
2362
|
{ label: dt.i18n(i18nBase + 'notEmpty', 'Not empty'), value: 'notEmpty' }
|
|
2332
|
-
])
|
|
2363
|
+
].filter(function (x) { return !config.excludeLogic.includes(x.value); }))
|
|
2333
2364
|
.search(function (searchType, searchTerm, loadingState) {
|
|
2365
|
+
// If in a dropdown, set the parent levels as active
|
|
2366
|
+
if (config._parents) {
|
|
2367
|
+
config._parents.forEach(function (btn) {
|
|
2368
|
+
return btn.activeList(_this.unique(), searchType === 'empty' || searchType === 'notEmpty' || !!searchTerm);
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
var column = dt.column(_this.idx());
|
|
2334
2372
|
// When SSP, don't apply a filter here, SearchInput will add to the submit data
|
|
2335
2373
|
if (dt.page.info().serverSide) {
|
|
2374
|
+
// Need to let the searchClear button know if we have a filter
|
|
2375
|
+
// applied though.
|
|
2376
|
+
column.init().__ccList = !!(searchType === 'empty' ||
|
|
2377
|
+
searchType === 'notEmpty' ||
|
|
2378
|
+
searchTerm);
|
|
2336
2379
|
if (!loadingState) {
|
|
2337
2380
|
dt.draw();
|
|
2338
2381
|
}
|
|
2339
2382
|
return;
|
|
2340
2383
|
}
|
|
2341
|
-
var column = dt.column(_this.idx());
|
|
2342
2384
|
searchTerm = searchTerm.toLowerCase();
|
|
2343
2385
|
if (searchType === 'empty') {
|
|
2344
2386
|
column.search.fixed('dtcc', function (haystack) { return !haystack; });
|
|
@@ -2400,15 +2442,15 @@ var search = {
|
|
|
2400
2442
|
},
|
|
2401
2443
|
init: function (config) {
|
|
2402
2444
|
var _this = this;
|
|
2403
|
-
var _a, _b
|
|
2445
|
+
var _a, _b;
|
|
2404
2446
|
var dt = this.dt();
|
|
2405
2447
|
var idx = this.idx();
|
|
2406
2448
|
var displayEl;
|
|
2407
|
-
var loadedState = (
|
|
2449
|
+
var loadedState = (_b = (_a = dt.state.loaded()) === null || _a === void 0 ? void 0 : _a.columnControl) === null || _b === void 0 ? void 0 : _b[idx];
|
|
2408
2450
|
var initType = function (type) {
|
|
2409
2451
|
var json = getJsonOptions(dt, idx);
|
|
2410
2452
|
// Attempt to match what type of search should be shown
|
|
2411
|
-
if (config.allowSearchList && json) {
|
|
2453
|
+
if (type === 'list' || (config.allowSearchList && json)) {
|
|
2412
2454
|
// We've got a list of JSON options, and are allowed to show the searchList
|
|
2413
2455
|
return searchList.init.call(_this, Object.assign({}, searchList.defaults, config));
|
|
2414
2456
|
}
|
|
@@ -2429,7 +2471,12 @@ var search = {
|
|
|
2429
2471
|
// to allow the state to be applied to the table and the first draw to have a filter
|
|
2430
2472
|
// applied (if it is needed).
|
|
2431
2473
|
if (loadedState) {
|
|
2432
|
-
|
|
2474
|
+
if (loadedState.searchInput) {
|
|
2475
|
+
displayEl = initType(loadedState.searchInput.type);
|
|
2476
|
+
}
|
|
2477
|
+
else if (loadedState.searchList) {
|
|
2478
|
+
displayEl = initType('list');
|
|
2479
|
+
}
|
|
2433
2480
|
}
|
|
2434
2481
|
else {
|
|
2435
2482
|
// Wait until we can get the data type for the column and the run the corresponding type
|
|
@@ -2463,9 +2510,12 @@ var searchClear$1 = {
|
|
|
2463
2510
|
.enable(false);
|
|
2464
2511
|
dt.on('draw', function () {
|
|
2465
2512
|
// change enable state
|
|
2466
|
-
var
|
|
2467
|
-
var
|
|
2468
|
-
|
|
2513
|
+
var col = dt.column(_this.idx());
|
|
2514
|
+
var search = col.search.fixed('dtcc');
|
|
2515
|
+
var searchList = col.search.fixed('dtcc-list');
|
|
2516
|
+
var searchSearchSsp = col.init().__ccSearch;
|
|
2517
|
+
var searchListSsp = col.init().__ccList;
|
|
2518
|
+
btn.enable(!!(search || searchList || searchSearchSsp || searchListSsp));
|
|
2469
2519
|
});
|
|
2470
2520
|
return btn.element();
|
|
2471
2521
|
}
|
|
@@ -2744,7 +2794,7 @@ var ColumnControl = /** @class */ (function () {
|
|
|
2744
2794
|
/** SVG icons that can be used by the content plugins */
|
|
2745
2795
|
ColumnControl.icons = icons;
|
|
2746
2796
|
/** Version */
|
|
2747
|
-
ColumnControl.version = '1.
|
|
2797
|
+
ColumnControl.version = '1.2.0';
|
|
2748
2798
|
return ColumnControl;
|
|
2749
2799
|
}());
|
|
2750
2800
|
|
|
@@ -2828,7 +2878,10 @@ DataTable.Api.registerPlural('columns().columnControl.searchClear()', 'column().
|
|
|
2828
2878
|
DataTable.Api.registerPlural('columns().ccSearchClear()', 'column().ccSearchClear()', searchClear);
|
|
2829
2879
|
DataTable.Api.registerPlural('columns().columnControl.searchList()', 'column().columnControl.searchList()', function (options) {
|
|
2830
2880
|
return this.iterator('column', function (settings, idx) {
|
|
2831
|
-
settings.aoColumns[idx].columnControlSearchList
|
|
2881
|
+
var fn = settings.aoColumns[idx].columnControlSearchList;
|
|
2882
|
+
if (fn) {
|
|
2883
|
+
fn(options);
|
|
2884
|
+
}
|
|
2832
2885
|
});
|
|
2833
2886
|
});
|
|
2834
2887
|
DataTable.ext.buttons.ccSearchClear = {
|