@flatbiz/pro-layout 5.0.4 → 5.0.5
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.d.ts +7 -0
- package/dist/index.js +41 -38
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -546,6 +546,13 @@ export type BootstrapOptions = {
|
|
|
546
546
|
cancelIframeRouteSyncParent?: boolean;
|
|
547
547
|
/** 侧边栏菜单onChange事件 */
|
|
548
548
|
siderBarMenuOnChange?: (data: any) => void;
|
|
549
|
+
/**
|
|
550
|
+
* iframeTab独立Path配置
|
|
551
|
+
* ```
|
|
552
|
+
* iframe模式中,在同一菜单路径下,打开多级路由时,点击菜单当前iframe会刷新为根路由页面,此处设置后不会被覆盖
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
separateIframeTabPathList?: string[];
|
|
549
556
|
};
|
|
550
557
|
export type LayoutCtxProps = {
|
|
551
558
|
menus: TMenuItem[];
|
package/dist/index.js
CHANGED
|
@@ -2613,9 +2613,6 @@ var SiderBar = function SiderBar() {
|
|
|
2613
2613
|
window['__sider_bar_menu_click'] = true;
|
|
2614
2614
|
layoutCtx.onChangeSelectedKeys(data.keyPath);
|
|
2615
2615
|
if (layoutCtx.layoutMode === 'iframe-main') {
|
|
2616
|
-
if (data.key === menuItemActiveKeyRef.current && layoutCtx.redDotMap[layoutCtx.iframeTabActiveItem.id]) {
|
|
2617
|
-
layoutCtx.onChangeActiveTabItemRedDot(false);
|
|
2618
|
-
}
|
|
2619
2616
|
layoutCtx.onIframeChange(data.key, 'menuClick');
|
|
2620
2617
|
menuItemActiveKeyRef.current = data.key;
|
|
2621
2618
|
return;
|
|
@@ -3192,7 +3189,7 @@ var NormalRoutesTiming = function NormalRoutesTiming() {
|
|
|
3192
3189
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
3193
3190
|
};
|
|
3194
3191
|
|
|
3195
|
-
var _excluded = ["sidebarWidth", "componentSize", "locale", "logoPath", "headerThemeConfig", "sidebarThemeConfig", "completeMenus"];
|
|
3192
|
+
var _excluded = ["sidebarWidth", "componentSize", "locale", "logoPath", "headerThemeConfig", "sidebarThemeConfig", "completeMenus", "separatePathList"];
|
|
3196
3193
|
var AppProvider = function AppProvider(props) {
|
|
3197
3194
|
var navigate = useNavigate();
|
|
3198
3195
|
var sidebarWidth = props.sidebarWidth,
|
|
@@ -3202,6 +3199,7 @@ var AppProvider = function AppProvider(props) {
|
|
|
3202
3199
|
headerThemeConfig = props.headerThemeConfig,
|
|
3203
3200
|
sidebarThemeConfig = props.sidebarThemeConfig,
|
|
3204
3201
|
completeMenus = props.completeMenus,
|
|
3202
|
+
separatePathList = props.separatePathList,
|
|
3205
3203
|
options = _objectWithoutProperties(props, _excluded);
|
|
3206
3204
|
var isIframeMain = options.layoutMode === 'iframe-main';
|
|
3207
3205
|
var unMatchHiddenSiderBar = isUndefined(options.unMatchHiddenSiderBar) ? true : options.unMatchHiddenSiderBar;
|
|
@@ -3441,33 +3439,38 @@ var AppProvider = function AppProvider(props) {
|
|
|
3441
3439
|
}
|
|
3442
3440
|
} else if (type === 'menuClick') {
|
|
3443
3441
|
if (valueIsEqual(id, siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.id)) {
|
|
3444
|
-
var
|
|
3445
|
-
|
|
3446
|
-
name: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.name,
|
|
3447
|
-
metaTitle: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.metaTitle,
|
|
3448
|
-
pathSearch: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.path
|
|
3449
|
-
}, getIframeTabCacheList());
|
|
3450
|
-
navigate(toLinkPath((siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.path) || ''));
|
|
3451
|
-
setIframeTabList(_toConsumableArray(refreshResult.iframeTabList));
|
|
3452
|
-
setIframeTabActiveItem(extend({}, refreshResult.target));
|
|
3453
|
-
if (configs !== null && configs !== void 0 && configs.locationMenu) {
|
|
3454
|
-
onChangeSiderBarMenuActiveItem(siderBarMenus, siderBarTileMenus, id);
|
|
3455
|
-
}
|
|
3456
|
-
return;
|
|
3457
|
-
} else {
|
|
3458
|
-
var menuTarget = siderBarTileMenus.find(function (item) {
|
|
3459
|
-
return valueIsEqual(item.id, id);
|
|
3442
|
+
var _target2 = separatePathList === null || separatePathList === void 0 ? void 0 : separatePathList.find(function (item) {
|
|
3443
|
+
return getIframeMainPurePath(item) == getIframeMainPurePath(location.pathname);
|
|
3460
3444
|
});
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3445
|
+
if (!_target2) {
|
|
3446
|
+
onChangeActiveTabItemRedDot(false);
|
|
3447
|
+
var refreshResult = refreshIframeTabLink(iframeTabActiveItem === null || iframeTabActiveItem === void 0 ? void 0 : iframeTabActiveItem.id, {
|
|
3448
|
+
link: toLinkPath(siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.link),
|
|
3449
|
+
name: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.name,
|
|
3450
|
+
metaTitle: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.metaTitle,
|
|
3451
|
+
pathSearch: siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.path
|
|
3452
|
+
}, getIframeTabCacheList());
|
|
3453
|
+
navigate(toLinkPath((siderBarMenuActiveItem === null || siderBarMenuActiveItem === void 0 ? void 0 : siderBarMenuActiveItem.path) || ''));
|
|
3454
|
+
setIframeTabList(_toConsumableArray(refreshResult.iframeTabList));
|
|
3455
|
+
setIframeTabActiveItem(extend({}, refreshResult.target));
|
|
3456
|
+
if (configs !== null && configs !== void 0 && configs.locationMenu) {
|
|
3457
|
+
onChangeSiderBarMenuActiveItem(siderBarMenus, siderBarTileMenus, id);
|
|
3458
|
+
}
|
|
3459
|
+
return;
|
|
3469
3460
|
}
|
|
3470
3461
|
}
|
|
3462
|
+
var menuTarget = siderBarTileMenus.find(function (item) {
|
|
3463
|
+
return valueIsEqual(item.id, id);
|
|
3464
|
+
});
|
|
3465
|
+
var _addOrUpdateIframeTab2 = addOrUpdateIframeTabListByMenuItem(menuTarget, getIframeTabCacheList()),
|
|
3466
|
+
iframeTabActiveItemNew = _addOrUpdateIframeTab2.iframeTabActiveItem,
|
|
3467
|
+
_iframeTabListNew = _addOrUpdateIframeTab2.iframeTabListNew;
|
|
3468
|
+
setIframeTabList(_toConsumableArray(_iframeTabListNew));
|
|
3469
|
+
setIframeTabActiveItem(iframeTabActiveItemNew);
|
|
3470
|
+
setSiderBarMenuActiveItem(menuTarget);
|
|
3471
|
+
if (configs !== null && configs !== void 0 && configs.locationMenu) {
|
|
3472
|
+
onChangeSiderBarMenuActiveItem(siderBarMenus, siderBarTileMenus, id);
|
|
3473
|
+
}
|
|
3471
3474
|
}
|
|
3472
3475
|
};
|
|
3473
3476
|
var onDeleteIframeTabItem = function onDeleteIframeTabItem(type, id) {
|
|
@@ -3533,10 +3536,10 @@ var AppProvider = function AppProvider(props) {
|
|
|
3533
3536
|
return valueIsEqual(item.id, menuId);
|
|
3534
3537
|
});
|
|
3535
3538
|
var _addOrUpdateIframeTab3 = addOrUpdateIframeTabListByMenuItem(menuTarget, iframeTabList),
|
|
3536
|
-
|
|
3539
|
+
_iframeTabActiveItem = _addOrUpdateIframeTab3.iframeTabActiveItem,
|
|
3537
3540
|
iframeTabListNew = _addOrUpdateIframeTab3.iframeTabListNew;
|
|
3538
3541
|
setIframeTabList(_toConsumableArray(iframeTabListNew));
|
|
3539
|
-
setIframeTabActiveItem(
|
|
3542
|
+
setIframeTabActiveItem(_iframeTabActiveItem);
|
|
3540
3543
|
setSiderBarMenuActiveItem(menuTarget);
|
|
3541
3544
|
return;
|
|
3542
3545
|
}
|
|
@@ -3571,14 +3574,14 @@ var AppProvider = function AppProvider(props) {
|
|
|
3571
3574
|
name: data.name,
|
|
3572
3575
|
metaTitle: data.metaTitle
|
|
3573
3576
|
}), cahceTabList),
|
|
3574
|
-
|
|
3577
|
+
_iframeTabActiveItem2 = _addOrUpdateIframeTab4.iframeTabActiveItem,
|
|
3575
3578
|
iframeTabListNew = _addOrUpdateIframeTab4.iframeTabListNew;
|
|
3576
3579
|
setIframeTabList(_toConsumableArray(iframeTabListNew));
|
|
3577
|
-
setIframeTabActiveItem(
|
|
3580
|
+
setIframeTabActiveItem(_iframeTabActiveItem2);
|
|
3578
3581
|
saveIframeOpenNewTabItemOperateLink({
|
|
3579
3582
|
startTabId: prevIframeTabActiveItem === null || prevIframeTabActiveItem === void 0 ? void 0 : prevIframeTabActiveItem.id,
|
|
3580
3583
|
startTabMenuId: prevIframeTabActiveItem === null || prevIframeTabActiveItem === void 0 ? void 0 : prevIframeTabActiveItem.menuId,
|
|
3581
|
-
endTabId:
|
|
3584
|
+
endTabId: _iframeTabActiveItem2.id
|
|
3582
3585
|
});
|
|
3583
3586
|
} else {
|
|
3584
3587
|
setSelectedKeys([]);
|
|
@@ -3604,13 +3607,13 @@ var AppProvider = function AppProvider(props) {
|
|
|
3604
3607
|
pathSearch: pathSearch
|
|
3605
3608
|
}),
|
|
3606
3609
|
_iframeTabListNew2 = _addIframeTabListByMe.iframeTabListNew,
|
|
3607
|
-
|
|
3610
|
+
_iframeTabActiveItem3 = _addIframeTabListByMe.iframeTabActiveItem;
|
|
3608
3611
|
setIframeTabList(_toConsumableArray(_iframeTabListNew2));
|
|
3609
|
-
setIframeTabActiveItem(
|
|
3612
|
+
setIframeTabActiveItem(_iframeTabActiveItem3);
|
|
3610
3613
|
saveIframeOpenNewTabItemOperateLink({
|
|
3611
3614
|
startTabId: prevIframeTabActiveItem === null || prevIframeTabActiveItem === void 0 ? void 0 : prevIframeTabActiveItem.id,
|
|
3612
3615
|
startTabMenuId: prevIframeTabActiveItem === null || prevIframeTabActiveItem === void 0 ? void 0 : prevIframeTabActiveItem.menuId,
|
|
3613
|
-
endTabId:
|
|
3616
|
+
endTabId: _iframeTabActiveItem3.id
|
|
3614
3617
|
});
|
|
3615
3618
|
}
|
|
3616
3619
|
}
|
|
@@ -3675,9 +3678,9 @@ var AppProvider = function AppProvider(props) {
|
|
|
3675
3678
|
link: data.link
|
|
3676
3679
|
})),
|
|
3677
3680
|
iframeTabListNew = _addIframeTabListByMe2.iframeTabListNew,
|
|
3678
|
-
|
|
3681
|
+
_iframeTabActiveItem4 = _addIframeTabListByMe2.iframeTabActiveItem;
|
|
3679
3682
|
setIframeTabList(_toConsumableArray(iframeTabListNew));
|
|
3680
|
-
setIframeTabActiveItem(
|
|
3683
|
+
setIframeTabActiveItem(_iframeTabActiveItem4);
|
|
3681
3684
|
}
|
|
3682
3685
|
};
|
|
3683
3686
|
var onChangeActiveTabItemRedDot = function onChangeActiveTabItemRedDot(visible) {
|