amis-core 6.11.0-beta.0 → 6.11.0-beta.2
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 -0
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +14 -8
- package/esm/SchemaRenderer.d.ts +2 -13
- package/esm/SchemaRenderer.js +36 -72
- package/esm/Scoped.js +1 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.js +1 -1
- package/esm/WithRootStore.d.ts +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.js +1 -1
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +6 -2
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +1 -1
- package/esm/actions/DialogAction.js +1 -1
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.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/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/WaitAction.js +1 -1
- package/esm/components/Animations.d.ts +8 -0
- package/esm/components/Animations.js +158 -0
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.d.ts +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.d.ts +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +1 -1
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +1 -0
- package/esm/factory.js +1 -1
- package/esm/globalVar.d.ts +173 -0
- package/esm/globalVar.js +122 -0
- package/esm/globalVarClientHandler.d.ts +1 -0
- package/esm/globalVarClientHandler.js +65 -0
- package/esm/globalVarDefaultValueHandler.d.ts +1 -0
- package/esm/globalVarDefaultValueHandler.js +28 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +8 -5
- package/esm/locale.d.ts +1 -1
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +3 -1
- package/esm/renderers/Form.js +39 -24
- package/esm/renderers/Item.d.ts +11 -17
- package/esm/renderers/Item.js +17 -2
- package/esm/renderers/Options.js +1 -1
- 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 +1 -1
- package/esm/renderers/wrapControl.js +1 -1
- package/esm/store/app.js +1 -1
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +8 -0
- package/esm/store/crud.js +24 -17
- package/esm/store/form.js +14 -5
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +14 -1
- package/esm/store/list.js +45 -17
- 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.d.ts +14 -0
- package/esm/store/root.js +483 -12
- package/esm/store/service.js +1 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +16 -2
- package/esm/store/table.js +83 -26
- package/esm/store/table2.js +1 -1
- package/esm/theme.d.ts +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +3 -2
- 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/animations.d.ts +4 -0
- package/esm/utils/animations.js +1 -1
- package/esm/utils/api.d.ts +1 -0
- package/esm/utils/api.js +18 -6
- 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 +1 -1
- package/esm/utils/debug.js +1 -1
- 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.js +1 -1
- 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 +5 -0
- package/esm/utils/helper.js +6 -2
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- 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.js +1 -1
- 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/validateId.js +1 -1
- package/esm/utils/validations.js +1 -1
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.d.ts +3 -0
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.d.ts +1 -1
- package/lib/RootRenderer.js +13 -7
- package/lib/SchemaRenderer.d.ts +2 -13
- package/lib/SchemaRenderer.js +35 -71
- package/lib/Scoped.js +1 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.js +1 -1
- package/lib/WithRootStore.d.ts +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/actions/Action.js +1 -1
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +6 -2
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +1 -1
- package/lib/actions/DialogAction.js +1 -1
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.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/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/WaitAction.js +1 -1
- package/lib/components/Animations.d.ts +8 -0
- package/lib/components/Animations.js +172 -0
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.d.ts +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.d.ts +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +1 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +1 -0
- package/lib/factory.js +1 -1
- package/lib/globalVar.d.ts +173 -0
- package/lib/globalVar.js +130 -0
- package/lib/globalVarClientHandler.d.ts +1 -0
- package/lib/globalVarClientHandler.js +67 -0
- package/lib/globalVarDefaultValueHandler.d.ts +1 -0
- package/lib/globalVarDefaultValueHandler.js +30 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +13 -4
- package/lib/locale.d.ts +1 -1
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +3 -1
- package/lib/renderers/Form.js +37 -21
- package/lib/renderers/Item.d.ts +11 -17
- package/lib/renderers/Item.js +17 -2
- package/lib/renderers/Options.js +1 -1
- 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 +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +24 -25
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +8 -0
- package/lib/store/crud.js +23 -16
- package/lib/store/form.d.ts +10 -11
- package/lib/store/form.js +14 -5
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +14 -1
- package/lib/store/list.js +44 -16
- 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.d.ts +13 -0
- package/lib/store/root.js +487 -11
- package/lib/store/service.js +1 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +36 -23
- package/lib/store/table.js +82 -25
- package/lib/store/table2.js +1 -1
- package/lib/theme.d.ts +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +3 -2
- 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/animations.d.ts +4 -0
- package/lib/utils/animations.js +1 -1
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/api.js +18 -5
- 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 +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.js +1 -1
- 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.js +1 -1
- 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 +5 -0
- package/lib/utils/helper.js +6 -2
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- 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.js +1 -1
- 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/validateId.js +1 -1
- package/lib/utils/validations.js +1 -1
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +2 -2
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -10,7 +10,7 @@ import './polyfills.js';
|
|
|
10
10
|
import './renderers/builtin.js';
|
|
11
11
|
import './renderers/register.js';
|
|
12
12
|
import { wrapFetcher } from './utils/api.js';
|
|
13
|
-
export { addApiRequestAdaptor, addApiResponseAdaptor, addApiResponseAdator, buildApi, callStrFunction, clearApiCache, getApiCache, isApiOutdated, isApiOutdatedWithData, isEffectiveApi, isSameApi, isValidApi, jsFetcher, jsonpFetcher, normalizeApi, normalizeApiResponseData, removeApiRequestAdaptor, removeApiResponseAdaptor, responseAdaptor, setApiCache, str2AsyncFunction, str2function, wrapAdaptor, wrapFetcher } from './utils/api.js';
|
|
13
|
+
export { addApiRequestAdaptor, addApiResponseAdaptor, addApiResponseAdator, buildApi, callStrFunction, clearApiCache, getApiCache, isApiOutdated, isApiOutdatedWithData, isEffectiveApi, isSameApi, isValidApi, jsFetcher, jsonpFetcher, normalizeApi, normalizeApiResponseData, removeApiRequestAdaptor, removeApiResponseAdaptor, responseAdaptor, setApiCache, shouldBlockedBySendOnApi, str2AsyncFunction, str2function, wrapAdaptor, wrapFetcher } from './utils/api.js';
|
|
14
14
|
export { attachmentAdpator } from './utils/attachmentAdpator.js';
|
|
15
15
|
export { autobindMethod, bind } from './utils/autobind.js';
|
|
16
16
|
export { chromeVersion, isSafari } from './utils/browser.js';
|
|
@@ -81,6 +81,9 @@ export { default as animation } from './utils/Animation.js';
|
|
|
81
81
|
export { createAnimationStyle } from './utils/animations.js';
|
|
82
82
|
import { RendererStore } from './store/index.js';
|
|
83
83
|
export { RegisterStore, RendererStore, registerStore } from './store/index.js';
|
|
84
|
+
export { buildGlobalVariable, createGlobalVarState, isGlobalVarExpression, observeGlobalVars, registerGlobalVariableHandler } from './globalVar.js';
|
|
85
|
+
import './globalVarClientHandler.js';
|
|
86
|
+
import './globalVarDefaultValueHandler.js';
|
|
84
87
|
import { getEnv } from 'mobx-state-tree';
|
|
85
88
|
import { getDefaultLocale, makeTranslator } from './locale.js';
|
|
86
89
|
export { extendLocale, getDefaultLocale, localeable, makeTranslator, register as registerLocale, removeLocaleData, setDefaultLocale } from './locale.js';
|
|
@@ -151,10 +154,10 @@ export { StoreNode } from './store/node.js';
|
|
|
151
154
|
*/
|
|
152
155
|
var classPrefix = getClassPrefix();
|
|
153
156
|
// @ts-ignore
|
|
154
|
-
var version = '6.11.0-beta.
|
|
157
|
+
var version = '6.11.0-beta.2';
|
|
155
158
|
window.amisVersionInfo = {
|
|
156
|
-
version: '6.11.0-beta.
|
|
157
|
-
buildTime: '2024-12-
|
|
159
|
+
version: '6.11.0-beta.2',
|
|
160
|
+
buildTime: '2024-12-24T03:28:24.148Z'
|
|
158
161
|
};
|
|
159
162
|
function render(schema, props, options, pathPrefix) {
|
|
160
163
|
if (props === void 0) { props = {}; }
|
package/esm/locale.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare function localeable<T extends React.ComponentType<React.Component
|
|
|
73
73
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
|
74
74
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
75
75
|
};
|
|
76
|
-
displayName:
|
|
76
|
+
displayName: string;
|
|
77
77
|
contextType: React.Context<string>;
|
|
78
78
|
ComposedComponent: React.ComponentType<T>;
|
|
79
79
|
} & hoistNonReactStatic.NonReactStatics<T, {}> & {
|
package/esm/locale.js
CHANGED
package/esm/polyfills.js
CHANGED
package/esm/renderers/Form.d.ts
CHANGED
|
@@ -381,7 +381,7 @@ export default class Form extends React.Component<FormProps, object> {
|
|
|
381
381
|
renderBody(): React.JSX.Element;
|
|
382
382
|
render(): JSX.Element;
|
|
383
383
|
}
|
|
384
|
-
export declare class
|
|
384
|
+
export declare class FormRendererBase extends Form {
|
|
385
385
|
static contextType: React.Context<IScopedContext>;
|
|
386
386
|
constructor(props: FormProps, context: IScopedContext);
|
|
387
387
|
componentDidMount(): void;
|
|
@@ -397,3 +397,5 @@ export declare class FormRenderer extends Form {
|
|
|
397
397
|
setData(values: object, replace?: boolean): void;
|
|
398
398
|
getData(): any;
|
|
399
399
|
}
|
|
400
|
+
export declare class FormRenderer extends FormRendererBase {
|
|
401
|
+
}
|
package/esm/renderers/Form.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { __extends, __awaiter, __generator, __assign, __values, __decorate
|
|
6
|
+
import { __extends, __awaiter, __generator, __assign, __values, __decorate } from 'tslib';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Renderer } from '../factory.js';
|
|
9
9
|
import { FormStore } from '../store/form.js';
|
|
@@ -21,7 +21,7 @@ import '../utils/memoryParse.js';
|
|
|
21
21
|
import '@rc-component/mini-decimal';
|
|
22
22
|
import { dataMapping } from '../utils/dataMapping.js';
|
|
23
23
|
import '../utils/filter.js';
|
|
24
|
-
import { isEffectiveApi, isApiOutdated } from '../utils/api.js';
|
|
24
|
+
import { isEffectiveApi, isApiOutdated, shouldBlockedBySendOnApi } from '../utils/api.js';
|
|
25
25
|
import themedLazyComponent from '../components/LazyComponent.js';
|
|
26
26
|
import { isAlive } from 'mobx-state-tree';
|
|
27
27
|
import '../utils/browser.js';
|
|
@@ -750,7 +750,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
750
750
|
_b.label = 2;
|
|
751
751
|
case 2:
|
|
752
752
|
// 走到这里代表校验成功了
|
|
753
|
-
dispatchEvent_2('validateSucc', this.props.data);
|
|
753
|
+
dispatchEvent_2('validateSucc', createObject(this.props.data, values));
|
|
754
754
|
if (target) {
|
|
755
755
|
this.submitToTarget(filterTarget(target, values), values);
|
|
756
756
|
/** 可能配置页面跳转事件,页面路由变化导致persistKey不一致,无法清除持久化数据,所以提交成功事件之前先清理一下 */
|
|
@@ -868,6 +868,10 @@ var Form = /** @class */ (function (_super) {
|
|
|
868
868
|
});
|
|
869
869
|
}); })];
|
|
870
870
|
}
|
|
871
|
+
else if (shouldBlockedBySendOnApi(action.api || api, values)) {
|
|
872
|
+
// api存在,但是不满足sendOn时,走这里,不派发submitSucc事件
|
|
873
|
+
return [2 /*return*/];
|
|
874
|
+
}
|
|
871
875
|
else {
|
|
872
876
|
clearPersistDataAfterSubmit && store.clearLocalPersistData();
|
|
873
877
|
// type为submit,但是没有配api以及target时,只派发事件
|
|
@@ -1476,15 +1480,15 @@ var Form = /** @class */ (function (_super) {
|
|
|
1476
1480
|
];
|
|
1477
1481
|
return Form;
|
|
1478
1482
|
}(React.Component));
|
|
1479
|
-
var
|
|
1480
|
-
__extends(
|
|
1481
|
-
function
|
|
1483
|
+
var FormRendererBase = /** @class */ (function (_super) {
|
|
1484
|
+
__extends(FormRendererBase, _super);
|
|
1485
|
+
function FormRendererBase(props, context) {
|
|
1482
1486
|
var _this = _super.call(this, props) || this;
|
|
1483
1487
|
var scoped = context;
|
|
1484
1488
|
scoped.registerComponent(_this);
|
|
1485
1489
|
return _this;
|
|
1486
1490
|
}
|
|
1487
|
-
|
|
1491
|
+
FormRendererBase.prototype.componentDidMount = function () {
|
|
1488
1492
|
_super.prototype.componentDidMount.call(this);
|
|
1489
1493
|
if (this.props.autoFocus) {
|
|
1490
1494
|
var scoped = this.context;
|
|
@@ -1493,17 +1497,17 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1493
1497
|
focuableInput_1 && setTimeout(function () { return focuableInput_1.focus(); }, 200);
|
|
1494
1498
|
}
|
|
1495
1499
|
};
|
|
1496
|
-
|
|
1500
|
+
FormRendererBase.prototype.componentWillUnmount = function () {
|
|
1497
1501
|
var scoped = this.context;
|
|
1498
1502
|
scoped.unRegisterComponent(this);
|
|
1499
1503
|
_super.prototype.componentWillUnmount.call(this);
|
|
1500
1504
|
};
|
|
1501
|
-
|
|
1505
|
+
FormRendererBase.prototype.doAction = function (action, data, throwErrors) {
|
|
1502
1506
|
if (data === void 0) { data = this.props.store.data; }
|
|
1503
1507
|
if (throwErrors === void 0) { throwErrors = false; }
|
|
1504
1508
|
return this.handleAction(undefined, action, data, throwErrors);
|
|
1505
1509
|
};
|
|
1506
|
-
|
|
1510
|
+
FormRendererBase.prototype.handleAction = function (e, action, ctx, throwErrors, delegate) {
|
|
1507
1511
|
if (throwErrors === void 0) { throwErrors = false; }
|
|
1508
1512
|
return __awaiter(this, void 0, void 0, function () {
|
|
1509
1513
|
var scoped_1;
|
|
@@ -1521,13 +1525,16 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1521
1525
|
target.doAction(__assign(__assign({}, action), { target: undefined }), ctx, throwErrors));
|
|
1522
1526
|
}))];
|
|
1523
1527
|
}
|
|
1528
|
+
else if (action.actionType === 'clearError') {
|
|
1529
|
+
return [2 /*return*/, _super.prototype.clearErrors.call(this)];
|
|
1530
|
+
}
|
|
1524
1531
|
else {
|
|
1525
1532
|
return [2 /*return*/, _super.prototype.handleAction.call(this, e, action, ctx, throwErrors, delegate)];
|
|
1526
1533
|
}
|
|
1527
1534
|
});
|
|
1528
1535
|
});
|
|
1529
1536
|
};
|
|
1530
|
-
|
|
1537
|
+
FormRendererBase.prototype.handleDialogConfirm = function (values, action, ctx, targets) {
|
|
1531
1538
|
_super.prototype.handleDialogConfirm.call(this, values, action, ctx, targets);
|
|
1532
1539
|
var store = this.props.store;
|
|
1533
1540
|
var scoped = this.context;
|
|
@@ -1538,19 +1545,19 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1538
1545
|
scoped.reload(store.action.reload, ctx);
|
|
1539
1546
|
}
|
|
1540
1547
|
};
|
|
1541
|
-
|
|
1548
|
+
FormRendererBase.prototype.submitToTarget = function (target, values) {
|
|
1542
1549
|
var scoped = this.context;
|
|
1543
1550
|
scoped.send(target, values);
|
|
1544
1551
|
};
|
|
1545
|
-
|
|
1552
|
+
FormRendererBase.prototype.reloadTarget = function (target, data) {
|
|
1546
1553
|
var scoped = this.context;
|
|
1547
1554
|
scoped.reload(target, data);
|
|
1548
1555
|
};
|
|
1549
|
-
|
|
1556
|
+
FormRendererBase.prototype.closeTarget = function (target) {
|
|
1550
1557
|
var scoped = this.context;
|
|
1551
1558
|
scoped.close(target);
|
|
1552
1559
|
};
|
|
1553
|
-
|
|
1560
|
+
FormRendererBase.prototype.reload = function (target, query, ctx, silent, replace) {
|
|
1554
1561
|
return __awaiter(this, void 0, void 0, function () {
|
|
1555
1562
|
var scoped, subPath, idx, subQuery, idx2, component, components;
|
|
1556
1563
|
return __generator(this, function (_a) {
|
|
@@ -1592,7 +1599,7 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1592
1599
|
});
|
|
1593
1600
|
});
|
|
1594
1601
|
};
|
|
1595
|
-
|
|
1602
|
+
FormRendererBase.prototype.receive = function (values, name, replace) {
|
|
1596
1603
|
return __awaiter(this, void 0, void 0, function () {
|
|
1597
1604
|
var scoped, idx, subPath, component;
|
|
1598
1605
|
return __generator(this, function (_a) {
|
|
@@ -1612,17 +1619,25 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1612
1619
|
});
|
|
1613
1620
|
});
|
|
1614
1621
|
};
|
|
1615
|
-
|
|
1622
|
+
FormRendererBase.prototype.setData = function (values, replace) {
|
|
1616
1623
|
var _a = this.props, onChange = _a.onChange, store = _a.store;
|
|
1617
1624
|
_super.prototype.setValues.call(this, values, replace);
|
|
1618
1625
|
// 触发表单change
|
|
1619
1626
|
onChange &&
|
|
1620
1627
|
onChange(store.data, difference(store.data, store.pristine), this.props);
|
|
1621
1628
|
};
|
|
1622
|
-
|
|
1629
|
+
FormRendererBase.prototype.getData = function () {
|
|
1623
1630
|
return this.getValues();
|
|
1624
1631
|
};
|
|
1625
|
-
|
|
1632
|
+
FormRendererBase.contextType = ScopedContext;
|
|
1633
|
+
return FormRendererBase;
|
|
1634
|
+
}(Form));
|
|
1635
|
+
var FormRenderer = /** @class */ (function (_super) {
|
|
1636
|
+
__extends(FormRenderer, _super);
|
|
1637
|
+
// 装饰器装饰后的类无法继承父类上的方法,所以多包了一层FormRendererBase用来继承
|
|
1638
|
+
function FormRenderer() {
|
|
1639
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1640
|
+
}
|
|
1626
1641
|
FormRenderer = __decorate([
|
|
1627
1642
|
Renderer({
|
|
1628
1643
|
type: 'form',
|
|
@@ -1641,10 +1656,10 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1641
1656
|
}
|
|
1642
1657
|
return undefined;
|
|
1643
1658
|
}
|
|
1644
|
-
})
|
|
1645
|
-
|
|
1659
|
+
})
|
|
1660
|
+
// 装饰器装饰后的类无法继承父类上的方法,所以多包了一层FormRendererBase用来继承
|
|
1646
1661
|
], FormRenderer);
|
|
1647
1662
|
return FormRenderer;
|
|
1648
|
-
}(
|
|
1663
|
+
}(FormRendererBase));
|
|
1649
1664
|
|
|
1650
|
-
export { FormRenderer, Form as default };
|
|
1665
|
+
export { FormRenderer, FormRendererBase, Form as default };
|
package/esm/renderers/Item.d.ts
CHANGED
|
@@ -639,7 +639,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
639
639
|
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
640
640
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
641
641
|
};
|
|
642
|
-
displayName:
|
|
642
|
+
displayName: string;
|
|
643
643
|
contextType: React.Context<{
|
|
644
644
|
storeType: string;
|
|
645
645
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
@@ -726,12 +726,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
726
726
|
} & {
|
|
727
727
|
addStore(store: {
|
|
728
728
|
[propName: string]: any;
|
|
729
|
-
storeType: string;
|
|
730
|
-
* 不设置时,当表单提交过后表单项每次修改都会触发重新验证,
|
|
731
|
-
* 如果设置了,则由此配置项来决定要不要每次修改都触发验证。
|
|
732
|
-
*/
|
|
729
|
+
storeType: string;
|
|
733
730
|
id: string;
|
|
734
|
-
path: string;
|
|
731
|
+
path: string; /**
|
|
732
|
+
* 是否只读
|
|
733
|
+
*/
|
|
735
734
|
parentId?: string | undefined;
|
|
736
735
|
}): {
|
|
737
736
|
id: string;
|
|
@@ -806,9 +805,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
806
805
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
807
806
|
addChildId: (id: string) => void;
|
|
808
807
|
removeChildId: (id: string) => void;
|
|
809
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
810
|
-
* 配置 input className
|
|
811
|
-
*/
|
|
808
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
812
809
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
813
810
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
814
811
|
}, {
|
|
@@ -895,12 +892,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
895
892
|
} & {
|
|
896
893
|
addStore(store: {
|
|
897
894
|
[propName: string]: any;
|
|
898
|
-
storeType: string;
|
|
899
|
-
* 不设置时,当表单提交过后表单项每次修改都会触发重新验证,
|
|
900
|
-
* 如果设置了,则由此配置项来决定要不要每次修改都触发验证。
|
|
901
|
-
*/
|
|
895
|
+
storeType: string;
|
|
902
896
|
id: string;
|
|
903
|
-
path: string;
|
|
897
|
+
path: string; /**
|
|
898
|
+
* 是否只读
|
|
899
|
+
*/
|
|
904
900
|
parentId?: string | undefined;
|
|
905
901
|
}): {
|
|
906
902
|
id: string;
|
|
@@ -975,9 +971,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
975
971
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
976
972
|
addChildId: (id: string) => void;
|
|
977
973
|
removeChildId: (id: string) => void;
|
|
978
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
979
|
-
* 配置 input className
|
|
980
|
-
*/
|
|
974
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
981
975
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
982
976
|
ComposedComponent: React.ComponentType<any>;
|
|
983
977
|
} & hoistNonReactStatic.NonReactStatics<any, {}> & {
|
package/esm/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,6 +8,8 @@ import React from 'react';
|
|
|
8
8
|
import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
9
9
|
import { reaction } from 'mobx';
|
|
10
10
|
import { isAlive } from 'mobx-state-tree';
|
|
11
|
+
import { isGlobalVarExpression } from '../globalVar.js';
|
|
12
|
+
import { resolveVariableAndFilter } from '../utils/resolveVariableAndFilter.js';
|
|
11
13
|
import { registerRenderer, renderersMap } from '../factory.js';
|
|
12
14
|
import { isEmpty, getTreeAncestors, ucFirst, getWidthRate, autobind, anyChanged } from '../utils/helper.js';
|
|
13
15
|
import { observer } from 'mobx-react';
|
|
@@ -1099,7 +1101,20 @@ function asFormItem(config) {
|
|
|
1099
1101
|
}
|
|
1100
1102
|
function registerFormItem(config) {
|
|
1101
1103
|
var Control = asFormItem(config)(config.component);
|
|
1102
|
-
return registerRenderer(__assign(__assign({}, config), { weight: typeof config.weight !== 'undefined' ? config.weight : -100, component: Control, isFormItem: true
|
|
1104
|
+
return registerRenderer(__assign(__assign({}, config), { weight: typeof config.weight !== 'undefined' ? config.weight : -100, component: Control, isFormItem: true, onGlobalVarChanged: function (instance, schema, data) {
|
|
1105
|
+
var _a, _b, _c;
|
|
1106
|
+
if (((_a = config.onGlobalVarChanged) === null || _a === void 0 ? void 0 : _a.apply(this, arguments)) === false) {
|
|
1107
|
+
return false;
|
|
1108
|
+
}
|
|
1109
|
+
if (isGlobalVarExpression(schema.source)) {
|
|
1110
|
+
(_c = (_b = instance.props).reloadOptions) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
1111
|
+
}
|
|
1112
|
+
// 目前表单项的全局变量更新要靠这个方式
|
|
1113
|
+
if (isGlobalVarExpression(schema.value)) {
|
|
1114
|
+
instance.props.onChange(resolveVariableAndFilter(schema.value, data, '| raw'));
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
} }));
|
|
1103
1118
|
}
|
|
1104
1119
|
function FormItem(config) {
|
|
1105
1120
|
return function (component) {
|
package/esm/renderers/Options.js
CHANGED
package/esm/renderers/builtin.js
CHANGED
|
@@ -77,7 +77,7 @@ export declare function wrapControl<T extends React.ComponentType<React.Componen
|
|
|
77
77
|
componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
78
78
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<any, "rootStore">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
79
79
|
};
|
|
80
|
-
displayName:
|
|
80
|
+
displayName: string;
|
|
81
81
|
contextType: React.Context<{
|
|
82
82
|
storeType: string;
|
|
83
83
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
package/esm/store/app.js
CHANGED
package/esm/store/combo.js
CHANGED
package/esm/store/crud.d.ts
CHANGED
|
@@ -111,10 +111,17 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
111
111
|
readonly mergedData: any;
|
|
112
112
|
readonly hasModalOpened: boolean;
|
|
113
113
|
readonly selectedItemsAsArray: any[];
|
|
114
|
+
readonly itemsAsArray: any[];
|
|
114
115
|
fetchCtxOf(data: any, options: {
|
|
115
116
|
pageField?: string;
|
|
116
117
|
perPageField?: string;
|
|
117
118
|
}): object;
|
|
119
|
+
readonly eventContext: {
|
|
120
|
+
items: any[];
|
|
121
|
+
selectedItems: any[];
|
|
122
|
+
unSelectedItems: any[];
|
|
123
|
+
selectedIndexes: string[];
|
|
124
|
+
};
|
|
118
125
|
} & {
|
|
119
126
|
getData: (superData: any) => any;
|
|
120
127
|
updateSelectData: (selected: Array<any>, unSelected: Array<any>) => void;
|
|
@@ -155,6 +162,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
155
162
|
updateColumns: (columns: Array<any>) => void;
|
|
156
163
|
updateTotal: (total: number) => void;
|
|
157
164
|
resetSelection: () => void;
|
|
165
|
+
replaceItems(items: Array<any>): void;
|
|
158
166
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
159
167
|
export type ICRUDStore = Instance<typeof CRUDStore>;
|
|
160
168
|
export {};
|
package/esm/store/crud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { __extends, __assign, __generator, __rest, __values, __awaiter } from 't
|
|
|
7
7
|
import { saveAs } from 'file-saver';
|
|
8
8
|
import { types, flow, getEnv, isAlive } from 'mobx-state-tree';
|
|
9
9
|
import { ServiceStore } from './service.js';
|
|
10
|
-
import { applyFilters, sortArray, isEmpty, isObjectShallowModified, qsstringify } from '../utils/helper.js';
|
|
10
|
+
import { findTreeIndex, applyFilters, sortArray, isEmpty, isObjectShallowModified, qsstringify } from '../utils/helper.js';
|
|
11
11
|
import pick from 'lodash/pick';
|
|
12
12
|
import 'amis-formula';
|
|
13
13
|
import 'moment';
|
|
@@ -61,14 +61,10 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
61
61
|
// 包两层,主要是为了处理以下 case
|
|
62
62
|
// 里面放了个 form,form 提交过来的时候不希望把 items 这些发送过来。
|
|
63
63
|
// 因为会把数据呈现在地址栏上。
|
|
64
|
-
return createObject(createObject(self.data, {
|
|
65
|
-
items: self.items.concat(),
|
|
66
|
-
selectedItems: self.selectedItems.concat(),
|
|
67
|
-
unSelectedItems: self.unSelectedItems.concat()
|
|
68
|
-
}), __assign({}, self.query));
|
|
64
|
+
return createObject(createObject(self.data, this.eventContext), __assign({}, self.query));
|
|
69
65
|
},
|
|
70
66
|
get mergedData() {
|
|
71
|
-
return extendObject(self.data, __assign(__assign(__assign({}, self.query),
|
|
67
|
+
return extendObject(self.data, __assign(__assign(__assign({}, self.query), this.eventContext), self.data));
|
|
72
68
|
},
|
|
73
69
|
get hasModalOpened() {
|
|
74
70
|
return self.dialogOpen || self.drawerOpen || self.hasInnerModalOpen;
|
|
@@ -76,9 +72,24 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
76
72
|
get selectedItemsAsArray() {
|
|
77
73
|
return self.selectedItems.concat();
|
|
78
74
|
},
|
|
75
|
+
get itemsAsArray() {
|
|
76
|
+
return self.items.concat();
|
|
77
|
+
},
|
|
79
78
|
fetchCtxOf: function (data, options) {
|
|
80
79
|
var _a;
|
|
81
80
|
return createObject(data, __assign(__assign(__assign({}, self.query), (_a = {}, _a[options.pageField || 'page'] = self.page, _a[options.perPageField || 'perPage'] = self.perPage, _a)), data));
|
|
81
|
+
},
|
|
82
|
+
get eventContext() {
|
|
83
|
+
var context = {
|
|
84
|
+
items: self.items.concat(),
|
|
85
|
+
selectedItems: self.selectedItems.concat(),
|
|
86
|
+
unSelectedItems: self.unSelectedItems.concat(),
|
|
87
|
+
selectedIndexes: self.selectedItems.map(function (item) {
|
|
88
|
+
var _a;
|
|
89
|
+
return ((_a = findTreeIndex(self.items, function (i) { return (item.__pristine || item) === (i.__pristine || i); })) === null || _a === void 0 ? void 0 : _a.join('.')) || '-1';
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
return context;
|
|
82
93
|
}
|
|
83
94
|
}); })
|
|
84
95
|
.actions(function (self) {
|
|
@@ -494,14 +505,7 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
494
505
|
});
|
|
495
506
|
};
|
|
496
507
|
var getData = function (superData) {
|
|
497
|
-
return createObject(superData, {
|
|
498
|
-
total: self.total,
|
|
499
|
-
page: self.page,
|
|
500
|
-
perPage: self.perPage,
|
|
501
|
-
items: self.items.concat(),
|
|
502
|
-
selectedItems: self.selectedItems.concat(),
|
|
503
|
-
unSelectedItems: self.unSelectedItems.concat()
|
|
504
|
-
});
|
|
508
|
+
return createObject(superData, __assign({ total: self.total, page: self.page, perPage: self.perPage }, self.eventContext));
|
|
505
509
|
};
|
|
506
510
|
var updateColumns = function (columns) {
|
|
507
511
|
self.columns = columns;
|
|
@@ -540,7 +544,10 @@ var CRUDStore = ServiceStore.named('CRUDStore')
|
|
|
540
544
|
exportAsCSV: exportAsCSV,
|
|
541
545
|
updateColumns: updateColumns,
|
|
542
546
|
updateTotal: updateTotal,
|
|
543
|
-
resetSelection: resetSelection
|
|
547
|
+
resetSelection: resetSelection,
|
|
548
|
+
replaceItems: function (items) {
|
|
549
|
+
self.items.replace(items);
|
|
550
|
+
}
|
|
544
551
|
};
|
|
545
552
|
});
|
|
546
553
|
|
package/esm/store/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.11.0-beta.
|
|
2
|
+
* amis-core v6.11.0-beta.2
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -439,9 +439,11 @@ var FormStore = ServiceStore.named('FormStore')
|
|
|
439
439
|
}, [self]);
|
|
440
440
|
};
|
|
441
441
|
// 10s 内不要重复弹同一个错误
|
|
442
|
-
var toastValidateError = throttle(function (msg) {
|
|
442
|
+
var toastValidateError = throttle(function (msg, validateError) {
|
|
443
443
|
var env = getEnv(self);
|
|
444
|
-
env.notify('error', msg
|
|
444
|
+
env.notify('error', msg, {
|
|
445
|
+
validateError: validateError
|
|
446
|
+
});
|
|
445
447
|
}, 10000, {
|
|
446
448
|
trailing: false,
|
|
447
449
|
leading: true
|
|
@@ -478,7 +480,7 @@ var FormStore = ServiceStore.named('FormStore')
|
|
|
478
480
|
});
|
|
479
481
|
});
|
|
480
482
|
var validate = flow(function validate(hooks, forceValidate, throwErrors, failedMessage, validateErrCb) {
|
|
481
|
-
var items, i, len, item, i, len, msg, e_2, msg, dispatcher;
|
|
483
|
+
var items, i, len, item, i, len, msg, e_2, msg, dispatcher, validateError;
|
|
482
484
|
return __generator(this, function (_a) {
|
|
483
485
|
switch (_a.label) {
|
|
484
486
|
case 0:
|
|
@@ -567,7 +569,14 @@ var FormStore = ServiceStore.named('FormStore')
|
|
|
567
569
|
_a.label = 12;
|
|
568
570
|
case 12:
|
|
569
571
|
if (!(dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented)) {
|
|
570
|
-
|
|
572
|
+
validateError = new ValidateError(failedMessage || self.__('Form.validateFailed'), self.errors, {
|
|
573
|
+
items: self.items,
|
|
574
|
+
msg: {
|
|
575
|
+
customMsg: failedMessage,
|
|
576
|
+
defaultMsg: self.__('Form.validateFailed')
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
msg && toastValidateError(msg, validateError);
|
|
571
580
|
}
|
|
572
581
|
_a.label = 13;
|
|
573
582
|
case 13:
|
package/esm/store/formItem.js
CHANGED
package/esm/store/iRenderer.js
CHANGED
package/esm/store/index.js
CHANGED
package/esm/store/list.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export declare const ListStore: import("mobx-state-tree").IModelType<{
|
|
|
62
62
|
reset(): void;
|
|
63
63
|
updateData({ children, ...rest }: any): void;
|
|
64
64
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
65
|
+
fullItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
66
|
+
fullSelectedItems: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<any, any, any>>, [undefined]>;
|
|
65
67
|
selectedItems: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IModelType<{
|
|
66
68
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
67
69
|
id: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -282,10 +284,21 @@ export declare const ListStore: import("mobx-state-tree").IModelType<{
|
|
|
282
284
|
reset(): void;
|
|
283
285
|
updateData({ children, ...rest }: any): void;
|
|
284
286
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>)[];
|
|
287
|
+
/**
|
|
288
|
+
* 构建事件的上下文数据
|
|
289
|
+
* @param buildChain
|
|
290
|
+
* @returns
|
|
291
|
+
*/
|
|
292
|
+
readonly eventContext: {
|
|
293
|
+
selectedItems: any[];
|
|
294
|
+
selectedIndexes: number[];
|
|
295
|
+
items: any[];
|
|
296
|
+
unSelectedItems: any[];
|
|
297
|
+
};
|
|
285
298
|
} & {
|
|
286
299
|
getData: (superData: any) => any;
|
|
287
300
|
update: (config: Partial<SListStore>) => void;
|
|
288
|
-
initItems: (items: Array<object>) => void;
|
|
301
|
+
initItems: (items: Array<object>, fullItems?: Array<any>, fullSelectedItems?: Array<any>) => void;
|
|
289
302
|
updateSelected: (selected: Array<any>, valueField?: string) => void;
|
|
290
303
|
toggleAll: () => void;
|
|
291
304
|
clearAll: () => void;
|