UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

123 lines (122 loc) 3.36 kB
import { ColumnSelectionEventArgsDetail as ColumnSelectionEventArgsDetail_internal } from "./ColumnSelectionEventArgsDetail"; import { ensureBool } from "igniteui-react-core"; /** * The event arguments when the selection state of a column is being changed * The event is cancelable */ export class IgrColumnSelectionEventArgsDetail { createImplementation() { return new ColumnSelectionEventArgsDetail_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(); } } /** * Represents an array of columns, that have already been selected */ get oldSelection() { return this.i.c; } set oldSelection(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.c = v; } /** * Represents the newly selected columns */ get newSelection() { return this.i.b; } set newSelection(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.b = v; } /** * Represents an array of all added columns * Whenever a column has been selected, the array is "refreshed" with the selected columns */ get added() { return this.i.a; } set added(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.a = v; } /** * Represents an array of all columns, removed from the selection * Whenever a column has been deselected, the array is "refreshed" with the columns, that have been previously selected, but are no longer */ get removed() { return this.i.d; } set removed(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.d = v; } /** * Provides the ability to cancel the event. */ get cancel() { return this.i.g; } set cancel(v) { this.i.g = ensureBool(v); } /** * Provides reference to the owner component. */ get owner() { return this.i.j; } set owner(v) { this.i.j = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } setNativeElement(element) { this.i.setNativeElement(element); } }