2022-09-06 12:03:37 +00:00
|
|
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
|
|
|
|
|
export interface KnobProps {
|
|
|
|
/**
|
|
|
|
* Value of the component.
|
|
|
|
*/
|
|
|
|
modelValue?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Size of the component in pixels.
|
|
|
|
* Default value is 100.
|
|
|
|
*/
|
|
|
|
size?: number | undefined;
|
|
|
|
/**
|
|
|
|
* When present, it specifies that the component should be disabled.
|
|
|
|
*/
|
|
|
|
disabled?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* When present, it specifies that the component value cannot be edited.
|
|
|
|
*/
|
|
|
|
readonly?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Step factor to increment/decrement the value.
|
|
|
|
*/
|
|
|
|
step?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Mininum boundary value.
|
|
|
|
* Default value is 0.
|
|
|
|
*/
|
|
|
|
min?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Maximum boundary value.
|
|
|
|
* Default value is 100.
|
|
|
|
*/
|
|
|
|
max?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Background of the value.
|
|
|
|
*/
|
|
|
|
valueColor?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Background color of the range.
|
|
|
|
*/
|
|
|
|
rangeColor?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Color of the value text.
|
|
|
|
*/
|
|
|
|
textColor?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Width of the knob stroke.
|
|
|
|
* Default value is 14.
|
|
|
|
*/
|
|
|
|
strokeWidth?: number | undefined;
|
|
|
|
/**
|
|
|
|
* Whether the show the value inside the knob.
|
|
|
|
* Default value is true.
|
|
|
|
*/
|
|
|
|
showValue?: boolean | undefined;
|
|
|
|
/**
|
|
|
|
* Template string of the value.
|
|
|
|
* Default value is '{value}'.
|
|
|
|
*/
|
|
|
|
valueTemplate?: string | undefined;
|
|
|
|
/**
|
|
|
|
* Index of the element in tabbing order.
|
|
|
|
*/
|
|
|
|
tabindex?: number | undefined;
|
|
|
|
/**
|
2022-09-14 11:26:01 +00:00
|
|
|
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
'aria-labelledby'?: string | undefined;
|
|
|
|
/**
|
2022-09-14 11:26:01 +00:00
|
|
|
* Used to define a string that labels the element.
|
|
|
|
*/
|
2022-09-06 12:03:37 +00:00
|
|
|
'aria-label'?: string | undefined;
|
|
|
|
}
|
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
export interface KnobSlots {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
export declare type KnobEmits = {
|
|
|
|
/**
|
|
|
|
* Emitted when the value changes.
|
|
|
|
* @param {number} value - New value.
|
|
|
|
*/
|
|
|
|
'update:modelValue': (value: number) => void;
|
|
|
|
/**
|
|
|
|
* Callback to invoke when the value changes.
|
|
|
|
* @param {number} value - New value
|
|
|
|
*/
|
2022-09-14 11:26:01 +00:00
|
|
|
change: (value: number) => void;
|
|
|
|
};
|
2022-09-06 12:03:37 +00:00
|
|
|
|
2022-09-14 11:26:01 +00:00
|
|
|
declare class Knob extends ClassComponent<KnobProps, KnobSlots, KnobEmits> {}
|
2022-09-06 12:03:37 +00:00
|
|
|
|
|
|
|
declare module '@vue/runtime-core' {
|
|
|
|
interface GlobalComponents {
|
2022-09-14 11:26:01 +00:00
|
|
|
Knob: GlobalComponentConstructor<Knob>;
|
2022-09-06 12:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Knob is a form component to define number inputs with a dial.
|
|
|
|
*
|
|
|
|
* Demos:
|
|
|
|
*
|
2022-09-14 11:26:01 +00:00
|
|
|
* - [Knob](https://www.primefaces.org/primevue/knob)
|
2022-09-06 12:03:37 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
export default Knob;
|