@refinitiv-ui/efx-grid 6.0.1 → 6.0.4
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 +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 +17835 -16266
- 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 +26 -17
- 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/SegmentCollection.d.ts +3 -3
- 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 +42 -27
- package/lib/core/es6/grid/Core.js +431 -163
- package/lib/core/es6/grid/ILayoutGrid.d.ts +23 -15
- 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 +311 -108
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +382 -24
- 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/Column.js +8 -2
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
- 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/components/Scrollbar.d.ts +1 -1
- 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 +29 -3
- 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 +94 -32
- 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 +30 -8
- package/lib/grid/lib/efx-grid.js +120 -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 +72 -41
- 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 +8 -2
- package/lib/row-segmenting/es6/RowSegmenting.js +137 -21
- package/lib/rt-grid/dist/rt-grid.js +11017 -9193
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +9 -4
- package/lib/rt-grid/es6/ColumnDefinition.js +20 -108
- package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
- package/lib/rt-grid/es6/Grid.d.ts +30 -15
- package/lib/rt-grid/es6/Grid.js +436 -167
- 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 +12 -7
- package/lib/rt-grid/es6/RowDefinition.js +58 -2
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -1
- package/lib/rt-grid/es6/SnapshotFiller.js +23 -0
- 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 +6 -3
- package/lib/tr-grid-checkbox/es6/Checkbox.js +79 -34
- 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 +269 -10
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +243 -125
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +24 -13
- 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 +8 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
- 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 +108 -127
- 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.d.ts +7 -2
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +138 -38
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +13 -9
- package/lib/tr-grid-row-selection/es6/RowSelection.js +230 -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-textformatting/es6/TextFormatting.d.ts +1 -1
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -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/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 +28 -1
- 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/ElfUtil.js +1 -1
- 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/FieldFormatter.js +7 -5
- 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/GridPlugin.js +8 -4
- 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/NumberFormatter.d.ts +2 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
- 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 +120 -28
- 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/Formula.js +9 -1
- 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 +6 -3
- package/lib/types/es6/ColumnGrouping.d.ts +1 -0
- package/lib/types/es6/ColumnSelection.d.ts +5 -1
- 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 +1 -1
- 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 +26 -17
- 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 +289 -0
- package/lib/types/es6/Core/grid/Core.d.ts +42 -27
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +23 -15
- 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/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/HScrollbar.d.ts +4 -0
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +1 -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/FilterInput.d.ts +4 -2
- package/lib/types/es6/InCellEditing.d.ts +8 -5
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +9 -4
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +31 -16
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +12 -7
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -1
- package/lib/types/es6/RowColoring.d.ts +2 -0
- package/lib/types/es6/RowDragging.d.ts +3 -4
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/RowGrouping.d.ts +7 -2
- package/lib/types/es6/RowSegmenting.d.ts +8 -2
- package/lib/types/es6/RowSelection.d.ts +13 -9
- package/lib/types/es6/TextFormatting.d.ts +1 -1
- package/lib/types/es6/Zoom.d.ts +2 -1
- package/lib/types/es6/index.d.ts +3 -0
- package/lib/versions.json +22 -21
- package/lib/zoom/es6/Zoom.d.ts +2 -1
- package/lib/zoom/es6/Zoom.js +11 -4
- package/package.json +7 -7
- 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,10 @@
|
|
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
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
7
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
8
|
var isMac = isMacFn();
|
7
9
|
/** Fired when selection is changed by mouse down or key press. A change by JavaScript APIs will not trigger this event.
|
8
10
|
* @event RowSelectionPlugin#selectionChanged
|
@@ -25,6 +27,8 @@ var isMac = isMacFn();
|
|
25
27
|
* @property {Function=} beforeSelection=null Handler executed before selection is made
|
26
28
|
* @property {boolean=} basedOnContent=false Normally row selection will not move when data sorted, with this option turn on then selection will relocate strictly with row data.
|
27
29
|
* @property {string=} selectionField=SELECTED_ROW Normally basedOnContent will set selection state in row data with field name "SELECTED_ROW" but you can change field name here.
|
30
|
+
* @property {Function=} menuClicked=null Event Handler when user clicks on menu icon.
|
31
|
+
* @property {string=} menuPosition="outside" show icon in column grid that have style outside and non-outside
|
28
32
|
*/
|
29
33
|
|
30
34
|
/** @constructor
|
@@ -41,6 +45,9 @@ var RowSelectionPlugin = function (options) {
|
|
41
45
|
t._onBeforeRowRemoved = t._onBeforeRowRemoved.bind(t);
|
42
46
|
t._onReselection = t._onReselection.bind(t);
|
43
47
|
t._onPostSectionDataBinding = t._onPostSectionDataBinding.bind(t);
|
48
|
+
t._onThemeLoaded = t._onThemeLoaded.bind(t);
|
49
|
+
t._onRowPositionChanged = t._onRowPositionChanged.bind(t);
|
50
|
+
t._updateMenuIcon = t._updateMenuIcon.bind(t);
|
44
51
|
|
45
52
|
t._hosts = [];
|
46
53
|
t._anchorRowDict = {};
|
@@ -100,10 +107,26 @@ RowSelectionPlugin.prototype._isIE = false;
|
|
100
107
|
* @private
|
101
108
|
*/
|
102
109
|
RowSelectionPlugin.prototype._textRange = null;
|
110
|
+
/** @type {Function}
|
111
|
+
* @private
|
112
|
+
*/
|
113
|
+
RowSelectionPlugin.prototype._onMenuClicked = null;
|
114
|
+
/** @type {Element}
|
115
|
+
* @private
|
116
|
+
*/
|
117
|
+
RowSelectionPlugin.prototype._menuButton = null;
|
118
|
+
/** @type {string}
|
119
|
+
* @private
|
120
|
+
*/
|
121
|
+
RowSelectionPlugin.prototype._menuPosition = "outside";
|
103
122
|
/** @type {number}
|
104
123
|
* @private
|
105
124
|
*/
|
106
125
|
RowSelectionPlugin.prototype._timerId = 0;
|
126
|
+
/** @type {number}
|
127
|
+
* @private
|
128
|
+
*/
|
129
|
+
RowSelectionPlugin.prototype._timerMenuId = 0;
|
107
130
|
/** @type {(number|null)}
|
108
131
|
* @private
|
109
132
|
*/
|
@@ -136,6 +159,7 @@ RowSelectionPlugin.prototype.initialize = function (host, options) {
|
|
136
159
|
host.listen("click", this._onClick);
|
137
160
|
host.listen("keydown", this._onKeyDown);
|
138
161
|
host.listen("postSectionDataBinding", this._onPostSectionDataBinding);
|
162
|
+
host.listen("rowPositionChanged", this._onRowPositionChanged);
|
139
163
|
|
140
164
|
var wrapper = this.getGridApi(host);
|
141
165
|
if(wrapper) {
|
@@ -147,6 +171,59 @@ RowSelectionPlugin.prototype.initialize = function (host, options) {
|
|
147
171
|
// host.listen("cut", this._onCopy);
|
148
172
|
|
149
173
|
this.config(options);
|
174
|
+
|
175
|
+
if(this._onMenuClicked) { // use styles menu icon only when want to use icon menu
|
176
|
+
if(RowSelectionPlugin._stylePromise) {
|
177
|
+
RowSelectionPlugin._applyThemeColor(host);
|
178
|
+
} else {
|
179
|
+
RowSelectionPlugin._stylePromise = ElfUtil.getThemeColors();
|
180
|
+
RowSelectionPlugin._stylePromise.then(this._onThemeLoaded);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
};
|
185
|
+
|
186
|
+
/** @private
|
187
|
+
* @param {Object} colors
|
188
|
+
*/
|
189
|
+
RowSelectionPlugin.prototype._onThemeLoaded = function(colors) {
|
190
|
+
if(!RowSelectionPlugin._styles) {
|
191
|
+
var styles = [
|
192
|
+
".row-selection-menu", [
|
193
|
+
"position: absolute;",
|
194
|
+
"background-color: var(--grid-column-menu-icon-bgcolor);",
|
195
|
+
"color: var(--grid-column-menu-icon-color);",
|
196
|
+
"z-index: 1;",
|
197
|
+
"cursor: pointer;",
|
198
|
+
"text-align: center;",
|
199
|
+
"width: 16px;",
|
200
|
+
"height: 16px;",
|
201
|
+
"padding: 6px;"
|
202
|
+
],
|
203
|
+
".row-selection-menu:hover", [
|
204
|
+
"background-color: var(--grid-column-menu-icon-hover-bgcolor);"
|
205
|
+
],
|
206
|
+
".row-selection-menu-inside", [
|
207
|
+
"padding: 4px;"
|
208
|
+
]
|
209
|
+
];
|
210
|
+
RowSelectionPlugin._styles = prettifyCss(styles);
|
211
|
+
}
|
212
|
+
for(var i = this._hosts.length; --i >= 0;) {
|
213
|
+
RowSelectionPlugin._applyThemeColor(this._hosts[i]);
|
214
|
+
}
|
215
|
+
};
|
216
|
+
/** @private
|
217
|
+
* @param {Object} grid core grid instance
|
218
|
+
*/
|
219
|
+
RowSelectionPlugin._applyThemeColor = function(grid) {
|
220
|
+
if(!grid || grid._rowSelectionStyles) {
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
if(RowSelectionPlugin._styles) {
|
224
|
+
grid._rowSelectionStyles = true; // Prevent loading the same style twice
|
225
|
+
injectCss(RowSelectionPlugin._styles, grid.getParent());
|
226
|
+
}
|
150
227
|
};
|
151
228
|
/** @public
|
152
229
|
* @param {Object=} host core grid instance
|
@@ -161,12 +238,15 @@ RowSelectionPlugin.prototype.unload = function (host) {
|
|
161
238
|
host.unlisten("click", this._onClick);
|
162
239
|
host.unlisten("keydown", this._onKeyDown);
|
163
240
|
host.unlisten("postSectionDataBinding", this._onPostSectionDataBinding);
|
241
|
+
host.unlisten("rowPositionChanged", this._onRowPositionChanged);
|
242
|
+
|
164
243
|
this._hosts.splice(at, 1);
|
165
244
|
|
166
245
|
if (!this._hosts.length) {
|
167
246
|
if(this._timerId) {
|
168
247
|
clearTimeout(this._timerId);
|
169
248
|
this._timerId = 0;
|
249
|
+
this._timerMenuId = 0;
|
170
250
|
this._pendingSelection = null;
|
171
251
|
}
|
172
252
|
}
|
@@ -197,6 +277,14 @@ RowSelectionPlugin.prototype.config = function (options) {
|
|
197
277
|
if (pluginOptions["selectionField"]) {
|
198
278
|
this._selectionField = pluginOptions["selectionField"];
|
199
279
|
}
|
280
|
+
var val = pluginOptions["menuClicked"];
|
281
|
+
if(typeof val === "function"){
|
282
|
+
this._onMenuClicked = val;
|
283
|
+
}
|
284
|
+
val = pluginOptions["menuPosition"];
|
285
|
+
if(val) {
|
286
|
+
this._menuPosition = val;
|
287
|
+
}
|
200
288
|
} else if (pluginOptions === "single") {
|
201
289
|
this._singleSelMode = true;
|
202
290
|
}
|
@@ -300,12 +388,12 @@ RowSelectionPlugin.prototype.getFirstSelectedIndex = function (sectRef) {
|
|
300
388
|
var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
|
301
389
|
if (!dv) return null;
|
302
390
|
|
303
|
-
var rids = dv.
|
391
|
+
var rids = dv.getVisibleRowIds(true);
|
304
392
|
var rows = dv.getMultipleRowData(rids);
|
305
393
|
var count = rows.length;
|
306
394
|
var dataRow;
|
307
395
|
for (var rowIndex = 0; rowIndex < count; rowIndex++) {
|
308
|
-
dataRow = this.
|
396
|
+
dataRow = this._rowGetter(rows[rowIndex]);
|
309
397
|
if (dataRow && dataRow[this._selectionField]) {
|
310
398
|
return rowIndex;
|
311
399
|
}
|
@@ -328,12 +416,12 @@ RowSelectionPlugin.prototype.getLastSelectedIndex = function (sectRef) {
|
|
328
416
|
var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
|
329
417
|
if (!dv) return null;
|
330
418
|
|
331
|
-
var rids = dv.
|
419
|
+
var rids = dv.getVisibleRowIds(true);
|
332
420
|
var rows = dv.getMultipleRowData(rids);
|
333
421
|
var count = rows.length;
|
334
422
|
var dataRow;
|
335
423
|
for (var rowIndex = count - 1; rowIndex >= 0; rowIndex--) {
|
336
|
-
dataRow = this.
|
424
|
+
dataRow = this._rowGetter(rows[rowIndex]);
|
337
425
|
if (dataRow && dataRow[this._selectionField]) {
|
338
426
|
return rowIndex;
|
339
427
|
}
|
@@ -357,13 +445,13 @@ RowSelectionPlugin.prototype.getSelectedRows = function (sectRef) {
|
|
357
445
|
var dv = this._activeGrid ? this._activeGrid.getDataSource() : null;
|
358
446
|
if (!dv) return null;
|
359
447
|
|
360
|
-
var rids = dv.
|
448
|
+
var rids = dv.getVisibleRowIds(true);
|
361
449
|
var rows = dv.getMultipleRowData(rids);
|
362
450
|
var count = rows.length;
|
363
451
|
var selectedRows = [];
|
364
452
|
var dataRow;
|
365
453
|
for (var rowIndex = 0; rowIndex < count; rowIndex++) {
|
366
|
-
dataRow = this.
|
454
|
+
dataRow = this._rowGetter(rows[rowIndex]);
|
367
455
|
if (dataRow && dataRow[this._selectionField]) {
|
368
456
|
selectedRows.push(rowIndex);
|
369
457
|
}
|
@@ -385,7 +473,7 @@ RowSelectionPlugin.prototype.getSelectedRowIds = function (sectRef) {
|
|
385
473
|
var selRows = this.getSelectedRows(sectRef);
|
386
474
|
if (selRows) {
|
387
475
|
var dv = this._activeGrid.getDataSource();
|
388
|
-
var rowIds = dv.
|
476
|
+
var rowIds = dv.getVisibleRowIds(true);
|
389
477
|
len = selRows.length;
|
390
478
|
rids = new Array(len);
|
391
479
|
for (i = 0; i < len; ++i) {
|
@@ -471,6 +559,7 @@ RowSelectionPlugin.prototype.selectAllRows = function (activeGrid) {
|
|
471
559
|
}
|
472
560
|
}
|
473
561
|
}
|
562
|
+
this._updateMenuIcon();
|
474
563
|
};
|
475
564
|
|
476
565
|
/** @public
|
@@ -485,6 +574,7 @@ RowSelectionPlugin.prototype.selectRowRange = function (rowIndex, length, sectRe
|
|
485
574
|
if (opt_scrollToRow) {
|
486
575
|
this._scrollToRow(rowIndex);
|
487
576
|
}
|
577
|
+
this._updateMenuIcon();
|
488
578
|
};
|
489
579
|
|
490
580
|
/** @public
|
@@ -516,8 +606,14 @@ RowSelectionPlugin.prototype._onClick = function (e) {
|
|
516
606
|
var host = this.getRelativeGrid(e);
|
517
607
|
this._clearPendingClickIndex(host);
|
518
608
|
|
609
|
+
if(!this._basedOnContent) { // Protect against rowPositionChanged and postBindingSection event
|
610
|
+
this._updateMenuIcon();
|
611
|
+
}
|
519
612
|
this._dispatchSelectionChanged(e);
|
520
613
|
}
|
614
|
+
if(this._activeGrid != null){
|
615
|
+
this._activeGrid.focus();
|
616
|
+
}
|
521
617
|
};
|
522
618
|
/** @private
|
523
619
|
* @description Left click will cause single row selection <br>
|
@@ -550,8 +646,8 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
550
646
|
if (!ctx["hit"] || ctx["sectionType"] !== "content") { return; }
|
551
647
|
if (e.button === 2) { // Right click at the selected column should override clicking row to select;
|
552
648
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
553
|
-
if (csp && csp[
|
554
|
-
if (csp[
|
649
|
+
if (csp && csp["isEnabled"]()) {
|
650
|
+
if (csp["isSelectedColumn"](ctx["colIndex"])) {
|
555
651
|
return;
|
556
652
|
}
|
557
653
|
}
|
@@ -624,6 +720,9 @@ RowSelectionPlugin.prototype._onMouseDown = function (e) {
|
|
624
720
|
host.getParent().focus();
|
625
721
|
}
|
626
722
|
}
|
723
|
+
if(!this._basedOnContent) { // Protect against rowPositionChanged and postBindingSection event
|
724
|
+
this._updateMenuIcon();
|
725
|
+
}
|
627
726
|
|
628
727
|
this._dispatchSelectionChanged(e, rowIndex, section);
|
629
728
|
};
|
@@ -644,7 +743,7 @@ RowSelectionPlugin.prototype._onMouseMove = function (e) {
|
|
644
743
|
*/
|
645
744
|
RowSelectionPlugin.prototype._setPendingClickIndex = function (rowIndex, host) {
|
646
745
|
this._pendingClickIndex = rowIndex;
|
647
|
-
host && host.listen(
|
746
|
+
host && host.listen("mousemove", this._onMouseMove);
|
648
747
|
};
|
649
748
|
|
650
749
|
/** To clear _pendingClickIndex
|
@@ -653,7 +752,7 @@ RowSelectionPlugin.prototype._setPendingClickIndex = function (rowIndex, host) {
|
|
653
752
|
*/
|
654
753
|
RowSelectionPlugin.prototype._clearPendingClickIndex = function (host) {
|
655
754
|
this._pendingClickIndex = -1;
|
656
|
-
host && host.unlisten(
|
755
|
+
host && host.unlisten("mousemove", this._onMouseMove);
|
657
756
|
};
|
658
757
|
|
659
758
|
|
@@ -757,15 +856,39 @@ RowSelectionPlugin.prototype._onCopy = function (e) {
|
|
757
856
|
*/
|
758
857
|
RowSelectionPlugin.prototype._onPostSectionDataBinding = function (e) {
|
759
858
|
if (!this._basedOnContent
|
760
|
-
||
|
859
|
+
|| "content" !== e.sectionType
|
761
860
|
|| !this._activeGrid) {
|
762
861
|
return;
|
763
862
|
}
|
764
|
-
var
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
863
|
+
var section = e.section;
|
864
|
+
var dv = e.dataSource;
|
865
|
+
|
866
|
+
var field = this._selectionField;
|
867
|
+
section.clearSelectedRows();
|
868
|
+
|
869
|
+
var fromR = section.getFirstIndexInView();
|
870
|
+
var toR = section.getLastIndexInView();
|
871
|
+
for (var r = fromR; r < toR; ++r) {
|
872
|
+
var dataRow = this._rowGetter(dv.getRowDataAt(r));
|
873
|
+
if(dataRow) {
|
874
|
+
if(dataRow[field]) {
|
875
|
+
section.setSelectedRow(r, true);
|
876
|
+
}
|
877
|
+
}
|
878
|
+
}
|
879
|
+
this._updateMenuIcon();
|
880
|
+
};
|
881
|
+
|
882
|
+
/** @private
|
883
|
+
* @param {Object} e
|
884
|
+
*/
|
885
|
+
RowSelectionPlugin.prototype._onRowPositionChanged = function (e) {
|
886
|
+
if(this._timerMenuId) {
|
887
|
+
return;
|
888
|
+
}
|
889
|
+
if(e.sender && e.sender === this._activeGrid) {
|
890
|
+
this._clearMenuIcon(); // Clear icon before re-renderer
|
891
|
+
this._timerMenuId = setTimeout(this._updateMenuIcon, 800);
|
769
892
|
}
|
770
893
|
};
|
771
894
|
|
@@ -839,14 +962,14 @@ RowSelectionPlugin.prototype._clearSelectedRows = function (preserveAnchor) { //
|
|
839
962
|
if (this._basedOnContent) {
|
840
963
|
var dv = this._activeGrid.getDataSource();
|
841
964
|
if (dv) {
|
842
|
-
var rids = dv.
|
965
|
+
var rids = dv.getVisibleRowIds(true);
|
843
966
|
var rows = dv.getMultipleRowData(rids);
|
844
967
|
var valueList = [];
|
845
968
|
var ridList = [];
|
846
969
|
var dataRow, firstIndex;
|
847
970
|
var len = rows.length;
|
848
971
|
for (i = 0; i < len; i++) {
|
849
|
-
dataRow = this.
|
972
|
+
dataRow = this._rowGetter(rows[i]);
|
850
973
|
if (dataRow && dataRow[this._selectionField]) {
|
851
974
|
valueList.push(false);
|
852
975
|
ridList.push(rids[i]);
|
@@ -875,6 +998,7 @@ RowSelectionPlugin.prototype._clearSelectedRows = function (preserveAnchor) { //
|
|
875
998
|
this._anchorSection = null;
|
876
999
|
}
|
877
1000
|
this._clearPendingClickIndex(this._activeGrid);
|
1001
|
+
this._clearMenuIcon();
|
878
1002
|
}
|
879
1003
|
};
|
880
1004
|
/** @private
|
@@ -888,6 +1012,10 @@ RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
|
|
888
1012
|
|
889
1013
|
if (!this._anchorSection) { return; }
|
890
1014
|
|
1015
|
+
if(this._activeGrid != null){
|
1016
|
+
this._activeGrid.focus();
|
1017
|
+
}
|
1018
|
+
|
891
1019
|
var shiftKey = e.shiftKey;
|
892
1020
|
var next = 0;
|
893
1021
|
var rowLimit = this._anchorSection.getRowCount() - 1;
|
@@ -913,8 +1041,8 @@ RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
|
|
913
1041
|
}
|
914
1042
|
if (next < 0) {
|
915
1043
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
916
|
-
if (!shiftKey && csp && csp[
|
917
|
-
csp[
|
1044
|
+
if (!shiftKey && csp && csp["isEnabled"]()) {
|
1045
|
+
csp["selectSingleColumn"](null, this._activeGrid);
|
918
1046
|
|
919
1047
|
this.clearAllSelections();
|
920
1048
|
return;
|
@@ -937,7 +1065,9 @@ RowSelectionPlugin.prototype._selectByKey = function (direction, e, pageKey) {
|
|
937
1065
|
}
|
938
1066
|
|
939
1067
|
this._scrollToRow(next);
|
940
|
-
|
1068
|
+
if(!this._basedOnContent) { // Protect against rowPositionChanged and postBindingSection event
|
1069
|
+
this._updateMenuIcon();
|
1070
|
+
}
|
941
1071
|
this._dispatchSelectionChanged(e, next);
|
942
1072
|
};
|
943
1073
|
/** @private
|
@@ -975,7 +1105,7 @@ RowSelectionPlugin.prototype._sectionSelectRowRange = function (section, rowInde
|
|
975
1105
|
|
976
1106
|
if (dv) {
|
977
1107
|
var toRowIndex = rowIndex + length - 1;
|
978
|
-
var rids = dv.
|
1108
|
+
var rids = dv.getVisibleRowIds(true);
|
979
1109
|
var ridList = [];
|
980
1110
|
var valueList = [];
|
981
1111
|
for (var r = rowIndex; r <= toRowIndex; r++) {
|
@@ -1034,6 +1164,74 @@ RowSelectionPlugin.prototype._selectSingleRow = function (section, rowIndex) {
|
|
1034
1164
|
return true;
|
1035
1165
|
};
|
1036
1166
|
|
1167
|
+
/** @private
|
1168
|
+
* @return {boolean} return true if can added icon
|
1169
|
+
*/
|
1170
|
+
RowSelectionPlugin.prototype._updateMenuIcon = function () {
|
1171
|
+
this._timerMenuId = 0;
|
1172
|
+
if(!this._onMenuClicked) {
|
1173
|
+
return false;
|
1174
|
+
}
|
1175
|
+
var host = this._activeGrid;
|
1176
|
+
var startRowIndex = this.getFirstSelectedIndex();
|
1177
|
+
if(startRowIndex == null || !host) { // have no selected rows
|
1178
|
+
return false;
|
1179
|
+
}
|
1180
|
+
var endRowIndex = this.getLastSelectedIndex();
|
1181
|
+
var parentEl = host.getParent().parentNode;
|
1182
|
+
|
1183
|
+
if(!this._menuButton) {
|
1184
|
+
this._menuButton = document.createElement("div");
|
1185
|
+
this._menuButton.classList.add("row-selection-menu");
|
1186
|
+
this._menuButton.addEventListener("click", this._onMenuClicked);
|
1187
|
+
var coralIcon = document.createElement("ef-icon");
|
1188
|
+
coralIcon.icon = "most-detail";
|
1189
|
+
this._menuButton.appendChild(coralIcon);
|
1190
|
+
}
|
1191
|
+
|
1192
|
+
parentEl.appendChild(this._menuButton);
|
1193
|
+
|
1194
|
+
var menuIconSize = 28; // Currently support 28 and 24 pixel only
|
1195
|
+
var rowRect = host.getRowRect(startRowIndex, endRowIndex);
|
1196
|
+
|
1197
|
+
if( rowRect.scrollViewSize <= rowRect.top || rowRect.height + rowRect.top <= 0) { // hide icon when have no selection in view both left and right
|
1198
|
+
this._clearMenuIcon();
|
1199
|
+
return false;
|
1200
|
+
}
|
1201
|
+
|
1202
|
+
var leftOffset = rowRect.left + rowRect.width;
|
1203
|
+
var topOffset = rowRect.top + rowRect.scrollViewTop;
|
1204
|
+
if(this._menuPosition !== "outside") {
|
1205
|
+
menuIconSize = 24;
|
1206
|
+
this._menuButton.classList.add("row-selection-menu-inside");
|
1207
|
+
leftOffset = rowRect.left + rowRect.width - menuIconSize;
|
1208
|
+
topOffset = rowRect.top + rowRect.scrollViewTop - menuIconSize;
|
1209
|
+
|
1210
|
+
if(rowRect.top < menuIconSize) {
|
1211
|
+
topOffset = rowRect.top + rowRect.scrollViewTop;
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
} else {
|
1215
|
+
if(rowRect.top <= 0) {
|
1216
|
+
topOffset = rowRect.scrollViewTop;
|
1217
|
+
}
|
1218
|
+
|
1219
|
+
if(rowRect.top + menuIconSize >= rowRect.scrollViewSize) { // when move from top to bottom and try to set new position icon
|
1220
|
+
topOffset = rowRect.scrollViewSize;
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
this._menuButton.style.left = leftOffset + "px";
|
1225
|
+
this._menuButton.style.top = topOffset + "px";
|
1226
|
+
return true;
|
1227
|
+
};
|
1228
|
+
|
1229
|
+
/** @private */
|
1230
|
+
RowSelectionPlugin.prototype._clearMenuIcon = function () {
|
1231
|
+
if(this._menuButton && this._menuButton.parentNode) {
|
1232
|
+
this._menuButton.parentNode.removeChild(this._menuButton);
|
1233
|
+
}
|
1234
|
+
};
|
1037
1235
|
/** @private
|
1038
1236
|
* @param {number} rowIndex
|
1039
1237
|
* @param {number} length
|
@@ -1131,6 +1329,9 @@ RowSelectionPlugin.prototype._gotoGrid = function (gridIndex) {
|
|
1131
1329
|
var sectionIndex = this._anchorSection.getIndex();
|
1132
1330
|
this.clearSelectedRows(); // Clear all current grid's selections
|
1133
1331
|
this.selectSingleRow(anchorRow, sectionIndex, this._hosts[gridIndex]); // go to the next grid at the first column
|
1332
|
+
if(this._activeGrid != null){
|
1333
|
+
this._activeGrid.focus();
|
1334
|
+
}
|
1134
1335
|
};
|
1135
1336
|
|
1136
1337
|
/** @private
|
@@ -1172,8 +1373,8 @@ RowSelectionPlugin.prototype._dispatchBeforeSelection = function (e, ctx) {
|
|
1172
1373
|
RowSelectionPlugin.prototype._dispatchSelectionChanged = function (e, rowIndex, section) {
|
1173
1374
|
if (this._activeGrid) {
|
1174
1375
|
var csp = this._getPlugin("ColumnSelectionPlugin");
|
1175
|
-
if (csp && csp[
|
1176
|
-
csp[
|
1376
|
+
if (csp && csp["isEnabled"]()) {
|
1377
|
+
csp["clearSelection"]();
|
1177
1378
|
}
|
1178
1379
|
var cep = this._getPlugin("CellEditingPlugin");
|
1179
1380
|
if (cep) {
|
@@ -30,6 +30,8 @@ declare class RowColoringPlugin extends GridPlugin {
|
|
30
30
|
|
31
31
|
public getConfigObject(gridOptions?: any): any;
|
32
32
|
|
33
|
+
public getRowConfigObject(rowId: string): any|null;
|
34
|
+
|
33
35
|
public setRowColor(rowRef: string|number, bgColor?: (string|null), txtColor?: (string|null)): void;
|
34
36
|
|
35
37
|
public getRowColor(rowRef: string|number): string;
|
@@ -231,6 +231,42 @@ RowColoringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
231
231
|
return obj;
|
232
232
|
};
|
233
233
|
/** @public
|
234
|
+
* @param {string} rowId
|
235
|
+
* @return {Object|null} If this row doesn't contain a config object, return null.
|
236
|
+
*/
|
237
|
+
|
238
|
+
|
239
|
+
RowColoringPlugin.prototype.getRowConfigObject = function (rowId) {
|
240
|
+
// TODO: Should be call a method for get data from dataTable in tr-grid-util instead of call direct in dataTable
|
241
|
+
var dv = this._getDataView();
|
242
|
+
|
243
|
+
if (!dv) {
|
244
|
+
return null;
|
245
|
+
}
|
246
|
+
|
247
|
+
var dt = dv.getDataSource();
|
248
|
+
|
249
|
+
if (!dt) {
|
250
|
+
return null;
|
251
|
+
}
|
252
|
+
|
253
|
+
var rowData = this._rowGetter(dt.getRowData(rowId)); // get data from dataTable
|
254
|
+
|
255
|
+
|
256
|
+
if (!rowData) {
|
257
|
+
return null;
|
258
|
+
}
|
259
|
+
|
260
|
+
var obj = {}; // Only css field for predefine user color classes are currently supported
|
261
|
+
|
262
|
+
if (rowData[this._cssField]) {
|
263
|
+
obj[this._cssField] = rowData[this._cssField];
|
264
|
+
return obj;
|
265
|
+
}
|
266
|
+
|
267
|
+
return null;
|
268
|
+
};
|
269
|
+
/** @public
|
234
270
|
* @param {string|number} rowRef Row id in the data table or row index
|
235
271
|
* @param {(string|null)=} bgColor
|
236
272
|
* @param {(string|null)=} txtColor
|
@@ -65,7 +65,7 @@ declare class TextFormattingPlugin extends GridPlugin {
|
|
65
65
|
|
66
66
|
public getColumnFormatOptions(colIndex: number, options?: any): any;
|
67
67
|
|
68
|
-
public getFormatter(colIndex: number): FieldFormatter;
|
68
|
+
public getFormatter(colIndex: number): FieldFormatter|null;
|
69
69
|
|
70
70
|
public formatText(colIndex: number, obj: any): string;
|
71
71
|
|
@@ -122,6 +122,18 @@ TextFormattingPlugin.prototype.initialize = function (host, options) {
|
|
122
122
|
this.config(options);
|
123
123
|
}
|
124
124
|
};
|
125
|
+
/** @override
|
126
|
+
*/
|
127
|
+
|
128
|
+
|
129
|
+
TextFormattingPlugin.prototype._afterInit = function () {
|
130
|
+
// WOWRKAROUND : In test-resource and tr-grid-util, avoid using static variables. duplicating DateTime
|
131
|
+
var rtGrid = this._realTimeGrid;
|
132
|
+
|
133
|
+
if (rtGrid && rtGrid.setDateTimeUtil) {
|
134
|
+
rtGrid.setDateTimeUtil(DateTime);
|
135
|
+
}
|
136
|
+
};
|
125
137
|
/** @public
|
126
138
|
* @param {Object} host core grid instance
|
127
139
|
*/
|
@@ -44,9 +44,9 @@ declare class CellPainter {
|
|
44
44
|
|
45
45
|
constructor();
|
46
46
|
|
47
|
-
public static readonly themeReady: Promise<any
|
47
|
+
public static readonly themeReady: Promise<any>|null;
|
48
48
|
|
49
|
-
public static parse(expression: string|((...params: any[]) => any)): ((...params: any[]) => any);
|
49
|
+
public static parse(expression: string|((...params: any[]) => any)): ((...params: any[]) => any)|null;
|
50
50
|
|
51
51
|
public dispose(): void;
|
52
52
|
|
@@ -64,9 +64,9 @@ declare class CellPainter {
|
|
64
64
|
|
65
65
|
public applyThemeColor(): void;
|
66
66
|
|
67
|
-
public getConditions(): (any)[];
|
67
|
+
public getConditions(): (any)[]|null;
|
68
68
|
|
69
|
-
public getColoringType(): CellPainter.ColoringTypes;
|
69
|
+
public getColoringType(): CellPainter.ColoringTypes|null;
|
70
70
|
|
71
71
|
public setConditions(conditions: (CellPainter.Condition)[]): void;
|
72
72
|
|
@@ -96,7 +96,7 @@ declare class CellPainter {
|
|
96
96
|
|
97
97
|
public renderForPrinting(cell: Element, rowData: any, min: number, max: number): void;
|
98
98
|
|
99
|
-
public static blendColor(baseColor: string, maxColor: string, ratio: number): (number)[];
|
99
|
+
public static blendColor(baseColor: string, maxColor: string, ratio: number): (number)[]|null;
|
100
100
|
|
101
101
|
public static rgb2Hex(rgbCode: string): string;
|
102
102
|
|
@@ -104,15 +104,15 @@ declare class CellPainter {
|
|
104
104
|
|
105
105
|
public static num2Rgb(triplet: (number)[]): string;
|
106
106
|
|
107
|
-
public static hex2Num(hex: string): (number)[];
|
107
|
+
public static hex2Num(hex: string): (number)[]|null;
|
108
108
|
|
109
109
|
public static hex2Rgb(hex: string): string;
|
110
110
|
|
111
111
|
public static setThemeColors(): void;
|
112
112
|
|
113
|
-
public static loadThemeColors(): Promise<any
|
113
|
+
public static loadThemeColors(): Promise<any>|null;
|
114
114
|
|
115
|
-
public static reloadThemeColors(): Promise<any
|
115
|
+
public static reloadThemeColors(): Promise<any>|null;
|
116
116
|
|
117
117
|
public static getOppositeColor(hexCode: string|(number)[]): string;
|
118
118
|
|
@@ -4,9 +4,9 @@ declare class Conflator {
|
|
4
4
|
|
5
5
|
constructor(func?: (((...params: any[]) => any)|number), ms?: (number|((...params: any[]) => any)), thisObj?: any);
|
6
6
|
|
7
|
-
public reset(): any[];
|
7
|
+
public reset(): any[]|null;
|
8
8
|
|
9
|
-
public popAllData(): any[];
|
9
|
+
public popAllData(): any[]|null;
|
10
10
|
|
11
11
|
public dispose(): void;
|
12
12
|
|
@@ -41,13 +41,13 @@ declare const SECONDS_IN_HOUR: number;
|
|
41
41
|
|
42
42
|
declare const SECONDS_IN_MINUTE: number;
|
43
43
|
|
44
|
-
declare const SHORT_DAYS: (string)[];
|
44
|
+
declare const SHORT_DAYS: (string)[]|null;
|
45
45
|
|
46
|
-
declare const FULL_DAYS: (string)[];
|
46
|
+
declare const FULL_DAYS: (string)[]|null;
|
47
47
|
|
48
|
-
declare const SHORT_MONTHS: (string)[];
|
48
|
+
declare const SHORT_MONTHS: (string)[]|null;
|
49
49
|
|
50
|
-
declare const FULL_MONTHS: (string)[];
|
50
|
+
declare const FULL_MONTHS: (string)[]|null;
|
51
51
|
|
52
52
|
declare function prefixZero(num: number): string;
|
53
53
|
|