@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,7 +1,7 @@
|
|
1
1
|
import {Ext} from '../../tr-grid-util/es6/Ext.js';
|
2
2
|
import {GridPlugin} from '../../tr-grid-util/es6/GridPlugin.js';
|
3
3
|
import {ElfUtil} from '../../tr-grid-util/es6/ElfUtil.js';
|
4
|
-
import {injectCss, prettifyCss
|
4
|
+
import {injectCss, prettifyCss} from "../../tr-grid-util/es6/Util.js";
|
5
5
|
|
6
6
|
/** @typedef {Object} CheckboxPlugin~Options
|
7
7
|
* @description Available options describing `checkbox` object specified in grid's option
|
@@ -12,6 +12,7 @@ import {injectCss, prettifyCss, extendObject} from "../../tr-grid-util/es6/Util.
|
|
12
12
|
* @property {Function=} checkboxBinding=null Function handler for checkboxBinding event
|
13
13
|
* @property {Function=} clicked=null Function handler for checkbox clicked event
|
14
14
|
* @property {number=} width=34 Width for checkbox column
|
15
|
+
* @property {boolean=} topCheckboxHandler=true If disabled, when clicked on header row checkbox it will not perform default behavior
|
15
16
|
*/
|
16
17
|
|
17
18
|
/** @typedef {Object} CheckboxPlugin~ColumnOptions
|
@@ -103,6 +104,10 @@ CheckboxPlugin.prototype._disablingField = "CHECK_BOX_DISABLED";
|
|
103
104
|
* @private
|
104
105
|
*/
|
105
106
|
CheckboxPlugin.prototype._autoRowSelection = false;
|
107
|
+
/** @type {boolean}
|
108
|
+
* @private
|
109
|
+
*/
|
110
|
+
CheckboxPlugin.prototype._topCheckboxHandler = true;
|
106
111
|
/** @type {Function}
|
107
112
|
* @private
|
108
113
|
*/
|
@@ -121,9 +126,11 @@ CheckboxPlugin._styles = prettifyCss([
|
|
121
126
|
".tr-checkbox-column input[type='checkbox'], .tr-checkbox-column input+label", [
|
122
127
|
"cursor: pointer;"
|
123
128
|
],
|
124
|
-
".column.tr-checkbox-column .cell", [
|
125
|
-
"
|
126
|
-
|
129
|
+
".column.tr-checkbox-column.tr-align-left .cell", [
|
130
|
+
"text-align: left;"
|
131
|
+
],
|
132
|
+
".column.tr-checkbox-column.tr-align-right .cell", [
|
133
|
+
"text-align: right;"
|
127
134
|
]
|
128
135
|
]);
|
129
136
|
/** @private
|
@@ -348,6 +355,10 @@ CheckboxPlugin.prototype.config = function (options) {
|
|
348
355
|
if(val) {
|
349
356
|
this._width = val;
|
350
357
|
}
|
358
|
+
val = chkboxOpt["topCheckboxHandler"];
|
359
|
+
if(val != null) {
|
360
|
+
this._topCheckboxHandler = val ? true : false;
|
361
|
+
}
|
351
362
|
|
352
363
|
this.addListener(chkboxOpt, "checkboxCreated");
|
353
364
|
this.addListener(chkboxOpt, "clicked");
|
@@ -437,45 +448,30 @@ CheckboxPlugin.prototype.beforeInit = function(elem, config, runTime) {
|
|
437
448
|
}
|
438
449
|
}
|
439
450
|
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
if (checkboxIdx >= 0) {
|
444
|
-
// WARNING:: User column config will be deleted here since we swap user column with our generated checkbox column
|
445
|
-
extendObject(columns[checkboxIdx], chbxCol);
|
451
|
+
t._userCheckboxIdx = t._findCheckboxColumnIndexFromConfig(columns);
|
452
|
+
if (t._userCheckboxIdx >= 0) {
|
453
|
+
t._genCheckboxColumn(columns[t._userCheckboxIdx]);
|
446
454
|
} else {
|
447
|
-
|
448
|
-
|
449
|
-
}
|
450
|
-
|
451
|
-
// Ensure freeze columns on the left of checkbox column
|
452
|
-
var freezeCol;
|
453
|
-
var freezeColumn = config["freezeColumn"];
|
454
|
-
var columnFreezing = config["columnFreezing"];
|
455
|
-
if (freezeColumn != null && freezeColumn >= 0) {
|
456
|
-
freezeCol = freezeColumn;
|
457
|
-
}
|
458
|
-
if (columnFreezing != null && columnFreezing >= 0) {
|
459
|
-
freezeCol = columnFreezing;
|
460
|
-
}
|
461
|
-
if (checkboxIdx <= freezeColumn) {
|
462
|
-
config["freezeColumn"] = config["columnFreezing"] = freezeCol + 1;
|
455
|
+
columns.unshift(t._genCheckboxColumn());
|
456
|
+
t._userCheckboxIdx = 0; // TODO: This _userCheckboxIdx has some misleading meaning
|
463
457
|
}
|
464
458
|
};
|
465
459
|
|
466
460
|
/** @private
|
467
|
-
* @
|
461
|
+
* @param {Object=} userObj
|
462
|
+
* @return {!Object} checkbox column config
|
468
463
|
*/
|
469
|
-
CheckboxPlugin.prototype._genCheckboxColumn = function () {
|
470
|
-
|
471
|
-
autoGenerated: true,
|
464
|
+
CheckboxPlugin.prototype._genCheckboxColumn = function (userObj) {
|
465
|
+
var defaultObj = {
|
472
466
|
width: this._width,
|
473
467
|
sortable: false,
|
474
468
|
className: "tr-checkbox-column", // For rt-grid
|
475
469
|
classes: { "tr-checkbox-column": 1 }, // For composite grid
|
476
470
|
noResizing: true, // ColumnResizing Extension
|
477
471
|
resizable: false, // ResizableTitlePlugin
|
478
|
-
|
472
|
+
title: "",
|
473
|
+
tooltip: "",
|
474
|
+
// headerRenderer: CheckboxPlugin._emptyFunc, // rt-grid support
|
479
475
|
filterInput: { disabled: true },
|
480
476
|
field: this._checkboxField,
|
481
477
|
notRealTimeField: true, // Checkbox column is not a real-time field
|
@@ -487,6 +483,26 @@ CheckboxPlugin.prototype._genCheckboxColumn = function () {
|
|
487
483
|
bind: CheckboxPlugin._emptyFunc
|
488
484
|
}
|
489
485
|
};
|
486
|
+
|
487
|
+
if(userObj && !userObj.autoGenerated) {
|
488
|
+
if(userObj.field && this._checkboxField === "CHECK_BOX") {
|
489
|
+
this._checkboxField = userObj.field;
|
490
|
+
}
|
491
|
+
if(userObj.width && this._width === 34) {
|
492
|
+
this._width = +userObj.width;
|
493
|
+
}
|
494
|
+
|
495
|
+
for(var key in defaultObj) {
|
496
|
+
var userVal = userObj[key];
|
497
|
+
if(userVal == null) {
|
498
|
+
userObj[key] = defaultObj[key];
|
499
|
+
}
|
500
|
+
}
|
501
|
+
return userObj;
|
502
|
+
}
|
503
|
+
|
504
|
+
defaultObj.autoGenerated = true;
|
505
|
+
return defaultObj;
|
490
506
|
};
|
491
507
|
|
492
508
|
/** @private
|
@@ -620,9 +636,6 @@ CheckboxPlugin.prototype._createCheckbox = function (sectionSettings, colIndex,
|
|
620
636
|
|
621
637
|
cell.setContent(chkbox);
|
622
638
|
var sectionType = sectionSettings.getType();
|
623
|
-
if(sectionType == "title") {
|
624
|
-
cell.enableClass("no-sort");
|
625
|
-
}
|
626
639
|
|
627
640
|
if(!this._coralCheckboxVer) { // Workaround for UIFR theme styling
|
628
641
|
var lbl = document.createElement("label");
|
@@ -703,6 +716,35 @@ CheckboxPlugin.prototype.setAllCheckStates = function (checked) {
|
|
703
716
|
}
|
704
717
|
};
|
705
718
|
|
719
|
+
/** Set state for all checkboxes regardless of pagination, state would be apply to all filtered data
|
720
|
+
* @public
|
721
|
+
* @param {boolean=} checked Truthy or Falsy value
|
722
|
+
* @see {@link CheckboxPlugin#checkAll}
|
723
|
+
*/
|
724
|
+
CheckboxPlugin.prototype.selectAllPages = function (checked) {
|
725
|
+
var state = checked != null ? checked : true;
|
726
|
+
var host = this._hosts[0];
|
727
|
+
var dv = host ? host.getDataSource() : null;
|
728
|
+
|
729
|
+
if(dv) {
|
730
|
+
var allRids = dv.getSortedRowIds(true); // All row ids with filter applied, including disabled and pagination
|
731
|
+
|
732
|
+
// remove disabled row
|
733
|
+
var rids = [];
|
734
|
+
var dataRows = dv.getMultipleRowData(allRids);
|
735
|
+
var len = dataRows.length;
|
736
|
+
var dataRow;
|
737
|
+
for(var i = 0; i < len; i++) {
|
738
|
+
dataRow = this._rowGetter(dataRows[i]);
|
739
|
+
if(dataRow && !dataRow[this._disablingField]) {
|
740
|
+
rids.push(allRids[i]);
|
741
|
+
}
|
742
|
+
}
|
743
|
+
var valueList = CheckboxPlugin._genData(rids.length, state);
|
744
|
+
this._setColumnData(dv, this._checkboxField, valueList, rids);
|
745
|
+
}
|
746
|
+
};
|
747
|
+
|
706
748
|
/** @public
|
707
749
|
* @param {number|string} rowRef Row id in the data table or row index
|
708
750
|
* @param {boolean} disabled Truthy or Falsy value
|
@@ -967,6 +1009,9 @@ CheckboxPlugin.prototype._getAllCheckboxes = function (sectionSettings, ary) {
|
|
967
1009
|
* @param {string} state
|
968
1010
|
*/
|
969
1011
|
CheckboxPlugin.prototype._setDescendantCheckState = function (sectionSettings, state) {
|
1012
|
+
if(!this._topCheckboxHandler){
|
1013
|
+
return;
|
1014
|
+
}
|
970
1015
|
var children = sectionSettings.getChildren();
|
971
1016
|
if (children) {
|
972
1017
|
for (var i = 0; i < children.length; ++i) {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
3
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
3
4
|
/** @typedef {Array<ColumnGroupingPlugin~GroupDefinition>} ColumnGroupingPlugin~Options
|
4
5
|
* @description This options can be specified by `columnGrouping` property of the main grid's options or extension options.
|
5
6
|
*/
|
@@ -149,6 +150,15 @@ ColumnGroupingPlugin.prototype.initialize = function (host, options) {
|
|
149
150
|
if (this._initializedGrid && host.getSection("title")) {
|
150
151
|
// For run-time loading
|
151
152
|
this._applyGrouping();
|
153
|
+
}
|
154
|
+
|
155
|
+
if (!ColumnGroupingPlugin._styles) {
|
156
|
+
ColumnGroupingPlugin._styles = prettifyCss([".tr-grid .title .column .cell:not(:last-child)", ["box-shadow: none;"]]);
|
157
|
+
}
|
158
|
+
|
159
|
+
if (!host._columnGroupingStyles) {
|
160
|
+
host._columnGroupingStyles = true;
|
161
|
+
injectCss(ColumnGroupingPlugin._styles, host.getElement());
|
152
162
|
} // TODO: wrong render group in hide/show column
|
153
163
|
|
154
164
|
};
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
2
2
|
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
3
3
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
4
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
5
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
4
6
|
|
5
7
|
declare namespace ColumnSelectionPlugin {
|
6
8
|
|
7
9
|
type Options = {
|
8
10
|
singleSelection?: boolean,
|
9
11
|
clickToggle?: boolean,
|
10
|
-
selectionChanged?: ((...params: any[]) => any)
|
12
|
+
selectionChanged?: ((...params: any[]) => any),
|
13
|
+
menuClicked?: ((...params: any[]) => any),
|
14
|
+
menuPosition?: string
|
11
15
|
};
|
12
16
|
|
13
17
|
type ColumnOptions = {
|
@@ -3,6 +3,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
3
3
|
import { Ext } from "../../tr-grid-util/es6/Ext.js";
|
4
4
|
import { Dom } from "../../tr-grid-util/es6/Dom.js";
|
5
5
|
import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
6
|
+
import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
|
7
|
+
import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
|
6
8
|
/** @event ColumnSelectionPlugin#selectionChanged
|
7
9
|
* @description Fired when selection is changed by mouse down or key press. A change by JavaScript APIs will not trigger this event.
|
8
10
|
*/
|
@@ -12,6 +14,8 @@ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
|
|
12
14
|
* @property {boolean=} singleSelection=false If enabled, user can have one selection at any moment
|
13
15
|
* @property {boolean=} clickToggle=false If enabled, click at the already selected column will deselect it
|
14
16
|
* @property {Function=} selectionChanged=null selectionChanged event handler
|
17
|
+
* @property {Function=} menuClicked=null Event Handler when user clicks on menu icon.
|
18
|
+
* @property {string=} menuPosition="outside" show icon in column grid that have style outside and non-outside
|
15
19
|
*/
|
16
20
|
|
17
21
|
/** @typedef {Object} ColumnSelectionPlugin~ColumnOptions
|
@@ -30,7 +34,11 @@ var ColumnSelectionPlugin = function ColumnSelectionPlugin(options) {
|
|
30
34
|
t._onMouseDown = t._onMouseDown.bind(t);
|
31
35
|
t._onKeyDown = t._onKeyDown.bind(t);
|
32
36
|
t._onColumnRemoved = t._onColumnRemoved.bind(t);
|
37
|
+
t._onColumnAdded = t._onColumnAdded.bind(t);
|
33
38
|
t._onReselection = t._onReselection.bind(t);
|
39
|
+
t._onThemeLoaded = t._onThemeLoaded.bind(t);
|
40
|
+
t._onColumnPositionChanged = t._onColumnPositionChanged.bind(t);
|
41
|
+
t._updateMenuIcon = t._updateMenuIcon.bind(t);
|
34
42
|
t._hosts = [];
|
35
43
|
|
36
44
|
if (options) {
|
@@ -81,7 +89,32 @@ ColumnSelectionPlugin.prototype._timerId = 0;
|
|
81
89
|
* @private
|
82
90
|
*/
|
83
91
|
|
84
|
-
ColumnSelectionPlugin.prototype.
|
92
|
+
ColumnSelectionPlugin.prototype._timerMenuId = 0;
|
93
|
+
/** @type {number}
|
94
|
+
* @private
|
95
|
+
*/
|
96
|
+
|
97
|
+
ColumnSelectionPlugin.prototype._pendingSelectionOnAdded = -1;
|
98
|
+
/** @type {Function}
|
99
|
+
* @private
|
100
|
+
*/
|
101
|
+
|
102
|
+
ColumnSelectionPlugin.prototype._pendingSelectionOnRemoved = -1;
|
103
|
+
/** @type {Function}
|
104
|
+
* @private
|
105
|
+
*/
|
106
|
+
|
107
|
+
ColumnSelectionPlugin.prototype._onMenuClicked = null;
|
108
|
+
/** @type {Object}
|
109
|
+
* @private
|
110
|
+
*/
|
111
|
+
|
112
|
+
ColumnSelectionPlugin.prototype._menuButton = null;
|
113
|
+
/** @type {string}
|
114
|
+
* @private
|
115
|
+
*/
|
116
|
+
|
117
|
+
ColumnSelectionPlugin.prototype._menuPosition = "outside";
|
85
118
|
/** @public
|
86
119
|
* @return {string}
|
87
120
|
*/
|
@@ -115,7 +148,52 @@ ColumnSelectionPlugin.prototype.initialize = function (host, options) {
|
|
115
148
|
host.listen("mousedown", this._onMouseDown);
|
116
149
|
host.listen("keydown", this._onKeyDown);
|
117
150
|
host.listen("columnRemoved", this._onColumnRemoved);
|
151
|
+
host.listen("columnAdded", this._onColumnAdded);
|
152
|
+
host.listen("columnPositionChanged", this._onColumnPositionChanged);
|
118
153
|
this.config(options);
|
154
|
+
|
155
|
+
if (this._onMenuClicked) {
|
156
|
+
// use styles menu icon only when want to use icon menu
|
157
|
+
if (ColumnSelectionPlugin._stylePromise) {
|
158
|
+
ColumnSelectionPlugin._applyThemeColor(host);
|
159
|
+
} else {
|
160
|
+
ColumnSelectionPlugin._stylePromise = ElfUtil.getThemeColors();
|
161
|
+
|
162
|
+
ColumnSelectionPlugin._stylePromise.then(this._onThemeLoaded);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
};
|
166
|
+
/** @private
|
167
|
+
* @param {Object} colors
|
168
|
+
*/
|
169
|
+
|
170
|
+
|
171
|
+
ColumnSelectionPlugin.prototype._onThemeLoaded = function (colors) {
|
172
|
+
if (!ColumnSelectionPlugin._styles) {
|
173
|
+
var styles = [".column-selection-menu", ["position: absolute;", "background-color: var(--grid-column-menu-icon-bgcolor);", "color: var(--grid-column-menu-icon-color);", "z-index: 1;", "cursor: pointer;", "text-align: center;", "width: 16px;", "height: 16px;", "padding: 6px;"], ".column-selection-menu:hover", ["background-color: var(--grid-column-menu-icon-hover-bgcolor);"], ".column-selection-menu-inside", ["padding: 4px;" // if not outside icon, move to inside
|
174
|
+
]];
|
175
|
+
ColumnSelectionPlugin._styles = prettifyCss(styles);
|
176
|
+
}
|
177
|
+
|
178
|
+
for (var i = this._hosts.length; --i >= 0;) {
|
179
|
+
ColumnSelectionPlugin._applyThemeColor(this._hosts[i]);
|
180
|
+
}
|
181
|
+
};
|
182
|
+
/** @private
|
183
|
+
* @param {Object} grid core grid instance
|
184
|
+
*/
|
185
|
+
|
186
|
+
|
187
|
+
ColumnSelectionPlugin._applyThemeColor = function (grid) {
|
188
|
+
if (!grid || grid._columnSelectionStyles) {
|
189
|
+
return;
|
190
|
+
}
|
191
|
+
|
192
|
+
if (ColumnSelectionPlugin._styles) {
|
193
|
+
grid._columnSelectionStyles = true; // Prevent loading the same style twice
|
194
|
+
|
195
|
+
injectCss(ColumnSelectionPlugin._styles, grid.getParent());
|
196
|
+
}
|
119
197
|
};
|
120
198
|
/** @public
|
121
199
|
* @param {Object=} host core grid object
|
@@ -133,6 +211,8 @@ ColumnSelectionPlugin.prototype.unload = function (host) {
|
|
133
211
|
host.unlisten("mousedown", this._onMouseDown);
|
134
212
|
host.unlisten("keydown", this._onKeyDown);
|
135
213
|
host.unlisten("columnRemoved", this._onColumnRemoved);
|
214
|
+
host.unlisten("columnAdded", this._onColumnAdded);
|
215
|
+
host.unlisten("columnPositionChanged", this._onColumnPositionChanged);
|
136
216
|
|
137
217
|
this._hosts.splice(at, 1);
|
138
218
|
|
@@ -140,6 +220,7 @@ ColumnSelectionPlugin.prototype.unload = function (host) {
|
|
140
220
|
if (this._timerId) {
|
141
221
|
clearTimeout(this._timerId);
|
142
222
|
this._timerId = 0;
|
223
|
+
this._timerMenuId = 0;
|
143
224
|
}
|
144
225
|
}
|
145
226
|
|
@@ -171,6 +252,18 @@ ColumnSelectionPlugin.prototype.config = function (options) {
|
|
171
252
|
this._clickToggleMode = true;
|
172
253
|
}
|
173
254
|
|
255
|
+
val = pluginOptions["menuClicked"];
|
256
|
+
|
257
|
+
if (val) {
|
258
|
+
this._onMenuClicked = val;
|
259
|
+
}
|
260
|
+
|
261
|
+
val = pluginOptions["menuPosition"];
|
262
|
+
|
263
|
+
if (val) {
|
264
|
+
this._menuPosition = val;
|
265
|
+
}
|
266
|
+
|
174
267
|
this.addListener(pluginOptions, "selectionChanged");
|
175
268
|
}
|
176
269
|
} else if (pluginOptions != null) {
|
@@ -373,14 +466,18 @@ ColumnSelectionPlugin.prototype.setSelectedColumn = function (colIndex, opt_sele
|
|
373
466
|
}
|
374
467
|
|
375
468
|
this._hasSelection = selection ? true : null;
|
376
|
-
this.
|
469
|
+
this._pendingSelectionOnAdded = -1; // New selection happens before resolving the pending selection
|
470
|
+
|
471
|
+
this._pendingSelectionOnRemoved = -1; // New selection happens before resolving the pending selection
|
377
472
|
|
378
473
|
var len = this._hosts.length;
|
379
474
|
|
380
475
|
for (var i = 0; i < len; ++i) {
|
381
|
-
this._hosts[i].
|
476
|
+
this._hosts[i].selectColumn(colIndex, selection);
|
382
477
|
}
|
383
478
|
|
479
|
+
this._updateMenuIcon();
|
480
|
+
|
384
481
|
return true;
|
385
482
|
};
|
386
483
|
/** Select the specified column on an active grid, and clear all other column selections
|
@@ -428,6 +525,127 @@ ColumnSelectionPlugin.prototype.selectRange = function (anchorIndex, len, opt_gr
|
|
428
525
|
ColumnSelectionPlugin.prototype.selectAllColumns = function () {
|
429
526
|
this.selectRange(0, this.getColumnCount());
|
430
527
|
};
|
528
|
+
/** @private
|
529
|
+
* @param {Object} e
|
530
|
+
*/
|
531
|
+
|
532
|
+
|
533
|
+
ColumnSelectionPlugin.prototype._onColumnPositionChanged = function (e) {
|
534
|
+
if (this._timerMenuId) {
|
535
|
+
return;
|
536
|
+
}
|
537
|
+
|
538
|
+
if (e.sender && e.sender === this._activeGrid) {
|
539
|
+
this._clearMenuIcon(); // Clear icon before re-renderer
|
540
|
+
|
541
|
+
|
542
|
+
this._timerMenuId = setTimeout(this._updateMenuIcon, 800);
|
543
|
+
}
|
544
|
+
};
|
545
|
+
/** @private
|
546
|
+
* @return {boolean} return true if icon added
|
547
|
+
*/
|
548
|
+
|
549
|
+
|
550
|
+
ColumnSelectionPlugin.prototype._updateMenuIcon = function () {
|
551
|
+
this._timerMenuId = 0;
|
552
|
+
|
553
|
+
if (!this._onMenuClicked) {
|
554
|
+
// When not set to onMenuClicked, the icon is not displayed
|
555
|
+
return false;
|
556
|
+
}
|
557
|
+
|
558
|
+
var startColIndex = this.getFirstSelectedColumn();
|
559
|
+
var host = this._activeGrid;
|
560
|
+
|
561
|
+
if (startColIndex < 0 || !host) {
|
562
|
+
this._clearMenuIcon();
|
563
|
+
|
564
|
+
return false;
|
565
|
+
}
|
566
|
+
|
567
|
+
var parentEl = host.getParent().parentNode;
|
568
|
+
var endColIndex = this.getLastSelectedColumn();
|
569
|
+
var rectPos = host.getColumnRect(startColIndex, endColIndex);
|
570
|
+
|
571
|
+
if (rectPos.width <= 0 || rectPos.left > rectPos.gridWidth) {
|
572
|
+
// hide icon when selection left or right not show.
|
573
|
+
this._clearMenuIcon();
|
574
|
+
|
575
|
+
return false;
|
576
|
+
}
|
577
|
+
|
578
|
+
if (!this._menuButton) {
|
579
|
+
this._menuButton = document.createElement("div");
|
580
|
+
|
581
|
+
this._menuButton.classList.add("column-selection-menu");
|
582
|
+
|
583
|
+
if (this._menuPosition !== "outside") {
|
584
|
+
this._menuButton.classList.add("column-selection-menu-inside"); // currently not support runtime change
|
585
|
+
|
586
|
+
}
|
587
|
+
|
588
|
+
var coralItem = document.createElement("ef-icon");
|
589
|
+
coralItem.icon = "most-detail";
|
590
|
+
|
591
|
+
this._menuButton.appendChild(coralItem);
|
592
|
+
|
593
|
+
this._menuButton.addEventListener("click", this._onMenuClicked);
|
594
|
+
}
|
595
|
+
|
596
|
+
parentEl.appendChild(this._menuButton);
|
597
|
+
var c;
|
598
|
+
var iconSize = 28; // calculate actual view when have pinned right
|
599
|
+
|
600
|
+
var pinnedLeftCount = rectPos.leftPinnedIndex;
|
601
|
+
var pinnedLeftSize = 0;
|
602
|
+
|
603
|
+
for (c = 0; c <= pinnedLeftCount; c++) {
|
604
|
+
// include index 0 from leftPinnedIndex
|
605
|
+
pinnedLeftSize = pinnedLeftSize + host.getColumnWidth(c);
|
606
|
+
}
|
607
|
+
|
608
|
+
var rightPx = rectPos.left + rectPos.width;
|
609
|
+
var leftOffset = rightPx;
|
610
|
+
var topOffset = rectPos.top;
|
611
|
+
|
612
|
+
if (this._menuPosition !== "outside") {
|
613
|
+
iconSize = 24; // edit size icon and re-calculate
|
614
|
+
|
615
|
+
this._menuButton.classList.add("column-selection-menu-inside");
|
616
|
+
|
617
|
+
var actualView = rightPx + iconSize;
|
618
|
+
var endRightPosition = rectPos.scrollViewSize + pinnedLeftSize; // rectPos.scrollViewSize doesn't including pinned left size
|
619
|
+
|
620
|
+
if (actualView >= endRightPosition) {
|
621
|
+
// case swap top right to left side column, when can't add menu in right side (overflow right)
|
622
|
+
leftOffset = rectPos.left - iconSize;
|
623
|
+
|
624
|
+
if (leftOffset < 0) {
|
625
|
+
// only case select all row in inside mode
|
626
|
+
leftOffset = rectPos.gridWidth - iconSize;
|
627
|
+
}
|
628
|
+
}
|
629
|
+
} else {
|
630
|
+
// TODO : support in another mode currently have "outside" and "inside"
|
631
|
+
if (rightPx >= rectPos.gridWidth) {
|
632
|
+
leftOffset = rectPos.gridWidth; // Menu move to the right size if inside mode when overflow grid
|
633
|
+
}
|
634
|
+
}
|
635
|
+
|
636
|
+
this._menuButton.style.left = leftOffset + "px"; // Menu icon position in top right
|
637
|
+
|
638
|
+
this._menuButton.style.top = topOffset + "px";
|
639
|
+
return true;
|
640
|
+
};
|
641
|
+
/** @private */
|
642
|
+
|
643
|
+
|
644
|
+
ColumnSelectionPlugin.prototype._clearMenuIcon = function () {
|
645
|
+
if (this._menuButton && this._menuButton.parentNode) {
|
646
|
+
this._menuButton.parentNode.removeChild(this._menuButton);
|
647
|
+
}
|
648
|
+
};
|
431
649
|
/** @public */
|
432
650
|
|
433
651
|
|
@@ -438,13 +656,15 @@ ColumnSelectionPlugin.prototype.clearAllSelections = function () {
|
|
438
656
|
for (var c = this.getColumnCount(); --c >= 0;) {
|
439
657
|
if (this.isSelectedColumn(c)) {
|
440
658
|
for (var i = 0; i < tableCount; ++i) {
|
441
|
-
this._hosts[i].
|
659
|
+
this._hosts[i].selectColumn(c, false);
|
442
660
|
}
|
443
661
|
}
|
444
662
|
}
|
445
663
|
|
446
664
|
this._hasSelection = false;
|
447
665
|
this._activeGrid = this._hosts[0] || null; // Maintain selectability even if there is no selection
|
666
|
+
|
667
|
+
this._clearMenuIcon();
|
448
668
|
}
|
449
669
|
};
|
450
670
|
/** Alias to clearAllSelections() method
|
@@ -492,7 +712,7 @@ ColumnSelectionPlugin.prototype.deselectAll = ColumnSelectionPlugin.prototype.cl
|
|
492
712
|
|
493
713
|
ColumnSelectionPlugin.prototype.isSelectedColumn = function (colIndex) {
|
494
714
|
if (this._activeGrid) {
|
495
|
-
return this._activeGrid.
|
715
|
+
return this._activeGrid.isSelectedColumn(colIndex);
|
496
716
|
}
|
497
717
|
|
498
718
|
return false;
|
@@ -657,7 +877,13 @@ ColumnSelectionPlugin.prototype._onKeyDown = function (e) {
|
|
657
877
|
|
658
878
|
|
659
879
|
ColumnSelectionPlugin.prototype._onColumnRemoved = function (e) {
|
880
|
+
var colIndex = e.colIndex;
|
881
|
+
|
660
882
|
if (this._timerId) {
|
883
|
+
if (this._pendingSelectionOnAdded > 0 && colIndex < this._pendingSelectionOnAdded) {
|
884
|
+
this._pendingSelectionOnAdded = this._pendingSelectionOnAdded - 1;
|
885
|
+
}
|
886
|
+
|
661
887
|
return;
|
662
888
|
} // Since column and its selection state has been removed, we have to keep track of the first selection across multiple calls
|
663
889
|
|
@@ -669,14 +895,39 @@ ColumnSelectionPlugin.prototype._onColumnRemoved = function (e) {
|
|
669
895
|
// The last selection has been removed
|
670
896
|
this._hasSelection = false;
|
671
897
|
|
672
|
-
if (this.
|
673
|
-
this.
|
898
|
+
if (this._pendingSelectionOnRemoved < 0) {
|
899
|
+
if (colIndex >= this.getColumnCount()) {
|
900
|
+
colIndex = this.getColumnCount() - 1;
|
901
|
+
}
|
902
|
+
|
903
|
+
this._pendingSelectionOnRemoved = colIndex;
|
674
904
|
}
|
675
905
|
|
676
906
|
this._timerId = setTimeout(this._onReselection, 10);
|
677
907
|
} else {
|
678
|
-
this.
|
908
|
+
this._pendingSelectionOnRemoved = firstSel;
|
909
|
+
}
|
910
|
+
}
|
911
|
+
};
|
912
|
+
/** @private
|
913
|
+
* @param {Object} e
|
914
|
+
*/
|
915
|
+
|
916
|
+
|
917
|
+
ColumnSelectionPlugin.prototype._onColumnAdded = function (e) {
|
918
|
+
if (this._timerId) {
|
919
|
+
this._pendingSelectionOnAdded = e.colIndex;
|
920
|
+
return;
|
921
|
+
}
|
922
|
+
|
923
|
+
if (this._hasSelection) {
|
924
|
+
this.clearAllSelections();
|
925
|
+
|
926
|
+
if (this._pendingSelectionOnAdded < 0) {
|
927
|
+
this._pendingSelectionOnAdded = e.colIndex;
|
679
928
|
}
|
929
|
+
|
930
|
+
this._timerId = setTimeout(this._onReselection, 10);
|
680
931
|
}
|
681
932
|
};
|
682
933
|
/** @private
|
@@ -686,8 +937,16 @@ ColumnSelectionPlugin.prototype._onColumnRemoved = function (e) {
|
|
686
937
|
|
687
938
|
ColumnSelectionPlugin.prototype._onReselection = function (e) {
|
688
939
|
this._timerId = 0;
|
689
|
-
this.
|
690
|
-
this.
|
940
|
+
var pendingSelection = this._pendingSelectionOnAdded > -1 ? this._pendingSelectionOnAdded : this._pendingSelectionOnRemoved;
|
941
|
+
this.setSelectedColumn(pendingSelection, true);
|
942
|
+
this._pendingSelectionOnAdded = -1;
|
943
|
+
this._pendingSelectionOnRemoved = -1;
|
944
|
+
|
945
|
+
if (!this._activeGrid) {
|
946
|
+
this._activeGrid = this._hosts[0];
|
947
|
+
}
|
948
|
+
|
949
|
+
this._activeGrid.focus();
|
691
950
|
};
|
692
951
|
/** @private
|
693
952
|
* @param {KeyboardEvent} e
|
@@ -9,6 +9,10 @@ import { preventDefault } from "../../tr-grid-util/es6/EventDispatcher.js";
|
|
9
9
|
|
10
10
|
declare namespace ColumnStackPlugin {
|
11
11
|
|
12
|
+
type Options = {
|
13
|
+
fields: (string)[]
|
14
|
+
};
|
15
|
+
|
12
16
|
type ColumnOptions = {
|
13
17
|
stackId?: string,
|
14
18
|
stack?: (string|StackOptions)
|
@@ -34,11 +38,11 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
34
38
|
|
35
39
|
public getConfigObject(gridOptions?: any): any;
|
36
40
|
|
37
|
-
public getMemberIndices(colIndex: number): (number)[];
|
41
|
+
public getMemberIndices(colIndex: number): (number)[]|null;
|
38
42
|
|
39
|
-
public collapseGroup(colIndex: number, collapsed?: boolean): (number)[];
|
43
|
+
public collapseGroup(colIndex: number, collapsed?: boolean): (number)[]|null;
|
40
44
|
|
41
|
-
public expandGroup(colIndex: number): (number)[];
|
45
|
+
public expandGroup(colIndex: number): (number)[]|null;
|
42
46
|
|
43
47
|
public isColumnStackable(colIndices: (number)[]): boolean;
|
44
48
|
|
@@ -60,7 +64,7 @@ declare class ColumnStackPlugin extends GridPlugin {
|
|
60
64
|
|
61
65
|
public getStackId(colIndex: number): string;
|
62
66
|
|
63
|
-
public stackColumns(
|
67
|
+
public stackColumns(colRefs?: (number|string)[], stackId?: string, options?: any): boolean;
|
64
68
|
|
65
69
|
public setStack(colRefs: (number|string)[]): boolean;
|
66
70
|
|