@refinitiv-ui/efx-grid 6.0.33 → 6.0.35
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/lib/column-dragging/es6/ColumnDragging.js +50 -40
- package/lib/core/dist/core.js +210 -38
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.d.ts +3 -1
- package/lib/core/es6/data/DataTable.js +27 -9
- package/lib/core/es6/data/DataView.d.ts +2 -0
- package/lib/core/es6/data/DataView.js +12 -1
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +16 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +1 -3
- package/lib/core/es6/data/SegmentCollection.js +25 -18
- package/lib/core/es6/grid/Core.d.ts +12 -0
- package/lib/core/es6/grid/Core.js +64 -2
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +13 -7
- package/lib/grid/index.js +1 -1
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +3 -1
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +766 -293
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +13 -8
- package/lib/rt-grid/es6/DataConnector.js +3 -2
- package/lib/rt-grid/es6/Grid.d.ts +3 -1
- package/lib/rt-grid/es6/Grid.js +148 -40
- package/lib/rt-grid/es6/RowDefSorter.d.ts +5 -5
- package/lib/rt-grid/es6/RowDefSorter.js +165 -71
- package/lib/rt-grid/es6/RowDefinition.d.ts +7 -2
- package/lib/rt-grid/es6/RowDefinition.js +48 -10
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +1 -0
- package/lib/rt-grid/es6/SnapshotFiller.js +1 -11
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +66 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +2 -0
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +38 -13
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +12 -5
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +128 -42
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +3 -3
- package/lib/tr-grid-heat-map/es6/HeatMap.js +13 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +2 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +153 -17
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +3 -2
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +20 -20
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +37 -138
- package/lib/tr-grid-util/es6/CellPainter.d.ts +1 -1
- package/lib/tr-grid-util/es6/CellPainter.js +56 -55
- package/lib/tr-grid-util/es6/DragUI.js +7 -3
- package/lib/tr-grid-util/es6/FieldFormatter.js +6 -2
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -11
- package/lib/tr-grid-util/es6/Util.d.ts +3 -0
- package/lib/tr-grid-util/es6/Util.js +53 -0
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +36 -33
- package/lib/types/es6/ColumnStack.d.ts +2 -0
- package/lib/types/es6/ConditionalColoring.d.ts +12 -5
- package/lib/types/es6/Core/data/DataTable.d.ts +3 -1
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +1 -3
- package/lib/types/es6/Core/grid/Core.d.ts +4 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +1 -0
- package/lib/types/es6/HeatMap.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +3 -1
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +7 -2
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +1 -0
- package/lib/types/es6/RowDragging.d.ts +2 -1
- package/lib/types/es6/TextFormatting.d.ts +20 -20
- package/lib/versions.json +9 -9
- package/package.json +1 -1
@@ -75,11 +75,17 @@ var ColumnDraggingPlugin = function (options) {
|
|
75
75
|
t._hosts = [];
|
76
76
|
|
77
77
|
t._guideline = document.createElement("div");
|
78
|
-
t._guideline.className = "guideline";
|
79
78
|
t._dragBox = document.createElement("div");
|
80
|
-
t._dragBox.
|
79
|
+
t._dragBox.classList.add("drag-box-disabled"); // defualt disable dragbox
|
81
80
|
t._dragBoxIcon = document.createElement("ef-icon");
|
82
|
-
t._dragBoxIcon.
|
81
|
+
t._dragBoxIcon.classList.add("drag-box-icon");
|
82
|
+
|
83
|
+
if(ElfUtil.getElfVersion() < 4) {
|
84
|
+
t._dragBox.classList.add("tr-dragbox");
|
85
|
+
t._guideline.classList.add("tr-guideline");
|
86
|
+
} else {
|
87
|
+
t._guideline.classList.add("guideline");
|
88
|
+
}
|
83
89
|
|
84
90
|
if(options) {
|
85
91
|
this.config({ "columnDragging": options });
|
@@ -284,7 +290,8 @@ ColumnDraggingPlugin.prototype.config = function (options) {
|
|
284
290
|
|
285
291
|
if (typeof extOptions["dragBoxRenderer"] === "function") {
|
286
292
|
this._dragBoxRenderer = extOptions["dragBoxRenderer"];
|
287
|
-
this._dragBox.
|
293
|
+
this._dragBox.classList.add("drag-box");
|
294
|
+
this._dragBox.classList.remove("drag-box-disabled");
|
288
295
|
}
|
289
296
|
this.addListener(extOptions, "dragStart");
|
290
297
|
this.addListener(extOptions, "drag");
|
@@ -607,47 +614,38 @@ ColumnDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
607
614
|
if (!operationCancelled) {
|
608
615
|
if (!this._noColumnMoving) {
|
609
616
|
var cgp = this._getPlugin("ColumnGroupingPlugin");
|
617
|
+
var csp = this._getPlugin("ColumnStackPlugin");
|
618
|
+
var destIndex = this._destColumn;
|
619
|
+
var groupId, stackId;
|
620
|
+
|
621
|
+
// Move operation always move to the left of destination column
|
622
|
+
// When moving forward, destnation need to added by 1 to move correctly
|
623
|
+
if (this._startColumn < this._destColumn) {
|
624
|
+
destIndex = this._destColumn + 1;
|
625
|
+
}
|
626
|
+
|
627
|
+
// TODO: support multi column dragging
|
628
|
+
if(csp) {
|
629
|
+
stackId = csp.getStackId(this._startColumn);
|
630
|
+
}
|
610
631
|
if(cgp){
|
611
632
|
var cellInfo = cgp.getCellInfo(this._startPos);
|
612
|
-
|
613
|
-
|
633
|
+
groupId = cellInfo["groupId"] || cellInfo["columnId"];
|
634
|
+
}
|
614
635
|
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
}
|
620
|
-
if(srcId){
|
621
|
-
cgp.moveGroup(srcId, destIndex);
|
622
|
-
}
|
636
|
+
if(stackId && this._startColumn === this._endColumn){
|
637
|
+
csp.moveStack(stackId, destIndex);
|
638
|
+
} else if(groupId) {
|
639
|
+
cgp.moveGroup(groupId, destIndex);
|
623
640
|
} else {
|
624
|
-
var
|
625
|
-
var
|
626
|
-
|
627
|
-
|
628
|
-
shiftStart = this._destColumn;
|
629
|
-
shiftEnd = this._startColumn - 1;
|
630
|
-
moveSize = -1 * (this._startColumn - this._destColumn); //Move to the left
|
631
|
-
} else
|
632
|
-
if (this._startColumn < this._destColumn) { //Move foward
|
633
|
-
shiftStart = this._endColumn + 1;
|
634
|
-
shiftEnd = this._destColumn;
|
635
|
-
moveSize = ((shiftEnd - shiftStart) + 1); //Move to the right
|
641
|
+
var colList = [];
|
642
|
+
var i;
|
643
|
+
for(i = this._startColumn; i <= this._endColumn; i++){
|
644
|
+
colList.push(i);
|
636
645
|
}
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
var host = this._hosts[j];
|
641
|
-
var i;
|
642
|
-
if (moveSize > 0) { //Move forward
|
643
|
-
for (i = this._startColumn; i <= this._endColumn; i++) {
|
644
|
-
host.moveColumn(this._startColumn, this._destColumn);
|
645
|
-
}
|
646
|
-
} else { //Move backward
|
647
|
-
for (i = this._startColumn; i <= this._endColumn; i++) {
|
648
|
-
host.moveColumn(this._startColumn + (i - this._startColumn), this._destColumn + (i - this._startColumn));
|
649
|
-
}
|
650
|
-
}
|
646
|
+
for(i = this._hosts.length; --i >= 0;) {
|
647
|
+
var host = this._hosts[i];
|
648
|
+
host.reorderColumns(colList, destIndex);
|
651
649
|
}
|
652
650
|
}
|
653
651
|
}
|
@@ -756,6 +754,18 @@ ColumnDraggingPlugin.prototype._renderGuideline = function() {
|
|
756
754
|
var rightHand = this._pos["x"] > colLeft + colWidth / 2;
|
757
755
|
var destColumn = (rightHand) ? colEnd + 1 : colStart;
|
758
756
|
|
757
|
+
var csp = this._getPlugin("ColumnStackPlugin");
|
758
|
+
if(csp){
|
759
|
+
var stackId = csp.getStackId(destColumn);
|
760
|
+
if(stackId){
|
761
|
+
var members = csp.getStackMemberIndices(stackId);
|
762
|
+
var memberCount = members.length;
|
763
|
+
if(members && memberCount){
|
764
|
+
destColumn = rightHand ? members[memberCount - 1] + 1 : members[0];
|
765
|
+
}
|
766
|
+
}
|
767
|
+
}
|
768
|
+
|
759
769
|
colLeft = this._clickedGrid.getColumnLeft(this._destColumn);
|
760
770
|
// If destination exceeds the specified bounds
|
761
771
|
if (destColumn < this._leftMovableBorder) {
|
package/lib/core/dist/core.js
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
/* harmony export */ "Qr": () => (/* binding */ isEmptyObject),
|
10
10
|
/* harmony export */ "kI": () => (/* binding */ cloneObject)
|
11
11
|
/* harmony export */ });
|
12
|
-
/* unused harmony exports Util, extendObject, arrayToObject, extendProperty, extendArrayProperty, parseCondition, prettifyCss, getShadowRoot, injectCss, isIE, isMac, isTouchDevice, nestedObjectToArray, rgb2Hex, prepareTSVContent */
|
12
|
+
/* unused harmony exports Util, extendObject, deepEqual, arrayToObject, extendProperty, extendArrayProperty, parseCondition, prettifyCss, getShadowRoot, injectCss, isIE, isMac, isTouchDevice, nestedObjectToArray, rgb2Hex, prepareTSVContent */
|
13
13
|
/** @namespace */
|
14
14
|
var Util = {};
|
15
15
|
|
@@ -212,6 +212,58 @@ var extendProperty = function (obj, extender, propName) {
|
|
212
212
|
}
|
213
213
|
}
|
214
214
|
};
|
215
|
+
|
216
|
+
|
217
|
+
/** Compare the values of obj1 and obj2. if they are the same object or have the same value, the result will be true. Otherwise, it will return false.
|
218
|
+
* @public
|
219
|
+
* @param {*} obj1
|
220
|
+
* @param {*} obj2
|
221
|
+
* @return {boolean}
|
222
|
+
*/
|
223
|
+
var deepEqual = function (obj1, obj2) {
|
224
|
+
|
225
|
+
if(obj1 === obj2) {
|
226
|
+
return true;
|
227
|
+
}
|
228
|
+
|
229
|
+
if (typeof obj1 !== typeof obj2) {
|
230
|
+
return false;
|
231
|
+
}
|
232
|
+
|
233
|
+
if (typeof obj1 === "object") {
|
234
|
+
|
235
|
+
// We need to split array and object for performance reason
|
236
|
+
if(Array.isArray(obj1)) {
|
237
|
+
if(obj1.length !== obj2.length) {
|
238
|
+
return false;
|
239
|
+
}
|
240
|
+
|
241
|
+
for (var i = 0; i < obj1.length; i++) {
|
242
|
+
if (!deepEqual(obj1[i], obj2[i])) { // The array may not be a match if the elements are not sorted, so it will not be considered equal if there is a mismatch.
|
243
|
+
return false;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
|
247
|
+
} else {
|
248
|
+
|
249
|
+
if (Object.keys(obj1).length !== Object.keys(obj2).length) {
|
250
|
+
return false;
|
251
|
+
}
|
252
|
+
|
253
|
+
for (var key in obj1) {
|
254
|
+
if (!deepEqual(obj1[key], obj2[key])) {
|
255
|
+
return false;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
|
261
|
+
return true;
|
262
|
+
}
|
263
|
+
|
264
|
+
return false;
|
265
|
+
|
266
|
+
};
|
215
267
|
/** Array.push() is much faster than Array.concat(). The downside is the parameters must be an array, whereas concat() has no such requirement. <br>
|
216
268
|
* This method excels in extending known array property in an object.
|
217
269
|
* @public
|
@@ -14060,6 +14112,22 @@ Segment.prototype.getOrder = function() {
|
|
14060
14112
|
}
|
14061
14113
|
return this._order * 10000;
|
14062
14114
|
};
|
14115
|
+
/** Get the last (highest) order from the entire tree regardless of the current position segment in the hierachy
|
14116
|
+
* @public
|
14117
|
+
* @return {number}
|
14118
|
+
*/
|
14119
|
+
Segment.prototype.getLastOrder = function() {
|
14120
|
+
if(this._subSegDef) {
|
14121
|
+
var subSegments = this._subSegDef.subSegments;
|
14122
|
+
if(subSegments) {
|
14123
|
+
var lastSegment = subSegments[subSegments.length - 1];
|
14124
|
+
if(lastSegment) {
|
14125
|
+
return lastSegment.getOrder();
|
14126
|
+
}
|
14127
|
+
}
|
14128
|
+
}
|
14129
|
+
return this.getOrder();
|
14130
|
+
};
|
14063
14131
|
/** @public
|
14064
14132
|
* @param {number} val
|
14065
14133
|
*/
|
@@ -14181,9 +14249,10 @@ SegmentCollection.prototype.dispose = function() {
|
|
14181
14249
|
};
|
14182
14250
|
/** @public
|
14183
14251
|
* @param {string} rid
|
14252
|
+
* @param {Array.<string>=} childRids Children of the newly added segment. This is a shorthand to addSegmentChildren method
|
14184
14253
|
* @return {boolean} Returns true if there is any change. Otherwise, returns false
|
14185
14254
|
*/
|
14186
|
-
SegmentCollection.prototype.addSegment = function(rid) {
|
14255
|
+
SegmentCollection.prototype.addSegment = function(rid, childRids) {
|
14187
14256
|
if(rid && !this._segments[rid]) {
|
14188
14257
|
if(this.getParentRowId(rid)) {
|
14189
14258
|
console.log("child of a segment cannot be set as a segment separator");
|
@@ -14194,6 +14263,10 @@ SegmentCollection.prototype.addSegment = function(rid) {
|
|
14194
14263
|
segment.addEventListener("subSegmentRemoved", this._onSubSegmentRemoved);
|
14195
14264
|
++this._segmentCount;
|
14196
14265
|
this._segmentList = null; // order could be changed
|
14266
|
+
|
14267
|
+
if(childRids && childRids.length) {
|
14268
|
+
segment.addChildren(childRids);
|
14269
|
+
}
|
14197
14270
|
return true;
|
14198
14271
|
}
|
14199
14272
|
return false;
|
@@ -14541,9 +14614,10 @@ SegmentCollection.prototype.calcSegmentOrder = function(rids) {
|
|
14541
14614
|
};
|
14542
14615
|
/** @public
|
14543
14616
|
* @param {!Array.<string>} rids Array of row ids
|
14617
|
+
* @param {boolean=} partial Indicating that the given ids are not the whole list
|
14544
14618
|
* @return {Array.<number>} Returns Array of segment values, if there are at least one segment, otherwise returns null
|
14545
|
-
*/
|
14546
|
-
SegmentCollection.prototype.getSegmentValues = function(rids) {
|
14619
|
+
*/ //
|
14620
|
+
SegmentCollection.prototype.getSegmentValues = function(rids, partial) {
|
14547
14621
|
var rowCount = rids ? rids.length : 0;
|
14548
14622
|
if(!rowCount) {
|
14549
14623
|
return null;
|
@@ -14560,29 +14634,30 @@ SegmentCollection.prototype.getSegmentValues = function(rids) {
|
|
14560
14634
|
var rid = rids[r];
|
14561
14635
|
curSegment = segmentSeparators[rid];
|
14562
14636
|
if(curSegment) { // segment separator
|
14563
|
-
|
14564
|
-
|
14565
|
-
|
14566
|
-
if(
|
14567
|
-
|
14637
|
+
segmentVal = curSegment.getOrder() * 100;
|
14638
|
+
offset = 0;
|
14639
|
+
if(!curSegment.isSubSegment()) {
|
14640
|
+
if(prevSegment !== curSegment) {
|
14641
|
+
prevSegment = curSegment;
|
14642
|
+
highestVal = curSegment.getLastOrder() * 100;
|
14568
14643
|
}
|
14569
14644
|
}
|
14570
|
-
offset = 0;
|
14571
14645
|
} else {
|
14572
14646
|
var parentId = childToSegmentId[rid];
|
14573
14647
|
if(parentId) { // segment member
|
14574
14648
|
curSegment = segmentSeparators[parentId];
|
14575
|
-
|
14576
|
-
prevSegment = curSegment;
|
14577
|
-
segmentVal = curSegment.getOrder() * 100;
|
14578
|
-
if(segmentVal > highestVal) {
|
14579
|
-
highestVal = segmentVal;
|
14580
|
-
}
|
14581
|
-
}
|
14649
|
+
segmentVal = curSegment.getOrder() * 100;
|
14582
14650
|
offset = 1;
|
14651
|
+
if(partial) {
|
14652
|
+
highestVal = curSegment.getLastOrder() * 100;
|
14653
|
+
}
|
14583
14654
|
} else { // row outside of segments
|
14584
|
-
|
14585
|
-
|
14655
|
+
if(highestVal) {
|
14656
|
+
segmentVal = highestVal;
|
14657
|
+
offset = 10;
|
14658
|
+
} else {
|
14659
|
+
segmentVal = offset = 0;
|
14660
|
+
}
|
14586
14661
|
}
|
14587
14662
|
}
|
14588
14663
|
|
@@ -15601,7 +15676,24 @@ DataTable.prototype.setSortingLogic = function(func) {
|
|
15601
15676
|
* @param {DataTable.SortLogic} func Use null to remove current sorting logic
|
15602
15677
|
*/
|
15603
15678
|
DataTable.prototype.setColumnSortingLogic = function(cid, func) {
|
15604
|
-
|
15679
|
+
if(cid) {
|
15680
|
+
this._compMap[cid] = func;
|
15681
|
+
}
|
15682
|
+
};
|
15683
|
+
/** Get sorting logic for the specified field. Default logic is returned, if no logic is specified for the column
|
15684
|
+
* @public
|
15685
|
+
* @param {string=} cid
|
15686
|
+
* @return {DataTable.SortLogic}
|
15687
|
+
*/
|
15688
|
+
DataTable.prototype.getColumnSortingLogic = function(cid) {
|
15689
|
+
if(cid) {
|
15690
|
+
var logic = this._compMap[cid];
|
15691
|
+
if(logic) {
|
15692
|
+
return logic;
|
15693
|
+
}
|
15694
|
+
}
|
15695
|
+
|
15696
|
+
return this._compMap["_default"] || null;
|
15605
15697
|
};
|
15606
15698
|
|
15607
15699
|
/** Freeze data table so that no event is fired for data processing until executing {@link DataTable#unfreeze} method
|
@@ -15764,11 +15856,12 @@ DataTable.prototype.getSegmentParentRowId = function(rid) {
|
|
15764
15856
|
/**
|
15765
15857
|
* @public
|
15766
15858
|
* @param {Array.<string>=} rids If no row id is given, row ids of this data table is used instead
|
15859
|
+
* @param {boolean=} partial Indicating that the given ids are not the whole list
|
15767
15860
|
* @return {Array.<number>} Return null if there is no segmentation
|
15768
15861
|
*/
|
15769
|
-
DataTable.prototype.getSegmentValues = function(rids) {
|
15862
|
+
DataTable.prototype.getSegmentValues = function(rids, partial) {
|
15770
15863
|
if(this._segments) {
|
15771
|
-
return this._segments.getSegmentValues(rids || this._rids);
|
15864
|
+
return this._segments.getSegmentValues(rids || this._rids, partial);
|
15772
15865
|
}
|
15773
15866
|
return null;
|
15774
15867
|
};
|
@@ -15851,9 +15944,9 @@ DataTable.prototype.addSegmentChild = function(segmentId, rid, dataId) {
|
|
15851
15944
|
if(this._segments) {
|
15852
15945
|
var dirty = this._segments.addSegmentChild(segmentId, rid, dataId);
|
15853
15946
|
if(dirty) {
|
15854
|
-
|
15855
|
-
|
15856
|
-
|
15947
|
+
this._sort(null);
|
15948
|
+
this._dispatchPositionChange(); // Force rerendering, even if there is no position change
|
15949
|
+
|
15857
15950
|
this.requestClassifying();
|
15858
15951
|
return true;
|
15859
15952
|
}
|
@@ -15870,9 +15963,9 @@ DataTable.prototype.addSegmentChildren = function(segmentId, rids, dataIds) {
|
|
15870
15963
|
if(this._segments) {
|
15871
15964
|
var dirty = this._segments.addSegmentChildren(segmentId, rids, dataIds);
|
15872
15965
|
if(dirty) {
|
15873
|
-
|
15874
|
-
|
15875
|
-
|
15966
|
+
this._sort(null);
|
15967
|
+
this._dispatchPositionChange(); // Force rerendering, even if there is no position change
|
15968
|
+
|
15876
15969
|
this.requestClassifying();
|
15877
15970
|
return true;
|
15878
15971
|
}
|
@@ -19347,6 +19440,17 @@ DataView.prototype.setColumnSortingLogic = function(cid, func) {
|
|
19347
19440
|
this._dt.setColumnSortingLogic(cid, func);
|
19348
19441
|
}
|
19349
19442
|
};
|
19443
|
+
/** Get sorting logic for the specified field. Default logic is returned, if no logic is specified for the column
|
19444
|
+
* @public
|
19445
|
+
* @param {string=} cid
|
19446
|
+
* @return {DataTable.SortLogic}
|
19447
|
+
*/
|
19448
|
+
DataView.prototype.getColumnSortingLogic = function(cid) {
|
19449
|
+
if(this._dt) {
|
19450
|
+
return this._dt.getColumnSortingLogic(cid);
|
19451
|
+
}
|
19452
|
+
return null;
|
19453
|
+
};
|
19350
19454
|
/** Check if this view is in sorting mode
|
19351
19455
|
* @public
|
19352
19456
|
* @return {boolean}
|
@@ -21864,7 +21968,7 @@ DataView.prototype._sort = function() {
|
|
21864
21968
|
if(this._dt._getSegmentSeparators() || this.isSorting()) {
|
21865
21969
|
var rids = this._rids;
|
21866
21970
|
var dataRows = this._dt.getMultipleRowData(rids);
|
21867
|
-
var segmentValues = this._dt.getSegmentValues(rids);
|
21971
|
+
var segmentValues = this._dt.getSegmentValues(rids, true); // WARNING: This does not work well for hidden/filtered rows
|
21868
21972
|
var change = data_DataTable._performMultiLevelSorting(dataRows, this._sortingDefs, segmentValues);
|
21869
21973
|
|
21870
21974
|
if(change) {
|
@@ -25083,6 +25187,7 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
25083
25187
|
|
25084
25188
|
// eslint-disable-line
|
25085
25189
|
|
25190
|
+
|
25086
25191
|
// eslint-disable-line
|
25087
25192
|
|
25088
25193
|
|
@@ -25282,7 +25387,9 @@ var Core_Core = function (opt_initializer) {
|
|
25282
25387
|
"rowRemoved",
|
25283
25388
|
"columnPositionChanged",
|
25284
25389
|
"rowPositionChanged",
|
25285
|
-
"beforeColumnBoundUpdate"
|
25390
|
+
"beforeColumnBoundUpdate",
|
25391
|
+
"beforeBatchOperation",
|
25392
|
+
"afterBatchOperation"
|
25286
25393
|
);
|
25287
25394
|
|
25288
25395
|
// For debugging in advanced optimization mode
|
@@ -25357,6 +25464,15 @@ Core_Core.SectionReference;
|
|
25357
25464
|
*/
|
25358
25465
|
Core_Core.MouseInfo;
|
25359
25466
|
|
25467
|
+
/** @typedef {Object} Core~BatchInfo
|
25468
|
+
* @private
|
25469
|
+
* @property {string=} reset //set columns
|
25470
|
+
* @property {string=} insertion //add cols
|
25471
|
+
* @property {string=} removal //remove cols
|
25472
|
+
* @property {string=} moving //reorder
|
25473
|
+
*/
|
25474
|
+
Core_Core.BatchInfo;
|
25475
|
+
|
25360
25476
|
/** @typedef {Core.MouseInfo|ElementWrapper|Element} Core~CellReference
|
25361
25477
|
* @description A section in core grid can be refered by the following object <br>
|
25362
25478
|
* `{Core.MouseInfo}` : Object with valid x, y coordinates and section index <br>
|
@@ -25611,6 +25727,10 @@ Core_Core.prototype._rowHeightTimerId = 0;
|
|
25611
25727
|
* @private
|
25612
25728
|
*/
|
25613
25729
|
Core_Core.prototype._groupDefs = null;
|
25730
|
+
/** @type {BatchInfo}
|
25731
|
+
* @private
|
25732
|
+
*/
|
25733
|
+
Core_Core.prototype._batches = null;
|
25614
25734
|
//#region Public Methods
|
25615
25735
|
|
25616
25736
|
/**
|
@@ -25618,7 +25738,7 @@ Core_Core.prototype._groupDefs = null;
|
|
25618
25738
|
* @return {string}
|
25619
25739
|
*/
|
25620
25740
|
Core_Core.getVersion = function () {
|
25621
|
-
return "5.1.
|
25741
|
+
return "5.1.48";
|
25622
25742
|
};
|
25623
25743
|
/** {@link ElementWrapper#dispose}
|
25624
25744
|
* @override
|
@@ -26557,6 +26677,10 @@ Core_Core.prototype.removeColumnAt = function (index) {
|
|
26557
26677
|
|
26558
26678
|
if (this._hasListener("columnRemoved")) {
|
26559
26679
|
var e = {};
|
26680
|
+
var batches = this._batches;
|
26681
|
+
if(batches){
|
26682
|
+
e["batches"] = batches;
|
26683
|
+
}
|
26560
26684
|
e["atTheMiddle"] = true;
|
26561
26685
|
e["colIndex"] = index;
|
26562
26686
|
e["columns"] = "deprecated";
|
@@ -29401,6 +29525,40 @@ Core_Core.prototype.getColumnGroupChildIds = function (groupId) {
|
|
29401
29525
|
}
|
29402
29526
|
return null;
|
29403
29527
|
};
|
29528
|
+
|
29529
|
+
/** @public
|
29530
|
+
* @param {string} batchType
|
29531
|
+
* @return {boolean}
|
29532
|
+
* @fires Core#beforeBatchOperation
|
29533
|
+
*/
|
29534
|
+
Core_Core.prototype.startBatch = function (batchType) {
|
29535
|
+
if(!batchType){
|
29536
|
+
return false;
|
29537
|
+
}
|
29538
|
+
if(!this._batches){
|
29539
|
+
this._batches = {};
|
29540
|
+
}
|
29541
|
+
this._batches[batchType] = batchType;
|
29542
|
+
this._dispatch("beforeBatchOperation", { batches: this._batches, batchType: batchType });
|
29543
|
+
return true;
|
29544
|
+
};
|
29545
|
+
/** @public
|
29546
|
+
* @param {string} batchType
|
29547
|
+
* @return {boolean}
|
29548
|
+
* @fires Core#afterBatchOperation
|
29549
|
+
*/
|
29550
|
+
Core_Core.prototype.stopBatch = function (batchType) {
|
29551
|
+
if(!batchType){
|
29552
|
+
return false;
|
29553
|
+
}
|
29554
|
+
this._dispatch("afterBatchOperation", { batches: this._batches, batchType: batchType });
|
29555
|
+
|
29556
|
+
delete this._batches[batchType];
|
29557
|
+
if((0,es6_Util/* isEmptyObject */.Qr)(this._batches)){
|
29558
|
+
this._batches = null;
|
29559
|
+
}
|
29560
|
+
return true;
|
29561
|
+
};
|
29404
29562
|
//#endregion Public Methods
|
29405
29563
|
|
29406
29564
|
//#region Private Methods
|
@@ -29644,6 +29802,10 @@ Core_Core.prototype._dispatchColumnAddedEvent = function (at, count, atTheMiddle
|
|
29644
29802
|
if (this._hasListener("columnAdded")) {
|
29645
29803
|
var e = {};
|
29646
29804
|
e["atTheMiddle"] = atTheMiddle;
|
29805
|
+
var batches = this._batches;
|
29806
|
+
if(batches){
|
29807
|
+
e["batches"] = batches;
|
29808
|
+
}
|
29647
29809
|
if(count === 1) {
|
29648
29810
|
e["colIndex"] = at;
|
29649
29811
|
e["context"] = ctx;
|
@@ -29795,6 +29957,10 @@ Core_Core.prototype._removeColumn = function (num) { // TODO: change the logic
|
|
29795
29957
|
|
29796
29958
|
if (this._hasListener("columnRemoved")) {
|
29797
29959
|
var e = {};
|
29960
|
+
var batches = this._batches;
|
29961
|
+
if(batches){
|
29962
|
+
e["batches"] = batches;
|
29963
|
+
}
|
29798
29964
|
for (var c = colCount; --c >= newCount; ) {
|
29799
29965
|
var colDef = removedCols[c - newCount];
|
29800
29966
|
e["colIndex"] = c;
|
@@ -32319,6 +32485,9 @@ SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
|
|
32319
32485
|
if (!this._dataSorting) { return; }
|
32320
32486
|
|
32321
32487
|
var sortCount = this._sortStates.length;
|
32488
|
+
if(this._userManagedLogic && sortCount > 1) { // The logic is managed by the user. There is no point in using multi-column sorting
|
32489
|
+
sortCount = 1;
|
32490
|
+
}
|
32322
32491
|
var orders = null;
|
32323
32492
|
var sortLogics = null;
|
32324
32493
|
var c_ref = null;
|
@@ -32334,6 +32503,9 @@ SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
|
|
32334
32503
|
} else {
|
32335
32504
|
c_ref = this.getColumnSortingFields();
|
32336
32505
|
}
|
32506
|
+
if(this._userManagedLogic && c_ref.length > 1) {
|
32507
|
+
c_ref = c_ref.slice(0, 1);
|
32508
|
+
}
|
32337
32509
|
}
|
32338
32510
|
|
32339
32511
|
// Perform sorting even if there is no sort state
|
@@ -32442,16 +32614,16 @@ SortableTitlePlugin.prototype._updateSortableIndicator = function (hostIndex) {
|
|
32442
32614
|
symbol = t._createIconElem(icon, textContent);
|
32443
32615
|
symbol.className = "sort-symbol";
|
32444
32616
|
cell["insertFloatingIcon"](symbol, 0);
|
32445
|
-
|
32446
|
-
if (t._sortStates.length > 1) {
|
32447
|
-
symbol = document.createElement("span");
|
32448
|
-
symbol.className = "priority-symbol";
|
32449
|
-
symbol.textContent = priority + 1;
|
32450
|
-
cell["insertFloatingIcon"](symbol, 1);
|
32451
|
-
}
|
32452
32617
|
} else {
|
32453
32618
|
cell["addClass"]("edge-indicator");
|
32454
32619
|
}
|
32620
|
+
|
32621
|
+
if (t._sortStates.length > 1) {
|
32622
|
+
symbol = document.createElement("span");
|
32623
|
+
symbol.className = "priority-symbol";
|
32624
|
+
symbol.textContent = priority + 1;
|
32625
|
+
cell["insertFloatingIcon"](symbol, 1);
|
32626
|
+
}
|
32455
32627
|
} else if (t._sortableIndicator) { // Can sort but currently not sorting
|
32456
32628
|
icon = SortableTitlePlugin._icons["sortable"];
|
32457
32629
|
symbol = t._createIconElem(icon, CODE_DIAMOND);
|