chore: 修改inputRange schema 类型定义

This commit is contained in:
huangying11 2022-02-21 14:15:36 +08:00
parent e8ccb2720c
commit b34c16f3de
2 changed files with 12 additions and 8 deletions

View File

@ -20,12 +20,18 @@ import {
MultipleValue, MultipleValue,
Value, Value,
FormatValue, FormatValue,
MarksType,
RangeItemProps RangeItemProps
} from '../renderers/Form/InputRange'; } from '../renderers/Form/InputRange';
import {stripNumber} from '../utils/tpl-builtin'; import {stripNumber} from '../utils/tpl-builtin';
import {findDOMNode} from 'react-dom'; import {findDOMNode} from 'react-dom';
type MarksType = {
[index: number | string]: Record<
number,
React.ReactNode | {style?: React.CSSProperties; label?: string}
>;
};
interface HandleItemState { interface HandleItemState {
isDrag: boolean; isDrag: boolean;
labelActive: boolean; labelActive: boolean;

View File

@ -10,6 +10,7 @@ import {Icon} from '../../components/icons';
import {stripNumber} from '../../utils/tpl-builtin'; import {stripNumber} from '../../utils/tpl-builtin';
import {autobind} from '../../utils/helper'; import {autobind} from '../../utils/helper';
import {filter} from '../../utils/tpl'; import {filter} from '../../utils/tpl';
import {SchemaObject} from '../../Schema';
/** /**
* Range * 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; disabled?: boolean;
} }
export type MarksType = { type MarksType = {
[index: number | string]: Record< [index: number | string]: Record<
number, 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;
/** /**
* *