UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

130 lines (129 loc) 3.22 kB
import { IgrRowType } from "./igr-row-type"; import { PinRowEventArgsDetail as PinRowEventArgsDetail_internal } from "./PinRowEventArgsDetail"; import { ensureBool } from "igniteui-react-core"; /** * Event emitted when a row's pin state changes. * The event is cancelable */ export class IgrPinRowEventArgsDetail { createImplementation() { return new PinRowEventArgsDetail_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; 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(); } } /** * The ID of the row, that was pinned/unpinned. * ID is either the primaryKey value or the data record instance. * @deprecated Use the `rowKey` property instead. */ get rowID() { return this.i.j; } set rowID(v) { this.i.j = v; } get rowKey() { return this.i.k; } set rowKey(v) { this.i.k = v; } get row() { const r = this.i.a; if (r == null) { return null; } if (!r.externalObject) { let e = new IgrRowType(); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; } set row(v) { v == null ? this.i.a = null : this.i.a = v.i; } /** * The index at which to pin the row in the pinned rows collection. */ get insertAtIndex() { return this.i.f; } set insertAtIndex(v) { this.i.f = +v; } /** * Whether or not the row is pinned or unpinned. */ get isPinned() { return this.i.e; } set isPinned(v) { this.i.e = ensureBool(v); } /** * Provides reference to the owner component. */ get owner() { return this.i.i; } set owner(v) { this.i.i = v; } /** * Provides the ability to cancel the event. */ get cancel() { return this.i.d; } set cancel(v) { this.i.d = ensureBool(v); } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.row && this.row.name && this.row.name == name) { return this.row; } return null; } setNativeElement(element) { this.i.setNativeElement(element); } }