升级到最新的 uncontrollable

This commit is contained in:
2betop 2020-06-03 17:19:14 +08:00
parent ecb9cc4ff0
commit 91afe54749
23 changed files with 37 additions and 24 deletions

View File

@ -73,7 +73,7 @@
"sortablejs": "1.10.0",
"tinymce": "5.2.2",
"tslib": "^1.10.0",
"uncontrollable": "4.1.0",
"uncontrollable": "7.0.2",
"video-react": "0.9.4"
},
"devDependencies": {

View File

@ -1,6 +1,10 @@
.#{$ns}InputBox {
@include input-input();
> input[readonly] {
cursor: inherit;
}
&.is-error {
border-color: $Form-input-onError-borderColor;
background-color: $Form-input-onError-bg;
@ -15,6 +19,12 @@
}
}
&.is-clickable:hover {
border-color: $Form-input-onFocused-borderColor;
box-shadow: $Form-input-boxShadow;
cursor: pointer;
}
&.is-error.is-focused {
border-color: $Form-input-onError-borderColor;
}

View File

@ -11,7 +11,7 @@ import ListMenu from './ListMenu';
import {autobind} from '../utils/helper';
import ListRadios from './ListRadios';
import {themeable} from '../theme';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import ListCheckboxes from './ListCheckboxes';
import TableCheckboxes from './TableCheckboxes';
import TreeCheckboxes from './TreeCheckboxes';

View File

@ -4,7 +4,7 @@
import {BaseCheckboxes, BaseCheckboxesProps} from './Checkboxes';
import {themeable} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option} from './Select';
import {getTreeDepth} from '../utils/helper';

View File

@ -5,7 +5,7 @@
*/
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import chunk from 'lodash/chunk';
import {ClassNamesFn, themeable, ThemeProps} from '../theme';

View File

@ -10,7 +10,7 @@ import {findDOMNode} from 'react-dom';
import {SketchPicker, GithubPicker, ColorState} from 'react-color';
import {Icon} from './icons';
import Overlay from './Overlay';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import PopOver from './PopOver';
import {ClassNamesFn, themeable, ThemeProps} from '../theme';
import {autobind} from '../utils/helper';

View File

@ -34,6 +34,8 @@ export class InputBox extends React.Component<InputBoxProps, InputBoxState> {
@autobind
clearValue(e: any) {
e.preventDefault();
const onClear = this.props.onChange;
const onChange = this.props.onChange;
onClear?.(e);
@ -87,7 +89,8 @@ export class InputBox extends React.Component<InputBoxProps, InputBoxState> {
className,
isFocused ? 'is-focused' : '',
disabled ? 'is-disabled' : '',
hasError ? 'is-error' : ''
hasError ? 'is-error' : '',
rest.onClick ? 'is-clickable' : ''
)}
>
{result}

View File

@ -1,7 +1,7 @@
import {BaseCheckboxes} from './Checkboxes';
import {themeable} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option} from './Select';
import {localeable} from '../locale';

View File

@ -1,7 +1,7 @@
import {BaseCheckboxes} from './Checkboxes';
import {themeable, ThemeProps} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option, Options} from './Select';
import {findTree, autobind} from '../utils/helper';

View File

@ -14,7 +14,7 @@
*/
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {value2array, OptionProps, Option} from './Select';
import chunk from 'lodash/chunk';

View File

@ -6,7 +6,7 @@
import React from 'react';
import InputRange from 'react-input-range';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import cx from 'classnames';
import {RendererProps} from '../factory';
import {ClassNamesFn, themeable} from '../theme';

View File

@ -1,7 +1,7 @@
import {ThemeProps, themeable} from '../theme';
import React from 'react';
import {InputBoxProps} from './InputBox';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import {Icon} from './icons';
import Input from './Input';
import {autobind} from '../utils/helper';

View File

@ -1,7 +1,7 @@
import React from 'react';
import {ThemeProps, themeable} from '../theme';
import {Icon} from './icons';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import {autobind} from '../utils/helper';
import {LocaleProps, localeable} from '../locale';

View File

@ -5,7 +5,7 @@
* @date 2017-11-07
*/
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import React from 'react';
import Overlay from './Overlay';
import PopOver from './PopOver';

View File

@ -1,7 +1,7 @@
import {BaseCheckboxes, BaseCheckboxesProps} from './Checkboxes';
import {themeable} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option} from './Select';
import {resolveVariable} from '../utils/tpl-builtin';

View File

@ -8,7 +8,7 @@ import React from 'react';
import {Schema} from '../types';
import Transition, {ENTERED, ENTERING} from 'react-transition-group/Transition';
import {themeable, ThemeProps} from '../theme';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
const transitionStyles: {
[propName: string]: string;

View File

@ -6,7 +6,7 @@
import React from 'react';
import Html from './Html';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import {findDOMNode} from 'react-dom';
import Tooltip from './Tooltip';
import {ClassNamesFn, themeable} from '../theme';

View File

@ -2,7 +2,7 @@ import React from 'react';
import {ThemeProps, themeable} from '../theme';
import {BaseCheckboxesProps, BaseCheckboxes} from './Checkboxes';
import {Options, Option} from './Select';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import ResultList from './ResultList';
import TableCheckboxes from './TableCheckboxes';
import ListCheckboxes from './ListCheckboxes';

View File

@ -1,7 +1,7 @@
import {BaseCheckboxes, BaseCheckboxesProps} from './Checkboxes';
import {themeable} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option} from './Select';
import {autobind, eachTree, everyTree} from '../utils/helper';

View File

@ -1,6 +1,6 @@
import {themeable} from '../theme';
import React from 'react';
import uncontrollable from 'uncontrollable';
import {uncontrollable} from 'uncontrollable';
import Checkbox from './Checkbox';
import {Option} from './Select';
import {autobind, eachTree, everyTree} from '../utils/helper';

View File

@ -593,7 +593,8 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
: (schema.children as Function)({
...rest,
$path: $path,
render: this.renderChild
render: this.renderChild,
forwardedRef: this.refFn
});
} else if (typeof schema.component === 'function') {
const isSFC = !(schema.component.prototype instanceof React.Component);
@ -602,6 +603,7 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
...schema,
$path: $path,
ref: isSFC ? undefined : this.refFn,
forwardedRef: isSFC ? this.refFn : undefined,
render: this.renderChild
});
} else if (!this.renderer) {

View File

@ -1019,7 +1019,7 @@ export default class Form extends React.Component<FormProps, object> {
// 自定义组件如果在节点设置了 label name 什么的,就用 formItem 包一层
// 至少自动支持了 valdiations, label, description 等逻辑。
if (control.component && control.label && control.name) {
if (control.component && control.label !== undefined && control.name) {
const cache = this.componentCache.get(control.component);
if (cache) {

View File

@ -1,10 +1,8 @@
declare module 'uncontrollable' {
function uncontrollable<
export function uncontrollable<
T extends Raect.ComponentType<any>,
P extends {
[propName: string]: any;
}
>(arg: T, config: P): T;
export = uncontrollable;
}