release/utils/math.js
function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) {
    if (defaultColWidth === void 0) { defaultColWidth = 300; }
    var columnsToResize = allColumns
        .slice(startIdx + 1, allColumns.length)
        .filter(function (c) {
        return c.canAutoResize !== false;
    });
    for (var _i = 0, columnsToResize_1 = columnsToResize; _i < columnsToResize_1.length; _i++) {
        var column = columnsToResize_1[_i];
        if (!column.$$oldWidth) {
            column.$$oldWidth = column.width;
        }
    }
    var additionWidthPerColumn = 0;
    var exceedsWindow = false;
    var contentWidth = getContentWidth(allColumns, defaultColWidth);
    var remainingWidth = expectedWidth - contentWidth;
    var columnsProcessed = [];
    // This loop takes care of the
    do {
        additionWidthPerColumn = remainingWidth / columnsToResize.length;
        exceedsWindow = contentWidth >= expectedWidth;
        for (var _a = 0, columnsToResize_2 = columnsToResize; _a < columnsToResize_2.length; _a++) {
            var column = columnsToResize_2[_a];
            if (exceedsWindow && allowBleed) {
                column.width = column.$$oldWidth || column.width || defaultColWidth;
            }
            else {
                var newSize = (column.width || defaultColWidth) + additionWidthPerColumn;
                if (column.minWidth && newSize < column.minWidth) {
                    column.width = column.minWidth;
                    columnsProcessed.push(column);
                }
                else if (column.maxWidth && newSize > column.maxWidth) {
                    column.width = column.maxWidth;
                    columnsProcessed.push(column);
                }
                else {
                    column.width = newSize;
                }
            }
            column.width = Math.max(0, column.width);
        }
        contentWidth = getContentWidth(allColumns);
        remainingWidth = expectedWidth - contentWidth;
        removeProcessedColumns(columnsToResize, columnsProcessed);
    } while (remainingWidth > 0 && columnsToResize.length !== 0);
}
function forceFillColumnWidths(allColumns, expectedWidth, startIdx, allowBleed, defaultColWidth) {
    if (defaultColWidth === void 0) { defaultColWidth = 300; }
    var columnsToResize = allColumns
        .slice(startIdx + 1, allColumns.length)
        .filter(function (c) {
        return c.canAutoResize !== false;
    });
    for (var _i = 0, columnsToResize_1 = columnsToResize; _i < columnsToResize_1.length; _i++) {
        var column = columnsToResize_1[_i];
        if (!column.$$oldWidth) {
            column.$$oldWidth = column.width;
        }
    }
    var additionWidthPerColumn = 0;
    var exceedsWindow = false;
    var contentWidth = getContentWidth(allColumns, defaultColWidth);
    var remainingWidth = expectedWidth - contentWidth;
    var columnsProcessed = [];
    // This loop takes care of the
    do {
        additionWidthPerColumn = remainingWidth / columnsToResize.length;
        exceedsWindow = contentWidth >= expectedWidth;
        for (var _a = 0, columnsToResize_2 = columnsToResize; _a < columnsToResize_2.length; _a++) {
            var column = columnsToResize_2[_a];
            if (exceedsWindow && allowBleed) {
                column.width = column.$$oldWidth || column.width || defaultColWidth;
            }
            else {
                var newSize = (column.width || defaultColWidth) + additionWidthPerColumn;
                if (column.minWidth && newSize < column.minWidth) {
                    column.width = column.minWidth;
                    columnsProcessed.push(column);
                }
                else if (column.maxWidth && newSize > column.maxWidth) {
                    column.width = column.maxWidth;
                    columnsProcessed.push(column);
                }
                else {
                    column.width = newSize;
                }
            }
            column.width = Math.max(0, column.width);
        }
        contentWidth = getContentWidth(allColumns);
        remainingWidth = expectedWidth - contentWidth;
        removeProcessedColumns(columnsToResize, columnsProcessed);
    } while (remainingWidth > 0 && columnsToResize.length !== 0);
}
function forceFillColumnWidths ( allColumns , expectedWidth , startIdx , allowBleed , defaultColWidth ) { if ( defaultColWidth === void 0 ) { defaultColWidth = 300 ; } var columnsToResize = allColumns . slice ( startIdx + 1 , allColumns . length ) . filter ( function ( c ) { return c . canAutoResize !== false ; } ) ; for ( var _i = 0 , columnsToResize_1 = columnsToResize ; _i < columnsToResize_1 . length ; _i ++ ) { var column = columnsToResize_1 [ _i ] ; if ( ! column . $$oldWidth ) { column . $$oldWidth = column . width ; } } var additionWidthPerColumn = 0 ; var exceedsWindow = false ; var contentWidth = getContentWidth ( allColumns , defaultColWidth ) ; var remainingWidth = expectedWidth - contentWidth ; var columnsProcessed = [ ] ; // This loop takes care of the do { additionWidthPerColumn = remainingWidth / columnsToResize . length ; exceedsWindow = contentWidth >= expectedWidth ; for ( var _a = 0 , columnsToResize_2 = columnsToResize ; _a < columnsToResize_2 . length ; _a ++ ) { var column = columnsToResize_2 [ _a ] ; if ( exceedsWindow && allowBleed ) { column . width = column . $$oldWidth || column . width || defaultColWidth ; } else { var newSize = ( column . width || defaultColWidth ) + additionWidthPerColumn ; if ( column . minWidth && newSize < column . minWidth ) { column . width = column . minWidth ; columnsProcessed . push ( column ) ; } else if ( column . maxWidth && newSize > column . maxWidth ) { column . width = column . maxWidth ; columnsProcessed . push ( column ) ; } else { column . width = newSize ; } } column . width = Math . max ( 0 , column . width ) ; } contentWidth = getContentWidth ( allColumns ) ; remainingWidth = expectedWidth - contentWidth ; removeProcessedColumns ( columnsToResize , columnsProcessed ) ; } while ( remainingWidth > 0 && columnsToResize . length !== 0 ) ; }
Forces the width of the columns to
distribute equally but overflowing when necessary

Rules:

- If combined withs are less than the total width of the grid,
proportion the widths given the min / max / normal widths to fill the width.

- If the combined widths, exceed the total width of the grid,
use the standard widths.

- If a column is resized, it should always use that width

- The proportional widths should never fall below min size if specified.

- If the grid starts off small but then becomes greater than the size ( + / - )
the width should use the original width; not the newly proportioned widths.
Forces the width of the columns to distribute equally but overflowing when necessary