/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, ChangeDetectorRef } from '@angular/core';
import { ColumnChooserBase } from '../column-chooser-base';
import { IgxColumnPinningItemDirective } from './pinning.directive';
var IgxColumnPinningComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxColumnPinningComponent, _super);
    function IgxColumnPinningComponent(cdr) {
        var _this = _super.call(this, cdr) || this;
        _this.cdr = cdr;
        return _this;
    }
    /**
     * @hidden
     */
    /**
     * @hidden
     * @param {?} container
     * @param {?} column
     * @return {?}
     */
    IgxColumnPinningComponent.prototype.createColumnItem = /**
     * @hidden
     * @param {?} container
     * @param {?} column
     * @return {?}
     */
    function (container, column) {
        if (column.level !== 0 || column.disablePinning) {
            return null;
        }
        /** @type {?} */
        var item = new IgxColumnPinningItemDirective();
        item.container = container;
        item.column = column;
        return item;
    };
    /**
     * @hidden
     */
    /**
     * @hidden
     * @param {?} event
     * @param {?} columnItem
     * @return {?}
     */
    IgxColumnPinningComponent.prototype.checkboxValueChange = /**
     * @hidden
     * @param {?} event
     * @param {?} columnItem
     * @return {?}
     */
    function (event, columnItem) {
        if (event.checked && !columnItem.pinnable) {
            event.checkbox.checked = false;
            return false;
        }
        columnItem.value = !columnItem.value;
    };
    IgxColumnPinningComponent.decorators = [
        { type: Component, args: [{
                    preserveWhitespaces: false,
                    selector: 'igx-column-pinning',
                    template: "\n<div class=\"igx-column-hiding__header\">\n    <h4 class=\"igx-column-hiding__header-title\" *ngIf=\"title\">{{ title }}</h4>\n\n    <igx-input-group class=\"igx-column-hiding__header-input\" *ngIf=\"!disableFilter\">\n        <input igxInput\n            type=\"text\"\n            [(ngModel)]=\"filterCriteria\"\n            [placeholder]=\"filterColumnsPrompt\"\n            autocomplete=\"off\" />\n    </igx-input-group>\n</div>\n\n<div class=\"igx-column-hiding__columns\"\n    [style.max-height]=\"columnsAreaMaxHeight\">\n    <igx-checkbox igxColumnPinningItem\n        *ngFor=\"let columnItem of columnItems\"\n        class=\"igx-column-hiding__columns-item\"\n        (change)=\"checkboxValueChange($event, columnItem)\"\n        [checked]=\"columnItem.value\">\n        {{ columnItem.name }}\n    </igx-checkbox>\n</div>\n"
                }] }
    ];
    /** @nocollapse */
    IgxColumnPinningComponent.ctorParameters = function () { return [
        { type: ChangeDetectorRef }
    ]; };
    return IgxColumnPinningComponent;
}(ColumnChooserBase));
export { IgxColumnPinningComponent };
if (false) {
    /** @type {?} */
    IgxColumnPinningComponent.prototype.cdr;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1uLXBpbm5pbmcuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vaWduaXRldWktYW5ndWxhci8iLCJzb3VyY2VzIjpbImxpYi9ncmlkcy9waW5uaW5nL2NvbHVtbi1waW5uaW5nLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUNBLE9BQU8sRUFBRSxTQUFTLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDM0QsT0FBTyxFQUFFLDZCQUE2QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFJcEU7SUFLK0MscURBQWlCO0lBRTVELG1DQUFtQixHQUFzQjtRQUF6QyxZQUNJLGtCQUFNLEdBQUcsQ0FBQyxTQUNiO1FBRmtCLFNBQUcsR0FBSCxHQUFHLENBQW1COztJQUV6QyxDQUFDO0lBRUQ7O09BRUc7Ozs7Ozs7SUFDSCxvREFBZ0I7Ozs7OztJQUFoQixVQUFpQixTQUFjLEVBQUUsTUFBVztRQUN4QyxJQUFJLE1BQU0sQ0FBQyxLQUFLLEtBQUssQ0FBQyxJQUFJLE1BQU0sQ0FBQyxjQUFjLEVBQUU7W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