amis-core 6.2.2 → 6.3.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.d.ts +1 -1
- package/esm/RootRenderer.js +28 -10
- package/esm/SchemaRenderer.js +15 -6
- package/esm/Scoped.d.ts +1 -1
- package/esm/Scoped.js +3 -1
- package/esm/StatusScoped.js +4 -2
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +28 -17
- package/esm/actions/Action.js +2 -2
- 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 +2 -2
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +2 -2
- package/esm/actions/DialogAction.d.ts +8 -0
- package/esm/actions/DialogAction.js +95 -35
- package/esm/actions/DrawerAction.d.ts +5 -0
- package/esm/actions/DrawerAction.js +66 -11
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.d.ts +20 -0
- package/esm/actions/EventAction.js +102 -0
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/actions/WaitAction.d.ts +18 -0
- package/esm/actions/WaitAction.js +41 -0
- package/esm/actions/index.d.ts +2 -0
- package/esm/components/CustomStyle.js +1 -1
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.d.ts +3 -0
- package/esm/components/Overlay.js +7 -4
- package/esm/components/PopOver.js +2 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +2 -0
- package/esm/factory.js +1 -1
- package/esm/index.js +6 -4
- package/esm/locale.js +4 -2
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +3 -2
- package/esm/renderers/Form.js +82 -25
- package/esm/renderers/Item.d.ts +123 -79
- package/esm/renderers/Item.js +159 -60
- package/esm/renderers/Options.d.ts +0 -11
- package/esm/renderers/Options.js +20 -84
- package/esm/renderers/Placeholder.js +1 -1
- package/esm/renderers/builtin.js +1 -1
- package/esm/renderers/register.js +1 -1
- package/esm/renderers/wrapControl.d.ts +2 -1
- package/esm/renderers/wrapControl.js +4 -2
- package/esm/store/app.d.ts +5 -5
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +255 -63
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +5 -5
- package/esm/store/crud.js +1 -1
- package/esm/store/form.d.ts +105 -25
- package/esm/store/form.js +33 -15
- package/esm/store/formItem.d.ts +6 -2
- package/esm/store/formItem.js +68 -5
- package/esm/store/iRenderer.d.ts +5 -5
- package/esm/store/iRenderer.js +23 -10
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +5 -5
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +5 -5
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +5 -5
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.d.ts +5 -5
- package/esm/store/root.js +1 -1
- package/esm/store/service.d.ts +5 -5
- package/esm/store/service.js +2 -2
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +243 -55
- package/esm/store/table.js +23 -9
- package/esm/store/table2.d.ts +5 -5
- package/esm/store/table2.js +1 -1
- package/esm/theme.js +4 -2
- package/esm/types.d.ts +7 -1
- 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 +1 -1
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.d.ts +2 -2
- package/esm/utils/dom.js +70 -11
- package/esm/utils/errors.js +1 -1
- package/esm/utils/escapeHtml.js +1 -1
- package/esm/utils/filter-schema.js +1 -1
- package/esm/utils/filter.js +1 -1
- package/esm/utils/formatDuration.js +1 -1
- package/esm/utils/formula.js +2 -2
- package/esm/utils/getVariable.js +1 -1
- package/esm/utils/grammar.js +1 -1
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +12 -6
- package/esm/utils/helper.js +39 -16
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/memoryParse.js +1 -1
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.d.ts +11 -0
- package/esm/utils/renderer-event.js +99 -2
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +1 -1
- package/esm/utils/resolveCondition.js +1 -1
- package/esm/utils/resolveVariable.js +1 -1
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/esm/utils/scrollPosition.js +1 -1
- package/esm/utils/string2regExp.js +1 -1
- package/esm/utils/stripNumber.d.ts +1 -1
- package/esm/utils/stripNumber.js +4 -3
- package/esm/utils/style-helper.d.ts +21 -2
- package/esm/utils/style-helper.js +55 -10
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +5 -2
- package/esm/utils/validations.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.d.ts +1 -1
- package/lib/RootRenderer.js +28 -10
- package/lib/SchemaRenderer.js +14 -5
- package/lib/Scoped.d.ts +1 -1
- package/lib/Scoped.js +3 -1
- package/lib/StatusScoped.js +4 -2
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +28 -17
- package/lib/actions/Action.js +2 -2
- 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 +2 -2
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +1 -1
- package/lib/actions/DialogAction.d.ts +8 -0
- package/lib/actions/DialogAction.js +98 -35
- package/lib/actions/DrawerAction.d.ts +5 -0
- package/lib/actions/DrawerAction.js +69 -11
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.d.ts +20 -0
- package/lib/actions/EventAction.js +109 -0
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/actions/WaitAction.d.ts +18 -0
- package/lib/actions/WaitAction.js +45 -0
- package/lib/actions/index.d.ts +2 -0
- package/lib/components/CustomStyle.js +1 -1
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.d.ts +3 -0
- package/lib/components/Overlay.js +7 -4
- package/lib/components/PopOver.js +1 -1
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +2 -0
- package/lib/factory.js +1 -1
- package/lib/index.js +6 -4
- package/lib/locale.js +4 -2
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +3 -2
- package/lib/renderers/Form.js +83 -24
- package/lib/renderers/Item.d.ts +123 -79
- package/lib/renderers/Item.js +158 -58
- package/lib/renderers/Options.d.ts +0 -11
- package/lib/renderers/Options.js +19 -84
- package/lib/renderers/Placeholder.js +1 -1
- package/lib/renderers/builtin.js +1 -1
- package/lib/renderers/register.js +1 -1
- package/lib/renderers/wrapControl.d.ts +2 -1
- package/lib/renderers/wrapControl.js +4 -2
- package/lib/store/app.d.ts +5 -5
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +255 -63
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +5 -5
- package/lib/store/crud.js +1 -1
- package/lib/store/form.d.ts +105 -25
- package/lib/store/form.js +33 -15
- package/lib/store/formItem.d.ts +6 -2
- package/lib/store/formItem.js +67 -4
- package/lib/store/iRenderer.d.ts +5 -5
- package/lib/store/iRenderer.js +23 -10
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +5 -5
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +5 -5
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +5 -5
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.d.ts +5 -5
- package/lib/store/root.js +1 -1
- package/lib/store/service.d.ts +5 -5
- package/lib/store/service.js +2 -2
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +243 -55
- package/lib/store/table.js +23 -9
- package/lib/store/table2.d.ts +5 -5
- package/lib/store/table2.js +1 -1
- package/lib/theme.js +4 -2
- package/lib/types.d.ts +7 -1
- 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 +1 -1
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.d.ts +2 -2
- package/lib/utils/dom.js +70 -11
- package/lib/utils/errors.js +1 -1
- package/lib/utils/escapeHtml.js +1 -1
- package/lib/utils/filter-schema.js +1 -1
- package/lib/utils/filter.js +1 -1
- package/lib/utils/formatDuration.js +1 -1
- package/lib/utils/formula.js +2 -2
- package/lib/utils/getVariable.js +1 -1
- package/lib/utils/grammar.js +1 -1
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +12 -6
- package/lib/utils/helper.js +39 -17
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- package/lib/utils/memoryParse.js +1 -1
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.d.ts +11 -0
- package/lib/utils/renderer-event.js +99 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +1 -1
- package/lib/utils/resolveCondition.js +1 -1
- package/lib/utils/resolveVariable.js +1 -1
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +1 -1
- package/lib/utils/scrollPosition.js +1 -1
- package/lib/utils/string2regExp.js +1 -1
- package/lib/utils/stripNumber.d.ts +1 -1
- package/lib/utils/stripNumber.js +4 -3
- package/lib/utils/style-helper.d.ts +21 -2
- package/lib/utils/style-helper.js +55 -10
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +9 -2
- package/lib/utils/validations.js +1 -1
- package/package.json +5 -3
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.3.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -41,7 +41,7 @@ require('../utils/highlight.js');
|
|
|
41
41
|
require('../utils/icon.js');
|
|
42
42
|
require('../utils/image.js');
|
|
43
43
|
require('lodash/isPlainObject');
|
|
44
|
-
require('lodash/isEqual');
|
|
44
|
+
var isEqual = require('lodash/isEqual');
|
|
45
45
|
require('../actions/Action.js');
|
|
46
46
|
require('../utils/resize-sensor.js');
|
|
47
47
|
require('react-overlays/useRootClose');
|
|
@@ -59,6 +59,7 @@ require('../utils/validations.js');
|
|
|
59
59
|
require('../utils/resolveCondition.js');
|
|
60
60
|
var mobx = require('mobx');
|
|
61
61
|
require('../utils/Animation.js');
|
|
62
|
+
var groupBy = require('lodash/groupBy');
|
|
62
63
|
|
|
63
64
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
64
65
|
|
|
@@ -66,6 +67,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
66
67
|
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
67
68
|
var flatten__default = /*#__PURE__*/_interopDefaultLegacy(flatten);
|
|
68
69
|
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
70
|
+
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
71
|
+
var groupBy__default = /*#__PURE__*/_interopDefaultLegacy(groupBy);
|
|
69
72
|
|
|
70
73
|
var __react_jsx__ = require('react');
|
|
71
74
|
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
@@ -83,6 +86,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
83
86
|
});
|
|
84
87
|
// 如果开启了 lazyChange,需要一个 flush 方法把队列中值应用上。
|
|
85
88
|
_this.flushing = false;
|
|
89
|
+
_this.emittedData = null;
|
|
86
90
|
_this.onInit = _this.onInit.bind(_this);
|
|
87
91
|
_this.handleAction = _this.handleAction.bind(_this);
|
|
88
92
|
_this.handleQuery = _this.handleQuery.bind(_this);
|
|
@@ -285,7 +289,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
285
289
|
};
|
|
286
290
|
Form.prototype.onInit = function () {
|
|
287
291
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
288
|
-
var _a, onInit, store, persistData, submitOnInit, data, initedAt, hooks;
|
|
292
|
+
var _a, onInit, store, persistData, submitOnInit, data, initedAt, hooks, groupedHooks;
|
|
289
293
|
return tslib.__generator(this, function (_b) {
|
|
290
294
|
switch (_b.label) {
|
|
291
295
|
case 0:
|
|
@@ -297,8 +301,23 @@ var Form = /** @class */ (function (_super) {
|
|
|
297
301
|
initedAt = store.initedAt;
|
|
298
302
|
store.setInited(true);
|
|
299
303
|
hooks = this.hooks['init'] || [];
|
|
300
|
-
|
|
304
|
+
groupedHooks = groupBy__default["default"](hooks, function (item) {
|
|
305
|
+
return item.__enforce === 'prev'
|
|
306
|
+
? 'prev'
|
|
307
|
+
: item.__enforce === 'post'
|
|
308
|
+
? 'post'
|
|
309
|
+
: 'normal';
|
|
310
|
+
});
|
|
311
|
+
return [4 /*yield*/, Promise.all((groupedHooks.prev || []).map(function (hook) { return hook(data); }))];
|
|
301
312
|
case 1:
|
|
313
|
+
_b.sent();
|
|
314
|
+
// 有可能在前面的步骤中删除了钩子,所以需要重新验证一下
|
|
315
|
+
return [4 /*yield*/, Promise.all((groupedHooks.normal || []).map(function (hook) { return hooks.includes(hook) && hook(data); }))];
|
|
316
|
+
case 2:
|
|
317
|
+
// 有可能在前面的步骤中删除了钩子,所以需要重新验证一下
|
|
318
|
+
_b.sent();
|
|
319
|
+
return [4 /*yield*/, Promise.all((groupedHooks.post || []).map(function (hook) { return hooks.includes(hook) && hook(data); }))];
|
|
320
|
+
case 3:
|
|
302
321
|
_b.sent();
|
|
303
322
|
if (!mobxStateTree.isAlive(store)) {
|
|
304
323
|
return [2 /*return*/];
|
|
@@ -496,11 +515,13 @@ var Form = /** @class */ (function (_super) {
|
|
|
496
515
|
var _a = this.props, store = _a.store, onReset = _a.onReset;
|
|
497
516
|
store.reset(onReset);
|
|
498
517
|
};
|
|
499
|
-
Form.prototype.addHook = function (fn, type) {
|
|
518
|
+
Form.prototype.addHook = function (fn, type, enforce) {
|
|
500
519
|
var _this = this;
|
|
501
520
|
if (type === void 0) { type = 'validate'; }
|
|
502
521
|
this.hooks[type] = this.hooks[type] || [];
|
|
503
|
-
|
|
522
|
+
var hook = type === 'flush' ? fn : helper.promisify(fn);
|
|
523
|
+
hook.__enforce = enforce;
|
|
524
|
+
this.hooks[type].push(hook);
|
|
504
525
|
return function () {
|
|
505
526
|
_this.removeHook(fn, type);
|
|
506
527
|
fn = helper.noop;
|
|
@@ -551,9 +572,11 @@ var Form = /** @class */ (function (_super) {
|
|
|
551
572
|
return [2 /*return*/];
|
|
552
573
|
}
|
|
553
574
|
diff = helper.difference(store.data, store.pristine);
|
|
554
|
-
if (skipIfNothingChanges &&
|
|
575
|
+
if (skipIfNothingChanges &&
|
|
576
|
+
(!Object.keys(diff).length || isEqual__default["default"](store.data, this.emittedData))) {
|
|
555
577
|
return [2 /*return*/];
|
|
556
578
|
}
|
|
579
|
+
this.emittedData = store.data;
|
|
557
580
|
changeProps = [store.data, diff, this.props];
|
|
558
581
|
return [4 /*yield*/, dispatchEvent('change', object.createObject(data, store.data))];
|
|
559
582
|
case 1:
|
|
@@ -673,7 +696,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
673
696
|
if ((dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented) || submitEvent) {
|
|
674
697
|
return [2 /*return*/];
|
|
675
698
|
}
|
|
676
|
-
store.setCurrentAction(action);
|
|
699
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
677
700
|
if (action.actionType === 'reset-and-submit') {
|
|
678
701
|
store.reset(this.handleReset(action));
|
|
679
702
|
}
|
|
@@ -709,10 +732,28 @@ var Form = /** @class */ (function (_super) {
|
|
|
709
732
|
this.reloadTarget(Scoped.filterTarget(action.target, values), values);
|
|
710
733
|
}
|
|
711
734
|
else if (action.actionType === 'dialog') {
|
|
712
|
-
|
|
735
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
736
|
+
store.openDialog(data, undefined, function (confirmed, value) {
|
|
737
|
+
var _a;
|
|
738
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
739
|
+
resolve({
|
|
740
|
+
confirmed: confirmed,
|
|
741
|
+
value: value
|
|
742
|
+
});
|
|
743
|
+
}, delegate || _this.context);
|
|
744
|
+
})];
|
|
713
745
|
}
|
|
714
746
|
else if (action.actionType === 'drawer') {
|
|
715
|
-
|
|
747
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
748
|
+
store.openDrawer(data, undefined, function (confirmed, value) {
|
|
749
|
+
var _a;
|
|
750
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
751
|
+
resolve({
|
|
752
|
+
confirmed: confirmed,
|
|
753
|
+
value: value
|
|
754
|
+
});
|
|
755
|
+
});
|
|
756
|
+
})];
|
|
716
757
|
}
|
|
717
758
|
else if (api.isEffectiveApi(action.api || api$1, values)) {
|
|
718
759
|
finnalAsyncApi_1 = action.asyncApi || asyncApi;
|
|
@@ -835,27 +876,45 @@ var Form = /** @class */ (function (_super) {
|
|
|
835
876
|
})];
|
|
836
877
|
case 8:
|
|
837
878
|
if (action.type === 'reset' || action.actionType === 'reset') {
|
|
838
|
-
store.setCurrentAction(action);
|
|
879
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
839
880
|
store.reset(onReset);
|
|
840
881
|
}
|
|
841
882
|
else if (action.actionType === 'clear') {
|
|
842
|
-
store.setCurrentAction(action);
|
|
883
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
843
884
|
store.clear(onReset);
|
|
844
885
|
}
|
|
845
886
|
else if (action.actionType === 'validate') {
|
|
846
|
-
store.setCurrentAction(action);
|
|
887
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
847
888
|
return [2 /*return*/, this.validate(true, throwErrors, true, true)];
|
|
848
889
|
}
|
|
849
890
|
else if (action.actionType === 'dialog') {
|
|
850
|
-
store.setCurrentAction(action);
|
|
851
|
-
|
|
891
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
892
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
893
|
+
store.openDialog(data, undefined, function (confirmed, value) {
|
|
894
|
+
var _a;
|
|
895
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
896
|
+
resolve({
|
|
897
|
+
confirmed: confirmed,
|
|
898
|
+
value: value
|
|
899
|
+
});
|
|
900
|
+
}, delegate || _this.context);
|
|
901
|
+
})];
|
|
852
902
|
}
|
|
853
903
|
else if (action.actionType === 'drawer') {
|
|
854
|
-
store.setCurrentAction(action);
|
|
855
|
-
|
|
904
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
905
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
906
|
+
store.openDrawer(data, undefined, function (confirmed, value) {
|
|
907
|
+
var _a;
|
|
908
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
909
|
+
resolve({
|
|
910
|
+
confirmed: confirmed,
|
|
911
|
+
value: value
|
|
912
|
+
});
|
|
913
|
+
});
|
|
914
|
+
})];
|
|
856
915
|
}
|
|
857
916
|
else if (action.actionType === 'ajax') {
|
|
858
|
-
store.setCurrentAction(action);
|
|
917
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
859
918
|
if (!api.isEffectiveApi(action.api)) {
|
|
860
919
|
return [2 /*return*/, env.alert(__("\u5F53 actionType \u4E3A ajax \u65F6\uFF0C\u8BF7\u8BBE\u7F6E api \u5C5E\u6027"))];
|
|
861
920
|
}
|
|
@@ -907,7 +966,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
907
966
|
})];
|
|
908
967
|
}
|
|
909
968
|
else if (action.actionType === 'reload') {
|
|
910
|
-
store.setCurrentAction(action);
|
|
969
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
911
970
|
if (action.target) {
|
|
912
971
|
this.reloadTarget(Scoped.filterTarget(action.target, data), data);
|
|
913
972
|
}
|
|
@@ -952,7 +1011,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
952
1011
|
targets[0].props.type === 'form') {
|
|
953
1012
|
this.handleBulkChange(values[0], false);
|
|
954
1013
|
}
|
|
955
|
-
store.closeDialog(true);
|
|
1014
|
+
store.closeDialog(true, values);
|
|
956
1015
|
};
|
|
957
1016
|
Form.prototype.handleDialogClose = function (confirmed) {
|
|
958
1017
|
if (confirmed === void 0) { confirmed = false; }
|
|
@@ -969,7 +1028,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
969
1028
|
onChange &&
|
|
970
1029
|
onChange(store.data, helper.difference(store.data, store.pristine), this.props);
|
|
971
1030
|
}
|
|
972
|
-
store.closeDrawer(true);
|
|
1031
|
+
store.closeDrawer(true, values);
|
|
973
1032
|
};
|
|
974
1033
|
Form.prototype.handleDrawerClose = function () {
|
|
975
1034
|
var store = this.props.store;
|
|
@@ -992,7 +1051,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
992
1051
|
type: 'button',
|
|
993
1052
|
actionType: 'dialog',
|
|
994
1053
|
dialog: dialog
|
|
995
|
-
});
|
|
1054
|
+
}, _this.props.resolveDefinitions);
|
|
996
1055
|
store.openDialog(ctx, undefined, function (confirmed) {
|
|
997
1056
|
resolve(confirmed);
|
|
998
1057
|
}, _this.context);
|
|
@@ -1133,14 +1192,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
1133
1192
|
return render("".concat(region ? "".concat(region, "/") : '').concat(key), subSchema, subProps);
|
|
1134
1193
|
};
|
|
1135
1194
|
Form.prototype.renderBody = function () {
|
|
1136
|
-
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, loadingConfig = _a.loadingConfig
|
|
1195
|
+
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, loadingConfig = _a.loadingConfig; _a.testid;
|
|
1137
1196
|
var restError = store.restError;
|
|
1138
1197
|
var WrapperComponent = this.props.wrapperComponent ||
|
|
1139
1198
|
(/(?:\/|^)form\//.test($path) ? 'div' : 'form');
|
|
1140
1199
|
var padDom = helper.repeatCount(columnCount && Array.isArray(body)
|
|
1141
1200
|
? (columnCount - (body.length % columnCount)) % columnCount
|
|
1142
1201
|
: 0, function (index) { return (_J$X_("div", { className: cx("Form-item Form-item--".concat(mode, " is-placeholder")), key: index })); });
|
|
1143
|
-
return (_J$X_(WrapperComponent,
|
|
1202
|
+
return (_J$X_(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 },
|
|
1144
1203
|
_J$X_("input", { type: "submit", style: { display: 'none' } }),
|
|
1145
1204
|
debug
|
|
1146
1205
|
? render('form-debug-json', tslib.__assign({ type: 'json', value: store.data, ellipsisThreshold: 120, className: cx('Form--debug') }, debugConfig))
|
package/lib/renderers/Item.d.ts
CHANGED
|
@@ -292,6 +292,62 @@ export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
|
292
292
|
* 远端校验表单项接口
|
|
293
293
|
*/
|
|
294
294
|
validateApi?: string | BaseApiObject;
|
|
295
|
+
/**
|
|
296
|
+
* 自动填充,当选项被选择的时候,将选项中的其他值同步设置到表单内。
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
299
|
+
autoFill?: {
|
|
300
|
+
[propName: string]: string;
|
|
301
|
+
} | {
|
|
302
|
+
/**
|
|
303
|
+
* 是否为参照录入模式,参照录入会展示候选值供用户选择,而不是直接填充。
|
|
304
|
+
*/
|
|
305
|
+
showSuggestion?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* 自动填充 api
|
|
308
|
+
*/
|
|
309
|
+
api?: BaseApiObject | string;
|
|
310
|
+
/**
|
|
311
|
+
* 是否展示数据格式错误提示,默认为不展示
|
|
312
|
+
* @default true
|
|
313
|
+
*/
|
|
314
|
+
silent?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* 填充时的数据映射
|
|
317
|
+
*/
|
|
318
|
+
fillMappinng?: {
|
|
319
|
+
[propName: string]: any;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* 触发条件,默认为 change
|
|
323
|
+
*/
|
|
324
|
+
trigger?: 'change' | 'foucs';
|
|
325
|
+
/**
|
|
326
|
+
* 弹窗方式,当为参照录入时用可以配置
|
|
327
|
+
*/
|
|
328
|
+
mode?: 'popOver' | 'dialog' | 'drawer';
|
|
329
|
+
/**
|
|
330
|
+
* 当参照录入为抽屉时可以配置弹出位置
|
|
331
|
+
*/
|
|
332
|
+
position?: string;
|
|
333
|
+
/**
|
|
334
|
+
* 当为参照录入时可以配置弹出容器的大小
|
|
335
|
+
*/
|
|
336
|
+
size?: string;
|
|
337
|
+
/**
|
|
338
|
+
* 参照录入展示的项
|
|
339
|
+
*/
|
|
340
|
+
columns?: Array<any>;
|
|
341
|
+
/**
|
|
342
|
+
* 参照录入时的过滤条件
|
|
343
|
+
*/
|
|
344
|
+
filter?: any;
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* @default fillIfNotSet
|
|
348
|
+
* 初始化时是否把其他字段同步到表单内部。
|
|
349
|
+
*/
|
|
350
|
+
initAutoFill?: boolean | 'fillIfNotSet';
|
|
295
351
|
}
|
|
296
352
|
export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
|
297
353
|
type?: string;
|
|
@@ -338,7 +394,7 @@ export interface FormItemProps extends RendererProps {
|
|
|
338
394
|
onBulkChange?: (values: {
|
|
339
395
|
[propName: string]: any;
|
|
340
396
|
}, submitOnChange?: boolean) => void;
|
|
341
|
-
addHook: (fn: Function, mode?: 'validate' | 'init' | 'flush') => () => void;
|
|
397
|
+
addHook: (fn: Function, mode?: 'validate' | 'init' | 'flush', enforce?: 'prev' | 'post') => () => void;
|
|
342
398
|
removeHook: (fn: Function, mode?: 'validate' | 'init' | 'flush') => void;
|
|
343
399
|
renderFormItems: (schema: Partial<FormSchemaBase>, region: string, props: any) => JSX.Element;
|
|
344
400
|
onFocus: (e: any) => void;
|
|
@@ -361,7 +417,6 @@ export interface FormItemProps extends RendererProps {
|
|
|
361
417
|
};
|
|
362
418
|
error?: string;
|
|
363
419
|
showErrorMsg?: boolean;
|
|
364
|
-
testid?: string;
|
|
365
420
|
}
|
|
366
421
|
export type FormControlProps = RendererProps & {
|
|
367
422
|
onOpenDialog: (schema: Schema, data: any) => Promise<any>;
|
|
@@ -372,24 +427,29 @@ export interface FormItemConfig extends FormItemBasicConfig {
|
|
|
372
427
|
component: FormControlComponent;
|
|
373
428
|
}
|
|
374
429
|
export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
375
|
-
reaction: Array<() => void>;
|
|
376
430
|
lastSearchTerm: any;
|
|
377
431
|
target: HTMLElement;
|
|
432
|
+
mounted: boolean;
|
|
433
|
+
initedOptionFilled: boolean;
|
|
434
|
+
initedApiFilled: boolean;
|
|
435
|
+
toDispose: Array<() => void>;
|
|
378
436
|
constructor(props: FormItemProps);
|
|
379
|
-
componentDidUpdate(prevProps: FormItemProps): void;
|
|
380
437
|
componentDidMount(): void;
|
|
438
|
+
componentDidUpdate(prevProps: FormItemProps): void;
|
|
381
439
|
componentWillUnmount(): void;
|
|
382
440
|
handleFocus(e: any): void;
|
|
383
441
|
handleBlur(e: any): void;
|
|
384
442
|
handleAutoFill(type: string): void;
|
|
385
443
|
updateAutoFillData(context: any): void;
|
|
386
|
-
|
|
387
|
-
|
|
444
|
+
syncApiAutoFill: import("lodash").DebouncedFunc<(term: any, forceLoad?: boolean, skipIfExits?: any) => Promise<void>>;
|
|
445
|
+
syncOptionAutoFill(selectedOptions: Array<any>, skipIfExits?: boolean): void;
|
|
446
|
+
buildAutoFillSchema(): React.JSX.Element | {
|
|
388
447
|
type: any;
|
|
389
448
|
className: string;
|
|
390
449
|
title: any;
|
|
391
450
|
size: any;
|
|
392
451
|
body: {
|
|
452
|
+
wrapWithPanel: boolean;
|
|
393
453
|
type: string;
|
|
394
454
|
title: string;
|
|
395
455
|
className: string;
|
|
@@ -496,7 +556,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
496
556
|
contextType: React.Context<{
|
|
497
557
|
storeType: string;
|
|
498
558
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
499
|
-
readonly fetcher: any;
|
|
559
|
+
readonly fetcher: any; /**
|
|
560
|
+
* 显示一个小图标, 鼠标放上去的时候显示提示内容, 这个小图标跟 label 在一起
|
|
561
|
+
*/
|
|
500
562
|
readonly notify: any;
|
|
501
563
|
readonly isCancel: (value: any) => boolean;
|
|
502
564
|
readonly __: import("..").TranslateFn<any>;
|
|
@@ -513,12 +575,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
513
575
|
readonly hasChildren: boolean;
|
|
514
576
|
readonly children: any[];
|
|
515
577
|
} & {
|
|
516
|
-
onChildStoreDispose(child: any): void;
|
|
578
|
+
onChildStoreDispose(child: any): void; /**
|
|
579
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
580
|
+
*/
|
|
517
581
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
518
582
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
519
|
-
/**
|
|
520
|
-
* 配置当前表单项展示模式
|
|
521
|
-
*/
|
|
522
583
|
addChildId: (id: string) => void;
|
|
523
584
|
removeChildId: (id: string) => void;
|
|
524
585
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -534,18 +595,14 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
534
595
|
readonly hasChildren: boolean;
|
|
535
596
|
readonly children: any[];
|
|
536
597
|
} & {
|
|
537
|
-
onChildStoreDispose(child: any): void;
|
|
598
|
+
onChildStoreDispose(child: any): void; /**
|
|
599
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
600
|
+
*/
|
|
538
601
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
539
602
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
540
|
-
/**
|
|
541
|
-
* 配置当前表单项展示模式
|
|
542
|
-
*/
|
|
543
603
|
addChildId: (id: string) => void;
|
|
544
604
|
removeChildId: (id: string) => void;
|
|
545
605
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
546
|
-
/**
|
|
547
|
-
* @deprecated 用 description 代替
|
|
548
|
-
*/
|
|
549
606
|
readonly stores: {
|
|
550
607
|
[propName: string]: {
|
|
551
608
|
id: string;
|
|
@@ -560,12 +617,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
560
617
|
readonly hasChildren: boolean;
|
|
561
618
|
readonly children: any[];
|
|
562
619
|
} & {
|
|
563
|
-
onChildStoreDispose(child: any): void;
|
|
620
|
+
onChildStoreDispose(child: any): void; /**
|
|
621
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
622
|
+
*/
|
|
564
623
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
565
624
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
566
|
-
/**
|
|
567
|
-
* 配置当前表单项展示模式
|
|
568
|
-
*/
|
|
569
625
|
addChildId: (id: string) => void;
|
|
570
626
|
removeChildId: (id: string) => void;
|
|
571
627
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -581,12 +637,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
581
637
|
readonly hasChildren: boolean;
|
|
582
638
|
readonly children: any[];
|
|
583
639
|
} & {
|
|
584
|
-
onChildStoreDispose(child: any): void;
|
|
640
|
+
onChildStoreDispose(child: any): void; /**
|
|
641
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
642
|
+
*/
|
|
585
643
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
586
644
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
587
|
-
/**
|
|
588
|
-
* 配置当前表单项展示模式
|
|
589
|
-
*/
|
|
590
645
|
addChildId: (id: string) => void;
|
|
591
646
|
removeChildId: (id: string) => void;
|
|
592
647
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -611,12 +666,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
611
666
|
readonly hasChildren: boolean;
|
|
612
667
|
readonly children: any[];
|
|
613
668
|
} & {
|
|
614
|
-
onChildStoreDispose(child: any): void;
|
|
669
|
+
onChildStoreDispose(child: any): void; /**
|
|
670
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
671
|
+
*/
|
|
615
672
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
616
673
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
617
|
-
/**
|
|
618
|
-
* 配置当前表单项展示模式
|
|
619
|
-
*/
|
|
620
674
|
addChildId: (id: string) => void;
|
|
621
675
|
removeChildId: (id: string) => void;
|
|
622
676
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -632,12 +686,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
632
686
|
readonly hasChildren: boolean;
|
|
633
687
|
readonly children: any[];
|
|
634
688
|
} & {
|
|
635
|
-
onChildStoreDispose(child: any): void;
|
|
689
|
+
onChildStoreDispose(child: any): void; /**
|
|
690
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
691
|
+
*/
|
|
636
692
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
637
693
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
638
|
-
/**
|
|
639
|
-
* 配置当前表单项展示模式
|
|
640
|
-
*/
|
|
641
694
|
addChildId: (id: string) => void;
|
|
642
695
|
removeChildId: (id: string) => void;
|
|
643
696
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -654,12 +707,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
654
707
|
readonly hasChildren: boolean;
|
|
655
708
|
readonly children: any[];
|
|
656
709
|
} & {
|
|
657
|
-
onChildStoreDispose(child: any): void;
|
|
710
|
+
onChildStoreDispose(child: any): void; /**
|
|
711
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
712
|
+
*/
|
|
658
713
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
659
714
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
660
|
-
/**
|
|
661
|
-
* 配置当前表单项展示模式
|
|
662
|
-
*/
|
|
663
715
|
addChildId: (id: string) => void;
|
|
664
716
|
removeChildId: (id: string) => void;
|
|
665
717
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -675,19 +727,20 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
675
727
|
readonly hasChildren: boolean;
|
|
676
728
|
readonly children: any[];
|
|
677
729
|
} & {
|
|
678
|
-
onChildStoreDispose(child: any): void;
|
|
730
|
+
onChildStoreDispose(child: any): void; /**
|
|
731
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
732
|
+
*/
|
|
679
733
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
680
734
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
681
|
-
/**
|
|
682
|
-
* 配置当前表单项展示模式
|
|
683
|
-
*/
|
|
684
735
|
addChildId: (id: string) => void;
|
|
685
736
|
removeChildId: (id: string) => void;
|
|
686
737
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
687
738
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
688
739
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
689
740
|
}, {
|
|
690
|
-
readonly fetcher: any;
|
|
741
|
+
readonly fetcher: any; /**
|
|
742
|
+
* 显示一个小图标, 鼠标放上去的时候显示提示内容, 这个小图标跟 label 在一起
|
|
743
|
+
*/
|
|
691
744
|
readonly notify: any;
|
|
692
745
|
readonly isCancel: (value: any) => boolean;
|
|
693
746
|
readonly __: import("..").TranslateFn<any>;
|
|
@@ -704,12 +757,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
704
757
|
readonly hasChildren: boolean;
|
|
705
758
|
readonly children: any[];
|
|
706
759
|
} & {
|
|
707
|
-
onChildStoreDispose(child: any): void;
|
|
760
|
+
onChildStoreDispose(child: any): void; /**
|
|
761
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
762
|
+
*/
|
|
708
763
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
709
764
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
710
|
-
/**
|
|
711
|
-
* 配置当前表单项展示模式
|
|
712
|
-
*/
|
|
713
765
|
addChildId: (id: string) => void;
|
|
714
766
|
removeChildId: (id: string) => void;
|
|
715
767
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -725,18 +777,14 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
725
777
|
readonly hasChildren: boolean;
|
|
726
778
|
readonly children: any[];
|
|
727
779
|
} & {
|
|
728
|
-
onChildStoreDispose(child: any): void;
|
|
780
|
+
onChildStoreDispose(child: any): void; /**
|
|
781
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
782
|
+
*/
|
|
729
783
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
730
784
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
731
|
-
/**
|
|
732
|
-
* 配置当前表单项展示模式
|
|
733
|
-
*/
|
|
734
785
|
addChildId: (id: string) => void;
|
|
735
786
|
removeChildId: (id: string) => void;
|
|
736
787
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
737
|
-
/**
|
|
738
|
-
* @deprecated 用 description 代替
|
|
739
|
-
*/
|
|
740
788
|
readonly stores: {
|
|
741
789
|
[propName: string]: {
|
|
742
790
|
id: string;
|
|
@@ -751,12 +799,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
751
799
|
readonly hasChildren: boolean;
|
|
752
800
|
readonly children: any[];
|
|
753
801
|
} & {
|
|
754
|
-
onChildStoreDispose(child: any): void;
|
|
802
|
+
onChildStoreDispose(child: any): void; /**
|
|
803
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
804
|
+
*/
|
|
755
805
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
756
806
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
757
|
-
/**
|
|
758
|
-
* 配置当前表单项展示模式
|
|
759
|
-
*/
|
|
760
807
|
addChildId: (id: string) => void;
|
|
761
808
|
removeChildId: (id: string) => void;
|
|
762
809
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -772,12 +819,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
772
819
|
readonly hasChildren: boolean;
|
|
773
820
|
readonly children: any[];
|
|
774
821
|
} & {
|
|
775
|
-
onChildStoreDispose(child: any): void;
|
|
822
|
+
onChildStoreDispose(child: any): void; /**
|
|
823
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
824
|
+
*/
|
|
776
825
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
777
826
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
778
|
-
/**
|
|
779
|
-
* 配置当前表单项展示模式
|
|
780
|
-
*/
|
|
781
827
|
addChildId: (id: string) => void;
|
|
782
828
|
removeChildId: (id: string) => void;
|
|
783
829
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -802,12 +848,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
802
848
|
readonly hasChildren: boolean;
|
|
803
849
|
readonly children: any[];
|
|
804
850
|
} & {
|
|
805
|
-
onChildStoreDispose(child: any): void;
|
|
851
|
+
onChildStoreDispose(child: any): void; /**
|
|
852
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
853
|
+
*/
|
|
806
854
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
807
855
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
808
|
-
/**
|
|
809
|
-
* 配置当前表单项展示模式
|
|
810
|
-
*/
|
|
811
856
|
addChildId: (id: string) => void;
|
|
812
857
|
removeChildId: (id: string) => void;
|
|
813
858
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -823,12 +868,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
823
868
|
readonly hasChildren: boolean;
|
|
824
869
|
readonly children: any[];
|
|
825
870
|
} & {
|
|
826
|
-
onChildStoreDispose(child: any): void;
|
|
871
|
+
onChildStoreDispose(child: any): void; /**
|
|
872
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
873
|
+
*/
|
|
827
874
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
828
875
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
829
|
-
/**
|
|
830
|
-
* 配置当前表单项展示模式
|
|
831
|
-
*/
|
|
832
876
|
addChildId: (id: string) => void;
|
|
833
877
|
removeChildId: (id: string) => void;
|
|
834
878
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -845,12 +889,11 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
845
889
|
readonly hasChildren: boolean;
|
|
846
890
|
readonly children: any[];
|
|
847
891
|
} & {
|
|
848
|
-
onChildStoreDispose(child: any): void;
|
|
892
|
+
onChildStoreDispose(child: any): void; /**
|
|
893
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
894
|
+
*/
|
|
849
895
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
850
896
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
851
|
-
/**
|
|
852
|
-
* 配置当前表单项展示模式
|
|
853
|
-
*/
|
|
854
897
|
addChildId: (id: string) => void;
|
|
855
898
|
removeChildId: (id: string) => void;
|
|
856
899
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
@@ -866,19 +909,20 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
866
909
|
readonly hasChildren: boolean;
|
|
867
910
|
readonly children: any[];
|
|
868
911
|
} & {
|
|
869
|
-
onChildStoreDispose(child: any): void;
|
|
912
|
+
onChildStoreDispose(child: any): void; /**
|
|
913
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
914
|
+
*/
|
|
870
915
|
syncProps(props: any, prevProps: any, list?: string[]): void;
|
|
871
916
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
872
|
-
/**
|
|
873
|
-
* 配置当前表单项展示模式
|
|
874
|
-
*/
|
|
875
917
|
addChildId: (id: string) => void;
|
|
876
918
|
removeChildId: (id: string) => void;
|
|
877
919
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
878
920
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
879
921
|
ComposedComponent: React.ComponentType<any>;
|
|
880
922
|
} & hoistNonReactStatic.NonReactStatics<any, {}> & {
|
|
881
|
-
ComposedComponent: any;
|
|
923
|
+
ComposedComponent: any; /**
|
|
924
|
+
* 字段名,表单提交时的 key,支持多层级,用.连接,如: a.b.c
|
|
925
|
+
*/
|
|
882
926
|
} & {
|
|
883
927
|
ComposedComponent: any;
|
|
884
928
|
};
|