@refinitiv-ui/efx-grid 6.0.46 → 6.0.48
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +314 -205
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +2 -0
- package/lib/core/es6/data/DataTable.js +97 -1
- package/lib/core/es6/data/DataView.d.ts +2 -2
- package/lib/core/es6/data/DataView.js +90 -170
- package/lib/core/es6/data/Segment.d.ts +0 -2
- package/lib/core/es6/data/Segment.js +0 -6
- package/lib/core/es6/grid/Core.d.ts +4 -0
- package/lib/core/es6/grid/Core.js +105 -28
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +22 -0
- package/lib/grid/index.js +1 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +2 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +2 -0
- package/package.json +1 -1
@@ -112,6 +112,8 @@ declare class DataTable extends DataCache {
|
|
112
112
|
|
113
113
|
public getSegmentChildIds(segmentId: string): (string)[]|null;
|
114
114
|
|
115
|
+
public sortSeparators(sortLogics: ((...params: any[]) => any)|(((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): boolean;
|
116
|
+
|
115
117
|
public sortSegments(compare: ((...params: any[]) => any)|null): boolean;
|
116
118
|
|
117
119
|
public setClassificationSource(dc: DataCache|null): void;
|
@@ -76,6 +76,14 @@ DataTable.prototype._removedRows = null;
|
|
76
76
|
*/
|
77
77
|
DataTable.prototype._userSegmentComparer = null;
|
78
78
|
/** @private
|
79
|
+
* @type {number}
|
80
|
+
*/
|
81
|
+
DataTable.prototype._segmentSortOrder = 0;
|
82
|
+
/** @private
|
83
|
+
* @type {*}
|
84
|
+
*/
|
85
|
+
DataTable.prototype._segmentSortContext = null;
|
86
|
+
/** @private
|
79
87
|
* @type {Object.<string, Object>}
|
80
88
|
*/
|
81
89
|
DataTable.prototype._clsSource = null;
|
@@ -1248,6 +1256,51 @@ DataTable.prototype.getSegmentChildIds = function(segmentId) {
|
|
1248
1256
|
}
|
1249
1257
|
return null;
|
1250
1258
|
};
|
1259
|
+
/** Sort all of existing segments by multiple sort logics
|
1260
|
+
* @public
|
1261
|
+
* @param {Function|Array.<Function>} sortLogics
|
1262
|
+
* @param {Array.<number>} sortOrders
|
1263
|
+
* @param {Array.<string>} cids
|
1264
|
+
* @return {boolean}
|
1265
|
+
*/
|
1266
|
+
DataTable.prototype.sortSeparators = function (sortLogics, sortOrders, cids) {
|
1267
|
+
var dirty = false;
|
1268
|
+
if(!this._segments){
|
1269
|
+
return false;
|
1270
|
+
}
|
1271
|
+
if(typeof sortLogics === "function"){
|
1272
|
+
return this.sortSegments(sortLogics);
|
1273
|
+
}
|
1274
|
+
var sortingDefs = DataTable._buildSortContext(
|
1275
|
+
[],
|
1276
|
+
cids,
|
1277
|
+
sortOrders,
|
1278
|
+
sortLogics
|
1279
|
+
);
|
1280
|
+
var defCount = sortingDefs ? sortingDefs.length : 0;
|
1281
|
+
if(!defCount){
|
1282
|
+
return dirty;
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
var sortOrder = 0;
|
1286
|
+
var sortLogic, sortContext;
|
1287
|
+
if(defCount > 1) {
|
1288
|
+
sortLogic = DataTable._multiColumnSeparatorCompareLogic;
|
1289
|
+
sortContext = sortingDefs;
|
1290
|
+
sortOrder = 1; // sortOrder is not used by _multiColumnSeparatorCompareLogic
|
1291
|
+
} else { // Single level sorting
|
1292
|
+
sortLogic = DataTable._singleColumnSeparatorCompareLogic;
|
1293
|
+
sortContext = sortingDefs[0];
|
1294
|
+
sortOrder = /** @type{number} */(sortContext[3]);
|
1295
|
+
}
|
1296
|
+
this._segmentSortOrder = sortOrder;
|
1297
|
+
this._segmentSortContext = sortContext;
|
1298
|
+
dirty = this.sortSegments(sortLogic);
|
1299
|
+
this._segmentSortOrder = 0;
|
1300
|
+
this._segmentSortContext = null;
|
1301
|
+
|
1302
|
+
return dirty;
|
1303
|
+
};
|
1251
1304
|
/** Sort all of existing segments by given compare function
|
1252
1305
|
* @public
|
1253
1306
|
* @param {Function} compare
|
@@ -1316,7 +1369,9 @@ DataTable.prototype.sortSegments = function (compare) {
|
|
1316
1369
|
DataTable.prototype._bySegmentSeparator = function (segmentA, segmentB) {
|
1317
1370
|
return /** @type{number} */(this._userSegmentComparer(
|
1318
1371
|
this.getRowData(segmentA.getId()),
|
1319
|
-
this.getRowData(segmentB.getId())
|
1372
|
+
this.getRowData(segmentB.getId()),
|
1373
|
+
this._segmentSortOrder,
|
1374
|
+
this._segmentSortContext
|
1320
1375
|
));
|
1321
1376
|
};
|
1322
1377
|
|
@@ -1657,6 +1712,47 @@ DataTable._singleColumnCompareLogic = function(a, b, order, sortingDef) {
|
|
1657
1712
|
sortingDef[4] // Context object
|
1658
1713
|
));
|
1659
1714
|
};
|
1715
|
+
/** Performance is extremely vital in this method
|
1716
|
+
* @public
|
1717
|
+
* @ignore
|
1718
|
+
* @function
|
1719
|
+
* @param {*} a
|
1720
|
+
* @param {*} b
|
1721
|
+
* @param {number} order Not used by in this method
|
1722
|
+
* @param {Array.<Array>} sortingDefs
|
1723
|
+
* @return {number}
|
1724
|
+
*/
|
1725
|
+
DataTable._multiColumnSeparatorCompareLogic = function(a, b, order, sortingDefs) {
|
1726
|
+
var count = sortingDefs.length;
|
1727
|
+
var result = 0;
|
1728
|
+
for(var c = 0; c < count; ++c) {
|
1729
|
+
var sortingDef = sortingDefs[c];
|
1730
|
+
result = DataTable._singleColumnSeparatorCompareLogic(a, b, sortingDef[3], sortingDef);
|
1731
|
+
if(result) {
|
1732
|
+
return result;
|
1733
|
+
}
|
1734
|
+
}
|
1735
|
+
return result;
|
1736
|
+
};
|
1737
|
+
/** Performance is extremely vital in this method
|
1738
|
+
* @public
|
1739
|
+
* @ignore
|
1740
|
+
* @function
|
1741
|
+
* @param {*} a
|
1742
|
+
* @param {*} b
|
1743
|
+
* @param {number} order
|
1744
|
+
* @param {Array} sortingDef
|
1745
|
+
* @return {number}
|
1746
|
+
*/
|
1747
|
+
DataTable._singleColumnSeparatorCompareLogic = function(a, b, order, sortingDef) {
|
1748
|
+
var key = /** @type{string} */(sortingDef[0]);
|
1749
|
+
return /** @type{number} */(sortingDef[2](
|
1750
|
+
a[key], // Value1
|
1751
|
+
b[key], // Value2
|
1752
|
+
order, // Sort order (3)
|
1753
|
+
sortingDef[4] // Context object
|
1754
|
+
));
|
1755
|
+
};
|
1660
1756
|
/** @public
|
1661
1757
|
* @function
|
1662
1758
|
* @ignore
|
@@ -272,9 +272,9 @@ declare class DataView extends EventDispatcher {
|
|
272
272
|
|
273
273
|
public getSegmentChildIds(segmentRef: string|number|null): (string)[]|null;
|
274
274
|
|
275
|
-
public
|
275
|
+
public sortSeparators(sortLogics: (((...params: any[]) => any))[]|null, sortOrders: (number)[]|null, cids: (string)[]|null): void;
|
276
276
|
|
277
|
-
public
|
277
|
+
public sortSegments(compare: ((...params: any[]) => any)|null): void;
|
278
278
|
|
279
279
|
public setSegmentClassification(segmentRef: string|number|null, fields: string|(string)[]|null): boolean;
|
280
280
|
|
@@ -68,8 +68,6 @@ var DataView = function(source) {
|
|
68
68
|
t._onRefreshTimeout = t._onRefreshTimeout.bind(t);
|
69
69
|
t._updateWrapCount = t._updateWrapCount.bind(t);
|
70
70
|
|
71
|
-
t._byRemovalMap = t._byRemovalMap.bind(t);
|
72
|
-
|
73
71
|
t._rids = [];
|
74
72
|
t._sortingDefs = [];
|
75
73
|
t._columnStats = {};
|
@@ -123,15 +121,6 @@ DataView.prototype._hiddenRids = null;
|
|
123
121
|
* @type {Object.<string, boolean>}
|
124
122
|
*/
|
125
123
|
DataView.prototype._collapsedRids = null; // for segmentation
|
126
|
-
/** @private
|
127
|
-
* @type {Object.<string, number>}
|
128
|
-
*/
|
129
|
-
DataView.prototype._excludedRids = null;
|
130
|
-
/** @private
|
131
|
-
* @type {boolean}
|
132
|
-
*/
|
133
|
-
DataView.prototype._emptySegmentFiltering = false;
|
134
|
-
|
135
124
|
/** @private
|
136
125
|
* @type {Object.<string, number>}
|
137
126
|
*/
|
@@ -828,6 +817,8 @@ DataView.prototype.hideRow = function(rId, hidden) {
|
|
828
817
|
*/
|
829
818
|
DataView.prototype.hideRows = function(rowRefs, hidden) {
|
830
819
|
hidden = hidden !== false;
|
820
|
+
var dirty = false;
|
821
|
+
var rids = this._toRowIds(rowRefs);
|
831
822
|
var hiddenRids = this._hiddenRids;
|
832
823
|
|
833
824
|
if(hidden){
|
@@ -838,19 +829,11 @@ DataView.prototype.hideRows = function(rowRefs, hidden) {
|
|
838
829
|
return; // All rows are visible
|
839
830
|
}
|
840
831
|
|
841
|
-
var rids = this._toRowIds(rowRefs);
|
842
|
-
var dirty = false;
|
843
|
-
|
844
832
|
for(var i = rids.length; --i >= 0;) {
|
845
833
|
var rid = rids[i];
|
846
834
|
if(rid) { // undefined, null, and an empty string value are not a valid row id
|
847
|
-
if(hidden) {
|
848
|
-
|
849
|
-
hiddenRids[rid] = true;
|
850
|
-
dirty = true;
|
851
|
-
}
|
852
|
-
} else if(hiddenRids[rid]) {
|
853
|
-
delete hiddenRids[rid];
|
835
|
+
if(!!hiddenRids[rid] !== hidden) {
|
836
|
+
hiddenRids[rid] = hidden;
|
854
837
|
dirty = true;
|
855
838
|
}
|
856
839
|
}
|
@@ -859,9 +842,11 @@ DataView.prototype.hideRows = function(rowRefs, hidden) {
|
|
859
842
|
if(dirty) {
|
860
843
|
if(!hidden) {
|
861
844
|
var hasHiddenRow = false;
|
862
|
-
for(var key in hiddenRids) {
|
863
|
-
|
864
|
-
|
845
|
+
for(var key in hiddenRids) {
|
846
|
+
if(hiddenRids[key]) {
|
847
|
+
hasHiddenRow = true;
|
848
|
+
break;
|
849
|
+
}
|
865
850
|
}
|
866
851
|
if(!hasHiddenRow) {
|
867
852
|
hiddenRids = this._hiddenRids = null;
|
@@ -950,14 +935,23 @@ DataView.prototype.filterOut = function(cid, value) {
|
|
950
935
|
*/
|
951
936
|
DataView.prototype.filterInOnce = function(cid, value, opt_filteringOut) {
|
952
937
|
var checker = this._getFilterLogic(cid, value);
|
938
|
+
if(!checker) { return; }
|
939
|
+
|
940
|
+
var filteringOut = (opt_filteringOut === true);
|
941
|
+
var rids = this._rids;
|
942
|
+
var dt = this._dt;
|
953
943
|
var removalMap = {};
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
944
|
+
var totalRem = 0;
|
945
|
+
var len = rids.length;
|
946
|
+
for(var i = len; --i >= 0;) {
|
947
|
+
var rid = rids[i];
|
948
|
+
var values = dt.getRowData(rid);
|
949
|
+
if (!values || checker(rid, values) === filteringOut) {
|
950
|
+
removalMap[rid] = true;
|
951
|
+
++totalRem;
|
952
|
+
}
|
960
953
|
}
|
954
|
+
if(totalRem <= 0) { return; }
|
961
955
|
|
962
956
|
var firstChange = this._removeRowIds(removalMap);
|
963
957
|
|
@@ -980,13 +974,13 @@ DataView.prototype.filterOutOnce = function(cid, value) {
|
|
980
974
|
this.filterInOnce(cid, value, true);
|
981
975
|
};
|
982
976
|
/** @private
|
983
|
-
* @param {!Object} removalMap
|
977
|
+
* @param {!Object.<string, *>} removalMap
|
984
978
|
* @return {number}
|
985
979
|
*/
|
986
980
|
DataView.prototype._removeRowIds = function(removalMap) {
|
987
|
-
var firstChange =
|
981
|
+
var firstChange = this._removeArrayItems(this._rids, removalMap);
|
988
982
|
if(this._groupView) {
|
989
|
-
firstChange =
|
983
|
+
firstChange = this._removeArrayItems(this._groupView, removalMap);
|
990
984
|
}
|
991
985
|
|
992
986
|
if(this._groupMembers) {
|
@@ -2548,6 +2542,15 @@ DataView.prototype.getSegmentIds = function() {
|
|
2548
2542
|
DataView.prototype.getSegmentChildIds = function(segmentRef) {
|
2549
2543
|
return this._dt.getSegmentChildIds(this._toRowId(segmentRef));
|
2550
2544
|
};
|
2545
|
+
/** Sort all of existing segments by multiple sort logics
|
2546
|
+
* @public
|
2547
|
+
* @param {Array.<Function>} sortLogics
|
2548
|
+
* @param {Array.<number>} sortOrders
|
2549
|
+
* @param {Array.<string>} cids
|
2550
|
+
*/
|
2551
|
+
DataView.prototype.sortSeparators = function (sortLogics, sortOrders, cids) {
|
2552
|
+
this._dt.sortSeparators(sortLogics, sortOrders, cids);
|
2553
|
+
};
|
2551
2554
|
/** Sort all of existing segments by given compare function
|
2552
2555
|
* @public
|
2553
2556
|
* @param {Function} compare
|
@@ -2555,19 +2558,6 @@ DataView.prototype.getSegmentChildIds = function(segmentRef) {
|
|
2555
2558
|
DataView.prototype.sortSegments = function (compare) {
|
2556
2559
|
this._dt.sortSegments(compare);
|
2557
2560
|
};
|
2558
|
-
/** Automatically hide empty segment when all of its member are filtered out. An empty segment will not be hidden, if there is no active filter. Collapsed segment does not count as filtering.
|
2559
|
-
* @public
|
2560
|
-
* @param {boolean=} enabled
|
2561
|
-
*/
|
2562
|
-
DataView.prototype.enableEmptySegmentFiltering = function (enabled) {
|
2563
|
-
enabled = enabled !== false;
|
2564
|
-
if(this._emptySegmentFiltering !== enabled) {
|
2565
|
-
this._emptySegmentFiltering = enabled;
|
2566
|
-
if(this._userFilter) {
|
2567
|
-
this._refreshAndNotify();
|
2568
|
-
}
|
2569
|
-
}
|
2570
|
-
};
|
2571
2561
|
|
2572
2562
|
/**
|
2573
2563
|
* @public
|
@@ -2728,35 +2718,26 @@ DataView.prototype._updateRowIds = function(opt_rowIds) {
|
|
2728
2718
|
// Perform the following sequences: parent view cloning >> row hiding >> row filtering >> row grouping >> sorting >> paging
|
2729
2719
|
this._rids = opt_rowIds || this._parent.getAllRowIds(); // Get all data ids
|
2730
2720
|
|
2731
|
-
this.
|
2732
|
-
|
2733
|
-
|
2734
|
-
var exclusionCount = 0;
|
2735
|
-
exclusionCount += DataView._copyObjectKeys(this._excludedRids, this._hiddenRids);
|
2736
|
-
|
2737
|
-
// Segment separators should not be filtered out (hidden)
|
2721
|
+
if(this._hiddenRids) {
|
2722
|
+
this._removeArrayItems(this._rids, this._hiddenRids);
|
2723
|
+
}
|
2738
2724
|
var segments = this._dt._getSegmentSeparators();
|
2739
|
-
var filterExceptions = segments ? segments.getSegments() : null;
|
2740
|
-
var userRemoval = this._getRemovalMap(this._excludedRids, this._userFilter, this._filteringOut, filterExceptions);
|
2741
|
-
exclusionCount += userRemoval;
|
2742
|
-
|
2743
2725
|
this._collapsedRids = null;
|
2726
|
+
var filterExceptions = null;
|
2744
2727
|
if(segments) {
|
2745
|
-
|
2746
|
-
|
2728
|
+
filterExceptions = segments.getSegments(); // Segment separators should not be filtered out (hidden)
|
2729
|
+
var collapsedRows = this._collapsedRids = segments.getCollapsedRows(); // Children of collapsed segments must be filtered out (hidden)
|
2730
|
+
if(collapsedRows) {
|
2731
|
+
this._removeArrayItems(this._rids, collapsedRows);
|
2747
2732
|
}
|
2748
|
-
this._collapsedRids = segments.getCollapsedRows();
|
2749
|
-
// Children of collapsed segments must be filtered out (hidden)
|
2750
|
-
exclusionCount += DataView._copyObjectKeys(this._excludedRids, this._collapsedRids);
|
2751
2733
|
}
|
2752
2734
|
|
2753
|
-
|
2754
|
-
|
2755
|
-
|
2756
|
-
if(
|
2757
|
-
this.
|
2735
|
+
this._dispatch("beforeFiltering", {});
|
2736
|
+
this._quickFilter(this._userFilter, this._filteringOut, filterExceptions);
|
2737
|
+
|
2738
|
+
if(this._groupLevel > 0 && !opt_rowIds) {
|
2739
|
+
this._quickFilter(this._groupFilterLogic, false); // Filter In
|
2758
2740
|
}
|
2759
|
-
this._excludedRids = null;
|
2760
2741
|
|
2761
2742
|
if(this._groupMembers) { // Has grouping
|
2762
2743
|
this._populateGroups(); // View will be properly re-populate inside _populateGroups()
|
@@ -3028,9 +3009,9 @@ DataView.prototype._onRowUpdated = function(e) { // onUpdate
|
|
3028
3009
|
|
3029
3010
|
if(this._groupLevel > 0) {
|
3030
3011
|
if(processingFlag === 1) { // The row is moved to the other group
|
3031
|
-
if(
|
3012
|
+
if(this._removeArrayItem(this._rids, rid) >= 0) {
|
3032
3013
|
if(this._groupView) {
|
3033
|
-
|
3014
|
+
this._removeArrayItem(this._groupView, rid);
|
3034
3015
|
}
|
3035
3016
|
}
|
3036
3017
|
if(this._shared.multiGroupRow) {
|
@@ -3230,31 +3211,34 @@ DataView.prototype._getRowIndex = function(rids, opt_nextRid, opt_fallback) {
|
|
3230
3211
|
* @returns {number}
|
3231
3212
|
*/
|
3232
3213
|
DataView.prototype._removeDataRow = function(rid) {
|
3233
|
-
var at =
|
3214
|
+
var at = this._removeArrayItem(this._rids, rid);
|
3234
3215
|
if(this._groupView && at >= 0) {
|
3235
|
-
at =
|
3216
|
+
at = this._removeArrayItem(this._groupView, rid);
|
3236
3217
|
}
|
3237
3218
|
return at;
|
3238
3219
|
};
|
3239
3220
|
/** @private
|
3240
|
-
* @param {
|
3221
|
+
* @param {Array} ary
|
3241
3222
|
* @param {*} item
|
3242
3223
|
* @return {number} Index of the removed item
|
3243
3224
|
*/
|
3244
|
-
DataView._removeArrayItem = function(ary, item) {
|
3245
|
-
var
|
3246
|
-
|
3247
|
-
ary
|
3225
|
+
DataView.prototype._removeArrayItem = function(ary, item) {
|
3226
|
+
var len = ary.length;
|
3227
|
+
for(var i = 0; i < len; ++i) {
|
3228
|
+
if(ary[i] === item) {
|
3229
|
+
ary.splice(i, 1);
|
3230
|
+
return i;
|
3231
|
+
}
|
3248
3232
|
}
|
3249
|
-
return
|
3233
|
+
return -1;
|
3250
3234
|
};
|
3251
3235
|
/** Remove multiple array items
|
3252
3236
|
* @private
|
3253
3237
|
* @param {Array.<string>} ary
|
3254
|
-
* @param {Object} items
|
3238
|
+
* @param {Object.<string, *>} items
|
3255
3239
|
* @return {number} First item index that is being removed. NaN if no item is removed
|
3256
3240
|
*/
|
3257
|
-
DataView._removeArrayItems = function(ary, items) {
|
3241
|
+
DataView.prototype._removeArrayItems = function(ary, items) {
|
3258
3242
|
var f = NaN;
|
3259
3243
|
var c = 0;
|
3260
3244
|
for(var i = ary.length; --i >= 0;) {
|
@@ -3273,23 +3257,6 @@ DataView._removeArrayItems = function(ary, items) {
|
|
3273
3257
|
return f;
|
3274
3258
|
};
|
3275
3259
|
/** @private
|
3276
|
-
* @param {Object} baseObj
|
3277
|
-
* @param {Object} masterObj
|
3278
|
-
* @returns {number}
|
3279
|
-
*/
|
3280
|
-
DataView._copyObjectKeys = function(baseObj, masterObj) {
|
3281
|
-
if(masterObj) {
|
3282
|
-
var count = 0;
|
3283
|
-
|
3284
|
-
for(var key in masterObj) {
|
3285
|
-
baseObj[key] = 1;
|
3286
|
-
++count; // WARNING: duplicated key can be counted more than once
|
3287
|
-
}
|
3288
|
-
return count;
|
3289
|
-
}
|
3290
|
-
return 0;
|
3291
|
-
};
|
3292
|
-
/** @private
|
3293
3260
|
* @param {string|null} rid
|
3294
3261
|
* @param {Object} rowData
|
3295
3262
|
* @return {boolean}
|
@@ -3323,6 +3290,9 @@ DataView.prototype.isRowFiltered = function(rid, rowData) {
|
|
3323
3290
|
return true;
|
3324
3291
|
}
|
3325
3292
|
}
|
3293
|
+
if(this.isSegmentSeparator(rid)) {
|
3294
|
+
return false; // Segment separator cannot be filtered
|
3295
|
+
}
|
3326
3296
|
if(this._collapsedRids) {
|
3327
3297
|
if(this._collapsedRids[rid]) {
|
3328
3298
|
return true;
|
@@ -3364,90 +3334,40 @@ DataView.prototype._sort = function() {
|
|
3364
3334
|
};
|
3365
3335
|
|
3366
3336
|
/** @private
|
3367
|
-
* @param {string} rid
|
3368
|
-
* @returns {boolean}
|
3369
|
-
*/
|
3370
|
-
DataView.prototype._byRemovalMap = function(rid) {
|
3371
|
-
return !this._excludedRids[rid];
|
3372
|
-
};
|
3373
|
-
/** @private
|
3374
|
-
* @param {Object} removalMap
|
3375
3337
|
* @param {Function} checker
|
3376
3338
|
* @param {boolean} filteringOut
|
3377
3339
|
* @param {Object=} exceptions
|
3378
|
-
* @returns {number} Number of rids that would be filtered out
|
3379
3340
|
*/
|
3380
|
-
DataView.prototype.
|
3341
|
+
DataView.prototype._quickFilter = function(checker, filteringOut, exceptions) {
|
3381
3342
|
if(!checker) {
|
3382
|
-
return
|
3343
|
+
return;
|
3383
3344
|
}
|
3384
3345
|
|
3385
3346
|
var rids = this._rids; // Make local variable to speed up the process
|
3386
|
-
var dt = this._dt;
|
3387
|
-
var count = 0;
|
3388
|
-
var rid, i, values;
|
3389
3347
|
var len = rids.length;
|
3390
|
-
|
3391
|
-
|
3392
|
-
|
3393
|
-
|
3394
|
-
|
3395
|
-
|
3396
|
-
|
3397
|
-
if(checker(rid, values) === filteringOut) {
|
3398
|
-
removalMap[rid] = 1;
|
3399
|
-
++count;
|
3400
|
-
}
|
3401
|
-
} else {
|
3402
|
-
removalMap[rid] = 1;
|
3403
|
-
++count;
|
3404
|
-
}
|
3405
|
-
}
|
3406
|
-
}
|
3407
|
-
} else {
|
3408
|
-
for(i = len; --i >= 0;) {
|
3409
|
-
rid = rids[i];
|
3410
|
-
values = dt.getRowData(rid);
|
3348
|
+
var dt = this._dt;
|
3349
|
+
var spliceCount = 0;
|
3350
|
+
for(var i = len; --i >= 0;) {
|
3351
|
+
var rid = rids[i];
|
3352
|
+
var removed = false;
|
3353
|
+
if(!exceptions || !exceptions[rid]) {
|
3354
|
+
var values = dt.getRowData(rid);
|
3411
3355
|
if (values) {
|
3412
|
-
|
3413
|
-
removalMap[rid] = 1;
|
3414
|
-
++count;
|
3415
|
-
}
|
3356
|
+
removed = checker(rid, values) === filteringOut;
|
3416
3357
|
} else {
|
3417
|
-
|
3418
|
-
++count;
|
3358
|
+
removed = true;
|
3419
3359
|
}
|
3420
3360
|
}
|
3421
|
-
|
3422
|
-
|
3423
|
-
}
|
3424
|
-
|
3425
|
-
|
3426
|
-
* @param {Object} segmentRids
|
3427
|
-
* @returns {number} Number of rids that would be filtered out
|
3428
|
-
*/
|
3429
|
-
DataView.prototype._getEmptySegments = function(removalMap, segmentRids) {
|
3430
|
-
var segments = this._dt._getSegmentSeparators();
|
3431
|
-
var count = 0;
|
3432
|
-
for(var segmentId in segmentRids) {
|
3433
|
-
var segment = segments.getSegment(segmentId);
|
3434
|
-
if(segment) {
|
3435
|
-
var chdr = segment.getChildren();
|
3436
|
-
var emptySegment = true;
|
3437
|
-
for(var childId in chdr) {
|
3438
|
-
if(!removalMap[childId]) {
|
3439
|
-
emptySegment = false;
|
3440
|
-
break;
|
3441
|
-
}
|
3442
|
-
}
|
3443
|
-
if(emptySegment) {
|
3444
|
-
removalMap[segmentId] = 1;
|
3445
|
-
++count;
|
3446
|
-
}
|
3361
|
+
if(removed) {
|
3362
|
+
++spliceCount;
|
3363
|
+
} else if(spliceCount > 0) {
|
3364
|
+
rids.splice(i + 1, spliceCount);
|
3365
|
+
spliceCount = 0;
|
3447
3366
|
}
|
3448
3367
|
}
|
3449
|
-
|
3450
|
-
|
3368
|
+
if(spliceCount > 0) {
|
3369
|
+
rids.splice(0, spliceCount);
|
3370
|
+
}
|
3451
3371
|
};
|
3452
3372
|
/** @private
|
3453
3373
|
* @param {string|Function|undefined} cid
|
@@ -3727,13 +3647,13 @@ DataView.prototype._removeGroupMember = function (groupIndex, groupId) {
|
|
3727
3647
|
};
|
3728
3648
|
/** @private
|
3729
3649
|
* @param {string} cid
|
3730
|
-
* @param {Object} values
|
3650
|
+
* @param {Object.<string, *>} values
|
3731
3651
|
* @return {Array.<string>}
|
3732
3652
|
*/
|
3733
3653
|
DataView.prototype._defaultGroupCriteria = function(cid, values) {
|
3734
3654
|
var val = values[cid];
|
3735
3655
|
if(Array.isArray(val)) {
|
3736
|
-
return val.map(function(data) {
|
3656
|
+
return val.map(function(data) {
|
3737
3657
|
return data + "";
|
3738
3658
|
});
|
3739
3659
|
} else {
|
@@ -3742,11 +3662,11 @@ DataView.prototype._defaultGroupCriteria = function(cid, values) {
|
|
3742
3662
|
};
|
3743
3663
|
/** @private
|
3744
3664
|
* @param {string|null} rid
|
3745
|
-
* @param {Object} values
|
3665
|
+
* @param {Object.<string, *>} values
|
3746
3666
|
* @return {boolean}
|
3747
3667
|
*/
|
3748
3668
|
DataView.prototype._groupFilterLogic = function(rid, values) {
|
3749
|
-
var gids = this._groupCriteria[this._groupLevel - 1](values);
|
3669
|
+
var gids = this._groupCriteria[this._groupLevel - 1](values);
|
3750
3670
|
return gids.indexOf(this._groupId) >= 0;
|
3751
3671
|
};
|
3752
3672
|
|
@@ -292,12 +292,6 @@ Segment.prototype.getChildIds = function() {
|
|
292
292
|
return this._childCount ? Object.keys(this._children) : [];
|
293
293
|
};
|
294
294
|
/** @public
|
295
|
-
* @return {!Object}
|
296
|
-
*/
|
297
|
-
Segment.prototype.getChildren = function() {
|
298
|
-
return this._children;
|
299
|
-
};
|
300
|
-
/** @public
|
301
295
|
* @return {number}
|
302
296
|
*/
|
303
297
|
Segment.prototype.getChildCount = function() {
|
@@ -405,6 +405,10 @@ declare class Core extends ElementWrapper {
|
|
405
405
|
|
406
406
|
public getColumnGroupChildIds(groupId: string): (string)[]|null;
|
407
407
|
|
408
|
+
public getValidColumnList(colIds: (string)[]|null, columnMap?: any): (string)[];
|
409
|
+
|
410
|
+
public createColumnMap(colIds?: (string)[]|null): any;
|
411
|
+
|
408
412
|
public startBatch(batchType: string): boolean;
|
409
413
|
|
410
414
|
public stopBatch(batchType: string): boolean;
|