UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

153 lines (152 loc) 5.61 kB
import { DataSourceSchemaPropertyType_$type } from "igniteui-react-core"; import { IgrGridFilterDialogViewModelGroupingLevelCollection } from "./igr-grid-filter-dialog-view-model-grouping-level-collection"; import { IgrGridFilterDialogViewModelRowCollection } from "./igr-grid-filter-dialog-view-model-row-collection"; import { GridFilterDialogViewModel as GridFilterDialogViewModel_internal } from "./GridFilterDialogViewModel"; import { ensureEnum, ensureBool } from "igniteui-react-core"; import { GridFilterDialogViewModelGroupingLevelCollection as GridFilterDialogViewModelGroupingLevelCollection_internal } from "./GridFilterDialogViewModelGroupingLevelCollection"; import { GridFilterDialogViewModelGroupingLevel } from "./GridFilterDialogViewModelGroupingLevel"; import { SyncableObservableCollection$1 } from "igniteui-react-core"; import { GridFilterDialogViewModelRowCollection as GridFilterDialogViewModelRowCollection_internal } from "./GridFilterDialogViewModelRowCollection"; import { GridFilterDialogViewModelRow } from "./GridFilterDialogViewModelRow"; export class IgrGridFilterDialogViewModel { createImplementation() { return new GridFilterDialogViewModel_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._groupingLevels = null; this._rows = null; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } get propertyType() { return this.i.a; } set propertyType(v) { this.i.a = ensureEnum(DataSourceSchemaPropertyType_$type, v); } get groupingLevels() { if (this._groupingLevels === null) { let coll = new IgrGridFilterDialogViewModelGroupingLevelCollection(); let innerColl = this.i.e; if (!innerColl) { innerColl = new GridFilterDialogViewModelGroupingLevelCollection_internal(); } this._groupingLevels = coll._fromInner(innerColl); this.i.e = innerColl; } return this._groupingLevels; } set groupingLevels(v) { if (this._groupingLevels !== null) { this._groupingLevels._setSyncTarget(null); this._groupingLevels = null; } let coll = new IgrGridFilterDialogViewModelGroupingLevelCollection(); this._groupingLevels = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(GridFilterDialogViewModelGroupingLevel.$type); let innerColl = this.i.e; if (!innerColl) { innerColl = new GridFilterDialogViewModelGroupingLevelCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._groupingLevels._setSyncTarget(syncColl); this.i.e = innerColl; } get isTopLevelOr() { return this.i.k; } set isTopLevelOr(v) { this.i.k = ensureBool(v); } get maxGroupingLevels() { return this.i.m; } set maxGroupingLevels(v) { this.i.m = +v; } get rows() { if (this._rows === null) { let coll = new IgrGridFilterDialogViewModelRowCollection(); let innerColl = this.i.f; if (!innerColl) { innerColl = new GridFilterDialogViewModelRowCollection_internal(); } this._rows = coll._fromInner(innerColl); this.i.f = innerColl; } return this._rows; } set rows(v) { if (this._rows !== null) { this._rows._setSyncTarget(null); this._rows = null; } let coll = new IgrGridFilterDialogViewModelRowCollection(); this._rows = coll._fromOuter(v); let syncColl = new SyncableObservableCollection$1(GridFilterDialogViewModelRow.$type); let innerColl = this.i.f; if (!innerColl) { innerColl = new GridFilterDialogViewModelRowCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._rows._setSyncTarget(syncColl); this.i.f = innerColl; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.rows != null && this.rows.findByName && this.rows.findByName(name)) { return this.rows.findByName(name); } return null; } addNewRow() { this.i.n(); } canGroupRange(startIndex, endIndex) { let iv = this.i.h(startIndex, endIndex); return (iv); } ungroupRange(startIndex, endIndex) { this.i.aa(startIndex, endIndex); } targetingRange(startIndex, endIndex) { let iv = this.i.l(startIndex, endIndex); return (iv); } toggleRange(startIndex, endIndex) { this.i.z(startIndex, endIndex); } groupRange(startIndex, endIndex, isOrGrouping) { this.i.o(startIndex, endIndex, isOrGrouping); } }