@flatbiz/pro-layout 5.2.10 → 5.2.12

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';
@@ -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,15 @@ var SiderBar = function SiderBar() {
2823
2822
  trailing: false
2824
2823
  }),
2825
2824
  onMouseEnter = _useDebounceFn.run;
2825
+ var onChangeTargetKeys = useMemoizedFn(function (activeId) {
2826
+ var parentsList = treeNodeParentsList(activeId, menusTreeListNew || [], false, {
2827
+ value: 'id',
2828
+ children: 'children'
2829
+ });
2830
+ layoutCtx.onChangeOpendKeys(parentsList.map(function (item) {
2831
+ return String(item);
2832
+ }));
2833
+ });
2826
2834
  return /*#__PURE__*/jsxs(Sider, {
2827
2835
  theme: "light",
2828
2836
  className: "flatbiz-layout-sider",
@@ -2857,21 +2865,38 @@ var SiderBar = function SiderBar() {
2857
2865
  children: [/*#__PURE__*/jsx(InputWrapper, {
2858
2866
  allowClear: true,
2859
2867
  placeholder: "\u62FC\u97F3\u9996\u5B57\u6BCD\u641C\u7D22",
2860
- onChange: onSearchChange
2868
+ onChange: onSearchChange,
2869
+ value: searchValue
2861
2870
  }), multipleOpen ? /*#__PURE__*/jsx("div", {
2862
2871
  style: {
2863
2872
  marginLeft: 10
2864
2873
  },
2865
2874
  children: /*#__PURE__*/jsx(IconWrapper, {
2866
2875
  onClick: function onClick() {
2867
- layoutCtx.onChangeOpendKeys([]);
2876
+ var _layoutCtx$siderBarMe2, _layoutCtx$opendKeys;
2877
+ var activeId = (_layoutCtx$siderBarMe2 = layoutCtx.siderBarMenuActiveItem) === null || _layoutCtx$siderBarMe2 === void 0 ? void 0 : _layoutCtx$siderBarMe2.id;
2878
+ if (!activeId) {
2879
+ layoutCtx.onChangeOpendKeys([]);
2880
+ return;
2881
+ }
2882
+ if (searchValue) {
2883
+ setSearchValue('');
2884
+ onChangeTargetKeys(activeId);
2885
+ return;
2886
+ }
2887
+ if ((_layoutCtx$opendKeys = layoutCtx.opendKeys) !== null && _layoutCtx$opendKeys !== void 0 && _layoutCtx$opendKeys.length) {
2888
+ layoutCtx.onChangeOpendKeys([]);
2889
+ } else {
2890
+ onChangeTargetKeys(activeId);
2891
+ }
2868
2892
  },
2869
2893
  size: "small",
2870
2894
  icon: /*#__PURE__*/jsx(SvgHttpView, {
2871
- svgPath: "lucide/fold-vertical",
2872
- width: 18,
2873
- height: 18
2895
+ svgPath: "ionic/swap-vertical-outline",
2896
+ width: 15,
2897
+ height: 15
2874
2898
  })
2899
+ //
2875
2900
  })
2876
2901
  }) : null]
2877
2902
  }) : null, /*#__PURE__*/jsx(Menu, _objectSpread2(_objectSpread2({}, menuProps), {}, {