@refinitiv-ui/efx-grid 6.0.0 → 6.0.3
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-format-dialog/lib/column-format-dialog.d.ts +13 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +226 -23
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +10158 -7908
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataTable.js +32 -10
- package/lib/core/es6/data/DataView.d.ts +16 -7
- package/lib/core/es6/data/DataView.js +172 -49
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +7 -0
- package/lib/core/es6/data/WrappedView.d.ts +289 -0
- package/lib/core/es6/data/WrappedView.js +1319 -0
- package/lib/core/es6/grid/Core.d.ts +13 -0
- package/lib/core/es6/grid/Core.js +406 -160
- package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
- package/lib/core/es6/grid/ILayoutGrid.js +45 -2
- package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/LayoutGrid.js +257 -82
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +316 -24
- package/lib/core/es6/grid/components/Column.js +8 -2
- package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
- package/lib/core/es6/grid/components/HScrollbar.js +20 -4
- package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
- package/lib/core/es6/grid/util/TrackLayout.js +2 -3
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/checkbox-list.d.ts +13 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +13 -1
- package/lib/filter-dialog/lib/filter-dialog.js +24 -9
- package/lib/grid/lib/efx-grid.d.ts +27 -8
- package/lib/grid/lib/efx-grid.js +114 -115
- package/lib/grid/themes/base.less +5 -3
- 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 +69 -32
- 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/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/index.d.ts +56 -56
- package/lib/index.js +56 -56
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +43 -12
- package/lib/rt-grid/dist/rt-grid.js +10293 -7865
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
- package/lib/rt-grid/es6/Grid.d.ts +14 -7
- package/lib/rt-grid/es6/Grid.js +244 -75
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/RowDefinition.js +52 -2
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +41 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +6 -1
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
- package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +1 -1
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +13 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -3
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +165 -70
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
- package/lib/tr-grid-row-selection/es6/RowSelection.js +220 -29
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
- package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
- package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
- package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
- package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +10 -2
- package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
- package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
- package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
- package/lib/tr-grid-util/es6/RowPainter.js +82 -20
- package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
- package/lib/tr-grid-util/es6/Table.d.ts +13 -13
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
- package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
- package/lib/tr-grid-util/es6/Util.d.ts +6 -6
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
- package/lib/types/es6/CellSelection.d.ts +1 -1
- package/lib/types/es6/Checkbox.d.ts +4 -1
- package/lib/types/es6/ColumnGrouping.d.ts +1 -0
- package/lib/types/es6/ColumnSelection.d.ts +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +16 -7
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
- package/lib/types/es6/Core/grid/Core.d.ts +13 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
- package/lib/types/es6/FilterInput.d.ts +4 -2
- package/lib/types/es6/InCellEditing.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
- package/lib/types/es6/RowColoring.d.ts +2 -0
- package/lib/types/es6/RowDragging.d.ts +1 -3
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/RowSegmenting.d.ts +1 -0
- package/lib/types/es6/RowSelection.d.ts +13 -9
- package/lib/types/es6/Zoom.d.ts +2 -1
- package/lib/types/es6/index.d.ts +3 -0
- package/lib/versions.json +19 -19
- package/lib/zoom/es6/Zoom.d.ts +2 -1
- package/lib/zoom/es6/Zoom.js +11 -4
- package/package.json +9 -2
@@ -11,7 +11,8 @@ declare namespace RowDefinition {
|
|
11
11
|
asChain?: boolean,
|
12
12
|
chainRic?: string,
|
13
13
|
collapsed?: boolean,
|
14
|
-
label?: (string|null)
|
14
|
+
label?: (string|null),
|
15
|
+
hidden?: boolean
|
15
16
|
};
|
16
17
|
|
17
18
|
}
|
@@ -30,6 +31,8 @@ declare class RowDefinition {
|
|
30
31
|
|
31
32
|
public getRowId(): string;
|
32
33
|
|
34
|
+
public getConfigObject(rowOptions?: RowDefinition.Options): RowDefinition.Options;
|
35
|
+
|
33
36
|
public getDataId(): string;
|
34
37
|
|
35
38
|
public setDataSource(dataSource: DataCache): void;
|
@@ -13,6 +13,7 @@ import { DataTable } from "../../core/es6/data/DataTable.js";
|
|
13
13
|
* @property {string=} chainRic="" RIC to be used for chain request (overiding ric property)
|
14
14
|
* @property {boolean=} collapsed=false Chain is expanded by default
|
15
15
|
* @property {(string|null)=} label=null
|
16
|
+
* @property {boolean=} hidden=true When this row is hidden
|
16
17
|
*/
|
17
18
|
|
18
19
|
/** @type {string}
|
@@ -280,6 +281,55 @@ RowDefinition.prototype.setContent = function(userInput) {
|
|
280
281
|
RowDefinition.prototype.getRowId = function() {
|
281
282
|
return this._rowId;
|
282
283
|
};
|
284
|
+
/** @public
|
285
|
+
* @param {RowDefinition~Options=} rowOptions
|
286
|
+
* @return {RowDefinition~Options}
|
287
|
+
*/
|
288
|
+
RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
289
|
+
var obj = rowOptions || {};
|
290
|
+
var val = this._ric;
|
291
|
+
if(val) {
|
292
|
+
obj["ric"] = val;
|
293
|
+
}
|
294
|
+
|
295
|
+
val = this._staticValues;
|
296
|
+
if(val) {
|
297
|
+
obj["values"] = val;
|
298
|
+
}
|
299
|
+
|
300
|
+
val = this._chainRic;
|
301
|
+
if(val) {
|
302
|
+
obj["chainRic"] = val;
|
303
|
+
}
|
304
|
+
|
305
|
+
val = this._label;
|
306
|
+
if(val) {
|
307
|
+
obj["label"] = val;
|
308
|
+
}
|
309
|
+
|
310
|
+
val = this._userModel;
|
311
|
+
if(val) {
|
312
|
+
obj["keepModel"] = obj;
|
313
|
+
}
|
314
|
+
|
315
|
+
val = this._isChain;
|
316
|
+
if(val) {
|
317
|
+
obj["asChain"] = val;
|
318
|
+
}
|
319
|
+
|
320
|
+
val = this._expanded;
|
321
|
+
if(val) {
|
322
|
+
obj["collapsed"] = !val;
|
323
|
+
}
|
324
|
+
|
325
|
+
// check row hidden
|
326
|
+
val = this._view.isHiddenRow(this._rowId);
|
327
|
+
if(val) {
|
328
|
+
obj["hidden"] = val;
|
329
|
+
}
|
330
|
+
|
331
|
+
return obj;
|
332
|
+
};
|
283
333
|
/** Since an index chain (e.g. .FTSE) can automatically produce rows for its constituent, we need to separate rowId and dataId, so that the constituents still use the same data Id as that of its parent.
|
284
334
|
* @public
|
285
335
|
* @return {string} Data Id will never be empty string unless the row has been removed
|
@@ -318,14 +368,14 @@ RowDefinition.prototype.setDataSource = function(dataSource) {
|
|
318
368
|
* @return {Object} rowData
|
319
369
|
*/
|
320
370
|
RowDefinition.prototype.getRowData = function() {
|
321
|
-
return this._dc.getRowData(this._dataId);
|
371
|
+
return this._dc ? this._dc.getRowData(this._dataId) : {};
|
322
372
|
};
|
323
373
|
/** @public
|
324
374
|
* @param {string} field
|
325
375
|
* @return {*} data
|
326
376
|
*/
|
327
377
|
RowDefinition.prototype.getData = function(field) {
|
328
|
-
return this._dc.getData(this._dataId, field);
|
378
|
+
return this._dc ? this._dc.getData(this._dataId, field) : null;
|
329
379
|
};
|
330
380
|
|
331
381
|
/** @public
|
@@ -29,29 +29,11 @@ import { isIE, cloneObject, prepareTSVContent } from "../../tr-grid-util/es6/Uti
|
|
29
29
|
* @property {boolean=} cancel Set to true to cancel operation.
|
30
30
|
*/
|
31
31
|
|
32
|
-
/** Active cell selected.
|
33
|
-
* @private
|
34
|
-
* @param {Object} cell
|
35
|
-
*/
|
36
|
-
|
37
|
-
var selectCell = function selectCell(cell) {
|
38
|
-
if (cell) cell.enableClass("selection", true);
|
39
|
-
};
|
40
|
-
/** Deactive cell selected.
|
41
|
-
* @private
|
42
|
-
* @param {Object} cell
|
43
|
-
*/
|
44
|
-
|
45
|
-
|
46
|
-
var deselectCell = function deselectCell(cell) {
|
47
|
-
if (cell) cell.enableClass("selection", false);
|
48
|
-
};
|
49
32
|
/** @constructor
|
50
33
|
* @param {Object=} options
|
51
34
|
* @extends {GridPlugin}
|
52
35
|
*/
|
53
36
|
|
54
|
-
|
55
37
|
var CellSelectionPlugin = function CellSelectionPlugin(options) {
|
56
38
|
this._textRange = document.createRange();
|
57
39
|
this._isIE = isIE();
|
@@ -876,8 +858,7 @@ CellSelectionPlugin.prototype._onColumnMoved = function (e) {
|
|
876
858
|
|
877
859
|
for (var rowIndex = rect.top; rowIndex < rect.bottom; rowIndex++) {
|
878
860
|
var rowObj = this._map[rowIndex];
|
879
|
-
|
880
|
-
deselectCell(cell);
|
861
|
+
rowObj.section.selectCell(clearColIndex, rowObj.rowIndex, false);
|
881
862
|
} // NOTED: No need to reselect after clear selection UI.
|
882
863
|
// postSectionDataBinding will do this job
|
883
864
|
|
@@ -991,19 +972,17 @@ CellSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
|
|
991
972
|
var selectionRowEnd = this._curRect.bottom - rowOffset;
|
992
973
|
var selectionColStart = this._curRect.left;
|
993
974
|
var selectionColEnd = this._curRect.right;
|
994
|
-
var
|
975
|
+
var rowIndex, colIndex;
|
995
976
|
|
996
977
|
for (rowIndex = e.fromRowIndex; rowIndex < e.toRowIndex; rowIndex++) {
|
997
978
|
if (rowIndex >= selectionRowStart && rowIndex < selectionRowEnd) {
|
998
979
|
// if row inside selection range
|
999
980
|
for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
|
1000
|
-
|
1001
|
-
selectCell(cell);
|
981
|
+
e.section.selectCell(colIndex, rowIndex, true);
|
1002
982
|
}
|
1003
983
|
} else {
|
1004
984
|
for (colIndex = selectionColStart; colIndex < selectionColEnd; colIndex++) {
|
1005
|
-
|
1006
|
-
deselectCell(cell);
|
985
|
+
e.section.selectCell(colIndex, rowIndex, false);
|
1007
986
|
}
|
1008
987
|
}
|
1009
988
|
}
|
@@ -1025,8 +1004,8 @@ CellSelectionPlugin.prototype._isString = function (elem) {
|
|
1025
1004
|
CellSelectionPlugin.prototype._cacheSectionMap = function () {
|
1026
1005
|
var sectionCount = this._hosts[0].getSectionCount();
|
1027
1006
|
|
1028
|
-
var totalRow = 0
|
1029
|
-
|
1007
|
+
var totalRow = 0;
|
1008
|
+
var rowOffset = 0;
|
1030
1009
|
this._hasCellSpan = false;
|
1031
1010
|
|
1032
1011
|
var activeGrid = this._getActiveGrid();
|
@@ -1035,7 +1014,7 @@ CellSelectionPlugin.prototype._cacheSectionMap = function () {
|
|
1035
1014
|
var sectionSettings = activeGrid.getSectionSettings(i);
|
1036
1015
|
var section = sectionSettings.getSection();
|
1037
1016
|
var hasCellSpan = section.hasCellSpan();
|
1038
|
-
rowCount = section.getRowCount();
|
1017
|
+
var rowCount = section.getRowCount();
|
1039
1018
|
|
1040
1019
|
for (var j = 0; j < rowCount; ++j) {
|
1041
1020
|
var obj = {};
|
@@ -1043,11 +1022,13 @@ CellSelectionPlugin.prototype._cacheSectionMap = function () {
|
|
1043
1022
|
obj.hasCellSpan = hasCellSpan;
|
1044
1023
|
obj.sectionIndex = i;
|
1045
1024
|
obj.rowIndex = j;
|
1025
|
+
obj.rowOffset = rowOffset;
|
1046
1026
|
obj.type = sectionSettings.getType();
|
1047
1027
|
this._map[totalRow] = obj;
|
1048
1028
|
totalRow++;
|
1049
1029
|
}
|
1050
1030
|
|
1031
|
+
rowOffset += rowCount;
|
1051
1032
|
this._hasCellSpan |= hasCellSpan;
|
1052
1033
|
}
|
1053
1034
|
|
@@ -1263,6 +1244,29 @@ CellSelectionPlugin.prototype._updateSelection = function (tgtRect) {
|
|
1263
1244
|
this._updateRowSelection(this._curRect.bottom, tgtRect.bottom);
|
1264
1245
|
|
1265
1246
|
this._curRect.bottom = tgtRect.bottom;
|
1247
|
+
|
1248
|
+
var activeGrid = this._getActiveGrid();
|
1249
|
+
|
1250
|
+
if (activeGrid) {
|
1251
|
+
var x = this._curRect.left;
|
1252
|
+
var y = this._curRect.top;
|
1253
|
+
var mapInfo = this._map[y];
|
1254
|
+
var contentType = mapInfo ? mapInfo.type === "content" : false;
|
1255
|
+
var w = 0;
|
1256
|
+
var h = 0;
|
1257
|
+
|
1258
|
+
if (contentType) {
|
1259
|
+
w = this._curRect.right - x;
|
1260
|
+
h = this._curRect.bottom - y;
|
1261
|
+
y -= mapInfo.rowOffset;
|
1262
|
+
}
|
1263
|
+
|
1264
|
+
var contentSect = activeGrid.getSection("content");
|
1265
|
+
|
1266
|
+
if (contentSect) {
|
1267
|
+
contentSect.setCellBounds(x, y, w, h);
|
1268
|
+
}
|
1269
|
+
}
|
1266
1270
|
};
|
1267
1271
|
/** Update all column that mouse draged over.
|
1268
1272
|
* @private
|
@@ -1331,13 +1335,9 @@ CellSelectionPlugin.prototype._updateRowSelection = function (from, to) {
|
|
1331
1335
|
|
1332
1336
|
CellSelectionPlugin.prototype._selectAsPosition = function (rowIndex, colIndex, isSelect) {
|
1333
1337
|
var mapInfo = this._map[rowIndex];
|
1334
|
-
if (!mapInfo || this._unselectables[mapInfo.type] === true) return;
|
1335
|
-
var cell = mapInfo.section.getCell(colIndex, mapInfo.rowIndex);
|
1336
1338
|
|
1337
|
-
if (
|
1338
|
-
selectCell(
|
1339
|
-
} else {
|
1340
|
-
deselectCell(cell);
|
1339
|
+
if (mapInfo && !this._unselectables[mapInfo.type]) {
|
1340
|
+
mapInfo.section.selectCell(colIndex, mapInfo.rowIndex, isSelect);
|
1341
1341
|
}
|
1342
1342
|
};
|
1343
1343
|
/** Check mouse is draging over cell that already selected.
|
@@ -1471,11 +1471,20 @@ CellSelectionPlugin.prototype.deselectAll = function () {
|
|
1471
1471
|
|
1472
1472
|
var activeGrid = this._getActiveGrid();
|
1473
1473
|
|
1474
|
-
|
1475
|
-
|
1474
|
+
if (activeGrid) {
|
1475
|
+
var selectedCells = activeGrid.getElement().querySelectorAll("div.cell.selection"); // TODO: Move this logic to core grid
|
1476
|
+
|
1477
|
+
var c = selectedCells.length;
|
1476
1478
|
|
1477
|
-
|
1478
|
-
|
1479
|
+
for (var i = 0; i < c; i++) {
|
1480
|
+
selectedCells[i].classList.remove('selection');
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
var contentSect = activeGrid.getSection("content");
|
1484
|
+
|
1485
|
+
if (contentSect) {
|
1486
|
+
contentSect.setCellBounds(0, 0, 0, 0);
|
1487
|
+
}
|
1479
1488
|
}
|
1480
1489
|
|
1481
1490
|
this._lastSelection = this.getSelectionBounds();
|
@@ -1601,7 +1610,11 @@ CellSelectionPlugin.prototype.selectSingleCell = function (anchor) {
|
|
1601
1610
|
};
|
1602
1611
|
/** Use to select multiple cells, can be selected by rectangle area.
|
1603
1612
|
* @public
|
1604
|
-
* @param {Object} rect
|
1613
|
+
* @param {Object} rect Object with rowIndex, colIndex, width, and height properties
|
1614
|
+
* @example
|
1615
|
+
* ext.selectCells({
|
1616
|
+
* colIndex: 1, rowIndex: 1, width: 2, height: 2
|
1617
|
+
* });
|
1605
1618
|
*/
|
1606
1619
|
|
1607
1620
|
|
@@ -1724,7 +1737,7 @@ CellSelectionPlugin.prototype.getAnchorInfo = function () {
|
|
1724
1737
|
};
|
1725
1738
|
/** Use to get selected cells.
|
1726
1739
|
* @public
|
1727
|
-
* @return {Array.<
|
1740
|
+
* @return {Array.<Array>} 2D array of cells
|
1728
1741
|
*/
|
1729
1742
|
|
1730
1743
|
|
@@ -12,7 +12,8 @@ declare namespace CheckboxPlugin {
|
|
12
12
|
checkboxCreated?: ((...params: any[]) => any),
|
13
13
|
checkboxBinding?: ((...params: any[]) => any),
|
14
14
|
clicked?: ((...params: any[]) => any),
|
15
|
-
width?: number
|
15
|
+
width?: number,
|
16
|
+
topCheckboxHandler?: boolean
|
16
17
|
};
|
17
18
|
|
18
19
|
type ColumnOptions = {
|
@@ -51,6 +52,8 @@ declare class CheckboxPlugin extends GridPlugin {
|
|
51
52
|
|
52
53
|
public setAllCheckStates(checked: boolean): void;
|
53
54
|
|
55
|
+
public selectAllPages(checked?: boolean): void;
|
56
|
+
|
54
57
|
public disableCheckbox(rowRef: number|string, disabled: boolean): void;
|
55
58
|
|
56
59
|
public enableCheckbox(rowRef: number|string): void;
|
@@ -12,6 +12,7 @@ import {injectCss, prettifyCss, extendObject} from "../../tr-grid-util/es6/Util.
|
|
12
12
|
* @property {Function=} checkboxBinding=null Function handler for checkboxBinding event
|
13
13
|
* @property {Function=} clicked=null Function handler for checkbox clicked event
|
14
14
|
* @property {number=} width=34 Width for checkbox column
|
15
|
+
* @property {boolean=} topCheckboxHandler=true If disabled, when clicked on header row checkbox it will not perform default behavior
|
15
16
|
*/
|
16
17
|
|
17
18
|
/** @typedef {Object} CheckboxPlugin~ColumnOptions
|
@@ -103,6 +104,10 @@ CheckboxPlugin.prototype._disablingField = "CHECK_BOX_DISABLED";
|
|
103
104
|
* @private
|
104
105
|
*/
|
105
106
|
CheckboxPlugin.prototype._autoRowSelection = false;
|
107
|
+
/** @type {boolean}
|
108
|
+
* @private
|
109
|
+
*/
|
110
|
+
CheckboxPlugin.prototype._topCheckboxHandler = true;
|
106
111
|
/** @type {Function}
|
107
112
|
* @private
|
108
113
|
*/
|
@@ -348,6 +353,10 @@ CheckboxPlugin.prototype.config = function (options) {
|
|
348
353
|
if(val) {
|
349
354
|
this._width = val;
|
350
355
|
}
|
356
|
+
val = chkboxOpt["topCheckboxHandler"];
|
357
|
+
if(val != null) {
|
358
|
+
this._topCheckboxHandler = val ? true : false;
|
359
|
+
}
|
351
360
|
|
352
361
|
this.addListener(chkboxOpt, "checkboxCreated");
|
353
362
|
this.addListener(chkboxOpt, "clicked");
|
@@ -447,20 +456,6 @@ CheckboxPlugin.prototype.beforeInit = function(elem, config, runTime) {
|
|
447
456
|
checkboxIdx = t._userCheckboxIdx = 0;
|
448
457
|
columns.unshift(chbxCol);
|
449
458
|
}
|
450
|
-
|
451
|
-
// Ensure freeze columns on the left of checkbox column
|
452
|
-
var freezeCol;
|
453
|
-
var freezeColumn = config["freezeColumn"];
|
454
|
-
var columnFreezing = config["columnFreezing"];
|
455
|
-
if (freezeColumn != null && freezeColumn >= 0) {
|
456
|
-
freezeCol = freezeColumn;
|
457
|
-
}
|
458
|
-
if (columnFreezing != null && columnFreezing >= 0) {
|
459
|
-
freezeCol = columnFreezing;
|
460
|
-
}
|
461
|
-
if (checkboxIdx <= freezeColumn) {
|
462
|
-
config["freezeColumn"] = config["columnFreezing"] = freezeCol + 1;
|
463
|
-
}
|
464
459
|
};
|
465
460
|
|
466
461
|
/** @private
|
@@ -703,6 +698,35 @@ CheckboxPlugin.prototype.setAllCheckStates = function (checked) {
|
|
703
698
|
}
|
704
699
|
};
|
705
700
|
|
701
|
+
/** Set state for all checkboxes regardless of pagination, state would be apply to all filtered data
|
702
|
+
* @public
|
703
|
+
* @param {boolean=} checked Truthy or Falsy value
|
704
|
+
* @see {@link CheckboxPlugin#checkAll}
|
705
|
+
*/
|
706
|
+
CheckboxPlugin.prototype.selectAllPages = function (checked) {
|
707
|
+
var state = checked != null ? checked : true;
|
708
|
+
var host = this._hosts[0];
|
709
|
+
var dv = host ? host.getDataSource() : null;
|
710
|
+
|
711
|
+
if(dv) {
|
712
|
+
var allRids = dv.getSortedRowIds(true); // All row ids with filter applied, including disabled and pagination
|
713
|
+
|
714
|
+
// remove disabled row
|
715
|
+
var rids = [];
|
716
|
+
var dataRows = dv.getMultipleRowData(allRids);
|
717
|
+
var len = dataRows.length;
|
718
|
+
var dataRow;
|
719
|
+
for(var i = 0; i < len; i++) {
|
720
|
+
dataRow = this._rowGetter(dataRows[i]);
|
721
|
+
if(dataRow && !dataRow[this._disablingField]) {
|
722
|
+
rids.push(allRids[i]);
|
723
|
+
}
|
724
|
+
}
|
725
|
+
var valueList = CheckboxPlugin._genData(rids.length, state);
|
726
|
+
this._setColumnData(dv, this._checkboxField, valueList, rids);
|
727
|
+
}
|
728
|
+
};
|
729
|
+
|
706
730
|
/** @public
|
707
731
|
* @param {number|string} rowRef Row id in the data table or row index
|
708
732
|
* @param {boolean} disabled Truthy or Falsy value
|
@@ -967,6 +991,9 @@ CheckboxPlugin.prototype._getAllCheckboxes = function (sectionSettings, ary) {
|
|
967
991
|
* @param {string} state
|
968
992
|
*/
|
969
993
|
CheckboxPlugin.prototype._setDescendantCheckState = function (sectionSettings, state) {
|
994
|
+
if(!this._topCheckboxHandler){
|
995
|
+
return;
|
996
|
+
}
|
970
997
|
var children = sectionSettings.getChildren();
|
971
998
|
if (children) {
|
972
999
|
for (var i = 0; i < children.length; ++i) {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
3
4
|
/** @typedef {Array<ColumnGroupingPlugin~GroupDefinition>} ColumnGroupingPlugin~Options
|
4
5
|
* @description This options can be specified by `columnGrouping` property of the main grid's options or extension options.
|
5
6
|
*/
|
@@ -149,6 +150,15 @@ ColumnGroupingPlugin.prototype.initialize = function (host, options) {
|
|
149
150
|
if (this._initializedGrid && host.getSection("title")) {
|
150
151
|
// For run-time loading
|
151
152
|
this._applyGrouping();
|
153
|
+
}
|
154
|
+
|
155
|
+
if (!ColumnGroupingPlugin._styles) {
|
156
|
+
ColumnGroupingPlugin._styles = prettifyCss([".tr-grid .title .column .cell:not(:last-child)", ["box-shadow: none;"]]);
|
157
|
+
}
|
158
|
+
|
159
|
+
if (!host._columnGroupingStyles) {
|
160
|
+
host._columnGroupingStyles = true;
|
161
|
+
injectCss(ColumnGroupingPlugin._styles, host.getElement());
|
152
162
|
} // TODO: wrong render group in hide/show column
|
153
163
|
|
154
164
|
};
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
3
3
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
4
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
4
6
|
|
5
7
|
declare namespace ColumnSelectionPlugin {
|
6
8
|
|
7
9
|
type Options = {
|
8
10
|
singleSelection?: boolean,
|
9
11
|
clickToggle?: boolean,
|
10
|
-
selectionChanged?: ((...params: any[]) => any)
|
12
|
+
selectionChanged?: ((...params: any[]) => any),
|
13
|
+
menuClicked?: ((...params: any[]) => any),
|
14
|
+
menuPosition?: string
|
11
15
|
};
|
12
16
|
|
13
17
|
type ColumnOptions = {
|