forked from p96170835/amis
commit
9916a8a8d4
|
@ -28,6 +28,7 @@ export interface ColorProps {
|
||||||
classnames: ClassNamesFn;
|
classnames: ClassNamesFn;
|
||||||
onChange: (value: any) => void;
|
onChange: (value: any) => void;
|
||||||
presetColors?: string[];
|
presetColors?: string[];
|
||||||
|
resetValue?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ColorControlState {
|
export interface ColorControlState {
|
||||||
|
@ -122,8 +123,8 @@ export class ColorControl extends React.PureComponent<
|
||||||
}
|
}
|
||||||
|
|
||||||
clearValue() {
|
clearValue() {
|
||||||
const onChange = this.props.onChange;
|
const {onChange, resetValue} = this.props;
|
||||||
onChange('');
|
onChange(resetValue || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick() {
|
handleClick() {
|
||||||
|
|
|
@ -184,7 +184,7 @@ import {addRule, str2rules} from './utils/validations';
|
||||||
import {normalizeOptions} from './components/Select';
|
import {normalizeOptions} from './components/Select';
|
||||||
import {OptionsControl} from './renderers/Form/Options';
|
import {OptionsControl} from './renderers/Form/Options';
|
||||||
|
|
||||||
import {classnames, getClassPrefix, setDefaultTheme} from './theme';
|
import {classnames, getClassPrefix, setDefaultTheme, theme} from './theme';
|
||||||
const classPrefix = getClassPrefix();
|
const classPrefix = getClassPrefix();
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -256,6 +256,7 @@ export {
|
||||||
Scoped,
|
Scoped,
|
||||||
ScopedContext,
|
ScopedContext,
|
||||||
setDefaultTheme,
|
setDefaultTheme,
|
||||||
|
theme,
|
||||||
classPrefix,
|
classPrefix,
|
||||||
getClassPrefix,
|
getClassPrefix,
|
||||||
classnames
|
classnames
|
||||||
|
|
|
@ -9,6 +9,7 @@ export interface ColorProps extends FormControlProps {
|
||||||
timeConstrainst?: object;
|
timeConstrainst?: object;
|
||||||
closeOnSelect?: boolean;
|
closeOnSelect?: boolean;
|
||||||
presetColors?: string[];
|
presetColors?: string[];
|
||||||
|
resetValue?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ColorControlState {
|
export interface ColorControlState {
|
||||||
|
|
Loading…
Reference in New Issue