@keyblade/pro-components 1.12.17 → 1.13.1

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.
@@ -7,6 +7,9 @@ declare const ProDateRangePicker: {
7
7
  startPlaceholder?: string;
8
8
  endPlaceholder?: string;
9
9
  separator?: string;
10
+ hideLabel?: boolean;
11
+ formItemProps?: FormItemProps;
12
+ datePickerProps?: DatePickerProps;
10
13
  }> & Readonly<{
11
14
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
12
15
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -17,6 +20,7 @@ declare const ProDateRangePicker: {
17
20
  startPlaceholder: string;
18
21
  endPlaceholder: string;
19
22
  separator: string;
23
+ hideLabel: boolean;
20
24
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
21
25
  startDatePickerRef: unknown;
22
26
  endDatePickerRef: unknown;
@@ -34,6 +38,9 @@ declare const ProDateRangePicker: {
34
38
  startPlaceholder?: string;
35
39
  endPlaceholder?: string;
36
40
  separator?: string;
41
+ hideLabel?: boolean;
42
+ formItemProps?: FormItemProps;
43
+ datePickerProps?: DatePickerProps;
37
44
  }> & Readonly<{
38
45
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
39
46
  }>, {}, {}, {}, {}, {
@@ -42,6 +49,7 @@ declare const ProDateRangePicker: {
42
49
  startPlaceholder: string;
43
50
  endPlaceholder: string;
44
51
  separator: string;
52
+ hideLabel: boolean;
45
53
  }>;
46
54
  __isFragment?: never;
47
55
  __isTeleport?: never;
@@ -53,6 +61,9 @@ declare const ProDateRangePicker: {
53
61
  startPlaceholder?: string;
54
62
  endPlaceholder?: string;
55
63
  separator?: string;
64
+ hideLabel?: boolean;
65
+ formItemProps?: FormItemProps;
66
+ datePickerProps?: DatePickerProps;
56
67
  }> & Readonly<{
57
68
  "onUpdate:modelValue"?: ((value: import('./type').IModelValue) => any) | undefined;
58
69
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -63,6 +74,7 @@ declare const ProDateRangePicker: {
63
74
  startPlaceholder: string;
64
75
  endPlaceholder: string;
65
76
  separator: string;
77
+ hideLabel: boolean;
66
78
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
67
79
  install: (app: App) => void;
68
80
  };
@@ -1,4 +1,5 @@
1
1
  import { IModelValue } from './type.ts';
2
+ import { DatePickerProps, FormItemProps } from '@arco-design/web-vue';
2
3
  type __VLS_Props = {
3
4
  modelValue: IModelValue;
4
5
  startField?: string;
@@ -6,6 +7,9 @@ type __VLS_Props = {
6
7
  startPlaceholder?: string;
7
8
  endPlaceholder?: string;
8
9
  separator?: string;
10
+ hideLabel?: boolean;
11
+ formItemProps?: FormItemProps;
12
+ datePickerProps?: DatePickerProps;
9
13
  };
10
14
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
11
15
  "update:modelValue": (value: IModelValue) => any;
@@ -17,6 +21,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
17
21
  startPlaceholder: string;
18
22
  endPlaceholder: string;
19
23
  separator: string;
24
+ hideLabel: boolean;
20
25
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
21
26
  startDatePickerRef: unknown;
22
27
  endDatePickerRef: unknown;
@@ -1,7 +1,7 @@
1
1
  import o from "./pro-date-range-picker.vue2.js";
2
2
  /* empty css */
3
- import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8dc7d86d"]]);
3
+ import a from "../_virtual/_plugin-vue_export-helper.js";
4
+ const _ = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ae94924a"]]);
5
5
  export {
6
6
  _ as default
7
7
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as C, useAttrs as E, computed as n, ref as V, resolveComponent as k, createElementBlock as S, openBlock as R, normalizeClass as T, createVNode as d, withCtx as s, createTextVNode as x, toDisplayString as A, mergeProps as B, nextTick as h } from "vue";
1
+ import { defineComponent as v, ref as V, computed as k, resolveComponent as h, createElementBlock as _, openBlock as E, normalizeClass as S, createVNode as d, mergeProps as i, withCtx as n, createTextVNode as B, toDisplayString as R, nextTick as P } from "vue";
2
2
  import r from "dayjs";
3
- const N = "keyblade-pro-date-range-picker", $ = /* @__PURE__ */ C({
3
+ const T = "keyblade-pro-date-range-picker", I = /* @__PURE__ */ v({
4
4
  __name: "pro-date-range-picker",
5
5
  props: {
6
6
  modelValue: {},
@@ -8,92 +8,93 @@ const N = "keyblade-pro-date-range-picker", $ = /* @__PURE__ */ C({
8
8
  endField: { default: "endDate" },
9
9
  startPlaceholder: { default: "开始日期" },
10
10
  endPlaceholder: { default: "结束日期" },
11
- separator: { default: "至" }
11
+ separator: { default: "至" },
12
+ hideLabel: { type: Boolean, default: !0 },
13
+ formItemProps: {},
14
+ datePickerProps: {}
12
15
  },
13
16
  emits: ["update:modelValue"],
14
- setup(D, { emit: g }) {
15
- const e = D, F = E(), _ = n(() => {
16
- const { class: t, ...l } = F;
17
- return l;
18
- }), i = g, u = V(), m = V(), c = n({
17
+ setup(F, { emit: g }) {
18
+ const e = F, s = g, u = V(), m = V(), p = k({
19
19
  get: () => e.modelValue[e.startField],
20
- set: (t) => {
21
- i("update:modelValue", {
20
+ set: (l) => {
21
+ s("update:modelValue", {
22
22
  ...e.modelValue,
23
- [e.startField]: t
23
+ [e.startField]: l
24
24
  });
25
25
  }
26
- }), p = n({
26
+ }), f = k({
27
27
  get: () => e.modelValue[e.endField],
28
- set: (t) => {
29
- i("update:modelValue", {
28
+ set: (l) => {
29
+ s("update:modelValue", {
30
30
  ...e.modelValue,
31
- [e.endField]: t
31
+ [e.endField]: l
32
32
  });
33
33
  }
34
- }), b = (t) => e.modelValue.endDate ? r(t).isAfter(r(e.modelValue[e.startField])) : !1, P = (t) => e.modelValue.startDate ? r(t).isBefore(r(e.modelValue[e.endField])) : !1, v = () => {
34
+ }), b = (l) => e.modelValue[e.endField] ? r(l).isAfter(r(e.modelValue[e.endField])) : !1, D = (l) => e.modelValue[e.startField] ? r(l).isBefore(r(e.modelValue[e.startField])) : !1, y = () => {
35
35
  setTimeout(() => {
36
- e.modelValue[e.startField] && !e.modelValue[e.endField] && h(() => {
37
- var l;
38
- const t = (l = m.value) == null ? void 0 : l.$el.parentElement.querySelector("input");
39
- t && t.click();
36
+ e.modelValue[e.startField] && !e.modelValue[e.endField] && P(() => {
37
+ var t;
38
+ const l = (t = m.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
39
+ l && l.click();
40
40
  });
41
41
  });
42
- }, y = () => {
42
+ }, C = () => {
43
43
  setTimeout(() => {
44
- e.modelValue[e.endField] && !e.modelValue[e.startField] && h(() => {
45
- var l;
46
- const t = (l = u.value) == null ? void 0 : l.$el.parentElement.querySelector("input");
47
- t && t.click();
44
+ e.modelValue[e.endField] && !e.modelValue[e.startField] && P(() => {
45
+ var t;
46
+ const l = (t = u.value) == null ? void 0 : t.$el.parentElement.querySelector("input");
47
+ l && l.click();
48
48
  });
49
49
  });
50
50
  };
51
- return (t, l) => {
52
- const f = k("a-date-picker"), o = k("a-form-item");
53
- return R(), S("div", {
54
- class: T(N)
51
+ return (l, t) => {
52
+ const c = h("a-date-picker"), o = h("a-form-item");
53
+ return E(), _("div", {
54
+ class: S(T)
55
55
  }, [
56
- d(o, {
57
- field: t.startField,
56
+ d(o, i(l.formItemProps, {
57
+ field: l.startField,
58
58
  style: { "margin-right": "8px" },
59
- "hide-label": ""
60
- }, {
61
- default: s(() => [
62
- d(f, {
59
+ "hide-label": l.hideLabel
60
+ }), {
61
+ default: n(() => [
62
+ d(c, i({
63
63
  ref_key: "startDatePickerRef",
64
64
  ref: u,
65
- modelValue: c.value,
66
- "onUpdate:modelValue": l[0] || (l[0] = (a) => c.value = a),
67
- placeholder: t.startPlaceholder,
65
+ modelValue: p.value,
66
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => p.value = a)
67
+ }, l.datePickerProps, {
68
+ placeholder: l.startPlaceholder,
68
69
  "disabled-date": (a) => b(a),
69
- onChange: v
70
- }, null, 8, ["modelValue", "placeholder", "disabled-date"])
70
+ onChange: y
71
+ }), null, 16, ["modelValue", "placeholder", "disabled-date"])
71
72
  ]),
72
73
  _: 1
73
- }, 8, ["field"]),
74
+ }, 16, ["field", "hide-label"]),
74
75
  d(o, {
75
76
  "hide-label": "",
76
77
  style: { "margin-right": "8px" }
77
78
  }, {
78
- default: s(() => [
79
- x(A(t.separator), 1)
79
+ default: n(() => [
80
+ B(R(l.separator), 1)
80
81
  ]),
81
82
  _: 1
82
83
  }),
83
84
  d(o, {
84
- field: t.endField,
85
+ field: l.endField,
85
86
  "hide-label": ""
86
87
  }, {
87
- default: s(() => [
88
- d(f, B({
88
+ default: n(() => [
89
+ d(c, i({
89
90
  ref_key: "endDatePickerRef",
90
91
  ref: m,
91
- modelValue: p.value,
92
- "onUpdate:modelValue": l[1] || (l[1] = (a) => p.value = a)
93
- }, _.value, {
94
- placeholder: t.endPlaceholder,
95
- "disabled-date": (a) => P(a),
96
- onChange: y
92
+ modelValue: f.value,
93
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => f.value = a)
94
+ }, l.datePickerProps, {
95
+ placeholder: l.endPlaceholder,
96
+ "disabled-date": (a) => D(a),
97
+ onChange: C
97
98
  }), null, 16, ["modelValue", "placeholder", "disabled-date"])
98
99
  ]),
99
100
  _: 1
@@ -103,5 +104,5 @@ const N = "keyblade-pro-date-range-picker", $ = /* @__PURE__ */ C({
103
104
  }
104
105
  });
105
106
  export {
106
- $ as default
107
+ I as default
107
108
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * layout模式
3
+ */
4
+ export declare enum ProLayoutMode {
5
+ /** 混合菜单模式(包含侧边栏和顶部菜单) */
6
+ mix = "mix",
7
+ /** 侧边栏菜单模式 */
8
+ side = "side"
9
+ }
10
+ /**
11
+ * 菜单类型
12
+ */
13
+ export declare enum ProLayoutMenuType {
14
+ top = "top",
15
+ side = "side"
16
+ }
@@ -0,0 +1,5 @@
1
+ var r = /* @__PURE__ */ ((i) => (i.mix = "mix", i.side = "side", i))(r || {}), e = /* @__PURE__ */ ((i) => (i.top = "top", i.side = "side", i))(e || {});
2
+ export {
3
+ e as ProLayoutMenuType,
4
+ r as ProLayoutMode
5
+ };
@@ -1,14 +1,91 @@
1
- import { Ref } from 'vue';
2
1
  import { IProMenuItem } from '../pro-menu';
3
2
  import { IProTab } from '../pro-reuse-tabs';
4
- export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
5
- hideTabs: boolean;
6
- disableKeepAlive: boolean;
7
- }): {
8
- menuSelectedKeys: Ref<string[], string[]>;
9
- activeMenuItem: Ref<IProMenuItem | undefined, IProMenuItem | undefined>;
10
- menuItemMap: Ref<Record<string, IProMenuItem>, Record<string, IProMenuItem>>;
11
- breadcrumbItems: Ref<{
3
+ import { ProLayoutMenuType } from './enum.ts';
4
+ import { IProLayoutProps } from './type.ts';
5
+ export declare function useHooks(props: IProLayoutProps): {
6
+ topMenuItems: import('vue').Ref<{
7
+ name: string;
8
+ path: string;
9
+ title: string;
10
+ topMenu?: boolean | undefined;
11
+ topChildrenMenu?: boolean | undefined;
12
+ activatedKeys?: string[] | undefined;
13
+ icon?: string | undefined;
14
+ selectedIcon?: string | undefined;
15
+ hideInMenu?: boolean | undefined;
16
+ hideChildrenInMenu?: boolean | undefined;
17
+ noAffix?: boolean | undefined;
18
+ breadcrumbs?: {
19
+ path?: string | undefined;
20
+ label: string;
21
+ }[] | undefined;
22
+ ignoreCache?: boolean | undefined;
23
+ componentKey?: "path" | "fullPath" | undefined;
24
+ children?: /*elided*/ any[] | undefined;
25
+ }[], IProMenuItem[] | {
26
+ name: string;
27
+ path: string;
28
+ title: string;
29
+ topMenu?: boolean | undefined;
30
+ topChildrenMenu?: boolean | undefined;
31
+ activatedKeys?: string[] | undefined;
32
+ icon?: string | undefined;
33
+ selectedIcon?: string | undefined;
34
+ hideInMenu?: boolean | undefined;
35
+ hideChildrenInMenu?: boolean | undefined;
36
+ noAffix?: boolean | undefined;
37
+ breadcrumbs?: {
38
+ path?: string | undefined;
39
+ label: string;
40
+ }[] | undefined;
41
+ ignoreCache?: boolean | undefined;
42
+ componentKey?: "path" | "fullPath" | undefined;
43
+ children?: /*elided*/ any[] | undefined;
44
+ }[]>;
45
+ siderMenuItems: import('vue').Ref<{
46
+ name: string;
47
+ path: string;
48
+ title: string;
49
+ topMenu?: boolean | undefined;
50
+ topChildrenMenu?: boolean | undefined;
51
+ activatedKeys?: string[] | undefined;
52
+ icon?: string | undefined;
53
+ selectedIcon?: string | undefined;
54
+ hideInMenu?: boolean | undefined;
55
+ hideChildrenInMenu?: boolean | undefined;
56
+ noAffix?: boolean | undefined;
57
+ breadcrumbs?: {
58
+ path?: string | undefined;
59
+ label: string;
60
+ }[] | undefined;
61
+ ignoreCache?: boolean | undefined;
62
+ componentKey?: "path" | "fullPath" | undefined;
63
+ children?: /*elided*/ any[] | undefined;
64
+ }[], IProMenuItem[] | {
65
+ name: string;
66
+ path: string;
67
+ title: string;
68
+ topMenu?: boolean | undefined;
69
+ topChildrenMenu?: boolean | undefined;
70
+ activatedKeys?: string[] | undefined;
71
+ icon?: string | undefined;
72
+ selectedIcon?: string | undefined;
73
+ hideInMenu?: boolean | undefined;
74
+ hideChildrenInMenu?: boolean | undefined;
75
+ noAffix?: boolean | undefined;
76
+ breadcrumbs?: {
77
+ path?: string | undefined;
78
+ label: string;
79
+ }[] | undefined;
80
+ ignoreCache?: boolean | undefined;
81
+ componentKey?: "path" | "fullPath" | undefined;
82
+ children?: /*elided*/ any[] | undefined;
83
+ }[]>;
84
+ topMenuSelectedKeys: import('vue').Ref<string[], string[]>;
85
+ siderMenuSelectedKeys: import('vue').Ref<string[], string[]>;
86
+ activeMenuItem: import('vue').Ref<IProMenuItem | undefined, IProMenuItem | undefined>;
87
+ menuItemMap: import('vue').Ref<Record<string, IProMenuItem>, Record<string, IProMenuItem>>;
88
+ breadcrumbItems: import('vue').Ref<{
12
89
  path?: string | undefined;
13
90
  label: string;
14
91
  }[], {
@@ -18,7 +95,7 @@ export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
18
95
  path?: string | undefined;
19
96
  label: string;
20
97
  }[]>;
21
- tabs: Ref<{
98
+ tabs: import('vue').Ref<{
22
99
  name: string;
23
100
  parentNames: string[];
24
101
  title: string;
@@ -31,8 +108,8 @@ export declare function useHooks(menuItems: Ref<IProMenuItem[]>, options: {
31
108
  fullPath: string;
32
109
  active: boolean;
33
110
  }[]>;
34
- keepAliveInclude: Ref<string[], string[]>;
35
- onMenuItemClick: (key: string) => void;
111
+ keepAliveInclude: import('vue').Ref<string[], string[]>;
112
+ onProMenuItemClick: (menuType: ProLayoutMenuType, item: IProMenuItem) => Promise<void>;
36
113
  onTabClick: (key: string) => void;
37
114
  onTabDelete: (key: string) => void;
38
115
  };
@@ -1,106 +1,146 @@
1
- import { ref as i, watch as T } from "vue";
2
- import { useRoute as S, useRouter as x } from "vue-router";
3
- function J(h, o) {
4
- const r = S(), b = x(), m = i([]), P = (t) => {
5
- m.value = [t];
6
- }, u = i(), v = i([]), d = i({}), p = i([]), c = i([]), f = i([]), N = () => {
7
- const t = [], l = (a) => {
8
- var n;
9
- for (const e in a) {
10
- const s = a[e];
11
- if (s.name === ((n = u == null ? void 0 : u.value) == null ? void 0 : n.name) || s.children && s.children.length > 0 && l(s.children))
12
- return delete s.children, t.unshift(s), !0;
1
+ import { ref as r, computed as L, watch as g } from "vue";
2
+ import { useRoute as R, useRouter as W } from "vue-router";
3
+ import { ProLayoutMode as P, ProLayoutMenuType as B } from "./enum.js";
4
+ function z(u) {
5
+ const o = R(), h = W(), y = r([]), T = r([]), i = r(), v = r([]), M = r({}), k = r([]), s = r([]), p = r([]), b = r([]), f = r([]), d = L(() => {
6
+ const a = [...u.menuItems], e = (n) => {
7
+ n.forEach((l) => {
8
+ if (l != null && l.children && l.children.length > 0) {
9
+ if ((l == null ? void 0 : l.topChildrenMenu) !== void 0)
10
+ l.children = l.children.map((t) => ({ ...t, topMenu: l == null ? void 0 : l.topChildrenMenu }));
11
+ else {
12
+ const t = l.children.find((c) => c.topMenu !== void 0);
13
+ t && (l.topChildrenMenu = t.topMenu, l.children = l.children.map((c) => ({ ...c, topMenu: t.topMenu })));
14
+ }
15
+ e(l.children);
16
+ }
17
+ });
18
+ };
19
+ return u.layout === P.mix && e(a), a;
20
+ }), C = (a) => {
21
+ var e;
22
+ y.value = [a.name], !(a != null && a.children) || ((e = a == null ? void 0 : a.children) == null ? void 0 : e.length) === 0 ? (f.value = [], h == null || h.push({ path: a.path })) : f.value = a.children;
23
+ }, E = (a) => {
24
+ h == null || h.push({ path: a.path }), T.value = [a.name];
25
+ }, N = async (a, e) => {
26
+ if (e != null && e.path && !(u != null && u.onMenuItemClick && !await u.onMenuItemClick(e))) {
27
+ if (e.path.startsWith("http") || e.path.startsWith("https")) {
28
+ window.open(e.path);
29
+ return;
30
+ }
31
+ a === B.top ? C(e) : E(e);
32
+ }
33
+ }, S = () => {
34
+ const a = [], e = (n) => {
35
+ var l;
36
+ for (const t in n) {
37
+ const c = n[t];
38
+ if (c.name === ((l = i == null ? void 0 : i.value) == null ? void 0 : l.name) || c.children && c.children.length > 0 && e(c.children))
39
+ return a.unshift(c), !0;
13
40
  }
14
41
  return !1;
15
42
  };
16
- l(JSON.parse(JSON.stringify(h.value))), v.value = t;
17
- }, k = () => {
18
- var l, a, n;
19
- const t = (l = v.value) == null ? void 0 : l.map((e) => ({ path: e == null ? void 0 : e.path, label: e == null ? void 0 : e.title }));
20
- p.value = (a = u.value) != null && a.breadcrumbs ? (n = u.value) == null ? void 0 : n.breadcrumbs : t.length !== 0 ? t : [];
43
+ e(JSON.parse(JSON.stringify(d.value))), v.value = a;
44
+ }, x = () => {
45
+ var e, n, l;
46
+ const a = (e = v.value) == null ? void 0 : e.map((t) => ({ path: t == null ? void 0 : t.path, label: t == null ? void 0 : t.title }));
47
+ k.value = (n = i.value) != null && n.breadcrumbs ? (l = i.value) == null ? void 0 : l.breadcrumbs : a.length !== 0 ? a : [];
21
48
  };
22
- function y() {
23
- if (!u.value || u.value.noAffix) {
24
- c.value.forEach((e) => {
25
- e.active = !1;
49
+ function A() {
50
+ if (!i.value || i.value.noAffix) {
51
+ s.value.forEach((t) => {
52
+ t.active = !1;
26
53
  });
27
54
  return;
28
55
  }
29
- const { name: t, title: l } = u.value;
30
- let a = -1;
31
- c.value.forEach((e, s) => {
32
- e.active = !1, e.name === t && (a = s);
56
+ const { name: a, title: e } = i.value;
57
+ let n = -1;
58
+ s.value.forEach((t, c) => {
59
+ t.active = !1, t.name === a && (n = c);
33
60
  });
34
- const n = {
35
- name: t,
36
- parentNames: v.value.map((e) => e.name),
37
- title: l ?? t,
38
- fullPath: r.fullPath,
61
+ const l = {
62
+ name: a,
63
+ parentNames: v.value.map((t) => t.name),
64
+ title: e ?? a,
65
+ fullPath: o.fullPath,
39
66
  active: !0
40
67
  };
41
- if (~a) {
42
- const e = c.value[a];
43
- e.fullPath === r.fullPath ? (e.active = !0, e.fullPath = r.fullPath) : (c.value.splice(a, 1), setTimeout(() => {
44
- c.value.push(n);
68
+ if (~n) {
69
+ const t = s.value[n];
70
+ t.fullPath === o.fullPath ? (t.active = !0, t.fullPath = o.fullPath) : (s.value.splice(n, 1), setTimeout(() => {
71
+ s.value.push(l);
45
72
  }));
46
73
  } else
47
- c.value.push(n);
74
+ s.value.push(l);
48
75
  }
49
- const A = (t) => {
50
- const l = c.value.findIndex((n) => n.name === t), a = c.value[l];
51
- b.push(a.fullPath);
52
- }, E = (t) => {
53
- let l = -1, a = -1;
54
- if (c.value.forEach((e, s) => {
55
- e.name === t && (a = s), e.active && (l = s);
56
- }), l === a) {
57
- let e;
58
- a === 0 ? e = c.value[a + 1] : e = c.value[a - 1], e.active = !0, b.push(e.fullPath);
76
+ const w = (a) => {
77
+ const e = s.value.findIndex((l) => l.name === a), n = s.value[e];
78
+ h.push(n.fullPath);
79
+ }, K = (a) => {
80
+ let e = -1, n = -1;
81
+ if (s.value.forEach((t, c) => {
82
+ t.name === a && (n = c), t.active && (e = c);
83
+ }), e === n) {
84
+ let t;
85
+ n === 0 ? t = s.value[n + 1] : t = s.value[n - 1], t.active = !0, h.push(t.fullPath);
59
86
  }
60
- const n = c.value.splice(a, 1);
61
- I(n[0]);
62
- }, g = () => {
63
- var l;
64
- if (o != null && o.disableKeepAlive || (l = r == null ? void 0 : r.meta) != null && l.ignoreCache)
87
+ const l = s.value.splice(n, 1);
88
+ O(l[0]);
89
+ }, J = () => {
90
+ var e;
91
+ if (u != null && u.disableKeepAlive || (e = o == null ? void 0 : o.meta) != null && e.ignoreCache)
65
92
  return;
66
- const t = new Set(f.value);
67
- v.value.forEach((a) => {
68
- a.name && t.add(a.name);
69
- }), f.value = Array.from(t.values());
70
- }, I = (t) => {
71
- const l = new Set(f.value);
72
- t.parentNames.forEach((a) => {
73
- l.delete(a);
74
- }), c.value.forEach((a) => {
75
- a.parentNames.forEach((n) => {
76
- const e = d.value[n];
77
- e != null && e.ignoreCache || l.add(e.name);
93
+ const a = new Set(p.value);
94
+ v.value.forEach((n) => {
95
+ n.name && a.add(n.name);
96
+ }), p.value = Array.from(a.values());
97
+ }, O = (a) => {
98
+ const e = new Set(p.value);
99
+ a.parentNames.forEach((n) => {
100
+ e.delete(n);
101
+ }), s.value.forEach((n) => {
102
+ n.parentNames.forEach((l) => {
103
+ const t = M.value[l];
104
+ t != null && t.ignoreCache || e.add(t.name);
78
105
  });
79
- }), f.value = Array.from(l.values());
106
+ }), p.value = Array.from(e.values());
80
107
  };
81
- return T(h, () => {
82
- const t = {}, l = (a) => {
83
- a.forEach((n) => {
84
- n.children && n.children.length > 0 && l(n.children), delete n.children, t[n.name] = n;
108
+ return g(() => d.value, () => {
109
+ const a = {}, e = (n) => {
110
+ n.forEach((l) => {
111
+ l.children && l.children.length > 0 && e(l.children), delete l.children, a[l.name] = l;
85
112
  });
86
113
  };
87
- l(JSON.parse(JSON.stringify(h.value))), d.value = t;
88
- }, { immediate: !0 }), T(() => r == null ? void 0 : r.name, () => {
89
- var l;
90
- const t = r == null ? void 0 : r.name;
91
- u.value = d.value[t], m.value = u != null && u.value ? [u.value.name, ...((l = u.value) == null ? void 0 : l.activatedKeys) || []] : [], N(), k(), o.hideTabs || y(), g();
114
+ e(JSON.parse(JSON.stringify(d.value))), M.value = a;
115
+ }, { immediate: !0 }), g(() => [u.layout, d.value], () => {
116
+ var a;
117
+ if (b.value = [], f.value = [], u.layout === P.side)
118
+ f.value = d.value;
119
+ else if (u.layout === P.mix) {
120
+ const e = (a = d.value) == null ? void 0 : a.filter((n) => n.topMenu);
121
+ (e == null ? void 0 : e.length) === 0 ? f.value = d.value : b.value = e;
122
+ }
123
+ }, { immediate: !0 }), g(() => o == null ? void 0 : o.name, () => {
124
+ var n, l, t;
125
+ const a = o == null ? void 0 : o.name;
126
+ i.value = M.value[a], S();
127
+ const e = v.value.filter((c) => c.topMenu);
128
+ e.length > 0 && b.value.length > 0 && (f.value = ((n = e[e.length - 1]) == null ? void 0 : n.children) || []), y.value = i != null && i.value ? [...e.map((c) => c.name), ...((l = i.value) == null ? void 0 : l.activatedKeys) || []] : [], T.value = i != null && i.value ? [i.value.name, ...((t = i.value) == null ? void 0 : t.activatedKeys) || []] : [], x(), u.hideTabs || A(), J();
92
129
  }, { immediate: !0 }), {
93
- menuSelectedKeys: m,
94
- activeMenuItem: u,
95
- menuItemMap: d,
96
- breadcrumbItems: p,
97
- tabs: c,
98
- keepAliveInclude: f,
99
- onMenuItemClick: P,
100
- onTabClick: A,
101
- onTabDelete: E
130
+ topMenuItems: b,
131
+ siderMenuItems: f,
132
+ topMenuSelectedKeys: y,
133
+ siderMenuSelectedKeys: T,
134
+ activeMenuItem: i,
135
+ menuItemMap: M,
136
+ breadcrumbItems: k,
137
+ tabs: s,
138
+ keepAliveInclude: p,
139
+ onProMenuItemClick: N,
140
+ onTabClick: w,
141
+ onTabDelete: K
102
142
  };
103
143
  }
104
144
  export {
105
- J as useHooks
145
+ z as useHooks
106
146
  };