amis-core 6.14.0-beta.0 → 6.14.0-beta.10
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.d.ts +3 -2
- package/esm/Root.js +3 -2
- package/esm/RootRenderer.d.ts +19 -1
- package/esm/RootRenderer.js +6 -3
- package/esm/SchemaRenderer.js +6 -4
- package/esm/Scoped.js +3 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.js +1 -1
- package/esm/WithRootStore.d.ts +70 -358
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +2 -3
- package/esm/actions/Action.d.ts +3 -17
- package/esm/actions/Action.js +3 -1
- package/esm/actions/AjaxAction.d.ts +1 -1
- package/esm/actions/AjaxAction.js +11 -11
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +2 -2
- package/esm/actions/CmptAction.d.ts +1 -1
- package/esm/actions/CmptAction.js +41 -41
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +2 -2
- package/esm/actions/CustomAction.d.ts +2 -1
- package/esm/actions/CustomAction.js +4 -2
- package/esm/actions/DialogAction.d.ts +6 -6
- package/esm/actions/DialogAction.js +14 -12
- package/esm/actions/DrawerAction.d.ts +3 -3
- package/esm/actions/DrawerAction.js +12 -10
- package/esm/actions/EmailAction.js +2 -2
- package/esm/actions/EventAction.js +8 -6
- package/esm/actions/LinkAction.js +2 -2
- package/esm/actions/LoopAction.js +12 -12
- package/esm/actions/PageAction.js +2 -2
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/PrintAction.js +2 -2
- package/esm/actions/StatusAction.js +2 -2
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +2 -2
- package/esm/actions/WaitAction.js +2 -2
- package/esm/actions/index.d.ts +66 -0
- package/esm/components/Animations.d.ts +2 -2
- package/esm/components/Animations.js +3 -1
- package/esm/components/CustomStyle.js +60 -33
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.d.ts +2 -3
- package/esm/components/LazyComponent.js +2 -3
- package/esm/components/Overlay.js +4 -9
- package/esm/components/PopOver.d.ts +2 -3
- package/esm/components/PopOver.js +4 -3
- package/esm/env.d.ts +24 -22
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +4 -1
- package/esm/factory.js +12 -8
- package/esm/globalVar.js +1 -1
- package/esm/globalVarClientHandler.js +1 -1
- package/esm/globalVarDefaultValueHandler.js +1 -1
- package/esm/hooks/useEnvContext.d.ts +9 -0
- package/esm/hooks/useEnvContext.js +22 -0
- package/esm/hooks/useRenderOptionsContext.d.ts +9 -0
- package/esm/hooks/useRenderOptionsContext.js +22 -0
- package/esm/index.d.ts +8 -6
- package/esm/index.js +21 -13
- package/esm/locale.d.ts +22 -22
- package/esm/locale.js +6 -6
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +47 -18
- package/esm/renderers/Form.js +28 -28
- package/esm/renderers/Item.d.ts +68 -240
- package/esm/renderers/Item.js +36 -24
- package/esm/renderers/Options.d.ts +21 -19
- package/esm/renderers/Options.js +99 -48
- 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 +36 -180
- package/esm/renderers/wrapControl.js +49 -50
- package/esm/schema.d.ts +1315 -0
- package/esm/store/app.d.ts +17 -17
- package/esm/store/app.js +3 -1
- package/esm/store/combo.d.ts +1504 -10289
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +22 -22
- package/esm/store/crud.js +9 -5
- package/esm/store/form.d.ts +571 -4232
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.d.ts +48 -48
- package/esm/store/formItem.js +8 -5
- package/esm/store/iRenderer.d.ts +7 -7
- package/esm/store/iRenderer.js +8 -6
- package/esm/store/index.d.ts +15 -15
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +10 -10
- package/esm/store/list.js +1 -1
- package/esm/store/manager.d.ts +18 -18
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +16 -16
- package/esm/store/modal.js +1 -1
- package/esm/store/node.d.ts +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +9 -9
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.d.ts +20 -19
- package/esm/store/root.js +11 -3
- package/esm/store/service.d.ts +9 -9
- package/esm/store/service.js +3 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +74 -11119
- package/esm/store/table.js +15 -8
- package/esm/store/table2.d.ts +20 -20
- package/esm/store/table2.js +4 -4
- package/esm/theme.d.ts +4 -4
- package/esm/theme.js +14 -16
- package/esm/types.d.ts +21 -352
- 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 +13 -3
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/animations.d.ts +2 -27
- package/esm/utils/animations.js +1 -1
- package/esm/utils/api.d.ts +1 -1
- package/esm/utils/api.js +2 -2
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +5 -3
- package/esm/utils/debug.js +3 -3
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.js +2 -2
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.d.ts +1 -1
- package/esm/utils/filter-schema.js +6 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +2 -2
- package/esm/utils/getPageId.js +1 -1
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.d.ts +0 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +8 -7
- package/esm/utils/helper.js +8 -7
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.d.ts +0 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.js +4 -2
- 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/labelToString.js +1 -1
- package/esm/utils/loopTooMuch.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- 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.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.d.ts +4 -5
- package/esm/utils/renderer-event.js +10 -10
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.d.ts +1 -1
- package/esm/utils/resolveCondition.js +8 -8
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +12 -8
- 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.d.ts +5 -1
- package/esm/utils/style-helper.js +30 -13
- 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.d.ts +1 -1
- package/esm/utils/tpl-builtin.js +9 -5
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.d.ts +1 -1
- package/esm/utils/tpl.js +6 -2
- package/esm/utils/uncontrollable.d.ts +0 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.d.ts +3 -2
- package/lib/Root.js +3 -1
- package/lib/RootRenderer.d.ts +18 -0
- package/lib/RootRenderer.js +6 -3
- package/lib/SchemaRenderer.js +5 -3
- package/lib/Scoped.js +3 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.js +1 -1
- package/lib/WithRootStore.d.ts +70 -358
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +2 -3
- package/lib/actions/Action.d.ts +3 -17
- package/lib/actions/Action.js +3 -1
- package/lib/actions/AjaxAction.d.ts +1 -1
- package/lib/actions/AjaxAction.js +11 -11
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +2 -2
- package/lib/actions/CmptAction.d.ts +1 -1
- package/lib/actions/CmptAction.js +41 -41
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +2 -2
- package/lib/actions/CustomAction.d.ts +2 -1
- package/lib/actions/CustomAction.js +4 -2
- package/lib/actions/DialogAction.d.ts +6 -6
- package/lib/actions/DialogAction.js +14 -12
- package/lib/actions/DrawerAction.d.ts +3 -3
- package/lib/actions/DrawerAction.js +12 -10
- package/lib/actions/EmailAction.js +2 -2
- package/lib/actions/EventAction.js +8 -6
- package/lib/actions/LinkAction.js +2 -2
- package/lib/actions/LoopAction.js +12 -12
- package/lib/actions/PageAction.js +2 -2
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/PrintAction.js +2 -2
- package/lib/actions/StatusAction.js +2 -2
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +2 -2
- package/lib/actions/WaitAction.js +2 -2
- package/lib/actions/index.d.ts +66 -0
- package/lib/components/Animations.d.ts +2 -2
- package/lib/components/Animations.js +3 -1
- package/lib/components/CustomStyle.js +62 -31
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.d.ts +2 -3
- package/lib/components/LazyComponent.js +2 -3
- package/lib/components/Overlay.js +4 -9
- package/lib/components/PopOver.d.ts +2 -3
- package/lib/components/PopOver.js +3 -2
- package/lib/env.d.ts +24 -22
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +4 -1
- package/lib/factory.js +14 -8
- package/lib/globalVar.js +1 -1
- package/lib/globalVarClientHandler.js +1 -1
- package/lib/globalVarDefaultValueHandler.js +1 -1
- package/lib/hooks/useEnvContext.d.ts +9 -0
- package/lib/hooks/useEnvContext.js +28 -0
- package/lib/hooks/useRenderOptionsContext.d.ts +9 -0
- package/lib/hooks/useRenderOptionsContext.js +28 -0
- package/lib/index.d.ts +8 -6
- package/lib/index.js +24 -9
- package/lib/locale.d.ts +22 -22
- package/lib/locale.js +6 -6
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +47 -18
- package/lib/renderers/Form.js +28 -28
- package/lib/renderers/Item.d.ts +69 -241
- package/lib/renderers/Item.js +34 -22
- package/lib/renderers/Options.d.ts +21 -19
- package/lib/renderers/Options.js +99 -48
- 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 +36 -180
- package/lib/renderers/wrapControl.js +49 -50
- package/lib/schema.d.ts +1315 -0
- package/lib/store/app.d.ts +17 -17
- package/lib/store/app.js +3 -1
- package/lib/store/combo.d.ts +1504 -10289
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +22 -22
- package/lib/store/crud.js +8 -4
- package/lib/store/form.d.ts +571 -4232
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.d.ts +48 -48
- package/lib/store/formItem.js +8 -5
- package/lib/store/iRenderer.d.ts +7 -7
- package/lib/store/iRenderer.js +8 -6
- package/lib/store/index.d.ts +15 -15
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +10 -10
- package/lib/store/list.js +1 -1
- package/lib/store/manager.d.ts +18 -18
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +16 -16
- package/lib/store/modal.js +1 -1
- package/lib/store/node.d.ts +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +9 -9
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.d.ts +20 -18
- package/lib/store/root.js +11 -3
- package/lib/store/service.d.ts +9 -9
- package/lib/store/service.js +3 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +74 -11119
- package/lib/store/table.js +15 -8
- package/lib/store/table2.d.ts +20 -20
- package/lib/store/table2.js +4 -4
- package/lib/theme.d.ts +4 -4
- package/lib/theme.js +14 -16
- package/lib/types.d.ts +21 -352
- 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 +13 -2
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/animations.d.ts +2 -27
- package/lib/utils/animations.js +1 -1
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +2 -2
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +5 -3
- package/lib/utils/debug.js +2 -2
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +2 -2
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.d.ts +1 -1
- package/lib/utils/filter-schema.js +6 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +2 -2
- package/lib/utils/getPageId.js +1 -1
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.d.ts +0 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +8 -7
- package/lib/utils/helper.js +8 -7
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.d.ts +0 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +5 -2
- 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/labelToString.js +1 -1
- package/lib/utils/loopTooMuch.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- 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.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.d.ts +4 -5
- package/lib/utils/renderer-event.js +10 -10
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.d.ts +1 -1
- package/lib/utils/resolveCondition.js +8 -8
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +11 -7
- 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.d.ts +5 -1
- package/lib/utils/style-helper.js +31 -12
- 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.d.ts +1 -1
- package/lib/utils/tpl-builtin.js +8 -4
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.d.ts +1 -1
- package/lib/utils/tpl.js +6 -2
- package/lib/utils/uncontrollable.d.ts +0 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +5 -5
package/esm/actions/Action.d.ts
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RendererProps } from '../factory';
|
|
3
|
-
import { ConditionGroupValue } from '../types';
|
|
4
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
5
3
|
import { IBreakAction } from './BreakAction';
|
|
6
4
|
import { IContinueAction } from './ContinueAction';
|
|
7
5
|
import { ILoopAction } from './LoopAction';
|
|
8
6
|
import { IParallelAction } from './ParallelAction';
|
|
9
7
|
import { ISwitchAction } from './SwitchAction';
|
|
8
|
+
import { AMISAction, AMISActionBase } from '../schema';
|
|
10
9
|
export declare enum LoopStatus {
|
|
11
10
|
NORMAL = 0,
|
|
12
11
|
BREAK = 1,
|
|
13
12
|
CONTINUE = 2
|
|
14
13
|
}
|
|
15
|
-
export interface ListenerAction {
|
|
16
|
-
actionType: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
componentId?: string;
|
|
19
|
-
componentName?: string;
|
|
20
|
-
ignoreError?: boolean;
|
|
21
|
-
args?: Record<string, any>;
|
|
22
|
-
data?: Record<string, any> | null;
|
|
23
|
-
dataMergeMode?: 'merge' | 'override';
|
|
24
|
-
outputVar?: string;
|
|
25
|
-
preventDefault?: boolean;
|
|
26
|
-
stopPropagation?: boolean;
|
|
27
|
-
expression?: string | ConditionGroupValue;
|
|
28
|
-
execOn?: string;
|
|
14
|
+
export interface ListenerAction extends AMISActionBase {
|
|
29
15
|
[propName: string]: any;
|
|
30
16
|
}
|
|
31
17
|
export interface ILogicAction extends ListenerAction {
|
|
32
|
-
children?:
|
|
18
|
+
children?: AMISAction[];
|
|
33
19
|
}
|
|
34
20
|
export type LogicAction = IParallelAction | ISwitchAction | ILoopAction | IContinueAction | IBreakAction;
|
|
35
21
|
export interface ListenerContext extends React.Component<RendererProps> {
|
package/esm/actions/Action.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -26,6 +26,7 @@ import 'react-dom';
|
|
|
26
26
|
import '../utils/helper.js';
|
|
27
27
|
import '../utils/errors.js';
|
|
28
28
|
import 'lodash/isPlainObject';
|
|
29
|
+
import '../theme.js';
|
|
29
30
|
import 'lodash/isObject';
|
|
30
31
|
import 'lodash/isString';
|
|
31
32
|
import 'lodash/isBoolean';
|
|
@@ -41,6 +42,7 @@ import 'lodash/cloneDeep';
|
|
|
41
42
|
import 'lodash/map';
|
|
42
43
|
import 'lodash/isEmpty';
|
|
43
44
|
import 'lodash/kebabCase';
|
|
45
|
+
import 'lodash/some';
|
|
44
46
|
import 'uncontrollable';
|
|
45
47
|
import 'hoist-non-react-statics';
|
|
46
48
|
import '../utils/validations.js';
|
|
@@ -2,7 +2,7 @@ import { Api } from '../types';
|
|
|
2
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
4
|
export interface IAjaxAction extends ListenerAction {
|
|
5
|
-
|
|
5
|
+
actionType: 'ajax' | 'download';
|
|
6
6
|
api: Api;
|
|
7
7
|
messages?: {
|
|
8
8
|
success: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -24,14 +24,14 @@ var AjaxAction = /** @class */ (function () {
|
|
|
24
24
|
this.fetcherType = fetcherType;
|
|
25
25
|
}
|
|
26
26
|
AjaxAction.prototype.run = function (action, renderer, event) {
|
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
28
27
|
return __awaiter(this, void 0, void 0, function () {
|
|
29
28
|
var env, silent, messages, api, sendOn, result, responseData, msg, e_1, result;
|
|
30
|
-
var
|
|
29
|
+
var _a;
|
|
30
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
31
31
|
return __generator(this, function (_q) {
|
|
32
32
|
switch (_q.label) {
|
|
33
33
|
case 0:
|
|
34
|
-
if (!((
|
|
34
|
+
if (!((_b = event.context.env) === null || _b === void 0 ? void 0 : _b.fetcher)) {
|
|
35
35
|
throw new Error('env.fetcher is required!');
|
|
36
36
|
}
|
|
37
37
|
if (!action.api) {
|
|
@@ -43,11 +43,11 @@ var AjaxAction = /** @class */ (function () {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
env = event.context.env;
|
|
46
|
-
silent = ((
|
|
47
|
-
messages = (
|
|
46
|
+
silent = ((_c = action === null || action === void 0 ? void 0 : action.options) === null || _c === void 0 ? void 0 : _c.silent) || (action === null || action === void 0 ? void 0 : action.api).silent;
|
|
47
|
+
messages = (_d = action === null || action === void 0 ? void 0 : action.api) === null || _d === void 0 ? void 0 : _d.messages;
|
|
48
48
|
api = normalizeApi(action.api);
|
|
49
49
|
if (!api.sendOn) return [3 /*break*/, 2];
|
|
50
|
-
return [4 /*yield*/, evalExpressionWithConditionBuilderAsync(api.sendOn, (
|
|
50
|
+
return [4 /*yield*/, evalExpressionWithConditionBuilderAsync(api.sendOn, (_e = action.data) !== null && _e !== void 0 ? _e : {}, false)];
|
|
51
51
|
case 1:
|
|
52
52
|
sendOn = _q.sent();
|
|
53
53
|
if (!sendOn) {
|
|
@@ -62,20 +62,20 @@ var AjaxAction = /** @class */ (function () {
|
|
|
62
62
|
_q.label = 3;
|
|
63
63
|
case 3:
|
|
64
64
|
_q.trys.push([3, 5, , 6]);
|
|
65
|
-
return [4 /*yield*/, env.fetcher(api, (
|
|
65
|
+
return [4 /*yield*/, env.fetcher(api, (_f = action.data) !== null && _f !== void 0 ? _f : {}, (_g = action === null || action === void 0 ? void 0 : action.options) !== null && _g !== void 0 ? _g : {})];
|
|
66
66
|
case 4:
|
|
67
67
|
result = _q.sent();
|
|
68
68
|
responseData = !isEmpty(result.data) || result.ok
|
|
69
69
|
? normalizeApiResponseData(result.data)
|
|
70
70
|
: null;
|
|
71
71
|
// 记录请求返回的数据
|
|
72
|
-
event.setData(createObject(event.data, __assign(__assign(__assign({}, event.data), responseData), (
|
|
72
|
+
event.setData(createObject(event.data, __assign(__assign(__assign({}, event.data), responseData), (_a = { responseData: responseData }, _a[action.outputVar || 'responseResult'] = __assign(__assign({}, responseData), { responseData: responseData, responseStatus: result.status, responseMsg: result.msg }), _a))));
|
|
73
73
|
if (!silent) {
|
|
74
74
|
if (!result.ok) {
|
|
75
|
-
throw new ServerError((
|
|
75
|
+
throw new ServerError((_k = (_h = messages === null || messages === void 0 ? void 0 : messages.failed) !== null && _h !== void 0 ? _h : (_j = action.messages) === null || _j === void 0 ? void 0 : _j.failed) !== null && _k !== void 0 ? _k : result.msg, result);
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
|
-
msg = (
|
|
78
|
+
msg = (_p = (_o = (_l = messages === null || messages === void 0 ? void 0 : messages.success) !== null && _l !== void 0 ? _l : (_m = action.messages) === null || _m === void 0 ? void 0 : _m.success) !== null && _o !== void 0 ? _o : result.msg) !== null && _p !== void 0 ? _p : result.defaultMsg;
|
|
79
79
|
msg &&
|
|
80
80
|
env.notify('success', msg, result.msgTimeout !== undefined
|
|
81
81
|
? {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -20,9 +20,9 @@ var BroadcastAction = /** @class */ (function () {
|
|
|
20
20
|
function BroadcastAction() {
|
|
21
21
|
}
|
|
22
22
|
BroadcastAction.prototype.run = function (action, renderer, event) {
|
|
23
|
-
var _a, _b, _c;
|
|
24
23
|
return __awaiter(this, void 0, void 0, function () {
|
|
25
24
|
var eventName;
|
|
25
|
+
var _a, _b, _c;
|
|
26
26
|
return __generator(this, function (_d) {
|
|
27
27
|
switch (_d.label) {
|
|
28
28
|
case 0:
|
|
@@ -1,7 +1,7 @@
|
|
|
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: 'setValue' | 'reload' | 'validateFormItem';
|
|
5
5
|
args: {
|
|
6
6
|
resetPage?: boolean;
|
|
7
7
|
path?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -20,22 +20,22 @@ var CmptAction = /** @class */ (function () {
|
|
|
20
20
|
function CmptAction() {
|
|
21
21
|
}
|
|
22
22
|
CmptAction.prototype.run = function (action, renderer, event) {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
24
23
|
return __awaiter(this, void 0, void 0, function () {
|
|
25
|
-
var key, dataMergeMode, path, topStore, beforeSetData, res, component, msg, result, valid,
|
|
26
|
-
var
|
|
24
|
+
var key, dataMergeMode, path, topStore, beforeSetData, res, component, msg, result, valid, _a, e_1, result, e_2;
|
|
25
|
+
var _b, _c, _d, _e, _f, _g;
|
|
26
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
27
27
|
return __generator(this, function (_14) {
|
|
28
28
|
switch (_14.label) {
|
|
29
29
|
case 0:
|
|
30
30
|
key = action.componentId || action.componentName;
|
|
31
31
|
dataMergeMode = action.dataMergeMode || 'merge';
|
|
32
|
-
path = (
|
|
32
|
+
path = (_h = action.args) === null || _h === void 0 ? void 0 : _h.path;
|
|
33
33
|
if (!(action.actionType === 'setValue' && path && typeof path === 'string')) return [3 /*break*/, 2];
|
|
34
34
|
if (path.startsWith('global.')) {
|
|
35
35
|
topStore = renderer.props.topStore;
|
|
36
36
|
topStore === null || topStore === void 0 ? void 0 : topStore.updateGlobalVarValue(path.substring(7), action.args.value);
|
|
37
37
|
}
|
|
38
|
-
beforeSetData = (
|
|
38
|
+
beforeSetData = (_k = (_j = event === null || event === void 0 ? void 0 : event.context) === null || _j === void 0 ? void 0 : _j.env) === null || _k === void 0 ? void 0 : _k.beforeSetData;
|
|
39
39
|
if (!(beforeSetData && typeof beforeSetData === 'function')) return [3 /*break*/, 2];
|
|
40
40
|
return [4 /*yield*/, beforeSetData(renderer, action, event)];
|
|
41
41
|
case 1:
|
|
@@ -60,91 +60,91 @@ var CmptAction = /** @class */ (function () {
|
|
|
60
60
|
}
|
|
61
61
|
if (action.actionType === 'setValue') {
|
|
62
62
|
if (component === null || component === void 0 ? void 0 : component.setData) {
|
|
63
|
-
return [2 /*return*/, component === null || component === void 0 ? void 0 : component.setData((
|
|
63
|
+
return [2 /*return*/, component === null || component === void 0 ? void 0 : component.setData((_l = action.args) === null || _l === void 0 ? void 0 : _l.value, dataMergeMode === 'override', (_m = action.args) === null || _m === void 0 ? void 0 : _m.index, (_o = action.args) === null || _o === void 0 ? void 0 : _o.condition)];
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
|
-
return [2 /*return*/, (
|
|
66
|
+
return [2 /*return*/, (_q = component === null || component === void 0 ? void 0 : (_p = component.props).onChange) === null || _q === void 0 ? void 0 : _q.call(_p, (_r = action.args) === null || _r === void 0 ? void 0 : _r.value)];
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
if (!(action.actionType === 'reload')) return [3 /*break*/, 4];
|
|
70
|
-
return [4 /*yield*/, ((
|
|
70
|
+
return [4 /*yield*/, ((_s = component === null || component === void 0 ? void 0 : component.reload) === null || _s === void 0 ? void 0 : _s.call(component, undefined, action.data, event.data, undefined, dataMergeMode === 'override', __assign(__assign({}, action.args), { resetPage: (_u = (_t = action.args) === null || _t === void 0 ? void 0 : _t.resetPage) !== null && _u !== void 0 ? _u : action.resetPage })))];
|
|
71
71
|
case 3:
|
|
72
72
|
result = _14.sent();
|
|
73
73
|
if (result && action.outputVar) {
|
|
74
|
-
event.setData(extendObject(event.data, (
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
event.setData(extendObject(event.data, (_b = {},
|
|
75
|
+
_b[action.outputVar] = result,
|
|
76
|
+
_b)));
|
|
77
77
|
}
|
|
78
78
|
return [2 /*return*/, result];
|
|
79
79
|
case 4:
|
|
80
80
|
if (!(action.actionType === 'validateFormItem' &&
|
|
81
|
-
((
|
|
81
|
+
((_w = getRendererByName((_v = component === null || component === void 0 ? void 0 : component.props) === null || _v === void 0 ? void 0 : _v.type)) === null || _w === void 0 ? void 0 : _w.isFormItem))) return [3 /*break*/, 11];
|
|
82
82
|
_14.label = 5;
|
|
83
83
|
case 5:
|
|
84
84
|
_14.trys.push([5, 9, , 10]);
|
|
85
|
-
return [4 /*yield*/, ((
|
|
85
|
+
return [4 /*yield*/, ((_y = component === null || component === void 0 ? void 0 : (_x = component.props).onValidate) === null || _y === void 0 ? void 0 : _y.call(_x))];
|
|
86
86
|
case 6:
|
|
87
|
-
|
|
88
|
-
if (!
|
|
89
|
-
return [4 /*yield*/, ((
|
|
87
|
+
_a = (_14.sent());
|
|
88
|
+
if (!_a) return [3 /*break*/, 8];
|
|
89
|
+
return [4 /*yield*/, ((_z = component === null || component === void 0 ? void 0 : component.validate) === null || _z === void 0 ? void 0 : _z.call(component))];
|
|
90
90
|
case 7:
|
|
91
|
-
|
|
91
|
+
_a = !(_14.sent());
|
|
92
92
|
_14.label = 8;
|
|
93
93
|
case 8:
|
|
94
|
-
valid =
|
|
94
|
+
valid = _a;
|
|
95
95
|
if (valid) {
|
|
96
|
-
event.setData(createObject(event.data, (
|
|
97
|
-
|
|
96
|
+
event.setData(createObject(event.data, (_c = {},
|
|
97
|
+
_c[action.outputVar || "".concat(action.actionType, "Result")] = {
|
|
98
98
|
error: '',
|
|
99
|
-
value: (
|
|
99
|
+
value: (_1 = (_0 = component === null || component === void 0 ? void 0 : component.props) === null || _0 === void 0 ? void 0 : _0.formItem) === null || _1 === void 0 ? void 0 : _1.value
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
_c)));
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
|
-
event.setData(createObject(event.data, (
|
|
105
|
-
|
|
104
|
+
event.setData(createObject(event.data, (_d = {},
|
|
105
|
+
_d[action.outputVar || "".concat(action.actionType, "Result")] = {
|
|
106
106
|
error: typeof valid === 'string'
|
|
107
107
|
? valid
|
|
108
|
-
: (((
|
|
109
|
-
value: (
|
|
108
|
+
: (((_3 = (_2 = component === null || component === void 0 ? void 0 : component.props) === null || _2 === void 0 ? void 0 : _2.formItem) === null || _3 === void 0 ? void 0 : _3.errors) || []).join(','),
|
|
109
|
+
value: (_5 = (_4 = component === null || component === void 0 ? void 0 : component.props) === null || _4 === void 0 ? void 0 : _4.formItem) === null || _5 === void 0 ? void 0 : _5.value
|
|
110
110
|
},
|
|
111
|
-
|
|
111
|
+
_d)));
|
|
112
112
|
}
|
|
113
113
|
return [3 /*break*/, 10];
|
|
114
114
|
case 9:
|
|
115
115
|
e_1 = _14.sent();
|
|
116
|
-
event.setData(createObject(event.data, (
|
|
117
|
-
|
|
116
|
+
event.setData(createObject(event.data, (_e = {},
|
|
117
|
+
_e[action.outputVar || "".concat(action.actionType, "Result")] = {
|
|
118
118
|
error: e_1.message || '未知错误',
|
|
119
|
-
value: (
|
|
119
|
+
value: (_7 = (_6 = component === null || component === void 0 ? void 0 : component.props) === null || _6 === void 0 ? void 0 : _6.formItem) === null || _7 === void 0 ? void 0 : _7.value
|
|
120
120
|
},
|
|
121
|
-
|
|
121
|
+
_e)));
|
|
122
122
|
return [3 /*break*/, 10];
|
|
123
123
|
case 10: return [2 /*return*/];
|
|
124
124
|
case 11:
|
|
125
125
|
_14.trys.push([11, 13, , 14]);
|
|
126
|
-
return [4 /*yield*/, ((
|
|
126
|
+
return [4 /*yield*/, ((_8 = component === null || component === void 0 ? void 0 : component.doAction) === null || _8 === void 0 ? void 0 : _8.call(component, action, event.data, true, action.args))];
|
|
127
127
|
case 12:
|
|
128
128
|
result = _14.sent();
|
|
129
129
|
if (['validate', 'submit'].includes(action.actionType)) {
|
|
130
|
-
event.setData(createObject(event.data, (
|
|
131
|
-
|
|
130
|
+
event.setData(createObject(event.data, (_f = {},
|
|
131
|
+
_f[action.outputVar || "".concat(action.actionType, "Result")] = {
|
|
132
132
|
error: '',
|
|
133
|
-
payload: (
|
|
133
|
+
payload: (_9 = result === null || result === void 0 ? void 0 : result.__payload) !== null && _9 !== void 0 ? _9 : (_11 = (_10 = component === null || component === void 0 ? void 0 : component.props) === null || _10 === void 0 ? void 0 : _10.store) === null || _11 === void 0 ? void 0 : _11.data,
|
|
134
134
|
responseData: result === null || result === void 0 ? void 0 : result.__response
|
|
135
135
|
},
|
|
136
|
-
|
|
136
|
+
_f)));
|
|
137
137
|
}
|
|
138
138
|
return [2 /*return*/, result];
|
|
139
139
|
case 13:
|
|
140
140
|
e_2 = _14.sent();
|
|
141
|
-
event.setData(createObject(event.data, (
|
|
142
|
-
|
|
141
|
+
event.setData(createObject(event.data, (_g = {},
|
|
142
|
+
_g[action.outputVar || "".concat(action.actionType, "Result")] = {
|
|
143
143
|
error: e_2.message,
|
|
144
144
|
errors: e_2.name === 'ValidateError' ? e_2.detail : e_2,
|
|
145
|
-
payload: (
|
|
145
|
+
payload: (_13 = (_12 = component === null || component === void 0 ? void 0 : component.props) === null || _12 === void 0 ? void 0 : _12.store) === null || _13 === void 0 ? void 0 : _13.data
|
|
146
146
|
},
|
|
147
|
-
|
|
147
|
+
_g)));
|
|
148
148
|
return [3 /*break*/, 14];
|
|
149
149
|
case 14: return [2 /*return*/];
|
|
150
150
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -17,8 +17,8 @@ var CopyAction = /** @class */ (function () {
|
|
|
17
17
|
function CopyAction() {
|
|
18
18
|
}
|
|
19
19
|
CopyAction.prototype.run = function (action, renderer, event) {
|
|
20
|
-
var _a, _b, _c, _d, _e;
|
|
21
20
|
return __awaiter(this, void 0, void 0, function () {
|
|
21
|
+
var _a, _b, _c, _d, _e;
|
|
22
22
|
return __generator(this, function (_f) {
|
|
23
23
|
if (!((_a = event.context.env) === null || _a === void 0 ? void 0 : _a.copy)) {
|
|
24
24
|
throw new Error('env.copy is required!');
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ActionObject } from '../types';
|
|
2
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
|
-
|
|
4
|
+
import { AMISFunction } from '../schema';
|
|
5
|
+
type ScriptType = AMISFunction<(renderer: any, doAction: (action: ActionObject, data: Record<string, any>) => void, event: RendererEvent<any>, action: ListenerAction) => void>;
|
|
5
6
|
export interface ICustomAction extends ListenerAction {
|
|
6
7
|
actionType: 'custom';
|
|
7
8
|
args: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -23,6 +23,7 @@ import 'react-dom';
|
|
|
23
23
|
import '../utils/helper.js';
|
|
24
24
|
import '../utils/errors.js';
|
|
25
25
|
import '../utils/tpl.js';
|
|
26
|
+
import '../theme.js';
|
|
26
27
|
import 'lodash/isObject';
|
|
27
28
|
import 'lodash/isString';
|
|
28
29
|
import 'lodash/isBoolean';
|
|
@@ -39,6 +40,7 @@ import 'lodash/cloneDeep';
|
|
|
39
40
|
import 'lodash/map';
|
|
40
41
|
import 'lodash/isEmpty';
|
|
41
42
|
import 'lodash/kebabCase';
|
|
43
|
+
import 'lodash/some';
|
|
42
44
|
import 'uncontrollable';
|
|
43
45
|
import 'hoist-non-react-statics';
|
|
44
46
|
import '../utils/validations.js';
|
|
@@ -57,9 +59,9 @@ var CustomAction = /** @class */ (function () {
|
|
|
57
59
|
function CustomAction() {
|
|
58
60
|
}
|
|
59
61
|
CustomAction.prototype.run = function (action, renderer, event) {
|
|
60
|
-
var _a, _b;
|
|
61
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
63
|
var scriptFunc, proxy;
|
|
64
|
+
var _a, _b;
|
|
63
65
|
return __generator(this, function (_c) {
|
|
64
66
|
switch (_c.label) {
|
|
65
67
|
case 0:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AMISDialogSchemaBase, AMISLegacyReloadActionButton } from '../schema';
|
|
2
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
4
|
export interface IAlertAction extends ListenerAction {
|
|
5
5
|
actionType: 'alert';
|
|
6
|
-
dialog?:
|
|
6
|
+
dialog?: AMISDialogSchemaBase;
|
|
7
7
|
args: {
|
|
8
8
|
msg: string;
|
|
9
9
|
[propName: string]: any;
|
|
@@ -20,9 +20,9 @@ export interface IConfirmAction extends ListenerAction {
|
|
|
20
20
|
export interface IDialogAction extends ListenerAction {
|
|
21
21
|
actionType: 'dialog';
|
|
22
22
|
args: {
|
|
23
|
-
dialog:
|
|
23
|
+
dialog: AMISDialogSchemaBase;
|
|
24
24
|
};
|
|
25
|
-
dialog?:
|
|
25
|
+
dialog?: AMISDialogSchemaBase;
|
|
26
26
|
/**
|
|
27
27
|
* 是否等待确认结果
|
|
28
28
|
*/
|
|
@@ -34,11 +34,11 @@ export interface IDialogAction extends ListenerAction {
|
|
|
34
34
|
}
|
|
35
35
|
export interface IConfirmDialogAction extends ListenerAction {
|
|
36
36
|
actionType: 'confirmDialog';
|
|
37
|
-
dialog?:
|
|
37
|
+
dialog?: AMISDialogSchemaBase;
|
|
38
38
|
args: {
|
|
39
39
|
msg: string;
|
|
40
40
|
title: string;
|
|
41
|
-
body?:
|
|
41
|
+
body?: AMISLegacyReloadActionButton;
|
|
42
42
|
closeOnEsc?: boolean;
|
|
43
43
|
size?: '' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
44
44
|
confirmText?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -24,6 +24,7 @@ import 'react-dom';
|
|
|
24
24
|
import '../utils/helper.js';
|
|
25
25
|
import '../utils/errors.js';
|
|
26
26
|
import { filter } from '../utils/tpl.js';
|
|
27
|
+
import '../theme.js';
|
|
27
28
|
import 'lodash/isObject';
|
|
28
29
|
import 'lodash/isString';
|
|
29
30
|
import 'lodash/isBoolean';
|
|
@@ -40,6 +41,7 @@ import 'lodash/cloneDeep';
|
|
|
40
41
|
import 'lodash/map';
|
|
41
42
|
import 'lodash/isEmpty';
|
|
42
43
|
import 'lodash/kebabCase';
|
|
44
|
+
import 'lodash/some';
|
|
43
45
|
import 'uncontrollable';
|
|
44
46
|
import 'hoist-non-react-statics';
|
|
45
47
|
import '../utils/validations.js';
|
|
@@ -58,10 +60,10 @@ var DialogAction = /** @class */ (function () {
|
|
|
58
60
|
function DialogAction() {
|
|
59
61
|
}
|
|
60
62
|
DialogAction.prototype.run = function (action, renderer, event) {
|
|
61
|
-
var _a, _b;
|
|
62
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var ret,
|
|
64
|
-
var
|
|
64
|
+
var ret, _a, confirmed, value;
|
|
65
|
+
var _b;
|
|
66
|
+
var _c, _d;
|
|
65
67
|
return __generator(this, function (_e) {
|
|
66
68
|
switch (_e.label) {
|
|
67
69
|
case 0:
|
|
@@ -76,7 +78,7 @@ var DialogAction = /** @class */ (function () {
|
|
|
76
78
|
reload: 'none',
|
|
77
79
|
data: action.rawData
|
|
78
80
|
}, action.data)
|
|
79
|
-
: (
|
|
81
|
+
: (_d = (_c = renderer.props).onAction) === null || _d === void 0 ? void 0 : _d.call(_c, event, {
|
|
80
82
|
actionType: 'dialog',
|
|
81
83
|
dialog: action.dialog,
|
|
82
84
|
reload: 'none',
|
|
@@ -86,13 +88,13 @@ var DialogAction = /** @class */ (function () {
|
|
|
86
88
|
if (!action.waitForAction) return [3 /*break*/, 2];
|
|
87
89
|
return [4 /*yield*/, ret];
|
|
88
90
|
case 1:
|
|
89
|
-
|
|
90
|
-
event.setData(extendObject(event.data, (
|
|
91
|
-
|
|
91
|
+
_a = _e.sent(), confirmed = _a.confirmed, value = _a.value;
|
|
92
|
+
event.setData(extendObject(event.data, (_b = {},
|
|
93
|
+
_b[action.outputVar || 'dialogResponse'] = {
|
|
92
94
|
confirmed: confirmed,
|
|
93
95
|
value: value
|
|
94
96
|
},
|
|
95
|
-
|
|
97
|
+
_b)));
|
|
96
98
|
_e.label = 2;
|
|
97
99
|
case 2: return [2 /*return*/];
|
|
98
100
|
}
|
|
@@ -112,8 +114,8 @@ var CloseDialogAction = /** @class */ (function () {
|
|
|
112
114
|
function CloseDialogAction() {
|
|
113
115
|
}
|
|
114
116
|
CloseDialogAction.prototype.run = function (action, renderer, event) {
|
|
115
|
-
var _a, _b;
|
|
116
117
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var _a, _b;
|
|
117
119
|
return __generator(this, function (_c) {
|
|
118
120
|
// todo 支持 waitForAction,等待弹窗关闭后再执行后续动作
|
|
119
121
|
if (action.componentId) {
|
|
@@ -137,8 +139,8 @@ var AlertAction = /** @class */ (function () {
|
|
|
137
139
|
function AlertAction() {
|
|
138
140
|
}
|
|
139
141
|
AlertAction.prototype.run = function (action, renderer, event) {
|
|
140
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
141
142
|
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
142
144
|
return __generator(this, function (_l) {
|
|
143
145
|
(_b = (_a = event.context.env).alert) === null || _b === void 0 ? void 0 : _b.call(_a, (_d = filter((_c = action.dialog) === null || _c === void 0 ? void 0 : _c.msg, event.data)) !== null && _d !== void 0 ? _d : (_e = action.args) === null || _e === void 0 ? void 0 : _e.msg, (_g = filter((_f = action.dialog) === null || _f === void 0 ? void 0 : _f.title, event.data)) !== null && _g !== void 0 ? _g : (_h = action.args) === null || _h === void 0 ? void 0 : _h.title, (_k = filter((_j = action.dialog) === null || _j === void 0 ? void 0 : _j.className, event.data)) !== null && _k !== void 0 ? _k : '');
|
|
144
146
|
return [2 /*return*/];
|
|
@@ -154,9 +156,9 @@ var ConfirmAction = /** @class */ (function () {
|
|
|
154
156
|
function ConfirmAction() {
|
|
155
157
|
}
|
|
156
158
|
ConfirmAction.prototype.run = function (action, renderer, event) {
|
|
157
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
158
159
|
return __awaiter(this, void 0, void 0, function () {
|
|
159
160
|
var modal, type, confirmed_1, confirmed;
|
|
161
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
160
162
|
return __generator(this, function (_v) {
|
|
161
163
|
switch (_v.label) {
|
|
162
164
|
case 0:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AMISDrawerSchemaBase } from '../schema';
|
|
2
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
4
|
export interface IDrawerAction extends ListenerAction {
|
|
5
5
|
actionType: 'drawer';
|
|
6
6
|
args: {
|
|
7
|
-
drawer:
|
|
7
|
+
drawer: AMISDrawerSchemaBase;
|
|
8
8
|
};
|
|
9
|
-
drawer?:
|
|
9
|
+
drawer?: AMISDrawerSchemaBase;
|
|
10
10
|
/**
|
|
11
11
|
* 是否等待确认结果
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.14.0-beta.
|
|
2
|
+
* amis-core v6.14.0-beta.10
|
|
3
3
|
* Copyright 2018-2025 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -24,6 +24,7 @@ import 'react-dom';
|
|
|
24
24
|
import '../utils/helper.js';
|
|
25
25
|
import '../utils/errors.js';
|
|
26
26
|
import '../utils/tpl.js';
|
|
27
|
+
import '../theme.js';
|
|
27
28
|
import 'lodash/isObject';
|
|
28
29
|
import 'lodash/isString';
|
|
29
30
|
import 'lodash/isBoolean';
|
|
@@ -40,6 +41,7 @@ import 'lodash/cloneDeep';
|
|
|
40
41
|
import 'lodash/map';
|
|
41
42
|
import 'lodash/isEmpty';
|
|
42
43
|
import 'lodash/kebabCase';
|
|
44
|
+
import 'lodash/some';
|
|
43
45
|
import 'uncontrollable';
|
|
44
46
|
import 'hoist-non-react-statics';
|
|
45
47
|
import '../utils/validations.js';
|
|
@@ -58,10 +60,10 @@ var DrawerAction = /** @class */ (function () {
|
|
|
58
60
|
function DrawerAction() {
|
|
59
61
|
}
|
|
60
62
|
DrawerAction.prototype.run = function (action, renderer, event) {
|
|
61
|
-
var _a, _b;
|
|
62
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
-
var ret,
|
|
64
|
-
var
|
|
64
|
+
var ret, _a, confirmed, value;
|
|
65
|
+
var _b;
|
|
66
|
+
var _c, _d;
|
|
65
67
|
return __generator(this, function (_e) {
|
|
66
68
|
switch (_e.label) {
|
|
67
69
|
case 0:
|
|
@@ -76,7 +78,7 @@ var DrawerAction = /** @class */ (function () {
|
|
|
76
78
|
reload: 'none',
|
|
77
79
|
data: action.rawData
|
|
78
80
|
}, action.data)
|
|
79
|
-
: (
|
|
81
|
+
: (_d = (_c = renderer.props).onAction) === null || _d === void 0 ? void 0 : _d.call(_c, event, {
|
|
80
82
|
actionType: 'drawer',
|
|
81
83
|
drawer: action.drawer,
|
|
82
84
|
reload: 'none',
|
|
@@ -86,13 +88,13 @@ var DrawerAction = /** @class */ (function () {
|
|
|
86
88
|
if (!action.waitForAction) return [3 /*break*/, 2];
|
|
87
89
|
return [4 /*yield*/, ret];
|
|
88
90
|
case 1:
|
|
89
|
-
|
|
90
|
-
event.setData(extendObject(event.data, (
|
|
91
|
-
|
|
91
|
+
_a = _e.sent(), confirmed = _a.confirmed, value = _a.value;
|
|
92
|
+
event.setData(extendObject(event.data, (_b = {},
|
|
93
|
+
_b[action.outputVar || 'drawerResponse'] = {
|
|
92
94
|
confirmed: confirmed,
|
|
93
95
|
value: value
|
|
94
96
|
},
|
|
95
|
-
|
|
97
|
+
_b)));
|
|
96
98
|
_e.label = 2;
|
|
97
99
|
case 2: return [2 /*return*/];
|
|
98
100
|
}
|
|
@@ -112,8 +114,8 @@ var CloseDrawerAction = /** @class */ (function () {
|
|
|
112
114
|
function CloseDrawerAction() {
|
|
113
115
|
}
|
|
114
116
|
CloseDrawerAction.prototype.run = function (action, renderer, event) {
|
|
115
|
-
var _a, _b;
|
|
116
117
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
+
var _a, _b;
|
|
117
119
|
return __generator(this, function (_c) {
|
|
118
120
|
if (action.componentId) {
|
|
119
121
|
// 关闭指定抽屉
|