amis-core 6.7.0 → 6.9.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/Root.js +1 -1
- package/esm/RootRenderer.d.ts +1 -1
- package/esm/RootRenderer.js +24 -2
- package/esm/SchemaRenderer.d.ts +0 -1
- package/esm/SchemaRenderer.js +44 -20
- package/esm/Scoped.d.ts +1 -1
- package/esm/Scoped.js +2 -1
- package/esm/StatusScoped.js +1 -1
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +14 -14
- package/esm/actions/Action.js +2 -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 +2 -1
- package/esm/actions/DialogAction.js +3 -1
- package/esm/actions/DrawerAction.js +2 -1
- package/esm/actions/EmailAction.js +1 -1
- package/esm/actions/EventAction.js +2 -1
- package/esm/actions/LinkAction.js +1 -1
- package/esm/actions/LoopAction.js +2 -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.d.ts +40 -2
- package/esm/components/LazyComponent.js +13 -7
- package/esm/components/Overlay.js +2 -1
- package/esm/components/PopOver.d.ts +1 -1
- package/esm/components/PopOver.js +2 -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 +19 -2
- package/esm/factory.js +205 -45
- package/esm/index.d.ts +4 -4
- package/esm/index.js +9 -5
- package/esm/locale.d.ts +1 -1
- package/esm/locale.js +14 -2
- package/esm/polyfills.js +1 -1
- package/esm/renderers/Form.d.ts +5 -5
- package/esm/renderers/Form.js +68 -29
- package/esm/renderers/Item.d.ts +109 -18
- package/esm/renderers/Item.js +164 -126
- package/esm/renderers/Options.d.ts +3 -3
- package/esm/renderers/Options.js +43 -19
- 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 +3 -3
- package/esm/renderers/wrapControl.js +25 -10
- package/esm/store/app.d.ts +3 -3
- package/esm/store/app.js +2 -1
- package/esm/store/combo.d.ts +425 -15
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +3 -3
- package/esm/store/crud.js +2 -1
- package/esm/store/form.d.ts +178 -7
- package/esm/store/form.js +29 -6
- package/esm/store/formItem.d.ts +5 -0
- package/esm/store/formItem.js +32 -10
- package/esm/store/iRenderer.d.ts +4 -3
- package/esm/store/iRenderer.js +29 -4
- package/esm/store/index.d.ts +1 -0
- package/esm/store/index.js +3 -2
- package/esm/store/list.d.ts +3 -3
- package/esm/store/list.js +1 -1
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +3 -3
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +3 -3
- package/esm/store/pagination.js +2 -1
- package/esm/store/root.d.ts +5 -3
- package/esm/store/root.js +46 -21
- package/esm/store/service.d.ts +3 -3
- package/esm/store/service.js +11 -4
- package/esm/store/status.js +1 -1
- package/esm/store/table.d.ts +396 -36
- package/esm/store/table.js +84 -54
- package/esm/store/table2.d.ts +3 -3
- 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 +19 -2
- 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.d.ts +21 -1
- package/esm/utils/api.js +138 -41
- package/esm/utils/arraySlice.js +1 -1
- package/esm/utils/attachmentAdpator.js +1 -1
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/browser.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/concatData.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.js +1 -1
- package/esm/utils/debug.js +17 -3
- 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 +2 -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 +4 -1
- package/esm/utils/helper.js +20 -4
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/isPureVariable.js +2 -2
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/labelToString.js +4 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/math.js +1 -1
- package/esm/utils/memoryParse.d.ts +2 -1
- package/esm/utils/memoryParse.js +10 -6
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +1 -1
- package/esm/utils/object.d.ts +2 -4
- package/esm/utils/object.js +1 -1
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/printElement.js +1 -1
- package/esm/utils/renderer-event.js +1 -1
- package/esm/utils/replaceText.js +1 -1
- package/esm/utils/resize-sensor.js +30 -1
- package/esm/utils/resolveCondition.js +2 -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 +2 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.js +1 -1
- package/esm/utils/tpl-builtin.js +2 -1
- package/esm/utils/tpl-lodash.js +2 -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 +2 -1
- package/esm/utils/visitedCache.d.ts +46 -0
- package/esm/utils/visitedCache.js +124 -0
- package/lib/Root.js +1 -1
- package/lib/RootRenderer.js +23 -1
- package/lib/SchemaRenderer.d.ts +0 -1
- package/lib/SchemaRenderer.js +42 -18
- package/lib/Scoped.d.ts +1 -1
- package/lib/Scoped.js +2 -1
- package/lib/StatusScoped.js +1 -1
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +14 -14
- package/lib/actions/Action.js +2 -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 +2 -1
- package/lib/actions/DialogAction.js +3 -1
- package/lib/actions/DrawerAction.js +2 -1
- package/lib/actions/EmailAction.js +1 -1
- package/lib/actions/EventAction.js +2 -1
- package/lib/actions/LinkAction.js +1 -1
- package/lib/actions/LoopAction.js +2 -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.d.ts +40 -2
- package/lib/components/LazyComponent.js +14 -7
- package/lib/components/Overlay.js +2 -1
- package/lib/components/PopOver.d.ts +1 -1
- package/lib/components/PopOver.js +2 -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 +19 -2
- package/lib/factory.js +211 -44
- package/lib/index.d.ts +4 -4
- package/lib/index.js +16 -2
- package/lib/locale.d.ts +1 -1
- package/lib/locale.js +14 -2
- package/lib/polyfills.js +1 -1
- package/lib/renderers/Form.d.ts +5 -5
- package/lib/renderers/Form.js +65 -26
- package/lib/renderers/Item.d.ts +110 -19
- package/lib/renderers/Item.js +163 -125
- package/lib/renderers/Options.d.ts +3 -3
- package/lib/renderers/Options.js +43 -19
- 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 +3 -3
- package/lib/renderers/wrapControl.js +25 -10
- package/lib/store/app.d.ts +3 -3
- package/lib/store/app.js +2 -1
- package/lib/store/combo.d.ts +449 -40
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +3 -3
- package/lib/store/crud.js +3 -2
- package/lib/store/form.d.ts +188 -18
- package/lib/store/form.js +29 -6
- package/lib/store/formItem.d.ts +5 -0
- package/lib/store/formItem.js +32 -10
- package/lib/store/iRenderer.d.ts +4 -3
- package/lib/store/iRenderer.js +29 -4
- package/lib/store/index.d.ts +1 -0
- package/lib/store/index.js +3 -1
- package/lib/store/list.d.ts +3 -3
- package/lib/store/list.js +1 -1
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +3 -3
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +3 -3
- package/lib/store/pagination.js +2 -1
- package/lib/store/root.d.ts +5 -3
- package/lib/store/root.js +44 -19
- package/lib/store/service.d.ts +3 -3
- package/lib/store/service.js +11 -4
- package/lib/store/status.js +1 -1
- package/lib/store/table.d.ts +416 -57
- package/lib/store/table.js +84 -54
- package/lib/store/table2.d.ts +3 -3
- 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 +19 -2
- 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.d.ts +21 -1
- package/lib/utils/api.js +141 -40
- package/lib/utils/arraySlice.js +1 -1
- package/lib/utils/attachmentAdpator.js +1 -1
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/browser.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/concatData.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.js +1 -1
- package/lib/utils/debug.js +18 -4
- 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 +2 -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 +4 -1
- package/lib/utils/helper.js +19 -3
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/isPureVariable.js +2 -2
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/labelToString.js +4 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/math.js +1 -1
- package/lib/utils/memoryParse.d.ts +2 -1
- package/lib/utils/memoryParse.js +10 -6
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +1 -1
- package/lib/utils/object.d.ts +2 -4
- package/lib/utils/object.js +1 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/printElement.js +1 -1
- package/lib/utils/renderer-event.js +1 -1
- package/lib/utils/replaceText.js +1 -1
- package/lib/utils/resize-sensor.js +30 -1
- package/lib/utils/resolveCondition.js +2 -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 +2 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.js +1 -1
- package/lib/utils/tpl-builtin.js +2 -1
- package/lib/utils/tpl-lodash.js +2 -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 +2 -1
- package/lib/utils/visitedCache.d.ts +46 -0
- package/lib/utils/visitedCache.js +128 -0
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
/// <reference types="react" />
|
|
9
|
-
import { Renderer, getRendererByName, getRenderers, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, addSchemaFilter, extendDefaultEnv } from './factory';
|
|
10
|
-
import type { RenderOptions, RendererConfig, RendererProps } from './factory';
|
|
9
|
+
import { Renderer, getRendererByName, getRenderers, loadAllAsyncRenderers, loadAsyncRenderersByType, loadAsyncRenderer, registerRenderer, unRegisterRenderer, resolveRenderer, filterSchema, clearStoresCache, updateEnv, addSchemaFilter, extendDefaultEnv, getGlobalOptions, setGlobalOptions } from './factory';
|
|
10
|
+
import type { RenderOptions, RendererConfig, RendererProps, hasAsyncRenderers } from './factory';
|
|
11
11
|
import './polyfills';
|
|
12
12
|
import './renderers/builtin';
|
|
13
13
|
import './renderers/register';
|
|
@@ -15,7 +15,7 @@ export * from './utils/index';
|
|
|
15
15
|
export * from './types';
|
|
16
16
|
export * from './store';
|
|
17
17
|
import * as utils from './utils/helper';
|
|
18
|
-
import { RegisterStore } from './store';
|
|
18
|
+
import { RegisterStore, registerStore } from './store';
|
|
19
19
|
import type { IColumn, IColumn2, IRow, IRow2 } from './store';
|
|
20
20
|
import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, removeLocaleData, localeable } from './locale';
|
|
21
21
|
import type { LocaleProps, TranslateFn } from './locale';
|
|
@@ -51,5 +51,5 @@ import type { IItem } from './store/list';
|
|
|
51
51
|
import CustomStyle from './components/CustomStyle';
|
|
52
52
|
import { StatusScoped } from './StatusScoped';
|
|
53
53
|
export declare const version = "__buildVersion";
|
|
54
|
-
export { clearStoresCache, updateEnv, Renderer, RendererProps, RenderOptions, RendererEnv, EnvContext, RegisterStore, FormItem, FormItemWrap, FormItemProps, OptionsControl, FormRenderer, FormHorizontal, utils, getRendererByName, registerRenderer, unRegisterRenderer, getRenderers, registerFormItem, getFormItemByName, registerOptionsControl, resolveRenderer, filterSchema, Scoped, ScopedContext, IScopedContext, StatusScoped, setDefaultTheme, theme, themeable, ThemeProps, getTheme, classPrefix, getClassPrefix, classnames, makeClassnames, getDefaultLocale, setDefaultLocale, registerLocale, makeTranslator, extendLocale, removeLocaleData, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, AsyncEvaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, registerFunction, evaluate, evaluateForAsync, LazyComponent, Overlay, PopOver, ErrorBoundary, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig, styleMap, RENDERER_TRANSMISSION_OMIT_PROPS, ScopedComponentType, IItem, IColumn, IRow, IColumn2, IRow2, OnEventProps, FormSchemaBase, filterTarget, splitTarget, CustomStyle, enableDebug, disableDebug, envOverwrite };
|
|
54
|
+
export { clearStoresCache, updateEnv, Renderer, RendererProps, RenderOptions, RendererEnv, EnvContext, RegisterStore, registerStore, FormItem, FormItemWrap, FormItemProps, OptionsControl, FormRenderer, FormHorizontal, utils, getRendererByName, registerRenderer, unRegisterRenderer, getRenderers, loadAllAsyncRenderers, loadAsyncRenderersByType, loadAsyncRenderer, hasAsyncRenderers, registerFormItem, getFormItemByName, registerOptionsControl, resolveRenderer, filterSchema, Scoped, ScopedContext, IScopedContext, StatusScoped, setDefaultTheme, theme, themeable, ThemeProps, getTheme, classPrefix, getClassPrefix, classnames, makeClassnames, getDefaultLocale, setDefaultLocale, registerLocale, makeTranslator, extendLocale, removeLocaleData, localeable, LocaleProps, TranslateFn, ClassNamesFn, parse, lexer, Evaluator, AsyncEvaluator, FilterContext, filters, getFilters, registerFilter, extendsFilters, registerFunction, evaluate, evaluateForAsync, LazyComponent, Overlay, PopOver, ErrorBoundary, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig, styleMap, RENDERER_TRANSMISSION_OMIT_PROPS, ScopedComponentType, IItem, IColumn, IRow, IColumn2, IRow2, OnEventProps, FormSchemaBase, filterTarget, splitTarget, CustomStyle, enableDebug, disableDebug, envOverwrite, getGlobalOptions, setGlobalOptions };
|
|
55
55
|
export declare function render(schema: Schema, props?: RootRenderProps, options?: RenderOptions, pathPrefix?: string): JSX.Element;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.9.0-beta.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -139,7 +139,11 @@ var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
|
|
|
139
139
|
(__react_jsx__["default"] || __react_jsx__).Fragment;
|
|
140
140
|
var classPrefix = theme.getClassPrefix();
|
|
141
141
|
// @ts-ignore
|
|
142
|
-
var version = '6.
|
|
142
|
+
var version = '6.9.0-beta.0';
|
|
143
|
+
window.amisVersionInfo = {
|
|
144
|
+
version: '6.9.0-beta.0',
|
|
145
|
+
buildTime: '2024-10-22T11:40:47.953Z'
|
|
146
|
+
};
|
|
143
147
|
function render(schema, props, options, pathPrefix) {
|
|
144
148
|
if (props === void 0) { props = {}; }
|
|
145
149
|
if (options === void 0) { options = {}; }
|
|
@@ -213,12 +217,19 @@ exports.addSchemaFilter = factory.addSchemaFilter;
|
|
|
213
217
|
exports.clearStoresCache = factory.clearStoresCache;
|
|
214
218
|
exports.extendDefaultEnv = factory.extendDefaultEnv;
|
|
215
219
|
exports.filterSchema = factory.filterSchema;
|
|
220
|
+
exports.getGlobalOptions = factory.getGlobalOptions;
|
|
216
221
|
exports.getRendererByName = factory.getRendererByName;
|
|
217
222
|
exports.getRenderers = factory.getRenderers;
|
|
223
|
+
exports.loadAllAsyncRenderers = factory.loadAllAsyncRenderers;
|
|
224
|
+
exports.loadAsyncRenderer = factory.loadAsyncRenderer;
|
|
225
|
+
exports.loadAsyncRenderersByType = factory.loadAsyncRenderersByType;
|
|
218
226
|
exports.registerRenderer = factory.registerRenderer;
|
|
219
227
|
exports.resolveRenderer = factory.resolveRenderer;
|
|
228
|
+
exports.setGlobalOptions = factory.setGlobalOptions;
|
|
220
229
|
exports.unRegisterRenderer = factory.unRegisterRenderer;
|
|
221
230
|
exports.updateEnv = factory.updateEnv;
|
|
231
|
+
exports.addApiRequestAdaptor = api.addApiRequestAdaptor;
|
|
232
|
+
exports.addApiResponseAdator = api.addApiResponseAdator;
|
|
222
233
|
exports.buildApi = api.buildApi;
|
|
223
234
|
exports.callStrFunction = api.callStrFunction;
|
|
224
235
|
exports.clearApiCache = api.clearApiCache;
|
|
@@ -232,6 +243,8 @@ exports.jsFetcher = api.jsFetcher;
|
|
|
232
243
|
exports.jsonpFetcher = api.jsonpFetcher;
|
|
233
244
|
exports.normalizeApi = api.normalizeApi;
|
|
234
245
|
exports.normalizeApiResponseData = api.normalizeApiResponseData;
|
|
246
|
+
exports.removeApiRequestAdaptor = api.removeApiRequestAdaptor;
|
|
247
|
+
exports.removeApiResponseAdaptor = api.removeApiResponseAdaptor;
|
|
235
248
|
exports.responseAdaptor = api.responseAdaptor;
|
|
236
249
|
exports.setApiCache = api.setApiCache;
|
|
237
250
|
exports.str2AsyncFunction = api.str2AsyncFunction;
|
|
@@ -473,6 +486,7 @@ exports.safeSub = math.safeSub;
|
|
|
473
486
|
exports.animation = Animation["default"];
|
|
474
487
|
exports.RegisterStore = index.RegisterStore;
|
|
475
488
|
exports.RendererStore = index.RendererStore;
|
|
489
|
+
exports.registerStore = index.registerStore;
|
|
476
490
|
exports.extendLocale = locale.extendLocale;
|
|
477
491
|
exports.getDefaultLocale = locale.getDefaultLocale;
|
|
478
492
|
exports.localeable = locale.localeable;
|
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.
|
|
2
|
+
* amis-core v6.9.0-beta.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -14,6 +14,7 @@ var moment = require('moment');
|
|
|
14
14
|
require('amis-formula');
|
|
15
15
|
require('lodash/isPlainObject');
|
|
16
16
|
var resolveVariable = require('./utils/resolveVariable.js');
|
|
17
|
+
require('./utils/memoryParse.js');
|
|
17
18
|
require('@rc-component/mini-decimal');
|
|
18
19
|
require('./utils/filter.js');
|
|
19
20
|
|
|
@@ -98,7 +99,7 @@ function setDefaultLocale(locale) {
|
|
|
98
99
|
defaultLocale = locale;
|
|
99
100
|
}
|
|
100
101
|
var LocaleContext = React__default["default"].createContext('');
|
|
101
|
-
function localeable(ComposedComponent) {
|
|
102
|
+
function localeable(ComposedComponent, methods) {
|
|
102
103
|
var _a;
|
|
103
104
|
var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
104
105
|
tslib.__extends(class_1, _super);
|
|
@@ -140,6 +141,17 @@ function localeable(ComposedComponent) {
|
|
|
140
141
|
_a.contextType = LocaleContext,
|
|
141
142
|
_a.ComposedComponent = ComposedComponent,
|
|
142
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
|
+
}
|
|
143
155
|
return result;
|
|
144
156
|
}
|
|
145
157
|
|
package/lib/polyfills.js
CHANGED
package/lib/renderers/Form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { RendererProps } from '../factory';
|
|
4
4
|
import { IFormStore } from '../store/form';
|
|
5
|
-
import { SchemaNode, ActionObject, ClassName, BaseApiObject, SchemaExpression, SchemaClassName } from '../types';
|
|
5
|
+
import { SchemaNode, ActionObject, ClassName, BaseApiObject, SchemaExpression, SchemaClassName, DataChangeReason } from '../types';
|
|
6
6
|
import { IScopedContext } from '../Scoped';
|
|
7
7
|
import type { LabelAlign } from './Item';
|
|
8
8
|
export interface FormHorizontal {
|
|
@@ -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>;
|
|
@@ -354,12 +354,12 @@ export default class Form extends React.Component<FormProps, object> {
|
|
|
354
354
|
reset(): void;
|
|
355
355
|
addHook(fn: () => any, type?: 'validate' | 'init' | 'flush', enforce?: 'prev' | 'post'): () => void;
|
|
356
356
|
removeHook(fn: () => any, type?: string): void;
|
|
357
|
-
handleChange(value: any, name: string, submit: boolean, changePristine?: boolean): void;
|
|
357
|
+
handleChange(value: any, name: string, submit: boolean, changePristine?: boolean, changeReason?: DataChangeReason): void;
|
|
358
358
|
formItemDispatchEvent(type: string, data: any): Promise<import("../utils").RendererEvent<any, any>>;
|
|
359
359
|
emittedData: any;
|
|
360
360
|
emitting: boolean;
|
|
361
361
|
emitChange(submit: boolean, emitedFromWatch?: boolean): Promise<void>;
|
|
362
|
-
handleBulkChange(values: Object, submit: boolean): void;
|
|
362
|
+
handleBulkChange(values: Object, submit: boolean, changeReason?: DataChangeReason): void;
|
|
363
363
|
handleFormSubmit(e: React.UIEvent<any>): any;
|
|
364
364
|
handleReset(action: any): (data: any) => void;
|
|
365
365
|
handleAction(e: React.UIEvent<any> | void, action: ActionObject, data: object, throwErrors?: boolean, delegate?: IScopedContext): Promise<any>;
|
package/lib/renderers/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
2
|
+
* amis-core v6.9.0-beta.0
|
|
3
3
|
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -21,6 +21,7 @@ var Scoped = require('../Scoped.js');
|
|
|
21
21
|
require('amis-formula');
|
|
22
22
|
require('moment');
|
|
23
23
|
var object = require('../utils/object.js');
|
|
24
|
+
require('../utils/memoryParse.js');
|
|
24
25
|
require('@rc-component/mini-decimal');
|
|
25
26
|
var dataMapping = require('../utils/dataMapping.js');
|
|
26
27
|
require('../utils/filter.js');
|
|
@@ -110,7 +111,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
110
111
|
_this.blockRouting = _this.blockRouting.bind(_this);
|
|
111
112
|
_this.beforePageUnload = _this.beforePageUnload.bind(_this);
|
|
112
113
|
_this.formItemDispatchEvent = _this.formItemDispatchEvent.bind(_this);
|
|
113
|
-
|
|
114
|
+
_this.flush = _this.flush.bind(_this);
|
|
115
|
+
var store = props.store, canAccessSuperData = props.canAccessSuperData, persistData = props.persistData, simpleMode = props.simpleMode, formLazyChange = props.formLazyChange;
|
|
114
116
|
store.setCanAccessSuperData(canAccessSuperData !== false);
|
|
115
117
|
store.setPersistData(persistData);
|
|
116
118
|
if (simpleMode) {
|
|
@@ -130,7 +132,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
130
132
|
// https://github.com/baidu/amis/issues/8773
|
|
131
133
|
_this.toDispose.push(mobx.reaction(function () { return store.initedAt; }, function () {
|
|
132
134
|
store.inited &&
|
|
133
|
-
_this.lazyEmitChange(!!_this.props.submitOnChange, true);
|
|
135
|
+
(formLazyChange === false ? _this.emitChange : _this.lazyEmitChange)(!!_this.props.submitOnChange, true);
|
|
134
136
|
}));
|
|
135
137
|
return _this;
|
|
136
138
|
}
|
|
@@ -195,7 +197,9 @@ var Form = /** @class */ (function (_super) {
|
|
|
195
197
|
successMessage: fetchSuccess,
|
|
196
198
|
errorMessage: fetchFailed,
|
|
197
199
|
onSuccess: function (json, data) {
|
|
198
|
-
store.setValues(data
|
|
200
|
+
store.setValues(data, undefined, undefined, undefined, {
|
|
201
|
+
type: 'api'
|
|
202
|
+
});
|
|
199
203
|
if (!api.isEffectiveApi(initAsyncApi, store.data) ||
|
|
200
204
|
store.data[initFinishedField || 'finished']) {
|
|
201
205
|
return;
|
|
@@ -391,7 +395,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
391
395
|
case 3:
|
|
392
396
|
// 派发初始化接口请求完成事件
|
|
393
397
|
this.dispatchInited(result);
|
|
394
|
-
return [2 /*return
|
|
398
|
+
return [2 /*return*/, store.data];
|
|
395
399
|
}
|
|
396
400
|
});
|
|
397
401
|
});
|
|
@@ -402,7 +406,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
402
406
|
return this.reload();
|
|
403
407
|
};
|
|
404
408
|
Form.prototype.silentReload = function (target, query) {
|
|
405
|
-
this.reload(target, query, undefined, true);
|
|
409
|
+
return this.reload(target, query, undefined, true);
|
|
406
410
|
};
|
|
407
411
|
Form.prototype.initInterval = function (value) {
|
|
408
412
|
var _a = this.props, interval = _a.interval, silentPolling = _a.silentPolling, stopAutoRefreshWhen = _a.stopAutoRefreshWhen, data = _a.data;
|
|
@@ -462,7 +466,9 @@ var Form = /** @class */ (function (_super) {
|
|
|
462
466
|
Form.prototype.setValues = function (value, replace) {
|
|
463
467
|
var store = this.props.store;
|
|
464
468
|
this.flush();
|
|
465
|
-
store.setValues(value, undefined, replace
|
|
469
|
+
store.setValues(value, undefined, replace, undefined, {
|
|
470
|
+
type: 'action'
|
|
471
|
+
});
|
|
466
472
|
};
|
|
467
473
|
Form.prototype.submit = function (fn, throwErrors, skipFlush) {
|
|
468
474
|
if (throwErrors === void 0) { throwErrors = false; }
|
|
@@ -489,29 +495,54 @@ var Form = /** @class */ (function (_super) {
|
|
|
489
495
|
};
|
|
490
496
|
Form.prototype.flush = function () {
|
|
491
497
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
492
|
-
var hooks;
|
|
493
|
-
|
|
494
|
-
|
|
498
|
+
var hooks, hooks_1, hooks_1_1, hook, e_1_1;
|
|
499
|
+
var e_1, _a;
|
|
500
|
+
return tslib.__generator(this, function (_b) {
|
|
501
|
+
switch (_b.label) {
|
|
495
502
|
case 0:
|
|
496
|
-
|
|
503
|
+
_b.trys.push([0, , 11, 12]);
|
|
497
504
|
if (this.flushing) {
|
|
498
505
|
return [2 /*return*/];
|
|
499
506
|
}
|
|
500
507
|
this.flushing = true;
|
|
501
508
|
hooks = this.hooks['flush'] || [];
|
|
502
|
-
|
|
509
|
+
_b.label = 1;
|
|
503
510
|
case 1:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
511
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
512
|
+
hooks_1 = tslib.__values(hooks), hooks_1_1 = hooks_1.next();
|
|
513
|
+
_b.label = 2;
|
|
507
514
|
case 2:
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
515
|
+
if (!!hooks_1_1.done) return [3 /*break*/, 5];
|
|
516
|
+
hook = hooks_1_1.value;
|
|
517
|
+
return [4 /*yield*/, hook()];
|
|
518
|
+
case 3:
|
|
519
|
+
_b.sent();
|
|
520
|
+
_b.label = 4;
|
|
511
521
|
case 4:
|
|
522
|
+
hooks_1_1 = hooks_1.next();
|
|
523
|
+
return [3 /*break*/, 2];
|
|
524
|
+
case 5: return [3 /*break*/, 8];
|
|
525
|
+
case 6:
|
|
526
|
+
e_1_1 = _b.sent();
|
|
527
|
+
e_1 = { error: e_1_1 };
|
|
528
|
+
return [3 /*break*/, 8];
|
|
529
|
+
case 7:
|
|
530
|
+
try {
|
|
531
|
+
if (hooks_1_1 && !hooks_1_1.done && (_a = hooks_1.return)) _a.call(hooks_1);
|
|
532
|
+
}
|
|
533
|
+
finally { if (e_1) throw e_1.error; }
|
|
534
|
+
return [7 /*endfinally*/];
|
|
535
|
+
case 8:
|
|
536
|
+
if (!!this.emitting) return [3 /*break*/, 10];
|
|
537
|
+
return [4 /*yield*/, this.lazyEmitChange.flush()];
|
|
538
|
+
case 9:
|
|
539
|
+
_b.sent();
|
|
540
|
+
_b.label = 10;
|
|
541
|
+
case 10: return [3 /*break*/, 12];
|
|
542
|
+
case 11:
|
|
512
543
|
this.flushing = false;
|
|
513
544
|
return [7 /*endfinally*/];
|
|
514
|
-
case
|
|
545
|
+
case 12: return [2 /*return*/];
|
|
515
546
|
}
|
|
516
547
|
});
|
|
517
548
|
});
|
|
@@ -547,13 +578,15 @@ var Form = /** @class */ (function (_super) {
|
|
|
547
578
|
}
|
|
548
579
|
}
|
|
549
580
|
};
|
|
550
|
-
Form.prototype.handleChange = function (value, name, submit, changePristine) {
|
|
581
|
+
Form.prototype.handleChange = function (value, name, submit, changePristine, changeReason) {
|
|
551
582
|
if (changePristine === void 0) { changePristine = false; }
|
|
552
583
|
var _a = this.props, store = _a.store, formLazyChange = _a.formLazyChange, persistDataKeys = _a.persistDataKeys;
|
|
553
584
|
if (typeof name !== 'string') {
|
|
554
585
|
return;
|
|
555
586
|
}
|
|
556
|
-
store.changeValue(name, value, changePristine
|
|
587
|
+
store.changeValue(name, value, changePristine, undefined, undefined, changeReason || {
|
|
588
|
+
type: 'input'
|
|
589
|
+
});
|
|
557
590
|
if (!changePristine || typeof value !== 'undefined') {
|
|
558
591
|
(formLazyChange === false ? this.emitChange : this.lazyEmitChange)(submit);
|
|
559
592
|
}
|
|
@@ -591,7 +624,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
591
624
|
if (!(dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented)) {
|
|
592
625
|
onChange && onChange.apply(null, changeProps);
|
|
593
626
|
}
|
|
594
|
-
store.clearRestError();
|
|
627
|
+
mobxStateTree.isAlive(store) && store.clearRestError();
|
|
595
628
|
if (!(!emitedFromWatch && (submit || (submitOnChange && store.inited)))) return [3 /*break*/, 3];
|
|
596
629
|
return [4 /*yield*/, this.handleAction(undefined, {
|
|
597
630
|
type: 'submit',
|
|
@@ -611,9 +644,11 @@ var Form = /** @class */ (function (_super) {
|
|
|
611
644
|
});
|
|
612
645
|
});
|
|
613
646
|
};
|
|
614
|
-
Form.prototype.handleBulkChange = function (values, submit) {
|
|
647
|
+
Form.prototype.handleBulkChange = function (values, submit, changeReason) {
|
|
615
648
|
var _a = this.props; _a.onChange; var store = _a.store, formLazyChange = _a.formLazyChange;
|
|
616
|
-
store.setValues(values
|
|
649
|
+
store.setValues(values, undefined, undefined, undefined, changeReason || {
|
|
650
|
+
type: 'input'
|
|
651
|
+
});
|
|
617
652
|
// store.updateData(values);
|
|
618
653
|
// store.items.forEach(formItem => {
|
|
619
654
|
// const updatedValue = getVariable(values, formItem.name, false);
|
|
@@ -663,6 +698,9 @@ var Form = /** @class */ (function (_super) {
|
|
|
663
698
|
_f.sent();
|
|
664
699
|
_f.label = 2;
|
|
665
700
|
case 2:
|
|
701
|
+
if (!mobxStateTree.isAlive(store)) {
|
|
702
|
+
return [2 /*return*/];
|
|
703
|
+
}
|
|
666
704
|
if (trimValues) {
|
|
667
705
|
store.trimValues();
|
|
668
706
|
}
|
|
@@ -863,7 +901,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
863
901
|
if (values === false) {
|
|
864
902
|
return store.data;
|
|
865
903
|
}
|
|
866
|
-
if (onFinished && onFinished(values, action) === false) {
|
|
904
|
+
if (onFinished && onFinished(values, action, store) === false) {
|
|
867
905
|
return values;
|
|
868
906
|
}
|
|
869
907
|
resetAfterSubmit && store.reset(_this.handleReset(action));
|
|
@@ -1222,7 +1260,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
1222
1260
|
removeHook: this.removeHook,
|
|
1223
1261
|
renderFormItems: this.renderFormItems,
|
|
1224
1262
|
formItemDispatchEvent: this.formItemDispatchEvent,
|
|
1225
|
-
formPristine: form.pristine
|
|
1263
|
+
formPristine: form.pristine,
|
|
1264
|
+
onFlushForm: this.flush
|
|
1226
1265
|
// value: (control as any)?.name
|
|
1227
1266
|
// ? getVariable(form.data, (control as any)?.name, canAccessSuperData)
|
|
1228
1267
|
// : (control as any)?.value,
|
package/lib/renderers/Item.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
|
4
4
|
import { IFormItemStore, IFormStore } from '../store/form';
|
|
5
5
|
import { RendererProps, TestFunc, RendererConfig } from '../factory';
|
|
6
6
|
import { FormHorizontal, FormSchemaBase } from './Form';
|
|
7
|
-
import { ActionObject, BaseApiObject, BaseSchemaWithoutType, ClassName, Schema } from '../types';
|
|
7
|
+
import { ActionObject, BaseApiObject, BaseSchemaWithoutType, ClassName, DataChangeReason, Schema } from '../types';
|
|
8
|
+
import { IScopedContext } from '../Scoped';
|
|
8
9
|
export type LabelAlign = 'right' | 'left' | 'top' | 'inherit';
|
|
9
10
|
export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
10
11
|
/**
|
|
@@ -303,6 +304,10 @@ export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
|
303
304
|
* 是否为参照录入模式,参照录入会展示候选值供用户选择,而不是直接填充。
|
|
304
305
|
*/
|
|
305
306
|
showSuggestion?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* 参照录入时,默认选中的值
|
|
309
|
+
*/
|
|
310
|
+
defaultSelection?: any;
|
|
306
311
|
/**
|
|
307
312
|
* 自动填充 api
|
|
308
313
|
*/
|
|
@@ -321,7 +326,7 @@ export interface FormBaseControl extends BaseSchemaWithoutType {
|
|
|
321
326
|
/**
|
|
322
327
|
* 触发条件,默认为 change
|
|
323
328
|
*/
|
|
324
|
-
trigger?: 'change' | '
|
|
329
|
+
trigger?: 'change' | 'focus' | 'blur';
|
|
325
330
|
/**
|
|
326
331
|
* 弹窗方式,当为参照录入时用可以配置
|
|
327
332
|
*/
|
|
@@ -359,6 +364,10 @@ export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
|
|
359
364
|
storeType?: string;
|
|
360
365
|
validations?: string;
|
|
361
366
|
strictMode?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* 是否是瘦子
|
|
369
|
+
*/
|
|
370
|
+
thin?: boolean;
|
|
362
371
|
/**
|
|
363
372
|
* schema变化使视图更新的属性白名单
|
|
364
373
|
*/
|
|
@@ -394,7 +403,7 @@ export interface FormItemProps extends RendererProps {
|
|
|
394
403
|
onChange: (value: any, submitOnChange?: boolean, changeImmediately?: boolean) => void;
|
|
395
404
|
onBulkChange?: (values: {
|
|
396
405
|
[propName: string]: any;
|
|
397
|
-
}, submitOnChange?: boolean) => void;
|
|
406
|
+
}, submitOnChange?: boolean, changeReason?: DataChangeReason) => void;
|
|
398
407
|
addHook: (fn: Function, mode?: 'validate' | 'init' | 'flush', enforce?: 'prev' | 'post') => () => void;
|
|
399
408
|
removeHook: (fn: Function, mode?: 'validate' | 'init' | 'flush') => void;
|
|
400
409
|
renderFormItems: (schema: Partial<FormSchemaBase>, region: string, props: any) => JSX.Element;
|
|
@@ -444,7 +453,76 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
444
453
|
updateAutoFillData(context: any): void;
|
|
445
454
|
syncApiAutoFill: import("lodash").DebouncedFunc<(term: any, forceLoad?: boolean, skipIfExits?: any) => Promise<void>>;
|
|
446
455
|
syncOptionAutoFill(selectedOptions: Array<any>, skipIfExits?: boolean): void;
|
|
447
|
-
|
|
456
|
+
/**
|
|
457
|
+
* 应用映射函数,根据给定的映射关系,更新数据对象
|
|
458
|
+
*
|
|
459
|
+
* @param mapping 映射关系,类型为任意类型
|
|
460
|
+
* @param ctx 上下文对象,类型为任意类型
|
|
461
|
+
* @param skipIfExits 是否跳过已存在的属性,默认为 false
|
|
462
|
+
*/
|
|
463
|
+
applyMapping(mapping: any, ctx: any, skipIfExits?: boolean): void;
|
|
464
|
+
buildAutoFillSchema(): {
|
|
465
|
+
popOverContainer: any;
|
|
466
|
+
popOverClassName: any;
|
|
467
|
+
placement: any;
|
|
468
|
+
offset: any;
|
|
469
|
+
body: {
|
|
470
|
+
type: string;
|
|
471
|
+
title: string;
|
|
472
|
+
className: string;
|
|
473
|
+
body: {
|
|
474
|
+
type: string;
|
|
475
|
+
embed: boolean;
|
|
476
|
+
joinValues: boolean;
|
|
477
|
+
strictMode: boolean;
|
|
478
|
+
label: boolean;
|
|
479
|
+
labelField: any;
|
|
480
|
+
valueField: any;
|
|
481
|
+
multiple: any;
|
|
482
|
+
name: string;
|
|
483
|
+
value: any;
|
|
484
|
+
options: never[];
|
|
485
|
+
required: boolean;
|
|
486
|
+
source: any;
|
|
487
|
+
pickerSchema: {
|
|
488
|
+
type: string;
|
|
489
|
+
bodyClassName: string;
|
|
490
|
+
affixHeader: boolean;
|
|
491
|
+
alwaysShowPagination: boolean;
|
|
492
|
+
keepItemSelectionOnPageChange: boolean;
|
|
493
|
+
headerToolbar: never[];
|
|
494
|
+
footerToolbar: ({
|
|
495
|
+
type: string;
|
|
496
|
+
align: string;
|
|
497
|
+
className?: undefined;
|
|
498
|
+
} | {
|
|
499
|
+
type: string;
|
|
500
|
+
align: string;
|
|
501
|
+
className: string;
|
|
502
|
+
})[];
|
|
503
|
+
multiple: any;
|
|
504
|
+
filter: any;
|
|
505
|
+
columns: any;
|
|
506
|
+
};
|
|
507
|
+
}[];
|
|
508
|
+
actions: ({
|
|
509
|
+
type: string;
|
|
510
|
+
actionType: string;
|
|
511
|
+
label: any;
|
|
512
|
+
level?: undefined;
|
|
513
|
+
} | {
|
|
514
|
+
type: string;
|
|
515
|
+
actionType: string;
|
|
516
|
+
level: string;
|
|
517
|
+
label: any;
|
|
518
|
+
})[];
|
|
519
|
+
};
|
|
520
|
+
type?: undefined;
|
|
521
|
+
className?: undefined;
|
|
522
|
+
title?: undefined;
|
|
523
|
+
size?: undefined;
|
|
524
|
+
actions?: undefined;
|
|
525
|
+
} | {
|
|
448
526
|
type: any;
|
|
449
527
|
className: string;
|
|
450
528
|
title: any;
|
|
@@ -458,16 +536,19 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
458
536
|
type: string;
|
|
459
537
|
embed: boolean;
|
|
460
538
|
joinValues: boolean;
|
|
539
|
+
strictMode: boolean;
|
|
461
540
|
label: boolean;
|
|
462
541
|
labelField: any;
|
|
463
542
|
valueField: any;
|
|
464
543
|
multiple: any;
|
|
465
544
|
name: string;
|
|
545
|
+
value: any;
|
|
466
546
|
options: never[];
|
|
467
547
|
required: boolean;
|
|
468
548
|
source: any;
|
|
469
549
|
pickerSchema: {
|
|
470
550
|
type: string;
|
|
551
|
+
bodyClassName: string;
|
|
471
552
|
affixHeader: boolean;
|
|
472
553
|
alwaysShowPagination: boolean;
|
|
473
554
|
keepItemSelectionOnPageChange: boolean;
|
|
@@ -485,7 +566,7 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
485
566
|
filter: any;
|
|
486
567
|
columns: any;
|
|
487
568
|
};
|
|
488
|
-
};
|
|
569
|
+
}[];
|
|
489
570
|
actions: ({
|
|
490
571
|
type: string;
|
|
491
572
|
actionType: string;
|
|
@@ -509,10 +590,14 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
509
590
|
level: string;
|
|
510
591
|
label: any;
|
|
511
592
|
})[];
|
|
593
|
+
popOverContainer?: undefined;
|
|
594
|
+
popOverClassName?: undefined;
|
|
595
|
+
placement?: undefined;
|
|
596
|
+
offset?: undefined;
|
|
512
597
|
} | undefined;
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
598
|
+
handlePopOverConfirm(values: any): void;
|
|
599
|
+
handlePopOverAction(e: React.UIEvent<any>, action: ActionObject, data: object, throwErrors?: boolean, delegate?: IScopedContext): any;
|
|
600
|
+
closePopOver(): void;
|
|
516
601
|
handleOpenDialog(schema: Schema, data: any): Promise<unknown>;
|
|
517
602
|
handleDialogConfirm([values]: Array<any>): void;
|
|
518
603
|
handleDialogClose(confirmed?: boolean): void;
|
|
@@ -523,7 +608,7 @@ export declare class FormItemWrap extends React.Component<FormItemProps> {
|
|
|
523
608
|
static layoutRenderers: {
|
|
524
609
|
[propsName: string]: (props: FormItemProps, renderControl: () => JSX.Element | null) => JSX.Element;
|
|
525
610
|
};
|
|
526
|
-
render(): JSX.Element | null;
|
|
611
|
+
render(): React.JSX.Element | null;
|
|
527
612
|
}
|
|
528
613
|
export declare const detectProps: string[];
|
|
529
614
|
export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (Control: FormControlComponent) => {
|
|
@@ -559,9 +644,7 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
559
644
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
560
645
|
readonly fetcher: any;
|
|
561
646
|
readonly notify: any;
|
|
562
|
-
readonly isCancel: (value: any) => boolean;
|
|
563
|
-
* 当修改完的时候是否提交表单。
|
|
564
|
-
*/
|
|
647
|
+
readonly isCancel: (value: any) => boolean;
|
|
565
648
|
readonly __: import("..").TranslateFn<any>;
|
|
566
649
|
getStoreById(id: string): {
|
|
567
650
|
id: string;
|
|
@@ -642,7 +725,10 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
642
725
|
} & {
|
|
643
726
|
addStore(store: {
|
|
644
727
|
[propName: string]: any;
|
|
645
|
-
storeType: string;
|
|
728
|
+
storeType: string; /**
|
|
729
|
+
* 不设置时,当表单提交过后表单项每次修改都会触发重新验证,
|
|
730
|
+
* 如果设置了,则由此配置项来决定要不要每次修改都触发验证。
|
|
731
|
+
*/
|
|
646
732
|
id: string;
|
|
647
733
|
path: string;
|
|
648
734
|
parentId?: string | undefined;
|
|
@@ -719,15 +805,15 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
719
805
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
720
806
|
addChildId: (id: string) => void;
|
|
721
807
|
removeChildId: (id: string) => void;
|
|
722
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
808
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void; /**
|
|
809
|
+
* 配置 input className
|
|
810
|
+
*/
|
|
723
811
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
724
812
|
storeType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
725
813
|
}, {
|
|
726
814
|
readonly fetcher: any;
|
|
727
815
|
readonly notify: any;
|
|
728
|
-
readonly isCancel: (value: any) => boolean;
|
|
729
|
-
* 当修改完的时候是否提交表单。
|
|
730
|
-
*/
|
|
816
|
+
readonly isCancel: (value: any) => boolean;
|
|
731
817
|
readonly __: import("..").TranslateFn<any>;
|
|
732
818
|
getStoreById(id: string): {
|
|
733
819
|
id: string;
|
|
@@ -808,7 +894,10 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
808
894
|
} & {
|
|
809
895
|
addStore(store: {
|
|
810
896
|
[propName: string]: any;
|
|
811
|
-
storeType: string;
|
|
897
|
+
storeType: string; /**
|
|
898
|
+
* 不设置时,当表单提交过后表单项每次修改都会触发重新验证,
|
|
899
|
+
* 如果设置了,则由此配置项来决定要不要每次修改都触发验证。
|
|
900
|
+
*/
|
|
812
901
|
id: string;
|
|
813
902
|
path: string;
|
|
814
903
|
parentId?: string | undefined;
|
|
@@ -885,7 +974,9 @@ export declare function asFormItem(config: Omit<FormItemConfig, 'component'>): (
|
|
|
885
974
|
dispose: (callback?: (() => void) | undefined) => void;
|
|
886
975
|
addChildId: (id: string) => void;
|
|
887
976
|
removeChildId: (id: string) => void;
|
|
888
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
977
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void; /**
|
|
978
|
+
* 配置 input className
|
|
979
|
+
*/
|
|
889
980
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>>;
|
|
890
981
|
ComposedComponent: React.ComponentType<any>;
|
|
891
982
|
} & hoistNonReactStatic.NonReactStatics<any, {}> & {
|