@opensig/opendesign
Version:
<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>
182 lines (181 loc) • 4.1 kB
TypeScript
import { PopupPositionT, PopupTriggerT } from '../popup';
import { ExtractPropTypes, PropType } from 'vue';
import { SizeT, RoundT, VariantT, Color2T } from '../_utils/types';
export declare const OptionWidthModeTypes: readonly ["auto", "min-width", "width"];
export type OptionWidthModeT = (typeof OptionWidthModeTypes)[number];
export interface SelectOptionT {
label: string;
value: string | number;
}
export type SelectValueT = string | number | string[] | number[] | (string | number)[];
export declare const selectProps: {
/**
* 下拉框的值
* v-model
*/
modelValue: {
type: PropType<SelectValueT>;
};
/**
* 下拉框的默认值
* 非受控
*/
defaultValue: {
type: PropType<SelectValueT>;
};
/**
* 大小 SizeT
*/
size: {
type: PropType<SizeT>;
};
/**
* 圆角值 RoundT
*/
round: {
type: PropType<RoundT>;
};
/**
* 颜色类型 Color2T
*/
color: {
type: PropType<Color2T>;
default: string;
};
/**
* 按钮类型:VariantT
*/
variant: {
type: PropType<VariantT>;
default: string;
};
/**
* 提示文本
*/
placeholder: {
type: StringConstructor;
};
/**
* 是否支持多选
*/
multiple: {
type: BooleanConstructor;
};
/**
* 多选标签最大显示数量
*/
maxTagCount: {
type: NumberConstructor;
};
/**
* 是否可以清除
*/
clearable: {
type: BooleanConstructor;
};
/**
* 是否禁用
*/
disabled: {
type: BooleanConstructor;
};
/**
* 下拉选项触发方式 PopupTriggerT
*/
trigger: {
type: PropType<PopupTriggerT>;
default: string;
};
/**
* 下拉选项位置 PopupPositionT
*/
optionPosition: {
type: PropType<PopupPositionT>;
default: string;
};
/**
* 下拉选项宽度自适应规则 OptionWidthModeT
* 'auto':自动 | 'min-width':最小宽度与选择框一致 | 'width': 宽度与选择框一致
*/
optionWidthMode: {
type: PropType<OptionWidthModeT>;
default: string;
};
/**
* 下拉容器自定义类
*/
optionWrapClass: {
type: PropType<string | any[]>;
};
/**
* 是否在结束选择时,卸载下拉选项
* v-model
*/
unmountOnHide: {
type: BooleanConstructor;
default: boolean;
};
/**
* 过渡名称
*/
transition: {
type: StringConstructor;
};
/**
* 加载状态
*/
loading: {
type: BooleanConstructor;
};
/**
* 选择前回调,根据返回值判断是否显示
*/
beforeSelect: {
type: PropType<(value: string | number, currentValue: SelectValueT) => Promise<boolean | string | number> | boolean | string | number>;
};
/**
* 显示前回调,根据返回值判断是否显示
*/
beforeOptionsShow: {
type: PropType<() => Promise<boolean> | boolean>;
};
/**
* 隐藏前回调,根据返回值判断是否隐藏
*/
beforeOptionsHide: {
type: PropType<() => Promise<boolean> | boolean>;
};
/**
* 挂载容器,默认为body
*/
optionsWrapper: {
type: PropType<string | HTMLElement | null>;
default: string;
};
/**
* 多选超过最大tag是,文本显示
*/
foldLabel: {
type: PropType<(tags: Array<SelectOptionT>) => string>;
};
/**
* 浮层显示收起的多选tag
*/
showFoldTags: {
type: PropType<boolean | "hover" | "click">;
default: string;
};
/**
* 选项标题(pad、phone显示)
*/
optionTitle: {
type: StringConstructor;
};
/**
* 下拉浮层是否响应式
*/
noResponsive: {
type: BooleanConstructor;
};
};
export type SelectPropsT = ExtractPropTypes<typeof selectProps>;