@refinitiv-ui/efx-grid 6.0.2 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/column-dragging/es6/ColumnDragging.d.ts +49 -0
- package/lib/column-dragging/es6/ColumnDragging.js +764 -0
- package/lib/column-dragging/es6/index.d.ts +1 -0
- package/lib/column-dragging/es6/index.js +1 -0
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +13 -1
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +15 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +146 -5
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +468 -1092
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.d.ts +2 -2
- package/lib/core/es6/data/DataCache.d.ts +4 -4
- package/lib/core/es6/data/DataTable.d.ts +5 -5
- package/lib/core/es6/data/DataTable.js +33 -11
- package/lib/core/es6/data/DataView.d.ts +12 -18
- package/lib/core/es6/data/DataView.js +0 -4
- package/lib/core/es6/data/Segment.d.ts +2 -0
- package/lib/core/es6/data/Segment.js +7 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +3 -3
- package/lib/core/es6/data/WrappedView.d.ts +13 -13
- package/lib/core/es6/data/WrappedView.js +6 -6
- package/lib/core/es6/grid/Core.d.ts +31 -27
- package/lib/core/es6/grid/Core.js +47 -11
- 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 +71 -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 +3 -1
- package/lib/core/es6/grid/components/Scrollbar.js +13 -0
- 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/checkbox-list.d.ts +13 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +14 -1
- package/lib/filter-dialog/lib/filter-dialog.js +86 -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 +25 -10
- package/lib/grid/lib/efx-grid.js +22 -56
- package/lib/grid/themes/base.less +1 -1
- 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/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +7 -2
- package/lib/row-segmenting/es6/RowSegmenting.js +98 -11
- package/lib/rt-grid/dist/rt-grid.js +1244 -1249
- 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 +24 -9
- package/lib/rt-grid/es6/Grid.js +285 -103
- 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 +6 -1
- package/lib/rt-grid/es6/SnapshotFiller.js +144 -15
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +4 -3
- package/lib/tr-grid-checkbox/es6/Checkbox.js +51 -21
- 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 +4 -3
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +28 -13
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +8 -5
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +106 -3
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +1 -1
- package/lib/tr-grid-printer/es6/CellWriter.d.ts +3 -3
- package/lib/tr-grid-printer/es6/GridPrinter.d.ts +1 -1
- package/lib/tr-grid-printer/es6/GridPrinter.js +26 -13
- package/lib/tr-grid-printer/es6/PrintTrait.d.ts +2 -2
- package/lib/tr-grid-printer/es6/SectionWriter.d.ts +3 -3
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +3 -4
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +86 -195
- 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.d.ts +8 -8
- package/lib/tr-grid-row-selection/es6/RowSelection.js +55 -31
- package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +1 -1
- package/lib/tr-grid-textformatting/es6/TextFormatting.js +12 -0
- package/lib/tr-grid-util/es6/CellPainter.js +1 -1
- 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 +32 -2
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -1
- package/lib/tr-grid-util/es6/ElfUtil.js +131 -28
- package/lib/tr-grid-util/es6/ExpanderIcon.js +2 -2
- 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/MultiTableManager.d.ts +8 -0
- package/lib/tr-grid-util/es6/MultiTableManager.js +164 -57
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +2 -0
- package/lib/tr-grid-util/es6/NumberFormatter.js +64 -19
- package/lib/tr-grid-util/es6/RowPainter.js +57 -19
- package/lib/tr-grid-util/es6/formula/Formula.js +9 -1
- package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
- package/lib/types/es6/Checkbox.d.ts +4 -3
- 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 +4 -3
- 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 -18
- package/lib/types/es6/Core/data/Segment.d.ts +2 -0
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +3 -3
- package/lib/types/es6/Core/data/WrappedView.d.ts +13 -13
- package/lib/types/es6/Core/grid/Core.d.ts +31 -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 +3 -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 +8 -5
- 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 +24 -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 +6 -1
- package/lib/types/es6/RowDragging.d.ts +3 -4
- package/lib/types/es6/RowGrouping.d.ts +7 -2
- package/lib/types/es6/RowSegmenting.d.ts +7 -2
- package/lib/types/es6/RowSelection.d.ts +8 -8
- package/lib/types/es6/TextFormatting.d.ts +1 -1
- package/lib/types/es6/index.d.ts +1 -0
- package/lib/versions.json +17 -16
- 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,5 +1,6 @@
|
|
1
1
|
import { nestedObjectToArray, rgb2Hex } from "./Util.js";
|
2
2
|
import { Deferred } from "./Deferred.js";
|
3
|
+
import { ElementObserver } from "./ElementObserver.js";
|
3
4
|
|
4
5
|
/** Dialog supporting language (selection dialog, formater dialog and filter dialog)
|
5
6
|
* @type {!Object.<string, boolean>}
|
@@ -63,6 +64,22 @@ ElfUtil._dummyIcon = null;
|
|
63
64
|
* @private
|
64
65
|
*/
|
65
66
|
ElfUtil._iconLoaded = false;
|
67
|
+
/** @type {string|null}
|
68
|
+
* @private
|
69
|
+
*/
|
70
|
+
ElfUtil._profileName = null;
|
71
|
+
/** @type {Array}
|
72
|
+
* @private
|
73
|
+
*/
|
74
|
+
ElfUtil._callbacks = [];
|
75
|
+
/** @type {boolean}
|
76
|
+
* @private
|
77
|
+
*/
|
78
|
+
ElfUtil._observed = false;
|
79
|
+
/** @type {boolean}
|
80
|
+
* @private
|
81
|
+
*/
|
82
|
+
ElfUtil._pendingResolve = false;
|
66
83
|
|
67
84
|
/** @type {Object.<string, Object>}
|
68
85
|
* @private
|
@@ -78,7 +95,7 @@ ElfUtil._icons = {
|
|
78
95
|
"sortable": "sort-up-down"
|
79
96
|
},
|
80
97
|
"columnStack": {
|
81
|
-
"stack": "
|
98
|
+
"stack": "map-layers",
|
82
99
|
"expand": "right",
|
83
100
|
"collapse": "left"
|
84
101
|
}
|
@@ -334,57 +351,146 @@ ElfUtil.getCssVariables = function (obj, optElem) {
|
|
334
351
|
return obj || null;
|
335
352
|
};
|
336
353
|
|
354
|
+
/** @public
|
355
|
+
* @param {Object} rtk
|
356
|
+
*/
|
357
|
+
ElfUtil.setRTK = function(rtk) {
|
358
|
+
if(rtk != null) {
|
359
|
+
ElfUtil._rtk = rtk;
|
360
|
+
}
|
361
|
+
};
|
362
|
+
|
363
|
+
/** Get current profile name set on the root html element (document.documentElement)
|
364
|
+
* @public
|
365
|
+
* @return {string} Current profile name
|
366
|
+
*/
|
367
|
+
ElfUtil.getMovementColorProfile = function() {
|
368
|
+
return document.documentElement.getAttribute("movement-color-profile");
|
369
|
+
};
|
370
|
+
|
371
|
+
/** @private
|
372
|
+
* @param {Function} cb
|
373
|
+
*/
|
374
|
+
ElfUtil._addThemeChangedCallback = function(cb) {
|
375
|
+
var callbacks = ElfUtil._callbacks;
|
376
|
+
if(callbacks.indexOf(cb) < 0) {
|
377
|
+
callbacks.push(cb);
|
378
|
+
}
|
379
|
+
};
|
380
|
+
|
337
381
|
/** Gets current theme colors from the document and returns a promise. <br>
|
338
|
-
* WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists. <br>
|
382
|
+
* WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists or RTK is available. <br>
|
339
383
|
* To re-request/reset theme colors, set ElfUtil.themeReady variable to null
|
340
384
|
* @public
|
385
|
+
* @param {Function=} themeChangedCb
|
341
386
|
* @return {Promise<Object>} A promise of object of theme colors
|
342
387
|
*/
|
343
|
-
ElfUtil.getThemeColors = function() {
|
388
|
+
ElfUtil.getThemeColors = function(themeChangedCb) {
|
389
|
+
if(typeof themeChangedCb === "function") {
|
390
|
+
ElfUtil._addThemeChangedCallback(themeChangedCb);
|
391
|
+
}
|
392
|
+
|
344
393
|
if(ElfUtil.themeReady) {
|
345
394
|
return ElfUtil.themeReady;
|
346
395
|
}
|
396
|
+
|
347
397
|
var d = ElfUtil._deferred = new Deferred();
|
348
398
|
ElfUtil.themeReady = d.promise;
|
349
399
|
|
350
|
-
var
|
351
|
-
if(
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
});
|
357
|
-
} catch (err) {
|
358
|
-
d.reject("Cannot read JET's settings");
|
400
|
+
var profileName = ElfUtil.getMovementColorProfile();
|
401
|
+
if(profileName) {
|
402
|
+
if(profileName !== ElfUtil._profileName) {
|
403
|
+
setTimeout(ElfUtil._profileNameRetrieved, 100); // TODO: Find a proper way to ensure that theme is ready
|
404
|
+
} else {
|
405
|
+
ElfUtil._deferred.resolve(ElfUtil.themeColors);
|
359
406
|
}
|
360
407
|
} else {
|
361
|
-
|
408
|
+
var options = {
|
409
|
+
providerName: "Configuration",
|
410
|
+
settingName: "RDE_USER_CURRENT_TICK_COLOR"
|
411
|
+
};
|
412
|
+
|
413
|
+
var jet = window ? window.JET : null;
|
414
|
+
if(ElfUtil._rtk && ElfUtil._rtk.Settings) {
|
415
|
+
ElfUtil._rtk.Settings.getAsync(options).then(ElfUtil._loadingProfileSuccess, ElfUtil._loadingProfileFailure);
|
416
|
+
} else if(jet && jet.Settings) {
|
417
|
+
try {
|
418
|
+
jet.Settings.read(ElfUtil._loadingProfileSuccess, options);
|
419
|
+
} catch (err) {
|
420
|
+
ElfUtil._loadingProfileFailure();
|
421
|
+
}
|
422
|
+
} else {
|
423
|
+
setTimeout(ElfUtil._profileNameRetrieved, 100); // TODO: Find a proper way to ensure that theme is ready
|
424
|
+
}
|
362
425
|
}
|
426
|
+
|
363
427
|
return d.promise;
|
364
428
|
};
|
365
429
|
|
366
|
-
/**
|
430
|
+
/** @private
|
431
|
+
* @param {string} profileName
|
432
|
+
*/
|
433
|
+
var movementColorProfileChanged = function(profileName) {
|
434
|
+
if(profileName && profileName !== ElfUtil._profileName) {
|
435
|
+
ElfUtil._retrieveThemeColors(profileName);
|
436
|
+
|
437
|
+
if(ElfUtil._pendingResolve) {
|
438
|
+
ElfUtil._pendingResolve = false;
|
439
|
+
ElfUtil._deferred.resolve(ElfUtil.themeColors);
|
440
|
+
}
|
441
|
+
|
442
|
+
var callbacks = ElfUtil._callbacks;
|
443
|
+
for (var i = 0; i < callbacks.length; i++) {
|
444
|
+
callbacks[i]();
|
445
|
+
}
|
446
|
+
}
|
447
|
+
};
|
448
|
+
|
449
|
+
/** Get user's color profile from JET or TRK and set it to html tag (document.documentElement)
|
367
450
|
* @private
|
368
|
-
* @param {string}
|
451
|
+
* @param {string} profileName Returned from JET.Settings or RTK.Settings
|
369
452
|
*/
|
370
|
-
ElfUtil.
|
371
|
-
if(
|
372
|
-
document.documentElement.setAttribute("movement-color-profile",
|
453
|
+
ElfUtil._loadingProfileSuccess = function(profileName) {
|
454
|
+
if(profileName) {
|
455
|
+
document.documentElement.setAttribute("movement-color-profile", profileName.toLowerCase());
|
456
|
+
}
|
457
|
+
|
458
|
+
if(ElfUtil._observed) { // Let attribute listener does the job
|
459
|
+
ElfUtil._pendingResolve = true;
|
460
|
+
} else {
|
461
|
+
ElfUtil._profileNameRetrieved(profileName);
|
373
462
|
}
|
374
|
-
ElfUtil._retrieveThemeColors();
|
375
463
|
};
|
376
|
-
|
377
|
-
|
378
|
-
* @return {string} Current profile name
|
464
|
+
|
465
|
+
/** @private
|
379
466
|
*/
|
380
|
-
ElfUtil.
|
381
|
-
|
467
|
+
ElfUtil._loadingProfileFailure = function() {
|
468
|
+
if(!ElfUtil._observed) {
|
469
|
+
ElfUtil._observed = true;
|
470
|
+
ElementObserver.addAttributeListener(document.documentElement, movementColorProfileChanged, "movement-color-profile");
|
471
|
+
}
|
472
|
+
ElfUtil._deferred.reject("Failed to get movement color profile from settings.");
|
473
|
+
};
|
474
|
+
|
475
|
+
/** @private
|
476
|
+
*/
|
477
|
+
ElfUtil._profileNameRetrieved = function() {
|
478
|
+
var profileName = ElfUtil.getMovementColorProfile();
|
479
|
+
ElfUtil._retrieveThemeColors(profileName);
|
480
|
+
if(!ElfUtil._observed) {
|
481
|
+
ElfUtil._observed = true;
|
482
|
+
ElementObserver.addAttributeListener(document.documentElement, movementColorProfileChanged, "movement-color-profile");
|
483
|
+
}
|
484
|
+
ElfUtil._deferred.resolve(ElfUtil.themeColors);
|
382
485
|
};
|
383
486
|
|
384
487
|
/** Get theme colors from document
|
385
488
|
* @private
|
489
|
+
* @param {string} profileName Movement color profile name
|
386
490
|
*/
|
387
|
-
ElfUtil._retrieveThemeColors = function() {
|
491
|
+
ElfUtil._retrieveThemeColors = function(profileName) {
|
492
|
+
ElfUtil._profileName = profileName;
|
493
|
+
|
388
494
|
var colors = ElfUtil.themeColors = ElfUtil.getCssVariables({
|
389
495
|
"primary": "--color-scheme-primary", // Usually used in headers, and selection
|
390
496
|
"secondary": "--color-scheme-secondary",
|
@@ -449,10 +555,7 @@ ElfUtil._retrieveThemeColors = function() {
|
|
449
555
|
colors["baseGrid"] = colors["tableBg"];
|
450
556
|
colors["baseText"] = colors["tableText"];
|
451
557
|
colors["trackColor"] = colors["primary"] || ElfUtil._defaultColors["trackColor"];
|
452
|
-
|
453
|
-
ElfUtil._deferred.resolve(colors);
|
454
558
|
};
|
455
559
|
|
456
|
-
|
457
560
|
export default ElfUtil;
|
458
561
|
export { ElfUtil };
|
@@ -39,10 +39,10 @@ ExpanderIcon._iconName = ""; // static variable
|
|
39
39
|
* @private
|
40
40
|
*/
|
41
41
|
ExpanderIcon._styles = prettifyCss([
|
42
|
-
".tr-grid
|
42
|
+
".tr-grid.expander-disabled .expander", [
|
43
43
|
"cursor: default;"
|
44
44
|
],
|
45
|
-
".tr-grid
|
45
|
+
".tr-grid.folder-disabled .cell.folder", [
|
46
46
|
"cursor: default;"
|
47
47
|
],
|
48
48
|
".tr-grid .expander", [
|
@@ -167,7 +167,7 @@ FieldFormatter.prototype.init = function(options) { // deserialize
|
|
167
167
|
var utc = options["useUTCTime"];
|
168
168
|
if(utc != null || dtf != null) {
|
169
169
|
this.setDateTimeMeta(
|
170
|
-
dtf
|
170
|
+
dtf,
|
171
171
|
utc,
|
172
172
|
(options["idnSource"]) ? "idn" : "" // IDN Source will send time in second instead of millisecond.
|
173
173
|
);
|
@@ -188,8 +188,10 @@ FieldFormatter.prototype.getOptions = function(options) { // serialize
|
|
188
188
|
|
189
189
|
options["field"] = this._field;
|
190
190
|
options["formatType"] = this._userFormatType ? this._userFormatType : this._formatType; // WARNING: Beware of case sensitivity
|
191
|
-
options["
|
192
|
-
|
191
|
+
if(toDateTimeType(options["formatType"]) == DATE_TIME){
|
192
|
+
options["dateTimeFormat"] = this._dateTimeFormat;
|
193
|
+
options["useUTCTime"] = (this._timeZone == "GMT");
|
194
|
+
}
|
193
195
|
return options;
|
194
196
|
};
|
195
197
|
/** @public
|
@@ -244,7 +246,7 @@ FieldFormatter.prototype.setField = function(field, combinedField, formattedFiel
|
|
244
246
|
* @param {string=} lang
|
245
247
|
*/
|
246
248
|
FieldFormatter.prototype.setDateTimeMeta = function(format, gmtTimeZone, inputSource, lang) {
|
247
|
-
this._dateTimeFormat = format;
|
249
|
+
this._dateTimeFormat = format || "";
|
248
250
|
this._timeZone = (gmtTimeZone !== false) ? "GMT" : "LOCAL";
|
249
251
|
this._idnSource = (inputSource && inputSource.toLowerCase() == "idn") ? "idn" : "";
|
250
252
|
DateTime.setLocale(lang);
|
@@ -385,7 +387,7 @@ FieldFormatter.prototype._formatDateTime = function(val, rowData) {
|
|
385
387
|
}
|
386
388
|
val = new Date(sec * 1000); // Convert real-time raw data (second) to millisecond
|
387
389
|
}
|
388
|
-
return this._df(val, this._dateTimeFormat, this._timeZone);
|
390
|
+
return this._df(val, this._dateTimeFormat || "MM/DD/YYYY", this._timeZone);
|
389
391
|
};
|
390
392
|
/** @private
|
391
393
|
* @param {number|string|Date} val
|
@@ -262,13 +262,17 @@ GridPlugin.prototype.getColumnIndex = function (colId) {
|
|
262
262
|
GridPlugin.prototype.getColumnIndices = function (colRefs) {
|
263
263
|
if(this._compositeGrid) {
|
264
264
|
var allFields = this._compositeGrid.getColumnFields();
|
265
|
+
var columnCount = this._compositeGrid.getColumnCount();
|
265
266
|
var columnIndices = [];
|
267
|
+
var colRef;
|
266
268
|
for (var i = 0; i < colRefs.length; i++) {
|
267
|
-
|
268
|
-
if(typeof
|
269
|
-
|
269
|
+
colRef = colRefs[i];
|
270
|
+
if(typeof colRef === 'number') { // When user pass index
|
271
|
+
if(colRef >= 0 && colRef < columnCount) {
|
272
|
+
columnIndices.push(colRef);
|
273
|
+
}
|
270
274
|
} else {
|
271
|
-
var columnIndex = allFields.indexOf(
|
275
|
+
var columnIndex = allFields.indexOf(colRef); // Looping check column index of colRefs field
|
272
276
|
if(columnIndex !== -1) {
|
273
277
|
columnIndices.push(columnIndex);
|
274
278
|
}
|
@@ -18,6 +18,8 @@ declare class MultiTableManager {
|
|
18
18
|
|
19
19
|
public setTableCount(num: number): void;
|
20
20
|
|
21
|
+
public wrapTable(rowCount: number): void;
|
22
|
+
|
21
23
|
public getTable(at?: number): Element|null;
|
22
24
|
|
23
25
|
public insertRow(rowOption?: any, at?: number): void;
|
@@ -26,6 +28,12 @@ declare class MultiTableManager {
|
|
26
28
|
|
27
29
|
public getRowCount(): number;
|
28
30
|
|
31
|
+
public insertColumn(columnOption: any, idx?: number): void;
|
32
|
+
|
33
|
+
public removeColumn(colRef: any): void;
|
34
|
+
|
35
|
+
public getColumnCount(): number;
|
36
|
+
|
29
37
|
}
|
30
38
|
|
31
39
|
export default MultiTableManager;
|
@@ -49,6 +49,10 @@ var _newArrayOfObject = function (num) {
|
|
49
49
|
* @param {boolean=} bool
|
50
50
|
*/
|
51
51
|
var _toggleInlineElement = function (elem, bool) {
|
52
|
+
if(!elem || elem.style.display === "none") {
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
|
52
56
|
var s = elem.style;
|
53
57
|
if(bool == null) {
|
54
58
|
bool = s.display !== "inline-block";
|
@@ -68,7 +72,7 @@ var _toggleInlineElement = function (elem, bool) {
|
|
68
72
|
var MultiTableManager = function (gridElem) {
|
69
73
|
this._onDelayedConfiguration = this._onDelayedConfiguration.bind(this);
|
70
74
|
this._onConfiguration = this._onConfiguration.bind(this);
|
71
|
-
this.
|
75
|
+
this._onWrapCountChanged = this._onWrapCountChanged.bind(this);
|
72
76
|
|
73
77
|
this._tables = [];
|
74
78
|
if(gridElem) {
|
@@ -102,6 +106,10 @@ MultiTableManager.prototype._emeraldGrid = false;
|
|
102
106
|
* @private
|
103
107
|
*/
|
104
108
|
MultiTableManager.prototype._ready = false;
|
109
|
+
/** @type {number}
|
110
|
+
* @private
|
111
|
+
*/
|
112
|
+
MultiTableManager.prototype._wrapSize = 0;
|
105
113
|
|
106
114
|
|
107
115
|
/** @public
|
@@ -196,6 +204,7 @@ MultiTableManager._onVScrollbarSynchronization = function(vScrollbarHost, hScrol
|
|
196
204
|
for(var i = 0; i < gridLen; ++i) {
|
197
205
|
var gridElem = gridElems[i];
|
198
206
|
var core = gridElem.api.getCoreGrid();
|
207
|
+
|
199
208
|
_toggleInlineElement(gridElem, true);
|
200
209
|
if(i > 0) {
|
201
210
|
mainCore.synchronizeVScrollbar(core);
|
@@ -234,6 +243,8 @@ MultiTableManager.prototype.setGridConfig = function (configObj) {
|
|
234
243
|
* @param {Object} e
|
235
244
|
*/
|
236
245
|
MultiTableManager.prototype._onDelayedConfiguration = function (e) {
|
246
|
+
this._ready = false;
|
247
|
+
// TODO: Handle the case where config is changed at runtime
|
237
248
|
setTimeout(this._onConfiguration, 10); // Add delay to ensure that scrollbars are synchronized first
|
238
249
|
};
|
239
250
|
/** @private
|
@@ -245,15 +256,16 @@ MultiTableManager.prototype._onConfiguration = function () {
|
|
245
256
|
}
|
246
257
|
this._ready = true;
|
247
258
|
|
248
|
-
|
259
|
+
if(this._wrapSize) {
|
260
|
+
this._wrapTable(this._wrapSize);
|
261
|
+
} else {
|
262
|
+
this._setTableCount(this._tableCount);
|
263
|
+
}
|
249
264
|
};
|
250
265
|
|
251
266
|
/** @public
|
252
267
|
*/
|
253
268
|
MultiTableManager.prototype.dispose = function () {
|
254
|
-
// var main = this._tables[0];
|
255
|
-
// main.api.getDataSource().unlisten("dataChanged", this._onDataChanged);
|
256
|
-
|
257
269
|
var len = this._tables.length;
|
258
270
|
for(var i = 0; i < len; ++i) {
|
259
271
|
this._tables[i].dispose();
|
@@ -272,7 +284,8 @@ MultiTableManager.prototype._cloneConfig = function () {
|
|
272
284
|
if(this._configObj) {
|
273
285
|
obj = cloneObject(this._configObj);
|
274
286
|
if(Array.isArray(obj.columns)) {
|
275
|
-
|
287
|
+
var runtimeConfig = this._tables[0].api ? this._tables[0].api.getConfigObject() : this._configObj;
|
288
|
+
obj.columns = runtimeConfig.columns.slice();
|
276
289
|
}
|
277
290
|
}
|
278
291
|
return obj || {};
|
@@ -282,13 +295,12 @@ MultiTableManager.prototype._cloneConfig = function () {
|
|
282
295
|
* @return {number}
|
283
296
|
*/
|
284
297
|
MultiTableManager.prototype.getTableCount = function() {
|
285
|
-
return this.
|
298
|
+
return this._tables.length;
|
286
299
|
};
|
287
|
-
/**
|
288
|
-
* @public
|
300
|
+
/** @private
|
289
301
|
* @param {number} num Number of tables. Number cannot be less than one.
|
290
302
|
*/
|
291
|
-
MultiTableManager.prototype.
|
303
|
+
MultiTableManager.prototype._setTableCount = function(num) {
|
292
304
|
this._tableCount = num > 0 ? num : 1;
|
293
305
|
|
294
306
|
if(this._ready) {
|
@@ -301,30 +313,53 @@ MultiTableManager.prototype.setTableCount = function(num) {
|
|
301
313
|
}
|
302
314
|
};
|
303
315
|
/**
|
316
|
+
* @public
|
317
|
+
* @param {number} num Number of tables. Number cannot be less than one.
|
318
|
+
*/
|
319
|
+
MultiTableManager.prototype.setTableCount = function(num) {
|
320
|
+
if(this._wrapSize) {
|
321
|
+
this._wrapTable(0);
|
322
|
+
}
|
323
|
+
this._setTableCount(num);
|
324
|
+
};
|
325
|
+
/**
|
304
326
|
* @private
|
327
|
+
* @param {number} tableIndex
|
305
328
|
* @return {Element}
|
306
329
|
*/
|
307
|
-
MultiTableManager.prototype._addTable = function() {
|
330
|
+
MultiTableManager.prototype._addTable = function(tableIndex) {
|
308
331
|
var main = this._tables[0];
|
309
332
|
var parentElem = main.parentNode;
|
333
|
+
var core = main.api.getCoreGrid();
|
310
334
|
var mainDataView = main.api.getDataView();
|
311
335
|
// var mainDataTable = main.api.getDataTable();
|
336
|
+
var stp = core.getPlugin("SortableTitlePlugin");
|
337
|
+
var dtp = core.getPlugin("DragAndDropTitlePlugin");
|
312
338
|
|
313
339
|
var configObj = this._cloneConfig();
|
314
340
|
configObj.extensions = this._generateExtensions();
|
341
|
+
|
315
342
|
delete configObj.staticDataRows;
|
316
343
|
delete configObj.rows;
|
317
344
|
delete configObj.dataModel;
|
318
345
|
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
configObj.dataModel = {
|
324
|
-
data: ary
|
325
|
-
};
|
346
|
+
if(this._wrapSize) {
|
347
|
+
var wrappedViews = mainDataView.getWrappedViews();
|
348
|
+
configObj.dataView = wrappedViews[tableIndex - 1];
|
349
|
+
configObj.grid = main.api;
|
326
350
|
} else {
|
327
|
-
configObj
|
351
|
+
configObj["SortableTitle"] = stp;
|
352
|
+
configObj["DragAndDropTitle"] = dtp;
|
353
|
+
var rowCount = mainDataView.getRowCount();
|
354
|
+
|
355
|
+
var ary = _newArrayOfObject(rowCount);
|
356
|
+
if(this._emeraldGrid) {
|
357
|
+
configObj.dataModel = {
|
358
|
+
data: ary
|
359
|
+
};
|
360
|
+
} else {
|
361
|
+
configObj.rows = ary;
|
362
|
+
}
|
328
363
|
}
|
329
364
|
|
330
365
|
var sub = document.createElement(main.tagName);
|
@@ -347,19 +382,22 @@ MultiTableManager.prototype._addTables = function(num) {
|
|
347
382
|
|
348
383
|
var main = this._tables[0];
|
349
384
|
_toggleInlineElement(main, true); // TODO: Check if we need to do this every time
|
385
|
+
|
350
386
|
// main.api.setFitContentWidth(true);
|
351
387
|
|
352
388
|
for(var i = 0; i < num; ++i) {
|
353
|
-
var grid = this._addTable();
|
389
|
+
var grid = this._addTable(this._tables.length);
|
354
390
|
this._tables.push(grid);
|
355
391
|
}
|
356
392
|
|
357
|
-
if(
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
393
|
+
if(!this._wrapSize) {
|
394
|
+
if(main._vScrollbarSynchronization) {
|
395
|
+
MultiTableManager.synchronizeVScrollbar(
|
396
|
+
main.api.getCoreGrid().getVScrollbar().getParent(),
|
397
|
+
main.parentNode,
|
398
|
+
this._tables
|
399
|
+
);
|
400
|
+
}
|
363
401
|
}
|
364
402
|
};
|
365
403
|
/**
|
@@ -381,20 +419,62 @@ MultiTableManager.prototype._removeTables = function(num) {
|
|
381
419
|
sub.parentNode.removeChild(sub);
|
382
420
|
}
|
383
421
|
}
|
384
|
-
if(this._tables.length === 1) {
|
385
|
-
|
386
|
-
|
422
|
+
// if(this._tables.length === 1) {
|
423
|
+
// TODO: Reset state
|
424
|
+
// this._tables[0].style.display = ""; // Remove display inline
|
425
|
+
// }
|
426
|
+
};
|
427
|
+
|
428
|
+
|
429
|
+
/** @private
|
430
|
+
* @param {number} rowCount Number of row per table. Set number to zero to turn off wrap mode.
|
431
|
+
*/
|
432
|
+
MultiTableManager.prototype._wrapTable = function(rowCount) {
|
433
|
+
this._wrapSize = rowCount > 0 ? rowCount : 0;
|
434
|
+
|
435
|
+
if(this._ready) {
|
436
|
+
var main = this._tables[0];
|
437
|
+
if(this._wrapSize) {
|
438
|
+
main.style.display = "none";
|
439
|
+
main.api.getCoreGrid().getVScrollbar().disable();
|
440
|
+
} else {
|
441
|
+
main.style.display = "";
|
442
|
+
_toggleInlineElement(main, true);
|
443
|
+
main.api.getCoreGrid().getVScrollbar().disable(false);
|
444
|
+
}
|
445
|
+
|
446
|
+
var dv = main.api.getDataView();
|
447
|
+
dv.listen("wrapCountChanged", this._onWrapCountChanged);
|
448
|
+
dv.wrapView(this._wrapSize);
|
387
449
|
}
|
388
450
|
};
|
389
451
|
/**
|
390
|
-
* @
|
452
|
+
* @public
|
453
|
+
* @param {number} rowCount Number of row per table. Set number to zero to turn off wrap mode.
|
454
|
+
*/
|
455
|
+
MultiTableManager.prototype.wrapTable = function(rowCount) {
|
456
|
+
if(rowCount && this._tableCount > 1) {
|
457
|
+
this._setTableCount(1);
|
458
|
+
}
|
459
|
+
if(!rowCount || rowCount < 0) {
|
460
|
+
rowCount = 0;
|
461
|
+
}
|
462
|
+
if(this._wrapSize !== rowCount) {
|
463
|
+
this._wrapTable(rowCount);
|
464
|
+
}
|
465
|
+
};
|
466
|
+
/** @private
|
391
467
|
* @param {Object} e
|
392
468
|
*/
|
393
|
-
MultiTableManager.prototype.
|
394
|
-
|
469
|
+
MultiTableManager.prototype._onWrapCountChanged = function(e) {
|
470
|
+
if(e.prevCount < e.newCount) {
|
471
|
+
this._addTables(e.newCount - e.prevCount);
|
472
|
+
}
|
473
|
+
if(e.newCount < e.prevCount) {
|
474
|
+
this._removeTables(e.prevCount - e.newCount);
|
475
|
+
}
|
395
476
|
};
|
396
477
|
|
397
|
-
|
398
478
|
/** @public
|
399
479
|
* @param {number=} at
|
400
480
|
* @return {Element}
|
@@ -445,23 +525,6 @@ MultiTableManager.prototype._execAll = function(methodName, args) {
|
|
445
525
|
}
|
446
526
|
};
|
447
527
|
|
448
|
-
/** @private
|
449
|
-
* @param {number} num
|
450
|
-
*/
|
451
|
-
MultiTableManager.prototype._setRtRowCount = function(num) {
|
452
|
-
var tableCount = this._tables.length;
|
453
|
-
// grid.api.getRowCount();
|
454
|
-
for(var i = 1; i < tableCount; ++i) {
|
455
|
-
var sub = this._tables[i];
|
456
|
-
sub.api.insertRows(_newArrayOfObject(num));
|
457
|
-
}
|
458
|
-
};
|
459
|
-
/** @private
|
460
|
-
* @param {number} num
|
461
|
-
*/
|
462
|
-
MultiTableManager.prototype._addCsRows = function(num) {
|
463
|
-
};
|
464
|
-
|
465
528
|
/** @public
|
466
529
|
* @param {Object=} rowOption
|
467
530
|
* @param {number=} at
|
@@ -471,10 +534,14 @@ MultiTableManager.prototype.insertRow = function(rowOption, at) {
|
|
471
534
|
return; // TODO
|
472
535
|
}
|
473
536
|
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
537
|
+
if(this._wrapSize) {
|
538
|
+
this.getTable().api.insertRow(rowOption, at);
|
539
|
+
} else {
|
540
|
+
var tableCount = this._tables.length;
|
541
|
+
for(var i = 0; i < tableCount; ++i) {
|
542
|
+
var tbl = this._tables[i];
|
543
|
+
tbl.api.insertRow(rowOption, at);
|
544
|
+
}
|
478
545
|
}
|
479
546
|
};
|
480
547
|
/** @public
|
@@ -488,18 +555,58 @@ MultiTableManager.prototype.removeRow = function(at) {
|
|
488
555
|
at = this.getRowCount() - 1;
|
489
556
|
}
|
490
557
|
|
558
|
+
if(this._wrapSize) {
|
559
|
+
this.getTable().api.removeRow(at);
|
560
|
+
} else {
|
561
|
+
var tableCount = this._tables.length;
|
562
|
+
for(var i = 0; i < tableCount; ++i) {
|
563
|
+
var tbl = this._tables[i];
|
564
|
+
tbl.api.removeRow(at);
|
565
|
+
}
|
566
|
+
}
|
567
|
+
};
|
568
|
+
|
569
|
+
/** @public
|
570
|
+
* @return {number}
|
571
|
+
*/
|
572
|
+
MultiTableManager.prototype.getRowCount = function() {
|
573
|
+
return this.getTable().api.getRowCount();
|
574
|
+
};
|
575
|
+
|
576
|
+
/** @public
|
577
|
+
* @param {*} columnOption String will be treated as field, while object is treated as the column options
|
578
|
+
* @param {number=} idx
|
579
|
+
*/
|
580
|
+
MultiTableManager.prototype.insertColumn = function(columnOption, idx) {
|
581
|
+
if(this._emeraldGrid) {
|
582
|
+
return; // TODO
|
583
|
+
}
|
584
|
+
|
491
585
|
var tableCount = this._tables.length;
|
492
586
|
for(var i = 0; i < tableCount; ++i) {
|
493
587
|
var tbl = this._tables[i];
|
494
|
-
tbl.api.
|
588
|
+
tbl.api.insertColumn(columnOption, idx);
|
589
|
+
}
|
590
|
+
};
|
591
|
+
/** @public
|
592
|
+
* @param {*} colRef Column reference
|
593
|
+
*/
|
594
|
+
MultiTableManager.prototype.removeColumn = function(colRef) {
|
595
|
+
if(this._emeraldGrid) {
|
596
|
+
return; // TODO
|
597
|
+
}
|
598
|
+
var tableCount = this._tables.length;
|
599
|
+
for(var i = 0; i < tableCount; ++i) {
|
600
|
+
var tbl = this._tables[i];
|
601
|
+
tbl.api.removeColumn(colRef);
|
495
602
|
}
|
496
603
|
};
|
497
604
|
|
498
605
|
/** @public
|
499
606
|
* @return {number}
|
500
607
|
*/
|
501
|
-
MultiTableManager.prototype.
|
502
|
-
return this.getTable().api.
|
608
|
+
MultiTableManager.prototype.getColumnCount = function() {
|
609
|
+
return this.getTable().api.getColumnCount();
|
503
610
|
};
|
504
611
|
|
505
612
|
export default MultiTableManager;
|
@@ -27,6 +27,8 @@ declare class NumberFormatter {
|
|
27
27
|
|
28
28
|
public static padDecimalPartWithZeroes(str: string, precision: number): string;
|
29
29
|
|
30
|
+
public static multiplyByHundred(num: number): number;
|
31
|
+
|
30
32
|
public getOptions(options?: any): any;
|
31
33
|
|
32
34
|
public format(origVal: number): string;
|