/** * @license * Copyright Datorama. All Rights Reserved. * * Use of this source code is governed by an Apache License 2.0 license that can be * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE * * */ import { AfterViewInit, Renderer2, OnDestroy, NgZone, OnInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { SliderOptions, CursorValues } from './types'; import { BaseCustomControl } from '../custom-control/base-custom-control'; export declare class DatoSliderComponent extends BaseCustomControl implements AfterViewInit, ControlValueAccessor, OnInit, OnDestroy { private zone; private renderer; writeValue(data: CursorValues | number): void; /** * Sets the disabled state for the slider */ setDisabledState(isDisabled: boolean): void; set options(data: SliderOptions); get options(): SliderOptions; /** * Whether we have 2 cursors or 1. * if we have 1 cursor, the min cursor will still be present in DOM but hidden * If we have only one cursor (referred as singleSlider), * our CursorValues.minCursor = {value: sliderStart, model: options.min} */ get multiCursor(): boolean; get midRange(): number; get showLabels(): boolean; ngOnDestroy(): void; private defaultOptions; private _options; private minCursor; private maxCursor; private slider; private range; private minLabel; private maxLabel; private get minCursorElement(); private get maxCursorElement(); private get sliderElement(); private get rangeElement(); private get sliderStart(); private get sliderEnd(); private get sliderRange(); private get minLabelElement(); private get maxLabelElement(); private model; private cursorsState; private minCursorMoving; private maxCursorMoving; private sliderDimensions; private unitSize; private readonly movingLabelClass; private numberOfDecimals; constructor(zone: NgZone, renderer: Renderer2); ngOnInit(): void; ngAfterViewInit(): void; /** * Listens for all interaction on the slider to update it accordingly */ private registerEvents; /** * listen for resize events and recalculates slider dimensions and adapts the cursor(s) position(s) accordingly */ private onResize; /** * display indicators on cursor hover */ private onCursorHover; /** * should hide the cursors when the mouse leaves them */ private onMouseLeaveCursor; private onMouseDown; private onKeyDown; private onMouseUp; private onMouseMove; /** * on slider click we want to bring the cursor to that point, * we first have to ensure that no cursor was moving prior to this */ private onSliderClick; private onMouseLeave; private disableAllCursors; private inRange; private cursorsDoNotOverlap; private setActiveCursor; private updateFormValues; private getNextStep; private moveClosestCursor; private initCursorState; private animateSlider; /** * @param data * happens when the value changes on the form, updates the slider accordingly. */ private writeValueOnSlider; private setSliderDimensions; /** * updates the label value on each mouseMove || afterViewInit */ private updateLabels; private countDecimals; /** * if the step < 1; we need to make sure that the values reflected on * the form contains the appropriate number of decimals */ private truncateFormValues; /** * sets label for max cursor */ private setMaxLabel; /** * sets label for min cursor */ private setMinLabel; /** * removes the black background on both cursors */ private removeLabelsStyle; /** * removes style from label on the max cursor */ private removeMaxLabelStyle; /** * Disables or activate the slider * happens either if slider has a disabled option or if someone sets disabled state via controlValue * @param disable */ private toggleSliderState; }