@refinitiv-ui/efx-grid 6.0.2 → 6.0.5
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.d.ts +49 -0
- package/lib/column-dragging/es6/ColumnDragging.js +764 -0
- package/lib/column-dragging/es6/index.d.ts +1 -0
- package/lib/column-dragging/es6/index.js +1 -0
- 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 +146 -5
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +468 -1092
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.d.ts +2 -2
- package/lib/core/es6/data/DataCache.d.ts +4 -4
- package/lib/core/es6/data/DataTable.d.ts +5 -5
- package/lib/core/es6/data/DataTable.js +33 -11
- package/lib/core/es6/data/DataView.d.ts +12 -18
- package/lib/core/es6/data/DataView.js +0 -4
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +7 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
- package/lib/core/es6/data/WrappedView.d.ts +13 -13
- package/lib/core/es6/data/WrappedView.js +6 -6
- package/lib/core/es6/grid/Core.d.ts +31 -27
- package/lib/core/es6/grid/Core.js +47 -11
- package/lib/core/es6/grid/ILayoutGrid.d.ts +15 -15
- package/lib/core/es6/grid/LayoutGrid.js +54 -26
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +71 -0
- package/lib/core/es6/grid/components/Cell.d.ts +4 -4
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
- package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
- package/lib/core/es6/grid/components/Column.d.ts +1 -1
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
- package/lib/core/es6/grid/components/Scrollbar.d.ts +3 -1
- package/lib/core/es6/grid/components/Scrollbar.js +13 -0
- package/lib/core/es6/grid/components/StretchedCells.js +2 -2
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +14 -6
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +147 -81
- package/lib/core/es6/grid/util/Conflator.d.ts +2 -2
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +3 -3
- package/lib/core/es6/grid/util/HttpRequest.d.ts +2 -2
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +1 -1
- package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
- package/lib/core/es6/grid/util/SectionSettings.d.ts +5 -5
- package/lib/core/es6/grid/util/SectionSettings.js +5 -0
- package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
- package/lib/core/es6/grid/util/TrackLayout.d.ts +7 -3
- package/lib/core/es6/grid/util/TrackLayout.js +27 -0
- package/lib/core/es6/grid/util/util.d.ts +2 -2
- package/lib/core/es6/index.d.ts +1 -5
- package/lib/core/es6/index.js +1 -7
- 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 +14 -1
- package/lib/filter-dialog/lib/filter-dialog.js +86 -26
- package/lib/filter-dialog/themes/base-checkbox.less +8 -1
- package/lib/filter-dialog/themes/base.less +69 -1
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/lib/efx-grid.d.ts +25 -10
- package/lib/grid/lib/efx-grid.js +22 -56
- package/lib/grid/themes/base.less +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 +33 -39
- 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 +2 -0
- package/lib/index.js +2 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +7 -2
- package/lib/row-segmenting/es6/RowSegmenting.js +98 -11
- package/lib/rt-grid/dist/rt-grid.js +1244 -1249
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +5 -3
- package/lib/rt-grid/es6/ColumnDefinition.js +17 -108
- package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
- package/lib/rt-grid/es6/Grid.d.ts +24 -9
- package/lib/rt-grid/es6/Grid.js +285 -103
- package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
- package/lib/rt-grid/es6/RowDefSorter.js +137 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +9 -7
- package/lib/rt-grid/es6/RowDefinition.js +6 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +6 -1
- package/lib/rt-grid/es6/SnapshotFiller.js +144 -15
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -3
- package/lib/tr-grid-checkbox/es6/Checkbox.js +51 -21
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +46 -9
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +240 -125
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +4 -3
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +28 -13
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +8 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +1 -1
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
- package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +3 -4
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +86 -195
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +97 -7
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +8 -8
- package/lib/tr-grid-row-selection/es6/RowSelection.js +55 -31
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1 -1
- package/lib/tr-grid-util/es6/DragUI.d.ts +16 -0
- package/lib/tr-grid-util/es6/DragUI.js +214 -0
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -0
- package/lib/tr-grid-util/es6/ElementObserver.js +32 -2
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -1
- package/lib/tr-grid-util/es6/ElfUtil.js +131 -28
- package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
- package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
- package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +8 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
- package/lib/tr-grid-util/es6/RowPainter.js +57 -19
- package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
- package/lib/types/es6/Checkbox.d.ts +4 -3
- package/lib/types/es6/ColumnStack.d.ts +8 -4
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +3 -2
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +20 -18
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +3 -2
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +28 -0
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +5 -4
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/index.d.ts +9 -9
- package/lib/types/es6/ConditionalColoring.d.ts +4 -3
- package/lib/types/es6/Core/data/ColumnStats.d.ts +2 -2
- package/lib/types/es6/Core/data/DataCache.d.ts +4 -4
- package/lib/types/es6/Core/data/DataTable.d.ts +5 -5
- package/lib/types/es6/Core/data/DataView.d.ts +12 -18
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
- package/lib/types/es6/Core/data/WrappedView.d.ts +13 -13
- package/lib/types/es6/Core/grid/Core.d.ts +31 -27
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +15 -15
- package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
- package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +3 -1
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +14 -6
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +5 -5
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +7 -3
- package/lib/types/es6/Core/grid/util/util.d.ts +2 -2
- package/lib/types/es6/Core/index.d.ts +1 -5
- package/lib/types/es6/ExtensionOptions.d.ts +2 -0
- package/lib/types/es6/InCellEditing.d.ts +8 -5
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +5 -3
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +24 -9
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +9 -7
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +6 -1
- package/lib/types/es6/RowDragging.d.ts +3 -4
- package/lib/types/es6/RowGrouping.d.ts +7 -2
- package/lib/types/es6/RowSegmenting.d.ts +7 -2
- package/lib/types/es6/RowSelection.d.ts +8 -8
- package/lib/types/es6/TextFormatting.d.ts +1 -1
- package/lib/types/es6/index.d.ts +1 -0
- package/lib/versions.json +17 -16
- package/package.json +1 -1
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
- package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
- package/lib/core/es6/grid/plugins/Plugin.js +0 -272
- package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
- package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -1,8 +1,9 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
-
import { cloneObject
|
2
|
+
import { cloneObject } from "../../tr-grid-util/es6/Util.js";
|
3
3
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
4
4
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
5
5
|
import Dom from "../../tr-grid-util/es6/Dom.js";
|
6
|
+
import { DragUI } from "../../tr-grid-util/es6/DragUI.js";
|
6
7
|
|
7
8
|
/** @typedef {Object} RowDraggingPlugin~Options
|
8
9
|
* @description Available options describing `rowDragging` object specified in grid's option
|
@@ -44,6 +45,15 @@ import Dom from "../../tr-grid-util/es6/Dom.js";
|
|
44
45
|
* @type {Object}
|
45
46
|
*/
|
46
47
|
|
48
|
+
|
49
|
+
/** @private
|
50
|
+
* @param {Object} pos
|
51
|
+
* @return {boolean}
|
52
|
+
*/
|
53
|
+
var _isInContentSection = function (pos) {
|
54
|
+
return (pos && pos["sectionType"] === "content") ? true : false;
|
55
|
+
};
|
56
|
+
|
47
57
|
/** @constructor
|
48
58
|
* @param {RowDraggingPlugin.Options=} options
|
49
59
|
* @extends {GridPlugin}
|
@@ -58,7 +68,6 @@ var RowDraggingPlugin = function (options) {
|
|
58
68
|
t._onMouseDown = t._onMouseDown.bind(t);
|
59
69
|
|
60
70
|
t._onDragPulse = t._onDragPulse.bind(t);
|
61
|
-
t._onContentScrolled = t._onContentScrolled.bind(t);
|
62
71
|
|
63
72
|
t._onDragStart = t._onDragStart.bind(t);
|
64
73
|
t._onMouseMove = t._onMouseMove.bind(t);
|
@@ -71,7 +80,7 @@ var RowDraggingPlugin = function (options) {
|
|
71
80
|
t._guideline.className = "tr-row-guideline";
|
72
81
|
|
73
82
|
t._dragBox = document.createElement("div");
|
74
|
-
t._dragBox.className = "drag-box";
|
83
|
+
t._dragBox.className = "drag-box-disabled";
|
75
84
|
|
76
85
|
t._dragBoxIcon = document.createElement("ef-icon");
|
77
86
|
t._dragBoxIcon.className = "drag-box-icon";
|
@@ -177,10 +186,14 @@ RowDraggingPlugin.prototype._dataTransfer = true;
|
|
177
186
|
* @private
|
178
187
|
*/
|
179
188
|
RowDraggingPlugin.prototype._autoScroll = true;
|
180
|
-
|
189
|
+
/** @type {Object}
|
190
|
+
* @private
|
191
|
+
*/
|
192
|
+
RowDraggingPlugin.prototype._dragUI = null;
|
181
193
|
|
182
194
|
/** Prevent built-in config
|
183
195
|
* @public
|
196
|
+
* @ignore
|
184
197
|
* @param {string} optionName
|
185
198
|
* @param {*} optionValue
|
186
199
|
* @return {*}
|
@@ -222,15 +235,21 @@ RowDraggingPlugin.prototype.initialize = function (host, options) {
|
|
222
235
|
host.setAttribute("draggable", "true");
|
223
236
|
host.listen("dragstart", this.startDrag);
|
224
237
|
}
|
225
|
-
|
238
|
+
|
226
239
|
host.listen("mousedown", this._onMouseDown);
|
227
240
|
host.listen("touchstart", this._onMouseDown);
|
228
241
|
|
229
|
-
|
230
|
-
|
242
|
+
this._dragUI = new DragUI({
|
243
|
+
dragBox: this._dragBox,
|
244
|
+
dragBoxIcon: this._dragBoxIcon
|
245
|
+
});
|
246
|
+
|
247
|
+
// Share dragging styles
|
248
|
+
if(DragUI.stylePromise) {
|
249
|
+
DragUI.applyThemeColor(host);
|
231
250
|
} else {
|
232
|
-
|
233
|
-
|
251
|
+
DragUI.stylePromise = ElfUtil.getThemeColors();
|
252
|
+
DragUI.stylePromise.then(this._onThemeLoaded);
|
234
253
|
}
|
235
254
|
|
236
255
|
// In case of lazy loading
|
@@ -245,7 +264,6 @@ RowDraggingPlugin.prototype.unload = function (host) {
|
|
245
264
|
|
246
265
|
// host.removeAttribute("draggable");
|
247
266
|
host.unlisten("dragstart", this.startDrag);
|
248
|
-
// host.unlisten("mouseover", this._onContentScrolled);
|
249
267
|
host.unlisten("mousedown", this._onMouseDown);
|
250
268
|
host.unlisten("touchstart", this._onMouseDown);
|
251
269
|
|
@@ -260,94 +278,9 @@ RowDraggingPlugin.prototype.unload = function (host) {
|
|
260
278
|
* @param {Object} colors
|
261
279
|
*/
|
262
280
|
RowDraggingPlugin.prototype._onThemeLoaded = function(colors) {
|
263
|
-
|
264
|
-
var styles = [ // Main Styles without theme
|
265
|
-
".tr-row-guideline", [
|
266
|
-
"position: absolute;",
|
267
|
-
"left: 0;",
|
268
|
-
"top: 0;",
|
269
|
-
"pointer-events: none;",
|
270
|
-
"z-index: 1;",
|
271
|
-
"text-align: center;",
|
272
|
-
"border-top-width: 3px;",
|
273
|
-
"border-top-style: solid;"
|
274
|
-
],
|
275
|
-
".drag-box", [
|
276
|
-
"position: absolute;",
|
277
|
-
"left: 0;",
|
278
|
-
"top: 0;",
|
279
|
-
"pointer-events: none;",
|
280
|
-
"background-color: var(--grid-dragbox-bgcolor);",
|
281
|
-
"border: solid 1px var(--grid-title-sort-icon-color);",
|
282
|
-
"width: 134px;",
|
283
|
-
"height: 29px;",
|
284
|
-
"line-height: 29px;",
|
285
|
-
"white-space: nowrap;",
|
286
|
-
"overflow-x: clip;",
|
287
|
-
"text-overflow: ellipsis;",
|
288
|
-
"padding: 0 7px 0 7px;",
|
289
|
-
"box-shadow: 0 0 8px var(--grid-dragbox-bordercolor);"
|
290
|
-
],
|
291
|
-
".drag-box-icon", [
|
292
|
-
"top: -4px;",
|
293
|
-
"left: 12px;",
|
294
|
-
"padding: 2px;",
|
295
|
-
"border-radius: 100%;",
|
296
|
-
"font-size: 11px;",
|
297
|
-
"position: absolute;"
|
298
|
-
],
|
299
|
-
".drag-box-icon[icon='void']", [
|
300
|
-
"background-color:var(--grid-void-icon-bgcolor);",
|
301
|
-
"color:var(--grid-void-icon-color);"
|
302
|
-
],
|
303
|
-
".drag-box-icon[icon='add']", [
|
304
|
-
"background-color:var(--grid-insertion-icon-bgcolor);",
|
305
|
-
"color:var(--grid-insertion-icon-color);"
|
306
|
-
],
|
307
|
-
":host", [
|
308
|
-
"--grid-dragbox-bgcolor: #ffffff;", // If the value cannot be found, default to halo-light
|
309
|
-
"--grid-insertion-icon-bgcolor: #39c46e;",
|
310
|
-
"--grid-insertion-icon-color: #1A1A1A;",
|
311
|
-
"--grid-void-icon-bgcolor: #F5475B;",
|
312
|
-
"--grid-void-icon-color: #FFFFFF;"
|
313
|
-
]
|
314
|
-
];
|
315
|
-
var guidelineColor = "#ff9933";
|
316
|
-
var ElfVersion = ElfUtil.getElfVersion();
|
317
|
-
if(colors.primary) {
|
318
|
-
guidelineColor = colors.primary;
|
319
|
-
}
|
320
|
-
guidelineColor += ";";
|
321
|
-
|
322
|
-
styles.push(".tr-row-guideline", [
|
323
|
-
"border-top-color: " + guidelineColor,
|
324
|
-
"color: " + guidelineColor
|
325
|
-
]);
|
326
|
-
|
327
|
-
if(ElfVersion < 3) { // Backward compatability
|
328
|
-
styles.push(".pearl .tr-row-guideline, *[theme=pearl] .tr-row-guideline", [
|
329
|
-
"border-top-color: #ee7600;",
|
330
|
-
"color: #ee7600;",
|
331
|
-
"background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1));"
|
332
|
-
]);
|
333
|
-
}
|
334
|
-
RowDraggingPlugin._styles = prettifyCss(styles);
|
335
|
-
}
|
336
|
-
|
281
|
+
this._dragUI.onThemeLoaded(colors); // TODO : onThemeLoaded should be static function like DragUI.applyThemeColor
|
337
282
|
for(var i = this._hosts.length; --i >= 0;) {
|
338
|
-
|
339
|
-
}
|
340
|
-
};
|
341
|
-
/** @private
|
342
|
-
* @param {Object} grid core grid instance
|
343
|
-
*/
|
344
|
-
RowDraggingPlugin._applyThemeColor = function(grid) {
|
345
|
-
if(!grid || grid._rowDraggingStyles) {
|
346
|
-
return;
|
347
|
-
}
|
348
|
-
if(RowDraggingPlugin._styles) {
|
349
|
-
grid._rowDraggingStyles = true; // Prevent loading the same style twice
|
350
|
-
injectCss(RowDraggingPlugin._styles, grid.getElement());
|
283
|
+
DragUI.applyThemeColor(this._hosts[i]);
|
351
284
|
}
|
352
285
|
};
|
353
286
|
|
@@ -364,6 +297,9 @@ RowDraggingPlugin.prototype.config = function (options) {
|
|
364
297
|
|
365
298
|
if (typeof extOptions["dragBoxRenderer"] === "function") {
|
366
299
|
this._dragBoxRenderer = extOptions["dragBoxRenderer"];
|
300
|
+
this._dragBox.className = "drag-box"; // set disable drag-box
|
301
|
+
} else {
|
302
|
+
this._dragBox.className = "drag-box-disabled"; // set disable drag-box
|
367
303
|
}
|
368
304
|
|
369
305
|
this._dragBoxEnabled = !!extOptions["dragBox"];
|
@@ -437,7 +373,7 @@ RowDraggingPlugin.prototype.startDrag = function (startRef) {
|
|
437
373
|
pos = this._hitTest(target);
|
438
374
|
}
|
439
375
|
|
440
|
-
if (pos
|
376
|
+
if (_isInContentSection(pos)) {
|
441
377
|
this._clearCache();
|
442
378
|
this._pos = pos;
|
443
379
|
this._onDragStart(startRef);
|
@@ -557,10 +493,8 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
|
|
557
493
|
// TODO: Just update curser will not gonna work since cell is pointer-events: none;
|
558
494
|
// we should do something to overwrite pointer-events first
|
559
495
|
// then set cursor move will have an effect
|
560
|
-
grid.getElement().
|
496
|
+
grid.getElement().classList.add("mouse-dragging");
|
561
497
|
|
562
|
-
// Initialize guideline
|
563
|
-
this._updateGuideParent(); // Insert guideline to the document
|
564
498
|
this._updateGuidePosition();
|
565
499
|
|
566
500
|
if (this._autoScroll) {
|
@@ -597,14 +531,18 @@ RowDraggingPlugin.prototype._onMouseMove = function (e) {
|
|
597
531
|
|
598
532
|
this._pos = this._hitTest(e); // A new object is created
|
599
533
|
|
600
|
-
this._updateGuideParent();
|
601
534
|
this._updateGuidePosition(e);
|
602
|
-
this._renderDragBox(e);
|
603
|
-
|
604
535
|
this._pos.dragBox = this._dragBox; // assign dragBox for user determine valid target
|
605
536
|
|
606
537
|
// Dispatch drag event to let user determine valid drop target using allowDrag (allowDrop) method
|
607
538
|
this._dispatch("drag", this._pos);
|
539
|
+
if(!this._disabled) {
|
540
|
+
e.dragBoxIcon = this._pos.dragBoxIcon; // access event object instread of element for prevent element persistence
|
541
|
+
var drop = this._dragUI.renderDragBox(e, this._startingGrid);
|
542
|
+
if(!drop) { // can not be drop or not allow to drop or insertion
|
543
|
+
this.cancelDrag();
|
544
|
+
}
|
545
|
+
}
|
608
546
|
};
|
609
547
|
/** @private
|
610
548
|
* @param {Object} e
|
@@ -636,7 +574,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
636
574
|
}
|
637
575
|
|
638
576
|
var srcGrid = this._startingGrid || this._hosts[0];
|
639
|
-
srcGrid.getElement().
|
577
|
+
srcGrid.getElement().classList.remove("mouse-dragging");
|
640
578
|
|
641
579
|
var destPos = this._pos; // This can be null
|
642
580
|
if(!this._isDragCancelled()) {
|
@@ -645,7 +583,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
645
583
|
destPos["dropTarget"] = e ? e.target : null;
|
646
584
|
|
647
585
|
if (!this.disabled) {
|
648
|
-
if (this._dataTransfer && this.
|
586
|
+
if (this._dataTransfer && _isInContentSection(this._pos)) {
|
649
587
|
var destGrid = destPos["grid"] || srcGrid;
|
650
588
|
var destRowIndex = destPos["rowIndex"];
|
651
589
|
|
@@ -674,11 +612,6 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
674
612
|
*/
|
675
613
|
RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGrid, destGrid, evtArg) {
|
676
614
|
var destDv = destGrid.getDataSource();
|
677
|
-
var destRowId = destDv.getRowId(destRowIndex);
|
678
|
-
|
679
|
-
if(!destRowId) {
|
680
|
-
return 0;
|
681
|
-
}
|
682
615
|
|
683
616
|
var srcRowIndices = null;
|
684
617
|
var srcDv = srcGrid.getDataSource();
|
@@ -695,10 +628,16 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
695
628
|
return 0;
|
696
629
|
}
|
697
630
|
|
631
|
+
|
698
632
|
var movedRowIds = null;
|
699
|
-
|
633
|
+
var destRowId = destDv.getRowId(destRowIndex);
|
634
|
+
if(srcGrid === destGrid) { // TODO: Support wrap mode
|
700
635
|
movedRowIds = srcDv.moveRow(srcRowIndices, destRowIndex) || [];
|
701
636
|
} else {
|
637
|
+
// TODO: Check if we support moving to last row for multi table
|
638
|
+
// if(!destRowId) {
|
639
|
+
// return 0;
|
640
|
+
// }
|
702
641
|
movedRowIds = [];
|
703
642
|
evtArg["destGrid"] = destGrid;
|
704
643
|
|
@@ -732,7 +671,7 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
732
671
|
if(movedRowIds.length) {
|
733
672
|
evtArg["originRowId"] = movedRowIds[0];
|
734
673
|
evtArg["originRowIds"] = movedRowIds;
|
735
|
-
evtArg["destinationRowId"] = destRowId;
|
674
|
+
evtArg["destinationRowId"] = destRowId; // Return empty string for the last row
|
736
675
|
|
737
676
|
this._dispatch("dataMoved", evtArg);
|
738
677
|
}
|
@@ -741,89 +680,54 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
741
680
|
/** @private
|
742
681
|
* @return {boolean}
|
743
682
|
*/
|
744
|
-
RowDraggingPlugin.prototype._isInContentSection = function () {
|
745
|
-
return (this._pos["sectionType"] === "content");
|
746
|
-
};
|
747
|
-
/** @private
|
748
|
-
* @return {boolean}
|
749
|
-
*/
|
750
|
-
RowDraggingPlugin.prototype._hasValidTarget = function () {
|
751
|
-
return (this._pos && this._pos["invalidTarget"]) ? false : true;
|
752
|
-
};
|
753
|
-
/** @private
|
754
|
-
* @return {boolean}
|
755
|
-
*/
|
756
683
|
RowDraggingPlugin.prototype._isDragCancelled = function () {
|
757
684
|
return (this._pos && this._pos["cancel"]) ? true : false;
|
758
685
|
};
|
759
686
|
|
760
|
-
/** @private */
|
761
|
-
RowDraggingPlugin.prototype._updateGuideParent = function () {
|
762
|
-
if (this._disabled) return;
|
763
|
-
|
764
|
-
if (this._isInContentSection()) {
|
765
|
-
var grid = this._pos["grid"] || null;
|
766
|
-
var pn = this._pos["section"].getColumnHost(); // This is to hide out of view guideline
|
767
|
-
if (pn !== this._guideline.parentNode) {
|
768
|
-
this._guideline.style.width = grid.getWidth() + "px";
|
769
|
-
pn.appendChild(this._guideline);
|
770
|
-
}
|
771
|
-
}
|
772
|
-
};
|
773
|
-
|
774
687
|
/** @private
|
775
|
-
* @param {Event} e
|
688
|
+
* @param {Event=} e
|
776
689
|
*/
|
777
690
|
RowDraggingPlugin.prototype._updateGuidePosition = function (e) {
|
778
|
-
|
779
|
-
|
780
|
-
if (this._isInContentSection()) {
|
781
|
-
if (this._hasValidTarget()) {
|
782
|
-
var pos = Dom.getRelativePosition(this._pos["cellElement"], this._guideline.parentNode);
|
783
|
-
this._guideline.style.top = (pos["y"] - 1) + "px";
|
784
|
-
}
|
785
|
-
}
|
786
|
-
};
|
787
|
-
|
788
|
-
/** @private
|
789
|
-
* @param {!Element|Event|MouseEvent} e
|
790
|
-
*/
|
791
|
-
RowDraggingPlugin.prototype._renderDragBox = function (e) {
|
792
|
-
|
793
|
-
if(this._disabled) {
|
691
|
+
var pos = this._pos;
|
692
|
+
if (this._disabled || !pos || pos["invalidTarget"]) {
|
794
693
|
return;
|
795
694
|
}
|
796
695
|
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
696
|
+
if (_isInContentSection(pos)) {
|
697
|
+
var guideline = this._guideline;
|
698
|
+
// var grid = pos["grid"];
|
699
|
+
var section = pos["section"];
|
700
|
+
var pn = section.getColumnHost(); // This is to hide out of view guideline
|
701
|
+
if (pn !== guideline.parentNode) {
|
702
|
+
guideline.style.width = section.getWidth() + "px";
|
703
|
+
pn.appendChild(guideline);
|
704
|
+
}
|
803
705
|
|
804
|
-
|
706
|
+
var cellElement = pos["cellElement"];
|
707
|
+
var relativePos = Dom.getRelativePosition(cellElement, pn);
|
708
|
+
var cellTop = relativePos["y"];
|
709
|
+
var rowIndex = pos["rowIndex"];
|
710
|
+
var offsetY = 0;
|
711
|
+
|
712
|
+
if(rowIndex) {
|
713
|
+
offsetY = -1; // Make guideline stay on top of the target cell
|
714
|
+
if(e) { // MouseEvent or TouchEvent
|
715
|
+
var lastRow = section.getRowCount() - 1;
|
716
|
+
if(rowIndex >= lastRow) { // bottommost row
|
717
|
+
var rowHeight = section.getRowHeight(lastRow);
|
718
|
+
relativePos = Dom.getRelativePosition(e, cellElement);
|
719
|
+
if(relativePos["y"] >= (rowHeight / 2) | 0) {
|
720
|
+
offsetY = rowHeight - 3; // TODO: Use actual guideline height for the offset
|
721
|
+
++pos["rowIndex"];
|
722
|
+
}
|
723
|
+
}
|
724
|
+
}
|
725
|
+
} // else { Topmost row
|
805
726
|
|
806
|
-
|
807
|
-
this._dragBoxIcon.style.visibility = "visible";
|
808
|
-
if(dragBoxIcon === "insertion") {
|
809
|
-
this.cancelDrag();
|
810
|
-
this._dragBoxIcon.icon = "add";
|
811
|
-
this._dragBox.appendChild(this._dragBoxIcon);
|
812
|
-
} else if (dragBoxIcon === "not-allowed" || dragBoxIcon === "no-drop" || dragBoxIcon === "void" ) {
|
813
|
-
this.cancelDrag();
|
814
|
-
this._dragBoxIcon.icon = "void";
|
815
|
-
this._dragBox.appendChild(this._dragBoxIcon);
|
727
|
+
guideline.style.top = (cellTop + offsetY) + "px";
|
816
728
|
}
|
817
|
-
|
818
|
-
var gridRect = gridElem.getBoundingClientRect();
|
819
|
-
|
820
|
-
var x = e.clientX - gridRect.left;
|
821
|
-
var y = e.pageY - gridRect.top;
|
822
|
-
|
823
|
-
// space for mouse cursor
|
824
|
-
this._dragBox.style.left = x - 5 + "px";
|
825
|
-
this._dragBox.style.top = y + 8 + "px";
|
826
729
|
};
|
730
|
+
|
827
731
|
/** @private */
|
828
732
|
RowDraggingPlugin.prototype._clearCache = function () {
|
829
733
|
if (this._dragPulseId) {
|
@@ -864,19 +768,6 @@ RowDraggingPlugin.prototype._onDragPulse = function () {
|
|
864
768
|
primaryHost.scrollDown(scrollVal);
|
865
769
|
}
|
866
770
|
};
|
867
|
-
/** @private
|
868
|
-
* @param {Event=} e
|
869
|
-
*/
|
870
|
-
RowDraggingPlugin.prototype._onContentScrolled = function (e) {
|
871
|
-
if (this._scrollingZone && this._dragging && this._pos["hit"]) {
|
872
|
-
var grid = this._pos["grid"];
|
873
|
-
if (grid.getElement() === e.currentTarget) {
|
874
|
-
this._pos = this._hitTest(e);
|
875
|
-
this._dispatch("drag", this._pos);
|
876
|
-
this._updateGuidePosition();
|
877
|
-
}
|
878
|
-
}
|
879
|
-
};
|
880
771
|
|
881
772
|
|
882
773
|
|
@@ -3,6 +3,7 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
3
3
|
import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
4
4
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
7
|
|
7
8
|
declare namespace RowGroupingPlugin {
|
8
9
|
|
@@ -26,6 +27,8 @@ declare namespace RowGroupingPlugin {
|
|
26
27
|
autoGroupSorting?: boolean,
|
27
28
|
indentSize?: (boolean|number|(number)[]),
|
28
29
|
colorTag?: boolean,
|
30
|
+
predefinedColors?: any,
|
31
|
+
groupColors?: any,
|
29
32
|
clicked?: ((...params: any[]) => any),
|
30
33
|
groupAdded?: ((...params: any[]) => any),
|
31
34
|
beforeGroupAdded?: ((...params: any[]) => any),
|
@@ -75,10 +78,12 @@ declare class RowGroupingPlugin extends GridPlugin {
|
|
75
78
|
|
76
79
|
public setGroupSortingLogic(sortFunction: RowGroupingPlugin.GroupSortLogic): void;
|
77
80
|
|
78
|
-
public getGroupSortingLogic(): ((...params: any[]) => any);
|
81
|
+
public getGroupSortingLogic(): ((...params: any[]) => any)|null;
|
79
82
|
|
80
83
|
public setPredefinedGroups(predefinedGroups: any[]|(any[])[]): void;
|
81
84
|
|
85
|
+
public setPredefinedColors(predefinedColors: any): void;
|
86
|
+
|
82
87
|
public sortGroups(): void;
|
83
88
|
|
84
89
|
public updateHeaders(): void;
|
@@ -93,7 +98,7 @@ declare class RowGroupingPlugin extends GridPlugin {
|
|
93
98
|
|
94
99
|
public disableClicking(opt_disabled?: boolean): void;
|
95
100
|
|
96
|
-
public getGroupingStates(): (RowGroupingPlugin.GroupingState)[];
|
101
|
+
public getGroupingStates(): (RowGroupingPlugin.GroupingState)[]|null;
|
97
102
|
|
98
103
|
public setGroupingStates(states: (RowGroupingPlugin.GroupingState)[]|string): void;
|
99
104
|
|
@@ -3,6 +3,7 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
3
3
|
import { ExpanderIcon } from "../../tr-grid-util/es6/ExpanderIcon.js";
|
4
4
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
5
|
import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
6
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
7
|
|
7
8
|
/** @typedef {Object} RowGroupingPlugin~Options
|
8
9
|
* @description The options can be specified by `rowGrouping` property of the main grid's options
|
@@ -23,6 +24,8 @@ import { RowPainter } from "../../tr-grid-util/es6/RowPainter.js";
|
|
23
24
|
* @property {boolean=} autoGroupSorting=false If enabled, group sorting will be performed after each `groupAdded` event
|
24
25
|
* @property {(boolean|number|Array.<number>)=} indentSize Use array to define indent for each group level. Use boolean to turn on or off indentation. Use number to define incremental step.
|
25
26
|
* @property {boolean=} colorTag If not specified, the color tag will be disabled when using extension without halo theme.
|
27
|
+
* @property {Object=} predefinedColors Predefined color object map for color tag
|
28
|
+
* @property {Object=} groupColors The object map of group ID and predefined color.
|
26
29
|
* @property {Function=} clicked=null Event handler when user clicks on arrows or cells
|
27
30
|
* @property {Function=} groupAdded=null Event handler
|
28
31
|
* @property {Function=} beforeGroupAdded=null Event handler
|
@@ -264,6 +267,22 @@ RowGroupingPlugin.prototype._rowPainter = null;
|
|
264
267
|
* @private
|
265
268
|
*/
|
266
269
|
RowGroupingPlugin.prototype._colorTag = null;
|
270
|
+
/** @type {Object}
|
271
|
+
* @private
|
272
|
+
*/
|
273
|
+
RowGroupingPlugin.prototype._predefinedColors = null;
|
274
|
+
/** @type {Object}
|
275
|
+
* @private
|
276
|
+
*/
|
277
|
+
RowGroupingPlugin.prototype._groupColors = null;
|
278
|
+
/** @type {string}
|
279
|
+
* @private
|
280
|
+
*/
|
281
|
+
RowGroupingPlugin._controlClass = "predefined-color-tag";
|
282
|
+
/** @type {Object}
|
283
|
+
* @private
|
284
|
+
*/
|
285
|
+
RowGroupingPlugin.prototype._styleTag = null;
|
267
286
|
|
268
287
|
/** @type {Function}
|
269
288
|
* @private
|
@@ -391,6 +410,12 @@ RowGroupingPlugin.prototype.initialize = function (host, options) {
|
|
391
410
|
|
392
411
|
var enabled = this._colorTag != null ? this._colorTag : ElfUtil.isHaloTheme();
|
393
412
|
RowPainter.disableColorTag(host, enabled === false);
|
413
|
+
|
414
|
+
if (this._predefinedColors != null) {
|
415
|
+
this._injectStyles(this._predefinedColors);
|
416
|
+
host.enableClass(RowGroupingPlugin._controlClass);
|
417
|
+
}
|
418
|
+
|
394
419
|
RowPainter.applyGroupingStyles(host);
|
395
420
|
|
396
421
|
this._applyGrouping(); // TODO: Support run-time theme loading
|
@@ -528,17 +553,27 @@ RowGroupingPlugin.prototype.config = function (options) {
|
|
528
553
|
if (this.hasListener("groupFooterBinding")) {
|
529
554
|
this._footerRows = 1;
|
530
555
|
}
|
531
|
-
|
532
|
-
clickableCell: this._clickableCell,
|
533
|
-
headerSpanning: this._headerSpanning,
|
534
|
-
footerSpanning: this._footerSpanning,
|
535
|
-
onCellClicked: this._onCellClicked
|
536
|
-
});
|
556
|
+
|
537
557
|
if (option.colorTag != null) {
|
538
558
|
this._colorTag = option.colorTag;
|
539
559
|
}
|
560
|
+
|
561
|
+
if (option.groupColors != null && typeof option.groupColors === "object") {
|
562
|
+
this._groupColors = option.groupColors;
|
563
|
+
}
|
564
|
+
|
565
|
+
if (option.predefinedColors != null && typeof option.predefinedColors === "object") {
|
566
|
+
this._predefinedColors = option.predefinedColors;
|
567
|
+
}
|
540
568
|
}
|
541
569
|
|
570
|
+
this._rowPainter = new RowPainter({
|
571
|
+
clickableCell: this._clickableCell,
|
572
|
+
headerSpanning: this._headerSpanning,
|
573
|
+
footerSpanning: this._footerSpanning,
|
574
|
+
onCellClicked: this._onCellClicked
|
575
|
+
});
|
576
|
+
|
542
577
|
if (this._fixedDisplayColumn < 0) {
|
543
578
|
var checkboxColumnIndex = this._findCheckboxColumnIndexFromConfig(options.columns);
|
544
579
|
if (checkboxColumnIndex >= 0) { // has checkbox column
|
@@ -620,10 +655,15 @@ RowGroupingPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
620
655
|
if(this._indentSizes) {
|
621
656
|
extOptions.indentSize = this._indentSizes;
|
622
657
|
}
|
623
|
-
|
624
658
|
if(this._colorTag != null) {
|
625
659
|
extOptions.colorTag = this._colorTag;
|
626
660
|
}
|
661
|
+
if(this._groupColors != null) {
|
662
|
+
extOptions.groupColors = this._groupColors;
|
663
|
+
}
|
664
|
+
if(this._predefinedColors != null) {
|
665
|
+
extOptions.predefinedColors = this._predefinedColors;
|
666
|
+
}
|
627
667
|
|
628
668
|
return obj;
|
629
669
|
};
|
@@ -699,6 +739,32 @@ RowGroupingPlugin.prototype.getColumnMenu = function (colIndex, config) {
|
|
699
739
|
return config;
|
700
740
|
};
|
701
741
|
|
742
|
+
/** @private
|
743
|
+
* @param {Object} predefinedColors Predefined color object map
|
744
|
+
*/
|
745
|
+
RowGroupingPlugin.prototype._injectStyles = function(predefinedColors) {
|
746
|
+
var prefix = ".tr-grid." + RowGroupingPlugin._controlClass + " .tr-lg .cell";
|
747
|
+
var css = [];
|
748
|
+
var value;
|
749
|
+
for (var className in predefinedColors) {
|
750
|
+
css.push(prefix + "." + className + "::before");
|
751
|
+
value = predefinedColors[className]["backgroundColor"];
|
752
|
+
if (value) {
|
753
|
+
css.push(["background-color: " + value + ";"]);
|
754
|
+
}
|
755
|
+
}
|
756
|
+
|
757
|
+
var host = this._hosts[0];
|
758
|
+
|
759
|
+
if (this._styleTag) {
|
760
|
+
if (this._styleTag.parentNode) {
|
761
|
+
this._styleTag.parentNode.removeChild(this._styleTag);
|
762
|
+
}
|
763
|
+
this._styleTag = null;
|
764
|
+
}
|
765
|
+
this._styleTag = injectCss(prettifyCss(css), host.getElement());
|
766
|
+
};
|
767
|
+
|
702
768
|
/** @private
|
703
769
|
* @param {Object} e
|
704
770
|
*/
|
@@ -918,6 +984,16 @@ RowGroupingPlugin.prototype.setPredefinedGroups = function (predefinedGroups) {
|
|
918
984
|
}
|
919
985
|
};
|
920
986
|
|
987
|
+
/** @public
|
988
|
+
* @param {Object} predefinedColors Predefined color object map
|
989
|
+
*/
|
990
|
+
RowGroupingPlugin.prototype.setPredefinedColors = function(predefinedColors) {
|
991
|
+
if(predefinedColors != null && typeof predefinedColors === "object") {
|
992
|
+
this._predefinedColors = predefinedColors;
|
993
|
+
this._injectStyles(predefinedColors);
|
994
|
+
}
|
995
|
+
};
|
996
|
+
|
921
997
|
/** Trigger group sorting logic -- re-sort the existing groups. This will not continuously apply to each data update.
|
922
998
|
* @public
|
923
999
|
*/
|
@@ -1217,6 +1293,8 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
|
|
1217
1293
|
if(needCal) {
|
1218
1294
|
currentGroup = dataSource.getGroup(rowId); // Slow
|
1219
1295
|
curGroupLevel = currentGroup.getGroupLevel();
|
1296
|
+
} else if(!currentGroup) {
|
1297
|
+
currentGroup = dataSource.getGroup(rowId); // Slow
|
1220
1298
|
}
|
1221
1299
|
|
1222
1300
|
if (contentHeaderGroup || nonGroupListener) {
|
@@ -1275,6 +1353,18 @@ RowGroupingPlugin.prototype._updateHeader = function (settings, firstRowIndex, l
|
|
1275
1353
|
|
1276
1354
|
arg.indentSize = indentSize;
|
1277
1355
|
|
1356
|
+
if (this._groupColors) {
|
1357
|
+
// TODO: Need better method to find the first level parent's group id
|
1358
|
+
var rootGroup = currentGroup ? currentGroup : dataSource.getGroup(rowId); // Slow
|
1359
|
+
if (curGroupLevel > 1) {
|
1360
|
+
for (var i = curGroupLevel; i > 1; i--) {
|
1361
|
+
rootGroup = rootGroup.getDataSource();
|
1362
|
+
}
|
1363
|
+
}
|
1364
|
+
var groupId = rootGroup.getGroupId();
|
1365
|
+
arg.colorTagClass = this._groupColors[groupId];
|
1366
|
+
}
|
1367
|
+
|
1278
1368
|
if (groupView) {
|
1279
1369
|
rowPainter.applyHeaderStyle(arg);
|
1280
1370
|
this._dispatch(footerRow ? "groupFooterBinding" : "groupHeaderBinding", arg);
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { Ext } from
|
2
|
-
import { EventDispatcher } from
|
3
|
-
import { GridPlugin } from
|
4
|
-
import { isMac as isMacFn } from
|
1
|
+
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
|
+
import { EventDispatcher } from "../../tr-grid-util/es6/EventDispatcher.js";
|
3
|
+
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
4
|
+
import { isMac as isMacFn } from "../../tr-grid-util/es6/Util.js";
|
5
5
|
import { isIE, prepareTSVContent } from "../../tr-grid-util/es6/Util.js";
|
6
6
|
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
7
7
|
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
@@ -46,13 +46,13 @@ declare class RowSelectionPlugin extends GridPlugin {
|
|
46
46
|
|
47
47
|
public getRowAnchor(sectRef?: any): number;
|
48
48
|
|
49
|
-
public getFirstSelectedIndex(sectRef?: any): number|null;
|
49
|
+
public getFirstSelectedIndex(sectRef?: any): number|null|null;
|
50
50
|
|
51
|
-
public getLastSelectedIndex(sectRef?: any): number|null;
|
51
|
+
public getLastSelectedIndex(sectRef?: any): number|null|null;
|
52
52
|
|
53
|
-
public getSelectedRows(sectRef?: any): (number)[];
|
53
|
+
public getSelectedRows(sectRef?: any): (number)[]|null;
|
54
54
|
|
55
|
-
public getSelectedRowIds(sectRef?: any): (string)[];
|
55
|
+
public getSelectedRowIds(sectRef?: any): (string)[]|null;
|
56
56
|
|
57
57
|
public getSelectedRowCount(sectRef?: any): number;
|
58
58
|
|