UNPKG

igniteui-react-core

Version:
74 lines (73 loc) 1.76 kB
import { TransactionType_$type } from "./TransactionType"; import { ensureEnum } from "./componentUtil"; /** * Represents the final state of items with all transactions combined. */ export class IgrTransactionState { get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } /** * Gets or sets the ID for the state. I.e. an items primary key. */ get id() { return this.i.id; } set id(v) { this.i.id = v; } /** * Gets or sets how this state was created. */ get transactionType() { return this.i.transactionType; } set transactionType(v) { this.i.transactionType = ensureEnum(TransactionType_$type, v); } /** * Gets or sets the final value with all transaction deltas combined. */ get value() { return this.i.value; } set value(v) { this.i.value = v; } /** * Gets or sets the version data for this item. Used for concurrency. */ get version() { return this.i.version; } set version(v) { this.i.version = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } }