@flatbiz/pro-layout 5.0.25 → 5.0.27
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 +2 -0
- package/dist/index.js +24 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { App as App$1, Breadcrumb, FloatButton, Result, Button, message as messa
|
|
|
6
6
|
import { classNames } from '@dimjs/utils/class-names/class-names';
|
|
7
7
|
import { createContext, useContext, useEffect, useMemo, Fragment, Children, cloneElement, forwardRef, useState, useImperativeHandle, isValidElement, Suspense, useRef, memo, Component } from 'react';
|
|
8
8
|
import { useParams, useLocation, useSearchParams, matchPath, Link, useNavigate, Routes, Route, Navigate, BrowserRouter } from 'react-router-dom';
|
|
9
|
-
import { getGlobalData, sessionStorageCache, ensureSlash as ensureSlash$1, removeSlash, toLinkPath, isHttpUri, toArray, urlJoinMulti, urlJoin, isWindowsEnv, valueIsEqual, toLinkPathWithQuery, openNewWindow, treeToArray, cloneObject, getUuid, EventEmitter, treeFilter, arrayFindByLoosely, arrayFindIndexByLoosely, isUndefinedOrNull } from '@flatbiz/utils';
|
|
9
|
+
import { getGlobalData, sessionStorageCache, ensureSlash as ensureSlash$1, removeSlash, toLinkPath, isHttpUri, toArray, urlJoinMulti, urlJoin, isWindowsEnv, valueIsEqual, toLinkPathWithQuery, openNewWindow, treeToArray, cloneObject, getUuid, EventEmitter, treeFilter, arrayFindByLoosely, arrayFindIndexByLoosely, isUndefinedOrNull, localStorageCache } from '@flatbiz/utils';
|
|
10
10
|
import { hooks } from '@wove/react/hooks';
|
|
11
11
|
import { parse } from '@dimjs/utils/json/parse';
|
|
12
12
|
import { isArray } from '@dimjs/lang/is-array';
|
|
@@ -3005,7 +3005,7 @@ var SiderBar = function SiderBar() {
|
|
|
3005
3005
|
}
|
|
3006
3006
|
if (targetItem.path) {
|
|
3007
3007
|
navigate(toLinkPath(targetItem.path));
|
|
3008
|
-
document.title = targetItem.metaTitle || targetItem.name;
|
|
3008
|
+
document.title = targetItem.metaTitle || layoutCtx.browserTitle || targetItem.name;
|
|
3009
3009
|
}
|
|
3010
3010
|
});
|
|
3011
3011
|
var onOpenChange = hooks.useCallbackRef(function (openKeys) {
|
|
@@ -3125,7 +3125,7 @@ var SiderBar = function SiderBar() {
|
|
|
3125
3125
|
var getIframeTabUid = function getIframeTabUid(prefix) {
|
|
3126
3126
|
var iframe = window.frameElement;
|
|
3127
3127
|
// 获取 iframe 的 id 属性
|
|
3128
|
-
var iframeId = iframe === null || iframe === void 0 ? void 0 : iframe.id;
|
|
3128
|
+
var iframeId = (iframe === null || iframe === void 0 ? void 0 : iframe.id) || getUuid();
|
|
3129
3129
|
return "".concat(prefix, "_").concat(iframeId);
|
|
3130
3130
|
};
|
|
3131
3131
|
|
|
@@ -3847,7 +3847,7 @@ var AppProvider = function AppProvider(props) {
|
|
|
3847
3847
|
opendKeysTempRef.current = chainMenuIdList;
|
|
3848
3848
|
setSiderBarMenuActiveItem(siderbarTargetMenu);
|
|
3849
3849
|
// initSiderBarMenuActiveItemRef.current = siderbarTargetMenu;
|
|
3850
|
-
document.title = siderbarTargetMenu.metaTitle || siderbarTargetMenu.name;
|
|
3850
|
+
document.title = siderbarTargetMenu.metaTitle || options.browserTitle || siderbarTargetMenu.name;
|
|
3851
3851
|
} else {
|
|
3852
3852
|
if (options.disableTopbarMenu) {
|
|
3853
3853
|
siderBarMenus = menus;
|
|
@@ -3898,7 +3898,7 @@ var AppProvider = function AppProvider(props) {
|
|
|
3898
3898
|
fbaHooks.useEffectCustom(function () {
|
|
3899
3899
|
if (iframeTabActiveItem !== null && iframeTabActiveItem !== void 0 && iframeTabActiveItem.id) {
|
|
3900
3900
|
saveCacheIframeActiveItem(iframeTabActiveItem);
|
|
3901
|
-
document.title = iframeTabActiveItem.metaTitle || iframeTabActiveItem.name;
|
|
3901
|
+
document.title = iframeTabActiveItem.metaTitle || options.browserTitle || iframeTabActiveItem.name;
|
|
3902
3902
|
navigate(iframeTabActiveItem.pathSearch);
|
|
3903
3903
|
onIframeTabActiveEvent === null || onIframeTabActiveEvent === void 0 || onIframeTabActiveEvent(iframeTabActiveItem);
|
|
3904
3904
|
iframeApi.broadcastMessages({
|
|
@@ -4208,7 +4208,7 @@ var AppProvider = function AppProvider(props) {
|
|
|
4208
4208
|
setSelectedKeys(chainMenuIdList);
|
|
4209
4209
|
setOpendKeys(chainMenuIdList);
|
|
4210
4210
|
setSiderBarMenuActiveItem(siderbarTargetMenu);
|
|
4211
|
-
document.title = siderbarTargetMenu.metaTitle || siderbarTargetMenu.name;
|
|
4211
|
+
document.title = siderbarTargetMenu.metaTitle || options.browserTitle || siderbarTargetMenu.name;
|
|
4212
4212
|
} else {
|
|
4213
4213
|
if (options.disableTopbarMenu) {
|
|
4214
4214
|
setSelectedKeys([]);
|
|
@@ -4679,13 +4679,28 @@ var Bootstrap = function Bootstrap(options) {
|
|
|
4679
4679
|
var isNoLayout = ['no-layout', 'iframe-tab'].includes(layoutMode);
|
|
4680
4680
|
var ContainerWrapper = options.containerWrapper || Fragment;
|
|
4681
4681
|
var configProviderProps = useMemo(function () {
|
|
4682
|
-
var _options$configProvid, _options$configProvid2;
|
|
4682
|
+
var _options$configProvid, _options$configProvid2, _options$configProvid3;
|
|
4683
4683
|
var algorithm = (_options$configProvid = options.configProviderProps) === null || _options$configProvid === void 0 || (_options$configProvid = _options$configProvid.theme) === null || _options$configProvid === void 0 ? void 0 : _options$configProvid.algorithm;
|
|
4684
4684
|
var algorithmArray = toArray(algorithm);
|
|
4685
4685
|
algorithmArray = [].concat(_toConsumableArray(algorithmArray), [isDark ? theme.darkAlgorithm : null, options.compact ? theme.compactAlgorithm : null]).filter(Boolean);
|
|
4686
|
+
var configTheme = (_options$configProvid2 = options.configProviderProps) === null || _options$configProvid2 === void 0 ? void 0 : _options$configProvid2.theme;
|
|
4687
|
+
var token = configTheme === null || configTheme === void 0 ? void 0 : configTheme.token;
|
|
4688
|
+
var components = configTheme === null || configTheme === void 0 ? void 0 : configTheme.components;
|
|
4689
|
+
var cacheName = "custom-antd-theme-".concat(globalData.appName);
|
|
4690
|
+
var customAntdTheme = localStorageCache.get(cacheName);
|
|
4691
|
+
var tokenNew = token || (customAntdTheme === null || customAntdTheme === void 0 ? void 0 : customAntdTheme.token);
|
|
4692
|
+
var componentsNew = components || (customAntdTheme === null || customAntdTheme === void 0 ? void 0 : customAntdTheme.components);
|
|
4693
|
+
if (tokenNew || componentsNew) {
|
|
4694
|
+
localStorageCache.set(cacheName, {
|
|
4695
|
+
token: tokenNew,
|
|
4696
|
+
components: componentsNew
|
|
4697
|
+
});
|
|
4698
|
+
}
|
|
4686
4699
|
return _objectSpread2(_objectSpread2({}, options.configProviderProps), {}, {
|
|
4687
|
-
theme: _objectSpread2(_objectSpread2({}, (_options$
|
|
4688
|
-
algorithm: algorithmArray
|
|
4700
|
+
theme: _objectSpread2(_objectSpread2({}, (_options$configProvid3 = options.configProviderProps) === null || _options$configProvid3 === void 0 ? void 0 : _options$configProvid3.theme), {}, {
|
|
4701
|
+
algorithm: algorithmArray,
|
|
4702
|
+
token: tokenNew,
|
|
4703
|
+
components: componentsNew
|
|
4689
4704
|
})
|
|
4690
4705
|
});
|
|
4691
4706
|
}, [isDark, options.compact, options.configProviderProps]);
|