UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

143 lines (139 loc) 4.55 kB
import { IgcFilteringOperand } from "./../../grids/combined"; import { FilteringOperand as FilteringOperand_internal } from "./FilteringOperand"; import { interfaceToInternal } from "igniteui-react-core"; import { FilteringOperation } from "./FilteringOperation"; /** * Provides base filtering operations * Implementations should be Singleton * @export */ var IgrFilteringOperand = /** @class */ /*@__PURE__*/ (function () { function IgrFilteringOperand() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } IgrFilteringOperand.prototype.createImplementation = function () { var impl = new FilteringOperand_internal(); if (impl.setNativeElement) { impl.setNativeElement(new IgcFilteringOperand()); } return impl; }; Object.defineProperty(IgrFilteringOperand.prototype, "nativeElement", { get: function () { return this._implementation.nativeElement; }, enumerable: false, configurable: true }); Object.defineProperty(IgrFilteringOperand.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgrFilteringOperand.prototype.onImplementationCreated = function () { }; IgrFilteringOperand.prototype._provideImplementation = function (i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } }; Object.defineProperty(IgrFilteringOperand.prototype, "operations", { get: function () { if (!this.i.b) { return undefined; } var ret = []; for (var i = 0; i < this.i.b.length; i++) { var impl = this.i.b[i]; ret.push(impl.nativeElement); } return ret; }, set: function (v) { var arr = []; for (var i = 0; i < v.length; i++) { arr.push(v[i]); } this.i.b = arr; }, enumerable: false, configurable: true }); IgrFilteringOperand.prototype.findByName = function (name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; }; IgrFilteringOperand.prototype.setNativeElement = function (element) { this.i.setNativeElement(element); }; IgrFilteringOperand.prototype.instance = function () { var iv = this.i.c(); var ret = null; if (iv && iv.externalObject) { ret = iv.externalObject; } else { if (iv) { var e = new IgrFilteringOperand(); e._implementation = iv; iv.externalObject = e; ret = e; } } return ret; }; /** * Returns an array of names of the conditions which are visible in the filtering UI */ IgrFilteringOperand.prototype.conditionList = function () { var iv = this.i.a(); return (iv); }; /** * Returns an instance of the condition with the specified name. * name The name of the condition. * @param name * The name of the condition. */ IgrFilteringOperand.prototype.condition = function (name) { var iv = this.i.d(name); var ret = null; if (iv && iv.externalObject) { ret = iv.externalObject; } else { if (iv) { ret = iv.nativeElement; delete ret.externalObject; } } return ret; }; /** * Adds a new condition to the filtering operations. * operation The filtering operation. * @param operation * The filtering operation. */ IgrFilteringOperand.prototype.append = function (operation) { this.i.i((operation == null ? null : interfaceToInternal(operation, function () { return new FilteringOperation(); }))); }; return IgrFilteringOperand; }()); export { IgrFilteringOperand };