amis-core 3.0.0 → 3.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.d.ts +89 -4
- package/esm/Root.js +15 -4
- package/esm/RootRenderer.d.ts +3 -1
- package/esm/RootRenderer.js +9 -3
- package/esm/SchemaRenderer.d.ts +3 -2
- package/esm/SchemaRenderer.js +26 -20
- package/esm/Scoped.d.ts +8 -0
- package/esm/Scoped.js +20 -5
- package/esm/StatusScoped.d.ts +58 -0
- package/esm/StatusScoped.js +54 -0
- package/esm/WithRootStore.d.ts +2 -2
- package/esm/WithRootStore.js +1 -1
- package/esm/WithStore.js +6 -2
- package/esm/actions/Action.d.ts +1 -0
- package/esm/actions/Action.js +12 -4
- 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 +8 -7
- package/esm/actions/ContinueAction.js +1 -1
- package/esm/actions/CopyAction.js +1 -1
- package/esm/actions/CustomAction.js +4 -4
- package/esm/actions/DialogAction.d.ts +16 -2
- package/esm/actions/DialogAction.js +19 -7
- package/esm/actions/DrawerAction.js +1 -1
- package/esm/actions/EmailAction.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/SwitchAction.js +1 -1
- package/esm/actions/ToastAction.js +1 -1
- package/esm/components/CustomStyle.d.ts +13 -0
- package/esm/components/CustomStyle.js +18 -0
- package/esm/components/LazyComponent.d.ts +1 -1
- package/esm/components/LazyComponent.js +1 -1
- package/esm/components/Overlay.d.ts +1 -1
- package/esm/components/Overlay.js +1 -1
- package/esm/components/PopOver.d.ts +2 -2
- package/esm/components/PopOver.js +1 -1
- package/esm/env.d.ts +10 -2
- package/esm/env.js +1 -1
- package/esm/envOverwrite.js +1 -5
- package/esm/factory.d.ts +3 -2
- package/esm/factory.js +1 -1
- package/esm/index.d.ts +4 -2
- package/esm/index.js +49 -28
- package/esm/locale.d.ts +2 -2
- package/esm/locale.js +10 -3
- package/esm/renderers/Form.d.ts +2 -1
- package/esm/renderers/Form.js +216 -180
- package/esm/renderers/Item.d.ts +55 -41
- package/esm/renderers/Item.js +24 -16
- package/esm/renderers/Options.js +9 -2
- 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 -2
- package/esm/renderers/wrapControl.js +13 -16
- package/esm/store/app.d.ts +1 -0
- package/esm/store/app.js +1 -1
- package/esm/store/combo.d.ts +3 -0
- package/esm/store/combo.js +1 -1
- package/esm/store/crud.d.ts +2 -0
- package/esm/store/crud.js +12 -4
- package/esm/store/form.d.ts +1 -0
- package/esm/store/form.js +10 -4
- package/esm/store/formItem.js +1 -1
- package/esm/store/iRenderer.d.ts +1 -0
- package/esm/store/iRenderer.js +54 -13
- package/esm/store/index.js +1 -1
- package/esm/store/list.d.ts +1 -0
- package/esm/store/list.js +7 -3
- package/esm/store/manager.js +1 -1
- package/esm/store/modal.d.ts +1 -0
- package/esm/store/modal.js +1 -1
- package/esm/store/node.js +1 -1
- package/esm/store/pagination.d.ts +1 -0
- package/esm/store/pagination.js +1 -1
- package/esm/store/root.d.ts +4 -6
- package/esm/store/root.js +53 -24
- package/esm/store/service.d.ts +1 -0
- package/esm/store/service.js +1 -1
- package/esm/store/status.d.ts +12 -0
- package/esm/store/status.js +38 -0
- package/esm/store/table.d.ts +4 -0
- package/esm/store/table.js +10 -2
- package/esm/store/table2.d.ts +2 -1
- package/esm/store/table2.js +6 -6
- package/esm/theme.d.ts +1 -1
- package/esm/theme.js +1 -1
- package/esm/types.d.ts +1 -1
- package/esm/utils/Animation.js +1 -1
- package/esm/utils/ColorScale.js +1 -1
- package/esm/utils/DataSchema.js +1 -1
- package/esm/utils/DataScope.d.ts +3 -5
- package/esm/utils/DataScope.js +88 -31
- package/esm/utils/RootClose.js +1 -1
- package/esm/utils/SimpleMap.js +1 -1
- package/esm/utils/api.js +6 -4
- package/esm/utils/attachmentAdpator.js +2 -2
- package/esm/utils/autobind.js +1 -1
- package/esm/utils/columnsSplit.js +1 -1
- package/esm/utils/dataMapping.js +1 -1
- package/esm/utils/date.d.ts +7 -0
- package/esm/utils/date.js +34 -2
- package/esm/utils/debug.js +1 -1
- package/esm/utils/decodeEntity.js +1 -1
- package/esm/utils/dom.d.ts +2 -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 +3 -3
- package/esm/utils/handleAction.js +1 -1
- package/esm/utils/helper.d.ts +2 -2
- package/esm/utils/helper.js +25 -18
- package/esm/utils/highlight.js +1 -1
- package/esm/utils/icon.d.ts +1 -1
- package/esm/utils/icon.js +1 -1
- package/esm/utils/image.js +1 -1
- package/esm/utils/isPureVariable.js +3 -3
- package/esm/utils/json-schema-2-amis-schema.js +1 -1
- package/esm/utils/keyToPath.js +1 -1
- package/esm/utils/makeSorter.js +1 -1
- package/esm/utils/memoryParse.d.ts +17 -0
- package/esm/utils/memoryParse.js +26 -0
- package/esm/utils/normalizeLink.js +1 -1
- package/esm/utils/normalizeOptions.js +4 -2
- package/esm/utils/object.d.ts +2 -0
- package/esm/utils/object.js +27 -2
- package/esm/utils/offset.js +1 -1
- package/esm/utils/offsetParent.js +1 -1
- package/esm/utils/optionValueCompare.js +1 -1
- package/esm/utils/position.js +1 -1
- package/esm/utils/prettyBytes.js +1 -1
- package/esm/utils/renderer-event.js +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 +4 -3
- package/esm/utils/resolveVariableAndFilter.js +1 -1
- package/esm/utils/resolveVariableAndFilterForAsync.js +5 -4
- 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.d.ts +5 -2
- package/esm/utils/style-helper.js +18 -6
- package/esm/utils/style.js +1 -1
- package/esm/utils/toNumber.js +1 -1
- package/esm/utils/tokenize.d.ts +0 -1
- package/esm/utils/tokenize.js +3 -34
- package/esm/utils/tpl-builtin.js +5 -3
- 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/validations.js +1 -1
- package/lib/Root.d.ts +89 -4
- package/lib/Root.js +15 -4
- package/lib/RootRenderer.d.ts +3 -1
- package/lib/RootRenderer.js +8 -2
- package/lib/SchemaRenderer.d.ts +3 -2
- package/lib/SchemaRenderer.js +26 -20
- package/lib/Scoped.d.ts +8 -0
- package/lib/Scoped.js +20 -4
- package/lib/StatusScoped.d.ts +58 -0
- package/lib/StatusScoped.js +63 -0
- package/lib/WithRootStore.d.ts +2 -2
- package/lib/WithRootStore.js +1 -1
- package/lib/WithStore.js +6 -2
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +12 -4
- 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 +8 -7
- package/lib/actions/ContinueAction.js +1 -1
- package/lib/actions/CopyAction.js +1 -1
- package/lib/actions/CustomAction.js +4 -4
- package/lib/actions/DialogAction.d.ts +16 -2
- package/lib/actions/DialogAction.js +19 -7
- package/lib/actions/DrawerAction.js +1 -1
- package/lib/actions/EmailAction.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/SwitchAction.js +1 -1
- package/lib/actions/ToastAction.js +1 -1
- package/lib/components/CustomStyle.d.ts +13 -0
- package/lib/components/CustomStyle.js +22 -0
- package/lib/components/LazyComponent.d.ts +1 -1
- package/lib/components/LazyComponent.js +1 -1
- package/lib/components/Overlay.d.ts +1 -1
- package/lib/components/Overlay.js +1 -1
- package/lib/components/PopOver.d.ts +2 -2
- package/lib/components/PopOver.js +1 -1
- package/lib/env.d.ts +10 -2
- package/lib/env.js +1 -1
- package/lib/envOverwrite.js +1 -5
- package/lib/factory.d.ts +3 -2
- package/lib/factory.js +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +50 -24
- package/lib/locale.d.ts +2 -2
- package/lib/locale.js +10 -3
- package/lib/renderers/Form.d.ts +2 -1
- package/lib/renderers/Form.js +215 -179
- package/lib/renderers/Item.d.ts +55 -41
- package/lib/renderers/Item.js +24 -16
- package/lib/renderers/Options.js +9 -2
- 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 -2
- package/lib/renderers/wrapControl.js +12 -15
- package/lib/store/app.d.ts +1 -0
- package/lib/store/app.js +1 -1
- package/lib/store/combo.d.ts +3 -0
- package/lib/store/combo.js +1 -1
- package/lib/store/crud.d.ts +2 -0
- package/lib/store/crud.js +12 -4
- package/lib/store/form.d.ts +1 -0
- package/lib/store/form.js +10 -4
- package/lib/store/formItem.js +1 -1
- package/lib/store/iRenderer.d.ts +1 -0
- package/lib/store/iRenderer.js +53 -12
- package/lib/store/index.js +1 -1
- package/lib/store/list.d.ts +1 -0
- package/lib/store/list.js +7 -3
- package/lib/store/manager.js +1 -1
- package/lib/store/modal.d.ts +1 -0
- package/lib/store/modal.js +1 -1
- package/lib/store/node.js +1 -1
- package/lib/store/pagination.d.ts +1 -0
- package/lib/store/pagination.js +1 -1
- package/lib/store/root.d.ts +4 -6
- package/lib/store/root.js +52 -23
- package/lib/store/service.d.ts +1 -0
- package/lib/store/service.js +1 -1
- package/lib/store/status.d.ts +12 -0
- package/lib/store/status.js +42 -0
- package/lib/store/table.d.ts +4 -0
- package/lib/store/table.js +10 -2
- package/lib/store/table2.d.ts +2 -1
- package/lib/store/table2.js +6 -6
- package/lib/theme.d.ts +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/utils/Animation.js +1 -1
- package/lib/utils/ColorScale.js +1 -1
- package/lib/utils/DataSchema.js +1 -1
- package/lib/utils/DataScope.d.ts +3 -5
- package/lib/utils/DataScope.js +86 -29
- package/lib/utils/RootClose.js +1 -1
- package/lib/utils/SimpleMap.js +1 -1
- package/lib/utils/api.js +5 -3
- package/lib/utils/attachmentAdpator.js +2 -2
- package/lib/utils/autobind.js +1 -1
- package/lib/utils/columnsSplit.js +1 -1
- package/lib/utils/dataMapping.js +1 -1
- package/lib/utils/date.d.ts +7 -0
- package/lib/utils/date.js +34 -1
- package/lib/utils/debug.js +1 -1
- package/lib/utils/decodeEntity.js +1 -1
- package/lib/utils/dom.d.ts +2 -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 +3 -3
- package/lib/utils/handleAction.js +1 -1
- package/lib/utils/helper.d.ts +2 -2
- package/lib/utils/helper.js +25 -18
- package/lib/utils/highlight.js +1 -1
- package/lib/utils/icon.d.ts +1 -1
- package/lib/utils/icon.js +1 -1
- package/lib/utils/image.js +1 -1
- package/lib/utils/isPureVariable.js +3 -3
- package/lib/utils/json-schema-2-amis-schema.js +1 -1
- package/lib/utils/keyToPath.js +1 -1
- package/lib/utils/makeSorter.js +1 -1
- package/lib/utils/memoryParse.d.ts +17 -0
- package/lib/utils/memoryParse.js +30 -0
- package/lib/utils/normalizeLink.js +1 -1
- package/lib/utils/normalizeOptions.js +4 -2
- package/lib/utils/object.d.ts +2 -0
- package/lib/utils/object.js +28 -1
- package/lib/utils/offset.js +1 -1
- package/lib/utils/offsetParent.js +1 -1
- package/lib/utils/optionValueCompare.js +1 -1
- package/lib/utils/position.js +1 -1
- package/lib/utils/prettyBytes.js +1 -1
- package/lib/utils/renderer-event.js +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 +3 -2
- package/lib/utils/resolveVariableAndFilter.js +1 -1
- package/lib/utils/resolveVariableAndFilterForAsync.js +4 -3
- 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.d.ts +5 -2
- package/lib/utils/style-helper.js +18 -6
- package/lib/utils/style.js +1 -1
- package/lib/utils/toNumber.js +1 -1
- package/lib/utils/tokenize.d.ts +0 -1
- package/lib/utils/tokenize.js +1 -33
- package/lib/utils/tpl-builtin.js +4 -2
- 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/validations.js +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -23,12 +23,13 @@ var CmptAction = /** @class */ (function () {
|
|
|
23
23
|
CmptAction.prototype.run = function (action, renderer, event) {
|
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
25
25
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
26
|
-
var component, dataMergeMode, visibility, usability, beforeSetData, path, res;
|
|
26
|
+
var key, component, dataMergeMode, visibility, usability, beforeSetData, path, res;
|
|
27
27
|
return tslib.__generator(this, function (_p) {
|
|
28
28
|
switch (_p.label) {
|
|
29
29
|
case 0:
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
key = action.componentId || action.componentName;
|
|
31
|
+
component = key && renderer.props.$schema[action.componentId ? 'id' : 'name'] !== key
|
|
32
|
+
? (_a = event.context.scoped) === null || _a === void 0 ? void 0 : _a[action.componentId ? 'getComponentById' : 'getComponentByName'](key)
|
|
32
33
|
: renderer;
|
|
33
34
|
dataMergeMode = action.dataMergeMode || 'merge';
|
|
34
35
|
// 显隐&状态控制
|
|
@@ -36,16 +37,16 @@ var CmptAction = /** @class */ (function () {
|
|
|
36
37
|
visibility = action.actionType === 'visibility'
|
|
37
38
|
? (_b = action.args) === null || _b === void 0 ? void 0 : _b.value
|
|
38
39
|
: action.actionType === 'show';
|
|
39
|
-
return [2 /*return*/, renderer.props.
|
|
40
|
+
return [2 /*return*/, renderer.props.statusStore.setVisible(key, visibility)];
|
|
40
41
|
}
|
|
41
42
|
else if (['static', 'nonstatic'].includes(action.actionType)) {
|
|
42
|
-
return [2 /*return*/, renderer.props.
|
|
43
|
+
return [2 /*return*/, renderer.props.statusStore.setStatic(key, action.actionType === 'static')];
|
|
43
44
|
}
|
|
44
45
|
else if (['enabled', 'disabled', 'usability'].includes(action.actionType)) {
|
|
45
46
|
usability = action.actionType === 'usability'
|
|
46
47
|
? !((_c = action.args) === null || _c === void 0 ? void 0 : _c.value)
|
|
47
48
|
: action.actionType === 'disabled';
|
|
48
|
-
return [2 /*return*/, renderer.props.
|
|
49
|
+
return [2 /*return*/, renderer.props.statusStore.setDisable(key, usability)];
|
|
49
50
|
}
|
|
50
51
|
if (!(action.actionType === 'setValue')) return [3 /*break*/, 3];
|
|
51
52
|
beforeSetData = (_e = (_d = renderer === null || renderer === void 0 ? void 0 : renderer.props) === null || _d === void 0 ? void 0 : _d.env) === null || _e === void 0 ? void 0 : _e.beforeSetData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var tslib = require('tslib');
|
|
11
|
-
require('../utils/api.js');
|
|
11
|
+
var api = require('../utils/api.js');
|
|
12
12
|
require('../utils/ColorScale.js');
|
|
13
13
|
require('react');
|
|
14
14
|
require('lodash/chunk');
|
|
@@ -21,7 +21,7 @@ require('../utils/debug.js');
|
|
|
21
21
|
require('react-dom');
|
|
22
22
|
require('../utils/errors.js');
|
|
23
23
|
require('../utils/tpl.js');
|
|
24
|
-
|
|
24
|
+
require('../utils/helper.js');
|
|
25
25
|
require('classnames');
|
|
26
26
|
require('../utils/filter.js');
|
|
27
27
|
require('lodash/isObject');
|
|
@@ -62,7 +62,7 @@ var CustomAction = /** @class */ (function () {
|
|
|
62
62
|
case 0:
|
|
63
63
|
scriptFunc = (_b = (_a = action.args) === null || _a === void 0 ? void 0 : _a.script) !== null && _b !== void 0 ? _b : action.script;
|
|
64
64
|
if (typeof scriptFunc === 'string') {
|
|
65
|
-
scriptFunc =
|
|
65
|
+
scriptFunc = api.str2AsyncFunction(scriptFunc, 'context', 'doAction', 'event');
|
|
66
66
|
}
|
|
67
67
|
return [4 /*yield*/, (scriptFunc === null || scriptFunc === void 0 ? void 0 : scriptFunc.call(null, renderer, function (action) { return Action.runActions(action, renderer, event); }, event, action))];
|
|
68
68
|
case 1:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SchemaNode } from '../types';
|
|
1
|
+
import { Schema, SchemaNode } from '../types';
|
|
2
2
|
import { RendererEvent } from '../utils/renderer-event';
|
|
3
3
|
import { RendererAction, ListenerAction, ListenerContext } from './Action';
|
|
4
4
|
export interface IAlertAction extends ListenerAction {
|
|
@@ -23,6 +23,20 @@ export interface IDialogAction extends ListenerAction {
|
|
|
23
23
|
};
|
|
24
24
|
dialog?: SchemaNode;
|
|
25
25
|
}
|
|
26
|
+
export interface IConfirmDialogAction extends ListenerAction {
|
|
27
|
+
actionType: 'confirmDialog';
|
|
28
|
+
args: {
|
|
29
|
+
msg: string;
|
|
30
|
+
title: string;
|
|
31
|
+
body?: Schema;
|
|
32
|
+
closeOnEsc?: boolean;
|
|
33
|
+
size?: '' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
34
|
+
confirmText?: string;
|
|
35
|
+
cancelText?: string;
|
|
36
|
+
confirmBtnLevel?: string;
|
|
37
|
+
cancelBtnLevel?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
26
40
|
/**
|
|
27
41
|
* 打开弹窗动作
|
|
28
42
|
*
|
|
@@ -56,5 +70,5 @@ export declare class AlertAction implements RendererAction {
|
|
|
56
70
|
* confirm确认提示动作
|
|
57
71
|
*/
|
|
58
72
|
export declare class ConfirmAction implements RendererAction {
|
|
59
|
-
run(action:
|
|
73
|
+
run(action: IConfirmDialogAction, renderer: ListenerContext, event: RendererEvent<any>): Promise<any>;
|
|
60
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
9
9
|
|
|
10
10
|
var tslib = require('tslib');
|
|
11
11
|
var Action = require('./Action.js');
|
|
12
|
+
var index = require('../index.js');
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* 打开弹窗动作
|
|
@@ -91,14 +92,25 @@ var ConfirmAction = /** @class */ (function () {
|
|
|
91
92
|
function ConfirmAction() {
|
|
92
93
|
}
|
|
93
94
|
ConfirmAction.prototype.run = function (action, renderer, event) {
|
|
94
|
-
var _a, _b, _c
|
|
95
|
+
var _a, _b, _c;
|
|
95
96
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
96
|
-
var confirmed;
|
|
97
|
-
return tslib.__generator(this, function (
|
|
98
|
-
switch (
|
|
99
|
-
case 0:
|
|
97
|
+
var content, confirmed;
|
|
98
|
+
return tslib.__generator(this, function (_d) {
|
|
99
|
+
switch (_d.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
content = ((_a = action.args) === null || _a === void 0 ? void 0 : _a.body)
|
|
102
|
+
? index.render(action.args.body)
|
|
103
|
+
: action.args.msg;
|
|
104
|
+
return [4 /*yield*/, ((_c = (_b = event.context.env).confirm) === null || _c === void 0 ? void 0 : _c.call(_b, content, action.args.title, {
|
|
105
|
+
closeOnEsc: action.args.closeOnEsc,
|
|
106
|
+
size: action.args.size,
|
|
107
|
+
confirmText: action.args.confirmText,
|
|
108
|
+
cancelText: action.args.cancelText,
|
|
109
|
+
confirmBtnLevel: action.args.confirmBtnLevel,
|
|
110
|
+
cancelBtnLevel: action.args.cancelBtnLevel
|
|
111
|
+
}))];
|
|
100
112
|
case 1:
|
|
101
|
-
confirmed =
|
|
113
|
+
confirmed = _d.sent();
|
|
102
114
|
return [2 /*return*/, confirmed];
|
|
103
115
|
}
|
|
104
116
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RendererEnv } from '../env';
|
|
2
|
+
import type { CustomStyleClassName } from '../utils/style-helper';
|
|
3
|
+
interface CustomStyleProps {
|
|
4
|
+
config: {
|
|
5
|
+
themeCss: any;
|
|
6
|
+
classNames: CustomStyleClassName[];
|
|
7
|
+
id?: string;
|
|
8
|
+
defaultData?: any;
|
|
9
|
+
};
|
|
10
|
+
env: RendererEnv;
|
|
11
|
+
}
|
|
12
|
+
export default function (props: CustomStyleProps): null;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v3.1.0
|
|
3
|
+
* Copyright 2018-2023 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var styleHelper = require('../utils/style-helper.js');
|
|
12
|
+
|
|
13
|
+
function CustomStyle (props) {
|
|
14
|
+
var _a = props.config, themeCss = _a.themeCss, classNames = _a.classNames, id = _a.id, defaultData = _a.defaultData;
|
|
15
|
+
React.useEffect(function () {
|
|
16
|
+
var _a;
|
|
17
|
+
styleHelper.insertCustomStyle(themeCss, classNames, id, defaultData, (_a = props.env) === null || _a === void 0 ? void 0 : _a.customStyleClassPrefix);
|
|
18
|
+
}, [props.config.themeCss]);
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports["default"] = CustomStyle;
|
|
@@ -19,7 +19,7 @@ export interface LazyComponentState {
|
|
|
19
19
|
}
|
|
20
20
|
export default class LazyComponent extends React.Component<LazyComponentProps, LazyComponentState> {
|
|
21
21
|
static defaultProps: {
|
|
22
|
-
placeholder: JSX.Element;
|
|
22
|
+
placeholder: React.JSX.Element;
|
|
23
23
|
unMountOnHidden: boolean;
|
|
24
24
|
partialVisibility: boolean;
|
|
25
25
|
};
|
|
@@ -39,6 +39,6 @@ export default class Overlay extends React.Component<OverlayProps, OverlayState>
|
|
|
39
39
|
componentDidUpdate(prevProps: OverlayProps): void;
|
|
40
40
|
onHiddenListener(node: HTMLElement): void;
|
|
41
41
|
getContainerSelector(): Element | null;
|
|
42
|
-
render(): JSX.Element | null;
|
|
42
|
+
render(): React.JSX.Element | null;
|
|
43
43
|
}
|
|
44
44
|
export {};
|
|
@@ -50,14 +50,14 @@ export declare class PopOver extends React.PureComponent<PopOverPorps, PopOverSt
|
|
|
50
50
|
componentDidUpdate(): void;
|
|
51
51
|
componentWillUnmount(): void;
|
|
52
52
|
mayUpdateOffset(): void;
|
|
53
|
-
render(): JSX.Element;
|
|
53
|
+
render(): React.JSX.Element;
|
|
54
54
|
}
|
|
55
55
|
declare const _default: {
|
|
56
56
|
new (props: Omit<PopOverPorps, keyof import("../theme").ThemeProps> & import("../theme").ThemeOutterProps): {
|
|
57
57
|
ref: any;
|
|
58
58
|
childRef(ref: any): void;
|
|
59
59
|
getWrappedInstance(): any;
|
|
60
|
-
render(): JSX.Element;
|
|
60
|
+
render(): React.JSX.Element;
|
|
61
61
|
context: unknown;
|
|
62
62
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<PopOverPorps, keyof import("../theme").ThemeProps> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
63
63
|
forceUpdate(callback?: (() => void) | undefined): void;
|
package/lib/env.d.ts
CHANGED
|
@@ -40,6 +40,14 @@ export interface RendererEnv {
|
|
|
40
40
|
*/
|
|
41
41
|
watchRouteChange?: (fn: () => void) => () => void;
|
|
42
42
|
tracker: (eventTrack: EventTrack, props?: PlainObject) => void;
|
|
43
|
+
/**
|
|
44
|
+
* 捕获amis执行中的错误信息
|
|
45
|
+
*/
|
|
46
|
+
errorCatcher?: (error: any, errorInfo: any) => void;
|
|
47
|
+
/**
|
|
48
|
+
* 自定义样式前缀
|
|
49
|
+
*/
|
|
50
|
+
customStyleClassPrefix?: string;
|
|
43
51
|
rendererResolver?: (path: string, schema: Schema, props: any) => null | RendererConfig;
|
|
44
52
|
copy?: (contents: string, format?: any) => void;
|
|
45
53
|
getModalContainer?: () => HTMLElement;
|
|
@@ -86,7 +94,7 @@ export declare function withRendererEnv<T extends React.ComponentType<React.Comp
|
|
|
86
94
|
}) | Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "env">> & {
|
|
87
95
|
env?: RendererEnv | undefined;
|
|
88
96
|
}>): {
|
|
89
|
-
render(): JSX.Element;
|
|
97
|
+
render(): React.JSX.Element;
|
|
90
98
|
context: unknown;
|
|
91
99
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "env">> & {
|
|
92
100
|
env?: RendererEnv | undefined;
|
|
@@ -129,7 +137,7 @@ export declare function withRendererEnv<T extends React.ComponentType<React.Comp
|
|
|
129
137
|
new (props: JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "env">> & {
|
|
130
138
|
env?: RendererEnv | undefined;
|
|
131
139
|
}, context: any): {
|
|
132
|
-
render(): JSX.Element;
|
|
140
|
+
render(): React.JSX.Element;
|
|
133
141
|
context: unknown;
|
|
134
142
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, "env">> & {
|
|
135
143
|
env?: RendererEnv | undefined;
|
package/lib/env.js
CHANGED
package/lib/envOverwrite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* amis-core v3.
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -20,10 +20,6 @@ var isMobile = ((_b = (_a = window).matchMedia) === null || _b === void 0 ? void
|
|
|
20
20
|
// 这里不能用 addSchemaFilter 是因为还需要更深层的替换,比如 select 里的 options
|
|
21
21
|
var envOverwrite = function (schema, locale) {
|
|
22
22
|
var e_1, _a, e_2, _b;
|
|
23
|
-
if (schema.mobile && isMobile) {
|
|
24
|
-
Object.assign(schema, schema.mobile);
|
|
25
|
-
delete schema.mobile;
|
|
26
|
-
}
|
|
27
23
|
if (locale) {
|
|
28
24
|
var schemaNodes = helper.findObjectsWithKey(schema, locale);
|
|
29
25
|
try {
|
package/lib/factory.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ThemeProps } from './theme';
|
|
|
5
5
|
import { LocaleProps } from './locale';
|
|
6
6
|
import type { RendererEnv } from './env';
|
|
7
7
|
import { OnEventProps, RendererEvent } from './utils/renderer-event';
|
|
8
|
+
import { StatusScopedProps } from './StatusScoped';
|
|
8
9
|
export interface TestFunc {
|
|
9
10
|
(path: string, schema?: Schema, resolveRenderer?: (path: string, schema?: Schema, props?: any) => null | RendererConfig): boolean;
|
|
10
11
|
}
|
|
@@ -20,7 +21,7 @@ export interface RendererBasicConfig {
|
|
|
20
21
|
isFormItem?: boolean;
|
|
21
22
|
autoVar?: boolean;
|
|
22
23
|
}
|
|
23
|
-
export interface RendererProps extends ThemeProps, LocaleProps, OnEventProps {
|
|
24
|
+
export interface RendererProps extends ThemeProps, LocaleProps, OnEventProps, StatusScopedProps {
|
|
24
25
|
render: (region: string, node: SchemaNode, props?: PlainObject) => JSX.Element;
|
|
25
26
|
env: RendererEnv;
|
|
26
27
|
$path: string;
|
|
@@ -72,7 +73,7 @@ export declare function filterSchema(schema: Schema, render: RendererConfig, pro
|
|
|
72
73
|
export declare function Renderer(config: RendererBasicConfig): <T extends RendererComponent>(component: T) => T;
|
|
73
74
|
export declare function registerRenderer(config: RendererConfig): RendererConfig;
|
|
74
75
|
export declare function unRegisterRenderer(config: RendererConfig | string): void;
|
|
75
|
-
export declare function loadRenderer(schema: Schema, path: string): JSX.Element;
|
|
76
|
+
export declare function loadRenderer(schema: Schema, path: string): React.JSX.Element;
|
|
76
77
|
export declare const defaultOptions: RenderOptions;
|
|
77
78
|
export declare const stores: {
|
|
78
79
|
[propName: string]: IRendererStore;
|
package/lib/factory.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { RegisterStore } from './store';
|
|
|
17
17
|
import type { IColumn, IColumn2, IRow, IRow2 } from './store';
|
|
18
18
|
import { setDefaultLocale, getDefaultLocale, makeTranslator, register as registerLocale, extendLocale, removeLocaleData, localeable } from './locale';
|
|
19
19
|
import type { LocaleProps, TranslateFn } from './locale';
|
|
20
|
-
import Scoped, { ScopedContext } from './Scoped';
|
|
20
|
+
import Scoped, { ScopedContext, filterTarget } from './Scoped';
|
|
21
21
|
import type { ScopedComponentType, IScopedContext } from './Scoped';
|
|
22
22
|
import { classnames, getClassPrefix, setDefaultTheme, theme, getTheme, themeable, makeClassnames } from './theme';
|
|
23
23
|
import type { ClassNamesFn, ThemeProps } from './theme';
|
|
@@ -43,6 +43,8 @@ import type { OnEventProps } from './utils/index';
|
|
|
43
43
|
import { valueMap as styleMap } from './utils/style-helper';
|
|
44
44
|
import { RENDERER_TRANSMISSION_OMIT_PROPS } from './SchemaRenderer';
|
|
45
45
|
import type { IItem } from './store/list';
|
|
46
|
+
import CustomStyle from './components/CustomStyle';
|
|
47
|
+
import { StatusScoped } from './StatusScoped';
|
|
46
48
|
export declare const version = "__buildVersion";
|
|
47
|
-
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, 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, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig, styleMap, RENDERER_TRANSMISSION_OMIT_PROPS, ScopedComponentType, IItem, IColumn, IRow, IColumn2, IRow2, OnEventProps, FormSchemaBase };
|
|
49
|
+
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, addSchemaFilter, OptionsControlProps, FormOptionsControl, FormControlProps, FormBaseControl, extendDefaultEnv, addRootWrapper, RendererConfig, styleMap, RENDERER_TRANSMISSION_OMIT_PROPS, ScopedComponentType, IItem, IColumn, IRow, IColumn2, IRow2, OnEventProps, FormSchemaBase, filterTarget, CustomStyle };
|
|
48
50
|
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 v3.
|
|
2
|
+
* amis-core v3.1.0
|
|
3
3
|
* Copyright 2018-2023 fex
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -102,6 +102,8 @@ var Overlay = require('./components/Overlay.js');
|
|
|
102
102
|
var PopOver = require('./components/PopOver.js');
|
|
103
103
|
var Form = require('./renderers/Form.js');
|
|
104
104
|
var SchemaRenderer = require('./SchemaRenderer.js');
|
|
105
|
+
var CustomStyle = require('./components/CustomStyle.js');
|
|
106
|
+
var StatusScoped = require('./StatusScoped.js');
|
|
105
107
|
var stripNumber = require('./utils/stripNumber.js');
|
|
106
108
|
var iRenderer = require('./store/iRenderer.js');
|
|
107
109
|
var service = require('./store/service.js');
|
|
@@ -130,35 +132,52 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
130
132
|
*/
|
|
131
133
|
var classPrefix = theme.getClassPrefix();
|
|
132
134
|
// @ts-ignore
|
|
133
|
-
var version = '3.
|
|
135
|
+
var version = '3.1.0';
|
|
134
136
|
function render(schema, props, options, pathPrefix) {
|
|
135
137
|
if (props === void 0) { props = {}; }
|
|
136
138
|
if (options === void 0) { options = {}; }
|
|
137
139
|
if (pathPrefix === void 0) { pathPrefix = ''; }
|
|
140
|
+
return (React__default["default"].createElement(AMISRenderer, tslib.__assign({}, props, { schema: schema, pathPrefix: pathPrefix, options: options })));
|
|
141
|
+
}
|
|
142
|
+
function AMISRenderer(_a) {
|
|
143
|
+
var schema = _a.schema, options = _a.options, pathPrefix = _a.pathPrefix, props = tslib.__rest(_a, ["schema", "options", "pathPrefix"]);
|
|
138
144
|
var locale$1 = props.locale || locale.getDefaultLocale();
|
|
139
145
|
// 兼容 locale 的不同写法
|
|
140
|
-
locale$1 =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
locale$1 =
|
|
147
|
+
locale$1 === 'en'
|
|
148
|
+
? 'en-US'
|
|
149
|
+
: locale$1 === 'zh' || locale$1 === 'cn'
|
|
150
|
+
? 'zh-CN'
|
|
151
|
+
: locale$1.replace('_', '-');
|
|
152
|
+
var translate = React__default["default"].useCallback(function () {
|
|
153
|
+
var fn = props.translate || locale.makeTranslator(locale$1);
|
|
154
|
+
return fn.apply(null, arguments);
|
|
155
|
+
}, [locale$1, props.translate]);
|
|
156
|
+
var store = React__default["default"].useMemo(function () {
|
|
157
|
+
var store = factory.stores[options.session || 'global'];
|
|
158
|
+
if (!store) {
|
|
159
|
+
options = tslib.__assign(tslib.__assign(tslib.__assign({}, factory.defaultOptions), options), { fetcher: options.fetcher
|
|
160
|
+
? api.wrapFetcher(options.fetcher, options.tracker)
|
|
161
|
+
: factory.defaultOptions.fetcher, confirm: helper.promisify(options.confirm || factory.defaultOptions.confirm || window.confirm), locale: locale$1, translate: translate });
|
|
162
|
+
if (options.enableAMISDebug) {
|
|
163
|
+
// 因为里面还有 render
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
debug.enableDebug();
|
|
166
|
+
}, 10);
|
|
167
|
+
}
|
|
168
|
+
store = index.RendererStore.create({}, options);
|
|
169
|
+
factory.stores[options.session || 'global'] = store;
|
|
157
170
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
else {
|
|
172
|
+
// 更新 env
|
|
173
|
+
var env_1 = mobxStateTree.getEnv(store);
|
|
174
|
+
Object.assign(env_1, tslib.__assign(tslib.__assign({}, options), { fetcher: options.fetcher
|
|
175
|
+
? api.wrapFetcher(options.fetcher, options.tracker)
|
|
176
|
+
: env_1.fetcher, confirm: options.confirm ? helper.promisify(options.confirm) : env_1.confirm, locale: locale$1, translate: translate }));
|
|
177
|
+
}
|
|
178
|
+
window.amisStore = store; // 为了方便 debug.
|
|
179
|
+
return store;
|
|
180
|
+
}, Object.keys(options).concat(Object.values(options)).concat(locale$1));
|
|
162
181
|
var env$1 = mobxStateTree.getEnv(store);
|
|
163
182
|
var theme$1 = props.theme || options.theme || 'cxd';
|
|
164
183
|
if (theme$1 === 'default') {
|
|
@@ -173,6 +192,8 @@ function render(schema, props, options, pathPrefix) {
|
|
|
173
192
|
if (options.useMobileUI !== false) {
|
|
174
193
|
props.useMobileUI = true;
|
|
175
194
|
}
|
|
195
|
+
// 根据环境覆盖 schema,这个要在最前面做,不然就无法覆盖 validations
|
|
196
|
+
envOverwrite.envOverwrite(schema, locale$1);
|
|
176
197
|
schema = replaceText.replaceText(schema, options.replaceText, env$1.replaceTextIgnoreKeys);
|
|
177
198
|
return (React__default["default"].createElement(env.EnvContext.Provider, { value: env$1 },
|
|
178
199
|
React__default["default"].createElement(Root["default"], tslib.__assign({}, props, { schema: schema, pathPrefix: pathPrefix, rootStore: store, env: env$1, theme: theme$1, locale: locale$1, translate: translate }))));
|
|
@@ -218,6 +239,7 @@ exports.resolveMappingObject = dataMapping.resolveMappingObject;
|
|
|
218
239
|
exports.DataSchema = DataSchema.DataSchema;
|
|
219
240
|
exports.DataScope = DataScope.DataScope;
|
|
220
241
|
exports.filterDate = date.filterDate;
|
|
242
|
+
exports.normalizeDate = date.normalizeDate;
|
|
221
243
|
exports.parseDuration = date.parseDuration;
|
|
222
244
|
exports.relativeValueRe = date.relativeValueRe;
|
|
223
245
|
exports.DebugWrapper = debug.DebugWrapper;
|
|
@@ -338,8 +360,10 @@ exports.normalizeLink = normalizeLink.normalizeLink;
|
|
|
338
360
|
exports.normalizeOptions = normalizeOptions.normalizeOptions;
|
|
339
361
|
exports.cloneObject = object.cloneObject;
|
|
340
362
|
exports.createObject = object.createObject;
|
|
363
|
+
exports.createObjectFromChain = object.createObjectFromChain;
|
|
341
364
|
exports.deleteVariable = object.deleteVariable;
|
|
342
365
|
exports.extendObject = object.extendObject;
|
|
366
|
+
exports.extractObjectChain = object.extractObjectChain;
|
|
343
367
|
exports.isObject = object.isObject;
|
|
344
368
|
exports.pickValues = object.pickValues;
|
|
345
369
|
exports.setVariable = object.setVariable;
|
|
@@ -366,7 +390,6 @@ exports.scrollPosition = scrollPosition.scrollPosition;
|
|
|
366
390
|
exports.SimpleMap = SimpleMap.SimpleMap;
|
|
367
391
|
exports.string2regExp = string2regExp.string2regExp;
|
|
368
392
|
exports.buildStyle = style.buildStyle;
|
|
369
|
-
exports.asyncTokenize = tokenize.asyncTokenize;
|
|
370
393
|
exports.tokenize = tokenize.tokenize;
|
|
371
394
|
exports.register = tplBuiltin.register;
|
|
372
395
|
exports.asyncFilter = tpl.asyncFilter;
|
|
@@ -411,6 +434,7 @@ exports.removeLocaleData = locale.removeLocaleData;
|
|
|
411
434
|
exports.setDefaultLocale = locale.setDefaultLocale;
|
|
412
435
|
exports.Scoped = Scoped.HocScoped;
|
|
413
436
|
exports.ScopedContext = Scoped.ScopedContext;
|
|
437
|
+
exports.filterTarget = Scoped.filterTarget;
|
|
414
438
|
exports.classnames = theme.classnames;
|
|
415
439
|
exports.getClassPrefix = theme.getClassPrefix;
|
|
416
440
|
exports.getTheme = theme.getTheme;
|
|
@@ -483,6 +507,8 @@ exports.Overlay = Overlay["default"];
|
|
|
483
507
|
exports.PopOver = PopOver["default"];
|
|
484
508
|
exports.FormRenderer = Form.FormRenderer;
|
|
485
509
|
exports.RENDERER_TRANSMISSION_OMIT_PROPS = SchemaRenderer.RENDERER_TRANSMISSION_OMIT_PROPS;
|
|
510
|
+
exports.CustomStyle = CustomStyle["default"];
|
|
511
|
+
exports.StatusScoped = StatusScoped.StatusScoped;
|
|
486
512
|
exports.stripNumber = stripNumber.stripNumber;
|
|
487
513
|
exports.iRendererStore = iRenderer.iRendererStore;
|
|
488
514
|
exports.ServiceStore = service.ServiceStore;
|
package/lib/locale.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ interface LocaleConfig {
|
|
|
5
5
|
[propsName: string]: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function register(name: string, config: LocaleConfig): void;
|
|
8
|
-
export declare function extendLocale(name: string, config: LocaleConfig): void;
|
|
8
|
+
export declare function extendLocale(name: string, config: LocaleConfig, cover?: boolean): void;
|
|
9
9
|
/** 删除语料数据 */
|
|
10
10
|
export declare function removeLocaleData(name: string, key: Array<string> | string): void;
|
|
11
11
|
export declare function makeTranslator(locale?: string): TranslateFn;
|
|
@@ -24,7 +24,7 @@ export declare function localeable<T extends React.ComponentType<React.Component
|
|
|
24
24
|
ref: any;
|
|
25
25
|
childRef(ref: any): void;
|
|
26
26
|
getWrappedInstance(): any;
|
|
27
|
-
render(): JSX.Element;
|
|
27
|
+
render(): React.JSX.Element;
|
|
28
28
|
context: unknown;
|
|
29
29
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<JSX.LibraryManagedAttributes<T, Omit<React.ComponentProps<T>, keyof LocaleProps>> & {
|
|
30
30
|
locale?: string | undefined;
|