amis-core 3.4.3 → 3.5.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 +12 -2
- package/esm/SchemaRenderer.js +1 -1
- package/esm/Scoped.js +1 -1
- package/esm/StatusScoped.js +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 +1 -1
- 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/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/components/CustomStyle.js +9 -9
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +11 -3
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +1 -3
- package/esm/index.js +4 -4
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.js +3 -3
- package/esm/renderers/Item.d.ts +2 -6
- package/esm/renderers/Item.js +10 -16
- 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.js +40 -21
- package/esm/store/app.js +6 -4
- package/esm/store/combo.d.ts +120 -0
- package/esm/store/combo.js +3 -2
- package/esm/store/crud.d.ts +13 -1
- package/esm/store/crud.js +94 -36
- package/esm/store/form.d.ts +50 -0
- package/esm/store/form.js +1 -1
- package/esm/store/formItem.d.ts +1 -0
- package/esm/store/formItem.js +17 -5
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +1 -1
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +1 -1
- package/esm/store/service.js +1 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +418 -65
- package/esm/store/table.js +106 -72
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +6 -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.js +2 -1
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.d.ts +2 -1
- package/esm/utils/attachmentAdpator.js +17 -11
- 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.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.d.ts +8 -0
- package/esm/utils/filter-schema.js +23 -9
- 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 +2 -1
- package/esm/utils/helper.d.ts +13 -0
- package/esm/utils/helper.js +46 -4
- 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/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/renderer-event.js +1 -1
- package/esm/utils/replaceText.d.ts +1 -1
- package/esm/utils/replaceText.js +9 -4
- 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 +3 -3
- 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 +12 -2
- package/lib/SchemaRenderer.js +1 -1
- package/lib/Scoped.js +1 -1
- package/lib/StatusScoped.js +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 +1 -1
- 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/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/components/CustomStyle.js +9 -9
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +11 -3
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +1 -3
- package/lib/index.js +6 -2
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.js +3 -3
- package/lib/renderers/Item.d.ts +3 -7
- package/lib/renderers/Item.js +10 -16
- 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.js +40 -21
- package/lib/store/app.js +5 -3
- package/lib/store/combo.d.ts +120 -1
- package/lib/store/combo.js +3 -2
- package/lib/store/crud.d.ts +13 -1
- package/lib/store/crud.js +94 -36
- package/lib/store/form.d.ts +50 -0
- package/lib/store/form.js +1 -1
- package/lib/store/formItem.d.ts +1 -0
- package/lib/store/formItem.js +15 -3
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +1 -1
- package/lib/store/service.js +1 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +418 -66
- package/lib/store/table.js +104 -70
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +6 -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.js +2 -1
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.d.ts +2 -1
- package/lib/utils/attachmentAdpator.js +17 -11
- 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.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.d.ts +8 -0
- package/lib/utils/filter-schema.js +22 -7
- 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 +2 -1
- package/lib/utils/helper.d.ts +13 -0
- package/lib/utils/helper.js +48 -3
- 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/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/renderer-event.js +1 -1
- package/lib/utils/replaceText.d.ts +1 -1
- package/lib/utils/replaceText.js +9 -4
- 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 +3 -3
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -34,26 +34,26 @@ function CustomStyle (props) {
|
|
|
34
34
|
};
|
|
35
35
|
}, [id]);
|
|
36
36
|
React.useEffect(function () {
|
|
37
|
-
var _a;
|
|
37
|
+
var _a, _b;
|
|
38
38
|
if (themeCss && id) {
|
|
39
|
-
styleHelper.insertCustomStyle(themeCss, classNames, id, defaultData, env === null || env === void 0 ? void 0 : env.customStyleClassPrefix, (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env).ownerDocument);
|
|
39
|
+
styleHelper.insertCustomStyle(themeCss, classNames, id, defaultData, env === null || env === void 0 ? void 0 : env.customStyleClassPrefix, (_b = (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env)) === null || _b === void 0 ? void 0 : _b.ownerDocument);
|
|
40
40
|
}
|
|
41
41
|
return function () {
|
|
42
|
-
var _a;
|
|
42
|
+
var _a, _b;
|
|
43
43
|
if (id && !styleIdCount.get(id)) {
|
|
44
|
-
styleHelper.removeCustomStyle('', id, (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env).ownerDocument);
|
|
44
|
+
styleHelper.removeCustomStyle('', id, (_b = (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env)) === null || _b === void 0 ? void 0 : _b.ownerDocument);
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
}, [themeCss, id]);
|
|
48
48
|
React.useEffect(function () {
|
|
49
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
50
50
|
if (wrapperCustomStyle && id) {
|
|
51
|
-
styleHelper.insertEditCustomStyle(wrapperCustomStyle, id, (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env).ownerDocument);
|
|
51
|
+
styleHelper.insertEditCustomStyle(wrapperCustomStyle, id, (_b = (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env)) === null || _b === void 0 ? void 0 : _b.ownerDocument);
|
|
52
52
|
}
|
|
53
53
|
return function () {
|
|
54
|
-
var _a;
|
|
54
|
+
var _a, _b;
|
|
55
55
|
if (id && !styleIdCount.get(id)) {
|
|
56
|
-
styleHelper.removeCustomStyle('wrapperCustomStyle', id, (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env).ownerDocument);
|
|
56
|
+
styleHelper.removeCustomStyle('wrapperCustomStyle', id, (_b = (_a = env.getModalContainer) === null || _a === void 0 ? void 0 : _a.call(env)) === null || _b === void 0 ? void 0 : _b.ownerDocument);
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
}, [wrapperCustomStyle, id]);
|
package/lib/env.d.ts
CHANGED
|
@@ -52,8 +52,16 @@ export interface RendererEnv {
|
|
|
52
52
|
copy?: (contents: string, format?: any) => void;
|
|
53
53
|
getModalContainer?: () => HTMLElement;
|
|
54
54
|
theme: ThemeInstance;
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated
|
|
57
|
+
* 请通过外层设置 `--affix-offset-top` css 变量设置
|
|
58
|
+
*/
|
|
59
|
+
affixOffsetTop?: number;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
* 请通过外层设置 `--affix-offset-bottom` css 变量设置
|
|
63
|
+
*/
|
|
64
|
+
affixOffsetBottom?: number;
|
|
57
65
|
richTextToken: string;
|
|
58
66
|
loadRenderer: (schema: Schema, path: string, reRender: Function) => Promise<React.ElementType> | React.ElementType | JSX.Element | void;
|
|
59
67
|
loadChartExtends?: () => void | Promise<void>;
|
|
@@ -78,7 +86,7 @@ export interface RendererEnv {
|
|
|
78
86
|
/**
|
|
79
87
|
* 文本替换的黑名单,因为属性太多了所以改成黑名单的 flags
|
|
80
88
|
*/
|
|
81
|
-
replaceTextIgnoreKeys?: String[];
|
|
89
|
+
replaceTextIgnoreKeys?: String[] | ((key: string, value: any, object: any) => boolean);
|
|
82
90
|
/**
|
|
83
91
|
* 解析url参数
|
|
84
92
|
*/
|
package/lib/env.js
CHANGED
package/lib/envOverwrite.js
CHANGED
package/lib/factory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -102,8 +102,6 @@ function loadRenderer(schema, path) {
|
|
|
102
102
|
}
|
|
103
103
|
var defaultOptions = {
|
|
104
104
|
session: 'global',
|
|
105
|
-
affixOffsetTop: 0,
|
|
106
|
-
affixOffsetBottom: 0,
|
|
107
105
|
richTextToken: '',
|
|
108
106
|
useMobileUI: true,
|
|
109
107
|
enableAMISDebug: (_b = (_a = window.enableAMISDebug) !== null && _a !== void 0 ? _a : location.search.indexOf('amisDebug=1') !== -1) !== null && _b !== void 0 ? _b : false,
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -132,7 +132,7 @@ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
|
132
132
|
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
133
133
|
var classPrefix = theme.getClassPrefix();
|
|
134
134
|
// @ts-ignore
|
|
135
|
-
var version = '3.
|
|
135
|
+
var version = '3.5.0';
|
|
136
136
|
function render(schema, props, options, pathPrefix) {
|
|
137
137
|
if (props === void 0) { props = {}; }
|
|
138
138
|
if (options === void 0) { options = {}; }
|
|
@@ -256,6 +256,7 @@ exports.ownerDocument = dom.ownerDocument;
|
|
|
256
256
|
exports.renderTextByKeyword = dom.renderTextByKeyword;
|
|
257
257
|
exports.ServerError = errors.ServerError;
|
|
258
258
|
exports.escapeHtml = escapeHtml.escapeHtml;
|
|
259
|
+
exports.filterClassNameObject = filterSchema.filterClassNameObject;
|
|
259
260
|
exports.getExprProperties = filterSchema.getExprProperties;
|
|
260
261
|
exports.formatDuration = formatDuration.formatDuration;
|
|
261
262
|
exports.FormulaExec = formula.FormulaExec;
|
|
@@ -281,6 +282,7 @@ exports.chainEvents = helper.chainEvents;
|
|
|
281
282
|
exports.chainFunctions = helper.chainFunctions;
|
|
282
283
|
exports.changedEffect = helper.changedEffect;
|
|
283
284
|
exports.convertArrayValueToMoment = helper.convertArrayValueToMoment;
|
|
285
|
+
exports.countTree = helper.countTree;
|
|
284
286
|
exports.detectPropValueChanged = helper.detectPropValueChanged;
|
|
285
287
|
exports.difference = helper.difference;
|
|
286
288
|
exports.differenceFromAll = helper.differenceFromAll;
|
|
@@ -337,6 +339,7 @@ exports.normalizeNodePath = helper.normalizeNodePath;
|
|
|
337
339
|
exports.object2formData = helper.object2formData;
|
|
338
340
|
exports.omitControls = helper.omitControls;
|
|
339
341
|
exports.padArr = helper.padArr;
|
|
342
|
+
exports.parsePrimitiveQueryString = helper.parsePrimitiveQueryString;
|
|
340
343
|
exports.parseQuery = helper.parseQuery;
|
|
341
344
|
exports.pickEventsProps = helper.pickEventsProps;
|
|
342
345
|
exports.preventDefault = helper.preventDefault;
|
|
@@ -346,6 +349,7 @@ exports.qsstringify = helper.qsstringify;
|
|
|
346
349
|
exports.range = helper.range;
|
|
347
350
|
exports.removeHTMLTag = helper.removeHTMLTag;
|
|
348
351
|
exports.repeatCount = helper.repeatCount;
|
|
352
|
+
exports.replaceUrlParams = helper.replaceUrlParams;
|
|
349
353
|
exports.rmUndefined = helper.rmUndefined;
|
|
350
354
|
exports.someTree = helper.someTree;
|
|
351
355
|
exports.sortArray = helper.sortArray;
|
package/lib/locale.js
CHANGED
package/lib/polyfills.js
CHANGED
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -722,7 +722,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
722
722
|
clearPersistDataAfterSubmit && store.clearLocalPersistData();
|
|
723
723
|
if (action.redirect || redirect) {
|
|
724
724
|
var finalRedirect = tpl.filter(action.redirect || redirect, store.data);
|
|
725
|
-
finalRedirect && env.jumpTo(finalRedirect, action);
|
|
725
|
+
finalRedirect && env.jumpTo(finalRedirect, action, store.data);
|
|
726
726
|
}
|
|
727
727
|
else if (action.reload || reload) {
|
|
728
728
|
_this.reloadTarget(Scoped.filterTarget(action.reload || reload, store.data), store.data);
|
|
@@ -794,7 +794,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
794
794
|
_a.label = 4;
|
|
795
795
|
case 4:
|
|
796
796
|
redirect = action.redirect && tpl.filter(action.redirect, store.data);
|
|
797
|
-
redirect && env.jumpTo(redirect, action);
|
|
797
|
+
redirect && env.jumpTo(redirect, action, store.data);
|
|
798
798
|
action.reload &&
|
|
799
799
|
this.reloadTarget(Scoped.filterTarget(action.reload, store.data), store.data);
|
|
800
800
|
action.close && this.closeTarget(action.close);
|
package/lib/renderers/Item.d.ts
CHANGED
|
@@ -461,7 +461,7 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
461
461
|
static layoutRenderers: {
|
|
462
462
|
[propsName: string]: (props: FormItemProps, renderControl: () => JSX.Element | null) => JSX.Element;
|
|
463
463
|
};
|
|
464
|
-
render(): JSX.Element | null;
|
|
464
|
+
render(): React.JSX.Element | null;
|
|
465
465
|
}
|
|
466
466
|
export declare const detectProps: string[];
|
|
467
467
|
export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (Control: FormControlComponent) => {
|
|
@@ -618,9 +618,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
618
618
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
619
619
|
addChildId: (id: string) => void;
|
|
620
620
|
removeChildId: (id: string) => void;
|
|
621
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
622
|
-
* 验证失败的提示信息
|
|
623
|
-
*/
|
|
621
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
624
622
|
removeStore(store: {
|
|
625
623
|
id: string;
|
|
626
624
|
path: string;
|
|
@@ -784,9 +782,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
784
782
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
785
783
|
addChildId: (id: string) => void;
|
|
786
784
|
removeChildId: (id: string) => void;
|
|
787
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
788
|
-
* 验证失败的提示信息
|
|
789
|
-
*/
|
|
785
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
790
786
|
removeStore(store: {
|
|
791
787
|
id: string;
|
|
792
788
|
path: string;
|
package/lib/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -14,7 +14,6 @@ var mobx = require('mobx');
|
|
|
14
14
|
var factory = require('../factory.js');
|
|
15
15
|
var helper = require('../utils/helper.js');
|
|
16
16
|
var mobxReact = require('mobx-react');
|
|
17
|
-
var tpl = require('../utils/tpl.js');
|
|
18
17
|
var WithStore = require('../WithStore.js');
|
|
19
18
|
var wrapControl = require('./wrapControl.js');
|
|
20
19
|
var debounce = require('lodash/debounce');
|
|
@@ -31,6 +30,7 @@ require('amis-formula');
|
|
|
31
30
|
require('../utils/debug.js');
|
|
32
31
|
require('../utils/dom.js');
|
|
33
32
|
require('../utils/errors.js');
|
|
33
|
+
require('../utils/tpl.js');
|
|
34
34
|
require('lodash/isPlainObject');
|
|
35
35
|
require('../utils/filter.js');
|
|
36
36
|
require('lodash/isObject');
|
|
@@ -407,7 +407,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
407
407
|
FormItemWrap.layoutRenderers = {
|
|
408
408
|
horizontal: function (props, renderControl) {
|
|
409
409
|
var _a, _b, _c;
|
|
410
|
-
var className = props.className, style = props.style, cx = props.classnames, description = props.description, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, desc = props.desc, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint
|
|
410
|
+
var className = props.className, style = props.style, cx = props.classnames, description = props.description, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, desc = props.desc, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint; props.data; var showErrorMsg = props.showErrorMsg, mobileUI = props.mobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName, id = props.id, wrapperCustomStyle = props.wrapperCustomStyle, themeCss = props.themeCss;
|
|
411
411
|
// 强制不渲染 label 的话
|
|
412
412
|
if (renderLabel === false) {
|
|
413
413
|
label = label === false ? false : '';
|
|
@@ -433,9 +433,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
433
433
|
_b['Form-label-noLabel'] = label === '',
|
|
434
434
|
_b), getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
435
435
|
_J$X_("span", null,
|
|
436
|
-
label
|
|
437
|
-
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
438
|
-
: null,
|
|
436
|
+
label ? render('label', label) : null,
|
|
439
437
|
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
440
438
|
labelRemark
|
|
441
439
|
? render('label-remark', {
|
|
@@ -484,7 +482,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
484
482
|
},
|
|
485
483
|
normal: function (props, renderControl) {
|
|
486
484
|
var _a;
|
|
487
|
-
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint
|
|
485
|
+
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint; props.data; var showErrorMsg = props.showErrorMsg, mobileUI = props.mobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName, themeCss = props.themeCss, wrapperCustomStyle = props.wrapperCustomStyle, id = props.id;
|
|
488
486
|
description = description || desc;
|
|
489
487
|
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--normal", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
490
488
|
'is-error': model && !model.valid
|
|
@@ -493,9 +491,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
493
491
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames, styleHelper.setThemeClassName('wrapperCustomStyle', id, wrapperCustomStyle, 'item')), style: style },
|
|
494
492
|
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)) },
|
|
495
493
|
_J$X_("span", null,
|
|
496
|
-
label
|
|
497
|
-
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
498
|
-
: null,
|
|
494
|
+
label ? render('label', label) : null,
|
|
499
495
|
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
500
496
|
labelRemark
|
|
501
497
|
? render('label-remark', {
|
|
@@ -571,7 +567,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
571
567
|
},
|
|
572
568
|
inline: function (props, renderControl) {
|
|
573
569
|
var _a;
|
|
574
|
-
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, remark = props.remark, labelRemark = props.labelRemark, env = props.env, hint = props.hint, renderLabel = props.renderLabel, renderDescription = props.renderDescription
|
|
570
|
+
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, remark = props.remark, labelRemark = props.labelRemark, env = props.env, hint = props.hint, renderLabel = props.renderLabel, renderDescription = props.renderDescription; props.data; var showErrorMsg = props.showErrorMsg, mobileUI = props.mobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName, themeCss = props.themeCss, wrapperCustomStyle = props.wrapperCustomStyle, id = props.id;
|
|
575
571
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
576
572
|
description = description || desc;
|
|
577
573
|
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--inline", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
@@ -581,9 +577,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
581
577
|
_a), model === null || model === void 0 ? void 0 : model.errClassNames, styleHelper.setThemeClassName('wrapperCustomStyle', id, wrapperCustomStyle, 'item')), style: style },
|
|
582
578
|
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
583
579
|
_J$X_("span", null,
|
|
584
|
-
label
|
|
585
|
-
? render('label', typeof label === 'string' ? tpl.filter(label, data) : label)
|
|
586
|
-
: label,
|
|
580
|
+
label ? render('label', label) : label,
|
|
587
581
|
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
588
582
|
labelRemark
|
|
589
583
|
? render('label-remark', {
|
|
@@ -629,7 +623,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
629
623
|
},
|
|
630
624
|
row: function (props, renderControl) {
|
|
631
625
|
var _a;
|
|
632
|
-
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint
|
|
626
|
+
var className = props.className, style = props.style, cx = props.classnames, desc = props.desc, description = props.description, label = props.label, render = props.render, required = props.required, caption = props.caption, remark = props.remark, labelRemark = props.labelRemark, env = props.env, descriptionClassName = props.descriptionClassName, captionClassName = props.captionClassName, model = props.formItem, renderLabel = props.renderLabel, renderDescription = props.renderDescription, hint = props.hint; props.data; var showErrorMsg = props.showErrorMsg, mobileUI = props.mobileUI; props.translate; var isStatic = props.static, staticClassName = props.staticClassName, wrapperCustomStyle = props.wrapperCustomStyle, themeCss = props.themeCss, id = props.id;
|
|
633
627
|
var labelWidth = props.labelWidth || props.formLabelWidth;
|
|
634
628
|
description = description || desc;
|
|
635
629
|
return (_J$X_("div", { "data-role": "form-item", className: cx("Form-item Form-item--row", isStatic && staticClassName ? staticClassName : className, (_a = {
|
|
@@ -640,7 +634,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
640
634
|
_J$X_("div", { className: cx('Form-rowInner') },
|
|
641
635
|
label && renderLabel !== false ? (_J$X_("label", { className: cx("Form-label", getItemLabelClassName(props)), style: labelWidth != null ? { width: labelWidth } : undefined },
|
|
642
636
|
_J$X_("span", null,
|
|
643
|
-
render('label',
|
|
637
|
+
render('label', label),
|
|
644
638
|
required && (label || labelRemark) ? (_J$X_("span", { className: cx("Form-star") }, "*")) : null,
|
|
645
639
|
labelRemark
|
|
646
640
|
? render('label-remark', {
|
package/lib/renderers/Options.js
CHANGED
package/lib/renderers/builtin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.5.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -27,6 +27,7 @@ var api = require('../utils/api.js');
|
|
|
27
27
|
require('../utils/ColorScale.js');
|
|
28
28
|
require('../utils/columnsSplit.js');
|
|
29
29
|
require('amis-formula');
|
|
30
|
+
var tokenize = require('../utils/tokenize.js');
|
|
30
31
|
require('lodash/isPlainObject');
|
|
31
32
|
var getVariable = require('../utils/getVariable.js');
|
|
32
33
|
require('../utils/DataSchema.js');
|
|
@@ -82,7 +83,7 @@ function wrapControl(ComposedComponent) {
|
|
|
82
83
|
trailing: true,
|
|
83
84
|
leading: false
|
|
84
85
|
});
|
|
85
|
-
var _c = _this.props, form = _c.formStore, formItem$1 = _c.formItem, rootStore = _c.rootStore, store = _c.store, onChange = _c.onChange, data = _c.data, inputGroupControl = _c.inputGroupControl, colIndex = _c.colIndex, rowIndex = _c.rowIndex, _d = _c.$schema,
|
|
86
|
+
var _c = _this.props, form = _c.formStore, formItem$1 = _c.formItem, rootStore = _c.rootStore, store = _c.store, onChange = _c.onChange, data = _c.data, inputGroupControl = _c.inputGroupControl, colIndex = _c.colIndex, rowIndex = _c.rowIndex, _d = _c.$schema, id = _d.id, type = _d.type, required = _d.required, validations = _d.validations, validationErrors = _d.validationErrors, unique = _d.unique, value = _d.value, extraName = _d.extraName; _d.multiple; var delimiter = _d.delimiter, valueField = _d.valueField, labelField = _d.labelField, joinValues = _d.joinValues, extractValue = _d.extractValue, selectFirst = _d.selectFirst, autoFill = _d.autoFill, clearValueOnHidden = _d.clearValueOnHidden, validateApi = _d.validateApi, minLength = _d.minLength, maxLength = _d.maxLength, validateOnChange = _d.validateOnChange, label = _d.label;
|
|
86
87
|
_this.getValue = _this.getValue.bind(_this);
|
|
87
88
|
_this.setValue = _this.setValue.bind(_this);
|
|
88
89
|
_this.handleChange = _this.handleChange.bind(_this);
|
|
@@ -91,6 +92,13 @@ function wrapControl(ComposedComponent) {
|
|
|
91
92
|
_this.handleBlur = _this.handleBlur.bind(_this);
|
|
92
93
|
_this.validate = _this.validate.bind(_this);
|
|
93
94
|
_this.flushChange = _this.flushChange.bind(_this);
|
|
95
|
+
_this.renderChild = _this.renderChild.bind(_this);
|
|
96
|
+
var name = _this.props.$schema.name;
|
|
97
|
+
// 如果 name 是表达式
|
|
98
|
+
// 扩充 each 用法
|
|
99
|
+
if (formula.isExpression(name)) {
|
|
100
|
+
name = tokenize.tokenize(name, data);
|
|
101
|
+
}
|
|
94
102
|
if (!name) {
|
|
95
103
|
// 一般情况下这些表单项都是需要 name 的,提示一下
|
|
96
104
|
if (typeof type === 'string' &&
|
|
@@ -180,7 +188,7 @@ function wrapControl(ComposedComponent) {
|
|
|
180
188
|
}
|
|
181
189
|
class_1.prototype.componentDidMount = function () {
|
|
182
190
|
var _this = this;
|
|
183
|
-
var _a = this.props; _a.store; _a.formStore; var
|
|
191
|
+
var _a = this.props; _a.store; _a.formStore; var validate = _a.$schema.validate, addHook = _a.addHook;
|
|
184
192
|
// 提交前先把之前的 lazyEmit 执行一下。
|
|
185
193
|
this.hook3 = function () {
|
|
186
194
|
_this.lazyEmitChange.flush();
|
|
@@ -191,7 +199,7 @@ function wrapControl(ComposedComponent) {
|
|
|
191
199
|
var finalValidate_1 = helper.promisify(validate.bind(this.control));
|
|
192
200
|
this.hook2 = function () {
|
|
193
201
|
formItem.clearError('control:valdiate');
|
|
194
|
-
return finalValidate_1(_this.props.data, _this.getValue(), name).then(function (ret) {
|
|
202
|
+
return finalValidate_1(_this.props.data, _this.getValue(), formItem.name).then(function (ret) {
|
|
195
203
|
if ((typeof ret === 'string' || Array.isArray(ret)) && ret) {
|
|
196
204
|
formItem.addError(ret, 'control:valdiate');
|
|
197
205
|
}
|
|
@@ -330,7 +338,7 @@ function wrapControl(ComposedComponent) {
|
|
|
330
338
|
};
|
|
331
339
|
class_1.prototype.controlRef = function (control) {
|
|
332
340
|
var _this = this;
|
|
333
|
-
var _a = this.props, addHook = _a.addHook, removeHook = _a.removeHook; _a.formStore;
|
|
341
|
+
var _a = this.props, addHook = _a.addHook, removeHook = _a.removeHook; _a.formStore;
|
|
334
342
|
// 因为 control 有可能被 n 层 hoc 包裹。
|
|
335
343
|
while (control && control.getWrappedInstance) {
|
|
336
344
|
control = control.getWrappedInstance();
|
|
@@ -340,9 +348,8 @@ function wrapControl(ComposedComponent) {
|
|
|
340
348
|
var validate_1 = helper.promisify(control.validate.bind(control));
|
|
341
349
|
this.hook = function () {
|
|
342
350
|
formItem_1.clearError('component:valdiate');
|
|
343
|
-
return validate_1(_this.props.data, _this.getValue(), name).then(function (ret) {
|
|
344
|
-
if ((typeof ret === 'string' || Array.isArray(ret)) &&
|
|
345
|
-
ret) {
|
|
351
|
+
return validate_1(_this.props.data, _this.getValue(), formItem_1.name).then(function (ret) {
|
|
352
|
+
if ((typeof ret === 'string' || Array.isArray(ret)) && ret) {
|
|
346
353
|
formItem_1.setError(ret, 'component:valdiate');
|
|
347
354
|
}
|
|
348
355
|
});
|
|
@@ -450,7 +457,7 @@ function wrapControl(ComposedComponent) {
|
|
|
450
457
|
};
|
|
451
458
|
class_1.prototype.emitChange = function (submitOnChange) {
|
|
452
459
|
if (submitOnChange === void 0) { submitOnChange = this.props.$schema.submitOnChange; }
|
|
453
|
-
var _a = this.props, form = _a.formStore, onChange = _a.onChange, _b = _a.$schema,
|
|
460
|
+
var _a = this.props, form = _a.formStore, onChange = _a.onChange, _b = _a.$schema, id = _b.id, label = _b.label, type = _b.type, onFormItemChange = _b.onChange; _b.maxLength; _b.minLength; var data = _a.data, env = _a.env; _a.validateOnChange; _a.formSubmited;
|
|
454
461
|
if (!this.model) {
|
|
455
462
|
return;
|
|
456
463
|
}
|
|
@@ -470,7 +477,7 @@ function wrapControl(ComposedComponent) {
|
|
|
470
477
|
eventType: 'formItemChange',
|
|
471
478
|
eventData: {
|
|
472
479
|
id: id,
|
|
473
|
-
name: name,
|
|
480
|
+
name: model.name,
|
|
474
481
|
label: label,
|
|
475
482
|
type: type,
|
|
476
483
|
value: value
|
|
@@ -487,11 +494,11 @@ function wrapControl(ComposedComponent) {
|
|
|
487
494
|
}
|
|
488
495
|
if (model.extraName) {
|
|
489
496
|
var values = model.splitExtraValue(value);
|
|
490
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(values[0], name);
|
|
497
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values[0], model.name);
|
|
491
498
|
onChange === null || onChange === void 0 ? void 0 : onChange(values[1], model.extraName, submitOnChange === true);
|
|
492
499
|
}
|
|
493
500
|
else {
|
|
494
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value, name, submitOnChange === true);
|
|
501
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value, model.name, submitOnChange === true);
|
|
495
502
|
}
|
|
496
503
|
this.checkValidate();
|
|
497
504
|
};
|
|
@@ -507,17 +514,17 @@ function wrapControl(ComposedComponent) {
|
|
|
507
514
|
return;
|
|
508
515
|
}
|
|
509
516
|
var model = this.model;
|
|
510
|
-
var _a = this.props; _a.formStore; var
|
|
517
|
+
var _a = this.props; _a.formStore; var pipeOut = _a.$schema.pipeOut, onChange = _a.onChange, oldValue = _a.value, data = _a.data;
|
|
511
518
|
if (pipeOut) {
|
|
512
519
|
value = api.callStrFunction.call(this, pipeOut, ['value', 'oldValue', 'data'], value, oldValue, data);
|
|
513
520
|
}
|
|
514
521
|
if (model.extraName) {
|
|
515
522
|
var values = model.splitExtraValue(value);
|
|
516
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(values[0], name, false, true);
|
|
523
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values[0], model.name, false, true);
|
|
517
524
|
onChange === null || onChange === void 0 ? void 0 : onChange(values[1], model.extraName, false, true);
|
|
518
525
|
}
|
|
519
526
|
else {
|
|
520
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value, name, false, true);
|
|
527
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value, model.name, false, true);
|
|
521
528
|
}
|
|
522
529
|
};
|
|
523
530
|
class_1.prototype.getValue = function () {
|
|
@@ -531,8 +538,8 @@ function wrapControl(ComposedComponent) {
|
|
|
531
538
|
// 兼容老版本用法,新版本直接用 onChange 就可以。
|
|
532
539
|
class_1.prototype.setValue = function (value, key) {
|
|
533
540
|
var _a;
|
|
534
|
-
var
|
|
535
|
-
if (!key || key === name) {
|
|
541
|
+
var onBulkChange = this.props.onBulkChange;
|
|
542
|
+
if (!key || (this.model && key === this.model.name)) {
|
|
536
543
|
this.handleChange(value);
|
|
537
544
|
}
|
|
538
545
|
else {
|
|
@@ -542,9 +549,17 @@ function wrapControl(ComposedComponent) {
|
|
|
542
549
|
_a));
|
|
543
550
|
}
|
|
544
551
|
};
|
|
552
|
+
class_1.prototype.renderChild = function (region, node, subProps) {
|
|
553
|
+
if (subProps === void 0) { subProps = {}; }
|
|
554
|
+
var _a = this.props, render = _a.render, data = _a.data, store = _a.store;
|
|
555
|
+
var model = this.model;
|
|
556
|
+
return render(region, node, tslib.__assign({ data: model
|
|
557
|
+
? model.getMergedData(data || (store === null || store === void 0 ? void 0 : store.data))
|
|
558
|
+
: data || (store === null || store === void 0 ? void 0 : store.data) }, subProps));
|
|
559
|
+
};
|
|
545
560
|
class_1.prototype.render = function () {
|
|
546
|
-
var _a, _b;
|
|
547
|
-
var
|
|
561
|
+
var _a, _b, _c;
|
|
562
|
+
var _d = this.props, controlWidth = _d.controlWidth, disabled = _d.disabled, formMode = _d.formMode, control = _d.$schema, store = _d.store, data = _d.data, invisible = _d.invisible, defaultStatic = _d.defaultStatic;
|
|
548
563
|
if (invisible) {
|
|
549
564
|
return null;
|
|
550
565
|
}
|
|
@@ -557,7 +572,10 @@ function wrapControl(ComposedComponent) {
|
|
|
557
572
|
formItem: this.model,
|
|
558
573
|
formMode: control.mode || formMode,
|
|
559
574
|
ref: this.controlRef,
|
|
560
|
-
data:
|
|
575
|
+
data: model
|
|
576
|
+
? model.getMergedData(data || (store === null || store === void 0 ? void 0 : store.data))
|
|
577
|
+
: data || (store === null || store === void 0 ? void 0 : store.data),
|
|
578
|
+
name: (_c = model === null || model === void 0 ? void 0 : model.name) !== null && _c !== void 0 ? _c : control.name,
|
|
561
579
|
value: value,
|
|
562
580
|
changeMotivation: model === null || model === void 0 ? void 0 : model.changeMotivation,
|
|
563
581
|
defaultValue: control.value,
|
|
@@ -569,7 +587,8 @@ function wrapControl(ComposedComponent) {
|
|
|
569
587
|
prinstine: model ? model.prinstine : undefined,
|
|
570
588
|
setPrinstineValue: this.setPrinstineValue,
|
|
571
589
|
onValidate: this.validate,
|
|
572
|
-
onFlushChange: this.flushChange
|
|
590
|
+
onFlushChange: this.flushChange,
|
|
591
|
+
render: this.renderChild // 如果覆盖,那么用的就是 form 上的 render,这个里面用到的 data 是比较旧的。
|
|
573
592
|
// !没了这个, tree 里的 options 渲染会出问题
|
|
574
593
|
// todo 理论上不应该影响,待确认
|
|
575
594
|
// _filteredOptions: this.model?.filteredOptions
|