@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,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);
|
@@ -67,9 +76,15 @@ var RowDraggingPlugin = function (options) {
|
|
67
76
|
|
68
77
|
t._hosts = [];
|
69
78
|
|
70
|
-
t._guideline = document.createElement("
|
79
|
+
t._guideline = document.createElement("div"); // Test IE mouse event, guildline close mouse event
|
71
80
|
t._guideline.className = "tr-row-guideline";
|
72
81
|
|
82
|
+
t._dragBox = document.createElement("div");
|
83
|
+
t._dragBox.className = "drag-box-disabled";
|
84
|
+
|
85
|
+
t._dragBoxIcon = document.createElement("ef-icon");
|
86
|
+
t._dragBoxIcon.className = "drag-box-icon";
|
87
|
+
|
73
88
|
t.config({ "rowDragging": options });
|
74
89
|
};
|
75
90
|
Ext.inherits(RowDraggingPlugin, GridPlugin);
|
@@ -87,6 +102,14 @@ RowDraggingPlugin._stylePromise = null; // Static variable
|
|
87
102
|
* @private
|
88
103
|
*/
|
89
104
|
RowDraggingPlugin.prototype._guideline = null;
|
105
|
+
/** @type {Element}
|
106
|
+
* @private
|
107
|
+
*/
|
108
|
+
RowDraggingPlugin.prototype._dragBox = null;
|
109
|
+
/** @type {Element}
|
110
|
+
* @private
|
111
|
+
*/
|
112
|
+
RowDraggingPlugin.prototype._dragBoxIcon = null;
|
90
113
|
/** For disabled UI
|
91
114
|
* @type {boolean}
|
92
115
|
* @private
|
@@ -163,10 +186,14 @@ RowDraggingPlugin.prototype._dataTransfer = true;
|
|
163
186
|
* @private
|
164
187
|
*/
|
165
188
|
RowDraggingPlugin.prototype._autoScroll = true;
|
166
|
-
|
189
|
+
/** @type {Object}
|
190
|
+
* @private
|
191
|
+
*/
|
192
|
+
RowDraggingPlugin.prototype._dragUI = null;
|
167
193
|
|
168
194
|
/** Prevent built-in config
|
169
195
|
* @public
|
196
|
+
* @ignore
|
170
197
|
* @param {string} optionName
|
171
198
|
* @param {*} optionValue
|
172
199
|
* @return {*}
|
@@ -208,15 +235,21 @@ RowDraggingPlugin.prototype.initialize = function (host, options) {
|
|
208
235
|
host.setAttribute("draggable", "true");
|
209
236
|
host.listen("dragstart", this.startDrag);
|
210
237
|
}
|
211
|
-
|
238
|
+
|
212
239
|
host.listen("mousedown", this._onMouseDown);
|
213
240
|
host.listen("touchstart", this._onMouseDown);
|
214
241
|
|
215
|
-
|
216
|
-
|
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);
|
217
250
|
} else {
|
218
|
-
|
219
|
-
|
251
|
+
DragUI.stylePromise = ElfUtil.getThemeColors();
|
252
|
+
DragUI.stylePromise.then(this._onThemeLoaded);
|
220
253
|
}
|
221
254
|
|
222
255
|
// In case of lazy loading
|
@@ -231,7 +264,6 @@ RowDraggingPlugin.prototype.unload = function (host) {
|
|
231
264
|
|
232
265
|
// host.removeAttribute("draggable");
|
233
266
|
host.unlisten("dragstart", this.startDrag);
|
234
|
-
// host.unlisten("mouseover", this._onContentScrolled);
|
235
267
|
host.unlisten("mousedown", this._onMouseDown);
|
236
268
|
host.unlisten("touchstart", this._onMouseDown);
|
237
269
|
|
@@ -246,56 +278,9 @@ RowDraggingPlugin.prototype.unload = function (host) {
|
|
246
278
|
* @param {Object} colors
|
247
279
|
*/
|
248
280
|
RowDraggingPlugin.prototype._onThemeLoaded = function(colors) {
|
249
|
-
|
250
|
-
var styles = [ // Main Styles without theme
|
251
|
-
".tr-row-guideline", [
|
252
|
-
"position: absolute;",
|
253
|
-
"left: 0;",
|
254
|
-
"top: 0;",
|
255
|
-
"pointer-events: none;",
|
256
|
-
"z-index: 1;",
|
257
|
-
"text-align: center;",
|
258
|
-
"border-top-width: 3px;",
|
259
|
-
"border-top-style: solid;"
|
260
|
-
]
|
261
|
-
];
|
262
|
-
var guidelineColor = "#ff9933";
|
263
|
-
var ElfVersion = ElfUtil.getElfVersion();
|
264
|
-
if(colors.primary) {
|
265
|
-
guidelineColor = colors.primary;
|
266
|
-
}
|
267
|
-
guidelineColor += ";";
|
268
|
-
|
269
|
-
styles.push(".tr-row-guideline", [
|
270
|
-
"border-top-color: " + guidelineColor,
|
271
|
-
"color: " + guidelineColor,
|
272
|
-
"background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));"
|
273
|
-
]);
|
274
|
-
|
275
|
-
if(ElfVersion < 3) { // Backward compatability
|
276
|
-
styles.push(".pearl .tr-row-guideline, *[theme=pearl] .tr-row-guideline", [
|
277
|
-
"border-top-color: #ee7600;",
|
278
|
-
"color: #ee7600;",
|
279
|
-
"background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1));"
|
280
|
-
]);
|
281
|
-
}
|
282
|
-
RowDraggingPlugin._styles = prettifyCss(styles);
|
283
|
-
}
|
284
|
-
|
281
|
+
this._dragUI.onThemeLoaded(colors); // TODO : onThemeLoaded should be static function like DragUI.applyThemeColor
|
285
282
|
for(var i = this._hosts.length; --i >= 0;) {
|
286
|
-
|
287
|
-
}
|
288
|
-
};
|
289
|
-
/** @private
|
290
|
-
* @param {Object} grid core grid instance
|
291
|
-
*/
|
292
|
-
RowDraggingPlugin._applyThemeColor = function(grid) {
|
293
|
-
if(!grid || grid._rowDraggingStyles) {
|
294
|
-
return;
|
295
|
-
}
|
296
|
-
if(RowDraggingPlugin._styles) {
|
297
|
-
grid._rowDraggingStyles = true; // Prevent loading the same style twice
|
298
|
-
injectCss(RowDraggingPlugin._styles, grid.getElement());
|
283
|
+
DragUI.applyThemeColor(this._hosts[i]);
|
299
284
|
}
|
300
285
|
};
|
301
286
|
|
@@ -312,6 +297,9 @@ RowDraggingPlugin.prototype.config = function (options) {
|
|
312
297
|
|
313
298
|
if (typeof extOptions["dragBoxRenderer"] === "function") {
|
314
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
|
315
303
|
}
|
316
304
|
|
317
305
|
this._dragBoxEnabled = !!extOptions["dragBox"];
|
@@ -385,7 +373,7 @@ RowDraggingPlugin.prototype.startDrag = function (startRef) {
|
|
385
373
|
pos = this._hitTest(target);
|
386
374
|
}
|
387
375
|
|
388
|
-
if (pos
|
376
|
+
if (_isInContentSection(pos)) {
|
389
377
|
this._clearCache();
|
390
378
|
this._pos = pos;
|
391
379
|
this._onDragStart(startRef);
|
@@ -491,7 +479,7 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
|
|
491
479
|
|
492
480
|
if (this._dragBoxRenderer) { // For custom drag box rendering
|
493
481
|
var arg = cloneObject(e); // TODO: Check if cloning is necessary
|
494
|
-
arg.dragBox = this.
|
482
|
+
arg.dragBox = this._dragBox;
|
495
483
|
arg.dataRow = this._getRowData(dv.getRowDataAt(rowIndex));
|
496
484
|
|
497
485
|
if (this._legacyRowReorder) {
|
@@ -505,11 +493,8 @@ RowDraggingPlugin.prototype._onDragStart = function (e) {
|
|
505
493
|
// TODO: Just update curser will not gonna work since cell is pointer-events: none;
|
506
494
|
// we should do something to overwrite pointer-events first
|
507
495
|
// then set cursor move will have an effect
|
508
|
-
grid.getElement().
|
496
|
+
grid.getElement().classList.add("mouse-dragging");
|
509
497
|
|
510
|
-
// Initialize guideline
|
511
|
-
this._guideline.style.lineHeight = this._guideline.style.height = "";
|
512
|
-
this._updateGuideParent(); // Insert guideline to the document
|
513
498
|
this._updateGuidePosition();
|
514
499
|
|
515
500
|
if (this._autoScroll) {
|
@@ -546,12 +531,18 @@ RowDraggingPlugin.prototype._onMouseMove = function (e) {
|
|
546
531
|
|
547
532
|
this._pos = this._hitTest(e); // A new object is created
|
548
533
|
|
549
|
-
this.
|
534
|
+
this._updateGuidePosition(e);
|
535
|
+
this._pos.dragBox = this._dragBox; // assign dragBox for user determine valid target
|
550
536
|
|
551
537
|
// Dispatch drag event to let user determine valid drop target using allowDrag (allowDrop) method
|
552
538
|
this._dispatch("drag", this._pos);
|
553
|
-
|
554
|
-
|
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
|
+
}
|
555
546
|
};
|
556
547
|
/** @private
|
557
548
|
* @param {Object} e
|
@@ -564,6 +555,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
564
555
|
Dom.preventDefault(e);
|
565
556
|
}
|
566
557
|
Dom.removeParent(this._guideline);
|
558
|
+
Dom.removeParent(this._dragBox);
|
567
559
|
|
568
560
|
document.body.classList.remove("tr-dragging");
|
569
561
|
|
@@ -582,7 +574,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
582
574
|
}
|
583
575
|
|
584
576
|
var srcGrid = this._startingGrid || this._hosts[0];
|
585
|
-
srcGrid.getElement().
|
577
|
+
srcGrid.getElement().classList.remove("mouse-dragging");
|
586
578
|
|
587
579
|
var destPos = this._pos; // This can be null
|
588
580
|
if(!this._isDragCancelled()) {
|
@@ -591,7 +583,7 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
591
583
|
destPos["dropTarget"] = e ? e.target : null;
|
592
584
|
|
593
585
|
if (!this.disabled) {
|
594
|
-
if (this._dataTransfer && this.
|
586
|
+
if (this._dataTransfer && _isInContentSection(this._pos)) {
|
595
587
|
var destGrid = destPos["grid"] || srcGrid;
|
596
588
|
var destRowIndex = destPos["rowIndex"];
|
597
589
|
|
@@ -620,11 +612,6 @@ RowDraggingPlugin.prototype._onDragEnd = function (e) {
|
|
620
612
|
*/
|
621
613
|
RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGrid, destGrid, evtArg) {
|
622
614
|
var destDv = destGrid.getDataSource();
|
623
|
-
var destRowId = destDv.getRowId(destRowIndex);
|
624
|
-
|
625
|
-
if(!destRowId) {
|
626
|
-
return 0;
|
627
|
-
}
|
628
615
|
|
629
616
|
var srcRowIndices = null;
|
630
617
|
var srcDv = srcGrid.getDataSource();
|
@@ -641,10 +628,16 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
641
628
|
return 0;
|
642
629
|
}
|
643
630
|
|
631
|
+
|
644
632
|
var movedRowIds = null;
|
645
|
-
|
633
|
+
var destRowId = destDv.getRowId(destRowIndex);
|
634
|
+
if(srcGrid === destGrid) { // TODO: Support wrap mode
|
646
635
|
movedRowIds = srcDv.moveRow(srcRowIndices, destRowIndex) || [];
|
647
636
|
} else {
|
637
|
+
// TODO: Check if we support moving to last row for multi table
|
638
|
+
// if(!destRowId) {
|
639
|
+
// return 0;
|
640
|
+
// }
|
648
641
|
movedRowIds = [];
|
649
642
|
evtArg["destGrid"] = destGrid;
|
650
643
|
|
@@ -678,7 +671,7 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
678
671
|
if(movedRowIds.length) {
|
679
672
|
evtArg["originRowId"] = movedRowIds[0];
|
680
673
|
evtArg["originRowIds"] = movedRowIds;
|
681
|
-
evtArg["destinationRowId"] = destRowId;
|
674
|
+
evtArg["destinationRowId"] = destRowId; // Return empty string for the last row
|
682
675
|
|
683
676
|
this._dispatch("dataMoved", evtArg);
|
684
677
|
}
|
@@ -687,53 +680,54 @@ RowDraggingPlugin.prototype._moveRows = function (srcRowRef, destRowIndex, srcGr
|
|
687
680
|
/** @private
|
688
681
|
* @return {boolean}
|
689
682
|
*/
|
690
|
-
RowDraggingPlugin.prototype._isInContentSection = function () {
|
691
|
-
return (this._pos["sectionType"] === "content");
|
692
|
-
};
|
693
|
-
/** @private
|
694
|
-
* @return {boolean}
|
695
|
-
*/
|
696
|
-
RowDraggingPlugin.prototype._hasValidTarget = function () {
|
697
|
-
return (this._pos && this._pos["invalidTarget"]) ? false : true;
|
698
|
-
};
|
699
|
-
/** @private
|
700
|
-
* @return {boolean}
|
701
|
-
*/
|
702
683
|
RowDraggingPlugin.prototype._isDragCancelled = function () {
|
703
684
|
return (this._pos && this._pos["cancel"]) ? true : false;
|
704
685
|
};
|
705
686
|
|
706
|
-
/** @private */
|
707
|
-
RowDraggingPlugin.prototype._updateGuideParent = function () {
|
708
|
-
if (this._disabled) return;
|
709
|
-
|
710
|
-
if (this._isInContentSection()) {
|
711
|
-
var grid = this._pos["grid"] || null;
|
712
|
-
var pn = this._pos["section"].getColumnHost(); // This is to hide out of view guideline
|
713
|
-
if (pn !== this._guideline.parentNode) {
|
714
|
-
this._guideline.style.width = grid.getWidth() + "px";
|
715
|
-
pn.appendChild(this._guideline);
|
716
|
-
}
|
717
|
-
}
|
718
|
-
};
|
719
|
-
|
720
687
|
/** @private
|
721
|
-
* @param {Event} e
|
688
|
+
* @param {Event=} e
|
722
689
|
*/
|
723
690
|
RowDraggingPlugin.prototype._updateGuidePosition = function (e) {
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
691
|
+
var pos = this._pos;
|
692
|
+
if (this._disabled || !pos || pos["invalidTarget"]) {
|
693
|
+
return;
|
694
|
+
}
|
695
|
+
|
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);
|
734
704
|
}
|
705
|
+
|
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
|
726
|
+
|
727
|
+
guideline.style.top = (cellTop + offsetY) + "px";
|
735
728
|
}
|
736
729
|
};
|
730
|
+
|
737
731
|
/** @private */
|
738
732
|
RowDraggingPlugin.prototype._clearCache = function () {
|
739
733
|
if (this._dragPulseId) {
|
@@ -774,19 +768,6 @@ RowDraggingPlugin.prototype._onDragPulse = function () {
|
|
774
768
|
primaryHost.scrollDown(scrollVal);
|
775
769
|
}
|
776
770
|
};
|
777
|
-
/** @private
|
778
|
-
* @param {Event=} e
|
779
|
-
*/
|
780
|
-
RowDraggingPlugin.prototype._onContentScrolled = function (e) {
|
781
|
-
if (this._scrollingZone && this._dragging && this._pos["hit"]) {
|
782
|
-
var grid = this._pos["grid"];
|
783
|
-
if (grid.getElement() === e.currentTarget) {
|
784
|
-
this._pos = this._hitTest(e);
|
785
|
-
this._dispatch("drag", this._pos);
|
786
|
-
this._updateGuidePosition();
|
787
|
-
}
|
788
|
-
}
|
789
|
-
};
|
790
771
|
|
791
772
|
|
792
773
|
|
@@ -2,6 +2,7 @@ import {Ext} from '../../tr-grid-util/es6/Ext.js';
|
|
2
2
|
import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
|
3
3
|
import {FilterBuilder} from '../../tr-grid-util/es6/FilterBuilder.js';
|
4
4
|
import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
5
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
5
6
|
|
6
7
|
declare namespace RowFilteringPlugin {
|
7
8
|
|
@@ -32,6 +33,7 @@ declare namespace RowFilteringPlugin {
|
|
32
33
|
|
33
34
|
type Options = {
|
34
35
|
disabledUI?: boolean,
|
36
|
+
iconActivation?: string,
|
35
37
|
click?: ((...params: any[]) => any),
|
36
38
|
clicked?: ((...params: any[]) => any),
|
37
39
|
iconCreated?: ((...params: any[]) => any),
|
@@ -4,6 +4,7 @@ import { Ext } from '../../tr-grid-util/es6/Ext.js';
|
|
4
4
|
import { GridPlugin } from '../../tr-grid-util/es6/GridPlugin.js';
|
5
5
|
import { FilterBuilder } from '../../tr-grid-util/es6/FilterBuilder.js';
|
6
6
|
import { ElfUtil } from '../../tr-grid-util/es6/ElfUtil.js';
|
7
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
7
8
|
/** @event RowFilteringPlugin#click
|
8
9
|
* @description click event is dispatched when a user clicks the column filter icon.
|
9
10
|
*/
|
@@ -71,6 +72,7 @@ The expression can take various forms:<br>
|
|
71
72
|
/** @typedef {Object} RowFilteringPlugin~Options
|
72
73
|
* @description The options can be specified by `rowFiltering` property of the main grid's options
|
73
74
|
* @property {boolean=} disabledUI=false If enabled, filter icon will not be created/shown.
|
75
|
+
* @property {string=} iconActivation=onActiveFilter Filter icon redering behavior, can be set to `always`,`onHover`,`onActiveFilter`,or `none`
|
74
76
|
* @property {Function=} click=null Event handler dispatched when a user clicks the column filter icon.
|
75
77
|
* @property {Function=} clicked=null Alias to `click` event handler
|
76
78
|
* @property {Function=} iconCreated=null Event handler dispatched when a new column filter icon is created.
|
@@ -134,11 +136,6 @@ RowFilteringPlugin.prototype._nameMap; // Mapping name to filter function for re
|
|
134
136
|
*/
|
135
137
|
|
136
138
|
RowFilteringPlugin.prototype._disabled = false;
|
137
|
-
/** @type {boolean}
|
138
|
-
* @private
|
139
|
-
*/
|
140
|
-
|
141
|
-
RowFilteringPlugin.prototype._disabledUI = false;
|
142
139
|
/** @type {Object.<string, boolean>}
|
143
140
|
* @private
|
144
141
|
*/
|
@@ -165,6 +162,11 @@ RowFilteringPlugin.prototype._columnFilters;
|
|
165
162
|
*/
|
166
163
|
|
167
164
|
RowFilteringPlugin.prototype._activeColFilters = null;
|
165
|
+
/** @type {string}
|
166
|
+
* @private
|
167
|
+
*/
|
168
|
+
|
169
|
+
RowFilteringPlugin.prototype._iconActivation = "onActiveFilter";
|
168
170
|
/** @type {number}
|
169
171
|
* @private
|
170
172
|
*/
|
@@ -231,6 +233,15 @@ RowFilteringPlugin.prototype.initialize = function (host, options) {
|
|
231
233
|
|
232
234
|
this._hosts.push(host);
|
233
235
|
|
236
|
+
if (!RowFilteringPlugin._styles) {
|
237
|
+
RowFilteringPlugin._styles = prettifyCss([".hovering-filter-icon .cell:not(.active-filter):hover .floating-panel .title-filter-icon", ["display: flex;"], ".hovering-filter-icon .cell:not(.active-filter) .floating-panel .title-filter-icon", ["display: none;"], ".floating-panel", ["position:relative;"], ".floating-panel .title-filter-icon", ["color: var(--grid-title-filter-icon-color,inherit);"], ".floating-panel .title-filter-icon:hover", ["color: var(--grid-title-filter-icon-hover-color,inherit);"], ".hovering-filter-icon .tiny-col .cell:hover, .tr-grid .tiny-col .cell.active-filter", ["padding-left:0px;"], ".tiny-col .cell .floating-panel .title-filter-icon:before", ["content: '.';", "position: absolute;", "margin-left: auto;", "margin-right: auto;", "left: 0;", "right: 0;", "top: -10px;", "font-size: 10px;", "font-family: monospace;", "color: var(--grid-title-dot-icon,inherit);", "text-align:center;"]]);
|
238
|
+
}
|
239
|
+
|
240
|
+
if (!host._rowFilteringStyles) {
|
241
|
+
host._rowFilteringStyles = true;
|
242
|
+
injectCss(RowFilteringPlugin._styles, host.getElement());
|
243
|
+
}
|
244
|
+
|
234
245
|
host.unloadPlugin("ColumnFilterPlugin");
|
235
246
|
host.listen("preSectionRender", this._onPreSectionRender);
|
236
247
|
host.listen("postDataSourceChanged", this._requestFilterRefresh); // TODO: Check if this is necessary
|
@@ -275,7 +286,17 @@ RowFilteringPlugin.prototype.config = function (options) {
|
|
275
286
|
|
276
287
|
if (rowFiltering) {
|
277
288
|
if (rowFiltering["disabledUI"] || rowFiltering["uiDisabled"]) {
|
278
|
-
this.
|
289
|
+
this._iconActivation = "none";
|
290
|
+
}
|
291
|
+
|
292
|
+
if (rowFiltering["iconActivation"]) {
|
293
|
+
this._iconActivation = rowFiltering["iconActivation"];
|
294
|
+
|
295
|
+
if (this._iconActivation === "onHover") {
|
296
|
+
this._hosts[0].enableClass("hovering-filter-icon", true);
|
297
|
+
} else {
|
298
|
+
this._hosts[0].enableClass("hovering-filter-icon", false);
|
299
|
+
}
|
279
300
|
}
|
280
301
|
|
281
302
|
if (rowFiltering["clicked"]) {
|
@@ -302,6 +323,8 @@ RowFilteringPlugin.prototype.config = function (options) {
|
|
302
323
|
|
303
324
|
this._setColumnOptions(i, column);
|
304
325
|
}
|
326
|
+
|
327
|
+
this.updateAllColumnIcons(); //Create icon at first time
|
305
328
|
};
|
306
329
|
/** @public
|
307
330
|
* @param {Object=} gridOptions
|
@@ -352,7 +375,7 @@ RowFilteringPlugin.prototype.getConfigObject = function (gridOptions) {
|
|
352
375
|
extOptions = obj.rowFiltering = {};
|
353
376
|
}
|
354
377
|
|
355
|
-
extOptions.
|
378
|
+
extOptions.iconActivation = this._iconActivation;
|
356
379
|
return obj;
|
357
380
|
};
|
358
381
|
/** All filter logics in DataView will be temporarily removed until re-enabling. This is useful when trying to insert an item at the specified index. After re-enabling, both logics and icons will be restored.
|
@@ -604,12 +627,12 @@ RowFilteringPlugin.prototype.setColumnFilter = function (colIndex, exp, ctx) {
|
|
604
627
|
|
605
628
|
|
606
629
|
RowFilteringPlugin.prototype._setColumnOptions = function (colIndex, columnOptions) {
|
607
|
-
var fieldDataType = columnOptions["fieldDataType"]; // TODO: This should not be set here
|
630
|
+
var fieldDataType = columnOptions["fieldDataType"] || columnOptions["dataType"]; // TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
|
608
631
|
|
609
632
|
if (fieldDataType) {
|
610
633
|
var colOptions = this._newExtColumnOptions(colIndex);
|
611
634
|
|
612
|
-
colOptions.fieldDataType = fieldDataType; // TODO: This should not be set here
|
635
|
+
colOptions.fieldDataType = fieldDataType; // TODO: This should not be set here, should retreive data type from Composite/Realtime Grid
|
613
636
|
}
|
614
637
|
|
615
638
|
var exp = columnOptions["filter"];
|
@@ -1143,7 +1166,7 @@ RowFilteringPlugin.prototype._requestFilterRefresh = function () {
|
|
1143
1166
|
|
1144
1167
|
|
1145
1168
|
RowFilteringPlugin.prototype._setTimerForUpdatingIcons = function () {
|
1146
|
-
if (this.
|
1169
|
+
if (this._iconActivation === "none") {
|
1147
1170
|
return;
|
1148
1171
|
}
|
1149
1172
|
|
@@ -1216,10 +1239,6 @@ RowFilteringPlugin.prototype.refresh = function () {
|
|
1216
1239
|
|
1217
1240
|
|
1218
1241
|
RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
1219
|
-
if (this._disabledUI) {
|
1220
|
-
return;
|
1221
|
-
}
|
1222
|
-
|
1223
1242
|
var cfo = this._getColumnFilterOption(colIndex);
|
1224
1243
|
|
1225
1244
|
var hasFilter = cfo ? cfo._filters.length : 0;
|
@@ -1244,9 +1263,11 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
|
1244
1263
|
cell["updatePadding"]();
|
1245
1264
|
}
|
1246
1265
|
|
1247
|
-
|
1266
|
+
var onActiveFilter = this._iconActivation !== "always" && this._iconActivation !== "onHover";
|
1267
|
+
var noFilterIcon = this._disabled || this._iconActivation === "none" || onActiveFilter && !hasFilter;
|
1268
|
+
|
1269
|
+
if (!noFilterIcon) {
|
1248
1270
|
if (!cell._filterIcon) {
|
1249
|
-
cell.addClass("filtering");
|
1250
1271
|
var filterIcon;
|
1251
1272
|
|
1252
1273
|
if (ElfUtil.hasComponent("ef-icon") >= 3) {
|
@@ -1257,6 +1278,8 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
|
1257
1278
|
filterIcon.className = "filter-symbol icon-filter ef-icon";
|
1258
1279
|
}
|
1259
1280
|
|
1281
|
+
filterIcon.classList.add("title-filter-icon"); // Icon reference
|
1282
|
+
|
1260
1283
|
filterIcon.addEventListener("click", this._onIconClick, false);
|
1261
1284
|
|
1262
1285
|
this._dispatch("iconCreated", {
|
@@ -1268,11 +1291,17 @@ RowFilteringPlugin.prototype._updateColumnIcon = function (colIndex) {
|
|
1268
1291
|
cell.insertFloatingIcon(filterIcon, 10);
|
1269
1292
|
cell._filterIcon = filterIcon;
|
1270
1293
|
}
|
1294
|
+
|
1295
|
+
if (hasFilter || this._iconActivation == "always") {
|
1296
|
+
cell.enableClass("active-filter", true);
|
1297
|
+
} else {
|
1298
|
+
cell.enableClass("active-filter", false);
|
1299
|
+
}
|
1271
1300
|
} else {
|
1272
1301
|
if (cell._filterIcon) {
|
1273
1302
|
cell.removeFloatingIcon(cell._filterIcon);
|
1274
1303
|
cell._filterIcon = null;
|
1275
|
-
cell.
|
1304
|
+
cell.enableClass("active-filter", false);
|
1276
1305
|
}
|
1277
1306
|
}
|
1278
1307
|
}
|
@@ -1614,38 +1643,64 @@ RowFilteringPlugin.prototype.openDialog = function (colIndex, options) {
|
|
1614
1643
|
nodes: [],
|
1615
1644
|
checked: selectedItems[formattedVal] ? true : false
|
1616
1645
|
};
|
1617
|
-
});
|
1646
|
+
}); //Setting up default default column options
|
1618
1647
|
|
1619
|
-
var colOptions = this.
|
1648
|
+
var colOptions = this._newExtColumnOptions(colIndex);
|
1620
1649
|
|
1621
1650
|
var fdt = "";
|
1651
|
+
var sui = true;
|
1652
|
+
var fui = true;
|
1653
|
+
var lang = "";
|
1622
1654
|
|
1623
|
-
if (colOptions
|
1624
|
-
|
1625
|
-
|
1655
|
+
if (colOptions) {
|
1656
|
+
if (colOptions.fieldDataType != null) {
|
1657
|
+
fdt = colOptions.fieldDataType; // TODO: Retrieve data type from Composite/Realtime Grid instead
|
1658
|
+
}
|
1659
|
+
|
1660
|
+
if (colOptions.sortUI != null) {
|
1661
|
+
sui = colOptions.sortUI;
|
1662
|
+
}
|
1663
|
+
|
1664
|
+
if (colOptions.filterUI != null) {
|
1665
|
+
fui = colOptions.filterUI;
|
1666
|
+
}
|
1667
|
+
|
1668
|
+
if (colOptions.lang != null) {
|
1669
|
+
lang = colOptions.lang;
|
1670
|
+
}
|
1626
1671
|
}
|
1627
1672
|
|
1628
1673
|
var dialogConfig = {
|
1629
|
-
sortUI:
|
1630
|
-
filterUI:
|
1631
|
-
fieldDataType: fdt
|
1674
|
+
sortUI: sui,
|
1675
|
+
filterUI: fui,
|
1676
|
+
fieldDataType: fdt,
|
1677
|
+
lang: lang
|
1632
1678
|
};
|
1633
1679
|
|
1634
1680
|
if (options && _typeof(options) === "object") {
|
1635
|
-
|
1636
|
-
|
1681
|
+
var fieldDataType = options["fieldDataType"];
|
1682
|
+
var sortUI = options["sortUI"];
|
1683
|
+
var filterUI = options["filterUI"];
|
1684
|
+
var optionLang = options["lang"];
|
1685
|
+
|
1686
|
+
if (sortUI === false) {
|
1687
|
+
dialogConfig.sortUI = sortUI;
|
1688
|
+
colOptions.sortUI = sortUI;
|
1637
1689
|
}
|
1638
1690
|
|
1639
|
-
if (
|
1640
|
-
dialogConfig.filterUI =
|
1691
|
+
if (filterUI === false) {
|
1692
|
+
dialogConfig.filterUI = filterUI;
|
1693
|
+
colOptions.filterUI = filterUI;
|
1641
1694
|
}
|
1642
1695
|
|
1643
|
-
if (
|
1644
|
-
dialogConfig.fieldDataType =
|
1696
|
+
if (fieldDataType != null) {
|
1697
|
+
dialogConfig.fieldDataType = fieldDataType;
|
1698
|
+
colOptions.fieldDataType = fieldDataType;
|
1645
1699
|
}
|
1646
1700
|
|
1647
|
-
if (
|
1648
|
-
dialogConfig.lang =
|
1701
|
+
if (optionLang != null) {
|
1702
|
+
dialogConfig.lang = optionLang;
|
1703
|
+
colOptions.lang = optionLang;
|
1649
1704
|
}
|
1650
1705
|
}
|
1651
1706
|
|