@refinitiv-ui/efx-grid 6.0.39 → 6.0.41
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-selection-dialog/lib/column-selection-dialog.d.ts +2 -1
 - package/lib/column-selection-dialog/lib/column-selection-dialog.js +23 -7
 - package/lib/core/dist/core.js +39 -28
 - package/lib/core/dist/core.min.js +1 -1
 - package/lib/core/es6/grid/Core.js +34 -26
 - package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +5 -2
 - package/lib/grid/index.js +1 -1
 - package/lib/row-segmenting/es6/RowSegmenting.js +4 -4
 - package/lib/rt-grid/dist/rt-grid.js +2191 -1780
 - package/lib/rt-grid/dist/rt-grid.min.js +1 -1
 - package/lib/rt-grid/es6/ColumnDefinition.d.ts +1 -0
 - package/lib/rt-grid/es6/ColumnDefinition.js +7 -8
 - package/lib/rt-grid/es6/Grid.d.ts +2 -0
 - package/lib/rt-grid/es6/Grid.js +91 -30
 - package/lib/rt-grid/es6/RowDefinition.d.ts +4 -5
 - package/lib/rt-grid/es6/RowDefinition.js +103 -52
 - package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +26 -40
 - package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +27 -27
 - package/lib/tr-grid-contextmenu/es6/ContextMenu.js +97 -93
 - package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +3 -3
 - package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +2 -2
 - package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +5 -5
 - package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +30 -12
 - package/lib/tr-grid-row-dragging/es6/RowDragging.js +2 -1
 - package/lib/tr-grid-rowcoloring/es6/RowColoring.js +50 -18
 - package/lib/tr-grid-util/es6/CellPainter.d.ts +2 -1
 - package/lib/tr-grid-util/es6/CellPainter.js +6 -4
 - package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
 - package/lib/tr-grid-util/es6/ExpressionParser.js +366 -0
 - package/lib/tr-grid-util/es6/FilterBuilder.d.ts +10 -6
 - package/lib/tr-grid-util/es6/FilterBuilder.js +264 -234
 - package/lib/tr-grid-util/es6/FilterOperators.d.ts +3 -1
 - package/lib/tr-grid-util/es6/FilterOperators.js +51 -2
 - package/lib/tr-grid-util/es6/Util.d.ts +0 -3
 - package/lib/tr-grid-util/es6/Util.js +0 -53
 - package/lib/tr-grid-util/es6/formula/Formula.js +3 -3
 - package/lib/types/es6/ColumnDragging.d.ts +51 -0
 - package/lib/types/es6/ContextMenu.d.ts +27 -27
 - package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +3 -0
 - package/lib/types/es6/ExtensionOptions.d.ts +2 -0
 - package/lib/types/es6/Extensions.d.ts +3 -1
 - package/lib/types/es6/MenuEventAPI.d.ts +3 -3
 - package/lib/types/es6/MenuItem.d.ts +2 -2
 - package/lib/types/es6/PopupMenu.d.ts +5 -5
 - package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +1 -0
 - package/lib/types/es6/RealtimeGrid/Grid.d.ts +2 -0
 - package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -5
 - package/lib/types/es6/index.d.ts +1 -0
 - package/lib/versions.json +10 -10
 - package/package.json +1 -1
 
| 
         @@ -30,7 +30,8 @@ import Engine from "../../tr-grid-util/es6/formula/Engine.js"; 
     | 
|
| 
       30 
30 
     | 
    
         
             
            * @property {ColumnDefinition~SortLogic=} sorter=null Alias to `sortLogic`
         
     | 
| 
       31 
31 
     | 
    
         
             
            * @property {boolean=} rowSorting=null If set to true, RowDefinition object will be used for sorting comparison. If set to false, data from the given `field` will be used for sorting comparison.
         
     | 
| 
       32 
32 
     | 
    
         
             
            * @property {boolean=} sortable=true If disabled, the column cannot be sorted by user click
         
     | 
| 
       33 
     | 
    
         
            -
            * @property {string=} sort=""  
     | 
| 
      
 33 
     | 
    
         
            +
            * @property {string=} sort="" Deprecated Alias to `sortOrder`
         
     | 
| 
      
 34 
     | 
    
         
            +
            * @property {string=} sortOrder="" The column can be sorted in ascending and descending order by specifying the order "a", "d". This option will sort the column when it is initialized or inserted at runtime.
         
     | 
| 
       34 
35 
     | 
    
         
             
            * @property {Object=} styles=null Key/value pair Object specifying CSS styles
         
     | 
| 
       35 
36 
     | 
    
         
             
            * @property {number=} width=NaN If specified, column will have a fixed width in pixel
         
     | 
| 
       36 
37 
     | 
    
         
             
            * @property {number=} minWidth=NaN If specified, column will have a minimum width in pixel
         
     | 
| 
         @@ -408,7 +409,7 @@ ColumnDefinition.prototype.initialize = function(columnOption) { 
     | 
|
| 
       408 
409 
     | 
    
         
             
            	}
         
     | 
| 
       409 
410 
     | 
    
         | 
| 
       410 
411 
     | 
    
         
             
            	// Deprecate
         
     | 
| 
       411 
     | 
    
         
            -
            	val = columnOption["sort"];
         
     | 
| 
      
 412 
     | 
    
         
            +
            	val = columnOption["sortOrder"] || columnOption["sort"];
         
     | 
| 
       412 
413 
     | 
    
         
             
            	if(val) {
         
     | 
| 
       413 
414 
     | 
    
         
             
            		this._initialOrder = val;
         
     | 
| 
       414 
415 
     | 
    
         
             
            	}
         
     | 
| 
         @@ -658,11 +659,13 @@ ColumnDefinition.prototype.isScalable = function() { 
     | 
|
| 
       658 
659 
     | 
    
         
             
            	var colIndex = grid.getColumnIndex(this);
         
     | 
| 
       659 
660 
     | 
    
         
             
            	return core.getColumnScalability(colIndex);
         
     | 
| 
       660 
661 
     | 
    
         
             
            };
         
     | 
| 
       661 
     | 
    
         
            -
            /**  
     | 
| 
       662 
     | 
    
         
            -
             
     | 
| 
      
 662 
     | 
    
         
            +
            /** Deprecated, this function will be return initial sort order of this column, The current sort state may be different from initial sort state.
         
     | 
| 
      
 663 
     | 
    
         
            +
            * @public
         
     | 
| 
      
 664 
     | 
    
         
            +
            * @deprecated
         
     | 
| 
       663 
665 
     | 
    
         
             
            * @return {string}
         
     | 
| 
       664 
666 
     | 
    
         
             
            */
         
     | 
| 
       665 
667 
     | 
    
         
             
            ColumnDefinition.prototype.getInitialSortOrder = function() {
         
     | 
| 
      
 668 
     | 
    
         
            +
            	// WARNING: This state is different from `sortOrder`, it is the state when grid is initialized.
         
     | 
| 
       666 
669 
     | 
    
         
             
            	return this._initialOrder;
         
     | 
| 
       667 
670 
     | 
    
         
             
            };
         
     | 
| 
       668 
671 
     | 
    
         
             
            /** @public
         
     | 
| 
         @@ -766,10 +769,6 @@ ColumnDefinition.prototype.getConfigObject = function(colOptions) { 
     | 
|
| 
       766 
769 
     | 
    
         
             
            		obj["sortable"] = false;
         
     | 
| 
       767 
770 
     | 
    
         
             
            	}
         
     | 
| 
       768 
771 
     | 
    
         | 
| 
       769 
     | 
    
         
            -
            	if(this._initialOrder) {
         
     | 
| 
       770 
     | 
    
         
            -
            		obj["sort"] = this._initialOrder;
         
     | 
| 
       771 
     | 
    
         
            -
            	}
         
     | 
| 
       772 
     | 
    
         
            -
             
     | 
| 
       773 
772 
     | 
    
         
             
            	var classes = this._classes;
         
     | 
| 
       774 
773 
     | 
    
         
             
            	if(classes && classes.length > 0) {
         
     | 
| 
       775 
774 
     | 
    
         
             
            		obj["className"] = classes.join(" ");
         
     | 
    
        package/lib/rt-grid/es6/Grid.js
    CHANGED
    
    | 
         @@ -230,6 +230,45 @@ var compareNumber = function(rowDefA, rowDefB, sortOrder, fieldName) { // edit n 
     | 
|
| 
       230 
230 
     | 
    
         
             
            	return (rowDefA.getData(fieldName) - rowDefB.getData(fieldName)) * sortOrder; // for numeric comparison
         
     | 
| 
       231 
231 
     | 
    
         
             
            };
         
     | 
| 
       232 
232 
     | 
    
         | 
| 
      
 233 
     | 
    
         
            +
            /**
         
     | 
| 
      
 234 
     | 
    
         
            +
             * @private
         
     | 
| 
      
 235 
     | 
    
         
            +
            * @param {string} rowDefA
         
     | 
| 
      
 236 
     | 
    
         
            +
            * @param {string} rowDefB
         
     | 
| 
      
 237 
     | 
    
         
            +
            * @param {string} sortOrder
         
     | 
| 
      
 238 
     | 
    
         
            +
            * @return {number} The outcome of the value comparison
         
     | 
| 
      
 239 
     | 
    
         
            +
            */
         
     | 
| 
      
 240 
     | 
    
         
            +
            var _sortChildrenOfChain =  function (rowDefA, rowDefB, sortOrder) {
         
     | 
| 
      
 241 
     | 
    
         
            +
            	var parentA = rowDefA.getParent();
         
     | 
| 
      
 242 
     | 
    
         
            +
             
     | 
| 
      
 243 
     | 
    
         
            +
            	if (!parentA) {
         
     | 
| 
      
 244 
     | 
    
         
            +
            	  return 0;
         
     | 
| 
      
 245 
     | 
    
         
            +
            	}
         
     | 
| 
      
 246 
     | 
    
         
            +
             
     | 
| 
      
 247 
     | 
    
         
            +
            	var parentB = rowDefB.getParent();
         
     | 
| 
      
 248 
     | 
    
         
            +
             
     | 
| 
      
 249 
     | 
    
         
            +
            	if (!parentB) {
         
     | 
| 
      
 250 
     | 
    
         
            +
            	  return 0;
         
     | 
| 
      
 251 
     | 
    
         
            +
            	}
         
     | 
| 
      
 252 
     | 
    
         
            +
             
     | 
| 
      
 253 
     | 
    
         
            +
            	if (parentA !== parentB) {
         
     | 
| 
      
 254 
     | 
    
         
            +
            	  return 0;
         
     | 
| 
      
 255 
     | 
    
         
            +
            	}
         
     | 
| 
      
 256 
     | 
    
         
            +
             
     | 
| 
      
 257 
     | 
    
         
            +
            	var a = rowDefA.getData('CHILD_ORDER');
         
     | 
| 
      
 258 
     | 
    
         
            +
             
     | 
| 
      
 259 
     | 
    
         
            +
            	if (a == null) {
         
     | 
| 
      
 260 
     | 
    
         
            +
            	  return 0;
         
     | 
| 
      
 261 
     | 
    
         
            +
            	}
         
     | 
| 
      
 262 
     | 
    
         
            +
             
     | 
| 
      
 263 
     | 
    
         
            +
            	var b = rowDefB.getData('CHILD_ORDER');
         
     | 
| 
      
 264 
     | 
    
         
            +
             
     | 
| 
      
 265 
     | 
    
         
            +
            	if (b == null) {
         
     | 
| 
      
 266 
     | 
    
         
            +
            	  return 0;
         
     | 
| 
      
 267 
     | 
    
         
            +
            	}
         
     | 
| 
      
 268 
     | 
    
         
            +
             
     | 
| 
      
 269 
     | 
    
         
            +
            	return ( a - b ) * sortOrder;
         
     | 
| 
      
 270 
     | 
    
         
            +
            };
         
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
       233 
272 
     | 
    
         
             
            /** @private
         
     | 
| 
       234 
273 
     | 
    
         
             
            * @param {ColumnDefinition} colDef
         
     | 
| 
       235 
274 
     | 
    
         
             
            * @return {string}
         
     | 
| 
         @@ -258,6 +297,7 @@ var Grid = function(placeholder, config) { 
     | 
|
| 
       258 
297 
     | 
    
         
             
            	var t = this; // This is to primarily reduce file size
         
     | 
| 
       259 
298 
     | 
    
         | 
| 
       260 
299 
     | 
    
         
             
            	t._onDataChanged = t._onDataChanged.bind(t);
         
     | 
| 
      
 300 
     | 
    
         
            +
            	t._onQuote2PostUpdate = t._onQuote2PostUpdate.bind(t);
         
     | 
| 
       261 
301 
     | 
    
         
             
            	t._onDataComposed = t._onDataComposed.bind(t);
         
     | 
| 
       262 
302 
     | 
    
         
             
            	t._onSubSegmentChanged = t._onSubSegmentChanged.bind(t);
         
     | 
| 
       263 
303 
     | 
    
         
             
            	t._recalculateFormulas = t._recalculateFormulas.bind(t);
         
     | 
| 
         @@ -616,6 +656,7 @@ Grid.prototype.initSubscription = function() { 
     | 
|
| 
       616 
656 
     | 
    
         
             
            	this._subs = s;
         
     | 
| 
       617 
657 
     | 
    
         
             
            	this._subs["start"]();
         
     | 
| 
       618 
658 
     | 
    
         
             
            	this._dc.setSubscriptions(s);
         
     | 
| 
      
 659 
     | 
    
         
            +
            	this._subs.addEventListener("postUpdate", this._onQuote2PostUpdate);
         
     | 
| 
       619 
660 
     | 
    
         | 
| 
       620 
661 
     | 
    
         
             
            	// TODO: Subscriptions should be registered per row.
         
     | 
| 
       621 
662 
     | 
    
         
             
            	// However, chain subscription cannot be integrated with DataConnector in this current implementation.
         
     | 
| 
         @@ -1528,6 +1569,9 @@ Grid.prototype.replaceColumn = function (columnOption, colRef) { 
     | 
|
| 
       1528 
1569 
     | 
    
         
             
            		colConfig["hidden"] = false;
         
     | 
| 
       1529 
1570 
     | 
    
         
             
            	}
         
     | 
| 
       1530 
1571 
     | 
    
         | 
| 
      
 1572 
     | 
    
         
            +
            	if(colConfig.id == null) {
         
     | 
| 
      
 1573 
     | 
    
         
            +
            		colConfig.id =  colDef.getId(); // retain ID
         
     | 
| 
      
 1574 
     | 
    
         
            +
            	}
         
     | 
| 
       1531 
1575 
     | 
    
         
             
            	this._grid.startBatch("reset");
         
     | 
| 
       1532 
1576 
     | 
    
         
             
            	this.insertColumn(colConfig, colIndex);
         
     | 
| 
       1533 
1577 
     | 
    
         
             
            	this.removeColumn(colIndex + 1); // remove existing column after insert
         
     | 
| 
         @@ -1678,12 +1722,6 @@ Grid.prototype.restoreColumns = function(columns) { 
     | 
|
| 
       1678 
1722 
     | 
    
         
             
            		}
         
     | 
| 
       1679 
1723 
     | 
    
         
             
            	}
         
     | 
| 
       1680 
1724 
     | 
    
         | 
| 
       1681 
     | 
    
         
            -
            	var sortingStates;
         
     | 
| 
       1682 
     | 
    
         
            -
            	var removeLen = removingFields.length;
         
     | 
| 
       1683 
     | 
    
         
            -
            	if(removeLen > 0 && this._stp) {
         
     | 
| 
       1684 
     | 
    
         
            -
            		sortingStates = this._stp.getSortingStates().slice(); // We need to clone array for avoid object reference in remove column
         
     | 
| 
       1685 
     | 
    
         
            -
            	}
         
     | 
| 
       1686 
     | 
    
         
            -
             
     | 
| 
       1687 
1725 
     | 
    
         
             
            	this.removeColumns(removingFields);
         
     | 
| 
       1688 
1726 
     | 
    
         | 
| 
       1689 
1727 
     | 
    
         
             
            	var keepingLen = keepingColumns.length;
         
     | 
| 
         @@ -1711,10 +1749,6 @@ Grid.prototype.restoreColumns = function(columns) { 
     | 
|
| 
       1711 
1749 
     | 
    
         
             
            		this._grid.freezeLayout(prevState);
         
     | 
| 
       1712 
1750 
     | 
    
         
             
            	}
         
     | 
| 
       1713 
1751 
     | 
    
         | 
| 
       1714 
     | 
    
         
            -
            	if(removeLen > 0 && this._stp) {
         
     | 
| 
       1715 
     | 
    
         
            -
            		this._stp.sortColumns(sortingStates);
         
     | 
| 
       1716 
     | 
    
         
            -
            	}
         
     | 
| 
       1717 
     | 
    
         
            -
             
     | 
| 
       1718 
1752 
     | 
    
         
             
            	grid.reorderColumns(columnOrdering);
         
     | 
| 
       1719 
1753 
     | 
    
         
             
            	grid.stopBatch("reset");
         
     | 
| 
       1720 
1754 
     | 
    
         
             
            };
         
     | 
| 
         @@ -2601,37 +2635,29 @@ Grid.prototype.hasHiddenRow = function(){ 
     | 
|
| 
       2601 
2635 
     | 
    
         
             
            /** Set RIC to the specified row
         
     | 
| 
       2602 
2636 
     | 
    
         
             
            * @public
         
     | 
| 
       2603 
2637 
     | 
    
         
             
            * @param {Grid~RowReference} rowRef
         
     | 
| 
       2604 
     | 
    
         
            -
            * @param {string} str
         
     | 
| 
      
 2638 
     | 
    
         
            +
            * @param {string} str RIC to be set to a row
         
     | 
| 
       2605 
2639 
     | 
    
         
             
            * @param {RowDefinition~Options=} options
         
     | 
| 
       2606 
2640 
     | 
    
         
             
            */
         
     | 
| 
       2607 
2641 
     | 
    
         
             
            Grid.prototype.setRic = function(rowRef, str, options) {
         
     | 
| 
       2608 
2642 
     | 
    
         
             
            	if(this._mainGrid) {
         
     | 
| 
       2609 
     | 
    
         
            -
            		this._mainGrid.setRic(this._toRowId(rowRef), str);
         
     | 
| 
      
 2643 
     | 
    
         
            +
            		this._mainGrid.setRic(this._toRowId(rowRef), str, options);
         
     | 
| 
       2610 
2644 
     | 
    
         
             
            		return;
         
     | 
| 
       2611 
2645 
     | 
    
         
             
            	}
         
     | 
| 
       2612 
2646 
     | 
    
         
             
            	var rowDef = this._getRowDefinitionByRef(rowRef);
         
     | 
| 
       2613 
2647 
     | 
    
         
             
            	if(rowDef) {
         
     | 
| 
       2614 
2648 
     | 
    
         
             
            		options = options || {};
         
     | 
| 
       2615 
     | 
    
         
            -
            		 
     | 
| 
       2616 
     | 
    
         
            -
            		 
     | 
| 
       2617 
     | 
    
         
            -
             
     | 
| 
      
 2649 
     | 
    
         
            +
            		options["ric"] = str;
         
     | 
| 
      
 2650 
     | 
    
         
            +
            		var extractedOptions = RowDefinition.extractRowOptions(options);
         
     | 
| 
      
 2651 
     | 
    
         
            +
            		var oldRic = rowDef.getSymbol();
         
     | 
| 
      
 2652 
     | 
    
         
            +
            		if(rowDef.setContent(str, extractedOptions)) { // The given string may not be a RIC
         
     | 
| 
      
 2653 
     | 
    
         
            +
            			this._connector.removeRic(rowDef, oldRic);
         
     | 
| 
      
 2654 
     | 
    
         
            +
            			this._initDuplicateRicData(rowDef);
         
     | 
| 
      
 2655 
     | 
    
         
            +
            			this._connector.addRic(rowDef);
         
     | 
| 
       2618 
2656 
     | 
    
         
             
            		}
         
     | 
| 
       2619 
     | 
    
         
            -
            		if(rowDef.isChain() || newChain) {
         
     | 
| 
       2620 
     | 
    
         
            -
            			if(rowDef.getRic() !== str.replace("0#", "")) {
         
     | 
| 
       2621 
     | 
    
         
            -
            				var rowIndex = this._dv.getRowIndex(rowDef.getRowId());
         
     | 
| 
       2622 
     | 
    
         
            -
            				this.removeRow(rowDef);
         
     | 
| 
       2623 
2657 
     | 
    
         | 
| 
       2624 
     | 
    
         
            -
             
     | 
| 
       2625 
     | 
    
         
            -
             
     | 
| 
       2626 
     | 
    
         
            -
            			 
     | 
| 
       2627 
     | 
    
         
            -
            		} else {
         
     | 
| 
       2628 
     | 
    
         
            -
            			var oldRic = rowDef.getSymbol();
         
     | 
| 
       2629 
     | 
    
         
            -
            			var permId = options["permId"] || "";
         
     | 
| 
       2630 
     | 
    
         
            -
            			if(rowDef.setContent(str, permId)) { // The given string may not be a RIC
         
     | 
| 
       2631 
     | 
    
         
            -
            				this._connector.removeRic(rowDef, oldRic);
         
     | 
| 
       2632 
     | 
    
         
            -
            				this._initDuplicateRicData(rowDef);
         
     | 
| 
       2633 
     | 
    
         
            -
            				this._connector.addRic(rowDef);
         
     | 
| 
       2634 
     | 
    
         
            -
            			}
         
     | 
| 
      
 2658 
     | 
    
         
            +
            		var values = options["values"];
         
     | 
| 
      
 2659 
     | 
    
         
            +
            		if(values != null) {
         
     | 
| 
      
 2660 
     | 
    
         
            +
            			rowDef.setStaticRowData(values, options["fields"]);
         
     | 
| 
       2635 
2661 
     | 
    
         
             
            		}
         
     | 
| 
       2636 
2662 
     | 
    
         
             
            	}
         
     | 
| 
       2637 
2663 
     | 
    
         
             
            };
         
     | 
| 
         @@ -3337,6 +3363,19 @@ Grid.prototype.clearSort = function() { 
     | 
|
| 
       3337 
3363 
     | 
    
         
             
            	this._stp.clearSortState(); // WARNING: No event is dispatched
         
     | 
| 
       3338 
3364 
     | 
    
         
             
            };
         
     | 
| 
       3339 
3365 
     | 
    
         | 
| 
      
 3366 
     | 
    
         
            +
            /**
         
     | 
| 
      
 3367 
     | 
    
         
            +
            * @private
         
     | 
| 
      
 3368 
     | 
    
         
            +
            * @param {Object} e Event object from quote2
         
     | 
| 
      
 3369 
     | 
    
         
            +
            */
         
     | 
| 
      
 3370 
     | 
    
         
            +
            Grid.prototype._onQuote2PostUpdate = function (e) {
         
     | 
| 
      
 3371 
     | 
    
         
            +
            	if(e.childOrderChange) { // For dynamic chain when CHILD_ORDER from the server change, it will be call sort children
         
     | 
| 
      
 3372 
     | 
    
         
            +
            		if(!this.isSorting()) {
         
     | 
| 
      
 3373 
     | 
    
         
            +
            			// Use rowDef for get CHILD_ORDER to sort
         
     | 
| 
      
 3374 
     | 
    
         
            +
            			this._dt.sortOnce("ROW_DEF", "a", _sortChildrenOfChain);
         
     | 
| 
      
 3375 
     | 
    
         
            +
            		}
         
     | 
| 
      
 3376 
     | 
    
         
            +
            	}
         
     | 
| 
      
 3377 
     | 
    
         
            +
            };
         
     | 
| 
      
 3378 
     | 
    
         
            +
             
     | 
| 
       3340 
3379 
     | 
    
         
             
            /** @private
         
     | 
| 
       3341 
3380 
     | 
    
         
             
            * @param {!Object} e
         
     | 
| 
       3342 
3381 
     | 
    
         
             
            */
         
     | 
| 
         @@ -3882,6 +3921,28 @@ Grid.prototype._logData = function(rowDefs, options) { 
     | 
|
| 
       3882 
3921 
     | 
    
         | 
| 
       3883 
3922 
     | 
    
         
             
            	console.table(tbl); // eslint-disable-line
         
     | 
| 
       3884 
3923 
     | 
    
         
             
            };
         
     | 
| 
      
 3924 
     | 
    
         
            +
            /** @public
         
     | 
| 
      
 3925 
     | 
    
         
            +
            * @description Replace existing row with a new row. Row ID would be changed, after row is replaced.
         
     | 
| 
      
 3926 
     | 
    
         
            +
            * @param {Grid~RowReference} rowRef Reference (i.e. row index, row id, or row definition) of the insert position
         
     | 
| 
      
 3927 
     | 
    
         
            +
            * @param {Object=} rowOption
         
     | 
| 
      
 3928 
     | 
    
         
            +
            * @returns {Object}
         
     | 
| 
      
 3929 
     | 
    
         
            +
            */
         
     | 
| 
      
 3930 
     | 
    
         
            +
            Grid.prototype.replaceRow = function(rowRef, rowOption) {
         
     | 
| 
      
 3931 
     | 
    
         
            +
            	var rowId = this._getRowId(rowRef);
         
     | 
| 
      
 3932 
     | 
    
         
            +
            	var rowDef = this._getRowDefinitionByRef(rowRef);
         
     | 
| 
      
 3933 
     | 
    
         
            +
            	if(rowDef.isAutoGenerated()) { // Users cannot replace auto-generated
         
     | 
| 
      
 3934 
     | 
    
         
            +
            		return  null;
         
     | 
| 
      
 3935 
     | 
    
         
            +
            	}
         
     | 
| 
      
 3936 
     | 
    
         
            +
            	var configObj = rowDef.getConfigObject();
         
     | 
| 
      
 3937 
     | 
    
         
            +
             
     | 
| 
      
 3938 
     | 
    
         
            +
            	if(deepEqual(configObj, rowOption)){
         
     | 
| 
      
 3939 
     | 
    
         
            +
            		return null;
         
     | 
| 
      
 3940 
     | 
    
         
            +
            	} else {
         
     | 
| 
      
 3941 
     | 
    
         
            +
            		var insertedRow = this.insertRow(rowOption, rowId);
         
     | 
| 
      
 3942 
     | 
    
         
            +
            		this.removeRow(rowId);
         
     | 
| 
      
 3943 
     | 
    
         
            +
            		return insertedRow;
         
     | 
| 
      
 3944 
     | 
    
         
            +
            	}
         
     | 
| 
      
 3945 
     | 
    
         
            +
            };
         
     | 
| 
       3885 
3946 
     | 
    
         | 
| 
       3886 
3947 
     | 
    
         
             
            export { Grid };
         
     | 
| 
       3887 
3948 
     | 
    
         
             
            export default Grid;
         
     | 
| 
         @@ -13,7 +13,8 @@ declare namespace RowDefinition { 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    chainRic?: string|null,
         
     | 
| 
       14 
14 
     | 
    
         
             
                    collapsed?: boolean|null,
         
     | 
| 
       15 
15 
     | 
    
         
             
                    label?: (string|null)|null,
         
     | 
| 
       16 
     | 
    
         
            -
                    hidden?: boolean|null
         
     | 
| 
      
 16 
     | 
    
         
            +
                    hidden?: boolean|null,
         
     | 
| 
      
 17 
     | 
    
         
            +
                    realTime?: boolean|null
         
     | 
| 
       17 
18 
     | 
    
         
             
                };
         
     | 
| 
       18 
19 
     | 
    
         | 
| 
       19 
20 
     | 
    
         
             
                type RowTypes = {
         
     | 
| 
         @@ -37,8 +38,6 @@ declare class RowDefinition { 
     | 
|
| 
       37 
38 
     | 
    
         | 
| 
       38 
39 
     | 
    
         
             
                public initialize(rowOptions?: RowDefinition.Options|null): void;
         
     | 
| 
       39 
40 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
                public setContent(userInput: string, permId?: string|null, asChain?: boolean|null, expanded?: boolean|null, realTime?: boolean|null): boolean;
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
41 
     | 
    
         
             
                public getRowId(): string;
         
     | 
| 
       43 
42 
     | 
    
         | 
| 
       44 
43 
     | 
    
         
             
                public getConfigObject(rowOptions?: RowDefinition.Options|null): RowDefinition.Options|null;
         
     | 
| 
         @@ -105,7 +104,7 @@ declare class RowDefinition { 
     | 
|
| 
       105 
104 
     | 
    
         | 
| 
       106 
105 
     | 
    
         
             
                public resetUpdates(): void;
         
     | 
| 
       107 
106 
     | 
    
         | 
| 
       108 
     | 
    
         
            -
                public registerToView(view:  
     | 
| 
      
 107 
     | 
    
         
            +
                public registerToView(view: DataView|null, rowId?: string|null): void;
         
     | 
| 
       109 
108 
     | 
    
         | 
| 
       110 
109 
     | 
    
         
             
                public static deregisterFromView(rowIds: (string)[]|null, rowDef: RowDefinition|null): (string)[]|null;
         
     | 
| 
       111 
110 
     | 
    
         | 
| 
         @@ -143,7 +142,7 @@ declare const ROW_DEF: string; 
     | 
|
| 
       143 
142 
     | 
    
         | 
| 
       144 
143 
     | 
    
         
             
            declare const ROW_TYPES: RowDefinition.RowTypes;
         
     | 
| 
       145 
144 
     | 
    
         | 
| 
       146 
     | 
    
         
            -
            declare function rowData(userInput: string,  
     | 
| 
      
 145 
     | 
    
         
            +
            declare function rowData(userInput: string, extractedOptions: any): boolean;
         
     | 
| 
       147 
146 
     | 
    
         | 
| 
       148 
147 
     | 
    
         
             
            export {RowDefinition, ROW_DEF, ROW_TYPES};
         
     | 
| 
       149 
148 
     | 
    
         
             
            export default RowDefinition;
         
     | 
| 
         @@ -15,7 +15,7 @@ import { DataTable } from "../../core/es6/data/DataTable.js"; 
     | 
|
| 
       15 
15 
     | 
    
         
             
            * @property {boolean=} collapsed=true Chain is collapsed by default
         
     | 
| 
       16 
16 
     | 
    
         
             
            * @property {(string|null)=} label=null
         
     | 
| 
       17 
17 
     | 
    
         
             
            * @property {boolean=} hidden=true When this row is hidden
         
     | 
| 
       18 
     | 
    
         
            -
            * @ 
     | 
| 
      
 18 
     | 
    
         
            +
            * @property {boolean=} realTime=true Realtime row, able to request for JET/RTK
         
     | 
| 
       19 
19 
     | 
    
         
             
            */
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            /** @typedef {Object} RowDefinition~RowTypes
         
     | 
| 
         @@ -217,6 +217,8 @@ RowDefinition.prototype.initialize = function(rowOptions) { 
     | 
|
| 
       217 
217 
     | 
    
         
             
            		return;
         
     | 
| 
       218 
218 
     | 
    
         
             
            	}
         
     | 
| 
       219 
219 
     | 
    
         | 
| 
      
 220 
     | 
    
         
            +
            	var extractedOptions = RowDefinition.extractRowOptions(rowOptions);
         
     | 
| 
      
 221 
     | 
    
         
            +
             
     | 
| 
       220 
222 
     | 
    
         
             
            	var val = rowOptions["permId"];
         
     | 
| 
       221 
223 
     | 
    
         
             
            	if(val != null) {
         
     | 
| 
       222 
224 
     | 
    
         
             
            		this._permId = val;
         
     | 
| 
         @@ -234,13 +236,8 @@ RowDefinition.prototype.initialize = function(rowOptions) { 
     | 
|
| 
       234 
236 
     | 
    
         
             
            	if(val != null) {
         
     | 
| 
       235 
237 
     | 
    
         
             
            		this._chainRic = val;
         
     | 
| 
       236 
238 
     | 
    
         
             
            	}
         
     | 
| 
       237 
     | 
    
         
            -
            	val = rowOptions["values"];
         
     | 
| 
       238 
     | 
    
         
            -
            	// eslint-disable-next-line no-undefined
         
     | 
| 
       239 
     | 
    
         
            -
            	if(val !== undefined) {
         
     | 
| 
       240 
     | 
    
         
            -
            		this.setStaticRowData(val, rowOptions["fields"]);
         
     | 
| 
       241 
     | 
    
         
            -
            	}
         
     | 
| 
       242 
239 
     | 
    
         | 
| 
       243 
     | 
    
         
            -
            	val =  
     | 
| 
      
 240 
     | 
    
         
            +
            	val = extractedOptions["asChain"];
         
     | 
| 
       244 
241 
     | 
    
         
             
            	if(val !== null) {
         
     | 
| 
       245 
242 
     | 
    
         
             
            		this._isChain = val;
         
     | 
| 
       246 
243 
     | 
    
         
             
            	}
         
     | 
| 
         @@ -251,29 +248,24 @@ RowDefinition.prototype.initialize = function(rowOptions) { 
     | 
|
| 
       251 
248 
     | 
    
         
             
            	}
         
     | 
| 
       252 
249 
     | 
    
         | 
| 
       253 
250 
     | 
    
         
             
            	val = rowOptions["collapsed"];
         
     | 
| 
       254 
     | 
    
         
            -
            	 
     | 
| 
       255 
     | 
    
         
            -
             
     | 
| 
      
 251 
     | 
    
         
            +
            	var collapsed = extractedOptions["collapsed"];
         
     | 
| 
      
 252 
     | 
    
         
            +
            	if(val != null || !collapsed){
         
     | 
| 
      
 253 
     | 
    
         
            +
            		this._expanded = !collapsed;
         
     | 
| 
       256 
254 
     | 
    
         
             
            	}
         
     | 
| 
       257 
255 
     | 
    
         
             
            	val = rowOptions["keepModel"];
         
     | 
| 
       258 
256 
     | 
    
         
             
            	if(val) {
         
     | 
| 
       259 
257 
     | 
    
         
             
            		this._userModel = rowOptions;
         
     | 
| 
       260 
258 
     | 
    
         
             
            	}
         
     | 
| 
       261 
259 
     | 
    
         | 
| 
       262 
     | 
    
         
            -
            	var expanded = this._expanded;
         
     | 
| 
       263 
260 
     | 
    
         
             
            	var symbol = this._ric || this._chainRic;
         
     | 
| 
       264 
     | 
    
         
            -
            	var asChain = this._isChain || !!this._chainRic;
         
     | 
| 
       265 
     | 
    
         
            -
            	if(this._ric && this._ric.indexOf("0#") >= 0){
         
     | 
| 
       266 
     | 
    
         
            -
            		asChain = true;
         
     | 
| 
       267 
     | 
    
         
            -
            		expanded = true;
         
     | 
| 
       268 
     | 
    
         
            -
            	}
         
     | 
| 
       269 
     | 
    
         
            -
            	if(this._isChain === false){
         
     | 
| 
       270 
     | 
    
         
            -
            		asChain = false;
         
     | 
| 
       271 
     | 
    
         
            -
            	}
         
     | 
| 
       272 
     | 
    
         
            -
            	if(this._expanded === false){
         
     | 
| 
       273 
     | 
    
         
            -
            		expanded = false;
         
     | 
| 
       274 
     | 
    
         
            -
            	}
         
     | 
| 
       275 
261 
     | 
    
         
             
            	if(symbol || this._permId){
         
     | 
| 
       276 
     | 
    
         
            -
            		this.setContent(symbol,  
     | 
| 
      
 262 
     | 
    
         
            +
            		this.setContent(symbol, extractedOptions); // this._dataId is modified
         
     | 
| 
      
 263 
     | 
    
         
            +
            	}
         
     | 
| 
      
 264 
     | 
    
         
            +
             
     | 
| 
      
 265 
     | 
    
         
            +
            	val = rowOptions["values"];
         
     | 
| 
      
 266 
     | 
    
         
            +
            	// eslint-disable-next-line no-undefined
         
     | 
| 
      
 267 
     | 
    
         
            +
            	if(val !== undefined) {
         
     | 
| 
      
 268 
     | 
    
         
            +
            		this.setStaticRowData(val, rowOptions["fields"]);
         
     | 
| 
       277 
269 
     | 
    
         
             
            	}
         
     | 
| 
       278 
270 
     | 
    
         
             
            };
         
     | 
| 
       279 
271 
     | 
    
         
             
            /** @private
         
     | 
| 
         @@ -300,14 +292,12 @@ RowDefinition.prototype._initializeAsConstituent = function(rowOptions) { 
     | 
|
| 
       300 
292 
     | 
    
         
             
            	}
         
     | 
| 
       301 
293 
     | 
    
         
             
            };
         
     | 
| 
       302 
294 
     | 
    
         
             
            /** @public
         
     | 
| 
      
 295 
     | 
    
         
            +
            * @ignore
         
     | 
| 
       303 
296 
     | 
    
         
             
            * @param {string} userInput RIC
         
     | 
| 
       304 
     | 
    
         
            -
            * @param { 
     | 
| 
       305 
     | 
    
         
            -
            * @param {boolean=} asChain
         
     | 
| 
       306 
     | 
    
         
            -
            * @param {boolean=} expanded
         
     | 
| 
       307 
     | 
    
         
            -
            * @param {boolean=} realTime
         
     | 
| 
      
 297 
     | 
    
         
            +
            * @param {Object} extractedOptions
         
     | 
| 
       308 
298 
     | 
    
         
             
            * @return {boolean} True if there is any change otherwise false
         
     | 
| 
       309 
299 
     | 
    
         
             
            */
         
     | 
| 
       310 
     | 
    
         
            -
            RowDefinition.prototype.setContent = function(userInput,  
     | 
| 
      
 300 
     | 
    
         
            +
            RowDefinition.prototype.setContent = function(userInput, extractedOptions) {
         
     | 
| 
       311 
301 
     | 
    
         
             
            	if(this._autoGenerated) { // AutoGenerated RowDefinition cannot be changed by user input
         
     | 
| 
       312 
302 
     | 
    
         
             
            		return false;
         
     | 
| 
       313 
303 
     | 
    
         
             
            	}
         
     | 
| 
         @@ -319,6 +309,7 @@ RowDefinition.prototype.setContent = function(userInput, permId, asChain, expand 
     | 
|
| 
       319 
309 
     | 
    
         
             
            	}
         
     | 
| 
       320 
310 
     | 
    
         | 
| 
       321 
311 
     | 
    
         
             
            	var dirty = (this._userInput !== userInput);
         
     | 
| 
      
 312 
     | 
    
         
            +
            	var permId = extractedOptions["permId"];
         
     | 
| 
       322 
313 
     | 
    
         
             
            	if(this._permId !== permId){
         
     | 
| 
       323 
314 
     | 
    
         
             
            		this._permId = permId || "";
         
     | 
| 
       324 
315 
     | 
    
         
             
            		dirty = true;
         
     | 
| 
         @@ -327,33 +318,42 @@ RowDefinition.prototype.setContent = function(userInput, permId, asChain, expand 
     | 
|
| 
       327 
318 
     | 
    
         
             
            		return false;
         
     | 
| 
       328 
319 
     | 
    
         
             
            	}
         
     | 
| 
       329 
320 
     | 
    
         | 
| 
       330 
     | 
    
         
            -
            	this.unsubscribeForUpdates() 
     | 
| 
      
 321 
     | 
    
         
            +
            	if(!this.unsubscribeForUpdates()){
         
     | 
| 
      
 322 
     | 
    
         
            +
            		this._clearStaticData();
         
     | 
| 
      
 323 
     | 
    
         
            +
            	}
         
     | 
| 
       331 
324 
     | 
    
         
             
            	this.resetUpdates(); // Remove all previous data updates because a new content is just entered
         
     | 
| 
       332 
325 
     | 
    
         | 
| 
       333 
     | 
    
         
            -
            	// TODO: handle changing between chain and ric row
         
     | 
| 
       334 
326 
     | 
    
         
             
            	this._userInput = userInput;
         
     | 
| 
       335 
327 
     | 
    
         
             
            	if(this._userInput.charAt(0) === "'") { // This is a row header
         
     | 
| 
       336 
328 
     | 
    
         
             
            		this._ric = this._chainRic = ""; // No ric for realtime request
         
     | 
| 
       337 
329 
     | 
    
         
             
            	} else {
         
     | 
| 
       338 
     | 
    
         
            -
            		 
     | 
| 
       339 
     | 
    
         
            -
             
     | 
| 
       340 
     | 
    
         
            -
             
     | 
| 
       341 
     | 
    
         
            -
             
     | 
| 
       342 
     | 
    
         
            -
             
     | 
| 
       343 
     | 
    
         
            -
             
     | 
| 
       344 
     | 
    
         
            -
            				this._isChain = true; // Only chain can be expanded by 0#
         
     | 
| 
       345 
     | 
    
         
            -
            				this._chainRic = this._userInput;
         
     | 
| 
       346 
     | 
    
         
            -
            				if(this._view) {
         
     | 
| 
       347 
     | 
    
         
            -
            					this._view.setSegmentSeparator(this._rowId);
         
     | 
| 
       348 
     | 
    
         
            -
            					this.expandChain();
         
     | 
| 
       349 
     | 
    
         
            -
            				}
         
     | 
| 
       350 
     | 
    
         
            -
            			}
         
     | 
| 
      
 330 
     | 
    
         
            +
            		var asChain = extractedOptions["asChain"];
         
     | 
| 
      
 331 
     | 
    
         
            +
            		var expanded = !extractedOptions["collapsed"];
         
     | 
| 
      
 332 
     | 
    
         
            +
            		var chainRic = extractedOptions["chainRic"];
         
     | 
| 
      
 333 
     | 
    
         
            +
            		if(asChain === true){
         
     | 
| 
      
 334 
     | 
    
         
            +
            			this._ric = expanded === false ? this._userInput : this._userInput.replace("0#", "");
         
     | 
| 
      
 335 
     | 
    
         
            +
            			this._expanded = expanded; // Only chain can be expanded by 0#
         
     | 
| 
       351 
336 
     | 
    
         
             
            		} else {
         
     | 
| 
       352 
337 
     | 
    
         
             
            			this._ric = this._userInput;
         
     | 
| 
       353 
     | 
    
         
            -
             
     | 
| 
       354 
     | 
    
         
            -
             
     | 
| 
      
 338 
     | 
    
         
            +
            		}
         
     | 
| 
      
 339 
     | 
    
         
            +
            		this._isChain = asChain;
         
     | 
| 
      
 340 
     | 
    
         
            +
            		this._chainRic = chainRic || "";
         
     | 
| 
      
 341 
     | 
    
         
            +
            	}
         
     | 
| 
      
 342 
     | 
    
         
            +
             
     | 
| 
      
 343 
     | 
    
         
            +
            	if(this._view) {
         
     | 
| 
      
 344 
     | 
    
         
            +
            		if(this._isChain){
         
     | 
| 
      
 345 
     | 
    
         
            +
            			var rid = this.getRowId();
         
     | 
| 
      
 346 
     | 
    
         
            +
            			var segmentId = this._view.getSegmentParentRowId(rid);
         
     | 
| 
      
 347 
     | 
    
         
            +
            			if(segmentId){
         
     | 
| 
      
 348 
     | 
    
         
            +
            				this._view.removeSegmentChild(segmentId, rid);
         
     | 
| 
       355 
349 
     | 
    
         
             
            			}
         
     | 
| 
       356 
350 
     | 
    
         
             
            		}
         
     | 
| 
      
 351 
     | 
    
         
            +
            		this._view.setSegmentSeparator(this._rowId, !!this._isChain);
         
     | 
| 
      
 352 
     | 
    
         
            +
            		if(this._expanded && this.isChainCollapsed()){
         
     | 
| 
      
 353 
     | 
    
         
            +
            			this.expandChain();
         
     | 
| 
      
 354 
     | 
    
         
            +
            		} else if (!this._expanded && this.isChainExpanded()){
         
     | 
| 
      
 355 
     | 
    
         
            +
            			this.collapseChain();
         
     | 
| 
      
 356 
     | 
    
         
            +
            		}
         
     | 
| 
       357 
357 
     | 
    
         
             
            	}
         
     | 
| 
       358 
358 
     | 
    
         | 
| 
       359 
359 
     | 
    
         
             
            	this._dataId = this._rowId + this.getSymbol(); // JET/RTK will generate data id to be rowId (given from this rowDef) + ric;
         
     | 
| 
         @@ -769,8 +769,17 @@ RowDefinition.prototype.subscribeForUpdates = function() { 
     | 
|
| 
       769 
769 
     | 
    
         
             
            	var prevRowData = this.unsubscribeForUpdates();
         
     | 
| 
       770 
770 
     | 
    
         | 
| 
       771 
771 
     | 
    
         
             
            	if(this.isChain()) {
         
     | 
| 
       772 
     | 
    
         
            -
            		 
     | 
| 
       773 
     | 
    
         
            -
            		 
     | 
| 
      
 772 
     | 
    
         
            +
            		var symbol = this._chainRic;
         
     | 
| 
      
 773 
     | 
    
         
            +
            		if(!symbol){
         
     | 
| 
      
 774 
     | 
    
         
            +
            			symbol = this._ric;
         
     | 
| 
      
 775 
     | 
    
         
            +
            			if(symbol.indexOf("0#") < 0){
         
     | 
| 
      
 776 
     | 
    
         
            +
            				var count = (symbol.match(/\./g) || []).length;
         
     | 
| 
      
 777 
     | 
    
         
            +
            				if(count < 2){
         
     | 
| 
      
 778 
     | 
    
         
            +
            					symbol = "0#" + symbol;
         
     | 
| 
      
 779 
     | 
    
         
            +
            				}
         
     | 
| 
      
 780 
     | 
    
         
            +
            			}
         
     | 
| 
      
 781 
     | 
    
         
            +
            		}
         
     | 
| 
      
 782 
     | 
    
         
            +
            		this._subId = subs["addChain"](symbol, this._rowId); // Some chain require 0# symbol to populate its constituents
         
     | 
| 
       774 
783 
     | 
    
         
             
            	} else if(this._ric) {
         
     | 
| 
       775 
784 
     | 
    
         
             
            		this._subId = subs["addRic"](this._ric, this._rowId);
         
     | 
| 
       776 
785 
     | 
    
         
             
            	}
         
     | 
| 
         @@ -798,7 +807,7 @@ RowDefinition.prototype.unsubscribeForUpdates = function() { 
     | 
|
| 
       798 
807 
     | 
    
         
             
            	this.resetUpdates();
         
     | 
| 
       799 
808 
     | 
    
         
             
            	// TODO: Reset only if this is the last ric
         
     | 
| 
       800 
809 
     | 
    
         
             
            	this._dc.setRowData(this._dataId, null); // Trigger data update immediately
         
     | 
| 
       801 
     | 
    
         
            -
            	 
     | 
| 
      
 810 
     | 
    
         
            +
            	this._clearStaticData();
         
     | 
| 
       802 
811 
     | 
    
         
             
            	// eslint-disable-next-line consistent-return
         
     | 
| 
       803 
812 
     | 
    
         
             
            	return prevRowData;
         
     | 
| 
       804 
813 
     | 
    
         
             
            };
         
     | 
| 
         @@ -847,7 +856,7 @@ RowDefinition.prototype.resetUpdates = function() { 
     | 
|
| 
       847 
856 
     | 
    
         
             
            };
         
     | 
| 
       848 
857 
     | 
    
         | 
| 
       849 
858 
     | 
    
         
             
            /** @public
         
     | 
| 
       850 
     | 
    
         
            -
            * @param { 
     | 
| 
      
 859 
     | 
    
         
            +
            * @param {DataView} view
         
     | 
| 
       851 
860 
     | 
    
         
             
            * @param {string=} rowId
         
     | 
| 
       852 
861 
     | 
    
         
             
            */
         
     | 
| 
       853 
862 
     | 
    
         
             
            RowDefinition.prototype.registerToView = function(view, rowId) {
         
     | 
| 
         @@ -964,11 +973,17 @@ RowDefinition.prototype.addConstituent = function(ric) { 
     | 
|
| 
       964 
973 
     | 
    
         
             
            	}
         
     | 
| 
       965 
974 
     | 
    
         | 
| 
       966 
975 
     | 
    
         
             
            	if(this._view) {
         
     | 
| 
       967 
     | 
    
         
            -
            		// WARNING: ChildCount may not be enough to determine proper inserting position
         
     | 
| 
       968 
     | 
    
         
            -
            		// TODO: Handle nested children
         
     | 
| 
       969 
976 
     | 
    
         
             
            		var rowId = this.getRowId();
         
     | 
| 
       970 
     | 
    
         
            -
            		 
     | 
| 
       971 
     | 
    
         
            -
            		childDef. 
     | 
| 
      
 977 
     | 
    
         
            +
            		// WARNING: insert position, we prioritize using CHILD_ORDER (From server) in dc first. If it does not exist, the last row of the segment will be pushed
         
     | 
| 
      
 978 
     | 
    
         
            +
            		var childOrder = childDef.getData("CHILD_ORDER");
         
     | 
| 
      
 979 
     | 
    
         
            +
            		var parentIndex =  this._view.getRowIndex(rowId);
         
     | 
| 
      
 980 
     | 
    
         
            +
            		var position =  parentIndex + this.getChildCount(); // push the last position
         
     | 
| 
      
 981 
     | 
    
         
            +
            		if(childOrder != null) {
         
     | 
| 
      
 982 
     | 
    
         
            +
            			// Warning: We need to carry a value of 1 because the CHILD_ORDER starts with 0, and it will be added to the parentIndex. In case the parent rowIndex is not included.
         
     | 
| 
      
 983 
     | 
    
         
            +
            			position = parentIndex + childOrder + 1; // insert between segment
         
     | 
| 
      
 984 
     | 
    
         
            +
            		} // else {} it will be push in the last row of segment
         
     | 
| 
      
 985 
     | 
    
         
            +
            		childDef.registerToView(this._view, this._view.getRowId(position));
         
     | 
| 
      
 986 
     | 
    
         
            +
            		// TODO: Handle nested children
         
     | 
| 
       972 
987 
     | 
    
         
             
            		this._view.addSegmentChild(rowId, childDef.getRowId(), childDef.getDataId());
         
     | 
| 
       973 
988 
     | 
    
         
             
            	}
         
     | 
| 
       974 
989 
     | 
    
         | 
| 
         @@ -1210,6 +1225,42 @@ RowDefinition.prototype.getUserModel = function() { 
     | 
|
| 
       1210 
1225 
     | 
    
         
             
            RowDefinition.toRowId = function(rowDef) {
         
     | 
| 
       1211 
1226 
     | 
    
         
             
            	return rowDef.getRowId();
         
     | 
| 
       1212 
1227 
     | 
    
         
             
            };
         
     | 
| 
      
 1228 
     | 
    
         
            +
            /** For transforming row options into standard format
         
     | 
| 
      
 1229 
     | 
    
         
            +
            * @public
         
     | 
| 
      
 1230 
     | 
    
         
            +
            * @ignore
         
     | 
| 
      
 1231 
     | 
    
         
            +
            * @function
         
     | 
| 
      
 1232 
     | 
    
         
            +
            * @param {RowDefinition~Options} rowOptions
         
     | 
| 
      
 1233 
     | 
    
         
            +
            * @return {RowDefinition~Options}
         
     | 
| 
      
 1234 
     | 
    
         
            +
            */
         
     | 
| 
      
 1235 
     | 
    
         
            +
            RowDefinition.extractRowOptions = function(rowOptions) {
         
     | 
| 
      
 1236 
     | 
    
         
            +
            	var ric = rowOptions["ric"];
         
     | 
| 
      
 1237 
     | 
    
         
            +
            	var permId = rowOptions["permId"];
         
     | 
| 
      
 1238 
     | 
    
         
            +
            	var chainRic = rowOptions["chainRic"];
         
     | 
| 
      
 1239 
     | 
    
         
            +
            	var collapsed = rowOptions["collapsed"];
         
     | 
| 
      
 1240 
     | 
    
         
            +
            	var asChain = rowOptions["asChain"];
         
     | 
| 
      
 1241 
     | 
    
         
            +
            	if(asChain == null && chainRic){
         
     | 
| 
      
 1242 
     | 
    
         
            +
            		asChain = true;
         
     | 
| 
      
 1243 
     | 
    
         
            +
            	}
         
     | 
| 
      
 1244 
     | 
    
         
            +
            	var expanded = null;
         
     | 
| 
      
 1245 
     | 
    
         
            +
            	if(ric && ric.indexOf("0#") >= 0){
         
     | 
| 
      
 1246 
     | 
    
         
            +
            		if(asChain == null){
         
     | 
| 
      
 1247 
     | 
    
         
            +
            			asChain = true;
         
     | 
| 
      
 1248 
     | 
    
         
            +
            		}
         
     | 
| 
      
 1249 
     | 
    
         
            +
            		expanded = true;
         
     | 
| 
      
 1250 
     | 
    
         
            +
            	}
         
     | 
| 
      
 1251 
     | 
    
         
            +
             
     | 
| 
      
 1252 
     | 
    
         
            +
            	var extractedOptions = {};
         
     | 
| 
      
 1253 
     | 
    
         
            +
            	if(collapsed == null) {
         
     | 
| 
      
 1254 
     | 
    
         
            +
            		extractedOptions["collapsed"] = !expanded;
         
     | 
| 
      
 1255 
     | 
    
         
            +
            	} else {
         
     | 
| 
      
 1256 
     | 
    
         
            +
            		extractedOptions["collapsed"] = collapsed;
         
     | 
| 
      
 1257 
     | 
    
         
            +
            	}
         
     | 
| 
      
 1258 
     | 
    
         
            +
            	extractedOptions["ric"] = ric;
         
     | 
| 
      
 1259 
     | 
    
         
            +
            	extractedOptions["permId"] = permId;
         
     | 
| 
      
 1260 
     | 
    
         
            +
            	extractedOptions["chainRic"] = chainRic;
         
     | 
| 
      
 1261 
     | 
    
         
            +
            	extractedOptions["asChain"] = asChain;
         
     | 
| 
      
 1262 
     | 
    
         
            +
            	return extractedOptions;
         
     | 
| 
      
 1263 
     | 
    
         
            +
            };
         
     | 
| 
       1213 
1264 
     | 
    
         
             
            /** For mapping row Id by Array.map()
         
     | 
| 
       1214 
1265 
     | 
    
         
             
            * @public
         
     | 
| 
       1215 
1266 
     | 
    
         
             
            * @function
         
     | 
| 
         @@ -64,10 +64,6 @@ ColumnGroupingPlugin.prototype._maxDepth = 0; 
     | 
|
| 
       64 
64 
     | 
    
         
             
            * @private
         
     | 
| 
       65 
65 
     | 
    
         
             
            */
         
     | 
| 
       66 
66 
     | 
    
         
             
            ColumnGroupingPlugin.prototype._restructuring = false;
         
     | 
| 
       67 
     | 
    
         
            -
            /** @type {boolean}
         
     | 
| 
       68 
     | 
    
         
            -
            * @private
         
     | 
| 
       69 
     | 
    
         
            -
            */
         
     | 
| 
       70 
     | 
    
         
            -
            ColumnGroupingPlugin.prototype._autoGrouping = true;
         
     | 
| 
       71 
67 
     | 
    
         
             
            /** @type {number}
         
     | 
| 
       72 
68 
     | 
    
         
             
            * @private
         
     | 
| 
       73 
69 
     | 
    
         
             
            */
         
     | 
| 
         @@ -894,9 +890,11 @@ ColumnGroupingPlugin.prototype._applyTimeSeries = function (e) { 
     | 
|
| 
       894 
890 
     | 
    
         
             
            * @param {Object} e dispatching of columnAdded event object
         
     | 
| 
       895 
891 
     | 
    
         
             
            */
         
     | 
| 
       896 
892 
     | 
    
         
             
            ColumnGroupingPlugin.prototype._onColumnAdded = function (e) {
         
     | 
| 
       897 
     | 
    
         
            -
              var  
     | 
| 
       898 
     | 
    
         
            -
               
     | 
| 
       899 
     | 
    
         
            -
             
     | 
| 
      
 893 
     | 
    
         
            +
              var batches = e["batches"];
         
     | 
| 
      
 894 
     | 
    
         
            +
              if (!(batches && batches["reset"])) {
         
     | 
| 
      
 895 
     | 
    
         
            +
                this._requestApplyAddChildGroup(e);
         
     | 
| 
      
 896 
     | 
    
         
            +
                this._applyNearestGrouping(e.colIndex);
         
     | 
| 
      
 897 
     | 
    
         
            +
              }
         
     | 
| 
       900 
898 
     | 
    
         
             
              this._requestApplyGrouping();
         
     | 
| 
       901 
899 
     | 
    
         
             
            };
         
     | 
| 
       902 
900 
     | 
    
         
             
            /** @private
         
     | 
| 
         @@ -908,7 +906,8 @@ ColumnGroupingPlugin.prototype._onColumnChanged = function () { 
     | 
|
| 
       908 
906 
     | 
    
         
             
            * @param {Object} e dispatching of columnMoved event object
         
     | 
| 
       909 
907 
     | 
    
         
             
            */
         
     | 
| 
       910 
908 
     | 
    
         
             
            ColumnGroupingPlugin.prototype._onColumnMoved = function (e) {
         
     | 
| 
       911 
     | 
    
         
            -
               
     | 
| 
      
 909 
     | 
    
         
            +
              var batches = e["batches"];
         
     | 
| 
      
 910 
     | 
    
         
            +
              if (!(batches && batches["move"])) {
         
     | 
| 
       912 
911 
     | 
    
         
             
                this._applyNearestGrouping(e.toColIndex);
         
     | 
| 
       913 
912 
     | 
    
         
             
              }
         
     | 
| 
       914 
913 
     | 
    
         
             
              this._requestApplyGrouping();
         
     | 
| 
         @@ -917,11 +916,16 @@ ColumnGroupingPlugin.prototype._onColumnMoved = function (e) { 
     | 
|
| 
       917 
916 
     | 
    
         
             
            * @param {Object} e
         
     | 
| 
       918 
917 
     | 
    
         
             
            */
         
     | 
| 
       919 
918 
     | 
    
         
             
            ColumnGroupingPlugin.prototype._onColumnRemoved = function (e) {
         
     | 
| 
       920 
     | 
    
         
            -
              var  
     | 
| 
       921 
     | 
    
         
            -
              if ( 
     | 
| 
       922 
     | 
    
         
            -
                 
     | 
| 
       923 
     | 
    
         
            -
             
     | 
| 
      
 919 
     | 
    
         
            +
              var batches = e["batches"];
         
     | 
| 
      
 920 
     | 
    
         
            +
              if (!(batches && batches["reset"])) {
         
     | 
| 
      
 921 
     | 
    
         
            +
                var colId = e.colId;
         
     | 
| 
      
 922 
     | 
    
         
            +
                if (colId) {
         
     | 
| 
      
 923 
     | 
    
         
            +
                  if (this._groupDefs.unsetParent(colId)) {
         
     | 
| 
      
 924 
     | 
    
         
            +
                    this._requestApplyGrouping();
         
     | 
| 
      
 925 
     | 
    
         
            +
                  }
         
     | 
| 
       924 
926 
     | 
    
         
             
                }
         
     | 
| 
      
 927 
     | 
    
         
            +
              } else {
         
     | 
| 
      
 928 
     | 
    
         
            +
                this._requestApplyGrouping();
         
     | 
| 
       925 
929 
     | 
    
         
             
              }
         
     | 
| 
       926 
930 
     | 
    
         
             
            };
         
     | 
| 
       927 
931 
     | 
    
         
             
            /** @private
         
     | 
| 
         @@ -1028,29 +1032,22 @@ ColumnGroupingPlugin.prototype._onBeforeColumnBoundUpdate = function (e) { 
     | 
|
| 
       1028 
1032 
     | 
    
         
             
            */
         
     | 
| 
       1029 
1033 
     | 
    
         
             
            ColumnGroupingPlugin.prototype.addColumnToGroup = function (column, groupId, colIndex) {
         
     | 
| 
       1030 
1034 
     | 
    
         
             
              if (!column) return;
         
     | 
| 
       1031 
     | 
    
         
            -
              var  
     | 
| 
       1032 
     | 
    
         
            -
              if (colIndex  
     | 
| 
      
 1035 
     | 
    
         
            +
              var destIndex = this.getColumnCount();
         
     | 
| 
      
 1036 
     | 
    
         
            +
              if (colIndex != null) {
         
     | 
| 
       1033 
1037 
     | 
    
         
             
                var groupDef = this._groupDefs.getGroup(groupId);
         
     | 
| 
       1034 
1038 
     | 
    
         
             
                if (groupDef) {
         
     | 
| 
       1035 
     | 
    
         
            -
                  var childIndices = this.getChildColumnIndices(groupId);
         
     | 
| 
       1036 
     | 
    
         
            -
                  if (childIndices && childIndices.length) {
         
     | 
| 
       1037 
     | 
    
         
            -
                    // Child indices need to be sorted here
         
     | 
| 
       1038 
     | 
    
         
            -
                    columnIndex = childIndices[childIndices.length - 1] + 1; // Put new column next to the last child in the group
         
     | 
| 
       1039 
     | 
    
         
            -
                  }
         
     | 
| 
       1040 
     | 
    
         
            -
             
     | 
| 
       1041 
1039 
     | 
    
         
             
                  this._groupDefs.addGroupChild(groupId, column.id);
         
     | 
| 
       1042 
1040 
     | 
    
         
             
                }
         
     | 
| 
       1043 
     | 
    
         
            -
             
     | 
| 
       1044 
     | 
    
         
            -
                columnIndex = colIndex;
         
     | 
| 
       1045 
     | 
    
         
            -
              }
         
     | 
| 
       1046 
     | 
    
         
            -
              if (columnIndex < 0) {
         
     | 
| 
       1047 
     | 
    
         
            -
                columnIndex = this.getColumnCount();
         
     | 
| 
      
 1041 
     | 
    
         
            +
                destIndex = colIndex;
         
     | 
| 
       1048 
1042 
     | 
    
         
             
              }
         
     | 
| 
       1049 
1043 
     | 
    
         
             
              if (this._realTimeGrid) {
         
     | 
| 
       1050 
1044 
     | 
    
         
             
                // TODO: Support multi-table feature
         
     | 
| 
       1051 
     | 
    
         
            -
                this._realTimeGrid.insertColumn(column,  
     | 
| 
      
 1045 
     | 
    
         
            +
                this._realTimeGrid.insertColumn(column, destIndex);
         
     | 
| 
       1052 
1046 
     | 
    
         
             
              } else if (this._compositeGrid) {
         
     | 
| 
       1053 
     | 
    
         
            -
                this._compositeGrid.insertColumn( 
     | 
| 
      
 1047 
     | 
    
         
            +
                this._compositeGrid.insertColumn(destIndex, column);
         
     | 
| 
      
 1048 
     | 
    
         
            +
              }
         
     | 
| 
      
 1049 
     | 
    
         
            +
              if (colIndex == null) {
         
     | 
| 
      
 1050 
     | 
    
         
            +
                this.setColumnParent(column.id || destColIndex, groupId);
         
     | 
| 
       1054 
1051 
     | 
    
         
             
              }
         
     | 
| 
       1055 
1052 
     | 
    
         
             
            };
         
     | 
| 
       1056 
1053 
     | 
    
         | 
| 
         @@ -1622,13 +1619,7 @@ ColumnGroupingPlugin.prototype.moveGroup = function (id, destCol) { 
     | 
|
| 
       1622 
1619 
     | 
    
         
             
            * @return {boolean}
         
     | 
| 
       1623 
1620 
     | 
    
         
             
            */
         
     | 
| 
       1624 
1621 
     | 
    
         
             
            ColumnGroupingPlugin.prototype.reorderColumns = function (colList, destCol) {
         
     | 
| 
       1625 
     | 
    
         
            -
               
     | 
| 
       1626 
     | 
    
         
            -
              // TODO: create method for toggling autoGrouping flag
         
     | 
| 
       1627 
     | 
    
         
            -
              this._autoGrouping = false; // Prevent re-grouping in columnMoved event
         
     | 
| 
       1628 
     | 
    
         
            -
             
     | 
| 
       1629 
     | 
    
         
            -
              this._reorderColumns(colList, destCol);
         
     | 
| 
       1630 
     | 
    
         
            -
              this._autoGrouping = true;
         
     | 
| 
       1631 
     | 
    
         
            -
              return dirty;
         
     | 
| 
      
 1622 
     | 
    
         
            +
              return this._reorderColumns(colList, destCol);
         
     | 
| 
       1632 
1623 
     | 
    
         
             
            };
         
     | 
| 
       1633 
1624 
     | 
    
         
             
            /** Move the specified column to position before the destination
         
     | 
| 
       1634 
1625 
     | 
    
         
             
            * @public
         
     | 
| 
         @@ -1637,12 +1628,7 @@ ColumnGroupingPlugin.prototype.reorderColumns = function (colList, destCol) { 
     | 
|
| 
       1637 
1628 
     | 
    
         
             
            * @return {boolean}
         
     | 
| 
       1638 
1629 
     | 
    
         
             
            */
         
     | 
| 
       1639 
1630 
     | 
    
         
             
            ColumnGroupingPlugin.prototype.moveColumnById = function (srcCol, destCol) {
         
     | 
| 
       1640 
     | 
    
         
            -
               
     | 
| 
       1641 
     | 
    
         
            -
              this._autoGrouping = false; // Prevent re-grouping in columnMoved event
         
     | 
| 
       1642 
     | 
    
         
            -
             
     | 
| 
       1643 
     | 
    
         
            -
              this._moveColumnById(srcCol, destCol);
         
     | 
| 
       1644 
     | 
    
         
            -
              this._autoGrouping = true;
         
     | 
| 
       1645 
     | 
    
         
            -
              return dirty;
         
     | 
| 
      
 1631 
     | 
    
         
            +
              return this._moveColumnById(srcCol, destCol);
         
     | 
| 
       1646 
1632 
     | 
    
         
             
            };
         
     | 
| 
       1647 
1633 
     | 
    
         
             
            /** @public
         
     | 
| 
       1648 
1634 
     | 
    
         
             
            * @param {string} groupId
         
     |