amis-core 3.1.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.d.ts +1 -1
- package/esm/RootRenderer.js +3 -3
- package/esm/SchemaRenderer.js +6 -2
- package/esm/Scoped.d.ts +4 -1
- package/esm/Scoped.js +9 -5
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.d.ts +4 -24
- package/esm/WithRootStore.js +12 -4
- package/esm/WithStore.js +23 -16
- package/esm/actions/Action.d.ts +1 -0
- package/esm/actions/Action.js +70 -45
- package/esm/actions/AjaxAction.d.ts +6 -8
- package/esm/actions/AjaxAction.js +20 -18
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.d.ts +1 -2
- package/esm/actions/CmptAction.js +47 -32
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +3 -2
- package/esm/actions/DialogAction.d.ts +2 -0
- package/esm/actions/DialogAction.js +39 -23
- package/esm/actions/DrawerAction.js +4 -4
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/StatusAction.d.ts +15 -0
- package/esm/actions/StatusAction.js +49 -0
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/index.d.ts +1 -0
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +3 -2
- package/esm/components/PopOver.js +3 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +3 -1
- package/esm/index.js +16 -14
- package/esm/locale.js +1 -1
- package/esm/polyfills.d.ts +3 -0
- package/esm/polyfills.js +18 -0
- package/esm/renderers/Form.d.ts +7 -7
- package/esm/renderers/Form.js +182 -128
- package/esm/renderers/Item.d.ts +82 -77
- package/esm/renderers/Item.js +90 -74
- package/esm/renderers/Options.js +1 -2
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.d.ts +4 -24
- package/esm/renderers/wrapControl.js +140 -88
- package/esm/store/app.js +42 -4
- package/esm/store/combo.d.ts +564 -1892
- package/esm/store/combo.js +9 -2
- package/esm/store/crud.d.ts +4 -2
- package/esm/store/crud.js +17 -4
- package/esm/store/form.d.ts +182 -882
- package/esm/store/form.js +83 -81
- package/esm/store/formItem.d.ts +6 -2
- package/esm/store/formItem.js +19 -3
- package/esm/store/iRenderer.js +3 -2
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -0
- package/esm/store/list.js +8 -2
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +3 -2
- package/esm/store/service.js +17 -12
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +604 -2020
- package/esm/store/table.js +86 -56
- package/esm/store/table2.d.ts +49 -0
- package/esm/store/table2.js +37 -4
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +22 -5
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.d.ts +3 -2
- package/esm/utils/DataSchema.js +27 -7
- package/esm/utils/DataScope.d.ts +10 -3
- package/esm/utils/DataScope.js +50 -12
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.d.ts +2 -2
- package/esm/utils/api.js +152 -112
- package/esm/utils/arraySlice.d.ts +1 -0
- package/esm/utils/arraySlice.js +76 -0
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/dataMapping.js +29 -19
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.d.ts +2 -0
- package/esm/utils/debug.js +34 -7
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.js +4 -1
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.d.ts +0 -1
- package/esm/utils/formula.js +6 -9
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +19 -2
- package/esm/utils/helper.js +69 -10
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +4 -2
- package/esm/utils/icon.js +3 -2
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.d.ts +3 -0
- package/esm/utils/math.js +52 -0
- package/esm/utils/memoryParse.js +1 -1
- package/esm/utils/normalizeLink.js +18 -9
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.d.ts +7 -0
- package/esm/utils/object.js +13 -2
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +2 -2
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.d.ts +1 -1
- package/esm/utils/renderer-event.js +14 -6
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/lib/Root.js +10 -7
- package/lib/RootRenderer.d.ts +1 -1
- package/lib/RootRenderer.js +11 -8
- package/lib/SchemaRenderer.js +13 -6
- package/lib/Scoped.d.ts +4 -1
- package/lib/Scoped.js +19 -13
- package/lib/StatusScoped.js +5 -2
- package/lib/WithRootStore.d.ts +4 -24
- package/lib/WithRootStore.js +15 -4
- package/lib/WithStore.js +27 -17
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +70 -45
- package/lib/actions/AjaxAction.d.ts +6 -8
- package/lib/actions/AjaxAction.js +20 -18
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.d.ts +1 -2
- package/lib/actions/CmptAction.js +47 -32
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +9 -5
- package/lib/actions/DialogAction.d.ts +2 -0
- package/lib/actions/DialogAction.js +39 -23
- package/lib/actions/DrawerAction.js +4 -4
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/StatusAction.d.ts +15 -0
- package/lib/actions/StatusAction.js +53 -0
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/index.d.ts +1 -0
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/LazyComponent.js +12 -14
- package/lib/components/Overlay.js +15 -14
- package/lib/components/PopOver.js +12 -10
- package/lib/env.js +4 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +11 -9
- package/lib/index.d.ts +3 -1
- package/lib/index.js +26 -19
- package/lib/locale.js +6 -3
- package/lib/polyfills.d.ts +3 -0
- package/lib/polyfills.js +20 -0
- package/lib/renderers/Form.d.ts +7 -7
- package/lib/renderers/Form.js +194 -135
- package/lib/renderers/Item.d.ts +82 -77
- package/lib/renderers/Item.js +126 -104
- package/lib/renderers/Options.js +10 -5
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.d.ts +4 -24
- package/lib/renderers/wrapControl.js +143 -88
- package/lib/store/app.js +44 -3
- package/lib/store/combo.d.ts +564 -1892
- package/lib/store/combo.js +9 -2
- package/lib/store/crud.d.ts +4 -2
- package/lib/store/crud.js +17 -4
- package/lib/store/form.d.ts +182 -882
- package/lib/store/form.js +81 -79
- package/lib/store/formItem.d.ts +6 -2
- package/lib/store/formItem.js +19 -3
- package/lib/store/iRenderer.js +9 -5
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -0
- package/lib/store/list.js +8 -2
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +9 -5
- package/lib/store/service.js +17 -12
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +604 -2020
- package/lib/store/table.js +85 -55
- package/lib/store/table2.d.ts +49 -0
- package/lib/store/table2.js +36 -3
- package/lib/theme.js +6 -3
- package/lib/types.d.ts +22 -5
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.d.ts +3 -2
- package/lib/utils/DataSchema.js +27 -7
- package/lib/utils/DataScope.d.ts +10 -3
- package/lib/utils/DataScope.js +50 -11
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.d.ts +2 -2
- package/lib/utils/api.js +151 -111
- package/lib/utils/arraySlice.d.ts +1 -0
- package/lib/utils/arraySlice.js +80 -0
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +8 -6
- package/lib/utils/dataMapping.js +29 -19
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.d.ts +2 -0
- package/lib/utils/debug.js +61 -33
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +10 -5
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.d.ts +0 -1
- package/lib/utils/formula.js +6 -10
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +19 -2
- package/lib/utils/helper.js +70 -9
- package/lib/utils/highlight.js +8 -9
- package/lib/utils/icon.d.ts +4 -2
- package/lib/utils/icon.js +12 -10
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.d.ts +3 -0
- package/lib/utils/math.js +58 -0
- package/lib/utils/memoryParse.js +1 -1
- package/lib/utils/normalizeLink.js +18 -9
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.d.ts +7 -0
- package/lib/utils/object.js +13 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +7 -3
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.d.ts +1 -1
- package/lib/utils/renderer-event.js +13 -5
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/package.json +9 -4
package/esm/renderers/Item.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
|
4
4
|
import { IFormItemStore, IFormStore } from '../store/form';
|
|
5
5
|
import { RendererProps, TestFunc, RendererConfig } from '../factory';
|
|
6
6
|
import { FormHorizontal, FormSchemaBase } from './Form';
|
|
7
|
-
import { BaseApiObject, BaseSchemaWithoutType, ClassName, Schema } from '../types';
|
|
7
|
+
import { ActionObject, BaseApiObject, BaseSchemaWithoutType, ClassName, Schema } from '../types';
|
|
8
8
|
export type LabelAlign = 'right' | 'left';
|
|
9
9
|
export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
10
10
|
/**
|
|
@@ -31,6 +31,10 @@ export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
|
31
31
|
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
32
32
|
*/
|
|
33
33
|
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
36
|
+
*/
|
|
37
|
+
extraName?: string;
|
|
34
38
|
/**
|
|
35
39
|
* 显示一个小图标, 鼠标放上去的时候显示提示内容
|
|
36
40
|
*/
|
|
@@ -444,8 +448,9 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
444
448
|
label: any;
|
|
445
449
|
})[];
|
|
446
450
|
} | undefined;
|
|
447
|
-
|
|
448
|
-
|
|
451
|
+
handleSubmit(values: any): void;
|
|
452
|
+
handleAction(e: React.UIEvent<any>, action: ActionObject, data: object): void;
|
|
453
|
+
handleClose(): void;
|
|
449
454
|
handleOpenDialog(schema: Schema, data: any): Promise<unknown>;
|
|
450
455
|
handleDialogConfirm([values]: Array<any>): void;
|
|
451
456
|
handleDialogClose(confirmed?: boolean): void;
|
|
@@ -460,30 +465,10 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
460
465
|
}
|
|
461
466
|
export declare const detectProps: string[];
|
|
462
467
|
export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (Control: FormControlComponent) => {
|
|
463
|
-
new (props: Omit<any, "rootStore">
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
468
|
-
readonly props: Readonly<Omit<any, "rootStore">>;
|
|
469
|
-
state: Readonly<{}>;
|
|
470
|
-
refs: {
|
|
471
|
-
[key: string]: React.ReactInstance;
|
|
472
|
-
};
|
|
473
|
-
componentDidMount?(): void;
|
|
474
|
-
shouldComponentUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
475
|
-
componentWillUnmount?(): void;
|
|
476
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
477
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>): any;
|
|
478
|
-
componentDidUpdate?(prevProps: Readonly<Omit<any, "rootStore">>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
479
|
-
componentWillMount?(): void;
|
|
480
|
-
UNSAFE_componentWillMount?(): void;
|
|
481
|
-
componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
482
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<any, "rootStore">>, nextContext: any): void;
|
|
483
|
-
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
484
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
485
|
-
};
|
|
486
|
-
new (props: Omit<any, "rootStore">, context: any): {
|
|
468
|
+
new (props: Omit<any, "rootStore">): {
|
|
469
|
+
ref: any;
|
|
470
|
+
getWrappedInstance(): any;
|
|
471
|
+
refFn(ref: any): void;
|
|
487
472
|
render(): React.JSX.Element;
|
|
488
473
|
context: unknown;
|
|
489
474
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<any, "rootStore">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
@@ -511,7 +496,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
511
496
|
storeType: string;
|
|
512
497
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
513
498
|
readonly fetcher: any;
|
|
514
|
-
readonly notify: any;
|
|
499
|
+
readonly notify: any; /**
|
|
500
|
+
* 只读条件
|
|
501
|
+
*/
|
|
515
502
|
readonly isCancel: (value: any) => boolean;
|
|
516
503
|
readonly __: import("..").TranslateFn<any>;
|
|
517
504
|
getStoreById(id: string): {
|
|
@@ -527,11 +514,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
527
514
|
readonly hasChildren: boolean;
|
|
528
515
|
readonly children: any[];
|
|
529
516
|
} & {
|
|
517
|
+
/**
|
|
518
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
519
|
+
*/
|
|
530
520
|
onChildStoreDispose(child: any): void;
|
|
531
521
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
532
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
533
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
534
|
-
*/
|
|
522
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
535
523
|
addChildId: (id: string) => void;
|
|
536
524
|
removeChildId: (id: string) => void;
|
|
537
525
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -547,11 +535,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
547
535
|
readonly hasChildren: boolean;
|
|
548
536
|
readonly children: any[];
|
|
549
537
|
} & {
|
|
538
|
+
/**
|
|
539
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
540
|
+
*/
|
|
550
541
|
onChildStoreDispose(child: any): void;
|
|
551
542
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
552
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
553
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
554
|
-
*/
|
|
543
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
555
544
|
addChildId: (id: string) => void;
|
|
556
545
|
removeChildId: (id: string) => void;
|
|
557
546
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -569,11 +558,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
569
558
|
readonly hasChildren: boolean;
|
|
570
559
|
readonly children: any[];
|
|
571
560
|
} & {
|
|
561
|
+
/**
|
|
562
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
563
|
+
*/
|
|
572
564
|
onChildStoreDispose(child: any): void;
|
|
573
565
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
574
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
575
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
576
|
-
*/
|
|
566
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
577
567
|
addChildId: (id: string) => void;
|
|
578
568
|
removeChildId: (id: string) => void;
|
|
579
569
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -589,11 +579,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
589
579
|
readonly hasChildren: boolean;
|
|
590
580
|
readonly children: any[];
|
|
591
581
|
} & {
|
|
582
|
+
/**
|
|
583
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
584
|
+
*/
|
|
592
585
|
onChildStoreDispose(child: any): void;
|
|
593
586
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
594
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
595
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
596
|
-
*/
|
|
587
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
597
588
|
addChildId: (id: string) => void;
|
|
598
589
|
removeChildId: (id: string) => void;
|
|
599
590
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -618,11 +609,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
618
609
|
readonly hasChildren: boolean;
|
|
619
610
|
readonly children: any[];
|
|
620
611
|
} & {
|
|
612
|
+
/**
|
|
613
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
614
|
+
*/
|
|
621
615
|
onChildStoreDispose(child: any): void;
|
|
622
616
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
623
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
624
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
625
|
-
*/
|
|
617
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
626
618
|
addChildId: (id: string) => void;
|
|
627
619
|
removeChildId: (id: string) => void;
|
|
628
620
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -638,11 +630,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
638
630
|
readonly hasChildren: boolean;
|
|
639
631
|
readonly children: any[];
|
|
640
632
|
} & {
|
|
633
|
+
/**
|
|
634
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
635
|
+
*/
|
|
641
636
|
onChildStoreDispose(child: any): void;
|
|
642
637
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
643
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
644
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
645
|
-
*/
|
|
638
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
646
639
|
addChildId: (id: string) => void;
|
|
647
640
|
removeChildId: (id: string) => void;
|
|
648
641
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -659,11 +652,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
659
652
|
readonly hasChildren: boolean;
|
|
660
653
|
readonly children: any[];
|
|
661
654
|
} & {
|
|
655
|
+
/**
|
|
656
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
657
|
+
*/
|
|
662
658
|
onChildStoreDispose(child: any): void;
|
|
663
659
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
664
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
665
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
666
|
-
*/
|
|
660
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
667
661
|
addChildId: (id: string) => void;
|
|
668
662
|
removeChildId: (id: string) => void;
|
|
669
663
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -679,11 +673,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
679
673
|
readonly hasChildren: boolean;
|
|
680
674
|
readonly children: any[];
|
|
681
675
|
} & {
|
|
676
|
+
/**
|
|
677
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
678
|
+
*/
|
|
682
679
|
onChildStoreDispose(child: any): void;
|
|
683
680
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
684
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
685
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
686
|
-
*/
|
|
681
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
687
682
|
addChildId: (id: string) => void;
|
|
688
683
|
removeChildId: (id: string) => void;
|
|
689
684
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
@@ -691,7 +686,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
691
686
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
692
687
|
}, {
|
|
693
688
|
readonly fetcher: any;
|
|
694
|
-
readonly notify: any;
|
|
689
|
+
readonly notify: any; /**
|
|
690
|
+
* 只读条件
|
|
691
|
+
*/
|
|
695
692
|
readonly isCancel: (value: any) => boolean;
|
|
696
693
|
readonly __: import("..").TranslateFn<any>;
|
|
697
694
|
getStoreById(id: string): {
|
|
@@ -707,11 +704,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
707
704
|
readonly hasChildren: boolean;
|
|
708
705
|
readonly children: any[];
|
|
709
706
|
} & {
|
|
707
|
+
/**
|
|
708
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
709
|
+
*/
|
|
710
710
|
onChildStoreDispose(child: any): void;
|
|
711
711
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
712
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
713
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
714
|
-
*/
|
|
712
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
715
713
|
addChildId: (id: string) => void;
|
|
716
714
|
removeChildId: (id: string) => void;
|
|
717
715
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -727,11 +725,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
727
725
|
readonly hasChildren: boolean;
|
|
728
726
|
readonly children: any[];
|
|
729
727
|
} & {
|
|
728
|
+
/**
|
|
729
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
730
|
+
*/
|
|
730
731
|
onChildStoreDispose(child: any): void;
|
|
731
732
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
732
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
733
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
734
|
-
*/
|
|
733
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
735
734
|
addChildId: (id: string) => void;
|
|
736
735
|
removeChildId: (id: string) => void;
|
|
737
736
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -749,11 +748,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
749
748
|
readonly hasChildren: boolean;
|
|
750
749
|
readonly children: any[];
|
|
751
750
|
} & {
|
|
751
|
+
/**
|
|
752
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
753
|
+
*/
|
|
752
754
|
onChildStoreDispose(child: any): void;
|
|
753
755
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
754
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
755
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
756
|
-
*/
|
|
756
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
757
757
|
addChildId: (id: string) => void;
|
|
758
758
|
removeChildId: (id: string) => void;
|
|
759
759
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -769,11 +769,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
769
769
|
readonly hasChildren: boolean;
|
|
770
770
|
readonly children: any[];
|
|
771
771
|
} & {
|
|
772
|
+
/**
|
|
773
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
774
|
+
*/
|
|
772
775
|
onChildStoreDispose(child: any): void;
|
|
773
776
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
774
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
775
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
776
|
-
*/
|
|
777
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
777
778
|
addChildId: (id: string) => void;
|
|
778
779
|
removeChildId: (id: string) => void;
|
|
779
780
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -798,11 +799,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
798
799
|
readonly hasChildren: boolean;
|
|
799
800
|
readonly children: any[];
|
|
800
801
|
} & {
|
|
802
|
+
/**
|
|
803
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
804
|
+
*/
|
|
801
805
|
onChildStoreDispose(child: any): void;
|
|
802
806
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
803
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
804
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
805
|
-
*/
|
|
807
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
806
808
|
addChildId: (id: string) => void;
|
|
807
809
|
removeChildId: (id: string) => void;
|
|
808
810
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -818,11 +820,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
818
820
|
readonly hasChildren: boolean;
|
|
819
821
|
readonly children: any[];
|
|
820
822
|
} & {
|
|
823
|
+
/**
|
|
824
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
825
|
+
*/
|
|
821
826
|
onChildStoreDispose(child: any): void;
|
|
822
827
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
823
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
824
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
825
|
-
*/
|
|
828
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
826
829
|
addChildId: (id: string) => void;
|
|
827
830
|
removeChildId: (id: string) => void;
|
|
828
831
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -839,11 +842,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
839
842
|
readonly hasChildren: boolean;
|
|
840
843
|
readonly children: any[];
|
|
841
844
|
} & {
|
|
845
|
+
/**
|
|
846
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
847
|
+
*/
|
|
842
848
|
onChildStoreDispose(child: any): void;
|
|
843
849
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
844
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
845
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
846
|
-
*/
|
|
850
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
847
851
|
addChildId: (id: string) => void;
|
|
848
852
|
removeChildId: (id: string) => void;
|
|
849
853
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -859,11 +863,12 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
859
863
|
readonly hasChildren: boolean;
|
|
860
864
|
readonly children: any[];
|
|
861
865
|
} & {
|
|
866
|
+
/**
|
|
867
|
+
* 额外的字段名,当为范围组件时可以用来将另外一个值打平出来
|
|
868
|
+
*/
|
|
862
869
|
onChildStoreDispose(child: any): void;
|
|
863
870
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
864
|
-
dispose: (callback?: (() => void) | undefined) => void;
|
|
865
|
-
* 当配置为水平布局的时候,用来配置具体的左右分配。
|
|
866
|
-
*/
|
|
871
|
+
dispose: (callback?: (() => void) | undefined) => void;
|
|
867
872
|
addChildId: (id: string) => void;
|
|
868
873
|
removeChildId: (id: string) => void;
|
|
869
874
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
package/esm/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -33,8 +33,8 @@ import 'lodash/isObject';
|
|
|
33
33
|
import 'lodash/isString';
|
|
34
34
|
import 'lodash/isBoolean';
|
|
35
35
|
import { getVariable } from '../utils/getVariable.js';
|
|
36
|
-
import 'lodash';
|
|
37
36
|
import '../utils/image.js';
|
|
37
|
+
import 'lodash/isEqual';
|
|
38
38
|
import '../actions/Action.js';
|
|
39
39
|
import 'lodash/cloneDeep';
|
|
40
40
|
import '../utils/resize-sensor.js';
|
|
@@ -272,8 +272,9 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
272
272
|
return (React.createElement(Overlay, { container: popOverContainer || this.target, target: function () { return _this.target; }, placement: position || 'left-bottom-left-top', show: true },
|
|
273
273
|
React.createElement(PopOver, { classPrefix: ns, className: cx("".concat(ns, "auto-fill-popOver"), popOverClassName), style: {
|
|
274
274
|
minWidth: this.target ? this.target.offsetWidth : undefined
|
|
275
|
-
}, offset: offset, onHide: this.
|
|
276
|
-
|
|
275
|
+
}, offset: offset, onHide: this.handleClose, overlay: true }, render('popOver-auto-fill-form', form, {
|
|
276
|
+
onAction: this.handleAction,
|
|
277
|
+
onSubmit: this.handleSubmit
|
|
277
278
|
}))));
|
|
278
279
|
}
|
|
279
280
|
else {
|
|
@@ -281,15 +282,20 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
281
282
|
}
|
|
282
283
|
};
|
|
283
284
|
// 参照录入popOver提交
|
|
284
|
-
FormItemWrap.prototype.
|
|
285
|
+
FormItemWrap.prototype.handleSubmit = function (values) {
|
|
285
286
|
var _a = this.props; _a.onBulkChange; var autoFill = _a.autoFill;
|
|
286
287
|
if (!autoFill || (autoFill && !(autoFill === null || autoFill === void 0 ? void 0 : autoFill.hasOwnProperty('api')))) {
|
|
287
288
|
return;
|
|
288
289
|
}
|
|
289
290
|
this.updateAutoFillData(values.selectedItems);
|
|
290
|
-
this.
|
|
291
|
+
this.handleClose();
|
|
291
292
|
};
|
|
292
|
-
FormItemWrap.prototype.
|
|
293
|
+
FormItemWrap.prototype.handleAction = function (e, action, data) {
|
|
294
|
+
if (action.actionType === 'cancel') {
|
|
295
|
+
this.handleClose();
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
FormItemWrap.prototype.handleClose = function () {
|
|
293
299
|
this.setState({
|
|
294
300
|
isOpened: false
|
|
295
301
|
});
|
|
@@ -427,11 +433,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
427
433
|
tooltip: labelRemark,
|
|
428
434
|
useMobileUI: useMobileUI,
|
|
429
435
|
className: cx("Form-labelRemark"),
|
|
430
|
-
container: props.popOverContainer
|
|
431
|
-
? props.popOverContainer
|
|
432
|
-
: env && env.getModalContainer
|
|
433
|
-
? env.getModalContainer
|
|
434
|
-
: undefined
|
|
436
|
+
container: props.popOverContainer || env.getModalContainer
|
|
435
437
|
})
|
|
436
438
|
: null))) : null,
|
|
437
439
|
React.createElement("div", { className: cx("Form-value", (_c = {},
|
|
@@ -451,11 +453,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
451
453
|
tooltip: remark,
|
|
452
454
|
className: cx("Form-remark"),
|
|
453
455
|
useMobileUI: useMobileUI,
|
|
454
|
-
container: props.popOverContainer
|
|
455
|
-
? props.popOverContainer
|
|
456
|
-
: env && env.getModalContainer
|
|
457
|
-
? env.getModalContainer
|
|
458
|
-
: undefined
|
|
456
|
+
container: props.popOverContainer || env.getModalContainer
|
|
459
457
|
})
|
|
460
458
|
: null,
|
|
461
459
|
hint && model && model.isFocused
|
|
@@ -476,6 +474,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
476
474
|
normal: function (props, renderControl) {
|
|
477
475
|
var _a;
|
|
478
476
|
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint, data = props.data, showErrorMsg = props.showErrorMsg, useMobileUI = props.useMobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName;
|
|
477
|
+
var mobileUI = useMobileUI && isMobile();
|
|
479
478
|
description = description || desc;
|
|
480
479
|
return (React.createElement("div", { "data-role": "form-item", className: cx("Form-item Form-item--normal", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
481
480
|
'is-error': model && !model.valid
|
|
@@ -495,45 +494,70 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
495
494
|
tooltip: labelRemark,
|
|
496
495
|
className: cx("Form-lableRemark"),
|
|
497
496
|
useMobileUI: useMobileUI,
|
|
498
|
-
container: props.popOverContainer
|
|
499
|
-
? props.popOverContainer
|
|
500
|
-
: env && env.getModalContainer
|
|
501
|
-
? env.getModalContainer
|
|
502
|
-
: undefined
|
|
497
|
+
container: props.popOverContainer || env.getModalContainer
|
|
503
498
|
})
|
|
504
499
|
: null))) : null,
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
500
|
+
mobileUI ? (React.createElement("div", { className: cx('Form-item-controlBox') },
|
|
501
|
+
renderControl(),
|
|
502
|
+
caption
|
|
503
|
+
? render('caption', caption, {
|
|
504
|
+
className: cx("Form-caption", captionClassName)
|
|
505
|
+
})
|
|
506
|
+
: null,
|
|
507
|
+
remark
|
|
508
|
+
? render('remark', {
|
|
509
|
+
type: 'remark',
|
|
510
|
+
icon: remark.icon || 'warning-mark',
|
|
511
|
+
className: cx("Form-remark"),
|
|
512
|
+
tooltip: remark,
|
|
513
|
+
useMobileUI: useMobileUI,
|
|
514
|
+
container: props.popOverContainer || env.getModalContainer
|
|
515
|
+
})
|
|
516
|
+
: null,
|
|
517
|
+
hint && model && model.isFocused
|
|
518
|
+
? render('hint', hint, {
|
|
519
|
+
className: cx("Form-hint")
|
|
520
|
+
})
|
|
521
|
+
: null,
|
|
522
|
+
model &&
|
|
523
|
+
!model.valid &&
|
|
524
|
+
showErrorMsg !== false &&
|
|
525
|
+
Array.isArray(model.errors) ? (React.createElement("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (React.createElement("li", { key: key }, msg)); }))) : null,
|
|
526
|
+
renderDescription !== false && description
|
|
527
|
+
? render('description', description, {
|
|
528
|
+
className: cx("Form-description", descriptionClassName)
|
|
529
|
+
})
|
|
530
|
+
: null)) : (React.createElement(React.Fragment, null,
|
|
531
|
+
renderControl(),
|
|
532
|
+
caption
|
|
533
|
+
? render('caption', caption, {
|
|
534
|
+
className: cx("Form-caption", captionClassName)
|
|
535
|
+
})
|
|
536
|
+
: null,
|
|
537
|
+
remark
|
|
538
|
+
? render('remark', {
|
|
539
|
+
type: 'remark',
|
|
540
|
+
icon: remark.icon || 'warning-mark',
|
|
541
|
+
className: cx("Form-remark"),
|
|
542
|
+
tooltip: remark,
|
|
543
|
+
useMobileUI: useMobileUI,
|
|
544
|
+
container: props.popOverContainer || env.getModalContainer
|
|
545
|
+
})
|
|
546
|
+
: null,
|
|
547
|
+
hint && model && model.isFocused
|
|
548
|
+
? render('hint', hint, {
|
|
549
|
+
className: cx("Form-hint")
|
|
550
|
+
})
|
|
551
|
+
: null,
|
|
552
|
+
model &&
|
|
553
|
+
!model.valid &&
|
|
554
|
+
showErrorMsg !== false &&
|
|
555
|
+
Array.isArray(model.errors) ? (React.createElement("ul", { className: cx("Form-feedback") }, model.errors.map(function (msg, key) { return (React.createElement("li", { key: key }, msg)); }))) : null,
|
|
556
|
+
renderDescription !== false && description
|
|
557
|
+
? render('description', description, {
|
|
558
|
+
className: cx("Form-description", descriptionClassName)
|
|
559
|
+
})
|
|
560
|
+
: null))));
|
|
537
561
|
},
|
|
538
562
|
inline: function (props, renderControl) {
|
|
539
563
|
var _a;
|
|
@@ -558,11 +582,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
558
582
|
tooltip: labelRemark,
|
|
559
583
|
className: cx("Form-lableRemark"),
|
|
560
584
|
useMobileUI: useMobileUI,
|
|
561
|
-
container: props.popOverContainer
|
|
562
|
-
? props.popOverContainer
|
|
563
|
-
: env && env.getModalContainer
|
|
564
|
-
? env.getModalContainer
|
|
565
|
-
: undefined
|
|
585
|
+
container: props.popOverContainer || env.getModalContainer
|
|
566
586
|
})
|
|
567
587
|
: null))) : null,
|
|
568
588
|
React.createElement("div", { className: cx("Form-value") },
|
|
@@ -579,11 +599,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
579
599
|
className: cx("Form-remark"),
|
|
580
600
|
tooltip: remark,
|
|
581
601
|
useMobileUI: useMobileUI,
|
|
582
|
-
container: props.popOverContainer
|
|
583
|
-
? props.popOverContainer
|
|
584
|
-
: env && env.getModalContainer
|
|
585
|
-
? env.getModalContainer
|
|
586
|
-
: undefined
|
|
602
|
+
container: props.popOverContainer || env.getModalContainer
|
|
587
603
|
})
|
|
588
604
|
: null,
|
|
589
605
|
hint && model && model.isFocused
|
|
@@ -623,11 +639,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
623
639
|
tooltip: labelRemark,
|
|
624
640
|
className: cx("Form-lableRemark"),
|
|
625
641
|
useMobileUI: useMobileUI,
|
|
626
|
-
container: props.popOverContainer
|
|
627
|
-
? props.popOverContainer
|
|
628
|
-
: env && env.getModalContainer
|
|
629
|
-
? env.getModalContainer
|
|
630
|
-
: undefined
|
|
642
|
+
container: props.popOverContainer || env.getModalContainer
|
|
631
643
|
})
|
|
632
644
|
: null))) : null,
|
|
633
645
|
renderControl(),
|
|
@@ -642,9 +654,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
642
654
|
icon: remark.icon || 'warning-mark',
|
|
643
655
|
className: cx("Form-remark"),
|
|
644
656
|
tooltip: remark,
|
|
645
|
-
container:
|
|
646
|
-
? env.getModalContainer
|
|
647
|
-
: undefined
|
|
657
|
+
container: props.popOverContainer || env.getModalContainer
|
|
648
658
|
})
|
|
649
659
|
: null),
|
|
650
660
|
hint && model && model.isFocused
|
|
@@ -680,13 +690,19 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
680
690
|
__metadata("design:type", Function),
|
|
681
691
|
__metadata("design:paramtypes", [Object]),
|
|
682
692
|
__metadata("design:returntype", void 0)
|
|
683
|
-
], FormItemWrap.prototype, "
|
|
693
|
+
], FormItemWrap.prototype, "handleSubmit", null);
|
|
694
|
+
__decorate([
|
|
695
|
+
autobind,
|
|
696
|
+
__metadata("design:type", Function),
|
|
697
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
698
|
+
__metadata("design:returntype", void 0)
|
|
699
|
+
], FormItemWrap.prototype, "handleAction", null);
|
|
684
700
|
__decorate([
|
|
685
701
|
autobind,
|
|
686
702
|
__metadata("design:type", Function),
|
|
687
703
|
__metadata("design:paramtypes", []),
|
|
688
704
|
__metadata("design:returntype", void 0)
|
|
689
|
-
], FormItemWrap.prototype, "
|
|
705
|
+
], FormItemWrap.prototype, "handleClose", null);
|
|
690
706
|
__decorate([
|
|
691
707
|
autobind,
|
|
692
708
|
__metadata("design:type", Function),
|
package/esm/renderers/Options.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.3.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -34,7 +34,6 @@ import 'classnames';
|
|
|
34
34
|
import 'lodash/isObject';
|
|
35
35
|
import 'lodash/isString';
|
|
36
36
|
import 'lodash/isBoolean';
|
|
37
|
-
import 'lodash';
|
|
38
37
|
import '../utils/image.js';
|
|
39
38
|
import { keyToPath } from '../utils/keyToPath.js';
|
|
40
39
|
import { resolveEventData } from '../utils/renderer-event.js';
|
package/esm/renderers/builtin.js
CHANGED