@umijs/plugins 4.0.0-rc.17 → 4.0.0-rc.18
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/layout.js
CHANGED
|
@@ -22,12 +22,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const allIcons = __importStar(require("@ant-design/icons"));
|
|
30
|
-
const assert_1 = __importDefault(require("assert"));
|
|
31
27
|
const path_1 = require("path");
|
|
32
28
|
const plugin_utils_1 = require("umi/plugin-utils");
|
|
33
29
|
const resolveProjectDep_1 = require("./utils/resolveProjectDep");
|
|
@@ -191,9 +187,6 @@ const { formatMessage } = useIntl();
|
|
|
191
187
|
const { icon } = api.appData.routes[id];
|
|
192
188
|
if (icon) {
|
|
193
189
|
const upperIcon = plugin_utils_1.lodash.upperFirst(plugin_utils_1.lodash.camelCase(icon));
|
|
194
|
-
(0, assert_1.default)(
|
|
195
|
-
// @ts-ignore
|
|
196
|
-
allIcons[upperIcon] || allIcons[`${upperIcon}Outlined`], `Icon ${upperIcon} is not found`);
|
|
197
190
|
// @ts-ignore
|
|
198
191
|
if (allIcons[upperIcon]) {
|
|
199
192
|
memo[upperIcon] = true;
|
|
@@ -238,7 +231,9 @@ export function patchRoutes({ routes }) {
|
|
|
238
231
|
const { icon } = routes[key];
|
|
239
232
|
if (icon && typeof icon === 'string') {
|
|
240
233
|
const upperIcon = formatIcon(icon);
|
|
241
|
-
|
|
234
|
+
if (icons[upperIcon] || icons[upperIcon + 'Outlined']) {
|
|
235
|
+
routes[key].icon = React.createElement(icons[upperIcon] || icons[upperIcon + 'Outlined']);
|
|
236
|
+
}
|
|
242
237
|
}
|
|
243
238
|
});
|
|
244
239
|
}
|
|
@@ -122,8 +122,10 @@ export function genMount(mountElementId: string) {
|
|
|
122
122
|
// 如果需要手动控制 loading,通过主应用配置 props.autoSetLoading false 可以关闭
|
|
123
123
|
// 考虑到 react 18 之后 callback 不再准
|
|
124
124
|
// 所以在这里直接返回,而不使用 ReactDOM.render 的第三个参数
|
|
125
|
-
if (
|
|
126
|
-
props.setLoading
|
|
125
|
+
if (typeof props !== 'undefined') {
|
|
126
|
+
if (props.autoSetLoading && typeof props.setLoading === 'function') {
|
|
127
|
+
props.setLoading(false);
|
|
128
|
+
}
|
|
127
129
|
}
|
|
128
130
|
hasMountedAtLeastOnce = true;
|
|
129
131
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.18",
|
|
4
4
|
"description": "@umijs/plugins",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/plugins#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@ahooksjs/use-request": "^2.0.0",
|
|
26
26
|
"@ant-design/icons": "^4.7.0",
|
|
27
27
|
"@ant-design/pro-layout": "^6.38.0",
|
|
28
|
-
"@umijs/bundler-utils": "4.0.0-rc.
|
|
28
|
+
"@umijs/bundler-utils": "4.0.0-rc.18",
|
|
29
29
|
"antd-dayjs-webpack-plugin": "^1.0.6",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"babel-plugin-import": "^1.13.3",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"warning": "^4.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"umi": "4.0.0-rc.
|
|
47
|
+
"umi": "4.0.0-rc.18"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|