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/esm/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
|
|
|
@@ -9,7 +9,7 @@ import { Renderer } from '../factory.js';
|
|
|
9
9
|
import { FormStore } from '../store/form.js';
|
|
10
10
|
import { evalExpression, filter } from '../utils/tpl.js';
|
|
11
11
|
import { getExprProperties } from '../utils/filter-schema.js';
|
|
12
|
-
import { promisify, isEmpty, until, noop, difference, isVisible, repeatCount,
|
|
12
|
+
import { promisify, isEmpty, until, noop, difference, isVisible, repeatCount, qsparse, isObjectShallowModified, SkipOperation } from '../utils/helper.js';
|
|
13
13
|
import debounce from 'lodash/debounce';
|
|
14
14
|
import flatten from 'lodash/flatten';
|
|
15
15
|
import find from 'lodash/find';
|
|
@@ -35,7 +35,7 @@ import 'lodash/isString';
|
|
|
35
35
|
import 'lodash/isBoolean';
|
|
36
36
|
import '../utils/image.js';
|
|
37
37
|
import 'lodash/isPlainObject';
|
|
38
|
-
import 'lodash/isEqual';
|
|
38
|
+
import isEqual from 'lodash/isEqual';
|
|
39
39
|
import '../actions/Action.js';
|
|
40
40
|
import '../utils/resize-sensor.js';
|
|
41
41
|
import 'react-overlays/useRootClose';
|
|
@@ -52,6 +52,7 @@ import '../utils/validations.js';
|
|
|
52
52
|
import '../utils/resolveCondition.js';
|
|
53
53
|
import { reaction } from 'mobx';
|
|
54
54
|
import '../utils/Animation.js';
|
|
55
|
+
import groupBy from 'lodash/groupBy';
|
|
55
56
|
|
|
56
57
|
var Form = /** @class */ (function (_super) {
|
|
57
58
|
__extends(Form, _super);
|
|
@@ -66,6 +67,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
66
67
|
});
|
|
67
68
|
// 如果开启了 lazyChange,需要一个 flush 方法把队列中值应用上。
|
|
68
69
|
_this.flushing = false;
|
|
70
|
+
_this.emittedData = null;
|
|
69
71
|
_this.onInit = _this.onInit.bind(_this);
|
|
70
72
|
_this.handleAction = _this.handleAction.bind(_this);
|
|
71
73
|
_this.handleQuery = _this.handleQuery.bind(_this);
|
|
@@ -268,7 +270,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
268
270
|
};
|
|
269
271
|
Form.prototype.onInit = function () {
|
|
270
272
|
return __awaiter(this, void 0, void 0, function () {
|
|
271
|
-
var _a, onInit, store, persistData, submitOnInit, data, initedAt, hooks;
|
|
273
|
+
var _a, onInit, store, persistData, submitOnInit, data, initedAt, hooks, groupedHooks;
|
|
272
274
|
return __generator(this, function (_b) {
|
|
273
275
|
switch (_b.label) {
|
|
274
276
|
case 0:
|
|
@@ -280,8 +282,23 @@ var Form = /** @class */ (function (_super) {
|
|
|
280
282
|
initedAt = store.initedAt;
|
|
281
283
|
store.setInited(true);
|
|
282
284
|
hooks = this.hooks['init'] || [];
|
|
283
|
-
|
|
285
|
+
groupedHooks = groupBy(hooks, function (item) {
|
|
286
|
+
return item.__enforce === 'prev'
|
|
287
|
+
? 'prev'
|
|
288
|
+
: item.__enforce === 'post'
|
|
289
|
+
? 'post'
|
|
290
|
+
: 'normal';
|
|
291
|
+
});
|
|
292
|
+
return [4 /*yield*/, Promise.all((groupedHooks.prev || []).map(function (hook) { return hook(data); }))];
|
|
284
293
|
case 1:
|
|
294
|
+
_b.sent();
|
|
295
|
+
// 有可能在前面的步骤中删除了钩子,所以需要重新验证一下
|
|
296
|
+
return [4 /*yield*/, Promise.all((groupedHooks.normal || []).map(function (hook) { return hooks.includes(hook) && hook(data); }))];
|
|
297
|
+
case 2:
|
|
298
|
+
// 有可能在前面的步骤中删除了钩子,所以需要重新验证一下
|
|
299
|
+
_b.sent();
|
|
300
|
+
return [4 /*yield*/, Promise.all((groupedHooks.post || []).map(function (hook) { return hooks.includes(hook) && hook(data); }))];
|
|
301
|
+
case 3:
|
|
285
302
|
_b.sent();
|
|
286
303
|
if (!isAlive(store)) {
|
|
287
304
|
return [2 /*return*/];
|
|
@@ -479,11 +496,13 @@ var Form = /** @class */ (function (_super) {
|
|
|
479
496
|
var _a = this.props, store = _a.store, onReset = _a.onReset;
|
|
480
497
|
store.reset(onReset);
|
|
481
498
|
};
|
|
482
|
-
Form.prototype.addHook = function (fn, type) {
|
|
499
|
+
Form.prototype.addHook = function (fn, type, enforce) {
|
|
483
500
|
var _this = this;
|
|
484
501
|
if (type === void 0) { type = 'validate'; }
|
|
485
502
|
this.hooks[type] = this.hooks[type] || [];
|
|
486
|
-
|
|
503
|
+
var hook = type === 'flush' ? fn : promisify(fn);
|
|
504
|
+
hook.__enforce = enforce;
|
|
505
|
+
this.hooks[type].push(hook);
|
|
487
506
|
return function () {
|
|
488
507
|
_this.removeHook(fn, type);
|
|
489
508
|
fn = noop;
|
|
@@ -534,9 +553,11 @@ var Form = /** @class */ (function (_super) {
|
|
|
534
553
|
return [2 /*return*/];
|
|
535
554
|
}
|
|
536
555
|
diff = difference(store.data, store.pristine);
|
|
537
|
-
if (skipIfNothingChanges &&
|
|
556
|
+
if (skipIfNothingChanges &&
|
|
557
|
+
(!Object.keys(diff).length || isEqual(store.data, this.emittedData))) {
|
|
538
558
|
return [2 /*return*/];
|
|
539
559
|
}
|
|
560
|
+
this.emittedData = store.data;
|
|
540
561
|
changeProps = [store.data, diff, this.props];
|
|
541
562
|
return [4 /*yield*/, dispatchEvent('change', createObject(data, store.data))];
|
|
542
563
|
case 1:
|
|
@@ -656,7 +677,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
656
677
|
if ((dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented) || submitEvent) {
|
|
657
678
|
return [2 /*return*/];
|
|
658
679
|
}
|
|
659
|
-
store.setCurrentAction(action);
|
|
680
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
660
681
|
if (action.actionType === 'reset-and-submit') {
|
|
661
682
|
store.reset(this.handleReset(action));
|
|
662
683
|
}
|
|
@@ -692,10 +713,28 @@ var Form = /** @class */ (function (_super) {
|
|
|
692
713
|
this.reloadTarget(filterTarget(action.target, values), values);
|
|
693
714
|
}
|
|
694
715
|
else if (action.actionType === 'dialog') {
|
|
695
|
-
|
|
716
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
717
|
+
store.openDialog(data, undefined, function (confirmed, value) {
|
|
718
|
+
var _a;
|
|
719
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
720
|
+
resolve({
|
|
721
|
+
confirmed: confirmed,
|
|
722
|
+
value: value
|
|
723
|
+
});
|
|
724
|
+
}, delegate || _this.context);
|
|
725
|
+
})];
|
|
696
726
|
}
|
|
697
727
|
else if (action.actionType === 'drawer') {
|
|
698
|
-
|
|
728
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
729
|
+
store.openDrawer(data, undefined, function (confirmed, value) {
|
|
730
|
+
var _a;
|
|
731
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
732
|
+
resolve({
|
|
733
|
+
confirmed: confirmed,
|
|
734
|
+
value: value
|
|
735
|
+
});
|
|
736
|
+
});
|
|
737
|
+
})];
|
|
699
738
|
}
|
|
700
739
|
else if (isEffectiveApi(action.api || api, values)) {
|
|
701
740
|
finnalAsyncApi_1 = action.asyncApi || asyncApi;
|
|
@@ -818,27 +857,45 @@ var Form = /** @class */ (function (_super) {
|
|
|
818
857
|
})];
|
|
819
858
|
case 8:
|
|
820
859
|
if (action.type === 'reset' || action.actionType === 'reset') {
|
|
821
|
-
store.setCurrentAction(action);
|
|
860
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
822
861
|
store.reset(onReset);
|
|
823
862
|
}
|
|
824
863
|
else if (action.actionType === 'clear') {
|
|
825
|
-
store.setCurrentAction(action);
|
|
864
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
826
865
|
store.clear(onReset);
|
|
827
866
|
}
|
|
828
867
|
else if (action.actionType === 'validate') {
|
|
829
|
-
store.setCurrentAction(action);
|
|
868
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
830
869
|
return [2 /*return*/, this.validate(true, throwErrors, true, true)];
|
|
831
870
|
}
|
|
832
871
|
else if (action.actionType === 'dialog') {
|
|
833
|
-
store.setCurrentAction(action);
|
|
834
|
-
|
|
872
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
873
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
874
|
+
store.openDialog(data, undefined, function (confirmed, value) {
|
|
875
|
+
var _a;
|
|
876
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
877
|
+
resolve({
|
|
878
|
+
confirmed: confirmed,
|
|
879
|
+
value: value
|
|
880
|
+
});
|
|
881
|
+
}, delegate || _this.context);
|
|
882
|
+
})];
|
|
835
883
|
}
|
|
836
884
|
else if (action.actionType === 'drawer') {
|
|
837
|
-
store.setCurrentAction(action);
|
|
838
|
-
|
|
885
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
886
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
887
|
+
store.openDrawer(data, undefined, function (confirmed, value) {
|
|
888
|
+
var _a;
|
|
889
|
+
(_a = action.callback) === null || _a === void 0 ? void 0 : _a.call(action, confirmed, value);
|
|
890
|
+
resolve({
|
|
891
|
+
confirmed: confirmed,
|
|
892
|
+
value: value
|
|
893
|
+
});
|
|
894
|
+
});
|
|
895
|
+
})];
|
|
839
896
|
}
|
|
840
897
|
else if (action.actionType === 'ajax') {
|
|
841
|
-
store.setCurrentAction(action);
|
|
898
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
842
899
|
if (!isEffectiveApi(action.api)) {
|
|
843
900
|
return [2 /*return*/, env.alert(__("\u5F53 actionType \u4E3A ajax \u65F6\uFF0C\u8BF7\u8BBE\u7F6E api \u5C5E\u6027"))];
|
|
844
901
|
}
|
|
@@ -890,7 +947,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
890
947
|
})];
|
|
891
948
|
}
|
|
892
949
|
else if (action.actionType === 'reload') {
|
|
893
|
-
store.setCurrentAction(action);
|
|
950
|
+
store.setCurrentAction(action, this.props.resolveDefinitions);
|
|
894
951
|
if (action.target) {
|
|
895
952
|
this.reloadTarget(filterTarget(action.target, data), data);
|
|
896
953
|
}
|
|
@@ -935,7 +992,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
935
992
|
targets[0].props.type === 'form') {
|
|
936
993
|
this.handleBulkChange(values[0], false);
|
|
937
994
|
}
|
|
938
|
-
store.closeDialog(true);
|
|
995
|
+
store.closeDialog(true, values);
|
|
939
996
|
};
|
|
940
997
|
Form.prototype.handleDialogClose = function (confirmed) {
|
|
941
998
|
if (confirmed === void 0) { confirmed = false; }
|
|
@@ -952,7 +1009,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
952
1009
|
onChange &&
|
|
953
1010
|
onChange(store.data, difference(store.data, store.pristine), this.props);
|
|
954
1011
|
}
|
|
955
|
-
store.closeDrawer(true);
|
|
1012
|
+
store.closeDrawer(true, values);
|
|
956
1013
|
};
|
|
957
1014
|
Form.prototype.handleDrawerClose = function () {
|
|
958
1015
|
var store = this.props.store;
|
|
@@ -975,7 +1032,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
975
1032
|
type: 'button',
|
|
976
1033
|
actionType: 'dialog',
|
|
977
1034
|
dialog: dialog
|
|
978
|
-
});
|
|
1035
|
+
}, _this.props.resolveDefinitions);
|
|
979
1036
|
store.openDialog(ctx, undefined, function (confirmed) {
|
|
980
1037
|
resolve(confirmed);
|
|
981
1038
|
}, _this.context);
|
|
@@ -1116,14 +1173,14 @@ var Form = /** @class */ (function (_super) {
|
|
|
1116
1173
|
return render("".concat(region ? "".concat(region, "/") : '').concat(key), subSchema, subProps);
|
|
1117
1174
|
};
|
|
1118
1175
|
Form.prototype.renderBody = function () {
|
|
1119
|
-
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
|
|
1176
|
+
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;
|
|
1120
1177
|
var restError = store.restError;
|
|
1121
1178
|
var WrapperComponent = this.props.wrapperComponent ||
|
|
1122
1179
|
(/(?:\/|^)form\//.test($path) ? 'div' : 'form');
|
|
1123
1180
|
var padDom = repeatCount(columnCount && Array.isArray(body)
|
|
1124
1181
|
? (columnCount - (body.length % columnCount)) % columnCount
|
|
1125
1182
|
: 0, function (index) { return (React.createElement("div", { className: cx("Form-item Form-item--".concat(mode, " is-placeholder")), key: index })); });
|
|
1126
|
-
return (React.createElement(WrapperComponent,
|
|
1183
|
+
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 },
|
|
1127
1184
|
React.createElement("input", { type: "submit", style: { display: 'none' } }),
|
|
1128
1185
|
debug
|
|
1129
1186
|
? render('form-debug-json', __assign({ type: 'json', value: store.data, ellipsisThreshold: 120, className: cx('Form--debug') }, debugConfig))
|
package/esm/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
|
};
|