igniteui-react-core
Version:
Ignite UI React Core.
130 lines (129 loc) • 3.36 kB
JavaScript
import { HighlightingState_$type } from "./HighlightingState";
import { HighlightingInfo as HighlightingInfo_internal } from "./HighlightingInfo";
import { ensureEnum, ensureBool } from "./componentUtil";
/**
* Contains contextual information about a highlighting.
*/
export class IgrHighlightingInfo {
createImplementation() {
return new HighlightingInfo_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 index of the first highlighted item.
*
* You can use `StartIndex` to get or set the first highlighted item for the series.
*/
get startIndex() {
return this.i.g;
}
set startIndex(v) {
this.i.g = +v;
}
/**
* The index of the last highlighted item.
*
* You can use the `EndIndex` to get or set the last highlighted item for the series.
*/
get endIndex() {
return this.i.f;
}
set endIndex(v) {
this.i.f = +v;
}
/**
* The state of the highlighting.
*
* You can use the `State` to get or set the transitioning state of the highlighting, between In, Out, or Static.
*/
get state() {
return this.i.a;
}
set state(v) {
this.i.a = ensureEnum(HighlightingState_$type, v);
}
/**
* A number between 0 and 1 representing the progress of the highlighting.
*
* You can use the `Progress` property to set a number between 0 and 1 representing the progress of the highlighting.
*/
get progress() {
return this.i.e;
}
set progress(v) {
this.i.e = +v;
}
/**
* True if this HighlightingInfo represents a marker highlighting.
*
* You can set the `IsMarker` to True if the HighlightingInfo represents a marker highlighting. Otherwise set to false.
*/
get isMarker() {
return this.i.d;
}
set isMarker(v) {
this.i.d = ensureBool(v);
}
/**
* True if this HighlightingInfo represents a full selection of the data.
*/
get isFullRange() {
return this.i.c;
}
set isFullRange(v) {
this.i.c = ensureBool(v);
}
/**
* TODO
*/
get isExclusive() {
return this.i.b;
}
set isExclusive(v) {
this.i.b = ensureBool(v);
}
/**
* The context for the highlight.
*/
get context() {
return this.i.i;
}
set context(v) {
this.i.i = v;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
return null;
}
}