@opensig/opendesign
Version:
240 lines (239 loc) • 6.29 kB
TypeScript
import { ExtractPropTypes, PropType, ComponentPublicInstance, Ref, CSSProperties } from 'vue';
import { PopupPositionT } from '../popup/types';
import { SizeT, DirectionT } from '../_utils/types';
import { default as OSliderButton } from './OSliderButton.vue';
export type Arrayable<T> = T | T[];
export interface SliderInitData {
firstBtnVal: number;
secondBtnVal: number;
oldValue?: Arrayable<number>;
isDragging: boolean;
sliderSize: number;
}
export interface SliderButtonInitData {
hovering: boolean;
dragging: boolean;
isClick: boolean;
startX: number;
currentX: number;
startY: number;
currentY: number;
startPosition: number;
newPosition: number;
oldValue: number;
}
export declare const sliderProps: {
/**
* @zh-CN 双向绑定值
* @en-US v-model value.
* @default 0
*/
readonly modelValue: {
readonly type: PropType<Arrayable<number>>;
readonly default: 0;
};
/**
* @zh-CN 滑动条最小值
* @en-US The min value.
* @default 0
*/
readonly min: {
readonly type: NumberConstructor;
readonly default: 0;
};
/**
* @zh-CN 滑动条最大值
* @en-US The max value.
* @default 100
*/
readonly max: {
readonly type: NumberConstructor;
readonly default: 100;
};
/**
* @zh-CN 每一分段值
* @en-US Each segment value.
* @default 1
*/
readonly step: {
readonly type: NumberConstructor;
readonly default: 1;
};
/**
* @zh-CN 禁用
* @en-US Disabled.
*/
readonly disabled: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 输入框尺寸
* @en-US Input box size.
*/
readonly inputSize: {
readonly type: PropType<SizeT>;
};
/**
* @zh-CN 显示输入框
* @en-US Show input box.
*/
readonly showInput: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 显示输入框控制器
* @en-US Show input box controls.
*/
readonly showInputControls: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 显示间隔点
* @en-US Show stops.
*/
readonly showStops: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 范围
* @en-US Range.
*/
readonly range: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 方向
* @en-US Direction.
*/
readonly direction: {
readonly type: PropType<DirectionT>;
readonly default: "h";
};
/**
* @zh-CN 垂直方向滑动条高度
* @en-US Vertical height.
*/
readonly height: {
readonly type: StringConstructor;
};
/**
* @zh-CN 气泡容器自定义类名
* @en-US Custom class name for bubble container.
*/
readonly wrapClass: {
readonly type: StringConstructor;
};
/**
* @zh-CN 气泡定位方向
* @en-US Bubble positioning direction.
*/
readonly position: {
readonly type: PropType<PopupPositionT>;
readonly default: "bottom";
};
/**
* @zh-CN 每个间隔点对应的标记
* @en-US The label corresponding to each interval point.
*/
readonly marks: {
readonly type: PropType<Record<number, string | sliderMarksPropsT["mark"]>>;
};
/**
* @zh-CN 单位
* @en-US Unit.
*/
readonly unit: {
readonly type: StringConstructor;
};
/**
* @zh-CN 控制气泡渲染
* @en-US Control bubble rendering.
*/
readonly showPopover: {
readonly type: BooleanConstructor;
readonly default: true;
};
};
export declare const sliderButtonProps: {
/**
* @zh-CN 双向绑定值
* @en-US v-model value.
* @default 0
*/
readonly modelValue: {
readonly type: NumberConstructor;
readonly default: 0;
};
/**
* @zh-CN 气泡定位方向
* @en-US Bubble positioning direction.
*/
readonly position: {
readonly type: PropType<PopupPositionT>;
readonly default: "top";
};
/**
* @zh-CN 气泡容器自定义类名
* @en-US Custom class name for bubble container.
*/
readonly wrapClass: {
readonly type: StringConstructor;
};
/**
* @zh-CN 方向
* @en-US Direction.
*/
readonly direction: {
readonly type: PropType<DirectionT>;
readonly default: "h";
};
/**
* @zh-CN 控制间隔滑动条按钮实心圆渲染
* @en-US Rendering of the solid circle of the control interval slider button.
*/
readonly showSolidCircle: {
readonly type: BooleanConstructor;
};
/**
* @zh-CN 控制气泡渲染
* @en-US Control bubble rendering.
*/
readonly showPopover: {
readonly type: BooleanConstructor;
};
};
export declare const sliderMarksProps: {
/**
* @zh-CN 每个间隔点对应的标记
* @en-US The label corresponding to each interval point.
*/
readonly mark: {
readonly type: PropType<string | {
style: CSSProperties;
label: any;
}>;
};
};
export type SliderButtonInstance = ComponentPublicInstance<typeof OSliderButton>;
export type ButtonRefs = Record<'firstButton' | 'secondButton', Ref<SliderButtonInstance | undefined>>;
export declare const sliderEmits: {
/**
* @zh-CN 双向绑定值更新
* @en-US v-model value update
*/
'update:modelValue': (value: Arrayable<number>) => value is number | number[];
/**
* @zh-CN 滑块拖动时触发
* @en-US Triggered while dragging the slider
*/
input: (value: Arrayable<number>) => value is number | number[];
/**
* @zh-CN 滑块值改变后触发
* @en-US Triggered after the slider value changes
*/
change: (value: Arrayable<number>) => value is number | number[];
};
export type SliderEmits = typeof sliderEmits;
export type sliderPropsT = ExtractPropTypes<typeof sliderProps>;
export type sliderButtonPropsT = ExtractPropTypes<typeof sliderButtonProps>;
export type sliderMarksPropsT = ExtractPropTypes<typeof sliderMarksProps>;