@refinitiv-ui/efx-grid 6.0.91 → 6.0.92
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/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-column-grouping/es6/ColumnGrouping.d.ts +3 -1
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +29 -1
- package/lib/tr-grid-util/es6/CellPainter.js +94 -93
- 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 +39 -39
- package/lib/tr-grid-util/es6/Deferred.js +5 -5
- package/lib/tr-grid-util/es6/Delay.js +1 -1
- 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 -57
- 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 -86
- 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 +68 -68
- package/lib/tr-grid-util/es6/NumberFormatter.js +22 -22
- 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 +49 -49
- 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/versions.json +4 -4
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @namespace */
|
|
2
|
-
|
|
2
|
+
let ElfDate = {};
|
|
3
3
|
|
|
4
4
|
/** Check ELF version
|
|
5
5
|
* @public
|
|
@@ -18,7 +18,7 @@ var ElfDate = {};
|
|
|
18
18
|
*/
|
|
19
19
|
ElfDate.from = function (val) {
|
|
20
20
|
if(val) {
|
|
21
|
-
|
|
21
|
+
let d = val;
|
|
22
22
|
if(typeof val === "string" || typeof val === "number") {
|
|
23
23
|
d = new Date(val);
|
|
24
24
|
} else if(Array.isArray(val)) {
|
|
@@ -38,7 +38,7 @@ ElfDate.from = function (val) {
|
|
|
38
38
|
*/
|
|
39
39
|
ElfDate.isValid = function (d) {
|
|
40
40
|
if(d && d.getTime) { // Date object must have getTime method
|
|
41
|
-
|
|
41
|
+
let ms = d.getTime(); // millisecond since 1 first january 1970
|
|
42
42
|
return ms === ms; // Invalid Date will have NaN as its value
|
|
43
43
|
}
|
|
44
44
|
return false;
|
|
@@ -77,7 +77,7 @@ ElfDate.toYMD = function (d) {
|
|
|
77
77
|
return d; // pass through only if we have yyyy-MM-dd
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
let dateObj = ElfDate.from(d);
|
|
81
81
|
if(dateObj) {
|
|
82
82
|
return dateObj.getFullYear() + "-" +
|
|
83
83
|
ElfDate.prefixSingleDigit(dateObj.getMonth() + 1) + "-" +
|
|
@@ -7,7 +7,7 @@ import { ElementObserver } from "./ElementObserver.js";
|
|
|
7
7
|
* @private
|
|
8
8
|
* @const
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
let LANGUAGE_SUPPORTS = {
|
|
11
11
|
"en": true,
|
|
12
12
|
"de": true,
|
|
13
13
|
"ja": true,
|
|
@@ -16,7 +16,7 @@ var LANGUAGE_SUPPORTS = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/** @namespace */
|
|
19
|
-
|
|
19
|
+
let ElfUtil = {};
|
|
20
20
|
/** @type {Deferred}
|
|
21
21
|
* @private
|
|
22
22
|
*/
|
|
@@ -123,14 +123,14 @@ ElfUtil._icons["solar-theme"] = ElfUtil._icons["elf-theme-solar"];
|
|
|
123
123
|
*/
|
|
124
124
|
ElfUtil.getElfVersion = function () {
|
|
125
125
|
if (!ElfUtil._elfVersion) {
|
|
126
|
-
|
|
126
|
+
let val = 0;
|
|
127
127
|
if (window.EFX_GRID) {
|
|
128
|
-
|
|
128
|
+
let version = window.EFX_GRID.version;
|
|
129
129
|
version = version.split(".");
|
|
130
130
|
val = +version[0];
|
|
131
131
|
} else if (window.elf) {
|
|
132
132
|
if (window.elf.version) {
|
|
133
|
-
|
|
133
|
+
let ver = window.elf.version.match(/\d/); // example version code: 4.0.1
|
|
134
134
|
if (ver && ver[0]) {
|
|
135
135
|
val = parseInt(ver[0], 10);
|
|
136
136
|
}
|
|
@@ -160,12 +160,12 @@ ElfUtil.getElfVersion = function () {
|
|
|
160
160
|
* ElfUtil.hasComponent("unknown-button"); // 0
|
|
161
161
|
*/
|
|
162
162
|
ElfUtil.hasComponent = function (compName) {
|
|
163
|
-
|
|
163
|
+
let val = ElfUtil._components[compName];
|
|
164
164
|
if (val == null) {
|
|
165
165
|
val = 0;
|
|
166
|
-
|
|
166
|
+
let ver = ElfUtil.getElfVersion();
|
|
167
167
|
if (compName) {
|
|
168
|
-
|
|
168
|
+
let elem;
|
|
169
169
|
if (ver === 1) {
|
|
170
170
|
elem = document.createElement(compName);
|
|
171
171
|
if (elem.is === compName) {
|
|
@@ -198,7 +198,7 @@ ElfUtil.toLangString = function (lang) {
|
|
|
198
198
|
if(lang === "zh-hant") {
|
|
199
199
|
return "zh-Hant";
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
let mainLang = lang.replace(/-.*/, "");
|
|
202
202
|
if(LANGUAGE_SUPPORTS[mainLang]){
|
|
203
203
|
return mainLang;
|
|
204
204
|
}
|
|
@@ -284,13 +284,13 @@ ElfUtil.isHaloTheme = function (themeName) {
|
|
|
284
284
|
ElfUtil.injectIcons = function (configObj, optElem) {
|
|
285
285
|
if (typeof configObj !== "object") { return; }
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
let theme = ElfUtil.getThemeName();
|
|
288
288
|
configObj.themeName = theme;
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
let ver = ElfUtil.getElfVersion();
|
|
291
291
|
configObj.elfVersion = ver;
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
let icons = ElfUtil._icons[theme];
|
|
294
294
|
if (icons) {
|
|
295
295
|
configObj.icons = icons;
|
|
296
296
|
}
|
|
@@ -302,7 +302,7 @@ ElfUtil.injectIcons = function (configObj, optElem) {
|
|
|
302
302
|
* @returns {!Array.<string>} Always return a list of icons for the existing theme
|
|
303
303
|
*/
|
|
304
304
|
ElfUtil.getIconList = function () {
|
|
305
|
-
|
|
305
|
+
let iconStruct = ElfUtil._icons[ElfUtil.getThemeName()];
|
|
306
306
|
return iconStruct ? nestedObjectToArray(iconStruct) : [];
|
|
307
307
|
};
|
|
308
308
|
|
|
@@ -311,7 +311,7 @@ ElfUtil.getIconList = function () {
|
|
|
311
311
|
*/
|
|
312
312
|
ElfUtil._onIconPreloaded = function() {
|
|
313
313
|
if(ElfUtil._dummyIcon) {
|
|
314
|
-
|
|
314
|
+
let pn = ElfUtil._dummyIcon.parentNode;
|
|
315
315
|
if(pn) {
|
|
316
316
|
pn.removeChild(ElfUtil._dummyIcon);
|
|
317
317
|
}
|
|
@@ -326,10 +326,10 @@ ElfUtil._onIconPreloaded = function() {
|
|
|
326
326
|
ElfUtil.prepareIconPreloading = function() {
|
|
327
327
|
if(!ElfUtil._iconLoaded) {
|
|
328
328
|
ElfUtil._iconLoaded = true;
|
|
329
|
-
|
|
329
|
+
let iconList = ElfUtil.getIconList();
|
|
330
330
|
if(iconList.length) {
|
|
331
331
|
setTimeout(ElfUtil._onIconPreloaded, 10);
|
|
332
|
-
|
|
332
|
+
let dummyIcon = ElfUtil._dummyIcon = document.createElement("ef-icon");
|
|
333
333
|
dummyIcon.style.transform = "scale(0)";
|
|
334
334
|
document.body.appendChild(dummyIcon);
|
|
335
335
|
return iconList;
|
|
@@ -347,8 +347,8 @@ ElfUtil.prepareIconPreloading = function() {
|
|
|
347
347
|
* ElfUtil.getCssVariable("--valid-name", spanElement);
|
|
348
348
|
*/
|
|
349
349
|
ElfUtil.getCssVariable = function (varName, optElem) {
|
|
350
|
-
|
|
351
|
-
|
|
350
|
+
let result = "";
|
|
351
|
+
let elem = optElem || document.body;
|
|
352
352
|
if (window && typeof varName === "string" && elem.nodeType === 1) {
|
|
353
353
|
if (varName.match(/^--/)) {
|
|
354
354
|
result = window.getComputedStyle(elem).getPropertyValue(varName);
|
|
@@ -368,11 +368,11 @@ ElfUtil.getCssVariable = function (varName, optElem) {
|
|
|
368
368
|
* }, spanElement); // Css varriable names will be replaced with their value
|
|
369
369
|
*/
|
|
370
370
|
ElfUtil.getCssVariables = function (obj, optElem) {
|
|
371
|
-
|
|
371
|
+
let elem = optElem || document.body;
|
|
372
372
|
if (window && elem.nodeType === 1) {
|
|
373
|
-
|
|
374
|
-
for(
|
|
375
|
-
|
|
373
|
+
let computedStyle = window.getComputedStyle(elem);
|
|
374
|
+
for(let key in obj) {
|
|
375
|
+
let varName = obj[key];
|
|
376
376
|
if (varName && varName.match(/^--/)) {
|
|
377
377
|
obj[key] = computedStyle.getPropertyValue(varName).replace(/\"/g, ""); // eslint-disable-line
|
|
378
378
|
}
|
|
@@ -402,7 +402,7 @@ ElfUtil.getMovementColorProfile = function() {
|
|
|
402
402
|
* @param {Function} cb
|
|
403
403
|
*/
|
|
404
404
|
ElfUtil._addThemeChangedCallback = function(cb) {
|
|
405
|
-
|
|
405
|
+
let callbacks = ElfUtil._callbacks;
|
|
406
406
|
if(callbacks.indexOf(cb) < 0) {
|
|
407
407
|
callbacks.push(cb);
|
|
408
408
|
}
|
|
@@ -438,10 +438,10 @@ ElfUtil.getThemeColors = function(themeChangedCb) {
|
|
|
438
438
|
return ElfUtil.themeReady;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
let d = ElfUtil._deferred = new Deferred();
|
|
442
442
|
ElfUtil.themeReady = d.promise;
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
let profileName = ElfUtil.getMovementColorProfile();
|
|
445
445
|
if(profileName) {
|
|
446
446
|
if(profileName !== ElfUtil._profileName) {
|
|
447
447
|
setTimeout(ElfUtil._profileNameRetrieved, 100); // TODO: Find a proper way to ensure that theme is ready
|
|
@@ -449,12 +449,12 @@ ElfUtil.getThemeColors = function(themeChangedCb) {
|
|
|
449
449
|
ElfUtil._deferred.resolve(ElfUtil.themeColors);
|
|
450
450
|
}
|
|
451
451
|
} else {
|
|
452
|
-
|
|
452
|
+
let options = {
|
|
453
453
|
providerName: "Configuration",
|
|
454
454
|
settingName: "RDE_USER_CURRENT_TICK_COLOR"
|
|
455
455
|
};
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
let jet = window ? window.JET : null;
|
|
458
458
|
ElfUtil._themeLoaded = false;
|
|
459
459
|
if(ElfUtil._rtk && ElfUtil._rtk.Settings) {
|
|
460
460
|
ElfUtil._rtk.Settings.getAsync(options)
|
|
@@ -477,7 +477,7 @@ ElfUtil.getThemeColors = function(themeChangedCb) {
|
|
|
477
477
|
/** @private
|
|
478
478
|
* @param {string} profileName
|
|
479
479
|
*/
|
|
480
|
-
|
|
480
|
+
let movementColorProfileChanged = function(profileName) {
|
|
481
481
|
if(profileName !== ElfUtil._profileName) {
|
|
482
482
|
ElfUtil._retrieveThemeColors(profileName);
|
|
483
483
|
|
|
@@ -486,8 +486,8 @@ var movementColorProfileChanged = function(profileName) {
|
|
|
486
486
|
ElfUtil._deferred.resolve(ElfUtil.themeColors);
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
for (
|
|
489
|
+
let callbacks = ElfUtil._callbacks;
|
|
490
|
+
for (let i = 0; i < callbacks.length; i++) {
|
|
491
491
|
callbacks[i]();
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -523,7 +523,7 @@ ElfUtil._loadingProfileFailure = function() {
|
|
|
523
523
|
/** @private
|
|
524
524
|
*/
|
|
525
525
|
ElfUtil._profileNameRetrieved = function() {
|
|
526
|
-
|
|
526
|
+
let profileName = ElfUtil.getMovementColorProfile();
|
|
527
527
|
ElfUtil._retrieveThemeColors(profileName);
|
|
528
528
|
if(!ElfUtil._observed) {
|
|
529
529
|
ElfUtil._observed = true;
|
|
@@ -540,7 +540,7 @@ ElfUtil._retrieveThemeColors = function(profileName) {
|
|
|
540
540
|
ElfUtil._themeLoaded = true;
|
|
541
541
|
ElfUtil._profileName = profileName;
|
|
542
542
|
|
|
543
|
-
|
|
543
|
+
let colors = ElfUtil.themeColors = ElfUtil.getCssVariables({
|
|
544
544
|
"primary": "--color-scheme-primary", // Usually used in headers, and selection
|
|
545
545
|
"secondary": "--color-scheme-secondary",
|
|
546
546
|
"tertiary": "--color-scheme-tertiary", // Usually black or white
|
|
@@ -565,20 +565,20 @@ ElfUtil._retrieveThemeColors = function(profileName) {
|
|
|
565
565
|
colors["neutral"] = colors["level"];
|
|
566
566
|
|
|
567
567
|
// Retrieve table styles to be used in grid and extensions
|
|
568
|
-
|
|
568
|
+
let tableElem = document.createElement("table");
|
|
569
569
|
tableElem.style.visibility = "hidden";
|
|
570
570
|
tableElem.style.position = "fixed";
|
|
571
571
|
tableElem.style.left = "0"; // Activate fixed position
|
|
572
572
|
tableElem.style.top = "0";
|
|
573
573
|
tableElem.style.width = "0"; // Prevent creating scrollbar
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
let trElem = tableElem.insertRow(-1);
|
|
575
|
+
let tdElem = trElem.insertCell(-1);
|
|
576
576
|
|
|
577
577
|
document.body.appendChild(tableElem);
|
|
578
|
-
|
|
578
|
+
let trStyles = window.getComputedStyle(trElem);
|
|
579
579
|
colors["tableBg"] = trStyles.backgroundColor; // Usually equivalent to --color-scheme-tertiary
|
|
580
580
|
|
|
581
|
-
|
|
581
|
+
let tdStyles = window.getComputedStyle(tdElem);
|
|
582
582
|
colors["tableText"] = tdStyles.color; // Usually equivalent to --color-scheme-neutral
|
|
583
583
|
colors["tableBorder"] = tdStyles.borderColor;
|
|
584
584
|
if(colors["tableText"] === colors["tableBorder"]) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Abstract base class that provides event management methods for derived class
|
|
2
2
|
* @constructor
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
let EventDispatcher = function () {};
|
|
5
5
|
|
|
6
6
|
/** @type {Object.<string, Function>}
|
|
7
7
|
* @protected
|
|
@@ -26,7 +26,7 @@ EventDispatcher.prototype.addEventListener = function(type, handler) {
|
|
|
26
26
|
this._events = {};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
let listeners = this._events[type];
|
|
30
30
|
if(listeners) {
|
|
31
31
|
if(listeners.indexOf(handler) < 0) {
|
|
32
32
|
listeners.push(handler);
|
|
@@ -43,9 +43,9 @@ EventDispatcher.prototype.addEventListener = function(type, handler) {
|
|
|
43
43
|
* @param {Function} handler Event handler
|
|
44
44
|
*/
|
|
45
45
|
EventDispatcher.prototype.removeEventListener = function(type, handler) {
|
|
46
|
-
|
|
46
|
+
let listeners = (this._events) ? this._events[type] : null;
|
|
47
47
|
if(listeners) {
|
|
48
|
-
|
|
48
|
+
let at = listeners.indexOf(handler);
|
|
49
49
|
if(at >= 0) {
|
|
50
50
|
listeners.splice(at, 1);
|
|
51
51
|
--this._listenerCount;
|
|
@@ -68,7 +68,7 @@ EventDispatcher.prototype.removeAllEventListeners = function() {
|
|
|
68
68
|
EventDispatcher.prototype.hasListener = function(type) {
|
|
69
69
|
if(this._listenerCount) {
|
|
70
70
|
if(type) {
|
|
71
|
-
|
|
71
|
+
let listeners = this._events ? this._events[type] : null;
|
|
72
72
|
return listeners ? (listeners.length > 0) : false;
|
|
73
73
|
} else {
|
|
74
74
|
return true;
|
|
@@ -85,7 +85,7 @@ EventDispatcher.prototype.hasListener = function(type) {
|
|
|
85
85
|
*/
|
|
86
86
|
EventDispatcher.prototype.getListener = function(type, idx) {
|
|
87
87
|
if(type) {
|
|
88
|
-
|
|
88
|
+
let listeners = this._events ? this._events[type] : null;
|
|
89
89
|
if(listeners) {
|
|
90
90
|
if(!idx) {
|
|
91
91
|
idx = 0;
|
|
@@ -101,12 +101,12 @@ EventDispatcher.prototype.getListener = function(type, idx) {
|
|
|
101
101
|
* @param {Object} obj Object that contains a handler with the same name as the given `type`
|
|
102
102
|
* @param {string} type Event name
|
|
103
103
|
* @example
|
|
104
|
-
*
|
|
104
|
+
* let obj = {"mouseUp": function(e) { console.log(e); }};
|
|
105
105
|
* plugin.addListener(obj, "mouseUp");
|
|
106
106
|
* plugin.addListener(obj, "mouseDown");
|
|
107
107
|
*/
|
|
108
108
|
EventDispatcher.prototype.addListener = function(obj, type) {
|
|
109
|
-
|
|
109
|
+
let func = obj ? obj[type] : null;
|
|
110
110
|
if(typeof func === "function") {
|
|
111
111
|
this.addEventListener(type, func);
|
|
112
112
|
}
|
|
@@ -130,11 +130,11 @@ EventDispatcher.prototype._prepareEventArguments = function(type, eventArg) {
|
|
|
130
130
|
* @param {Object} eventArg Event arguments
|
|
131
131
|
*/
|
|
132
132
|
EventDispatcher.prototype._dispatch = function(type, eventArg) {
|
|
133
|
-
|
|
133
|
+
let listeners = this._events ? this._events[type] : null;
|
|
134
134
|
if(listeners) {
|
|
135
135
|
eventArg = this._prepareEventArguments(type, eventArg);
|
|
136
|
-
|
|
137
|
-
for(
|
|
136
|
+
let len = listeners.length;
|
|
137
|
+
for(let i = 0; i < len; ++i) {
|
|
138
138
|
listeners[i](eventArg);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
@@ -144,7 +144,7 @@ EventDispatcher.prototype._dispatch = function(type, eventArg) {
|
|
|
144
144
|
* @function
|
|
145
145
|
* @param {Event} e
|
|
146
146
|
*/
|
|
147
|
-
|
|
147
|
+
let preventDefault = function(e) {
|
|
148
148
|
if(e && e.preventDefault) {
|
|
149
149
|
e.preventDefault();
|
|
150
150
|
e.stopPropagation();
|
|
@@ -6,14 +6,14 @@ import { ElfUtil } from "./ElfUtil.js";
|
|
|
6
6
|
* @constructor
|
|
7
7
|
* @extends {ElementWrapper}
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
let ExpanderIcon = function () {
|
|
10
|
+
let elem;
|
|
11
11
|
if (ExpanderIcon._iconName) {
|
|
12
12
|
elem = document.createElement("ef-icon");
|
|
13
13
|
elem.setAttribute("icon", ExpanderIcon._iconName);
|
|
14
14
|
} else {
|
|
15
15
|
elem = document.createElement("span");
|
|
16
|
-
|
|
16
|
+
let fallback = document.createElement("span");
|
|
17
17
|
fallback.className = "fallback-arrow";
|
|
18
18
|
fallback.textContent = "\u25bc";
|
|
19
19
|
elem.appendChild(fallback);
|
|
@@ -49,7 +49,7 @@ ExpanderIcon._onThemeLoaded = function() {
|
|
|
49
49
|
*/
|
|
50
50
|
ExpanderIcon.loadExpanderStyles = function() {
|
|
51
51
|
if(!ExpanderIcon._iconName) {
|
|
52
|
-
|
|
52
|
+
let themeName = ElfUtil.getThemeName();
|
|
53
53
|
|
|
54
54
|
if(themeName) {
|
|
55
55
|
ExpanderIcon._onThemeLoaded(); // synchronous
|
|
@@ -65,11 +65,11 @@ ExpanderIcon.loadExpanderStyles = function() {
|
|
|
65
65
|
* @return {ExpanderIcon} Return ExpanderIcon object only if Expander is newly created
|
|
66
66
|
*/
|
|
67
67
|
ExpanderIcon.renderOn = function (cell, removal) {
|
|
68
|
-
|
|
68
|
+
let newExpander = null;
|
|
69
69
|
if (removal) {
|
|
70
70
|
cell.removeIcon();
|
|
71
71
|
} else {
|
|
72
|
-
|
|
72
|
+
let expander = cell._expanderIcon;
|
|
73
73
|
if (!expander) {
|
|
74
74
|
expander = cell._expanderIcon = newExpander = new ExpanderIcon();
|
|
75
75
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @private
|
|
3
3
|
* @const
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
let OperatorPrecedences = {
|
|
6
6
|
"||": 1,
|
|
7
7
|
"&&": 2,
|
|
8
8
|
"<": 3,
|
|
@@ -25,7 +25,7 @@ var OperatorPrecedences = {
|
|
|
25
25
|
* @private
|
|
26
26
|
* @const
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
let OperatorFunctions = {
|
|
29
29
|
"+": function(lhs, rhs){ return lhs + rhs; },
|
|
30
30
|
"-": function(lhs, rhs){ return lhs - rhs; },
|
|
31
31
|
"*": function(lhs, rhs){ return lhs * rhs; },
|
|
@@ -46,7 +46,7 @@ var OperatorFunctions = {
|
|
|
46
46
|
* @private
|
|
47
47
|
* @const
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
let OperandRequirements = {
|
|
50
50
|
"+": 2,
|
|
51
51
|
"-": 2,
|
|
52
52
|
"*": 2,
|
|
@@ -71,8 +71,8 @@ var OperandRequirements = {
|
|
|
71
71
|
* @param {string=} dataType
|
|
72
72
|
* @return {number}
|
|
73
73
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
let _addToken = function(ary, value, type, dataType) {
|
|
75
|
+
let tok = {
|
|
76
76
|
value: value,
|
|
77
77
|
type: type
|
|
78
78
|
};
|
|
@@ -92,14 +92,14 @@ var _addToken = function(ary, value, type, dataType) {
|
|
|
92
92
|
* @param {Object} obj
|
|
93
93
|
* @returns {*}
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
let _toValue = function(obj) { // eslint-disable-line
|
|
96
96
|
return obj.value;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
/** @public
|
|
100
100
|
* @namespace
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
let ExpressionParser = {};
|
|
103
103
|
/** @type {Array.<Object>}
|
|
104
104
|
* @private
|
|
105
105
|
* @const
|
|
@@ -113,7 +113,7 @@ ExpressionParser._tokens = [];
|
|
|
113
113
|
* @return {string}
|
|
114
114
|
*/
|
|
115
115
|
ExpressionParser._withString = function(str) {
|
|
116
|
-
|
|
116
|
+
let tokId = _addToken(ExpressionParser._tokens,
|
|
117
117
|
str.substring(1, str.length - 1),
|
|
118
118
|
"literal",
|
|
119
119
|
"string"
|
|
@@ -126,7 +126,7 @@ ExpressionParser._withString = function(str) {
|
|
|
126
126
|
* @return {string}
|
|
127
127
|
*/
|
|
128
128
|
ExpressionParser._withField = function(field) {
|
|
129
|
-
|
|
129
|
+
let tokId = _addToken(ExpressionParser._tokens,
|
|
130
130
|
field,
|
|
131
131
|
"literal",
|
|
132
132
|
"variable"
|
|
@@ -147,9 +147,9 @@ ExpressionParser._withFieldInBrackets = function(field) {
|
|
|
147
147
|
* @return {string}
|
|
148
148
|
*/
|
|
149
149
|
ExpressionParser._withNegativeNumber = function(numStr) {
|
|
150
|
-
|
|
150
|
+
let num = +numStr;
|
|
151
151
|
if(num === num) {
|
|
152
|
-
|
|
152
|
+
let tokId = _addToken(ExpressionParser._tokens,
|
|
153
153
|
num,
|
|
154
154
|
"literal",
|
|
155
155
|
"number"
|
|
@@ -179,7 +179,7 @@ ExpressionParser._withOperator = function(opStr) {
|
|
|
179
179
|
if(opStr == "=" || opStr == "===") {
|
|
180
180
|
opStr = "==";
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
let tokId = _addToken(ExpressionParser._tokens, opStr, "operator");
|
|
183
183
|
return "#" + tokId + "#";
|
|
184
184
|
}
|
|
185
185
|
return "";
|
|
@@ -190,7 +190,7 @@ ExpressionParser._withOperator = function(opStr) {
|
|
|
190
190
|
* @return {string}
|
|
191
191
|
*/
|
|
192
192
|
ExpressionParser._withParenthesis = function(paStr) {
|
|
193
|
-
|
|
193
|
+
let tokId = _addToken(ExpressionParser._tokens, paStr, "parenthesis");
|
|
194
194
|
return "#" + tokId + "#";
|
|
195
195
|
};
|
|
196
196
|
|
|
@@ -201,14 +201,14 @@ ExpressionParser._withParenthesis = function(paStr) {
|
|
|
201
201
|
* @return {boolean} Returns true if there is any error, otherwise returns false (everything is OK)
|
|
202
202
|
*/
|
|
203
203
|
ExpressionParser._tester = function(ctx) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
for(
|
|
209
|
-
|
|
204
|
+
let rpn = ctx._rpn;
|
|
205
|
+
let inputCount = rpn.length;
|
|
206
|
+
let operandCount = 0;
|
|
207
|
+
let maxStack = 0;
|
|
208
|
+
for(let i = 0; i < inputCount; ++i) {
|
|
209
|
+
let tok = rpn[i];
|
|
210
210
|
if(tok.type !== "literal") {
|
|
211
|
-
|
|
211
|
+
let requiredCount = OperandRequirements[tok.value];
|
|
212
212
|
if(operandCount >= requiredCount) {
|
|
213
213
|
operandCount -= requiredCount;
|
|
214
214
|
} else {
|
|
@@ -236,14 +236,14 @@ ExpressionParser._tester = function(ctx) {
|
|
|
236
236
|
* @return {boolean}
|
|
237
237
|
*/
|
|
238
238
|
ExpressionParser._filter = function(ctx, rowData) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
for(
|
|
245
|
-
|
|
246
|
-
|
|
239
|
+
let rpn = ctx._rpn;
|
|
240
|
+
let results = new Array(ctx._stackSize);
|
|
241
|
+
let inputCount = rpn.length;
|
|
242
|
+
let operandCount = 0;
|
|
243
|
+
let curRes;
|
|
244
|
+
for(let i = 0; i < inputCount; ++i) {
|
|
245
|
+
let tok = rpn[i];
|
|
246
|
+
let tokValue = tok.value;
|
|
247
247
|
if(tok.type === "literal") {
|
|
248
248
|
if(tok.dataType !== "variable") {
|
|
249
249
|
curRes = tokValue;
|
|
@@ -287,7 +287,7 @@ ExpressionParser.parse = function(expression) {
|
|
|
287
287
|
return null;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
|
|
290
|
+
let tokExp = expression.trim();
|
|
291
291
|
if(!tokExp) {
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
@@ -302,23 +302,23 @@ ExpressionParser.parse = function(expression) {
|
|
|
302
302
|
tokExp = tokExp.replace(/[\-\/+*%!=<>&|]+/g, ExpressionParser._withOperator);
|
|
303
303
|
tokExp = tokExp.replace(/[()]/g, ExpressionParser._withParenthesis); // round brackets
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
let tokens = ExpressionParser._tokens;
|
|
306
|
+
let tokCount = tokens.length;
|
|
307
307
|
if(!tokCount) {
|
|
308
308
|
return null; // There is no recognizable character
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// Generate infix token list
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
let infixTokens = [];
|
|
313
|
+
let matches = tokExp.match(/#[0-9]+#/g);
|
|
314
|
+
let i, tok, tokType;
|
|
315
315
|
for(i = 0; i < tokCount; ++i) {
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
let tokId = matches[i];
|
|
317
|
+
let tokIdx = +(tokId.substring(1, tokId.length - 1));
|
|
318
318
|
tok = tokens[tokIdx];
|
|
319
319
|
tokType = tok.type;
|
|
320
320
|
if(tokType === "literal") {
|
|
321
|
-
|
|
321
|
+
let prevTok = infixTokens[infixTokens.length - 1];
|
|
322
322
|
if(prevTok && prevTok.type === "literal") { // Incorrect infix notation detected
|
|
323
323
|
if(tok.value < 0 && tok.dataType === "number") {
|
|
324
324
|
_addToken(infixTokens, "-", "operator");
|
|
@@ -336,10 +336,10 @@ ExpressionParser.parse = function(expression) {
|
|
|
336
336
|
// Convert Infix notation to Reverse Polish Notation (Postfix)
|
|
337
337
|
// See https://en.wikipedia.org/wiki/Shunting_yard_algorithm#The_algorithm_in_detail
|
|
338
338
|
tokCount = infixTokens.length;
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
let rpn = [];
|
|
340
|
+
let operators = [];
|
|
341
|
+
let lastOp = null;
|
|
342
|
+
let foundLeftPa = false;
|
|
343
343
|
for(i = 0; i < tokCount; ++i) {
|
|
344
344
|
tok = infixTokens[i];
|
|
345
345
|
tokType = tok.type;
|
|
@@ -388,12 +388,12 @@ ExpressionParser.parse = function(expression) {
|
|
|
388
388
|
console.warn("No right parenthesis paired with the left one");
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
|
|
391
|
+
let inputCount = rpn.length;
|
|
392
392
|
if(!inputCount) {
|
|
393
393
|
return null; // The expression contains nothing but parentheses
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
|
|
396
|
+
let ctx = {
|
|
397
397
|
_rpn: rpn
|
|
398
398
|
};
|
|
399
399
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/** Provide ability for prototype based Class to inherits another class
|
|
2
2
|
* @namespace
|
|
3
3
|
* @example
|
|
4
|
-
*
|
|
4
|
+
* let BaseClass = function() {};
|
|
5
5
|
* BaseClass.prototype.method = function() {};
|
|
6
6
|
* BaseClass.prototype._member = 1;
|
|
7
|
-
*
|
|
7
|
+
* let DerivedClass = function() {};
|
|
8
8
|
* Ext.inherits(DerivedClass, BaseClass); // Derived class will have methods and members of the base class
|
|
9
9
|
* // To call base class method
|
|
10
10
|
* DeriveClass["base"](this, "methodName", ...params);
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
let Ext = {};
|
|
13
13
|
|
|
14
14
|
/** @public
|
|
15
15
|
* @function
|
|
@@ -39,9 +39,9 @@ Ext.inherits = function (childCtor, parentCtor) {
|
|
|
39
39
|
childCtor["base"] = function(me, methodName, var_args) {
|
|
40
40
|
if(!methodName) { methodName = 'constructor'; }
|
|
41
41
|
// Copying using loop to avoid deop due to passing arguments object to function. This is faster in many JS engines as of late 2014.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
for (
|
|
42
|
+
let len = arguments.length;
|
|
43
|
+
let args = new Array(len); // http://jsperf.com/creating-an-array
|
|
44
|
+
for (let i = 2; i < len; i++) {
|
|
45
45
|
args[i - 2] = arguments[i];
|
|
46
46
|
}
|
|
47
47
|
return parentCtor.prototype[methodName].apply(me, args);
|