@keyblade/pro-components 1.4.5 → 1.4.6

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/es/index.js CHANGED
@@ -1,31 +1,26 @@
1
- import { ProBreadcrumb } from "./pro-breadcrumb/index.js";
2
- import { default as default2 } from "./pro-breadcrumb/index.js";
3
- import { ProKeepAliveRouterView } from "./pro-keep-alive-router-view/index.js";
4
- import { default as default3 } from "./pro-keep-alive-router-view/index.js";
5
- import { ProLayout } from "./pro-layout/index.js";
6
- import { default as default4 } from "./pro-layout/index.js";
7
- import { ProMenu } from "./pro-menu/index.js";
8
- import { default as default5 } from "./pro-menu/index.js";
9
- import { ProPageContainer } from "./pro-page-container/index.js";
10
- import { default as default6 } from "./pro-page-container/index.js";
11
- import { ProReuseTabs } from "./pro-reuse-tabs/index.js";
12
- import { default as default7 } from "./pro-reuse-tabs/index.js";
13
- const index = {
14
- install(app) {
15
- app.use(ProBreadcrumb);
16
- app.use(ProKeepAliveRouterView);
17
- app.use(ProLayout);
18
- app.use(ProMenu);
19
- app.use(ProPageContainer);
20
- app.use(ProReuseTabs);
1
+ import { ProBreadcrumb as o } from "./pro-breadcrumb/index.js";
2
+ import { default as b } from "./pro-breadcrumb/index.js";
3
+ import { ProKeepAliveRouterView as e } from "./pro-keep-alive-router-view/index.js";
4
+ import { default as c } from "./pro-keep-alive-router-view/index.js";
5
+ import { ProLayout as t } from "./pro-layout/index.js";
6
+ import { default as v } from "./pro-layout/index.js";
7
+ import { ProMenu as u } from "./pro-menu/index.js";
8
+ import { default as y } from "./pro-menu/index.js";
9
+ import { ProPageContainer as a } from "./pro-page-container/index.js";
10
+ import { default as B } from "./pro-page-container/index.js";
11
+ import { ProReuseTabs as m } from "./pro-reuse-tabs/index.js";
12
+ import { default as K } from "./pro-reuse-tabs/index.js";
13
+ const n = {
14
+ install(r) {
15
+ r.use(o), r.use(e), r.use(t), r.use(u), r.use(a), r.use(m);
21
16
  }
22
17
  };
23
18
  export {
24
- default2 as ProBreadcrumb,
25
- default3 as ProKeepAliveRouterView,
26
- default4 as ProLayout,
27
- default5 as ProMenu,
28
- default6 as ProPageContainer,
29
- default7 as ProReuseTabs,
30
- index as default
19
+ b as ProBreadcrumb,
20
+ c as ProKeepAliveRouterView,
21
+ v as ProLayout,
22
+ y as ProMenu,
23
+ B as ProPageContainer,
24
+ K as ProReuseTabs,
25
+ n as default
31
26
  };
@@ -1,16 +1,13 @@
1
- import _sfc_main from "./pro-breadcrumb.vue.js";
1
+ import o from "./pro-breadcrumb.vue.js";
2
2
  import "./pro-breadcrumb.vue2.js";
3
- import { Breadcrumb } from "@arco-design/web-vue";
4
- import { IconApps } from "@arco-design/web-vue/es/icon";
5
- const ProBreadcrumb = Object.assign(_sfc_main, {
6
- install: (app) => {
7
- app.use(Breadcrumb);
8
- app.use(IconApps);
9
- app.component("KbProBreadcrumb", _sfc_main);
3
+ import { Breadcrumb as m } from "@arco-design/web-vue";
4
+ import { IconApps as t } from "@arco-design/web-vue/es/icon";
5
+ const c = Object.assign(o, {
6
+ install: (r) => {
7
+ r.use(m), r.use(t), r.component("KbProBreadcrumb", o);
10
8
  }
11
- });
12
- const ProBreadcrumb$1 = ProBreadcrumb;
9
+ }), i = c;
13
10
  export {
14
- ProBreadcrumb,
15
- ProBreadcrumb$1 as default
11
+ c as ProBreadcrumb,
12
+ i as default
16
13
  };
@@ -1,115 +1,102 @@
1
- import { defineComponent, inject, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createBlock, resolveDynamicComponent, createCommentVNode, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
2
- const prefixClsName = "keyblade-pro-breadcrumb";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as k, inject as v, computed as x, resolveComponent as s, openBlock as t, createElementBlock as _, normalizeClass as u, createVNode as B, withCtx as r, createBlock as l, resolveDynamicComponent as C, createCommentVNode as c, Fragment as q, renderList as T, createTextVNode as d, toDisplayString as y } from "vue";
2
+ const i = "keyblade-pro-breadcrumb", N = /* @__PURE__ */ k({
4
3
  __name: "pro-breadcrumb",
5
4
  props: {
6
5
  /** 是否显示图标 */
7
6
  showIcon: {
8
7
  type: Boolean,
9
- required: false,
10
- default: true
8
+ required: !1,
9
+ default: !0
11
10
  },
12
11
  /** 图标类型 */
13
12
  icon: {
14
13
  type: String,
15
- required: false,
14
+ required: !1,
16
15
  default: "icon-apps"
17
16
  },
18
17
  /** 面包屑项目 */
19
18
  items: {
20
19
  type: Array,
21
- required: false,
20
+ required: !1,
22
21
  default: () => []
23
22
  },
24
23
  /** 是否显示标题 */
25
24
  showTitle: {
26
25
  type: Boolean,
27
- required: false,
28
- default: true
26
+ required: !1,
27
+ default: !0
29
28
  },
30
29
  /** 标题,不传默认展示面包屑标题最后一项 */
31
30
  title: {
32
31
  type: String,
33
- required: false,
32
+ required: !1,
34
33
  default: ""
35
34
  },
36
35
  /** 副标题,不传默认不展示 */
37
36
  subTitle: {
38
37
  type: String,
39
- required: false,
38
+ required: !1,
40
39
  default: ""
41
40
  }
42
41
  },
43
- setup(__props) {
44
- const props = __props;
45
- const proBreadcrumbItems = inject("ProBreadcrumbItems", []);
46
- const breadcrumbItems = computed(() => {
47
- if (props.items instanceof Array && props.items.length === 0 || !props.items) {
48
- return proBreadcrumbItems.value;
49
- }
50
- return props.items || [];
51
- });
52
- return (_ctx, _cache) => {
53
- const _component_a_breadcrumb_item = resolveComponent("a-breadcrumb-item");
54
- const _component_a_breadcrumb = resolveComponent("a-breadcrumb");
55
- const _component_a_typography_title = resolveComponent("a-typography-title");
56
- const _component_a_typography_text = resolveComponent("a-typography-text");
57
- return breadcrumbItems.value ? (openBlock(), createElementBlock("div", {
42
+ setup(m) {
43
+ const e = m, b = v("ProBreadcrumbItems", []), n = x(() => e.items instanceof Array && e.items.length === 0 || !e.items ? b.value : e.items || []);
44
+ return (w, I) => {
45
+ const f = s("a-breadcrumb-item"), p = s("a-breadcrumb"), h = s("a-typography-title"), g = s("a-typography-text");
46
+ return n.value ? (t(), _("div", {
58
47
  key: 0,
59
- class: normalizeClass(prefixClsName)
48
+ class: u(i)
60
49
  }, [
61
- createVNode(_component_a_breadcrumb, {
62
- class: normalizeClass(`${prefixClsName}-items`)
50
+ B(p, {
51
+ class: u(`${i}-items`)
63
52
  }, {
64
- default: withCtx(() => [
65
- __props.showIcon ? (openBlock(), createBlock(_component_a_breadcrumb_item, {
53
+ default: r(() => [
54
+ m.showIcon ? (t(), l(f, {
66
55
  key: 0,
67
- style: { "cursor": "text" }
56
+ style: { cursor: "text" }
68
57
  }, {
69
- default: withCtx(() => [
70
- (openBlock(), createBlock(resolveDynamicComponent(__props.icon)))
58
+ default: r(() => [
59
+ (t(), l(C(m.icon)))
71
60
  ]),
72
61
  _: 1
73
- })) : createCommentVNode("", true),
74
- (openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbItems.value, (item, index) => {
75
- return openBlock(), createBlock(_component_a_breadcrumb_item, {
76
- key: `${item}-${index}`
77
- }, {
78
- default: withCtx(() => [
79
- createTextVNode(toDisplayString(item), 1)
80
- ]),
81
- _: 2
82
- }, 1024);
83
- }), 128))
62
+ })) : c("", !0),
63
+ (t(!0), _(q, null, T(n.value, (a, o) => (t(), l(f, {
64
+ key: `${a}-${o}`
65
+ }, {
66
+ default: r(() => [
67
+ d(y(a), 1)
68
+ ]),
69
+ _: 2
70
+ }, 1024))), 128))
84
71
  ]),
85
72
  _: 1
86
73
  }, 8, ["class"]),
87
- (props == null ? void 0 : props.showTitle) ? (openBlock(), createBlock(_component_a_typography_title, {
74
+ e != null && e.showTitle ? (t(), l(h, {
88
75
  key: 0,
89
76
  heading: 6,
90
- class: normalizeClass(`${prefixClsName}-title`)
77
+ class: u(`${i}-title`)
91
78
  }, {
92
- default: withCtx(() => {
93
- var _a, _b;
79
+ default: r(() => {
80
+ var a, o;
94
81
  return [
95
- createTextVNode(toDisplayString((props == null ? void 0 : props.title) || ((_b = breadcrumbItems.value) == null ? void 0 : _b[((_a = breadcrumbItems.value) == null ? void 0 : _a.length) - 1])), 1)
82
+ d(y((e == null ? void 0 : e.title) || ((o = n.value) == null ? void 0 : o[((a = n.value) == null ? void 0 : a.length) - 1])), 1)
96
83
  ];
97
84
  }),
98
85
  _: 1
99
- }, 8, ["class"])) : createCommentVNode("", true),
100
- (props == null ? void 0 : props.subTitle) ? (openBlock(), createBlock(_component_a_typography_text, {
86
+ }, 8, ["class"])) : c("", !0),
87
+ e != null && e.subTitle ? (t(), l(g, {
101
88
  key: 1,
102
- class: normalizeClass(`${prefixClsName}-subtitle`)
89
+ class: u(`${i}-subtitle`)
103
90
  }, {
104
- default: withCtx(() => [
105
- createTextVNode(toDisplayString(props == null ? void 0 : props.subTitle), 1)
91
+ default: r(() => [
92
+ d(y(e == null ? void 0 : e.subTitle), 1)
106
93
  ]),
107
94
  _: 1
108
- }, 8, ["class"])) : createCommentVNode("", true)
109
- ])) : createCommentVNode("", true);
95
+ }, 8, ["class"])) : c("", !0)
96
+ ])) : c("", !0);
110
97
  };
111
98
  }
112
99
  });
113
100
  export {
114
- _sfc_main as default
101
+ N as default
115
102
  };
@@ -1,4 +1,4 @@
1
- const proBreadcrumb_vue_vue_type_style_index_0_lang = "";
1
+ const e = "";
2
2
  export {
3
- proBreadcrumb_vue_vue_type_style_index_0_lang as default
3
+ e as default
4
4
  };
@@ -1,5 +1,5 @@
1
- import _sfc_main from "./pro-breadcrumb.vue.js";
1
+ import o from "./pro-breadcrumb.vue.js";
2
2
  import "./pro-breadcrumb.vue2.js";
3
3
  export {
4
- _sfc_main as default
4
+ o as default
5
5
  };
@@ -1,11 +1,10 @@
1
- import _sfc_main from "./pro-keep-alive-router-view.vue.js";
2
- const ProKeepAliveRouterView = Object.assign(_sfc_main, {
3
- install: (app) => {
4
- app.component("KbProKeepAliveRouterView", _sfc_main);
1
+ import e from "./pro-keep-alive-router-view.vue.js";
2
+ const t = Object.assign(e, {
3
+ install: (o) => {
4
+ o.component("KbProKeepAliveRouterView", e);
5
5
  }
6
- });
7
- const ProKeepAliveRouterView$1 = ProKeepAliveRouterView;
6
+ }), r = t;
8
7
  export {
9
- ProKeepAliveRouterView,
10
- ProKeepAliveRouterView$1 as default
8
+ t as ProKeepAliveRouterView,
9
+ r as default
11
10
  };
@@ -1,49 +1,39 @@
1
- import { defineComponent, inject, computed, resolveComponent, openBlock, createBlock, withCtx, KeepAlive, resolveDynamicComponent } from "vue";
2
- const _sfc_main = /* @__PURE__ */ defineComponent({
1
+ import { defineComponent as d, inject as v, computed as u, resolveComponent as s, openBlock as l, createBlock as n, withCtx as A, KeepAlive as f, resolveDynamicComponent as k } from "vue";
2
+ const _ = /* @__PURE__ */ d({
3
3
  __name: "pro-keep-alive-router-view",
4
4
  props: {
5
5
  /** 包含 */
6
6
  keepAliveInclude: {
7
7
  type: Array,
8
- required: false,
8
+ required: !1,
9
9
  default: () => []
10
10
  },
11
11
  /** 排除(ProLayout里一般不会用) */
12
12
  keepAliveExclude: {
13
13
  type: Array,
14
- required: false,
14
+ required: !1,
15
15
  default: () => []
16
16
  },
17
17
  /** 最大数(ProLayout里一般不会用) */
18
18
  keepAliveMax: {
19
19
  type: Number,
20
- required: false,
20
+ required: !1,
21
21
  default: 9999
22
22
  }
23
23
  },
24
- setup(__props) {
25
- const props = __props;
26
- const proKeepAliveInclude = inject("ProKeepAliveInclude", []);
27
- const include = computed(() => {
28
- if (props.keepAliveInclude instanceof Array && props.keepAliveInclude.length === 0 || !props.keepAliveInclude) {
29
- return proKeepAliveInclude.value;
30
- }
31
- return props.keepAliveInclude || [];
32
- });
33
- const exclude = computed(() => {
34
- return props.keepAliveExclude || [];
35
- });
36
- return (_ctx, _cache) => {
37
- const _component_router_view = resolveComponent("router-view");
38
- return openBlock(), createBlock(_component_router_view, null, {
39
- default: withCtx(({ Component, route }) => [
40
- (openBlock(), createBlock(KeepAlive, {
41
- include: include.value,
42
- exclude: exclude.value,
43
- max: __props.keepAliveMax
24
+ setup(r) {
25
+ const e = r, t = v("ProKeepAliveInclude", []), c = u(() => e.keepAliveInclude instanceof Array && e.keepAliveInclude.length === 0 || !e.keepAliveInclude ? t.value : e.keepAliveInclude || []), o = u(() => e.keepAliveExclude || []);
26
+ return (m, x) => {
27
+ const i = s("router-view");
28
+ return l(), n(i, null, {
29
+ default: A(({ Component: p, route: a }) => [
30
+ (l(), n(f, {
31
+ include: c.value,
32
+ exclude: o.value,
33
+ max: r.keepAliveMax
44
34
  }, [
45
- (openBlock(), createBlock(resolveDynamicComponent(Component), {
46
- key: route.fullPath
35
+ (l(), n(k(p), {
36
+ key: a.fullPath
47
37
  }))
48
38
  ], 1032, ["include", "exclude", "max"]))
49
39
  ]),
@@ -53,5 +43,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
53
43
  }
54
44
  });
55
45
  export {
56
- _sfc_main as default
46
+ _ as default
57
47
  };
@@ -1,4 +1,4 @@
1
- import _sfc_main from "./pro-keep-alive-router-view.vue.js";
1
+ import f from "./pro-keep-alive-router-view.vue.js";
2
2
  export {
3
- _sfc_main as default
3
+ f as default
4
4
  };
@@ -1,181 +1,106 @@
1
- import { ref, watch } from "vue";
2
- import { useRoute, useRouter } from "vue-router";
3
- function useHooks(menuItems, options) {
4
- const route = useRoute();
5
- const router = useRouter();
6
- const menuSelectedKeys = ref([]);
7
- const onMenuItemClick = (key) => {
8
- menuSelectedKeys.value = [key];
9
- };
10
- const activeMenuItem = ref();
11
- const activeMenuItemPaths = ref([]);
12
- const menuItemMap = ref({});
13
- const breadcrumbItems = ref([]);
14
- const tabs = ref([]);
15
- const keepAliveInclude = ref([]);
16
- const setActiveMenuItemPaths = () => {
17
- const paths = [];
18
- const recursion = (_menuItems) => {
19
- var _a;
20
- for (const i in _menuItems) {
21
- const menuItem = _menuItems[i];
22
- if (menuItem.name === ((_a = activeMenuItem == null ? void 0 : activeMenuItem.value) == null ? void 0 : _a.name)) {
23
- delete menuItem.children;
24
- paths.unshift(menuItem);
25
- return true;
26
- }
27
- if (menuItem.children && menuItem.children.length > 0) {
28
- const ok = recursion(menuItem.children);
29
- if (ok) {
30
- delete menuItem.children;
31
- paths.unshift(menuItem);
32
- return true;
33
- }
34
- }
1
+ import { ref as r, watch as b } from "vue";
2
+ import { useRoute as S, useRouter as x } from "vue-router";
3
+ function K(d, T) {
4
+ const i = S(), m = x(), h = r([]), P = (a) => {
5
+ h.value = [a];
6
+ }, u = r(), f = r([]), v = r({}), p = r([]), s = r([]), o = r([]), N = () => {
7
+ const a = [], t = (e) => {
8
+ var l;
9
+ for (const n in e) {
10
+ const c = e[n];
11
+ if (c.name === ((l = u == null ? void 0 : u.value) == null ? void 0 : l.name) || c.children && c.children.length > 0 && t(c.children))
12
+ return delete c.children, a.unshift(c), !0;
35
13
  }
36
- return false;
14
+ return !1;
37
15
  };
38
- recursion(JSON.parse(JSON.stringify(menuItems.value)));
39
- activeMenuItemPaths.value = paths;
40
- };
41
- const setBreadcrumbItems = () => {
42
- var _a, _b;
43
- const activeMenuItemTitles = activeMenuItemPaths.value.map((v) => v.title);
44
- breadcrumbItems.value = ((_a = activeMenuItem.value) == null ? void 0 : _a.breadcrumbs) ? (_b = activeMenuItem.value) == null ? void 0 : _b.breadcrumbs : activeMenuItemTitles.length !== 0 ? activeMenuItemTitles : [];
16
+ t(JSON.parse(JSON.stringify(d.value))), f.value = a;
17
+ }, k = () => {
18
+ var t, e;
19
+ const a = f.value.map((l) => l.title);
20
+ p.value = (t = u.value) != null && t.breadcrumbs ? (e = u.value) == null ? void 0 : e.breadcrumbs : a.length !== 0 ? a : [];
45
21
  };
46
- function setTabs() {
47
- if (!activeMenuItem.value || activeMenuItem.value.noAffix) {
48
- tabs.value.forEach((tab) => {
49
- tab.active = false;
22
+ function y() {
23
+ if (!u.value || u.value.noAffix) {
24
+ s.value.forEach((n) => {
25
+ n.active = !1;
50
26
  });
51
27
  return;
52
28
  }
53
- const { name: menuItemName, title: menuItemTitle } = activeMenuItem.value;
54
- let findIndex = -1;
55
- tabs.value.forEach((v, i) => {
56
- v.active = false;
57
- if (v.name === menuItemName) {
58
- findIndex = i;
59
- }
29
+ const { name: a, title: t } = u.value;
30
+ let e = -1;
31
+ s.value.forEach((n, c) => {
32
+ n.active = !1, n.name === a && (e = c);
60
33
  });
61
- const newTab = {
62
- name: menuItemName,
63
- parentNames: activeMenuItemPaths.value.map((v) => v.name),
64
- title: menuItemTitle ?? menuItemName,
65
- fullPath: route.fullPath,
66
- active: true
34
+ const l = {
35
+ name: a,
36
+ parentNames: f.value.map((n) => n.name),
37
+ title: t ?? a,
38
+ fullPath: i.fullPath,
39
+ active: !0
67
40
  };
68
- if (~findIndex) {
69
- const findTab = tabs.value[findIndex];
70
- if (findTab.fullPath === route.fullPath) {
71
- findTab.active = true;
72
- findTab.fullPath = route.fullPath;
73
- } else {
74
- tabs.value.splice(findIndex, 1);
75
- setTimeout(() => {
76
- tabs.value.push(newTab);
77
- });
78
- }
79
- } else {
80
- tabs.value.push(newTab);
81
- }
41
+ if (~e) {
42
+ const n = s.value[e];
43
+ n.fullPath === i.fullPath ? (n.active = !0, n.fullPath = i.fullPath) : (s.value.splice(e, 1), setTimeout(() => {
44
+ s.value.push(l);
45
+ }));
46
+ } else
47
+ s.value.push(l);
82
48
  }
83
- const onTabClick = (key) => {
84
- const findTabIndex = tabs.value.findIndex((v) => v.name === key);
85
- const findTab = tabs.value[findTabIndex];
86
- router.push(findTab.fullPath);
87
- };
88
- const onTabDelete = (key) => {
89
- let activeIndex = -1;
90
- let findTabIndex = -1;
91
- tabs.value.forEach((tab, index) => {
92
- if (tab.name === key) {
93
- findTabIndex = index;
94
- }
95
- if (tab.active) {
96
- activeIndex = index;
97
- }
98
- });
99
- if (activeIndex === findTabIndex) {
100
- let tab;
101
- if (findTabIndex === 0) {
102
- tab = tabs.value[findTabIndex + 1];
103
- } else {
104
- tab = tabs.value[findTabIndex - 1];
105
- }
106
- tab.active = true;
107
- router.push(tab.fullPath);
49
+ const E = (a) => {
50
+ const t = s.value.findIndex((l) => l.name === a), e = s.value[t];
51
+ m.push(e.fullPath);
52
+ }, g = (a) => {
53
+ let t = -1, e = -1;
54
+ if (s.value.forEach((n, c) => {
55
+ n.name === a && (e = c), n.active && (t = c);
56
+ }), t === e) {
57
+ let n;
58
+ e === 0 ? n = s.value[e + 1] : n = s.value[e - 1], n.active = !0, m.push(n.fullPath);
108
59
  }
109
- const deleteTab = tabs.value.splice(findTabIndex, 1);
110
- removeKeepAliveInclude(deleteTab[0]);
111
- };
112
- const addKeepAliveInclude = () => {
113
- var _a;
114
- if ((_a = route == null ? void 0 : route.meta) == null ? void 0 : _a.ignoreCache) {
60
+ const l = s.value.splice(e, 1);
61
+ I(l[0]);
62
+ }, A = () => {
63
+ var t;
64
+ if ((t = i == null ? void 0 : i.meta) != null && t.ignoreCache)
115
65
  return;
116
- }
117
- const keys = new Set(keepAliveInclude.value);
118
- activeMenuItemPaths.value.forEach((item) => {
119
- if (item.name) {
120
- keys.add(item.name);
121
- }
122
- });
123
- keepAliveInclude.value = Array.from(keys.values());
124
- };
125
- const removeKeepAliveInclude = (tab) => {
126
- const keys = new Set(keepAliveInclude.value);
127
- tab.parentNames.forEach((name) => {
128
- keys.delete(name);
129
- });
130
- tabs.value.forEach((tab2) => {
131
- tab2.parentNames.forEach((name) => {
132
- const menuItem = menuItemMap.value[name];
133
- if (menuItem == null ? void 0 : menuItem.ignoreCache) {
134
- return;
135
- }
136
- keys.add(menuItem.name);
66
+ const a = new Set(o.value);
67
+ f.value.forEach((e) => {
68
+ e.name && a.add(e.name);
69
+ }), o.value = Array.from(a.values());
70
+ }, I = (a) => {
71
+ const t = new Set(o.value);
72
+ a.parentNames.forEach((e) => {
73
+ t.delete(e);
74
+ }), s.value.forEach((e) => {
75
+ e.parentNames.forEach((l) => {
76
+ const n = v.value[l];
77
+ n != null && n.ignoreCache || t.add(n.name);
137
78
  });
138
- });
139
- keepAliveInclude.value = Array.from(keys.values());
79
+ }), o.value = Array.from(t.values());
140
80
  };
141
- watch(menuItems, () => {
142
- const _menuItemMap = {};
143
- const fn = (_menuItem) => {
144
- _menuItem.forEach((menuItem) => {
145
- if (menuItem.children && menuItem.children.length > 0) {
146
- fn(menuItem.children);
147
- }
148
- delete menuItem["children"];
149
- _menuItemMap[menuItem.name] = menuItem;
81
+ return b(d, () => {
82
+ const a = {}, t = (e) => {
83
+ e.forEach((l) => {
84
+ l.children && l.children.length > 0 && t(l.children), delete l.children, a[l.name] = l;
150
85
  });
151
86
  };
152
- fn(JSON.parse(JSON.stringify(menuItems.value)));
153
- menuItemMap.value = _menuItemMap;
154
- }, { immediate: true });
155
- watch(() => route == null ? void 0 : route.name, () => {
156
- var _a;
157
- const routeName = route == null ? void 0 : route.name;
158
- activeMenuItem.value = menuItemMap.value[routeName];
159
- menuSelectedKeys.value = (activeMenuItem == null ? void 0 : activeMenuItem.value) ? [activeMenuItem.value.name, ...((_a = activeMenuItem.value) == null ? void 0 : _a.activatedKeys) || []] : [];
160
- setActiveMenuItemPaths();
161
- setBreadcrumbItems();
162
- if (options.showTabs) {
163
- setTabs();
164
- }
165
- addKeepAliveInclude();
166
- }, { immediate: true });
167
- return {
168
- menuSelectedKeys,
169
- activeMenuItem,
170
- menuItemMap,
171
- breadcrumbItems,
172
- tabs,
173
- keepAliveInclude,
174
- onMenuItemClick,
175
- onTabClick,
176
- onTabDelete
87
+ t(JSON.parse(JSON.stringify(d.value))), v.value = a;
88
+ }, { immediate: !0 }), b(() => i == null ? void 0 : i.name, () => {
89
+ var t;
90
+ const a = i == null ? void 0 : i.name;
91
+ u.value = v.value[a], h.value = u != null && u.value ? [u.value.name, ...((t = u.value) == null ? void 0 : t.activatedKeys) || []] : [], N(), k(), T.showTabs && y(), A();
92
+ }, { immediate: !0 }), {
93
+ menuSelectedKeys: h,
94
+ activeMenuItem: u,
95
+ menuItemMap: v,
96
+ breadcrumbItems: p,
97
+ tabs: s,
98
+ keepAliveInclude: o,
99
+ onMenuItemClick: P,
100
+ onTabClick: E,
101
+ onTabDelete: g
177
102
  };
178
103
  }
179
104
  export {
180
- useHooks
105
+ K as useHooks
181
106
  };