UNPKG

igniteui-react-grids

Version:

Ignite UI React grid components.

73 lines (72 loc) 2.07 kB
import { GridClipboardEventDetail as GridClipboardEventDetail_internal } from "./GridClipboardEventDetail"; import { ensureBool } from "igniteui-react-core"; /** * The event arguments when data from a grid is being copied. */ export class IgrGridClipboardEventDetail { createImplementation() { return new GridClipboardEventDetail_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(); } } /** * `data` can be of any type and refers to the data that is being copied/stored to the clipboard */ get data() { return this.i.a; } set data(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.a = v; } /** * `cancel` returns whether an external event has intercepted the copying * If the value becomes "true", it returns/exits from the method, instantiating the interface */ 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); } } return null; } setNativeElement(element) { this.i.setNativeElement(element); } }