melondtable 1.18.5 → 1.20.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -0
- package/dist/melondtable.cjs.js +267 -24
- package/dist/melondtable.css +38 -3
- package/dist/melondtable.js +362 -77
- package/dist/melondtable.min.css +1 -1
- package/dist/melondtable.min.js +1 -1
- package/package.json +3 -3
- package/src/body-renderer.js +15 -1
- package/src/cellmanager.js +40 -8
- package/src/columnmanager.js +85 -7
- package/src/datamanager.js +5 -6
- package/src/datatable.js +30 -0
- package/src/defaults.js +17 -0
- package/src/style.css +36 -3
- package/src/style.js +58 -1
- package/src/translations/en.json +2 -0
- package/src/translations/fr.json +2 -0
- package/src/translations/index.js +7 -7
- package/src/translations/pt.json +16 -0
- package/src/translations/sw.json +16 -0
- package/src/translations/de.json +0 -15
- package/src/translations/it.json +0 -15
package/dist/melondtable.js
CHANGED
|
@@ -271,11 +271,6 @@ var DataTable = (function (Sortable) {
|
|
|
271
271
|
|
|
272
272
|
var isObject_1 = isObject;
|
|
273
273
|
|
|
274
|
-
var isObject$1 = /*#__PURE__*/Object.freeze({
|
|
275
|
-
default: isObject_1,
|
|
276
|
-
__moduleExports: isObject_1
|
|
277
|
-
});
|
|
278
|
-
|
|
279
274
|
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
280
275
|
|
|
281
276
|
function commonjsRequire () {
|
|
@@ -295,11 +290,18 @@ var DataTable = (function (Sortable) {
|
|
|
295
290
|
|
|
296
291
|
var _freeGlobal = freeGlobal;
|
|
297
292
|
|
|
293
|
+
var _freeGlobal$1 = /*#__PURE__*/Object.freeze({
|
|
294
|
+
default: _freeGlobal,
|
|
295
|
+
__moduleExports: _freeGlobal
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
var freeGlobal$1 = ( _freeGlobal$1 && _freeGlobal ) || _freeGlobal$1;
|
|
299
|
+
|
|
298
300
|
/** Detect free variable `self`. */
|
|
299
301
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
300
302
|
|
|
301
303
|
/** Used as a reference to the global object. */
|
|
302
|
-
var root =
|
|
304
|
+
var root = freeGlobal$1 || freeSelf || Function('return this')();
|
|
303
305
|
|
|
304
306
|
var _root = root;
|
|
305
307
|
|
|
@@ -374,6 +376,11 @@ var DataTable = (function (Sortable) {
|
|
|
374
376
|
|
|
375
377
|
var _getRawTag = getRawTag;
|
|
376
378
|
|
|
379
|
+
var _getRawTag$1 = /*#__PURE__*/Object.freeze({
|
|
380
|
+
default: _getRawTag,
|
|
381
|
+
__moduleExports: _getRawTag
|
|
382
|
+
});
|
|
383
|
+
|
|
377
384
|
/** Used for built-in method references. */
|
|
378
385
|
var objectProto$1 = Object.prototype;
|
|
379
386
|
|
|
@@ -397,6 +404,8 @@ var DataTable = (function (Sortable) {
|
|
|
397
404
|
|
|
398
405
|
var _objectToString = objectToString;
|
|
399
406
|
|
|
407
|
+
var getRawTag$1 = ( _getRawTag$1 && _getRawTag ) || _getRawTag$1;
|
|
408
|
+
|
|
400
409
|
/** `Object#toString` result references. */
|
|
401
410
|
var nullTag = '[object Null]',
|
|
402
411
|
undefinedTag = '[object Undefined]';
|
|
@@ -416,7 +425,7 @@ var DataTable = (function (Sortable) {
|
|
|
416
425
|
return value === undefined ? undefinedTag : nullTag;
|
|
417
426
|
}
|
|
418
427
|
return (symToStringTag$1 && symToStringTag$1 in Object(value))
|
|
419
|
-
?
|
|
428
|
+
? getRawTag$1(value)
|
|
420
429
|
: _objectToString(value);
|
|
421
430
|
}
|
|
422
431
|
|
|
@@ -452,6 +461,13 @@ var DataTable = (function (Sortable) {
|
|
|
452
461
|
|
|
453
462
|
var isObjectLike_1 = isObjectLike;
|
|
454
463
|
|
|
464
|
+
var isObjectLike$1 = /*#__PURE__*/Object.freeze({
|
|
465
|
+
default: isObjectLike_1,
|
|
466
|
+
__moduleExports: isObjectLike_1
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
var isObjectLike$2 = ( isObjectLike$1 && isObjectLike_1 ) || isObjectLike$1;
|
|
470
|
+
|
|
455
471
|
/** `Object#toString` result references. */
|
|
456
472
|
var symbolTag = '[object Symbol]';
|
|
457
473
|
|
|
@@ -474,13 +490,11 @@ var DataTable = (function (Sortable) {
|
|
|
474
490
|
*/
|
|
475
491
|
function isSymbol(value) {
|
|
476
492
|
return typeof value == 'symbol' ||
|
|
477
|
-
(
|
|
493
|
+
(isObjectLike$2(value) && _baseGetTag(value) == symbolTag);
|
|
478
494
|
}
|
|
479
495
|
|
|
480
496
|
var isSymbol_1 = isSymbol;
|
|
481
497
|
|
|
482
|
-
var isObject$2 = ( isObject$1 && isObject_1 ) || isObject$1;
|
|
483
|
-
|
|
484
498
|
/** Used as references for various `Number` constants. */
|
|
485
499
|
var NAN = 0 / 0;
|
|
486
500
|
|
|
@@ -529,9 +543,9 @@ var DataTable = (function (Sortable) {
|
|
|
529
543
|
if (isSymbol_1(value)) {
|
|
530
544
|
return NAN;
|
|
531
545
|
}
|
|
532
|
-
if (
|
|
546
|
+
if (isObject_1(value)) {
|
|
533
547
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
534
|
-
value =
|
|
548
|
+
value = isObject_1(other) ? (other + '') : other;
|
|
535
549
|
}
|
|
536
550
|
if (typeof value != 'string') {
|
|
537
551
|
return value === 0 ? value : +value;
|
|
@@ -622,7 +636,7 @@ var DataTable = (function (Sortable) {
|
|
|
622
636
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
623
637
|
}
|
|
624
638
|
wait = toNumber_1(wait) || 0;
|
|
625
|
-
if (
|
|
639
|
+
if (isObject_1(options)) {
|
|
626
640
|
leading = !!options.leading;
|
|
627
641
|
maxing = 'maxWait' in options;
|
|
628
642
|
maxWait = maxing ? nativeMax(toNumber_1(options.maxWait) || 0, wait) : maxWait;
|
|
@@ -786,7 +800,7 @@ var DataTable = (function (Sortable) {
|
|
|
786
800
|
if (typeof func != 'function') {
|
|
787
801
|
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
788
802
|
}
|
|
789
|
-
if (
|
|
803
|
+
if (isObject_1(options)) {
|
|
790
804
|
leading = 'leading' in options ? !!options.leading : leading;
|
|
791
805
|
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
792
806
|
}
|
|
@@ -823,7 +837,7 @@ var DataTable = (function (Sortable) {
|
|
|
823
837
|
* // => false
|
|
824
838
|
*/
|
|
825
839
|
function isFunction(value) {
|
|
826
|
-
if (!
|
|
840
|
+
if (!isObject_1(value)) {
|
|
827
841
|
return false;
|
|
828
842
|
}
|
|
829
843
|
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
@@ -834,21 +848,19 @@ var DataTable = (function (Sortable) {
|
|
|
834
848
|
|
|
835
849
|
var isFunction_1 = isFunction;
|
|
836
850
|
|
|
851
|
+
var isFunction$1 = /*#__PURE__*/Object.freeze({
|
|
852
|
+
default: isFunction_1,
|
|
853
|
+
__moduleExports: isFunction_1
|
|
854
|
+
});
|
|
855
|
+
|
|
837
856
|
/** Used to detect overreaching core-js shims. */
|
|
838
857
|
var coreJsData = _root['__core-js_shared__'];
|
|
839
858
|
|
|
840
859
|
var _coreJsData = coreJsData;
|
|
841
860
|
|
|
842
|
-
var _coreJsData$1 = /*#__PURE__*/Object.freeze({
|
|
843
|
-
default: _coreJsData,
|
|
844
|
-
__moduleExports: _coreJsData
|
|
845
|
-
});
|
|
846
|
-
|
|
847
|
-
var coreJsData$1 = ( _coreJsData$1 && _coreJsData ) || _coreJsData$1;
|
|
848
|
-
|
|
849
861
|
/** Used to detect methods masquerading as native. */
|
|
850
862
|
var maskSrcKey = (function() {
|
|
851
|
-
var uid = /[^.]+$/.exec(
|
|
863
|
+
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
852
864
|
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
853
865
|
}());
|
|
854
866
|
|
|
@@ -892,6 +904,8 @@ var DataTable = (function (Sortable) {
|
|
|
892
904
|
|
|
893
905
|
var _toSource = toSource;
|
|
894
906
|
|
|
907
|
+
var isFunction$2 = ( isFunction$1 && isFunction_1 ) || isFunction$1;
|
|
908
|
+
|
|
895
909
|
/**
|
|
896
910
|
* Used to match `RegExp`
|
|
897
911
|
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
@@ -926,10 +940,10 @@ var DataTable = (function (Sortable) {
|
|
|
926
940
|
* else `false`.
|
|
927
941
|
*/
|
|
928
942
|
function baseIsNative(value) {
|
|
929
|
-
if (!
|
|
943
|
+
if (!isObject_1(value) || _isMasked(value)) {
|
|
930
944
|
return false;
|
|
931
945
|
}
|
|
932
|
-
var pattern =
|
|
946
|
+
var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
|
|
933
947
|
return pattern.test(_toSource(value));
|
|
934
948
|
}
|
|
935
949
|
|
|
@@ -969,13 +983,6 @@ var DataTable = (function (Sortable) {
|
|
|
969
983
|
|
|
970
984
|
var _nativeCreate = nativeCreate;
|
|
971
985
|
|
|
972
|
-
var _nativeCreate$1 = /*#__PURE__*/Object.freeze({
|
|
973
|
-
default: _nativeCreate,
|
|
974
|
-
__moduleExports: _nativeCreate
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
var nativeCreate$1 = ( _nativeCreate$1 && _nativeCreate ) || _nativeCreate$1;
|
|
978
|
-
|
|
979
986
|
/**
|
|
980
987
|
* Removes all key-value entries from the hash.
|
|
981
988
|
*
|
|
@@ -984,7 +991,7 @@ var DataTable = (function (Sortable) {
|
|
|
984
991
|
* @memberOf Hash
|
|
985
992
|
*/
|
|
986
993
|
function hashClear() {
|
|
987
|
-
this.__data__ =
|
|
994
|
+
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
988
995
|
this.size = 0;
|
|
989
996
|
}
|
|
990
997
|
|
|
@@ -1028,7 +1035,7 @@ var DataTable = (function (Sortable) {
|
|
|
1028
1035
|
*/
|
|
1029
1036
|
function hashGet(key) {
|
|
1030
1037
|
var data = this.__data__;
|
|
1031
|
-
if (
|
|
1038
|
+
if (_nativeCreate) {
|
|
1032
1039
|
var result = data[key];
|
|
1033
1040
|
return result === HASH_UNDEFINED ? undefined : result;
|
|
1034
1041
|
}
|
|
@@ -1054,11 +1061,16 @@ var DataTable = (function (Sortable) {
|
|
|
1054
1061
|
*/
|
|
1055
1062
|
function hashHas(key) {
|
|
1056
1063
|
var data = this.__data__;
|
|
1057
|
-
return
|
|
1064
|
+
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$3.call(data, key);
|
|
1058
1065
|
}
|
|
1059
1066
|
|
|
1060
1067
|
var _hashHas = hashHas;
|
|
1061
1068
|
|
|
1069
|
+
var _hashHas$1 = /*#__PURE__*/Object.freeze({
|
|
1070
|
+
default: _hashHas,
|
|
1071
|
+
__moduleExports: _hashHas
|
|
1072
|
+
});
|
|
1073
|
+
|
|
1062
1074
|
/** Used to stand-in for `undefined` hash values. */
|
|
1063
1075
|
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
1064
1076
|
|
|
@@ -1075,12 +1087,14 @@ var DataTable = (function (Sortable) {
|
|
|
1075
1087
|
function hashSet(key, value) {
|
|
1076
1088
|
var data = this.__data__;
|
|
1077
1089
|
this.size += this.has(key) ? 0 : 1;
|
|
1078
|
-
data[key] = (
|
|
1090
|
+
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
|
1079
1091
|
return this;
|
|
1080
1092
|
}
|
|
1081
1093
|
|
|
1082
1094
|
var _hashSet = hashSet;
|
|
1083
1095
|
|
|
1096
|
+
var hashHas$1 = ( _hashHas$1 && _hashHas ) || _hashHas$1;
|
|
1097
|
+
|
|
1084
1098
|
/**
|
|
1085
1099
|
* Creates a hash object.
|
|
1086
1100
|
*
|
|
@@ -1103,7 +1117,7 @@ var DataTable = (function (Sortable) {
|
|
|
1103
1117
|
Hash.prototype.clear = _hashClear;
|
|
1104
1118
|
Hash.prototype['delete'] = _hashDelete;
|
|
1105
1119
|
Hash.prototype.get = _hashGet;
|
|
1106
|
-
Hash.prototype.has =
|
|
1120
|
+
Hash.prototype.has = hashHas$1;
|
|
1107
1121
|
Hash.prototype.set = _hashSet;
|
|
1108
1122
|
|
|
1109
1123
|
var _Hash = Hash;
|
|
@@ -1160,6 +1174,13 @@ var DataTable = (function (Sortable) {
|
|
|
1160
1174
|
|
|
1161
1175
|
var eq_1 = eq;
|
|
1162
1176
|
|
|
1177
|
+
var eq$1 = /*#__PURE__*/Object.freeze({
|
|
1178
|
+
default: eq_1,
|
|
1179
|
+
__moduleExports: eq_1
|
|
1180
|
+
});
|
|
1181
|
+
|
|
1182
|
+
var eq$2 = ( eq$1 && eq_1 ) || eq$1;
|
|
1183
|
+
|
|
1163
1184
|
/**
|
|
1164
1185
|
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1165
1186
|
*
|
|
@@ -1171,7 +1192,7 @@ var DataTable = (function (Sortable) {
|
|
|
1171
1192
|
function assocIndexOf(array, key) {
|
|
1172
1193
|
var length = array.length;
|
|
1173
1194
|
while (length--) {
|
|
1174
|
-
if (
|
|
1195
|
+
if (eq$2(array[length][0], key)) {
|
|
1175
1196
|
return length;
|
|
1176
1197
|
}
|
|
1177
1198
|
}
|
|
@@ -1329,6 +1350,11 @@ var DataTable = (function (Sortable) {
|
|
|
1329
1350
|
|
|
1330
1351
|
var _mapCacheClear = mapCacheClear;
|
|
1331
1352
|
|
|
1353
|
+
var _mapCacheClear$1 = /*#__PURE__*/Object.freeze({
|
|
1354
|
+
default: _mapCacheClear,
|
|
1355
|
+
__moduleExports: _mapCacheClear
|
|
1356
|
+
});
|
|
1357
|
+
|
|
1332
1358
|
/**
|
|
1333
1359
|
* Checks if `value` is suitable for use as unique object key.
|
|
1334
1360
|
*
|
|
@@ -1345,6 +1371,13 @@ var DataTable = (function (Sortable) {
|
|
|
1345
1371
|
|
|
1346
1372
|
var _isKeyable = isKeyable;
|
|
1347
1373
|
|
|
1374
|
+
var _isKeyable$1 = /*#__PURE__*/Object.freeze({
|
|
1375
|
+
default: _isKeyable,
|
|
1376
|
+
__moduleExports: _isKeyable
|
|
1377
|
+
});
|
|
1378
|
+
|
|
1379
|
+
var isKeyable$1 = ( _isKeyable$1 && _isKeyable ) || _isKeyable$1;
|
|
1380
|
+
|
|
1348
1381
|
/**
|
|
1349
1382
|
* Gets the data for `map`.
|
|
1350
1383
|
*
|
|
@@ -1355,13 +1388,20 @@ var DataTable = (function (Sortable) {
|
|
|
1355
1388
|
*/
|
|
1356
1389
|
function getMapData(map, key) {
|
|
1357
1390
|
var data = map.__data__;
|
|
1358
|
-
return
|
|
1391
|
+
return isKeyable$1(key)
|
|
1359
1392
|
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1360
1393
|
: data.map;
|
|
1361
1394
|
}
|
|
1362
1395
|
|
|
1363
1396
|
var _getMapData = getMapData;
|
|
1364
1397
|
|
|
1398
|
+
var _getMapData$1 = /*#__PURE__*/Object.freeze({
|
|
1399
|
+
default: _getMapData,
|
|
1400
|
+
__moduleExports: _getMapData
|
|
1401
|
+
});
|
|
1402
|
+
|
|
1403
|
+
var getMapData$1 = ( _getMapData$1 && _getMapData ) || _getMapData$1;
|
|
1404
|
+
|
|
1365
1405
|
/**
|
|
1366
1406
|
* Removes `key` and its value from the map.
|
|
1367
1407
|
*
|
|
@@ -1372,7 +1412,7 @@ var DataTable = (function (Sortable) {
|
|
|
1372
1412
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1373
1413
|
*/
|
|
1374
1414
|
function mapCacheDelete(key) {
|
|
1375
|
-
var result =
|
|
1415
|
+
var result = getMapData$1(this, key)['delete'](key);
|
|
1376
1416
|
this.size -= result ? 1 : 0;
|
|
1377
1417
|
return result;
|
|
1378
1418
|
}
|
|
@@ -1389,7 +1429,7 @@ var DataTable = (function (Sortable) {
|
|
|
1389
1429
|
* @returns {*} Returns the entry value.
|
|
1390
1430
|
*/
|
|
1391
1431
|
function mapCacheGet(key) {
|
|
1392
|
-
return
|
|
1432
|
+
return getMapData$1(this, key).get(key);
|
|
1393
1433
|
}
|
|
1394
1434
|
|
|
1395
1435
|
var _mapCacheGet = mapCacheGet;
|
|
@@ -1404,7 +1444,7 @@ var DataTable = (function (Sortable) {
|
|
|
1404
1444
|
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1405
1445
|
*/
|
|
1406
1446
|
function mapCacheHas(key) {
|
|
1407
|
-
return
|
|
1447
|
+
return getMapData$1(this, key).has(key);
|
|
1408
1448
|
}
|
|
1409
1449
|
|
|
1410
1450
|
var _mapCacheHas = mapCacheHas;
|
|
@@ -1420,7 +1460,7 @@ var DataTable = (function (Sortable) {
|
|
|
1420
1460
|
* @returns {Object} Returns the map cache instance.
|
|
1421
1461
|
*/
|
|
1422
1462
|
function mapCacheSet(key, value) {
|
|
1423
|
-
var data =
|
|
1463
|
+
var data = getMapData$1(this, key),
|
|
1424
1464
|
size = data.size;
|
|
1425
1465
|
|
|
1426
1466
|
data.set(key, value);
|
|
@@ -1430,6 +1470,8 @@ var DataTable = (function (Sortable) {
|
|
|
1430
1470
|
|
|
1431
1471
|
var _mapCacheSet = mapCacheSet;
|
|
1432
1472
|
|
|
1473
|
+
var mapCacheClear$1 = ( _mapCacheClear$1 && _mapCacheClear ) || _mapCacheClear$1;
|
|
1474
|
+
|
|
1433
1475
|
/**
|
|
1434
1476
|
* Creates a map cache object to store key-value pairs.
|
|
1435
1477
|
*
|
|
@@ -1449,7 +1491,7 @@ var DataTable = (function (Sortable) {
|
|
|
1449
1491
|
}
|
|
1450
1492
|
|
|
1451
1493
|
// Add methods to `MapCache`.
|
|
1452
|
-
MapCache.prototype.clear =
|
|
1494
|
+
MapCache.prototype.clear = mapCacheClear$1;
|
|
1453
1495
|
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
1454
1496
|
MapCache.prototype.get = _mapCacheGet;
|
|
1455
1497
|
MapCache.prototype.has = _mapCacheHas;
|
|
@@ -1541,11 +1583,6 @@ var DataTable = (function (Sortable) {
|
|
|
1541
1583
|
|
|
1542
1584
|
var _baseFindIndex = baseFindIndex;
|
|
1543
1585
|
|
|
1544
|
-
var _baseFindIndex$1 = /*#__PURE__*/Object.freeze({
|
|
1545
|
-
default: _baseFindIndex,
|
|
1546
|
-
__moduleExports: _baseFindIndex
|
|
1547
|
-
});
|
|
1548
|
-
|
|
1549
1586
|
/**
|
|
1550
1587
|
* The base implementation of `_.isNaN` without support for number objects.
|
|
1551
1588
|
*
|
|
@@ -1583,8 +1620,6 @@ var DataTable = (function (Sortable) {
|
|
|
1583
1620
|
|
|
1584
1621
|
var _strictIndexOf = strictIndexOf;
|
|
1585
1622
|
|
|
1586
|
-
var baseFindIndex$1 = ( _baseFindIndex$1 && _baseFindIndex ) || _baseFindIndex$1;
|
|
1587
|
-
|
|
1588
1623
|
/**
|
|
1589
1624
|
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
1590
1625
|
*
|
|
@@ -1597,7 +1632,7 @@ var DataTable = (function (Sortable) {
|
|
|
1597
1632
|
function baseIndexOf(array, value, fromIndex) {
|
|
1598
1633
|
return value === value
|
|
1599
1634
|
? _strictIndexOf(array, value, fromIndex)
|
|
1600
|
-
:
|
|
1635
|
+
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
1601
1636
|
}
|
|
1602
1637
|
|
|
1603
1638
|
var _baseIndexOf = baseIndexOf;
|
|
@@ -1625,6 +1660,11 @@ var DataTable = (function (Sortable) {
|
|
|
1625
1660
|
|
|
1626
1661
|
var _arrayIncludes = arrayIncludes;
|
|
1627
1662
|
|
|
1663
|
+
var _arrayIncludes$1 = /*#__PURE__*/Object.freeze({
|
|
1664
|
+
default: _arrayIncludes,
|
|
1665
|
+
__moduleExports: _arrayIncludes
|
|
1666
|
+
});
|
|
1667
|
+
|
|
1628
1668
|
/**
|
|
1629
1669
|
* This function is like `arrayIncludes` except that it accepts a comparator.
|
|
1630
1670
|
*
|
|
@@ -1720,6 +1760,8 @@ var DataTable = (function (Sortable) {
|
|
|
1720
1760
|
|
|
1721
1761
|
var _createSet = createSet;
|
|
1722
1762
|
|
|
1763
|
+
var arrayIncludes$1 = ( _arrayIncludes$1 && _arrayIncludes ) || _arrayIncludes$1;
|
|
1764
|
+
|
|
1723
1765
|
/** Used as the size to enable large array optimizations. */
|
|
1724
1766
|
var LARGE_ARRAY_SIZE = 200;
|
|
1725
1767
|
|
|
@@ -1734,7 +1776,7 @@ var DataTable = (function (Sortable) {
|
|
|
1734
1776
|
*/
|
|
1735
1777
|
function baseUniq(array, iteratee, comparator) {
|
|
1736
1778
|
var index = -1,
|
|
1737
|
-
includes =
|
|
1779
|
+
includes = arrayIncludes$1,
|
|
1738
1780
|
length = array.length,
|
|
1739
1781
|
isCommon = true,
|
|
1740
1782
|
result = [],
|
|
@@ -2033,6 +2075,7 @@ var DataTable = (function (Sortable) {
|
|
|
2033
2075
|
sortable: false,
|
|
2034
2076
|
focusable: false,
|
|
2035
2077
|
dropdown: false,
|
|
2078
|
+
sticky: true,
|
|
2036
2079
|
width: 32
|
|
2037
2080
|
};
|
|
2038
2081
|
this.columns.push(cell);
|
|
@@ -2041,16 +2084,14 @@ var DataTable = (function (Sortable) {
|
|
|
2041
2084
|
if (this.options.serialNoColumn && !this.hasColumnById('_rowIndex')) {
|
|
2042
2085
|
let cell = {
|
|
2043
2086
|
id: '_rowIndex',
|
|
2044
|
-
content: '',
|
|
2087
|
+
content: this.options.serialNoColumnLabel || '',
|
|
2045
2088
|
align: 'center',
|
|
2046
2089
|
editable: false,
|
|
2047
|
-
resizable:
|
|
2090
|
+
resizable: true,
|
|
2048
2091
|
focusable: false,
|
|
2049
|
-
dropdown: false
|
|
2092
|
+
dropdown: false,
|
|
2093
|
+
sticky: true
|
|
2050
2094
|
};
|
|
2051
|
-
if (this.options.data.length > 1000) {
|
|
2052
|
-
cell.resizable = true;
|
|
2053
|
-
}
|
|
2054
2095
|
this.columns.push(cell);
|
|
2055
2096
|
}
|
|
2056
2097
|
}
|
|
@@ -2634,6 +2675,7 @@ var DataTable = (function (Sortable) {
|
|
|
2634
2675
|
this.bindKeyboardSelection();
|
|
2635
2676
|
this.bindCopyCellContents();
|
|
2636
2677
|
this.bindMouseEvents();
|
|
2678
|
+
this.bindWheelEvents();
|
|
2637
2679
|
this.bindTreeEvents();
|
|
2638
2680
|
}
|
|
2639
2681
|
|
|
@@ -2682,6 +2724,7 @@ var DataTable = (function (Sortable) {
|
|
|
2682
2724
|
}
|
|
2683
2725
|
|
|
2684
2726
|
this.focusCell($cell);
|
|
2727
|
+
sessionStorage.setItem('dt-last-nav-method', 'key');
|
|
2685
2728
|
return true;
|
|
2686
2729
|
};
|
|
2687
2730
|
|
|
@@ -2790,6 +2833,12 @@ var DataTable = (function (Sortable) {
|
|
|
2790
2833
|
$.on(this.bodyScrollable, 'mousemove', '.dt-cell', throttle$1(selectArea, 50));
|
|
2791
2834
|
}
|
|
2792
2835
|
|
|
2836
|
+
bindWheelEvents() {
|
|
2837
|
+
$.on(this.bodyScrollable, 'wheel', (e) => {
|
|
2838
|
+
sessionStorage.setItem('dt-last-nav-method', 'scroll');
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2793
2842
|
bindTreeEvents() {
|
|
2794
2843
|
$.on(this.bodyScrollable, 'click', '.dt-tree-node__toggle', (e, $toggle) => {
|
|
2795
2844
|
const $cell = $.closest('.dt-cell', $toggle);
|
|
@@ -2914,11 +2963,13 @@ var DataTable = (function (Sortable) {
|
|
|
2914
2963
|
// this function is called after hyperlist renders the rows after scroll,
|
|
2915
2964
|
// focusCell calls clearSelection which resets the area selection
|
|
2916
2965
|
// so a flag to skip it
|
|
2917
|
-
// we
|
|
2918
|
-
// because it fights with the user scroll
|
|
2966
|
+
// we skip scroll to cell
|
|
2967
|
+
// and also skip DOM focus (if user is scrolling) because it fights with the user scroll
|
|
2968
|
+
const skipDOMFocus = sessionStorage.getItem('dt-last-nav-method') !== 'key';
|
|
2969
|
+
|
|
2919
2970
|
this.focusCell($cell, {
|
|
2971
|
+
skipDOMFocus,
|
|
2920
2972
|
skipClearSelection: 1,
|
|
2921
|
-
skipDOMFocus: 1,
|
|
2922
2973
|
skipScrollToCell: 1
|
|
2923
2974
|
});
|
|
2924
2975
|
}
|
|
@@ -2934,7 +2985,6 @@ var DataTable = (function (Sortable) {
|
|
|
2934
2985
|
|
|
2935
2986
|
_selectArea($cell1, $cell2) {
|
|
2936
2987
|
if ($cell1 === $cell2) return false;
|
|
2937
|
-
|
|
2938
2988
|
const cells = this.getCellsInRange($cell1, $cell2);
|
|
2939
2989
|
if (!cells) return false;
|
|
2940
2990
|
|
|
@@ -2961,9 +3011,17 @@ var DataTable = (function (Sortable) {
|
|
|
2961
3011
|
const cell2 = $.data($cell2);
|
|
2962
3012
|
|
|
2963
3013
|
colIndex1 = +cell1.colIndex;
|
|
2964
|
-
rowIndex1 = +cell1.rowIndex;
|
|
2965
3014
|
colIndex2 = +cell2.colIndex;
|
|
2966
|
-
|
|
3015
|
+
|
|
3016
|
+
if (this.columnmanager.sortState) {
|
|
3017
|
+
this.sortedColumn = true;
|
|
3018
|
+
rowIndex1 = this.datamanager.rowViewOrder.indexOf(parseInt(cell1.rowIndex, 10));
|
|
3019
|
+
rowIndex2 = this.datamanager.rowViewOrder.indexOf(parseInt(cell2.rowIndex, 10));
|
|
3020
|
+
} else {
|
|
3021
|
+
rowIndex1 = +cell1.rowIndex;
|
|
3022
|
+
rowIndex2 = +cell2.rowIndex;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
2967
3025
|
}
|
|
2968
3026
|
|
|
2969
3027
|
if (rowIndex1 > rowIndex2) {
|
|
@@ -2995,7 +3053,11 @@ var DataTable = (function (Sortable) {
|
|
|
2995
3053
|
}
|
|
2996
3054
|
colIndex = colIndex1;
|
|
2997
3055
|
});
|
|
2998
|
-
|
|
3056
|
+
if (this.columnmanager.sortState) {
|
|
3057
|
+
cells.forEach(selectedCells => {
|
|
3058
|
+
selectedCells[1] = this.datamanager.rowViewOrder[selectedCells[1]];
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
2999
3061
|
return cells;
|
|
3000
3062
|
}
|
|
3001
3063
|
|
|
@@ -3304,6 +3366,7 @@ var DataTable = (function (Sortable) {
|
|
|
3304
3366
|
}
|
|
3305
3367
|
|
|
3306
3368
|
this.focusCell($cell);
|
|
3369
|
+
sessionStorage.setItem('dt-last-nav-method', 'key');
|
|
3307
3370
|
return true;
|
|
3308
3371
|
}
|
|
3309
3372
|
|
|
@@ -3402,8 +3465,15 @@ var DataTable = (function (Sortable) {
|
|
|
3402
3465
|
});
|
|
3403
3466
|
|
|
3404
3467
|
const row = this.datamanager.getRow(rowIndex);
|
|
3468
|
+
const column = cell.column || this.datamanager.getColumn(colIndex) || {};
|
|
3405
3469
|
|
|
3406
3470
|
const isBodyCell = !(isHeader || isFilter || isTotalRow);
|
|
3471
|
+
const isSticky = Boolean(column.sticky);
|
|
3472
|
+
const stickyColumns = this.datamanager.getColumns().filter(col => col.sticky);
|
|
3473
|
+
const lastStickyColumn = stickyColumns[stickyColumns.length - 1];
|
|
3474
|
+
const isLastStickyColumn = isSticky &&
|
|
3475
|
+
lastStickyColumn &&
|
|
3476
|
+
lastStickyColumn.colIndex === colIndex;
|
|
3407
3477
|
|
|
3408
3478
|
const className = [
|
|
3409
3479
|
'dt-cell',
|
|
@@ -3413,7 +3483,10 @@ var DataTable = (function (Sortable) {
|
|
|
3413
3483
|
isHeader ? 'dt-cell--header' : '',
|
|
3414
3484
|
isHeader ? `dt-cell--header-${colIndex}` : '',
|
|
3415
3485
|
isFilter ? 'dt-cell--filter' : '',
|
|
3416
|
-
isBodyCell && (row && row.meta.isTreeNodeClose) ? 'dt-cell--tree-close' : ''
|
|
3486
|
+
isBodyCell && (row && row.meta.isTreeNodeClose) ? 'dt-cell--tree-close' : '',
|
|
3487
|
+
isSticky ? 'dt-cell--sticky' : '',
|
|
3488
|
+
isSticky && !isBodyCell ? 'dt-cell--sticky-top' : '',
|
|
3489
|
+
isLastStickyColumn ? 'dt-cell--sticky-last' : ''
|
|
3417
3490
|
].join(' ');
|
|
3418
3491
|
|
|
3419
3492
|
return `
|
|
@@ -3611,7 +3684,7 @@ var DataTable = (function (Sortable) {
|
|
|
3611
3684
|
});
|
|
3612
3685
|
|
|
3613
3686
|
$.on(this.$dropdownList, 'click', '.dt-dropdown__list-item', (e, $item) => {
|
|
3614
|
-
if (
|
|
3687
|
+
if (this._dropdownActiveColIndex == null) return;
|
|
3615
3688
|
const dropdownItems = this.options.headerDropdown;
|
|
3616
3689
|
const { index } = $.data($item);
|
|
3617
3690
|
const colIndex = this._dropdownActiveColIndex;
|
|
@@ -3626,6 +3699,11 @@ var DataTable = (function (Sortable) {
|
|
|
3626
3699
|
_this.hideDropdown();
|
|
3627
3700
|
}
|
|
3628
3701
|
|
|
3702
|
+
this.stickDropdownIndex = this.options.headerDropdown
|
|
3703
|
+
.findIndex(item => item.stickyAction === 'stick');
|
|
3704
|
+
this.unstickDropdownIndex = this.options.headerDropdown
|
|
3705
|
+
.findIndex(item => item.stickyAction === 'unstick');
|
|
3706
|
+
|
|
3629
3707
|
this.hideDropdown();
|
|
3630
3708
|
}
|
|
3631
3709
|
|
|
@@ -3642,6 +3720,7 @@ var DataTable = (function (Sortable) {
|
|
|
3642
3720
|
const $cell = $.closest('.dt-cell', e.target);
|
|
3643
3721
|
const { colIndex } = $.data($cell);
|
|
3644
3722
|
this._dropdownActiveColIndex = colIndex;
|
|
3723
|
+
this.updateStickyDropdownItems(this.getColumn(colIndex));
|
|
3645
3724
|
}
|
|
3646
3725
|
|
|
3647
3726
|
hideDropdown() {
|
|
@@ -3785,9 +3864,29 @@ var DataTable = (function (Sortable) {
|
|
|
3785
3864
|
.then(() => this.instance.unfreeze())
|
|
3786
3865
|
.then(() => {
|
|
3787
3866
|
this.fireEvent('onSortColumn', this.getColumn(colIndex));
|
|
3867
|
+
this.setSortState();
|
|
3788
3868
|
});
|
|
3789
3869
|
}
|
|
3790
3870
|
|
|
3871
|
+
saveSorting(colIndex) {
|
|
3872
|
+
let currentColumn = this.getColumn(colIndex);
|
|
3873
|
+
let saveSorting = {
|
|
3874
|
+
[currentColumn.name]: {
|
|
3875
|
+
colIndex: colIndex,
|
|
3876
|
+
sortOrder: currentColumn.sortOrder
|
|
3877
|
+
}
|
|
3878
|
+
};
|
|
3879
|
+
this.sortingKey = this.options.sortingKey ? `${this.options.sortingKey}::sortedColumns` : 'sortedColumns' ;
|
|
3880
|
+
localStorage.setItem(this.sortingKey, JSON.stringify(saveSorting));
|
|
3881
|
+
}
|
|
3882
|
+
setSortState(sortOrder) {
|
|
3883
|
+
if (sortOrder === 'none') {
|
|
3884
|
+
this.sortState = false;
|
|
3885
|
+
} else {
|
|
3886
|
+
this.sortState = true;
|
|
3887
|
+
}
|
|
3888
|
+
}
|
|
3889
|
+
|
|
3791
3890
|
removeColumn(colIndex) {
|
|
3792
3891
|
const removedCol = this.getColumn(colIndex);
|
|
3793
3892
|
this.instance.freeze();
|
|
@@ -3802,6 +3901,20 @@ var DataTable = (function (Sortable) {
|
|
|
3802
3901
|
});
|
|
3803
3902
|
}
|
|
3804
3903
|
|
|
3904
|
+
setColumnSticky(colIndex, sticky) {
|
|
3905
|
+
const column = this.getColumn(colIndex);
|
|
3906
|
+
if (!column || column.sticky === sticky) {
|
|
3907
|
+
return;
|
|
3908
|
+
}
|
|
3909
|
+
|
|
3910
|
+
this.instance.freeze();
|
|
3911
|
+
this.datamanager.updateColumn(colIndex, { sticky });
|
|
3912
|
+
|
|
3913
|
+
this.refreshHeader();
|
|
3914
|
+
this.rowmanager.refreshRows()
|
|
3915
|
+
.then(() => this.instance.unfreeze());
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3805
3918
|
switchColumn(oldIndex, newIndex) {
|
|
3806
3919
|
this.instance.freeze();
|
|
3807
3920
|
this.datamanager.switchColumn(oldIndex, newIndex)
|
|
@@ -3886,6 +3999,19 @@ var DataTable = (function (Sortable) {
|
|
|
3886
3999
|
}
|
|
3887
4000
|
}
|
|
3888
4001
|
|
|
4002
|
+
applySavedSortOrder() {
|
|
4003
|
+
|
|
4004
|
+
let key = this.options.sortingKey ? `${this.options.sortingKey}::sortedColumns` : 'sortedColumns' ;
|
|
4005
|
+
let sortingConfig = JSON.parse(localStorage.getItem(key));
|
|
4006
|
+
if (sortingConfig) {
|
|
4007
|
+
const columnsToSort = Object.values(sortingConfig);
|
|
4008
|
+
for (let column of columnsToSort) {
|
|
4009
|
+
this.sortColumn(column.colIndex, column.sortOrder);
|
|
4010
|
+
this.sortState = true;
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
|
|
3889
4015
|
sortRows(colIndex, sortOrder) {
|
|
3890
4016
|
return this.datamanager.sortRows(colIndex, sortOrder);
|
|
3891
4017
|
}
|
|
@@ -3961,14 +4087,39 @@ var DataTable = (function (Sortable) {
|
|
|
3961
4087
|
|
|
3962
4088
|
getDropdownListHTML() {
|
|
3963
4089
|
const { headerDropdown: dropdownItems } = this.options;
|
|
3964
|
-
|
|
3965
4090
|
return `
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
4091
|
+
<div class="dt-dropdown__list">
|
|
4092
|
+
${dropdownItems.map((d, i) => `
|
|
4093
|
+
<div
|
|
4094
|
+
class="dt-dropdown__list-item${d.display ? ' dt-hidden' : ''}"
|
|
4095
|
+
data-index="${i}"
|
|
4096
|
+
>
|
|
4097
|
+
${d.label}
|
|
3970
4098
|
</div>
|
|
3971
|
-
|
|
4099
|
+
`).join('')}
|
|
4100
|
+
</div>
|
|
4101
|
+
`;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
toggleDropdownItem(index) {
|
|
4105
|
+
$('.dt-dropdown__list', this.instance.dropdownContainer).children[index].classList.toggle('dt-hidden');
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
updateStickyDropdownItems(column) {
|
|
4109
|
+
if (!column) return;
|
|
4110
|
+
if (this.stickDropdownIndex === -1 || this.unstickDropdownIndex === -1) return;
|
|
4111
|
+
|
|
4112
|
+
const stickItem = this.$dropdownList.children[this.stickDropdownIndex];
|
|
4113
|
+
const unstickItem = this.$dropdownList.children[this.unstickDropdownIndex];
|
|
4114
|
+
if (!(stickItem && unstickItem)) return;
|
|
4115
|
+
|
|
4116
|
+
if (column.sticky) {
|
|
4117
|
+
stickItem.classList.add('dt-hidden');
|
|
4118
|
+
unstickItem.classList.remove('dt-hidden');
|
|
4119
|
+
} else {
|
|
4120
|
+
stickItem.classList.remove('dt-hidden');
|
|
4121
|
+
unstickItem.classList.add('dt-hidden');
|
|
4122
|
+
}
|
|
3972
4123
|
}
|
|
3973
4124
|
}
|
|
3974
4125
|
|
|
@@ -4837,12 +4988,26 @@ var DataTable = (function (Sortable) {
|
|
|
4837
4988
|
}
|
|
4838
4989
|
|
|
4839
4990
|
render() {
|
|
4840
|
-
const rows = this.
|
|
4991
|
+
const rows = this.getRowsToRender();
|
|
4841
4992
|
this.renderRows(rows);
|
|
4842
4993
|
// setDimensions requires atleast 1 row to exist in dom
|
|
4843
4994
|
this.instance.setDimensions();
|
|
4844
4995
|
}
|
|
4845
4996
|
|
|
4997
|
+
// Keep the current tree expand/collapse state on a full re-render
|
|
4998
|
+
getRowsToRender() {
|
|
4999
|
+
const rows = this.datamanager.getRowsForView();
|
|
5000
|
+
let closedIndent = null;
|
|
5001
|
+
return rows.filter(row => {
|
|
5002
|
+
const { indent, isTreeNodeClose } = row.meta;
|
|
5003
|
+
if (closedIndent !== null && indent > closedIndent) {
|
|
5004
|
+
return false;
|
|
5005
|
+
}
|
|
5006
|
+
closedIndent = isTreeNodeClose ? indent : null;
|
|
5007
|
+
return true;
|
|
5008
|
+
});
|
|
5009
|
+
}
|
|
5010
|
+
|
|
4846
5011
|
renderFooter() {
|
|
4847
5012
|
if (!this.options.showTotalRow) return;
|
|
4848
5013
|
|
|
@@ -4972,6 +5137,7 @@ var DataTable = (function (Sortable) {
|
|
|
4972
5137
|
|
|
4973
5138
|
bindScrollHeader() {
|
|
4974
5139
|
this._settingHeaderPosition = false;
|
|
5140
|
+
this.updateStickyTopPositions(0);
|
|
4975
5141
|
|
|
4976
5142
|
$.on(this.bodyScrollable, 'scroll', (e) => {
|
|
4977
5143
|
if (this._settingHeaderPosition) return;
|
|
@@ -4979,7 +5145,8 @@ var DataTable = (function (Sortable) {
|
|
|
4979
5145
|
this._settingHeaderPosition = true;
|
|
4980
5146
|
|
|
4981
5147
|
requestAnimationFrame(() => {
|
|
4982
|
-
const
|
|
5148
|
+
const scrollLeft = e.target.scrollLeft;
|
|
5149
|
+
const left = -scrollLeft;
|
|
4983
5150
|
|
|
4984
5151
|
$.style(this.header, {
|
|
4985
5152
|
transform: `translateX(${left}px)`
|
|
@@ -4987,6 +5154,7 @@ var DataTable = (function (Sortable) {
|
|
|
4987
5154
|
$.style(this.footer, {
|
|
4988
5155
|
transform: `translateX(${left}px)`
|
|
4989
5156
|
});
|
|
5157
|
+
this.updateStickyTopPositions(scrollLeft);
|
|
4990
5158
|
this._settingHeaderPosition = false;
|
|
4991
5159
|
if (this.instance.noData) {
|
|
4992
5160
|
$.style($('.no-data-message'), {
|
|
@@ -5084,6 +5252,8 @@ var DataTable = (function (Sortable) {
|
|
|
5084
5252
|
this.setupColumnWidth();
|
|
5085
5253
|
this.distributeRemainingWidth();
|
|
5086
5254
|
this.setColumnStyle();
|
|
5255
|
+
this.setStickyColumnStyle();
|
|
5256
|
+
this.updateStickyTopPositions(this.bodyScrollable.scrollLeft || 0);
|
|
5087
5257
|
this.setBodyStyle();
|
|
5088
5258
|
}
|
|
5089
5259
|
|
|
@@ -5241,6 +5411,8 @@ var DataTable = (function (Sortable) {
|
|
|
5241
5411
|
this.columnmanager.setColumnHeaderWidth(column.colIndex);
|
|
5242
5412
|
this.columnmanager.setColumnWidth(column.colIndex);
|
|
5243
5413
|
});
|
|
5414
|
+
this.setStickyColumnStyle();
|
|
5415
|
+
this.updateStickyTopPositions(this.bodyScrollable.scrollLeft || 0);
|
|
5244
5416
|
}
|
|
5245
5417
|
|
|
5246
5418
|
setBodyStyle() {
|
|
@@ -5302,6 +5474,56 @@ var DataTable = (function (Sortable) {
|
|
|
5302
5474
|
return $(`.dt-cell--col-${colIndex}`, this.header);
|
|
5303
5475
|
}
|
|
5304
5476
|
|
|
5477
|
+
setStickyColumnStyle() {
|
|
5478
|
+
if (!this.datamanager || !this.datamanager.getColumns) return;
|
|
5479
|
+
|
|
5480
|
+
const stickySelectors = [];
|
|
5481
|
+
let stickyOffset = 0;
|
|
5482
|
+
let normalOffset = 0;
|
|
5483
|
+
|
|
5484
|
+
this.datamanager.getColumns().forEach((column) => {
|
|
5485
|
+
const $headerCell = this.getColumnHeaderElement(column.colIndex);
|
|
5486
|
+
const renderedWidth = $headerCell ? $headerCell.offsetWidth : column.width;
|
|
5487
|
+
|
|
5488
|
+
if (column.sticky) {
|
|
5489
|
+
const selector = `.dt-cell--col-${column.colIndex}.dt-cell--sticky`;
|
|
5490
|
+
const style = {
|
|
5491
|
+
left: `${stickyOffset}px`
|
|
5492
|
+
};
|
|
5493
|
+
|
|
5494
|
+
column.stickyLeft = stickyOffset;
|
|
5495
|
+
column.stickyScrollTrigger = normalOffset - stickyOffset;
|
|
5496
|
+
column.renderedWidth = renderedWidth;
|
|
5497
|
+
this.setStyle(selector, style);
|
|
5498
|
+
stickySelectors.push(selector);
|
|
5499
|
+
stickyOffset += renderedWidth;
|
|
5500
|
+
}
|
|
5501
|
+
normalOffset += renderedWidth;
|
|
5502
|
+
});
|
|
5503
|
+
|
|
5504
|
+
const staleSelectors = (this._stickySelectors || [])
|
|
5505
|
+
.filter(selector => !stickySelectors.includes(selector));
|
|
5506
|
+
|
|
5507
|
+
staleSelectors.forEach(selector => this.removeStyle(selector));
|
|
5508
|
+
this._stickySelectors = stickySelectors;
|
|
5509
|
+
}
|
|
5510
|
+
|
|
5511
|
+
updateStickyTopPositions(scrollLeft) {
|
|
5512
|
+
if (!this.datamanager || !this.datamanager.getColumns) return;
|
|
5513
|
+
|
|
5514
|
+
const stickyColumns = this.datamanager.getColumns().filter(column => column.sticky);
|
|
5515
|
+
|
|
5516
|
+
stickyColumns.forEach((column) => {
|
|
5517
|
+
const trigger = Math.max(0, column.stickyScrollTrigger || 0);
|
|
5518
|
+
const compensation = Math.max(0, scrollLeft - trigger);
|
|
5519
|
+
const cells = $.each(`.dt-cell--col-${column.colIndex}.dt-cell--sticky-top`, this.wrapper) || [];
|
|
5520
|
+
|
|
5521
|
+
$.style(cells, {
|
|
5522
|
+
transform: compensation ? `translateX(${compensation}px)` : ''
|
|
5523
|
+
});
|
|
5524
|
+
});
|
|
5525
|
+
}
|
|
5526
|
+
|
|
5305
5527
|
getRowIndexColumnWidth() {
|
|
5306
5528
|
const rowCount = this.datamanager.getRowCount();
|
|
5307
5529
|
const padding = 22;
|
|
@@ -5365,7 +5587,11 @@ var DataTable = (function (Sortable) {
|
|
|
5365
5587
|
}
|
|
5366
5588
|
}
|
|
5367
5589
|
|
|
5590
|
+
var Freeze = "Freeze";
|
|
5591
|
+
var Unfreeze = "Unfreeze";
|
|
5368
5592
|
var en = {
|
|
5593
|
+
Freeze: Freeze,
|
|
5594
|
+
Unfreeze: Unfreeze,
|
|
5369
5595
|
"Sort Ascending": "Sort Ascending",
|
|
5370
5596
|
"Sort Descending": "Sort Descending",
|
|
5371
5597
|
"Reset sorting": "Reset sorting",
|
|
@@ -5375,7 +5601,11 @@ var DataTable = (function (Sortable) {
|
|
|
5375
5601
|
"{count} rows selected": {"1":"{count} row selected","default":"{count} rows selected"}
|
|
5376
5602
|
};
|
|
5377
5603
|
|
|
5604
|
+
var Freeze$1 = "Bevriezen";
|
|
5605
|
+
var Unfreeze$1 = "Ontdooien";
|
|
5378
5606
|
var de = {
|
|
5607
|
+
Freeze: Freeze$1,
|
|
5608
|
+
Unfreeze: Unfreeze$1,
|
|
5379
5609
|
"Sort Ascending": "Aufsteigend sortieren",
|
|
5380
5610
|
"Sort Descending": "Absteigend sortieren",
|
|
5381
5611
|
"Reset sorting": "Sortierung zurücksetzen",
|
|
@@ -5385,7 +5615,11 @@ var DataTable = (function (Sortable) {
|
|
|
5385
5615
|
"{count} rows selected": {"1":"{count} Zeile ausgewählt","default":"{count} Zeilen ausgewählt"}
|
|
5386
5616
|
};
|
|
5387
5617
|
|
|
5618
|
+
var Freeze$2 = "Geler";
|
|
5619
|
+
var Unfreeze$2 = "Dégeler";
|
|
5388
5620
|
var fr = {
|
|
5621
|
+
Freeze: Freeze$2,
|
|
5622
|
+
Unfreeze: Unfreeze$2,
|
|
5389
5623
|
"Sort Ascending": "Trier par ordre croissant",
|
|
5390
5624
|
"Sort Descending": "Trier par ordre décroissant",
|
|
5391
5625
|
"Reset sorting": "Réinitialiser le tri",
|
|
@@ -5395,7 +5629,11 @@ var DataTable = (function (Sortable) {
|
|
|
5395
5629
|
"{count} rows selected": {"1":"{count} ligne sélectionnée","default":"{count} lignes sélectionnées"}
|
|
5396
5630
|
};
|
|
5397
5631
|
|
|
5632
|
+
var Freeze$3 = "Congelare";
|
|
5633
|
+
var Unfreeze$3 = "Dégeler";
|
|
5398
5634
|
var it = {
|
|
5635
|
+
Freeze: Freeze$3,
|
|
5636
|
+
Unfreeze: Unfreeze$3,
|
|
5399
5637
|
"Sort Ascending": "Ordinamento ascendente",
|
|
5400
5638
|
"Sort Descending": "Ordinamento decrescente",
|
|
5401
5639
|
"Reset sorting": "Azzeramento ordinamento",
|
|
@@ -5677,6 +5915,22 @@ var DataTable = (function (Sortable) {
|
|
|
5677
5915
|
action: function (column) {
|
|
5678
5916
|
this.removeColumn(column.colIndex);
|
|
5679
5917
|
}
|
|
5918
|
+
},
|
|
5919
|
+
{
|
|
5920
|
+
label: instance.translate('Freeze'),
|
|
5921
|
+
stickyAction: 'stick',
|
|
5922
|
+
display: 'hidden',
|
|
5923
|
+
action: function (column) {
|
|
5924
|
+
this.setColumnSticky(column.colIndex, true);
|
|
5925
|
+
}
|
|
5926
|
+
},
|
|
5927
|
+
{
|
|
5928
|
+
label: instance.translate('Unfreeze'),
|
|
5929
|
+
stickyAction: 'unstick',
|
|
5930
|
+
display: 'hidden',
|
|
5931
|
+
action: function (column) {
|
|
5932
|
+
this.setColumnSticky(column.colIndex, false);
|
|
5933
|
+
}
|
|
5680
5934
|
}
|
|
5681
5935
|
],
|
|
5682
5936
|
events: {
|
|
@@ -5701,6 +5955,7 @@ var DataTable = (function (Sortable) {
|
|
|
5701
5955
|
freezeMessage: '',
|
|
5702
5956
|
getEditor: null,
|
|
5703
5957
|
serialNoColumn: true,
|
|
5958
|
+
serialNoColumnLabel: '',
|
|
5704
5959
|
checkboxColumn: false,
|
|
5705
5960
|
clusterize: true,
|
|
5706
5961
|
logs: false,
|
|
@@ -5751,6 +6006,10 @@ var DataTable = (function (Sortable) {
|
|
|
5751
6006
|
if (this.options.data) {
|
|
5752
6007
|
this.refresh();
|
|
5753
6008
|
this.columnmanager.applyDefaultSortOrder();
|
|
6009
|
+
if (this.options.saveSorting) {
|
|
6010
|
+
this.setupSaveSorting();
|
|
6011
|
+
this.columnmanager.applySavedSortOrder();
|
|
6012
|
+
}
|
|
5754
6013
|
}
|
|
5755
6014
|
}
|
|
5756
6015
|
|
|
@@ -5920,11 +6179,18 @@ var DataTable = (function (Sortable) {
|
|
|
5920
6179
|
sortColumn(colIndex, sortOrder) {
|
|
5921
6180
|
this.columnmanager.sortColumn(colIndex, sortOrder);
|
|
5922
6181
|
}
|
|
6182
|
+
saveSorting(colIndex, nextSortOrder) {
|
|
6183
|
+
this.columnmanager.saveSorting(colIndex, nextSortOrder);
|
|
6184
|
+
}
|
|
5923
6185
|
|
|
5924
6186
|
removeColumn(colIndex) {
|
|
5925
6187
|
this.columnmanager.removeColumn(colIndex);
|
|
5926
6188
|
}
|
|
5927
6189
|
|
|
6190
|
+
setColumnSticky(colIndex, sticky) {
|
|
6191
|
+
this.columnmanager.setColumnSticky(colIndex, sticky);
|
|
6192
|
+
}
|
|
6193
|
+
|
|
5928
6194
|
scrollToLastColumn() {
|
|
5929
6195
|
this.datatableWrapper.scrollLeft = 9999;
|
|
5930
6196
|
}
|
|
@@ -5973,6 +6239,25 @@ var DataTable = (function (Sortable) {
|
|
|
5973
6239
|
translate(str, args) {
|
|
5974
6240
|
return this.translationManager.translate(str, args);
|
|
5975
6241
|
}
|
|
6242
|
+
setupSaveSorting() {
|
|
6243
|
+
// add options in default headerdropdown
|
|
6244
|
+
let action = {
|
|
6245
|
+
label: this.translate('Save Sorting'),
|
|
6246
|
+
action: function (column) {
|
|
6247
|
+
this.saveSorting(column.colIndex, column.sotOrder);
|
|
6248
|
+
},
|
|
6249
|
+
display: 'hidden'
|
|
6250
|
+
};
|
|
6251
|
+
this.options.headerDropdown.push(action);
|
|
6252
|
+
this.columnmanager.bindDropdown();
|
|
6253
|
+
// add events for onSortColumn
|
|
6254
|
+
this.on('onSortColumn', function (column) {
|
|
6255
|
+
this.columnmanager.toggleDropdownItem(4);
|
|
6256
|
+
if (column.sortOrder === 'none') {
|
|
6257
|
+
localStorage.removeItem(this.columnmanager.sortingKey);
|
|
6258
|
+
}
|
|
6259
|
+
});
|
|
6260
|
+
}
|
|
5976
6261
|
}
|
|
5977
6262
|
|
|
5978
6263
|
DataTable.instances = 0;
|
|
@@ -5985,7 +6270,7 @@ var DataTable = (function (Sortable) {
|
|
|
5985
6270
|
var jsdelivr = "dist/melondtable.min.js";
|
|
5986
6271
|
var scripts = {"start":"yarn run dev","build":"rollup -c && NODE_ENV=production rollup -c","dev":"rollup -c -w","cy:server":"http-server -p 8989","cy:open":"cypress open","cy:run":"cypress run","test":"start-server-and-test cy:server http://localhost:8989 cy:run","test-local":"start-server-and-test cy:server http://localhost:8989 cy:open","travis-deploy-once":"travis-deploy-once","semantic-release":"semantic-release","lint":"eslint src","lint-and-build":"yarn lint && yarn build","commit":"npx git-cz"};
|
|
5987
6272
|
var files = ["dist","src"];
|
|
5988
|
-
var devDependencies = {"autoprefixer":"^9.0.0","chai":"3.5.0","cypress":"^9.2.0","cz-conventional-changelog":"^2.1.0","deepmerge":"^2.0.1","eslint":"^5.0.1","eslint-config-airbnb":"^16.1.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.11.0","http-server":"^0.11.1","mocha":"3.3.0","postcss-custom-properties":"^7.0.0","postcss-nested":"^3.0.0","rollup":"^0.59.4","rollup-plugin-commonjs":"^8.3.0","rollup-plugin-eslint":"^4.0.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.3","rollup-plugin-postcss":"^1.2.8","rollup-plugin-uglify-es":"^0.0.1","semantic-release":"^
|
|
6273
|
+
var devDependencies = {"autoprefixer":"^9.0.0","chai":"3.5.0","cypress":"^9.2.0","cz-conventional-changelog":"^2.1.0","deepmerge":"^2.0.1","eslint":"^5.0.1","eslint-config-airbnb":"^16.1.0","eslint-config-airbnb-base":"^12.1.0","eslint-plugin-import":"^2.11.0","http-server":"^0.11.1","mocha":"3.3.0","postcss-custom-properties":"^7.0.0","postcss-nested":"^3.0.0","rollup":"^0.59.4","rollup-plugin-commonjs":"^8.3.0","rollup-plugin-eslint":"^4.0.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.3","rollup-plugin-postcss":"^1.2.8","rollup-plugin-uglify-es":"^0.0.1","semantic-release":"^25.0.3","start-server-and-test":"^1.4.1","travis-deploy-once":"^5.0.1"};
|
|
5989
6274
|
var repository = {"type":"git","url":"https://github.com/amonak/melondtable.git"};
|
|
5990
6275
|
var keywords = ["datatable","data","grid","table"];
|
|
5991
6276
|
var author = "Alphamonak Solutions";
|