UNPKG

igniteui-angular-inputs

Version:

Ignite UI Angular input components for building rich data visualizations for modern web apps.

843 lines (839 loc) 30.7 kB
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"; var IgxMultiSliderComponent = /** @class */ /*@__PURE__*/ (function () { function IgxMultiSliderComponent() { 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(); } } IgxMultiSliderComponent.prototype.createImplementation = function () { return new MultiSlider(); }; IgxMultiSliderComponent.prototype.ngOnInit = function () { }; Object.defineProperty(IgxMultiSliderComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; } /** * @hidden */, enumerable: false, configurable: true }); IgxMultiSliderComponent._createFromInternal = function (internal) { if (!internal) { return null; } if (!internal.$type) { return null; } var name = internal.$type.name; var externalName = "Igx" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); }; IgxMultiSliderComponent.prototype.onImplementationCreated = function () { }; Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbs", { /** * Gets the column definitions that are assigned to the grid. This collection can be modified to add or remove columns in the grid. */ get: function () { if (this._thumbs === null) { var coll = new IgxMultiSliderThumbCollection(); var innerColl = this.i.thumbs; if (!innerColl) { innerColl = new MultiSliderThumbCollection_internal(); } this._thumbs = coll._fromInner(innerColl); } return this._thumbs; }, set: function (v) { if (this._thumbs !== null) { this._thumbs._setSyncTarget(null); this._thumbs = null; } var coll = new IgxMultiSliderThumbCollection(); this._thumbs = coll._fromOuter(v); var syncColl = new SyncableObservableCollection$1(MultiSliderThumb.$type); var innerColl = this.i.thumbs; if (!innerColl) { innerColl = new MultiSliderThumbCollection_internal(); } syncColl._inner = innerColl; syncColl.clear(); this._thumbs._setSyncTarget(syncColl); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "min", { get: function () { return this.i.bg; }, set: function (v) { this.i.bg = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "max", { get: function () { return this.i.bf; }, set: function (v) { this.i.bf = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "step", { get: function () { return this.i.bl; }, set: function (v) { this.i.bl = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yMax", { get: function () { return this.i.bu; }, set: function (v) { this.i.bu = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yMin", { get: function () { return this.i.bv; }, set: function (v) { this.i.bv = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yStep", { get: function () { return this.i.bx; }, set: function (v) { this.i.bx = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "pixelScalingRatio", { /** * 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: function () { return this.i.bh; }, set: function (v) { this.i.bh = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "actualPixelScalingRatio", { get: function () { return this.i.a9; }, set: function (v) { this.i.a9 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "windowRect", { get: function () { return fromRect(this.i.e1); }, set: function (v) { this.i.e1 = toRect(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yValue", { get: function () { return this.i.b0; }, set: function (v) { this.i.b0 = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "startInset", { get: function () { return this.i.bk; }, set: function (v) { this.i.bk = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "endInset", { get: function () { return this.i.be; }, set: function (v) { this.i.be = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "trackStartInset", { get: function () { return this.i.bq; }, set: function (v) { this.i.bq = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "trackEndInset", { get: function () { return this.i.bp; }, set: function (v) { this.i.bp = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yTrackStartInset", { get: function () { return this.i.bz; }, set: function (v) { this.i.bz = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yTrackEndInset", { get: function () { return this.i.by; }, set: function (v) { this.i.by = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "barExtent", { get: function () { return this.i.bb; }, set: function (v) { this.i.bb = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "orientation", { get: function () { return this.i.e; }, set: function (v) { this.i.e = ensureEnum(MultiSliderOrientation_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbBrush", { get: function () { return brushToString(this.i.es); }, set: function (v) { this.i.es = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbStrokeThickness", { get: function () { return this.i.bn; }, set: function (v) { this.i.bn = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbOutline", { get: function () { return brushToString(this.i.et); }, set: function (v) { this.i.et = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbWidth", { get: function () { return this.i.bo; }, set: function (v) { this.i.bo = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbHeight", { get: function () { return this.i.bm; }, set: function (v) { this.i.bm = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "barBrush", { get: function () { return brushToString(this.i.ek); }, set: function (v) { this.i.ek = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "barOutline", { get: function () { return brushToString(this.i.el); }, set: function (v) { this.i.el = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "barStrokeThickness", { get: function () { return this.i.bc; }, set: function (v) { this.i.bc = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "rangeThumbBrush", { get: function () { return brushToString(this.i.ep); }, set: function (v) { this.i.ep = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "rangeThumbOutline", { get: function () { return brushToString(this.i.eq); }, set: function (v) { this.i.eq = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "rangeThumbStrokeThickness", { get: function () { return this.i.bj; }, set: function (v) { this.i.bj = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "rangeThumbRidgesBrush", { get: function () { return brushToString(this.i.er); }, set: function (v) { this.i.er = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbRidgesBrush", { get: function () { return brushToString(this.i.eu); }, set: function (v) { this.i.eu = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "calloutBrush", { get: function () { return brushToString(this.i.em); }, set: function (v) { this.i.em = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "calloutTextColor", { get: function () { return brushToString(this.i.eo); }, set: function (v) { this.i.eo = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "calloutOutline", { get: function () { return brushToString(this.i.en); }, set: function (v) { this.i.en = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "calloutStrokeThickness", { get: function () { return this.i.bd; }, set: function (v) { this.i.bd = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "isCustomThumbProvided", { get: function () { return this.i.ac; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "isCustomRangeThumbProvided", { get: function () { return this.i.aa; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "isCustomBarProvided", { get: function () { return this.i.z; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "isCustomShadeProvided", { get: function () { return this.i.ab; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "areThumbCalloutsEnabled", { get: function () { return this.i.t; }, set: function (v) { this.i.t = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbCalloutTextStyle", { get: function () { if (this.i.p == null) { return null; } return this.i.p.fontString; }, set: function (v) { var fi = new FontInfo(); fi.fontString = v; this.i.p = fi; }, enumerable: false, configurable: true }); IgxMultiSliderComponent.prototype.findByName = function (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; }; Object.defineProperty(IgxMultiSliderComponent.prototype, "hasUserValues", { get: function () { return this._hasUserValues; }, enumerable: false, configurable: true }); IgxMultiSliderComponent.prototype.__m = function (propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } }; IgxMultiSliderComponent.prototype._styling = function (container, component, parent) { if (this._inStyling) { return; } this._inStyling = true; this._stylingContainer = container; this._stylingParent = component; var genericPrefix = ""; var typeName = this.i.$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("MultiSliderComponent"); var additionalPrefixes = []; var prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); var 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); } var basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { var parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } var 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; }; IgxMultiSliderComponent.prototype.onDetachedFromUI = function () { this.i.onDetachedFromUI(); }; IgxMultiSliderComponent.prototype.onAttachedToUI = function () { this.i.onAttachedToUI(); }; /** * Called by the UI framework to provide a UI container for rendering this control. * @param container * The UI container element. */ IgxMultiSliderComponent.prototype.provideContainer = function (container) { this.i.provideContainer(container); }; IgxMultiSliderComponent.prototype.flush = function () { this.i.c7(); }; IgxMultiSliderComponent.prototype.trackDirty = function () { this.i.trackDirty(); }; /** * Shows the ZoomSlider. */ IgxMultiSliderComponent.prototype.show = function () { this.i.dw(); }; /** * Hides the ZoomSlider. */ IgxMultiSliderComponent.prototype.hide = function () { this.i.c8(); }; Object.defineProperty(IgxMultiSliderComponent.prototype, "resolvingToolTipValue", { get: function () { var _this = this; if (this._resolvingToolTipValue == null) { this._resolvingToolTipValue = new EventEmitter(); this.i.resolvingToolTipValue = delegateCombine(this.i.resolvingToolTipValue, function (o, e) { var outerArgs = new IgxMultiSliderResolvingToolTipValueEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeResolvingToolTipValue) { _this.beforeResolvingToolTipValue(_this, outerArgs); } _this._resolvingToolTipValue.emit({ sender: _this, args: outerArgs }); }); } return this._resolvingToolTipValue; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbValueChanging", { get: function () { var _this = this; if (this._thumbValueChanging == null) { this._thumbValueChanging = new EventEmitter(); this.i.thumbValueChanging = delegateCombine(this.i.thumbValueChanging, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxMultiSliderThumbValueChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeThumbValueChanging) { _this.beforeThumbValueChanging(_this, outerArgs); } _this._thumbValueChanging.emit({ sender: _this, args: outerArgs }); }); }); } return this._thumbValueChanging; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "thumbValueChanged", { get: function () { var _this = this; if (this._thumbValueChanged == null) { this._thumbValueChanged = new EventEmitter(); this.i.thumbValueChanged = delegateCombine(this.i.thumbValueChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxMultiSliderThumbValueChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeThumbValueChanged) { _this.beforeThumbValueChanged(_this, outerArgs); } _this._thumbValueChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._thumbValueChanged; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yValueChanging", { get: function () { var _this = this; if (this._yValueChanging == null) { this._yValueChanging = new EventEmitter(); this.i.yValueChanging = delegateCombine(this.i.yValueChanging, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxMultiSliderYValueChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeYValueChanging) { _this.beforeYValueChanging(_this, outerArgs); } _this._yValueChanging.emit({ sender: _this, args: outerArgs }); }); }); } return this._yValueChanging; }, enumerable: false, configurable: true }); Object.defineProperty(IgxMultiSliderComponent.prototype, "yValueChanged", { get: function () { var _this = this; if (this._yValueChanged == null) { this._yValueChanged = new EventEmitter(); this.i.yValueChanged = delegateCombine(this.i.yValueChanged, function (o, e) { _this._runInZone(function () { var outerArgs = new IgxMultiSliderYValueChangingEventArgs(); outerArgs._provideImplementation(e); if (_this.beforeYValueChanged) { _this.beforeYValueChanged(_this, outerArgs); } _this._yValueChanged.emit({ sender: _this, args: outerArgs }); }); }); } return this._yValueChanged; }, enumerable: false, configurable: true }); IgxMultiSliderComponent.prototype._runInZone = function (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; }()); export { 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 }] } });