@refinitiv-ui/efx-grid 6.0.91 → 6.0.93
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 +1 -1
- package/lib/column-dragging/es6/ColumnDragging.js +144 -34
- package/lib/core/dist/core.js +2410 -2621
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.js +14 -14
- package/lib/core/es6/data/DataCache.js +118 -118
- package/lib/core/es6/data/DataTable.d.ts +3 -1
- package/lib/core/es6/data/DataTable.js +208 -190
- package/lib/core/es6/data/DataView.d.ts +1 -1
- package/lib/core/es6/data/DataView.js +291 -291
- package/lib/core/es6/data/Segment.js +79 -79
- package/lib/core/es6/data/SegmentCollection.js +81 -81
- package/lib/core/es6/data/WrappedView.js +41 -41
- package/lib/core/es6/grid/Core.js +635 -635
- package/lib/core/es6/grid/ILayoutGrid.js +1 -1
- package/lib/core/es6/grid/LayoutGrid.js +183 -183
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +91 -91
- package/lib/core/es6/grid/components/Cell.js +29 -29
- package/lib/core/es6/grid/components/CellFloatingPanel.js +11 -11
- package/lib/core/es6/grid/components/CellSpan.js +7 -7
- package/lib/core/es6/grid/components/CellSpans.js +36 -34
- package/lib/core/es6/grid/components/Column.js +40 -40
- package/lib/core/es6/grid/components/ElementWrapper.js +17 -17
- package/lib/core/es6/grid/components/HScrollbar.js +31 -31
- package/lib/core/es6/grid/components/Scrollbar.js +77 -77
- package/lib/core/es6/grid/components/StretchedCells.js +49 -49
- package/lib/core/es6/grid/components/VScrollbar.js +11 -11
- package/lib/core/es6/grid/components/VirtualItems.js +3 -3
- package/lib/core/es6/grid/event/EventDispatcher.js +9 -9
- package/lib/core/es6/grid/event/EventListeners.js +4 -4
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +186 -186
- package/lib/core/es6/grid/util/Conflator.js +4 -4
- package/lib/core/es6/grid/util/Reverter.js +1 -1
- package/lib/core/es6/grid/util/SectionSettings.js +20 -20
- package/lib/core/es6/grid/util/SelectionList.js +23 -23
- package/lib/core/es6/grid/util/TrackLayout.js +74 -74
- package/lib/core/es6/grid/util/Virtualizer.js +15 -15
- package/lib/core/es6/grid/util/util.js +20 -20
- package/lib/core/es6/index.d.ts +0 -2
- package/lib/core/es6/index.js +0 -3
- package/lib/filter-dialog/lib/filter-dialog.js +1 -0
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +193 -70
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +46 -30
- package/lib/rt-grid/es6/RowDefinition.d.ts +2 -1
- package/lib/rt-grid/es6/RowDefinition.js +74 -16
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +56 -1
- package/lib/tr-grid-checkbox/es6/Checkbox.js +268 -268
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +3 -2
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +60 -32
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +279 -279
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +227 -207
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +11 -11
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +1 -2
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +120 -121
- package/lib/tr-grid-util/es6/CellPainter.js +94 -104
- package/lib/tr-grid-util/es6/Conflator.js +4 -4
- package/lib/tr-grid-util/es6/CoralItems.js +6 -6
- package/lib/tr-grid-util/es6/DateTime.js +41 -41
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.d.ts +3 -3
- package/lib/tr-grid-util/es6/Delay.js +14 -3
- package/lib/tr-grid-util/es6/Dom.js +26 -26
- package/lib/tr-grid-util/es6/DragUI.js +17 -17
- package/lib/tr-grid-util/es6/ElementObserver.js +12 -12
- package/lib/tr-grid-util/es6/ElementWrapper.js +2 -2
- package/lib/tr-grid-util/es6/ElfDate.js +4 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +37 -37
- package/lib/tr-grid-util/es6/EventDispatcher.js +12 -12
- package/lib/tr-grid-util/es6/ExpanderIcon.js +6 -6
- package/lib/tr-grid-util/es6/ExpressionParser.js +43 -43
- package/lib/tr-grid-util/es6/Ext.js +6 -6
- package/lib/tr-grid-util/es6/FieldFormatter.js +17 -17
- package/lib/tr-grid-util/es6/FilterBuilder.js +57 -58
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +12 -1
- package/lib/tr-grid-util/es6/FilterOperators.js +13 -2
- package/lib/tr-grid-util/es6/GridPlugin.js +86 -87
- package/lib/tr-grid-util/es6/GroupDefinitions.js +90 -90
- package/lib/tr-grid-util/es6/Icon.js +4 -4
- package/lib/tr-grid-util/es6/MouseDownTrait.js +6 -6
- package/lib/tr-grid-util/es6/MultiTableManager.js +71 -80
- package/lib/tr-grid-util/es6/NumberFormatter.js +23 -23
- package/lib/tr-grid-util/es6/PercentBar.js +17 -17
- package/lib/tr-grid-util/es6/Perf.js +5 -5
- package/lib/tr-grid-util/es6/Popup.js +42 -42
- package/lib/tr-grid-util/es6/RangeBar.js +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.js +5 -5
- package/lib/tr-grid-util/es6/RowPainter.js +23 -23
- package/lib/tr-grid-util/es6/SubTable.js +94 -94
- package/lib/tr-grid-util/es6/Table.js +51 -51
- package/lib/tr-grid-util/es6/TextHighlighter.js +52 -52
- package/lib/tr-grid-util/es6/TickCodes.js +2 -2
- package/lib/tr-grid-util/es6/Timer.js +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.js +7 -7
- package/lib/tr-grid-util/es6/Util.js +50 -50
- package/lib/tr-grid-util/es6/formula/ADCService.js +2 -2
- package/lib/tr-grid-util/es6/formula/ADCSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/AdFinService.js +2 -2
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +19 -19
- package/lib/tr-grid-util/es6/formula/Engine.js +56 -56
- package/lib/tr-grid-util/es6/formula/Formula.js +62 -62
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +3 -3
- package/lib/tr-grid-util/es6/formula/Realtime.js +15 -15
- package/lib/tr-grid-util/es6/formula/RealtimeService.js +15 -15
- package/lib/tr-grid-util/es6/formula/TSIService.js +2 -2
- package/lib/tr-grid-util/es6/formula/TSISubscription.js +104 -104
- package/lib/tr-grid-util/es6/formula/VariableToken.js +20 -20
- package/lib/tr-grid-util/es6/formula/functions/AdFin.js +10 -10
- package/lib/tr-grid-util/es6/formula/functions/Excel.js +1 -1
- package/lib/tr-grid-util/es6/formula/functions/Info.js +2 -2
- package/lib/tr-grid-util/es6/formula/functions/Internal.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Logic.js +5 -5
- package/lib/tr-grid-util/es6/formula/functions/Math.js +46 -46
- package/lib/tr-grid-util/es6/formula/functions/Statistics.js +27 -27
- package/lib/tr-grid-util/es6/formula/functions/Text.js +19 -19
- package/lib/tr-grid-util/es6/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/Adc.js +36 -36
- package/lib/tr-grid-util/es6/jet/CollectionDict.js +11 -11
- package/lib/tr-grid-util/es6/jet/DataGenerator.js +95 -95
- package/lib/tr-grid-util/es6/jet/DataSet.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockArchive.js +5 -5
- package/lib/tr-grid-util/es6/jet/MockJET.js +1 -1
- package/lib/tr-grid-util/es6/jet/MockQuotes.js +13 -13
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +100 -100
- package/lib/tr-grid-util/es6/jet/MockRTK.js +4 -4
- package/lib/tr-grid-util/es6/jet/MockUtil.js +2 -2
- package/lib/tr-grid-util/es6/jet/index.js +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +15 -15
- package/lib/tr-grid-util/es6/locale/translation-de.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-en.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-ja.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation-zh.js +1 -1
- package/lib/tr-grid-util/es6/locale/translation.js +1 -1
- package/lib/types/es6/ColumnDragging.d.ts +1 -1
- package/lib/types/es6/ColumnGrouping.d.ts +3 -1
- package/lib/types/es6/Core/data/DataTable.d.ts +4 -0
- package/lib/types/es6/Core/data/DataView.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +2 -0
- package/lib/types/es6/Core/index.d.ts +0 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +2 -1
- package/lib/types/es6/RowDragging.d.ts +1 -2
- package/lib/versions.json +12 -12
- package/package.json +1 -1
- package/lib/core/es6/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/core/es6/grid/util/ElementFrameWork.js +0 -227
- package/lib/core/es6/grid/util/HttpRequest.d.ts +0 -53
- package/lib/core/es6/grid/util/HttpRequest.js +0 -371
- package/lib/core/es6/grid/util/PercentBar.d.ts +0 -43
- package/lib/core/es6/grid/util/PercentBar.js +0 -390
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/core/es6/grid/util/PercentBarRenderer.js +0 -316
- package/lib/core/es6/grid/util/RangeBar.d.ts +0 -25
- package/lib/core/es6/grid/util/RangeBar.js +0 -255
- package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +0 -18
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +0 -53
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +0 -43
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +0 -41
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +0 -25
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* @param {number|Function=} opt_ms The delay time in millisecond before executing the function
|
|
7
7
|
* @param {*=} opt_thisObj "this" object to be bound with the given function. If the function is already bound, there is no need to provide thisObj parameter
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
10
|
-
* for(
|
|
9
|
+
* let c = new Conflator(function() { console.log("Executed"); }, 1000);
|
|
10
|
+
* for(let i = 10; --i >= 0;) {
|
|
11
11
|
* c.conflate(i); // Only one "Executed" text will be logged to console after one second
|
|
12
12
|
* }
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
let Conflator = function (opt_func, opt_ms, opt_thisObj) {
|
|
15
15
|
this._onConflated = this._onConflated.bind(this);
|
|
16
16
|
|
|
17
17
|
this._data = [];
|
|
@@ -73,7 +73,7 @@ Conflator.prototype.reset = function () {
|
|
|
73
73
|
*/
|
|
74
74
|
Conflator.prototype.popAllData = function() {
|
|
75
75
|
if(this._data.length) {
|
|
76
|
-
|
|
76
|
+
let data = this._data;
|
|
77
77
|
this._data = [];
|
|
78
78
|
return data;
|
|
79
79
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {Function|number=} opt_func
|
|
5
5
|
* @param {number|Function=} opt_ms The delay time in millisecond before executing the function
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
let Reverter = function (opt_func, opt_ms) {
|
|
8
8
|
this._onInterval = this._onInterval.bind(this);
|
|
9
9
|
|
|
10
10
|
if(typeof opt_func == "function") {
|
|
@@ -13,8 +13,8 @@ import Conflator from "../util/Conflator.js";
|
|
|
13
13
|
* @extends {EventDispatcher}
|
|
14
14
|
* @param {!ILayoutGrid} grid
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
let SectionSettings = function (grid) {
|
|
17
|
+
let _t = this;
|
|
18
18
|
_t._onDataChanged = _t._onDataChanged.bind(_t);
|
|
19
19
|
_t.extendEventArg = _t.extendEventArg.bind(_t);
|
|
20
20
|
|
|
@@ -149,7 +149,7 @@ SectionSettings.prototype.getDataSource = function () {
|
|
|
149
149
|
* @param {DataView} dataView
|
|
150
150
|
*/
|
|
151
151
|
SectionSettings.prototype.setDataSource = function (dataView) {
|
|
152
|
-
|
|
152
|
+
let t = this;
|
|
153
153
|
if(!t.getAutoSyncRowCount() || t._dataView === dataView) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
@@ -174,7 +174,7 @@ SectionSettings.prototype.setDataSource = function (dataView) {
|
|
|
174
174
|
SectionSettings.prototype.getRootDataSource = function () {
|
|
175
175
|
if (!this._dataView) { return null; }
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
let dataTable = this._dataView.getDataSource();
|
|
178
178
|
if (!dataTable) { return null; }
|
|
179
179
|
|
|
180
180
|
while (dataTable.getDataSource()) {
|
|
@@ -223,11 +223,11 @@ SectionSettings.prototype.getRowData = function (rowRef) {
|
|
|
223
223
|
SectionSettings.prototype.removeRowData = function (rowRef) {
|
|
224
224
|
if (!this._dataView) { return false; }
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
let dataTable = /** @type{DataTable} */(this.getRootDataSource());
|
|
227
227
|
if (!dataTable) { return false; }
|
|
228
228
|
|
|
229
229
|
rowRef = this._getRowId(rowRef);
|
|
230
|
-
|
|
230
|
+
let rowIndex = dataTable.getRowIndex(/** @type{string} */(rowRef));
|
|
231
231
|
if (rowIndex < 0) { return false; }
|
|
232
232
|
|
|
233
233
|
dataTable.removeRow(rowIndex);
|
|
@@ -241,8 +241,8 @@ SectionSettings.prototype.removeRowData = function (rowRef) {
|
|
|
241
241
|
SectionSettings.prototype.activateColumns = function (activations, firstIndex, lastIndex) {
|
|
242
242
|
// Column virtual rendering should only work with content section only
|
|
243
243
|
if (this._type === "content") {
|
|
244
|
-
for(
|
|
245
|
-
|
|
244
|
+
for(let c = lastIndex + 1; --c >= firstIndex;) {
|
|
245
|
+
let activation = activations[c];
|
|
246
246
|
if (activation != null) {
|
|
247
247
|
this._grid.activateColumn(c, activation);
|
|
248
248
|
}
|
|
@@ -264,7 +264,7 @@ SectionSettings.prototype.getChildren = function () { // TODO: Deprecate this me
|
|
|
264
264
|
*/
|
|
265
265
|
SectionSettings.prototype.setParent = function (parent) { // TODO: Deprecate this method
|
|
266
266
|
if(this._parent) {
|
|
267
|
-
|
|
267
|
+
let at = this._parent._children.indexOf(this);
|
|
268
268
|
if(at >= 0) {
|
|
269
269
|
this._parent._children.splice(at, 1);
|
|
270
270
|
if(this._parent._children.length <= 0) {
|
|
@@ -320,7 +320,7 @@ SectionSettings.prototype.getAutoSyncRowCount = function () {
|
|
|
320
320
|
SectionSettings.prototype.setAutoSyncRowCount = function (bool) {
|
|
321
321
|
this._autoSyncRowCount = bool;
|
|
322
322
|
if (this.getAutoSyncRowCount()) {
|
|
323
|
-
|
|
323
|
+
let newRowCount = (this._dataView) ? this._dataView.getVisibleRowCount() : 0;
|
|
324
324
|
this._grid.setRowCount(newRowCount);
|
|
325
325
|
}
|
|
326
326
|
};
|
|
@@ -339,7 +339,7 @@ SectionSettings.prototype.isDataBindable = function () {
|
|
|
339
339
|
* @ignore
|
|
340
340
|
*/
|
|
341
341
|
SectionSettings.prototype.dispose = function () {
|
|
342
|
-
|
|
342
|
+
let _t = this;
|
|
343
343
|
_t._dataChangedConflator.reset();
|
|
344
344
|
_t._dataArg = null;
|
|
345
345
|
if (_t._grid) {
|
|
@@ -412,7 +412,7 @@ SectionSettings.prototype.extendDataEventArg = function (e, begin, end) {
|
|
|
412
412
|
e.firstUpdate = begin;
|
|
413
413
|
e.lastUpdate = end;
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
let firstInView, endOfView;
|
|
416
416
|
if(this._snapshot) {
|
|
417
417
|
firstInView = 0;
|
|
418
418
|
endOfView = this._grid.getRowCount();
|
|
@@ -423,7 +423,7 @@ SectionSettings.prototype.extendDataEventArg = function (e, begin, end) {
|
|
|
423
423
|
|
|
424
424
|
e["fromRowIndex"] = (begin > firstInView) ? begin : firstInView; // Handles NaN value
|
|
425
425
|
if (this._dataView) {
|
|
426
|
-
|
|
426
|
+
let dataRowCount = this._dataView.getVisibleRowCount();
|
|
427
427
|
e["dataRowCount"] = dataRowCount;
|
|
428
428
|
if (endOfView > dataRowCount) {
|
|
429
429
|
endOfView = dataRowCount;
|
|
@@ -507,9 +507,9 @@ SectionSettings.prototype._onDataChanged = function (e) {
|
|
|
507
507
|
* @param {number} lastUpdate
|
|
508
508
|
*/
|
|
509
509
|
SectionSettings.prototype._dispatchDataChanged = function (firstUpdate, lastUpdate) {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
510
|
+
let isAutoSync = this.getAutoSyncRowCount();
|
|
511
|
+
let newCount = (this._dataView) ? this._dataView.getVisibleRowCount() : 0;
|
|
512
|
+
let prevCount = this._grid.getRowCount();
|
|
513
513
|
if (isAutoSync) {
|
|
514
514
|
if (newCount !== prevCount) {
|
|
515
515
|
this._grid.setRowCount(newCount, true);
|
|
@@ -589,7 +589,7 @@ SectionSettings.prototype._getRowId = function (rowRef) {
|
|
|
589
589
|
* @param {!Object} e
|
|
590
590
|
*/
|
|
591
591
|
SectionSettings.prototype._mergeEvent = function (e) {
|
|
592
|
-
|
|
592
|
+
let arg = this._dataArg;
|
|
593
593
|
if(!arg) {
|
|
594
594
|
arg = this._dataArg = {};
|
|
595
595
|
arg["actualUpdate"] = true; // Indicate that this event is fired because of some changes from data view
|
|
@@ -619,9 +619,9 @@ SectionSettings.prototype._mergeEvent = function (e) {
|
|
|
619
619
|
return;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
-
|
|
622
|
+
let rids = e["rids"];
|
|
623
623
|
if(rids) {
|
|
624
|
-
for(
|
|
624
|
+
for(let i = rids.length; --i >= 0;) {
|
|
625
625
|
arg.updatedRids[rids[i]] = true;
|
|
626
626
|
}
|
|
627
627
|
} else if(e["rid"]) {
|
|
@@ -643,7 +643,7 @@ SectionSettings.prototype._calculateChangeIndices = function () {
|
|
|
643
643
|
}
|
|
644
644
|
|
|
645
645
|
// Calculate the first and last update indices.
|
|
646
|
-
|
|
646
|
+
let rid, rowIndex;
|
|
647
647
|
if(this._dataArg.indexShifted) {
|
|
648
648
|
if(this._dataArg.dataRemoved) {
|
|
649
649
|
this._dataArg.firstUpdate = 0;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @constructor
|
|
3
3
|
* @ignore
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
let SelectionList = function () {
|
|
6
6
|
this._selections = [];
|
|
7
7
|
};
|
|
8
8
|
/** Clone all members
|
|
@@ -11,7 +11,7 @@ var SelectionList = function () {
|
|
|
11
11
|
*/
|
|
12
12
|
SelectionList.prototype.clone = function () {
|
|
13
13
|
// IMPORTANT NOTE: If you add any field or member to this class, clone it over here too.
|
|
14
|
-
|
|
14
|
+
let newObj = new SelectionList();
|
|
15
15
|
newObj._selections = this._selections.concat();
|
|
16
16
|
newObj._count = this._count;
|
|
17
17
|
newObj._anchor = this._anchor;
|
|
@@ -86,9 +86,9 @@ SelectionList.prototype.deselectFrom = function (at) {
|
|
|
86
86
|
return true;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
for(
|
|
89
|
+
let lastIndex = this._lastIndex;
|
|
90
|
+
let sels = this._selections;
|
|
91
|
+
for(let i = at; i <= lastIndex; ++i) {
|
|
92
92
|
if (sels[i]) {
|
|
93
93
|
sels[at] = false;
|
|
94
94
|
--this._count;
|
|
@@ -150,8 +150,8 @@ SelectionList.prototype.selectRange = function (anchor, length) {
|
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
let at = anchor;
|
|
154
|
+
let endIndex = at + length;
|
|
155
155
|
if (length < 0) {
|
|
156
156
|
endIndex = at + 1;
|
|
157
157
|
at = endIndex + length;
|
|
@@ -169,7 +169,7 @@ SelectionList.prototype.selectRange = function (anchor, length) {
|
|
|
169
169
|
this._lastIndex = endIndex - 1;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
for (
|
|
172
|
+
for (let i = at; i < endIndex; ++i) {
|
|
173
173
|
this._select(i);
|
|
174
174
|
}
|
|
175
175
|
};
|
|
@@ -188,7 +188,7 @@ SelectionList.prototype.deselectRange = function (at, length) {
|
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
let endIndex = at + length;
|
|
192
192
|
if (length < 0) {
|
|
193
193
|
endIndex = at + 1;
|
|
194
194
|
at = endIndex + length;
|
|
@@ -209,7 +209,7 @@ SelectionList.prototype.deselectRange = function (at, length) {
|
|
|
209
209
|
this._lastIndex = this._findPrevSelection(at);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
let i = 0;
|
|
213
213
|
for (i = at; i < endIndex; ++i) {
|
|
214
214
|
if (this._selections[i]) {
|
|
215
215
|
this._selections[i] = false;
|
|
@@ -226,7 +226,7 @@ SelectionList.prototype.hasSelection = function(at, length) {
|
|
|
226
226
|
if(this._count <= 0) {
|
|
227
227
|
return false;
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
let endIndex = at + length;
|
|
230
230
|
if (length < 0) {
|
|
231
231
|
endIndex = at + 1;
|
|
232
232
|
at = endIndex + length;
|
|
@@ -235,7 +235,7 @@ SelectionList.prototype.hasSelection = function(at, length) {
|
|
|
235
235
|
return false;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
for(
|
|
238
|
+
for(let i = at; i < endIndex; ++i) {
|
|
239
239
|
if(this._selections[i]) {
|
|
240
240
|
return true;
|
|
241
241
|
}
|
|
@@ -300,11 +300,11 @@ SelectionList.prototype.getLastSelectedIndex = function() {
|
|
|
300
300
|
*/
|
|
301
301
|
SelectionList.prototype.getAllSelections = function() {
|
|
302
302
|
if(this._count > 0) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
for(
|
|
303
|
+
let ary = new Array(this._count); // Fastest way to create an array
|
|
304
|
+
let count = 0;
|
|
305
|
+
let sels = this._selections;
|
|
306
|
+
let lastIdx = this._lastIndex;
|
|
307
|
+
for(let i = this._firstIndex; i <= lastIdx; ++i) {
|
|
308
308
|
if(sels[i]) {
|
|
309
309
|
ary[count++] = i;
|
|
310
310
|
}
|
|
@@ -321,7 +321,7 @@ SelectionList.prototype.getAllSelections = function() {
|
|
|
321
321
|
*/
|
|
322
322
|
SelectionList.prototype.getConnectedRanges = function(from, to) {
|
|
323
323
|
if(this._count > 0) {
|
|
324
|
-
|
|
324
|
+
let ary = [];
|
|
325
325
|
if(from == null || from < this._firstIndex) {
|
|
326
326
|
from = this._firstIndex;
|
|
327
327
|
}
|
|
@@ -329,8 +329,8 @@ SelectionList.prototype.getConnectedRanges = function(from, to) {
|
|
|
329
329
|
to = this._lastIndex + 1;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
for(
|
|
332
|
+
let pair = null;
|
|
333
|
+
for(let i = from; i < to; ++i) {
|
|
334
334
|
if(this._selections[i]) {
|
|
335
335
|
if(!pair) {
|
|
336
336
|
pair = [i, -1];
|
|
@@ -364,7 +364,7 @@ SelectionList.prototype.getSelectionMap = function () {
|
|
|
364
364
|
*/
|
|
365
365
|
SelectionList.prototype.clearAllSelections = function() {
|
|
366
366
|
if(this._count > 0) {
|
|
367
|
-
|
|
367
|
+
let count = 0;
|
|
368
368
|
this._selections.length = 0;
|
|
369
369
|
this._count = 0;
|
|
370
370
|
this._anchor = -1;
|
|
@@ -385,7 +385,7 @@ SelectionList.prototype.clearAllSelections = function() {
|
|
|
385
385
|
SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset, forLength) {
|
|
386
386
|
if (forLength <= 0) { return; }
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
let toThisIndex = fromSrcIndex + offset;
|
|
389
389
|
if (srcSelections == null) {
|
|
390
390
|
this.deselectRange(toThisIndex, forLength);
|
|
391
391
|
return;
|
|
@@ -396,7 +396,7 @@ SelectionList.prototype.copyFrom = function (srcSelections, fromSrcIndex, offset
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
|
|
399
|
-
for (
|
|
399
|
+
for (let i = 0; i < forLength; ++i) {
|
|
400
400
|
if (srcSelections._selections[fromSrcIndex + i]) {
|
|
401
401
|
this.select(toThisIndex + i);
|
|
402
402
|
} else {
|