"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require("@angular/core");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __object = typescript_angular_utilities_1.services.object;
var __string = typescript_angular_utilities_1.services.string;
var __transform = typescript_angular_utilities_1.services.transform;
exports.filterName = 'column-search';
var ColumnSearchFilter = (function () {
    function ColumnSearchFilter(object, string, transformService) {
        this.type = exports.filterName;
        this.object = object;
        this.string = string;
        this.transformService = transformService;
    }
    ColumnSearchFilter.prototype.filter = function (item) {
        if (this.column == null) {
            return true;
        }
        var value = this.object.toString(this.transformService.getValue(item, this.column.getValue));
        var search = this.searchText;
        if (!this.caseSensitive) {
            search = search.toLowerCase();
            value = value.toLowerCase();
        }
        return this.string.contains(value, search);
    };
    return ColumnSearchFilter;
}());
ColumnSearchFilter = __decorate([
    core_1.Injectable(),
    __metadata("design:paramtypes", [__object.ObjectUtility, __string.StringUtility, __transform.TransformService])
], ColumnSearchFilter);
exports.ColumnSearchFilter = ColumnSearchFilter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sdW1uU2VhcmNoRmlsdGVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjb2x1bW5TZWFyY2hGaWx0ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0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