amis-core 6.0.0 → 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 +2 -2
- package/esm/RootRenderer.js +4 -3
- package/esm/SchemaRenderer.js +5 -2
- package/esm/Scoped.d.ts +6 -0
- package/esm/Scoped.js +45 -8
- package/esm/StatusScoped.js +2 -2
- package/esm/WithRootStore.js +2 -2
- package/esm/WithStore.js +4 -6
- package/esm/actions/Action.js +2 -2
- package/esm/actions/AjaxAction.js +2 -2
- package/esm/actions/BreakAction.js +2 -2
- package/esm/actions/BroadcastAction.js +2 -2
- package/esm/actions/CmptAction.js +2 -2
- package/esm/actions/ContinueAction.js +2 -2
- package/esm/actions/CopyAction.js +2 -2
- package/esm/actions/CustomAction.js +3 -3
- package/esm/actions/DialogAction.js +2 -2
- package/esm/actions/DrawerAction.js +2 -2
- package/esm/actions/EmailAction.js +2 -2
- package/esm/actions/LinkAction.js +10 -5
- package/esm/actions/LoopAction.js +2 -2
- package/esm/actions/PageAction.js +2 -2
- package/esm/actions/ParallelAction.js +2 -2
- package/esm/actions/StatusAction.js +2 -2
- package/esm/actions/SwitchAction.js +2 -2
- package/esm/actions/ToastAction.js +2 -2
- package/esm/components/CustomStyle.d.ts +1 -2
- package/esm/components/CustomStyle.js +20 -7
- package/esm/components/ErrorBoundary.js +2 -2
- package/esm/components/LazyComponent.js +2 -2
- package/esm/components/Overlay.js +11 -9
- package/esm/components/PopOver.js +7 -5
- package/esm/env.d.ts +4 -0
- package/esm/env.js +2 -2
- package/esm/envOverwrite.js +2 -2
- package/esm/factory.js +15 -2
- package/esm/index.d.ts +2 -2
- package/esm/index.js +13 -8
- package/esm/locale.js +2 -2
- package/esm/polyfills.js +2 -2
- package/esm/renderers/Form.d.ts +4 -3
- package/esm/renderers/Form.js +94 -42
- package/esm/renderers/Item.d.ts +1 -0
- package/esm/renderers/Item.js +15 -16
- package/esm/renderers/Options.d.ts +5 -0
- package/esm/renderers/Options.js +27 -10
- package/esm/renderers/Placeholder.js +2 -2
- package/esm/renderers/builtin.js +2 -2
- package/esm/renderers/register.js +2 -2
- package/esm/renderers/wrapControl.js +37 -29
- package/esm/store/app.js +3 -3
- package/esm/store/combo.d.ts +48 -24
- package/esm/store/combo.js +2 -2
- package/esm/store/crud.js +2 -2
- package/esm/store/form.d.ts +20 -10
- package/esm/store/form.js +2 -2
- package/esm/store/formItem.d.ts +2 -1
- package/esm/store/formItem.js +4 -3
- package/esm/store/iRenderer.js +5 -3
- package/esm/store/index.js +2 -2
- package/esm/store/list.js +2 -2
- package/esm/store/manager.js +2 -2
- package/esm/store/modal.js +2 -2
- package/esm/store/node.js +2 -2
- package/esm/store/pagination.js +2 -2
- package/esm/store/root.js +3 -3
- package/esm/store/service.js +2 -2
- package/esm/store/status.js +2 -2
- package/esm/store/table.d.ts +42 -20
- package/esm/store/table.js +33 -19
- package/esm/store/table2.js +2 -2
- package/esm/theme.js +2 -2
- package/esm/utils/Animation.js +2 -2
- package/esm/utils/ColorScale.js +2 -2
- package/esm/utils/DataSchema.js +2 -2
- package/esm/utils/DataScope.js +2 -2
- package/esm/utils/RootClose.js +2 -2
- package/esm/utils/SimpleMap.js +2 -2
- package/esm/utils/api.js +2 -2
- package/esm/utils/arraySlice.js +2 -2
- package/esm/utils/attachmentAdpator.js +2 -2
- package/esm/utils/autobind.js +2 -2
- package/esm/utils/browser.js +2 -2
- package/esm/utils/columnsSplit.js +2 -2
- package/esm/utils/concatData.js +2 -2
- package/esm/utils/dataMapping.js +2 -2
- package/esm/utils/date.js +2 -2
- package/esm/utils/debug.js +2 -2
- package/esm/utils/decodeEntity.js +2 -2
- package/esm/utils/dom.js +2 -2
- package/esm/utils/errors.js +2 -2
- package/esm/utils/escapeHtml.js +2 -2
- package/esm/utils/filter-schema.js +2 -2
- package/esm/utils/filter.js +2 -2
- package/esm/utils/formatDuration.js +2 -2
- package/esm/utils/formula.js +2 -2
- package/esm/utils/getVariable.js +2 -2
- package/esm/utils/grammar.js +2 -2
- package/esm/utils/handleAction.js +2 -2
- package/esm/utils/helper.d.ts +8 -1
- package/esm/utils/helper.js +28 -10
- package/esm/utils/highlight.js +4 -3
- package/esm/utils/icon.js +2 -2
- package/esm/utils/image.js +2 -2
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/isPureVariable.js +2 -2
- package/esm/utils/json-schema-2-amis-schema.js +2 -2
- package/esm/utils/keyToPath.js +2 -2
- package/esm/utils/labelToString.d.ts +1 -0
- package/esm/utils/labelToString.js +38 -0
- package/esm/utils/makeSorter.js +2 -2
- package/esm/utils/math.js +2 -2
- package/esm/utils/memoryParse.js +2 -2
- package/esm/utils/normalizeLink.js +2 -2
- package/esm/utils/normalizeOptions.js +2 -2
- package/esm/utils/object.js +2 -2
- package/esm/utils/offset.js +2 -2
- package/esm/utils/offsetParent.js +2 -2
- package/esm/utils/optionValueCompare.js +2 -2
- package/esm/utils/position.js +2 -2
- package/esm/utils/prettyBytes.js +2 -2
- package/esm/utils/renderer-event.js +2 -2
- package/esm/utils/replaceText.js +10 -12
- package/esm/utils/resize-sensor.js +2 -2
- package/esm/utils/resolveCondition.js +2 -2
- package/esm/utils/resolveVariable.js +2 -2
- package/esm/utils/resolveVariableAndFilter.js +2 -2
- package/esm/utils/resolveVariableAndFilterForAsync.js +2 -2
- package/esm/utils/scrollPosition.js +2 -2
- package/esm/utils/string2regExp.d.ts +1 -1
- package/esm/utils/string2regExp.js +5 -4
- package/esm/utils/stripNumber.js +2 -2
- package/esm/utils/style-helper.d.ts +24 -5
- package/esm/utils/style-helper.js +47 -17
- package/esm/utils/style.js +2 -2
- package/esm/utils/toNumber.js +2 -2
- package/esm/utils/tokenize.d.ts +1 -0
- package/esm/utils/tokenize.js +11 -4
- package/esm/utils/tpl-builtin.js +2 -2
- package/esm/utils/tpl-lodash.js +2 -2
- package/esm/utils/tpl.js +7 -9
- package/esm/utils/uncontrollable.js +2 -2
- package/esm/utils/validateId.d.ts +16 -0
- package/esm/utils/validateId.js +154 -0
- package/esm/utils/validations.js +17 -9
- package/lib/Root.js +2 -2
- package/lib/RootRenderer.d.ts +1 -1
- package/lib/RootRenderer.js +4 -3
- package/lib/SchemaRenderer.js +5 -2
- package/lib/Scoped.d.ts +6 -0
- package/lib/Scoped.js +45 -7
- package/lib/StatusScoped.js +2 -2
- package/lib/WithRootStore.js +2 -2
- package/lib/WithStore.js +4 -6
- package/lib/actions/Action.js +2 -2
- package/lib/actions/AjaxAction.js +2 -2
- package/lib/actions/BreakAction.js +2 -2
- package/lib/actions/BroadcastAction.js +2 -2
- package/lib/actions/CmptAction.js +2 -2
- package/lib/actions/ContinueAction.js +2 -2
- package/lib/actions/CopyAction.js +2 -2
- package/lib/actions/CustomAction.js +3 -3
- package/lib/actions/DialogAction.js +2 -2
- package/lib/actions/DrawerAction.js +2 -2
- package/lib/actions/EmailAction.js +2 -2
- package/lib/actions/LinkAction.js +10 -5
- package/lib/actions/LoopAction.js +2 -2
- package/lib/actions/PageAction.js +2 -2
- package/lib/actions/ParallelAction.js +2 -2
- package/lib/actions/StatusAction.js +2 -2
- package/lib/actions/SwitchAction.js +2 -2
- package/lib/actions/ToastAction.js +2 -2
- package/lib/components/CustomStyle.d.ts +1 -2
- package/lib/components/CustomStyle.js +20 -7
- package/lib/components/ErrorBoundary.js +2 -2
- package/lib/components/LazyComponent.js +2 -2
- package/lib/components/Overlay.js +10 -8
- package/lib/components/PopOver.js +7 -5
- package/lib/env.d.ts +4 -0
- package/lib/env.js +2 -2
- package/lib/envOverwrite.js +2 -2
- package/lib/factory.js +15 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.js +16 -5
- package/lib/locale.js +2 -2
- package/lib/polyfills.js +2 -2
- package/lib/renderers/Form.d.ts +4 -3
- package/lib/renderers/Form.js +94 -42
- package/lib/renderers/Item.d.ts +1 -0
- package/lib/renderers/Item.js +15 -16
- package/lib/renderers/Options.d.ts +5 -0
- package/lib/renderers/Options.js +27 -10
- package/lib/renderers/Placeholder.js +2 -2
- package/lib/renderers/builtin.js +2 -2
- package/lib/renderers/register.js +2 -2
- package/lib/renderers/wrapControl.js +36 -28
- package/lib/store/app.js +3 -3
- package/lib/store/combo.d.ts +72 -49
- package/lib/store/combo.js +2 -2
- package/lib/store/crud.js +2 -2
- package/lib/store/form.d.ts +30 -21
- package/lib/store/form.js +2 -2
- package/lib/store/formItem.d.ts +2 -1
- package/lib/store/formItem.js +4 -3
- package/lib/store/iRenderer.js +5 -3
- package/lib/store/index.js +2 -2
- package/lib/store/list.js +2 -2
- package/lib/store/manager.js +2 -2
- package/lib/store/modal.js +2 -2
- package/lib/store/node.js +2 -2
- package/lib/store/pagination.js +2 -2
- package/lib/store/root.js +3 -3
- package/lib/store/service.js +2 -2
- package/lib/store/status.js +2 -2
- package/lib/store/table.d.ts +62 -41
- package/lib/store/table.js +33 -19
- package/lib/store/table2.js +2 -2
- package/lib/theme.js +2 -2
- package/lib/utils/Animation.js +2 -2
- package/lib/utils/ColorScale.js +2 -2
- package/lib/utils/DataSchema.js +2 -2
- package/lib/utils/DataScope.js +2 -2
- package/lib/utils/RootClose.js +2 -2
- package/lib/utils/SimpleMap.js +2 -2
- package/lib/utils/api.js +2 -2
- package/lib/utils/arraySlice.js +2 -2
- package/lib/utils/attachmentAdpator.js +2 -2
- package/lib/utils/autobind.js +2 -2
- package/lib/utils/browser.js +2 -2
- package/lib/utils/columnsSplit.js +2 -2
- package/lib/utils/concatData.js +2 -2
- package/lib/utils/dataMapping.js +2 -2
- package/lib/utils/date.js +2 -2
- package/lib/utils/debug.js +2 -2
- package/lib/utils/decodeEntity.js +2 -2
- package/lib/utils/dom.js +2 -2
- package/lib/utils/errors.js +2 -2
- package/lib/utils/escapeHtml.js +2 -2
- package/lib/utils/filter-schema.js +2 -2
- package/lib/utils/filter.js +2 -2
- package/lib/utils/formatDuration.js +2 -2
- package/lib/utils/formula.js +2 -2
- package/lib/utils/getVariable.js +2 -2
- package/lib/utils/grammar.js +2 -2
- package/lib/utils/handleAction.js +2 -2
- package/lib/utils/helper.d.ts +8 -1
- package/lib/utils/helper.js +29 -8
- package/lib/utils/highlight.js +4 -3
- package/lib/utils/icon.js +2 -2
- package/lib/utils/image.js +2 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/isPureVariable.js +2 -2
- package/lib/utils/json-schema-2-amis-schema.js +2 -2
- package/lib/utils/keyToPath.js +2 -2
- package/lib/utils/labelToString.d.ts +1 -0
- package/lib/utils/labelToString.js +46 -0
- package/lib/utils/makeSorter.js +2 -2
- package/lib/utils/math.js +2 -2
- package/lib/utils/memoryParse.js +2 -2
- package/lib/utils/normalizeLink.js +2 -2
- package/lib/utils/normalizeOptions.js +2 -2
- package/lib/utils/object.js +2 -2
- package/lib/utils/offset.js +2 -2
- package/lib/utils/offsetParent.js +2 -2
- package/lib/utils/optionValueCompare.js +2 -2
- package/lib/utils/position.js +2 -2
- package/lib/utils/prettyBytes.js +2 -2
- package/lib/utils/renderer-event.js +2 -2
- package/lib/utils/replaceText.js +9 -15
- package/lib/utils/resize-sensor.js +2 -2
- package/lib/utils/resolveCondition.js +2 -2
- package/lib/utils/resolveVariable.js +2 -2
- package/lib/utils/resolveVariableAndFilter.js +2 -2
- package/lib/utils/resolveVariableAndFilterForAsync.js +2 -2
- package/lib/utils/scrollPosition.js +2 -2
- package/lib/utils/string2regExp.d.ts +1 -1
- package/lib/utils/string2regExp.js +5 -4
- package/lib/utils/stripNumber.js +2 -2
- package/lib/utils/style-helper.d.ts +24 -5
- package/lib/utils/style-helper.js +47 -17
- package/lib/utils/style.js +2 -2
- package/lib/utils/toNumber.js +2 -2
- package/lib/utils/tokenize.d.ts +1 -0
- package/lib/utils/tokenize.js +11 -3
- package/lib/utils/tpl-builtin.js +2 -2
- package/lib/utils/tpl-lodash.js +2 -2
- package/lib/utils/tpl.js +6 -8
- package/lib/utils/uncontrollable.js +2 -2
- package/lib/utils/validateId.d.ts +16 -0
- package/lib/utils/validateId.js +160 -0
- package/lib/utils/validations.js +17 -9
- package/package.json +3 -3
- package/LICENSE +0 -201
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
3
|
-
* Copyright 2018-
|
|
2
|
+
* amis-core v6.1.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __extends, __rest, __assign, __decorate, __metadata } from 'tslib';
|
|
@@ -28,12 +28,12 @@ import '../utils/image.js';
|
|
|
28
28
|
import 'lodash/isEqual';
|
|
29
29
|
import '../actions/Action.js';
|
|
30
30
|
import 'lodash/debounce';
|
|
31
|
-
import 'lodash/cloneDeep';
|
|
32
31
|
import '../utils/resize-sensor.js';
|
|
33
32
|
import 'react-overlays/useRootClose';
|
|
34
33
|
import '../utils/SimpleMap.js';
|
|
35
34
|
import 'lodash/mapValues';
|
|
36
35
|
import 'lodash/camelCase';
|
|
36
|
+
import 'lodash/cloneDeep';
|
|
37
37
|
import 'lodash/map';
|
|
38
38
|
import 'lodash/isEmpty';
|
|
39
39
|
import 'lodash/kebabCase';
|
|
@@ -103,7 +103,9 @@ var PopOver = /** @class */ (function (_super) {
|
|
|
103
103
|
closeOnOutside &&
|
|
104
104
|
target &&
|
|
105
105
|
this.wrapperRef.current &&
|
|
106
|
-
!this.wrapperRef.current
|
|
106
|
+
!this.wrapperRef.current
|
|
107
|
+
.getAttributeNames()
|
|
108
|
+
.find(function (n) { return n.startsWith(SubPopoverDisplayedID); }) &&
|
|
107
109
|
((!this.wrapperRef.current.contains(target) &&
|
|
108
110
|
!target.closest('[role=dialog]')) ||
|
|
109
111
|
(target.matches(".".concat(ns, "Modal")) && target === this.wrapperRef.current))); // 干脆过滤掉来自弹框里面的点击
|
|
@@ -149,7 +151,7 @@ var PopOver = /** @class */ (function (_super) {
|
|
|
149
151
|
});
|
|
150
152
|
};
|
|
151
153
|
PopOver.prototype.render = function () {
|
|
152
|
-
var _a = this.props; _a.placement; var activePlacement = _a.activePlacement, positionTop = _a.positionTop, positionLeft = _a.positionLeft; _a.arrowOffsetLeft; _a.arrowOffsetTop; var style = _a.style, children = _a.children; _a.offset; var overlay = _a.overlay, onHide = _a.onHide, ns = _a.classPrefix, cx = _a.classnames, className = _a.className
|
|
154
|
+
var _a = this.props; _a.placement; var activePlacement = _a.activePlacement, positionTop = _a.positionTop, positionLeft = _a.positionLeft; _a.arrowOffsetLeft; _a.arrowOffsetTop; var style = _a.style, children = _a.children; _a.offset; var overlay = _a.overlay, onHide = _a.onHide, ns = _a.classPrefix, cx = _a.classnames, className = _a.className; _a.componentId; var rest = __rest(_a, ["placement", "activePlacement", "positionTop", "positionLeft", "arrowOffsetLeft", "arrowOffsetTop", "style", "children", "offset", "overlay", "onHide", "classPrefix", "classnames", "className", "componentId"]);
|
|
153
155
|
var _b = this.state, xOffset = _b.xOffset, yOffset = _b.yOffset;
|
|
154
156
|
var outerStyle = __assign(__assign({ display: 'block' }, style), { top: positionTop + yOffset, left: positionLeft + xOffset });
|
|
155
157
|
var placements = typeof activePlacement === 'string' ? activePlacement.split('-') : [];
|
package/esm/env.d.ts
CHANGED
package/esm/env.js
CHANGED
package/esm/envOverwrite.js
CHANGED
package/esm/factory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
3
|
-
* Copyright 2018-
|
|
2
|
+
* amis-core v6.1.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __assign } from 'tslib';
|
|
@@ -151,6 +151,19 @@ var defaultOptions = {
|
|
|
151
151
|
action.blank === false ? (window.location.href = to) : window.open(to);
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
+
// link动作新增了targetType属性,默认是内容区打开(page),在新窗口打开(blank);在当前页签打开(self)
|
|
155
|
+
if ((action === null || action === void 0 ? void 0 : action.actionType) === 'link' &&
|
|
156
|
+
['blank', 'self'].includes(action === null || action === void 0 ? void 0 : action.targetType)) {
|
|
157
|
+
if (action.targetType === 'self') {
|
|
158
|
+
// 当前页签打开,需要刷新页面
|
|
159
|
+
window.history.pushState(null, '', to);
|
|
160
|
+
location.reload();
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
window.open(to);
|
|
164
|
+
}
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
154
167
|
if (/^https?:\/\//.test(to)) {
|
|
155
168
|
window.location.replace(to);
|
|
156
169
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { 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';
|
|
22
|
-
import Scoped, { ScopedContext, filterTarget } from './Scoped';
|
|
22
|
+
import Scoped, { ScopedContext, filterTarget, splitTarget } from './Scoped';
|
|
23
23
|
import type { ScopedComponentType, IScopedContext } from './Scoped';
|
|
24
24
|
import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, themeable, makeClassnames } from './theme';
|
|
25
25
|
import type { ClassNamesFn, ThemeProps } from './theme';
|
|
@@ -50,5 +50,5 @@ import type { IItem } from './store/list';
|
|
|
50
50
|
import CustomStyle from './components/CustomStyle';
|
|
51
51
|
import { StatusScoped } from './StatusScoped';
|
|
52
52
|
export declare const version = "__buildVersion";
|
|
53
|
-
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, CustomStyle, enableDebug, disableDebug };
|
|
53
|
+
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 };
|
|
54
54
|
export declare function render(schema: Schema, props?: RootRenderProps, options?: RenderOptions, pathPrefix?: string): JSX.Element;
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
3
|
-
* Copyright 2018-
|
|
2
|
+
* amis-core v6.1.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __assign, __rest } from 'tslib';
|
|
@@ -36,13 +36,14 @@ export { handleAction } from './utils/handleAction.js';
|
|
|
36
36
|
import { promisify } from './utils/helper.js';
|
|
37
37
|
import * as helper from './utils/helper.js';
|
|
38
38
|
export { helper as utils };
|
|
39
|
-
export { JSONTraverse, JSONValueMap, SkipOperation, ValidateError, __uri, anyChanged, autobind, buildTrackExpression, bulkBindFunctions, camel, chainEvents, chainFunctions, changedEffect, convertArrayValueToMoment, countTree, detectPropValueChanged, difference, differenceFromAll, eachTree, evalTrackExpression, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeAll, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, importLazyComponent, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, loadStyle, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parsePrimitiveQueryString, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, replaceUrlParams, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter } from './utils/helper.js';
|
|
39
|
+
export { JSONTraverse, JSONValueMap, SkipOperation, TEST_ID_KEY, ValidateError, __uri, anyChanged, autobind, buildTestId, buildTrackExpression, bulkBindFunctions, camel, chainEvents, chainFunctions, changedEffect, convertArrayValueToMoment, countTree, detectPropValueChanged, difference, differenceFromAll, eachTree, evalTrackExpression, everyTree, filterTree, findIndex, findObjectsWithKey, findTree, findTreeAll, findTreeIndex, flattenTree, flattenTreeWithLeafNodes, getLevelFromClassName, getPropValue, getRange, getScrollParent, getScrollbarWidth, getTestId, getTree, getTreeAncestors, getTreeDepth, getTreeParent, getWidthRate, guid, hasAbility, hasFile, hasOwnPropertyInPath, hasVisibleExpression, hashCode, immutableExtends, importLazyComponent, injectPropsToObject, isArrayChildrenModified, isBreakpoint, isClickOnInput, isDisabled, isEmpty, isMobile, isNumeric, isObjectShallowModified, isSuperDataModified, isUnfolded, isVisible, lcFirst, loadScript, loadStyle, makeColumnClassBuild, makeHorizontalDeeper, mapObject, mapTree, noop, normalizeNodePath, object2formData, omitControls, padArr, parsePrimitiveQueryString, parseQuery, pickEventsProps, preventDefault, promisify, qsparse, qsstringify, range, removeHTMLTag, repeatCount, replaceUrlParams, rmUndefined, someTree, sortArray, spliceTree, syncDataFromSuper, ucFirst, until, uuid, uuidv4, visibilityFilter } from './utils/helper.js';
|
|
40
40
|
export { highlight } from './utils/highlight.js';
|
|
41
41
|
export { generateIcon } from './utils/icon.js';
|
|
42
42
|
export { getImageDimensions, toDataURL } from './utils/image.js';
|
|
43
43
|
export { isPureVariable } from './utils/isPureVariable.js';
|
|
44
44
|
export { JSONSchme2AMisSchema } from './utils/json-schema-2-amis-schema.js';
|
|
45
45
|
export { keyToPath } from './utils/keyToPath.js';
|
|
46
|
+
export { labelToString } from './utils/labelToString.js';
|
|
46
47
|
export { makeSorter } from './utils/makeSorter.js';
|
|
47
48
|
export { normalizeLink } from './utils/normalizeLink.js';
|
|
48
49
|
export { normalizeOptions } from './utils/normalizeOptions.js';
|
|
@@ -64,7 +65,7 @@ export { scrollPosition } from './utils/scrollPosition.js';
|
|
|
64
65
|
export { SimpleMap } from './utils/SimpleMap.js';
|
|
65
66
|
export { string2regExp } from './utils/string2regExp.js';
|
|
66
67
|
export { buildStyle } from './utils/style.js';
|
|
67
|
-
export { tokenize } from './utils/tokenize.js';
|
|
68
|
+
export { memoParse, tokenize } from './utils/tokenize.js';
|
|
68
69
|
export { register } from './utils/tpl-builtin.js';
|
|
69
70
|
export { asyncFilter, evalExpression, evalExpressionWithConditionBuilder, evalJS, filter, registerTplEnginer, setCustomEvalExpression, setCustomEvalJs } from './utils/tpl.js';
|
|
70
71
|
export { uncontrollable } from './utils/uncontrollable.js';
|
|
@@ -81,7 +82,7 @@ export { RegisterStore, RendererStore } from './store/index.js';
|
|
|
81
82
|
import { getEnv } from 'mobx-state-tree';
|
|
82
83
|
import { getDefaultLocale, makeTranslator } from './locale.js';
|
|
83
84
|
export { extendLocale, getDefaultLocale, localeable, makeTranslator, register as registerLocale, removeLocaleData, setDefaultLocale } from './locale.js';
|
|
84
|
-
export { HocScoped as Scoped, ScopedContext, filterTarget } from './Scoped.js';
|
|
85
|
+
export { HocScoped as Scoped, ScopedContext, filterTarget, splitTarget } from './Scoped.js';
|
|
85
86
|
import { getClassPrefix, getTheme } from './theme.js';
|
|
86
87
|
export { classnames, getClassPrefix, getTheme, makeClassnames, setDefaultTheme, theme, themeable } from './theme.js';
|
|
87
88
|
import './actions/LoopAction.js';
|
|
@@ -143,7 +144,7 @@ export { StoreNode } from './store/node.js';
|
|
|
143
144
|
*/
|
|
144
145
|
var classPrefix = getClassPrefix();
|
|
145
146
|
// @ts-ignore
|
|
146
|
-
var version = '6.
|
|
147
|
+
var version = '6.1.0';
|
|
147
148
|
function render(schema, props, options, pathPrefix) {
|
|
148
149
|
if (props === void 0) { props = {}; }
|
|
149
150
|
if (options === void 0) { options = {}; }
|
|
@@ -202,8 +203,12 @@ function AMISRenderer(_a) {
|
|
|
202
203
|
props.mobileUI = env.isMobile();
|
|
203
204
|
}
|
|
204
205
|
// 根据环境覆盖 schema,这个要在最前面做,不然就无法覆盖 validations
|
|
205
|
-
schema =
|
|
206
|
-
|
|
206
|
+
schema = React.useMemo(function () {
|
|
207
|
+
schema = envOverwrite(schema, locale);
|
|
208
|
+
// todo 和 envOverwrite 一起处理,减少循环次数
|
|
209
|
+
schema = replaceText(schema, options.replaceText, env.replaceTextIgnoreKeys);
|
|
210
|
+
return schema;
|
|
211
|
+
}, [schema, locale]);
|
|
207
212
|
return (React.createElement(EnvContext.Provider, { value: env },
|
|
208
213
|
React.createElement(ScopedRootRenderer, __assign({}, props, { schema: schema, pathPrefix: pathPrefix, rootStore: store, env: env, theme: theme, locale: locale, translate: translate }))));
|
|
209
214
|
}
|
package/esm/locale.js
CHANGED
package/esm/polyfills.js
CHANGED
package/esm/renderers/Form.d.ts
CHANGED
|
@@ -341,15 +341,16 @@ export default class Form extends React.Component<FormProps, object> {
|
|
|
341
341
|
silentReload(target?: string, query?: any): void;
|
|
342
342
|
initInterval(value: any): any;
|
|
343
343
|
isValidated(): boolean;
|
|
344
|
-
validate(forceValidate?: boolean, throwErrors?: boolean, toastErrors?: boolean): Promise<boolean>;
|
|
344
|
+
validate(forceValidate?: boolean, throwErrors?: boolean, toastErrors?: boolean, skipFlush?: boolean): Promise<boolean>;
|
|
345
345
|
setErrors(errors: {
|
|
346
346
|
[propName: string]: string;
|
|
347
347
|
}, tag?: string): void;
|
|
348
348
|
clearErrors(): void;
|
|
349
349
|
getValues(): any;
|
|
350
350
|
setValues(value: any, replace?: boolean): void;
|
|
351
|
-
submit(fn?: (values: object) => Promise<any>, throwErrors?: boolean): Promise<any>;
|
|
352
|
-
|
|
351
|
+
submit(fn?: (values: object) => Promise<any>, throwErrors?: boolean, skipFlush?: boolean): Promise<any>;
|
|
352
|
+
flushing: boolean;
|
|
353
|
+
flush(): Promise<void>;
|
|
353
354
|
reset(): void;
|
|
354
355
|
addHook(fn: () => any, type?: 'validate' | 'init' | 'flush'): () => void;
|
|
355
356
|
removeHook(fn: () => any, type?: string): void;
|
package/esm/renderers/Form.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v6.
|
|
3
|
-
* Copyright 2018-
|
|
2
|
+
* amis-core v6.1.0
|
|
3
|
+
* Copyright 2018-2024 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { __extends, __awaiter, __generator, __assign, __decorate, __metadata } from 'tslib';
|
|
@@ -37,12 +37,12 @@ import '../utils/image.js';
|
|
|
37
37
|
import 'lodash/isPlainObject';
|
|
38
38
|
import 'lodash/isEqual';
|
|
39
39
|
import '../actions/Action.js';
|
|
40
|
-
import 'lodash/cloneDeep';
|
|
41
40
|
import '../utils/resize-sensor.js';
|
|
42
41
|
import 'react-overlays/useRootClose';
|
|
43
42
|
import '../utils/SimpleMap.js';
|
|
44
43
|
import 'lodash/mapValues';
|
|
45
44
|
import 'lodash/camelCase';
|
|
45
|
+
import 'lodash/cloneDeep';
|
|
46
46
|
import 'lodash/map';
|
|
47
47
|
import 'lodash/isEmpty';
|
|
48
48
|
import 'lodash/kebabCase';
|
|
@@ -64,6 +64,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
64
64
|
trailing: true,
|
|
65
65
|
leading: false
|
|
66
66
|
});
|
|
67
|
+
// 如果开启了 lazyChange,需要一个 flush 方法把队列中值应用上。
|
|
68
|
+
_this.flushing = false;
|
|
67
69
|
_this.onInit = _this.onInit.bind(_this);
|
|
68
70
|
_this.handleAction = _this.handleAction.bind(_this);
|
|
69
71
|
_this.handleQuery = _this.handleQuery.bind(_this);
|
|
@@ -376,22 +378,27 @@ var Form = /** @class */ (function (_super) {
|
|
|
376
378
|
Form.prototype.isValidated = function () {
|
|
377
379
|
return this.props.store.validated;
|
|
378
380
|
};
|
|
379
|
-
Form.prototype.validate = function (forceValidate, throwErrors, toastErrors) {
|
|
381
|
+
Form.prototype.validate = function (forceValidate, throwErrors, toastErrors, skipFlush) {
|
|
380
382
|
if (throwErrors === void 0) { throwErrors = false; }
|
|
381
383
|
if (toastErrors === void 0) { toastErrors = true; }
|
|
384
|
+
if (skipFlush === void 0) { skipFlush = false; }
|
|
382
385
|
return __awaiter(this, void 0, void 0, function () {
|
|
383
386
|
var _a, store, dispatchEvent, data, messages, __, result;
|
|
384
387
|
return __generator(this, function (_b) {
|
|
385
388
|
switch (_b.label) {
|
|
386
389
|
case 0:
|
|
387
390
|
_a = this.props, store = _a.store, dispatchEvent = _a.dispatchEvent, data = _a.data, messages = _a.messages, __ = _a.translate;
|
|
388
|
-
|
|
389
|
-
return [4 /*yield*/,
|
|
390
|
-
? ''
|
|
391
|
-
: typeof (messages === null || messages === void 0 ? void 0 : messages.validateFailed) === 'string'
|
|
392
|
-
? __(filter(messages.validateFailed, store.data))
|
|
393
|
-
: undefined)];
|
|
391
|
+
if (!!skipFlush) return [3 /*break*/, 2];
|
|
392
|
+
return [4 /*yield*/, this.flush()];
|
|
394
393
|
case 1:
|
|
394
|
+
_b.sent();
|
|
395
|
+
_b.label = 2;
|
|
396
|
+
case 2: return [4 /*yield*/, store.validate(this.hooks['validate'] || [], forceValidate, throwErrors, toastErrors === false
|
|
397
|
+
? ''
|
|
398
|
+
: typeof (messages === null || messages === void 0 ? void 0 : messages.validateFailed) === 'string'
|
|
399
|
+
? __(filter(messages.validateFailed, store.data))
|
|
400
|
+
: undefined)];
|
|
401
|
+
case 3:
|
|
395
402
|
result = _b.sent();
|
|
396
403
|
dispatchEvent(result ? 'validateSucc' : 'validateError', data);
|
|
397
404
|
return [2 /*return*/, result];
|
|
@@ -418,20 +425,55 @@ var Form = /** @class */ (function (_super) {
|
|
|
418
425
|
this.flush();
|
|
419
426
|
store.setValues(value, undefined, replace);
|
|
420
427
|
};
|
|
421
|
-
Form.prototype.submit = function (fn, throwErrors) {
|
|
428
|
+
Form.prototype.submit = function (fn, throwErrors, skipFlush) {
|
|
422
429
|
if (throwErrors === void 0) { throwErrors = false; }
|
|
423
|
-
|
|
424
|
-
this
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
430
|
+
if (skipFlush === void 0) { skipFlush = false; }
|
|
431
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
432
|
+
var _a, store, messages, __, dispatchEvent, data, validateErrCb;
|
|
433
|
+
return __generator(this, function (_b) {
|
|
434
|
+
switch (_b.label) {
|
|
435
|
+
case 0:
|
|
436
|
+
_a = this.props, store = _a.store, messages = _a.messages, __ = _a.translate, dispatchEvent = _a.dispatchEvent, data = _a.data;
|
|
437
|
+
if (!!skipFlush) return [3 /*break*/, 2];
|
|
438
|
+
return [4 /*yield*/, this.flush()];
|
|
439
|
+
case 1:
|
|
440
|
+
_b.sent();
|
|
441
|
+
_b.label = 2;
|
|
442
|
+
case 2:
|
|
443
|
+
validateErrCb = function () { return dispatchEvent('validateError', data); };
|
|
444
|
+
return [2 /*return*/, store.submit(fn, this.hooks['validate'] || [], typeof (messages === null || messages === void 0 ? void 0 : messages.validateFailed) === 'string'
|
|
445
|
+
? __(filter(messages.validateFailed, store.data))
|
|
446
|
+
: undefined, validateErrCb, throwErrors)];
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
});
|
|
429
450
|
};
|
|
430
|
-
// 如果开启了 lazyChange,需要一个 flush 方法把队列中值应用上。
|
|
431
451
|
Form.prototype.flush = function () {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
452
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
453
|
+
var hooks;
|
|
454
|
+
return __generator(this, function (_a) {
|
|
455
|
+
switch (_a.label) {
|
|
456
|
+
case 0:
|
|
457
|
+
_a.trys.push([0, , 3, 4]);
|
|
458
|
+
if (this.flushing) {
|
|
459
|
+
return [2 /*return*/];
|
|
460
|
+
}
|
|
461
|
+
this.flushing = true;
|
|
462
|
+
hooks = this.hooks['flush'] || [];
|
|
463
|
+
return [4 /*yield*/, Promise.all(hooks.map(function (fn) { return fn(); }))];
|
|
464
|
+
case 1:
|
|
465
|
+
_a.sent();
|
|
466
|
+
return [4 /*yield*/, this.lazyEmitChange.flush()];
|
|
467
|
+
case 2:
|
|
468
|
+
_a.sent();
|
|
469
|
+
return [3 /*break*/, 4];
|
|
470
|
+
case 3:
|
|
471
|
+
this.flushing = false;
|
|
472
|
+
return [7 /*endfinally*/];
|
|
473
|
+
case 4: return [2 /*return*/];
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
});
|
|
435
477
|
};
|
|
436
478
|
Form.prototype.reset = function () {
|
|
437
479
|
var _a = this.props, store = _a.store, onReset = _a.onReset;
|
|
@@ -503,11 +545,17 @@ var Form = /** @class */ (function (_super) {
|
|
|
503
545
|
onChange && onChange.apply(null, changeProps);
|
|
504
546
|
}
|
|
505
547
|
store.clearRestError();
|
|
506
|
-
(submit || (submitOnChange && store.inited))
|
|
507
|
-
|
|
508
|
-
type: 'submit'
|
|
509
|
-
|
|
510
|
-
|
|
548
|
+
if (!(submit || (submitOnChange && store.inited))) return [3 /*break*/, 3];
|
|
549
|
+
return [4 /*yield*/, this.handleAction(undefined, {
|
|
550
|
+
type: 'submit',
|
|
551
|
+
// 如果这里不跳过,会相互依赖死循环,flush 会 让 emiteChange 立即执行
|
|
552
|
+
// handleAction 里面又会调用 flush
|
|
553
|
+
skipFormFlush: true
|
|
554
|
+
}, store.data)];
|
|
555
|
+
case 2:
|
|
556
|
+
_b.sent();
|
|
557
|
+
_b.label = 3;
|
|
558
|
+
case 3: return [2 /*return*/];
|
|
511
559
|
}
|
|
512
560
|
});
|
|
513
561
|
});
|
|
@@ -558,8 +606,12 @@ var Form = /** @class */ (function (_super) {
|
|
|
558
606
|
switch (_f.label) {
|
|
559
607
|
case 0:
|
|
560
608
|
_c = this.props, store = _c.store, onSubmit = _c.onSubmit, api = _c.api, asyncApi = _c.asyncApi, finishedField = _c.finishedField, checkInterval = _c.checkInterval, _d = _c.messages, saveSuccess = _d.saveSuccess, saveFailed = _d.saveFailed, resetAfterSubmit = _c.resetAfterSubmit, clearAfterSubmit = _c.clearAfterSubmit, onAction = _c.onAction, onSaved = _c.onSaved, onReset = _c.onReset, onFinished = _c.onFinished, onFailed = _c.onFailed, redirect = _c.redirect, reload = _c.reload, target = _c.target, env = _c.env, onChange = _c.onChange, clearPersistDataAfterSubmit = _c.clearPersistDataAfterSubmit, trimValues = _c.trimValues, dispatchEvent = _c.dispatchEvent, __ = _c.translate;
|
|
561
|
-
|
|
562
|
-
this.flush();
|
|
609
|
+
if (!!action.skipFormFlush) return [3 /*break*/, 2];
|
|
610
|
+
return [4 /*yield*/, this.flush()];
|
|
611
|
+
case 1:
|
|
612
|
+
_f.sent();
|
|
613
|
+
_f.label = 2;
|
|
614
|
+
case 2:
|
|
563
615
|
if (trimValues) {
|
|
564
616
|
store.trimValues();
|
|
565
617
|
}
|
|
@@ -567,7 +619,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
567
619
|
if (data === this.props.data) {
|
|
568
620
|
data = store.data;
|
|
569
621
|
}
|
|
570
|
-
if (!(Array.isArray(action.required) && action.required.length)) return [3 /*break*/,
|
|
622
|
+
if (!(Array.isArray(action.required) && action.required.length)) return [3 /*break*/, 6];
|
|
571
623
|
/** 如果是按钮指定了required,则校验前先清空一下遗留的校验报错 */
|
|
572
624
|
store.clearErrors();
|
|
573
625
|
fields = action.required.map(function (item) { return ({
|
|
@@ -575,31 +627,31 @@ var Form = /** @class */ (function (_super) {
|
|
|
575
627
|
rules: { isRequired: true }
|
|
576
628
|
}); });
|
|
577
629
|
return [4 /*yield*/, store.validateFields(fields)];
|
|
578
|
-
case
|
|
630
|
+
case 3:
|
|
579
631
|
validationRes = _f.sent();
|
|
580
|
-
if (!!validationRes) return [3 /*break*/,
|
|
632
|
+
if (!!validationRes) return [3 /*break*/, 5];
|
|
581
633
|
return [4 /*yield*/, dispatchEvent('validateError', this.props.data)];
|
|
582
|
-
case
|
|
634
|
+
case 4:
|
|
583
635
|
dispatcher = _f.sent();
|
|
584
636
|
if (!(dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented)) {
|
|
585
637
|
env.notify('error', __('Form.validateFailed'));
|
|
586
638
|
}
|
|
587
639
|
/** 抛异常是为了在dialog中catch这个错误,避免弹窗直接关闭 */
|
|
588
640
|
return [2 /*return*/, Promise.reject(__('Form.validateFailed'))];
|
|
589
|
-
case
|
|
641
|
+
case 5:
|
|
590
642
|
/** 重置validated状态,保证submit时触发表单中的校验项 */
|
|
591
643
|
store.clearErrors();
|
|
592
|
-
_f.label =
|
|
593
|
-
case
|
|
644
|
+
_f.label = 6;
|
|
645
|
+
case 6:
|
|
594
646
|
if (!(action.type === 'submit' ||
|
|
595
647
|
action.actionType === 'submit' ||
|
|
596
648
|
action.actionType === 'confirm' ||
|
|
597
649
|
action.actionType === 'reset-and-submit' ||
|
|
598
|
-
action.actionType === 'clear-and-submit')) return [3 /*break*/,
|
|
650
|
+
action.actionType === 'clear-and-submit')) return [3 /*break*/, 8];
|
|
599
651
|
_e = this.props, dispatchEvent_1 = _e.dispatchEvent, onEvent = _e.onEvent;
|
|
600
652
|
submitEvent = (_b = (_a = onEvent === null || onEvent === void 0 ? void 0 : onEvent.submit) === null || _a === void 0 ? void 0 : _a.actions) === null || _b === void 0 ? void 0 : _b.length;
|
|
601
653
|
return [4 /*yield*/, dispatchEvent_1('submit', this.props.data)];
|
|
602
|
-
case
|
|
654
|
+
case 7:
|
|
603
655
|
dispatcher = _f.sent();
|
|
604
656
|
if ((dispatcher === null || dispatcher === void 0 ? void 0 : dispatcher.prevented) || submitEvent) {
|
|
605
657
|
return [2 /*return*/];
|
|
@@ -736,7 +788,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
736
788
|
return [2 /*return*/, Promise.resolve(null)];
|
|
737
789
|
}
|
|
738
790
|
});
|
|
739
|
-
}); }, throwErrors)
|
|
791
|
+
}); }, throwErrors, true)
|
|
740
792
|
.then(function (values) {
|
|
741
793
|
// 有可能 onSubmit return false 了,那么后面的就不应该再执行了。
|
|
742
794
|
if (values === false) {
|
|
@@ -764,7 +816,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
764
816
|
throw reason;
|
|
765
817
|
}
|
|
766
818
|
})];
|
|
767
|
-
case
|
|
819
|
+
case 8:
|
|
768
820
|
if (action.type === 'reset' || action.actionType === 'reset') {
|
|
769
821
|
store.setCurrentAction(action);
|
|
770
822
|
store.reset(onReset);
|
|
@@ -775,7 +827,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
775
827
|
}
|
|
776
828
|
else if (action.actionType === 'validate') {
|
|
777
829
|
store.setCurrentAction(action);
|
|
778
|
-
return [2 /*return*/, this.validate(true, throwErrors)];
|
|
830
|
+
return [2 /*return*/, this.validate(true, throwErrors, true, true)];
|
|
779
831
|
}
|
|
780
832
|
else if (action.actionType === 'dialog') {
|
|
781
833
|
store.setCurrentAction(action);
|
|
@@ -851,8 +903,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
851
903
|
// 不识别的丢给上层去处理。
|
|
852
904
|
return [2 /*return*/, onAction(e, action, data, throwErrors, delegate || this.context)];
|
|
853
905
|
}
|
|
854
|
-
_f.label =
|
|
855
|
-
case
|
|
906
|
+
_f.label = 9;
|
|
907
|
+
case 9: return [2 /*return*/];
|
|
856
908
|
}
|
|
857
909
|
});
|
|
858
910
|
});
|
package/esm/renderers/Item.d.ts
CHANGED