@refinitiv-ui/efx-grid 6.0.5 → 6.0.7
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 +13 -11
- package/lib/column-dragging/es6/ColumnDragging.js +21 -15
- package/lib/column-format-dialog/lib/column-format-dialog.d.ts +1 -1
- package/lib/column-format-dialog/lib/column-format-dialog.js +3 -4
- package/lib/column-format-dialog/lib/preview-table.js +3 -4
- package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +2 -2
- package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +456 -269
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/ColumnStats.d.ts +3 -3
- package/lib/core/es6/data/DataCache.d.ts +9 -9
- package/lib/core/es6/data/DataTable.d.ts +28 -28
- package/lib/core/es6/data/DataTable.js +44 -11
- package/lib/core/es6/data/DataView.d.ts +62 -62
- package/lib/core/es6/data/DataView.js +42 -22
- package/lib/core/es6/data/Segment.d.ts +8 -4
- package/lib/core/es6/data/Segment.js +16 -0
- package/lib/core/es6/data/SegmentCollection.d.ts +9 -7
- package/lib/core/es6/data/SegmentCollection.js +38 -36
- package/lib/core/es6/data/WrappedView.d.ts +62 -62
- package/lib/core/es6/grid/Core.d.ts +95 -95
- package/lib/core/es6/grid/Core.js +173 -25
- package/lib/core/es6/grid/ILayoutGrid.d.ts +20 -20
- package/lib/core/es6/grid/ILayoutGrid.js +2 -1
- package/lib/core/es6/grid/LayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/LayoutGrid.js +18 -10
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +14 -3
- package/lib/core/es6/grid/components/Cell.d.ts +6 -6
- package/lib/core/es6/grid/components/Cell.js +3 -0
- package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +4 -2
- package/lib/core/es6/grid/components/CellFloatingPanel.js +7 -0
- package/lib/core/es6/grid/components/CellSpans.d.ts +2 -2
- package/lib/core/es6/grid/components/Column.d.ts +2 -2
- package/lib/core/es6/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/core/es6/grid/components/Scrollbar.d.ts +9 -9
- package/lib/core/es6/grid/components/StretchedCells.js +19 -5
- package/lib/core/es6/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/core/es6/grid/event/EventListeners.d.ts +5 -5
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +62 -65
- package/lib/core/es6/grid/util/Conflator.d.ts +4 -4
- package/lib/core/es6/grid/util/HttpRequest.d.ts +3 -3
- package/lib/core/es6/grid/util/PercentBar.d.ts +8 -8
- package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/core/es6/grid/util/RangeBar.d.ts +1 -1
- package/lib/core/es6/grid/util/RangeBar.js +1 -1
- package/lib/core/es6/grid/util/Reverter.d.ts +1 -1
- package/lib/core/es6/grid/util/SectionSettings.d.ts +13 -13
- package/lib/core/es6/grid/util/SelectionList.d.ts +2 -2
- package/lib/core/es6/grid/util/TrackLayout.d.ts +9 -9
- package/lib/core/es6/grid/util/Virtualizer.d.ts +3 -3
- package/lib/core/es6/grid/util/util.d.ts +6 -4
- package/lib/core/es6/grid/util/util.js +16 -91
- package/lib/core/es6/index.d.ts +1 -0
- package/lib/core/es6/index.js +2 -0
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/checkbox-list.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.d.ts +1 -1
- package/lib/filter-dialog/lib/filter-dialog.js +27 -9
- package/lib/filter-dialog/themes/base-checkbox.less +0 -1
- package/lib/filter-dialog/themes/base.less +1 -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/formatters/es6/index.d.ts +1 -1
- package/lib/formatters/es6/index.js +1 -1
- package/lib/grid/index.js +1 -1
- package/lib/grid/lib/efx-grid.js +3 -0
- 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 +5 -5
- 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/row-segmenting/es6/RowSegmenting.d.ts +30 -24
- package/lib/row-segmenting/es6/RowSegmenting.js +122 -21
- package/lib/rt-grid/dist/rt-grid.js +689 -367
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +46 -42
- package/lib/rt-grid/es6/ColumnDefinition.js +31 -1
- package/lib/rt-grid/es6/DataConnector.d.ts +6 -4
- package/lib/rt-grid/es6/DataConnector.js +8 -0
- package/lib/rt-grid/es6/FieldDefinition.d.ts +2 -2
- package/lib/rt-grid/es6/FieldDefinition.js +12 -5
- package/lib/rt-grid/es6/Grid.d.ts +102 -94
- package/lib/rt-grid/es6/Grid.js +70 -105
- package/lib/rt-grid/es6/ReferenceCounter.d.ts +5 -5
- package/lib/rt-grid/es6/RowDefSorter.d.ts +2 -2
- package/lib/rt-grid/es6/RowDefinition.d.ts +22 -22
- package/lib/rt-grid/es6/RowDefinition.js +12 -5
- package/lib/rt-grid/es6/SnapshotFiller.d.ts +3 -3
- package/lib/rt-grid/es6/StyleLoader.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +11 -11
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +50 -54
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +18 -16
- package/lib/tr-grid-checkbox/es6/Checkbox.js +1 -0
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +29 -27
- package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +28 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +556 -11
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +2 -2
- package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +2 -3
- package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +15 -13
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +96 -72
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +11 -2
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +309 -114
- package/lib/tr-grid-content-wrap/es6/ContentWrap.js +1 -6
- package/lib/tr-grid-contextmenu/es6/ContextMenu.js +3 -3
- package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +2 -2
- package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
- package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +2 -1
- package/lib/tr-grid-heat-map/es6/HeatMap.js +6 -9
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +5 -2
- package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +311 -71
- package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-percent-bar/es6/PercentBar.js +8 -11
- package/lib/tr-grid-printer/es6/SectionWriter.js +8 -0
- package/lib/tr-grid-range-bar/es6/RangeBar.js +3 -10
- package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +6 -0
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +56 -23
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +4 -3
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +57 -13
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1 -1
- package/lib/tr-grid-row-selection/es6/RowSelection.js +2 -3
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +0 -2
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +1 -40
- package/lib/tr-grid-util/es6/CellPainter.d.ts +30 -30
- package/lib/tr-grid-util/es6/CellPainter.js +9 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +4 -4
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +10 -10
- package/lib/tr-grid-util/es6/Deferred.d.ts +3 -1
- package/lib/tr-grid-util/es6/Deferred.js +11 -1
- package/lib/tr-grid-util/es6/Delay.d.ts +2 -2
- package/lib/tr-grid-util/es6/Dom.d.ts +10 -10
- package/lib/tr-grid-util/es6/Dom.js +14 -10
- package/lib/tr-grid-util/es6/DragUI.js +5 -2
- package/lib/tr-grid-util/es6/ElementObserver.d.ts +2 -2
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElfDate.d.ts +5 -5
- package/lib/tr-grid-util/es6/ElfDate.js +1 -0
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +10 -4
- package/lib/tr-grid-util/es6/ElfUtil.js +53 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +5 -5
- package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +2 -2
- package/lib/tr-grid-util/es6/ExpanderIcon.js +1 -1
- package/lib/tr-grid-util/es6/Ext.d.ts +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +12 -12
- package/lib/tr-grid-util/es6/FieldFormatter.js +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +13 -13
- package/lib/tr-grid-util/es6/FilterBuilder.js +15 -8
- package/lib/tr-grid-util/es6/FilterOperators.d.ts +22 -22
- package/lib/tr-grid-util/es6/FilterOperators.js +3 -3
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +10 -10
- package/lib/tr-grid-util/es6/GridPlugin.js +20 -0
- package/lib/tr-grid-util/es6/Icon.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +8 -8
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +6 -6
- package/lib/tr-grid-util/es6/NumberFormatter.d.ts +19 -19
- package/lib/tr-grid-util/es6/NumberFormatter.js +1 -1
- package/lib/tr-grid-util/es6/PercentBar.d.ts +19 -19
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +36 -33
- package/lib/tr-grid-util/es6/Popup.js +19 -1
- package/lib/tr-grid-util/es6/RangeBar.d.ts +5 -5
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +4 -4
- package/lib/tr-grid-util/es6/RowPainter.d.ts +37 -4
- package/lib/tr-grid-util/es6/RowPainter.js +199 -76
- package/lib/tr-grid-util/es6/SubTable.d.ts +14 -14
- package/lib/tr-grid-util/es6/Table.d.ts +25 -25
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +1 -1
- package/lib/tr-grid-util/es6/Timer.d.ts +1 -1
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +9 -9
- package/lib/tr-grid-util/es6/Util.d.ts +12 -12
- package/lib/tr-grid-util/es6/formula/ADCService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +9 -9
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +4 -4
- package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/Realtime.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSIService.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +1 -1
- package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +34 -34
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockJET.js +12 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +9 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +17 -9
- package/lib/tr-grid-util/es6/jet/MockQuotes2.js +84 -24
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +42 -2
- package/lib/tr-grid-util/es6/jet/MockRTK.js +55 -16
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/mockDataAPI.js +99 -1
- package/lib/types/es6/CellSelection.d.ts +11 -11
- package/lib/types/es6/Checkbox.d.ts +18 -16
- package/lib/types/es6/ColumnFormatting.d.ts +29 -27
- package/lib/types/es6/ColumnGrouping.d.ts +28 -14
- package/lib/types/es6/ColumnResizing.d.ts +2 -2
- package/lib/types/es6/ColumnStack.d.ts +15 -13
- package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +4 -2
- package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +0 -1
- package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +1 -5
- package/lib/types/es6/CompositeGrid/Plugin.d.ts +3 -1
- package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +2 -1
- package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +1 -1
- package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +0 -1
- package/lib/types/es6/ConditionalColoring.d.ts +11 -2
- package/lib/types/es6/Core/data/ColumnStats.d.ts +3 -3
- package/lib/types/es6/Core/data/DataCache.d.ts +9 -9
- package/lib/types/es6/Core/data/DataTable.d.ts +28 -28
- package/lib/types/es6/Core/data/DataView.d.ts +62 -62
- package/lib/types/es6/Core/data/Segment.d.ts +8 -4
- package/lib/types/es6/Core/data/SegmentCollection.d.ts +9 -7
- package/lib/types/es6/Core/data/WrappedView.d.ts +62 -62
- package/lib/types/es6/Core/grid/Core.d.ts +95 -95
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +20 -20
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Cell.d.ts +6 -6
- package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/CellSpans.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/Column.d.ts +2 -2
- package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +19 -19
- package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +9 -9
- package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +3 -3
- package/lib/types/es6/Core/grid/event/EventListeners.d.ts +5 -5
- package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +45 -44
- package/lib/types/es6/Core/grid/util/Conflator.d.ts +4 -4
- package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/PercentBar.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +8 -8
- package/lib/types/es6/Core/grid/util/RangeBar.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/Reverter.d.ts +1 -1
- package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +13 -13
- package/lib/types/es6/Core/grid/util/SelectionList.d.ts +2 -2
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +9 -9
- package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +3 -3
- package/lib/types/es6/Core/grid/util/util.d.ts +6 -4
- package/lib/types/es6/Core/index.d.ts +1 -0
- package/lib/types/es6/HeatMap.d.ts +2 -1
- package/lib/types/es6/InCellEditing.d.ts +5 -2
- package/lib/types/es6/MenuEventAPI.d.ts +2 -2
- package/lib/types/es6/MenuItem.d.ts +2 -2
- package/lib/types/es6/PercentBar.d.ts +1 -1
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +46 -42
- package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +6 -4
- package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +100 -92
- package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +5 -5
- package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +2 -2
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +22 -22
- package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +3 -3
- package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +1 -1
- package/lib/types/es6/RowColoring.d.ts +0 -2
- package/lib/types/es6/RowDragging.d.ts +6 -0
- package/lib/types/es6/RowFiltering.d.ts +4 -3
- package/lib/types/es6/RowSegmenting.d.ts +30 -24
- package/lib/versions.json +27 -27
- package/package.json +2 -2
@@ -2392,7 +2392,7 @@ Dom.getRelativePosition = function(A, B, retObj) {
|
|
2392
2392
|
retObj["y"] -= bp["y"];
|
2393
2393
|
return /**@type {!Object} */(retObj);
|
2394
2394
|
};
|
2395
|
-
/**
|
2395
|
+
/** The method returns closest ancestor element or the element itself with specified class string. Otherwise, it returns null
|
2396
2396
|
* @public
|
2397
2397
|
* @function
|
2398
2398
|
* @param {Element|Node|undefined} elem
|
@@ -2401,15 +2401,17 @@ Dom.getRelativePosition = function(A, B, retObj) {
|
|
2401
2401
|
*/
|
2402
2402
|
Dom.closestElement = function(elem, classStr) {
|
2403
2403
|
var n = elem;
|
2404
|
-
while(n
|
2405
|
-
if(n.classList
|
2406
|
-
|
2404
|
+
while (n) {
|
2405
|
+
if(n.classList) { // DocumentFragment does not have classList property
|
2406
|
+
if (n.classList.contains(classStr)) {
|
2407
|
+
return /** @type{Element} */(n);
|
2408
|
+
}
|
2407
2409
|
}
|
2408
|
-
n = n.parentNode;
|
2410
|
+
n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
|
2409
2411
|
}
|
2410
2412
|
return null;
|
2411
2413
|
};
|
2412
|
-
/**
|
2414
|
+
/** The method returns closest ancestor element or the element itself with the specified tagName. Otherwise, it returns null
|
2413
2415
|
* @public
|
2414
2416
|
* @function
|
2415
2417
|
* @param {Element|Node|undefined} elem
|
@@ -2418,11 +2420,13 @@ Dom.closestElement = function(elem, classStr) {
|
|
2418
2420
|
*/
|
2419
2421
|
Dom.closestTagName = function(elem, tn) {
|
2420
2422
|
var n = elem;
|
2421
|
-
while(n
|
2422
|
-
if(n.tagName
|
2423
|
-
|
2423
|
+
while(n) {
|
2424
|
+
if(n.tagName) {
|
2425
|
+
if(n.tagName == tn) {
|
2426
|
+
return /** @type{Element} */(n);
|
2427
|
+
}
|
2424
2428
|
}
|
2425
|
-
n = n.parentNode;
|
2429
|
+
n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
|
2426
2430
|
}
|
2427
2431
|
return null;
|
2428
2432
|
};
|
@@ -2979,7 +2983,10 @@ Deferred.prototype._rejectHandler = null;
|
|
2979
2983
|
* @private
|
2980
2984
|
*/
|
2981
2985
|
Deferred.prototype._ctx = null;
|
2982
|
-
|
2986
|
+
/** @type {boolean}
|
2987
|
+
* @private
|
2988
|
+
*/
|
2989
|
+
Deferred.prototype._fulfilled = false;
|
2983
2990
|
|
2984
2991
|
/** @public
|
2985
2992
|
* @param {*=} result
|
@@ -3011,10 +3018,17 @@ Deferred.prototype.reject = function(result) {
|
|
3011
3018
|
this._finally();
|
3012
3019
|
}
|
3013
3020
|
};
|
3021
|
+
/** @public
|
3022
|
+
* @return {boolean}
|
3023
|
+
*/
|
3024
|
+
Deferred.prototype.isFulfilled = function() {
|
3025
|
+
return this._fulfilled;
|
3026
|
+
};
|
3014
3027
|
|
3015
3028
|
/** @private */
|
3016
3029
|
Deferred.prototype._finally = function() {
|
3017
3030
|
// Release all references to avoid memory leak
|
3031
|
+
this._fulfilled = true;
|
3018
3032
|
this._ctx = this._resolveHandler = this._rejectHandler = null;
|
3019
3033
|
this._resolve = this._reject = null;
|
3020
3034
|
};
|
@@ -3238,6 +3252,10 @@ ElfUtil._observed = false;
|
|
3238
3252
|
* @private
|
3239
3253
|
*/
|
3240
3254
|
ElfUtil._pendingResolve = false;
|
3255
|
+
/** @type {boolean}
|
3256
|
+
* @private
|
3257
|
+
*/
|
3258
|
+
ElfUtil._themeLoaded = false;
|
3241
3259
|
|
3242
3260
|
/** @type {Object.<string, Object>}
|
3243
3261
|
* @private
|
@@ -3386,6 +3404,32 @@ ElfUtil.getThemeName = function (optElem) {
|
|
3386
3404
|
return ElfUtil._themeName;
|
3387
3405
|
};
|
3388
3406
|
|
3407
|
+
/** This method is using for unit test
|
3408
|
+
* @public
|
3409
|
+
* @ignore
|
3410
|
+
* @function
|
3411
|
+
* @param {string} themeName
|
3412
|
+
*/
|
3413
|
+
ElfUtil.setThemeName = function (themeName) {
|
3414
|
+
ElfUtil._themeName = themeName;
|
3415
|
+
};
|
3416
|
+
|
3417
|
+
/** @public
|
3418
|
+
* @function
|
3419
|
+
* @return {boolean}
|
3420
|
+
*/
|
3421
|
+
ElfUtil.isThemeLoaded = function () {
|
3422
|
+
return ElfUtil._themeLoaded;
|
3423
|
+
};
|
3424
|
+
|
3425
|
+
/** @public
|
3426
|
+
* @function
|
3427
|
+
* @return {Object}
|
3428
|
+
*/
|
3429
|
+
ElfUtil.getColors = function() {
|
3430
|
+
return ElfUtil.themeColors;
|
3431
|
+
};
|
3432
|
+
|
3389
3433
|
/** Check the current ELF theme is Halo theme
|
3390
3434
|
* @public
|
3391
3435
|
* @function
|
@@ -3536,8 +3580,22 @@ ElfUtil._addThemeChangedCallback = function(cb) {
|
|
3536
3580
|
}
|
3537
3581
|
};
|
3538
3582
|
|
3583
|
+
/** @public
|
3584
|
+
* @return {Promise<Object>} A promise of object of theme colors
|
3585
|
+
*/
|
3586
|
+
ElfUtil.reloadThemeColors = function() {
|
3587
|
+
if (ElfUtil._deferred && ElfUtil._deferred.isFulfilled()) {
|
3588
|
+
ElfUtil._profileName = "";
|
3589
|
+
ElfUtil._themeLoaded = false;
|
3590
|
+
ElfUtil.themeReady = null;
|
3591
|
+
return ElfUtil.getThemeColors();
|
3592
|
+
} else {
|
3593
|
+
return ElfUtil.themeReady;
|
3594
|
+
}
|
3595
|
+
};
|
3596
|
+
|
3539
3597
|
/** Gets current theme colors from the document and returns a promise. <br>
|
3540
|
-
* WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists or RTK is available. <br>
|
3598
|
+
* WANRING: This method sets movement color profile to html tag automatically, if JET.Settings exists or RTK.Settings is available. <br>
|
3541
3599
|
* To re-request/reset theme colors, set ElfUtil.themeReady variable to null
|
3542
3600
|
* @public
|
3543
3601
|
* @param {Function=} themeChangedCb
|
@@ -3569,8 +3627,11 @@ ElfUtil.getThemeColors = function(themeChangedCb) {
|
|
3569
3627
|
};
|
3570
3628
|
|
3571
3629
|
var jet = window ? window.JET : null;
|
3630
|
+
ElfUtil._themeLoaded = false;
|
3572
3631
|
if(ElfUtil._rtk && ElfUtil._rtk.Settings) {
|
3573
|
-
ElfUtil._rtk.Settings.getAsync(options)
|
3632
|
+
ElfUtil._rtk.Settings.getAsync(options)
|
3633
|
+
.then(ElfUtil._loadingProfileSuccess)
|
3634
|
+
.catch(ElfUtil._loadingProfileFailure);
|
3574
3635
|
} else if(jet && jet.Settings) {
|
3575
3636
|
try {
|
3576
3637
|
jet.Settings.read(ElfUtil._loadingProfileSuccess, options);
|
@@ -3589,7 +3650,7 @@ ElfUtil.getThemeColors = function(themeChangedCb) {
|
|
3589
3650
|
* @param {string} profileName
|
3590
3651
|
*/
|
3591
3652
|
var movementColorProfileChanged = function(profileName) {
|
3592
|
-
if(profileName
|
3653
|
+
if(profileName !== ElfUtil._profileName) {
|
3593
3654
|
ElfUtil._retrieveThemeColors(profileName);
|
3594
3655
|
|
3595
3656
|
if(ElfUtil._pendingResolve) {
|
@@ -3604,7 +3665,7 @@ var movementColorProfileChanged = function(profileName) {
|
|
3604
3665
|
}
|
3605
3666
|
};
|
3606
3667
|
|
3607
|
-
/** Get user's color profile from JET or
|
3668
|
+
/** Get user's color profile from JET or RTK and set it to html tag (document.documentElement)
|
3608
3669
|
* @private
|
3609
3670
|
* @param {string} profileName Returned from JET.Settings or RTK.Settings
|
3610
3671
|
*/
|
@@ -3623,6 +3684,7 @@ ElfUtil._loadingProfileSuccess = function(profileName) {
|
|
3623
3684
|
/** @private
|
3624
3685
|
*/
|
3625
3686
|
ElfUtil._loadingProfileFailure = function() {
|
3687
|
+
ElfUtil._retrieveThemeColors();
|
3626
3688
|
if(!ElfUtil._observed) {
|
3627
3689
|
ElfUtil._observed = true;
|
3628
3690
|
ElementObserver.addAttributeListener(document.documentElement, movementColorProfileChanged, "movement-color-profile");
|
@@ -3647,6 +3709,7 @@ ElfUtil._profileNameRetrieved = function() {
|
|
3647
3709
|
* @param {string} profileName Movement color profile name
|
3648
3710
|
*/
|
3649
3711
|
ElfUtil._retrieveThemeColors = function(profileName) {
|
3712
|
+
ElfUtil._themeLoaded = true;
|
3650
3713
|
ElfUtil._profileName = profileName;
|
3651
3714
|
|
3652
3715
|
var colors = ElfUtil.themeColors = ElfUtil.getCssVariables({
|
@@ -7894,40 +7957,6 @@ util_Util.moveArrayItem = function (ary, from, to) {
|
|
7894
7957
|
}
|
7895
7958
|
return ary;
|
7896
7959
|
};
|
7897
|
-
/** Insert an item in the given array at the specified position. If the position exceeds the array length, the array will be expanded
|
7898
|
-
* @public
|
7899
|
-
* @ignore
|
7900
|
-
* @param {Array|*} ary
|
7901
|
-
* @param {number} at INCLUSIVE
|
7902
|
-
* @param {*} item
|
7903
|
-
*/
|
7904
|
-
util_Util.insertArrayItem = function (ary, at, item) {
|
7905
|
-
if (!ary) { return; }
|
7906
|
-
|
7907
|
-
if (at < 0) {
|
7908
|
-
return; // Negative index cannot be added
|
7909
|
-
}
|
7910
|
-
if (at < ary.length) {
|
7911
|
-
ary.splice(at, 0, item); // any subsequence item is shifted to the right
|
7912
|
-
} else {
|
7913
|
-
ary[at] = item;
|
7914
|
-
}
|
7915
|
-
};
|
7916
|
-
/** Remove the specified item from the given array
|
7917
|
-
* @public
|
7918
|
-
* @ignore
|
7919
|
-
* @param {Array|*} ary
|
7920
|
-
* @param {number} at INCLUSIVE
|
7921
|
-
* @return {*} removed item. If not existed, null is returned
|
7922
|
-
*/
|
7923
|
-
util_Util.removeArrayItem = function (ary, at) {
|
7924
|
-
if (!ary) { return null; }
|
7925
|
-
|
7926
|
-
if (at >= 0 && at < ary.length) {
|
7927
|
-
return ary.splice(at, 1)[0];
|
7928
|
-
}
|
7929
|
-
return null;
|
7930
|
-
};
|
7931
7960
|
/** @public
|
7932
7961
|
* @function
|
7933
7962
|
* @param {Array} ary
|
@@ -7995,35 +8024,6 @@ util_Util.cycleArray = function (ary, numItems) {
|
|
7995
8024
|
return ary || null;
|
7996
8025
|
};
|
7997
8026
|
|
7998
|
-
/** Correct the index when associated item is moved by the specified indices
|
7999
|
-
* @public
|
8000
|
-
* @ignore
|
8001
|
-
* @param {number|null} num
|
8002
|
-
* @param {number|null} from INCLUSIVE removed index
|
8003
|
-
* @param {number|null=} opt_to INCLUSIVE added index
|
8004
|
-
* @return {number} Negative if the index is removed
|
8005
|
-
*/
|
8006
|
-
util_Util.moveIndex = function (num, from, opt_to) {
|
8007
|
-
if (!util_Util.isNumber(num)) { return -1; }
|
8008
|
-
if (num === from) {
|
8009
|
-
if (util_Util.isNumber(opt_to)) {
|
8010
|
-
return /** @type{number} */(opt_to);
|
8011
|
-
}
|
8012
|
-
return -1;
|
8013
|
-
}
|
8014
|
-
if (from !== null) {
|
8015
|
-
if (num > from) {
|
8016
|
-
--num;
|
8017
|
-
}
|
8018
|
-
}
|
8019
|
-
if (opt_to !== null) {
|
8020
|
-
if (num >= opt_to) {
|
8021
|
-
++num;
|
8022
|
-
}
|
8023
|
-
}
|
8024
|
-
return /** @type{number} */(num);
|
8025
|
-
};
|
8026
|
-
|
8027
8027
|
/** STL implementation of lowerBound() of the C++ vector class with no recursion
|
8028
8028
|
* @public
|
8029
8029
|
* @ignore
|
@@ -8096,28 +8096,6 @@ util_Util.stringFormat = function (format) {
|
|
8096
8096
|
util_Util._defaultLessComparator = function (left, right) {
|
8097
8097
|
return left < right;
|
8098
8098
|
};
|
8099
|
-
/** @public
|
8100
|
-
* @function
|
8101
|
-
* @ignore
|
8102
|
-
* @param {number} left
|
8103
|
-
* @param {number} right
|
8104
|
-
* @return {number}
|
8105
|
-
* @example [4, 1, 2].sort(Util._numericSorter) === [1, 2, 4];
|
8106
|
-
*/
|
8107
|
-
util_Util._numericSorter = function (left, right) {
|
8108
|
-
return left - right;
|
8109
|
-
};
|
8110
|
-
|
8111
|
-
/** @public
|
8112
|
-
* @function
|
8113
|
-
* @ignore
|
8114
|
-
* @param {Event} e
|
8115
|
-
*/
|
8116
|
-
util_Util._preventDefault = function (e) {
|
8117
|
-
e.preventDefault();
|
8118
|
-
e.stopPropagation();
|
8119
|
-
};
|
8120
|
-
|
8121
8099
|
/**
|
8122
8100
|
* @public
|
8123
8101
|
* @function
|
@@ -8155,24 +8133,34 @@ util_Util.calculatePercent = function (lowVal, lastVal, highVal) {
|
|
8155
8133
|
return percent * 100;
|
8156
8134
|
};
|
8157
8135
|
|
8158
|
-
/** @description
|
8136
|
+
/** @description The method returns closest ancestor element or the element itself with specified class string. Otherwise, it returns null
|
8159
8137
|
* @public
|
8160
8138
|
* @function
|
8161
|
-
* @ignore
|
8162
8139
|
* @param {Element|Node|undefined} elem
|
8163
8140
|
* @param {string} classStr The class string can only be one single class without spaces
|
8164
8141
|
* @return {Element}
|
8165
8142
|
*/
|
8166
8143
|
util_Util.closestElement = function (elem, classStr) {
|
8167
8144
|
var n = elem;
|
8168
|
-
while (n
|
8169
|
-
if
|
8170
|
-
|
8145
|
+
while (n) {
|
8146
|
+
if(n.classList) { // DocumentFragment does not have classList property
|
8147
|
+
if (n.classList.contains(classStr)) {
|
8148
|
+
return /** @type{Element} */(n);
|
8149
|
+
}
|
8171
8150
|
}
|
8172
|
-
n = n.parentNode;
|
8151
|
+
n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
|
8173
8152
|
}
|
8174
8153
|
return null;
|
8175
8154
|
};
|
8155
|
+
/** @public
|
8156
|
+
* @function
|
8157
|
+
* @ignore
|
8158
|
+
* @param {Event} e
|
8159
|
+
*/
|
8160
|
+
util_Util._preventDefault = function (e) {
|
8161
|
+
e.preventDefault();
|
8162
|
+
e.stopPropagation();
|
8163
|
+
};
|
8176
8164
|
|
8177
8165
|
/** @public
|
8178
8166
|
* @type {boolean}
|
@@ -10692,7 +10680,15 @@ DataTable.prototype.setRowData = function(rid, values, eventArg) { // Data chang
|
|
10692
10680
|
this._prevData[rid] = this._rows[rid]; // Move reference from the removed row to history
|
10693
10681
|
delete this._rows[rid];
|
10694
10682
|
if(this._segments) {
|
10695
|
-
|
10683
|
+
var segment = this._segments.getSegment(rid);
|
10684
|
+
if(segment) {
|
10685
|
+
if(this._segments.removeSegment(rid)) {
|
10686
|
+
segmentChanged = true;
|
10687
|
+
if(!this._segments.getSegmentCount()) {
|
10688
|
+
this._segments = null;
|
10689
|
+
}
|
10690
|
+
}
|
10691
|
+
}
|
10696
10692
|
}
|
10697
10693
|
for(var i = this._rids.length; --i >= 0;) {
|
10698
10694
|
if(this._rids[i] === rid) {
|
@@ -11895,18 +11891,33 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
11895
11891
|
return null;
|
11896
11892
|
}
|
11897
11893
|
|
11894
|
+
var sortLogic;
|
11898
11895
|
// Populate data for each definition
|
11899
11896
|
for(var c = 0; c < defCount; ++c) {
|
11900
11897
|
var sortingDef = sortingDefs[c];
|
11901
|
-
var columnId = sortingDef[0];
|
11902
11898
|
var rows = sortingDef[1];
|
11903
|
-
|
11904
|
-
|
11905
|
-
|
11906
|
-
|
11907
|
-
|
11908
|
-
|
11909
|
-
|
11899
|
+
sortLogic = sortingDef[2];
|
11900
|
+
var rowSorting = sortLogic["rowSorting"];
|
11901
|
+
var r;
|
11902
|
+
if(rowSorting) {
|
11903
|
+
if(rows) {
|
11904
|
+
rows.length = rowCount;
|
11905
|
+
for(r = 0; r < rowCount; ++r) {
|
11906
|
+
rows[r] = dataRows[r];
|
11907
|
+
}
|
11908
|
+
} else {
|
11909
|
+
rows = sortingDef[1] = dataRows;
|
11910
|
+
}
|
11911
|
+
} else {
|
11912
|
+
if(rows) {
|
11913
|
+
rows.length = rowCount;
|
11914
|
+
} else {
|
11915
|
+
rows = sortingDef[1] = new Array(rowCount);
|
11916
|
+
}
|
11917
|
+
var columnId = sortingDef[0];
|
11918
|
+
for(r = 0; r < rowCount; ++r) {
|
11919
|
+
rows[r] = dataRows[r][columnId];
|
11920
|
+
}
|
11910
11921
|
}
|
11911
11922
|
}
|
11912
11923
|
|
@@ -11932,7 +11943,7 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
11932
11943
|
}
|
11933
11944
|
|
11934
11945
|
var sortOrder = 0;
|
11935
|
-
var
|
11946
|
+
var sortContext;
|
11936
11947
|
if(defCount > 1) {
|
11937
11948
|
sortLogic = DataTable._multiColumnCompareLogic;
|
11938
11949
|
sortContext = sortingDefs;
|
@@ -12397,7 +12408,12 @@ RowDefinition.prototype.setContent = function(userInput) {
|
|
12397
12408
|
this._dataId = this._rowId + this._ric; // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
|
12398
12409
|
|
12399
12410
|
// This will work for runtime ric modification, but not for first initilization.
|
12400
|
-
this.subscribeForUpdates()
|
12411
|
+
if(!this.subscribeForUpdates()) {
|
12412
|
+
// Avoid losing the ROW_DEF pointer.
|
12413
|
+
var rowData = {};
|
12414
|
+
rowData[ROW_DEF] = this; // Enable tracking back and updating data
|
12415
|
+
this.setRowData(rowData);
|
12416
|
+
}
|
12401
12417
|
return true;
|
12402
12418
|
};
|
12403
12419
|
/** @public
|
@@ -12419,7 +12435,7 @@ RowDefinition.prototype.getConfigObject = function(rowOptions) {
|
|
12419
12435
|
|
12420
12436
|
val = this._staticValues;
|
12421
12437
|
if(val) {
|
12422
|
-
obj["values"] = val;
|
12438
|
+
obj["values"] = Object(Util["b" /* cloneObject */])(val);
|
12423
12439
|
}
|
12424
12440
|
|
12425
12441
|
val = this._chainRic;
|
@@ -12676,15 +12692,16 @@ RowDefinition.prototype.isRealTimeRow = function() {
|
|
12676
12692
|
};
|
12677
12693
|
|
12678
12694
|
/** @public
|
12695
|
+
* @return {boolean} If a subscription is made, return true.
|
12679
12696
|
*/
|
12680
12697
|
RowDefinition.prototype.subscribeForUpdates = function() {
|
12681
12698
|
if(!this.isRealTimeRow()) {
|
12682
|
-
return;
|
12699
|
+
return false;
|
12683
12700
|
}
|
12684
12701
|
|
12685
12702
|
var subs = this._dc ? this._dc.getSubscriptions() : null;
|
12686
12703
|
if(!subs) {
|
12687
|
-
return;
|
12704
|
+
return false;
|
12688
12705
|
}
|
12689
12706
|
// TODO: Check if the same subscription is being made.
|
12690
12707
|
var prevRowData = this.unsubscribeForUpdates();
|
@@ -12701,6 +12718,7 @@ RowDefinition.prototype.subscribeForUpdates = function() {
|
|
12701
12718
|
} else {
|
12702
12719
|
this._dc.setRowData(this._dataId, {"X_RIC_NAME": this._ric, "ROW_DEF": this}); // Trigger data update immediately
|
12703
12720
|
}
|
12721
|
+
return true;
|
12704
12722
|
};
|
12705
12723
|
/** @public
|
12706
12724
|
* @returns {*}
|
@@ -13227,6 +13245,11 @@ FieldDefinition._synapse = '';
|
|
13227
13245
|
* @const
|
13228
13246
|
*/
|
13229
13247
|
FieldDefinition._lang = 'en';
|
13248
|
+
/**
|
13249
|
+
* @type {boolean}
|
13250
|
+
* @private
|
13251
|
+
*/
|
13252
|
+
FieldDefinition._caching = false;
|
13230
13253
|
|
13231
13254
|
/**
|
13232
13255
|
* @type {Object.<string, boolean>}
|
@@ -13248,7 +13271,10 @@ FieldDefinition.set = function(field, def) {
|
|
13248
13271
|
* @return {Object}
|
13249
13272
|
*/
|
13250
13273
|
FieldDefinition.get = function(field) {
|
13251
|
-
|
13274
|
+
if(this._caching) {
|
13275
|
+
return FieldDefinition._defs[field];
|
13276
|
+
}
|
13277
|
+
return null;
|
13252
13278
|
};
|
13253
13279
|
/** @public
|
13254
13280
|
* @function
|
@@ -13269,11 +13295,10 @@ FieldDefinition.setSynapseConfig = function (config) {
|
|
13269
13295
|
|
13270
13296
|
/** @public
|
13271
13297
|
* @function
|
13272
|
-
* @param {
|
13273
|
-
* @param {Object} def
|
13298
|
+
* @param {boolean} caching
|
13274
13299
|
*/
|
13275
|
-
FieldDefinition.
|
13276
|
-
FieldDefinition.
|
13300
|
+
FieldDefinition.setFieldCaching = function (caching) {
|
13301
|
+
FieldDefinition._caching = caching;
|
13277
13302
|
};
|
13278
13303
|
|
13279
13304
|
/** to get more info about field via synapse service
|
@@ -13580,7 +13605,11 @@ var TYPE_MAPPING = {
|
|
13580
13605
|
|
13581
13606
|
PRICE: "number",
|
13582
13607
|
DOUBLE: "number",
|
13583
|
-
MONEY: "number"
|
13608
|
+
MONEY: "number",
|
13609
|
+
|
13610
|
+
INTEGER: "number",
|
13611
|
+
FLOAT: "number",
|
13612
|
+
SCORE: "number"
|
13584
13613
|
};
|
13585
13614
|
|
13586
13615
|
/** @type {string}
|
@@ -13658,6 +13687,10 @@ ColumnDefinition.prototype._name = "";
|
|
13658
13687
|
* @private
|
13659
13688
|
*/
|
13660
13689
|
ColumnDefinition.prototype._isDefaultName = true;
|
13690
|
+
/** @type {boolean}
|
13691
|
+
* @private
|
13692
|
+
*/
|
13693
|
+
ColumnDefinition.prototype._emptyField = false;
|
13661
13694
|
/** @type {string|null}
|
13662
13695
|
* @private
|
13663
13696
|
*/
|
@@ -13978,6 +14011,17 @@ ColumnDefinition.prototype.getDataType = function () {
|
|
13978
14011
|
}
|
13979
14012
|
return "";
|
13980
14013
|
};
|
14014
|
+
/** set data type
|
14015
|
+
* @public
|
14016
|
+
* @param {string} dataType
|
14017
|
+
*/
|
14018
|
+
ColumnDefinition.prototype.setDataType = function (dataType) {
|
14019
|
+
var val = TYPE_MAPPING[dataType.toUpperCase()];
|
14020
|
+
if(val) {
|
14021
|
+
dataType = val;
|
14022
|
+
}
|
14023
|
+
this._dataType = dataType;
|
14024
|
+
};
|
13981
14025
|
/** get data type
|
13982
14026
|
* @public
|
13983
14027
|
* @param {string} field
|
@@ -14140,6 +14184,13 @@ ColumnDefinition.prototype.getTextAlign = function() {
|
|
14140
14184
|
var colIndex = grid.getColumnIndex(this);
|
14141
14185
|
return core.getColumnAlignment(colIndex);
|
14142
14186
|
};
|
14187
|
+
/** @public
|
14188
|
+
* @return {boolean}
|
14189
|
+
*/
|
14190
|
+
ColumnDefinition.prototype.isFieldEmpty = function() {
|
14191
|
+
return this._emptyField;
|
14192
|
+
};
|
14193
|
+
|
14143
14194
|
/** @public
|
14144
14195
|
* @return {string}
|
14145
14196
|
*/
|
@@ -14398,9 +14449,11 @@ ColumnDefinition.prototype._setField = function(field, formulaStr) {
|
|
14398
14449
|
if(defaultField) {
|
14399
14450
|
this._field = "COLUMN_" + this._id;
|
14400
14451
|
this._name = "Column " + this._id;
|
14452
|
+
this._emptyField = true;
|
14401
14453
|
} else {
|
14402
14454
|
this._field = field;
|
14403
14455
|
this._name = field;
|
14456
|
+
this._emptyField = false;
|
14404
14457
|
this._realTimeField = field ? true : false;
|
14405
14458
|
}
|
14406
14459
|
this._isDefaultName = true;
|
@@ -14456,6 +14509,8 @@ ColumnDefinition.prototype._customRenderer = function(e) {
|
|
14456
14509
|
arg["rowIndex"] = e["rowIndex"];
|
14457
14510
|
if(rowData) {
|
14458
14511
|
arg["data"] = rowData[this._field];
|
14512
|
+
} else {
|
14513
|
+
arg["data"] = null;
|
14459
14514
|
}
|
14460
14515
|
arg["colIndex"] = e["colIndex"];
|
14461
14516
|
arg["cell"] = e["cell"];
|
@@ -18037,8 +18092,9 @@ ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPosit
|
|
18037
18092
|
* @ignore
|
18038
18093
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
18039
18094
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
18095
|
+
* @param {number=} topPx Top position of bound
|
18040
18096
|
*/
|
18041
|
-
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {};
|
18097
|
+
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
|
18042
18098
|
|
18043
18099
|
/* harmony default export */ var grid_ILayoutGrid = (ILayoutGrid);
|
18044
18100
|
|
@@ -18917,7 +18973,7 @@ StretchedCells.prototype.getRowIndex = function (cellRef) {
|
|
18917
18973
|
* @return {Cell}
|
18918
18974
|
*/
|
18919
18975
|
StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
18920
|
-
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not
|
18976
|
+
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not need to be accurate
|
18921
18977
|
++this._activeCount;
|
18922
18978
|
if(!colIndex || colIndex < 0) {
|
18923
18979
|
colIndex = 0;
|
@@ -18932,7 +18988,17 @@ StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
|
18932
18988
|
}
|
18933
18989
|
var cellElem = cell["getElement"]();
|
18934
18990
|
cellElem["stretched"] = true;
|
18935
|
-
cellElem._colIndex
|
18991
|
+
if(cellElem._colIndex !== colIndex) {
|
18992
|
+
cellElem._colIndex = colIndex;
|
18993
|
+
if(colIndex > 0) {
|
18994
|
+
cellElem.classList.add("right-stretching");
|
18995
|
+
} else {
|
18996
|
+
cellElem.classList.remove("right-stretching");
|
18997
|
+
}
|
18998
|
+
}
|
18999
|
+
if(cellElem._rowIndex !== rowIndex) {
|
19000
|
+
cellElem._rowIndex = rowIndex;
|
19001
|
+
}
|
18936
19002
|
|
18937
19003
|
var width = this._stretchSize || this._trackX.getTrackSize();
|
18938
19004
|
_updateXAxis(cell, this._trackX, colIndex, width);
|
@@ -22158,10 +22224,8 @@ LayoutGrid.prototype._updateColumnLayout = function () {
|
|
22158
22224
|
/** @public
|
22159
22225
|
* @ignore
|
22160
22226
|
* @param {boolean} enabled
|
22161
|
-
* @param {number=} fromR
|
22162
|
-
* @param {number=} toR
|
22163
22227
|
*/
|
22164
|
-
LayoutGrid.prototype._startBindingSession = function (enabled
|
22228
|
+
LayoutGrid.prototype._startBindingSession = function (enabled) {
|
22165
22229
|
// Prevent error when calling _startBindingSession in LayoutGrid
|
22166
22230
|
};
|
22167
22231
|
/** @public
|
@@ -23378,8 +23442,14 @@ LayoutGrid.prototype.moveColumn = function (from, to) {
|
|
23378
23442
|
|
23379
23443
|
util.moveArrayItem(this._columns, from, to);
|
23380
23444
|
|
23381
|
-
|
23382
|
-
|
23445
|
+
if(movedColumn.getElement().offsetParent) {
|
23446
|
+
var siblingIndex = to + 1;
|
23447
|
+
var nextSibling = this._columns[siblingIndex] || null;
|
23448
|
+
while (nextSibling && !nextSibling.getElement().offsetParent) {
|
23449
|
+
nextSibling = this._columns[++siblingIndex];
|
23450
|
+
}
|
23451
|
+
movedColumn.insertBefore(nextSibling);
|
23452
|
+
}
|
23383
23453
|
|
23384
23454
|
this._updateColumnIndices();
|
23385
23455
|
this._updateCellSpans(cellSpans, true); // Restore all styling
|
@@ -23598,6 +23668,10 @@ LayoutGrid.prototype.updateStretchedCells = function () {
|
|
23598
23668
|
* @return {number}
|
23599
23669
|
*/
|
23600
23670
|
LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
23671
|
+
if(this._frozenLayout) {
|
23672
|
+
return this._stretchedCells.getStretchSize();
|
23673
|
+
}
|
23674
|
+
|
23601
23675
|
var ctx = this._ctx;
|
23602
23676
|
var stretchSize = forceRecal ? 0 : this._stretchedCells.getStretchSize();
|
23603
23677
|
if(!stretchSize && ctx) {
|
@@ -23605,9 +23679,6 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
|
23605
23679
|
var contentWidth = this.getContentWidth();
|
23606
23680
|
stretchSize = ctx["getWidth"]();
|
23607
23681
|
if(stretchSize) { // Grid may not be in the document
|
23608
|
-
if(!ctx.hasClass("no-borders")) {
|
23609
|
-
stretchSize -= 1;
|
23610
|
-
}
|
23611
23682
|
if(contentWidth < stretchSize) { // If view width is larger than actual content
|
23612
23683
|
stretchSize = contentWidth;
|
23613
23684
|
}
|
@@ -23955,8 +24026,9 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
|
|
23955
24026
|
* @ignore
|
23956
24027
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
23957
24028
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
24029
|
+
* @param {number=} topPx Top position of bound
|
23958
24030
|
*/
|
23959
|
-
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
24031
|
+
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
23960
24032
|
var columnBound = this._columnBound;
|
23961
24033
|
if(!columnBound) {
|
23962
24034
|
return;
|
@@ -23973,7 +24045,9 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
|
23973
24045
|
columnBound.style.left = lftPx + "px";
|
23974
24046
|
columnBound.style.width = (rgtPx - lftPx) + "px";
|
23975
24047
|
|
23976
|
-
|
24048
|
+
topPx = topPx || 0;
|
24049
|
+
columnBound.style.top = topPx + "px";
|
24050
|
+
columnBound.style.height = (this._trackY.getTrackSize() - topPx) + "px";
|
23977
24051
|
columnBound.classList.toggle("no-left-bound", noBorders[0]);
|
23978
24052
|
columnBound.classList.toggle("no-right-bound", noBorders[1]);
|
23979
24053
|
if(this._boundLayer) {
|
@@ -26977,45 +27051,65 @@ DataView.prototype.isSorting = function() {
|
|
26977
27051
|
|
26978
27052
|
/** Hide rows in the data view
|
26979
27053
|
* @param {string|number} rId Row id to hide. If the rId is a number, it will be treated as a row index
|
26980
|
-
* @param {boolean=}
|
27054
|
+
* @param {boolean=} hidden=true If the value is false, the specified row will be shown.
|
26981
27055
|
* @public
|
26982
27056
|
*/
|
26983
|
-
DataView.prototype.hideRow = function(rId,
|
26984
|
-
this.
|
27057
|
+
DataView.prototype.hideRow = function(rId, hidden) {
|
27058
|
+
this.hideRows([rId], hidden);
|
26985
27059
|
};
|
26986
27060
|
/** Hide rows in the data view
|
26987
27061
|
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
26988
|
-
* @param {boolean=}
|
27062
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
26989
27063
|
* @public
|
26990
27064
|
*/
|
26991
|
-
DataView.prototype.hideRows = function(rowRefs,
|
26992
|
-
|
26993
|
-
|
26994
|
-
|
26995
|
-
|
26996
|
-
|
26997
|
-
* @param {boolean=} opt_show hide instead show if false
|
26998
|
-
* @public
|
26999
|
-
*/
|
27000
|
-
DataView.prototype.showRows = function(rowRefs, opt_show) {
|
27001
|
-
var hidden = opt_show === false;
|
27065
|
+
DataView.prototype.hideRows = function(rowRefs, hidden) {
|
27066
|
+
hidden = hidden !== false;
|
27067
|
+
var dirty = false;
|
27068
|
+
var rids = this._toRowIds(rowRefs);
|
27069
|
+
var hiddenRids = this._hiddenRids;
|
27070
|
+
|
27002
27071
|
if(hidden){
|
27003
|
-
if(!
|
27004
|
-
this._hiddenRids = {};
|
27072
|
+
if(!hiddenRids) {
|
27073
|
+
hiddenRids = this._hiddenRids = {};
|
27005
27074
|
}
|
27006
|
-
} else if(!
|
27075
|
+
} else if(!hiddenRids) {
|
27007
27076
|
return; // All rows are visible
|
27008
27077
|
}
|
27009
27078
|
|
27010
|
-
var rids = this._toRowIds(rowRefs);
|
27011
27079
|
for(var i = rids.length; --i >= 0;) {
|
27012
27080
|
var rid = rids[i];
|
27013
27081
|
if(rid) { // undefined, null, and an empty string value are not a valid row id
|
27014
|
-
|
27082
|
+
if(!!hiddenRids[rid] !== hidden) {
|
27083
|
+
hiddenRids[rid] = hidden;
|
27084
|
+
dirty = true;
|
27085
|
+
}
|
27015
27086
|
}
|
27016
27087
|
}
|
27017
27088
|
|
27018
|
-
|
27089
|
+
if(dirty) {
|
27090
|
+
if(!hidden) {
|
27091
|
+
var hasHiddenRow = false;
|
27092
|
+
for(var key in hiddenRids) {
|
27093
|
+
if(hiddenRids[key]) {
|
27094
|
+
hasHiddenRow = true;
|
27095
|
+
break;
|
27096
|
+
}
|
27097
|
+
}
|
27098
|
+
if(!hasHiddenRow) {
|
27099
|
+
hiddenRids = this._hiddenRids = null;
|
27100
|
+
}
|
27101
|
+
}
|
27102
|
+
this._refreshAndNotify(); // Very slow
|
27103
|
+
}
|
27104
|
+
};
|
27105
|
+
/**
|
27106
|
+
* Show/hide rows in the data view
|
27107
|
+
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
27108
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
27109
|
+
* @public
|
27110
|
+
*/
|
27111
|
+
DataView.prototype.showRows = function(rowRefs, shown) {
|
27112
|
+
this.hideRows(rowRefs, shown === false);
|
27019
27113
|
};
|
27020
27114
|
/** Unhide all rows
|
27021
27115
|
* @public
|
@@ -27031,7 +27125,7 @@ DataView.prototype.unhideAllRows = function(){
|
|
27031
27125
|
* @return {boolean}
|
27032
27126
|
*/
|
27033
27127
|
DataView.prototype.hasHiddenRow = function(){
|
27034
|
-
return
|
27128
|
+
return this._hiddenRids ? true : false;
|
27035
27129
|
};
|
27036
27130
|
|
27037
27131
|
/** @public
|
@@ -32170,12 +32264,22 @@ VirtualizedLayoutGrid.prototype.updateLayout = function () {
|
|
32170
32264
|
/** {@link ILayoutGrid#stretchCell}
|
32171
32265
|
* @inheritDoc */
|
32172
32266
|
VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching, onlyToTheRight) {
|
32173
|
-
|
32267
|
+
var stretchedCell = this._grid.stretchCell(
|
32174
32268
|
cellRef,
|
32175
32269
|
(rowIndex != null) ? rowIndex - this._firstIndex : null,
|
32176
32270
|
opt_stretching,
|
32177
32271
|
onlyToTheRight
|
32178
32272
|
);
|
32273
|
+
|
32274
|
+
if (stretchedCell){
|
32275
|
+
var cellElem = stretchedCell.getElement();
|
32276
|
+
if(rowIndex === 0) {
|
32277
|
+
cellElem.classList.add("top");
|
32278
|
+
} else {
|
32279
|
+
cellElem.classList.remove("top");
|
32280
|
+
}
|
32281
|
+
}
|
32282
|
+
return stretchedCell;
|
32179
32283
|
};
|
32180
32284
|
|
32181
32285
|
/** {@link ILayoutGrid#unstretchCell}
|
@@ -32394,9 +32498,10 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
32394
32498
|
* @ignore
|
32395
32499
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
32396
32500
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
32501
|
+
* @param {number=} topPx Top position of bound
|
32397
32502
|
*/
|
32398
|
-
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
32399
|
-
this._grid.updateColumnBounds(positions, noBorders);
|
32503
|
+
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
32504
|
+
this._grid.updateColumnBounds(positions, noBorders, topPx);
|
32400
32505
|
this._updateRowBounds();
|
32401
32506
|
};
|
32402
32507
|
/** @private
|
@@ -32586,10 +32691,9 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
32586
32691
|
|
32587
32692
|
|
32588
32693
|
// CONCATENATED MODULE: ./node_modules/@grid/core/es6/grid/Core.js
|
32589
|
-
/* eslint-disable */
|
32590
|
-
|
32591
32694
|
|
32592
32695
|
|
32696
|
+
// eslint-disable-line
|
32593
32697
|
|
32594
32698
|
|
32595
32699
|
|
@@ -32601,7 +32705,6 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
32601
32705
|
|
32602
32706
|
|
32603
32707
|
|
32604
|
-
/* eslint-enable */
|
32605
32708
|
|
32606
32709
|
//#region Events
|
32607
32710
|
/** @event Core#sectionAdded */
|
@@ -32639,6 +32742,15 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
32639
32742
|
*/
|
32640
32743
|
//#endregion Events
|
32641
32744
|
|
32745
|
+
/** @private
|
32746
|
+
* @param {number} a
|
32747
|
+
* @param {number} b
|
32748
|
+
* @return {number}
|
32749
|
+
*/
|
32750
|
+
var ascNumberSorter = function (a, b) {
|
32751
|
+
return a - b;
|
32752
|
+
};
|
32753
|
+
|
32642
32754
|
/** @constructor
|
32643
32755
|
* @param {Element=} opt_initializer this can be either element id (string) or DOM element.
|
32644
32756
|
* @extends {ElementWrapper}
|
@@ -32776,7 +32888,8 @@ var Core = function (opt_initializer) {
|
|
32776
32888
|
"rowAdded",
|
32777
32889
|
"rowRemoved",
|
32778
32890
|
"columnPositionChanged",
|
32779
|
-
"rowPositionChanged"
|
32891
|
+
"rowPositionChanged",
|
32892
|
+
"beforeColumnBoundUpdate"
|
32780
32893
|
);
|
32781
32894
|
|
32782
32895
|
// For debugging in advanced optimization mode
|
@@ -32796,13 +32909,13 @@ var Core = function (opt_initializer) {
|
|
32796
32909
|
Core._runningGridId++;
|
32797
32910
|
|
32798
32911
|
// init hiddenInput for retrieve copy and cut event
|
32799
|
-
var hiddenInput = document.createElement(
|
32800
|
-
hiddenInput.style.position =
|
32801
|
-
hiddenInput.style.width =
|
32802
|
-
hiddenInput.style.height =
|
32803
|
-
hiddenInput.style.padding =
|
32804
|
-
hiddenInput.style.border =
|
32805
|
-
hiddenInput.value =
|
32912
|
+
var hiddenInput = document.createElement("input");
|
32913
|
+
hiddenInput.style.position = "absolute";
|
32914
|
+
hiddenInput.style.width = "0";
|
32915
|
+
hiddenInput.style.height = "0";
|
32916
|
+
hiddenInput.style.padding = "0";
|
32917
|
+
hiddenInput.style.border = "0";
|
32918
|
+
hiddenInput.value = "0";
|
32806
32919
|
_t._hiddenInput = hiddenInput;
|
32807
32920
|
elem.insertBefore(hiddenInput, elem.firstChild);
|
32808
32921
|
|
@@ -33108,7 +33221,7 @@ Core.prototype._rowHeightTimerId = 0;
|
|
33108
33221
|
* @return {string}
|
33109
33222
|
*/
|
33110
33223
|
Core.getVersion = function () {
|
33111
|
-
return "5.
|
33224
|
+
return "5.1.15";
|
33112
33225
|
};
|
33113
33226
|
/** {@link ElementWrapper#dispose}
|
33114
33227
|
* @override
|
@@ -33272,6 +33385,9 @@ Core.prototype.getConfigObject = function (gridOptions) {
|
|
33272
33385
|
if(this.hasClass("no-horizontal-grid-line")) {
|
33273
33386
|
obj["horizontalLines"] = false;
|
33274
33387
|
}
|
33388
|
+
if(this.hasClass("no-content-vertical-line")) {
|
33389
|
+
obj["contentVerticalLines"] = false;
|
33390
|
+
}
|
33275
33391
|
if(this._bottomPaddingSect) {
|
33276
33392
|
obj["contentBottomPadding"] = this._bottomPadding;
|
33277
33393
|
}
|
@@ -34105,13 +34221,118 @@ Core.prototype.isColumnMoveAllowed = function (fromColIndex, toColIndex) {
|
|
34105
34221
|
return true;
|
34106
34222
|
};
|
34107
34223
|
|
34224
|
+
/** This method is used for checking movability of column.
|
34225
|
+
* @public
|
34226
|
+
* @param {number} colIndex Index of the column.
|
34227
|
+
* @return {boolean} Return true if the column moving is movable, and false otherwise
|
34228
|
+
*/
|
34229
|
+
Core.prototype.isColumnMovable = function (colIndex) {
|
34230
|
+
var stationaryIndex = this.getStationaryColumnIndex();
|
34231
|
+
|
34232
|
+
if (stationaryIndex > -1) {
|
34233
|
+
if (colIndex <= stationaryIndex) {
|
34234
|
+
return false;
|
34235
|
+
}
|
34236
|
+
}
|
34237
|
+
|
34238
|
+
return true;
|
34239
|
+
};
|
34240
|
+
|
34108
34241
|
/** @public
|
34109
|
-
* @param {number} fromCol INCLUSIVE
|
34242
|
+
* @param {number|Array.<number>} fromCol INCLUSIVE index/indices of the column to be moved
|
34110
34243
|
* @param {number} destCol INCLUSIVE
|
34111
34244
|
* @return {boolean} Return true if there is any change, and false otherwise
|
34112
34245
|
* @fires Core#columnMoved
|
34113
34246
|
*/
|
34114
34247
|
Core.prototype.moveColumn = function (fromCol, destCol) {
|
34248
|
+
if(typeof fromCol === "number") {
|
34249
|
+
return this._moveColumn(fromCol, destCol);
|
34250
|
+
}
|
34251
|
+
if(!Array.isArray(fromCol)) {
|
34252
|
+
return false;
|
34253
|
+
}
|
34254
|
+
|
34255
|
+
// Validate user inputs
|
34256
|
+
var i;
|
34257
|
+
var len = fromCol.length;
|
34258
|
+
var colIndices = [];
|
34259
|
+
var colIndex = 0;
|
34260
|
+
var colCount = this.getColumnCount();
|
34261
|
+
var dict = {};
|
34262
|
+
for(i = 0; i < len; ++i) {
|
34263
|
+
colIndex = fromCol[i];
|
34264
|
+
if(colIndex >= 0 && colIndex < colCount) { // Filter out invalid index
|
34265
|
+
if(dict[colIndex] == null) { // Remove duplication
|
34266
|
+
dict[colIndex] = 1;
|
34267
|
+
colIndices.push(colIndex);
|
34268
|
+
}
|
34269
|
+
}
|
34270
|
+
}
|
34271
|
+
if (destCol < 0) {
|
34272
|
+
destCol = 0;
|
34273
|
+
} else if (destCol >= colCount) {
|
34274
|
+
destCol = colCount - 1;
|
34275
|
+
}
|
34276
|
+
|
34277
|
+
// Skip unneccessary cases
|
34278
|
+
len = colIndices.length;
|
34279
|
+
if(!len) {
|
34280
|
+
return false;
|
34281
|
+
}
|
34282
|
+
if(len === 1) {
|
34283
|
+
return this._moveColumn(colIndices[0], destCol);
|
34284
|
+
}
|
34285
|
+
if(!this.isColumnMoveAllowed(colIndices, destCol)) {
|
34286
|
+
return false;
|
34287
|
+
}
|
34288
|
+
|
34289
|
+
colIndices.sort(ascNumberSorter);
|
34290
|
+
if(dict[destCol]) { // Destination falls in the same place as source columns
|
34291
|
+
// Check if source columns are in continuous sequence
|
34292
|
+
var continuousSequence = true;
|
34293
|
+
colIndex = colIndices[0];
|
34294
|
+
for(i = 1; i < len; ++i) {
|
34295
|
+
if(++colIndex !== colIndices[i]) {
|
34296
|
+
continuousSequence = false;
|
34297
|
+
break;
|
34298
|
+
}
|
34299
|
+
}
|
34300
|
+
if(continuousSequence) {
|
34301
|
+
return false; // No moving operation is required
|
34302
|
+
}
|
34303
|
+
}
|
34304
|
+
var prevState = this.freezeLayout(true);
|
34305
|
+
|
34306
|
+
// Start moving multiple items
|
34307
|
+
var rhsCount = 0;
|
34308
|
+
var srcIndex, destIndex;
|
34309
|
+
// Perform move operation on the right hand side
|
34310
|
+
for(i = 0; i < len; ++i) {
|
34311
|
+
srcIndex = colIndices[i];
|
34312
|
+
if(srcIndex >= destCol) {
|
34313
|
+
destIndex = destCol + rhsCount;
|
34314
|
+
this._moveColumn(srcIndex, destIndex);
|
34315
|
+
++rhsCount;
|
34316
|
+
}
|
34317
|
+
}
|
34318
|
+
// Perform move operation on the left hand side
|
34319
|
+
var lhsCount = len - rhsCount;
|
34320
|
+
destIndex = rhsCount ? destCol - 1 : destCol;
|
34321
|
+
for(i = 0; i < lhsCount; ++i) {
|
34322
|
+
srcIndex = colIndices[i] - i;
|
34323
|
+
this._moveColumn(srcIndex, destIndex);
|
34324
|
+
}
|
34325
|
+
|
34326
|
+
this.freezeLayout(prevState);
|
34327
|
+
return true;
|
34328
|
+
};
|
34329
|
+
/** @private
|
34330
|
+
* @param {number} fromCol INCLUSIVE
|
34331
|
+
* @param {number} destCol INCLUSIVE
|
34332
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
34333
|
+
* @fires Core#columnMoved
|
34334
|
+
*/
|
34335
|
+
Core.prototype._moveColumn = function (fromCol, destCol) {
|
34115
34336
|
var colCount = this.getColumnCount();
|
34116
34337
|
if (fromCol < 0) { fromCol = 0; }
|
34117
34338
|
else if (fromCol >= colCount) { fromCol = colCount - 1; }
|
@@ -34196,6 +34417,7 @@ Core.prototype.moveColumn = function (fromCol, destCol) {
|
|
34196
34417
|
this._colVirtualizer.update();
|
34197
34418
|
}
|
34198
34419
|
}
|
34420
|
+
this._updateColumnBounds();
|
34199
34421
|
return true;
|
34200
34422
|
};
|
34201
34423
|
|
@@ -35402,6 +35624,7 @@ Core.prototype.isLayoutFrozen = function () {
|
|
35402
35624
|
|
35403
35625
|
/** Deprecated
|
35404
35626
|
* @public
|
35627
|
+
* @ignore
|
35405
35628
|
* @function
|
35406
35629
|
* @param {boolean=} opt_shown
|
35407
35630
|
* @see {@link Core#toggleBorders}
|
@@ -35409,6 +35632,7 @@ Core.prototype.isLayoutFrozen = function () {
|
|
35409
35632
|
Core.prototype.showBorders = util._deprecatedFunction;
|
35410
35633
|
/** Deprecated
|
35411
35634
|
* @public
|
35635
|
+
* @ignore
|
35412
35636
|
* @function
|
35413
35637
|
* @param {boolean=} opt_hidden
|
35414
35638
|
* @see {@link Core#toggleBorders}
|
@@ -35442,6 +35666,14 @@ Core.prototype.toggleVerticalLines = function(forcedVal) {
|
|
35442
35666
|
Core.prototype.toggleHorizontalLines = function(forcedVal) {
|
35443
35667
|
this.toggleClass("no-horizontal-grid-line", forcedVal != null ? !forcedVal : null);
|
35444
35668
|
};
|
35669
|
+
/** Toggle vertical gridlines. This applies to ONLY content sections.
|
35670
|
+
* @public
|
35671
|
+
* @param {boolean=} forcedVal If value is true, show horizontal lines, otherwise hide them
|
35672
|
+
*/
|
35673
|
+
Core.prototype.toggleContentVerticalLines = function(forcedVal) {
|
35674
|
+
this.toggleClass("no-content-vertical-line", forcedVal != null ? !forcedVal : null);
|
35675
|
+
};
|
35676
|
+
|
35445
35677
|
|
35446
35678
|
/** @public
|
35447
35679
|
* @return {Array.<string>}
|
@@ -36257,18 +36489,18 @@ Core.prototype.isBinding = function() {
|
|
36257
36489
|
};
|
36258
36490
|
|
36259
36491
|
/**
|
36260
|
-
* Hide
|
36492
|
+
* Hide the specified rows by row id
|
36261
36493
|
* @param {number | string} rowId rowId of the row to hide
|
36262
|
-
* @param {boolean=} hidden
|
36494
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
36263
36495
|
* @public
|
36264
36496
|
*/
|
36265
36497
|
Core.prototype.hideRow = function (rowId, hidden) {
|
36266
36498
|
this._dataSource.hideRow(rowId, hidden);
|
36267
36499
|
};
|
36268
36500
|
/**
|
36269
|
-
* Hide
|
36501
|
+
* Hide the specified rows by rowIds
|
36270
36502
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to hide
|
36271
|
-
* @param {boolean=} hidden
|
36503
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
36272
36504
|
* @public
|
36273
36505
|
*/
|
36274
36506
|
Core.prototype.hideRows = function (rowIds, hidden) {
|
@@ -36280,9 +36512,9 @@ Core.prototype.hideRows = function (rowIds, hidden) {
|
|
36280
36512
|
};
|
36281
36513
|
|
36282
36514
|
/**
|
36283
|
-
* Show
|
36515
|
+
* Show the specified rows by rowIds. To show all rows, use unhideAllRows method for better performance.
|
36284
36516
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to show
|
36285
|
-
* @param {boolean=} shown
|
36517
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
36286
36518
|
* @public
|
36287
36519
|
*/
|
36288
36520
|
Core.prototype.showRows = function (rowIds, shown) {
|
@@ -36303,7 +36535,7 @@ Core.prototype.unhideAllRows = function () {
|
|
36303
36535
|
|
36304
36536
|
/**
|
36305
36537
|
* @public
|
36306
|
-
* @
|
36538
|
+
* @return {boolean}
|
36307
36539
|
*/
|
36308
36540
|
Core.prototype.hasHiddenRow = function () {
|
36309
36541
|
return this._dataSource.hasHiddenRow();
|
@@ -36382,10 +36614,22 @@ Core.prototype._updateColumnBounds = function () {
|
|
36382
36614
|
return;
|
36383
36615
|
}
|
36384
36616
|
|
36617
|
+
var colCount = this.getColumnCount();
|
36618
|
+
var colIndices = [];
|
36619
|
+
var i;
|
36620
|
+
for(i = 0; i < colCount; i++) {
|
36621
|
+
if(this.isSelectedColumn(i)) {
|
36622
|
+
colIndices.push(i);
|
36623
|
+
}
|
36624
|
+
}
|
36625
|
+
var arg = {
|
36626
|
+
selectedColumns: colIndices
|
36627
|
+
};
|
36628
|
+
this._dispatch("beforeColumnBoundUpdate", arg);
|
36629
|
+
|
36385
36630
|
var len = this.getColumnCount();
|
36386
36631
|
var lftIdx = -1;
|
36387
36632
|
var rgtIdx = -1;
|
36388
|
-
var i;
|
36389
36633
|
for(i = 0; i < len; ++i) {
|
36390
36634
|
if(this.isSelectedColumn(i)) {
|
36391
36635
|
rgtIdx = i;
|
@@ -36396,12 +36640,17 @@ Core.prototype._updateColumnBounds = function () {
|
|
36396
36640
|
}
|
36397
36641
|
var sectCount = this._settings.length;
|
36398
36642
|
if(sectCount) {
|
36399
|
-
var
|
36643
|
+
var sectionSetting = this._settings[0];
|
36644
|
+
var section = sectionSetting.getSection();
|
36400
36645
|
var positions = [0, 0];
|
36401
36646
|
var noBorders = [false, false];
|
36402
36647
|
section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
|
36403
|
-
|
36404
|
-
|
36648
|
+
var topPx = 0;
|
36649
|
+
if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
|
36650
|
+
topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
|
36651
|
+
}
|
36652
|
+
section.updateColumnBounds(positions, noBorders, topPx);
|
36653
|
+
for(i = 1; i < sectCount; i++) {
|
36405
36654
|
section = this._settings[i].getSection();
|
36406
36655
|
section.updateColumnBounds(positions, noBorders);
|
36407
36656
|
}
|
@@ -37571,6 +37820,10 @@ Core.prototype._updateScrollbarHeight = function (paneChanged, contentChanged, n
|
|
37571
37820
|
* @param {boolean} contentChanged
|
37572
37821
|
*/
|
37573
37822
|
Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
37823
|
+
if (this._frozenLayout) {
|
37824
|
+
return;
|
37825
|
+
}
|
37826
|
+
|
37574
37827
|
if (paneChanged && this._hScrollbarEnabled) {
|
37575
37828
|
// Scroll Frame
|
37576
37829
|
var gridElem = this.getElement();
|
@@ -37775,7 +38028,7 @@ Core.prototype._updateLayout = function () {
|
|
37775
38028
|
this._syncLayoutToColumns(); // Update only if need
|
37776
38029
|
|
37777
38030
|
this._updateScrollbarHeight(true, true);
|
37778
|
-
this._updateScrollbarWidth(true, true);
|
38031
|
+
this._updateScrollbarWidth(true, true); // WARNING this may be redundant with _syncLayoutToColumns
|
37779
38032
|
|
37780
38033
|
var sectionCount = this.getSectionCount();
|
37781
38034
|
for (var s = 0; s < sectionCount; ++s) {
|
@@ -38287,6 +38540,14 @@ DataConnector.prototype.removeFields = function (fieldRef, referer) {
|
|
38287
38540
|
this._commitFieldsChanges();
|
38288
38541
|
};
|
38289
38542
|
|
38543
|
+
/** @public
|
38544
|
+
* @param {string} referrer
|
38545
|
+
*/
|
38546
|
+
DataConnector.prototype.removeFieldReferrer = function (referrer) {
|
38547
|
+
this._fields.removeReferer(referrer);
|
38548
|
+
this._commitFieldsChanges();
|
38549
|
+
};
|
38550
|
+
|
38290
38551
|
/** @public
|
38291
38552
|
*/
|
38292
38553
|
DataConnector.prototype.removeAllFields = function () {
|
@@ -38595,7 +38856,7 @@ SortableTitlePlugin.ColumnOptions;
|
|
38595
38856
|
* @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
|
38596
38857
|
* @property {boolean=} threeStatesSorting=false If enabled, sorting will cycle through ascending, descending and original order states. This option is deprecated in favor of sortingSequence option
|
38597
38858
|
* @property {Object.<string, DataTable.SortLogic>=} sortLogic=null Custom logic for sorting based on the specified field. The key is field name and the value pair is a function.
|
38598
|
-
* @property {boolean=} disableDoubleClickToSort=
|
38859
|
+
* @property {boolean=} disableDoubleClickToSort=true If disabled, double click will trigger sorting operation
|
38599
38860
|
* @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
|
38600
38861
|
* @property {boolean=} sortableIndicator=false If enabled, sort indicator (diamond) icon will always show regardless of sorting states. In Halo theme, this option will be enabled by default.
|
38601
38862
|
* @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
|
@@ -38605,7 +38866,8 @@ SortableTitlePlugin.ColumnOptions;
|
|
38605
38866
|
* @property {Function=} preClicked A shortcut to define the preClicked event handler
|
38606
38867
|
* @property {Function=} clicked A shortcut to define the clicked event handler
|
38607
38868
|
* @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
|
38608
|
-
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option
|
38869
|
+
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option overrides threeStatesSorting
|
38870
|
+
* @property {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
38609
38871
|
*/
|
38610
38872
|
SortableTitlePlugin.Options;
|
38611
38873
|
|
@@ -38634,7 +38896,7 @@ SortableTitlePlugin.prototype._dataSorting = true;
|
|
38634
38896
|
/** @private
|
38635
38897
|
* @type {boolean}
|
38636
38898
|
*/
|
38637
|
-
SortableTitlePlugin.prototype.
|
38899
|
+
SortableTitlePlugin.prototype._dblClickAllowed = false;
|
38638
38900
|
|
38639
38901
|
/** @private
|
38640
38902
|
* @type {number}
|
@@ -38777,19 +39039,20 @@ SortableTitlePlugin.prototype.unload = function (host) {
|
|
38777
39039
|
SortableTitlePlugin.prototype.afterInit = function () {
|
38778
39040
|
var t = this;
|
38779
39041
|
|
38780
|
-
//
|
39042
|
+
// Set logic to the data source, since the data source not available during the initialization
|
38781
39043
|
t.setSortLogics(t._sortLogic);
|
38782
39044
|
|
38783
|
-
|
38784
|
-
if (
|
38785
|
-
|
38786
|
-
|
38787
|
-
|
38788
|
-
|
38789
|
-
|
38790
|
-
|
39045
|
+
var userInput = t._initialSort;
|
39046
|
+
if (userInput != null) {
|
39047
|
+
if(Array.isArray(userInput)) {
|
39048
|
+
if(t._maxCount === 1) { // TODO: max count could be part of sortColumns method
|
39049
|
+
t.sortColumns(userInput.slice(0, 1));
|
39050
|
+
} else {
|
39051
|
+
t.sortColumns(userInput);
|
39052
|
+
}
|
39053
|
+
} else {
|
39054
|
+
t.sortColumns([userInput]);
|
38791
39055
|
}
|
38792
|
-
t.sortColumns(initialSort);
|
38793
39056
|
}
|
38794
39057
|
};
|
38795
39058
|
|
@@ -38967,7 +39230,9 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
38967
39230
|
if(this._maxCount !== 1) {
|
38968
39231
|
extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
|
38969
39232
|
}
|
38970
|
-
|
39233
|
+
if(this._dblClickAllowed) {
|
39234
|
+
extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
|
39235
|
+
}
|
38971
39236
|
extOptions["sortableColumns"] = this._sortableColumns;
|
38972
39237
|
extOptions["indicatorOnly"] = !this._dataSorting;
|
38973
39238
|
// extOptions["mode"] = this._mode;
|
@@ -39340,9 +39605,10 @@ SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
|
|
39340
39605
|
* @public
|
39341
39606
|
* @param {number} colIndex
|
39342
39607
|
* @param {string|null} field A field used for sorting
|
39343
|
-
* @param {Function=} sortLogic
|
39608
|
+
* @param {Function=} sortLogic=null
|
39609
|
+
* @param {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
39344
39610
|
*/
|
39345
|
-
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic) {
|
39611
|
+
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic, rowSorting) {
|
39346
39612
|
if (typeof colIndex == "number" && field != null) {
|
39347
39613
|
var options = this._newSortOptions(colIndex);
|
39348
39614
|
if (!field) {
|
@@ -39354,6 +39620,9 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
|
|
39354
39620
|
if(sortLogic != null && !this._userManagedLogic) {
|
39355
39621
|
if (options["sortLogic"] !== sortLogic) {
|
39356
39622
|
options["sortLogic"] = sortLogic || null;
|
39623
|
+
if(rowSorting && sortLogic) {
|
39624
|
+
sortLogic["rowSorting"] = true; // Tell data view/table about the argument
|
39625
|
+
}
|
39357
39626
|
}
|
39358
39627
|
}
|
39359
39628
|
}
|
@@ -39453,10 +39722,10 @@ SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
|
|
39453
39722
|
};
|
39454
39723
|
/** @public
|
39455
39724
|
* @description To allow double click action to sort. Default value is false.
|
39456
|
-
* @param {boolean=} disabled
|
39725
|
+
* @param {boolean=} disabled=false
|
39457
39726
|
*/
|
39458
39727
|
SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
|
39459
|
-
this.
|
39728
|
+
this._dblClickAllowed = !disabled;
|
39460
39729
|
};
|
39461
39730
|
/** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
|
39462
39731
|
* @public
|
@@ -39502,54 +39771,26 @@ SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
|
|
39502
39771
|
this._delayInterval = (opt_ms != null) ? opt_ms : 500;
|
39503
39772
|
};
|
39504
39773
|
|
39505
|
-
/** @private
|
39506
|
-
* @description Pre-process columns options to support both composite and rt-grid backward compatible
|
39507
|
-
* @param {number} colIndex
|
39508
|
-
* @param {Object} options
|
39509
|
-
* @returns {Object}
|
39510
|
-
*/
|
39511
|
-
SortableTitlePlugin.prototype._prepareColumnOptions = function (colIndex, options) {
|
39512
|
-
var t = this;
|
39513
|
-
var column = options || {};
|
39514
|
-
var colOption = {
|
39515
|
-
"colIndex": colIndex,
|
39516
|
-
"field": column["field"],
|
39517
|
-
"sortable": !!t._sortableColumns
|
39518
|
-
};
|
39519
|
-
|
39520
|
-
if (column["sortBy"] != null) { // composite grid option
|
39521
|
-
colOption["sortable"] = !!column["sortBy"];
|
39522
|
-
colOption["sortBy"] = column["sortBy"];
|
39523
|
-
}
|
39524
|
-
if (column["sortable"] != null) { // rt grid option
|
39525
|
-
colOption["sortable"] = !!column["sortable"];
|
39526
|
-
}
|
39527
|
-
|
39528
|
-
colOption["sortLogic"] = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
39529
|
-
colOption["sort"] = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
39530
|
-
return colOption;
|
39531
|
-
};
|
39532
|
-
|
39533
39774
|
/** @private
|
39534
39775
|
* @description Get initial sort from column option `defaultSort` or `sort`
|
39535
39776
|
* @param {Object} options Core model object
|
39536
39777
|
* @returns {Object}
|
39537
39778
|
*/
|
39538
39779
|
SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
|
39539
|
-
var
|
39540
|
-
var
|
39541
|
-
var
|
39542
|
-
|
39543
|
-
var
|
39544
|
-
|
39545
|
-
|
39546
|
-
|
39547
|
-
"colIndex":
|
39548
|
-
"sortOrder":
|
39780
|
+
var columns = options["columns"];
|
39781
|
+
var colCount = columns ? columns.length : 0;
|
39782
|
+
for (var i = 0; i < colCount; i++) {
|
39783
|
+
var column = columns[i];
|
39784
|
+
var sortOrder = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
39785
|
+
if (sortOrder) {
|
39786
|
+
// TODO: Support multi-column sorting
|
39787
|
+
return {
|
39788
|
+
"colIndex": i,
|
39789
|
+
"sortOrder": sortOrder
|
39549
39790
|
};
|
39550
39791
|
}
|
39551
39792
|
}
|
39552
|
-
return
|
39793
|
+
return null;
|
39553
39794
|
};
|
39554
39795
|
|
39555
39796
|
/** @private
|
@@ -39660,7 +39901,7 @@ SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
|
|
39660
39901
|
if(this._disabled) {
|
39661
39902
|
return;
|
39662
39903
|
}
|
39663
|
-
if (e.detail === 2 && this.
|
39904
|
+
if (e.detail === 2 && !this._dblClickAllowed) { // dblclick
|
39664
39905
|
if (this._clickTimer) {
|
39665
39906
|
clearTimeout(this._clickTimer);
|
39666
39907
|
this._clickTimer = 0;
|
@@ -39938,18 +40179,35 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
|
|
39938
40179
|
SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
39939
40180
|
var t = this;
|
39940
40181
|
var colIndex = e["colIndex"];
|
39941
|
-
var
|
39942
|
-
|
39943
|
-
var
|
39944
|
-
var
|
40182
|
+
var column = e["context"] || {};
|
40183
|
+
|
40184
|
+
var sortable = !!t._sortableColumns;
|
40185
|
+
var field = column["field"];
|
40186
|
+
var sortBy = column["sortBy"];
|
40187
|
+
|
40188
|
+
if (sortBy != null) { // composite grid option
|
40189
|
+
sortable = !!sortBy;
|
40190
|
+
field = sortBy;
|
40191
|
+
}
|
40192
|
+
if (column["sortable"] != null) { // rt grid option
|
40193
|
+
sortable = !!column["sortable"];
|
40194
|
+
}
|
40195
|
+
|
40196
|
+
var sortLogic = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
40197
|
+
if(!sortLogic) {
|
40198
|
+
sortLogic = t._sortLogic[field];
|
40199
|
+
}
|
40200
|
+
if(typeof sortLogic !== "function") {
|
40201
|
+
sortLogic = null;
|
40202
|
+
}
|
39945
40203
|
|
39946
|
-
var sortingSequence =
|
40204
|
+
var sortingSequence = column["sortingSequence"];
|
39947
40205
|
if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
|
39948
40206
|
t.setSortingSequence(sortingSequence, field);
|
39949
40207
|
}
|
39950
40208
|
|
39951
|
-
if (
|
39952
|
-
t.setColumnSortingField(colIndex, field,
|
40209
|
+
if (sortable) { // TODO: Check if empty field should be sortable
|
40210
|
+
t.setColumnSortingField(colIndex, field, sortLogic, column["rowSorting"]);
|
39953
40211
|
} else {
|
39954
40212
|
t.disableColumnSorting(colIndex, true);
|
39955
40213
|
}
|
@@ -40334,6 +40592,7 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
|
40334
40592
|
* @property {boolean=} borders=true Lines around grid element
|
40335
40593
|
* @property {boolean=} gridlines=true Horizontal and Vertical lines for ONLY content sections
|
40336
40594
|
* @property {boolean=} verticalLines=true Vertical lines for all sections
|
40595
|
+
* @property {boolean=} contentVerticalLines=true Vertical lines for all content section
|
40337
40596
|
* @property {boolean=} horizontalLines=true Horizontal lines for all sections
|
40338
40597
|
* @property {*=} RTK=null rtk toolkit instance
|
40339
40598
|
* @property {Grid~ADCOptions=} ADC=null ADC requesting level config object from adc team
|
@@ -40348,6 +40607,7 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
|
40348
40607
|
* @property {Element=} scrollbarParent=null Element to be attached by grid's scrollbars, allowing them to move outside and avoid overlapping with the content.
|
40349
40608
|
* @property {boolean=} formulaEngine=false If enabled, field with leading equal sign will be treated as a formula and rows will be filled with the calculated values.
|
40350
40609
|
* @property {number=} adcPollingInterval=0 Length of polling interval for refreshing ADC data in milliseconds. The default value (0) means no polling.
|
40610
|
+
* @property {boolean=} fieldCaching=false If enabled, field definition will be caching internal mechanism
|
40351
40611
|
*/
|
40352
40612
|
|
40353
40613
|
/** @typedef {number|string|RowDefinition} Grid~RowReference
|
@@ -40360,7 +40620,7 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
|
40360
40620
|
/** @typedef {number|string|ColumnDefinition} Grid~ColumnReference
|
40361
40621
|
* @description A column in Grid can be referred by the following values:<br>
|
40362
40622
|
* <b>number</b> : Column index including all invisible (hidden) columns<br>
|
40363
|
-
* <b>string</b> : Field name of the column<br>
|
40623
|
+
* <b>string</b> : Field name or column id of the column<br>
|
40364
40624
|
* <b>ColumnDefinition</b> : Column definition object<br>
|
40365
40625
|
*/
|
40366
40626
|
|
@@ -40456,25 +40716,6 @@ var cloneRowData = function(fromRowDef, toRowDef) {
|
|
40456
40716
|
}
|
40457
40717
|
};
|
40458
40718
|
|
40459
|
-
/** @private
|
40460
|
-
* @param {number} a
|
40461
|
-
* @param {number} b
|
40462
|
-
* @return {number}
|
40463
|
-
*/
|
40464
|
-
var ascNumberSorter = function (a, b) {
|
40465
|
-
return a - b;
|
40466
|
-
};
|
40467
|
-
|
40468
|
-
/** @private
|
40469
|
-
* @param {number} min
|
40470
|
-
* @param {number} max
|
40471
|
-
* @param {number} elem
|
40472
|
-
* @return {boolean}
|
40473
|
-
*/
|
40474
|
-
var inRangeFilter = function (min, max, elem) {
|
40475
|
-
return elem >= min && elem <= max;
|
40476
|
-
};
|
40477
|
-
|
40478
40719
|
/** @private
|
40479
40720
|
* @param {string} sortField
|
40480
40721
|
* @param {Object} elemData
|
@@ -40772,6 +41013,10 @@ Grid.prototype._lastPollingRequest = 0;
|
|
40772
41013
|
* @private
|
40773
41014
|
*/
|
40774
41015
|
Grid.prototype._pollingEnabled = true;
|
41016
|
+
/** @type {boolean}
|
41017
|
+
* @private
|
41018
|
+
*/
|
41019
|
+
Grid.prototype._fieldCaching = false;
|
40775
41020
|
|
40776
41021
|
|
40777
41022
|
/** @public
|
@@ -41016,6 +41261,11 @@ Grid.prototype.initialize = function(gridOption) {
|
|
41016
41261
|
js_FieldDefinition.setSynapseConfig(t._synapse);
|
41017
41262
|
}
|
41018
41263
|
|
41264
|
+
if (gridOption["fieldCaching"]) {
|
41265
|
+
t._fieldCaching = gridOption["fieldCaching"];
|
41266
|
+
js_FieldDefinition.setFieldCaching(t._fieldCaching);
|
41267
|
+
}
|
41268
|
+
|
41019
41269
|
if (gridOption["icons"] && gridOption["icons"]["rowGrouping"] && gridOption["icons"]["rowGrouping"]["expander"]) {
|
41020
41270
|
js_StyleLoader.chainIcon = gridOption["icons"]["rowGrouping"]["expander"];
|
41021
41271
|
}
|
@@ -41038,6 +41288,10 @@ Grid.prototype.initialize = function(gridOption) {
|
|
41038
41288
|
if (vLines != null) {
|
41039
41289
|
grid.toggleVerticalLines(vLines);
|
41040
41290
|
}
|
41291
|
+
var cvLines = gridOption["contentVerticalLines"];
|
41292
|
+
if (cvLines != null) {
|
41293
|
+
grid.toggleContentVerticalLines(cvLines);
|
41294
|
+
}
|
41041
41295
|
var hLines = gridOption["horizontalLines"];
|
41042
41296
|
if (hLines != null) {
|
41043
41297
|
grid.toggleHorizontalLines(hLines);
|
@@ -41326,11 +41580,14 @@ Grid.prototype.getConfigObject = function (gridOptions) {
|
|
41326
41580
|
if(this._pollingInterval) {
|
41327
41581
|
obj["adcPollingInterval"] = this._pollingInterval;
|
41328
41582
|
}
|
41583
|
+
if(this._fieldCaching) {
|
41584
|
+
obj["fieldCaching"] = this._fieldCaching;
|
41585
|
+
}
|
41329
41586
|
|
41330
41587
|
// get all rows config
|
41331
41588
|
var rowDefs = this.getAllRowDefinitions();
|
41332
41589
|
var rows = obj["rows"] = [];
|
41333
|
-
var rowDef, rowConfig
|
41590
|
+
var rowDef, rowConfig;
|
41334
41591
|
len = rowDefs.length;
|
41335
41592
|
for (i = 0; i < len; i++) {
|
41336
41593
|
rowDef = rowDefs[i];
|
@@ -41340,6 +41597,7 @@ Grid.prototype.getConfigObject = function (gridOptions) {
|
|
41340
41597
|
|
41341
41598
|
// get row config from extensions
|
41342
41599
|
var extensions = grid.getPlugins();
|
41600
|
+
var pluginInstance, row;
|
41343
41601
|
for(var key in extensions) {
|
41344
41602
|
pluginInstance = extensions[key];
|
41345
41603
|
if(typeof pluginInstance["getRowConfigObject"] === "function") {
|
@@ -41347,15 +41605,7 @@ Grid.prototype.getConfigObject = function (gridOptions) {
|
|
41347
41605
|
for (i = 0; i < len; i++) {
|
41348
41606
|
rowDef = rowDefs[i];
|
41349
41607
|
row = rows[i];
|
41350
|
-
|
41351
|
-
if(retObj) {
|
41352
|
-
if(row.values) {
|
41353
|
-
// eslint-disable-next-line es5/no-es6-static-methods
|
41354
|
-
Object.assign(row.values, retObj); // Ignore lint
|
41355
|
-
} else {
|
41356
|
-
row.values = retObj;
|
41357
|
-
}
|
41358
|
-
}
|
41608
|
+
pluginInstance["getRowConfigObject"](row, rowDef.getRowId());
|
41359
41609
|
}
|
41360
41610
|
}
|
41361
41611
|
}
|
@@ -41887,78 +42137,7 @@ Grid.prototype.removeAllColumns = function() {
|
|
41887
42137
|
* @return {boolean} Return true if there is any change, and false otherwise
|
41888
42138
|
*/
|
41889
42139
|
Grid.prototype.moveColumn = function (fromColIndex, toColIndex) {
|
41890
|
-
|
41891
|
-
if (!Array.isArray(fromColIndex)) {
|
41892
|
-
fromColIndex = [fromColIndex];
|
41893
|
-
}
|
41894
|
-
|
41895
|
-
var columnCount = this._grid.getColumnCount();
|
41896
|
-
var lastColIndex = columnCount - 1;
|
41897
|
-
fromColIndex.sort(ascNumberSorter);
|
41898
|
-
fromColIndex = fromColIndex.filter(inRangeFilter.bind(null, 0, lastColIndex));
|
41899
|
-
|
41900
|
-
if (!this._grid.isColumnMoveAllowed(fromColIndex, toColIndex)) {
|
41901
|
-
return false;
|
41902
|
-
}
|
41903
|
-
|
41904
|
-
var frozen = this._grid.isLayoutFrozen();
|
41905
|
-
this._grid.freezeLayout(true);
|
41906
|
-
|
41907
|
-
var marker = [];
|
41908
|
-
var runner = 0;
|
41909
|
-
var i;
|
41910
|
-
for (i = 0; i < columnCount; i++) {
|
41911
|
-
if (i == fromColIndex[runner]) {
|
41912
|
-
marker.push(true);
|
41913
|
-
runner++;
|
41914
|
-
} else {
|
41915
|
-
marker.push(false);
|
41916
|
-
}
|
41917
|
-
}
|
41918
|
-
//Find the index to be moved to
|
41919
|
-
var counter = -1;
|
41920
|
-
var toMoveTo = -1;
|
41921
|
-
|
41922
|
-
for (i = 0; i < columnCount; i++) {
|
41923
|
-
if (marker[i] === false) {
|
41924
|
-
counter++;
|
41925
|
-
}
|
41926
|
-
|
41927
|
-
if (counter === toColIndex) {
|
41928
|
-
toMoveTo = i;
|
41929
|
-
break;
|
41930
|
-
}
|
41931
|
-
}
|
41932
|
-
|
41933
|
-
//If toMoveTo == -1, it means the target column index is beyond the last colmn so just move the columns
|
41934
|
-
//to the end of the table
|
41935
|
-
if (toMoveTo === -1) {
|
41936
|
-
toMoveTo = columnCount;
|
41937
|
-
}
|
41938
|
-
|
41939
|
-
//Perform moving
|
41940
|
-
var leftList = [], rightList = [];
|
41941
|
-
|
41942
|
-
for (i = 0; i < fromColIndex.length; i++) {
|
41943
|
-
if (fromColIndex[i] < toMoveTo) {
|
41944
|
-
leftList.push(fromColIndex[i]);
|
41945
|
-
} else if (fromColIndex[i] > toMoveTo) {
|
41946
|
-
rightList.push(fromColIndex[i]);
|
41947
|
-
}
|
41948
|
-
}
|
41949
|
-
|
41950
|
-
for (i = 0; i < rightList.length; i++) {
|
41951
|
-
this._grid.moveColumn(rightList[i], toMoveTo + i);
|
41952
|
-
}
|
41953
|
-
|
41954
|
-
for (i = leftList.length - 1; i >= 0; i--) {
|
41955
|
-
toMoveTo--;
|
41956
|
-
|
41957
|
-
this._grid.moveColumn(leftList[i], toMoveTo);
|
41958
|
-
}
|
41959
|
-
|
41960
|
-
this._grid.freezeLayout(frozen);
|
41961
|
-
return true;
|
42140
|
+
return this._grid.moveColumn(fromColIndex, toColIndex);
|
41962
42141
|
};
|
41963
42142
|
|
41964
42143
|
/** The hidden column still occupies the same index.
|
@@ -42023,7 +42202,7 @@ Grid.prototype.addDataFields = function(fieldRef, referrer) {
|
|
42023
42202
|
|
42024
42203
|
if(!dataType) {
|
42025
42204
|
// wait field-info to be loaded before adding field
|
42026
|
-
onLoaded = this._onFieldLoaded.bind(this, field);
|
42205
|
+
onLoaded = this._onFieldLoaded.bind(this, field, referrer);
|
42027
42206
|
prom = prom.then(onLoaded).catch(onLoaded);
|
42028
42207
|
} else {
|
42029
42208
|
this._connector.addFields(field, referrer || "grid");
|
@@ -42049,6 +42228,16 @@ Grid.prototype.removeDataFields = function(fieldRef, referrer) {
|
|
42049
42228
|
this._connector.removeFields(fieldRef, referrer || "grid");
|
42050
42229
|
return true;
|
42051
42230
|
};
|
42231
|
+
/** @public
|
42232
|
+
* @param {string} referrer
|
42233
|
+
*/
|
42234
|
+
Grid.prototype.removeFieldReferrer = function(referrer) {
|
42235
|
+
if(!referrer) {
|
42236
|
+
return;
|
42237
|
+
}
|
42238
|
+
|
42239
|
+
this._connector.removeFieldReferrer(referrer);
|
42240
|
+
};
|
42052
42241
|
|
42053
42242
|
/** @public
|
42054
42243
|
* @param {Grid~ColumnReference} colRef
|
@@ -42675,6 +42864,40 @@ Grid.prototype.getColumnDefinition = function(colIndex) {
|
|
42675
42864
|
}
|
42676
42865
|
return null;
|
42677
42866
|
};
|
42867
|
+
|
42868
|
+
/** @public
|
42869
|
+
* @param {string} colId
|
42870
|
+
* @return {ColumnDefinition}
|
42871
|
+
*/
|
42872
|
+
Grid.prototype.getColumnDefinitionById = function(colId) {
|
42873
|
+
if(typeof colId === "string") {
|
42874
|
+
var colIndex = this.getColumnIndex(colId);
|
42875
|
+
var colData = this._grid.getColumnData(colIndex);
|
42876
|
+
if(colData) {
|
42877
|
+
return /** @type{ColumnDefinition} */(colData[COL_DEF]) || null;
|
42878
|
+
}
|
42879
|
+
}
|
42880
|
+
return null;
|
42881
|
+
};
|
42882
|
+
|
42883
|
+
/** @public
|
42884
|
+
* @param {Array.<string>} colIds
|
42885
|
+
* @return {ColumnDefinition}
|
42886
|
+
*/
|
42887
|
+
Grid.prototype.getColumnDefinitionsById = function(colIds) {
|
42888
|
+
var colCount = Array.isArray(colIds) ? colIds.length : 0;
|
42889
|
+
if(colCount > 0) {
|
42890
|
+
var i, colId;
|
42891
|
+
var colDefs = new Array(colCount);
|
42892
|
+
for(i = 0; i < colCount; i++) {
|
42893
|
+
colId = colIds[i];
|
42894
|
+
colDefs[i] = this.getColumnDefinitionById(colId);
|
42895
|
+
}
|
42896
|
+
return colDefs;
|
42897
|
+
}
|
42898
|
+
return null;
|
42899
|
+
|
42900
|
+
};
|
42678
42901
|
/** @private
|
42679
42902
|
* @param {Grid~ColumnReference} colRef
|
42680
42903
|
* @return {ColumnDefinition}
|
@@ -42688,7 +42911,7 @@ Grid.prototype._getColumnDefinition = function(colRef) {
|
|
42688
42911
|
var colCount = this.getColumnCount();
|
42689
42912
|
for(var i = 0; i < colCount; ++i) {
|
42690
42913
|
var colDef = this.getColumnDefinition(i);
|
42691
|
-
if(colDef.getField() === colRef) {
|
42914
|
+
if(colDef.getField() === colRef || colDef.getId() === colRef) {
|
42692
42915
|
return colDef; // Return the first found field
|
42693
42916
|
}
|
42694
42917
|
}
|
@@ -42880,7 +43103,7 @@ Grid.prototype.getColumnIndex = function(colRef) {
|
|
42880
43103
|
} else if(typeof colRef === "string") {
|
42881
43104
|
for(i = 0; i < colCount; ++i) {
|
42882
43105
|
colDef = this.getColumnDefinition(i);
|
42883
|
-
if(colDef.getField() === colRef) {
|
43106
|
+
if(colDef.getField() === colRef || colDef.getId() === colRef) {
|
42884
43107
|
return i; // Return the first found field
|
42885
43108
|
}
|
42886
43109
|
}
|
@@ -45714,6 +45937,11 @@ var dataGen = new DataGenerator();
|
|
45714
45937
|
*/
|
45715
45938
|
var DataGrid = {};
|
45716
45939
|
|
45940
|
+
/** @private
|
45941
|
+
* @namespace
|
45942
|
+
*/
|
45943
|
+
var Adc = {};
|
45944
|
+
|
45717
45945
|
/** @private
|
45718
45946
|
* @function
|
45719
45947
|
* @param {Object} payload
|
@@ -45792,6 +46020,97 @@ DataGrid.request = function (payload, mockResponse) {
|
|
45792
46020
|
}));
|
45793
46021
|
};
|
45794
46022
|
|
46023
|
+
/** @private
|
46024
|
+
* @function
|
46025
|
+
* @param {Object} payload
|
46026
|
+
* @param {Object=} mockResponse
|
46027
|
+
* @return {Promise}
|
46028
|
+
*/
|
46029
|
+
Adc.request = function (payload, mockResponse) {
|
46030
|
+
if (mockResponse) {
|
46031
|
+
return Promise.resolve(JSON.stringify(mockResponse));
|
46032
|
+
}
|
46033
|
+
|
46034
|
+
var i, f, len, row;
|
46035
|
+
var identifiers = payload.identifiers;
|
46036
|
+
var formula = payload.formula.split(",");
|
46037
|
+
var fields = [];
|
46038
|
+
|
46039
|
+
// _invalidFieldDict is a dictionary of non exist field
|
46040
|
+
// so we must remove invalid field to make "mocking api" return result more like a "real api".
|
46041
|
+
var invalidDict = _invalidFieldDict;
|
46042
|
+
for (i = 0; i < formula.length; i++) {
|
46043
|
+
f = formula[i];
|
46044
|
+
if (!invalidDict[f]) {
|
46045
|
+
fields.push(f);
|
46046
|
+
}
|
46047
|
+
}
|
46048
|
+
|
46049
|
+
// build row header
|
46050
|
+
var rows = [];
|
46051
|
+
rows[0] = [{
|
46052
|
+
"h": true,
|
46053
|
+
"i": "instrument",
|
46054
|
+
"v": "Instrument"
|
46055
|
+
}];
|
46056
|
+
for (i = 0; i < fields.length; i++) {
|
46057
|
+
f = fields[i];
|
46058
|
+
rows[0].push({
|
46059
|
+
"h": true,
|
46060
|
+
"r": f.toUpperCase()
|
46061
|
+
// "v": "Price Close", // Doesn't use
|
46062
|
+
// "p": "I_TRP_PH_PriceClose" // Doesn't use this property
|
46063
|
+
});
|
46064
|
+
}
|
46065
|
+
|
46066
|
+
// build data
|
46067
|
+
var rowMap = {};
|
46068
|
+
|
46069
|
+
len = identifiers.length;
|
46070
|
+
var rowData = dataGen.generate(fields, len);
|
46071
|
+
for (i = 0; i < len; ++i) {
|
46072
|
+
var inst = identifiers[i];
|
46073
|
+
row = rowMap[inst];
|
46074
|
+
if (!row) {
|
46075
|
+
row = rowMap[inst] = rowData[i];
|
46076
|
+
row.unshift(inst); // prepend instrument on each row
|
46077
|
+
}
|
46078
|
+
rows.push(row);
|
46079
|
+
}
|
46080
|
+
|
46081
|
+
// There is a chance that rtk will return multiple row data per instrument
|
46082
|
+
// so we must create mock up for this case
|
46083
|
+
if (rows.length > 0) {
|
46084
|
+
var chance = dataGen.randInt(1, 10);
|
46085
|
+
if (chance <= 3) { // chance 30%
|
46086
|
+
var pos = dataGen.randInt(0, rows.length - 1); // random row pos
|
46087
|
+
row = rows[pos];
|
46088
|
+
len = row.length;
|
46089
|
+
var mockupRow = new Array(len);
|
46090
|
+
mockupRow[0] = row[0]; // 1st index is for instrument
|
46091
|
+
for (i = 1; i < len; i++) {
|
46092
|
+
mockupRow[i] = ''; // real case will return null or empty string
|
46093
|
+
}
|
46094
|
+
rows.splice(pos + 1, 0, mockupRow);
|
46095
|
+
}
|
46096
|
+
}
|
46097
|
+
|
46098
|
+
/*
|
46099
|
+
response type is :
|
46100
|
+
{
|
46101
|
+
cols: number,
|
46102
|
+
faults: Array<obj>,
|
46103
|
+
rows: Array<obj>,
|
46104
|
+
status: string
|
46105
|
+
}
|
46106
|
+
Currently, we use only the rows property for cache ADC data
|
46107
|
+
*/
|
46108
|
+
return Promise.resolve(JSON.stringify({
|
46109
|
+
rows: rows
|
46110
|
+
// TODO : supports faults property
|
46111
|
+
}));
|
46112
|
+
};
|
46113
|
+
|
45795
46114
|
/** @public
|
45796
46115
|
* @function
|
45797
46116
|
* @param {string} dataType
|
@@ -45800,6 +46119,8 @@ DataGrid.request = function (payload, mockResponse) {
|
|
45800
46119
|
var mockDataAPI = function (dataType) {
|
45801
46120
|
if (dataType === "datagrid") {
|
45802
46121
|
return Promise.resolve(DataGrid);
|
46122
|
+
} else if(dataType === "adc") {
|
46123
|
+
return Promise.resolve(Adc);
|
45803
46124
|
} else {
|
45804
46125
|
return Promise.reject(dataType + " is not supported.");
|
45805
46126
|
}
|
@@ -46151,7 +46472,7 @@ CellPainter.prototype.clearHeatMap = function() {
|
|
46151
46472
|
|
46152
46473
|
/** @public */
|
46153
46474
|
CellPainter.prototype.applyThemeColor = function() {
|
46154
|
-
var colors = ElfUtil.
|
46475
|
+
var colors = ElfUtil.getColors();
|
46155
46476
|
var cond = this._conditions[0]; // Heatmap, color text condition must be the first
|
46156
46477
|
if(cond) {
|
46157
46478
|
if(this._coloringType === CellPainter.ColoringTypes.HEATMAP) { // Heatmap uses grid color to blend the result color
|
@@ -46738,16 +47059,13 @@ CellPainter.themeChanged = function() {};
|
|
46738
47059
|
CellPainter.setThemeColors = function() {};
|
46739
47060
|
/** @private
|
46740
47061
|
* @function
|
46741
|
-
* @param {Object} colors
|
46742
|
-
* @return {Object} colors
|
46743
47062
|
*/
|
46744
|
-
CellPainter._onThemeChanged = function(
|
47063
|
+
CellPainter._onThemeChanged = function() {
|
46745
47064
|
// Apply newly changed theme to all the painters
|
46746
47065
|
var painters = CellPainter._painters;
|
46747
47066
|
for(var i = painters.length; --i >= 0;) {
|
46748
47067
|
painters[i].applyThemeColor(); // Re-apply theme color
|
46749
47068
|
}
|
46750
|
-
return colors;
|
46751
47069
|
};
|
46752
47070
|
/** Load theme colors and change colors for all instances of CellPainter
|
46753
47071
|
* @public
|
@@ -46756,7 +47074,9 @@ CellPainter._onThemeChanged = function(colors) {
|
|
46756
47074
|
*/
|
46757
47075
|
CellPainter.loadThemeColors = function() {
|
46758
47076
|
if(!CellPainter.themeReady) {
|
46759
|
-
CellPainter.themeReady = ElfUtil.getThemeColors(CellPainter._onThemeChanged)
|
47077
|
+
CellPainter.themeReady = ElfUtil.getThemeColors(CellPainter._onThemeChanged)
|
47078
|
+
.then(CellPainter._onThemeChanged)
|
47079
|
+
.catch(CellPainter._onThemeChanged);
|
46760
47080
|
}
|
46761
47081
|
return CellPainter.themeReady;
|
46762
47082
|
};
|
@@ -46767,8 +47087,10 @@ CellPainter.loadThemeColors = function() {
|
|
46767
47087
|
* @return {Promise<Object>}
|
46768
47088
|
*/
|
46769
47089
|
CellPainter.reloadThemeColors = function () {
|
46770
|
-
CellPainter.themeReady = ElfUtil.
|
46771
|
-
|
47090
|
+
CellPainter.themeReady = ElfUtil.reloadThemeColors()
|
47091
|
+
.then(CellPainter._onThemeChanged)
|
47092
|
+
.catch(CellPainter._onThemeChanged);
|
47093
|
+
return CellPainter.themeReady;
|
46772
47094
|
};
|
46773
47095
|
|
46774
47096
|
/** @public
|