mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
chore: 修改inputRange schema 类型定义
This commit is contained in:
parent
e8ccb2720c
commit
b34c16f3de
@ -20,12 +20,18 @@ import {
|
||||
MultipleValue,
|
||||
Value,
|
||||
FormatValue,
|
||||
MarksType,
|
||||
RangeItemProps
|
||||
} from '../renderers/Form/InputRange';
|
||||
import {stripNumber} from '../utils/tpl-builtin';
|
||||
import {findDOMNode} from 'react-dom';
|
||||
|
||||
type MarksType = {
|
||||
[index: number | string]: Record<
|
||||
number,
|
||||
React.ReactNode | {style?: React.CSSProperties; label?: string}
|
||||
>;
|
||||
};
|
||||
|
||||
interface HandleItemState {
|
||||
isDrag: boolean;
|
||||
labelActive: boolean;
|
||||
|
@ -10,6 +10,7 @@ import {Icon} from '../../components/icons';
|
||||
import {stripNumber} from '../../utils/tpl-builtin';
|
||||
import {autobind} from '../../utils/helper';
|
||||
import {filter} from '../../utils/tpl';
|
||||
import {SchemaObject} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Range
|
||||
@ -60,7 +61,7 @@ export interface RangeControlSchema extends FormBaseControl {
|
||||
/**
|
||||
* 刻度
|
||||
*/
|
||||
// marks?: MarksType;
|
||||
marks?: MarksType;
|
||||
|
||||
/**
|
||||
* 是否展示标签
|
||||
@ -98,10 +99,10 @@ export interface RangeControlSchema extends FormBaseControl {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export type MarksType = {
|
||||
type MarksType = {
|
||||
[index: number | string]: Record<
|
||||
number,
|
||||
React.ReactNode | {style?: React.CSSProperties; label?: string}
|
||||
SchemaObject | {style?: React.CSSProperties; label?: string}
|
||||
>;
|
||||
};
|
||||
|
||||
@ -138,11 +139,8 @@ export interface RangeProps extends FormControlProps {
|
||||
|
||||
/**
|
||||
* 刻度
|
||||
*
|
||||
* todo 这里面存在 React.Compnonent 复杂定义,不能转成 json schema
|
||||
* 需要简化类型定义,json 中是不能定义复杂类型的,如 function
|
||||
*/
|
||||
// marks?: MarksType;
|
||||
marks?: MarksType;
|
||||
|
||||
/**
|
||||
* 是否展示标签
|
||||
|
Loading…
Reference in New Issue
Block a user