@pdg/react-admin-layout 1.0.1 → 1.0.3
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/index.esm.js
CHANGED
|
@@ -7474,11 +7474,11 @@ var DefaultLayout = function (_a) {
|
|
|
7474
7474
|
menu.forEach(function (info) {
|
|
7475
7475
|
if (empty(info.uri) && info.items && info.items.length > 0) {
|
|
7476
7476
|
info.items.map(function (subInfo) {
|
|
7477
|
-
menuTitles[subInfo.uri] = { name: subInfo.name, parentName: info.name };
|
|
7477
|
+
menuTitles[subInfo.uri] = { name: subInfo.name, parentName: info.name, parentIcon: info.icon };
|
|
7478
7478
|
});
|
|
7479
7479
|
}
|
|
7480
7480
|
else if (info.uri) {
|
|
7481
|
-
menuTitles[info.uri] = { name: info.name };
|
|
7481
|
+
menuTitles[info.uri] = { name: info.name, icon: info.icon };
|
|
7482
7482
|
}
|
|
7483
7483
|
});
|
|
7484
7484
|
}
|
|
@@ -7488,7 +7488,13 @@ var DefaultLayout = function (_a) {
|
|
|
7488
7488
|
if (menuTitles) {
|
|
7489
7489
|
var titleData = menuTitles[location.pathname];
|
|
7490
7490
|
if (titleData) {
|
|
7491
|
-
setTitle(React.createElement(Title, { title:
|
|
7491
|
+
setTitle(React.createElement(Title, { title: React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
7492
|
+
titleData.icon && (React.createElement("div", { style: { flexShrink: 0, display: 'inline-flex', verticalAlign: 'bottom', marginRight: 5 } },
|
|
7493
|
+
React.createElement(Icon, { fontSize: 'small' }, titleData.icon.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); })))),
|
|
7494
|
+
React.createElement("div", null, titleData.name)), headTitle: titleData.parentName ? (React.createElement("div", { style: { display: 'flex', alignItems: 'center', marginBottom: 3 } },
|
|
7495
|
+
titleData.parentIcon && (React.createElement("div", { style: { flexShrink: 0, display: 'inline-flex', verticalAlign: 'bottom', marginRight: 3 } },
|
|
7496
|
+
React.createElement(Icon, { fontSize: 'small' }, titleData.parentIcon.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); })))),
|
|
7497
|
+
React.createElement("div", null, titleData.parentName))) : null }));
|
|
7492
7498
|
}
|
|
7493
7499
|
else {
|
|
7494
7500
|
setTitle(undefined);
|