jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
49 lines (48 loc) • 1.14 kB
TypeScript
import type { FormBaseControlSchema, FormControlProps, SchemaApi } from '../../types';
/**
* Matrix 选择控件。适合做权限勾选。
*
*/
export interface MatrixControlSchema extends FormBaseControlSchema {
type: 'matrix-checkboxes';
/**
* 配置singleSelectMode时设置为false
*/
multiple?: boolean;
/**
* 设置单选模式,multiple为false时有效
*/
singleSelectMode?: boolean;
/**
* 可用来通过 API 拉取 options。
*/
source?: SchemaApi;
columns?: Array<{
label: string;
[propName: string]: any;
}>;
rows?: Array<{
label: string;
[propName: string]: any;
}>;
/**
* 行标题说明
*/
rowLabel?: string;
}
export interface MatrixColumn {
label: string;
[propName: string]: any;
}
export interface MatrixRow {
label: string;
[propName: string]: any;
}
export interface ValueItem extends MatrixColumn, MatrixRow {
checked: boolean;
}
export interface MatrixProps extends FormControlProps {
columns: Array<MatrixColumn>;
rows: Array<MatrixRow>;
multiple: boolean;
}