igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
163 lines (162 loc) • 4.68 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 IgxHighlightingInfo {
constructor() {
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
createImplementation() {
return new HighlightingInfo_internal();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
onImplementationCreated() {
}
_provideImplementation(i) {
this._implementation = i;
this._implementation.externalObject = this;
this.onImplementationCreated();
}
/**
* The index of the first highlighted item.
*
* You can use `StartIndex` to get or set the first highlighted item for the series.
*
* ```html
* <igx-column-series
* #series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true" (assigningCategoryStyle)="assigningSeries($event)" >
* </igx-column-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.
*
* ```html
* <igx-column-series
* #series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true" (assigningCategoryStyle)="assigningSeries($event)" >
* </igx-column-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.
*
* ```html
* <igx-column-series
* #series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true" (assigningCategoryStyle)="assigningSeries($event)" >
* </igx-column-series>
* ```
*/
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.
*
* ```html
* <igx-column-series
* #series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* isHighlightingEnabled="true" isCustomCategoryStyleAllowed="true" (assigningCategoryStyle)="assigningSeries($event)" >
* </igx-column-series>
* ```
*/
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;
}
}