mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:39:05 +08:00
升级到最新的 uncontrollable
This commit is contained in:
parent
ecb9cc4ff0
commit
91afe54749
@ -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": {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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}
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
4
types/uncontrollable/index.d.ts
vendored
4
types/uncontrollable/index.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user