var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Container } from 'aurelia-framework';
import { I18N } from 'aurelia-i18n';
import BaseFloatingFilter from '../base-floating-filter';
import { NumberFilterHelper } from './number-filter-helper';
var NumberFloatingFilter = (function (_super) {
    __extends(NumberFloatingFilter, _super);
    function NumberFloatingFilter() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    NumberFloatingFilter.prototype.init = function (params) {
        var _this = this;
        this.filterHelper = new NumberFilterHelper(function (model) {
            _this.params.parentFilterInstance(function (instance) {
                instance.setModel(model);
            });
        });
        _super.prototype.init.call(this, params);
        this.i18n = Container.instance.get(I18N);
        if (this.i18n != null) {
            this.DROPDOWN_NAME = this.i18n.tr('grid.noFilter', { ns: "common" });
        }
        this.setupGui();
    };
    NumberFloatingFilter.prototype.onParentModelChanged = function (parentModel) {
        this.filterHelper.type = ((parentModel === null || parentModel === void 0 ? void 0 : parentModel.type) ? parentModel.type : 'equals');
        this.filterHelper.fromNumber = ((parentModel === null || parentModel === void 0 ? void 0 : parentModel.filter) ? parentModel.filter : null);
        this.filterHelper.toNumber = ((parentModel === null || parentModel === void 0 ? void 0 : parentModel.filterTo) ? parentModel.filterTo : null);
        this.DROPDOWN_NAME = this.getModelAsString();
    };
    NumberFloatingFilter.prototype.setupContentGui = function () {
        return this.filterHelper.setupContentGui();
    };
    NumberFloatingFilter.prototype.resetFilter = function () {
        this.filterHelper.resetFilter();
    };
    NumberFloatingFilter.prototype.getModelAsString = function () {
        return this.filterHelper.getModelAsString();
    };
    NumberFloatingFilter.prototype.setupContentGuiSideFilter = function () {
        return this.filterHelper.setupContentGuiSideFilter();
    };
    NumberFloatingFilter.prototype.applyObservers = function () {
        var _this = this;
        this.dispose();
        this.disposables.push(this.bindingEngine.propertyObserver(this.filterHelper, 'displayEmptyFields').subscribe(function () { return _this.filterHelper.displayEmptyFieldsChanged(); }));
    };
    return NumberFloatingFilter;
}(BaseFloatingFilter));
export { NumberFloatingFilter };

//# sourceMappingURL=number-floating-filter.js.map
