release/utils/column-helper.js
function setColumnDefaults(columns) {
    if (!columns)
        return;
    // Only one column should hold the tree view
    // Thus if multiple columns are provided with
    // isTreeColumn as true we take only the first one
    var treeColumnFound = false;
    for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
        var column = columns_1[_i];
        if (!column.$$id) {
            column.$$id = id_1.id();
        }
        // prop can be numeric; zero is valid not a missing prop
        // translate name => prop
        if (isNullOrUndefined(column.prop) && column.name) {
            column.prop = camel_case_1.camelCase(column.name);
        }
        if (!column.$$valueGetter) {
            column.$$valueGetter = column_prop_getters_1.getterForProp(column.prop);
        }
        // format props if no name passed
        if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = camel_case_1.deCamelCase(String(column.prop));
        }
        if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = ''; // Fixes IE and Edge displaying `null`
        }
        if (!column.hasOwnProperty('resizeable')) {
            column.resizeable = true;
        }
        if (!column.hasOwnProperty('sortable')) {
            column.sortable = true;
        }
        if (!column.hasOwnProperty('draggable')) {
            column.draggable = true;
        }
        if (!column.hasOwnProperty('canAutoResize')) {
            column.canAutoResize = true;
        }
        if (!column.hasOwnProperty('width')) {
            column.width = 150;
        }
        if (!column.hasOwnProperty('isTreeColumn')) {
            column.isTreeColumn = false;
        }
        else {
            if (column.isTreeColumn && !treeColumnFound) {
                // If the first column with isTreeColumn is true found
                // we mark that treeCoulmn is found
                treeColumnFound = true;
            }
            else {
                // After that isTreeColumn property for any other column
                // will be set as false
                column.isTreeColumn = false;
            }
        }
    }
}
function setColumnDefaults(columns) {
    if (!columns)
        return;
    // Only one column should hold the tree view
    // Thus if multiple columns are provided with
    // isTreeColumn as true we take only the first one
    var treeColumnFound = false;
    for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
        var column = columns_1[_i];
        if (!column.$$id) {
            column.$$id = id_1.id();
        }
        // prop can be numeric; zero is valid not a missing prop
        // translate name => prop
        if (isNullOrUndefined(column.prop) && column.name) {
            column.prop = camel_case_1.camelCase(column.name);
        }
        if (!column.$$valueGetter) {
            column.$$valueGetter = column_prop_getters_1.getterForProp(column.prop);
        }
        // format props if no name passed
        if (!isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = camel_case_1.deCamelCase(String(column.prop));
        }
        if (isNullOrUndefined(column.prop) && isNullOrUndefined(column.name)) {
            column.name = ''; // Fixes IE and Edge displaying `null`
        }
        if (!column.hasOwnProperty('resizeable')) {
            column.resizeable = true;
        }
        if (!column.hasOwnProperty('sortable')) {
            column.sortable = true;
        }
        if (!column.hasOwnProperty('draggable')) {
            column.draggable = true;
        }
        if (!column.hasOwnProperty('canAutoResize')) {
            column.canAutoResize = true;
        }
        if (!column.hasOwnProperty('width')) {
            column.width = 150;
        }
        if (!column.hasOwnProperty('isTreeColumn')) {
            column.isTreeColumn = false;
        }
        else {
            if (column.isTreeColumn && !treeColumnFound) {
                // If the first column with isTreeColumn is true found
                // we mark that treeCoulmn is found
                treeColumnFound = true;
            }
            else {
                // After that isTreeColumn property for any other column
                // will be set as false
                column.isTreeColumn = false;
            }
        }
    }
}
function setColumnDefaults ( columns ) { if ( ! columns ) return ; // Only one column should hold the tree view // Thus if multiple columns are provided with // isTreeColumn as true we take only the first one var treeColumnFound = false ; for ( var _i = 0 , columns_1 = columns ; _i < columns_1 . length ; _i ++ ) { var column = columns_1 [ _i ] ; if ( ! column . $$id ) { column . $$id = id_1 . id ( ) ; } // prop can be numeric; zero is valid not a missing prop // translate name => prop if ( isNullOrUndefined ( column . prop ) && column . name ) { column . prop = camel_case_1 . camelCase ( column . name ) ; } if ( ! column . $$valueGetter ) { column . $$valueGetter = column_prop_getters_1 . getterForProp ( column . prop ) ; } // format props if no name passed if ( ! isNullOrUndefined ( column . prop ) && isNullOrUndefined ( column . name ) ) { column . name = camel_case_1 . deCamelCase ( String ( column . prop ) ) ; } if ( isNullOrUndefined ( column . prop ) && isNullOrUndefined ( column . name ) ) { column . name = '' ; // Fixes IE and Edge displaying `null` } if ( ! column . hasOwnProperty ( 'resizeable' ) ) { column . resizeable = true ; } if ( ! column . hasOwnProperty ( 'sortable' ) ) { column . sortable = true ; } if ( ! column . hasOwnProperty ( 'draggable' ) ) { column . draggable = true ; } if ( ! column . hasOwnProperty ( 'canAutoResize' ) ) { column . canAutoResize = true ; } if ( ! column . hasOwnProperty ( 'width' ) ) { column . width = 150 ; } if ( ! column . hasOwnProperty ( 'isTreeColumn' ) ) { column . isTreeColumn = false ; } else { if ( column . isTreeColumn && ! treeColumnFound ) { // If the first column with isTreeColumn is true found // we mark that treeCoulmn is found treeColumnFound = true ; } else { // After that isTreeColumn property for any other column // will be set as false column . isTreeColumn = false ; } } } }
Sets the column defaults
Sets the column defaults