Merge pull request #424 from catchonme/master

导出theme注册入口
This commit is contained in:
liaoxuezhi 2020-01-10 09:28:33 +08:00 committed by GitHub
commit 9916a8a8d4
3 changed files with 6 additions and 3 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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 {