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
|
|
|
@@ -25,8 +25,8 @@ import '../utils/filter.js';
|
|
|
25
25
|
import 'lodash/isObject';
|
|
26
26
|
import 'lodash/isString';
|
|
27
27
|
import 'lodash/isBoolean';
|
|
28
|
-
import '../utils/image.js';
|
|
29
28
|
import 'lodash';
|
|
29
|
+
import '../utils/image.js';
|
|
30
30
|
import '../actions/Action.js';
|
|
31
31
|
import { getComputedStyle, resizeSensor } from '../utils/resize-sensor.js';
|
|
32
32
|
import { RootClose } from '../utils/RootClose.js';
|
|
@@ -137,6 +137,7 @@ var Position = /** @class */ (function (_super) {
|
|
|
137
137
|
// and `props.style`.
|
|
138
138
|
positionLeft: positionLeft, positionTop: positionTop, className: cx(className, child.props.className), style: __assign(__assign({}, child.props.style), { left: positionLeft, top: positionTop }) }));
|
|
139
139
|
};
|
|
140
|
+
// setState: (state: any) => void;
|
|
140
141
|
Position.defaultProps = {
|
|
141
142
|
containerPadding: 0,
|
|
142
143
|
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
|
|
|
@@ -24,12 +24,11 @@ import '../utils/filter.js';
|
|
|
24
24
|
import 'lodash/isObject';
|
|
25
25
|
import 'lodash/isString';
|
|
26
26
|
import 'lodash/isBoolean';
|
|
27
|
-
import '../utils/image.js';
|
|
28
27
|
import 'lodash';
|
|
28
|
+
import '../utils/image.js';
|
|
29
29
|
import '../actions/Action.js';
|
|
30
30
|
import '../utils/resize-sensor.js';
|
|
31
31
|
import '../node_modules/dom-helpers/esm/addEventListener.js';
|
|
32
|
-
import '../node_modules/warning/warning.js';
|
|
33
32
|
import '../utils/SimpleMap.js';
|
|
34
33
|
import 'lodash/mapValues';
|
|
35
34
|
import 'lodash/camelCase';
|
package/esm/env.js
CHANGED
package/esm/envOverwrite.js
CHANGED
package/esm/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/esm/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
|
|
|
@@ -253,7 +253,7 @@ function resolveRenderer(path, schema) {
|
|
|
253
253
|
else if (cache[path]) {
|
|
254
254
|
return cache[path];
|
|
255
255
|
}
|
|
256
|
-
else if (path && path.length >
|
|
256
|
+
else if (path && path.length > 3072) {
|
|
257
257
|
throw new Error('Path太长是不是死循环了?');
|
|
258
258
|
}
|
|
259
259
|
var renderer = null;
|
package/esm/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/esm/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
|
|
|
@@ -48,7 +48,7 @@ export { offsetParent } from './utils/offsetParent.js';
|
|
|
48
48
|
export { matchOptionValue, optionValueCompare } from './utils/optionValueCompare.js';
|
|
49
49
|
export { position } from './utils/position.js';
|
|
50
50
|
export { prettyBytes } from './utils/prettyBytes.js';
|
|
51
|
-
export { bindEvent, createRendererEvent, dispatchEvent, getRendererEventListeners } from './utils/renderer-event.js';
|
|
51
|
+
export { bindEvent, createRendererEvent, dispatchEvent, getRendererEventListeners, resolveEventData } from './utils/renderer-event.js';
|
|
52
52
|
import { replaceText } from './utils/replaceText.js';
|
|
53
53
|
export { replaceText } from './utils/replaceText.js';
|
|
54
54
|
export { getComputedStyle, resizeSensor } from './utils/resize-sensor.js';
|
|
@@ -65,6 +65,7 @@ export { evalExpression, evalJS, filter, registerTplEnginer, setCustomEvalExpres
|
|
|
65
65
|
export { uncontrollable } from './utils/uncontrollable.js';
|
|
66
66
|
export { addRule, str2rules, validate, validateMessages, validateObject, validations } from './utils/validations.js';
|
|
67
67
|
export { toNumber } from './utils/toNumber.js';
|
|
68
|
+
export { decodeEntity } from './utils/decodeEntity.js';
|
|
68
69
|
export { default as animation } from './utils/Animation.js';
|
|
69
70
|
import { RendererStore } from './store/index.js';
|
|
70
71
|
export { RegisterStore, RendererStore } from './store/index.js';
|
|
@@ -90,7 +91,6 @@ import './actions/EmailAction.js';
|
|
|
90
91
|
import './actions/LinkAction.js';
|
|
91
92
|
import './actions/ToastAction.js';
|
|
92
93
|
import './actions/PageAction.js';
|
|
93
|
-
export { bindRendererEvent, rendererEventDispatcher } from './actions/Decorators.js';
|
|
94
94
|
export { LoopStatus, getActionByType, registerAction, runAction, runActions } from './actions/Action.js';
|
|
95
95
|
export { FormItem, FormItemWrap, getFormItemByName, registerFormItem } from './renderers/Item.js';
|
|
96
96
|
export { OptionsControl, registerOptionsControl } from './renderers/Options.js';
|
|
@@ -121,6 +121,8 @@ export { AppStore } from './store/app.js';
|
|
|
121
121
|
export { StoreNode } from './store/node.js';
|
|
122
122
|
|
|
123
123
|
var classPrefix = getClassPrefix();
|
|
124
|
+
// @ts-ignore
|
|
125
|
+
var version = "2.4.0";
|
|
124
126
|
function render(schema, props, options, pathPrefix) {
|
|
125
127
|
if (props === void 0) { props = {}; }
|
|
126
128
|
if (options === void 0) { options = {}; }
|
|
@@ -168,4 +170,4 @@ function render(schema, props, options, pathPrefix) {
|
|
|
168
170
|
React.createElement(ScopedRootRenderer, __assign({}, props, { schema: schema, pathPrefix: pathPrefix, rootStore: store, env: env, theme: theme, locale: locale, translate: translate }))));
|
|
169
171
|
}
|
|
170
172
|
|
|
171
|
-
export { classPrefix, render };
|
|
173
|
+
export { classPrefix, render, version };
|
package/esm/locale.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import ReactPropTypesSecret_1 from './lib/ReactPropTypesSecret.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -12,68 +12,59 @@ import { __require as requireReactPropTypesSecret } from './lib/ReactPropTypesSe
|
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
var hasRequiredFactoryWithThrowingShims;
|
|
15
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
17
16
|
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function emptyFunction() {}
|
|
18
|
+
function emptyFunctionWithReset() {}
|
|
19
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
var factoryWithThrowingShims = function() {
|
|
22
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
23
|
+
if (secret === ReactPropTypesSecret) {
|
|
24
|
+
// It is still safe when called from React.
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var err = new Error(
|
|
28
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
29
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
30
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
31
|
+
);
|
|
32
|
+
err.name = 'Invariant Violation';
|
|
33
|
+
throw err;
|
|
34
|
+
} shim.isRequired = shim;
|
|
35
|
+
function getShim() {
|
|
36
|
+
return shim;
|
|
37
|
+
} // Important!
|
|
38
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
39
|
+
var ReactPropTypes = {
|
|
40
|
+
array: shim,
|
|
41
|
+
bigint: shim,
|
|
42
|
+
bool: shim,
|
|
43
|
+
func: shim,
|
|
44
|
+
number: shim,
|
|
45
|
+
object: shim,
|
|
46
|
+
string: shim,
|
|
47
|
+
symbol: shim,
|
|
23
48
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
49
|
+
any: shim,
|
|
50
|
+
arrayOf: getShim,
|
|
51
|
+
element: shim,
|
|
52
|
+
elementType: shim,
|
|
53
|
+
instanceOf: getShim,
|
|
54
|
+
node: shim,
|
|
55
|
+
objectOf: getShim,
|
|
56
|
+
oneOf: getShim,
|
|
57
|
+
oneOfType: getShim,
|
|
58
|
+
shape: getShim,
|
|
59
|
+
exact: getShim,
|
|
27
60
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// It is still safe when called from React.
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
var err = new Error(
|
|
35
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
36
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
37
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
38
|
-
);
|
|
39
|
-
err.name = 'Invariant Violation';
|
|
40
|
-
throw err;
|
|
41
|
-
} shim.isRequired = shim;
|
|
42
|
-
function getShim() {
|
|
43
|
-
return shim;
|
|
44
|
-
} // Important!
|
|
45
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
46
|
-
var ReactPropTypes = {
|
|
47
|
-
array: shim,
|
|
48
|
-
bigint: shim,
|
|
49
|
-
bool: shim,
|
|
50
|
-
func: shim,
|
|
51
|
-
number: shim,
|
|
52
|
-
object: shim,
|
|
53
|
-
string: shim,
|
|
54
|
-
symbol: shim,
|
|
61
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
62
|
+
resetWarningCache: emptyFunction
|
|
63
|
+
};
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
arrayOf: getShim,
|
|
58
|
-
element: shim,
|
|
59
|
-
elementType: shim,
|
|
60
|
-
instanceOf: getShim,
|
|
61
|
-
node: shim,
|
|
62
|
-
objectOf: getShim,
|
|
63
|
-
oneOf: getShim,
|
|
64
|
-
oneOfType: getShim,
|
|
65
|
-
shape: getShim,
|
|
66
|
-
exact: getShim,
|
|
65
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
67
|
+
return ReactPropTypes;
|
|
68
|
+
};
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return ReactPropTypes;
|
|
75
|
-
};
|
|
76
|
-
return factoryWithThrowingShims;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { requireFactoryWithThrowingShims as __require };
|
|
70
|
+
export { factoryWithThrowingShims as default };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v2.
|
|
2
|
+
* amis-core v2.4.0
|
|
3
3
|
* Copyright 2018-2022 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { p as propTypes } from '../../_virtual/index.js';
|
|
7
|
-
import
|
|
8
|
-
import { __require as requireFactoryWithTypeCheckers } from './factoryWithTypeCheckers.js';
|
|
9
|
-
import { __require as requireFactoryWithThrowingShims } from './factoryWithThrowingShims.js';
|
|
7
|
+
import factoryWithThrowingShims from './factoryWithThrowingShims.js';
|
|
10
8
|
|
|
11
9
|
/**
|
|
12
10
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -15,17 +13,10 @@ import { __require as requireFactoryWithThrowingShims } from './factoryWithThrow
|
|
|
15
13
|
* LICENSE file in the root directory of this source tree.
|
|
16
14
|
*/
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
var ReactIs = requireReactIs();
|
|
20
|
-
|
|
21
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
22
|
-
// http://fb.me/prop-types-in-prod
|
|
23
|
-
var throwOnDirectAccess = true;
|
|
24
|
-
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
25
|
-
} else {
|
|
16
|
+
{
|
|
26
17
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
27
18
|
// http://fb.me/prop-types-in-prod
|
|
28
|
-
propTypes.exports =
|
|
19
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
29
20
|
}
|
|
30
21
|
|
|
31
22
|
var exports = 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
|
|
|
@@ -10,17 +10,8 @@
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
var hasRequiredReactPropTypesSecret;
|
|
13
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
18
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
15
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
23
|
-
return ReactPropTypesSecret_1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { requireReactPropTypesSecret as __require };
|
|
17
|
+
export { ReactPropTypesSecret_1 as default };
|
|
@@ -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,6 @@ import contains from '../../dom-helpers/esm/contains.js';
|
|
|
7
7
|
import listen from '../../dom-helpers/esm/listen.js';
|
|
8
8
|
import { useRef, useCallback, useEffect } from 'react';
|
|
9
9
|
import useEventCallback from '../../@restart/hooks/esm/useEventCallback.js';
|
|
10
|
-
import warning_1 from '../../warning/warning.js';
|
|
11
10
|
import ownerDocument from './ownerDocument.js';
|
|
12
11
|
|
|
13
12
|
var escapeKeyCode = 27;
|
|
@@ -48,7 +47,6 @@ function useRootClose(ref, onRootClose, _temp) {
|
|
|
48
47
|
var onClose = onRootClose || noop;
|
|
49
48
|
var handleMouseCapture = useCallback(function (e) {
|
|
50
49
|
var currentTarget = getRefTarget(ref);
|
|
51
|
-
warning_1(!!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');
|
|
52
50
|
preventMouseRootCloseRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!contains(currentTarget, e.target);
|
|
53
51
|
}, [ref]);
|
|
54
52
|
var handleMouse = useEventCallback(function (e) {
|
package/esm/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/esm/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
|
|
|
@@ -854,7 +854,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
854
854
|
}
|
|
855
855
|
var props = __assign(__assign({}, this.props), otherProps);
|
|
856
856
|
var form = this.props.store;
|
|
857
|
-
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;
|
|
857
|
+
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;
|
|
858
858
|
var subProps = {
|
|
859
859
|
formStore: form,
|
|
860
860
|
data: store.data,
|
|
@@ -873,6 +873,13 @@ var Form = /** @class */ (function (_super) {
|
|
|
873
873
|
disabled: disabled ||
|
|
874
874
|
control.disabled ||
|
|
875
875
|
(form.loading ? true : undefined),
|
|
876
|
+
/**
|
|
877
|
+
* 静态展示 优先级逻辑
|
|
878
|
+
* 1. 表单子项 static: true 始终保持静态
|
|
879
|
+
* 2. 表单子项 static: false 或 不配置,跟随父表单
|
|
880
|
+
* 3. 动作控制 表单子项 时,无视配置,优先级最高
|
|
881
|
+
*/
|
|
882
|
+
static: control.static || isStatic,
|
|
876
883
|
btnDisabled: disabled || form.loading || form.validating,
|
|
877
884
|
onAction: this.handleAction,
|
|
878
885
|
onQuery: this.handleQuery,
|
|
@@ -896,14 +903,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
896
903
|
return render("".concat(region ? "".concat(region, "/") : '').concat(key), subSchema, subProps);
|
|
897
904
|
};
|
|
898
905
|
Form.prototype.renderBody = function () {
|
|
899
|
-
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;
|
|
906
|
+
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;
|
|
900
907
|
var restError = store.restError;
|
|
901
908
|
var WrapperComponent = this.props.wrapperComponent ||
|
|
902
909
|
(/(?:\/|^)form\//.test($path) ? 'div' : 'form');
|
|
903
910
|
var padDom = repeatCount(columnCount && Array.isArray(body)
|
|
904
911
|
? columnCount - (body.length % columnCount)
|
|
905
912
|
: 0, function (index) { return (React.createElement("div", { className: cx("Form-item Form-item--".concat(mode, " is-placeholder")), key: index })); });
|
|
906
|
-
return (React.createElement(WrapperComponent, { className: cx("Form", "Form--".concat(mode || 'normal'), columnCount ? "Form--column Form--column-".concat(columnCount) : null, className), onSubmit: this.handleFormSubmit, noValidate: true },
|
|
913
|
+
return (React.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 },
|
|
907
914
|
React.createElement("input", { type: "submit", style: { display: 'none' } }),
|
|
908
915
|
debug
|
|
909
916
|
? render('form-debug-json', extend({
|
|
@@ -942,7 +949,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
942
949
|
})));
|
|
943
950
|
};
|
|
944
951
|
Form.prototype.render = function () {
|
|
945
|
-
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;
|
|
952
|
+
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;
|
|
946
953
|
var body = this.renderBody();
|
|
947
954
|
if (wrapWithPanel) {
|
|
948
955
|
body = render('body', {
|
|
@@ -1155,7 +1162,11 @@ var FormRenderer = /** @class */ (function (_super) {
|
|
|
1155
1162
|
return _super.prototype.receive.call(this, values, undefined, replace);
|
|
1156
1163
|
};
|
|
1157
1164
|
FormRenderer.prototype.setData = function (values, replace) {
|
|
1158
|
-
|
|
1165
|
+
var _a = this.props, onChange = _a.onChange, store = _a.store;
|
|
1166
|
+
_super.prototype.setValues.call(this, values);
|
|
1167
|
+
// 触发表单change
|
|
1168
|
+
onChange &&
|
|
1169
|
+
onChange(store.data, difference(store.data, store.pristine), this.props);
|
|
1159
1170
|
};
|
|
1160
1171
|
FormRenderer.contextType = ScopedContext;
|
|
1161
1172
|
FormRenderer = __decorate([
|
package/esm/renderers/Item.d.ts
CHANGED
|
@@ -516,9 +516,6 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
516
516
|
readonly fetcher: any;
|
|
517
517
|
readonly notify: any;
|
|
518
518
|
readonly isCancel: (value: any) => boolean;
|
|
519
|
-
/**
|
|
520
|
-
* 输入提示,聚焦的时候显示
|
|
521
|
-
*/
|
|
522
519
|
readonly __: import("..").TranslateFn<any>;
|
|
523
520
|
getStoreById(id: string): {
|
|
524
521
|
id: string;
|
|
@@ -612,6 +609,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
612
609
|
addStore(store: {
|
|
613
610
|
[propName: string]: any;
|
|
614
611
|
storeType: string;
|
|
612
|
+
/**
|
|
613
|
+
* 表单 control 是否为 inline 模式。
|
|
614
|
+
*/
|
|
615
615
|
id: string;
|
|
616
616
|
path: string;
|
|
617
617
|
parentId?: string | undefined;
|
|
@@ -707,9 +707,6 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
707
707
|
readonly fetcher: any;
|
|
708
708
|
readonly notify: any;
|
|
709
709
|
readonly isCancel: (value: any) => boolean;
|
|
710
|
-
/**
|
|
711
|
-
* 输入提示,聚焦的时候显示
|
|
712
|
-
*/
|
|
713
710
|
readonly __: import("..").TranslateFn<any>;
|
|
714
711
|
getStoreById(id: string): {
|
|
715
712
|
id: string;
|
|
@@ -803,6 +800,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
803
800
|
addStore(store: {
|
|
804
801
|
[propName: string]: any;
|
|
805
802
|
storeType: string;
|
|
803
|
+
/**
|
|
804
|
+
* 表单 control 是否为 inline 模式。
|
|
805
|
+
*/
|
|
806
806
|
id: string;
|
|
807
807
|
path: string;
|
|
808
808
|
parentId?: string | undefined;
|