amis-core 6.9.0-rc.1 → 6.9.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.js +1 -1
- package/esm/SchemaRenderer.d.ts +13 -0
- package/esm/SchemaRenderer.js +76 -6
- package/esm/Scoped.d.ts +1 -1
- package/esm/Scoped.js +1 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/StyleManager.d.ts +18 -0
- package/esm/StyleManager.js +55 -0
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +1 -1
- package/esm/actions/Action.js +4 -1
- package/esm/actions/AjaxAction.js +1 -1
- package/esm/actions/BreakAction.js +1 -1
- package/esm/actions/BroadcastAction.js +1 -1
- package/esm/actions/CmptAction.js +57 -50
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +1 -1
- package/esm/actions/DialogAction.js +1 -1
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.js +1 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +1 -1
- package/esm/actions/PageAction.js +1 -1
- package/esm/actions/ParallelAction.js +1 -1
- package/esm/actions/PrintAction.js +1 -1
- package/esm/actions/StatusAction.js +1 -1
- package/esm/actions/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +3 -3
- package/esm/actions/WaitAction.js +1 -1
- 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.js +1 -1
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +0 -4
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -1
- package/esm/factory.d.ts +7 -1
- package/esm/factory.js +51 -5
- package/esm/index.d.ts +6 -4
- package/esm/index.js +13 -6
- package/esm/locale.d.ts +1 -1
- package/esm/locale.js +13 -2
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +2 -2
- package/esm/renderers/Form.js +11 -6
- package/esm/renderers/Item.d.ts +2 -1
- package/esm/renderers/Item.js +9 -10
- package/esm/renderers/Options.d.ts +46 -1
- package/esm/renderers/Options.js +921 -914
- 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 +8 -7
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +2 -0
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.js +1 -1
- package/esm/store/form.d.ts +1 -0
- package/esm/store/form.js +5 -1
- package/esm/store/formItem.js +4 -4
- package/esm/store/iRenderer.js +1 -1
- package/esm/store/index.js +1 -1
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.js +1 -1
- package/esm/store/service.js +1 -1
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +2 -0
- package/esm/store/table.js +1 -1
- package/esm/store/table2.js +1 -1
- package/esm/theme.d.ts +1 -1
- package/esm/theme.js +13 -2
- package/esm/types.d.ts +2 -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/animations.d.ts +19 -0
- package/esm/utils/animations.js +58 -0
- package/esm/utils/api.d.ts +2 -1
- package/esm/utils/api.js +11 -4
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +4 -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.d.ts +3 -3
- package/esm/utils/debug.js +104 -37
- 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 +1 -0
- package/esm/utils/helper.js +15 -2
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/isPureVariable.js +1 -1
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.js +2 -2
- package/esm/utils/loopTooMuch.d.ts +1 -0
- package/esm/utils/loopTooMuch.js +27 -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 +11 -6
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- 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.js +1 -1
- package/esm/utils/style-helper.js +1 -1
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +1 -1
- package/esm/utils/tpl-lodash.js +1 -1
- package/esm/utils/tpl.js +1 -1
- package/esm/utils/uncontrollable.js +1 -1
- package/esm/utils/validateId.js +1 -1
- package/esm/utils/validations.js +17 -12
- package/esm/utils/visitedCache.js +1 -1
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +1 -1
- package/lib/SchemaRenderer.d.ts +13 -0
- package/lib/SchemaRenderer.js +75 -5
- package/lib/Scoped.d.ts +1 -1
- package/lib/Scoped.js +1 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/StyleManager.d.ts +18 -0
- package/lib/StyleManager.js +63 -0
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +1 -1
- package/lib/actions/Action.js +4 -1
- package/lib/actions/AjaxAction.js +1 -1
- package/lib/actions/BreakAction.js +1 -1
- package/lib/actions/BroadcastAction.js +1 -1
- package/lib/actions/CmptAction.js +56 -49
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +1 -1
- package/lib/actions/DialogAction.js +1 -1
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.js +1 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +1 -1
- package/lib/actions/PageAction.js +1 -1
- package/lib/actions/ParallelAction.js +1 -1
- package/lib/actions/PrintAction.js +1 -1
- package/lib/actions/StatusAction.js +1 -1
- package/lib/actions/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +2 -2
- package/lib/actions/WaitAction.js +1 -1
- 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.js +1 -1
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +0 -4
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -1
- package/lib/factory.d.ts +7 -1
- package/lib/factory.js +52 -4
- package/lib/index.d.ts +6 -4
- package/lib/index.js +17 -2
- package/lib/locale.d.ts +1 -1
- package/lib/locale.js +13 -2
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +2 -2
- package/lib/renderers/Form.js +11 -6
- package/lib/renderers/Item.d.ts +2 -1
- package/lib/renderers/Item.js +8 -9
- package/lib/renderers/Options.d.ts +46 -1
- package/lib/renderers/Options.js +920 -912
- 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 +8 -7
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +2 -1
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.js +1 -1
- package/lib/store/form.d.ts +1 -1
- package/lib/store/form.js +5 -1
- package/lib/store/formItem.js +4 -4
- package/lib/store/iRenderer.js +1 -1
- package/lib/store/index.js +1 -1
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.js +1 -1
- package/lib/store/service.js +1 -1
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +2 -1
- package/lib/store/table.js +1 -1
- package/lib/store/table2.js +1 -1
- package/lib/theme.d.ts +1 -1
- package/lib/theme.js +13 -2
- package/lib/types.d.ts +2 -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/animations.d.ts +19 -0
- package/lib/utils/animations.js +62 -0
- package/lib/utils/api.d.ts +2 -1
- package/lib/utils/api.js +10 -2
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +4 -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.d.ts +3 -3
- package/lib/utils/debug.js +103 -36
- 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 +1 -0
- package/lib/utils/helper.js +15 -1
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/isPureVariable.js +1 -1
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.js +2 -2
- package/lib/utils/loopTooMuch.d.ts +1 -0
- package/lib/utils/loopTooMuch.js +31 -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 +11 -6
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.js +1 -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.js +1 -1
- package/lib/utils/style-helper.js +1 -1
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +1 -1
- package/lib/utils/tpl-lodash.js +1 -1
- package/lib/utils/tpl.js +1 -1
- package/lib/utils/uncontrollable.js +1 -1
- package/lib/utils/validateId.js +1 -1
- package/lib/utils/validations.js +17 -12
- package/lib/utils/visitedCache.js +1 -1
- package/package.json +5 -4
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.9.0-rc.
|
|
2
|
+
* amis-core v6.9.0-rc.11
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -42,6 +42,7 @@ var isPureVariable = require('./utils/isPureVariable.js');
|
|
|
42
42
|
var jsonSchema2AmisSchema = require('./utils/json-schema-2-amis-schema.js');
|
|
43
43
|
var keyToPath = require('./utils/keyToPath.js');
|
|
44
44
|
var labelToString = require('./utils/labelToString.js');
|
|
45
|
+
var loopTooMuch = require('./utils/loopTooMuch.js');
|
|
45
46
|
var makeSorter = require('./utils/makeSorter.js');
|
|
46
47
|
var normalizeLink = require('./utils/normalizeLink.js');
|
|
47
48
|
var normalizeOptions = require('./utils/normalizeOptions.js');
|
|
@@ -74,6 +75,7 @@ var resolveCondition = require('./utils/resolveCondition.js');
|
|
|
74
75
|
var arraySlice = require('./utils/arraySlice.js');
|
|
75
76
|
var math = require('./utils/math.js');
|
|
76
77
|
var Animation = require('./utils/Animation.js');
|
|
78
|
+
var animations = require('./utils/animations.js');
|
|
77
79
|
var index = require('./store/index.js');
|
|
78
80
|
var mobxStateTree = require('mobx-state-tree');
|
|
79
81
|
var locale = require('./locale.js');
|
|
@@ -115,6 +117,7 @@ var Form = require('./renderers/Form.js');
|
|
|
115
117
|
var SchemaRenderer = require('./SchemaRenderer.js');
|
|
116
118
|
var CustomStyle = require('./components/CustomStyle.js');
|
|
117
119
|
var StatusScoped = require('./StatusScoped.js');
|
|
120
|
+
var StyleManager = require('./StyleManager.js');
|
|
118
121
|
var stripNumber = require('./utils/stripNumber.js');
|
|
119
122
|
var iRenderer = require('./store/iRenderer.js');
|
|
120
123
|
var service = require('./store/service.js');
|
|
@@ -139,7 +142,11 @@ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
|
139
142
|
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
140
143
|
var classPrefix = theme.getClassPrefix();
|
|
141
144
|
// @ts-ignore
|
|
142
|
-
var version = '6.9.0-rc.
|
|
145
|
+
var version = '6.9.0-rc.11';
|
|
146
|
+
window.amisVersionInfo = {
|
|
147
|
+
version: '6.9.0-rc.11',
|
|
148
|
+
buildTime: '2024-11-19T09:27:22.613Z'
|
|
149
|
+
};
|
|
143
150
|
function render(schema, props, options, pathPrefix) {
|
|
144
151
|
if (props === void 0) { props = {}; }
|
|
145
152
|
if (options === void 0) { options = {}; }
|
|
@@ -213,6 +220,7 @@ exports.addSchemaFilter = factory.addSchemaFilter;
|
|
|
213
220
|
exports.clearStoresCache = factory.clearStoresCache;
|
|
214
221
|
exports.extendDefaultEnv = factory.extendDefaultEnv;
|
|
215
222
|
exports.filterSchema = factory.filterSchema;
|
|
223
|
+
exports.getGlobalOptions = factory.getGlobalOptions;
|
|
216
224
|
exports.getRendererByName = factory.getRendererByName;
|
|
217
225
|
exports.getRenderers = factory.getRenderers;
|
|
218
226
|
exports.loadAllAsyncRenderers = factory.loadAllAsyncRenderers;
|
|
@@ -220,9 +228,11 @@ exports.loadAsyncRenderer = factory.loadAsyncRenderer;
|
|
|
220
228
|
exports.loadAsyncRenderersByType = factory.loadAsyncRenderersByType;
|
|
221
229
|
exports.registerRenderer = factory.registerRenderer;
|
|
222
230
|
exports.resolveRenderer = factory.resolveRenderer;
|
|
231
|
+
exports.setGlobalOptions = factory.setGlobalOptions;
|
|
223
232
|
exports.unRegisterRenderer = factory.unRegisterRenderer;
|
|
224
233
|
exports.updateEnv = factory.updateEnv;
|
|
225
234
|
exports.addApiRequestAdaptor = api.addApiRequestAdaptor;
|
|
235
|
+
exports.addApiResponseAdaptor = api.addApiResponseAdaptor;
|
|
226
236
|
exports.addApiResponseAdator = api.addApiResponseAdator;
|
|
227
237
|
exports.buildApi = api.buildApi;
|
|
228
238
|
exports.callStrFunction = api.callStrFunction;
|
|
@@ -321,6 +331,7 @@ exports.findTreeAll = helper.findTreeAll;
|
|
|
321
331
|
exports.findTreeIndex = helper.findTreeIndex;
|
|
322
332
|
exports.flattenTree = helper.flattenTree;
|
|
323
333
|
exports.flattenTreeWithLeafNodes = helper.flattenTreeWithLeafNodes;
|
|
334
|
+
exports.formateId = helper.formateId;
|
|
324
335
|
exports.getLevelFromClassName = helper.getLevelFromClassName;
|
|
325
336
|
exports.getPropValue = helper.getPropValue;
|
|
326
337
|
exports.getRange = helper.getRange;
|
|
@@ -394,6 +405,7 @@ exports.isPureVariable = isPureVariable.isPureVariable;
|
|
|
394
405
|
exports.JSONSchme2AMisSchema = jsonSchema2AmisSchema.JSONSchme2AMisSchema;
|
|
395
406
|
exports.keyToPath = keyToPath.keyToPath;
|
|
396
407
|
exports.labelToString = labelToString.labelToString;
|
|
408
|
+
exports.loopTooMuch = loopTooMuch.loopTooMuch;
|
|
397
409
|
exports.makeSorter = makeSorter.makeSorter;
|
|
398
410
|
exports.normalizeLink = normalizeLink.normalizeLink;
|
|
399
411
|
exports.normalizeOptions = normalizeOptions.normalizeOptions;
|
|
@@ -478,6 +490,7 @@ exports.numberFormatter = math.numberFormatter;
|
|
|
478
490
|
exports.safeAdd = math.safeAdd;
|
|
479
491
|
exports.safeSub = math.safeSub;
|
|
480
492
|
exports.animation = Animation["default"];
|
|
493
|
+
exports.createAnimationStyle = animations.createAnimationStyle;
|
|
481
494
|
exports.RegisterStore = index.RegisterStore;
|
|
482
495
|
exports.RendererStore = index.RendererStore;
|
|
483
496
|
exports.registerStore = index.registerStore;
|
|
@@ -512,6 +525,7 @@ exports.FormItemWrap = Item.FormItemWrap;
|
|
|
512
525
|
exports.getFormItemByName = Item.getFormItemByName;
|
|
513
526
|
exports.registerFormItem = Item.registerFormItem;
|
|
514
527
|
exports.OptionsControl = Options.OptionsControl;
|
|
528
|
+
exports.OptionsControlBase = Options.OptionsControlBase;
|
|
515
529
|
exports.registerOptionsControl = Options.registerOptionsControl;
|
|
516
530
|
exports.addRootWrapper = Root.addRootWrapper;
|
|
517
531
|
exports.envOverwrite = envOverwrite.envOverwrite;
|
|
@@ -568,6 +582,7 @@ exports.FormRenderer = Form.FormRenderer;
|
|
|
568
582
|
exports.RENDERER_TRANSMISSION_OMIT_PROPS = SchemaRenderer.RENDERER_TRANSMISSION_OMIT_PROPS;
|
|
569
583
|
exports.CustomStyle = CustomStyle["default"];
|
|
570
584
|
exports.StatusScoped = StatusScoped.StatusScoped;
|
|
585
|
+
exports.styleManager = StyleManager["default"];
|
|
571
586
|
exports.stripNumber = stripNumber.stripNumber;
|
|
572
587
|
exports.iRendererStore = iRenderer.iRendererStore;
|
|
573
588
|
exports.ServiceStore = service.ServiceStore;
|
package/lib/locale.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface LocaleProps {
|
|
|
16
16
|
translate: TranslateFn;
|
|
17
17
|
}
|
|
18
18
|
export declare const LocaleContext: React.Context<string>;
|
|
19
|
-
export declare function localeable<T extends React.ComponentType<React.ComponentProps<T> & LocaleProps>>(ComposedComponent: T): {
|
|
19
|
+
export declare function localeable<T extends React.ComponentType<React.ComponentProps<T> & LocaleProps>>(ComposedComponent: T, methods?: Array<string>): {
|
|
20
20
|
new (props: JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, keyof LocaleProps>> & {
|
|
21
21
|
locale?: string | undefined;
|
|
22
22
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
package/lib/locale.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.9.0-rc.
|
|
2
|
+
* amis-core v6.9.0-rc.11
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -99,7 +99,7 @@ function setDefaultLocale(locale) {
|
|
|
99
99
|
defaultLocale = locale;
|
|
100
100
|
}
|
|
101
101
|
var LocaleContext = React__default["default"].createContext('');
|
|
102
|
-
function localeable(ComposedComponent) {
|
|
102
|
+
function localeable(ComposedComponent, methods) {
|
|
103
103
|
var _a;
|
|
104
104
|
var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
105
105
|
tslib.__extends(class_1, _super);
|
|
@@ -141,6 +141,17 @@ function localeable(ComposedComponent) {
|
|
|
141
141
|
_a.contextType = LocaleContext,
|
|
142
142
|
_a.ComposedComponent = ComposedComponent,
|
|
143
143
|
_a), ComposedComponent);
|
|
144
|
+
if (Array.isArray(methods)) {
|
|
145
|
+
methods.forEach(function (method) {
|
|
146
|
+
if (ComposedComponent.prototype[method]) {
|
|
147
|
+
result.prototype[method] = function () {
|
|
148
|
+
var _a;
|
|
149
|
+
var fn = (_a = this.ref) === null || _a === void 0 ? void 0 : _a[method];
|
|
150
|
+
return fn ? fn.apply(this.ref, arguments) : undefined;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
144
155
|
return result;
|
|
145
156
|
}
|
|
146
157
|
|
package/lib/polyfills.js
CHANGED
package/lib/renderers/Form.d.ts
CHANGED
|
@@ -263,7 +263,7 @@ export interface FormProps extends RendererProps, Omit<FormSchemaBase, 'mode' |
|
|
|
263
263
|
onSubmit?: (values: object, action: any) => any;
|
|
264
264
|
onChange?: (values: object, diff: object, props: any) => any;
|
|
265
265
|
onFailed?: (reason: string, errors: any) => any;
|
|
266
|
-
onFinished: (values: object, action:
|
|
266
|
+
onFinished: (values: object, action: ActionObject, store: IFormStore) => any;
|
|
267
267
|
onValidate: (values: object, form: any) => any;
|
|
268
268
|
onValidChange?: (valid: boolean, props: any) => void;
|
|
269
269
|
messages: {
|
|
@@ -338,7 +338,7 @@ export default class Form extends React.Component<FormProps, object> {
|
|
|
338
338
|
onInit(): Promise<void>;
|
|
339
339
|
reload(subPath?: string, query?: any, ctx?: any, silent?: boolean): Promise<any>;
|
|
340
340
|
receive(values: object, name?: string, replace?: boolean): Promise<any>;
|
|
341
|
-
silentReload(target?: string, query?: any):
|
|
341
|
+
silentReload(target?: string, query?: any): Promise<any>;
|
|
342
342
|
initInterval(value: any): any;
|
|
343
343
|
isValidated(): boolean;
|
|
344
344
|
validate(forceValidate?: boolean, throwErrors?: boolean, toastErrors?: boolean, skipFlush?: boolean): Promise<boolean>;
|
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.9.0-rc.
|
|
2
|
+
* amis-core v6.9.0-rc.11
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -111,6 +111,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
111
111
|
_this.blockRouting = _this.blockRouting.bind(_this);
|
|
112
112
|
_this.beforePageUnload = _this.beforePageUnload.bind(_this);
|
|
113
113
|
_this.formItemDispatchEvent = _this.formItemDispatchEvent.bind(_this);
|
|
114
|
+
_this.flush = _this.flush.bind(_this);
|
|
114
115
|
var store = props.store, canAccessSuperData = props.canAccessSuperData, persistData = props.persistData, simpleMode = props.simpleMode, formLazyChange = props.formLazyChange;
|
|
115
116
|
store.setCanAccessSuperData(canAccessSuperData !== false);
|
|
116
117
|
store.setPersistData(persistData);
|
|
@@ -394,7 +395,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
394
395
|
case 3:
|
|
395
396
|
// 派发初始化接口请求完成事件
|
|
396
397
|
this.dispatchInited(result);
|
|
397
|
-
return [2 /*return
|
|
398
|
+
return [2 /*return*/, store.data];
|
|
398
399
|
}
|
|
399
400
|
});
|
|
400
401
|
});
|
|
@@ -405,7 +406,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
405
406
|
return this.reload();
|
|
406
407
|
};
|
|
407
408
|
Form.prototype.silentReload = function (target, query) {
|
|
408
|
-
this.reload(target, query, undefined, true);
|
|
409
|
+
return this.reload(target, query, undefined, true);
|
|
409
410
|
};
|
|
410
411
|
Form.prototype.initInterval = function (value) {
|
|
411
412
|
var _a = this.props, interval = _a.interval, silentPolling = _a.silentPolling, stopAutoRefreshWhen = _a.stopAutoRefreshWhen, data = _a.data;
|
|
@@ -623,7 +624,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
623
624
|
if (!(dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented)) {
|
|
624
625
|
onChange && onChange.apply(null, changeProps);
|
|
625
626
|
}
|
|
626
|
-
store.clearRestError();
|
|
627
|
+
mobxStateTree.isAlive(store) && store.clearRestError();
|
|
627
628
|
if (!(!emitedFromWatch && (submit || (submitOnChange && store.inited)))) return [3 /*break*/, 3];
|
|
628
629
|
return [4 /*yield*/, this.handleAction(undefined, {
|
|
629
630
|
type: 'submit',
|
|
@@ -697,6 +698,9 @@ var Form = /** @class */ (function (_super) {
|
|
|
697
698
|
_f.sent();
|
|
698
699
|
_f.label = 2;
|
|
699
700
|
case 2:
|
|
701
|
+
if (!mobxStateTree.isAlive(store)) {
|
|
702
|
+
return [2 /*return*/];
|
|
703
|
+
}
|
|
700
704
|
if (trimValues) {
|
|
701
705
|
store.trimValues();
|
|
702
706
|
}
|
|
@@ -897,7 +901,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
897
901
|
if (values === false) {
|
|
898
902
|
return store.data;
|
|
899
903
|
}
|
|
900
|
-
if (onFinished && onFinished(values, action) === false) {
|
|
904
|
+
if (onFinished && onFinished(values, action, store) === false) {
|
|
901
905
|
return values;
|
|
902
906
|
}
|
|
903
907
|
resetAfterSubmit && store.reset(_this.handleReset(action));
|
|
@@ -1256,7 +1260,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
1256
1260
|
removeHook: this.removeHook,
|
|
1257
1261
|
renderFormItems: this.renderFormItems,
|
|
1258
1262
|
formItemDispatchEvent: this.formItemDispatchEvent,
|
|
1259
|
-
formPristine: form.pristine
|
|
1263
|
+
formPristine: form.pristine,
|
|
1264
|
+
onFlushForm: this.flush
|
|
1260
1265
|
// value: (control as any)?.name
|
|
1261
1266
|
// ? getVariable(form.data, (control as any)?.name, canAccessSuperData)
|
|
1262
1267
|
// : (control as any)?.value,
|
package/lib/renderers/Item.d.ts
CHANGED
|
@@ -362,6 +362,7 @@ export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
|
|
362
362
|
renderDescription?: boolean;
|
|
363
363
|
test?: RegExp | TestFunc;
|
|
364
364
|
storeType?: string;
|
|
365
|
+
formItemStoreType?: string;
|
|
365
366
|
validations?: string;
|
|
366
367
|
strictMode?: boolean;
|
|
367
368
|
/**
|
|
@@ -460,7 +461,7 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
460
461
|
* @param ctx 上下文对象,类型为任意类型
|
|
461
462
|
* @param skipIfExits 是否跳过已存在的属性,默认为 false
|
|
462
463
|
*/
|
|
463
|
-
applyMapping(mapping: any, ctx: any, skipIfExits?: boolean
|
|
464
|
+
applyMapping(mapping: any, ctx: any, skipIfExits?: boolean): void;
|
|
464
465
|
buildAutoFillSchema(): {
|
|
465
466
|
popOverContainer: any;
|
|
466
467
|
popOverClassName: any;
|
package/lib/renderers/Item.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.9.0-rc.
|
|
2
|
+
* amis-core v6.9.0-rc.11
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -136,7 +136,7 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
136
136
|
if (!result) {
|
|
137
137
|
return [2 /*return*/];
|
|
138
138
|
}
|
|
139
|
-
this.applyMapping((_d = autoFill === null || autoFill === void 0 ? void 0 : autoFill.fillMapping) !== null && _d !== void 0 ? _d : { '&': '$$' }, result, false
|
|
139
|
+
this.applyMapping((_d = autoFill === null || autoFill === void 0 ? void 0 : autoFill.fillMapping) !== null && _d !== void 0 ? _d : { '&': '$$' }, result, false);
|
|
140
140
|
_e.label = 3;
|
|
141
141
|
case 3: return [3 /*break*/, 5];
|
|
142
142
|
case 4:
|
|
@@ -293,10 +293,9 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
293
293
|
* @param ctx 上下文对象,类型为任意类型
|
|
294
294
|
* @param skipIfExits 是否跳过已存在的属性,默认为 false
|
|
295
295
|
*/
|
|
296
|
-
FormItemWrap.prototype.applyMapping = function (mapping, ctx, skipIfExits
|
|
296
|
+
FormItemWrap.prototype.applyMapping = function (mapping, ctx, skipIfExits) {
|
|
297
297
|
if (skipIfExits === void 0) { skipIfExits = false; }
|
|
298
|
-
|
|
299
|
-
var _a = this.props, onBulkChange = _a.onBulkChange, data = _a.data, formItem = _a.formItem;
|
|
298
|
+
var _a = this.props, onBulkChange = _a.onBulkChange, data = _a.data; _a.formItem;
|
|
300
299
|
var toSync = dataMapping.dataMapping(mapping, ctx);
|
|
301
300
|
var tmpData = tslib.__assign({}, data);
|
|
302
301
|
var result = tslib.__assign({}, toSync);
|
|
@@ -323,9 +322,9 @@ var FormItemWrap = /** @class */ (function (_super) {
|
|
|
323
322
|
}
|
|
324
323
|
});
|
|
325
324
|
// 是否忽略自己的设置
|
|
326
|
-
if (ignoreSelf &&
|
|
327
|
-
|
|
328
|
-
}
|
|
325
|
+
// if (ignoreSelf && formItem?.name) {
|
|
326
|
+
// deleteVariable(result, formItem.name);
|
|
327
|
+
// }
|
|
329
328
|
onBulkChange(result);
|
|
330
329
|
};
|
|
331
330
|
FormItemWrap.prototype.buildAutoFillSchema = function () {
|
|
@@ -1038,7 +1037,7 @@ function asFormItem(config) {
|
|
|
1038
1037
|
})(mobxReact.observer(Control));
|
|
1039
1038
|
delete config.storeType;
|
|
1040
1039
|
}
|
|
1041
|
-
return wrapControl.wrapControl(hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
1040
|
+
return wrapControl.wrapControl(config, hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
1042
1041
|
tslib.__extends(class_1, _super);
|
|
1043
1042
|
function class_1(props) {
|
|
1044
1043
|
var _this = _super.call(this, props) || this;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file 所有列表选择类控件的父级,比如 Select、Radios、Checkboxes、
|
|
3
3
|
* List、ButtonGroup 等等
|
|
4
4
|
*/
|
|
5
|
-
import { Api, PlainObject, OptionProps, BaseApiObject } from '../types';
|
|
5
|
+
import { Api, PlainObject, ActionObject, OptionProps, BaseApiObject } from '../types';
|
|
6
6
|
import { FormControlProps, FormItemBasicConfig, FormBaseControl } from './Item';
|
|
7
7
|
export type OptionsControlComponent = React.ComponentType<FormControlProps>;
|
|
8
8
|
import React from 'react';
|
|
@@ -156,5 +156,50 @@ export interface OptionsProps extends FormControlProps, Omit<OptionProps, 'class
|
|
|
156
156
|
optionLabel?: string;
|
|
157
157
|
}
|
|
158
158
|
export declare const detectProps: string[];
|
|
159
|
+
export declare class OptionsControlBase<T extends OptionsProps = OptionsProps, S = any> extends React.Component<T, S> {
|
|
160
|
+
readonly config: OptionsConfig;
|
|
161
|
+
toDispose: Array<() => void>;
|
|
162
|
+
input: any;
|
|
163
|
+
mounted: boolean;
|
|
164
|
+
constructor(props: T, config: OptionsConfig);
|
|
165
|
+
componentDidMount(): void;
|
|
166
|
+
shouldComponentUpdate(nextProps: OptionsProps): boolean;
|
|
167
|
+
componentDidUpdate(prevProps: OptionsProps): void;
|
|
168
|
+
componentWillUnmount(): void;
|
|
169
|
+
oldDispatchOptionEvent(eventName: string, eventData?: any): Promise<boolean>;
|
|
170
|
+
dispatchOptionEvent(eventName: string, eventData?: any): Promise<boolean>;
|
|
171
|
+
doAction(action: ActionObject, data: object, throwErrors: boolean): void;
|
|
172
|
+
normalizeValue(): void;
|
|
173
|
+
getWrappedInstance(): any;
|
|
174
|
+
inputRef(ref: any): void;
|
|
175
|
+
handleToggle(option: Option, submitOnChange?: boolean, changeImmediately?: boolean): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* 初始化时处理默认全选逻辑
|
|
178
|
+
*/
|
|
179
|
+
defaultCheckAll(): void;
|
|
180
|
+
/**
|
|
181
|
+
* 选中的值经过joinValues和delimiter等规则处理输出规定格式的值
|
|
182
|
+
* @param valueArray 选中值的数组
|
|
183
|
+
* @returns 通过joinValues和delimiter等规则输出规定格式的值
|
|
184
|
+
*/
|
|
185
|
+
formatValueArray(valueArray: Array<Option>): string | Option | Option[];
|
|
186
|
+
handleToggleAll(): Promise<void>;
|
|
187
|
+
toggleValue(option: Option, originValue?: any): string | Option | Option[];
|
|
188
|
+
reload(): Promise<import("../types").Payload | null> | undefined;
|
|
189
|
+
reloadOptions(setError?: boolean, isInit?: boolean, data?: T["data"]): Promise<import("../types").Payload | null> | undefined;
|
|
190
|
+
deferLoad(option: Option): Promise<void>;
|
|
191
|
+
leftDeferLoad(option: Option, leftOptions: Option): void;
|
|
192
|
+
expandTreeOptions(nodePathArr: any[]): void;
|
|
193
|
+
initOptions(data: any): Promise<void>;
|
|
194
|
+
focus(): void;
|
|
195
|
+
changeOptionValue(value: any): void;
|
|
196
|
+
setOptions(options: Array<any>, skipNormalize?: boolean): void;
|
|
197
|
+
syncOptions(): void;
|
|
198
|
+
setLoading(value: boolean): void;
|
|
199
|
+
handleOptionAdd(idx?: number | Array<number>, value?: any, skipForm?: boolean, callback?: (value: any) => any): Promise<void>;
|
|
200
|
+
handleOptionEdit(value: any, origin?: any, skipForm?: boolean, callback?: (value: any) => any): Promise<void>;
|
|
201
|
+
handleOptionDelete(value: any, callback?: (value: any) => any): Promise<void>;
|
|
202
|
+
render(): React.ReactNode;
|
|
203
|
+
}
|
|
159
204
|
export declare function registerOptionsControl(config: OptionsConfig): import("..").RendererConfig;
|
|
160
205
|
export declare function OptionsControl(config: OptionsBasicConfig): <T extends React.ComponentType<OptionsControlProps>>(component: T) => T;
|