RichText/Archived/Rooster/Rooster.gcomp/Support/node_modules/roosterjs/dist/rooster-amd.js
/**
     * Create a new instance of VTable object using HTML TABLE or TD node
     * @param node The HTML Table or TD node
     */
Create a new instance of VTable object using HTML TABLE or TD node
@param node The HTML Table or TD node
Create a new instance of VTable object using HTML TABLE or TD node @param node The HTML Table or TD node
function VTable(node) {
        var _this = this;
        this.trs = [];
        this.table = node instanceof HTMLTableElement ? node : getTableFromTd(node);
        if (this.table) {
            var currentTd_1 = node instanceof HTMLTableElement ? null : node;
            var trs = [].slice.call(this.table.rows);
            this.cells = trs.map(function (row) { return []; });
            trs.forEach(function (tr, rowIndex) {
                _this.trs[rowIndex % 2] = tr;
                for (var sourceCol = 0, targetCol = 0; sourceCol < tr.cells.length; sourceCol++) {
                    for (; _this.cells[rowIndex][targetCol]; targetCol++) { }
                    var td = tr.cells[sourceCol];
                    if (td == currentTd_1) {
                        _this.col = targetCol;
                        _this.row = rowIndex;
                    }
                    for (var colSpan = 0; colSpan < td.colSpan; colSpan++, targetCol++) {
                        for (var rowSpan = 0; rowSpan < td.rowSpan; rowSpan++) {
                            _this.cells[rowIndex + rowSpan][targetCol] = {
                                td: colSpan + rowSpan == 0 ? td : null,
                                spanLeft: colSpan > 0,
                                spanAbove: rowSpan > 0,
                            };
                        }
                    }
                }
            });
        }
    }
function VTable ( node ) { var _this = this ; this . trs = [ ] ; this . table = node instanceof HTMLTableElement ? node : getTableFromTd ( node ) ; if ( this . table ) { var currentTd_1 = node instanceof HTMLTableElement ? null : node ; var trs = [ ] . slice . call ( this . table . rows ) ; this . cells = trs . map ( function ( row ) { return [ ] ; } ) ; trs . forEach ( function ( tr , rowIndex ) { _this . trs [ rowIndex % 2 ] = tr ; for ( var sourceCol = 0 , targetCol = 0 ; sourceCol < tr . cells . length ; sourceCol ++ ) { for ( ; _this . cells [ rowIndex ] [ targetCol ] ; targetCol ++ ) { } var td = tr . cells [ sourceCol ] ; if ( td == currentTd_1 ) { _this . col = targetCol ; _this . row = rowIndex ; } for ( var colSpan = 0 ; colSpan < td . colSpan ; colSpan ++ , targetCol ++ ) { for ( var rowSpan = 0 ; rowSpan < td . rowSpan ; rowSpan ++ ) { _this . cells [ rowIndex + rowSpan ] [ targetCol ] = { td : colSpan + rowSpan == 0 ? td : null , spanLeft : colSpan > 0 , spanAbove : rowSpan > 0 , } ; } } } } ) ; } }
Create a new instance of VTable object using HTML TABLE or TD node
 @param node The HTML Table or TD node
Create a new instance of VTable object using HTML TABLE or TD node @param node The HTML Table or TD node
// Skip the cells which already initialized