igniteui-react-grids
Version:
Ignite UI React grid components.
95 lines (94 loc) • 2.63 kB
JavaScript
import { IgrExpressionTree } from "./igr-expression-tree";
import { IgrFilteringExpressionsTreeOrFilteringExpression } from "./igr-filtering-expressions-tree-or-filtering-expression";
import { FilteringExpression as FilteringExpression_internal } from "./FilteringExpression";
import { interfaceToInternal, ensureBool } from "igniteui-react-core";
import { FilteringOperation } from "./FilteringOperation";
/**
* Represents filtering expressions.
*/
export class IgrFilteringExpression extends IgrFilteringExpressionsTreeOrFilteringExpression {
createImplementation() {
let impl = new FilteringExpression_internal();
if (impl.setNativeElement) {
impl.setNativeElement({});
}
return impl;
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
get fieldName() {
return this.i.j;
}
set fieldName(v) {
this.i.j = v;
}
get condition() {
return this.i.b.nativeElement;
}
set condition(v) {
this.i.b = interfaceToInternal(v, () => new FilteringOperation());
}
get conditionName() {
return this.i.i;
}
set conditionName(v) {
this.i.i = v;
}
get searchVal() {
return this.i.h;
}
set searchVal(v) {
this.i.h = v;
}
get searchTree() {
const r = this.i.a;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = new IgrExpressionTree();
if (r.$type) {
e._implementation = r;
}
else {
if (e.i.setNativeElement) {
e.i.setNativeElement(r);
}
}
r.externalObject = e;
}
return r.externalObject;
}
set searchTree(v) {
v == null ? this.i.a = null : this.i.a = v.i;
}
get ignoreCase() {
return this.i.e;
}
set ignoreCase(v) {
this.i.e = ensureBool(v);
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.condition && this.condition.name && this.condition.name == name) {
return this.condition;
}
if (this.searchTree && this.searchTree.name && this.searchTree.name == name) {
return this.searchTree;
}
return null;
}
setNativeElement(element) {
this.i.setNativeElement(element);
}
}