@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
package/lib/core/dist/core.js
CHANGED
@@ -166,40 +166,6 @@ Util.moveArrayItem = function (ary, from, to) {
|
|
166
166
|
}
|
167
167
|
return ary;
|
168
168
|
};
|
169
|
-
/** Insert an item in the given array at the specified position. If the position exceeds the array length, the array will be expanded
|
170
|
-
* @public
|
171
|
-
* @ignore
|
172
|
-
* @param {Array|*} ary
|
173
|
-
* @param {number} at INCLUSIVE
|
174
|
-
* @param {*} item
|
175
|
-
*/
|
176
|
-
Util.insertArrayItem = function (ary, at, item) {
|
177
|
-
if (!ary) { return; }
|
178
|
-
|
179
|
-
if (at < 0) {
|
180
|
-
return; // Negative index cannot be added
|
181
|
-
}
|
182
|
-
if (at < ary.length) {
|
183
|
-
ary.splice(at, 0, item); // any subsequence item is shifted to the right
|
184
|
-
} else {
|
185
|
-
ary[at] = item;
|
186
|
-
}
|
187
|
-
};
|
188
|
-
/** Remove the specified item from the given array
|
189
|
-
* @public
|
190
|
-
* @ignore
|
191
|
-
* @param {Array|*} ary
|
192
|
-
* @param {number} at INCLUSIVE
|
193
|
-
* @return {*} removed item. If not existed, null is returned
|
194
|
-
*/
|
195
|
-
Util.removeArrayItem = function (ary, at) {
|
196
|
-
if (!ary) { return null; }
|
197
|
-
|
198
|
-
if (at >= 0 && at < ary.length) {
|
199
|
-
return ary.splice(at, 1)[0];
|
200
|
-
}
|
201
|
-
return null;
|
202
|
-
};
|
203
169
|
/** @public
|
204
170
|
* @function
|
205
171
|
* @param {Array} ary
|
@@ -267,35 +233,6 @@ Util.cycleArray = function (ary, numItems) {
|
|
267
233
|
return ary || null;
|
268
234
|
};
|
269
235
|
|
270
|
-
/** Correct the index when associated item is moved by the specified indices
|
271
|
-
* @public
|
272
|
-
* @ignore
|
273
|
-
* @param {number|null} num
|
274
|
-
* @param {number|null} from INCLUSIVE removed index
|
275
|
-
* @param {number|null=} opt_to INCLUSIVE added index
|
276
|
-
* @return {number} Negative if the index is removed
|
277
|
-
*/
|
278
|
-
Util.moveIndex = function (num, from, opt_to) {
|
279
|
-
if (!Util.isNumber(num)) { return -1; }
|
280
|
-
if (num === from) {
|
281
|
-
if (Util.isNumber(opt_to)) {
|
282
|
-
return /** @type{number} */(opt_to);
|
283
|
-
}
|
284
|
-
return -1;
|
285
|
-
}
|
286
|
-
if (from !== null) {
|
287
|
-
if (num > from) {
|
288
|
-
--num;
|
289
|
-
}
|
290
|
-
}
|
291
|
-
if (opt_to !== null) {
|
292
|
-
if (num >= opt_to) {
|
293
|
-
++num;
|
294
|
-
}
|
295
|
-
}
|
296
|
-
return /** @type{number} */(num);
|
297
|
-
};
|
298
|
-
|
299
236
|
/** STL implementation of lowerBound() of the C++ vector class with no recursion
|
300
237
|
* @public
|
301
238
|
* @ignore
|
@@ -368,28 +305,6 @@ Util.stringFormat = function (format) {
|
|
368
305
|
Util._defaultLessComparator = function (left, right) {
|
369
306
|
return left < right;
|
370
307
|
};
|
371
|
-
/** @public
|
372
|
-
* @function
|
373
|
-
* @ignore
|
374
|
-
* @param {number} left
|
375
|
-
* @param {number} right
|
376
|
-
* @return {number}
|
377
|
-
* @example [4, 1, 2].sort(Util._numericSorter) === [1, 2, 4];
|
378
|
-
*/
|
379
|
-
Util._numericSorter = function (left, right) {
|
380
|
-
return left - right;
|
381
|
-
};
|
382
|
-
|
383
|
-
/** @public
|
384
|
-
* @function
|
385
|
-
* @ignore
|
386
|
-
* @param {Event} e
|
387
|
-
*/
|
388
|
-
Util._preventDefault = function (e) {
|
389
|
-
e.preventDefault();
|
390
|
-
e.stopPropagation();
|
391
|
-
};
|
392
|
-
|
393
308
|
/**
|
394
309
|
* @public
|
395
310
|
* @function
|
@@ -427,24 +342,34 @@ Util.calculatePercent = function (lowVal, lastVal, highVal) {
|
|
427
342
|
return percent * 100;
|
428
343
|
};
|
429
344
|
|
430
|
-
/** @description
|
345
|
+
/** @description The method returns closest ancestor element or the element itself with specified class string. Otherwise, it returns null
|
431
346
|
* @public
|
432
347
|
* @function
|
433
|
-
* @ignore
|
434
348
|
* @param {Element|Node|undefined} elem
|
435
349
|
* @param {string} classStr The class string can only be one single class without spaces
|
436
350
|
* @return {Element}
|
437
351
|
*/
|
438
352
|
Util.closestElement = function (elem, classStr) {
|
439
353
|
var n = elem;
|
440
|
-
while (n
|
441
|
-
if
|
442
|
-
|
354
|
+
while (n) {
|
355
|
+
if(n.classList) { // DocumentFragment does not have classList property
|
356
|
+
if (n.classList.contains(classStr)) {
|
357
|
+
return /** @type{Element} */(n);
|
358
|
+
}
|
443
359
|
}
|
444
|
-
n = n.parentNode;
|
360
|
+
n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
|
445
361
|
}
|
446
362
|
return null;
|
447
363
|
};
|
364
|
+
/** @public
|
365
|
+
* @function
|
366
|
+
* @ignore
|
367
|
+
* @param {Event} e
|
368
|
+
*/
|
369
|
+
Util._preventDefault = function (e) {
|
370
|
+
e.preventDefault();
|
371
|
+
e.stopPropagation();
|
372
|
+
};
|
448
373
|
|
449
374
|
/** @public
|
450
375
|
* @type {boolean}
|
@@ -1786,6 +1711,13 @@ CellFloatingPanel.prototype._items = [];
|
|
1786
1711
|
CellFloatingPanel.prototype.hasItem = function () {
|
1787
1712
|
return !!this._items.length;
|
1788
1713
|
};
|
1714
|
+
/** @public
|
1715
|
+
* @param {Element} icon Element of item
|
1716
|
+
* @returns {boolean}
|
1717
|
+
*/
|
1718
|
+
CellFloatingPanel.prototype.containItem = function (icon) {
|
1719
|
+
return this._items.indexOf(icon) > -1;
|
1720
|
+
};
|
1789
1721
|
/** @public
|
1790
1722
|
* @param {Element} item
|
1791
1723
|
* @param {number=} opt_order The greater the order, the farther the position to the right
|
@@ -2270,6 +2202,9 @@ Cell.prototype.updateIcon = function(icon) {
|
|
2270
2202
|
|
2271
2203
|
var fi = this._frontIcon;
|
2272
2204
|
if (fi) {
|
2205
|
+
if(fi.containItem(icon)) { // Check same icon which duplicate with insertItem in _frontIcon
|
2206
|
+
return;
|
2207
|
+
}
|
2273
2208
|
fi.clearItems();
|
2274
2209
|
}
|
2275
2210
|
this.insertFrontIcon(icon, 0);
|
@@ -4202,8 +4137,9 @@ ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPosit
|
|
4202
4137
|
* @ignore
|
4203
4138
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
4204
4139
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
4140
|
+
* @param {number=} topPx Top position of bound
|
4205
4141
|
*/
|
4206
|
-
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {};
|
4142
|
+
ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
|
4207
4143
|
|
4208
4144
|
/* harmony default export */ const grid_ILayoutGrid = (ILayoutGrid);
|
4209
4145
|
|
@@ -5013,7 +4949,11 @@ StretchedCells.prototype.setCellCount = function (count) {
|
|
5013
4949
|
* @return {Cell}
|
5014
4950
|
*/
|
5015
4951
|
StretchedCells.prototype.getCell = function (rowIndex) {
|
5016
|
-
|
4952
|
+
var cell = this._cells[rowIndex];
|
4953
|
+
if(cell && cell["getParent"]()) {
|
4954
|
+
return cell;
|
4955
|
+
}
|
4956
|
+
return null;
|
5017
4957
|
};
|
5018
4958
|
/** @public
|
5019
4959
|
* @ignore
|
@@ -5060,13 +5000,13 @@ StretchedCells.prototype.getColumnIndex = function (cellRef) {
|
|
5060
5000
|
StretchedCells.prototype.getRowIndex = function (cellRef) {
|
5061
5001
|
if(cellRef) {
|
5062
5002
|
if(cellRef["getElement"]) {
|
5063
|
-
return this._cells.indexOf(cellRef);
|
5003
|
+
return cellRef["getParent"]() ? this._cells.indexOf(cellRef) : -1;
|
5064
5004
|
} else {
|
5065
5005
|
var cells = this._cells;
|
5066
5006
|
var rowCount = cells.length;
|
5067
5007
|
for(var r = 0; r < rowCount; ++r) {
|
5068
5008
|
var cell = cells[r];
|
5069
|
-
if(cell && cell["getElement"]() === cellRef) {
|
5009
|
+
if(cell && cell["getParent"]() && cell["getElement"]() === cellRef) {
|
5070
5010
|
return r;
|
5071
5011
|
}
|
5072
5012
|
}
|
@@ -5082,7 +5022,7 @@ StretchedCells.prototype.getRowIndex = function (cellRef) {
|
|
5082
5022
|
* @return {Cell}
|
5083
5023
|
*/
|
5084
5024
|
StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
5085
|
-
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not
|
5025
|
+
// Increase the active count regardless of redundancy. This acts as a dirty flag. It does not need to be accurate
|
5086
5026
|
++this._activeCount;
|
5087
5027
|
if(!colIndex || colIndex < 0) {
|
5088
5028
|
colIndex = 0;
|
@@ -5097,7 +5037,17 @@ StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
|
|
5097
5037
|
}
|
5098
5038
|
var cellElem = cell["getElement"]();
|
5099
5039
|
cellElem["stretched"] = true;
|
5100
|
-
cellElem._colIndex
|
5040
|
+
if(cellElem._colIndex !== colIndex) {
|
5041
|
+
cellElem._colIndex = colIndex;
|
5042
|
+
if(colIndex > 0) {
|
5043
|
+
cellElem.classList.add("right-stretching");
|
5044
|
+
} else {
|
5045
|
+
cellElem.classList.remove("right-stretching");
|
5046
|
+
}
|
5047
|
+
}
|
5048
|
+
if(cellElem._rowIndex !== rowIndex) {
|
5049
|
+
cellElem._rowIndex = rowIndex;
|
5050
|
+
}
|
5101
5051
|
|
5102
5052
|
var width = this._stretchSize || this._trackX.getTrackSize();
|
5103
5053
|
_updateXAxis(cell, this._trackX, colIndex, width);
|
@@ -8323,10 +8273,8 @@ LayoutGrid.prototype._updateColumnLayout = function () {
|
|
8323
8273
|
/** @public
|
8324
8274
|
* @ignore
|
8325
8275
|
* @param {boolean} enabled
|
8326
|
-
* @param {number=} fromR
|
8327
|
-
* @param {number=} toR
|
8328
8276
|
*/
|
8329
|
-
LayoutGrid.prototype._startBindingSession = function (enabled
|
8277
|
+
LayoutGrid.prototype._startBindingSession = function (enabled) {
|
8330
8278
|
// Prevent error when calling _startBindingSession in LayoutGrid
|
8331
8279
|
};
|
8332
8280
|
/** @public
|
@@ -9543,8 +9491,14 @@ LayoutGrid.prototype.moveColumn = function (from, to) {
|
|
9543
9491
|
|
9544
9492
|
util.moveArrayItem(this._columns, from, to);
|
9545
9493
|
|
9546
|
-
|
9547
|
-
|
9494
|
+
if(movedColumn.getElement().offsetParent) {
|
9495
|
+
var siblingIndex = to + 1;
|
9496
|
+
var nextSibling = this._columns[siblingIndex] || null;
|
9497
|
+
while (nextSibling && !nextSibling.getElement().offsetParent) {
|
9498
|
+
nextSibling = this._columns[++siblingIndex];
|
9499
|
+
}
|
9500
|
+
movedColumn.insertBefore(nextSibling);
|
9501
|
+
}
|
9548
9502
|
|
9549
9503
|
this._updateColumnIndices();
|
9550
9504
|
this._updateCellSpans(cellSpans, true); // Restore all styling
|
@@ -9763,6 +9717,10 @@ LayoutGrid.prototype.updateStretchedCells = function () {
|
|
9763
9717
|
* @return {number}
|
9764
9718
|
*/
|
9765
9719
|
LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
9720
|
+
if(this._frozenLayout) {
|
9721
|
+
return this._stretchedCells.getStretchSize();
|
9722
|
+
}
|
9723
|
+
|
9766
9724
|
var ctx = this._ctx;
|
9767
9725
|
var stretchSize = forceRecal ? 0 : this._stretchedCells.getStretchSize();
|
9768
9726
|
if(!stretchSize && ctx) {
|
@@ -9770,9 +9728,6 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
|
|
9770
9728
|
var contentWidth = this.getContentWidth();
|
9771
9729
|
stretchSize = ctx["getWidth"]();
|
9772
9730
|
if(stretchSize) { // Grid may not be in the document
|
9773
|
-
if(!ctx.hasClass("no-borders")) {
|
9774
|
-
stretchSize -= 1;
|
9775
|
-
}
|
9776
9731
|
if(contentWidth < stretchSize) { // If view width is larger than actual content
|
9777
9732
|
stretchSize = contentWidth;
|
9778
9733
|
}
|
@@ -10120,8 +10075,9 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
|
|
10120
10075
|
* @ignore
|
10121
10076
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
10122
10077
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
10078
|
+
* @param {number=} topPx Top position of bound
|
10123
10079
|
*/
|
10124
|
-
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
10080
|
+
LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
10125
10081
|
var columnBound = this._columnBound;
|
10126
10082
|
if(!columnBound) {
|
10127
10083
|
return;
|
@@ -10138,7 +10094,9 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
|
10138
10094
|
columnBound.style.left = lftPx + "px";
|
10139
10095
|
columnBound.style.width = (rgtPx - lftPx) + "px";
|
10140
10096
|
|
10141
|
-
|
10097
|
+
topPx = topPx || 0;
|
10098
|
+
columnBound.style.top = topPx + "px";
|
10099
|
+
columnBound.style.height = (this._trackY.getTrackSize() - topPx) + "px";
|
10142
10100
|
columnBound.classList.toggle("no-left-bound", noBorders[0]);
|
10143
10101
|
columnBound.classList.toggle("no-right-bound", noBorders[1]);
|
10144
10102
|
if(this._boundLayer) {
|
@@ -11945,6 +11903,10 @@ Segment.prototype._collapsed = false;
|
|
11945
11903
|
* @private
|
11946
11904
|
*/
|
11947
11905
|
Segment.prototype._value = 0;
|
11906
|
+
/** @type {number}
|
11907
|
+
* @private
|
11908
|
+
*/
|
11909
|
+
Segment.prototype._order = 0;
|
11948
11910
|
|
11949
11911
|
|
11950
11912
|
/** @public
|
@@ -12112,6 +12074,18 @@ Segment.prototype.getValue = function() {
|
|
12112
12074
|
Segment.prototype.setValue = function(val) {
|
12113
12075
|
this._value = val;
|
12114
12076
|
};
|
12077
|
+
/** @public
|
12078
|
+
* @return {number}
|
12079
|
+
*/
|
12080
|
+
Segment.prototype.getOrder = function() {
|
12081
|
+
return this._order;
|
12082
|
+
};
|
12083
|
+
/** @public
|
12084
|
+
* @param {number} val
|
12085
|
+
*/
|
12086
|
+
Segment.prototype.setOrder = function(val) {
|
12087
|
+
this._order = val;
|
12088
|
+
};
|
12115
12089
|
|
12116
12090
|
|
12117
12091
|
/* harmony default export */ const data_Segment = (Segment);
|
@@ -12158,6 +12132,7 @@ SegmentCollection.prototype.addSegment = function(rid) {
|
|
12158
12132
|
if(rid && !this._segments[rid]) {
|
12159
12133
|
if(this._childToSegmentId[rid]) {
|
12160
12134
|
console.log("child of a segment cannot be set as a segment separator");
|
12135
|
+
return false;
|
12161
12136
|
}
|
12162
12137
|
this._segments[rid] = new data_Segment(rid);
|
12163
12138
|
++this._segmentCount;
|
@@ -12488,8 +12463,27 @@ SegmentCollection.prototype.fillSegments = function(rids) {
|
|
12488
12463
|
return change;
|
12489
12464
|
};
|
12490
12465
|
/** @public
|
12466
|
+
* @param {Array.<string>} rids
|
12467
|
+
*/
|
12468
|
+
SegmentCollection.prototype.calcSegmentOrder = function(rids) {
|
12469
|
+
var ridCount = rids ? rids.length : 0;
|
12470
|
+
var segmentSeparators = this._segments;
|
12471
|
+
var segmentCount = this._segmentCount;
|
12472
|
+
var order = 0;
|
12473
|
+
for(var i = 0; i < ridCount; ++i) {
|
12474
|
+
var rid = rids[i];
|
12475
|
+
var segment = segmentSeparators[rid];
|
12476
|
+
if(segment) {
|
12477
|
+
segment.setOrder(++order);
|
12478
|
+
if(order >= segmentCount) {
|
12479
|
+
break;
|
12480
|
+
}
|
12481
|
+
}
|
12482
|
+
}
|
12483
|
+
};
|
12484
|
+
/** @public
|
12491
12485
|
* @param {!Array.<string>} rids Array of row ids
|
12492
|
-
* @return {Array.<number>} Returns Array of segment values, if there are at least
|
12486
|
+
* @return {Array.<number>} Returns Array of segment values, if there are at least one segment, otherwise returns null
|
12493
12487
|
*/
|
12494
12488
|
SegmentCollection.prototype.getSegmentValues = function(rids) {
|
12495
12489
|
var rowCount = rids ? rids.length : 0;
|
@@ -12499,51 +12493,33 @@ SegmentCollection.prototype.getSegmentValues = function(rids) {
|
|
12499
12493
|
var segmentSeparators = this._segments;
|
12500
12494
|
var childToSegmentId = this._childToSegmentId;
|
12501
12495
|
var curSegment = null;
|
12496
|
+
var prevSegment = null;
|
12502
12497
|
var segmentValues = new Array(rowCount);
|
12503
|
-
var curSegmentCount = 0;
|
12504
12498
|
var segmentVal = 0;
|
12505
|
-
var
|
12506
|
-
var
|
12507
|
-
while(r < rowCount) {
|
12499
|
+
var offset = 0;
|
12500
|
+
for(var r = 0; r < rowCount; ++r) {
|
12508
12501
|
var rid = rids[r];
|
12509
|
-
|
12510
|
-
|
12511
|
-
|
12512
|
-
segmentVal += 100;
|
12513
|
-
segmentValues[r] = segmentVal;
|
12514
|
-
curSegment.setValue(segmentVal);
|
12515
|
-
if(curSegmentCount >= this._segmentCount) {
|
12516
|
-
++r;
|
12517
|
-
break;
|
12518
|
-
}
|
12502
|
+
curSegment = segmentSeparators[rid];
|
12503
|
+
if(curSegment) {
|
12504
|
+
offset = 0;
|
12519
12505
|
} else {
|
12520
|
-
|
12521
|
-
|
12506
|
+
var parentId = childToSegmentId[rid];
|
12507
|
+
if(parentId) {
|
12508
|
+
curSegment = segmentSeparators[parentId];
|
12509
|
+
offset = 1;
|
12522
12510
|
} else {
|
12523
|
-
|
12524
|
-
}
|
12525
|
-
if(childToSegmentId[rid]) {
|
12526
|
-
childToIndex[rid] = r;
|
12527
|
-
}
|
12528
|
-
}
|
12529
|
-
++r;
|
12530
|
-
}
|
12531
|
-
if(curSegmentCount) {
|
12532
|
-
while(r < rowCount) {
|
12533
|
-
rid = rids[r];
|
12534
|
-
segmentValues[r] = segmentVal + 10;
|
12535
|
-
if(childToSegmentId[rid]) {
|
12536
|
-
childToIndex[rid] = r;
|
12511
|
+
offset = prevSegment ? 10 : 0;
|
12537
12512
|
}
|
12538
|
-
++r;
|
12539
12513
|
}
|
12540
|
-
|
12541
|
-
|
12542
|
-
|
12514
|
+
|
12515
|
+
if(curSegment && prevSegment !== curSegment) {
|
12516
|
+
prevSegment = curSegment;
|
12517
|
+
segmentVal = curSegment.getOrder() * 100;
|
12543
12518
|
}
|
12519
|
+
segmentValues[r] = segmentVal + offset;
|
12544
12520
|
}
|
12545
12521
|
|
12546
|
-
return
|
12522
|
+
return prevSegment ? segmentValues : null;
|
12547
12523
|
};
|
12548
12524
|
|
12549
12525
|
|
@@ -12799,7 +12775,15 @@ DataTable.prototype.setRowData = function(rid, values, eventArg) { // Data chang
|
|
12799
12775
|
this._prevData[rid] = this._rows[rid]; // Move reference from the removed row to history
|
12800
12776
|
delete this._rows[rid];
|
12801
12777
|
if(this._segments) {
|
12802
|
-
|
12778
|
+
var segment = this._segments.getSegment(rid);
|
12779
|
+
if(segment) {
|
12780
|
+
if(this._segments.removeSegment(rid)) {
|
12781
|
+
segmentChanged = true;
|
12782
|
+
if(!this._segments.getSegmentCount()) {
|
12783
|
+
this._segments = null;
|
12784
|
+
}
|
12785
|
+
}
|
12786
|
+
}
|
12803
12787
|
}
|
12804
12788
|
for(var i = this._rids.length; --i >= 0;) {
|
12805
12789
|
if(this._rids[i] === rid) {
|
@@ -13107,6 +13091,7 @@ DataTable.prototype.removeRows = function(refs) {
|
|
13107
13091
|
this._prevData[rid] = this._rows[rid];
|
13108
13092
|
this._removedRows[rid] = 1;
|
13109
13093
|
delete this._rows[rid];
|
13094
|
+
// TODO: remove segments
|
13110
13095
|
dirty = true;
|
13111
13096
|
}
|
13112
13097
|
}
|
@@ -13203,6 +13188,7 @@ DataTable.prototype.moveRow = function(fromIndex, toIndex, suppressEvent) {
|
|
13203
13188
|
|
13204
13189
|
if(output) {
|
13205
13190
|
if(this._segments) {
|
13191
|
+
this._segments.calcSegmentOrder(this._rids);
|
13206
13192
|
this._sort(null); // Reorder segment members
|
13207
13193
|
}
|
13208
13194
|
this._dispatchPositionChange(suppressEvent);
|
@@ -13432,12 +13418,19 @@ DataTable.prototype.isFrozen = function() {
|
|
13432
13418
|
DataTable.prototype.setSegmentSeparator = function(rid, enabled) {
|
13433
13419
|
var change = false;
|
13434
13420
|
var memberCount = 0;
|
13435
|
-
if(typeof rid === "string") {
|
13421
|
+
if(rid && typeof rid === "string") {
|
13436
13422
|
if(enabled !== false) {
|
13437
13423
|
if(!this._segments) {
|
13438
13424
|
this._segments = new data_SegmentCollection();
|
13439
13425
|
}
|
13426
|
+
if(this._autoSegmentFilling) {
|
13427
|
+
var parentId = this._segments.getParentRowId(rid);
|
13428
|
+
if(parentId) {
|
13429
|
+
this._segments.removeSegmentChild(parentId, rid);
|
13430
|
+
}
|
13431
|
+
}
|
13440
13432
|
if(this._segments.addSegment(rid)) {
|
13433
|
+
this._segments.calcSegmentOrder(this._rids);
|
13441
13434
|
change = true;
|
13442
13435
|
}
|
13443
13436
|
} else if(this._segments) {
|
@@ -13739,6 +13732,7 @@ DataTable.prototype.sortSegments = function (compare) {
|
|
13739
13732
|
}
|
13740
13733
|
|
13741
13734
|
if(dirty) {
|
13735
|
+
this._segments.calcSegmentOrder(rids);
|
13742
13736
|
this._sort(null);
|
13743
13737
|
this._dispatchPositionChange();
|
13744
13738
|
}
|
@@ -14002,18 +13996,33 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
14002
13996
|
return null;
|
14003
13997
|
}
|
14004
13998
|
|
13999
|
+
var sortLogic;
|
14005
14000
|
// Populate data for each definition
|
14006
14001
|
for(var c = 0; c < defCount; ++c) {
|
14007
14002
|
var sortingDef = sortingDefs[c];
|
14008
|
-
var columnId = sortingDef[0];
|
14009
14003
|
var rows = sortingDef[1];
|
14010
|
-
|
14011
|
-
|
14012
|
-
|
14013
|
-
|
14014
|
-
|
14015
|
-
|
14016
|
-
|
14004
|
+
sortLogic = sortingDef[2];
|
14005
|
+
var rowSorting = sortLogic["rowSorting"];
|
14006
|
+
var r;
|
14007
|
+
if(rowSorting) {
|
14008
|
+
if(rows) {
|
14009
|
+
rows.length = rowCount;
|
14010
|
+
for(r = 0; r < rowCount; ++r) {
|
14011
|
+
rows[r] = dataRows[r];
|
14012
|
+
}
|
14013
|
+
} else {
|
14014
|
+
rows = sortingDef[1] = dataRows;
|
14015
|
+
}
|
14016
|
+
} else {
|
14017
|
+
if(rows) {
|
14018
|
+
rows.length = rowCount;
|
14019
|
+
} else {
|
14020
|
+
rows = sortingDef[1] = new Array(rowCount);
|
14021
|
+
}
|
14022
|
+
var columnId = sortingDef[0];
|
14023
|
+
for(r = 0; r < rowCount; ++r) {
|
14024
|
+
rows[r] = dataRows[r][columnId];
|
14025
|
+
}
|
14017
14026
|
}
|
14018
14027
|
}
|
14019
14028
|
|
@@ -14039,7 +14048,7 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
|
|
14039
14048
|
}
|
14040
14049
|
|
14041
14050
|
var sortOrder = 0;
|
14042
|
-
var
|
14051
|
+
var sortContext;
|
14043
14052
|
if(defCount > 1) {
|
14044
14053
|
sortLogic = DataTable._multiColumnCompareLogic;
|
14045
14054
|
sortContext = sortingDefs;
|
@@ -16970,45 +16979,65 @@ DataView.prototype.isSorting = function() {
|
|
16970
16979
|
|
16971
16980
|
/** Hide rows in the data view
|
16972
16981
|
* @param {string|number} rId Row id to hide. If the rId is a number, it will be treated as a row index
|
16973
|
-
* @param {boolean=}
|
16982
|
+
* @param {boolean=} hidden=true If the value is false, the specified row will be shown.
|
16974
16983
|
* @public
|
16975
16984
|
*/
|
16976
|
-
DataView.prototype.hideRow = function(rId,
|
16977
|
-
this.
|
16985
|
+
DataView.prototype.hideRow = function(rId, hidden) {
|
16986
|
+
this.hideRows([rId], hidden);
|
16978
16987
|
};
|
16979
16988
|
/** Hide rows in the data view
|
16980
16989
|
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
16981
|
-
* @param {boolean=}
|
16982
|
-
* @public
|
16983
|
-
*/
|
16984
|
-
DataView.prototype.hideRows = function(rowRefs, opt_show) {
|
16985
|
-
this.showRows(rowRefs, opt_show === false);
|
16986
|
-
};
|
16987
|
-
/**
|
16988
|
-
* Show/hide rows in the data view
|
16989
|
-
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
16990
|
-
* @param {boolean=} opt_show hide instead show if false
|
16990
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
16991
16991
|
* @public
|
16992
16992
|
*/
|
16993
|
-
DataView.prototype.
|
16994
|
-
|
16993
|
+
DataView.prototype.hideRows = function(rowRefs, hidden) {
|
16994
|
+
hidden = hidden !== false;
|
16995
|
+
var dirty = false;
|
16996
|
+
var rids = this._toRowIds(rowRefs);
|
16997
|
+
var hiddenRids = this._hiddenRids;
|
16998
|
+
|
16995
16999
|
if(hidden){
|
16996
|
-
if(!
|
16997
|
-
this._hiddenRids = {};
|
17000
|
+
if(!hiddenRids) {
|
17001
|
+
hiddenRids = this._hiddenRids = {};
|
16998
17002
|
}
|
16999
|
-
} else if(!
|
17003
|
+
} else if(!hiddenRids) {
|
17000
17004
|
return; // All rows are visible
|
17001
17005
|
}
|
17002
17006
|
|
17003
|
-
var rids = this._toRowIds(rowRefs);
|
17004
17007
|
for(var i = rids.length; --i >= 0;) {
|
17005
17008
|
var rid = rids[i];
|
17006
17009
|
if(rid) { // undefined, null, and an empty string value are not a valid row id
|
17007
|
-
|
17010
|
+
if(!!hiddenRids[rid] !== hidden) {
|
17011
|
+
hiddenRids[rid] = hidden;
|
17012
|
+
dirty = true;
|
17013
|
+
}
|
17008
17014
|
}
|
17009
17015
|
}
|
17010
17016
|
|
17011
|
-
|
17017
|
+
if(dirty) {
|
17018
|
+
if(!hidden) {
|
17019
|
+
var hasHiddenRow = false;
|
17020
|
+
for(var key in hiddenRids) {
|
17021
|
+
if(hiddenRids[key]) {
|
17022
|
+
hasHiddenRow = true;
|
17023
|
+
break;
|
17024
|
+
}
|
17025
|
+
}
|
17026
|
+
if(!hasHiddenRow) {
|
17027
|
+
hiddenRids = this._hiddenRids = null;
|
17028
|
+
}
|
17029
|
+
}
|
17030
|
+
this._refreshAndNotify(); // Very slow
|
17031
|
+
}
|
17032
|
+
};
|
17033
|
+
/**
|
17034
|
+
* Show/hide rows in the data view
|
17035
|
+
* @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
|
17036
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
17037
|
+
* @public
|
17038
|
+
*/
|
17039
|
+
DataView.prototype.showRows = function(rowRefs, shown) {
|
17040
|
+
this.hideRows(rowRefs, shown === false);
|
17012
17041
|
};
|
17013
17042
|
/** Unhide all rows
|
17014
17043
|
* @public
|
@@ -17024,7 +17053,7 @@ DataView.prototype.unhideAllRows = function(){
|
|
17024
17053
|
* @return {boolean}
|
17025
17054
|
*/
|
17026
17055
|
DataView.prototype.hasHiddenRow = function(){
|
17027
|
-
return
|
17056
|
+
return this._hiddenRids ? true : false;
|
17028
17057
|
};
|
17029
17058
|
|
17030
17059
|
/** @public
|
@@ -22163,12 +22192,22 @@ VirtualizedLayoutGrid.prototype.updateLayout = function () {
|
|
22163
22192
|
/** {@link ILayoutGrid#stretchCell}
|
22164
22193
|
* @inheritDoc */
|
22165
22194
|
VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching, onlyToTheRight) {
|
22166
|
-
|
22195
|
+
var stretchedCell = this._grid.stretchCell(
|
22167
22196
|
cellRef,
|
22168
22197
|
(rowIndex != null) ? rowIndex - this._firstIndex : null,
|
22169
22198
|
opt_stretching,
|
22170
22199
|
onlyToTheRight
|
22171
22200
|
);
|
22201
|
+
|
22202
|
+
if (stretchedCell){
|
22203
|
+
var cellElem = stretchedCell.getElement();
|
22204
|
+
if(rowIndex === 0) {
|
22205
|
+
cellElem.classList.add("top");
|
22206
|
+
} else {
|
22207
|
+
cellElem.classList.remove("top");
|
22208
|
+
}
|
22209
|
+
}
|
22210
|
+
return stretchedCell;
|
22172
22211
|
};
|
22173
22212
|
|
22174
22213
|
/** {@link ILayoutGrid#unstretchCell}
|
@@ -22387,9 +22426,10 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
|
|
22387
22426
|
* @ignore
|
22388
22427
|
* @param {!Array.<number>} positions Left and right bound positions in pixel
|
22389
22428
|
* @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
|
22429
|
+
* @param {number=} topPx Top position of bound
|
22390
22430
|
*/
|
22391
|
-
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
|
22392
|
-
this._grid.updateColumnBounds(positions, noBorders);
|
22431
|
+
VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
|
22432
|
+
this._grid.updateColumnBounds(positions, noBorders, topPx);
|
22393
22433
|
this._updateRowBounds();
|
22394
22434
|
};
|
22395
22435
|
/** @private
|
@@ -22579,10 +22619,9 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22579
22619
|
|
22580
22620
|
|
22581
22621
|
;// CONCATENATED MODULE: ./src/js/grid/Core.js
|
22582
|
-
/* eslint-disable */
|
22583
|
-
|
22584
22622
|
|
22585
22623
|
|
22624
|
+
// eslint-disable-line
|
22586
22625
|
|
22587
22626
|
|
22588
22627
|
|
@@ -22594,7 +22633,6 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22594
22633
|
|
22595
22634
|
|
22596
22635
|
|
22597
|
-
/* eslint-enable */
|
22598
22636
|
|
22599
22637
|
//#region Events
|
22600
22638
|
/** @event Core#sectionAdded */
|
@@ -22632,6 +22670,15 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
|
|
22632
22670
|
*/
|
22633
22671
|
//#endregion Events
|
22634
22672
|
|
22673
|
+
/** @private
|
22674
|
+
* @param {number} a
|
22675
|
+
* @param {number} b
|
22676
|
+
* @return {number}
|
22677
|
+
*/
|
22678
|
+
var ascNumberSorter = function (a, b) {
|
22679
|
+
return a - b;
|
22680
|
+
};
|
22681
|
+
|
22635
22682
|
/** @constructor
|
22636
22683
|
* @param {Element=} opt_initializer this can be either element id (string) or DOM element.
|
22637
22684
|
* @extends {ElementWrapper}
|
@@ -22769,7 +22816,8 @@ var Core_Core = function (opt_initializer) {
|
|
22769
22816
|
"rowAdded",
|
22770
22817
|
"rowRemoved",
|
22771
22818
|
"columnPositionChanged",
|
22772
|
-
"rowPositionChanged"
|
22819
|
+
"rowPositionChanged",
|
22820
|
+
"beforeColumnBoundUpdate"
|
22773
22821
|
);
|
22774
22822
|
|
22775
22823
|
// For debugging in advanced optimization mode
|
@@ -22789,13 +22837,13 @@ var Core_Core = function (opt_initializer) {
|
|
22789
22837
|
Core_Core._runningGridId++;
|
22790
22838
|
|
22791
22839
|
// init hiddenInput for retrieve copy and cut event
|
22792
|
-
var hiddenInput = document.createElement(
|
22793
|
-
hiddenInput.style.position =
|
22794
|
-
hiddenInput.style.width =
|
22795
|
-
hiddenInput.style.height =
|
22796
|
-
hiddenInput.style.padding =
|
22797
|
-
hiddenInput.style.border =
|
22798
|
-
hiddenInput.value =
|
22840
|
+
var hiddenInput = document.createElement("input");
|
22841
|
+
hiddenInput.style.position = "absolute";
|
22842
|
+
hiddenInput.style.width = "0";
|
22843
|
+
hiddenInput.style.height = "0";
|
22844
|
+
hiddenInput.style.padding = "0";
|
22845
|
+
hiddenInput.style.border = "0";
|
22846
|
+
hiddenInput.value = "0";
|
22799
22847
|
_t._hiddenInput = hiddenInput;
|
22800
22848
|
elem.insertBefore(hiddenInput, elem.firstChild);
|
22801
22849
|
|
@@ -23101,7 +23149,7 @@ Core_Core.prototype._rowHeightTimerId = 0;
|
|
23101
23149
|
* @return {string}
|
23102
23150
|
*/
|
23103
23151
|
Core_Core.getVersion = function () {
|
23104
|
-
return "5.
|
23152
|
+
return "5.1.20";
|
23105
23153
|
};
|
23106
23154
|
/** {@link ElementWrapper#dispose}
|
23107
23155
|
* @override
|
@@ -23265,6 +23313,9 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
|
|
23265
23313
|
if(this.hasClass("no-horizontal-grid-line")) {
|
23266
23314
|
obj["horizontalLines"] = false;
|
23267
23315
|
}
|
23316
|
+
if(this.hasClass("no-content-vertical-line")) {
|
23317
|
+
obj["contentVerticalLines"] = false;
|
23318
|
+
}
|
23268
23319
|
if(this._bottomPaddingSect) {
|
23269
23320
|
obj["contentBottomPadding"] = this._bottomPadding;
|
23270
23321
|
}
|
@@ -24098,13 +24149,118 @@ Core_Core.prototype.isColumnMoveAllowed = function (fromColIndex, toColIndex) {
|
|
24098
24149
|
return true;
|
24099
24150
|
};
|
24100
24151
|
|
24152
|
+
/** This method is used for checking movability of column.
|
24153
|
+
* @public
|
24154
|
+
* @param {number} colIndex Index of the column.
|
24155
|
+
* @return {boolean} Return true if the column moving is movable, and false otherwise
|
24156
|
+
*/
|
24157
|
+
Core_Core.prototype.isColumnMovable = function (colIndex) {
|
24158
|
+
var stationaryIndex = this.getStationaryColumnIndex();
|
24159
|
+
|
24160
|
+
if (stationaryIndex > -1) {
|
24161
|
+
if (colIndex <= stationaryIndex) {
|
24162
|
+
return false;
|
24163
|
+
}
|
24164
|
+
}
|
24165
|
+
|
24166
|
+
return true;
|
24167
|
+
};
|
24168
|
+
|
24101
24169
|
/** @public
|
24102
|
-
* @param {number} fromCol INCLUSIVE
|
24170
|
+
* @param {number|Array.<number>} fromCol INCLUSIVE index/indices of the column to be moved
|
24103
24171
|
* @param {number} destCol INCLUSIVE
|
24104
24172
|
* @return {boolean} Return true if there is any change, and false otherwise
|
24105
24173
|
* @fires Core#columnMoved
|
24106
24174
|
*/
|
24107
24175
|
Core_Core.prototype.moveColumn = function (fromCol, destCol) {
|
24176
|
+
if(typeof fromCol === "number") {
|
24177
|
+
return this._moveColumn(fromCol, destCol);
|
24178
|
+
}
|
24179
|
+
if(!Array.isArray(fromCol)) {
|
24180
|
+
return false;
|
24181
|
+
}
|
24182
|
+
|
24183
|
+
// Validate user inputs
|
24184
|
+
var i;
|
24185
|
+
var len = fromCol.length;
|
24186
|
+
var colIndices = [];
|
24187
|
+
var colIndex = 0;
|
24188
|
+
var colCount = this.getColumnCount();
|
24189
|
+
var dict = {};
|
24190
|
+
for(i = 0; i < len; ++i) {
|
24191
|
+
colIndex = fromCol[i];
|
24192
|
+
if(colIndex >= 0 && colIndex < colCount) { // Filter out invalid index
|
24193
|
+
if(dict[colIndex] == null) { // Remove duplication
|
24194
|
+
dict[colIndex] = 1;
|
24195
|
+
colIndices.push(colIndex);
|
24196
|
+
}
|
24197
|
+
}
|
24198
|
+
}
|
24199
|
+
if (destCol < 0) {
|
24200
|
+
destCol = 0;
|
24201
|
+
} else if (destCol >= colCount) {
|
24202
|
+
destCol = colCount - 1;
|
24203
|
+
}
|
24204
|
+
|
24205
|
+
// Skip unneccessary cases
|
24206
|
+
len = colIndices.length;
|
24207
|
+
if(!len) {
|
24208
|
+
return false;
|
24209
|
+
}
|
24210
|
+
if(len === 1) {
|
24211
|
+
return this._moveColumn(colIndices[0], destCol);
|
24212
|
+
}
|
24213
|
+
if(!this.isColumnMoveAllowed(colIndices, destCol)) {
|
24214
|
+
return false;
|
24215
|
+
}
|
24216
|
+
|
24217
|
+
colIndices.sort(ascNumberSorter);
|
24218
|
+
if(dict[destCol]) { // Destination falls in the same place as source columns
|
24219
|
+
// Check if source columns are in continuous sequence
|
24220
|
+
var continuousSequence = true;
|
24221
|
+
colIndex = colIndices[0];
|
24222
|
+
for(i = 1; i < len; ++i) {
|
24223
|
+
if(++colIndex !== colIndices[i]) {
|
24224
|
+
continuousSequence = false;
|
24225
|
+
break;
|
24226
|
+
}
|
24227
|
+
}
|
24228
|
+
if(continuousSequence) {
|
24229
|
+
return false; // No moving operation is required
|
24230
|
+
}
|
24231
|
+
}
|
24232
|
+
var prevState = this.freezeLayout(true);
|
24233
|
+
|
24234
|
+
// Start moving multiple items
|
24235
|
+
var rhsCount = 0;
|
24236
|
+
var srcIndex, destIndex;
|
24237
|
+
// Perform move operation on the right hand side
|
24238
|
+
for(i = 0; i < len; ++i) {
|
24239
|
+
srcIndex = colIndices[i];
|
24240
|
+
if(srcIndex >= destCol) {
|
24241
|
+
destIndex = destCol + rhsCount;
|
24242
|
+
this._moveColumn(srcIndex, destIndex);
|
24243
|
+
++rhsCount;
|
24244
|
+
}
|
24245
|
+
}
|
24246
|
+
// Perform move operation on the left hand side
|
24247
|
+
var lhsCount = len - rhsCount;
|
24248
|
+
destIndex = rhsCount ? destCol - 1 : destCol;
|
24249
|
+
for(i = 0; i < lhsCount; ++i) {
|
24250
|
+
srcIndex = colIndices[i] - i;
|
24251
|
+
this._moveColumn(srcIndex, destIndex);
|
24252
|
+
}
|
24253
|
+
|
24254
|
+
this.freezeLayout(prevState);
|
24255
|
+
return true;
|
24256
|
+
};
|
24257
|
+
/** @private
|
24258
|
+
* @param {number} fromCol INCLUSIVE
|
24259
|
+
* @param {number} destCol INCLUSIVE
|
24260
|
+
* @return {boolean} Return true if there is any change, and false otherwise
|
24261
|
+
* @fires Core#columnMoved
|
24262
|
+
*/
|
24263
|
+
Core_Core.prototype._moveColumn = function (fromCol, destCol) {
|
24108
24264
|
var colCount = this.getColumnCount();
|
24109
24265
|
if (fromCol < 0) { fromCol = 0; }
|
24110
24266
|
else if (fromCol >= colCount) { fromCol = colCount - 1; }
|
@@ -24189,6 +24345,7 @@ Core_Core.prototype.moveColumn = function (fromCol, destCol) {
|
|
24189
24345
|
this._colVirtualizer.update();
|
24190
24346
|
}
|
24191
24347
|
}
|
24348
|
+
this._updateColumnBounds();
|
24192
24349
|
return true;
|
24193
24350
|
};
|
24194
24351
|
|
@@ -25395,6 +25552,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
|
|
25395
25552
|
|
25396
25553
|
/** Deprecated
|
25397
25554
|
* @public
|
25555
|
+
* @ignore
|
25398
25556
|
* @function
|
25399
25557
|
* @param {boolean=} opt_shown
|
25400
25558
|
* @see {@link Core#toggleBorders}
|
@@ -25402,6 +25560,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
|
|
25402
25560
|
Core_Core.prototype.showBorders = util._deprecatedFunction;
|
25403
25561
|
/** Deprecated
|
25404
25562
|
* @public
|
25563
|
+
* @ignore
|
25405
25564
|
* @function
|
25406
25565
|
* @param {boolean=} opt_hidden
|
25407
25566
|
* @see {@link Core#toggleBorders}
|
@@ -25435,6 +25594,14 @@ Core_Core.prototype.toggleVerticalLines = function(forcedVal) {
|
|
25435
25594
|
Core_Core.prototype.toggleHorizontalLines = function(forcedVal) {
|
25436
25595
|
this.toggleClass("no-horizontal-grid-line", forcedVal != null ? !forcedVal : null);
|
25437
25596
|
};
|
25597
|
+
/** Toggle vertical gridlines. This applies to ONLY content sections.
|
25598
|
+
* @public
|
25599
|
+
* @param {boolean=} forcedVal If value is true, show horizontal lines, otherwise hide them
|
25600
|
+
*/
|
25601
|
+
Core_Core.prototype.toggleContentVerticalLines = function(forcedVal) {
|
25602
|
+
this.toggleClass("no-content-vertical-line", forcedVal != null ? !forcedVal : null);
|
25603
|
+
};
|
25604
|
+
|
25438
25605
|
|
25439
25606
|
/** @public
|
25440
25607
|
* @return {Array.<string>}
|
@@ -26250,18 +26417,18 @@ Core_Core.prototype.isBinding = function() {
|
|
26250
26417
|
};
|
26251
26418
|
|
26252
26419
|
/**
|
26253
|
-
* Hide
|
26420
|
+
* Hide the specified rows by row id
|
26254
26421
|
* @param {number | string} rowId rowId of the row to hide
|
26255
|
-
* @param {boolean=} hidden
|
26422
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
26256
26423
|
* @public
|
26257
26424
|
*/
|
26258
26425
|
Core_Core.prototype.hideRow = function (rowId, hidden) {
|
26259
26426
|
this._dataSource.hideRow(rowId, hidden);
|
26260
26427
|
};
|
26261
26428
|
/**
|
26262
|
-
* Hide
|
26429
|
+
* Hide the specified rows by rowIds
|
26263
26430
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to hide
|
26264
|
-
* @param {boolean=} hidden
|
26431
|
+
* @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
|
26265
26432
|
* @public
|
26266
26433
|
*/
|
26267
26434
|
Core_Core.prototype.hideRows = function (rowIds, hidden) {
|
@@ -26273,9 +26440,9 @@ Core_Core.prototype.hideRows = function (rowIds, hidden) {
|
|
26273
26440
|
};
|
26274
26441
|
|
26275
26442
|
/**
|
26276
|
-
* Show
|
26443
|
+
* Show the specified rows by rowIds. To show all rows, use unhideAllRows method for better performance.
|
26277
26444
|
* @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to show
|
26278
|
-
* @param {boolean=} shown
|
26445
|
+
* @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
|
26279
26446
|
* @public
|
26280
26447
|
*/
|
26281
26448
|
Core_Core.prototype.showRows = function (rowIds, shown) {
|
@@ -26296,7 +26463,7 @@ Core_Core.prototype.unhideAllRows = function () {
|
|
26296
26463
|
|
26297
26464
|
/**
|
26298
26465
|
* @public
|
26299
|
-
* @
|
26466
|
+
* @return {boolean}
|
26300
26467
|
*/
|
26301
26468
|
Core_Core.prototype.hasHiddenRow = function () {
|
26302
26469
|
return this._dataSource.hasHiddenRow();
|
@@ -26375,10 +26542,22 @@ Core_Core.prototype._updateColumnBounds = function () {
|
|
26375
26542
|
return;
|
26376
26543
|
}
|
26377
26544
|
|
26545
|
+
var colCount = this.getColumnCount();
|
26546
|
+
var colIndices = [];
|
26547
|
+
var i;
|
26548
|
+
for(i = 0; i < colCount; i++) {
|
26549
|
+
if(this.isSelectedColumn(i)) {
|
26550
|
+
colIndices.push(i);
|
26551
|
+
}
|
26552
|
+
}
|
26553
|
+
var arg = {
|
26554
|
+
selectedColumns: colIndices
|
26555
|
+
};
|
26556
|
+
this._dispatch("beforeColumnBoundUpdate", arg);
|
26557
|
+
|
26378
26558
|
var len = this.getColumnCount();
|
26379
26559
|
var lftIdx = -1;
|
26380
26560
|
var rgtIdx = -1;
|
26381
|
-
var i;
|
26382
26561
|
for(i = 0; i < len; ++i) {
|
26383
26562
|
if(this.isSelectedColumn(i)) {
|
26384
26563
|
rgtIdx = i;
|
@@ -26389,12 +26568,17 @@ Core_Core.prototype._updateColumnBounds = function () {
|
|
26389
26568
|
}
|
26390
26569
|
var sectCount = this._settings.length;
|
26391
26570
|
if(sectCount) {
|
26392
|
-
var
|
26571
|
+
var sectionSetting = this._settings[0];
|
26572
|
+
var section = sectionSetting.getSection();
|
26393
26573
|
var positions = [0, 0];
|
26394
26574
|
var noBorders = [false, false];
|
26395
26575
|
section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
|
26396
|
-
|
26397
|
-
|
26576
|
+
var topPx = 0;
|
26577
|
+
if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
|
26578
|
+
topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
|
26579
|
+
}
|
26580
|
+
section.updateColumnBounds(positions, noBorders, topPx);
|
26581
|
+
for(i = 1; i < sectCount; i++) {
|
26398
26582
|
section = this._settings[i].getSection();
|
26399
26583
|
section.updateColumnBounds(positions, noBorders);
|
26400
26584
|
}
|
@@ -27564,6 +27748,10 @@ Core_Core.prototype._updateScrollbarHeight = function (paneChanged, contentChang
|
|
27564
27748
|
* @param {boolean} contentChanged
|
27565
27749
|
*/
|
27566
27750
|
Core_Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
|
27751
|
+
if (this._frozenLayout) {
|
27752
|
+
return;
|
27753
|
+
}
|
27754
|
+
|
27567
27755
|
if (paneChanged && this._hScrollbarEnabled) {
|
27568
27756
|
// Scroll Frame
|
27569
27757
|
var gridElem = this.getElement();
|
@@ -27768,7 +27956,7 @@ Core_Core.prototype._updateLayout = function () {
|
|
27768
27956
|
this._syncLayoutToColumns(); // Update only if need
|
27769
27957
|
|
27770
27958
|
this._updateScrollbarHeight(true, true);
|
27771
|
-
this._updateScrollbarWidth(true, true);
|
27959
|
+
this._updateScrollbarWidth(true, true); // WARNING this may be redundant with _syncLayoutToColumns
|
27772
27960
|
|
27773
27961
|
var sectionCount = this.getSectionCount();
|
27774
27962
|
for (var s = 0; s < sectionCount; ++s) {
|
@@ -27900,7 +28088,7 @@ SortableTitlePlugin.ColumnOptions;
|
|
27900
28088
|
* @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
|
27901
28089
|
* @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
|
27902
28090
|
* @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.
|
27903
|
-
* @property {boolean=} disableDoubleClickToSort=
|
28091
|
+
* @property {boolean=} disableDoubleClickToSort=true If disabled, double click will trigger sorting operation
|
27904
28092
|
* @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
|
27905
28093
|
* @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.
|
27906
28094
|
* @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
|
@@ -27910,7 +28098,8 @@ SortableTitlePlugin.ColumnOptions;
|
|
27910
28098
|
* @property {Function=} preClicked A shortcut to define the preClicked event handler
|
27911
28099
|
* @property {Function=} clicked A shortcut to define the clicked event handler
|
27912
28100
|
* @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
|
27913
|
-
* @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option
|
28101
|
+
* @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
|
28102
|
+
* @property {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
27914
28103
|
*/
|
27915
28104
|
SortableTitlePlugin.Options;
|
27916
28105
|
|
@@ -27939,7 +28128,7 @@ SortableTitlePlugin.prototype._dataSorting = true;
|
|
27939
28128
|
/** @private
|
27940
28129
|
* @type {boolean}
|
27941
28130
|
*/
|
27942
|
-
SortableTitlePlugin.prototype.
|
28131
|
+
SortableTitlePlugin.prototype._dblClickAllowed = false;
|
27943
28132
|
|
27944
28133
|
/** @private
|
27945
28134
|
* @type {number}
|
@@ -28082,19 +28271,20 @@ SortableTitlePlugin.prototype.unload = function (host) {
|
|
28082
28271
|
SortableTitlePlugin.prototype.afterInit = function () {
|
28083
28272
|
var t = this;
|
28084
28273
|
|
28085
|
-
//
|
28274
|
+
// Set logic to the data source, since the data source not available during the initialization
|
28086
28275
|
t.setSortLogics(t._sortLogic);
|
28087
28276
|
|
28088
|
-
|
28089
|
-
if (
|
28090
|
-
|
28091
|
-
|
28092
|
-
|
28093
|
-
|
28094
|
-
|
28095
|
-
|
28277
|
+
var userInput = t._initialSort;
|
28278
|
+
if (userInput != null) {
|
28279
|
+
if(Array.isArray(userInput)) {
|
28280
|
+
if(t._maxCount === 1) { // TODO: max count could be part of sortColumns method
|
28281
|
+
t.sortColumns(userInput.slice(0, 1));
|
28282
|
+
} else {
|
28283
|
+
t.sortColumns(userInput);
|
28284
|
+
}
|
28285
|
+
} else {
|
28286
|
+
t.sortColumns([userInput]);
|
28096
28287
|
}
|
28097
|
-
t.sortColumns(initialSort);
|
28098
28288
|
}
|
28099
28289
|
};
|
28100
28290
|
|
@@ -28272,7 +28462,9 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
|
|
28272
28462
|
if(this._maxCount !== 1) {
|
28273
28463
|
extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
|
28274
28464
|
}
|
28275
|
-
|
28465
|
+
if(this._dblClickAllowed) {
|
28466
|
+
extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
|
28467
|
+
}
|
28276
28468
|
extOptions["sortableColumns"] = this._sortableColumns;
|
28277
28469
|
extOptions["indicatorOnly"] = !this._dataSorting;
|
28278
28470
|
// extOptions["mode"] = this._mode;
|
@@ -28645,9 +28837,10 @@ SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
|
|
28645
28837
|
* @public
|
28646
28838
|
* @param {number} colIndex
|
28647
28839
|
* @param {string|null} field A field used for sorting
|
28648
|
-
* @param {Function=} sortLogic
|
28840
|
+
* @param {Function=} sortLogic=null
|
28841
|
+
* @param {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
|
28649
28842
|
*/
|
28650
|
-
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic) {
|
28843
|
+
SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic, rowSorting) {
|
28651
28844
|
if (typeof colIndex == "number" && field != null) {
|
28652
28845
|
var options = this._newSortOptions(colIndex);
|
28653
28846
|
if (!field) {
|
@@ -28659,6 +28852,9 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
|
|
28659
28852
|
if(sortLogic != null && !this._userManagedLogic) {
|
28660
28853
|
if (options["sortLogic"] !== sortLogic) {
|
28661
28854
|
options["sortLogic"] = sortLogic || null;
|
28855
|
+
if(rowSorting && sortLogic) {
|
28856
|
+
sortLogic["rowSorting"] = true; // Tell data view/table about the argument
|
28857
|
+
}
|
28662
28858
|
}
|
28663
28859
|
}
|
28664
28860
|
}
|
@@ -28758,10 +28954,10 @@ SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
|
|
28758
28954
|
};
|
28759
28955
|
/** @public
|
28760
28956
|
* @description To allow double click action to sort. Default value is false.
|
28761
|
-
* @param {boolean=} disabled
|
28957
|
+
* @param {boolean=} disabled=false
|
28762
28958
|
*/
|
28763
28959
|
SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
|
28764
|
-
this.
|
28960
|
+
this._dblClickAllowed = !disabled;
|
28765
28961
|
};
|
28766
28962
|
/** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
|
28767
28963
|
* @public
|
@@ -28807,54 +29003,26 @@ SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
|
|
28807
29003
|
this._delayInterval = (opt_ms != null) ? opt_ms : 500;
|
28808
29004
|
};
|
28809
29005
|
|
28810
|
-
/** @private
|
28811
|
-
* @description Pre-process columns options to support both composite and rt-grid backward compatible
|
28812
|
-
* @param {number} colIndex
|
28813
|
-
* @param {Object} options
|
28814
|
-
* @returns {Object}
|
28815
|
-
*/
|
28816
|
-
SortableTitlePlugin.prototype._prepareColumnOptions = function (colIndex, options) {
|
28817
|
-
var t = this;
|
28818
|
-
var column = options || {};
|
28819
|
-
var colOption = {
|
28820
|
-
"colIndex": colIndex,
|
28821
|
-
"field": column["field"],
|
28822
|
-
"sortable": !!t._sortableColumns
|
28823
|
-
};
|
28824
|
-
|
28825
|
-
if (column["sortBy"] != null) { // composite grid option
|
28826
|
-
colOption["sortable"] = !!column["sortBy"];
|
28827
|
-
colOption["sortBy"] = column["sortBy"];
|
28828
|
-
}
|
28829
|
-
if (column["sortable"] != null) { // rt grid option
|
28830
|
-
colOption["sortable"] = !!column["sortable"];
|
28831
|
-
}
|
28832
|
-
|
28833
|
-
colOption["sortLogic"] = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
28834
|
-
colOption["sort"] = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
28835
|
-
return colOption;
|
28836
|
-
};
|
28837
|
-
|
28838
29006
|
/** @private
|
28839
29007
|
* @description Get initial sort from column option `defaultSort` or `sort`
|
28840
29008
|
* @param {Object} options Core model object
|
28841
29009
|
* @returns {Object}
|
28842
29010
|
*/
|
28843
29011
|
SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
|
28844
|
-
var
|
28845
|
-
var
|
28846
|
-
var
|
28847
|
-
|
28848
|
-
var
|
28849
|
-
|
28850
|
-
|
28851
|
-
|
28852
|
-
"colIndex":
|
28853
|
-
"sortOrder":
|
29012
|
+
var columns = options["columns"];
|
29013
|
+
var colCount = columns ? columns.length : 0;
|
29014
|
+
for (var i = 0; i < colCount; i++) {
|
29015
|
+
var column = columns[i];
|
29016
|
+
var sortOrder = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
|
29017
|
+
if (sortOrder) {
|
29018
|
+
// TODO: Support multi-column sorting
|
29019
|
+
return {
|
29020
|
+
"colIndex": i,
|
29021
|
+
"sortOrder": sortOrder
|
28854
29022
|
};
|
28855
29023
|
}
|
28856
29024
|
}
|
28857
|
-
return
|
29025
|
+
return null;
|
28858
29026
|
};
|
28859
29027
|
|
28860
29028
|
/** @private
|
@@ -28965,7 +29133,7 @@ SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
|
|
28965
29133
|
if(this._disabled) {
|
28966
29134
|
return;
|
28967
29135
|
}
|
28968
|
-
if (e.detail === 2 && this.
|
29136
|
+
if (e.detail === 2 && !this._dblClickAllowed) { // dblclick
|
28969
29137
|
if (this._clickTimer) {
|
28970
29138
|
clearTimeout(this._clickTimer);
|
28971
29139
|
this._clickTimer = 0;
|
@@ -29243,18 +29411,35 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
|
|
29243
29411
|
SortableTitlePlugin.prototype._onColumnAdded = function (e) {
|
29244
29412
|
var t = this;
|
29245
29413
|
var colIndex = e["colIndex"];
|
29246
|
-
var
|
29247
|
-
|
29248
|
-
var
|
29249
|
-
var
|
29414
|
+
var column = e["context"] || {};
|
29415
|
+
|
29416
|
+
var sortable = !!t._sortableColumns;
|
29417
|
+
var field = column["field"];
|
29418
|
+
var sortBy = column["sortBy"];
|
29250
29419
|
|
29251
|
-
|
29420
|
+
if (sortBy != null) { // composite grid option
|
29421
|
+
sortable = !!sortBy;
|
29422
|
+
field = sortBy;
|
29423
|
+
}
|
29424
|
+
if (column["sortable"] != null) { // rt grid option
|
29425
|
+
sortable = !!column["sortable"];
|
29426
|
+
}
|
29427
|
+
|
29428
|
+
var sortLogic = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
|
29429
|
+
if(!sortLogic) {
|
29430
|
+
sortLogic = t._sortLogic[field];
|
29431
|
+
}
|
29432
|
+
if(typeof sortLogic !== "function") {
|
29433
|
+
sortLogic = null;
|
29434
|
+
}
|
29435
|
+
|
29436
|
+
var sortingSequence = column["sortingSequence"];
|
29252
29437
|
if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
|
29253
29438
|
t.setSortingSequence(sortingSequence, field);
|
29254
29439
|
}
|
29255
29440
|
|
29256
|
-
if (
|
29257
|
-
t.setColumnSortingField(colIndex, field,
|
29441
|
+
if (sortable) { // TODO: Check if empty field should be sortable
|
29442
|
+
t.setColumnSortingField(colIndex, field, sortLogic, column["rowSorting"]);
|
29258
29443
|
} else {
|
29259
29444
|
t.disableColumnSorting(colIndex, true);
|
29260
29445
|
}
|
@@ -29608,6 +29793,7 @@ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
|
|
29608
29793
|
|
29609
29794
|
|
29610
29795
|
|
29796
|
+
|
29611
29797
|
// tsd-disable
|
29612
29798
|
var tr = window["tr"];
|
29613
29799
|
if(!tr) {
|
@@ -29631,6 +29817,7 @@ tr.ColumnStats = data_ColumnStats;
|
|
29631
29817
|
tr.DataCache = data_DataCache;
|
29632
29818
|
tr.DataTable = data_DataTable;
|
29633
29819
|
tr.DataView = data_DataView;
|
29820
|
+
tr.SegmentCollection = data_SegmentCollection;
|
29634
29821
|
|
29635
29822
|
// Components
|
29636
29823
|
grid.CellFloatingPanel = components_CellFloatingPanel;
|