igniteui-react-grids
Version:
Ignite UI React grid components.
131 lines (130 loc) • 4.46 kB
JavaScript
import { __extends } from "tslib";
import { FilteringExpressionsTreeType_$type } from "./FilteringExpressionsTreeType";
import { FilteringLogic_$type } from "./FilteringLogic";
import { IgrExpressionTree } from "./igr-expression-tree";
import { IgrFilteringExpressionsTreeOrFilteringExpression } from "./igr-filtering-expressions-tree-or-filtering-expression";
import { FilteringExpressionsTree as FilteringExpressionsTree_internal } from "./FilteringExpressionsTree";
import { ensureEnum } from "igniteui-react-core";
var IgrFilteringExpressionsTree = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrFilteringExpressionsTree, _super);
function IgrFilteringExpressionsTree() {
return _super.call(this) || this;
}
IgrFilteringExpressionsTree.prototype.createImplementation = function () {
var impl = new FilteringExpressionsTree_internal();
if (impl.setNativeElement) {
impl.setNativeElement({});
}
return impl;
};
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "filteringOperands", {
get: function () {
if (!this.i.k) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.k.length; i++) {
var impl = this.i.k[i];
if (!impl.externalObject) {
if (impl instanceof IgrFilteringExpressionsTreeOrFilteringExpression) {
ret.push(impl);
continue;
}
var e = new IgrFilteringExpressionsTreeOrFilteringExpression();
e._implementation = impl;
impl.externalObject = e;
}
ret.push(impl.externalObject);
}
return ret;
},
set: function (v) {
var arr = [];
for (var i = 0; i < v.length; i++) {
arr.push(v[i].i);
}
this.i.k = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "type", {
get: function () {
return this.i.m;
},
set: function (v) {
this.i.m = ensureEnum(FilteringExpressionsTreeType_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "owner", {
/**
* Provides reference to the owner component.
*/
get: function () {
return this.i.o;
},
set: function (v) {
this.i.o = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "operator", {
get: function () {
return this.i.n;
},
set: function (v) {
this.i.n = ensureEnum(FilteringLogic_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "fieldName", {
get: function () {
return this.i.q;
},
set: function (v) {
this.i.q = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "entity", {
get: function () {
return this.i.p;
},
set: function (v) {
this.i.p = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFilteringExpressionsTree.prototype, "returnFields", {
get: function () {
return this.i.l;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.l = v;
},
enumerable: false,
configurable: true
});
return IgrFilteringExpressionsTree;
}(IgrExpressionTree));
export { IgrFilteringExpressionsTree };