amis-core 1.0.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/dist/Root.js +94 -0
- package/dist/RootRenderer.js +288 -0
- package/dist/SchemaRenderer.js +323 -0
- package/dist/Scoped.js +252 -0
- package/dist/WithRootStore.js +44 -0
- package/dist/WithStore.js +179 -0
- package/dist/__tests__/compat.test.d.ts +1 -0
- package/dist/__tests__/factory.test.d.ts +1 -0
- package/dist/__tests__/filter.test.d.ts +1 -0
- package/dist/__tests__/helper.d.ts +13 -0
- package/dist/__tests__/tokenize.test.d.ts +1 -0
- package/dist/actions/Action.js +119 -0
- package/dist/actions/AjaxAction.js +96 -0
- package/dist/actions/BreakAction.js +35 -0
- package/dist/actions/BroadcastAction.js +49 -0
- package/dist/actions/CmptAction.js +60 -0
- package/dist/actions/ContinueAction.js +35 -0
- package/dist/actions/CopyAction.js +43 -0
- package/dist/actions/CustomAction.js +49 -0
- package/dist/actions/DialogAction.js +104 -0
- package/dist/actions/DrawerAction.js +66 -0
- package/dist/actions/EmailAction.js +48 -0
- package/dist/actions/LinkAction.js +52 -0
- package/dist/actions/LoopAction.js +107 -0
- package/dist/actions/PageAction.js +80 -0
- package/dist/actions/ParallelAction.js +40 -0
- package/dist/actions/SwitchAction.js +52 -0
- package/dist/actions/ToastAction.js +35 -0
- package/dist/components/LazyComponent.js +99 -0
- package/dist/env.js +20 -0
- package/dist/envOverwrite.js +43 -0
- package/dist/factory.js +308 -0
- package/dist/index.js +218 -0
- package/dist/index2.js +255 -0
- package/dist/locale.js +114 -0
- package/dist/renderers/Form.js +1162 -0
- package/dist/renderers/Item.js +636 -0
- package/dist/renderers/Options.js +881 -0
- package/dist/renderers/Placeholder.js +31 -0
- package/dist/renderers/builtin.js +27 -0
- package/dist/renderers/wrapControl.js +507 -0
- package/dist/src/Root.d.ts +37 -0
- package/dist/src/RootRenderer.d.ts +27 -0
- package/dist/src/SchemaRenderer.d.ts +37 -0
- package/dist/src/Scoped.d.ts +38 -0
- package/dist/src/WithRootStore.d.ts +737 -0
- package/dist/src/WithStore.d.ts +5 -0
- package/dist/src/actions/Action.d.ts +38 -0
- package/dist/src/actions/AjaxAction.d.ts +25 -0
- package/dist/src/actions/BreakAction.d.ts +15 -0
- package/dist/src/actions/BroadcastAction.d.ts +16 -0
- package/dist/src/actions/CmptAction.d.ts +20 -0
- package/dist/src/actions/ContinueAction.d.ts +15 -0
- package/dist/src/actions/CopyAction.d.ts +20 -0
- package/dist/src/actions/CustomAction.d.ts +17 -0
- package/dist/src/actions/Decorators.d.ts +25 -0
- package/dist/src/actions/DialogAction.d.ts +57 -0
- package/dist/src/actions/DrawerAction.d.ts +30 -0
- package/dist/src/actions/EmailAction.d.ts +23 -0
- package/dist/src/actions/LinkAction.d.ts +24 -0
- package/dist/src/actions/LoopAction.d.ts +19 -0
- package/dist/src/actions/PageAction.d.ts +39 -0
- package/dist/src/actions/ParallelAction.d.ts +8 -0
- package/dist/src/actions/SwitchAction.d.ts +11 -0
- package/dist/src/actions/ToastAction.d.ts +19 -0
- package/dist/src/actions/index.d.ts +21 -0
- package/dist/src/components/LazyComponent.d.ts +32 -0
- package/dist/src/env.d.ts +172 -0
- package/dist/src/envOverwrite.d.ts +4 -0
- package/dist/src/factory.d.ts +78 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/locale.d.ts +82 -0
- package/dist/src/renderers/Form.d.ts +352 -0
- package/dist/src/renderers/Item.d.ts +795 -0
- package/dist/src/renderers/Options.d.ts +150 -0
- package/dist/src/renderers/Placeholder.d.ts +6 -0
- package/dist/src/renderers/builtin.d.ts +1 -0
- package/dist/src/renderers/wrapControl.d.ts +446 -0
- package/dist/src/schema.d.ts +369 -0
- package/dist/src/store/app.d.ts +89 -0
- package/dist/src/store/combo.d.ts +8504 -0
- package/dist/src/store/crud.d.ts +124 -0
- package/dist/src/store/form.d.ts +3394 -0
- package/dist/src/store/formItem.d.ts +130 -0
- package/dist/src/store/iRenderer.d.ts +46 -0
- package/dist/src/store/index.d.ts +105 -0
- package/dist/src/store/list.d.ts +270 -0
- package/dist/src/store/manager.d.ts +115 -0
- package/dist/src/store/modal.d.ts +84 -0
- package/dist/src/store/node.d.ts +22 -0
- package/dist/src/store/pagination.d.ts +58 -0
- package/dist/src/store/root.d.ts +79 -0
- package/dist/src/store/service.d.ts +71 -0
- package/dist/src/store/table-v2.d.ts +309 -0
- package/dist/src/store/table.d.ts +8334 -0
- package/dist/src/theme.d.ts +83 -0
- package/dist/src/types.d.ts +217 -0
- package/dist/src/utils/Animation.d.ts +22 -0
- package/dist/src/utils/ColorScale.d.ts +19 -0
- package/dist/src/utils/DataSchema.d.ts +25 -0
- package/dist/src/utils/DataScope.d.ts +23 -0
- package/dist/src/utils/RootClose.d.ts +4 -0
- package/dist/src/utils/SimpleMap.d.ts +8 -0
- package/dist/src/utils/api.d.ts +27 -0
- package/dist/src/utils/attachmentAdpator.d.ts +7 -0
- package/dist/src/utils/autobind.d.ts +7 -0
- package/dist/src/utils/columnsSplit.d.ts +1 -0
- package/dist/src/utils/dataMapping.d.ts +3 -0
- package/dist/src/utils/date.d.ts +4 -0
- package/dist/src/utils/debug.d.ts +26 -0
- package/dist/src/utils/dom.d.ts +13 -0
- package/dist/src/utils/errors.d.ts +6 -0
- package/dist/src/utils/escapeHtml.d.ts +1 -0
- package/dist/src/utils/filter-schema.d.ts +12 -0
- package/dist/src/utils/filter.d.ts +1 -0
- package/dist/src/utils/formatDuration.d.ts +1 -0
- package/dist/src/utils/formula.d.ts +16 -0
- package/dist/src/utils/getVariable.d.ts +3 -0
- package/dist/src/utils/grammar.d.ts +4 -0
- package/dist/src/utils/handleAction.d.ts +6 -0
- package/dist/src/utils/helper.d.ts +286 -0
- package/dist/src/utils/icon.d.ts +12 -0
- package/dist/src/utils/image.d.ts +17 -0
- package/dist/src/utils/index.d.ts +12 -0
- package/dist/src/utils/isPureVariable.d.ts +1 -0
- package/dist/src/utils/json-schema-2-amis-schema.d.ts +6 -0
- package/dist/src/utils/keyToPath.d.ts +6 -0
- package/dist/src/utils/makeSorter.d.ts +1 -0
- package/dist/src/utils/markdown.d.ts +5 -0
- package/dist/src/utils/normalizeLink.d.ts +1 -0
- package/dist/src/utils/normalizeOptions.d.ts +7 -0
- package/dist/src/utils/object.d.ts +15 -0
- package/dist/src/utils/offset.d.ts +14 -0
- package/dist/src/utils/offsetParent.d.ts +4 -0
- package/dist/src/utils/optionValueCompare.d.ts +3 -0
- package/dist/src/utils/position.d.ts +15 -0
- package/dist/src/utils/prettyBytes.d.ts +1 -0
- package/dist/src/utils/renderer-event.d.ts +44 -0
- package/dist/src/utils/replaceText.d.ts +6 -0
- package/dist/src/utils/resize-sensor.d.ts +6 -0
- package/dist/src/utils/resolveVariable.d.ts +1 -0
- package/dist/src/utils/resolveVariableAndFilter.d.ts +1 -0
- package/dist/src/utils/scrollPosition.d.ts +6 -0
- package/dist/src/utils/string2regExp.d.ts +1 -0
- package/dist/src/utils/stripNumber.d.ts +1 -0
- package/dist/src/utils/style.d.ts +10 -0
- package/dist/src/utils/tokenize.d.ts +1 -0
- package/dist/src/utils/tpl-builtin.d.ts +18 -0
- package/dist/src/utils/tpl-lodash.d.ts +4 -0
- package/dist/src/utils/tpl.d.ts +11 -0
- package/dist/src/utils/validations.d.ts +39 -0
- package/dist/store/app.js +190 -0
- package/dist/store/combo.js +154 -0
- package/dist/store/crud.js +413 -0
- package/dist/store/form.js +579 -0
- package/dist/store/formItem.js +846 -0
- package/dist/store/iRenderer.js +189 -0
- package/dist/store/index.js +103 -0
- package/dist/store/list.js +248 -0
- package/dist/store/manager.js +56 -0
- package/dist/store/modal.js +54 -0
- package/dist/store/node.js +93 -0
- package/dist/store/pagination.js +60 -0
- package/dist/store/root.js +45 -0
- package/dist/store/service.js +415 -0
- package/dist/store/table-v2.js +471 -0
- package/dist/store/table.js +1105 -0
- package/dist/theme.js +93 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/Animation.js +290 -0
- package/dist/utils/DataSchema.js +120 -0
- package/dist/utils/DataScope.js +151 -0
- package/dist/utils/SimpleMap.js +46 -0
- package/dist/utils/api.js +555 -0
- package/dist/utils/autobind.js +94 -0
- package/dist/utils/dataMapping.js +136 -0
- package/dist/utils/date.js +90 -0
- package/dist/utils/debug.js +343 -0
- package/dist/utils/errors.js +23 -0
- package/dist/utils/escapeHtml.js +24 -0
- package/dist/utils/filter-schema.js +75 -0
- package/dist/utils/filter.js +481 -0
- package/dist/utils/formatDuration.js +27 -0
- package/dist/utils/formula.js +165 -0
- package/dist/utils/getVariable.js +29 -0
- package/dist/utils/grammar.js +54 -0
- package/dist/utils/helper.js +1283 -0
- package/dist/utils/isPureVariable.js +16 -0
- package/dist/utils/keyToPath.js +34 -0
- package/dist/utils/makeSorter.js +30 -0
- package/dist/utils/normalizeLink.js +47 -0
- package/dist/utils/normalizeOptions.js +92 -0
- package/dist/utils/object.js +156 -0
- package/dist/utils/offset.js +36 -0
- package/dist/utils/offsetParent.js +27 -0
- package/dist/utils/optionValueCompare.js +25 -0
- package/dist/utils/position.js +50 -0
- package/dist/utils/prettyBytes.js +28 -0
- package/dist/utils/renderer-event.js +131 -0
- package/dist/utils/replaceText.js +35 -0
- package/dist/utils/resize-sensor.js +177 -0
- package/dist/utils/resolveVariable.js +39 -0
- package/dist/utils/resolveVariableAndFilter.js +37 -0
- package/dist/utils/string2regExp.js +18 -0
- package/dist/utils/stripNumber.js +20 -0
- package/dist/utils/tokenize.js +33 -0
- package/dist/utils/tpl-builtin.js +71 -0
- package/dist/utils/tpl-lodash.js +71 -0
- package/dist/utils/tpl.js +140 -0
- package/dist/utils/validations.js +377 -0
- package/package.json +121 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var difference = require('lodash/difference');
|
|
12
|
+
var omit = require('lodash/omit');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var LazyComponent = require('./components/LazyComponent.js');
|
|
15
|
+
var factory = require('./factory.js');
|
|
16
|
+
var Item = require('./renderers/Item.js');
|
|
17
|
+
var Scoped = require('./Scoped.js');
|
|
18
|
+
var debug = require('./utils/debug.js');
|
|
19
|
+
var filterSchema = require('./utils/filter-schema.js');
|
|
20
|
+
var helper = require('./utils/helper.js');
|
|
21
|
+
var SimpleMap = require('./utils/SimpleMap.js');
|
|
22
|
+
var rendererEvent = require('./utils/renderer-event.js');
|
|
23
|
+
var mobxStateTree = require('mobx-state-tree');
|
|
24
|
+
var mobx = require('mobx');
|
|
25
|
+
require('amis-formula');
|
|
26
|
+
require('moment');
|
|
27
|
+
require('lodash/isPlainObject');
|
|
28
|
+
var resolveVariableAndFilter = require('./utils/resolveVariableAndFilter.js');
|
|
29
|
+
require('./utils/filter.js');
|
|
30
|
+
|
|
31
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
32
|
+
|
|
33
|
+
var difference__default = /*#__PURE__*/_interopDefaultLegacy(difference);
|
|
34
|
+
var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
|
|
35
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
36
|
+
|
|
37
|
+
var defaultOmitList = [
|
|
38
|
+
'type',
|
|
39
|
+
'name',
|
|
40
|
+
'$ref',
|
|
41
|
+
'className',
|
|
42
|
+
'data',
|
|
43
|
+
'children',
|
|
44
|
+
'ref',
|
|
45
|
+
'visible',
|
|
46
|
+
'visibleOn',
|
|
47
|
+
'hidden',
|
|
48
|
+
'hiddenOn',
|
|
49
|
+
'disabled',
|
|
50
|
+
'disabledOn',
|
|
51
|
+
'component',
|
|
52
|
+
'detectField',
|
|
53
|
+
'defaultValue',
|
|
54
|
+
'defaultData',
|
|
55
|
+
'required',
|
|
56
|
+
'requiredOn',
|
|
57
|
+
'syncSuperStore',
|
|
58
|
+
'mode',
|
|
59
|
+
'body'
|
|
60
|
+
];
|
|
61
|
+
var componentCache = new SimpleMap.SimpleMap();
|
|
62
|
+
var SchemaRenderer = /** @class */ (function (_super) {
|
|
63
|
+
tslib.__extends(SchemaRenderer, _super);
|
|
64
|
+
function SchemaRenderer(props) {
|
|
65
|
+
var _this = _super.call(this, props) || this;
|
|
66
|
+
_this.rendererKey = '';
|
|
67
|
+
_this.unbindEvent = undefined;
|
|
68
|
+
_this.refFn = _this.refFn.bind(_this);
|
|
69
|
+
_this.renderChild = _this.renderChild.bind(_this);
|
|
70
|
+
_this.reRender = _this.reRender.bind(_this);
|
|
71
|
+
_this.resolveRenderer(_this.props);
|
|
72
|
+
_this.dispatchEvent = _this.dispatchEvent.bind(_this);
|
|
73
|
+
// 监听rootStore更新
|
|
74
|
+
_this.reaction = mobx.reaction(function () {
|
|
75
|
+
return "".concat(props.rootStore.visibleState[props.schema.id || props.$path]).concat(props.rootStore.disableState[props.schema.id || props.$path]);
|
|
76
|
+
}, function () { return _this.forceUpdate(); });
|
|
77
|
+
return _this;
|
|
78
|
+
}
|
|
79
|
+
SchemaRenderer.prototype.componentDidMount = function () {
|
|
80
|
+
// 这里无法区分监听的是不是广播,所以又bind一下,主要是为了绑广播
|
|
81
|
+
this.unbindEvent = rendererEvent.bindEvent(this.cRef);
|
|
82
|
+
};
|
|
83
|
+
SchemaRenderer.prototype.componentWillUnmount = function () {
|
|
84
|
+
var _a, _b;
|
|
85
|
+
(_a = this.reaction) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
86
|
+
(_b = this.unbindEvent) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
87
|
+
};
|
|
88
|
+
// 限制:只有 schema 除外的 props 变化,或者 schema 里面的某个成员值发生变化才更新。
|
|
89
|
+
SchemaRenderer.prototype.shouldComponentUpdate = function (nextProps) {
|
|
90
|
+
var props = this.props;
|
|
91
|
+
var list = difference__default["default"](Object.keys(nextProps), [
|
|
92
|
+
'schema',
|
|
93
|
+
'scope'
|
|
94
|
+
]);
|
|
95
|
+
if (difference__default["default"](Object.keys(props), ['schema', 'scope']).length !==
|
|
96
|
+
list.length ||
|
|
97
|
+
helper.anyChanged(list, this.props, nextProps)) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
var list_1 = Object.keys(nextProps.schema);
|
|
102
|
+
if (Object.keys(props.schema).length !== list_1.length ||
|
|
103
|
+
helper.anyChanged(list_1, props.schema, nextProps.schema)) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
109
|
+
SchemaRenderer.prototype.resolveRenderer = function (props, force) {
|
|
110
|
+
if (force === void 0) { force = false; }
|
|
111
|
+
var schema = props.schema;
|
|
112
|
+
var path = props.$path;
|
|
113
|
+
if (schema && schema.$ref) {
|
|
114
|
+
schema = tslib.__assign(tslib.__assign({}, props.resolveDefinitions(schema.$ref)), schema);
|
|
115
|
+
path = path.replace(/(?!.*\/).*/, schema.type);
|
|
116
|
+
}
|
|
117
|
+
if ((schema === null || schema === void 0 ? void 0 : schema.type) &&
|
|
118
|
+
(force ||
|
|
119
|
+
!this.renderer ||
|
|
120
|
+
this.rendererKey !== "".concat(schema.type, "-").concat(schema.$$id))) {
|
|
121
|
+
var rendererResolver = props.env.rendererResolver || factory.resolveRenderer;
|
|
122
|
+
this.renderer = rendererResolver(path, schema, props);
|
|
123
|
+
this.rendererKey = "".concat(schema.type, "-").concat(schema.$$id);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
// 自定义组件如果在节点设置了 label name 什么的,就用 formItem 包一层
|
|
127
|
+
// 至少自动支持了 valdiations, label, description 等逻辑。
|
|
128
|
+
if (schema.children && !schema.component && schema.asFormItem) {
|
|
129
|
+
schema.component = PlaceholderComponent;
|
|
130
|
+
schema.renderChildren = schema.children;
|
|
131
|
+
delete schema.children;
|
|
132
|
+
}
|
|
133
|
+
if (schema.component &&
|
|
134
|
+
!schema.component.wrapedAsFormItem &&
|
|
135
|
+
schema.asFormItem) {
|
|
136
|
+
var cache = componentCache.get(schema.component);
|
|
137
|
+
if (cache) {
|
|
138
|
+
schema.component = cache;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
var cache_1 = Item.asFormItem(tslib.__assign({ strictMode: false }, schema.asFormItem))(schema.component);
|
|
142
|
+
componentCache.set(schema.component, cache_1);
|
|
143
|
+
cache_1.wrapedAsFormItem = true;
|
|
144
|
+
schema.component = cache_1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return { path: path, schema: schema };
|
|
149
|
+
};
|
|
150
|
+
SchemaRenderer.prototype.getWrappedInstance = function () {
|
|
151
|
+
return this.cRef;
|
|
152
|
+
};
|
|
153
|
+
SchemaRenderer.prototype.refFn = function (ref) {
|
|
154
|
+
this.ref = ref;
|
|
155
|
+
};
|
|
156
|
+
SchemaRenderer.prototype.childRef = function (ref) {
|
|
157
|
+
while (ref && ref.getWrappedInstance) {
|
|
158
|
+
ref = ref.getWrappedInstance();
|
|
159
|
+
}
|
|
160
|
+
this.cRef = ref;
|
|
161
|
+
};
|
|
162
|
+
SchemaRenderer.prototype.dispatchEvent = function (e, data) {
|
|
163
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
164
|
+
return tslib.__generator(this, function (_a) {
|
|
165
|
+
switch (_a.label) {
|
|
166
|
+
case 0: return [4 /*yield*/, rendererEvent.dispatchEvent(e, this.cRef, this.context, data)];
|
|
167
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
SchemaRenderer.prototype.renderChild = function (region, node, subProps) {
|
|
173
|
+
if (subProps === void 0) { subProps = {}; }
|
|
174
|
+
var _a = this.props; _a.schema; _a.$path; var env = _a.env, render = _a.render, rest = tslib.__rest(_a, ["schema", "$path", "env", "render"]);
|
|
175
|
+
var $path = this.resolveRenderer(this.props).path;
|
|
176
|
+
var omitList = defaultOmitList.concat();
|
|
177
|
+
if (this.renderer) {
|
|
178
|
+
var Component = this.renderer.component;
|
|
179
|
+
Component.propsList &&
|
|
180
|
+
omitList.push.apply(omitList, Component.propsList);
|
|
181
|
+
}
|
|
182
|
+
return render("".concat($path).concat(region ? "/".concat(region) : ''), node || '', tslib.__assign(tslib.__assign(tslib.__assign({}, omit__default["default"](rest, omitList)), subProps), { data: subProps.data || rest.data, env: env }));
|
|
183
|
+
};
|
|
184
|
+
SchemaRenderer.prototype.reRender = function () {
|
|
185
|
+
this.resolveRenderer(this.props, true);
|
|
186
|
+
this.forceUpdate();
|
|
187
|
+
};
|
|
188
|
+
SchemaRenderer.prototype.render = function () {
|
|
189
|
+
var _this = this;
|
|
190
|
+
var _a, _b, _c;
|
|
191
|
+
var _d = this.props; _d.$path; var __ = _d.schema, rootStore = _d.rootStore, render = _d.render, rest = tslib.__rest(_d, ["$path", "schema", "rootStore", "render"]);
|
|
192
|
+
if (__ == null) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
var _e = this.resolveRenderer(this.props), $path = _e.path, schema = _e.schema;
|
|
196
|
+
var theme = this.props.env.theme;
|
|
197
|
+
if (Array.isArray(schema)) {
|
|
198
|
+
return render($path, schema, rest);
|
|
199
|
+
}
|
|
200
|
+
var detectData = schema &&
|
|
201
|
+
(schema.detectField === '&' ? rest : rest[schema.detectField || 'data']);
|
|
202
|
+
var exprProps = detectData
|
|
203
|
+
? filterSchema["default"](schema, detectData, undefined, rest)
|
|
204
|
+
: {};
|
|
205
|
+
// 控制显隐
|
|
206
|
+
var visible = mobxStateTree.isAlive(rootStore)
|
|
207
|
+
? rootStore.visibleState[schema.id || $path]
|
|
208
|
+
: undefined;
|
|
209
|
+
var disable = mobxStateTree.isAlive(rootStore)
|
|
210
|
+
? rootStore.disableState[schema.id || $path]
|
|
211
|
+
: undefined;
|
|
212
|
+
if (visible === false ||
|
|
213
|
+
(visible !== true &&
|
|
214
|
+
exprProps &&
|
|
215
|
+
(exprProps.hidden ||
|
|
216
|
+
exprProps.visible === false ||
|
|
217
|
+
schema.hidden ||
|
|
218
|
+
schema.visible === false ||
|
|
219
|
+
rest.hidden ||
|
|
220
|
+
rest.visible === false))) {
|
|
221
|
+
rest.invisible = true;
|
|
222
|
+
}
|
|
223
|
+
if (schema.children) {
|
|
224
|
+
return rest.invisible
|
|
225
|
+
? null
|
|
226
|
+
: React__default["default"].isValidElement(schema.children)
|
|
227
|
+
? schema.children
|
|
228
|
+
: schema.children(tslib.__assign(tslib.__assign(tslib.__assign({}, rest), exprProps), { $path: $path, $schema: schema, render: this.renderChild, forwardedRef: this.refFn, rootStore: rootStore, dispatchEvent: this.dispatchEvent }));
|
|
229
|
+
}
|
|
230
|
+
else if (typeof schema.component === 'function') {
|
|
231
|
+
var isSFC = !(schema.component.prototype instanceof React__default["default"].Component);
|
|
232
|
+
var defaultData_1 = schema.data, defaultValue_1 = schema.value, // render时的value改放defaultValue中
|
|
233
|
+
defaultActiveKey_1 = schema.activeKey, propKey_1 = schema.key, restSchema_1 = tslib.__rest(schema, ["data", "value", "activeKey", "key"]);
|
|
234
|
+
return rest.invisible
|
|
235
|
+
? null
|
|
236
|
+
: React__default["default"].createElement(schema.component, tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, rest), restSchema_1), exprProps), {
|
|
237
|
+
// value: defaultValue, // 备注: 此处并没有将value传递给渲染器
|
|
238
|
+
defaultData: defaultData_1, defaultValue: defaultValue_1, defaultActiveKey: defaultActiveKey_1, propKey: propKey_1, $path: $path, $schema: schema, ref: isSFC ? undefined : this.refFn, forwardedRef: isSFC ? this.refFn : undefined, render: this.renderChild, rootStore: rootStore, dispatchEvent: this.dispatchEvent }));
|
|
239
|
+
}
|
|
240
|
+
else if (Object.keys(schema).length === 0) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
else if (!this.renderer) {
|
|
244
|
+
return rest.invisible ? null : (React__default["default"].createElement(LazyComponent["default"], tslib.__assign({}, rest, exprProps, { getComponent: function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
245
|
+
var result;
|
|
246
|
+
return tslib.__generator(this, function (_a) {
|
|
247
|
+
switch (_a.label) {
|
|
248
|
+
case 0: return [4 /*yield*/, rest.env.loadRenderer(schema, $path, this.reRender)];
|
|
249
|
+
case 1:
|
|
250
|
+
result = _a.sent();
|
|
251
|
+
if (result && typeof result === 'function') {
|
|
252
|
+
return [2 /*return*/, result];
|
|
253
|
+
}
|
|
254
|
+
else if (result && React__default["default"].isValidElement(result)) {
|
|
255
|
+
return [2 /*return*/, function () { return result; }];
|
|
256
|
+
}
|
|
257
|
+
this.reRender();
|
|
258
|
+
return [2 /*return*/, function () { return factory.loadRenderer(schema, $path); }];
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}); }, "$path": $path, "$schema": schema, retry: this.reRender, rootStore: rootStore, dispatchEvent: this.dispatchEvent })));
|
|
262
|
+
}
|
|
263
|
+
var renderer = this.renderer;
|
|
264
|
+
schema = factory.filterSchema(schema, renderer, rest);
|
|
265
|
+
var defaultData = schema.data, defaultValue = schema.value, propKey = schema.key, defaultActiveKey = schema.activeKey, restSchema = tslib.__rest(schema, ["data", "value", "key", "activeKey"]);
|
|
266
|
+
var Component = renderer.component;
|
|
267
|
+
// 原来表单项的 visible: false 和 hidden: true 表单项的值和验证是有效的
|
|
268
|
+
// 而 visibleOn 和 hiddenOn 是无效的,
|
|
269
|
+
// 这个本来就是个bug,但是已经被广泛使用了
|
|
270
|
+
// 我只能继续实现这个bug了
|
|
271
|
+
if (rest.invisible &&
|
|
272
|
+
(exprProps.hidden ||
|
|
273
|
+
exprProps.visible === false ||
|
|
274
|
+
!renderer.isFormItem ||
|
|
275
|
+
(schema.visible !== false && !schema.hidden))) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
var isClassComponent = (_a = Component.prototype) === null || _a === void 0 ? void 0 : _a.isReactComponent;
|
|
279
|
+
var $schema = tslib.__assign(tslib.__assign({}, schema), exprProps);
|
|
280
|
+
var props = tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, theme.getRendererConfig(renderer.name)), restSchema), helper.chainEvents(rest, restSchema)), exprProps), {
|
|
281
|
+
// value: defaultValue, // 备注: 此处并没有将value传递给渲染器
|
|
282
|
+
defaultData: (_b = restSchema.defaultData) !== null && _b !== void 0 ? _b : defaultData, defaultValue: (_c = restSchema.defaultValue) !== null && _c !== void 0 ? _c : defaultValue, defaultActiveKey: defaultActiveKey, propKey: propKey, $path: $path, $schema: $schema, ref: this.refFn, render: this.renderChild, rootStore: rootStore, dispatchEvent: this.dispatchEvent });
|
|
283
|
+
if (disable !== undefined) {
|
|
284
|
+
props.disabled = disable;
|
|
285
|
+
}
|
|
286
|
+
// 自动解析变量模式,主要是方便直接引入第三方组件库,无需为了支持变量封装一层
|
|
287
|
+
if (renderer.autoVar) {
|
|
288
|
+
for (var _i = 0, _f = Object.keys($schema); _i < _f.length; _i++) {
|
|
289
|
+
var key = _f[_i];
|
|
290
|
+
if (typeof props[key] === 'string') {
|
|
291
|
+
props[key] = resolveVariableAndFilter.resolveVariableAndFilter(props[key], props.data, '| raw');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
var component = isClassComponent ? (React__default["default"].createElement(Component, tslib.__assign({}, props, { ref: this.childRef }))) : (React__default["default"].createElement(Component, tslib.__assign({}, props)));
|
|
296
|
+
return this.props.env.enableAMISDebug ? (React__default["default"].createElement(debug.DebugWrapper, { renderer: renderer }, component)) : (component);
|
|
297
|
+
};
|
|
298
|
+
SchemaRenderer.displayName = 'Renderer';
|
|
299
|
+
SchemaRenderer.contextType = Scoped.ScopedContext;
|
|
300
|
+
tslib.__decorate([
|
|
301
|
+
helper.autobind,
|
|
302
|
+
tslib.__metadata("design:type", Function),
|
|
303
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
304
|
+
tslib.__metadata("design:returntype", void 0)
|
|
305
|
+
], SchemaRenderer.prototype, "childRef", null);
|
|
306
|
+
return SchemaRenderer;
|
|
307
|
+
}(React__default["default"].Component));
|
|
308
|
+
var PlaceholderComponent = /** @class */ (function (_super) {
|
|
309
|
+
tslib.__extends(PlaceholderComponent, _super);
|
|
310
|
+
function PlaceholderComponent() {
|
|
311
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
312
|
+
}
|
|
313
|
+
PlaceholderComponent.prototype.render = function () {
|
|
314
|
+
var _a = this.props, renderChildren = _a.renderChildren, rest = tslib.__rest(_a, ["renderChildren"]);
|
|
315
|
+
if (typeof renderChildren === 'function') {
|
|
316
|
+
return renderChildren(rest);
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
};
|
|
320
|
+
return PlaceholderComponent;
|
|
321
|
+
}(React__default["default"].Component));
|
|
322
|
+
|
|
323
|
+
exports.SchemaRenderer = SchemaRenderer;
|
package/dist/Scoped.js
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var find = require('lodash/find');
|
|
13
|
+
var hoistNonReactStatic = require('hoist-non-react-statics');
|
|
14
|
+
require('amis-formula');
|
|
15
|
+
require('moment');
|
|
16
|
+
require('lodash/isPlainObject');
|
|
17
|
+
var dataMapping = require('./utils/dataMapping.js');
|
|
18
|
+
require('./utils/filter.js');
|
|
19
|
+
var helper = require('./utils/helper.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
+
var find__default = /*#__PURE__*/_interopDefaultLegacy(find);
|
|
25
|
+
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @file 用来创建一个域,在这个域里面会把里面的运行时实例注册进来,方便组件之间的通信。
|
|
29
|
+
* @author fex
|
|
30
|
+
*/
|
|
31
|
+
var ScopedContext = React__default["default"].createContext(createScopedTools(''));
|
|
32
|
+
function createScopedTools(path, parent, env) {
|
|
33
|
+
var components = [];
|
|
34
|
+
var self = {
|
|
35
|
+
parent: parent,
|
|
36
|
+
registerComponent: function (component) {
|
|
37
|
+
// 不要把自己注册在自己的 Scoped 上,自己的 Scoped 是给子节点们注册的。
|
|
38
|
+
if (component.props.$path === path && parent) {
|
|
39
|
+
return parent.registerComponent(component);
|
|
40
|
+
}
|
|
41
|
+
if (!~components.indexOf(component)) {
|
|
42
|
+
components.push(component);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
unRegisterComponent: function (component) {
|
|
46
|
+
// 自己本身实际上注册在父级 Scoped 上。
|
|
47
|
+
if (component.props.$path === path && parent) {
|
|
48
|
+
return parent.unRegisterComponent(component);
|
|
49
|
+
}
|
|
50
|
+
var idx = components.indexOf(component);
|
|
51
|
+
if (~idx) {
|
|
52
|
+
components.splice(idx, 1);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
getComponentByName: function (name) {
|
|
56
|
+
if (~name.indexOf('.')) {
|
|
57
|
+
var paths = name.split('.');
|
|
58
|
+
var len_1 = paths.length;
|
|
59
|
+
return paths.reduce(function (scope, name, idx) {
|
|
60
|
+
if (scope && scope.getComponentByName) {
|
|
61
|
+
var result = scope.getComponentByName(name);
|
|
62
|
+
return result && idx < len_1 - 1 ? result.context : result;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}, this);
|
|
66
|
+
}
|
|
67
|
+
var resolved = find__default["default"](components, function (component) {
|
|
68
|
+
return component.props.name === name || component.props.id === name;
|
|
69
|
+
});
|
|
70
|
+
return resolved || (parent && parent.getComponentByName(name));
|
|
71
|
+
},
|
|
72
|
+
getComponentById: function (id) {
|
|
73
|
+
var root = this;
|
|
74
|
+
// 找到顶端scoped
|
|
75
|
+
while (root.parent) {
|
|
76
|
+
root = root.parent;
|
|
77
|
+
}
|
|
78
|
+
// 向下查找
|
|
79
|
+
var component = undefined;
|
|
80
|
+
helper.findTree([root], function (item) {
|
|
81
|
+
return item.getComponents().find(function (cmpt) {
|
|
82
|
+
if (cmpt.props.id === id) {
|
|
83
|
+
component = cmpt;
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
return component;
|
|
90
|
+
},
|
|
91
|
+
getComponents: function () {
|
|
92
|
+
return components.concat();
|
|
93
|
+
},
|
|
94
|
+
reload: function (target, ctx) {
|
|
95
|
+
var scoped = this;
|
|
96
|
+
var targets = typeof target === 'string' ? target.split(/\s*,\s*/) : target;
|
|
97
|
+
targets.forEach(function (name) {
|
|
98
|
+
var idx2 = name.indexOf('?');
|
|
99
|
+
var query = null;
|
|
100
|
+
if (~idx2) {
|
|
101
|
+
var queryObj = helper.qsparse(name
|
|
102
|
+
.substring(idx2 + 1)
|
|
103
|
+
.replace(/\$\{(.*?)\}/, function (_, match) { return '${' + encodeURIComponent(match) + '}'; }));
|
|
104
|
+
query = dataMapping.dataMapping(queryObj, ctx);
|
|
105
|
+
name = name.substring(0, idx2);
|
|
106
|
+
}
|
|
107
|
+
var idx = name.indexOf('.');
|
|
108
|
+
var subPath = '';
|
|
109
|
+
if (~idx) {
|
|
110
|
+
subPath = name.substring(1 + idx);
|
|
111
|
+
name = name.substring(0, idx);
|
|
112
|
+
}
|
|
113
|
+
if (name === 'window') {
|
|
114
|
+
if (query) {
|
|
115
|
+
var link = location.pathname + '?' + helper.qsstringify(query);
|
|
116
|
+
env ? env.updateLocation(link, true) : location.replace(link);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
location.reload();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
var component = scoped.getComponentByName(name);
|
|
124
|
+
component &&
|
|
125
|
+
component.reload &&
|
|
126
|
+
component.reload(subPath, query, ctx);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
send: function (receive, values) {
|
|
131
|
+
var scoped = this;
|
|
132
|
+
var receives = typeof receive === 'string' ? receive.split(/\s*,\s*/) : receive;
|
|
133
|
+
// todo 没找到做提示!
|
|
134
|
+
receives.forEach(function (name) {
|
|
135
|
+
var askIdx = name.indexOf('?');
|
|
136
|
+
if (~askIdx) {
|
|
137
|
+
var query = name.substring(askIdx + 1);
|
|
138
|
+
var queryObj = helper.qsparse(query.replace(/\$\{(.*?)\}/, function (_, match) { return '${' + encodeURIComponent(match) + '}'; }));
|
|
139
|
+
name = name.substring(0, askIdx);
|
|
140
|
+
values = dataMapping.dataMapping(queryObj, values);
|
|
141
|
+
}
|
|
142
|
+
var idx = name.indexOf('.');
|
|
143
|
+
var subPath = '';
|
|
144
|
+
if (~idx) {
|
|
145
|
+
subPath = name.substring(1 + idx);
|
|
146
|
+
name = name.substring(0, idx);
|
|
147
|
+
}
|
|
148
|
+
var component = scoped.getComponentByName(name);
|
|
149
|
+
if (component && component.receive) {
|
|
150
|
+
component.receive(values, subPath);
|
|
151
|
+
}
|
|
152
|
+
else if (name === 'window' && env && env.updateLocation) {
|
|
153
|
+
var query = tslib.__assign(tslib.__assign({}, (location.search ? helper.qsparse(location.search.substring(1)) : {})), values);
|
|
154
|
+
var link = location.pathname + '?' + helper.qsstringify(query);
|
|
155
|
+
env.updateLocation(link, true);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* 主要是用来关闭指定弹框的
|
|
161
|
+
*
|
|
162
|
+
* @param target 目标 name
|
|
163
|
+
*/
|
|
164
|
+
close: function (target) {
|
|
165
|
+
var scoped = this;
|
|
166
|
+
if (typeof target === 'string') {
|
|
167
|
+
// 过滤已经关掉的,当用户 close 配置多个弹框 name 时会出现这种情况
|
|
168
|
+
target
|
|
169
|
+
.split(/\s*,\s*/)
|
|
170
|
+
.map(function (name) { return scoped.getComponentByName(name); })
|
|
171
|
+
.filter(function (component) { return component && component.props.show; })
|
|
172
|
+
.forEach(closeDialog);
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* 关闭指定id的弹窗
|
|
177
|
+
* @param id
|
|
178
|
+
*/
|
|
179
|
+
closeById: function (id) {
|
|
180
|
+
var scoped = this;
|
|
181
|
+
var component = scoped.getComponentById(id);
|
|
182
|
+
if (component && component.props.show) {
|
|
183
|
+
closeDialog(component);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
if (!parent) {
|
|
188
|
+
return self;
|
|
189
|
+
}
|
|
190
|
+
!parent.children && (parent.children = []);
|
|
191
|
+
// 把孩子带上
|
|
192
|
+
parent.children.push(self);
|
|
193
|
+
return self;
|
|
194
|
+
}
|
|
195
|
+
function closeDialog(component) {
|
|
196
|
+
component.context
|
|
197
|
+
.getComponents()
|
|
198
|
+
.filter(function (item) {
|
|
199
|
+
return item &&
|
|
200
|
+
(item.props.type === 'dialog' || item.props.type === 'drawer') &&
|
|
201
|
+
item.props.show;
|
|
202
|
+
})
|
|
203
|
+
.forEach(closeDialog);
|
|
204
|
+
component.props.onClose && component.props.onClose();
|
|
205
|
+
}
|
|
206
|
+
function HocScoped(ComposedComponent) {
|
|
207
|
+
var ScopedComponent = /** @class */ (function (_super) {
|
|
208
|
+
tslib.__extends(ScopedComponent, _super);
|
|
209
|
+
function ScopedComponent(props, context) {
|
|
210
|
+
var _this = _super.call(this, props) || this;
|
|
211
|
+
_this.scoped = createScopedTools(_this.props.$path, context, _this.props.env);
|
|
212
|
+
var scopeRef = props.scopeRef;
|
|
213
|
+
scopeRef && scopeRef(_this.scoped);
|
|
214
|
+
return _this;
|
|
215
|
+
}
|
|
216
|
+
ScopedComponent.prototype.getWrappedInstance = function () {
|
|
217
|
+
return this.ref;
|
|
218
|
+
};
|
|
219
|
+
ScopedComponent.prototype.childRef = function (ref) {
|
|
220
|
+
while (ref && ref.getWrappedInstance) {
|
|
221
|
+
ref = ref.getWrappedInstance();
|
|
222
|
+
}
|
|
223
|
+
this.ref = ref;
|
|
224
|
+
};
|
|
225
|
+
ScopedComponent.prototype.componentWillUnmount = function () {
|
|
226
|
+
var scopeRef = this.props.scopeRef;
|
|
227
|
+
scopeRef && scopeRef(null);
|
|
228
|
+
delete this.scoped;
|
|
229
|
+
};
|
|
230
|
+
ScopedComponent.prototype.render = function () {
|
|
231
|
+
var _a = this.props; _a.scopeRef; var rest = tslib.__rest(_a, ["scopeRef"]);
|
|
232
|
+
return (React__default["default"].createElement(ScopedContext.Provider, { value: this.scoped },
|
|
233
|
+
React__default["default"].createElement(ComposedComponent, tslib.__assign({}, rest /* todo */, { ref: this.childRef }))));
|
|
234
|
+
};
|
|
235
|
+
ScopedComponent.displayName = "Scoped(".concat(ComposedComponent.displayName || ComposedComponent.name, ")");
|
|
236
|
+
ScopedComponent.contextType = ScopedContext;
|
|
237
|
+
ScopedComponent.ComposedComponent = ComposedComponent;
|
|
238
|
+
tslib.__decorate([
|
|
239
|
+
helper.autobind,
|
|
240
|
+
tslib.__metadata("design:type", Function),
|
|
241
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
242
|
+
tslib.__metadata("design:returntype", void 0)
|
|
243
|
+
], ScopedComponent.prototype, "childRef", null);
|
|
244
|
+
return ScopedComponent;
|
|
245
|
+
}(React__default["default"].Component));
|
|
246
|
+
hoistNonReactStatic__default["default"](ScopedComponent, ComposedComponent);
|
|
247
|
+
return ScopedComponent;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
exports.HocScoped = HocScoped;
|
|
251
|
+
exports.ScopedContext = ScopedContext;
|
|
252
|
+
exports["default"] = HocScoped;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* amis-core v1.0.0-beta.0
|
|
3
|
+
* Copyright 2018-2022 fex
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var tslib = require('tslib');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var hoistNonReactStatic = require('hoist-non-react-statics');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
var hoistNonReactStatic__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatic);
|
|
18
|
+
|
|
19
|
+
var RootStoreContext = React__default["default"].createContext(undefined);
|
|
20
|
+
function withRootStore(ComposedComponent) {
|
|
21
|
+
var _a;
|
|
22
|
+
var result = hoistNonReactStatic__default["default"]((_a = /** @class */ (function (_super) {
|
|
23
|
+
tslib.__extends(class_1, _super);
|
|
24
|
+
function class_1() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
class_1.prototype.render = function () {
|
|
28
|
+
var rootStore = this.context;
|
|
29
|
+
var injectedProps = {
|
|
30
|
+
rootStore: rootStore
|
|
31
|
+
};
|
|
32
|
+
return (React__default["default"].createElement(ComposedComponent, tslib.__assign({}, this.props, injectedProps)));
|
|
33
|
+
};
|
|
34
|
+
return class_1;
|
|
35
|
+
}(React__default["default"].Component)),
|
|
36
|
+
_a.displayName = "WithRootStore(".concat(ComposedComponent.displayName || ComposedComponent.name, ")"),
|
|
37
|
+
_a.contextType = RootStoreContext,
|
|
38
|
+
_a.ComposedComponent = ComposedComponent,
|
|
39
|
+
_a), ComposedComponent);
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.RootStoreContext = RootStoreContext;
|
|
44
|
+
exports.withRootStore = withRootStore;
|