@refinitiv-ui/efx-grid 6.0.39 → 6.0.40
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +15 -3
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +10 -1
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +5 -2
- package/lib/grid/index.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.js +4 -4
- package/lib/rt-grid/dist/rt-grid.js +168 -87
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +1 -0
- package/lib/rt-grid/es6/ColumnDefinition.js +7 -8
- package/lib/rt-grid/es6/Grid.d.ts +2 -0
- package/lib/rt-grid/es6/Grid.js +43 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +3 -4
- package/lib/rt-grid/es6/RowDefinition.js +72 -40
- package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +27 -27
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +97 -93
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +3 -3
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
- package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +5 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +30 -12
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +2 -1
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +50 -18
- package/lib/types/es6/ContextMenu.d.ts +27 -27
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -0
- package/lib/types/es6/MenuEventAPI.d.ts +3 -3
- package/lib/types/es6/MenuItem.d.ts +2 -2
- package/lib/types/es6/PopupMenu.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +1 -0
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +3 -4
- package/lib/versions.json +8 -8
- package/package.json +1 -1
@@ -30,7 +30,8 @@ import Engine from "../../tr-grid-util/es6/formula/Engine.js";
|
|
30
30
|
* @property {ColumnDefinition~SortLogic=} sorter=null Alias to `sortLogic`
|
31
31
|
* @property {boolean=} rowSorting=null If set to true, RowDefinition object will be used for sorting comparison. If set to false, data from the given `field` will be used for sorting comparison.
|
32
32
|
* @property {boolean=} sortable=true If disabled, the column cannot be sorted by user click
|
33
|
-
* @property {string=} sort=""
|
33
|
+
* @property {string=} sort="" Deprecated Alias to `sortOrder`
|
34
|
+
* @property {string=} sortOrder="" The column can be sorted in ascending and descending order by specifying the order "a", "d". This option will sort the column when it is initialized or inserted at runtime.
|
34
35
|
* @property {Object=} styles=null Key/value pair Object specifying CSS styles
|
35
36
|
* @property {number=} width=NaN If specified, column will have a fixed width in pixel
|
36
37
|
* @property {number=} minWidth=NaN If specified, column will have a minimum width in pixel
|
@@ -408,7 +409,7 @@ ColumnDefinition.prototype.initialize = function(columnOption) {
|
|
408
409
|
}
|
409
410
|
|
410
411
|
// Deprecate
|
411
|
-
val = columnOption["sort"];
|
412
|
+
val = columnOption["sortOrder"] || columnOption["sort"];
|
412
413
|
if(val) {
|
413
414
|
this._initialOrder = val;
|
414
415
|
}
|
@@ -658,11 +659,13 @@ ColumnDefinition.prototype.isScalable = function() {
|
|
658
659
|
var colIndex = grid.getColumnIndex(this);
|
659
660
|
return core.getColumnScalability(colIndex);
|
660
661
|
};
|
661
|
-
/**
|
662
|
-
|
662
|
+
/** Deprecated, this function will be return initial sort order of this column, The current sort state may be different from initial sort state.
|
663
|
+
* @public
|
664
|
+
* @deprecated
|
663
665
|
* @return {string}
|
664
666
|
*/
|
665
667
|
ColumnDefinition.prototype.getInitialSortOrder = function() {
|
668
|
+
// WARNING: This state is different from `sortOrder`, it is the state when grid is initialized.
|
666
669
|
return this._initialOrder;
|
667
670
|
};
|
668
671
|
/** @public
|
@@ -766,10 +769,6 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) {
|
|
766
769
|
obj["sortable"] = false;
|
767
770
|
}
|
768
771
|
|
769
|
-
if(this._initialOrder) {
|
770
|
-
obj["sort"] = this._initialOrder;
|
771
|
-
}
|
772
|
-
|
773
772
|
var classes = this._classes;
|
774
773
|
if(classes && classes.length > 0) {
|
775
774
|
obj["className"] = classes.join(" ");
|
package/lib/rt-grid/es6/Grid.js
CHANGED
@@ -1528,6 +1528,9 @@ Grid.prototype.replaceColumn = function (columnOption, colRef) {
|
|
1528
1528
|
colConfig["hidden"] = false;
|
1529
1529
|
}
|
1530
1530
|
|
1531
|
+
if(colConfig.id == null) {
|
1532
|
+
colConfig.id = colDef.getId(); // retain ID
|
1533
|
+
}
|
1531
1534
|
this._grid.startBatch("reset");
|
1532
1535
|
this.insertColumn(colConfig, colIndex);
|
1533
1536
|
this.removeColumn(colIndex + 1); // remove existing column after insert
|
@@ -1678,12 +1681,6 @@ Grid.prototype.restoreColumns = function(columns) {
|
|
1678
1681
|
}
|
1679
1682
|
}
|
1680
1683
|
|
1681
|
-
var sortingStates;
|
1682
|
-
var removeLen = removingFields.length;
|
1683
|
-
if(removeLen > 0 && this._stp) {
|
1684
|
-
sortingStates = this._stp.getSortingStates().slice(); // We need to clone array for avoid object reference in remove column
|
1685
|
-
}
|
1686
|
-
|
1687
1684
|
this.removeColumns(removingFields);
|
1688
1685
|
|
1689
1686
|
var keepingLen = keepingColumns.length;
|
@@ -1711,10 +1708,6 @@ Grid.prototype.restoreColumns = function(columns) {
|
|
1711
1708
|
this._grid.freezeLayout(prevState);
|
1712
1709
|
}
|
1713
1710
|
|
1714
|
-
if(removeLen > 0 && this._stp) {
|
1715
|
-
this._stp.sortColumns(sortingStates);
|
1716
|
-
}
|
1717
|
-
|
1718
1711
|
grid.reorderColumns(columnOrdering);
|
1719
1712
|
grid.stopBatch("reset");
|
1720
1713
|
};
|
@@ -2601,37 +2594,35 @@ Grid.prototype.hasHiddenRow = function(){
|
|
2601
2594
|
/** Set RIC to the specified row
|
2602
2595
|
* @public
|
2603
2596
|
* @param {Grid~RowReference} rowRef
|
2604
|
-
* @param {string} str
|
2597
|
+
* @param {string} str RIC to be set to a row
|
2605
2598
|
* @param {RowDefinition~Options=} options
|
2606
2599
|
*/
|
2607
2600
|
Grid.prototype.setRic = function(rowRef, str, options) {
|
2608
2601
|
if(this._mainGrid) {
|
2609
|
-
this._mainGrid.setRic(this._toRowId(rowRef), str);
|
2602
|
+
this._mainGrid.setRic(this._toRowId(rowRef), str, options);
|
2610
2603
|
return;
|
2611
2604
|
}
|
2612
2605
|
var rowDef = this._getRowDefinitionByRef(rowRef);
|
2613
2606
|
if(rowDef) {
|
2614
2607
|
options = options || {};
|
2615
|
-
|
2616
|
-
|
2617
|
-
|
2608
|
+
options["ric"] = str;
|
2609
|
+
var extractedOptions = RowDefinition.extractRowOptions(options);
|
2610
|
+
var oldRic = rowDef.getSymbol();
|
2611
|
+
var permId = options["permId"];
|
2612
|
+
var expanded = null;
|
2613
|
+
var collapsed = options["collapsed"];
|
2614
|
+
if(collapsed != null){
|
2615
|
+
expanded = !extractedOptions["collapsed"];
|
2616
|
+
}
|
2617
|
+
if(rowDef.setContent(str, permId, extractedOptions["asChain"], expanded)) { // The given string may not be a RIC
|
2618
|
+
this._connector.removeRic(rowDef, oldRic);
|
2619
|
+
this._initDuplicateRicData(rowDef);
|
2620
|
+
this._connector.addRic(rowDef);
|
2618
2621
|
}
|
2619
|
-
if(rowDef.isChain() || newChain) {
|
2620
|
-
if(rowDef.getRic() !== str.replace("0#", "")) {
|
2621
|
-
var rowIndex = this._dv.getRowIndex(rowDef.getRowId());
|
2622
|
-
this.removeRow(rowDef);
|
2623
2622
|
|
2624
|
-
|
2625
|
-
|
2626
|
-
|
2627
|
-
} else {
|
2628
|
-
var oldRic = rowDef.getSymbol();
|
2629
|
-
var permId = options["permId"] || "";
|
2630
|
-
if(rowDef.setContent(str, permId)) { // The given string may not be a RIC
|
2631
|
-
this._connector.removeRic(rowDef, oldRic);
|
2632
|
-
this._initDuplicateRicData(rowDef);
|
2633
|
-
this._connector.addRic(rowDef);
|
2634
|
-
}
|
2623
|
+
var values = options["values"];
|
2624
|
+
if(values != null) {
|
2625
|
+
rowDef.setStaticRowData(values, options["fields"]);
|
2635
2626
|
}
|
2636
2627
|
}
|
2637
2628
|
};
|
@@ -3882,6 +3873,28 @@ Grid.prototype._logData = function(rowDefs, options) {
|
|
3882
3873
|
|
3883
3874
|
console.table(tbl); // eslint-disable-line
|
3884
3875
|
};
|
3876
|
+
/** @public
|
3877
|
+
* @description Replace existing row with a new row. Row ID would be changed, after row is replaced.
|
3878
|
+
* @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position
|
3879
|
+
* @param {Object=} rowOption
|
3880
|
+
* @returns {Object}
|
3881
|
+
*/
|
3882
|
+
Grid.prototype.replaceRow = function(rowRef, rowOption) {
|
3883
|
+
var rowId = this._getRowId(rowRef);
|
3884
|
+
var rowDef = this._getRowDefinitionByRef(rowRef);
|
3885
|
+
if(rowDef.isAutoGenerated()) { // Users cannot replace auto-generated
|
3886
|
+
return null;
|
3887
|
+
}
|
3888
|
+
var configObj = rowDef.getConfigObject();
|
3889
|
+
|
3890
|
+
if(deepEqual(configObj, rowOption)){
|
3891
|
+
return null;
|
3892
|
+
} else {
|
3893
|
+
var insertedRow = this.insertRow(rowOption, rowId);
|
3894
|
+
this.removeRow(rowId);
|
3895
|
+
return insertedRow;
|
3896
|
+
}
|
3897
|
+
};
|
3885
3898
|
|
3886
3899
|
export { Grid };
|
3887
3900
|
export default Grid;
|
@@ -13,7 +13,8 @@ declare namespace RowDefinition {
|
|
13
13
|
chainRic?: string|null,
|
14
14
|
collapsed?: boolean|null,
|
15
15
|
label?: (string|null)|null,
|
16
|
-
hidden?: boolean|null
|
16
|
+
hidden?: boolean|null,
|
17
|
+
realTime?: boolean|null
|
17
18
|
};
|
18
19
|
|
19
20
|
type RowTypes = {
|
@@ -37,8 +38,6 @@ declare class RowDefinition {
|
|
37
38
|
|
38
39
|
public initialize(rowOptions?: RowDefinition.Options|null): void;
|
39
40
|
|
40
|
-
public setContent(userInput: string, permId?: string|null, asChain?: boolean|null, expanded?: boolean|null, realTime?: boolean|null): boolean;
|
41
|
-
|
42
41
|
public getRowId(): string;
|
43
42
|
|
44
43
|
public getConfigObject(rowOptions?: RowDefinition.Options|null): RowDefinition.Options|null;
|
@@ -143,7 +142,7 @@ declare const ROW_DEF: string;
|
|
143
142
|
|
144
143
|
declare const ROW_TYPES: RowDefinition.RowTypes;
|
145
144
|
|
146
|
-
declare function rowData(userInput: string, permId?: string|null, asChain?: boolean|null, expanded?: boolean|null
|
145
|
+
declare function rowData(userInput: string, permId?: string|null, asChain?: boolean|null, expanded?: boolean|null): boolean;
|
147
146
|
|
148
147
|
export {RowDefinition, ROW_DEF, ROW_TYPES};
|
149
148
|
export default RowDefinition;
|
@@ -15,7 +15,7 @@ import { DataTable } from "../../core/es6/data/DataTable.js";
|
|
15
15
|
* @property {boolean=} collapsed=true Chain is collapsed by default
|
16
16
|
* @property {(string|null)=} label=null
|
17
17
|
* @property {boolean=} hidden=true When this row is hidden
|
18
|
-
* @
|
18
|
+
* @property {boolean=} realTime=true Realtime row, able to request for JET/RTK
|
19
19
|
*/
|
20
20
|
|
21
21
|
/** @typedef {Object} RowDefinition~RowTypes
|
@@ -217,6 +217,8 @@ RowDefinition.prototype.initialize = function(rowOptions) {
|
|
217
217
|
return;
|
218
218
|
}
|
219
219
|
|
220
|
+
var extractedOptions = RowDefinition.extractRowOptions(rowOptions);
|
221
|
+
|
220
222
|
var val = rowOptions["permId"];
|
221
223
|
if(val != null) {
|
222
224
|
this._permId = val;
|
@@ -234,13 +236,8 @@ RowDefinition.prototype.initialize = function(rowOptions) {
|
|
234
236
|
if(val != null) {
|
235
237
|
this._chainRic = val;
|
236
238
|
}
|
237
|
-
val = rowOptions["values"];
|
238
|
-
// eslint-disable-next-line no-undefined
|
239
|
-
if(val !== undefined) {
|
240
|
-
this.setStaticRowData(val, rowOptions["fields"]);
|
241
|
-
}
|
242
239
|
|
243
|
-
val =
|
240
|
+
val = extractedOptions["asChain"];
|
244
241
|
if(val !== null) {
|
245
242
|
this._isChain = val;
|
246
243
|
}
|
@@ -252,28 +249,22 @@ RowDefinition.prototype.initialize = function(rowOptions) {
|
|
252
249
|
|
253
250
|
val = rowOptions["collapsed"];
|
254
251
|
if(val != null){
|
255
|
-
this._expanded =
|
252
|
+
this._expanded = extractedOptions["collapsed"];
|
256
253
|
}
|
257
254
|
val = rowOptions["keepModel"];
|
258
255
|
if(val) {
|
259
256
|
this._userModel = rowOptions;
|
260
257
|
}
|
261
258
|
|
262
|
-
var expanded = this._expanded;
|
263
259
|
var symbol = this._ric || this._chainRic;
|
264
|
-
var asChain = this._isChain || !!this._chainRic;
|
265
|
-
if(this._ric && this._ric.indexOf("0#") >= 0){
|
266
|
-
asChain = true;
|
267
|
-
expanded = true;
|
268
|
-
}
|
269
|
-
if(this._isChain === false){
|
270
|
-
asChain = false;
|
271
|
-
}
|
272
|
-
if(this._expanded === false){
|
273
|
-
expanded = false;
|
274
|
-
}
|
275
260
|
if(symbol || this._permId){
|
276
|
-
this.setContent(symbol, this._permId,
|
261
|
+
this.setContent(symbol, this._permId, this._isChain, this._expanded); // this._dataId is modified
|
262
|
+
}
|
263
|
+
|
264
|
+
val = rowOptions["values"];
|
265
|
+
// eslint-disable-next-line no-undefined
|
266
|
+
if(val !== undefined) {
|
267
|
+
this.setStaticRowData(val, rowOptions["fields"]);
|
277
268
|
}
|
278
269
|
};
|
279
270
|
/** @private
|
@@ -300,11 +291,11 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) {
|
|
300
291
|
}
|
301
292
|
};
|
302
293
|
/** @public
|
294
|
+
* @ignore
|
303
295
|
* @param {string} userInput RIC
|
304
296
|
* @param {string=} permId=null Organization PermId, which use for getting ADC data for private company
|
305
297
|
* @param {boolean=} asChain
|
306
298
|
* @param {boolean=} expanded
|
307
|
-
* @param {boolean=} realTime
|
308
299
|
* @return {boolean} True if there is any change otherwise false
|
309
300
|
*/
|
310
301
|
RowDefinition.prototype.setContent = function(userInput, permId, asChain, expanded) {
|
@@ -327,33 +318,40 @@ RowDefinition.prototype.setContent = function(userInput, permId, asChain, expand
|
|
327
318
|
return false;
|
328
319
|
}
|
329
320
|
|
330
|
-
this.unsubscribeForUpdates()
|
321
|
+
if(!this.unsubscribeForUpdates()){
|
322
|
+
this._clearStaticData();
|
323
|
+
}
|
331
324
|
this.resetUpdates(); // Remove all previous data updates because a new content is just entered
|
332
325
|
|
333
|
-
// TODO: handle changing between chain and ric row
|
334
326
|
this._userInput = userInput;
|
335
327
|
if(this._userInput.charAt(0) === "'") { // This is a row header
|
336
328
|
this._ric = this._chainRic = ""; // No ric for realtime request
|
337
329
|
} else {
|
338
|
-
if(
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
this._expanded = expanded;
|
344
|
-
this._isChain = true; // Only chain can be expanded by 0#
|
345
|
-
this._chainRic = this._userInput;
|
346
|
-
if(this._view) {
|
347
|
-
this._view.setSegmentSeparator(this._rowId);
|
348
|
-
this.expandChain();
|
349
|
-
}
|
350
|
-
}
|
330
|
+
if(asChain === true){
|
331
|
+
this._ric = expanded === false ? this._userInput : this._userInput.replace("0#", "");
|
332
|
+
this._expanded = expanded;
|
333
|
+
this._isChain = true; // Only chain can be expanded by 0#
|
334
|
+
this._chainRic = this._userInput;
|
351
335
|
} else {
|
352
336
|
this._ric = this._userInput;
|
353
|
-
|
354
|
-
|
337
|
+
this._isChain = asChain;
|
338
|
+
}
|
339
|
+
}
|
340
|
+
|
341
|
+
if(this._view) {
|
342
|
+
if(this._isChain){
|
343
|
+
var rid = this.getRowId();
|
344
|
+
var segmentId = this._view.getSegmentParentRowId(rid);
|
345
|
+
if(segmentId){
|
346
|
+
this._view.removeSegmentChild(segmentId, rid);
|
355
347
|
}
|
356
348
|
}
|
349
|
+
this._view.setSegmentSeparator(this._rowId, !!this._isChain);
|
350
|
+
if(this._expanded && this.isChainCollapsed()){
|
351
|
+
this.expandChain();
|
352
|
+
} else if (!this._expanded && this.isChainExpanded()){
|
353
|
+
this.collapseChain();
|
354
|
+
}
|
357
355
|
}
|
358
356
|
|
359
357
|
this._dataId = this._rowId + this.getSymbol(); // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
|
@@ -798,7 +796,7 @@ RowDefinition.prototype.unsubscribeForUpdates = function() {
|
|
798
796
|
this.resetUpdates();
|
799
797
|
// TODO: Reset only if this is the last ric
|
800
798
|
this._dc.setRowData(this._dataId, null); // Trigger data update immediately
|
801
|
-
|
799
|
+
this._clearStaticData();
|
802
800
|
// eslint-disable-next-line consistent-return
|
803
801
|
return prevRowData;
|
804
802
|
};
|
@@ -1210,6 +1208,40 @@ RowDefinition.prototype.getUserModel = function() {
|
|
1210
1208
|
RowDefinition.toRowId = function(rowDef) {
|
1211
1209
|
return rowDef.getRowId();
|
1212
1210
|
};
|
1211
|
+
/** For transforming row options into standard format
|
1212
|
+
* @public
|
1213
|
+
* @ignore
|
1214
|
+
* @function
|
1215
|
+
* @param {RowDefinition~Options} rowOptions
|
1216
|
+
* @return {RowDefinition~Options}
|
1217
|
+
*/
|
1218
|
+
RowDefinition.extractRowOptions = function(rowOptions) {
|
1219
|
+
var ric = rowOptions["ric"];
|
1220
|
+
var chainRic = rowOptions["chainRic"];
|
1221
|
+
var collapsed = rowOptions["collapsed"];
|
1222
|
+
var asChain = rowOptions["asChain"];
|
1223
|
+
if(asChain == null && chainRic){
|
1224
|
+
asChain = true;
|
1225
|
+
}
|
1226
|
+
var expanded = null;
|
1227
|
+
if(ric && ric.indexOf("0#") >= 0){
|
1228
|
+
if(asChain == null){
|
1229
|
+
asChain = true;
|
1230
|
+
}
|
1231
|
+
expanded = true;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
var extractedOptions = {};
|
1235
|
+
if(collapsed == null) {
|
1236
|
+
extractedOptions["collapsed"] = !expanded;
|
1237
|
+
} else {
|
1238
|
+
extractedOptions["collapsed"] = collapsed;
|
1239
|
+
}
|
1240
|
+
extractedOptions["ric"] = ric;
|
1241
|
+
extractedOptions["chainRic"] = chainRic;
|
1242
|
+
extractedOptions["asChain"] = asChain;
|
1243
|
+
return extractedOptions;
|
1244
|
+
};
|
1213
1245
|
/** For mapping row Id by Array.map()
|
1214
1246
|
* @public
|
1215
1247
|
* @function
|
@@ -8,39 +8,39 @@ import CellPainter from "../../tr-grid-util/es6/CellPainter.js";
|
|
8
8
|
|
9
9
|
declare namespace ContextMenuPlugin {
|
10
10
|
|
11
|
-
type MenuItemEventCallback = (e: ContextMenuPlugin.MenuItemEvent) => void;
|
11
|
+
type MenuItemEventCallback = (e: ContextMenuPlugin.MenuItemEvent|null) => void;
|
12
12
|
|
13
|
-
type OnMenuEventCallback = (e: ContextMenuPlugin.OnMenuEvent) => void;
|
13
|
+
type OnMenuEventCallback = (e: ContextMenuPlugin.OnMenuEvent|null) => void;
|
14
14
|
|
15
|
-
type Context = "header" | "content" | "footer" | "filterRow";
|
15
|
+
type Context = "header" | "content" | "footer" | "filterRow"|null;
|
16
16
|
|
17
17
|
type Options = {
|
18
|
-
items: { [key: string]: ContextMenuPlugin.MenuItem },
|
19
|
-
onMenu?: ContextMenuPlugin.OnMenuEventCallback,
|
20
|
-
contextmenu?: ((...params: any[]) => any)
|
18
|
+
items: { [key: string]: ContextMenuPlugin.MenuItem }|null,
|
19
|
+
onMenu?: ContextMenuPlugin.OnMenuEventCallback|null,
|
20
|
+
contextmenu?: ((...params: any[]) => any)|null
|
21
21
|
};
|
22
22
|
|
23
23
|
type MenuItem = {
|
24
|
-
text?: string,
|
25
|
-
value?: (string|number),
|
26
|
-
isDisabled?: boolean,
|
27
|
-
isVisible?: boolean,
|
28
|
-
isSeparator?: boolean,
|
29
|
-
items?: (ContextMenuPlugin.MenuItem)[],
|
30
|
-
renderer?: ((...params: any[]) => any),
|
31
|
-
callback?: ContextMenuPlugin.MenuItemEventCallback
|
24
|
+
text?: string|null,
|
25
|
+
value?: (string|number)|null,
|
26
|
+
isDisabled?: boolean|null,
|
27
|
+
isVisible?: boolean|null,
|
28
|
+
isSeparator?: boolean|null,
|
29
|
+
items?: (ContextMenuPlugin.MenuItem)[]|null,
|
30
|
+
renderer?: ((...params: any[]) => any)|null,
|
31
|
+
callback?: ContextMenuPlugin.MenuItemEventCallback|null
|
32
32
|
};
|
33
33
|
|
34
34
|
type MenuItemEvent = {
|
35
35
|
altKey: boolean,
|
36
36
|
cell: any,
|
37
37
|
colIndex: number,
|
38
|
-
columnDef: object,
|
39
|
-
context: ContextMenuPlugin.Context,
|
38
|
+
columnDef: object|null,
|
39
|
+
context: ContextMenuPlugin.Context|null,
|
40
40
|
ctrlKey: boolean,
|
41
|
-
item: ContextMenuPlugin.MenuItem,
|
42
|
-
items: { [key: string]: ContextMenuPlugin.MenuItem },
|
43
|
-
menu: MenuEventAPI,
|
41
|
+
item: ContextMenuPlugin.MenuItem|null,
|
42
|
+
items: { [key: string]: ContextMenuPlugin.MenuItem }|null,
|
43
|
+
menu: MenuEventAPI|null,
|
44
44
|
rowIndex: number,
|
45
45
|
section: any,
|
46
46
|
shiftKey: boolean
|
@@ -49,21 +49,21 @@ declare namespace ContextMenuPlugin {
|
|
49
49
|
type OnMenuEvent = {
|
50
50
|
cell: any,
|
51
51
|
colIndex: number,
|
52
|
-
columnDef: object,
|
53
|
-
context: ContextMenuPlugin.Context,
|
54
|
-
items: object,
|
55
|
-
menu: MenuEventAPI,
|
52
|
+
columnDef: object|null,
|
53
|
+
context: ContextMenuPlugin.Context|null,
|
54
|
+
items: object|null,
|
55
|
+
menu: MenuEventAPI|null,
|
56
56
|
rowIndex: number,
|
57
57
|
section: any,
|
58
|
-
selectedColumns: (number)[],
|
59
|
-
selectedRows: (number)[]
|
58
|
+
selectedColumns: (number)[]|null,
|
59
|
+
selectedRows: (number)[]|null
|
60
60
|
};
|
61
61
|
|
62
62
|
}
|
63
63
|
|
64
64
|
declare class ContextMenuPlugin extends GridPlugin {
|
65
65
|
|
66
|
-
constructor(options?: (ContextMenuPlugin.Options|ContextMenuPlugin.OnMenuEvent));
|
66
|
+
constructor(options?: (ContextMenuPlugin.Options|ContextMenuPlugin.OnMenuEvent)|null);
|
67
67
|
|
68
68
|
public getName(): string;
|
69
69
|
|
@@ -71,7 +71,7 @@ declare class ContextMenuPlugin extends GridPlugin {
|
|
71
71
|
|
72
72
|
public unload(host: any): void;
|
73
73
|
|
74
|
-
public config(options?: ContextMenuPlugin.Options): void;
|
74
|
+
public config(options?: ContextMenuPlugin.Options|null): void;
|
75
75
|
|
76
76
|
public getConfigObject(gridOptions?: any): any;
|
77
77
|
|