mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
补充之前因代码拆分删掉的逻辑
This commit is contained in:
parent
1ff51f15fb
commit
31eb2feb12
10
fis-conf.js
10
fis-conf.js
@ -127,7 +127,7 @@ fis.match('tinymce/plugins/*/index.js', {
|
||||
ignoreDependencies: false
|
||||
});
|
||||
|
||||
fis.match(/(?:mpegts\.js)/, {
|
||||
fis.match(/(?:mpegts\.js|object\-inspect\/util\.inspect\.js)/, {
|
||||
ignoreDependencies: true
|
||||
});
|
||||
|
||||
@ -709,10 +709,13 @@ if (fis.project.currentMedia() === 'publish-sdk') {
|
||||
'!amis-formula/**',
|
||||
'!amis-core/**',
|
||||
'!amis-ui/**',
|
||||
'!amis/**',
|
||||
'!amis/**'
|
||||
],
|
||||
|
||||
'pkg/rich-text.js': ['amis-ui/lib/components/RichText.js', 'froala-editor/**'],
|
||||
'pkg/rich-text.js': [
|
||||
'amis-ui/lib/components/RichText.js',
|
||||
'froala-editor/**'
|
||||
],
|
||||
|
||||
'pkg/tinymce.js': ['amis-ui/lib/components/Tinymce.tsx', 'tinymce/**'],
|
||||
|
||||
@ -929,4 +932,3 @@ if (fis.project.currentMedia() === 'publish-sdk') {
|
||||
domain: null
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import {RendererEnv} from './env';
|
||||
import {RendererProps} from './factory';
|
||||
import {LocaleContext, TranslateFn} from './locale';
|
||||
import {RootRenderer} from './RootRenderer';
|
||||
import {RootRenderer, RootRendererProps} from './RootRenderer';
|
||||
import {SchemaRenderer} from './SchemaRenderer';
|
||||
import Scoped from './Scoped';
|
||||
import {IRendererStore} from './store';
|
||||
@ -29,6 +29,23 @@ export interface RootProps {
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
||||
export interface RootWrapperProps {
|
||||
env: RendererEnv;
|
||||
children: React.ReactNode;
|
||||
schema: SchemaNode;
|
||||
rootStore: IRendererStore;
|
||||
theme: string;
|
||||
[propName: string]: any;
|
||||
}
|
||||
|
||||
const rootWrappers: Array<(props: RootWrapperProps) => React.ReactNode> = [];
|
||||
|
||||
export function addRootWrapper(
|
||||
fn: (props: RootWrapperProps) => React.ReactNode
|
||||
) {
|
||||
rootWrappers.push(fn);
|
||||
}
|
||||
|
||||
export class Root extends React.Component<RootProps> {
|
||||
@autobind
|
||||
resolveDefinitions(name: string) {
|
||||
@ -62,28 +79,60 @@ export class Root extends React.Component<RootProps> {
|
||||
<RootStoreContext.Provider value={rootStore}>
|
||||
<ThemeContext.Provider value={themeName}>
|
||||
<LocaleContext.Provider value={this.props.locale!}>
|
||||
<RootRenderer
|
||||
pathPrefix={pathPrefix || ''}
|
||||
schema={
|
||||
isPlainObject(schema)
|
||||
? {
|
||||
type: 'page',
|
||||
...(schema as any)
|
||||
}
|
||||
: schema
|
||||
}
|
||||
{...rest}
|
||||
render={renderChild}
|
||||
rootStore={rootStore}
|
||||
resolveDefinitions={this.resolveDefinitions}
|
||||
location={location}
|
||||
data={data}
|
||||
env={env}
|
||||
classnames={theme.classnames}
|
||||
classPrefix={theme.classPrefix}
|
||||
locale={locale}
|
||||
translate={translate}
|
||||
/>
|
||||
{
|
||||
rootWrappers.reduce(
|
||||
(props: RootWrapperProps, wrapper) => {
|
||||
return {
|
||||
...props,
|
||||
children: wrapper(props)
|
||||
};
|
||||
},
|
||||
{
|
||||
pathPrefix: pathPrefix || '',
|
||||
schema: isPlainObject(schema)
|
||||
? {
|
||||
type: 'page',
|
||||
...(schema as any)
|
||||
}
|
||||
: schema,
|
||||
...rest,
|
||||
render: renderChild,
|
||||
rootStore: rootStore,
|
||||
resolveDefinitions: this.resolveDefinitions,
|
||||
location: location,
|
||||
data: data,
|
||||
env: env,
|
||||
classnames: theme.classnames,
|
||||
classPrefix: theme.classPrefix,
|
||||
locale: locale,
|
||||
translate: translate,
|
||||
children: (
|
||||
<RootRenderer
|
||||
pathPrefix={pathPrefix || ''}
|
||||
schema={
|
||||
isPlainObject(schema)
|
||||
? {
|
||||
type: 'page',
|
||||
...(schema as any)
|
||||
}
|
||||
: schema
|
||||
}
|
||||
{...rest}
|
||||
render={renderChild}
|
||||
rootStore={rootStore}
|
||||
resolveDefinitions={this.resolveDefinitions}
|
||||
location={location}
|
||||
data={data}
|
||||
env={env}
|
||||
classnames={theme.classnames}
|
||||
classPrefix={theme.classPrefix}
|
||||
locale={locale}
|
||||
translate={translate}
|
||||
/>
|
||||
)
|
||||
} as RootWrapperProps
|
||||
).children
|
||||
}
|
||||
</LocaleContext.Provider>
|
||||
</ThemeContext.Provider>
|
||||
</RootStoreContext.Provider>
|
||||
|
@ -70,7 +70,7 @@ import {
|
||||
registerOptionsControl
|
||||
} from './renderers/Options';
|
||||
import {Schema} from './types';
|
||||
import ScopedRootRenderer, {RootRenderProps} from './Root';
|
||||
import ScopedRootRenderer, {addRootWrapper, RootRenderProps} from './Root';
|
||||
import {envOverwrite} from './envOverwrite';
|
||||
import {EnvContext, RendererEnv} from './env';
|
||||
import React from 'react';
|
||||
@ -152,7 +152,8 @@ export {
|
||||
FormOptionsControl,
|
||||
FormControlProps,
|
||||
FormBaseControl,
|
||||
extendDefaultEnv
|
||||
extendDefaultEnv,
|
||||
addRootWrapper
|
||||
};
|
||||
|
||||
export function render(
|
||||
|
@ -195,7 +195,12 @@ export interface OptionsControlProps
|
||||
extends FormControlProps,
|
||||
Omit<
|
||||
FormOptionsControl,
|
||||
'type' | 'className' | 'descriptionClassName' | 'inputClassName'
|
||||
| 'type'
|
||||
| 'className'
|
||||
| 'descriptionClassName'
|
||||
| 'inputClassName'
|
||||
| 'remark'
|
||||
| 'labelRemark'
|
||||
> {
|
||||
options: Array<Option>;
|
||||
onToggle: (
|
||||
|
@ -5,7 +5,13 @@
|
||||
*/
|
||||
|
||||
import NotFound from './404';
|
||||
import {default as Alert, alert, confirm, prompt} from './Alert';
|
||||
import {
|
||||
default as Alert,
|
||||
alert,
|
||||
confirm,
|
||||
prompt,
|
||||
setRenderSchemaFn
|
||||
} from './Alert';
|
||||
import {default as ContextMenu, openContextMenus} from './ContextMenu';
|
||||
import AsideNav from './AsideNav';
|
||||
import Avatar from './Avatar';
|
||||
@ -67,7 +73,7 @@ import FormulaPicker from './formula/Picker';
|
||||
import PickerContainer from './PickerContainer';
|
||||
import InputJSONSchema from './json-schema';
|
||||
import {Badge, BadgeObject, withBadge} from './Badge';
|
||||
import {getIcon, Icon} from './icons';
|
||||
import {getIcon, Icon, registerIcon} from './icons';
|
||||
import {RemoteOptionsProps, withRemoteConfig} from './WithRemoteConfig';
|
||||
import ConditionBuilder from './condition-builder';
|
||||
import {
|
||||
@ -101,6 +107,7 @@ import Progress from './Progress';
|
||||
import Steps, {StepStatus} from './Steps';
|
||||
import Tag from './Tag';
|
||||
import Timeline from './Timeline';
|
||||
import ImageGallery from './ImageGallery';
|
||||
|
||||
export {
|
||||
NotFound,
|
||||
@ -109,6 +116,7 @@ export {
|
||||
Avatar,
|
||||
confirm,
|
||||
prompt,
|
||||
setRenderSchemaFn,
|
||||
ContextMenu,
|
||||
openContextMenus,
|
||||
Alert2,
|
||||
@ -193,6 +201,7 @@ export {
|
||||
UserSelect,
|
||||
UserTabSelect,
|
||||
getIcon,
|
||||
registerIcon,
|
||||
Badge,
|
||||
HeadCellDropDown,
|
||||
AnchorNav,
|
||||
@ -210,5 +219,6 @@ export {
|
||||
Steps,
|
||||
StepStatus,
|
||||
Tag,
|
||||
Timeline
|
||||
Timeline,
|
||||
ImageGallery
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {PageSchema} from './renderers/Page';
|
||||
import {TplSchema} from './renderers/Tpl';
|
||||
import {RemarkSchema} from './renderers/Remark';
|
||||
import {RemarkSchema, SchemaRemark} from './renderers/Remark';
|
||||
import {ActionSchema} from './renderers/Action';
|
||||
import {AlertSchema} from './renderers/Alert';
|
||||
import {AudioSchema} from './renderers/Audio';
|
||||
@ -121,6 +121,8 @@ import {JSONSchemaEditorControlSchema} from './renderers/Form/JSONSchemaEditor';
|
||||
import {TableSchemaV2} from './renderers/Table-v2';
|
||||
import {
|
||||
BaseSchemaWithoutType,
|
||||
FormBaseControl,
|
||||
FormOptionsControl,
|
||||
SchemaClassName,
|
||||
SchemaExpression
|
||||
} from 'amis-core';
|
||||
@ -861,4 +863,25 @@ export interface FormSchema extends FormSchemaBase, BaseSchema {
|
||||
body?: SchemaCollection;
|
||||
}
|
||||
|
||||
export interface FormBaseControlSchema extends FormBaseControl {
|
||||
/**
|
||||
* 表单项类型
|
||||
*/
|
||||
type: SchemaType;
|
||||
|
||||
/**
|
||||
* 显示一个小图标, 鼠标放上去的时候显示提示内容
|
||||
*/
|
||||
remark?: SchemaRemark;
|
||||
|
||||
/**
|
||||
* 显示一个小图标, 鼠标放上去的时候显示提示内容, 这个小图标跟 label 在一起
|
||||
*/
|
||||
labelRemark?: SchemaRemark;
|
||||
}
|
||||
|
||||
export interface FormOptionsSchema
|
||||
extends FormBaseControlSchema,
|
||||
Omit<FormOptionsControl, 'remark' | 'labelRemark'> {}
|
||||
|
||||
export {SchemaClassName, SchemaExpression};
|
||||
|
@ -1,10 +0,0 @@
|
||||
import {extendDefaultEnv} from 'amis-core';
|
||||
|
||||
import {alert, confirm, toast} from 'amis-ui';
|
||||
|
||||
extendDefaultEnv({
|
||||
alert,
|
||||
confirm,
|
||||
notify: (type: keyof typeof toast, msg: string, conf: any) =>
|
||||
toast[type] ? toast[type](msg, conf) : console.warn('[Notify]', type, msg)
|
||||
});
|
58
packages/amis/src/preset.tsx
Normal file
58
packages/amis/src/preset.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import {
|
||||
addRootWrapper,
|
||||
extendDefaultEnv,
|
||||
LazyComponent,
|
||||
render
|
||||
} from 'amis-core';
|
||||
|
||||
import {
|
||||
alert,
|
||||
confirm,
|
||||
setRenderSchemaFn,
|
||||
toast,
|
||||
ImageGallery,
|
||||
Spinner
|
||||
} from 'amis-ui';
|
||||
import React from 'react';
|
||||
|
||||
extendDefaultEnv({
|
||||
alert,
|
||||
confirm,
|
||||
notify: (type: keyof typeof toast, msg: string, conf: any) =>
|
||||
toast[type] ? toast[type](msg, conf) : console.warn('[Notify]', type, msg)
|
||||
});
|
||||
|
||||
setRenderSchemaFn((controls, value, callback, scopeRef, theme) => {
|
||||
return render(
|
||||
{
|
||||
name: 'form',
|
||||
type: 'form',
|
||||
wrapWithPanel: false,
|
||||
mode: 'horizontal',
|
||||
controls,
|
||||
messages: {
|
||||
validateFailed: ''
|
||||
}
|
||||
},
|
||||
{
|
||||
data: value,
|
||||
onFinished: callback,
|
||||
scopeRef,
|
||||
theme
|
||||
},
|
||||
{
|
||||
session: 'prompt'
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
addRootWrapper((props: any) => {
|
||||
const {env, children} = props;
|
||||
return (
|
||||
<ImageGallery modalContainer={env.getModalContainer}>
|
||||
{children}
|
||||
</ImageGallery>
|
||||
);
|
||||
});
|
||||
|
||||
LazyComponent.defaultProps.placeholder = <Spinner />;
|
@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import cx from 'classnames';
|
||||
import {
|
||||
OptionsControl,
|
||||
OptionsControlProps,
|
||||
@ -8,9 +7,7 @@ import {
|
||||
import type {Option} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {getLevelFromClassName, autobind, isEmpty} from 'amis-core';
|
||||
import {dataMapping} from 'amis-core';
|
||||
import {ButtonGroupSchema} from '../ButtonGroup';
|
||||
import {FormBaseControl} from 'amis-core';
|
||||
|
||||
/**
|
||||
* 按钮组控件。
|
||||
|
@ -11,12 +11,13 @@ import {Api} from 'amis-core';
|
||||
import {isEffectiveApi} from 'amis-core';
|
||||
import {isMobile, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* 级联选择框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/chained-select
|
||||
*/
|
||||
export interface ChainedSelectControlSchema extends FormOptionsControl {
|
||||
export interface ChainedSelectControlSchema extends FormOptionsSchema {
|
||||
type: 'chained-select';
|
||||
}
|
||||
|
||||
|
@ -5,12 +5,13 @@ import {
|
||||
FormOptionsControl
|
||||
} from 'amis-core';
|
||||
import {autobind} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* 图表 Radio 单选框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/chart-radios
|
||||
*/
|
||||
export interface ChartRadiosControlSchema extends FormOptionsControl {
|
||||
export interface ChartRadiosControlSchema extends FormOptionsSchema {
|
||||
type: 'chart-radios';
|
||||
config: any;
|
||||
showTooltipOnHighlight?: boolean;
|
||||
|
@ -5,7 +5,7 @@ import {Checkbox} from 'amis-ui';
|
||||
import {withBadge, BadgeObject} from 'amis-ui';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {BaseSchema} from '../../Schema';
|
||||
import {BaseSchema, FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
export interface SchemaMap {
|
||||
checkbox: CheckboxControlSchema;
|
||||
@ -15,7 +15,7 @@ export interface SchemaMap {
|
||||
* Checkbox 勾选框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/checkbox
|
||||
*/
|
||||
export interface CheckboxControlSchema extends FormBaseControl {
|
||||
export interface CheckboxControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为多行文本输入框
|
||||
*/
|
||||
|
@ -10,12 +10,13 @@ import {Icon} from 'amis-ui';
|
||||
import {ActionObject, Api} from 'amis-core';
|
||||
import {autobind, hasAbility} from 'amis-core';
|
||||
import {columnsSplit} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* 复选框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/checkboxes
|
||||
*/
|
||||
export interface CheckboxesControlSchema extends FormOptionsControl {
|
||||
export interface CheckboxesControlSchema extends FormOptionsSchema {
|
||||
type: 'checkboxes';
|
||||
|
||||
/**
|
||||
|
@ -26,6 +26,7 @@ import memoize from 'lodash/memoize';
|
||||
import {Icon} from 'amis-ui';
|
||||
import {isAlive} from 'mobx-state-tree';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaApi,
|
||||
SchemaClassName,
|
||||
SchemaObject,
|
||||
@ -57,7 +58,7 @@ export type ComboSubControl = SchemaObject & {
|
||||
* Combo 组合输入框类型
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/combo
|
||||
*/
|
||||
export interface ComboControlSchema extends FormBaseControl {
|
||||
export interface ComboControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为组合输入框类型
|
||||
*/
|
||||
|
@ -7,7 +7,11 @@ import {
|
||||
isPureVariable,
|
||||
resolveVariableAndFilter
|
||||
} from 'amis-core';
|
||||
import {SchemaApi, SchemaTokenizeableString} from '../../Schema';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaApi,
|
||||
SchemaTokenizeableString
|
||||
} from '../../Schema';
|
||||
|
||||
import {autobind} from 'amis-core';
|
||||
import {
|
||||
@ -23,7 +27,7 @@ import {
|
||||
* 条件组合控件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/condition-builder
|
||||
*/
|
||||
export interface ConditionBuilderControlSchema extends FormBaseControl {
|
||||
export interface ConditionBuilderControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import {RendererProps, Renderer} from 'amis-core';
|
||||
import {SchemaCollection} from '../../Schema';
|
||||
import {FormBaseControlSchema, SchemaCollection} from '../../Schema';
|
||||
import {autobind} from 'amis-core';
|
||||
import {resolveVariable} from 'amis-core';
|
||||
import {FormBaseControl, FormItemWrap} from 'amis-core';
|
||||
@ -9,7 +9,7 @@ import {FormBaseControl, FormItemWrap} from 'amis-core';
|
||||
* Group 表单集合渲染器,能让多个表单在一行显示
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/group
|
||||
*/
|
||||
export interface FormControlSchema extends FormBaseControl {
|
||||
export interface FormControlSchema extends FormBaseControlSchema {
|
||||
type: 'control';
|
||||
|
||||
/**
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {LazyComponent} from 'amis-core';
|
||||
import {isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
||||
import {SchemaTokenizeableString} from '../../Schema';
|
||||
import {FormBaseControlSchema, SchemaTokenizeableString} from '../../Schema';
|
||||
import {autobind} from 'amis-core';
|
||||
import {bindRendererEvent} from 'amis-core';
|
||||
|
||||
@ -13,7 +13,7 @@ import type {ListenerAction} from 'amis-core';
|
||||
* Diff 编辑器
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/diff
|
||||
*/
|
||||
export interface DiffControlSchema extends FormBaseControl {
|
||||
export interface DiffControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为 Diff 编辑器
|
||||
*/
|
||||
|
@ -2,12 +2,13 @@ import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {evalJS, filter} from 'amis-core';
|
||||
import {autobind, isObjectShallowModified, setVariable} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* 公式功能控件。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/formula
|
||||
*/
|
||||
export interface FormulaControlSchema extends FormBaseControl {
|
||||
export interface FormulaControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为公式功能控件。
|
||||
*/
|
||||
|
@ -3,7 +3,11 @@ import {Renderer, RendererProps} from 'amis-core';
|
||||
import {isVisible, getWidthRate, makeHorizontalDeeper} from 'amis-core';
|
||||
import {FormBaseControl, FormItemWrap} from 'amis-core';
|
||||
|
||||
import {SchemaClassName, SchemaObject} from '../../Schema';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaClassName,
|
||||
SchemaObject
|
||||
} from '../../Schema';
|
||||
import Form, {FormHorizontal} from 'amis-core';
|
||||
|
||||
export type GroupSubControl = SchemaObject & {
|
||||
@ -22,7 +26,7 @@ export type GroupSubControl = SchemaObject & {
|
||||
* Group 表单集合渲染器,能让多个表单在一行显示
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/group
|
||||
*/
|
||||
export interface GroupControlSchema extends FormBaseControl {
|
||||
export interface GroupControlSchema extends FormBaseControlSchema {
|
||||
type: 'group';
|
||||
|
||||
/**
|
||||
|
@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Hidden 隐藏域。功能性组件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/hidden
|
||||
*/
|
||||
export interface HiddenControlSchema extends FormBaseControl {
|
||||
export interface HiddenControlSchema extends FormBaseControlSchema {
|
||||
type: 'hidden';
|
||||
}
|
||||
|
||||
|
@ -8,12 +8,13 @@ import {ICONS} from './IconPickerIcons';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {Option} from 'amis-core';
|
||||
import {Icon} from 'amis-ui';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* 图标选择器
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/icon-picker
|
||||
*/
|
||||
export interface IconPickerControlSchema extends FormBaseControl {
|
||||
export interface IconPickerControlSchema extends FormBaseControlSchema {
|
||||
type: 'icon-picker';
|
||||
|
||||
// 这就不应该成为一个 amis 控件。。。
|
||||
|
@ -8,12 +8,13 @@ import {autobind, isMobile, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {Option} from 'amis-core';
|
||||
import {localeable, LocaleProps} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* City 城市选择框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/city
|
||||
*/
|
||||
export interface InputCityControlSchema extends FormBaseControl {
|
||||
export interface InputCityControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为城市选择框。
|
||||
*/
|
||||
|
@ -4,6 +4,7 @@ import cx from 'classnames';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import type {PresetColor} from 'amis-ui';
|
||||
import {isMobile} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
// todo amis-ui 里面组件直接改成按需加载
|
||||
export const ColorPicker = React.lazy(
|
||||
@ -14,7 +15,7 @@ export const ColorPicker = React.lazy(
|
||||
* Color 颜色选择框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/color
|
||||
*/
|
||||
export interface InputColorControlSchema extends FormBaseControl {
|
||||
export interface InputColorControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为颜色选择框
|
||||
*/
|
||||
|
@ -5,11 +5,11 @@ import {filterDate, isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
||||
import moment from 'moment';
|
||||
import 'moment/locale/zh-cn';
|
||||
import {DatePicker} from 'amis-ui';
|
||||
import {SchemaObject} from '../../Schema';
|
||||
import {FormBaseControlSchema, SchemaObject} from '../../Schema';
|
||||
import {createObject, anyChanged, isMobile, autobind} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
|
||||
export interface InputDateBaseControlSchema extends FormBaseControl {
|
||||
export interface InputDateBaseControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为日期选择控件
|
||||
*/
|
||||
|
@ -7,12 +7,13 @@ import {DateRangePicker} from 'amis-ui';
|
||||
import {isMobile, createObject, autobind} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import type {ShortCuts} from 'amis-ui/lib/components/DatePicker';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* DateRange 日期范围控件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/date-range
|
||||
*/
|
||||
export interface DateRangeControlSchema extends FormBaseControl {
|
||||
export interface DateRangeControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为日期范围控件
|
||||
*/
|
||||
|
@ -2,12 +2,13 @@ import React, {Suspense} from 'react';
|
||||
import Dropzone from 'react-dropzone';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Excel 解析
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-excel
|
||||
*/
|
||||
export interface InputExcelControlSchema extends FormBaseControl {
|
||||
export interface InputExcelControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为 Excel 解析
|
||||
*/
|
||||
|
@ -12,6 +12,7 @@ import DropZone from 'react-dropzone';
|
||||
import {FileRejection} from 'react-dropzone';
|
||||
import {dataMapping} from 'amis-core';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaApi,
|
||||
SchemaClassName,
|
||||
SchemaTokenizeableString,
|
||||
@ -24,7 +25,7 @@ import omit from 'lodash/omit';
|
||||
* File 文件上传控件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/file
|
||||
*/
|
||||
export interface FileControlSchema extends FormBaseControl {
|
||||
export interface FileControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为文件上传
|
||||
*/
|
||||
|
@ -3,7 +3,7 @@ import {FormItem, FormBaseControl, FormControlProps} from 'amis-core';
|
||||
import {FormulaPicker} from 'amis-ui';
|
||||
import {autobind} from 'amis-core';
|
||||
|
||||
import type {SchemaIcon} from '../../Schema';
|
||||
import type {FormBaseControlSchema, SchemaIcon} from '../../Schema';
|
||||
import {isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
||||
import type {
|
||||
FuncGroup,
|
||||
@ -14,7 +14,7 @@ import type {
|
||||
* InputFormula 公式编辑器
|
||||
* 文档:https://baidu.gitee.io/amis/zh-CN/components/form/input-formula
|
||||
*/
|
||||
export interface InputFormulaControlSchema extends FormBaseControl {
|
||||
export interface InputFormulaControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-formula';
|
||||
|
||||
/**
|
||||
|
@ -8,13 +8,18 @@ import {
|
||||
import {getExprProperties} from 'amis-core';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {IFormItemStore, IFormStore} from 'amis-core';
|
||||
import {SchemaClassName, SchemaCollection, SchemaObject} from '../../Schema';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaClassName,
|
||||
SchemaCollection,
|
||||
SchemaObject
|
||||
} from '../../Schema';
|
||||
|
||||
/**
|
||||
* InputGroup
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-group
|
||||
*/
|
||||
export interface InputGroupControlSchema extends FormBaseControl {
|
||||
export interface InputGroupControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-group';
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@ import ImageComponent, {ImageThumbProps} from '../Image';
|
||||
import {TranslateFn} from 'amis-core';
|
||||
import {dataMapping} from 'amis-core';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaApi,
|
||||
SchemaClassName,
|
||||
SchemaTokenizeableString,
|
||||
@ -31,7 +32,7 @@ import omit from 'lodash/omit';
|
||||
* Image 图片上传控件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/image
|
||||
*/
|
||||
export interface ImageControlSchema extends FormBaseControl {
|
||||
export interface ImageControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为图片上传控件
|
||||
*/
|
||||
|
@ -6,12 +6,12 @@ import {NumberInput, Select} from 'amis-ui';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {normalizeOptions, Option} from 'amis-core';
|
||||
import {PlainObject, ActionObject} from 'amis-core';
|
||||
import {BaseSchema} from '../../Schema';
|
||||
import {BaseSchema, FormBaseControlSchema} from '../../Schema';
|
||||
/**
|
||||
* 数字输入框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/number
|
||||
*/
|
||||
export interface NumberControlSchema extends FormBaseControl {
|
||||
export interface NumberControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-number';
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,7 @@ import {Icon} from 'amis-ui';
|
||||
import {stripNumber} from 'amis-core';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {filter} from 'amis-core';
|
||||
import {SchemaObject} from '../../Schema';
|
||||
import {FormBaseControlSchema, SchemaObject} from '../../Schema';
|
||||
import {ActionObject} from 'amis-core';
|
||||
|
||||
/**
|
||||
@ -24,7 +24,7 @@ export type FormatValue = MultipleValue | number;
|
||||
export type TooltipPosType = 'auto' | 'top' | 'right' | 'bottom' | 'left';
|
||||
export type InputRangeRendererEvent = 'change' | 'blur' | 'focus';
|
||||
export type InputRangeRendererAction = 'clear';
|
||||
export interface RangeControlSchema extends FormBaseControl {
|
||||
export interface RangeControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-range';
|
||||
|
||||
/**
|
||||
|
@ -4,12 +4,13 @@ import {autobind, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {Rating} from 'amis-ui';
|
||||
import type {textPositionType} from 'amis-ui/lib/components/Rating';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Rating
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/rating
|
||||
*/
|
||||
export interface RatingControlSchema extends FormBaseControl {
|
||||
export interface RatingControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-rating';
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
* Repeat
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/repeat
|
||||
*/
|
||||
export interface RepeatControlSchema extends FormBaseControl {
|
||||
export interface RepeatControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-repeat';
|
||||
|
||||
options?: string;
|
||||
@ -34,6 +34,7 @@ const LANG: {
|
||||
import {Select} from 'amis-ui';
|
||||
import {Range as InputRange} from 'amis-ui';
|
||||
import {Option} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
export interface RepeatProps extends FormControlProps {
|
||||
options?: string;
|
||||
|
@ -5,13 +5,13 @@ import {LazyComponent} from 'amis-core';
|
||||
import {tokenize} from 'amis-core';
|
||||
import {normalizeApi} from 'amis-core';
|
||||
import {ucFirst} from 'amis-core';
|
||||
import type {SchemaApi} from '../../Schema';
|
||||
import type {FormBaseControlSchema, SchemaApi} from '../../Schema';
|
||||
|
||||
/**
|
||||
* RichText
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/input-rich-text
|
||||
*/
|
||||
export interface RichTextControlSchema extends FormBaseControl {
|
||||
export interface RichTextControlSchema extends FormBaseControlSchema {
|
||||
type: 'input-rich-text';
|
||||
|
||||
/**
|
||||
|
@ -5,7 +5,7 @@ import omit from 'lodash/omit';
|
||||
import pick from 'lodash/pick';
|
||||
import {createObject, guid} from 'amis-core';
|
||||
import {Icon} from 'amis-ui';
|
||||
import {FormSchema, SchemaClassName} from '../../Schema';
|
||||
import {FormBaseControlSchema, FormSchema, SchemaClassName} from '../../Schema';
|
||||
import Sortable from 'sortablejs';
|
||||
import {findDOMNode} from 'react-dom';
|
||||
|
||||
@ -13,7 +13,7 @@ import {findDOMNode} from 'react-dom';
|
||||
* SubForm 子表单
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/subform
|
||||
*/
|
||||
export interface SubFormControlSchema extends FormBaseControl {
|
||||
export interface SubFormControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为 SubForm 子表单
|
||||
*/
|
||||
|
@ -15,12 +15,13 @@ import {Overlay} from 'amis-ui';
|
||||
import {PopOver} from 'amis-ui';
|
||||
import {ListMenu} from 'amis-ui';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Tag 输入框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/tag
|
||||
*/
|
||||
export interface TagControlSchema extends FormOptionsControl {
|
||||
export interface TagControlSchema extends FormOptionsSchema {
|
||||
type: 'input-tag';
|
||||
|
||||
/**
|
||||
|
@ -17,7 +17,7 @@ import {autobind, createObject, setVariable, ucFirst} from 'amis-core';
|
||||
import {isEffectiveApi} from 'amis-core';
|
||||
import {Spinner} from 'amis-ui';
|
||||
import {ActionSchema} from '../Action';
|
||||
import {SchemaApi} from '../../Schema';
|
||||
import {FormOptionsSchema, SchemaApi} from '../../Schema';
|
||||
import {generateIcon} from 'amis-core';
|
||||
import {rendererEventDispatcher, bindRendererEvent} from 'amis-core';
|
||||
|
||||
@ -30,7 +30,7 @@ import type {ListenerAction} from 'amis-core';
|
||||
* Text 文本输入框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/text
|
||||
*/
|
||||
export interface TextControlSchema extends FormOptionsControl {
|
||||
export interface TextControlSchema extends FormOptionsSchema {
|
||||
type:
|
||||
| 'input-text'
|
||||
| 'input-email'
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
OptionsControlProps
|
||||
} from 'amis-core';
|
||||
import {Spinner} from 'amis-ui';
|
||||
import {SchemaApi} from '../../Schema';
|
||||
import {FormOptionsSchema, SchemaApi} from '../../Schema';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
|
||||
@ -15,7 +15,7 @@ import {ActionObject} from 'amis-core';
|
||||
* Tree 下拉选择框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/tree
|
||||
*/
|
||||
export interface TreeControlSchema extends FormOptionsControl {
|
||||
export interface TreeControlSchema extends FormOptionsSchema {
|
||||
type: 'input-tree';
|
||||
|
||||
/**
|
||||
|
@ -2,12 +2,13 @@ import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {InputJSONSchema} from 'amis-ui';
|
||||
import {withRemoteConfig} from 'amis-ui';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* JSON Schema
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema
|
||||
*/
|
||||
export interface JSONSchemaControlSchema extends FormBaseControl {
|
||||
export interface JSONSchemaControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为 JSON Schema
|
||||
*/
|
||||
|
@ -2,12 +2,13 @@ import React from 'react';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {JSONSchemaEditor} from 'amis-ui';
|
||||
import {autobind} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* JSON Schema Editor
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/json-schema-editor
|
||||
*/
|
||||
export interface JSONSchemaEditorControlSchema extends FormBaseControl {
|
||||
export interface JSONSchemaEditorControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为 JSON Schema Editor
|
||||
*/
|
||||
|
@ -7,13 +7,17 @@ import {
|
||||
} from 'amis-core';
|
||||
import {ActionObject, Schema} from 'amis-core';
|
||||
import {createObject, isEmpty} from 'amis-core';
|
||||
import {SchemaClassName, SchemaCollection} from '../../Schema';
|
||||
import {
|
||||
FormOptionsSchema,
|
||||
SchemaClassName,
|
||||
SchemaCollection
|
||||
} from '../../Schema';
|
||||
|
||||
/**
|
||||
* List 复选框
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/list
|
||||
*/
|
||||
export interface ListControlSchema extends FormOptionsControl {
|
||||
export interface ListControlSchema extends FormOptionsSchema {
|
||||
type: 'list-select';
|
||||
|
||||
/**
|
||||
|
@ -3,11 +3,12 @@ import {themeable, ClassNamesFn, ThemeProps} from 'amis-core';
|
||||
import {FormItem, FormBaseControl, FormControlProps} from 'amis-core';
|
||||
import {LocationPicker} from 'amis-ui';
|
||||
import {filter} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
/**
|
||||
* Location 选点组件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/location
|
||||
*/
|
||||
export interface LocationControlSchema extends FormBaseControl {
|
||||
export interface LocationControlSchema extends FormBaseControlSchema {
|
||||
type: 'location-picker';
|
||||
|
||||
/**
|
||||
|
@ -9,13 +9,13 @@ import {buildApi, isValidApi, isEffectiveApi} from 'amis-core';
|
||||
import {Checkbox, Spinner} from 'amis-ui';
|
||||
import {autobind, setVariable, createObject} from 'amis-core';
|
||||
import {ApiObject, ActionObject} from 'amis-core';
|
||||
import {SchemaApi} from '../../Schema';
|
||||
import {FormBaseControlSchema, SchemaApi} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Matrix 选择控件。适合做权限勾选。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/matrix
|
||||
*/
|
||||
export interface MatrixControlSchema extends FormBaseControl {
|
||||
export interface MatrixControlSchema extends FormBaseControlSchema {
|
||||
type: 'matrix-checkboxes';
|
||||
|
||||
/**
|
||||
|
@ -29,12 +29,13 @@ import compact from 'lodash/compact';
|
||||
import {RootClose} from 'amis-core';
|
||||
import {Cascader} from 'amis-ui';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Nested Select
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/nested-select
|
||||
*/
|
||||
export interface NestedSelectControlSchema extends FormOptionsControl {
|
||||
export interface NestedSelectControlSchema extends FormOptionsSchema {
|
||||
type: 'nested-select';
|
||||
/**
|
||||
* 边框模式,全边框,还是半边框,或者没边框。
|
||||
|
@ -22,7 +22,7 @@ import {Html} from 'amis-ui';
|
||||
import {filter} from 'amis-core';
|
||||
import {Icon} from 'amis-ui';
|
||||
import {dataMapping, isPureVariable, resolveVariableAndFilter} from 'amis-core';
|
||||
import {SchemaCollection, SchemaTpl} from '../../Schema';
|
||||
import {FormOptionsSchema, SchemaCollection, SchemaTpl} from '../../Schema';
|
||||
import {CRUDSchema} from '../CRUD';
|
||||
import {isApiOutdated, isEffectiveApi} from 'amis-core';
|
||||
|
||||
@ -30,7 +30,7 @@ import {isApiOutdated, isEffectiveApi} from 'amis-core';
|
||||
* Picker
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/picker
|
||||
*/
|
||||
export interface PickerControlSchema extends FormOptionsControl {
|
||||
export interface PickerControlSchema extends FormOptionsSchema {
|
||||
type: 'picker';
|
||||
|
||||
/**
|
||||
|
@ -9,12 +9,13 @@ import {
|
||||
} from 'amis-core';
|
||||
import {autobind, isEmpty, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Radio 单选框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/radios
|
||||
*/
|
||||
export interface RadiosControlSchema extends FormOptionsControl {
|
||||
export interface RadiosControlSchema extends FormOptionsSchema {
|
||||
type: 'radios';
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ import {Api, ActionObject} from 'amis-core';
|
||||
import {isEffectiveApi, isApiOutdated} from 'amis-core';
|
||||
import {isEmpty, createObject, autobind, isMobile} from 'amis-core';
|
||||
|
||||
import {SchemaApi} from '../../Schema';
|
||||
import {FormOptionsSchema, SchemaApi} from '../../Schema';
|
||||
import {Spinner, Select} from 'amis-ui';
|
||||
import {BaseTransferRenderer, TransferControlSchema} from './Transfer';
|
||||
import {TransferDropDown} from 'amis-ui';
|
||||
@ -25,7 +25,7 @@ import type {TooltipObject} from 'amis-ui/lib/components/TooltipWrapper';
|
||||
* Select 下拉选择框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/select
|
||||
*/
|
||||
export interface SelectControlSchema extends FormOptionsControl {
|
||||
export interface SelectControlSchema extends FormOptionsSchema {
|
||||
type: 'select' | 'multi-select';
|
||||
|
||||
/**
|
||||
|
@ -7,13 +7,18 @@ import QuickEdit, {SchemaQuickEdit} from '../QuickEdit';
|
||||
import Copyable, {SchemaCopyable} from '../Copyable';
|
||||
import {extendObject, ucFirst} from 'amis-core';
|
||||
import omit from 'lodash/omit';
|
||||
import {SchemaObject, SchemaTpl, SchemaType} from '../../Schema';
|
||||
import {
|
||||
FormBaseControlSchema,
|
||||
SchemaObject,
|
||||
SchemaTpl,
|
||||
SchemaType
|
||||
} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Static
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/static
|
||||
*/
|
||||
export interface StaticExactControlSchema extends FormBaseControl {
|
||||
export interface StaticExactControlSchema extends FormBaseControlSchema {
|
||||
type: 'static';
|
||||
|
||||
/**
|
||||
|
@ -4,13 +4,14 @@ import {Switch} from 'amis-ui';
|
||||
import {createObject, autobind, isObject} from 'amis-core';
|
||||
import {generateIcon} from 'amis-core';
|
||||
import {IconSchema} from '../Icon';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Switch
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/switch
|
||||
*/
|
||||
|
||||
export interface SwitchControlSchema extends FormBaseControl {
|
||||
export interface SwitchControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为多行文本输入框
|
||||
*/
|
||||
|
@ -7,12 +7,13 @@ import {autobind, ucFirst} from 'amis-core';
|
||||
|
||||
import {bindRendererEvent} from 'amis-core';
|
||||
import type {ListenerAction} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* TextArea 多行文本输入框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/textarea
|
||||
*/
|
||||
export interface TextareaControlSchema extends FormBaseControl {
|
||||
export interface TextareaControlSchema extends FormBaseControlSchema {
|
||||
/**
|
||||
* 指定为多行文本输入框
|
||||
*/
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
import {Spinner} from 'amis-ui';
|
||||
import {optionValueCompare} from 'amis-core';
|
||||
import {resolveVariable} from 'amis-core';
|
||||
import {SchemaApi, SchemaObject} from '../../Schema';
|
||||
import {FormOptionsSchema, SchemaApi, SchemaObject} from '../../Schema';
|
||||
import {Selection as BaseSelection} from 'amis-ui';
|
||||
import {ResultList} from 'amis-ui';
|
||||
import {ActionObject} from 'amis-core';
|
||||
@ -31,7 +31,7 @@ import type {ItemRenderStates} from 'amis-ui/lib/components/Selection';
|
||||
* Transfer
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/transfer
|
||||
*/
|
||||
export interface TransferControlSchema extends FormOptionsControl {
|
||||
export interface TransferControlSchema extends FormOptionsSchema {
|
||||
type: 'transfer';
|
||||
|
||||
/**
|
||||
|
@ -22,12 +22,13 @@ import {autobind, getTreeAncestors, isMobile, createObject} from 'amis-core';
|
||||
import {findDOMNode} from 'react-dom';
|
||||
import {normalizeOptions} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* Tree 下拉选择框。
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/tree
|
||||
*/
|
||||
export interface TreeSelectControlSchema extends FormOptionsControl {
|
||||
export interface TreeSelectControlSchema extends FormOptionsSchema {
|
||||
type: 'tree-select';
|
||||
|
||||
/**
|
||||
|
@ -1,12 +1,13 @@
|
||||
import React from 'react';
|
||||
import {uuidv4} from 'amis-core';
|
||||
import {FormItem, FormControlProps, FormBaseControl} from 'amis-core';
|
||||
import {FormBaseControlSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* UUID 功能性组件
|
||||
* 文档:https://baidu.gitee.io/amis/docs/components/form/uuid
|
||||
*/
|
||||
export interface UUIDControlSchema extends FormBaseControl {
|
||||
export interface UUIDControlSchema extends FormBaseControlSchema {
|
||||
type: 'uuid';
|
||||
/**
|
||||
* 长度,默认 uuid 的长度是 36,如果不需要那么长,可以设置这个来缩短
|
||||
|
@ -12,11 +12,12 @@ import {isEffectiveApi} from 'amis-core';
|
||||
import find from 'lodash/find';
|
||||
import {createObject, autobind} from 'amis-core';
|
||||
import {PlainObject} from 'amis-core';
|
||||
import {FormOptionsSchema} from '../../Schema';
|
||||
|
||||
/**
|
||||
* UserSelect 移动端人员选择。
|
||||
*/
|
||||
export interface UserSelectControlSchema extends FormOptionsControl {
|
||||
export interface UserSelectControlSchema extends FormOptionsSchema {
|
||||
type: 'users-select';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user