补充之前因代码拆分删掉的逻辑

This commit is contained in:
liaoxuezhi 2022-06-06 23:21:30 +08:00
parent 1ff51f15fb
commit 31eb2feb12
55 changed files with 296 additions and 113 deletions

View File

@ -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
});
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)
});

View 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 />;

View File

@ -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';
/**
*

View File

@ -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';
}

View File

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

View File

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

View File

@ -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';
/**

View File

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

View File

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

View File

@ -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';
/**

View File

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

View File

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

View File

@ -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';
/**

View File

@ -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';
}

View File

@ -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 控件。。。

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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';
/**

View File

@ -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';
/**

View File

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

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

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

View File

@ -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';
/**

View File

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

View File

@ -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';
/**

View File

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

View File

@ -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';
/**

View File

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

View File

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

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**
*

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

@ -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';
/**

View File

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

View File

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

View File

@ -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';
/**

View File

@ -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';
/**

View File

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

View File

@ -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';
}