amis-core 3.6.4 → 6.1.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 +3 -2
- package/esm/SchemaRenderer.js +4 -1
- package/esm/Scoped.d.ts +6 -0
- package/esm/Scoped.js +45 -7
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +3 -5
- package/esm/actions/Action.js +31 -27
- 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 +65 -26
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +4 -3
- 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 +9 -4
- 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.d.ts +1 -2
- package/esm/components/CustomStyle.js +19 -6
- package/esm/components/ErrorBoundary.js +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.js +12 -9
- package/esm/components/PopOver.js +8 -5
- package/esm/env.d.ts +4 -0
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.js +14 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +14 -7
- package/esm/locale.js +1 -1
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +4 -3
- package/esm/renderers/Form.js +216 -150
- package/esm/renderers/Item.d.ts +1 -0
- package/esm/renderers/Item.js +17 -17
- package/esm/renderers/Options.d.ts +5 -0
- package/esm/renderers/Options.js +188 -57
- 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 +39 -30
- package/esm/store/app.d.ts +2 -2
- package/esm/store/app.js +4 -3
- package/esm/store/combo.d.ts +79 -55
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +3 -2
- package/esm/store/crud.js +18 -4
- package/esm/store/form.d.ts +33 -23
- package/esm/store/form.js +5 -5
- package/esm/store/formItem.d.ts +2 -1
- package/esm/store/formItem.js +3 -2
- package/esm/store/iRenderer.d.ts +1 -1
- package/esm/store/iRenderer.js +10 -3
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -1
- package/esm/store/list.js +18 -13
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +2 -2
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +2 -1
- package/esm/store/pagination.js +3 -2
- package/esm/store/root.d.ts +2 -2
- package/esm/store/root.js +4 -3
- package/esm/store/service.d.ts +2 -2
- package/esm/store/service.js +11 -7
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +69 -47
- package/esm/store/table.js +54 -25
- package/esm/store/table2.d.ts +14 -3
- package/esm/store/table2.js +22 -9
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +7 -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 +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.d.ts +1 -0
- package/esm/utils/browser.js +11 -0
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.d.ts +8 -0
- package/esm/utils/concatData.js +39 -0
- 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.js +1 -1
- 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 +1 -1
- package/esm/utils/helper.d.ts +14 -2
- package/esm/utils/helper.js +49 -14
- package/esm/utils/highlight.js +3 -2
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +3 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.d.ts +1 -0
- package/esm/utils/labelToString.js +38 -0
- 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 +19 -3
- package/esm/utils/replaceText.js +9 -11
- 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.d.ts +1 -1
- package/esm/utils/string2regExp.js +4 -3
- package/esm/utils/stripNumber.js +1 -1
- package/esm/utils/style-helper.d.ts +24 -5
- package/esm/utils/style-helper.js +49 -21
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.d.ts +1 -0
- package/esm/utils/tokenize.js +10 -3
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +6 -8
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.d.ts +16 -0
- package/esm/utils/validateId.js +154 -0
- package/esm/utils/validations.js +16 -8
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +3 -2
- package/lib/SchemaRenderer.js +4 -1
- package/lib/Scoped.d.ts +6 -0
- package/lib/Scoped.js +45 -6
- package/lib/StatusScoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +3 -5
- package/lib/actions/Action.js +31 -27
- 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 +65 -26
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +4 -3
- 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 +9 -4
- 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.d.ts +1 -2
- package/lib/components/CustomStyle.js +19 -6
- package/lib/components/ErrorBoundary.js +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.js +11 -8
- package/lib/components/PopOver.js +8 -5
- package/lib/env.d.ts +4 -0
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.js +14 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +19 -4
- package/lib/locale.js +1 -1
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +4 -3
- package/lib/renderers/Form.js +216 -150
- package/lib/renderers/Item.d.ts +1 -0
- package/lib/renderers/Item.js +17 -17
- package/lib/renderers/Options.d.ts +5 -0
- package/lib/renderers/Options.js +188 -57
- 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 +38 -29
- package/lib/store/app.d.ts +2 -2
- package/lib/store/app.js +4 -3
- package/lib/store/combo.d.ts +55 -31
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +3 -2
- package/lib/store/crud.js +18 -4
- package/lib/store/form.d.ts +23 -13
- package/lib/store/form.js +5 -5
- package/lib/store/formItem.d.ts +2 -1
- package/lib/store/formItem.js +3 -2
- package/lib/store/iRenderer.d.ts +1 -1
- package/lib/store/iRenderer.js +10 -3
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -1
- package/lib/store/list.js +18 -14
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +2 -2
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +2 -1
- package/lib/store/pagination.js +3 -2
- package/lib/store/root.d.ts +2 -2
- package/lib/store/root.js +4 -3
- package/lib/store/service.d.ts +2 -2
- package/lib/store/service.js +11 -7
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +49 -27
- package/lib/store/table.js +54 -26
- package/lib/store/table2.d.ts +14 -3
- package/lib/store/table2.js +22 -9
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +7 -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 +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.d.ts +1 -0
- package/lib/utils/browser.js +15 -0
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.d.ts +8 -0
- package/lib/utils/concatData.js +43 -0
- 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.js +1 -1
- 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 +1 -1
- package/lib/utils/helper.d.ts +14 -2
- package/lib/utils/helper.js +50 -12
- package/lib/utils/highlight.js +3 -2
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.d.ts +1 -0
- package/lib/utils/labelToString.js +46 -0
- 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 +19 -3
- package/lib/utils/replaceText.js +8 -14
- 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.d.ts +1 -1
- package/lib/utils/string2regExp.js +4 -3
- package/lib/utils/stripNumber.js +1 -1
- package/lib/utils/style-helper.d.ts +24 -5
- package/lib/utils/style-helper.js +49 -21
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.d.ts +1 -0
- package/lib/utils/tokenize.js +10 -2
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +5 -7
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.d.ts +16 -0
- package/lib/utils/validateId.js +160 -0
- package/lib/utils/validations.js +16 -8
- package/package.json +4 -3
- package/LICENSE +0 -201
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v6.1.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -23,12 +23,13 @@ var WithRootStore = require('../WithRootStore.js');
|
|
|
23
23
|
var table = require('../store/table.js');
|
|
24
24
|
var pick = require('lodash/pick');
|
|
25
25
|
var api = require('../utils/api.js');
|
|
26
|
+
require('../utils/browser.js');
|
|
26
27
|
require('../utils/ColorScale.js');
|
|
27
28
|
require('../utils/columnsSplit.js');
|
|
29
|
+
var getVariable = require('../utils/getVariable.js');
|
|
30
|
+
require('lodash/isPlainObject');
|
|
28
31
|
require('amis-formula');
|
|
29
32
|
var tokenize = require('../utils/tokenize.js');
|
|
30
|
-
require('lodash/isPlainObject');
|
|
31
|
-
var getVariable = require('../utils/getVariable.js');
|
|
32
33
|
require('../utils/DataSchema.js');
|
|
33
34
|
require('../utils/DataScope.js');
|
|
34
35
|
require('moment');
|
|
@@ -41,13 +42,13 @@ require('../utils/highlight.js');
|
|
|
41
42
|
require('../utils/icon.js');
|
|
42
43
|
require('../utils/image.js');
|
|
43
44
|
require('../actions/Action.js');
|
|
44
|
-
require('lodash/cloneDeep');
|
|
45
45
|
require('../utils/resize-sensor.js');
|
|
46
46
|
require('react-overlays/useRootClose');
|
|
47
47
|
require('react-dom');
|
|
48
48
|
require('../utils/SimpleMap.js');
|
|
49
49
|
require('lodash/mapValues');
|
|
50
50
|
require('lodash/camelCase');
|
|
51
|
+
require('lodash/cloneDeep');
|
|
51
52
|
require('lodash/isObject');
|
|
52
53
|
require('lodash/map');
|
|
53
54
|
require('lodash/isEmpty');
|
|
@@ -127,26 +128,7 @@ function wrapControl(ComposedComponent) {
|
|
|
127
128
|
model.setIsControlled(true);
|
|
128
129
|
}
|
|
129
130
|
else {
|
|
130
|
-
|
|
131
|
-
if (isExp) {
|
|
132
|
-
model.changeTmpValue(formula.FormulaExec['formula'](value, data), // 对组件默认值进行运算
|
|
133
|
-
'formulaChanged');
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
var initialValue = model.extraName
|
|
137
|
-
? [
|
|
138
|
-
store === null || store === void 0 ? void 0 : store.getValueByName(model.name, form === null || form === void 0 ? void 0 : form.canAccessSuperData),
|
|
139
|
-
store === null || store === void 0 ? void 0 : store.getValueByName(model.extraName, form === null || form === void 0 ? void 0 : form.canAccessSuperData)
|
|
140
|
-
]
|
|
141
|
-
: store === null || store === void 0 ? void 0 : store.getValueByName(model.name, form === null || form === void 0 ? void 0 : form.canAccessSuperData);
|
|
142
|
-
if (model.extraName &&
|
|
143
|
-
initialValue.every(function (item) { return item === undefined; })) {
|
|
144
|
-
initialValue = undefined;
|
|
145
|
-
}
|
|
146
|
-
model.changeTmpValue(initialValue !== null && initialValue !== void 0 ? initialValue : formula.replaceExpression(value), typeof initialValue !== 'undefined'
|
|
147
|
-
? 'initialValue'
|
|
148
|
-
: 'defaultValue');
|
|
149
|
-
}
|
|
131
|
+
_this.setInitialValue(value);
|
|
150
132
|
}
|
|
151
133
|
if (onChange &&
|
|
152
134
|
value !== undefined &&
|
|
@@ -184,9 +166,7 @@ function wrapControl(ComposedComponent) {
|
|
|
184
166
|
var _this = this;
|
|
185
167
|
var _a = this.props; _a.store; _a.formStore; var validate = _a.$schema.validate, addHook = _a.addHook;
|
|
186
168
|
// 提交前先把之前的 lazyEmit 执行一下。
|
|
187
|
-
this.hook3 = function () {
|
|
188
|
-
_this.lazyEmitChange.flush();
|
|
189
|
-
};
|
|
169
|
+
this.hook3 = function () { return _this.lazyEmitChange.flush(); };
|
|
190
170
|
addHook === null || addHook === void 0 ? void 0 : addHook(this.hook3, 'flush');
|
|
191
171
|
var formItem = this.model;
|
|
192
172
|
if (formItem && validate) {
|
|
@@ -203,6 +183,7 @@ function wrapControl(ComposedComponent) {
|
|
|
203
183
|
}
|
|
204
184
|
};
|
|
205
185
|
class_1.prototype.componentDidUpdate = function (prevProps) {
|
|
186
|
+
var _this = this;
|
|
206
187
|
var _a, _b, _c;
|
|
207
188
|
var props = this.props;
|
|
208
189
|
var model = this.model;
|
|
@@ -210,6 +191,7 @@ function wrapControl(ComposedComponent) {
|
|
|
210
191
|
return;
|
|
211
192
|
}
|
|
212
193
|
helper.changedEffect([
|
|
194
|
+
'name',
|
|
213
195
|
'id',
|
|
214
196
|
'validations',
|
|
215
197
|
'validationErrors',
|
|
@@ -236,6 +218,9 @@ function wrapControl(ComposedComponent) {
|
|
|
236
218
|
model.config(tslib.__assign(tslib.__assign({}, changes), {
|
|
237
219
|
// todo 优化后面两个
|
|
238
220
|
isValueSchemaExp: formula.isExpression(props.$schema.value), inputGroupControl: props === null || props === void 0 ? void 0 : props.inputGroupControl }));
|
|
221
|
+
if (changes.hasOwnProperty('name')) {
|
|
222
|
+
_this.setInitialValue(_this.props.$schema.value);
|
|
223
|
+
}
|
|
239
224
|
});
|
|
240
225
|
if (props.required !== prevProps.required) {
|
|
241
226
|
model.config({
|
|
@@ -311,6 +296,30 @@ function wrapControl(ComposedComponent) {
|
|
|
311
296
|
(_g = this.reaction) === null || _g === void 0 ? void 0 : _g.call(this);
|
|
312
297
|
this.disposeModel();
|
|
313
298
|
};
|
|
299
|
+
class_1.prototype.setInitialValue = function (value) {
|
|
300
|
+
var model = this.model;
|
|
301
|
+
var _a = this.props, form = _a.formStore, data = _a.data;
|
|
302
|
+
var isExp = formula.isExpression(value);
|
|
303
|
+
if (isExp) {
|
|
304
|
+
model.changeTmpValue(formula.FormulaExec['formula'](value, data), // 对组件默认值进行运算
|
|
305
|
+
'formulaChanged');
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
var initialValue = model.extraName
|
|
309
|
+
? [
|
|
310
|
+
getVariable.getVariable(data, model.name, form === null || form === void 0 ? void 0 : form.canAccessSuperData),
|
|
311
|
+
getVariable.getVariable(data, model.extraName, form === null || form === void 0 ? void 0 : form.canAccessSuperData)
|
|
312
|
+
]
|
|
313
|
+
: getVariable.getVariable(data, model.name, form === null || form === void 0 ? void 0 : form.canAccessSuperData);
|
|
314
|
+
if (model.extraName &&
|
|
315
|
+
initialValue.every(function (item) { return item === undefined; })) {
|
|
316
|
+
initialValue = undefined;
|
|
317
|
+
}
|
|
318
|
+
model.changeTmpValue(initialValue !== null && initialValue !== void 0 ? initialValue : formula.replaceExpression(value), typeof initialValue !== 'undefined'
|
|
319
|
+
? 'initialValue'
|
|
320
|
+
: 'defaultValue');
|
|
321
|
+
}
|
|
322
|
+
};
|
|
314
323
|
class_1.prototype.disposeModel = function () {
|
|
315
324
|
var _a;
|
|
316
325
|
var _b = this.props, form = _b.formStore, formItem = _b.formItem, rootStore = _b.rootStore;
|
|
@@ -523,10 +532,10 @@ function wrapControl(ComposedComponent) {
|
|
|
523
532
|
}
|
|
524
533
|
};
|
|
525
534
|
class_1.prototype.getValue = function () {
|
|
526
|
-
var _a = this.props,
|
|
535
|
+
var _a = this.props, formStore = _a.formStore, data = _a.data, control = _a.$schema;
|
|
527
536
|
var value = this.model ? this.model.tmpValue : control.value;
|
|
528
537
|
if (control.pipeIn) {
|
|
529
|
-
value = api.callStrFunction.call(this, control.pipeIn, ['value', 'data'], value, data);
|
|
538
|
+
value = api.callStrFunction.call(this, control.pipeIn, ['value', 'store', 'data'], value, formStore, data);
|
|
530
539
|
}
|
|
531
540
|
return value;
|
|
532
541
|
};
|
package/lib/store/app.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare const AppStore: import("mobx-state-tree").IModelType<{
|
|
|
52
52
|
setTopStore(value: any): void;
|
|
53
53
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
54
54
|
reset(): void;
|
|
55
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
55
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
56
56
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
57
57
|
setCurrentAction(action: object): void;
|
|
58
58
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -69,7 +69,7 @@ export declare const AppStore: import("mobx-state-tree").IModelType<{
|
|
|
69
69
|
markBusying: (busying?: boolean) => void;
|
|
70
70
|
fetchInitData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
|
|
71
71
|
fetchData: (api: import("../types").Api, data?: object | undefined, options?: import("../types").fetchOptions | undefined) => Promise<any>;
|
|
72
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
72
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
73
73
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
74
74
|
clearMessage: () => void;
|
|
75
75
|
setHasRemoteData: () => void;
|
package/lib/store/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v6.1.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -12,11 +12,12 @@ var mobxStateTree = require('mobx-state-tree');
|
|
|
12
12
|
var helper = require('../utils/helper.js');
|
|
13
13
|
var service = require('./service.js');
|
|
14
14
|
require('../utils/api.js');
|
|
15
|
+
require('../utils/browser.js');
|
|
15
16
|
require('../utils/ColorScale.js');
|
|
16
17
|
require('../utils/columnsSplit.js');
|
|
18
|
+
var object = require('../utils/object.js');
|
|
17
19
|
require('amis-formula');
|
|
18
20
|
require('lodash/isPlainObject');
|
|
19
|
-
var object = require('../utils/object.js');
|
|
20
21
|
require('../utils/DataSchema.js');
|
|
21
22
|
require('../utils/DataScope.js');
|
|
22
23
|
require('moment');
|
|
@@ -34,7 +35,6 @@ require('../utils/image.js');
|
|
|
34
35
|
require('lodash/isEqual');
|
|
35
36
|
require('../actions/Action.js');
|
|
36
37
|
require('lodash/debounce');
|
|
37
|
-
require('lodash/cloneDeep');
|
|
38
38
|
require('../utils/resize-sensor.js');
|
|
39
39
|
require('react');
|
|
40
40
|
require('react-overlays/useRootClose');
|
|
@@ -42,6 +42,7 @@ require('react-dom');
|
|
|
42
42
|
require('../utils/SimpleMap.js');
|
|
43
43
|
require('lodash/mapValues');
|
|
44
44
|
require('lodash/camelCase');
|
|
45
|
+
require('lodash/cloneDeep');
|
|
45
46
|
require('lodash/map');
|
|
46
47
|
require('lodash/isEmpty');
|
|
47
48
|
require('lodash/kebabCase');
|
package/lib/store/combo.d.ts
CHANGED
|
@@ -95,7 +95,8 @@ export declare const UniqueGroup: import("mobx-state-tree").IModelType<{
|
|
|
95
95
|
} & {
|
|
96
96
|
focus: () => void;
|
|
97
97
|
blur: () => void;
|
|
98
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
98
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
99
|
+
name?: string | undefined;
|
|
99
100
|
extraName?: string | undefined;
|
|
100
101
|
required?: boolean | undefined;
|
|
101
102
|
unique?: boolean | undefined;
|
|
@@ -604,7 +605,8 @@ export declare const UniqueGroup: import("mobx-state-tree").IModelType<{
|
|
|
604
605
|
} & {
|
|
605
606
|
focus: () => void;
|
|
606
607
|
blur: () => void;
|
|
607
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
608
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
609
|
+
name?: string | undefined;
|
|
608
610
|
extraName?: string | undefined;
|
|
609
611
|
required?: boolean | undefined;
|
|
610
612
|
unique?: boolean | undefined;
|
|
@@ -1145,7 +1147,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
1145
1147
|
} & {
|
|
1146
1148
|
focus: () => void;
|
|
1147
1149
|
blur: () => void;
|
|
1148
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1150
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1151
|
+
name?: string | undefined;
|
|
1149
1152
|
extraName?: string | undefined;
|
|
1150
1153
|
required?: boolean | undefined;
|
|
1151
1154
|
unique?: boolean | undefined;
|
|
@@ -1654,7 +1657,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
1654
1657
|
} & {
|
|
1655
1658
|
focus: () => void;
|
|
1656
1659
|
blur: () => void;
|
|
1657
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1660
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
1661
|
+
name?: string | undefined;
|
|
1658
1662
|
extraName?: string | undefined;
|
|
1659
1663
|
required?: boolean | undefined;
|
|
1660
1664
|
unique?: boolean | undefined;
|
|
@@ -2105,7 +2109,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2105
2109
|
setTopStore(value: any): void;
|
|
2106
2110
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
2107
2111
|
reset(): void;
|
|
2108
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
2112
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
2109
2113
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
2110
2114
|
setCurrentAction(action: object): void;
|
|
2111
2115
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -2167,7 +2171,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2167
2171
|
setTopStore(value: any): void;
|
|
2168
2172
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
2169
2173
|
reset(): void;
|
|
2170
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
2174
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
2171
2175
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
2172
2176
|
setCurrentAction(action: object): void;
|
|
2173
2177
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -2184,7 +2188,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2184
2188
|
markBusying: (busying?: boolean) => void;
|
|
2185
2189
|
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
2186
2190
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
2187
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
2191
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
2188
2192
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
2189
2193
|
clearMessage: () => void;
|
|
2190
2194
|
setHasRemoteData: () => void;
|
|
@@ -2284,7 +2288,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2284
2288
|
} & {
|
|
2285
2289
|
focus: () => void;
|
|
2286
2290
|
blur: () => void;
|
|
2287
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2291
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2292
|
+
name?: string | undefined;
|
|
2288
2293
|
extraName?: string | undefined;
|
|
2289
2294
|
required?: boolean | undefined;
|
|
2290
2295
|
unique?: boolean | undefined;
|
|
@@ -2793,7 +2798,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
2793
2798
|
} & {
|
|
2794
2799
|
focus: () => void;
|
|
2795
2800
|
blur: () => void;
|
|
2796
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2801
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
2802
|
+
name?: string | undefined;
|
|
2797
2803
|
extraName?: string | undefined;
|
|
2798
2804
|
required?: boolean | undefined;
|
|
2799
2805
|
unique?: boolean | undefined;
|
|
@@ -3306,7 +3312,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
3306
3312
|
} & {
|
|
3307
3313
|
focus: () => void;
|
|
3308
3314
|
blur: () => void;
|
|
3309
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3315
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3316
|
+
name?: string | undefined;
|
|
3310
3317
|
extraName?: string | undefined;
|
|
3311
3318
|
required?: boolean | undefined;
|
|
3312
3319
|
unique?: boolean | undefined;
|
|
@@ -3815,7 +3822,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
3815
3822
|
} & {
|
|
3816
3823
|
focus: () => void;
|
|
3817
3824
|
blur: () => void;
|
|
3818
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3825
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
3826
|
+
name?: string | undefined;
|
|
3819
3827
|
extraName?: string | undefined;
|
|
3820
3828
|
required?: boolean | undefined;
|
|
3821
3829
|
unique?: boolean | undefined;
|
|
@@ -4333,7 +4341,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
4333
4341
|
} & {
|
|
4334
4342
|
focus: () => void;
|
|
4335
4343
|
blur: () => void;
|
|
4336
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4344
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4345
|
+
name?: string | undefined;
|
|
4337
4346
|
extraName?: string | undefined;
|
|
4338
4347
|
required?: boolean | undefined;
|
|
4339
4348
|
unique?: boolean | undefined;
|
|
@@ -4842,7 +4851,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
4842
4851
|
} & {
|
|
4843
4852
|
focus: () => void;
|
|
4844
4853
|
blur: () => void;
|
|
4845
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4854
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
4855
|
+
name?: string | undefined;
|
|
4846
4856
|
extraName?: string | undefined;
|
|
4847
4857
|
required?: boolean | undefined;
|
|
4848
4858
|
unique?: boolean | undefined;
|
|
@@ -5355,7 +5365,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
5355
5365
|
} & {
|
|
5356
5366
|
focus: () => void;
|
|
5357
5367
|
blur: () => void;
|
|
5358
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5368
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5369
|
+
name?: string | undefined;
|
|
5359
5370
|
extraName?: string | undefined;
|
|
5360
5371
|
required?: boolean | undefined;
|
|
5361
5372
|
unique?: boolean | undefined;
|
|
@@ -5864,7 +5875,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
5864
5875
|
} & {
|
|
5865
5876
|
focus: () => void;
|
|
5866
5877
|
blur: () => void;
|
|
5867
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5878
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
5879
|
+
name?: string | undefined;
|
|
5868
5880
|
extraName?: string | undefined;
|
|
5869
5881
|
required?: boolean | undefined;
|
|
5870
5882
|
unique?: boolean | undefined;
|
|
@@ -6377,7 +6389,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
6377
6389
|
} & {
|
|
6378
6390
|
focus: () => void;
|
|
6379
6391
|
blur: () => void;
|
|
6380
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6392
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6393
|
+
name?: string | undefined;
|
|
6381
6394
|
extraName?: string | undefined;
|
|
6382
6395
|
required?: boolean | undefined;
|
|
6383
6396
|
unique?: boolean | undefined;
|
|
@@ -6886,7 +6899,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
6886
6899
|
} & {
|
|
6887
6900
|
focus: () => void;
|
|
6888
6901
|
blur: () => void;
|
|
6889
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6902
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
6903
|
+
name?: string | undefined;
|
|
6890
6904
|
extraName?: string | undefined;
|
|
6891
6905
|
required?: boolean | undefined;
|
|
6892
6906
|
unique?: boolean | undefined;
|
|
@@ -7315,7 +7329,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
7315
7329
|
readonly persistKey: string;
|
|
7316
7330
|
} & {
|
|
7317
7331
|
setInited: (value: boolean) => void;
|
|
7318
|
-
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined) => void;
|
|
7332
|
+
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined) => void;
|
|
7319
7333
|
setValueByName: (name: string, value: any, isPristine?: boolean, force?: boolean) => void;
|
|
7320
7334
|
trimValues: () => void;
|
|
7321
7335
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined, throwErrors?: boolean | undefined) => Promise<any>;
|
|
@@ -7401,7 +7415,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
7401
7415
|
setTopStore(value: any): void;
|
|
7402
7416
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
7403
7417
|
reset(): void;
|
|
7404
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
7418
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
7405
7419
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
7406
7420
|
setCurrentAction(action: object): void;
|
|
7407
7421
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -7418,7 +7432,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
7418
7432
|
markBusying: (busying?: boolean) => void;
|
|
7419
7433
|
fetchInitData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
7420
7434
|
fetchData: (api: import("..").Api, data?: object | undefined, options?: import("..").fetchOptions | undefined) => Promise<any>;
|
|
7421
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
7435
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
7422
7436
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
7423
7437
|
clearMessage: () => void;
|
|
7424
7438
|
setHasRemoteData: () => void;
|
|
@@ -7518,7 +7532,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
7518
7532
|
} & {
|
|
7519
7533
|
focus: () => void;
|
|
7520
7534
|
blur: () => void;
|
|
7521
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7535
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
7536
|
+
name?: string | undefined;
|
|
7522
7537
|
extraName?: string | undefined;
|
|
7523
7538
|
required?: boolean | undefined;
|
|
7524
7539
|
unique?: boolean | undefined;
|
|
@@ -8027,7 +8042,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
8027
8042
|
} & {
|
|
8028
8043
|
focus: () => void;
|
|
8029
8044
|
blur: () => void;
|
|
8030
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8045
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8046
|
+
name?: string | undefined;
|
|
8031
8047
|
extraName?: string | undefined;
|
|
8032
8048
|
required?: boolean | undefined;
|
|
8033
8049
|
unique?: boolean | undefined;
|
|
@@ -8540,7 +8556,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
8540
8556
|
} & {
|
|
8541
8557
|
focus: () => void;
|
|
8542
8558
|
blur: () => void;
|
|
8543
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8559
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
8560
|
+
name?: string | undefined;
|
|
8544
8561
|
extraName?: string | undefined;
|
|
8545
8562
|
required?: boolean | undefined;
|
|
8546
8563
|
unique?: boolean | undefined;
|
|
@@ -9049,7 +9066,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
9049
9066
|
} & {
|
|
9050
9067
|
focus: () => void;
|
|
9051
9068
|
blur: () => void;
|
|
9052
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9069
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9070
|
+
name?: string | undefined;
|
|
9053
9071
|
extraName?: string | undefined;
|
|
9054
9072
|
required?: boolean | undefined;
|
|
9055
9073
|
unique?: boolean | undefined;
|
|
@@ -9567,7 +9585,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
9567
9585
|
} & {
|
|
9568
9586
|
focus: () => void;
|
|
9569
9587
|
blur: () => void;
|
|
9570
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9588
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
9589
|
+
name?: string | undefined;
|
|
9571
9590
|
extraName?: string | undefined;
|
|
9572
9591
|
required?: boolean | undefined;
|
|
9573
9592
|
unique?: boolean | undefined;
|
|
@@ -10076,7 +10095,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
10076
10095
|
} & {
|
|
10077
10096
|
focus: () => void;
|
|
10078
10097
|
blur: () => void;
|
|
10079
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10098
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10099
|
+
name?: string | undefined;
|
|
10080
10100
|
extraName?: string | undefined;
|
|
10081
10101
|
required?: boolean | undefined;
|
|
10082
10102
|
unique?: boolean | undefined;
|
|
@@ -10589,7 +10609,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
10589
10609
|
} & {
|
|
10590
10610
|
focus: () => void;
|
|
10591
10611
|
blur: () => void;
|
|
10592
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10612
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
10613
|
+
name?: string | undefined;
|
|
10593
10614
|
extraName?: string | undefined;
|
|
10594
10615
|
required?: boolean | undefined;
|
|
10595
10616
|
unique?: boolean | undefined;
|
|
@@ -11098,7 +11119,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
11098
11119
|
} & {
|
|
11099
11120
|
focus: () => void;
|
|
11100
11121
|
blur: () => void;
|
|
11101
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
11122
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
11123
|
+
name?: string | undefined;
|
|
11102
11124
|
extraName?: string | undefined;
|
|
11103
11125
|
required?: boolean | undefined;
|
|
11104
11126
|
unique?: boolean | undefined;
|
|
@@ -11611,7 +11633,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
11611
11633
|
} & {
|
|
11612
11634
|
focus: () => void;
|
|
11613
11635
|
blur: () => void;
|
|
11614
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
11636
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
11637
|
+
name?: string | undefined;
|
|
11615
11638
|
extraName?: string | undefined;
|
|
11616
11639
|
required?: boolean | undefined;
|
|
11617
11640
|
unique?: boolean | undefined;
|
|
@@ -12120,7 +12143,8 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
12120
12143
|
} & {
|
|
12121
12144
|
focus: () => void;
|
|
12122
12145
|
blur: () => void;
|
|
12123
|
-
config: ({ extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
12146
|
+
config: ({ name, extraName, required, unique, value, isValueSchemaExp, rules, messages, delimiter, multiple, valueField, labelField, joinValues, extractValue, type, id, selectFirst, autoFill, clearValueOnHidden, validateApi, maxLength, minLength, validateOnChange, label, inputGroupControl, pagination }: {
|
|
12147
|
+
name?: string | undefined;
|
|
12124
12148
|
extraName?: string | undefined;
|
|
12125
12149
|
required?: boolean | undefined;
|
|
12126
12150
|
unique?: boolean | undefined;
|
|
@@ -12549,7 +12573,7 @@ export declare const ComboStore: import("mobx-state-tree").IModelType<{
|
|
|
12549
12573
|
readonly persistKey: string;
|
|
12550
12574
|
} & {
|
|
12551
12575
|
setInited: (value: boolean) => void;
|
|
12552
|
-
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined) => void;
|
|
12576
|
+
setValues: (values: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined) => void;
|
|
12553
12577
|
setValueByName: (name: string, value: any, isPristine?: boolean, force?: boolean) => void;
|
|
12554
12578
|
trimValues: () => void;
|
|
12555
12579
|
submit: (fn?: ((values: object) => Promise<any>) | undefined, hooks?: (() => Promise<any>)[] | undefined, failedMessage?: string | undefined, validateErrCb?: (() => void) | undefined, throwErrors?: boolean | undefined) => Promise<any>;
|
package/lib/store/combo.js
CHANGED
package/lib/store/crud.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
77
77
|
setTopStore(value: any): void;
|
|
78
78
|
initData(data?: object, skipSetPristine?: boolean): void;
|
|
79
79
|
reset(): void;
|
|
80
|
-
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined): void;
|
|
80
|
+
updateData(data?: object, tag?: object | undefined, replace?: boolean | undefined, concatFields?: string | string[] | undefined): void;
|
|
81
81
|
changeValue(name: string, value: any, changePristine?: boolean | undefined, force?: boolean | undefined, otherModifier?: ((data: Object) => void) | undefined): void;
|
|
82
82
|
setCurrentAction(action: object): void;
|
|
83
83
|
openDialog(ctx: any, additonal?: object | undefined, callback?: ((ret: any) => void) | undefined, scoped?: import("..").IScopedContext | undefined): void;
|
|
@@ -94,7 +94,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
94
94
|
markBusying: (busying?: boolean) => void;
|
|
95
95
|
fetchInitData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
|
|
96
96
|
fetchData: (api: Api, data?: object | undefined, options?: fetchOptions | undefined) => Promise<any>;
|
|
97
|
-
reInitData: (data: object | undefined, replace?: boolean) => void;
|
|
97
|
+
reInitData: (data: object | undefined, replace?: boolean, concatFields?: string | string[] | undefined) => void;
|
|
98
98
|
updateMessage: (msg?: string | undefined, error?: boolean) => void;
|
|
99
99
|
clearMessage: () => void;
|
|
100
100
|
setHasRemoteData: () => void;
|
|
@@ -149,6 +149,7 @@ export declare const CRUDStore: import("mobx-state-tree").IModelType<{
|
|
|
149
149
|
}) => Promise<void>;
|
|
150
150
|
updateColumns: (columns: Array<any>) => void;
|
|
151
151
|
updateTotal: (total: number) => void;
|
|
152
|
+
resetSelection: () => void;
|
|
152
153
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
153
154
|
export type ICRUDStore = Instance<typeof CRUDStore>;
|
|
154
155
|
export {};
|
package/lib/store/crud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core
|
|
2
|
+
* amis-core v6.1.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -23,6 +23,7 @@ require('../utils/filter.js');
|
|
|
23
23
|
var api = require('../utils/api.js');
|
|
24
24
|
var matchSorter = require('match-sorter');
|
|
25
25
|
var tpl = require('../utils/tpl.js');
|
|
26
|
+
var table = require('./table.js');
|
|
26
27
|
|
|
27
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
29
|
|
|
@@ -326,7 +327,7 @@ var CRUDStore = service.ServiceStore.named('CRUDStore')
|
|
|
326
327
|
self.columns = options.columns;
|
|
327
328
|
}
|
|
328
329
|
self.items.replace(rowsData);
|
|
329
|
-
self.reInitData(data_2, !!api$1.replaceData);
|
|
330
|
+
self.reInitData(data_2, !!api$1.replaceData, api$1.concatDataFields);
|
|
330
331
|
options.syncResponse2Query !== false &&
|
|
331
332
|
updateQuery(pick__default["default"](rest, Object.keys(self.query)), undefined, options.pageField || 'page', options.perPageField || 'perPage');
|
|
332
333
|
self.total = parseInt((_k = data_2.total) !== null && _k !== void 0 ? _k : data_2.count, 10) || 0;
|
|
@@ -391,7 +392,7 @@ var CRUDStore = service.ServiceStore.named('CRUDStore')
|
|
|
391
392
|
if (!helper.isEmpty(json.data) || json.ok) {
|
|
392
393
|
self.updateData(api.normalizeApiResponseData(json.data), {
|
|
393
394
|
__saved: Date.now()
|
|
394
|
-
}, !!api$1 && api$1.replaceData);
|
|
395
|
+
}, !!api$1 && api$1.replaceData, api$1 === null || api$1 === void 0 ? void 0 : api$1.concatDataFields);
|
|
395
396
|
self.updatedAt = Date.now();
|
|
396
397
|
}
|
|
397
398
|
if (!json.ok) {
|
|
@@ -610,6 +611,18 @@ var CRUDStore = service.ServiceStore.named('CRUDStore')
|
|
|
610
611
|
var updateTotal = function (total) {
|
|
611
612
|
self.total = total || 0;
|
|
612
613
|
};
|
|
614
|
+
/** 非Picker模式下,重置当前CRUD的所有的已选择项目 */
|
|
615
|
+
var resetSelection = function () {
|
|
616
|
+
var _a, _b, _c, _d;
|
|
617
|
+
// 初始化CRUD记录的已选择项目和未选择项目
|
|
618
|
+
setSelectedItems([]);
|
|
619
|
+
setUnSelectedItems([]);
|
|
620
|
+
var tableStore = (_b = (_a = self === null || self === void 0 ? void 0 : self.children) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (s) { return s.storeType === table.TableStore.name; });
|
|
621
|
+
if (tableStore) {
|
|
622
|
+
// 清空Table记录的已选择项目
|
|
623
|
+
(_d = (_c = tableStore).clear) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
624
|
+
}
|
|
625
|
+
};
|
|
613
626
|
return {
|
|
614
627
|
getData: getData,
|
|
615
628
|
updateSelectData: updateSelectData,
|
|
@@ -628,7 +641,8 @@ var CRUDStore = service.ServiceStore.named('CRUDStore')
|
|
|
628
641
|
initFromScope: initFromScope,
|
|
629
642
|
exportAsCSV: exportAsCSV,
|
|
630
643
|
updateColumns: updateColumns,
|
|
631
|
-
updateTotal: updateTotal
|
|
644
|
+
updateTotal: updateTotal,
|
|
645
|
+
resetSelection: resetSelection
|
|
632
646
|
};
|
|
633
647
|
});
|
|
634
648
|
|