UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

141 lines (140 loc) 3.95 kB
import { DataSourceSchemaPropertyType_$type } from "igniteui-react-core"; import { IgrGridFilterOperandsCollection } from "./igr-grid-filter-operands-collection"; import { IgrCellInfo } from "./igr-cell-info"; import { FilterCellModel as FilterCellModel_internal } from "./FilterCellModel"; import { ensureEnum } from "igniteui-react-core"; import { GridFilterOperandsCollection as GridFilterOperandsCollection_internal } from "./GridFilterOperandsCollection"; import { FilterOperand } from "./FilterOperand"; import { SyncableObservableCollection$1 } from "igniteui-react-core"; /** * Represents info about the current cell. */ export class IgrFilterCellInfo extends IgrCellInfo { createImplementation() { return new FilterCellModel_internal(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); this._filterOperands = null; } /** * Gets or sets whether the cell is hit test visible. */ get dataType() { return this.i.mk; } set dataType(v) { this.i.mk = ensureEnum(DataSourceSchemaPropertyType_$type, v); } /** * Gets or sets the current filter to display in the cell. */ get filter() { return this.i.mi; } set filter(v) { this.i.mi = v; } /** * Gets or sets the current filter expression applied to the column. */ get filterExpression() { return this.i.mm; } set filterExpression(v) { this.i.mm = v; } get filterOperands() { if (this._filterOperands === null) { let coll = new IgrGridFilterOperandsCollection(); let innerColl = this.i.mo; if (!innerColl) { innerColl = new GridFilterOperandsCollection_internal(); } this._filterOperands = coll._fromInner(innerColl); this.i.mo = innerColl; } return this._filterOperands; } set filterOperands(v) { if (this._filterOperands !== null) { this._filterOperands._setSyncTarget(null); this._filterOperands = null; } let coll = new IgrGridFilterOperandsCollection(); this._filterOperands = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(FilterOperand.$type); let innerColl = this.i.mo; if (!innerColl) { innerColl = new GridFilterOperandsCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._filterOperands._setSyncTarget(syncColl); this.i.mo = innerColl; } get operatorType() { return this.i.mg; } set operatorType(v) { this.i.mg = v; } get filterValue() { return this.i.m2; } set filterValue(v) { this.i.m2 = v; } get selectorTop() { return this.i.mw; } set selectorTop(v) { this.i.mw = +v; } get selectorLeft() { return this.i.mv; } set selectorLeft(v) { this.i.mv = +v; } get editorTop() { return this.i.mu; } set editorTop(v) { this.i.mu = +v; } get editorLeft() { return this.i.mt; } set editorLeft(v) { this.i.mt = +v; } get clearIconTop() { return this.i.ms; } set clearIconTop(v) { this.i.ms = +v; } get clearIconLeft() { return this.i.mr; } set clearIconLeft(v) { this.i.mr = +v; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.filterOperands != null && this.filterOperands.findByName && this.filterOperands.findByName(name)) { return this.filterOperands.findByName(name); } return null; } }