amis-core 1.0.0-beta.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/dist/Root.js +94 -0
- package/dist/RootRenderer.js +288 -0
- package/dist/SchemaRenderer.js +323 -0
- package/dist/Scoped.js +252 -0
- package/dist/WithRootStore.js +44 -0
- package/dist/WithStore.js +179 -0
- package/dist/__tests__/compat.test.d.ts +1 -0
- package/dist/__tests__/factory.test.d.ts +1 -0
- package/dist/__tests__/filter.test.d.ts +1 -0
- package/dist/__tests__/helper.d.ts +13 -0
- package/dist/__tests__/tokenize.test.d.ts +1 -0
- package/dist/actions/Action.js +119 -0
- package/dist/actions/AjaxAction.js +96 -0
- package/dist/actions/BreakAction.js +35 -0
- package/dist/actions/BroadcastAction.js +49 -0
- package/dist/actions/CmptAction.js +60 -0
- package/dist/actions/ContinueAction.js +35 -0
- package/dist/actions/CopyAction.js +43 -0
- package/dist/actions/CustomAction.js +49 -0
- package/dist/actions/DialogAction.js +104 -0
- package/dist/actions/DrawerAction.js +66 -0
- package/dist/actions/EmailAction.js +48 -0
- package/dist/actions/LinkAction.js +52 -0
- package/dist/actions/LoopAction.js +107 -0
- package/dist/actions/PageAction.js +80 -0
- package/dist/actions/ParallelAction.js +40 -0
- package/dist/actions/SwitchAction.js +52 -0
- package/dist/actions/ToastAction.js +35 -0
- package/dist/components/LazyComponent.js +99 -0
- package/dist/env.js +20 -0
- package/dist/envOverwrite.js +43 -0
- package/dist/factory.js +308 -0
- package/dist/index.js +218 -0
- package/dist/index2.js +255 -0
- package/dist/locale.js +114 -0
- package/dist/renderers/Form.js +1162 -0
- package/dist/renderers/Item.js +636 -0
- package/dist/renderers/Options.js +881 -0
- package/dist/renderers/Placeholder.js +31 -0
- package/dist/renderers/builtin.js +27 -0
- package/dist/renderers/wrapControl.js +507 -0
- package/dist/src/Root.d.ts +37 -0
- package/dist/src/RootRenderer.d.ts +27 -0
- package/dist/src/SchemaRenderer.d.ts +37 -0
- package/dist/src/Scoped.d.ts +38 -0
- package/dist/src/WithRootStore.d.ts +737 -0
- package/dist/src/WithStore.d.ts +5 -0
- package/dist/src/actions/Action.d.ts +38 -0
- package/dist/src/actions/AjaxAction.d.ts +25 -0
- package/dist/src/actions/BreakAction.d.ts +15 -0
- package/dist/src/actions/BroadcastAction.d.ts +16 -0
- package/dist/src/actions/CmptAction.d.ts +20 -0
- package/dist/src/actions/ContinueAction.d.ts +15 -0
- package/dist/src/actions/CopyAction.d.ts +20 -0
- package/dist/src/actions/CustomAction.d.ts +17 -0
- package/dist/src/actions/Decorators.d.ts +25 -0
- package/dist/src/actions/DialogAction.d.ts +57 -0
- package/dist/src/actions/DrawerAction.d.ts +30 -0
- package/dist/src/actions/EmailAction.d.ts +23 -0
- package/dist/src/actions/LinkAction.d.ts +24 -0
- package/dist/src/actions/LoopAction.d.ts +19 -0
- package/dist/src/actions/PageAction.d.ts +39 -0
- package/dist/src/actions/ParallelAction.d.ts +8 -0
- package/dist/src/actions/SwitchAction.d.ts +11 -0
- package/dist/src/actions/ToastAction.d.ts +19 -0
- package/dist/src/actions/index.d.ts +21 -0
- package/dist/src/components/LazyComponent.d.ts +32 -0
- package/dist/src/env.d.ts +172 -0
- package/dist/src/envOverwrite.d.ts +4 -0
- package/dist/src/factory.d.ts +78 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/locale.d.ts +82 -0
- package/dist/src/renderers/Form.d.ts +352 -0
- package/dist/src/renderers/Item.d.ts +795 -0
- package/dist/src/renderers/Options.d.ts +150 -0
- package/dist/src/renderers/Placeholder.d.ts +6 -0
- package/dist/src/renderers/builtin.d.ts +1 -0
- package/dist/src/renderers/wrapControl.d.ts +446 -0
- package/dist/src/schema.d.ts +369 -0
- package/dist/src/store/app.d.ts +89 -0
- package/dist/src/store/combo.d.ts +8504 -0
- package/dist/src/store/crud.d.ts +124 -0
- package/dist/src/store/form.d.ts +3394 -0
- package/dist/src/store/formItem.d.ts +130 -0
- package/dist/src/store/iRenderer.d.ts +46 -0
- package/dist/src/store/index.d.ts +105 -0
- package/dist/src/store/list.d.ts +270 -0
- package/dist/src/store/manager.d.ts +115 -0
- package/dist/src/store/modal.d.ts +84 -0
- package/dist/src/store/node.d.ts +22 -0
- package/dist/src/store/pagination.d.ts +58 -0
- package/dist/src/store/root.d.ts +79 -0
- package/dist/src/store/service.d.ts +71 -0
- package/dist/src/store/table-v2.d.ts +309 -0
- package/dist/src/store/table.d.ts +8334 -0
- package/dist/src/theme.d.ts +83 -0
- package/dist/src/types.d.ts +217 -0
- package/dist/src/utils/Animation.d.ts +22 -0
- package/dist/src/utils/ColorScale.d.ts +19 -0
- package/dist/src/utils/DataSchema.d.ts +25 -0
- package/dist/src/utils/DataScope.d.ts +23 -0
- package/dist/src/utils/RootClose.d.ts +4 -0
- package/dist/src/utils/SimpleMap.d.ts +8 -0
- package/dist/src/utils/api.d.ts +27 -0
- package/dist/src/utils/attachmentAdpator.d.ts +7 -0
- package/dist/src/utils/autobind.d.ts +7 -0
- package/dist/src/utils/columnsSplit.d.ts +1 -0
- package/dist/src/utils/dataMapping.d.ts +3 -0
- package/dist/src/utils/date.d.ts +4 -0
- package/dist/src/utils/debug.d.ts +26 -0
- package/dist/src/utils/dom.d.ts +13 -0
- package/dist/src/utils/errors.d.ts +6 -0
- package/dist/src/utils/escapeHtml.d.ts +1 -0
- package/dist/src/utils/filter-schema.d.ts +12 -0
- package/dist/src/utils/filter.d.ts +1 -0
- package/dist/src/utils/formatDuration.d.ts +1 -0
- package/dist/src/utils/formula.d.ts +16 -0
- package/dist/src/utils/getVariable.d.ts +3 -0
- package/dist/src/utils/grammar.d.ts +4 -0
- package/dist/src/utils/handleAction.d.ts +6 -0
- package/dist/src/utils/helper.d.ts +286 -0
- package/dist/src/utils/icon.d.ts +12 -0
- package/dist/src/utils/image.d.ts +17 -0
- package/dist/src/utils/index.d.ts +12 -0
- package/dist/src/utils/isPureVariable.d.ts +1 -0
- package/dist/src/utils/json-schema-2-amis-schema.d.ts +6 -0
- package/dist/src/utils/keyToPath.d.ts +6 -0
- package/dist/src/utils/makeSorter.d.ts +1 -0
- package/dist/src/utils/markdown.d.ts +5 -0
- package/dist/src/utils/normalizeLink.d.ts +1 -0
- package/dist/src/utils/normalizeOptions.d.ts +7 -0
- package/dist/src/utils/object.d.ts +15 -0
- package/dist/src/utils/offset.d.ts +14 -0
- package/dist/src/utils/offsetParent.d.ts +4 -0
- package/dist/src/utils/optionValueCompare.d.ts +3 -0
- package/dist/src/utils/position.d.ts +15 -0
- package/dist/src/utils/prettyBytes.d.ts +1 -0
- package/dist/src/utils/renderer-event.d.ts +44 -0
- package/dist/src/utils/replaceText.d.ts +6 -0
- package/dist/src/utils/resize-sensor.d.ts +6 -0
- package/dist/src/utils/resolveVariable.d.ts +1 -0
- package/dist/src/utils/resolveVariableAndFilter.d.ts +1 -0
- package/dist/src/utils/scrollPosition.d.ts +6 -0
- package/dist/src/utils/string2regExp.d.ts +1 -0
- package/dist/src/utils/stripNumber.d.ts +1 -0
- package/dist/src/utils/style.d.ts +10 -0
- package/dist/src/utils/tokenize.d.ts +1 -0
- package/dist/src/utils/tpl-builtin.d.ts +18 -0
- package/dist/src/utils/tpl-lodash.d.ts +4 -0
- package/dist/src/utils/tpl.d.ts +11 -0
- package/dist/src/utils/validations.d.ts +39 -0
- package/dist/store/app.js +190 -0
- package/dist/store/combo.js +154 -0
- package/dist/store/crud.js +413 -0
- package/dist/store/form.js +579 -0
- package/dist/store/formItem.js +846 -0
- package/dist/store/iRenderer.js +189 -0
- package/dist/store/index.js +103 -0
- package/dist/store/list.js +248 -0
- package/dist/store/manager.js +56 -0
- package/dist/store/modal.js +54 -0
- package/dist/store/node.js +93 -0
- package/dist/store/pagination.js +60 -0
- package/dist/store/root.js +45 -0
- package/dist/store/service.js +415 -0
- package/dist/store/table-v2.js +471 -0
- package/dist/store/table.js +1105 -0
- package/dist/theme.js +93 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/Animation.js +290 -0
- package/dist/utils/DataSchema.js +120 -0
- package/dist/utils/DataScope.js +151 -0
- package/dist/utils/SimpleMap.js +46 -0
- package/dist/utils/api.js +555 -0
- package/dist/utils/autobind.js +94 -0
- package/dist/utils/dataMapping.js +136 -0
- package/dist/utils/date.js +90 -0
- package/dist/utils/debug.js +343 -0
- package/dist/utils/errors.js +23 -0
- package/dist/utils/escapeHtml.js +24 -0
- package/dist/utils/filter-schema.js +75 -0
- package/dist/utils/filter.js +481 -0
- package/dist/utils/formatDuration.js +27 -0
- package/dist/utils/formula.js +165 -0
- package/dist/utils/getVariable.js +29 -0
- package/dist/utils/grammar.js +54 -0
- package/dist/utils/helper.js +1283 -0
- package/dist/utils/isPureVariable.js +16 -0
- package/dist/utils/keyToPath.js +34 -0
- package/dist/utils/makeSorter.js +30 -0
- package/dist/utils/normalizeLink.js +47 -0
- package/dist/utils/normalizeOptions.js +92 -0
- package/dist/utils/object.js +156 -0
- package/dist/utils/offset.js +36 -0
- package/dist/utils/offsetParent.js +27 -0
- package/dist/utils/optionValueCompare.js +25 -0
- package/dist/utils/position.js +50 -0
- package/dist/utils/prettyBytes.js +28 -0
- package/dist/utils/renderer-event.js +131 -0
- package/dist/utils/replaceText.js +35 -0
- package/dist/utils/resize-sensor.js +177 -0
- package/dist/utils/resolveVariable.js +39 -0
- package/dist/utils/resolveVariableAndFilter.js +37 -0
- package/dist/utils/string2regExp.js +18 -0
- package/dist/utils/stripNumber.js +20 -0
- package/dist/utils/tokenize.js +33 -0
- package/dist/utils/tpl-builtin.js +71 -0
- package/dist/utils/tpl-lodash.js +71 -0
- package/dist/utils/tpl.js +140 -0
- package/dist/utils/validations.js +377 -0
- package/package.json +121 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RendererProps } from '../factory';
|
|
3
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
4
|
+
import { IBreakAction } from './BreakAction';
|
|
5
|
+
import { IContinueAction } from './ContinueAction';
|
|
6
|
+
import { ILoopAction } from './LoopAction';
|
|
7
|
+
import { IParallelAction } from './ParallelAction';
|
|
8
|
+
import { ISwitchAction } from './SwitchAction';
|
|
9
|
+
export declare enum LoopStatus {
|
|
10
|
+
NORMAL = 0,
|
|
11
|
+
BREAK = 1,
|
|
12
|
+
CONTINUE = 2
|
|
13
|
+
}
|
|
14
|
+
export interface ListenerAction {
|
|
15
|
+
actionType: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
componentId?: string;
|
|
18
|
+
args?: Record<string, any>;
|
|
19
|
+
outputVar?: string;
|
|
20
|
+
preventDefault?: boolean;
|
|
21
|
+
stopPropagation?: boolean;
|
|
22
|
+
expression?: string;
|
|
23
|
+
execOn?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ILogicAction extends ListenerAction {
|
|
26
|
+
children?: ListenerAction[];
|
|
27
|
+
}
|
|
28
|
+
export declare type LogicAction = IParallelAction | ISwitchAction | ILoopAction | IContinueAction | IBreakAction;
|
|
29
|
+
export interface ListenerContext extends React.Component<RendererProps> {
|
|
30
|
+
[propName: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export interface RendererAction {
|
|
33
|
+
run: (action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData?: any) => Promise<RendererEvent<any> | void>;
|
|
34
|
+
}
|
|
35
|
+
export declare const registerAction: (type: string, action: RendererAction) => void;
|
|
36
|
+
export declare const getActionByType: (type: string) => RendererAction;
|
|
37
|
+
export declare const runActions: (actions: ListenerAction | ListenerAction[], renderer: ListenerContext, event: any) => Promise<void>;
|
|
38
|
+
export declare const runAction: (actionInstrance: RendererAction, actionConfig: ListenerAction, renderer: ListenerContext, event: any) => Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Api } from '../types';
|
|
2
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
3
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
|
+
export interface IAjaxAction extends ListenerAction {
|
|
5
|
+
action: 'ajax';
|
|
6
|
+
args: {
|
|
7
|
+
api: Api;
|
|
8
|
+
messages?: {
|
|
9
|
+
success: string;
|
|
10
|
+
failed: string;
|
|
11
|
+
};
|
|
12
|
+
options?: Record<string, any>;
|
|
13
|
+
[propName: string]: any;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 发送请求动作
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @class AjaxAction
|
|
21
|
+
* @implements {Action}
|
|
22
|
+
*/
|
|
23
|
+
export declare class AjaxAction implements RendererAction {
|
|
24
|
+
run(action: IAjaxAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<any>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ILogicAction } from './Action';
|
|
3
|
+
export interface IBreakAction extends ILogicAction {
|
|
4
|
+
actionType: 'break';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* breach
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @class BreakAction
|
|
11
|
+
* @implements {Action}
|
|
12
|
+
*/
|
|
13
|
+
export declare class BreakAction implements RendererAction {
|
|
14
|
+
run(action: IBreakAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
3
|
+
export interface IBroadcastAction extends ListenerAction {
|
|
4
|
+
actionType: 'broadcast';
|
|
5
|
+
eventName: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* broadcast
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @class BroadcastAction
|
|
12
|
+
* @implements {Action}
|
|
13
|
+
*/
|
|
14
|
+
export declare class BroadcastAction implements RendererAction {
|
|
15
|
+
run(action: IBroadcastAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void | RendererEvent<any, any>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
3
|
+
export interface ICmptAction extends ListenerAction {
|
|
4
|
+
actionType: 'setValue' | 'show' | 'hidden' | 'enabled' | 'disabled' | 'reload';
|
|
5
|
+
args: {
|
|
6
|
+
value?: string | {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 组件动作
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @class CmptAction
|
|
16
|
+
* @implements {Action}
|
|
17
|
+
*/
|
|
18
|
+
export declare class CmptAction implements RendererAction {
|
|
19
|
+
run(action: ICmptAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<any>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ILogicAction } from './Action';
|
|
3
|
+
export interface IContinueAction extends ILogicAction {
|
|
4
|
+
actionType: 'continue';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* continue
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @class ContinueAction
|
|
11
|
+
* @implements {Action}
|
|
12
|
+
*/
|
|
13
|
+
export declare class ContinueAction implements RendererAction {
|
|
14
|
+
run(action: IContinueAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
3
|
+
export interface ICopyAction extends ListenerAction {
|
|
4
|
+
actionType: 'copy';
|
|
5
|
+
args: {
|
|
6
|
+
content: string;
|
|
7
|
+
copyFormat?: string;
|
|
8
|
+
[propName: string]: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 复制动作
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @class CopyAction
|
|
16
|
+
* @implements {Action}
|
|
17
|
+
*/
|
|
18
|
+
export declare class CopyAction implements RendererAction {
|
|
19
|
+
run(action: ICopyAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../types';
|
|
2
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
3
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
|
+
export interface ICustomAction extends ListenerAction {
|
|
5
|
+
actionType: 'custom';
|
|
6
|
+
script: string | ((renderer: any, doAction: (action: Action, data: Record<string, any>) => void, event: RendererEvent<any>, action: ListenerAction) => void);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 自定义动作,JS脚本
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @class CustomAction
|
|
13
|
+
* @implements {Action}
|
|
14
|
+
*/
|
|
15
|
+
export declare class CustomAction implements RendererAction {
|
|
16
|
+
run(action: ICustomAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormControlProps } from '../renderers/Item';
|
|
2
|
+
import type { RendererEvent } from '../utils/renderer-event';
|
|
3
|
+
/**
|
|
4
|
+
* 渲染器事件派发
|
|
5
|
+
*
|
|
6
|
+
* @param props 组件props
|
|
7
|
+
* @param e 事件类型
|
|
8
|
+
* @param ctx 上下文数据
|
|
9
|
+
*/
|
|
10
|
+
export declare function rendererEventDispatcher<T extends FormControlProps, E = any>(props: T, e: E, ctx?: Record<string, any>): Promise<RendererEvent<any> | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* 渲染器事件方法装饰器
|
|
13
|
+
*
|
|
14
|
+
* @param event 事件类型
|
|
15
|
+
* @param ctx 上下文数据
|
|
16
|
+
* @returns {Function}
|
|
17
|
+
*/
|
|
18
|
+
export declare function bindRendererEvent<T extends FormControlProps, E = any>(event: E, ctx?: Record<string, any>): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => {
|
|
19
|
+
value: (...params: any[]) => Promise<any>;
|
|
20
|
+
enumerable?: boolean | undefined;
|
|
21
|
+
configurable?: boolean | undefined;
|
|
22
|
+
writable?: boolean | undefined;
|
|
23
|
+
get?: (() => any) | undefined;
|
|
24
|
+
set?: ((value: any) => void) | undefined;
|
|
25
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SchemaNode } from '../types';
|
|
2
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
3
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
|
+
export interface IAlertAction extends ListenerAction {
|
|
5
|
+
actionType: 'alert';
|
|
6
|
+
args: {
|
|
7
|
+
msg: string;
|
|
8
|
+
[propName: string]: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface IConfirmAction extends ListenerAction {
|
|
12
|
+
actionType: 'confirm';
|
|
13
|
+
args: {
|
|
14
|
+
title: string;
|
|
15
|
+
msg: string;
|
|
16
|
+
[propName: string]: any;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface IDialogAction extends ListenerAction {
|
|
20
|
+
actionType: 'dialog';
|
|
21
|
+
dialog: SchemaNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 打开弹窗动作
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @class DialogAction
|
|
28
|
+
* @implements {Action}
|
|
29
|
+
*/
|
|
30
|
+
export declare class DialogAction implements RendererAction {
|
|
31
|
+
run(action: IDialogAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export interface ICloseDialogAction extends ListenerAction {
|
|
34
|
+
actionType: 'closeDialog';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 关闭弹窗动作
|
|
38
|
+
*
|
|
39
|
+
* @export
|
|
40
|
+
* @class CloseDialogAction
|
|
41
|
+
* @implements {Action}
|
|
42
|
+
*/
|
|
43
|
+
export declare class CloseDialogAction implements RendererAction {
|
|
44
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* alert提示动作
|
|
48
|
+
*/
|
|
49
|
+
export declare class AlertAction implements RendererAction {
|
|
50
|
+
run(action: IAlertAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* confirm确认提示动作
|
|
54
|
+
*/
|
|
55
|
+
export declare class ConfirmAction implements RendererAction {
|
|
56
|
+
run(action: IConfirmAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SchemaNode } from '../types';
|
|
2
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
3
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
|
+
export interface IDrawerAction extends ListenerAction {
|
|
5
|
+
actionType: 'drawer';
|
|
6
|
+
drawer: SchemaNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 打开抽屉动作
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @class DrawerAction
|
|
13
|
+
* @implements {Action}
|
|
14
|
+
*/
|
|
15
|
+
export declare class DrawerAction implements RendererAction {
|
|
16
|
+
run(action: IDrawerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface ICloseDrawerAction extends ListenerAction {
|
|
19
|
+
actionType: 'closeDrawer';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 关闭抽屉动作
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
* @class CloseDrawerAction
|
|
26
|
+
* @implements {Action}
|
|
27
|
+
*/
|
|
28
|
+
export declare class CloseDrawerAction implements RendererAction {
|
|
29
|
+
run(action: ListenerAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ListenerAction } from './Action';
|
|
3
|
+
export interface IEmailAction extends ListenerAction {
|
|
4
|
+
actionType: 'email';
|
|
5
|
+
args: {
|
|
6
|
+
to: string;
|
|
7
|
+
cc: string;
|
|
8
|
+
bcc: string;
|
|
9
|
+
subject: string;
|
|
10
|
+
body: string;
|
|
11
|
+
[propName: string]: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 邮件动作
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @class EmailAction
|
|
19
|
+
* @implements {Action}
|
|
20
|
+
*/
|
|
21
|
+
export declare class EmailAction implements RendererAction {
|
|
22
|
+
run(action: IEmailAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ListenerAction } from './Action';
|
|
3
|
+
export interface ILinkAction extends ListenerAction {
|
|
4
|
+
actionType: 'link' | 'url' | 'jump';
|
|
5
|
+
args: {
|
|
6
|
+
link?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
blank?: boolean;
|
|
9
|
+
params?: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
[propName: string]: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 打开页面动作
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @class LinkAction
|
|
20
|
+
* @implements {Action}
|
|
21
|
+
*/
|
|
22
|
+
export declare class LinkAction implements RendererAction {
|
|
23
|
+
run(action: ILinkAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ILogicAction } from './Action';
|
|
3
|
+
export interface ILoopAction extends ILogicAction {
|
|
4
|
+
actionType: 'loop';
|
|
5
|
+
args: {
|
|
6
|
+
loopName: string;
|
|
7
|
+
[propName: string]: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 循环动作
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @class LoopAction
|
|
15
|
+
* @implements {Action}
|
|
16
|
+
*/
|
|
17
|
+
export declare class LoopAction implements RendererAction {
|
|
18
|
+
run(action: ILoopAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData: any): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
3
|
+
export interface IPageGoAction extends ListenerAction {
|
|
4
|
+
actionType: 'goBack' | 'refresh' | 'goPage';
|
|
5
|
+
args: {
|
|
6
|
+
delta?: number;
|
|
7
|
+
[propName: string]: any;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 返回上个页面
|
|
12
|
+
*
|
|
13
|
+
* @export
|
|
14
|
+
* @class PageGoBackAction
|
|
15
|
+
* @implements {Action}
|
|
16
|
+
*/
|
|
17
|
+
export declare class PageGoBackAction implements RendererAction {
|
|
18
|
+
run(action: IPageGoAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 到指定页面
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @class PageGoAction
|
|
25
|
+
* @implements {Action}
|
|
26
|
+
*/
|
|
27
|
+
export declare class PageGoAction implements RendererAction {
|
|
28
|
+
run(action: IPageGoAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 浏览器刷新
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @class PageRefreshAction
|
|
35
|
+
* @implements {Action}
|
|
36
|
+
*/
|
|
37
|
+
export declare class PageRefreshAction implements RendererAction {
|
|
38
|
+
run(action: IPageGoAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ILogicAction } from './Action';
|
|
3
|
+
export interface IParallelAction extends ILogicAction {
|
|
4
|
+
actionType: 'parallel';
|
|
5
|
+
}
|
|
6
|
+
export declare class ParallelAction implements RendererAction {
|
|
7
|
+
run(action: IParallelAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ILogicAction } from './Action';
|
|
3
|
+
export interface ISwitchAction extends ILogicAction {
|
|
4
|
+
actionType: 'switch';
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 排他动作
|
|
8
|
+
*/
|
|
9
|
+
export declare class SwitchAction implements RendererAction {
|
|
10
|
+
run(action: ISwitchAction, renderer: ListenerContext, event: RendererEvent<any>, mergeData: any): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RendererEvent } from '../utils/renderer-event';
|
|
2
|
+
import { RendererAction, ListenerContext, ListenerAction } from './Action';
|
|
3
|
+
export interface IToastAction extends ListenerAction {
|
|
4
|
+
actionType: 'toast';
|
|
5
|
+
args: {
|
|
6
|
+
msg: string;
|
|
7
|
+
msgType?: string;
|
|
8
|
+
position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-center' | 'bottom-left' | 'bottom-right' | 'center';
|
|
9
|
+
closeButton?: boolean;
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 全局toast
|
|
16
|
+
*/
|
|
17
|
+
export declare class ToastAction implements RendererAction {
|
|
18
|
+
run(action: IToastAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file 导入所有动作
|
|
3
|
+
*/
|
|
4
|
+
import './LoopAction';
|
|
5
|
+
import './BreakAction';
|
|
6
|
+
import './ContinueAction';
|
|
7
|
+
import './SwitchAction';
|
|
8
|
+
import './ParallelAction';
|
|
9
|
+
import './CustomAction';
|
|
10
|
+
import './BroadcastAction';
|
|
11
|
+
import './CmptAction';
|
|
12
|
+
import './AjaxAction';
|
|
13
|
+
import './CopyAction';
|
|
14
|
+
import './DialogAction';
|
|
15
|
+
import './DrawerAction';
|
|
16
|
+
import './EmailAction';
|
|
17
|
+
import './LinkAction';
|
|
18
|
+
import './ToastAction';
|
|
19
|
+
import './PageAction';
|
|
20
|
+
import './Decorators';
|
|
21
|
+
export * from './Action';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file LazyComponent
|
|
3
|
+
* @description
|
|
4
|
+
* @author fex
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface LazyComponentProps {
|
|
8
|
+
component?: React.ReactType;
|
|
9
|
+
getComponent?: () => Promise<React.ReactType>;
|
|
10
|
+
placeholder?: React.ReactNode;
|
|
11
|
+
unMountOnHidden?: boolean;
|
|
12
|
+
childProps?: object;
|
|
13
|
+
visiblilityProps?: object;
|
|
14
|
+
[propName: string]: any;
|
|
15
|
+
}
|
|
16
|
+
export interface LazyComponentState {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
component?: React.ReactType;
|
|
19
|
+
}
|
|
20
|
+
export default class LazyComponent extends React.Component<LazyComponentProps, LazyComponentState> {
|
|
21
|
+
static defaultProps: {
|
|
22
|
+
placeholder: JSX.Element;
|
|
23
|
+
unMountOnHidden: boolean;
|
|
24
|
+
partialVisibility: boolean;
|
|
25
|
+
};
|
|
26
|
+
mounted: boolean;
|
|
27
|
+
constructor(props: LazyComponentProps);
|
|
28
|
+
componentDidMount(): void;
|
|
29
|
+
componentWillUnmount(): void;
|
|
30
|
+
handleVisibleChange(visible: boolean): void;
|
|
31
|
+
render(): {};
|
|
32
|
+
}
|