@refinitiv-ui/efx-grid 6.0.3 → 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/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +389 -1070
- 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 +1 -1
- package/lib/core/es6/data/DataView.d.ts +12 -12
- package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
- package/lib/core/es6/data/WrappedView.d.ts +13 -13
- package/lib/core/es6/grid/Core.d.ts +29 -27
- package/lib/core/es6/grid/Core.js +26 -4
- package/lib/core/es6/grid/ILayoutGrid.d.ts +15 -15
- package/lib/core/es6/grid/LayoutGrid.js +54 -26
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +66 -0
- package/lib/core/es6/grid/components/Cell.d.ts +4 -4
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +1 -1
- package/lib/core/es6/grid/components/CellSpans.d.ts +8 -8
- package/lib/core/es6/grid/components/Column.d.ts +1 -1
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +6 -6
- package/lib/core/es6/grid/components/Scrollbar.d.ts +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 +27 -0
- package/lib/core/es6/grid/util/util.d.ts +2 -2
- package/lib/core/es6/index.d.ts +1 -5
- package/lib/core/es6/index.js +1 -7
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -0
- package/lib/filter-dialog/lib/filter-dialog.js +73 -26
- package/lib/filter-dialog/themes/base-checkbox.less +8 -1
- package/lib/filter-dialog/themes/base.less +69 -1
- package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/halo/light/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/halo/light/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +1 -1
- package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +2 -2
- package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +1 -1
- package/lib/grid/lib/efx-grid.d.ts +8 -5
- package/lib/grid/lib/efx-grid.js +10 -4
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +33 -39
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +7 -2
- package/lib/row-segmenting/es6/RowSegmenting.js +94 -9
- package/lib/rt-grid/dist/rt-grid.js +567 -1171
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +5 -3
- package/lib/rt-grid/es6/ColumnDefinition.js +17 -108
- package/lib/rt-grid/es6/DataConnector.d.ts +3 -3
- package/lib/rt-grid/es6/Grid.d.ts +17 -9
- package/lib/rt-grid/es6/Grid.js +201 -101
- package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
- package/lib/rt-grid/es6/RowDefSorter.js +137 -0
- package/lib/rt-grid/es6/RowDefinition.d.ts +9 -7
- package/lib/rt-grid/es6/RowDefinition.js +6 -0
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -1
- package/lib/rt-grid/es6/SnapshotFiller.js +23 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -2
- package/lib/tr-grid-checkbox/es6/Checkbox.js +38 -20
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +46 -9
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +8 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +240 -125
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +1 -1
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +18 -12
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +7 -4
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +93 -2
- 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 +2 -1
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +29 -143
- package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +7 -2
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +97 -7
- package/lib/tr-grid-row-selection/es6/RowSelection.js +10 -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/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/ElfUtil.js +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.js +7 -5
- package/lib/tr-grid-util/es6/GridPlugin.js +8 -4
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
- package/lib/tr-grid-util/es6/RowPainter.js +41 -11
- package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
- package/lib/types/es6/Checkbox.d.ts +2 -2
- 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 +12 -12
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
- package/lib/types/es6/Core/data/WrappedView.d.ts +13 -13
- package/lib/types/es6/Core/grid/Core.d.ts +29 -27
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +15 -15
- package/lib/types/es6/Core/grid/components/Cell.d.ts +4 -4
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +1 -1
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +8 -8
- package/lib/types/es6/Core/grid/components/Column.d.ts +1 -1
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +6 -6
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +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/InCellEditing.d.ts +7 -4
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +5 -3
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +17 -9
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +9 -7
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -1
- package/lib/types/es6/RowDragging.d.ts +2 -1
- package/lib/types/es6/RowGrouping.d.ts +7 -2
- package/lib/types/es6/RowSegmenting.d.ts +7 -2
- package/lib/types/es6/TextFormatting.d.ts +1 -1
- package/lib/versions.json +14 -13
- package/package.json +1 -1
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
- package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +0 -615
- package/lib/core/es6/grid/plugins/Plugin.d.ts +0 -28
- package/lib/core/es6/grid/plugins/Plugin.js +0 -272
- package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +0 -24
- package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +0 -28
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
import Ext from "../../../../tr-grid-util/es6/Ext.js";
|
3
|
-
import
|
3
|
+
import EventDispatcher from "../event/EventDispatcher.js";
|
4
4
|
import Core from "../Core.js";
|
5
5
|
import ILayoutGrid from "../ILayoutGrid.js";
|
6
6
|
import ElementWrapper from "../components/ElementWrapper.js";
|
@@ -40,7 +40,7 @@ import DataTable from "../../data/DataTable.js";
|
|
40
40
|
*/
|
41
41
|
|
42
42
|
/** @constructor
|
43
|
-
* @extends {
|
43
|
+
* @extends {EventDispatcher}
|
44
44
|
* @param {SortableTitlePlugin.Options=} options
|
45
45
|
*/
|
46
46
|
var SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlugin to grid extension.
|
@@ -72,7 +72,7 @@ var SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlu
|
|
72
72
|
_t.config({ "sorting": options });
|
73
73
|
}
|
74
74
|
};
|
75
|
-
Ext.inherits(SortableTitlePlugin,
|
75
|
+
Ext.inherits(SortableTitlePlugin, EventDispatcher);
|
76
76
|
|
77
77
|
/**
|
78
78
|
* @typedef {"a" | "ascending" | "d" | "descending" | "n" | null} SortableTitlePlugin~SortOrder
|
@@ -118,6 +118,12 @@ SortableTitlePlugin.ColumnOptions;
|
|
118
118
|
*/
|
119
119
|
SortableTitlePlugin.Options;
|
120
120
|
|
121
|
+
|
122
|
+
/** @type {Array.<Core>}
|
123
|
+
* @private
|
124
|
+
*/
|
125
|
+
SortableTitlePlugin.prototype._hosts = null; // For a plug-in that support multi-table
|
126
|
+
|
121
127
|
/** Order of item indicates sort priorities used in DataView. <br>
|
122
128
|
* Each state contains column name{string}, sort order {string}, and rendering cell {ElementWrapper}
|
123
129
|
* @private
|
@@ -222,13 +228,17 @@ var CODE_DOWN = "\u25BC";
|
|
222
228
|
*/
|
223
229
|
var CODE_DIAMOND = "\u25CA";
|
224
230
|
|
225
|
-
/**
|
231
|
+
/** The name must be readonly and unique among all other plugins
|
232
|
+
* @public
|
233
|
+
* @return {string}
|
234
|
+
*/
|
226
235
|
SortableTitlePlugin.prototype.getName = function () {
|
227
236
|
return "SortableTitlePlugin"; // Read Only
|
228
237
|
};
|
229
238
|
|
230
|
-
/**
|
231
|
-
* @
|
239
|
+
/** @public
|
240
|
+
* @param {!Core} host
|
241
|
+
* @param {Object=} options
|
232
242
|
* @description Suppress google compiler for argument options because Internal Plugin doesn't support.
|
233
243
|
* @suppress {checkTypes}
|
234
244
|
*/
|
@@ -247,7 +257,10 @@ SortableTitlePlugin.prototype.initialize = function (host, options) {
|
|
247
257
|
this.config(options);
|
248
258
|
};
|
249
259
|
|
250
|
-
/**
|
260
|
+
/**For disposing any resource
|
261
|
+
* @public
|
262
|
+
* @param {!Core} host
|
263
|
+
*/
|
251
264
|
SortableTitlePlugin.prototype.unload = function (host) {
|
252
265
|
var at = this._hosts.indexOf(host);
|
253
266
|
if (at < 0) { return; }
|
@@ -638,31 +651,18 @@ SortableTitlePlugin.prototype.getSortOrder = function (colIndex) {
|
|
638
651
|
* @return {number} Return negative value if there is no sorted column
|
639
652
|
*/
|
640
653
|
SortableTitlePlugin.prototype.getSortedColumnIndex = function (priority) {
|
641
|
-
|
642
|
-
if (state) {
|
643
|
-
var host = this._hosts[0];
|
644
|
-
var colCount = host ? host.getColumnCount() : 0;
|
645
|
-
for (var c = 0; c < colCount; ++c) {
|
646
|
-
var sortOptions = this._getSortOptions(c);
|
647
|
-
if (sortOptions === state) {
|
648
|
-
return c;
|
649
|
-
}
|
650
|
-
}
|
651
|
-
}
|
652
|
-
return -1;
|
654
|
+
return this._getColumnIndexByOptions(this._sortStates[priority || 0]);
|
653
655
|
};
|
654
|
-
/**
|
656
|
+
/** Start with 0 (the first column that is being sorted). The highest number will be sorted last. Negative value means the specified column is not sorted
|
657
|
+
* @public
|
655
658
|
* @param {number} colIndex
|
656
|
-
* @return {number}
|
659
|
+
* @return {number}
|
657
660
|
*/
|
658
661
|
SortableTitlePlugin.prototype.getSortPriority = function (colIndex) {
|
659
|
-
var
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
if (this._sortStates[i] === sortOptions) {
|
664
|
-
return i;
|
665
|
-
}
|
662
|
+
var len = this._sortStates.length;
|
663
|
+
for (var i = 0; i < len; ++i) {
|
664
|
+
if (this._sortStates[i] === this._getSortOptions(colIndex)) {
|
665
|
+
return i;
|
666
666
|
}
|
667
667
|
}
|
668
668
|
return -1;
|
@@ -675,7 +675,7 @@ SortableTitlePlugin.prototype.isColumnSorted = function (colIndex) {
|
|
675
675
|
return this.getSortPriority(colIndex) >= 0;
|
676
676
|
};
|
677
677
|
/** @public
|
678
|
-
* @return {Array.<Object>
|
678
|
+
* @return {Array.<Object>} Array of object with "colIndex" and "sortOrder"
|
679
679
|
*/
|
680
680
|
SortableTitlePlugin.prototype.getSortedColumns = function () {
|
681
681
|
var len = this._sortStates.length;
|
@@ -684,28 +684,33 @@ SortableTitlePlugin.prototype.getSortedColumns = function () {
|
|
684
684
|
var arr = new Array(len);
|
685
685
|
for (var i = 0; i < len; ++i) {
|
686
686
|
var colIndex = this.getSortedColumnIndex(i);
|
687
|
+
var state = this._sortStates[i];
|
687
688
|
arr[i] = {
|
688
689
|
"colIndex": colIndex,
|
689
|
-
"
|
690
|
+
"field": state["field"] || "",
|
691
|
+
"sortOrder": state["sortOrder"] || "n"
|
690
692
|
};
|
691
693
|
}
|
692
694
|
return arr;
|
693
695
|
};
|
696
|
+
/** @public
|
697
|
+
* @return {boolean}
|
698
|
+
*/
|
699
|
+
SortableTitlePlugin.prototype.isSorting = function () {
|
700
|
+
return this._sortStates.length ? true : false;
|
701
|
+
};
|
694
702
|
|
695
703
|
/** @public
|
696
|
-
* @param {number}
|
704
|
+
* @param {number|string} colRef Column index or field
|
697
705
|
* @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
|
698
706
|
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
699
707
|
* @fires SortableTitlePlugin#preDataSorting
|
700
708
|
* @fires SortableTitlePlugin#columnSorted
|
701
709
|
*/
|
702
|
-
SortableTitlePlugin.prototype.sortColumn = function (
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
if (state) {
|
707
|
-
this._sortColumn([state], opt_arg);
|
708
|
-
}
|
710
|
+
SortableTitlePlugin.prototype.sortColumn = function (colRef, sortOrder, opt_arg) {
|
711
|
+
var state = this._prepareSorting(colRef, sortOrder);
|
712
|
+
if (state) {
|
713
|
+
this._sortColumn([state], opt_arg);
|
709
714
|
}
|
710
715
|
};
|
711
716
|
|
@@ -721,7 +726,14 @@ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
|
|
721
726
|
var states = [];
|
722
727
|
for (var i = 0; i < sortOptions.length; i++) {
|
723
728
|
var opt = sortOptions[i];
|
724
|
-
var
|
729
|
+
var colRef = opt["colIndex"];
|
730
|
+
if(colRef < 0 || colRef == null) {
|
731
|
+
colRef = opt["field"];
|
732
|
+
}
|
733
|
+
var state = this._prepareSorting(
|
734
|
+
colRef,
|
735
|
+
opt["sortOrder"] || opt["order"]
|
736
|
+
);
|
725
737
|
if (state) {
|
726
738
|
states[i] = state;
|
727
739
|
}
|
@@ -750,7 +762,6 @@ SortableTitlePlugin.prototype.refresh = function () {
|
|
750
762
|
|
751
763
|
/** @description Perform sorting with the same parameter. Alias to {@link SortableTitlePlugin#refresh}
|
752
764
|
* @public
|
753
|
-
* @override
|
754
765
|
* @function
|
755
766
|
*/
|
756
767
|
SortableTitlePlugin.prototype.restoreUserActions = SortableTitlePlugin.prototype.refresh;
|
@@ -818,20 +829,24 @@ SortableTitlePlugin.prototype.setDataColumnNames = SortableTitlePlugin.prototype
|
|
818
829
|
* @return {string} field A field used for sorting
|
819
830
|
*/
|
820
831
|
SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
|
821
|
-
var
|
832
|
+
var sortOptions = this._getSortOptions(colIndex);
|
822
833
|
// options["field"] is already consolidated from field, sortBy, and sortable properties.
|
823
|
-
var field = (
|
834
|
+
var field = (sortOptions) ? sortOptions["field"] : null;
|
824
835
|
|
825
|
-
if (field == null && !this._rowDefMode) { // Old CompositeGrid may
|
836
|
+
if (field == null && !this._rowDefMode) { // Old CompositeGrid may store sorting field in DataColumnName
|
826
837
|
var host = this._hosts[0];
|
827
838
|
if (host) {
|
828
839
|
field = host.getDataColumnName(colIndex);
|
840
|
+
if(field && sortOptions) {
|
841
|
+
sortOptions["field"] = field; // Cache for later use
|
842
|
+
}
|
829
843
|
}
|
830
844
|
}
|
831
845
|
|
832
846
|
return field || "";
|
833
847
|
};
|
834
|
-
/**
|
848
|
+
/** This is equivalent to setting sortBy in the configuration object.
|
849
|
+
* @public
|
835
850
|
* @param {number} colIndex
|
836
851
|
* @param {string|null} field A field used for sorting
|
837
852
|
* @param {Function=} sortLogic
|
@@ -852,21 +867,26 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
|
|
852
867
|
}
|
853
868
|
}
|
854
869
|
};
|
855
|
-
/**
|
870
|
+
/** Return array of the fields from the currently sorted columns
|
871
|
+
* @public
|
856
872
|
* @return {!Array.<string>} fields of each sorting states
|
857
873
|
*/
|
858
874
|
SortableTitlePlugin.prototype.getColumnSortingFields = function () {
|
859
|
-
var
|
875
|
+
var len = this._sortStates.length;
|
876
|
+
var ary = new Array(len);
|
860
877
|
var host = this._hosts[0];
|
861
|
-
|
862
|
-
for
|
863
|
-
var sortOptions = this.
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
878
|
+
|
879
|
+
for(var i = 0; i < len; ++i) {
|
880
|
+
var sortOptions = this._sortStates[i];
|
881
|
+
var field = sortOptions["field"];
|
882
|
+
if(!field && !this._rowDefMode) {
|
883
|
+
var colIndex = this._getColumnIndexByOptions(sortOptions); // Slow
|
884
|
+
field = host.getDataColumnName(colIndex);
|
885
|
+
if(field) {
|
886
|
+
sortOptions["field"] = field; // Cache for later use
|
868
887
|
}
|
869
888
|
}
|
889
|
+
ary[i] = field || "";
|
870
890
|
}
|
871
891
|
return ary;
|
872
892
|
};
|
@@ -1110,7 +1130,7 @@ SortableTitlePlugin.prototype._proceedSorting = function (hitObj) {
|
|
1110
1130
|
if (this._canClickToSort(hitObj)) {
|
1111
1131
|
var colIndex = hitObj["colIndex"];
|
1112
1132
|
// _proceedSorting() method is always produced by user clicking at the header // Thus, this operation is guaranteed to be a user action
|
1113
|
-
var state = this.
|
1133
|
+
var state = this._prepareSorting(colIndex);
|
1114
1134
|
if (state) {
|
1115
1135
|
this._sortColumn([state], { "isUserAction": true });
|
1116
1136
|
}
|
@@ -1134,6 +1154,14 @@ SortableTitlePlugin.prototype._onMouseDown = function (e) {
|
|
1134
1154
|
}
|
1135
1155
|
};
|
1136
1156
|
/** @private
|
1157
|
+
* @param {string} pluginName
|
1158
|
+
* @return {*|null}
|
1159
|
+
*/
|
1160
|
+
SortableTitlePlugin.prototype._getPlugin = function(pluginName) {
|
1161
|
+
var host = this._hosts[0];
|
1162
|
+
return (host) ? host.getPlugin(pluginName) : null;
|
1163
|
+
};
|
1164
|
+
/** @private
|
1137
1165
|
* @param {Core} grid
|
1138
1166
|
* @param {MouseEvent} e
|
1139
1167
|
*/
|
@@ -1288,23 +1316,36 @@ SortableTitlePlugin.prototype.clearAllColumnSortingSequences = function () {
|
|
1288
1316
|
|
1289
1317
|
|
1290
1318
|
/** @private
|
1291
|
-
* @param {number}
|
1319
|
+
* @param {number|string} colRef Column index or field
|
1292
1320
|
* @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
|
1293
1321
|
* @returns {Object} state Returns null, if nothing is changed
|
1294
1322
|
*/
|
1295
|
-
SortableTitlePlugin.prototype.
|
1296
|
-
if (!this._maxCount) {
|
1323
|
+
SortableTitlePlugin.prototype._prepareSorting = function (colRef, sortOrder) {
|
1324
|
+
if (!this._maxCount) {
|
1325
|
+
return null;
|
1326
|
+
}
|
1297
1327
|
|
1298
|
-
var
|
1299
|
-
var
|
1328
|
+
var colIndex = -1;
|
1329
|
+
var field = "";
|
1330
|
+
var priority = -1;
|
1331
|
+
if(typeof colRef === "number") {
|
1332
|
+
colIndex = colRef;
|
1333
|
+
field = this.getColumnSortingField(colIndex);
|
1334
|
+
priority = this.getSortPriority(colIndex);
|
1335
|
+
} else if(typeof colRef === "string") {
|
1336
|
+
field = colRef;
|
1337
|
+
colIndex = this._getColumnIndexByField(field);
|
1338
|
+
var fields = this.getColumnSortingFields();
|
1339
|
+
priority = fields.indexOf(field);
|
1340
|
+
}
|
1300
1341
|
|
1342
|
+
var curState = (priority >= 0) ? this._sortStates[priority] : null;
|
1301
1343
|
var curOrder = curState ? curState["sortOrder"] : "n";
|
1302
1344
|
|
1303
1345
|
// Getting next sort order
|
1304
1346
|
var nextOrder = "n";
|
1305
|
-
var sortingField = this.getColumnSortingField(colIndex);
|
1306
1347
|
if (sortOrder == null) { // Auto order switch
|
1307
|
-
var sortingSequence = this.getSortingSequence(
|
1348
|
+
var sortingSequence = this.getSortingSequence(field);
|
1308
1349
|
|
1309
1350
|
var sequenceIndex = sortingSequence.indexOf(curOrder);
|
1310
1351
|
if (sequenceIndex < 0) {
|
@@ -1329,10 +1370,16 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
|
|
1329
1370
|
}
|
1330
1371
|
|
1331
1372
|
if (nextOrder === "a" || nextOrder === "d") { // Reorder sort states
|
1373
|
+
if(colIndex < 0 && !field) {
|
1374
|
+
return null;
|
1375
|
+
}
|
1332
1376
|
if (!curState) {
|
1333
1377
|
// TODO: Sort state object should not be sortOptions
|
1334
1378
|
curState = this._newSortOptions(colIndex); // This may come with sortLogic
|
1335
1379
|
}
|
1380
|
+
if(colIndex < 0) {
|
1381
|
+
curState["field"] = field;
|
1382
|
+
}
|
1336
1383
|
|
1337
1384
|
this._sortStates.push(curState); // Latest sorting have lowest priority (multiColumn sorting)
|
1338
1385
|
}
|
@@ -1359,7 +1406,7 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
|
|
1359
1406
|
|
1360
1407
|
return { // TODO: Refactor this code as it is only used by "columnSorted" event (unnecessarily complex).
|
1361
1408
|
"colIndex": colIndex,
|
1362
|
-
"sortedField":
|
1409
|
+
"sortedField": field,
|
1363
1410
|
"sortOrder": nextOrder || "n",
|
1364
1411
|
"prevOrder": curOrder,
|
1365
1412
|
"clearedSortColIndexes": clearedSortColIndexes
|
@@ -1367,7 +1414,7 @@ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
|
|
1367
1414
|
};
|
1368
1415
|
|
1369
1416
|
/** @private
|
1370
|
-
* @param {Array.<Object>} states States from
|
1417
|
+
* @param {Array.<Object>} states States from _prepareSorting for dispatching columnSorted event.
|
1371
1418
|
* @param {Object=} opt_arg Event argument to be sent with preDataSorting event
|
1372
1419
|
* @fires SortableTitlePlugin#preDataSorting
|
1373
1420
|
* @fires SortableTitlePlugin#columnSorted
|
@@ -1394,8 +1441,8 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
|
|
1394
1441
|
this._dispatch("columnSorted", res);
|
1395
1442
|
};
|
1396
1443
|
|
1397
|
-
/** @
|
1398
|
-
* @
|
1444
|
+
/** @private
|
1445
|
+
* @param {Object} e
|
1399
1446
|
*/
|
1400
1447
|
SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
1401
1448
|
var t = this;
|
@@ -1417,8 +1464,8 @@ SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
|
1417
1464
|
}
|
1418
1465
|
};
|
1419
1466
|
|
1420
|
-
/** @
|
1421
|
-
* @
|
1467
|
+
/** @private
|
1468
|
+
* @param {Object} e
|
1422
1469
|
* @fires SortableTitlePlugin#preDataSorting
|
1423
1470
|
* @fires SortableTitlePlugin#columnSorted
|
1424
1471
|
*/
|
@@ -1470,7 +1517,7 @@ SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
|
|
1470
1517
|
sortLogics = new Array(sortCount);
|
1471
1518
|
for (var i = 0; i < sortCount; ++i) {
|
1472
1519
|
orders[i] = this._sortStates[i]["sortOrder"];
|
1473
|
-
sortLogics[i] = this._sortStates[i]["sortLogic"];
|
1520
|
+
sortLogics[i] = this._sortStates[i]["sortLogic"]; // sortLogic can be null
|
1474
1521
|
}
|
1475
1522
|
if(this._rowDefMode) { // DataView in real-time grid has only ROW_DEF column
|
1476
1523
|
c_ref = this._sortStates.map(SortableTitlePlugin._toRowDefField);
|
@@ -1552,7 +1599,7 @@ SortableTitlePlugin.prototype._updateSortableIndicator = function (hostIndex) {
|
|
1552
1599
|
|
1553
1600
|
cell["addClass"]("sortable");
|
1554
1601
|
|
1555
|
-
var priority = t.
|
1602
|
+
var priority = t.getSortPriority(col);
|
1556
1603
|
var state = t._sortStates[priority];
|
1557
1604
|
|
1558
1605
|
var isSorting = state && state["sortOrder"] !== "n";
|
@@ -1623,18 +1670,40 @@ SortableTitlePlugin.prototype._createIconElem = function (icon, fallback) {
|
|
1623
1670
|
};
|
1624
1671
|
|
1625
1672
|
/** @private
|
1626
|
-
|
1627
|
-
* @return {number}
|
1673
|
+
* @param {Object} sortOptions
|
1674
|
+
* @return {number}
|
1628
1675
|
*/
|
1629
|
-
SortableTitlePlugin.prototype.
|
1630
|
-
|
1631
|
-
|
1632
|
-
var
|
1633
|
-
|
1676
|
+
SortableTitlePlugin.prototype._getColumnIndexByOptions = function (sortOptions) {
|
1677
|
+
if(sortOptions) {
|
1678
|
+
var host = this._hosts[0];
|
1679
|
+
var colCount = host ? host.getColumnCount() : 0;
|
1680
|
+
for (var c = 0; c < colCount; ++c) {
|
1681
|
+
var colData = host.getColumnData(c); // Equivalent to _getSortOptions() method
|
1682
|
+
if (colData) {
|
1683
|
+
if(sortOptions === colData["sortableTitle"]) {
|
1684
|
+
return c;
|
1685
|
+
}
|
1686
|
+
}
|
1687
|
+
}
|
1688
|
+
}
|
1689
|
+
return -1;
|
1690
|
+
};
|
1691
|
+
/** @private
|
1692
|
+
* @param {string} field
|
1693
|
+
* @return {number}
|
1694
|
+
*/
|
1695
|
+
SortableTitlePlugin.prototype._getColumnIndexByField = function (field) {
|
1696
|
+
if(field) {
|
1697
|
+
var host = this._hosts[0];
|
1698
|
+
var colCount = host ? host.getColumnCount() : 0;
|
1699
|
+
for (var c = 0; c < colCount; ++c) {
|
1700
|
+
if(field === this.getColumnSortingField(c)) {
|
1701
|
+
return c;
|
1702
|
+
}
|
1703
|
+
}
|
1634
1704
|
}
|
1635
1705
|
return -1;
|
1636
1706
|
};
|
1637
|
-
|
1638
1707
|
/** @private
|
1639
1708
|
* @param {number} colIndex
|
1640
1709
|
* @return {Object}
|
@@ -1657,10 +1726,7 @@ SortableTitlePlugin.prototype._newSortOptions = function (colIndex) {
|
|
1657
1726
|
var host = this._hosts[0];
|
1658
1727
|
var sortOptions = null;
|
1659
1728
|
if (host && colIndex >= 0) {
|
1660
|
-
var colData = host.getColumnData(colIndex);
|
1661
|
-
if (!colData) {
|
1662
|
-
colData = host.setColumnData(colIndex, {});
|
1663
|
-
}
|
1729
|
+
var colData = host.getColumnData(colIndex); // colData is guaranteed to exist
|
1664
1730
|
sortOptions = colData["sortableTitle"];
|
1665
1731
|
if (!sortOptions) {
|
1666
1732
|
sortOptions = colData["sortableTitle"] = {};
|
@@ -4,9 +4,9 @@ declare class Conflator {
|
|
4
4
|
|
5
5
|
constructor(opt_func?: ((...params: any[]) => any)|number, opt_ms?: number|((...params: any[]) => any), opt_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
|
|
@@ -6,11 +6,11 @@ declare namespace ElementFrameWork {
|
|
6
6
|
|
7
7
|
function isElfv3(): boolean;
|
8
8
|
|
9
|
-
function createIcon(iconName: string): Element;
|
9
|
+
function createIcon(iconName: string): Element|null;
|
10
10
|
|
11
|
-
function createIconButton(iconName: string): Element;
|
11
|
+
function createIconButton(iconName: string): Element|null;
|
12
12
|
|
13
|
-
function createRangeBar(): Element;
|
13
|
+
function createRangeBar(): Element|null;
|
14
14
|
|
15
15
|
}
|
16
16
|
|
@@ -17,7 +17,7 @@ declare class HttpRequest extends EventDispatcher {
|
|
17
17
|
|
18
18
|
public getState(): string;
|
19
19
|
|
20
|
-
public getResponse(): any|string;
|
20
|
+
public getResponse(): any|string|null;
|
21
21
|
|
22
22
|
public getResponseText(): string;
|
23
23
|
|
@@ -27,7 +27,7 @@ declare class HttpRequest extends EventDispatcher {
|
|
27
27
|
|
28
28
|
public setRequestTimeout(timeout: number): void;
|
29
29
|
|
30
|
-
public valueOf(): any|string;
|
30
|
+
public valueOf(): any|string|null;
|
31
31
|
|
32
32
|
public toString(): string;
|
33
33
|
|
@@ -9,7 +9,7 @@ declare class PercentBarRenderer {
|
|
9
9
|
|
10
10
|
public render(cell: ElementWrapper, value: number, opt_max?: number, opt_displayText?: string, opt_textWidth?: number): void;
|
11
11
|
|
12
|
-
public renderForPrinting(cell: ElementWrapper, value: number, opt_max?: number): PercentBar;
|
12
|
+
public renderForPrinting(cell: ElementWrapper, value: number, opt_max?: number): PercentBar|null;
|
13
13
|
|
14
14
|
public setAlignment(alignment: string): void;
|
15
15
|
|
@@ -15,7 +15,7 @@ declare class SectionSettings extends EventDispatcher {
|
|
15
15
|
|
16
16
|
public setId(str?: string): string;
|
17
17
|
|
18
|
-
public getSection(): ILayoutGrid;
|
18
|
+
public getSection(): ILayoutGrid|null;
|
19
19
|
|
20
20
|
public getSectionName(): string;
|
21
21
|
|
@@ -25,11 +25,11 @@ declare class SectionSettings extends EventDispatcher {
|
|
25
25
|
|
26
26
|
public setType(type: string): void;
|
27
27
|
|
28
|
-
public getDataSource(): DataView;
|
28
|
+
public getDataSource(): DataView|null;
|
29
29
|
|
30
30
|
public setDataSource(dataView: DataView): void;
|
31
31
|
|
32
|
-
public getRootDataSource(): DataTable|DataView;
|
32
|
+
public getRootDataSource(): DataTable|DataView|null;
|
33
33
|
|
34
34
|
public getData(colName: string, rowRef: number|string): any;
|
35
35
|
|
@@ -41,9 +41,9 @@ declare class SectionSettings extends EventDispatcher {
|
|
41
41
|
|
42
42
|
public activateColumns(activations: (boolean|undefined)[], firstIndex: number, lastIndex: number): void;
|
43
43
|
|
44
|
-
public getChildren(): (SectionSettings)[];
|
44
|
+
public getChildren(): (SectionSettings)[]|null;
|
45
45
|
|
46
|
-
public getParent(): SectionSettings;
|
46
|
+
public getParent(): SectionSettings|null;
|
47
47
|
|
48
48
|
public getDataChangedConflator(): Conflator;
|
49
49
|
|
@@ -532,6 +532,11 @@ SectionSettings.prototype._dispatchDataChanged = function (firstUpdate, lastUpda
|
|
532
532
|
*/
|
533
533
|
SectionSettings.prototype.updateRowData = function (fromRowIndex, lastRowIndex, e) {
|
534
534
|
if(this.isDataBindable()) { // Prevent dispatching dataChanged event without the data view
|
535
|
+
if(this._grid._getTempRowHeights()){
|
536
|
+
fromRowIndex = this._grid.getFirstIndexInView();
|
537
|
+
lastRowIndex = this._grid.getLastIndexInView() + 1;
|
538
|
+
}
|
539
|
+
|
535
540
|
e = this.extendDataEventArg(e, fromRowIndex, lastRowIndex);
|
536
541
|
if(e["fromRowIndex"] < e["toRowIndex"]) {
|
537
542
|
this._dispatch("dataChanged", e);
|
@@ -36,9 +36,9 @@ declare class SelectionList {
|
|
36
36
|
|
37
37
|
public getLastSelectedIndex(): number;
|
38
38
|
|
39
|
-
public getAllSelections(): (number)[];
|
39
|
+
public getAllSelections(): (number)[]|null;
|
40
40
|
|
41
|
-
public getSelectionMap(): (boolean)[];
|
41
|
+
public getSelectionMap(): (boolean)[]|null;
|
42
42
|
|
43
43
|
public clearAllSelections(): number;
|
44
44
|
|
@@ -36,7 +36,7 @@ declare class TrackLayout {
|
|
36
36
|
|
37
37
|
public getTrackSize(): number;
|
38
38
|
|
39
|
-
public setTrackSize(targetSize: number): (number)[]|null;
|
39
|
+
public setTrackSize(targetSize: number): (number)[]|null|null;
|
40
40
|
|
41
41
|
public getLaneStart(index: number): number;
|
42
42
|
|
@@ -48,6 +48,10 @@ declare class TrackLayout {
|
|
48
48
|
|
49
49
|
public setLaneSize(index: number, val: number): boolean;
|
50
50
|
|
51
|
+
public setLaneProperty(index: number, propName: string, val: any): boolean;
|
52
|
+
|
53
|
+
public getLaneProperty(index: number, propName: string): any;
|
54
|
+
|
51
55
|
public getMinimumLaneSize(index: number): number;
|
52
56
|
|
53
57
|
public setMinimumLaneSize(index: number, val: number, proportion?: boolean): boolean;
|
@@ -64,13 +68,13 @@ declare class TrackLayout {
|
|
64
68
|
|
65
69
|
public setLaneScalability(index: number, val: boolean): boolean;
|
66
70
|
|
67
|
-
public removeLaneAt(index: number, opt_count?: number): any|null;
|
71
|
+
public removeLaneAt(index: number, opt_count?: number): any|null|null;
|
68
72
|
|
69
73
|
public insertLane(index: number, opt_json?: number|any): void;
|
70
74
|
|
71
75
|
public moveLane(from: number, to: number): void;
|
72
76
|
|
73
|
-
public serializeLane(index: number): any|null;
|
77
|
+
public serializeLane(index: number): any|null|null;
|
74
78
|
|
75
79
|
public deserializeLane(index: number, opt_json?: any): void;
|
76
80
|
|
@@ -401,6 +401,33 @@ TrackLayout.prototype.setLaneSize = function (index, val) {
|
|
401
401
|
return false;
|
402
402
|
};
|
403
403
|
|
404
|
+
/** @public
|
405
|
+
* @param {number} index
|
406
|
+
* @param {string} propName
|
407
|
+
* @param {*} val
|
408
|
+
* @return {boolean}
|
409
|
+
*/
|
410
|
+
TrackLayout.prototype.setLaneProperty = function (index, propName, val) {
|
411
|
+
if (index < 0 || index >= this._laneCount) { return false; }
|
412
|
+
|
413
|
+
var col = this._cols[index];
|
414
|
+
if (col == null || col[propName] !== val) {
|
415
|
+
col = this._newColumn(index);
|
416
|
+
col[propName] = val;
|
417
|
+
return true;
|
418
|
+
}
|
419
|
+
|
420
|
+
return false;
|
421
|
+
};
|
422
|
+
/** @public
|
423
|
+
* @param {number} index
|
424
|
+
* @param {string} propName
|
425
|
+
* @return {*}
|
426
|
+
*/
|
427
|
+
TrackLayout.prototype.getLaneProperty = function (index, propName) {
|
428
|
+
var col = this._cols[index];
|
429
|
+
return (col && col[propName] != null) ? col[propName] : null;
|
430
|
+
};
|
404
431
|
/** @public
|
405
432
|
* @param {number} index
|
406
433
|
* @return {number}
|
@@ -4,11 +4,11 @@ declare namespace Util {
|
|
4
4
|
|
5
5
|
const isMobile: boolean;
|
6
6
|
|
7
|
-
function pushArrayItems(ary: any[], items: any[]): any[];
|
7
|
+
function pushArrayItems(ary: any[], items: any[]): any[]|null;
|
8
8
|
|
9
9
|
function insertEmptyItems(ary: any[], at: number, chunkSize: number): void;
|
10
10
|
|
11
|
-
function cycleArray(ary: any[], numItems: number): any[];
|
11
|
+
function cycleArray(ary: any[], numItems: number): any[]|null;
|
12
12
|
|
13
13
|
}
|
14
14
|
|