igniteui-react-grids
Version:
Ignite UI React grid components.
110 lines (109 loc) • 3.73 kB
JavaScript
import { __extends } from "tslib";
import { FilteringLogic_$type } from "./FilteringLogic";
import { IgrFilteringExpressionsTreeOrFilteringExpression } from "./igr-filtering-expressions-tree-or-filtering-expression";
import { IgrExpressionTreeOrFilteringExpression } from "./igr-expression-tree-or-filtering-expression";
import { ExpressionTree as ExpressionTree_internal } from "./ExpressionTree";
import { ensureEnum } from "igniteui-react-core";
var IgrExpressionTree = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrExpressionTree, _super);
function IgrExpressionTree() {
return _super.call(this) || this;
}
IgrExpressionTree.prototype.createImplementation = function () {
var impl = new ExpressionTree_internal();
if (impl.setNativeElement) {
impl.setNativeElement({});
}
return impl;
};
Object.defineProperty(IgrExpressionTree.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrExpressionTree.prototype, "filteringOperands", {
get: function () {
if (!this.i.a) {
return undefined;
}
var ret = [];
for (var i = 0; i < this.i.a.length; i++) {
var impl = this.i.a[i];
if (!impl.externalObject) {
if (impl instanceof IgrExpressionTreeOrFilteringExpression) {
ret.push(impl);
continue;
}
var e = new IgrExpressionTreeOrFilteringExpression();
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.a = arr;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrExpressionTree.prototype, "operator", {
get: function () {
return this.i.c;
},
set: function (v) {
this.i.c = ensureEnum(FilteringLogic_$type, v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrExpressionTree.prototype, "fieldName", {
get: function () {
return this.i.i;
},
set: function (v) {
this.i.i = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrExpressionTree.prototype, "entity", {
get: function () {
return this.i.h;
},
set: function (v) {
this.i.h = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrExpressionTree.prototype, "returnFields", {
get: function () {
return this.i.b;
},
set: function (v) {
if (v && !Array.isArray(v) && typeof (v) == "string") {
var re = /\s*(?:,|\s|$)\s*/gm;
v = v.split(re);
}
this.i.b = v;
},
enumerable: false,
configurable: true
});
IgrExpressionTree.prototype.setNativeElement = function (element) {
this.i.setNativeElement(element);
};
return IgrExpressionTree;
}(IgrFilteringExpressionsTreeOrFilteringExpression));
export { IgrExpressionTree };