jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
70 lines (69 loc) • 1.72 kB
TypeScript
import type { ThemeProps } from 'jamis-core';
import type { FormBaseControlSchema, FormControlProps, FormOptionsSchema, SchemaTpl } from '../types';
/**
* Picker
*
*/
export interface PickerControlSchema extends FormOptionsSchema {
type: 'picker';
/**
* 可用来生成选中的值的描述文字
*/
labelTpl?: SchemaTpl;
/**
* 建议用 labelTpl
* 选中一个字段名用来作为值的描述文字
*/
labelField?: string;
/**
* 选一个可以用来作为值的字段。
*/
valueField?: string;
/**
* 弹窗选择框详情。
*/
pickerSchema?: any;
/**
* 弹窗模式,dialog 或者 drawer
*/
modalMode?: 'dialog' | 'drawer';
/**
* 内嵌模式,也就是说不弹框了。
*/
embed?: boolean;
}
/**
* 图标选择器
*
*/
export interface IconPickerControlSchema extends FormBaseControlSchema {
type: 'icon-picker';
}
export interface IconPickerProps extends FormControlProps {
placeholder?: string;
resetValue?: any;
noDataTip?: string;
clearable?: boolean;
}
/**
* Location 选点组件
*
*/
export interface LocationControlSchema extends FormBaseControlSchema {
type: 'location-picker';
/**
* 选择地图类型
*/
vendor?: 'baidu' | 'gaode' | 'tenxun';
/**
* 有的地图需要设置 ak 信息
*/
ak?: string;
}
export interface LocationPickerProps extends FormControlProps, ThemeProps, Omit<LocationControlSchema, 'type' | 'descriptionClassName' | 'inputClassName'> {
value: any;
onChange: (value: any) => void;
vendor: 'baidu' | 'gaode' | 'tenxun';
ak: string;
coordinatesType: 'bd09' | 'gcj02';
}