define(["require", "exports", "../base/constant", "../base/util", "../common/checkbox-filter-base"], function (require, exports, events, util_1, checkbox_filter_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CheckBoxFilter = (function () {
function CheckBoxFilter(parent, filterSettings, serviceLocator) {
this.parent = parent;
this.isresetFocus = true;
this.checkBoxBase = new checkbox_filter_base_1.CheckBoxFilterBase(parent);
this.addEventListener();
}
CheckBoxFilter.prototype.destroy = function () {
this.removeEventListener();
this.checkBoxBase.closeDialog();
};
CheckBoxFilter.prototype.openDialog = function (options) {
this.checkBoxBase.openDialog(options);
this.parent.log('column_type_missing', { column: options.column });
};
CheckBoxFilter.prototype.closeDialog = function () {
this.destroy();
if (this.isresetFocus) {
this.parent.notify(events.restoreFocus, {});
}
};
CheckBoxFilter.prototype.closeResponsiveDialog = function () {
this.checkBoxBase.closeDialog();
};
CheckBoxFilter.prototype.getModuleName = function () {
return 'checkboxFilter';
};
CheckBoxFilter.prototype.actionBegin = function (args) {
this.parent.trigger(events.actionBegin, args);
};
CheckBoxFilter.prototype.actionComplete = function (args) {
this.parent.trigger(events.actionComplete, args);
};
CheckBoxFilter.prototype.actionPrevent = function (args) {
if (util_1.isActionPrevent(this.parent)) {
this.parent.notify(events.preventBatch, args);
args.cancel = true;
}
};
CheckBoxFilter.prototype.clearCustomFilter = function (col) {
this.checkBoxBase.clearFilter(col);
};
CheckBoxFilter.prototype.applyCustomFilter = function () {
this.checkBoxBase.fltrBtnHandler();
this.checkBoxBase.closeDialog();
};
CheckBoxFilter.prototype.addEventListener = function () {
if (this.parent.isDestroyed) {
return;
}
this.parent.on(events.cBoxFltrBegin, this.actionBegin, this);
this.parent.on(events.cBoxFltrComplete, this.actionComplete, this);
this.parent.on(events.fltrPrevent, this.actionPrevent, this);
};
CheckBoxFilter.prototype.removeEventListener = function () {
if (this.parent.isDestroyed) {
return;
}
this.parent.off(events.cBoxFltrBegin, this.actionBegin);
this.parent.off(events.cBoxFltrComplete, this.actionComplete);
this.parent.off(events.fltrPrevent, this.actionPrevent);
};
return CheckBoxFilter;
}());
exports.CheckBoxFilter = CheckBoxFilter;
});
|