@flatbiz/pro-layout 5.2.8 → 5.2.10

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.js CHANGED
@@ -2,33 +2,29 @@
2
2
  import './index.css';
3
3
  /*! @flatjs/forge MIT @flatbiz/pro-layout */
4
4
 
5
- import { App as App$1, Breadcrumb, FloatButton, Result, Button, Dropdown, Space, Menu, Badge, Layout, message as message$1, Tabs, Typography, theme } from 'antd';
6
- import { classNames } from '@dimjs/utils/class-names/class-names';
7
- import { useEffect, useMemo, Fragment, Children, cloneElement, forwardRef, useState, useImperativeHandle, isValidElement, Suspense, useRef, memo, Component } from 'react';
8
- import { useParams, useLocation, useSearchParams, matchPath, Link, useNavigate, Routes, Route, Navigate, BrowserRouter } from 'react-router-dom';
9
- import { sessionStorageCache, getRunningEnv, ensureSlash as ensureSlash$1, removeSlash, getGlobalData, toLinkPath, isHttpUri, toArray, urlJoinMulti, urlJoin, isWindows, valueIsEqual, toLinkPathWithQuery, openNewWindow, treeToArray, cloneObject, getUuid, EventEmitter, treeFilter, arrayFindByLoosely, arrayFindIndexByLoosely, isUndefinedOrNull, localStorageCache } from '@flatbiz/utils';
5
+ import { useEffect, useMemo, Fragment, isValidElement, Suspense, useState, useRef, memo, Component, Children, cloneElement, forwardRef, useImperativeHandle } from 'react';
6
+ import { useMemoizedFn, useUpdateEffect, useAsyncEffect, useDebounceFn } from 'ahooks';
7
+ import { App as App$1, Result, Breadcrumb, FloatButton, Dropdown, Space, Button, Menu, Badge, Layout, message as message$1, Tabs, Typography, theme } from 'antd';
8
+ import { ConfigProviderWrapper } from '@flatbiz/antd/config-provider-wrapper';
9
+ import { FbaApp } from '@flatbiz/antd/fba-app';
10
+ import { getQueryString } from '@dimjs/utils/uri/get-query-string';
11
+ import { isArray } from '@dimjs/lang/is-array';
12
+ import { extend } from '@dimjs/utils/extend/extend';
13
+ import { useParams, useLocation, useSearchParams, matchPath, Link, Routes, Route, Navigate, useNavigate, BrowserRouter } from 'react-router-dom';
14
+ import { getRunningEnv, sessionStorageCache, ensureSlash as ensureSlash$1, removeSlash, getGlobalData, toLinkPath, isHttpUri, toArray, urlJoinMulti, urlJoin, valueIsEqual, toLinkPathWithQuery, openNewWindow, isWindows, treeToArray, cloneObject, getUuid, EventEmitter, loadScripts, treeEachAdaptive, treeFilter, arrayFindByLoosely, arrayFindIndexByLoosely, isUndefinedOrNull, localStorageCache } from '@flatbiz/utils';
15
+ import { get } from '@dimjs/utils/get/get';
10
16
  import { fbaHooks } from '@flatbiz/antd/fba-hooks';
17
+ import { jsx, jsxs } from 'react/jsx-runtime';
18
+ import { isString } from '@dimjs/lang/is-string';
19
+ import { classNames } from '@dimjs/utils/class-names/class-names';
11
20
  import { parse } from '@dimjs/utils/json/parse';
12
- import { useMemoizedFn, useUpdateEffect, useDebounceFn, useAsyncEffect } from 'ahooks';
13
- import { isArray } from '@dimjs/lang/is-array';
14
21
  import { pick } from '@dimjs/utils/pick/pick';
15
22
  import { paramStrToJson } from '@dimjs/utils/uri/param-str-to-json';
16
- import { jsx, jsxs } from 'react/jsx-runtime';
17
- import { ButtonWrapper } from '@flatbiz/antd/button-wrapper';
18
- import { isPromise } from '@dimjs/lang/is-promise';
19
23
  import { isHttpUrl } from '@dimjs/utils/uri/is-http-url';
20
24
  import { modifyQueryString } from '@dimjs/utils/uri/modify-query-string';
21
25
  import { uriParse } from '@dimjs/utils/uri/uri-parse';
22
- import { isUndefined } from '@dimjs/lang/is-undefined';
23
- import { isFragment } from 'react-is';
24
- import { createRoot } from 'react-dom/client';
25
- import { ConfigProviderWrapper } from '@flatbiz/antd/config-provider-wrapper';
26
- import { FbaApp } from '@flatbiz/antd/fba-app';
27
- import { getQueryString } from '@dimjs/utils/uri/get-query-string';
28
- import { extend } from '@dimjs/utils/extend/extend';
29
- import { get } from '@dimjs/utils/get/get';
30
- import { isString } from '@dimjs/lang/is-string';
31
26
  import _CloseOutlined from '@ant-design/icons/es/icons/CloseOutlined.js';
27
+ import { isUndefined } from '@dimjs/lang/is-undefined';
32
28
  import { useMediaQuery } from 'react-responsive';
33
29
  import { SvgHttpView } from '@flatbiz/antd/svg-http-view';
34
30
  import { findAncestors } from '@dimjs/utils/tree/find-ancestors';
@@ -45,17 +41,10 @@ import _CaretDownOutlined from '@ant-design/icons/es/icons/CaretDownOutlined.js'
45
41
  import _LoadingOutlined from '@ant-design/icons/es/icons/LoadingOutlined.js';
46
42
  import _RedoOutlined from '@ant-design/icons/es/icons/RedoOutlined.js';
47
43
  import { arrayRemove } from '@dimjs/utils/array/array-remove';
48
-
49
- var message;
50
- var notification;
51
- var modal;
52
- var useAntdApp = (function () {
53
- var staticFunction = App$1.useApp();
54
- message = staticFunction.message;
55
- modal = staticFunction.modal;
56
- notification = staticFunction.notification;
57
- return null;
58
- });
44
+ import { ButtonWrapper } from '@flatbiz/antd/button-wrapper';
45
+ import { isPromise } from '@dimjs/lang/is-promise';
46
+ import { isFragment } from 'react-is';
47
+ import { createRoot } from 'react-dom/client';
59
48
 
60
49
  function _arrayLikeToArray(r, a) {
61
50
  (null == a || a > r.length) && (a = r.length);
@@ -237,6 +226,91 @@ function _unsupportedIterableToArray(r, a) {
237
226
  }
238
227
  }
239
228
 
229
+ var AntdAppWrapper = function AntdAppWrapper(props) {
230
+ var theme = fbaHooks.useThemeToken();
231
+ var appProviderValue = props.appProviderValue;
232
+ var headerThemeConfig = appProviderValue.headerThemeConfig;
233
+ var sidebarThemeConfig = appProviderValue.sidebarThemeConfig;
234
+ var varStyleList = [{
235
+ '--header-bgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.bgColor
236
+ }, {
237
+ '--header-textColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.textColor
238
+ }, {
239
+ '--header-menuColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuColor
240
+ }, {
241
+ '--header-menuActiveTextColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuActiveTextColor
242
+ }, {
243
+ '--header-menuActiveBgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuActiveBgColor
244
+ }, {
245
+ '--header-menuSelectedBgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuSelectedBgColor
246
+ }, {
247
+ '--header-menuSelectedTextColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuSelectedTextColor
248
+ }, {
249
+ '--sidebar-bgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.bgColor
250
+ }, {
251
+ '--sidebar-menuActiveBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuActiveBgColor
252
+ }, {
253
+ '--sidebar-menuActiveTextColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuActiveTextColor
254
+ }, {
255
+ '--sidebar-menuSelectedBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSelectedBgColor
256
+ }, {
257
+ '--sidebar-menuSelectedTextColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSelectedTextColor
258
+ }, {
259
+ '--sidebar-menuSubMenuBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSubMenuBgColor
260
+ }, {
261
+ '--sidebar-menuColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuColor
262
+ }, {
263
+ '--color-primary': theme.colorPrimary
264
+ }];
265
+ if (appProviderValue.dark) {
266
+ varStyleList.push({
267
+ '--block-bg-color': get(appProviderValue, 'bgColorConfig.dark.blockBgColor', '#000')
268
+ });
269
+ varStyleList.push({
270
+ '--bg-color': get(appProviderValue, 'bgColorConfig.dark.bgColor', '#1b1a1a')
271
+ });
272
+ } else {
273
+ varStyleList.push({
274
+ '--block-bg-color': get(appProviderValue, 'bgColorConfig.light.blockBgColor', '#FFF')
275
+ });
276
+ varStyleList.push({
277
+ '--bg-color': get(appProviderValue, 'bgColorConfig.light.bgColor', '#F2F2F2')
278
+ });
279
+ }
280
+ var varStyleText = '';
281
+ varStyleList.forEach(function (item) {
282
+ var key = Object.keys(item)[0];
283
+ if (item[key]) {
284
+ varStyleText = varStyleText + "".concat(key, ":").concat(item[key], ";");
285
+ }
286
+ });
287
+ document.body.style.cssText = "".concat(document.body.style.cssText, ";").concat(varStyleText);
288
+ if (appProviderValue.dark) {
289
+ document.body.classList.remove('light-theme');
290
+ document.body.classList.add('dark-theme');
291
+ } else {
292
+ document.body.classList.remove('dark-theme');
293
+ document.body.classList.add('light-theme');
294
+ }
295
+ if (appProviderValue.compact) {
296
+ document.body.classList.add('compact-theme');
297
+ } else {
298
+ document.body.classList.remove('compact-theme');
299
+ }
300
+ return /*#__PURE__*/jsx(App$1, {
301
+ className: appProviderValue.className,
302
+ children: props.children
303
+ });
304
+ };
305
+
306
+ var NotFound = function NotFound() {
307
+ return /*#__PURE__*/jsx(Result, {
308
+ status: "404",
309
+ title: "404",
310
+ subTitle: "Sorry, \u60A8\u8BBF\u95EE\u7684\u5730\u5740\u4E0D\u5B58\u5728"
311
+ });
312
+ };
313
+
240
314
  var _fbaHooks$createCtx$1 = fbaHooks.createCtx(),
241
315
  _fbaHooks$createCtx2$1 = _slicedToArray(_fbaHooks$createCtx$1, 2),
242
316
  useLayoutCtx = _fbaHooks$createCtx2$1[0],
@@ -839,6 +913,31 @@ var Bread = function Bread(props) {
839
913
  });
840
914
  };
841
915
 
916
+ var Loader = function Loader(_ref) {
917
+ var _ref$spinning = _ref.spinning,
918
+ spinning = _ref$spinning === void 0 ? false : _ref$spinning,
919
+ _ref$fullScreen = _ref.fullScreen,
920
+ fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
921
+ _ref$style = _ref.style,
922
+ style = _ref$style === void 0 ? {} : _ref$style;
923
+ return /*#__PURE__*/jsx("div", {
924
+ style: style,
925
+ className: classNames('loader', {
926
+ hidden: !spinning,
927
+ fullScreen: fullScreen
928
+ }),
929
+ children: /*#__PURE__*/jsxs("div", {
930
+ className: "loader-wrapper",
931
+ children: [/*#__PURE__*/jsx("div", {
932
+ className: "loader-inner"
933
+ }), /*#__PURE__*/jsx("div", {
934
+ className: "loader-text",
935
+ children: "LOADING"
936
+ })]
937
+ })
938
+ });
939
+ };
940
+
842
941
  // export const urlJoin = (first: string, second: string) => {
843
942
  // return (first || '').replace(/\/$/, '') + '/' + (second || '').replace(/^\//, '');
844
943
  // };
@@ -1217,485 +1316,91 @@ var getSameProtocolUrl = function getSameProtocolUrl(url) {
1217
1316
  return "".concat(protocol, "//").concat(newUrl);
1218
1317
  };
1219
1318
 
1220
- var _excluded$3 = ["level"];
1319
+ var AppRoutes = function AppRoutes(props) {
1320
+ var getHideBreadsFlag = function getHideBreadsFlag() {
1321
+ var _props$hideBreadsPath;
1322
+ var target = (_props$hideBreadsPath = props.hideBreadsPathList) === null || _props$hideBreadsPath === void 0 ? void 0 : _props$hideBreadsPath.find(function (item) {
1323
+ if (props.layoutMode === 'iframe-tab') {
1324
+ return getIframeMainPurePath(item) == getIframeMainPurePath(location.pathname);
1325
+ }
1326
+ return getPurePath(item) == getPurePath(location.pathname);
1327
+ });
1328
+ if (target) return true;
1329
+ return !!getQueryString('hideBreads');
1330
+ };
1331
+ var hideBreads = getHideBreadsFlag();
1332
+ var routeList = props.routeList;
1333
+ var globbingRouteList = routeList.filter(function (item) {
1334
+ return valueIsEqual(item.path, ['*', '/*', '/*/']);
1335
+ });
1336
+ return /*#__PURE__*/jsx(Fragment, {
1337
+ children: /*#__PURE__*/jsxs(Routes, {
1338
+ children: [routeList.map(function (route, index) {
1339
+ var path = route.path,
1340
+ caseSensitive = route.caseSensitive,
1341
+ Element = route.element,
1342
+ redirect = route.redirect;
1343
+ var isGlobbing = valueIsEqual(path, ['*', '/*', '/*/']);
1344
+ if (isString(redirect)) {
1345
+ return /*#__PURE__*/jsx(Route, {
1346
+ path: path,
1347
+ element: /*#__PURE__*/jsx(Navigate, {
1348
+ to: toLinkPathWithQuery(redirect)
1349
+ })
1350
+ }, index);
1351
+ }
1352
+ if (Element) {
1353
+ var elementRender = null;
1354
+ if (/*#__PURE__*/isValidElement(Element)) {
1355
+ elementRender = Element;
1356
+ } else {
1357
+ var CElement = Element;
1358
+ elementRender = /*#__PURE__*/jsx(Suspense, {
1359
+ fallback: /*#__PURE__*/jsx(Loader, {
1360
+ spinning: true
1361
+ }),
1362
+ children: /*#__PURE__*/jsx(CElement, {})
1363
+ });
1364
+ }
1365
+ var tempPath = isGlobbing ? '*' : path.endsWith('/*') ? path : urlJoinMulti(path, '*');
1366
+ return /*#__PURE__*/jsx(Route, {
1367
+ path: tempPath,
1368
+ caseSensitive: caseSensitive,
1369
+ element: /*#__PURE__*/jsxs(Fragment, {
1370
+ children: [props.breads && props.hideDefaultBread !== true && !hideBreads ? /*#__PURE__*/jsx(Bread, {
1371
+ children: props.breadExtendRender
1372
+ }) : null, elementRender]
1373
+ })
1374
+ }, index);
1375
+ }
1376
+ return null;
1377
+ }), globbingRouteList.length === 0 ? /*#__PURE__*/jsx(Route, {
1378
+ path: "*",
1379
+ element: /*#__PURE__*/jsx(NotFound, {})
1380
+ }) : null]
1381
+ })
1382
+ });
1383
+ };
1384
+
1385
+ var message;
1386
+ var notification;
1387
+ var modal;
1388
+ var useAntdApp = (function () {
1389
+ var staticFunction = App$1.useApp();
1390
+ message = staticFunction.message;
1391
+ modal = staticFunction.modal;
1392
+ notification = staticFunction.notification;
1393
+ return null;
1394
+ });
1395
+
1396
+ var currentIsIframe = function currentIsIframe() {
1397
+ return self != top;
1398
+ };
1399
+
1221
1400
  /**
1222
- * 通过面包屑路径返回
1223
- * @param props
1224
- * @returns
1401
+ * Iframe Tab 模块使用
1225
1402
  * ```
1226
- * 1. breads 模块面包屑配置
1227
- * 2. level回退级别,如果传递数据未获取到路由配置,则取上一级
1228
- * 例如:-1,-2,-3
1229
- * 3. 为什么不能使用useNavigate(-1)
1230
- * 因为内部iframe和外部浏览器共用history历史记录,导致里外浏览器栈混乱
1231
- * 4. 什么场景使用
1232
- * 使用iframe tab的项目,在执行路由回退时使用
1233
- * 5. onClick返回 promise reject,则不会进行回退处理(V4.2.4)
1234
- * ```
1235
- */
1236
- var HistoryBackButton = function HistoryBackButton(props) {
1237
- var ctx = bootstrapCtx();
1238
- var level = props.level,
1239
- otherProps = _objectWithoutProperties(props, _excluded$3);
1240
- var _getHostUrlAndRouteBa = getHostUrlAndRouteBaseName(location.href),
1241
- routeBaseName = _getHostUrlAndRouteBa.routeBaseName;
1242
- var routerList = useBread(ctx.breads, routeBaseName);
1243
- var navigate = useNavigate();
1244
- var path = useMemo(function () {
1245
- var newLevel = level || -1;
1246
- if (routerList.length >= 2) {
1247
- var routerItem = routerList[routerList.length - 1 - Math.abs(newLevel)] || routerList[routerList.length - 2];
1248
- if (routerItem) {
1249
- return toLinkPath(routerItem.path, routerItem.query);
1250
- } else {
1251
- console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
1252
- return '';
1253
- }
1254
- }
1255
- console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
1256
- return '';
1257
- }, []);
1258
- var onBack = function onBack() {
1259
- if (path) {
1260
- navigate(toLinkPath(path));
1261
- } else {
1262
- console.warn("\u672A\u83B7\u53D6\u5230\u9762\u5305\u5C51\u6570\u636E\uFF0C\u65E0\u8FD4\u56DE\u94FE\u63A5");
1263
- }
1264
- };
1265
- var onClick = useMemoizedFn(function (event) {
1266
- var _props$onClick;
1267
- var result = props === null || props === void 0 || (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, event);
1268
- if (result && isPromise(result)) {
1269
- return result.then(function () {
1270
- onBack();
1271
- });
1272
- }
1273
- onBack();
1274
- return;
1275
- });
1276
- return /*#__PURE__*/jsx(ButtonWrapper, _objectSpread2(_objectSpread2({}, otherProps), {}, {
1277
- onClick: onClick,
1278
- children: props.children || '返回'
1279
- }));
1280
- };
1281
- var useHistoryBack = function useHistoryBack(props) {
1282
- var ctx = bootstrapCtx();
1283
- var level = (props === null || props === void 0 ? void 0 : props.level) || -1;
1284
- var _getHostUrlAndRouteBa2 = getHostUrlAndRouteBaseName(location.href),
1285
- routeBaseName = _getHostUrlAndRouteBa2.routeBaseName;
1286
- var routerList = useBread(ctx.breads, routeBaseName);
1287
- var path = useMemo(function () {
1288
- var newLevel = level;
1289
- if (routerList.length >= 2) {
1290
- var routerItem = routerList[routerList.length - 1 - Math.abs(newLevel)] || routerList[routerList.length - 2];
1291
- if (routerItem) {
1292
- return toLinkPath(routerItem.path, routerItem.query);
1293
- } else {
1294
- console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
1295
- return '';
1296
- }
1297
- }
1298
- console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
1299
- return '';
1300
- }, []);
1301
- return {
1302
- path: path
1303
- };
1304
- };
1305
-
1306
- var Loader = function Loader(_ref) {
1307
- var _ref$spinning = _ref.spinning,
1308
- spinning = _ref$spinning === void 0 ? false : _ref$spinning,
1309
- _ref$fullScreen = _ref.fullScreen,
1310
- fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
1311
- _ref$style = _ref.style,
1312
- style = _ref$style === void 0 ? {} : _ref$style;
1313
- return /*#__PURE__*/jsx("div", {
1314
- style: style,
1315
- className: classNames('loader', {
1316
- hidden: !spinning,
1317
- fullScreen: fullScreen
1318
- }),
1319
- children: /*#__PURE__*/jsxs("div", {
1320
- className: "loader-wrapper",
1321
- children: [/*#__PURE__*/jsx("div", {
1322
- className: "loader-inner"
1323
- }), /*#__PURE__*/jsx("div", {
1324
- className: "loader-text",
1325
- children: "LOADING"
1326
- })]
1327
- })
1328
- });
1329
- };
1330
-
1331
- /**
1332
- * 页面包装组件
1333
- * ```
1334
- * 1. 如果初始化面包屑被隐藏,在特殊页面级可以独立设置显示面包屑
1335
- * <Page bread={<Bread />}/>
1336
- * 2. 如果需要在 面包屑上添加按钮,初始化设置 bootstrap.hideDefaultBread = true,在需要按钮的页面上配置
1337
- * <Page bread={<Bread><Button>我是按钮</Button></Bread>}/>
1338
- * ```
1339
- * @param props
1340
- * @returns
1341
- */
1342
- var Page = function Page(props) {
1343
- var loading = props.loading;
1344
- var isWin = isWindows();
1345
- var className = classNames('page', {
1346
- 'page-loading': loading,
1347
- 'page-flex': !isUndefined(props.fullIndex),
1348
- 'page-windows': isWin
1349
- }, props.className);
1350
- var backTopTarget = useMemoizedFn(function () {
1351
- if (!isUndefined(props.fullIndex)) {
1352
- return document.querySelector('.page-full');
1353
- }
1354
- return document.querySelector('.page');
1355
- });
1356
- return /*#__PURE__*/jsxs(Fragment, {
1357
- children: [props.bread, /*#__PURE__*/jsxs("div", {
1358
- style: props.style,
1359
- className: className,
1360
- id: props.elementId,
1361
- children: [Children.map(props.children, function (item, index) {
1362
- if (index === props.fullIndex) {
1363
- var _item$props;
1364
- return /*#__PURE__*/jsx(Fragment, {
1365
- children: /*#__PURE__*/cloneElement(item, {
1366
- className: classNames('page-full', item === null || item === void 0 || (_item$props = item['props']) === null || _item$props === void 0 ? void 0 : _item$props.className)
1367
- })
1368
- }, index);
1369
- }
1370
- return /*#__PURE__*/jsx(Fragment, {
1371
- children: item
1372
- }, index);
1373
- }), /*#__PURE__*/jsx(FloatButton.BackTop, {
1374
- target: backTopTarget
1375
- }), loading && /*#__PURE__*/jsx(Loader, {
1376
- spinning: true
1377
- })]
1378
- })]
1379
- });
1380
- };
1381
-
1382
- var _fbaHooks$createCtx = fbaHooks.createCtx(),
1383
- _fbaHooks$createCtx2 = _slicedToArray(_fbaHooks$createCtx, 2),
1384
- usePageWrapperCtx = _fbaHooks$createCtx2[0],
1385
- PageWrapperCtxProvider = _fbaHooks$createCtx2[1];
1386
-
1387
- var _excluded$2 = ["respData"],
1388
- _excluded2 = ["serviceConfig", "isAsync", "errorRender"];
1389
- var PageContent$1 = function PageContent(props) {
1390
- var _props$children;
1391
- var respData = props.respData,
1392
- otherProps = _objectWithoutProperties(props, _excluded$2);
1393
- var children = typeof props.children === 'function' ? (_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.call(props, respData) : props.children;
1394
- if (isFragment(children)) {
1395
- var childrenList = Children.toArray(children.props.children);
1396
- return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({}, otherProps), {}, {
1397
- children: childrenList
1398
- }));
1399
- }
1400
- return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({}, otherProps), {}, {
1401
- children: children
1402
- }));
1403
- };
1404
-
1405
- /**
1406
- * 为Page内置接口处理流程组件,如果无全局初始化接口请求场景,请使用Page组件
1407
- * ```
1408
- * 包括
1409
- * 1. loading显示效果
1410
- * 2. error显示效果
1411
- * 3. 正常接口数据渲染
1412
- * ```
1413
- * @param props
1414
- * @returns
1415
- */
1416
- var PageWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
1417
- var serviceConfig = props.serviceConfig,
1418
- isAsync = props.isAsync,
1419
- errorRender = props.errorRender,
1420
- otherProps = _objectWithoutProperties(props, _excluded2);
1421
- var _useState = useState({
1422
- status: 'loading'
1423
- }),
1424
- _useState2 = _slicedToArray(_useState, 2),
1425
- result = _useState2[0],
1426
- setResult = _useState2[1];
1427
- var _useState3 = useState(false),
1428
- _useState4 = _slicedToArray(_useState3, 2),
1429
- againRefresh = _useState4[0],
1430
- setAgainRefresh = _useState4[1];
1431
- var onRequest = function onRequest() {
1432
- return new Promise(function ($return, $error) {
1433
- var params, _result;
1434
- var $Try_1_Post = function () {
1435
- try {
1436
- return $return(Promise.resolve());
1437
- } catch ($boundEx) {
1438
- return $error($boundEx);
1439
- }
1440
- };
1441
- var $Try_1_Catch = function (error) {
1442
- try {
1443
- setResult({
1444
- status: 'error',
1445
- respData: error
1446
- });
1447
- return $Try_1_Post();
1448
- } catch ($boundEx) {
1449
- return $error($boundEx);
1450
- }
1451
- };
1452
- try {
1453
- params = typeof serviceConfig.params === 'function' ? serviceConfig.params() : serviceConfig.params;
1454
- return Promise.resolve(serviceConfig.onRequest(params)).then(function ($await_2) {
1455
- try {
1456
- _result = $await_2;
1457
- setResult({
1458
- status: 'success',
1459
- respData: _result
1460
- });
1461
- return $Try_1_Post();
1462
- } catch ($boundEx) {
1463
- return $Try_1_Catch($boundEx);
1464
- }
1465
- }, $Try_1_Catch);
1466
- } catch (error) {
1467
- $Try_1_Catch(error);
1468
- }
1469
- });
1470
- };
1471
- fbaHooks.useEffectCustomAsync(onRequest, []);
1472
- var onReload = useMemoizedFn(function () {
1473
- setResult({
1474
- status: 'loading'
1475
- });
1476
- void onRequest();
1477
- });
1478
- var onRefresh = useMemoizedFn(function () {
1479
- setAgainRefresh(true);
1480
- onRequest().finally(function () {
1481
- setAgainRefresh(false);
1482
- });
1483
- });
1484
- useImperativeHandle(ref, function () {
1485
- return {
1486
- onRefresh: onRefresh,
1487
- onReload: onReload
1488
- };
1489
- });
1490
- if (result.status === 'error') {
1491
- var _result$respData;
1492
- if (errorRender) {
1493
- return errorRender(result.respData);
1494
- }
1495
- return /*#__PURE__*/jsx(Page, {
1496
- fullIndex: 0,
1497
- style: {
1498
- backgroundColor: '#fff'
1499
- },
1500
- children: /*#__PURE__*/jsx(Result, {
1501
- status: "error",
1502
- title: '数据获取异常',
1503
- subTitle: ((_result$respData = result.respData) === null || _result$respData === void 0 ? void 0 : _result$respData.message) || '数据请求异常',
1504
- extra: [/*#__PURE__*/jsx(Button, {
1505
- type: "primary",
1506
- onClick: onReload,
1507
- children: "\u91CD\u65B0\u83B7\u53D6"
1508
- }, "console")]
1509
- })
1510
- });
1511
- }
1512
- if (result.status === 'loading' && !isAsync) {
1513
- return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({
1514
- loading: true
1515
- }, otherProps), {}, {
1516
- children: /*#__PURE__*/jsx(Fragment, {})
1517
- }));
1518
- }
1519
- return /*#__PURE__*/jsxs(PageWrapperCtxProvider, {
1520
- value: {
1521
- onReload: onReload,
1522
- onRefresh: onRefresh
1523
- },
1524
- children: [againRefresh ? /*#__PURE__*/jsx(Loader, {
1525
- spinning: true,
1526
- style: {
1527
- backgroundColor: 'transparent'
1528
- }
1529
- }) : null, /*#__PURE__*/jsx(PageContent$1, _objectSpread2({
1530
- loading: result.status === 'loading',
1531
- respData: result.respData
1532
- }, otherProps))]
1533
- });
1534
- });
1535
- var usePageWrapper = function usePageWrapper() {
1536
- var ctx = usePageWrapperCtx();
1537
- return ctx;
1538
- };
1539
-
1540
- var AntdAppWrapper = function AntdAppWrapper(props) {
1541
- var theme = fbaHooks.useThemeToken();
1542
- var appProviderValue = props.appProviderValue;
1543
- var headerThemeConfig = appProviderValue.headerThemeConfig;
1544
- var sidebarThemeConfig = appProviderValue.sidebarThemeConfig;
1545
- var varStyleList = [{
1546
- '--header-bgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.bgColor
1547
- }, {
1548
- '--header-textColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.textColor
1549
- }, {
1550
- '--header-menuColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuColor
1551
- }, {
1552
- '--header-menuActiveTextColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuActiveTextColor
1553
- }, {
1554
- '--header-menuActiveBgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuActiveBgColor
1555
- }, {
1556
- '--header-menuSelectedBgColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuSelectedBgColor
1557
- }, {
1558
- '--header-menuSelectedTextColor': headerThemeConfig === null || headerThemeConfig === void 0 ? void 0 : headerThemeConfig.menuSelectedTextColor
1559
- }, {
1560
- '--sidebar-bgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.bgColor
1561
- }, {
1562
- '--sidebar-menuActiveBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuActiveBgColor
1563
- }, {
1564
- '--sidebar-menuActiveTextColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuActiveTextColor
1565
- }, {
1566
- '--sidebar-menuSelectedBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSelectedBgColor
1567
- }, {
1568
- '--sidebar-menuSelectedTextColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSelectedTextColor
1569
- }, {
1570
- '--sidebar-menuSubMenuBgColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuSubMenuBgColor
1571
- }, {
1572
- '--sidebar-menuColor': sidebarThemeConfig === null || sidebarThemeConfig === void 0 ? void 0 : sidebarThemeConfig.menuColor
1573
- }, {
1574
- '--color-primary': theme.colorPrimary
1575
- }];
1576
- if (appProviderValue.dark) {
1577
- varStyleList.push({
1578
- '--block-bg-color': get(appProviderValue, 'bgColorConfig.dark.blockBgColor', '#000')
1579
- });
1580
- varStyleList.push({
1581
- '--bg-color': get(appProviderValue, 'bgColorConfig.dark.bgColor', '#1b1a1a')
1582
- });
1583
- } else {
1584
- varStyleList.push({
1585
- '--block-bg-color': get(appProviderValue, 'bgColorConfig.light.blockBgColor', '#FFF')
1586
- });
1587
- varStyleList.push({
1588
- '--bg-color': get(appProviderValue, 'bgColorConfig.light.bgColor', '#F2F2F2')
1589
- });
1590
- }
1591
- var varStyleText = '';
1592
- varStyleList.forEach(function (item) {
1593
- var key = Object.keys(item)[0];
1594
- if (item[key]) {
1595
- varStyleText = varStyleText + "".concat(key, ":").concat(item[key], ";");
1596
- }
1597
- });
1598
- document.body.style.cssText = "".concat(document.body.style.cssText, ";").concat(varStyleText);
1599
- if (appProviderValue.dark) {
1600
- document.body.classList.remove('light-theme');
1601
- document.body.classList.add('dark-theme');
1602
- } else {
1603
- document.body.classList.remove('dark-theme');
1604
- document.body.classList.add('light-theme');
1605
- }
1606
- if (appProviderValue.compact) {
1607
- document.body.classList.add('compact-theme');
1608
- } else {
1609
- document.body.classList.remove('compact-theme');
1610
- }
1611
- return /*#__PURE__*/jsx(App$1, {
1612
- className: appProviderValue.className,
1613
- children: props.children
1614
- });
1615
- };
1616
-
1617
- var NotFound = function NotFound() {
1618
- return /*#__PURE__*/jsx(Result, {
1619
- status: "404",
1620
- title: "404",
1621
- subTitle: "Sorry, \u60A8\u8BBF\u95EE\u7684\u5730\u5740\u4E0D\u5B58\u5728"
1622
- });
1623
- };
1624
-
1625
- var AppRoutes = function AppRoutes(props) {
1626
- var getHideBreadsFlag = function getHideBreadsFlag() {
1627
- var _props$hideBreadsPath;
1628
- var target = (_props$hideBreadsPath = props.hideBreadsPathList) === null || _props$hideBreadsPath === void 0 ? void 0 : _props$hideBreadsPath.find(function (item) {
1629
- if (props.layoutMode === 'iframe-tab') {
1630
- return getIframeMainPurePath(item) == getIframeMainPurePath(location.pathname);
1631
- }
1632
- return getPurePath(item) == getPurePath(location.pathname);
1633
- });
1634
- if (target) return true;
1635
- return !!getQueryString('hideBreads');
1636
- };
1637
- var hideBreads = getHideBreadsFlag();
1638
- var routeList = props.routeList;
1639
- var globbingRouteList = routeList.filter(function (item) {
1640
- return valueIsEqual(item.path, ['*', '/*', '/*/']);
1641
- });
1642
- return /*#__PURE__*/jsx(Fragment, {
1643
- children: /*#__PURE__*/jsxs(Routes, {
1644
- children: [routeList.map(function (route, index) {
1645
- var path = route.path,
1646
- caseSensitive = route.caseSensitive,
1647
- Element = route.element,
1648
- redirect = route.redirect;
1649
- var isGlobbing = valueIsEqual(path, ['*', '/*', '/*/']);
1650
- if (isString(redirect)) {
1651
- return /*#__PURE__*/jsx(Route, {
1652
- path: path,
1653
- element: /*#__PURE__*/jsx(Navigate, {
1654
- to: toLinkPathWithQuery(redirect)
1655
- })
1656
- }, index);
1657
- }
1658
- if (Element) {
1659
- var elementRender = null;
1660
- if (/*#__PURE__*/isValidElement(Element)) {
1661
- elementRender = Element;
1662
- } else {
1663
- var CElement = Element;
1664
- elementRender = /*#__PURE__*/jsx(Suspense, {
1665
- fallback: /*#__PURE__*/jsx(Loader, {
1666
- spinning: true
1667
- }),
1668
- children: /*#__PURE__*/jsx(CElement, {})
1669
- });
1670
- }
1671
- var tempPath = isGlobbing ? '*' : path.endsWith('/*') ? path : urlJoinMulti(path, '*');
1672
- return /*#__PURE__*/jsx(Route, {
1673
- path: tempPath,
1674
- caseSensitive: caseSensitive,
1675
- element: /*#__PURE__*/jsxs(Fragment, {
1676
- children: [props.breads && props.hideDefaultBread !== true && !hideBreads ? /*#__PURE__*/jsx(Bread, {
1677
- children: props.breadExtendRender
1678
- }) : null, elementRender]
1679
- })
1680
- }, index);
1681
- }
1682
- return null;
1683
- }), globbingRouteList.length === 0 ? /*#__PURE__*/jsx(Route, {
1684
- path: "*",
1685
- element: /*#__PURE__*/jsx(NotFound, {})
1686
- }) : null]
1687
- })
1688
- });
1689
- };
1690
-
1691
- var currentIsIframe = function currentIsIframe() {
1692
- return self != top;
1693
- };
1694
-
1695
- /**
1696
- * Iframe Tab 模块使用
1697
- * ```
1698
- * 当Iframe Tab独立访问时,触发逻辑跳转正常访问页面(包含菜单)
1403
+ * 当Iframe Tab独立访问时,触发逻辑跳转正常访问页面(包含菜单)
1699
1404
  * ```
1700
1405
  */
1701
1406
  var IframeTabMode = function IframeTabMode(props) {
@@ -2860,6 +2565,10 @@ var SiderBar = function SiderBar() {
2860
2565
  _useState4 = _slicedToArray(_useState3, 2),
2861
2566
  menuBadgeMap = _useState4[0],
2862
2567
  setMenuBadgeMap = _useState4[1];
2568
+ var _useState5 = useState(),
2569
+ _useState6 = _slicedToArray(_useState5, 2),
2570
+ menusTreeListNew = _useState6[0],
2571
+ setMenusTreeListNew = _useState6[1];
2863
2572
  var menuItemActiveKeyRef = useRef();
2864
2573
  var changeMenuBadgeFn = useMemoizedFn(function (data) {
2865
2574
  var newData = [];
@@ -2887,13 +2596,72 @@ var SiderBar = function SiderBar() {
2887
2596
  menuPubSub.unsubscribe('changeMenuBadge', changeMenuBadgeFn);
2888
2597
  };
2889
2598
  }, [changeMenuBadgeFn]);
2599
+ useAsyncEffect(function () {
2600
+ return new Promise(function ($return, $error) {
2601
+ var menusTreeList, pinyinPro, newMenusTreeList;
2602
+ if (layoutCtx.sliderBarSearch) {
2603
+ return Promise.resolve(loadScripts({
2604
+ scriptUrls: ['https://oss.ly.com/statics/open/cdn/pinyin-pro@3.27.0/index.min.js'],
2605
+ checkFn: function checkFn() {
2606
+ return window['pinyinPro'] !== undefined;
2607
+ }
2608
+ })).then(function ($await_2) {
2609
+ try {
2610
+ menusTreeList = layoutCtx.siderBarMenus;
2611
+ pinyinPro = window['pinyinPro'];
2612
+ newMenusTreeList = treeEachAdaptive(menusTreeList, function (node) {
2613
+ var _node$name;
2614
+ var name = (_node$name = node.name) === null || _node$name === void 0 ? void 0 : _node$name.toLowerCase();
2615
+ var letterPinyinArray = pinyinPro.pinyin(name, {
2616
+ toneType: 'none',
2617
+ type: 'array'
2618
+ });
2619
+
2620
+ // 取出letterPinyinArray中每个元素的第一个字母
2621
+ var letterPinyinLetters = letterPinyinArray === null || letterPinyinArray === void 0 ? void 0 : letterPinyinArray.map(function (item) {
2622
+ return item.charAt(0);
2623
+ });
2624
+ var letterInitialPinyin = letterPinyinLetters === null || letterPinyinLetters === void 0 ? void 0 : letterPinyinLetters.join(''); // 拼音首字母拼音
2625
+
2626
+ var letterPinyin = letterPinyinArray === null || letterPinyinArray === void 0 ? void 0 : letterPinyinArray.join('');
2627
+ return _objectSpread2(_objectSpread2({}, node), {}, {
2628
+ letterPinyin: letterPinyin,
2629
+ letterInitialPinyin: letterInitialPinyin
2630
+ });
2631
+ });
2632
+ setMenusTreeListNew(newMenusTreeList);
2633
+ return $If_1.call(this);
2634
+ } catch ($boundEx) {
2635
+ return $error($boundEx);
2636
+ }
2637
+ }.bind(this), $error);
2638
+ } else {
2639
+ setMenusTreeListNew(layoutCtx.siderBarMenus);
2640
+ return $If_1.call(this);
2641
+ }
2642
+ function $If_1() {
2643
+ return $return();
2644
+ }
2645
+ });
2646
+ }, [layoutCtx.siderBarMenus, layoutCtx.sliderBarSearch]);
2647
+ console.log('xxxxx', menusTreeListNew);
2890
2648
  var antdMenuitems = useMemo(function () {
2891
- var menusTreeList = layoutCtx.siderBarMenus;
2892
- if (searchValue) {
2649
+ var menusTreeList = menusTreeListNew || [];
2650
+ var searchValueFt = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
2651
+ if (searchValueFt) {
2893
2652
  menusTreeList = treeFilter(cloneObject(menusTreeList), function (node) {
2894
- var _node$name;
2895
- var value = (_node$name = node.name) === null || _node$name === void 0 ? void 0 : _node$name.toLowerCase();
2896
- return value.indexOf(searchValue.toLowerCase()) >= 0;
2653
+ var _node$name2, _node$letterPinyin, _node$letterInitialPi;
2654
+ var value = (_node$name2 = node.name) === null || _node$name2 === void 0 ? void 0 : _node$name2.toLowerCase();
2655
+ if (value.indexOf(searchValueFt) >= 0) {
2656
+ return true;
2657
+ }
2658
+ if (((_node$letterPinyin = node.letterPinyin) === null || _node$letterPinyin === void 0 ? void 0 : _node$letterPinyin.indexOf(searchValueFt)) >= 0) {
2659
+ return true;
2660
+ }
2661
+ if (((_node$letterInitialPi = node.letterInitialPinyin) === null || _node$letterInitialPi === void 0 ? void 0 : _node$letterInitialPi.indexOf(searchValueFt)) >= 0) {
2662
+ return true;
2663
+ }
2664
+ return false;
2897
2665
  }, {
2898
2666
  childrenName: 'children'
2899
2667
  });
@@ -2969,7 +2737,7 @@ var SiderBar = function SiderBar() {
2969
2737
  });
2970
2738
  };
2971
2739
  return _getMenuItem(menusTreeList, 0);
2972
- }, [layoutCtx.siderBarMenus, layoutCtx.collapsed, searchValue, colorActive, textColor, menuBadgeMap]);
2740
+ }, [menusTreeListNew, searchValue, colorActive, textColor, layoutCtx.collapsed, menuBadgeMap]);
2973
2741
  var onMenuClick = useMemoizedFn(function (data) {
2974
2742
  if (!valueIsEqual(menuItemActiveKeyRef.current, data.key)) {
2975
2743
  var _layoutCtx$siderBarMe;
@@ -3013,10 +2781,10 @@ var SiderBar = function SiderBar() {
3013
2781
  }
3014
2782
  layoutCtx.onChangeOpendKeys(openKeys);
3015
2783
  });
3016
- var _useState5 = useState(0),
3017
- _useState6 = _slicedToArray(_useState5, 2),
3018
- refreshKey = _useState6[0],
3019
- setRefreshKey = _useState6[1];
2784
+ var _useState7 = useState(0),
2785
+ _useState8 = _slicedToArray(_useState7, 2),
2786
+ refreshKey = _useState8[0],
2787
+ setRefreshKey = _useState8[1];
3020
2788
  useEffect(function () {
3021
2789
  // 在操作shrink时,两种类型的Menu结构都缓存时,在切换shrink时会出现错误菜单闪屏(未找到更合适的解决方案,此处修改Menu key值后菜单重置可解决闪屏问题)
3022
2790
  setRefreshKey(Date.now());
@@ -3088,7 +2856,7 @@ var SiderBar = function SiderBar() {
3088
2856
  }),
3089
2857
  children: [/*#__PURE__*/jsx(InputWrapper, {
3090
2858
  allowClear: true,
3091
- placeholder: "\u641C\u7D22",
2859
+ placeholder: "\u62FC\u97F3\u9996\u5B57\u6BCD\u641C\u7D22",
3092
2860
  onChange: onSearchChange
3093
2861
  }), multipleOpen ? /*#__PURE__*/jsx("div", {
3094
2862
  style: {
@@ -3126,7 +2894,7 @@ var getIframeTabUid = function getIframeTabUid(prefix) {
3126
2894
  return "".concat(prefix, "_").concat(iframeId);
3127
2895
  };
3128
2896
 
3129
- var _excluded$1 = ["_isClosed"];
2897
+ var _excluded$3 = ["_isClosed"];
3130
2898
  var EventHandling = function EventHandling() {
3131
2899
  var navigate = useNavigate();
3132
2900
  var layoutCtx = useLayoutCtx();
@@ -3137,7 +2905,7 @@ var EventHandling = function EventHandling() {
3137
2905
  if (result.type === 'redirect_to_frame_layout_menu_item') {
3138
2906
  var _ref = result.data,
3139
2907
  _isClosed = _ref._isClosed,
3140
- iframeTabItem = _objectWithoutProperties(_ref, _excluded$1);
2908
+ iframeTabItem = _objectWithoutProperties(_ref, _excluded$3);
3141
2909
  var targetIndex = layoutCtx.iframeTabList.findIndex(function (item) {
3142
2910
  var _layoutCtx$iframeTabA;
3143
2911
  return valueIsEqual(item.id, (_layoutCtx$iframeTabA = layoutCtx.iframeTabActiveItem) === null || _layoutCtx$iframeTabA === void 0 ? void 0 : _layoutCtx$iframeTabA.id);
@@ -3272,7 +3040,7 @@ var IframePage = /*#__PURE__*/memo(IframePageInner, function (prevProps, nextPro
3272
3040
  return prevProps.iframeKey === nextProps.iframeKey;
3273
3041
  });
3274
3042
 
3275
- var PageContent = function PageContent() {
3043
+ var PageContent$1 = function PageContent() {
3276
3044
  var _useLayoutCtx = useLayoutCtx(),
3277
3045
  iframeTabList = _useLayoutCtx.iframeTabList,
3278
3046
  iframeTabBarExtra = _useLayoutCtx.iframeTabBarExtra,
@@ -3669,7 +3437,7 @@ var LayoutIFrame = function LayoutIFrame() {
3669
3437
  });
3670
3438
  }
3671
3439
  if (layoutCtx.multiFrameTabs) {
3672
- return /*#__PURE__*/jsx(PageContent, {});
3440
+ return /*#__PURE__*/jsx(PageContent$1, {});
3673
3441
  }
3674
3442
  if (layoutCtx.siderBarMaxMenuLevel) {
3675
3443
  return /*#__PURE__*/jsx(PageLevelContent, {});
@@ -3728,7 +3496,7 @@ var NormalRoutesTiming = function NormalRoutesTiming() {
3728
3496
  return /*#__PURE__*/jsx(Fragment, {});
3729
3497
  };
3730
3498
 
3731
- var _excluded = ["sidebarWidth", "componentSize", "locale", "logoPath", "headerThemeConfig", "sidebarThemeConfig", "completeMenus", "onIframeTabActiveEvent"];
3499
+ var _excluded$2 = ["sidebarWidth", "componentSize", "locale", "logoPath", "headerThemeConfig", "sidebarThemeConfig", "completeMenus", "onIframeTabActiveEvent"];
3732
3500
  var AppProvider = function AppProvider(props) {
3733
3501
  var navigate = useNavigate();
3734
3502
  var sidebarWidth = props.sidebarWidth,
@@ -3739,7 +3507,7 @@ var AppProvider = function AppProvider(props) {
3739
3507
  sidebarThemeConfig = props.sidebarThemeConfig,
3740
3508
  completeMenus = props.completeMenus,
3741
3509
  onIframeTabActiveEvent = props.onIframeTabActiveEvent,
3742
- options = _objectWithoutProperties(props, _excluded);
3510
+ options = _objectWithoutProperties(props, _excluded$2);
3743
3511
  var isIframeMain = options.layoutMode === 'iframe-main';
3744
3512
  var unMatchHiddenSiderBar = useMemo(function () {
3745
3513
  if (options.disableTopbarMenu) {
@@ -4716,129 +4484,424 @@ var BootstrapContent = function BootstrapContent(options) {
4716
4484
  space: {
4717
4485
  size: componentSize
4718
4486
  }
4719
- }, configProviderProps), {}, {
4720
- children: /*#__PURE__*/jsx(ContainerWrapper, {
4721
- children: /*#__PURE__*/jsx(BrowserRouter, {
4722
- basename: globalValue.routeBaseName,
4723
- children: /*#__PURE__*/jsx(BootstrapCtx, {
4724
- value: {
4725
- breads: breadList,
4726
- breadTitle: appProviderValue.breadTitle,
4727
- breadcrumbProps: appProviderValue.breadcrumbProps,
4728
- layoutMode: appProviderValue.layoutMode
4729
- },
4730
- children: /*#__PURE__*/jsx(AntdAppWrapper, {
4731
- appProviderValue: appProviderValue,
4732
- children: /*#__PURE__*/jsx(FbaApp, {
4733
- children: /*#__PURE__*/jsxs(ErrorBoundary, {
4734
- onError: options.onError,
4735
- onReset: options.onErrorReset,
4736
- FallbackComponent: options.ErrorFallback || ErrorFallback,
4737
- children: [layoutMode === 'iframe-main' ? /*#__PURE__*/jsx(IframeMainRegister, {}) : null, /*#__PURE__*/jsx(Container, {
4738
- layoutMode: appProviderValue.layoutMode,
4739
- MenuEmptyRender: appProviderValue.MenuEmptyRender,
4740
- menus: menus,
4741
- ignoreMenuEmptyJudge: appProviderValue.ignoreMenuEmptyJudge,
4742
- children: isNoLayout ? /*#__PURE__*/jsx(AppNoLayout, {
4743
- routeList: routeList,
4744
- layoutMode: layoutMode,
4745
- LayoutComponent: appProviderValue.LayoutComponent,
4746
- breadExtendRender: appProviderValue.breadExtendRender,
4747
- breads: appProviderValue.breads,
4748
- hideDefaultBread: appProviderValue.hideDefaultBread,
4749
- hideHeader: appProviderValue.hideHeader,
4750
- breadTitle: appProviderValue.breadTitle,
4751
- iframeTabAloneView: appProviderValue.iframeTabAloneView,
4752
- layoutPageClassName: appProviderValue.layoutPageClassName,
4753
- hideBreadsPathList: appProviderValue.hideBreadsPathList,
4754
- developmentEnvGuideConfigs: appProviderValue.developmentEnvGuideConfigs,
4755
- showProdEnvGuide: appProviderValue.showProdEnvGuide,
4756
- hidenEnvGuide: appProviderValue.hidenEnvGuide
4757
- }) : /*#__PURE__*/jsx(AppProvider, _objectSpread2({}, appProviderValue))
4758
- })]
4759
- })
4487
+ }, configProviderProps), {}, {
4488
+ children: /*#__PURE__*/jsx(ContainerWrapper, {
4489
+ children: /*#__PURE__*/jsx(BrowserRouter, {
4490
+ basename: globalValue.routeBaseName,
4491
+ children: /*#__PURE__*/jsx(BootstrapCtx, {
4492
+ value: {
4493
+ breads: breadList,
4494
+ breadTitle: appProviderValue.breadTitle,
4495
+ breadcrumbProps: appProviderValue.breadcrumbProps,
4496
+ layoutMode: appProviderValue.layoutMode
4497
+ },
4498
+ children: /*#__PURE__*/jsx(AntdAppWrapper, {
4499
+ appProviderValue: appProviderValue,
4500
+ children: /*#__PURE__*/jsx(FbaApp, {
4501
+ children: /*#__PURE__*/jsxs(ErrorBoundary, {
4502
+ onError: options.onError,
4503
+ onReset: options.onErrorReset,
4504
+ FallbackComponent: options.ErrorFallback || ErrorFallback,
4505
+ children: [layoutMode === 'iframe-main' ? /*#__PURE__*/jsx(IframeMainRegister, {}) : null, /*#__PURE__*/jsx(Container, {
4506
+ layoutMode: appProviderValue.layoutMode,
4507
+ MenuEmptyRender: appProviderValue.MenuEmptyRender,
4508
+ menus: menus,
4509
+ ignoreMenuEmptyJudge: appProviderValue.ignoreMenuEmptyJudge,
4510
+ children: isNoLayout ? /*#__PURE__*/jsx(AppNoLayout, {
4511
+ routeList: routeList,
4512
+ layoutMode: layoutMode,
4513
+ LayoutComponent: appProviderValue.LayoutComponent,
4514
+ breadExtendRender: appProviderValue.breadExtendRender,
4515
+ breads: appProviderValue.breads,
4516
+ hideDefaultBread: appProviderValue.hideDefaultBread,
4517
+ hideHeader: appProviderValue.hideHeader,
4518
+ breadTitle: appProviderValue.breadTitle,
4519
+ iframeTabAloneView: appProviderValue.iframeTabAloneView,
4520
+ layoutPageClassName: appProviderValue.layoutPageClassName,
4521
+ hideBreadsPathList: appProviderValue.hideBreadsPathList,
4522
+ developmentEnvGuideConfigs: appProviderValue.developmentEnvGuideConfigs,
4523
+ showProdEnvGuide: appProviderValue.showProdEnvGuide,
4524
+ hidenEnvGuide: appProviderValue.hidenEnvGuide
4525
+ }) : /*#__PURE__*/jsx(AppProvider, _objectSpread2({}, appProviderValue))
4526
+ })]
4527
+ })
4528
+ })
4529
+ })
4530
+ })
4531
+ })
4532
+ })
4533
+ }));
4534
+ };
4535
+
4536
+ var Bootstrap = function Bootstrap(options) {
4537
+ var _useState = useState(false),
4538
+ _useState2 = _slicedToArray(_useState, 2),
4539
+ renderFlag = _useState2[0],
4540
+ setRenderFlag = _useState2[1];
4541
+ var _useState3 = useState(''),
4542
+ _useState4 = _slicedToArray(_useState3, 2),
4543
+ errorMessage = _useState4[0],
4544
+ setErrorMessage = _useState4[1];
4545
+ useAsyncEffect(function () {
4546
+ return new Promise(function ($return, $error) {
4547
+ var globalData, apiBase, hostUrl;
4548
+ var $Try_1_Post = function () {
4549
+ try {
4550
+ return $return();
4551
+ } catch ($boundEx) {
4552
+ return $error($boundEx);
4553
+ }
4554
+ };
4555
+ var $Try_1_Catch = function (error) {
4556
+ try {
4557
+ setErrorMessage((error === null || error === void 0 ? void 0 : error['message']) || '获取初始加载数据失败');
4558
+ return $Try_1_Post();
4559
+ } catch ($boundEx) {
4560
+ return $error($boundEx);
4561
+ }
4562
+ };
4563
+ try {
4564
+ if (options.layoutMode === 'iframe-main') {
4565
+ window['__flat_iframe_parent_window'] = true;
4566
+ }
4567
+ if (options.getGlobalData) {
4568
+ return Promise.resolve(options.getGlobalData()).then(function ($await_3) {
4569
+ try {
4570
+ globalData = $await_3;
4571
+ if (globalData) {
4572
+ window['GLOBAL'] = globalData;
4573
+ }
4574
+ return $If_2.call(this);
4575
+ } catch ($boundEx) {
4576
+ return $Try_1_Catch($boundEx);
4577
+ }
4578
+ }.bind(this), $Try_1_Catch);
4579
+ }
4580
+ function $If_2() {
4581
+ apiBase = window['GLOBAL'].apiBase;
4582
+ if (apiBase) {
4583
+ window['GLOBAL'].apiBase = getSameProtocolUrl(apiBase);
4584
+ }
4585
+ hostUrl = window['GLOBAL'].hostUrl;
4586
+ if (hostUrl) {
4587
+ window['GLOBAL'].hostUrl = getSameProtocolUrl(hostUrl);
4588
+ }
4589
+ setRenderFlag(true);
4590
+ return $Try_1_Post();
4591
+ }
4592
+ return $If_2.call(this);
4593
+ } catch (error) {
4594
+ $Try_1_Catch(error);
4595
+ }
4596
+ });
4597
+ }, []);
4598
+ if (errorMessage) {
4599
+ return /*#__PURE__*/jsx(Result, {
4600
+ status: "error",
4601
+ title: errorMessage
4602
+ });
4603
+ }
4604
+ if (!renderFlag) {
4605
+ return /*#__PURE__*/jsx(Loader, {
4606
+ spinning: true
4607
+ });
4608
+ }
4609
+ return /*#__PURE__*/jsx(BootstrapContent, _objectSpread2({}, options));
4610
+ };
4611
+
4612
+ var _excluded$1 = ["level"];
4613
+ /**
4614
+ * 通过面包屑路径返回
4615
+ * @param props
4616
+ * @returns
4617
+ * ```
4618
+ * 1. breads 模块面包屑配置
4619
+ * 2. level回退级别,如果传递数据未获取到路由配置,则取上一级
4620
+ * 例如:-1,-2,-3
4621
+ * 3. 为什么不能使用useNavigate(-1)
4622
+ * 因为内部iframe和外部浏览器共用history历史记录,导致里外浏览器栈混乱
4623
+ * 4. 什么场景使用
4624
+ * 使用iframe tab的项目,在执行路由回退时使用
4625
+ * 5. onClick返回 promise reject,则不会进行回退处理(V4.2.4)
4626
+ * ```
4627
+ */
4628
+ var HistoryBackButton = function HistoryBackButton(props) {
4629
+ var ctx = bootstrapCtx();
4630
+ var level = props.level,
4631
+ otherProps = _objectWithoutProperties(props, _excluded$1);
4632
+ var _getHostUrlAndRouteBa = getHostUrlAndRouteBaseName(location.href),
4633
+ routeBaseName = _getHostUrlAndRouteBa.routeBaseName;
4634
+ var routerList = useBread(ctx.breads, routeBaseName);
4635
+ var navigate = useNavigate();
4636
+ var path = useMemo(function () {
4637
+ var newLevel = level || -1;
4638
+ if (routerList.length >= 2) {
4639
+ var routerItem = routerList[routerList.length - 1 - Math.abs(newLevel)] || routerList[routerList.length - 2];
4640
+ if (routerItem) {
4641
+ return toLinkPath(routerItem.path, routerItem.query);
4642
+ } else {
4643
+ console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
4644
+ return '';
4645
+ }
4646
+ }
4647
+ console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
4648
+ return '';
4649
+ }, []);
4650
+ var onBack = function onBack() {
4651
+ if (path) {
4652
+ navigate(toLinkPath(path));
4653
+ } else {
4654
+ console.warn("\u672A\u83B7\u53D6\u5230\u9762\u5305\u5C51\u6570\u636E\uFF0C\u65E0\u8FD4\u56DE\u94FE\u63A5");
4655
+ }
4656
+ };
4657
+ var onClick = useMemoizedFn(function (event) {
4658
+ var _props$onClick;
4659
+ var result = props === null || props === void 0 || (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props, event);
4660
+ if (result && isPromise(result)) {
4661
+ return result.then(function () {
4662
+ onBack();
4663
+ });
4664
+ }
4665
+ onBack();
4666
+ return;
4667
+ });
4668
+ return /*#__PURE__*/jsx(ButtonWrapper, _objectSpread2(_objectSpread2({}, otherProps), {}, {
4669
+ onClick: onClick,
4670
+ children: props.children || '返回'
4671
+ }));
4672
+ };
4673
+ var useHistoryBack = function useHistoryBack(props) {
4674
+ var ctx = bootstrapCtx();
4675
+ var level = (props === null || props === void 0 ? void 0 : props.level) || -1;
4676
+ var _getHostUrlAndRouteBa2 = getHostUrlAndRouteBaseName(location.href),
4677
+ routeBaseName = _getHostUrlAndRouteBa2.routeBaseName;
4678
+ var routerList = useBread(ctx.breads, routeBaseName);
4679
+ var path = useMemo(function () {
4680
+ var newLevel = level;
4681
+ if (routerList.length >= 2) {
4682
+ var routerItem = routerList[routerList.length - 1 - Math.abs(newLevel)] || routerList[routerList.length - 2];
4683
+ if (routerItem) {
4684
+ return toLinkPath(routerItem.path, routerItem.query);
4685
+ } else {
4686
+ console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
4687
+ return '';
4688
+ }
4689
+ }
4690
+ console.warn("\u672A\u83B7\u53D6\u5230\u3010level\uFF1A".concat(newLevel, "\u3011\u9762\u5305\u5C51\u6570\u636E"));
4691
+ return '';
4692
+ }, []);
4693
+ return {
4694
+ path: path
4695
+ };
4696
+ };
4697
+
4698
+ /**
4699
+ * 页面包装组件
4700
+ * ```
4701
+ * 1. 如果初始化面包屑被隐藏,在特殊页面级可以独立设置显示面包屑
4702
+ * <Page bread={<Bread />}/>
4703
+ * 2. 如果需要在 面包屑上添加按钮,初始化设置 bootstrap.hideDefaultBread = true,在需要按钮的页面上配置
4704
+ * <Page bread={<Bread><Button>我是按钮</Button></Bread>}/>
4705
+ * ```
4706
+ * @param props
4707
+ * @returns
4708
+ */
4709
+ var Page = function Page(props) {
4710
+ var loading = props.loading;
4711
+ var isWin = isWindows();
4712
+ var className = classNames('page', {
4713
+ 'page-loading': loading,
4714
+ 'page-flex': !isUndefined(props.fullIndex),
4715
+ 'page-windows': isWin
4716
+ }, props.className);
4717
+ var backTopTarget = useMemoizedFn(function () {
4718
+ if (!isUndefined(props.fullIndex)) {
4719
+ return document.querySelector('.page-full');
4720
+ }
4721
+ return document.querySelector('.page');
4722
+ });
4723
+ return /*#__PURE__*/jsxs(Fragment, {
4724
+ children: [props.bread, /*#__PURE__*/jsxs("div", {
4725
+ style: props.style,
4726
+ className: className,
4727
+ id: props.elementId,
4728
+ children: [Children.map(props.children, function (item, index) {
4729
+ if (index === props.fullIndex) {
4730
+ var _item$props;
4731
+ return /*#__PURE__*/jsx(Fragment, {
4732
+ children: /*#__PURE__*/cloneElement(item, {
4733
+ className: classNames('page-full', item === null || item === void 0 || (_item$props = item['props']) === null || _item$props === void 0 ? void 0 : _item$props.className)
4760
4734
  })
4761
- })
4762
- })
4763
- })
4764
- })
4735
+ }, index);
4736
+ }
4737
+ return /*#__PURE__*/jsx(Fragment, {
4738
+ children: item
4739
+ }, index);
4740
+ }), /*#__PURE__*/jsx(FloatButton.BackTop, {
4741
+ target: backTopTarget
4742
+ }), loading && /*#__PURE__*/jsx(Loader, {
4743
+ spinning: true
4744
+ })]
4745
+ })]
4746
+ });
4747
+ };
4748
+
4749
+ var _fbaHooks$createCtx = fbaHooks.createCtx(),
4750
+ _fbaHooks$createCtx2 = _slicedToArray(_fbaHooks$createCtx, 2),
4751
+ usePageWrapperCtx = _fbaHooks$createCtx2[0],
4752
+ PageWrapperCtxProvider = _fbaHooks$createCtx2[1];
4753
+
4754
+ var _excluded = ["respData"],
4755
+ _excluded2 = ["serviceConfig", "isAsync", "errorRender"];
4756
+ var PageContent = function PageContent(props) {
4757
+ var _props$children;
4758
+ var respData = props.respData,
4759
+ otherProps = _objectWithoutProperties(props, _excluded);
4760
+ var children = typeof props.children === 'function' ? (_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.call(props, respData) : props.children;
4761
+ if (isFragment(children)) {
4762
+ var childrenList = Children.toArray(children.props.children);
4763
+ return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({}, otherProps), {}, {
4764
+ children: childrenList
4765
+ }));
4766
+ }
4767
+ return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({}, otherProps), {}, {
4768
+ children: children
4765
4769
  }));
4766
4770
  };
4767
4771
 
4768
- var Bootstrap = function Bootstrap(options) {
4769
- var _useState = useState(false),
4772
+ /**
4773
+ * 为Page内置接口处理流程组件,如果无全局初始化接口请求场景,请使用Page组件
4774
+ * ```
4775
+ * 包括
4776
+ * 1. loading显示效果
4777
+ * 2. error显示效果
4778
+ * 3. 正常接口数据渲染
4779
+ * ```
4780
+ * @param props
4781
+ * @returns
4782
+ */
4783
+ var PageWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
4784
+ var serviceConfig = props.serviceConfig,
4785
+ isAsync = props.isAsync,
4786
+ errorRender = props.errorRender,
4787
+ otherProps = _objectWithoutProperties(props, _excluded2);
4788
+ var _useState = useState({
4789
+ status: 'loading'
4790
+ }),
4770
4791
  _useState2 = _slicedToArray(_useState, 2),
4771
- renderFlag = _useState2[0],
4772
- setRenderFlag = _useState2[1];
4773
- var _useState3 = useState(''),
4792
+ result = _useState2[0],
4793
+ setResult = _useState2[1];
4794
+ var _useState3 = useState(false),
4774
4795
  _useState4 = _slicedToArray(_useState3, 2),
4775
- errorMessage = _useState4[0],
4776
- setErrorMessage = _useState4[1];
4777
- useAsyncEffect(function () {
4796
+ againRefresh = _useState4[0],
4797
+ setAgainRefresh = _useState4[1];
4798
+ var onRequest = function onRequest() {
4778
4799
  return new Promise(function ($return, $error) {
4779
- var globalData, apiBase, hostUrl;
4800
+ var params, _result;
4780
4801
  var $Try_1_Post = function () {
4781
4802
  try {
4782
- return $return();
4803
+ return $return(Promise.resolve());
4783
4804
  } catch ($boundEx) {
4784
4805
  return $error($boundEx);
4785
4806
  }
4786
4807
  };
4787
4808
  var $Try_1_Catch = function (error) {
4788
4809
  try {
4789
- setErrorMessage((error === null || error === void 0 ? void 0 : error['message']) || '获取初始加载数据失败');
4810
+ setResult({
4811
+ status: 'error',
4812
+ respData: error
4813
+ });
4790
4814
  return $Try_1_Post();
4791
4815
  } catch ($boundEx) {
4792
4816
  return $error($boundEx);
4793
4817
  }
4794
4818
  };
4795
4819
  try {
4796
- if (options.layoutMode === 'iframe-main') {
4797
- window['__flat_iframe_parent_window'] = true;
4798
- }
4799
- if (options.getGlobalData) {
4800
- return Promise.resolve(options.getGlobalData()).then(function ($await_3) {
4801
- try {
4802
- globalData = $await_3;
4803
- if (globalData) {
4804
- window['GLOBAL'] = globalData;
4805
- }
4806
- return $If_2.call(this);
4807
- } catch ($boundEx) {
4808
- return $Try_1_Catch($boundEx);
4809
- }
4810
- }.bind(this), $Try_1_Catch);
4811
- }
4812
- function $If_2() {
4813
- apiBase = window['GLOBAL'].apiBase;
4814
- if (apiBase) {
4815
- window['GLOBAL'].apiBase = getSameProtocolUrl(apiBase);
4816
- }
4817
- hostUrl = window['GLOBAL'].hostUrl;
4818
- if (hostUrl) {
4819
- window['GLOBAL'].hostUrl = getSameProtocolUrl(hostUrl);
4820
+ params = typeof serviceConfig.params === 'function' ? serviceConfig.params() : serviceConfig.params;
4821
+ return Promise.resolve(serviceConfig.onRequest(params)).then(function ($await_2) {
4822
+ try {
4823
+ _result = $await_2;
4824
+ setResult({
4825
+ status: 'success',
4826
+ respData: _result
4827
+ });
4828
+ return $Try_1_Post();
4829
+ } catch ($boundEx) {
4830
+ return $Try_1_Catch($boundEx);
4820
4831
  }
4821
- setRenderFlag(true);
4822
- return $Try_1_Post();
4823
- }
4824
- return $If_2.call(this);
4832
+ }, $Try_1_Catch);
4825
4833
  } catch (error) {
4826
4834
  $Try_1_Catch(error);
4827
4835
  }
4828
4836
  });
4829
- }, []);
4830
- if (errorMessage) {
4831
- return /*#__PURE__*/jsx(Result, {
4832
- status: "error",
4833
- title: errorMessage
4837
+ };
4838
+ fbaHooks.useEffectCustomAsync(onRequest, []);
4839
+ var onReload = useMemoizedFn(function () {
4840
+ setResult({
4841
+ status: 'loading'
4834
4842
  });
4835
- }
4836
- if (!renderFlag) {
4837
- return /*#__PURE__*/jsx(Loader, {
4838
- spinning: true
4843
+ void onRequest();
4844
+ });
4845
+ var onRefresh = useMemoizedFn(function () {
4846
+ setAgainRefresh(true);
4847
+ onRequest().finally(function () {
4848
+ setAgainRefresh(false);
4849
+ });
4850
+ });
4851
+ useImperativeHandle(ref, function () {
4852
+ return {
4853
+ onRefresh: onRefresh,
4854
+ onReload: onReload
4855
+ };
4856
+ });
4857
+ if (result.status === 'error') {
4858
+ var _result$respData;
4859
+ if (errorRender) {
4860
+ return errorRender(result.respData);
4861
+ }
4862
+ return /*#__PURE__*/jsx(Page, {
4863
+ fullIndex: 0,
4864
+ style: {
4865
+ backgroundColor: '#fff'
4866
+ },
4867
+ children: /*#__PURE__*/jsx(Result, {
4868
+ status: "error",
4869
+ title: '数据获取异常',
4870
+ subTitle: ((_result$respData = result.respData) === null || _result$respData === void 0 ? void 0 : _result$respData.message) || '数据请求异常',
4871
+ extra: [/*#__PURE__*/jsx(Button, {
4872
+ type: "primary",
4873
+ onClick: onReload,
4874
+ children: "\u91CD\u65B0\u83B7\u53D6"
4875
+ }, "console")]
4876
+ })
4839
4877
  });
4840
4878
  }
4841
- return /*#__PURE__*/jsx(BootstrapContent, _objectSpread2({}, options));
4879
+ if (result.status === 'loading' && !isAsync) {
4880
+ return /*#__PURE__*/jsx(Page, _objectSpread2(_objectSpread2({
4881
+ loading: true
4882
+ }, otherProps), {}, {
4883
+ children: /*#__PURE__*/jsx(Fragment, {})
4884
+ }));
4885
+ }
4886
+ return /*#__PURE__*/jsxs(PageWrapperCtxProvider, {
4887
+ value: {
4888
+ onReload: onReload,
4889
+ onRefresh: onRefresh
4890
+ },
4891
+ children: [againRefresh ? /*#__PURE__*/jsx(Loader, {
4892
+ spinning: true,
4893
+ style: {
4894
+ backgroundColor: 'transparent'
4895
+ }
4896
+ }) : null, /*#__PURE__*/jsx(PageContent, _objectSpread2({
4897
+ loading: result.status === 'loading',
4898
+ respData: result.respData
4899
+ }, otherProps))]
4900
+ });
4901
+ });
4902
+ var usePageWrapper = function usePageWrapper() {
4903
+ var ctx = usePageWrapperCtx();
4904
+ return ctx;
4842
4905
  };
4843
4906
 
4844
4907
  /**
@@ -4862,5 +4925,5 @@ var onUpdateTheme = function onUpdateTheme(theme) {
4862
4925
  });
4863
4926
  };
4864
4927
 
4865
- export { Bread, HistoryBackButton, LayoutPage, Page, PageWrapper, bootstrap, getIframeTabUid, menuPubSub, message, modal, notification, onUpdateTheme, useHistoryBack, useIframe, useIframeTabActive, usePageWrapper, useRefreshRegisterIframeTab, useRegisterRefreshCurrentIframeTab };
4928
+ export { Bootstrap, Bread, HistoryBackButton, LayoutPage, Page, PageWrapper, bootstrap, getIframeTabUid, menuPubSub, message, modal, notification, onUpdateTheme, useHistoryBack, useIframe, useIframeTabActive, usePageWrapper, useRefreshRegisterIframeTab, useRegisterRefreshCurrentIframeTab };
4866
4929
  //# sourceMappingURL=index.js.map