amis-core 2.3.1 → 2.4.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.js +1 -1
- package/esm/SchemaRenderer.js +10 -3
- package/esm/Scoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/_virtual/index.js +1 -1
- package/esm/actions/Action.d.ts +2 -1
- package/esm/actions/Action.js +90 -19
- package/esm/actions/AjaxAction.js +2 -3
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.d.ts +4 -1
- package/esm/actions/BroadcastAction.js +8 -8
- package/esm/actions/CmptAction.d.ts +1 -1
- package/esm/actions/CmptAction.js +5 -2
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.d.ts +6 -1
- package/esm/actions/CustomAction.js +7 -7
- package/esm/actions/DialogAction.d.ts +4 -1
- package/esm/actions/DialogAction.js +9 -5
- package/esm/actions/DrawerAction.d.ts +4 -1
- package/esm/actions/DrawerAction.js +9 -5
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/LinkAction.js +5 -6
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/index.d.ts +0 -2
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +3 -2
- package/esm/components/PopOver.js +2 -3
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +1 -1
- package/esm/factory.js +2 -2
- package/esm/index.d.ts +20 -9
- package/esm/index.js +6 -4
- package/esm/locale.js +1 -1
- package/esm/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/esm/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/esm/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/esm/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/esm/node_modules/dom-helpers/esm/contains.js +1 -1
- package/esm/node_modules/dom-helpers/esm/listen.js +1 -1
- package/esm/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/esm/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/esm/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
- package/esm/node_modules/prop-types/index.js +4 -13
- package/esm/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
- package/esm/node_modules/react-overlays/esm/Portal.js +1 -1
- package/esm/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/esm/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/esm/node_modules/react-overlays/esm/useRootClose.js +1 -3
- package/esm/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/esm/renderers/Form.d.ts +7 -1
- package/esm/renderers/Form.js +17 -6
- package/esm/renderers/Item.d.ts +6 -6
- package/esm/renderers/Item.js +24 -16
- package/esm/renderers/Options.d.ts +1 -1
- package/esm/renderers/Options.js +28 -7
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +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.js +1 -1
- package/esm/store/form.js +2 -2
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.d.ts +26 -13
- package/esm/store/index.js +2 -2
- 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.d.ts +2 -0
- package/esm/store/root.js +10 -4
- package/esm/store/service.js +1 -1
- package/esm/store/table.d.ts +6 -6
- package/esm/store/table.js +3 -11
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +27 -0
- 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 +1 -1
- package/esm/utils/api.js +17 -5
- 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 +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.d.ts +5 -0
- package/esm/utils/decodeEntity.js +16 -0
- 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 +7 -5
- 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.js +6 -1
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +5 -1
- package/esm/utils/icon.js +11 -1
- 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/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/renderer-event.d.ts +7 -0
- package/esm/utils/renderer-event.js +15 -3
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.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.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 +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.js +10 -3
- package/lib/Scoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/_virtual/index.js +1 -1
- package/lib/actions/Action.d.ts +2 -1
- package/lib/actions/Action.js +94 -19
- package/lib/actions/AjaxAction.js +2 -7
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.d.ts +4 -1
- package/lib/actions/BroadcastAction.js +8 -8
- package/lib/actions/CmptAction.d.ts +1 -1
- package/lib/actions/CmptAction.js +5 -2
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.d.ts +6 -1
- package/lib/actions/CustomAction.js +7 -7
- package/lib/actions/DialogAction.d.ts +4 -1
- package/lib/actions/DialogAction.js +9 -5
- package/lib/actions/DrawerAction.d.ts +4 -1
- package/lib/actions/DrawerAction.js +9 -5
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/LinkAction.js +5 -10
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/index.d.ts +0 -2
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +3 -2
- package/lib/components/PopOver.js +2 -3
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +1 -1
- package/lib/factory.js +2 -2
- package/lib/index.d.ts +20 -9
- package/lib/index.js +7 -4
- package/lib/locale.js +1 -1
- package/lib/node_modules/@restart/hooks/esm/useCommittedRef.js +1 -1
- package/lib/node_modules/@restart/hooks/esm/useEventCallback.js +1 -1
- package/lib/node_modules/dom-helpers/esm/addEventListener.js +1 -1
- package/lib/node_modules/dom-helpers/esm/canUseDOM.js +1 -1
- package/lib/node_modules/dom-helpers/esm/contains.js +1 -1
- package/lib/node_modules/dom-helpers/esm/listen.js +1 -1
- package/lib/node_modules/dom-helpers/esm/ownerDocument.js +1 -1
- package/lib/node_modules/dom-helpers/esm/removeEventListener.js +1 -1
- package/lib/node_modules/prop-types/factoryWithThrowingShims.js +51 -60
- package/lib/node_modules/prop-types/index.js +3 -12
- package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +4 -13
- package/lib/node_modules/react-overlays/esm/Portal.js +1 -1
- package/lib/node_modules/react-overlays/esm/ownerDocument.js +1 -1
- package/lib/node_modules/react-overlays/esm/safeFindDOMNode.js +1 -1
- package/lib/node_modules/react-overlays/esm/useRootClose.js +1 -3
- package/lib/node_modules/react-overlays/esm/useWaitForDOMRef.js +1 -1
- package/lib/renderers/Form.d.ts +7 -1
- package/lib/renderers/Form.js +17 -6
- package/lib/renderers/Item.d.ts +6 -6
- package/lib/renderers/Item.js +24 -16
- package/lib/renderers/Options.d.ts +1 -1
- package/lib/renderers/Options.js +30 -9
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/wrapControl.js +1 -1
- package/lib/store/app.js +1 -1
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.js +2 -2
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.d.ts +26 -13
- package/lib/store/index.js +2 -2
- 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.d.ts +2 -0
- package/lib/store/root.js +9 -3
- package/lib/store/service.js +1 -1
- package/lib/store/table.d.ts +6 -6
- package/lib/store/table.js +3 -11
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +27 -0
- 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 +1 -1
- package/lib/utils/api.js +16 -4
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.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.d.ts +5 -0
- package/lib/utils/decodeEntity.js +20 -0
- 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 +7 -5
- 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.js +6 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.d.ts +5 -1
- package/lib/utils/icon.js +11 -1
- 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/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/renderer-event.d.ts +7 -0
- package/lib/utils/renderer-event.js +14 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.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.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 +4 -3
- package/esm/_virtual/index2.js +0 -8
- package/esm/_virtual/react-is.development.js +0 -8
- package/esm/_virtual/react-is.production.min.js +0 -8
- package/esm/actions/Decorators.d.ts +0 -25
- package/esm/actions/Decorators.js +0 -83
- package/esm/node_modules/object-assign/index.js +0 -104
- package/esm/node_modules/prop-types/checkPropTypes.js +0 -120
- package/esm/node_modules/prop-types/factoryWithTypeCheckers.js +0 -630
- package/esm/node_modules/prop-types/lib/has.js +0 -16
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -195
- package/esm/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -31
- package/esm/node_modules/prop-types/node_modules/react-is/index.js +0 -26
- package/esm/node_modules/warning/warning.js +0 -67
- package/lib/_virtual/index2.js +0 -12
- package/lib/_virtual/react-is.development.js +0 -12
- package/lib/_virtual/react-is.production.min.js +0 -12
- package/lib/actions/Decorators.d.ts +0 -25
- package/lib/actions/Decorators.js +0 -88
- package/lib/node_modules/object-assign/index.js +0 -108
- package/lib/node_modules/prop-types/checkPropTypes.js +0 -124
- package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +0 -634
- package/lib/node_modules/prop-types/lib/has.js +0 -20
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -199
- package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -35
- package/lib/node_modules/prop-types/node_modules/react-is/index.js +0 -30
- package/lib/node_modules/warning/warning.js +0 -71
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -29,8 +29,8 @@ require('../utils/filter.js');
|
|
|
29
29
|
require('lodash/isObject');
|
|
30
30
|
require('lodash/isString');
|
|
31
31
|
require('lodash/isBoolean');
|
|
32
|
-
require('../utils/image.js');
|
|
33
32
|
require('lodash');
|
|
33
|
+
require('../utils/image.js');
|
|
34
34
|
require('../actions/Action.js');
|
|
35
35
|
var resizeSensor = require('../utils/resize-sensor.js');
|
|
36
36
|
var RootClose = require('../utils/RootClose.js');
|
|
@@ -147,6 +147,7 @@ var Position = /** @class */ (function (_super) {
|
|
|
147
147
|
// and `props.style`.
|
|
148
148
|
positionLeft: positionLeft, positionTop: positionTop, className: cx__default["default"](className, child.props.className), style: tslib.__assign(tslib.__assign({}, child.props.style), { left: positionLeft, top: positionTop }) }));
|
|
149
149
|
};
|
|
150
|
+
// setState: (state: any) => void;
|
|
150
151
|
Position.defaultProps = {
|
|
151
152
|
containerPadding: 0,
|
|
152
153
|
placement: 'right',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -28,12 +28,11 @@ require('../utils/filter.js');
|
|
|
28
28
|
require('lodash/isObject');
|
|
29
29
|
require('lodash/isString');
|
|
30
30
|
require('lodash/isBoolean');
|
|
31
|
-
require('../utils/image.js');
|
|
32
31
|
require('lodash');
|
|
32
|
+
require('../utils/image.js');
|
|
33
33
|
require('../actions/Action.js');
|
|
34
34
|
require('../utils/resize-sensor.js');
|
|
35
35
|
require('../node_modules/dom-helpers/esm/addEventListener.js');
|
|
36
|
-
require('../node_modules/warning/warning.js');
|
|
37
36
|
require('../utils/SimpleMap.js');
|
|
38
37
|
require('lodash/mapValues');
|
|
39
38
|
require('lodash/camelCase');
|
package/lib/env.js
CHANGED
package/lib/envOverwrite.js
CHANGED
package/lib/factory.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { IRendererStore, IIRendererStore } from './store/index';
|
|
|
3
3
|
import { fetcherResult, SchemaNode, Schema, PlainObject } from './types';
|
|
4
4
|
import { ThemeProps } from './theme';
|
|
5
5
|
import { LocaleProps } from './locale';
|
|
6
|
-
import { RendererEnv } from './env';
|
|
6
|
+
import type { RendererEnv } from './env';
|
|
7
7
|
import { OnEventProps } from './utils/renderer-event';
|
|
8
8
|
export interface TestFunc {
|
|
9
9
|
(path: string, schema?: Schema, resolveRenderer?: (path: string, schema?: Schema, props?: any) => null | RendererConfig): boolean;
|
package/lib/factory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -262,7 +262,7 @@ function resolveRenderer(path, schema) {
|
|
|
262
262
|
else if (cache[path]) {
|
|
263
263
|
return cache[path];
|
|
264
264
|
}
|
|
265
|
-
else if (path && path.length >
|
|
265
|
+
else if (path && path.length > 3072) {
|
|
266
266
|
throw new Error('Path太长是不是死循环了?');
|
|
267
267
|
}
|
|
268
268
|
var renderer = null;
|
package/lib/index.d.ts
CHANGED
|
@@ -6,27 +6,38 @@
|
|
|
6
6
|
* This source code is licensed under the Apache license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv,
|
|
9
|
+
import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, addSchemaFilter, extendDefaultEnv } from './factory';
|
|
10
|
+
import type { RenderOptions, RendererConfig, RendererProps } from './factory';
|
|
10
11
|
import './renderers/builtin';
|
|
11
12
|
export * from './utils/index';
|
|
12
13
|
export * from './types';
|
|
13
14
|
export * from './store';
|
|
14
15
|
import * as utils from './utils/helper';
|
|
15
16
|
import { RegisterStore } from './store';
|
|
16
|
-
import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, localeable
|
|
17
|
-
import
|
|
18
|
-
import
|
|
17
|
+
import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, localeable } from './locale';
|
|
18
|
+
import type { LocaleProps, TranslateFn } from './locale';
|
|
19
|
+
import Scoped, { ScopedContext } from './Scoped';
|
|
20
|
+
import type { IScopedContext } from './Scoped';
|
|
21
|
+
import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, themeable, makeClassnames } from './theme';
|
|
22
|
+
import type { ClassNamesFn, ThemeProps } from './theme';
|
|
19
23
|
declare const classPrefix: string | undefined;
|
|
20
24
|
export * from './actions';
|
|
21
|
-
import FormItem, {
|
|
22
|
-
import {
|
|
25
|
+
import FormItem, { FormItemWrap, registerFormItem, getFormItemByName } from './renderers/Item';
|
|
26
|
+
import type { FormBaseControl, FormControlProps, FormItemProps } from './renderers/Item';
|
|
27
|
+
import { OptionsControl, registerOptionsControl } from './renderers/Options';
|
|
28
|
+
import type { OptionsControlProps } from './renderers/Options';
|
|
29
|
+
import type { FormOptionsControl } from './renderers/Options';
|
|
23
30
|
import { Schema } from './types';
|
|
24
31
|
import { addRootWrapper, RootRenderProps } from './Root';
|
|
25
|
-
import { EnvContext
|
|
26
|
-
import {
|
|
32
|
+
import { EnvContext } from './env';
|
|
33
|
+
import type { RendererEnv } from './env';
|
|
34
|
+
import { evaluate, Evaluator, extendsFilters, filters, getFilters, lexer, parse, registerFilter } from 'amis-formula';
|
|
35
|
+
import type { FilterContext } from 'amis-formula';
|
|
27
36
|
import LazyComponent from './components/LazyComponent';
|
|
28
37
|
import Overlay from './components/Overlay';
|
|
29
38
|
import PopOver from './components/PopOver';
|
|
30
|
-
import {
|
|
39
|
+
import { FormRenderer } from './renderers/Form';
|
|
40
|
+
import type { FormHorizontal } from './renderers/Form';
|
|
41
|
+
export declare const version: any;
|
|
31
42
|
export { clearStoresCache, updateEnv, Renderer, RendererProps, RenderOptions, RendererEnv, EnvContext, RegisterStore, FormItem, FormItemWrap, FormItemProps, OptionsControl, FormRenderer, FormHorizontal, utils, getRendererByName, registerRenderer, unRegisterRenderer, getRenderers, registerFormItem, getFormItemByName, registerOptionsControl, resolveRenderer, filterSchema, Scoped, ScopedContext, IScopedContext, setDefaultTheme, theme, themeable, ThemeProps, getTheme, classPrefix, getClassPrefix, classnames, makeClassnames, getDefaultLocale, setDefaultLocale, registerLocale, makeTranslator, extendLocale, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, evaluate, LazyComponent, Overlay, PopOver, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig };
|
|
32
43
|
export declare function render(schema: Schema, props?: RootRenderProps, options?: RenderOptions, pathPrefix?: string): JSX.Element;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -62,6 +62,7 @@ var tpl = require('./utils/tpl.js');
|
|
|
62
62
|
var uncontrollable = require('./utils/uncontrollable.js');
|
|
63
63
|
var validations = require('./utils/validations.js');
|
|
64
64
|
var toNumber = require('./utils/toNumber.js');
|
|
65
|
+
var decodeEntity = require('./utils/decodeEntity.js');
|
|
65
66
|
var Animation = require('./utils/Animation.js');
|
|
66
67
|
var index = require('./store/index.js');
|
|
67
68
|
var mobxStateTree = require('mobx-state-tree');
|
|
@@ -84,7 +85,6 @@ require('./actions/EmailAction.js');
|
|
|
84
85
|
require('./actions/LinkAction.js');
|
|
85
86
|
require('./actions/ToastAction.js');
|
|
86
87
|
require('./actions/PageAction.js');
|
|
87
|
-
var Decorators = require('./actions/Decorators.js');
|
|
88
88
|
var Action = require('./actions/Action.js');
|
|
89
89
|
var Item = require('./renderers/Item.js');
|
|
90
90
|
var Options = require('./renderers/Options.js');
|
|
@@ -117,6 +117,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
117
117
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
118
118
|
|
|
119
119
|
var classPrefix = theme.getClassPrefix();
|
|
120
|
+
// @ts-ignore
|
|
121
|
+
var version = "2.4.0";
|
|
120
122
|
function render(schema, props, options, pathPrefix) {
|
|
121
123
|
if (props === void 0) { props = {}; }
|
|
122
124
|
if (options === void 0) { options = {}; }
|
|
@@ -335,6 +337,7 @@ exports.bindEvent = rendererEvent.bindEvent;
|
|
|
335
337
|
exports.createRendererEvent = rendererEvent.createRendererEvent;
|
|
336
338
|
exports.dispatchEvent = rendererEvent.dispatchEvent;
|
|
337
339
|
exports.getRendererEventListeners = rendererEvent.getRendererEventListeners;
|
|
340
|
+
exports.resolveEventData = rendererEvent.resolveEventData;
|
|
338
341
|
exports.replaceText = replaceText.replaceText;
|
|
339
342
|
exports.getComputedStyle = resizeSensor.getComputedStyle;
|
|
340
343
|
exports.resizeSensor = resizeSensor.resizeSensor;
|
|
@@ -361,6 +364,7 @@ exports.validateMessages = validations.validateMessages;
|
|
|
361
364
|
exports.validateObject = validations.validateObject;
|
|
362
365
|
exports.validations = validations.validations;
|
|
363
366
|
exports.toNumber = toNumber.toNumber;
|
|
367
|
+
exports.decodeEntity = decodeEntity.decodeEntity;
|
|
364
368
|
exports.animation = Animation["default"];
|
|
365
369
|
exports.RegisterStore = index.RegisterStore;
|
|
366
370
|
exports.RendererStore = index.RendererStore;
|
|
@@ -379,8 +383,6 @@ exports.makeClassnames = theme.makeClassnames;
|
|
|
379
383
|
exports.setDefaultTheme = theme.setDefaultTheme;
|
|
380
384
|
exports.theme = theme.theme;
|
|
381
385
|
exports.themeable = theme.themeable;
|
|
382
|
-
exports.bindRendererEvent = Decorators.bindRendererEvent;
|
|
383
|
-
exports.rendererEventDispatcher = Decorators.rendererEventDispatcher;
|
|
384
386
|
Object.defineProperty(exports, 'LoopStatus', {
|
|
385
387
|
enumerable: true,
|
|
386
388
|
get: function () { return Action.LoopStatus; }
|
|
@@ -449,3 +451,4 @@ exports.AppStore = app.AppStore;
|
|
|
449
451
|
exports.StoreNode = node.StoreNode;
|
|
450
452
|
exports.classPrefix = classPrefix;
|
|
451
453
|
exports.render = render;
|
|
454
|
+
exports.version = version;
|
package/lib/locale.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
|
-
var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
|
|
10
|
+
var ReactPropTypesSecret$1 = require('./lib/ReactPropTypesSecret.js');
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -16,68 +16,59 @@ var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret.js');
|
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
var hasRequiredFactoryWithThrowingShims;
|
|
19
|
+
var ReactPropTypesSecret = ReactPropTypesSecret$1["default"];
|
|
21
20
|
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function emptyFunction() {}
|
|
22
|
+
function emptyFunctionWithReset() {}
|
|
23
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
var factoryWithThrowingShims = function() {
|
|
26
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
27
|
+
if (secret === ReactPropTypesSecret) {
|
|
28
|
+
// It is still safe when called from React.
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
var err = new Error(
|
|
32
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
33
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
34
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
35
|
+
);
|
|
36
|
+
err.name = 'Invariant Violation';
|
|
37
|
+
throw err;
|
|
38
|
+
} shim.isRequired = shim;
|
|
39
|
+
function getShim() {
|
|
40
|
+
return shim;
|
|
41
|
+
} // Important!
|
|
42
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
43
|
+
var ReactPropTypes = {
|
|
44
|
+
array: shim,
|
|
45
|
+
bigint: shim,
|
|
46
|
+
bool: shim,
|
|
47
|
+
func: shim,
|
|
48
|
+
number: shim,
|
|
49
|
+
object: shim,
|
|
50
|
+
string: shim,
|
|
51
|
+
symbol: shim,
|
|
27
52
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
any: shim,
|
|
54
|
+
arrayOf: getShim,
|
|
55
|
+
element: shim,
|
|
56
|
+
elementType: shim,
|
|
57
|
+
instanceOf: getShim,
|
|
58
|
+
node: shim,
|
|
59
|
+
objectOf: getShim,
|
|
60
|
+
oneOf: getShim,
|
|
61
|
+
oneOfType: getShim,
|
|
62
|
+
shape: getShim,
|
|
63
|
+
exact: getShim,
|
|
31
64
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// It is still safe when called from React.
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
var err = new Error(
|
|
39
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
40
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
41
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
42
|
-
);
|
|
43
|
-
err.name = 'Invariant Violation';
|
|
44
|
-
throw err;
|
|
45
|
-
} shim.isRequired = shim;
|
|
46
|
-
function getShim() {
|
|
47
|
-
return shim;
|
|
48
|
-
} // Important!
|
|
49
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
50
|
-
var ReactPropTypes = {
|
|
51
|
-
array: shim,
|
|
52
|
-
bigint: shim,
|
|
53
|
-
bool: shim,
|
|
54
|
-
func: shim,
|
|
55
|
-
number: shim,
|
|
56
|
-
object: shim,
|
|
57
|
-
string: shim,
|
|
58
|
-
symbol: shim,
|
|
65
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
66
|
+
resetWarningCache: emptyFunction
|
|
67
|
+
};
|
|
59
68
|
|
|
60
|
-
|
|
61
|
-
arrayOf: getShim,
|
|
62
|
-
element: shim,
|
|
63
|
-
elementType: shim,
|
|
64
|
-
instanceOf: getShim,
|
|
65
|
-
node: shim,
|
|
66
|
-
objectOf: getShim,
|
|
67
|
-
oneOf: getShim,
|
|
68
|
-
oneOfType: getShim,
|
|
69
|
-
shape: getShim,
|
|
70
|
-
exact: getShim,
|
|
69
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
71
|
+
return ReactPropTypes;
|
|
72
|
+
};
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return ReactPropTypes;
|
|
79
|
-
};
|
|
80
|
-
return factoryWithThrowingShims;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
exports.__require = requireFactoryWithThrowingShims;
|
|
74
|
+
exports["default"] = factoryWithThrowingShims;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var index = require('../../_virtual/index.js');
|
|
11
|
-
var index$1 = require('./node_modules/react-is/index.js');
|
|
12
|
-
var factoryWithTypeCheckers = require('./factoryWithTypeCheckers.js');
|
|
13
11
|
var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
|
|
14
12
|
|
|
15
13
|
/**
|
|
@@ -19,17 +17,10 @@ var factoryWithThrowingShims = require('./factoryWithThrowingShims.js');
|
|
|
19
17
|
* LICENSE file in the root directory of this source tree.
|
|
20
18
|
*/
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
var ReactIs = index$1.__require();
|
|
24
|
-
|
|
25
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
26
|
-
// http://fb.me/prop-types-in-prod
|
|
27
|
-
var throwOnDirectAccess = true;
|
|
28
|
-
index.propTypes.exports = factoryWithTypeCheckers.__require()(ReactIs.isElement, throwOnDirectAccess);
|
|
29
|
-
} else {
|
|
20
|
+
{
|
|
30
21
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
31
22
|
// http://fb.me/prop-types-in-prod
|
|
32
|
-
index.propTypes.exports = factoryWithThrowingShims
|
|
23
|
+
index.propTypes.exports = factoryWithThrowingShims["default"]();
|
|
33
24
|
}
|
|
34
25
|
|
|
35
26
|
exports["default"] = index.propTypes.exports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -14,17 +14,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
var hasRequiredReactPropTypesSecret;
|
|
17
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
22
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
19
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
27
|
-
return ReactPropTypesSecret_1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
exports.__require = requireReactPropTypesSecret;
|
|
21
|
+
exports["default"] = ReactPropTypesSecret_1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,7 +11,6 @@ var contains = require('../../dom-helpers/esm/contains.js');
|
|
|
11
11
|
var listen = require('../../dom-helpers/esm/listen.js');
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var useEventCallback = require('../../@restart/hooks/esm/useEventCallback.js');
|
|
14
|
-
var warning = require('../../warning/warning.js');
|
|
15
14
|
var ownerDocument = require('./ownerDocument.js');
|
|
16
15
|
|
|
17
16
|
var escapeKeyCode = 27;
|
|
@@ -52,7 +51,6 @@ function useRootClose(ref, onRootClose, _temp) {
|
|
|
52
51
|
var onClose = onRootClose || noop;
|
|
53
52
|
var handleMouseCapture = React.useCallback(function (e) {
|
|
54
53
|
var currentTarget = getRefTarget(ref);
|
|
55
|
-
warning["default"](!!currentTarget, 'RootClose captured a close event but does not have a ref to compare it to. ' + 'useRootClose(), should be passed a ref that resolves to a DOM node');
|
|
56
54
|
preventMouseRootCloseRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!contains["default"](currentTarget, e.target);
|
|
57
55
|
}, [ref]);
|
|
58
56
|
var handleMouse = useEventCallback["default"](function (e) {
|
package/lib/renderers/Form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { RendererProps } from '../factory';
|
|
4
4
|
import { IFormStore } from '../store/form';
|
|
5
|
-
import { SchemaNode, ActionObject, ClassName, BaseApiObject } from '../types';
|
|
5
|
+
import { SchemaNode, ActionObject, ClassName, BaseApiObject, SchemaExpression, SchemaClassName } from '../types';
|
|
6
6
|
import { IScopedContext } from '../Scoped';
|
|
7
7
|
import type { LabelAlign } from './Item';
|
|
8
8
|
export interface FormHorizontal {
|
|
@@ -236,6 +236,12 @@ export interface FormSchemaBase {
|
|
|
236
236
|
* label自定义宽度,默认单位为px
|
|
237
237
|
*/
|
|
238
238
|
labelWidth?: number | string;
|
|
239
|
+
/**
|
|
240
|
+
* 展示态时的className
|
|
241
|
+
*/
|
|
242
|
+
static?: boolean;
|
|
243
|
+
staticOn?: SchemaExpression;
|
|
244
|
+
staticClassName?: SchemaClassName;
|
|
239
245
|
}
|
|
240
246
|
export declare type FormGroup = FormSchemaBase & {
|
|
241
247
|
title?: string;
|
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -866,7 +866,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
866
866
|
}
|
|
867
867
|
var props = tslib.__assign(tslib.__assign({}, this.props), otherProps);
|
|
868
868
|
var form = this.props.store;
|
|
869
|
-
var render = props.render, mode = props.mode, horizontal = props.horizontal, store = props.store, disabled = props.disabled, controlWidth = props.controlWidth, resolveDefinitions = props.resolveDefinitions, lazyChange = props.lazyChange; props.formLazyChange; var dispatchEvent = props.dispatchEvent, labelAlign = props.labelAlign, labelWidth = props.labelWidth;
|
|
869
|
+
var render = props.render, mode = props.mode, horizontal = props.horizontal, store = props.store, disabled = props.disabled, controlWidth = props.controlWidth, resolveDefinitions = props.resolveDefinitions, lazyChange = props.lazyChange; props.formLazyChange; var dispatchEvent = props.dispatchEvent, labelAlign = props.labelAlign, labelWidth = props.labelWidth, _a = props.static, isStatic = _a === void 0 ? false : _a;
|
|
870
870
|
var subProps = {
|
|
871
871
|
formStore: form,
|
|
872
872
|
data: store.data,
|
|
@@ -885,6 +885,13 @@ var Form = /** @class */ (function (_super) {
|
|
|
885
885
|
disabled: disabled ||
|
|
886
886
|
control.disabled ||
|
|
887
887
|
(form.loading ? true : undefined),
|
|
888
|
+
/**
|
|
889
|
+
* 静态展示 优先级逻辑
|
|
890
|
+
* 1. 表单子项 static: true 始终保持静态
|
|
891
|
+
* 2. 表单子项 static: false 或 不配置,跟随父表单
|
|
892
|
+
* 3. 动作控制 表单子项 时,无视配置,优先级最高
|
|
893
|
+
*/
|
|
894
|
+
static: control.static || isStatic,
|
|
888
895
|
btnDisabled: disabled || form.loading || form.validating,
|
|
889
896
|
onAction: this.handleAction,
|
|
890
897
|
onQuery: this.handleQuery,
|
|
@@ -908,14 +915,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
908
915
|
return render("".concat(region ? "".concat(region, "/") : '').concat(key), subSchema, subProps);
|
|
909
916
|
};
|
|
910
917
|
Form.prototype.renderBody = function () {
|
|
911
|
-
var _a = this.props, body = _a.body, mode = _a.mode, className = _a.className, cx = _a.classnames, debug = _a.debug, debugConfig = _a.debugConfig, $path = _a.$path, store = _a.store, columnCount = _a.columnCount, render = _a.render;
|
|
918
|
+
var _a = this.props, body = _a.body, mode = _a.mode, className = _a.className, cx = _a.classnames, debug = _a.debug, debugConfig = _a.debugConfig, $path = _a.$path, store = _a.store, columnCount = _a.columnCount, render = _a.render, staticClassName = _a.staticClassName, _b = _a.static, isStatic = _b === void 0 ? false : _b;
|
|
912
919
|
var restError = store.restError;
|
|
913
920
|
var WrapperComponent = this.props.wrapperComponent ||
|
|
914
921
|
(/(?:\/|^)form\//.test($path) ? 'div' : 'form');
|
|
915
922
|
var padDom = helper.repeatCount(columnCount && Array.isArray(body)
|
|
916
923
|
? columnCount - (body.length % columnCount)
|
|
917
924
|
: 0, function (index) { return (React__default["default"].createElement("div", { className: cx("Form-item Form-item--".concat(mode, " is-placeholder")), key: index })); });
|
|
918
|
-
return (React__default["default"].createElement(WrapperComponent, { className: cx("Form", "Form--".concat(mode || 'normal'), columnCount ? "Form--column Form--column-".concat(columnCount) : null, className), onSubmit: this.handleFormSubmit, noValidate: true },
|
|
925
|
+
return (React__default["default"].createElement(WrapperComponent, { className: cx("Form", "Form--".concat(mode || 'normal'), columnCount ? "Form--column Form--column-".concat(columnCount) : null, staticClassName && isStatic ? staticClassName : className, isStatic ? 'Form--isStatic' : null), onSubmit: this.handleFormSubmit, noValidate: true },
|
|
919
926
|
React__default["default"].createElement("input", { type: "submit", style: { display: 'none' } }),
|
|
920
927
|
debug
|
|
921
928
|
? render('form-debug-json', extend__default["default"]({
|
|
@@ -954,7 +961,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
954
961
|
})));
|
|
955
962
|
};
|
|
956
963
|
Form.prototype.render = function () {
|
|
957
|
-
var _a = this.props; _a.$path; _a.$schema; var wrapWithPanel = _a.wrapWithPanel, render = _a.render, title = _a.title, store = _a.store, panelClassName = _a.panelClassName, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, footerWrapClassName = _a.footerWrapClassName, actionsClassName = _a.actionsClassName, bodyClassName = _a.bodyClassName, cx = _a.classnames, affixFooter = _a.affixFooter, lazyLoad = _a.lazyLoad, __ = _a.translate, footer = _a.footer;
|
|
964
|
+
var _a = this.props; _a.$path; _a.$schema; var wrapWithPanel = _a.wrapWithPanel, render = _a.render, title = _a.title, store = _a.store, panelClassName = _a.panelClassName, headerClassName = _a.headerClassName, footerClassName = _a.footerClassName, footerWrapClassName = _a.footerWrapClassName, actionsClassName = _a.actionsClassName, bodyClassName = _a.bodyClassName, cx = _a.classnames, affixFooter = _a.affixFooter, lazyLoad = _a.lazyLoad, __ = _a.translate, footer = _a.footer;
|
|
958
965
|
var body = this.renderBody();
|
|
959
966
|
if (wrapWithPanel) {
|
|
960
967
|
body = render('body', {
|
|
@@ -1167,7 +1174,11 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1167
1174
|
return _super.prototype.receive.call(this, values, undefined, replace);
|
|
1168
1175
|
};
|
|
1169
1176
|
FormRenderer.prototype.setData = function (values, replace) {
|
|
1170
|
-
|
|
1177
|
+
var _a = this.props, onChange = _a.onChange, store = _a.store;
|
|
1178
|
+
_super.prototype.setValues.call(this, values);
|
|
1179
|
+
// 触发表单change
|
|
1180
|
+
onChange &&
|
|
1181
|
+
onChange(store.data, helper.difference(store.data, store.pristine), this.props);
|
|
1171
1182
|
};
|
|
1172
1183
|
FormRenderer.contextType = Scoped.ScopedContext;
|
|
1173
1184
|
FormRenderer = tslib.__decorate([
|