@refinitiv-ui/efx-grid 6.0.41 → 6.0.42
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +837 -871
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +4 -0
- package/lib/core/es6/grid/Core.js +67 -2
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +3 -2
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +26 -26
- package/lib/core/es6/grid/util/util.js +25 -9
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +212 -44
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.d.ts +22 -0
- package/lib/rt-grid/es6/Grid.js +91 -4
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +4 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +34 -19
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +9 -3
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +290 -364
- package/lib/tr-grid-util/es6/DateTime.js +3 -3
- package/lib/tr-grid-util/es6/GridPlugin.js +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +4 -0
- package/lib/types/es6/ColumnStack.d.ts +9 -3
- package/lib/types/es6/Core/grid/Core.d.ts +4 -0
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -2
- package/lib/versions.json +3 -3
- package/package.json +1 -1
@@ -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;
|
@@ -82,6 +82,7 @@ var Core = function (opt_initializer) {
|
|
82
82
|
|
83
83
|
_t._onMouseMove = _t._onMouseMove.bind(_t);
|
84
84
|
_t._onRowHightlighted = _t._onRowHightlighted.bind(_t);
|
85
|
+
_t._onGridClicked = _t._onGridClicked.bind(_t);
|
85
86
|
|
86
87
|
_t._onWindowResize = _t._onWindowResize.bind(_t);
|
87
88
|
_t._onSectionDataChanged = _t._onSectionDataChanged.bind(_t);
|
@@ -167,11 +168,16 @@ var Core = function (opt_initializer) {
|
|
167
168
|
_t._hscrollbar.setOtherScrollbar(_t._vscrollbar);
|
168
169
|
_t._vscrollbar.setOtherScrollbar(_t._hscrollbar);
|
169
170
|
|
170
|
-
if (Util.isMobile) {
|
171
|
+
if (Util.isMobile || Util.isTouchDevice) {
|
171
172
|
_t._element.addEventListener("touchmove", this._onMouseMove, false);
|
172
173
|
} else {
|
173
174
|
_t._element.addEventListener("mousemove", this._onMouseMove, false);
|
174
175
|
}
|
176
|
+
|
177
|
+
if(Util.isSafari){
|
178
|
+
_t._element.addEventListener("click", this._onGridClicked);
|
179
|
+
}
|
180
|
+
|
175
181
|
window.addEventListener("resize", _t._onWindowResize, false); // Should be unlistened after destroyed
|
176
182
|
_t._rowVirtualizer.listen("indexChanged", _t._onRowInViewChanged);
|
177
183
|
_t._colVirtualizer.listen("indexChanged", _t._onColInViewChanged);
|
@@ -556,7 +562,7 @@ Core.prototype._batches = null;
|
|
556
562
|
* @return {string}
|
557
563
|
*/
|
558
564
|
Core.getVersion = function () {
|
559
|
-
return "5.1.
|
565
|
+
return "5.1.63";
|
560
566
|
};
|
561
567
|
/** {@link ElementWrapper#dispose}
|
562
568
|
* @override
|
@@ -4411,6 +4417,53 @@ Core.prototype.getColumnGroupChildIds = function (groupId) {
|
|
4411
4417
|
return null;
|
4412
4418
|
};
|
4413
4419
|
|
4420
|
+
/** @public
|
4421
|
+
* @description Get a list of objects with column id and column index in sorted order
|
4422
|
+
* @param {Array.<string>} colIds
|
4423
|
+
* @param {Object=} columnMap
|
4424
|
+
* @return {!Array.<string>} Return column array with corresponding order to UI
|
4425
|
+
* @example
|
4426
|
+
* core.getValidColumnList(["c1","c2","c5"]); // Get list of valid columns
|
4427
|
+
* core.getValidColumnList(["c1","c2","c5"],{ "c2":true, "c5":true }); // Get list of valid columns from specific mapping
|
4428
|
+
*/
|
4429
|
+
Core.prototype.getValidColumnList = function (colIds, columnMap) {
|
4430
|
+
var colList = [];
|
4431
|
+
if(!colIds){
|
4432
|
+
return colList;
|
4433
|
+
}
|
4434
|
+
if(!columnMap){
|
4435
|
+
columnMap = this.createColumnMap(colIds);
|
4436
|
+
}
|
4437
|
+
var colCount = this.getColumnCount();
|
4438
|
+
for(var c = 0; c < colCount; ++c) {
|
4439
|
+
var id = this._getColumnDef(c)["id"];
|
4440
|
+
if(columnMap[id] != null){
|
4441
|
+
colList.push({"index": c, "id": id});
|
4442
|
+
}
|
4443
|
+
}
|
4444
|
+
return colList;
|
4445
|
+
};
|
4446
|
+
|
4447
|
+
/** @public
|
4448
|
+
* @description Create mapping object from an array of strings
|
4449
|
+
* @param {Array.<string>=} colIds
|
4450
|
+
* @return {!Object} Column mapping object
|
4451
|
+
*/
|
4452
|
+
Core.prototype.createColumnMap = function (colIds) {
|
4453
|
+
if(!colIds){
|
4454
|
+
colIds = this.getColumnIds();
|
4455
|
+
}
|
4456
|
+
var mappingObj = {};
|
4457
|
+
var count = colIds.length;
|
4458
|
+
for(var i = 0; i < count; i++){
|
4459
|
+
var colId = colIds[i];
|
4460
|
+
if(colId){
|
4461
|
+
mappingObj[colId] = true;
|
4462
|
+
}
|
4463
|
+
}
|
4464
|
+
return mappingObj;
|
4465
|
+
};
|
4466
|
+
|
4414
4467
|
/** @public
|
4415
4468
|
* @param {string} batchType
|
4416
4469
|
* @return {boolean}
|
@@ -5250,6 +5303,18 @@ Core.prototype._onMouseMove = function () {
|
|
5250
5303
|
this._vscrollbar.flash();
|
5251
5304
|
this._hscrollbar.flash();
|
5252
5305
|
};
|
5306
|
+
/** @private */
|
5307
|
+
Core.prototype._onGridClicked = function () {
|
5308
|
+
// research for dragging
|
5309
|
+
var selection = window.getSelection();
|
5310
|
+
if(selection.toString()){
|
5311
|
+
return;
|
5312
|
+
}
|
5313
|
+
var activeElem = document.activeElement;
|
5314
|
+
if(!this._element.contains(activeElem)){
|
5315
|
+
this.focus();
|
5316
|
+
}
|
5317
|
+
};
|
5253
5318
|
|
5254
5319
|
/** @private
|
5255
5320
|
* @param {Object} e
|
@@ -11,8 +11,9 @@ declare namespace SortableTitlePlugin {
|
|
11
11
|
type SortOrder = "a" | "ascending" | "d" | "descending" | "n" | null|null;
|
12
12
|
|
13
13
|
type InitialSort = {
|
14
|
-
colIndex
|
15
|
-
|
14
|
+
colIndex?: number|null,
|
15
|
+
colId?: string|null,
|
16
|
+
field?: string|null,
|
16
17
|
sortOrder?: SortableTitlePlugin.SortOrder|null,
|
17
18
|
order?: SortableTitlePlugin.SortOrder|null
|
18
19
|
};
|
@@ -81,8 +81,9 @@ Ext.inherits(SortableTitlePlugin, EventDispatcher);
|
|
81
81
|
|
82
82
|
/** The sorting object which will be used for initialSort config.
|
83
83
|
* @typedef {Object} SortableTitlePlugin~InitialSort
|
84
|
-
* @property {number} colIndex Index of the column
|
85
|
-
* @property {string}
|
84
|
+
* @property {number=} colIndex Index of the column
|
85
|
+
* @property {string=} colId column id of the column
|
86
|
+
* @property {string=} field field of the column
|
86
87
|
* @property {SortableTitlePlugin~SortOrder=} sortOrder=null Set to "d" for descending order and "a" for ascending order
|
87
88
|
* @property {SortableTitlePlugin~SortOrder=} order Alias of sortOrder
|
88
89
|
*/
|
@@ -740,6 +741,7 @@ SortableTitlePlugin.prototype.getSortedColumns = function () {
|
|
740
741
|
var state = this._sortStates[i];
|
741
742
|
arr[i] = {
|
742
743
|
"colIndex": colIndex,
|
744
|
+
"colId": this._getColumnId(colIndex),
|
743
745
|
"field": state["field"] || "",
|
744
746
|
"sortOrder": state["sortOrder"] || "n"
|
745
747
|
};
|
@@ -781,7 +783,7 @@ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
|
|
781
783
|
var opt = sortOptions[i];
|
782
784
|
var colRef = opt["colIndex"];
|
783
785
|
if(colRef < 0 || colRef == null) {
|
784
|
-
colRef = opt["field"];
|
786
|
+
colRef = opt["colId"] || opt["field"];
|
785
787
|
}
|
786
788
|
var state = this._prepareSorting(
|
787
789
|
colRef,
|
@@ -1368,19 +1370,9 @@ SortableTitlePlugin.prototype._prepareSorting = function (colRef, sortOrder) {
|
|
1368
1370
|
return null;
|
1369
1371
|
}
|
1370
1372
|
|
1371
|
-
var colIndex =
|
1372
|
-
var
|
1373
|
-
var
|
1374
|
-
if(typeof colRef === "number") {
|
1375
|
-
colIndex = colRef;
|
1376
|
-
field = this.getColumnSortingField(colIndex);
|
1377
|
-
priority = this.getSortPriority(colIndex);
|
1378
|
-
} else if(typeof colRef === "string") {
|
1379
|
-
field = colRef;
|
1380
|
-
colIndex = this._getColumnIndexByField(field);
|
1381
|
-
var fields = this.getColumnSortingFields();
|
1382
|
-
priority = fields.indexOf(field);
|
1383
|
-
}
|
1373
|
+
var colIndex = this._getColumnIndex(colRef);
|
1374
|
+
var priority = this.getSortPriority(colIndex);
|
1375
|
+
var field = this.getColumnSortingField(colIndex);
|
1384
1376
|
|
1385
1377
|
var curState = (priority >= 0) ? this._sortStates[priority] : null;
|
1386
1378
|
var curOrder = curState ? curState["sortOrder"] : "n";
|
@@ -1764,21 +1756,29 @@ SortableTitlePlugin.prototype._getColumnIndexByOptions = function (sortOptions)
|
|
1764
1756
|
return -1;
|
1765
1757
|
};
|
1766
1758
|
/** @private
|
1767
|
-
* @param {string}
|
1759
|
+
* @param {string|number} colRef
|
1768
1760
|
* @return {number}
|
1769
1761
|
*/
|
1770
|
-
SortableTitlePlugin.prototype.
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
for (var c = 0; c < colCount; ++c) {
|
1775
|
-
if(field === this.getColumnSortingField(c)) {
|
1776
|
-
return c;
|
1777
|
-
}
|
1778
|
-
}
|
1762
|
+
SortableTitlePlugin.prototype._getColumnIndex = function (colRef) {
|
1763
|
+
var host = this._hosts[0];
|
1764
|
+
if(host && colRef != null) {
|
1765
|
+
return host.getColumnIndex(colRef);
|
1779
1766
|
}
|
1780
1767
|
return -1;
|
1781
1768
|
};
|
1769
|
+
|
1770
|
+
/** @private
|
1771
|
+
* @param {string|number} colRef
|
1772
|
+
* @return {string} column id or empty string for not found
|
1773
|
+
*/
|
1774
|
+
SortableTitlePlugin.prototype._getColumnId = function (colRef) {
|
1775
|
+
var host = this._hosts[0];
|
1776
|
+
if(host && colRef != null) {
|
1777
|
+
return host.getColumnId(colRef);
|
1778
|
+
}
|
1779
|
+
return "";
|
1780
|
+
};
|
1781
|
+
|
1782
1782
|
/** @private
|
1783
1783
|
* @param {number} colIndex
|
1784
1784
|
* @return {Object}
|
@@ -2,23 +2,46 @@
|
|
2
2
|
* @namespace
|
3
3
|
*/
|
4
4
|
var Util = {};
|
5
|
+
|
6
|
+
// TODO: move to tr-grid-util
|
7
|
+
|
5
8
|
/** @const
|
6
9
|
* @type {boolean}
|
7
10
|
*/
|
8
|
-
Util.isIE =
|
11
|
+
Util.isIE = (function () {
|
9
12
|
var ua = window.navigator.userAgent;
|
10
13
|
return (ua.indexOf('MSIE ') > 0) || (ua.indexOf('Trident/') > 0) || (ua.indexOf('Edge/') > 0);
|
11
14
|
}());
|
12
15
|
/** @const
|
13
16
|
* @type {boolean}
|
14
17
|
*/
|
15
|
-
Util.isTouchDevice =
|
18
|
+
Util.isTouchDevice = (function () {
|
16
19
|
if ((navigator["maxTouchPoints"] && navigator["maxTouchPoints"] < 256) ||
|
17
20
|
(navigator["msMaxTouchPoints"] && navigator["msMaxTouchPoints"] < 256)) {
|
18
21
|
return true;
|
19
22
|
}
|
20
23
|
return false;
|
21
24
|
}());
|
25
|
+
/** @const
|
26
|
+
* @type {boolean}
|
27
|
+
*/
|
28
|
+
Util.isSafari = (function () {
|
29
|
+
var rejectedExpression = /Chrome|Android|CriOS|FxiOS|EdgiOS/i;
|
30
|
+
var safariExpression = /Safari/i;
|
31
|
+
var agent = navigator.userAgent;
|
32
|
+
if (rejectedExpression.test(agent)) {
|
33
|
+
return false;
|
34
|
+
}
|
35
|
+
return safariExpression.test(agent);
|
36
|
+
}());
|
37
|
+
|
38
|
+
/** @public
|
39
|
+
* @type {boolean}
|
40
|
+
*/
|
41
|
+
Util.isMobile = (function () {
|
42
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
43
|
+
}());
|
44
|
+
|
22
45
|
/** Retrieve an element from Novakit control or any object that has "getElement" method.
|
23
46
|
* @public
|
24
47
|
* @ignore
|
@@ -364,12 +387,5 @@ Util._preventDefault = function (e) {
|
|
364
387
|
e.stopPropagation();
|
365
388
|
};
|
366
389
|
|
367
|
-
/** @public
|
368
|
-
* @type {boolean}
|
369
|
-
*/
|
370
|
-
Util.isMobile = Util.isMobile || (function () {
|
371
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
372
|
-
}());
|
373
|
-
|
374
390
|
export default Util;
|
375
391
|
export { Util };
|
package/lib/grid/index.js
CHANGED
@@ -4189,9 +4189,9 @@ DateTime.toDateObject = function(dateInput) {
|
|
4189
4189
|
*/
|
4190
4190
|
DateTime.toDateNumber = function(dateObj) {
|
4191
4191
|
return DateTime._millisecondToDateNumber(Date.UTC(
|
4192
|
-
dateObj.
|
4193
|
-
dateObj.
|
4194
|
-
dateObj.
|
4192
|
+
dateObj.getUTCFullYear(),
|
4193
|
+
dateObj.getUTCMonth(),
|
4194
|
+
dateObj.getUTCDate()
|
4195
4195
|
));
|
4196
4196
|
};
|
4197
4197
|
/** Convert the JavaScript date object to the time number in a range between 0 and 1. WARNING: This discards date and millisecond from the given date object.
|
@@ -7753,23 +7753,46 @@ Engine._proto = Engine.prototype;
|
|
7753
7753
|
* @namespace
|
7754
7754
|
*/
|
7755
7755
|
var util_Util = {};
|
7756
|
+
|
7757
|
+
// TODO: move to tr-grid-util
|
7758
|
+
|
7756
7759
|
/** @const
|
7757
7760
|
* @type {boolean}
|
7758
7761
|
*/
|
7759
|
-
util_Util.isIE =
|
7762
|
+
util_Util.isIE = (function () {
|
7760
7763
|
var ua = window.navigator.userAgent;
|
7761
7764
|
return (ua.indexOf('MSIE ') > 0) || (ua.indexOf('Trident/') > 0) || (ua.indexOf('Edge/') > 0);
|
7762
7765
|
}());
|
7763
7766
|
/** @const
|
7764
7767
|
* @type {boolean}
|
7765
7768
|
*/
|
7766
|
-
util_Util.isTouchDevice =
|
7769
|
+
util_Util.isTouchDevice = (function () {
|
7767
7770
|
if ((navigator["maxTouchPoints"] && navigator["maxTouchPoints"] < 256) ||
|
7768
7771
|
(navigator["msMaxTouchPoints"] && navigator["msMaxTouchPoints"] < 256)) {
|
7769
7772
|
return true;
|
7770
7773
|
}
|
7771
7774
|
return false;
|
7772
7775
|
}());
|
7776
|
+
/** @const
|
7777
|
+
* @type {boolean}
|
7778
|
+
*/
|
7779
|
+
util_Util.isSafari = (function () {
|
7780
|
+
var rejectedExpression = /Chrome|Android|CriOS|FxiOS|EdgiOS/i;
|
7781
|
+
var safariExpression = /Safari/i;
|
7782
|
+
var agent = navigator.userAgent;
|
7783
|
+
if (rejectedExpression.test(agent)) {
|
7784
|
+
return false;
|
7785
|
+
}
|
7786
|
+
return safariExpression.test(agent);
|
7787
|
+
}());
|
7788
|
+
|
7789
|
+
/** @public
|
7790
|
+
* @type {boolean}
|
7791
|
+
*/
|
7792
|
+
util_Util.isMobile = (function () {
|
7793
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
7794
|
+
}());
|
7795
|
+
|
7773
7796
|
/** Retrieve an element from Novakit control or any object that has "getElement" method.
|
7774
7797
|
* @public
|
7775
7798
|
* @ignore
|
@@ -8115,13 +8138,6 @@ util_Util._preventDefault = function (e) {
|
|
8115
8138
|
e.stopPropagation();
|
8116
8139
|
};
|
8117
8140
|
|
8118
|
-
/** @public
|
8119
|
-
* @type {boolean}
|
8120
|
-
*/
|
8121
|
-
util_Util.isMobile = util_Util.isMobile || (function () {
|
8122
|
-
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
8123
|
-
}());
|
8124
|
-
|
8125
8141
|
/* harmony default export */ var util = (util_Util);
|
8126
8142
|
|
8127
8143
|
|
@@ -35410,6 +35426,7 @@ var Core = function (opt_initializer) {
|
|
35410
35426
|
|
35411
35427
|
_t._onMouseMove = _t._onMouseMove.bind(_t);
|
35412
35428
|
_t._onRowHightlighted = _t._onRowHightlighted.bind(_t);
|
35429
|
+
_t._onGridClicked = _t._onGridClicked.bind(_t);
|
35413
35430
|
|
35414
35431
|
_t._onWindowResize = _t._onWindowResize.bind(_t);
|
35415
35432
|
_t._onSectionDataChanged = _t._onSectionDataChanged.bind(_t);
|
@@ -35495,11 +35512,16 @@ var Core = function (opt_initializer) {
|
|
35495
35512
|
_t._hscrollbar.setOtherScrollbar(_t._vscrollbar);
|
35496
35513
|
_t._vscrollbar.setOtherScrollbar(_t._hscrollbar);
|
35497
35514
|
|
35498
|
-
if (util.isMobile) {
|
35515
|
+
if (util.isMobile || util.isTouchDevice) {
|
35499
35516
|
_t._element.addEventListener("touchmove", this._onMouseMove, false);
|
35500
35517
|
} else {
|
35501
35518
|
_t._element.addEventListener("mousemove", this._onMouseMove, false);
|
35502
35519
|
}
|
35520
|
+
|
35521
|
+
if(util.isSafari){
|
35522
|
+
_t._element.addEventListener("click", this._onGridClicked);
|
35523
|
+
}
|
35524
|
+
|
35503
35525
|
window.addEventListener("resize", _t._onWindowResize, false); // Should be unlistened after destroyed
|
35504
35526
|
_t._rowVirtualizer.listen("indexChanged", _t._onRowInViewChanged);
|
35505
35527
|
_t._colVirtualizer.listen("indexChanged", _t._onColInViewChanged);
|
@@ -35884,7 +35906,7 @@ Core.prototype._batches = null;
|
|
35884
35906
|
* @return {string}
|
35885
35907
|
*/
|
35886
35908
|
Core.getVersion = function () {
|
35887
|
-
return "5.1.
|
35909
|
+
return "5.1.63";
|
35888
35910
|
};
|
35889
35911
|
/** {@link ElementWrapper#dispose}
|
35890
35912
|
* @override
|
@@ -39739,6 +39761,53 @@ Core.prototype.getColumnGroupChildIds = function (groupId) {
|
|
39739
39761
|
return null;
|
39740
39762
|
};
|
39741
39763
|
|
39764
|
+
/** @public
|
39765
|
+
* @description Get a list of objects with column id and column index in sorted order
|
39766
|
+
* @param {Array.<string>} colIds
|
39767
|
+
* @param {Object=} columnMap
|
39768
|
+
* @return {!Array.<string>} Return column array with corresponding order to UI
|
39769
|
+
* @example
|
39770
|
+
* core.getValidColumnList(["c1","c2","c5"]); // Get list of valid columns
|
39771
|
+
* core.getValidColumnList(["c1","c2","c5"],{ "c2":true, "c5":true }); // Get list of valid columns from specific mapping
|
39772
|
+
*/
|
39773
|
+
Core.prototype.getValidColumnList = function (colIds, columnMap) {
|
39774
|
+
var colList = [];
|
39775
|
+
if(!colIds){
|
39776
|
+
return colList;
|
39777
|
+
}
|
39778
|
+
if(!columnMap){
|
39779
|
+
columnMap = this.createColumnMap(colIds);
|
39780
|
+
}
|
39781
|
+
var colCount = this.getColumnCount();
|
39782
|
+
for(var c = 0; c < colCount; ++c) {
|
39783
|
+
var id = this._getColumnDef(c)["id"];
|
39784
|
+
if(columnMap[id] != null){
|
39785
|
+
colList.push({"index": c, "id": id});
|
39786
|
+
}
|
39787
|
+
}
|
39788
|
+
return colList;
|
39789
|
+
};
|
39790
|
+
|
39791
|
+
/** @public
|
39792
|
+
* @description Create mapping object from an array of strings
|
39793
|
+
* @param {Array.<string>=} colIds
|
39794
|
+
* @return {!Object} Column mapping object
|
39795
|
+
*/
|
39796
|
+
Core.prototype.createColumnMap = function (colIds) {
|
39797
|
+
if(!colIds){
|
39798
|
+
colIds = this.getColumnIds();
|
39799
|
+
}
|
39800
|
+
var mappingObj = {};
|
39801
|
+
var count = colIds.length;
|
39802
|
+
for(var i = 0; i < count; i++){
|
39803
|
+
var colId = colIds[i];
|
39804
|
+
if(colId){
|
39805
|
+
mappingObj[colId] = true;
|
39806
|
+
}
|
39807
|
+
}
|
39808
|
+
return mappingObj;
|
39809
|
+
};
|
39810
|
+
|
39742
39811
|
/** @public
|
39743
39812
|
* @param {string} batchType
|
39744
39813
|
* @return {boolean}
|
@@ -40578,6 +40647,18 @@ Core.prototype._onMouseMove = function () {
|
|
40578
40647
|
this._vscrollbar.flash();
|
40579
40648
|
this._hscrollbar.flash();
|
40580
40649
|
};
|
40650
|
+
/** @private */
|
40651
|
+
Core.prototype._onGridClicked = function () {
|
40652
|
+
// research for dragging
|
40653
|
+
var selection = window.getSelection();
|
40654
|
+
if(selection.toString()){
|
40655
|
+
return;
|
40656
|
+
}
|
40657
|
+
var activeElem = document.activeElement;
|
40658
|
+
if(!this._element.contains(activeElem)){
|
40659
|
+
this.focus();
|
40660
|
+
}
|
40661
|
+
};
|
40581
40662
|
|
40582
40663
|
/** @private
|
40583
40664
|
* @param {Object} e
|
@@ -42057,8 +42138,9 @@ es6_Ext.inherits(SortableTitlePlugin, event_EventDispatcher);
|
|
42057
42138
|
|
42058
42139
|
/** The sorting object which will be used for initialSort config.
|
42059
42140
|
* @typedef {Object} SortableTitlePlugin~InitialSort
|
42060
|
-
* @property {number} colIndex Index of the column
|
42061
|
-
* @property {string}
|
42141
|
+
* @property {number=} colIndex Index of the column
|
42142
|
+
* @property {string=} colId column id of the column
|
42143
|
+
* @property {string=} field field of the column
|
42062
42144
|
* @property {SortableTitlePlugin~SortOrder=} sortOrder=null Set to "d" for descending order and "a" for ascending order
|
42063
42145
|
* @property {SortableTitlePlugin~SortOrder=} order Alias of sortOrder
|
42064
42146
|
*/
|
@@ -42716,6 +42798,7 @@ SortableTitlePlugin.prototype.getSortedColumns = function () {
|
|
42716
42798
|
var state = this._sortStates[i];
|
42717
42799
|
arr[i] = {
|
42718
42800
|
"colIndex": colIndex,
|
42801
|
+
"colId": this._getColumnId(colIndex),
|
42719
42802
|
"field": state["field"] || "",
|
42720
42803
|
"sortOrder": state["sortOrder"] || "n"
|
42721
42804
|
};
|
@@ -42757,7 +42840,7 @@ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
|
|
42757
42840
|
var opt = sortOptions[i];
|
42758
42841
|
var colRef = opt["colIndex"];
|
42759
42842
|
if(colRef < 0 || colRef == null) {
|
42760
|
-
colRef = opt["field"];
|
42843
|
+
colRef = opt["colId"] || opt["field"];
|
42761
42844
|
}
|
42762
42845
|
var state = this._prepareSorting(
|
42763
42846
|
colRef,
|
@@ -43344,19 +43427,9 @@ SortableTitlePlugin.prototype._prepareSorting = function (colRef, sortOrder) {
|
|
43344
43427
|
return null;
|
43345
43428
|
}
|
43346
43429
|
|
43347
|
-
var colIndex =
|
43348
|
-
var
|
43349
|
-
var
|
43350
|
-
if(typeof colRef === "number") {
|
43351
|
-
colIndex = colRef;
|
43352
|
-
field = this.getColumnSortingField(colIndex);
|
43353
|
-
priority = this.getSortPriority(colIndex);
|
43354
|
-
} else if(typeof colRef === "string") {
|
43355
|
-
field = colRef;
|
43356
|
-
colIndex = this._getColumnIndexByField(field);
|
43357
|
-
var fields = this.getColumnSortingFields();
|
43358
|
-
priority = fields.indexOf(field);
|
43359
|
-
}
|
43430
|
+
var colIndex = this._getColumnIndex(colRef);
|
43431
|
+
var priority = this.getSortPriority(colIndex);
|
43432
|
+
var field = this.getColumnSortingField(colIndex);
|
43360
43433
|
|
43361
43434
|
var curState = (priority >= 0) ? this._sortStates[priority] : null;
|
43362
43435
|
var curOrder = curState ? curState["sortOrder"] : "n";
|
@@ -43740,21 +43813,29 @@ SortableTitlePlugin.prototype._getColumnIndexByOptions = function (sortOptions)
|
|
43740
43813
|
return -1;
|
43741
43814
|
};
|
43742
43815
|
/** @private
|
43743
|
-
* @param {string}
|
43816
|
+
* @param {string|number} colRef
|
43744
43817
|
* @return {number}
|
43745
43818
|
*/
|
43746
|
-
SortableTitlePlugin.prototype.
|
43747
|
-
|
43748
|
-
|
43749
|
-
|
43750
|
-
for (var c = 0; c < colCount; ++c) {
|
43751
|
-
if(field === this.getColumnSortingField(c)) {
|
43752
|
-
return c;
|
43753
|
-
}
|
43754
|
-
}
|
43819
|
+
SortableTitlePlugin.prototype._getColumnIndex = function (colRef) {
|
43820
|
+
var host = this._hosts[0];
|
43821
|
+
if(host && colRef != null) {
|
43822
|
+
return host.getColumnIndex(colRef);
|
43755
43823
|
}
|
43756
43824
|
return -1;
|
43757
43825
|
};
|
43826
|
+
|
43827
|
+
/** @private
|
43828
|
+
* @param {string|number} colRef
|
43829
|
+
* @return {string} column id or empty string for not found
|
43830
|
+
*/
|
43831
|
+
SortableTitlePlugin.prototype._getColumnId = function (colRef) {
|
43832
|
+
var host = this._hosts[0];
|
43833
|
+
if(host && colRef != null) {
|
43834
|
+
return host.getColumnId(colRef);
|
43835
|
+
}
|
43836
|
+
return "";
|
43837
|
+
};
|
43838
|
+
|
43758
43839
|
/** @private
|
43759
43840
|
* @param {number} colIndex
|
43760
43841
|
* @return {Object}
|
@@ -43966,21 +44047,17 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
|
43966
44047
|
* @description Fired after ADC data or response received from the server
|
43967
44048
|
* @property {Array.<Array>} data Data part of the server response
|
43968
44049
|
*/
|
43969
|
-
|
43970
44050
|
/** @event Grid#pageIndexChanged
|
43971
44051
|
* @description Fired after page index in the data view is changed during the active pagination mode
|
43972
44052
|
*/
|
43973
|
-
|
43974
44053
|
/** @event Grid#pageCountChanged
|
43975
44054
|
* @description Fired after page count in the data view is changed during the active pagination mode
|
43976
44055
|
*/
|
43977
|
-
|
43978
44056
|
/** @event Grid#dataComposed
|
43979
44057
|
* @description Trigger before dataChanged. Perform any data update during the event will NOT cause more dataChanged events
|
43980
44058
|
* @property {Grid} grid
|
43981
44059
|
* @property {RowDefinition} rowDef
|
43982
44060
|
*/
|
43983
|
-
|
43984
44061
|
/** @event Grid#beforeRowRemoved
|
43985
44062
|
* @description Fired only when a row will be removed through Grid's API and before occurring of the actual removal
|
43986
44063
|
*/
|
@@ -47747,6 +47824,7 @@ Grid.prototype._logData = function(rowDefs, options) {
|
|
47747
47824
|
|
47748
47825
|
console.table(tbl); // eslint-disable-line
|
47749
47826
|
};
|
47827
|
+
|
47750
47828
|
/** @public
|
47751
47829
|
* @description Replace existing row with a new row. Row ID would be changed, after row is replaced.
|
47752
47830
|
* @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position
|
@@ -47770,6 +47848,96 @@ Grid.prototype.replaceRow = function(rowRef, rowOption) {
|
|
47770
47848
|
}
|
47771
47849
|
};
|
47772
47850
|
|
47851
|
+
/** Scroll the view to the specified column. If the column is already in the view, nothing happens. If the column is outside of the view, the view will be moved to the column with some additional offsets
|
47852
|
+
* @public
|
47853
|
+
* @param {number} colIndex
|
47854
|
+
* @param {boolean=} leftOfView Default is false. If true, the specified column will be put at the leftmost of the view (no offset)
|
47855
|
+
* @returns {boolean} Return true, if there is any change
|
47856
|
+
*/
|
47857
|
+
Grid.prototype.scrollToColumn = function (colIndex, leftOfView) {
|
47858
|
+
return this._grid.scrollToColumn(colIndex, leftOfView);
|
47859
|
+
};
|
47860
|
+
/** Scroll the view to the specified row. If the row is already in the view, nothing happens. If the row is outside of the view, the view will be moved to the row with some additional offsets
|
47861
|
+
* @public
|
47862
|
+
* @param {number} rowIndex
|
47863
|
+
* @param {boolean=} topOfView=false If true, the specified row will be put at the top of the view (no offset)
|
47864
|
+
*/
|
47865
|
+
Grid.prototype.scrollToRow = function (rowIndex, topOfView) {
|
47866
|
+
this._grid.scrollToRow("content", rowIndex, topOfView);
|
47867
|
+
};
|
47868
|
+
|
47869
|
+
/** Get scroll value in pixel from the horizontal scrollbar
|
47870
|
+
* @public
|
47871
|
+
* @returns {number} pixels
|
47872
|
+
*/
|
47873
|
+
Grid.prototype.getScrollLeft = function () {
|
47874
|
+
return this._grid.getScrollLeft();
|
47875
|
+
};
|
47876
|
+
/** Get scroll value in pixel from the vertical scrollbar
|
47877
|
+
* @public
|
47878
|
+
* @returns {number} pixels
|
47879
|
+
*/
|
47880
|
+
Grid.prototype.getScrollTop = function () {
|
47881
|
+
return this._grid.getScrollTop();
|
47882
|
+
};
|
47883
|
+
|
47884
|
+
/** Set scroll value to the horizontal scrollbar. This will move the scrollbar to specific position
|
47885
|
+
* @public
|
47886
|
+
* @param {number} pixels
|
47887
|
+
* @see {@link Grid.scrollRight}
|
47888
|
+
*/
|
47889
|
+
Grid.prototype.setScrollLeft = function (pixels) {
|
47890
|
+
this._grid.setScrollLeft(pixels);
|
47891
|
+
};
|
47892
|
+
/** Set scroll value to the vertical scrollbar. This will move the scrollbar to specific position
|
47893
|
+
* @public
|
47894
|
+
* @param {number} pixels
|
47895
|
+
* @see {@link Grid.scrollDown}
|
47896
|
+
*/
|
47897
|
+
Grid.prototype.setScrollTop = function (pixels) {
|
47898
|
+
this._grid.setScrollTop(pixels);
|
47899
|
+
};
|
47900
|
+
|
47901
|
+
/** Scroll the view to the right by the specified value. Use negative value to scroll the view to the left
|
47902
|
+
* @public
|
47903
|
+
* @param {number} pixels
|
47904
|
+
* @see {@link Grid.setScrollLeft}
|
47905
|
+
*/
|
47906
|
+
Grid.prototype.scrollRight = function (pixels) {
|
47907
|
+
this._grid.scrollRight(pixels);
|
47908
|
+
};
|
47909
|
+
/** Scroll the view down by the specified value. Use negative value to scroll the view to the top
|
47910
|
+
* @public
|
47911
|
+
* @param {number} pixels
|
47912
|
+
* @see {@link Grid.setScrollTop}
|
47913
|
+
*/
|
47914
|
+
Grid.prototype.scrollDown = function (pixels) {
|
47915
|
+
this._grid.scrollDown(pixels);
|
47916
|
+
};
|
47917
|
+
|
47918
|
+
/** Get width of scrollable area from the horizontal scrollbar. This is useful for determining the end of scrollbar
|
47919
|
+
* @public
|
47920
|
+
* @returns {number}
|
47921
|
+
*/
|
47922
|
+
Grid.prototype.getScrollWidth = function () {
|
47923
|
+
return this._grid.getScrollWidth();
|
47924
|
+
};
|
47925
|
+
/** Get height of scrollable area from the vertical scrollbar. This is useful for determining the end of scrollbar
|
47926
|
+
* @public
|
47927
|
+
* @returns {number}
|
47928
|
+
*/
|
47929
|
+
Grid.prototype.getScrollHeight = function () {
|
47930
|
+
return this._grid.getScrollHeight();
|
47931
|
+
};
|
47932
|
+
|
47933
|
+
/** Get information about current grid's view and the vertical scrollbar
|
47934
|
+
* @public
|
47935
|
+
* @returns {Object} Returns null, if vertical scrollbar does not exists
|
47936
|
+
*/
|
47937
|
+
Grid.prototype.getVScrollView = function () {
|
47938
|
+
return this._grid.getVScrollView();
|
47939
|
+
};
|
47940
|
+
|
47773
47941
|
|
47774
47942
|
/* harmony default export */ var js_Grid = (Grid);
|
47775
47943
|
|