2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Slider is a component to provide input with a drag handle.
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/slider/)
|
|
|
|
*
|
|
|
|
* @module slider
|
|
|
|
*
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
* Custom slide end event.
|
|
|
|
* @see {@link SliderEmits.slideend}
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface SliderSlideEndEvent {
|
|
|
|
/**
|
|
|
|
* Original event
|
|
|
|
*/
|
|
|
|
originalEvent: Event;
|
|
|
|
/**
|
|
|
|
* New value.
|
|
|
|
*/
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
* Defines valid properties in Slider component.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
export interface SliderProps {
|
|
|
|
/**
|
|
|
|
* Value of the component.
|
|
|
|
*/
|
|
|
|
modelValue?: number | number[] | undefined;
|
|
|
|
/**
|
|
|
|
* Mininum boundary value.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue 0
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
min?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Maximum boundary value.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue 100
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
max?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Orientation of the slider.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue horizontal
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
2023-03-01 11:09:05 +00:00
|
|
|
orientation?: 'horizontal' | 'vertical' | undefined;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Step factor to increment/decrement the value.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue 1
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
step?: number | undefined;
|
|
|
|
/**
|
|
|
|
* When speficed, allows two boundary values to be picked.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
range?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* When present, it specifies that the component should be disabled.
|
2023-03-01 11:09:05 +00:00
|
|
|
* @defaultValue false
|
2022-09-06 12:03:37 +00:00
|
|
|
*/
|
|
|
|
disabled?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Index of the element in tabbing order.
|
|
|
|
*/
|
|
|
|
tabindex?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
|
|
*/
|
|
|
|
'aria-labelledby'?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Used to define a string that labels the element.
|
|
|
|
*/
|
|
|
|
'aria-label'?: string | undefined;
|
|
|
|
}
|
|
|
|
|
2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
* Defines valid slots in Slider component.
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
export interface SliderSlots {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
* Defines valid emits in Slider component.
|
|
|
|
*/
|
2023-03-01 11:09:42 +00:00
|
|
|
export interface SliderEmits {
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {number | number[]} value - New value.
|
|
|
|
*/
|
2023-03-01 11:09:05 +00:00
|
|
|
'update:modelValue'(value: number | number[]): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke on value change.
|
|
|
|
* @param {number} value - New value
|
|
|
|
*/
|
2023-03-01 11:09:05 +00:00
|
|
|
change(value: number): void;
|
2022-09-06 12:03:37 +00:00
|
|
|
/**
|
|
|
|
* Callback to invoke when slide ends.
|
|
|
|
* @param {SliderSlideEndEvent} event - Custom slide end event.
|
|
|
|
*/
|
2023-03-01 11:09:05 +00:00
|
|
|
slideend(event: SliderSlideEndEvent): void;
|
2023-03-01 11:09:42 +00:00
|
|
|
}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2023-03-01 11:09:05 +00:00
|
|
|
/**
|
|
|
|
* **PrimeVue - Slider**
|
|
|
|
*
|
|
|
|
* _Slider is a component to provide input with a drag handle._
|
|
|
|
*
|
|
|
|
* [Live Demo](https://www.primevue.org/slider/)
|
|
|
|
* --- ---
|
|
|
|
* ![PrimeVue](https://primefaces.org/cdn/primevue/images/logo.svg)
|
|
|
|
*
|
|
|
|
* @group Component
|
|
|
|
*
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Slider extends ClassComponent<SliderProps, SliderSlots, SliderEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Slider: GlobalComponentConstructor<Slider>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Slider;
|