amis-core 3.2.0 → 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 +5 -2
- package/esm/Scoped.d.ts +4 -1
- package/esm/Scoped.js +8 -5
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.d.ts +1 -0
- package/esm/actions/Action.js +62 -37
- 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 +46 -31
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +2 -2
- package/esm/actions/DialogAction.js +5 -6
- 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 +2 -2
- package/esm/components/PopOver.js +2 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +2 -1
- package/esm/index.js +13 -13
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +6 -6
- package/esm/renderers/Form.js +168 -124
- package/esm/renderers/Item.d.ts +42 -66
- package/esm/renderers/Item.js +11 -41
- 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.js +101 -47
- package/esm/store/app.js +8 -4
- package/esm/store/combo.d.ts +444 -1912
- package/esm/store/combo.js +9 -2
- package/esm/store/crud.d.ts +1 -0
- package/esm/store/crud.js +11 -5
- package/esm/store/form.d.ts +132 -892
- package/esm/store/form.js +83 -81
- package/esm/store/formItem.d.ts +5 -2
- package/esm/store/formItem.js +13 -2
- package/esm/store/iRenderer.js +2 -2
- package/esm/store/index.js +1 -1
- package/esm/store/list.js +1 -1
- 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 +2 -2
- package/esm/store/service.js +4 -4
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +503 -2040
- package/esm/store/table.js +79 -55
- 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 +17 -3
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.js +1 -1
- 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 +113 -81
- package/esm/utils/arraySlice.js +1 -1
- 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 +4 -2
- 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 +1 -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 +11 -1
- package/esm/utils/helper.js +14 -2
- 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 +1 -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 +1 -1
- 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 +12 -6
- package/lib/Scoped.d.ts +4 -1
- package/lib/Scoped.js +18 -13
- package/lib/StatusScoped.js +5 -2
- package/lib/WithRootStore.js +5 -2
- package/lib/WithStore.js +5 -2
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +62 -37
- 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 +46 -31
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +8 -5
- package/lib/actions/DialogAction.js +5 -6
- 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 +14 -14
- package/lib/components/PopOver.js +11 -10
- package/lib/env.js +4 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +11 -9
- package/lib/index.d.ts +2 -1
- package/lib/index.js +21 -19
- package/lib/locale.js +6 -3
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +6 -6
- package/lib/renderers/Form.js +180 -131
- package/lib/renderers/Item.d.ts +42 -66
- package/lib/renderers/Item.js +51 -75
- 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.js +104 -47
- package/lib/store/app.js +14 -7
- package/lib/store/combo.d.ts +444 -1912
- package/lib/store/combo.js +9 -2
- package/lib/store/crud.d.ts +1 -0
- package/lib/store/crud.js +11 -5
- package/lib/store/form.d.ts +132 -892
- package/lib/store/form.js +81 -79
- package/lib/store/formItem.d.ts +5 -2
- package/lib/store/formItem.js +13 -2
- package/lib/store/iRenderer.js +8 -5
- package/lib/store/index.js +1 -1
- package/lib/store/list.js +1 -1
- 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 +8 -5
- package/lib/store/service.js +4 -4
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +503 -2040
- package/lib/store/table.js +79 -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 +17 -3
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.js +1 -1
- 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 +113 -81
- package/lib/utils/arraySlice.js +1 -1
- 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 +4 -2
- 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 +7 -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 +11 -1
- package/lib/utils/helper.js +14 -1
- 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 +1 -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 +1 -1
- 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 +5 -5
package/lib/SchemaRenderer.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
|
|
|
@@ -36,6 +36,9 @@ var difference__default = /*#__PURE__*/_interopDefaultLegacy(difference);
|
|
|
36
36
|
var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
|
|
37
37
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
38
38
|
|
|
39
|
+
var __react_jsx__ = require('react');
|
|
40
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
41
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
39
42
|
var RENDERER_TRANSMISSION_OMIT_PROPS = [
|
|
40
43
|
'type',
|
|
41
44
|
'name',
|
|
@@ -51,6 +54,8 @@ var RENDERER_TRANSMISSION_OMIT_PROPS = [
|
|
|
51
54
|
'hiddenOn',
|
|
52
55
|
'disabled',
|
|
53
56
|
'disabledOn',
|
|
57
|
+
'static',
|
|
58
|
+
'staticOn',
|
|
54
59
|
'component',
|
|
55
60
|
'detectField',
|
|
56
61
|
'defaultValue',
|
|
@@ -64,7 +69,8 @@ var RENDERER_TRANSMISSION_OMIT_PROPS = [
|
|
|
64
69
|
'inputOnly',
|
|
65
70
|
'label',
|
|
66
71
|
'renderLabel',
|
|
67
|
-
'trackExpression'
|
|
72
|
+
'trackExpression',
|
|
73
|
+
'editorSetting'
|
|
68
74
|
];
|
|
69
75
|
var componentCache = new SimpleMap.SimpleMap();
|
|
70
76
|
var SchemaRenderer = /** @class */ (function (_super) {
|
|
@@ -251,7 +257,7 @@ var SchemaRenderer = /** @class */ (function (_super) {
|
|
|
251
257
|
defaultActiveKey_1 = schema.activeKey, propKey_1 = schema.key, restSchema_1 = tslib.__rest(schema, ["data", "value", "activeKey", "key"]);
|
|
252
258
|
return rest.invisible
|
|
253
259
|
? null
|
|
254
|
-
:
|
|
260
|
+
: _J$X_(schema.component, tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, rest), restSchema_1), exprProps), {
|
|
255
261
|
// value: defaultValue, // 备注: 此处并没有将value传递给渲染器
|
|
256
262
|
defaultData: defaultData_1, defaultValue: defaultValue_1, defaultActiveKey: defaultActiveKey_1, propKey: propKey_1, $path: $path, $schema: schema, ref: isSFC ? undefined : this.refFn, forwardedRef: isSFC ? this.refFn : undefined, render: this.renderChild, rootStore: rootStore, statusStore: statusStore, dispatchEvent: this.dispatchEvent }));
|
|
257
263
|
}
|
|
@@ -259,7 +265,7 @@ var SchemaRenderer = /** @class */ (function (_super) {
|
|
|
259
265
|
return null;
|
|
260
266
|
}
|
|
261
267
|
else if (!this.renderer) {
|
|
262
|
-
return rest.invisible ? null : (
|
|
268
|
+
return rest.invisible ? null : (_J$X_(LazyComponent["default"], tslib.__assign({}, rest, exprProps, { getComponent: function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
263
269
|
var result;
|
|
264
270
|
return tslib.__generator(this, function (_a) {
|
|
265
271
|
switch (_a.label) {
|
|
@@ -332,8 +338,8 @@ var SchemaRenderer = /** @class */ (function (_super) {
|
|
|
332
338
|
finally { if (e_1) throw e_1.error; }
|
|
333
339
|
}
|
|
334
340
|
}
|
|
335
|
-
var component = isClassComponent ? (
|
|
336
|
-
return this.props.env.enableAMISDebug ? (
|
|
341
|
+
var component = isClassComponent ? (_J$X_(Component, tslib.__assign({}, props, { ref: this.childRef }))) : (_J$X_(Component, tslib.__assign({}, props)));
|
|
342
|
+
return this.props.env.enableAMISDebug ? (_J$X_(debug.DebugWrapper, { renderer: renderer }, component)) : (component);
|
|
337
343
|
};
|
|
338
344
|
SchemaRenderer.displayName = 'Renderer';
|
|
339
345
|
SchemaRenderer.contextType = Scoped.ScopedContext;
|
package/lib/Scoped.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface ScopedComponentType extends React.Component<RendererProps> {
|
|
|
22
22
|
setData?: (value?: object, replace?: boolean, index?: number) => void;
|
|
23
23
|
}
|
|
24
24
|
export interface IScopedContext {
|
|
25
|
+
rendererType?: string;
|
|
26
|
+
component?: ScopedComponentType;
|
|
25
27
|
parent?: AliasIScopedContext;
|
|
26
28
|
children?: AliasIScopedContext[];
|
|
27
29
|
registerComponent: (component: ScopedComponentType) => void;
|
|
@@ -33,13 +35,14 @@ export interface IScopedContext {
|
|
|
33
35
|
send: (target: string, ctx: RendererData) => void;
|
|
34
36
|
close: (target: string) => void;
|
|
35
37
|
closeById: (target: string) => void;
|
|
38
|
+
getComponentsByRefPath: (session: string, path: string) => ScopedComponentType[];
|
|
36
39
|
}
|
|
37
40
|
type AliasIScopedContext = IScopedContext;
|
|
38
41
|
export declare const ScopedContext: React.Context<IScopedContext>;
|
|
39
42
|
export declare function HocScoped<T extends {
|
|
40
43
|
$path?: string;
|
|
41
44
|
env: RendererEnv;
|
|
42
|
-
}>(ComposedComponent: React.ComponentType<T
|
|
45
|
+
}>(ComposedComponent: React.ComponentType<T>, rendererType?: string): React.ComponentType<T & {
|
|
43
46
|
scopeRef?: (ref: any) => void;
|
|
44
47
|
}> & {
|
|
45
48
|
ComposedComponent: React.ComponentType<T>;
|
package/lib/Scoped.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
|
|
|
@@ -22,24 +22,27 @@ require('./utils/filter.js');
|
|
|
22
22
|
var helper = require('./utils/helper.js');
|
|
23
23
|
require('./utils/api.js');
|
|
24
24
|
require('./utils/ColorScale.js');
|
|
25
|
-
require('
|
|
25
|
+
require('./utils/columnsSplit.js');
|
|
26
26
|
require('./utils/DataSchema.js');
|
|
27
27
|
require('./utils/DataScope.js');
|
|
28
28
|
require('./utils/debug.js');
|
|
29
|
-
require('
|
|
29
|
+
require('./utils/dom.js');
|
|
30
30
|
require('./utils/errors.js');
|
|
31
31
|
var tpl = require('./utils/tpl.js');
|
|
32
32
|
require('classnames');
|
|
33
33
|
require('lodash/isObject');
|
|
34
34
|
require('lodash/isString');
|
|
35
35
|
require('lodash/isBoolean');
|
|
36
|
-
require('
|
|
36
|
+
require('./utils/highlight.js');
|
|
37
|
+
require('./utils/icon.js');
|
|
37
38
|
require('./utils/image.js');
|
|
39
|
+
require('lodash/isEqual');
|
|
38
40
|
require('./actions/Action.js');
|
|
39
41
|
require('lodash/debounce');
|
|
40
42
|
require('lodash/cloneDeep');
|
|
41
43
|
require('./utils/resize-sensor.js');
|
|
42
44
|
require('react-overlays/useRootClose');
|
|
45
|
+
require('react-dom');
|
|
43
46
|
require('./utils/SimpleMap.js');
|
|
44
47
|
require('lodash/mapValues');
|
|
45
48
|
require('lodash/camelCase');
|
|
@@ -56,10 +59,9 @@ var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
|
56
59
|
var values__default = /*#__PURE__*/_interopDefaultLegacy(values);
|
|
57
60
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*/
|
|
62
|
+
var __react_jsx__ = require('react');
|
|
63
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
64
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
63
65
|
/**
|
|
64
66
|
* target 里面可能包含 ?xxx=xxx,这种情况下,需要把 ?xxx=xxx 保留下来,然后对前面的部分进行 filter
|
|
65
67
|
* 因为后面会对 query 部分做不一样的处理。会保留原始的值。而不是会转成字符串。
|
|
@@ -76,13 +78,16 @@ function filterTarget(target, data) {
|
|
|
76
78
|
}
|
|
77
79
|
var rootScopedContext = createScopedTools('');
|
|
78
80
|
var ScopedContext = React__default["default"].createContext(rootScopedContext);
|
|
79
|
-
function createScopedTools(path, parent, env) {
|
|
81
|
+
function createScopedTools(path, parent, env, rendererType) {
|
|
80
82
|
var components = [];
|
|
81
83
|
var self = {
|
|
84
|
+
rendererType: rendererType,
|
|
85
|
+
component: undefined,
|
|
82
86
|
parent: parent,
|
|
83
87
|
registerComponent: function (component) {
|
|
84
88
|
// 不要把自己注册在自己的 Scoped 上,自己的 Scoped 是给子节点们注册的。
|
|
85
89
|
if (component.props.$path === path && parent) {
|
|
90
|
+
self.component = component;
|
|
86
91
|
return parent.registerComponent(component);
|
|
87
92
|
}
|
|
88
93
|
if (!~components.indexOf(component)) {
|
|
@@ -346,12 +351,12 @@ function closeDialog(component) {
|
|
|
346
351
|
.forEach(closeDialog);
|
|
347
352
|
component.props.onClose && component.props.onClose();
|
|
348
353
|
}
|
|
349
|
-
function HocScoped(ComposedComponent) {
|
|
354
|
+
function HocScoped(ComposedComponent, rendererType) {
|
|
350
355
|
var ScopedComponent = /** @class */ (function (_super) {
|
|
351
356
|
tslib.__extends(ScopedComponent, _super);
|
|
352
357
|
function ScopedComponent(props, context) {
|
|
353
358
|
var _this = _super.call(this, props) || this;
|
|
354
|
-
_this.scoped = createScopedTools(_this.props.$path, context, _this.props.env);
|
|
359
|
+
_this.scoped = createScopedTools(_this.props.$path, context, _this.props.env, rendererType);
|
|
355
360
|
var scopeRef = props.scopeRef;
|
|
356
361
|
scopeRef && scopeRef(_this.scoped);
|
|
357
362
|
return _this;
|
|
@@ -372,8 +377,8 @@ function HocScoped(ComposedComponent) {
|
|
|
372
377
|
};
|
|
373
378
|
ScopedComponent.prototype.render = function () {
|
|
374
379
|
var _a = this.props; _a.scopeRef; var rest = tslib.__rest(_a, ["scopeRef"]);
|
|
375
|
-
return (
|
|
376
|
-
|
|
380
|
+
return (_J$X_(ScopedContext.Provider, { value: this.scoped },
|
|
381
|
+
_J$X_(ComposedComponent, tslib.__assign({}, rest /* todo */, { ref: this.childRef }))));
|
|
377
382
|
};
|
|
378
383
|
ScopedComponent.displayName = "Scoped(".concat(ComposedComponent.displayName || ComposedComponent.name, ")");
|
|
379
384
|
ScopedComponent.contextType = ScopedContext;
|
package/lib/StatusScoped.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
|
|
|
@@ -18,6 +18,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
19
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
20
20
|
|
|
21
|
+
var __react_jsx__ = require('react');
|
|
22
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
23
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
21
24
|
function StatusScoped(ComposedComponent) {
|
|
22
25
|
var _a;
|
|
23
26
|
var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
@@ -50,7 +53,7 @@ function StatusScoped(ComposedComponent) {
|
|
|
50
53
|
var refConfig = ((_a = ComposedComponent.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent)
|
|
51
54
|
? { ref: this.childRef }
|
|
52
55
|
: { forwardedRef: this.childRef };
|
|
53
|
-
return (
|
|
56
|
+
return (_J$X_(ComposedComponent, tslib.__assign({}, this.props, injectedProps, refConfig)));
|
|
54
57
|
};
|
|
55
58
|
return class_1;
|
|
56
59
|
}(React__default["default"].Component)),
|
package/lib/WithRootStore.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
|
|
|
@@ -16,6 +16,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
16
16
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
17
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
18
18
|
|
|
19
|
+
var __react_jsx__ = require('react');
|
|
20
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
21
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
19
22
|
var RootStoreContext = React__default["default"].createContext(undefined);
|
|
20
23
|
function withRootStore(ComposedComponent) {
|
|
21
24
|
var _a;
|
|
@@ -37,7 +40,7 @@ function withRootStore(ComposedComponent) {
|
|
|
37
40
|
var injectedProps = {
|
|
38
41
|
rootStore: rootStore
|
|
39
42
|
};
|
|
40
|
-
return (
|
|
43
|
+
return (_J$X_(ComposedComponent, tslib.__assign({}, this.props, injectedProps, { ref: this.refFn })));
|
|
41
44
|
};
|
|
42
45
|
return class_1;
|
|
43
46
|
}(React__default["default"].Component)),
|
package/lib/WithStore.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
|
|
|
@@ -28,6 +28,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
28
28
|
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
29
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
30
|
|
|
31
|
+
var __react_jsx__ = require('react');
|
|
32
|
+
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
33
|
+
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
31
34
|
function HocStoreFactory(renderer) {
|
|
32
35
|
return function (Component) {
|
|
33
36
|
var StoreFactory = /** @class */ (function (_super) {
|
|
@@ -182,7 +185,7 @@ function HocStoreFactory(renderer) {
|
|
|
182
185
|
if (this.state.hidden || this.state.visible === false) {
|
|
183
186
|
return null;
|
|
184
187
|
}
|
|
185
|
-
return (
|
|
188
|
+
return (_J$X_(Component, tslib.__assign({}, rest /* todo */, this.state, { ref: this.refFn, data: this.store.data, dataUpdatedAt: this.store.updatedAt, store: this.store, scope: this.store.data, render: this.renderChild })));
|
|
186
189
|
};
|
|
187
190
|
StoreFactory.displayName = "WithStore(".concat(Component.displayName || Component.name, ")");
|
|
188
191
|
StoreFactory.ComposedComponent = Component;
|
package/lib/actions/Action.d.ts
CHANGED
package/lib/actions/Action.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
|
|
|
@@ -125,11 +125,20 @@ var runActions = function (actions, renderer, event) { return tslib.__awaiter(vo
|
|
|
125
125
|
// 如果存在指定组件ID,说明是组件专有动作
|
|
126
126
|
if (!actionInstrance &&
|
|
127
127
|
(actionConfig.componentId || actionConfig.componentName)) {
|
|
128
|
-
actionInstrance =
|
|
128
|
+
actionInstrance = [
|
|
129
|
+
'static',
|
|
130
|
+
'nonstatic',
|
|
131
|
+
'show',
|
|
132
|
+
'visibility',
|
|
133
|
+
'hidden',
|
|
134
|
+
'enabled',
|
|
135
|
+
'disabled',
|
|
136
|
+
'usability'
|
|
137
|
+
].includes(actionConfig.actionType)
|
|
138
|
+
? getActionByType('status')
|
|
139
|
+
: getActionByType('component');
|
|
129
140
|
}
|
|
130
|
-
else if (
|
|
131
|
-
actionConfig.actionType === 'link' ||
|
|
132
|
-
actionConfig.actionType === 'jump') {
|
|
141
|
+
else if (['url', 'link', 'jump'].includes(actionConfig.actionType)) {
|
|
133
142
|
// 打开页面动作
|
|
134
143
|
actionInstrance = getActionByType('openlink');
|
|
135
144
|
}
|
|
@@ -166,14 +175,16 @@ var runActions = function (actions, renderer, event) { return tslib.__awaiter(vo
|
|
|
166
175
|
}); };
|
|
167
176
|
// 执行动作,与原有动作处理打通
|
|
168
177
|
var runAction = function (actionInstrance, actionConfig, renderer, event) { return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
169
|
-
var additional, mergeData, expression, isStop, preventDefault, key, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
|
|
170
|
-
var _a, _b, _c;
|
|
171
|
-
return tslib.__generator(this, function (
|
|
172
|
-
switch (
|
|
178
|
+
var additional, action, mergeData, expression, isStop, preventDefault, key, api, args, afterMappingData, actionData, data, stopped, actionResult, stopPropagation;
|
|
179
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
180
|
+
return tslib.__generator(this, function (_u) {
|
|
181
|
+
switch (_u.label) {
|
|
173
182
|
case 0:
|
|
174
183
|
additional = {
|
|
175
184
|
event: event
|
|
176
185
|
};
|
|
186
|
+
action = tslib.__assign({}, actionConfig);
|
|
187
|
+
action.args = tslib.__assign({}, actionConfig.args);
|
|
177
188
|
// __rendererData默认为renderer.props.data,兼容表单项值变化时的data读取
|
|
178
189
|
if (!event.data.__rendererData) {
|
|
179
190
|
additional = {
|
|
@@ -184,29 +195,47 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
|
|
|
184
195
|
mergeData = object.createObject(object.createObject(renderer.props.data.__super
|
|
185
196
|
? object.createObject(renderer.props.data.__super, additional)
|
|
186
197
|
: additional, renderer.props.data), event.data);
|
|
187
|
-
expression = (_a =
|
|
198
|
+
expression = (_a = action.expression) !== null && _a !== void 0 ? _a : action.execOn;
|
|
188
199
|
isStop = false;
|
|
189
200
|
if (!expression) return [3 /*break*/, 2];
|
|
190
201
|
return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(expression, mergeData, true)];
|
|
191
202
|
case 1:
|
|
192
|
-
isStop = !(
|
|
193
|
-
|
|
203
|
+
isStop = !(_u.sent());
|
|
204
|
+
_u.label = 2;
|
|
194
205
|
case 2:
|
|
195
206
|
if (isStop) {
|
|
196
207
|
return [2 /*return*/];
|
|
197
208
|
}
|
|
198
209
|
preventDefault = false;
|
|
199
|
-
if (!
|
|
200
|
-
return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(
|
|
210
|
+
if (!action.preventDefault) return [3 /*break*/, 4];
|
|
211
|
+
return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.preventDefault, mergeData, false)];
|
|
201
212
|
case 3:
|
|
202
|
-
preventDefault =
|
|
203
|
-
|
|
213
|
+
preventDefault = _u.sent();
|
|
214
|
+
_u.label = 4;
|
|
204
215
|
case 4:
|
|
205
216
|
key = {
|
|
206
|
-
componentId: dataMapping.dataMapping(
|
|
207
|
-
componentName: dataMapping.dataMapping(
|
|
217
|
+
componentId: dataMapping.dataMapping(action.componentId, mergeData),
|
|
218
|
+
componentName: dataMapping.dataMapping(action.componentName, mergeData)
|
|
208
219
|
};
|
|
209
|
-
|
|
220
|
+
// 兼容args包裹的用法
|
|
221
|
+
if (action.actionType === 'dialog') {
|
|
222
|
+
action.dialog = tslib.__assign({}, ((_b = action.dialog) !== null && _b !== void 0 ? _b : (_c = action.args) === null || _c === void 0 ? void 0 : _c.dialog));
|
|
223
|
+
(_d = action.args) === null || _d === void 0 ? true : delete _d.dialog;
|
|
224
|
+
}
|
|
225
|
+
else if (action.actionType === 'drawer') {
|
|
226
|
+
action.drawer = tslib.__assign({}, ((_e = action.drawer) !== null && _e !== void 0 ? _e : (_f = action.args) === null || _f === void 0 ? void 0 : _f.drawer));
|
|
227
|
+
(_g = action.args) === null || _g === void 0 ? true : delete _g.drawer;
|
|
228
|
+
}
|
|
229
|
+
else if (action.actionType === 'ajax') {
|
|
230
|
+
api = (_h = action.api) !== null && _h !== void 0 ? _h : (_j = action.args) === null || _j === void 0 ? void 0 : _j.api;
|
|
231
|
+
action.api = typeof api === 'string' ? api : tslib.__assign({}, api);
|
|
232
|
+
action.options = tslib.__assign({}, ((_k = action.options) !== null && _k !== void 0 ? _k : (_l = action.args) === null || _l === void 0 ? void 0 : _l.options));
|
|
233
|
+
action.messages = tslib.__assign({}, ((_m = action.messages) !== null && _m !== void 0 ? _m : (_o = action.args) === null || _o === void 0 ? void 0 : _o.messages));
|
|
234
|
+
(_p = action.args) === null || _p === void 0 ? true : delete _p.api;
|
|
235
|
+
(_q = action.args) === null || _q === void 0 ? true : delete _q.options;
|
|
236
|
+
(_r = action.args) === null || _r === void 0 ? true : delete _r.messages;
|
|
237
|
+
}
|
|
238
|
+
args = dataMapping.dataMapping(action.args, mergeData, function (key) {
|
|
210
239
|
return [
|
|
211
240
|
'adaptor',
|
|
212
241
|
'responseAdaptor',
|
|
@@ -215,34 +244,30 @@ var runAction = function (actionInstrance, actionConfig, renderer, event) { retu
|
|
|
215
244
|
'condition'
|
|
216
245
|
].includes(key);
|
|
217
246
|
});
|
|
218
|
-
afterMappingData = dataMapping.dataMapping(
|
|
247
|
+
afterMappingData = dataMapping.dataMapping(action.data, mergeData);
|
|
219
248
|
actionData = args && Object.keys(args).length
|
|
220
|
-
? omit__default["default"](tslib.__assign(tslib.__assign({}, args), (afterMappingData !== null && afterMappingData !== void 0 ? afterMappingData : {})), getOmitActionProp(
|
|
249
|
+
? omit__default["default"](tslib.__assign(tslib.__assign({}, args), (afterMappingData !== null && afterMappingData !== void 0 ? afterMappingData : {})), getOmitActionProp(action.actionType))
|
|
221
250
|
: afterMappingData;
|
|
222
|
-
data =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
? actionData
|
|
226
|
-
: event.data;
|
|
227
|
-
(_b = console.group) === null || _b === void 0 ? void 0 : _b.call(console, "run action ".concat(actionConfig.actionType));
|
|
228
|
-
console.debug("[".concat(actionConfig.actionType, "] action args, data"), args, data);
|
|
251
|
+
data = actionData !== undefined ? actionData : mergeData;
|
|
252
|
+
(_s = console.group) === null || _s === void 0 ? void 0 : _s.call(console, "run action ".concat(action.actionType));
|
|
253
|
+
console.debug("[".concat(action.actionType, "] action args, data"), args, data);
|
|
229
254
|
stopped = false;
|
|
230
|
-
return [4 /*yield*/, actionInstrance.run(tslib.__assign(tslib.__assign(tslib.__assign({},
|
|
255
|
+
return [4 /*yield*/, actionInstrance.run(tslib.__assign(tslib.__assign(tslib.__assign({}, action), { args: args, data: action.actionType === 'reload' ? actionData : data }), key), renderer, event, mergeData)];
|
|
231
256
|
case 5:
|
|
232
|
-
actionResult =
|
|
257
|
+
actionResult = _u.sent();
|
|
233
258
|
// 二次确认弹窗如果取消,则终止后续动作
|
|
234
|
-
if ((
|
|
259
|
+
if ((action === null || action === void 0 ? void 0 : action.actionType) === 'confirmDialog' && !actionResult) {
|
|
235
260
|
stopped = true;
|
|
236
261
|
}
|
|
237
262
|
stopPropagation = false;
|
|
238
|
-
if (!
|
|
239
|
-
return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(
|
|
263
|
+
if (!action.stopPropagation) return [3 /*break*/, 7];
|
|
264
|
+
return [4 /*yield*/, tpl.evalExpressionWithConditionBuilder(action.stopPropagation, mergeData, false)];
|
|
240
265
|
case 6:
|
|
241
|
-
stopPropagation =
|
|
242
|
-
|
|
266
|
+
stopPropagation = _u.sent();
|
|
267
|
+
_u.label = 7;
|
|
243
268
|
case 7:
|
|
244
|
-
console.debug("[".concat(
|
|
245
|
-
(
|
|
269
|
+
console.debug("[".concat(action.actionType, "] action end event"), event);
|
|
270
|
+
(_t = console.groupEnd) === null || _t === void 0 ? void 0 : _t.call(console);
|
|
246
271
|
// 阻止原有动作执行
|
|
247
272
|
preventDefault && event.preventDefault();
|
|
248
273
|
// 阻止后续动作执行
|
|
@@ -3,15 +3,13 @@ import { RendererEvent } from '../utils/renderer-event';
|
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
4
|
export interface IAjaxAction extends ListenerAction {
|
|
5
5
|
action: 'ajax';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
failed: string;
|
|
11
|
-
};
|
|
12
|
-
options?: Record<string, any>;
|
|
13
|
-
[propName: string]: any;
|
|
6
|
+
api: Api;
|
|
7
|
+
messages?: {
|
|
8
|
+
success: string;
|
|
9
|
+
failed: string;
|
|
14
10
|
};
|
|
11
|
+
options?: Record<string, any>;
|
|
12
|
+
[propName: string]: any;
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
15
|
* 发送请求动作
|
|
@@ -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
|
|
|
@@ -27,39 +27,41 @@ var AjaxAction = /** @class */ (function () {
|
|
|
27
27
|
this.fetcherType = fetcherType;
|
|
28
28
|
}
|
|
29
29
|
AjaxAction.prototype.run = function (action, renderer, event) {
|
|
30
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
30
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
31
31
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
32
|
-
var env, result, responseData, msg, e_1, result;
|
|
33
|
-
var
|
|
34
|
-
return tslib.__generator(this, function (
|
|
35
|
-
switch (
|
|
32
|
+
var env, silent, messages, result, responseData, msg, e_1, result;
|
|
33
|
+
var _o;
|
|
34
|
+
return tslib.__generator(this, function (_p) {
|
|
35
|
+
switch (_p.label) {
|
|
36
36
|
case 0:
|
|
37
37
|
if (!((_a = renderer.props.env) === null || _a === void 0 ? void 0 : _a.fetcher)) {
|
|
38
38
|
throw new Error('env.fetcher is required!');
|
|
39
39
|
}
|
|
40
40
|
if (this.fetcherType === 'download' && action.actionType === 'download') {
|
|
41
|
-
if (
|
|
42
|
-
action.
|
|
41
|
+
if (action.api) {
|
|
42
|
+
action.api.responseType = 'blob';
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
env = event.context.env;
|
|
46
|
-
|
|
46
|
+
silent = (_b = action === null || action === void 0 ? void 0 : action.options) === null || _b === void 0 ? void 0 : _b.silent;
|
|
47
|
+
messages = (_c = action === null || action === void 0 ? void 0 : action.api) === null || _c === void 0 ? void 0 : _c.messages;
|
|
48
|
+
_p.label = 1;
|
|
47
49
|
case 1:
|
|
48
|
-
|
|
49
|
-
return [4 /*yield*/, env.fetcher(
|
|
50
|
+
_p.trys.push([1, 3, , 4]);
|
|
51
|
+
return [4 /*yield*/, env.fetcher(action === null || action === void 0 ? void 0 : action.api, (_d = action.data) !== null && _d !== void 0 ? _d : {}, (_e = action === null || action === void 0 ? void 0 : action.options) !== null && _e !== void 0 ? _e : {})];
|
|
50
52
|
case 2:
|
|
51
|
-
result =
|
|
53
|
+
result = _p.sent();
|
|
52
54
|
responseData = !helper.isEmpty(result.data) || result.ok
|
|
53
55
|
? api.normalizeApiResponseData(result.data)
|
|
54
56
|
: null;
|
|
55
57
|
// 记录请求返回的数据
|
|
56
|
-
event.setData(object.createObject(event.data, tslib.__assign(tslib.__assign({}, responseData), (
|
|
57
|
-
if (!
|
|
58
|
+
event.setData(object.createObject(event.data, tslib.__assign(tslib.__assign({}, responseData), (_o = { responseData: responseData }, _o[action.outputVar || 'responseResult'] = tslib.__assign(tslib.__assign({}, responseData), { responseData: responseData, responseStatus: result.status, responseMsg: result.msg }), _o))));
|
|
59
|
+
if (!silent) {
|
|
58
60
|
if (!result.ok) {
|
|
59
|
-
throw new errors.ServerError((
|
|
61
|
+
throw new errors.ServerError((_h = (_f = messages === null || messages === void 0 ? void 0 : messages.failed) !== null && _f !== void 0 ? _f : (_g = action.messages) === null || _g === void 0 ? void 0 : _g.failed) !== null && _h !== void 0 ? _h : result.msg, result);
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
|
-
msg = (
|
|
64
|
+
msg = (_m = (_l = (_j = messages === null || messages === void 0 ? void 0 : messages.success) !== null && _j !== void 0 ? _j : (_k = action.messages) === null || _k === void 0 ? void 0 : _k.success) !== null && _l !== void 0 ? _l : result.msg) !== null && _m !== void 0 ? _m : result.defaultMsg;
|
|
63
65
|
msg &&
|
|
64
66
|
env.notify('success', msg, result.msgTimeout !== undefined
|
|
65
67
|
? {
|
|
@@ -71,8 +73,8 @@ var AjaxAction = /** @class */ (function () {
|
|
|
71
73
|
}
|
|
72
74
|
return [2 /*return*/, result.data];
|
|
73
75
|
case 3:
|
|
74
|
-
e_1 =
|
|
75
|
-
if (!
|
|
76
|
+
e_1 = _p.sent();
|
|
77
|
+
if (!silent) {
|
|
76
78
|
if (e_1.type === 'ServerError') {
|
|
77
79
|
result = e_1.response;
|
|
78
80
|
env.notify('error', e_1.message, result.msgTimeout !== undefined
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { RendererEvent } from '../utils/renderer-event';
|
|
2
2
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
3
3
|
export interface ICmptAction extends ListenerAction {
|
|
4
|
-
actionType:
|
|
4
|
+
actionType: string;
|
|
5
5
|
args: {
|
|
6
|
-
/** actionType为setValue时,目标变量的path */
|
|
7
6
|
path?: string;
|
|
8
7
|
value?: string | {
|
|
9
8
|
[key: string]: string;
|