igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
88 lines (87 loc) • 3.66 kB
JavaScript
import { BrushSelectionMode_$type } from "./BrushSelectionMode";
import { IgcBrushScaleComponent } from "./igc-brush-scale-component";
import { CustomPaletteBrushScale } from "./CustomPaletteBrushScale";
import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, brushToString } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
/**
* Represents a brush scale that uses index-based brush selection mode.
*/
export let IgcCustomPaletteBrushScaleComponent = /*@__PURE__*/ (() => {
class IgcCustomPaletteBrushScaleComponent extends IgcBrushScaleComponent {
createImplementation() {
return new CustomPaletteBrushScale();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcCustomPaletteBrushScaleComponent._observedAttributesIgcCustomPaletteBrushScaleComponent == null) {
let names = getAllPropertyNames(IgcCustomPaletteBrushScaleComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcCustomPaletteBrushScaleComponent._observedAttributesIgcCustomPaletteBrushScaleComponent = names;
}
return IgcCustomPaletteBrushScaleComponent._observedAttributesIgcCustomPaletteBrushScaleComponent;
}
static register() {
if (!IgcCustomPaletteBrushScaleComponent._isElementRegistered) {
IgcCustomPaletteBrushScaleComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcCustomPaletteBrushScaleComponent.htmlTagName, IgcCustomPaletteBrushScaleComponent);
}
}
/**
* Gets or sets the brush selection mode.
*/
get brushSelectionMode() {
return this.i.brushSelectionMode;
}
set brushSelectionMode(v) {
this.i.brushSelectionMode = ensureEnum(BrushSelectionMode_$type, v);
this._a("brushSelectionMode", enumToString(BrushSelectionMode_$type, this.i.brushSelectionMode));
}
/**
* Checks if this scale is ready for useage with a series
*/
get isReady() {
return this.i.isReady;
}
getBrush1(index, total) {
let iv = this.i.getBrush1(index, total);
return brushToString(iv);
}
}
IgcCustomPaletteBrushScaleComponent._observedAttributesIgcCustomPaletteBrushScaleComponent = null;
IgcCustomPaletteBrushScaleComponent.htmlTagName = "igc-custom-palette-brush-scale";
IgcCustomPaletteBrushScaleComponent._isElementRegistered = false;
return IgcCustomPaletteBrushScaleComponent;
})();