@refinitiv-ui/efx-grid 6.0.87 → 6.0.89
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/column-dragging/es6/ColumnDragging.js +55 -0
- package/lib/core/dist/core.js +2 -2
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.d.ts +0 -2
- package/lib/core/es6/grid/Core.js +2 -2
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +786 -706
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +68 -68
- package/lib/rt-grid/es6/DataConnector.js +26 -26
- package/lib/rt-grid/es6/FieldDefinition.js +27 -27
- package/lib/rt-grid/es6/Grid.js +390 -378
- package/lib/rt-grid/es6/PredefinedFormula.js +1 -1
- package/lib/rt-grid/es6/ReferenceCounter.js +15 -15
- package/lib/rt-grid/es6/RowDefSorter.js +26 -26
- package/lib/rt-grid/es6/RowDefinition.d.ts +5 -6
- package/lib/rt-grid/es6/RowDefinition.js +105 -76
- package/lib/rt-grid/es6/SnapshotFiller.js +77 -77
- package/lib/rt-grid/es6/StyleLoader.js +1 -1
- package/lib/statistics-row/es6/StatisticsRow.d.ts +1 -0
- package/lib/statistics-row/es6/StatisticsRow.js +18 -2
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +0 -4
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +2 -2
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +18 -18
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +7 -1
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +69 -18
- package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +0 -2
- package/lib/tr-grid-titlewrap/es6/TitleWrap.js +1 -1
- package/lib/tr-grid-util/es6/DragUI.js +2 -1
- package/lib/types/es6/PercentBar.d.ts +18 -18
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +5 -2
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/StatisticsRow.d.ts +1 -0
- package/lib/versions.json +10 -10
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/** @constructor
|
2
2
|
*/
|
3
|
-
|
3
|
+
let ReferenceCounter = function() {
|
4
4
|
this._counter = {};
|
5
5
|
this._session = {};
|
6
6
|
this._referers = {};
|
@@ -57,10 +57,10 @@ ReferenceCounter.prototype.getAllReferrers = ReferenceCounter.prototype.getAllRe
|
|
57
57
|
* @return {Object} Object with newEntries and removedEntries
|
58
58
|
*/
|
59
59
|
ReferenceCounter.prototype.getSession = function() {
|
60
|
-
|
61
|
-
|
62
|
-
for(
|
63
|
-
|
60
|
+
let newEntries = [];
|
61
|
+
let removedEntries = [];
|
62
|
+
for(let key in this._session) {
|
63
|
+
let val = this._session[key];
|
64
64
|
if(val > 0) {
|
65
65
|
newEntries.push(key);
|
66
66
|
} else if(val < 0) {
|
@@ -82,7 +82,7 @@ ReferenceCounter.prototype.getSession = function() {
|
|
82
82
|
ReferenceCounter.prototype.addReference = function(key, referer) {
|
83
83
|
if(key) {
|
84
84
|
if(referer) {
|
85
|
-
|
85
|
+
let counter = this._referers[referer];
|
86
86
|
if(counter) {
|
87
87
|
if(counter[key]) { // Single Referer can only add specific key only once
|
88
88
|
return false;
|
@@ -126,7 +126,7 @@ ReferenceCounter.prototype.removeReference = function(key, referer, count) {
|
|
126
126
|
if(!key) {
|
127
127
|
return false;
|
128
128
|
}
|
129
|
-
|
129
|
+
let val = this._counter[key];
|
130
130
|
if(!val) {
|
131
131
|
return false;
|
132
132
|
}
|
@@ -139,7 +139,7 @@ ReferenceCounter.prototype.removeReference = function(key, referer, count) {
|
|
139
139
|
}
|
140
140
|
|
141
141
|
if(referer) {
|
142
|
-
|
142
|
+
let counter = this._referers[referer];
|
143
143
|
if(!counter) {
|
144
144
|
return false;
|
145
145
|
}
|
@@ -179,10 +179,10 @@ ReferenceCounter.prototype.addReferences = function(keys, referer) {
|
|
179
179
|
if(!keys) {
|
180
180
|
return 0;
|
181
181
|
}
|
182
|
-
|
182
|
+
let count = 0;
|
183
183
|
if(Array.isArray(keys)) {
|
184
|
-
|
185
|
-
for(
|
184
|
+
let len = keys.length;
|
185
|
+
for(let i = 0; i < len; ++i) {
|
186
186
|
if(this.addReference(keys[i], referer)) {
|
187
187
|
++count;
|
188
188
|
}
|
@@ -192,7 +192,7 @@ ReferenceCounter.prototype.addReferences = function(keys, referer) {
|
|
192
192
|
++count;
|
193
193
|
}
|
194
194
|
} else {
|
195
|
-
for(
|
195
|
+
for(let key in keys) {
|
196
196
|
if(this.addReference(key, referer)) {
|
197
197
|
++count;
|
198
198
|
}
|
@@ -207,11 +207,11 @@ ReferenceCounter.prototype.addReferences = function(keys, referer) {
|
|
207
207
|
* @return {number} Number of removed entries
|
208
208
|
*/
|
209
209
|
ReferenceCounter.prototype.removeReferer = function(referer) {
|
210
|
-
|
210
|
+
let count = 0;
|
211
211
|
if(referer) {
|
212
|
-
|
212
|
+
let counter = this._referers[referer];
|
213
213
|
if(counter) {
|
214
|
-
for(
|
214
|
+
for(let key in counter) {
|
215
215
|
if(this.removeReference(key, referer)) {
|
216
216
|
++count;
|
217
217
|
}
|
@@ -6,7 +6,7 @@ import { cloneObject } from "../../tr-grid-util/es6/Util.js";
|
|
6
6
|
* @param {number} order
|
7
7
|
* @return {number}
|
8
8
|
*/
|
9
|
-
|
9
|
+
let _defaultCompare = function(a, b, order) {
|
10
10
|
if(a == null || a !== a) {
|
11
11
|
if(b == null || b !== b) {
|
12
12
|
return 0;
|
@@ -28,7 +28,7 @@ var _defaultCompare = function(a, b, order) {
|
|
28
28
|
|
29
29
|
/** @constructor
|
30
30
|
*/
|
31
|
-
|
31
|
+
let RowDefSorter = function() {
|
32
32
|
this._defaultSorter = this._defaultSorter.bind(this);
|
33
33
|
this._dataSorter = this._dataSorter.bind(this);
|
34
34
|
this._rowDefSorter = this._rowDefSorter.bind(this);
|
@@ -71,12 +71,12 @@ RowDefSorter.prototype.dispose = function() {
|
|
71
71
|
*/
|
72
72
|
RowDefSorter.prototype.getSorter = function() {
|
73
73
|
this._primaryParams = null;
|
74
|
-
|
74
|
+
let sortCount = this._sortParams.length;
|
75
75
|
if(sortCount === 1) {
|
76
|
-
|
77
|
-
|
76
|
+
let params = this._primaryParams = this._sortParams[0];
|
77
|
+
let sortLogic = params[1];
|
78
78
|
if(sortLogic) {
|
79
|
-
|
79
|
+
let rowSorting = params[3];
|
80
80
|
return rowSorting ? this._rowDefSorter : this._dataSorter;
|
81
81
|
} else {
|
82
82
|
return this._defaultSorter;
|
@@ -116,19 +116,19 @@ RowDefSorter.prototype.addColumnContext = function(field, logic, rowSorting, ord
|
|
116
116
|
if(!field) {
|
117
117
|
field = "";
|
118
118
|
}
|
119
|
-
|
120
|
-
|
119
|
+
let sortPriority = this._sortParams.length;
|
120
|
+
let ctx = this._ctxCaches[sortPriority];
|
121
121
|
if(!ctx) {
|
122
122
|
ctx = this._ctxCaches[sortPriority] = cloneObject(this._globalContext);
|
123
123
|
}
|
124
|
-
|
124
|
+
let orderNum = 0;
|
125
125
|
if(order === "a") {
|
126
126
|
orderNum = 1;
|
127
127
|
} else if(order === "d") {
|
128
128
|
orderNum = -1;
|
129
129
|
}
|
130
130
|
|
131
|
-
|
131
|
+
let params = [
|
132
132
|
field, // 0
|
133
133
|
(typeof logic === "function") ? logic : null, // 1
|
134
134
|
ctx, // 2
|
@@ -160,7 +160,7 @@ RowDefSorter._noSorting = function(rowDefA, rowDefB, order) {
|
|
160
160
|
* @return {number}
|
161
161
|
*/
|
162
162
|
RowDefSorter.prototype._defaultSorter = function(rowDefA, rowDefB, order) {
|
163
|
-
|
163
|
+
let field = this._primaryParams[0];
|
164
164
|
return _defaultCompare(
|
165
165
|
rowDefA.getData(field),
|
166
166
|
rowDefB.getData(field),
|
@@ -174,9 +174,9 @@ RowDefSorter.prototype._defaultSorter = function(rowDefA, rowDefB, order) {
|
|
174
174
|
* @return {number}
|
175
175
|
*/
|
176
176
|
RowDefSorter.prototype._dataSorter = function(rowDefA, rowDefB, order) {
|
177
|
-
|
178
|
-
|
179
|
-
|
177
|
+
let params = this._primaryParams;
|
178
|
+
let field = params[0];
|
179
|
+
let sortLogic = params[1];
|
180
180
|
return sortLogic(
|
181
181
|
rowDefA.getData(field),
|
182
182
|
rowDefB.getData(field),
|
@@ -191,8 +191,8 @@ RowDefSorter.prototype._dataSorter = function(rowDefA, rowDefB, order) {
|
|
191
191
|
* @return {number}
|
192
192
|
*/
|
193
193
|
RowDefSorter.prototype._rowDefSorter = function(rowDefA, rowDefB, order) {
|
194
|
-
|
195
|
-
|
194
|
+
let params = this._primaryParams;
|
195
|
+
let sortLogic = params[1];
|
196
196
|
return sortLogic(rowDefA, rowDefB, order, params[2]);
|
197
197
|
};
|
198
198
|
/** @private
|
@@ -202,16 +202,16 @@ RowDefSorter.prototype._rowDefSorter = function(rowDefA, rowDefB, order) {
|
|
202
202
|
* @return {number}
|
203
203
|
*/
|
204
204
|
RowDefSorter.prototype._multiColumnsSorter = function(rowDefA, rowDefB, primaryOrder) {
|
205
|
-
|
206
|
-
|
207
|
-
for(
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
205
|
+
let sortParams = this._sortParams;
|
206
|
+
let sortCount = sortParams.length;
|
207
|
+
for(let i = 0; i < sortCount; ++i) {
|
208
|
+
let params = sortParams[i];
|
209
|
+
let field = params[0];
|
210
|
+
let sortLogic = params[1];
|
211
|
+
let ctx = params[2];
|
212
|
+
let rowSorting = params[3];
|
213
|
+
let orderNum = params[4];
|
214
|
+
let ret = 0;
|
215
215
|
if(sortLogic) {
|
216
216
|
if(rowSorting) {
|
217
217
|
ret = sortLogic(rowDefA, rowDefB, orderNum, ctx);
|
@@ -14,7 +14,8 @@ declare namespace RowDefinition {
|
|
14
14
|
collapsed?: boolean|null,
|
15
15
|
label?: (string|null)|null,
|
16
16
|
hidden?: boolean|null,
|
17
|
-
realTime?: boolean|null
|
17
|
+
realTime?: boolean|null,
|
18
|
+
info?: any
|
18
19
|
};
|
19
20
|
|
20
21
|
type RowTypes = {
|
@@ -56,8 +57,6 @@ declare class RowDefinition {
|
|
56
57
|
|
57
58
|
public setStaticRowData(data: { [key: string]: any }|any[], opt_fields?: (string)[]|null): void;
|
58
59
|
|
59
|
-
public _getStaticRowData(): { [key: string]: any };
|
60
|
-
|
61
60
|
public updateRowData(data: { [key: string]: any }|any[], opt_fields?: (string)[]|null): void;
|
62
61
|
|
63
62
|
public setStaticData(field: string, value: any): void;
|
@@ -108,8 +107,6 @@ declare class RowDefinition {
|
|
108
107
|
|
109
108
|
public static deregisterFromView(rowIds: (string)[]|null, rowDef: RowDefinition|null): (string)[]|null;
|
110
109
|
|
111
|
-
public _toRealTimeRow(): void;
|
112
|
-
|
113
110
|
public unlinkChain(): void;
|
114
111
|
|
115
112
|
public collapseChain(): boolean;
|
@@ -130,7 +127,9 @@ declare class RowDefinition {
|
|
130
127
|
|
131
128
|
public getDepthLevel(): number;
|
132
129
|
|
133
|
-
public
|
130
|
+
public setRowInfo(obj: any): void;
|
131
|
+
|
132
|
+
public getRowInfo(): any;
|
134
133
|
|
135
134
|
public static toRowId(rowDef: RowDefinition|null): string;
|
136
135
|
|