UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

86 lines (85 loc) 2.74 kB
import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { IgrGridBaseDirective } from "./igr-grid-base-directive"; import { IgrForOfStateEventArgs } from "./igr-for-of-state-event-args"; import { ensureBool } from "igniteui-react-core"; export class IgrHierarchicalGridBaseDirective extends IgrGridBaseDirective { /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); this._dataPreLoad = null; this._dataPreLoad_wrapped = null; } get hasChildrenKey() { return this.i.g3; } set hasChildrenKey(v) { this.i.g3 = v; } get showExpandAll() { return this.i.g2; } set showExpandAll(v) { this.i.g2 = ensureBool(v); } get rootGrid() { const r = this.i.g1; if (r == null) { return null; } return r.externalObject; } set rootGrid(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.g1 = null : this.i.g1 = v.i; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.rootGrid && this.rootGrid.name && this.rootGrid.name == name) { return this.rootGrid; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.rootGrid && this.rootGrid._styling) { this.rootGrid._styling(container, component, this); } this._inStyling = false; } get dataPreLoad() { return this._dataPreLoad; } set dataPreLoad(ev) { if (this._dataPreLoad_wrapped !== null) { this.i.dataPreLoad = delegateRemove(this.i.dataPreLoad, this._dataPreLoad_wrapped); this._dataPreLoad_wrapped = null; this._dataPreLoad = null; } this._dataPreLoad = ev; this._dataPreLoad_wrapped = (o, e) => { let outerArgs = new IgrForOfStateEventArgs(); outerArgs._provideImplementation(e); if (this.beforeDataPreLoad) { this.beforeDataPreLoad(this, outerArgs); } if (this._dataPreLoad) { this._dataPreLoad(this, outerArgs); } }; this.i.dataPreLoad = delegateCombine(this.i.dataPreLoad, this._dataPreLoad_wrapped); if (this.i.dataPreLoadChanged) { this.i.dataPreLoadChanged(); } ; } }