igniteui-angular-inputs
Version:
Ignite UI Angular input components for building rich data visualizations for modern web apps.
643 lines (639 loc) • 23.5 kB
JavaScript
import { EventEmitter, Output, Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxMultiSliderThumbCollection } from "./igx-multi-slider-thumb-collection";
import { MultiSliderOrientation_$type } from "./MultiSliderOrientation";
import { IgxMultiSliderResolvingToolTipValueEventArgs } from "./igx-multi-slider-resolving-tool-tip-value-event-args";
import { IgxMultiSliderThumbValueChangingEventArgs } from "./igx-multi-slider-thumb-value-changing-event-args";
import { IgxMultiSliderYValueChangingEventArgs } from "./igx-multi-slider-y-value-changing-event-args";
import { MultiSlider } from "./MultiSlider";
import { TypeRegistrar } from "igniteui-angular-core";
import { NamePatcher, fromRect, toRect, ensureEnum, brushToString, stringToBrush, ensureBool, toSpinal, initializePropertiesFromCss } from "igniteui-angular-core";
import { MultiSliderThumbCollection as MultiSliderThumbCollection_internal } from "./MultiSliderThumbCollection";
import { MultiSliderThumb } from "./MultiSliderThumb";
import { SyncableObservableCollection$1 } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import * as i0 from "@angular/core";
export let IgxMultiSliderComponent = /*@__PURE__*/ (() => {
class IgxMultiSliderComponent {
constructor() {
this._thumbs = null;
this.__p = null;
this._hasUserValues = new Set();
this._stylingContainer = null;
this._stylingParent = null;
this._inStyling = false;
this._resolvingToolTipValue = null;
this._thumbValueChanging = null;
this._thumbValueChanged = null;
this._yValueChanging = null;
this._yValueChanged = null;
this._zoneRunner = null;
if (this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
}
this._implementation = this.createImplementation();
this._implementation.externalObject = this;
this.onImplementationCreated();
if (this._initializeAdapters) {
this._initializeAdapters();
}
}
createImplementation() {
return new MultiSlider();
}
ngOnInit() {
}
/**
* @hidden
*/
get i() {
return this._implementation;
} /**
* @hidden
*/
static _createFromInternal(internal) {
if (!internal) {
return null;
}
if (!internal.$type) {
return null;
}
let name = internal.$type.name;
let externalName = "Igx" + name + "Component";
if (!TypeRegistrar.isRegistered(externalName)) {
return null;
}
return TypeRegistrar.create(externalName);
}
onImplementationCreated() {
}
/**
* Gets the column definitions that are assigned to the grid. This collection can be modified to add or remove columns in the grid.
*/
get thumbs() {
if (this._thumbs === null) {
let coll = new IgxMultiSliderThumbCollection();
let innerColl = this.i.thumbs;
if (!innerColl) {
innerColl = new MultiSliderThumbCollection_internal();
}
this._thumbs = coll._fromInner(innerColl);
}
return this._thumbs;
}
set thumbs(v) {
if (this._thumbs !== null) {
this._thumbs._setSyncTarget(null);
this._thumbs = null;
}
let coll = new IgxMultiSliderThumbCollection();
this._thumbs = coll._fromOuter(v);
let syncColl = new SyncableObservableCollection$1(MultiSliderThumb.$type);
let innerColl = this.i.thumbs;
if (!innerColl) {
innerColl = new MultiSliderThumbCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._thumbs._setSyncTarget(syncColl);
}
get min() {
return this.i.bg;
}
set min(v) {
this.i.bg = +v;
}
get max() {
return this.i.bf;
}
set max(v) {
this.i.bf = +v;
}
get step() {
return this.i.bl;
}
set step(v) {
this.i.bl = +v;
}
get yMax() {
return this.i.bu;
}
set yMax(v) {
this.i.bu = +v;
}
get yMin() {
return this.i.bv;
}
set yMin(v) {
this.i.bv = +v;
}
get yStep() {
return this.i.bx;
}
set yStep(v) {
this.i.bx = +v;
}
/**
* Gets or sets the scaling value used to affect the pixel density of the control.
* A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control
* to appear blurry.
*/
get pixelScalingRatio() {
return this.i.bh;
}
set pixelScalingRatio(v) {
this.i.bh = +v;
}
get actualPixelScalingRatio() {
return this.i.a9;
}
set actualPixelScalingRatio(v) {
this.i.a9 = +v;
}
get windowRect() {
return fromRect(this.i.e1);
}
set windowRect(v) {
this.i.e1 = toRect(v);
}
get yValue() {
return this.i.b0;
}
set yValue(v) {
this.i.b0 = +v;
}
get startInset() {
return this.i.bk;
}
set startInset(v) {
this.i.bk = +v;
}
get endInset() {
return this.i.be;
}
set endInset(v) {
this.i.be = +v;
}
get trackStartInset() {
return this.i.bq;
}
set trackStartInset(v) {
this.i.bq = +v;
}
get trackEndInset() {
return this.i.bp;
}
set trackEndInset(v) {
this.i.bp = +v;
}
get yTrackStartInset() {
return this.i.bz;
}
set yTrackStartInset(v) {
this.i.bz = +v;
}
get yTrackEndInset() {
return this.i.by;
}
set yTrackEndInset(v) {
this.i.by = +v;
}
get barExtent() {
return this.i.bb;
}
set barExtent(v) {
this.i.bb = +v;
}
get orientation() {
return this.i.e;
}
set orientation(v) {
this.i.e = ensureEnum(MultiSliderOrientation_$type, v);
}
get thumbBrush() {
return brushToString(this.i.es);
}
set thumbBrush(v) {
this.i.es = stringToBrush(v);
}
get thumbStrokeThickness() {
return this.i.bn;
}
set thumbStrokeThickness(v) {
this.i.bn = +v;
}
get thumbOutline() {
return brushToString(this.i.et);
}
set thumbOutline(v) {
this.i.et = stringToBrush(v);
}
get thumbWidth() {
return this.i.bo;
}
set thumbWidth(v) {
this.i.bo = +v;
}
get thumbHeight() {
return this.i.bm;
}
set thumbHeight(v) {
this.i.bm = +v;
}
get barBrush() {
return brushToString(this.i.ek);
}
set barBrush(v) {
this.i.ek = stringToBrush(v);
}
get barOutline() {
return brushToString(this.i.el);
}
set barOutline(v) {
this.i.el = stringToBrush(v);
}
get barStrokeThickness() {
return this.i.bc;
}
set barStrokeThickness(v) {
this.i.bc = +v;
}
get rangeThumbBrush() {
return brushToString(this.i.ep);
}
set rangeThumbBrush(v) {
this.i.ep = stringToBrush(v);
}
get rangeThumbOutline() {
return brushToString(this.i.eq);
}
set rangeThumbOutline(v) {
this.i.eq = stringToBrush(v);
}
get rangeThumbStrokeThickness() {
return this.i.bj;
}
set rangeThumbStrokeThickness(v) {
this.i.bj = +v;
}
get rangeThumbRidgesBrush() {
return brushToString(this.i.er);
}
set rangeThumbRidgesBrush(v) {
this.i.er = stringToBrush(v);
}
get thumbRidgesBrush() {
return brushToString(this.i.eu);
}
set thumbRidgesBrush(v) {
this.i.eu = stringToBrush(v);
}
get calloutBrush() {
return brushToString(this.i.em);
}
set calloutBrush(v) {
this.i.em = stringToBrush(v);
}
get calloutTextColor() {
return brushToString(this.i.eo);
}
set calloutTextColor(v) {
this.i.eo = stringToBrush(v);
}
get calloutOutline() {
return brushToString(this.i.en);
}
set calloutOutline(v) {
this.i.en = stringToBrush(v);
}
get calloutStrokeThickness() {
return this.i.bd;
}
set calloutStrokeThickness(v) {
this.i.bd = +v;
}
get isCustomThumbProvided() {
return this.i.ac;
}
get isCustomRangeThumbProvided() {
return this.i.aa;
}
get isCustomBarProvided() {
return this.i.z;
}
get isCustomShadeProvided() {
return this.i.ab;
}
get areThumbCalloutsEnabled() {
return this.i.t;
}
set areThumbCalloutsEnabled(v) {
this.i.t = ensureBool(v);
}
get thumbCalloutTextStyle() {
if (this.i.p == null) {
return null;
}
return this.i.p.fontString;
}
set thumbCalloutTextStyle(v) {
let fi = new FontInfo();
fi.fontString = v;
this.i.p = fi;
}
findByName(name) {
if (this.findEphemera) {
if (name && name.indexOf("@@e:") == 0) {
return this.findEphemera(name);
}
}
if (this.thumbs != null && this.thumbs.findByName && this.thumbs.findByName(name)) {
return this.thumbs.findByName(name);
}
return null;
}
get hasUserValues() {
return this._hasUserValues;
}
__m(propertyName) {
if (!this._inStyling) {
this._hasUserValues.add(propertyName);
}
}
_styling(container, component, parent) {
if (this._inStyling) {
return;
}
this._inStyling = true;
this._stylingContainer = container;
this._stylingParent = component;
let genericPrefix = "";
let typeName = this.i.$type.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
genericPrefix = toSpinal("MultiSliderComponent");
let additionalPrefixes = [];
let prefix = toSpinal(typeName);
additionalPrefixes.push(prefix + "-");
let b = this.i.$type.baseType;
while (b && b.name != "Object" &&
b.name != "Base" &&
b.name != "Control" &&
b.Name != "DependencyObject" &&
b.Name != "FrameworkElement") {
typeName = b.name;
if (typeName.indexOf("Xam") === 0) {
typeName = typeName.substring(3);
}
let basePrefix = toSpinal(typeName);
additionalPrefixes.push(basePrefix + "-");
b = b.baseType;
}
if (parent) {
let parentTypeName = parent.i.$type.name;
if (parentTypeName.indexOf("Xam") === 0) {
parentTypeName = parentTypeName.substring(3);
}
let parentPrefix = toSpinal(parentTypeName);
additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
}
initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
if (this._otherStyling) {
this._otherStyling(container, component, parent);
}
this._inStyling = false;
}
onDetachedFromUI() {
this.i.onDetachedFromUI();
}
onAttachedToUI() {
this.i.onAttachedToUI();
}
/**
* Called by the UI framework to provide a UI container for rendering this control.
* @param container * The UI container element.
*/
provideContainer(container) {
this.i.provideContainer(container);
}
flush() {
this.i.c7();
}
trackDirty() {
this.i.trackDirty();
}
/**
* Shows the ZoomSlider.
*/
show() {
this.i.dw();
}
/**
* Hides the ZoomSlider.
*/
hide() {
this.i.c8();
}
get resolvingToolTipValue() {
if (this._resolvingToolTipValue == null) {
this._resolvingToolTipValue = new EventEmitter();
this.i.resolvingToolTipValue = delegateCombine(this.i.resolvingToolTipValue, (o, e) => {
let outerArgs = new IgxMultiSliderResolvingToolTipValueEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeResolvingToolTipValue) {
this.beforeResolvingToolTipValue(this, outerArgs);
}
this._resolvingToolTipValue.emit({
sender: this,
args: outerArgs
});
});
}
return this._resolvingToolTipValue;
}
get thumbValueChanging() {
if (this._thumbValueChanging == null) {
this._thumbValueChanging = new EventEmitter();
this.i.thumbValueChanging = delegateCombine(this.i.thumbValueChanging, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxMultiSliderThumbValueChangingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeThumbValueChanging) {
this.beforeThumbValueChanging(this, outerArgs);
}
this._thumbValueChanging.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._thumbValueChanging;
}
get thumbValueChanged() {
if (this._thumbValueChanged == null) {
this._thumbValueChanged = new EventEmitter();
this.i.thumbValueChanged = delegateCombine(this.i.thumbValueChanged, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxMultiSliderThumbValueChangingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeThumbValueChanged) {
this.beforeThumbValueChanged(this, outerArgs);
}
this._thumbValueChanged.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._thumbValueChanged;
}
get yValueChanging() {
if (this._yValueChanging == null) {
this._yValueChanging = new EventEmitter();
this.i.yValueChanging = delegateCombine(this.i.yValueChanging, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxMultiSliderYValueChangingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeYValueChanging) {
this.beforeYValueChanging(this, outerArgs);
}
this._yValueChanging.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._yValueChanging;
}
get yValueChanged() {
if (this._yValueChanged == null) {
this._yValueChanged = new EventEmitter();
this.i.yValueChanged = delegateCombine(this.i.yValueChanged, (o, e) => {
this._runInZone(() => {
let outerArgs = new IgxMultiSliderYValueChangingEventArgs();
outerArgs._provideImplementation(e);
if (this.beforeYValueChanged) {
this.beforeYValueChanged(this, outerArgs);
}
this._yValueChanged.emit({
sender: this,
args: outerArgs
});
});
});
}
return this._yValueChanged;
}
_runInZone(act) {
if (this._zoneRunner != null) {
this._zoneRunner(act);
}
else {
act();
}
}
}
IgxMultiSliderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxMultiSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxMultiSliderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxMultiSliderComponent, selector: "igx-multi-slider", inputs: { thumbs: "thumbs", min: "min", max: "max", step: "step", yMax: "yMax", yMin: "yMin", yStep: "yStep", pixelScalingRatio: "pixelScalingRatio", actualPixelScalingRatio: "actualPixelScalingRatio", windowRect: "windowRect", yValue: "yValue", startInset: "startInset", endInset: "endInset", trackStartInset: "trackStartInset", trackEndInset: "trackEndInset", yTrackStartInset: "yTrackStartInset", yTrackEndInset: "yTrackEndInset", barExtent: "barExtent", orientation: "orientation", thumbBrush: "thumbBrush", thumbStrokeThickness: "thumbStrokeThickness", thumbOutline: "thumbOutline", thumbWidth: "thumbWidth", thumbHeight: "thumbHeight", barBrush: "barBrush", barOutline: "barOutline", barStrokeThickness: "barStrokeThickness", rangeThumbBrush: "rangeThumbBrush", rangeThumbOutline: "rangeThumbOutline", rangeThumbStrokeThickness: "rangeThumbStrokeThickness", rangeThumbRidgesBrush: "rangeThumbRidgesBrush", thumbRidgesBrush: "thumbRidgesBrush", calloutBrush: "calloutBrush", calloutTextColor: "calloutTextColor", calloutOutline: "calloutOutline", calloutStrokeThickness: "calloutStrokeThickness", areThumbCalloutsEnabled: "areThumbCalloutsEnabled", thumbCalloutTextStyle: "thumbCalloutTextStyle" }, outputs: { resolvingToolTipValue: "resolvingToolTipValue", thumbValueChanging: "thumbValueChanging", thumbValueChanged: "thumbValueChanged", yValueChanging: "yValueChanging", yValueChanged: "yValueChanged" }, providers: [], ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxMultiSliderComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxMultiSliderComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-multi-slider',
template: ``,
providers: [],
changeDetection: ChangeDetectionStrategy.OnPush
}]
}], ctorParameters: function () { return []; }, propDecorators: { thumbs: [{
type: Input
}], min: [{
type: Input
}], max: [{
type: Input
}], step: [{
type: Input
}], yMax: [{
type: Input
}], yMin: [{
type: Input
}], yStep: [{
type: Input
}], pixelScalingRatio: [{
type: Input
}], actualPixelScalingRatio: [{
type: Input
}], windowRect: [{
type: Input
}], yValue: [{
type: Input
}], startInset: [{
type: Input
}], endInset: [{
type: Input
}], trackStartInset: [{
type: Input
}], trackEndInset: [{
type: Input
}], yTrackStartInset: [{
type: Input
}], yTrackEndInset: [{
type: Input
}], barExtent: [{
type: Input
}], orientation: [{
type: Input
}], thumbBrush: [{
type: Input
}], thumbStrokeThickness: [{
type: Input
}], thumbOutline: [{
type: Input
}], thumbWidth: [{
type: Input
}], thumbHeight: [{
type: Input
}], barBrush: [{
type: Input
}], barOutline: [{
type: Input
}], barStrokeThickness: [{
type: Input
}], rangeThumbBrush: [{
type: Input
}], rangeThumbOutline: [{
type: Input
}], rangeThumbStrokeThickness: [{
type: Input
}], rangeThumbRidgesBrush: [{
type: Input
}], thumbRidgesBrush: [{
type: Input
}], calloutBrush: [{
type: Input
}], calloutTextColor: [{
type: Input
}], calloutOutline: [{
type: Input
}], calloutStrokeThickness: [{
type: Input
}], areThumbCalloutsEnabled: [{
type: Input
}], thumbCalloutTextStyle: [{
type: Input
}], resolvingToolTipValue: [{
type: Output
}], thumbValueChanging: [{
type: Output
}], thumbValueChanged: [{
type: Output
}], yValueChanging: [{
type: Output
}], yValueChanged: [{
type: Output
}] } });