@tker-react/layout 0.2.8 → 0.2.9

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.mts CHANGED
@@ -55,7 +55,6 @@ interface TabAdapterProps {
55
55
  onClose: (path: string) => void;
56
56
  onCloseOther: (path?: string) => void;
57
57
  onCloseAll: () => void;
58
- onRefresh: () => void;
59
58
  onSetFixed: (path: string, fixed: boolean) => void;
60
59
  }
61
60
  interface UserAvatarAdapterProps {
package/dist/index.d.ts CHANGED
@@ -55,7 +55,6 @@ interface TabAdapterProps {
55
55
  onClose: (path: string) => void;
56
56
  onCloseOther: (path?: string) => void;
57
57
  onCloseAll: () => void;
58
- onRefresh: () => void;
59
58
  onSetFixed: (path: string, fixed: boolean) => void;
60
59
  }
61
60
  interface UserAvatarAdapterProps {
package/dist/index.mjs CHANGED
@@ -357,7 +357,6 @@ function LayoutContent({ children }) {
357
357
  const isTopMenu = layoutMode === "top-menu";
358
358
  const [tabData, setTabData] = useState([]);
359
359
  const [activeTab, setActiveTab] = useState("");
360
- const [refreshKey, setRefreshKey] = useState(0);
361
360
  const menuDataRef = useRef(menuData);
362
361
  menuDataRef.current = menuData;
363
362
  const activeTabRef = useRef(activeTab);
@@ -441,9 +440,6 @@ function LayoutContent({ children }) {
441
440
  (prev) => prev.map((t) => t.path === path ? { ...t, fixed } : t)
442
441
  );
443
442
  }, []);
444
- const handleRefresh = useCallback(() => {
445
- setRefreshKey((k) => k + 1);
446
- }, []);
447
443
  const TabAdapter = adapters.tab;
448
444
  return /* @__PURE__ */ jsxs("main", { className: "tker-layout-content", children: [
449
445
  !isTopMenu && TabAdapter && /* @__PURE__ */ jsx(
@@ -455,11 +451,10 @@ function LayoutContent({ children }) {
455
451
  onClose: handleTabClose,
456
452
  onCloseOther: handleCloseOtherTabs,
457
453
  onCloseAll: handleCloseAllTabs,
458
- onRefresh: handleRefresh,
459
454
  onSetFixed: handleSetFixed
460
455
  }
461
456
  ),
462
- /* @__PURE__ */ jsx("div", { className: "tker-layout-content__body", children }, refreshKey)
457
+ /* @__PURE__ */ jsx("div", { className: "tker-layout-content__body", children })
463
458
  ] });
464
459
  }
465
460
  function openTabInData(tabData, path, config) {
@@ -541,6 +536,7 @@ function LayoutHeader() {
541
536
  },
542
537
  [getFullPath, navigate, isConcretePage]
543
538
  );
539
+ const emptyOpenKeysRef = useRef(/* @__PURE__ */ new Set());
544
540
  const leftContent = isTopMenu ? ["logo", "menu"] : ["logo", "breadcrumb"];
545
541
  const logoWidth = isSideMenu ? collapsed ? collapsedWidth : expandedWidth : expandedWidth;
546
542
  const LogoAdapter = adapters.logo;
@@ -566,7 +562,7 @@ function LayoutHeader() {
566
562
  collapsed: false,
567
563
  mode: "top",
568
564
  width: logoWidth,
569
- openKeys: /* @__PURE__ */ new Set(),
565
+ openKeys: emptyOpenKeysRef.current,
570
566
  onSelect: handleMenuSelect,
571
567
  onMenuItemClick: menuItemClick
572
568
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tker-react/layout",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",