UNPKG

igniteui-react-core

Version:
68 lines (67 loc) 1.97 kB
import { GridLayoutSizeType_$type } from "./GridLayoutSizeType"; import { GridLayoutSizeDefinition as GridLayoutSizeDefinition_internal } from "./GridLayoutSizeDefinition"; import { ensureEnum } from "./componentUtil"; /** * Represents a size ruleset for rows and columns in the grid view. */ export class IgrGridLayoutSizeDefinition { createImplementation() { return new GridLayoutSizeDefinition_internal(0); } 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(); } } /** * Gets or sets the size type for the definition. */ get sizeType() { return this.i.a; } set sizeType(v) { this.i.a = ensureEnum(GridLayoutSizeType_$type, v); } /** * Gets or sets the value for the definition. This value is treated differently depending * on the size type specified. For example, Star sizing will treat this property as a * weighted percentage relative to other Star sized definitions. */ get value() { return this.i.b; } set value(v) { this.i.b = +v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } }