import { AfterViewInit, ElementRef, EventEmitter, OnInit, Renderer2, TemplateRef, OnDestroy, ChangeDetectorRef, OnChanges } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { EditorProvider } from '../core/edit-provider'; import { Subject } from 'rxjs'; import { IRangeSliderValue, SliderType, ISliderValueChangeEventArgs, TicksOrientation, TickLabelsOrientation } from './slider.common'; /** * **Ignite UI for Angular Slider** - * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/slider.html) * * The Ignite UI Slider allows selection in a given range by moving the thumb along the track. The track * can be defined as continuous or stepped, and you can choose between single and range slider types. * * Example: * ```html * * * ``` */ export declare class IgxSliderComponent implements ControlValueAccessor, EditorProvider, OnInit, AfterViewInit, OnChanges, OnDestroy { private renderer; private _el; private _cdr; private _pMin; private _pMax; private _hasViewInit; private _minValue; private _maxValue; private _lowerBound?; private _upperBound?; private _lowerValue?; private _upperValue?; private _continuous; private _disabled; private _step; private _primaryTicks; private _secondaryTicks; private _labels; private _type; private _destroyer$; private _indicatorsDestroyer$; private _indicatorsTimer; private _onChangeCallback; private _onTouchedCallback; /** * @hidden */ private ticks; /** * @hidden */ private thumbs; /** * @hidden */ private labelRefs; private readonly thumbFrom; private readonly thumbTo; private readonly labelFrom; private readonly labelTo; /** * @hidden */ trackRef: ElementRef; /** * @hidden */ stepDistance: number; /** * @hidden */ onPan: Subject; /** * @hidden */ thumbFromTemplateRef: TemplateRef; /** * @hidden */ thumbToTemplateRef: TemplateRef; /** * @hidden */ tickLabelTemplateRef: TemplateRef; /** * @hidden */ role: string; /** * @hidden */ readonly valuemin: number; /** * @hidden */ readonly valuemax: number; /** * @hidden */ readonly readonly: boolean; /** * @hidden */ slierClass: boolean; /** * @hidden */ readonly disabledClass: boolean; /** * An @Input property that sets the value of the `id` attribute. * If not provided it will be automatically generated. * ```html * * ``` */ id: string; /** * An @Input property that gets the type of the `IgxSliderComponent`. The slider can be SliderType.SLIDER(default) or SliderType.RANGE. * ```typescript * @ViewChild("slider2") * public slider: IgxSliderComponent; * ngAfterViewInit(){ * let type = this.slider.type; * } */ /** * An @Input property that sets the type of the `IgxSliderComponent`. The slider can be SliderType.SLIDER(default) or SliderType.RANGE. * ```typescript * sliderType: SliderType = SliderType.RANGE; * ``` * ```html * * ``` */ type: SliderType; /** *An @Input property that sets the duration visibility of thumbs labels. The default value is 750 milliseconds. *```html * *``` */ thumbLabelVisibilityDuration: number; /** * Enables `labelView`, by accepting a collection of primitive values with more than one element. * Each element will be equally spread over the slider and it will serve as a thumb label. * Once the property is set, it will precendence over {@link maxValue}, {@link minValue}, {@link step}. * This means that the manipulation for those properties won't be allowed. */ labels: Array; /** * Returns the template context corresponding * to {@link IgxThumbFromTemplateDirective} and {@link IgxThumbToTemplateDirective} templates. * * ```typescript * return { * $implicit // returns the value of the label, * labels // returns the labels collection the user has passed. * } * ``` */ readonly context: any; /** * An @Input property that sets the incremental/decremental step of the value when dragging the thumb. * The default step is 1, and step should not be less or equal than 0. * ```html * * ``` */ /** * Returns the incremental/decremental dragging step of the {@link IgxSliderComponent}. * ```typescript * @ViewChild("slider2") * public slider: IgxSliderComponent; * ngAfterViewInit(){ * let step = this.slider.step; * } * ``` */ step: number; /** * Returns if the {@link IgxSliderComponent} is disabled. * ```typescript * @ViewChild("slider2") * public slider: IgxSliderComponent; * ngAfterViewInit(){ * let isDisabled = this.slider.disabled; * } * ``` */ /** *An @Input property that disables or enables UI interaction. *```html * *``` */ disabled: boolean; /** * Returns if the {@link IgxSliderComponent} is set as continuous. * ```typescript * @ViewChild("slider2") * public slider: IgxSliderComponent; * ngAfterViewInit(){ * let continuous = this.slider.continuous; * } * ``` */ /** * An @Input property that marks the {@link IgxSliderComponent} as continuous. * By default is considered that the {@link IgxSliderComponent} is discrete. * Discrete {@link IgxSliderComponent} does not have ticks and does not show bubble labels for values. * ```html * * ``` */ continuous: boolean; /** *Returns the minimal value of the `IgxSliderComponent`. *```typescript *@ViewChild("slider2") *public slider: IgxSliderComponent; *ngAfterViewInit(){ * let sliderMin = this.slider.minValue; *} *``` */ /** * Sets the minimal value for the `IgxSliderComponent`. * The default minimal value is 0. * ```html * * ``` */ minValue: number; /** * Returns the maximum value for the {@link IgxSliderComponent}. * ```typescript *@ViewChild("slider") *public slider: IgxSliderComponent; *ngAfterViewInit(){ * let sliderMax = this.slider.maxValue; *} * ``` */ /** * Sets the maximal value for the `IgxSliderComponent`. * The default maximum value is 100. * ```html * * ``` */ maxValue: number; /** * Returns the lower boundary of the `IgxSliderComponent`. *```typescript *@ViewChild("slider") *public slider: IgxSliderComponent; *ngAfterViewInit(){ * let sliderLowBound = this.slider.lowerBound; *} *``` */ /** * Sets the lower boundary of the `IgxSliderComponent`. * If not set is the same as min value. * ```html * * ``` */ lowerBound: number; /** * Returns the upper boundary of the `IgxSliderComponent`. * ```typescript *@ViewChild("slider") *public slider: IgxSliderComponent; *ngAfterViewInit(){ * let sliderUpBound = this.slider.upperBound; *} * ``` */ /** * Sets the upper boundary of the `IgxSliderComponent`. * If not set is the same as max value. * ```html * * ``` */ upperBound: number; /** * Returns the slider value. If the slider is of type {@link SliderType.SLIDER} the returned value is number. * If the slider type is {@link SliderType.RANGE} the returned value represents an object of {@link lowerValue} and {@link upperValue}. *```typescript *@ViewChild("slider2") *public slider: IgxSliderComponent; *public sliderValue(event){ * let sliderVal = this.slider.value; *} *``` */ /** * Sets the slider value. * If the slider is of type {@link SliderType.SLIDER} the argument is number. By default the {@link value} gets the {@link lowerBound}. * If the slider type is {@link SliderType.RANGE} the argument * represents an object of {@link lowerValue} and {@link upperValue} properties. * By default the object is associated with the {@link lowerBound} and {@link upperBound} property values. * ```typescript *rangeValue = { * lower: 30, * upper: 60 *}; * ``` * ```html * * ``` */ value: number | IRangeSliderValue; /** * Returns the number of the presented primary ticks. * ```typescript * const primaryTicks = this.slider.primaryTicks; * ``` */ /** * Sets the number of primary ticks. If {@link @labels} is enabled, this property won't function. * Insted enable ticks by {@link showTicks} property. * ```typescript * this.slider.primaryTicks = 5; * ``` */ primaryTicks: number; /** * Returns the number of the presented secondary ticks. * ```typescript * const secondaryTicks = this.slider.secondaryTicks; * ``` */ /** * Sets the number of secondary ticks. The property functions even when {@link labels} is enabled, * but all secondary ticks won't present any tick labels. * ```typescript * this.slider.secondaryTicks = 5; * ``` */ secondaryTicks: number; /** * Show/hide slider ticks * ```html * * ``` */ showTicks: boolean; /** * show/hide primary tick labels * ```html * * ``` */ primaryTickLabels: boolean; /** * show/hide secondary tick labels * ```html * * ``` */ secondaryTickLabels: boolean; /** * Changes ticks orientation: * bottom - The default orienation, below the slider track. * top - Above the slider track * mirror - combines top and bottom orientation. * ```html * * ``` */ ticksOrientation: TicksOrientation; /** * Changes tick labels rotation: * horizontal - The default rotation * toptobottom - Rotates tick labels vertically to 90deg * bottomtotop - Rotate tick labels vertically to -90deg * ```html * * ``` */ tickLabelsOrientation: TickLabelsOrientation; /** * @hidden */ readonly deactivateThumbLabel: boolean; /** * This event is emitted when user has stopped interacting the thumb and value is changed. * ```typescript * public change(event){ * alert("The value has been changed!"); *} * ``` * ```html * * ``` */ onValueChange: EventEmitter; constructor(renderer: Renderer2, _el: ElementRef, _cdr: ChangeDetectorRef); /** * @hidden */ onPointerDown($event: any): void; /** * @hidden */ onPointerUp($event: any): void; /** * @hidden */ onFocus(): void; /** * @hidden */ onPanListener($event: any): void; /** * @hidden */ onPanStart(): void; /** * @hidden */ onPanEnd(): void; /** *Returns whether the `IgxSliderComponent` type is RANGE. *```typescript *@ViewChild("slider") *public slider: IgxSliderComponent; *ngAfterViewInit(){ * let sliderRange = this.slider.isRange; *} * ``` */ readonly isRange: boolean; /** * Returns the lower value of the `IgxSliderComponent`. * ```typescript * @ViewChild("slider") * public slider: IgxSliderComponent; * public lowValue(event){ * let sliderLowValue = this.slider.lowerValue; *} *``` */ /** *Sets the lower value of the `IgxSliderComponent`. *```typescript *@ViewChild("slider2") *public slider: IgxSliderComponent; *public lowValue(event){ * this.slider.lowerValue = 120; *} *``` */ lowerValue: number; /** *Returns the upper value of the `IgxSliderComponent`. *```typescript *@ViewChild("slider2") *public slider: IgxSliderComponent; *public upperValue(event){ * let upperValue = this.slider.upperValue; *} *``` */ /** *Sets the upper value of the `IgxSliderComponent`. *```typescript *@ViewChild("slider2") *public slider: IgxSliderComponent; *public upperValue(event){ * this.slider.upperValue = 120; *} *``` */ upperValue: number; /** * Returns the value corresponding the lower label. *```typescript * @ViewChild("slider") * public slider: IgxSliderComponent; * let label = this.slider.lowerLabel; *``` */ readonly lowerLabel: string | number | boolean; /** * Returns the value corresponding the upper label. *```typescript * @ViewChild("slider") * public slider: IgxSliderComponent; * let label = this.slider.upperLabel; *``` */ readonly upperLabel: string | number | boolean; /** * Returns if label view is enabled. * If the {@link labels} is set, the view is automatically activated. *```typescript * @ViewChild("slider") * public slider: IgxSliderComponent; * let labelView = this.slider.labelsViewEnabled; *``` */ readonly labelsViewEnabled: boolean; /** * @hidden */ readonly showTopTicks: boolean; /** * @hidden */ readonly showBottomTicks: boolean; /** * @hidden */ ngOnInit(): void; ngOnChanges(changes: any): void; /** * @hidden */ ngAfterViewInit(): void; /** * @hidden */ ngOnDestroy(): void; /** * @hidden */ writeValue(value: IRangeSliderValue | number): void; /** * @hidden */ registerOnChange(fn: any): void; /** * @hidden */ registerOnTouched(fn: any): void; /** @hidden */ getEditElement(): any; /** * * @hidden */ update(mouseX: any): void; /** * @hidden */ thumbChanged(value: number, thumbType: number): void; /** * @hidden */ onThumbChange(): void; /** * @hidden */ onHoverChange(state: boolean): void; private swapThumb; private findClosestThumb; private updateLowerBoundAndMinTravelZone; private updateUpperBoundAndMaxTravelZone; private sliderSetup; private calculateStepDistance; private toggleThumb; private valueInRange; private generateTickMarks; private positionHandler; private positionHandlersAndUpdateTrack; private closestHandle; private setTickInterval; private showSliderIndicators; private hideSliderIndicators; private toggleSliderIndicators; private changeThumbFocusableState; private closestTo; private valueToFraction; /** * @hidden * Normalizе the value when two-way data bind is used and {@link this.step} is set. * @param value */ private normalizeByStep; private updateTrack; private validateInitialValue; private subscribeTo; private unsubscriber; private hasValueChanged; private emitValueChanged; } /** * @hidden */ export declare class IgxSliderModule { }