UNPKG

@ray-js/components

Version:

Ray basic components

92 lines (91 loc) 2.27 kB
import { GenericEvent } from '@ray-js/adapter'; import { BaseProps } from '../types'; export interface SliderProps extends BaseProps { /** * @description.en min * @description.zh 最小值 * @default 0 */ min?: number; /** * @description.en max * @description.zh 最大值 * @default 100 */ max?: number; /** * @description.en The value must be greater than 0 and divisible by (max-min) * @description.zh 步长,取值必须大于 0,并且可被(max - min)整除 * @default 1 */ step?: number; /** * @description.en disabled * @description.zh 是否禁用 * @default false */ disabled?: boolean; /** * @description.en value * @description.zh 当前取值 * @default 0 */ value?: number; /** * @description.en activeColor * @description.zh 已选择的颜色 * @default #007aff */ activeColor?: string; /** * @description.en backgroundColor * @description.zh 背景条的颜色 * @default rgba(0,0,0,.2) */ backgroundColor?: string; /** * @description.en blockSize * @description.zh 滑块的大小,取值范围为 12 - 28 * @default 28 */ blockSize?: number; /** * @description.en blockColor * @description.zh 滑块的颜色 * @default #ffffff */ blockColor?: string; /** * @description.en showValue * @description.zh 是否显示当前 value * @default false */ showValue?: boolean; /** * @description.en onChange * @description.zh 完成一次拖动后触发的事件,event.detail = {value} * @default undefined */ onChange?: (event: GenericEvent<{ value: any; }>) => void; /** * @description.en onChanging * @description.zh 拖动过程中触发的事件,event.detail = {value} * @default undefined */ onChanging?: (event: GenericEvent<{ value: any; }>) => void; } export declare const sliderDefault: { blockSize: number; activeColor: string; backgroundColor: string; blockColor: string; min: number; max: number; disabled: boolean; value: number; step: number; };