igniteui-react-grids
Version:
Ignite UI React grid components.
168 lines (167 loc) • 5.59 kB
JavaScript
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { EditorType_$type } from "./EditorType";
import { IgrGridCustomFilterRequestedEventArgs } from "./igr-grid-custom-filter-requested-event-args";
import { FilterOperand as FilterOperand_internal } from "./FilterOperand";
import { ensureBool, ensureEnum } from "igniteui-react-core";
/**
* A filter operand.
*/
var IgrFilterOperand = /** @class */ /*@__PURE__*/ (function () {
function IgrFilterOperand() {
this.mounted = false;
this._filterRequested = null;
this._filterRequested_wrapped = null;
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
IgrFilterOperand.prototype.createImplementation = function () {
return new FilterOperand_internal();
};
Object.defineProperty(IgrFilterOperand.prototype, "nativeElement", {
get: function () {
return this._implementation.nativeElement;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
IgrFilterOperand.prototype.onImplementationCreated = function () {
};
IgrFilterOperand.prototype._provideImplementation = function (i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
};
Object.defineProperty(IgrFilterOperand.prototype, "filterFactory", {
/**
* Gets the FilterFactory to assists in building filters.
*/
get: function () {
return this.i.a;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "iD", {
/**
* Gets or sets the ID of the filter. Must be unique from other filters in the column.
*/
get: function () {
return this.i.g;
},
set: function (v) {
this.i.g = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "displayName", {
/**
* Gets or sets the name for display of this custom filter.
*/
get: function () {
return this.i.e;
},
set: function (v) {
this.i.e = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "icon", {
/**
* Gets or sets the SVG path to use for the operand icon in the filter cell.
*/
get: function () {
return this.i.f;
},
set: function (v) {
this.i.f = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "isInputRequired", {
/**
* Gets or sets whether this filter requires input.
*/
get: function () {
return this.i.d;
},
set: function (v) {
this.i.d = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilterOperand.prototype, "editorType", {
/**
* The type of editor to use in the filter cell. Combo is not currently supported.
*/
get: function () {
return this.i.b;
},
set: function (v) {
this.i.b = ensureEnum(EditorType_$type, v);
},
enumerable: false,
configurable: true
});
IgrFilterOperand.prototype.findByName = function (name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
};
Object.defineProperty(IgrFilterOperand.prototype, "filterRequested", {
/**
* Gets or sets a function that returns a filter expression to use.
*/
get: function () {
return this._filterRequested;
},
set: function (ev) {
var _this = this;
if (this._filterRequested_wrapped !== null) {
this.i.filterRequested = delegateRemove(this.i.filterRequested, this._filterRequested_wrapped);
this._filterRequested_wrapped = null;
this._filterRequested = null;
}
this._filterRequested = ev;
this._filterRequested_wrapped = function (o, e) {
var outerArgs = new IgrGridCustomFilterRequestedEventArgs();
outerArgs._provideImplementation(e);
if (_this.beforeFilterRequested) {
_this.beforeFilterRequested(_this, outerArgs);
}
if (_this._filterRequested) {
_this._filterRequested(_this, outerArgs);
}
};
this.i.filterRequested = delegateCombine(this.i.filterRequested, this._filterRequested_wrapped);
;
},
enumerable: false,
configurable: true
});
return IgrFilterOperand;
}());
export { IgrFilterOperand };