@flatbiz/pro-layout 5.2.10 → 5.2.11

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
@@ -11,7 +11,7 @@ import { getQueryString } from '@dimjs/utils/uri/get-query-string';
11
11
  import { isArray } from '@dimjs/lang/is-array';
12
12
  import { extend } from '@dimjs/utils/extend/extend';
13
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';
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, treeNodeParentsList, arrayFindByLoosely, arrayFindIndexByLoosely, isUndefinedOrNull, localStorageCache } from '@flatbiz/utils';
15
15
  import { get } from '@dimjs/utils/get/get';
16
16
  import { fbaHooks } from '@flatbiz/antd/fba-hooks';
17
17
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -2548,7 +2548,7 @@ var MenuNoChildrenTextView = function MenuNoChildrenTextView(props) {
2548
2548
 
2549
2549
  var Sider = Layout.Sider;
2550
2550
  var SiderBar = function SiderBar() {
2551
- var _layoutCtx$sidebarThe, _layoutCtx$sidebarThe2, _layoutCtx$sidebarThe3, _layoutCtx$sidebarThe4, _layoutCtx$sidebarThe5, _layoutCtx$sidebarThe6, _layoutCtx$sidebarThe7, _layoutCtx$sidebarThe8, _layoutCtx$sidebarThe9, _layoutCtx$sidebarThe0, _layoutCtx$sidebarThe1, _layoutCtx$sidebarThe10, _layoutCtx$sidebarThe11, _layoutCtx$sidebarThe12, _layoutCtx$sidebarThe13;
2551
+ var _layoutCtx$sidebarThe, _layoutCtx$sidebarThe2, _layoutCtx$sidebarThe3, _layoutCtx$sidebarThe4, _layoutCtx$siderBarMe2, _layoutCtx$sidebarThe5, _layoutCtx$sidebarThe6, _layoutCtx$sidebarThe7, _layoutCtx$sidebarThe8, _layoutCtx$sidebarThe9, _layoutCtx$sidebarThe0, _layoutCtx$sidebarThe1, _layoutCtx$sidebarThe10, _layoutCtx$sidebarThe11, _layoutCtx$sidebarThe12, _layoutCtx$sidebarThe13;
2552
2552
  var _useState = useState(),
2553
2553
  _useState2 = _slicedToArray(_useState, 2),
2554
2554
  searchValue = _useState2[0],
@@ -2644,7 +2644,6 @@ var SiderBar = function SiderBar() {
2644
2644
  }
2645
2645
  });
2646
2646
  }, [layoutCtx.siderBarMenus, layoutCtx.sliderBarSearch]);
2647
- console.log('xxxxx', menusTreeListNew);
2648
2647
  var antdMenuitems = useMemo(function () {
2649
2648
  var menusTreeList = menusTreeListNew || [];
2650
2649
  var searchValueFt = searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase();
@@ -2823,6 +2822,14 @@ var SiderBar = function SiderBar() {
2823
2822
  trailing: false
2824
2823
  }),
2825
2824
  onMouseEnter = _useDebounceFn.run;
2825
+ console.log('layoutCtx', layoutCtx.opendKeys, (_layoutCtx$siderBarMe2 = layoutCtx.siderBarMenuActiveItem) === null || _layoutCtx$siderBarMe2 === void 0 ? void 0 : _layoutCtx$siderBarMe2.id);
2826
+ var onChangeTargetKeys = useMemoizedFn(function (activeId) {
2827
+ var parentsList = treeNodeParentsList(activeId, menusTreeListNew || [], false, {
2828
+ value: 'id',
2829
+ children: 'children'
2830
+ });
2831
+ layoutCtx.onChangeOpendKeys(parentsList);
2832
+ });
2826
2833
  return /*#__PURE__*/jsxs(Sider, {
2827
2834
  theme: "light",
2828
2835
  className: "flatbiz-layout-sider",
@@ -2857,21 +2864,38 @@ var SiderBar = function SiderBar() {
2857
2864
  children: [/*#__PURE__*/jsx(InputWrapper, {
2858
2865
  allowClear: true,
2859
2866
  placeholder: "\u62FC\u97F3\u9996\u5B57\u6BCD\u641C\u7D22",
2860
- onChange: onSearchChange
2867
+ onChange: onSearchChange,
2868
+ value: searchValue
2861
2869
  }), multipleOpen ? /*#__PURE__*/jsx("div", {
2862
2870
  style: {
2863
2871
  marginLeft: 10
2864
2872
  },
2865
2873
  children: /*#__PURE__*/jsx(IconWrapper, {
2866
2874
  onClick: function onClick() {
2867
- layoutCtx.onChangeOpendKeys([]);
2875
+ var _layoutCtx$siderBarMe3, _layoutCtx$opendKeys;
2876
+ var activeId = (_layoutCtx$siderBarMe3 = layoutCtx.siderBarMenuActiveItem) === null || _layoutCtx$siderBarMe3 === void 0 ? void 0 : _layoutCtx$siderBarMe3.id;
2877
+ if (!activeId) {
2878
+ layoutCtx.onChangeOpendKeys([]);
2879
+ return;
2880
+ }
2881
+ if (searchValue) {
2882
+ setSearchValue('');
2883
+ onChangeTargetKeys(activeId);
2884
+ return;
2885
+ }
2886
+ if ((_layoutCtx$opendKeys = layoutCtx.opendKeys) !== null && _layoutCtx$opendKeys !== void 0 && _layoutCtx$opendKeys.length) {
2887
+ layoutCtx.onChangeOpendKeys([]);
2888
+ } else {
2889
+ onChangeTargetKeys(activeId);
2890
+ }
2868
2891
  },
2869
2892
  size: "small",
2870
2893
  icon: /*#__PURE__*/jsx(SvgHttpView, {
2871
- svgPath: "lucide/fold-vertical",
2872
- width: 18,
2873
- height: 18
2894
+ svgPath: "ionic/swap-vertical-outline",
2895
+ width: 15,
2896
+ height: 15
2874
2897
  })
2898
+ //
2875
2899
  })
2876
2900
  }) : null]
2877
2901
  }) : null, /*#__PURE__*/jsx(Menu, _objectSpread2(_objectSpread2({}, menuProps), {}, {