"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var SelectFilterOld = (function (_super) {
    __extends(SelectFilterOld, _super);
    function SelectFilterOld(settings, object, transformService) {
        var _this = _super.call(this) || this;
        _this.type = 'selectFilter';
        _this.object = object;
        _this.transformService = transformService;
        _this.valueSelector = settings.valueSelector;
        _this.comparer = settings.comparer;
        _this.options = settings.options;
        _this.getOptions = settings.getOptions;
        _this.label = settings.label;
        _this.displayNameSelector = settings.displayNameSelector;
        _this.nullOption = settings.nullOption;
        _this.template = "<rl-select-filter filter=\"filter\" source=\"dataSource\" options=\"filter.options\" get-options=\"filter.getOptions()\"\n\t\t\t\t\t\t\t\t\t\t   label=\"{{filter.label}}\" selector=\"filter.displayNameSelector\" null-option=\"{{filter.nullOption}}\"></rl-select-filter>";
        return _this;
    }
    Object.defineProperty(SelectFilterOld.prototype, "selectedValue", {
        get: function () {
            return this._selectedValue;
        },
        set: function (value) {
            if (this._selectedValue !== value) {
                this._selectedValue = value;
                this.onChange();
            }
        },
        enumerable: true,
        configurable: true
    });
    SelectFilterOld.prototype.filter = function (item) {
        if (this.selectedValue == null) {
            return true;
        }
        if (this.comparer != null) {
            return this.comparer(this.getValue(item), this.selectedValue);
        }
        return this.object.areEqual(this.getValue(item), this.selectedValue);
    };
    SelectFilterOld.prototype.serialize = function () {
        return this.selectedValue;
    };
    SelectFilterOld.prototype.getValue = function (item) {
        return this.transformService.getValue(item, this.valueSelector);
    };
    return SelectFilterOld;
}(typescript_angular_utilities_1.filters.SerializableFilter));
exports.SelectFilterOld = SelectFilterOld;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0RmlsdGVyT2xkLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291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