/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, ContentChildren, ChangeDetectionStrategy, Input, forwardRef, QueryList, Output, EventEmitter } from '@angular/core';
import { IgxColumnComponent } from './column.component';
import { flatten } from '../../core/utils';
var IgxColumnGroupComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxColumnGroupComponent, _super);
    function IgxColumnGroupComponent() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.children = new QueryList();
        /**
         * Sets/gets whether the column group is `searchable`.
         * Default value is `true`.
         * ```typescript
         * let isSearchable =  this.columnGroup.searchable;
         * ```
         * ```html
         *  <igx-column-group [searchable] = "false"></igx-column-group>
         * ```
         * \@memberof IgxColumnGroupComponent
         */
        _this.searchable = true;
        /**
         * @hidden
         */
        _this.hiddenChange = new EventEmitter();
        return _this;
        // constructor(public gridAPI: GridBaseAPIService<IgxGridBaseComponent & IGridDataBindable>, public cdr: ChangeDetectorRef) {
        //     // D.P. constructor duplication due to es6 compilation, might be obsolete in the future
        //     super(gridAPI, cdr);
        // }
    }
    Object.defineProperty(IgxColumnGroupComponent.prototype, "summaries", {
        /**
         * Gets the column group `summaries`.
         * ```typescript
         * let columnGroupSummaries = this.columnGroup.summaries;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Gets the column group `summaries`.
         * ```typescript
         * let columnGroupSummaries = this.columnGroup.summaries;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return this._summaries;
        },
        /**
         * Sets the column group `summaries`.
         * ```typescript
         * this.columnGroup.summaries = IgxNumberSummaryOperand;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        set: /**
         * Sets the column group `summaries`.
         * ```typescript
         * this.columnGroup.summaries = IgxNumberSummaryOperand;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @param {?} classRef
         * @return {?}
         */
        function (classRef) { },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "filters", {
        /**
         * Gets the column group `filters`.
         * ```typescript
         * let columnGroupFilters = this.columnGroup.filters;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Gets the column group `filters`.
         * ```typescript
         * let columnGroupFilters = this.columnGroup.filters;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return this._filters;
        },
        /**
         * Sets the column group `filters`.
         * ```typescript
         * this.columnGroup.filters = IgxStringFilteringOperand;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        set: /**
         * Sets the column group `filters`.
         * ```typescript
         * this.columnGroup.filters = IgxStringFilteringOperand;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @param {?} classRef
         * @return {?}
         */
        function (classRef) { },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "bodyTemplate", {
        /**
         * Returns a reference to the body template.
         * ```typescript
         * let bodyTemplate = this.columnGroup.bodyTemplate;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Returns a reference to the body template.
         * ```typescript
         * let bodyTemplate = this.columnGroup.bodyTemplate;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return this._bodyTemplate;
        },
        /**
         * @hidden
         */
        set: /**
         * @hidden
         * @param {?} template
         * @return {?}
         */
        function (template) { },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "inlineEditorTemplate", {
        /**
         * Returns a reference to the inline editor template.
         * ```typescript
         * let inlineEditorTemplate = this.columnGroup.inlineEditorTemplate;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Returns a reference to the inline editor template.
         * ```typescript
         * let inlineEditorTemplate = this.columnGroup.inlineEditorTemplate;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return this._inlineEditorTemplate;
        },
        /**
         * @hidden
         */
        set: /**
         * @hidden
         * @param {?} template
         * @return {?}
         */
        function (template) { },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "cells", {
        /**
         * Gets the column group cells.
         * ```typescript
         * let columnCells = this.columnGroup.cells;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Gets the column group cells.
         * ```typescript
         * let columnCells = this.columnGroup.cells;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return [];
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "hidden", {
        /**
         * Gets whether the column group is hidden.
         * ```typescript
         * let isHidden = this.columnGroup.hidden;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Gets whether the column group is hidden.
         * ```typescript
         * let isHidden = this.columnGroup.hidden;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return this.allChildren.every(function (c) { return c.hidden; });
        },
        /**
         * Sets the column group hidden property.
         * ```html
         * <igx-column [hidden] = "true"></igx-column>
         * ```
         *
         * Two-way data binding
         * ```html
         * <igx-column [(hidden)] = "model.columns[0].isHidden"></igx-column>
         * ```
         * @memberof IgxColumnGroupComponent
         */
        set: /**
         * Sets the column group hidden property.
         * ```html
         * <igx-column [hidden] = "true"></igx-column>
         * ```
         *
         * Two-way data binding
         * ```html
         * <igx-column [(hidden)] = "model.columns[0].isHidden"></igx-column>
         * ```
         * \@memberof IgxColumnGroupComponent
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this._hidden = value;
            this.hiddenChange.emit(this._hidden);
            this.children.forEach(function (child) { return child.hidden = value; });
        },
        enumerable: true,
        configurable: true
    });
    /**
     *@hidden
     */
    /**
     * @hidden
     * @return {?}
     */
    IgxColumnGroupComponent.prototype.ngAfterContentInit = /**
     * @hidden
     * @return {?}
     */
    function () {
        var _this = this;
        /*
            @ContentChildren with descendants still returns the `parent`
            component in the query list.
        */
        if (this.headTemplate && this.headTemplate.length) {
            this._headerTemplate = this.headTemplate.toArray()[0].template;
        }
        // Delete the line below once we update to Angular 9
        this.children.reset(this.children.toArray().slice(1));
        this.children.forEach(function (child) {
            child.parent = _this;
        });
    };
    Object.defineProperty(IgxColumnGroupComponent.prototype, "allChildren", {
        /**
         * Returns the children columns collection.
         * ```typescript
         * let columns =  this.columnGroup.allChildren;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Returns the children columns collection.
         * ```typescript
         * let columns =  this.columnGroup.allChildren;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return flatten(this.children.toArray());
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "columnGroup", {
        /**
         * Returns a boolean indicating if the column is a `ColumnGroup`.
         * ```typescript
         * let isColumnGroup =  this.columnGroup.columnGroup
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Returns a boolean indicating if the column is a `ColumnGroup`.
         * ```typescript
         * let isColumnGroup =  this.columnGroup.columnGroup
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            return true;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "columnLayout", {
        /**
         * Returns a boolean indicating if the column is a `ColumnLayout` for multi-row layout.
         * ```typescript
         * let columnGroup =  this.column.columnGroup;
         * ```
         * @memberof IgxColumnComponent
         */
        get: /**
         * Returns a boolean indicating if the column is a `ColumnLayout` for multi-row layout.
         * ```typescript
         * let columnGroup =  this.column.columnGroup;
         * ```
         * \@memberof IgxColumnComponent
         * @return {?}
         */
        function () {
            return false;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxColumnGroupComponent.prototype, "width", {
        /**
         * Gets the width of the column group.
         * ```typescript
         * let columnGroupWidth = this.columnGroup.width;
         * ```
         * @memberof IgxColumnGroupComponent
         */
        get: /**
         * Gets the width of the column group.
         * ```typescript
         * let columnGroupWidth = this.columnGroup.width;
         * ```
         * \@memberof IgxColumnGroupComponent
         * @return {?}
         */
        function () {
            /** @type {?} */
            var isChildrenWidthInPercent = false;
            /** @type {?} */
            var width;
            width = "" + this.children.reduce(function (acc, val) {
                if (val.hidden) {
                    return acc;
                }
                if (typeof val.width === 'string' && val.width.indexOf('%') !== -1) {
                    isChildrenWidthInPercent = true;
                }
                return acc + parseInt(val.width, 10);
            }, 0);
            return isChildrenWidthInPercent ? width + '%' : width;
        },
        set: /**
         * @param {?} val
         * @return {?}
         */
        function (val) { },
        enumerable: true,
        configurable: true
    });
    IgxColumnGroupComponent.decorators = [
        { type: Component, args: [{
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    providers: [{ provide: IgxColumnComponent, useExisting: forwardRef(function () { return IgxColumnGroupComponent; }) }],
                    selector: 'igx-column-group',
                    template: ""
                }] }
    ];
    IgxColumnGroupComponent.propDecorators = {
        children: [{ type: ContentChildren, args: [IgxColumnComponent, { read: IgxColumnComponent },] }],
        summaries: [{ type: Input }],
        searchable: [{ type: Input }],
        filters: [{ type: Input }],
        hidden: [{ type: Input }],
        hiddenChange: [{ type: Output }]
    };
    return IgxColumnGroupComponent;
}(IgxColumnComponent));
export { IgxColumnGroupComponent };
if (false) {
    /** @type {?} */
    IgxColumnGroupComponent.prototype.children;
    /**
     * Sets/gets whether the column group is `searchable`.
     * Default value is `true`.
     * ```typescript
     * let isSearchable =  this.columnGroup.searchable;
     * ```
     * ```html
     *  <igx-column-group [searchable] = "false"></igx-column-group>
     * ```
     * \@memberof IgxColumnGroupComponent
     * @type {?}
     */
    IgxColumnGroupComponent.prototype.searchable;
    /**
     * @hidden
     * @type {?}
     */
    IgxColumnGroupComponent.prototype.hiddenChange;
}
//# sourceMappingURL=data:application/json;base64, 