175 lines
6.6 KiB
TypeScript
175 lines
6.6 KiB
TypeScript
|
import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, Renderer2 } from '@angular/core';
|
||
|
import { ControlValueAccessor } from '@angular/forms';
|
||
|
import { Nullable, VoidListener } from 'primeng/ts-helpers';
|
||
|
import { SliderChangeEvent, SliderSlideEndEvent } from './slider.interface';
|
||
|
import * as i0 from "@angular/core";
|
||
|
import * as i1 from "@angular/common";
|
||
|
import * as i2 from "primeng/autofocus";
|
||
|
export declare const SLIDER_VALUE_ACCESSOR: any;
|
||
|
/**
|
||
|
* Slider is a component to provide input with a drag handle.
|
||
|
* @group Components
|
||
|
*/
|
||
|
export declare class Slider implements OnDestroy, ControlValueAccessor {
|
||
|
private document;
|
||
|
private platformId;
|
||
|
el: ElementRef;
|
||
|
renderer: Renderer2;
|
||
|
private ngZone;
|
||
|
cd: ChangeDetectorRef;
|
||
|
/**
|
||
|
* When enabled, displays an animation on click of the slider bar.
|
||
|
* @group Props
|
||
|
*/
|
||
|
animate: boolean | undefined;
|
||
|
/**
|
||
|
* When present, it specifies that the element should be disabled.
|
||
|
* @group Props
|
||
|
*/
|
||
|
disabled: boolean | undefined;
|
||
|
/**
|
||
|
* Mininum boundary value.
|
||
|
* @group Props
|
||
|
*/
|
||
|
min: number;
|
||
|
/**
|
||
|
* Maximum boundary value.
|
||
|
* @group Props
|
||
|
*/
|
||
|
max: number;
|
||
|
/**
|
||
|
* Orientation of the slider.
|
||
|
* @group Props
|
||
|
*/
|
||
|
orientation: 'horizontal' | 'vertical';
|
||
|
/**
|
||
|
* Step factor to increment/decrement the value.
|
||
|
* @group Props
|
||
|
*/
|
||
|
step: number | undefined;
|
||
|
/**
|
||
|
* When specified, allows two boundary values to be picked.
|
||
|
* @group Props
|
||
|
*/
|
||
|
range: boolean | undefined;
|
||
|
/**
|
||
|
* Inline style of the component.
|
||
|
* @group Props
|
||
|
*/
|
||
|
style: {
|
||
|
[klass: string]: any;
|
||
|
} | null | undefined;
|
||
|
/**
|
||
|
* Style class of the component.
|
||
|
* @group Props
|
||
|
*/
|
||
|
styleClass: string | undefined;
|
||
|
/**
|
||
|
* Defines a string that labels the input for accessibility.
|
||
|
* @group Props
|
||
|
*/
|
||
|
ariaLabel: string | undefined;
|
||
|
/**
|
||
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
||
|
* @group Props
|
||
|
*/
|
||
|
ariaLabelledBy: string | undefined;
|
||
|
/**
|
||
|
* Index of the element in tabbing order.
|
||
|
* @group Props
|
||
|
*/
|
||
|
tabindex: number;
|
||
|
/**
|
||
|
* When present, it specifies that the component should automatically get focus on load.
|
||
|
* @group Props
|
||
|
*/
|
||
|
autofocus: boolean | undefined;
|
||
|
/**
|
||
|
* Callback to invoke on value change.
|
||
|
* @param {SliderChangeEvent} event - Custom value change event.
|
||
|
* @group Emits
|
||
|
*/
|
||
|
onChange: EventEmitter<SliderChangeEvent>;
|
||
|
/**
|
||
|
* Callback to invoke when slide ended.
|
||
|
* @param {SliderSlideEndEvent} event - Custom slide end event.
|
||
|
* @group Emits
|
||
|
*/
|
||
|
onSlideEnd: EventEmitter<SliderSlideEndEvent>;
|
||
|
sliderHandle: Nullable<ElementRef>;
|
||
|
sliderHandleStart: Nullable<ElementRef>;
|
||
|
sliderHandleEnd: Nullable<ElementRef>;
|
||
|
value: Nullable<number>;
|
||
|
values: Nullable<number[]>;
|
||
|
handleValue: Nullable<number>;
|
||
|
handleValues: number[];
|
||
|
diff: Nullable<number>;
|
||
|
offset: Nullable<number>;
|
||
|
bottom: Nullable<number>;
|
||
|
onModelChange: Function;
|
||
|
onModelTouched: Function;
|
||
|
dragging: Nullable<boolean>;
|
||
|
dragListener: VoidListener;
|
||
|
mouseupListener: VoidListener;
|
||
|
initX: Nullable<number>;
|
||
|
initY: Nullable<number>;
|
||
|
barWidth: Nullable<number>;
|
||
|
barHeight: Nullable<number>;
|
||
|
sliderHandleClick: Nullable<boolean>;
|
||
|
handleIndex: number;
|
||
|
startHandleValue: any;
|
||
|
startx: Nullable<number>;
|
||
|
starty: Nullable<number>;
|
||
|
constructor(document: Document, platformId: any, el: ElementRef, renderer: Renderer2, ngZone: NgZone, cd: ChangeDetectorRef);
|
||
|
onMouseDown(event: Event, index?: number): void;
|
||
|
onDragStart(event: TouchEvent, index?: number): void;
|
||
|
onDrag(event: TouchEvent): void;
|
||
|
onDragEnd(event: TouchEvent): void;
|
||
|
onBarClick(event: Event): void;
|
||
|
onKeyDown(event: any, index: any): void;
|
||
|
decrementValue(event: any, index: any, pageKey?: boolean): void;
|
||
|
incrementValue(event: any, index: any, pageKey?: boolean): void;
|
||
|
handleChange(event: Event): void;
|
||
|
bindDragListeners(): void;
|
||
|
unbindDragListeners(): void;
|
||
|
setValueFromHandle(event: Event, handleValue: any): void;
|
||
|
handleStepChange(newValue: number, oldValue: number): void;
|
||
|
writeValue(value: any): void;
|
||
|
registerOnChange(fn: Function): void;
|
||
|
registerOnTouched(fn: Function): void;
|
||
|
setDisabledState(val: boolean): void;
|
||
|
get rangeStartLeft(): string;
|
||
|
get rangeStartBottom(): string;
|
||
|
get rangeEndLeft(): string;
|
||
|
get rangeEndBottom(): string;
|
||
|
isVertical(): boolean;
|
||
|
updateDomData(): void;
|
||
|
calculateHandleValue(event: Event): number;
|
||
|
updateHandleValue(): void;
|
||
|
updateDiffAndOffset(): void;
|
||
|
getDiff(): number;
|
||
|
getOffset(): number;
|
||
|
updateValue(val: number, event?: Event): void;
|
||
|
getValueFromHandle(handleValue: number): number;
|
||
|
getDecimalsCount(value: number): number;
|
||
|
getNormalizedValue(val: number): number;
|
||
|
ngOnDestroy(): void;
|
||
|
get minVal(): number;
|
||
|
get maxVal(): number;
|
||
|
static ɵfac: i0.ɵɵFactoryDeclaration<Slider, never>;
|
||
|
static ɵcmp: i0.ɵɵComponentDeclaration<Slider, "p-slider", never, { "animate": { "alias": "animate"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "step": { "alias": "step"; "required": false; }; "range": { "alias": "range"; "required": false; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; }, { "onChange": "onChange"; "onSlideEnd": "onSlideEnd"; }, never, never, false, never>;
|
||
|
static ngAcceptInputType_animate: unknown;
|
||
|
static ngAcceptInputType_disabled: unknown;
|
||
|
static ngAcceptInputType_min: unknown;
|
||
|
static ngAcceptInputType_max: unknown;
|
||
|
static ngAcceptInputType_step: unknown;
|
||
|
static ngAcceptInputType_range: unknown;
|
||
|
static ngAcceptInputType_tabindex: unknown;
|
||
|
static ngAcceptInputType_autofocus: unknown;
|
||
|
}
|
||
|
export declare class SliderModule {
|
||
|
static ɵfac: i0.ɵɵFactoryDeclaration<SliderModule, never>;
|
||
|
static ɵmod: i0.ɵɵNgModuleDeclaration<SliderModule, [typeof Slider], [typeof i1.CommonModule, typeof i2.AutoFocusModule], [typeof Slider]>;
|
||
|
static ɵinj: i0.ɵɵInjectorDeclaration<SliderModule>;
|
||
|
}
|