@pubinfo/core 2.1.10-beta.2 → 2.1.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.
Files changed (88) hide show
  1. package/dist/{AppSetting-Dl8pVkN4.js → AppSetting-7jlhUzze.js} +42 -42
  2. package/dist/{HButton-CzYSwI6a.js → HButton-Dt6qGhhR.js} +7 -7
  3. package/dist/{HCheckList-CHR-lWIq.js → HCheckList-cPBgATmv.js} +15 -15
  4. package/dist/{HDivider-CXS9rl4C.js → HDivider-BwvBr5OE.js} +3 -3
  5. package/dist/{HInput-CSVwTg1Q.js → HInput-KJ5nFBpF.js} +10 -10
  6. package/dist/HSlideover-DVQDc9q6.js +3151 -0
  7. package/dist/{HToggle-C_iVIpxv.js → HToggle-Ce_2-yhZ.js} +8 -8
  8. package/dist/{HTooltip-BHBHfrCD.js → HTooltip-DjAU-Evn.js} +6 -6
  9. package/dist/PreferencesContent-BAIH81yS.js +701 -0
  10. package/dist/SettingBreadcrumb-O9-PhAFT.js +45 -0
  11. package/dist/SettingCopyright-DIKsWTuf.js +45 -0
  12. package/dist/{SettingEnableTransition-BBH52KKl.js → SettingEnableTransition-61O7W00b.js} +19 -19
  13. package/dist/SettingHome-Sv65TPH8.js +31 -0
  14. package/dist/SettingMenu-BvwJOUZV.js +111 -0
  15. package/dist/{SettingMode-BwhhUYlz.js → SettingMode-B8H_eQc8.js} +14 -14
  16. package/dist/SettingNavSearch-BHsmYBA7.js +31 -0
  17. package/dist/SettingOther-CyyNnaDX.js +48 -0
  18. package/dist/SettingPage-B82lW41P.js +22 -0
  19. package/dist/{SettingTabbar-DuqQVRnz.js → SettingTabbar-Bky2xvH-.js} +58 -58
  20. package/dist/{SettingThemes-Doo6Ax3u.js → SettingThemes-CkdzS1xt.js} +44 -44
  21. package/dist/SettingToolbar-CD4qns1J.js +50 -0
  22. package/dist/SettingTopbar-1shjoe3s.js +49 -0
  23. package/dist/{SettingWidthMode-VaN0CrBa.js → SettingWidthMode-DlG6lXjA.js} +14 -14
  24. package/dist/auth-BLGKOyc5.js +4432 -0
  25. package/dist/built-in/layout-component/composables/useContext.d.ts +1 -0
  26. package/dist/{change-organization-OjxZhWST.js → change-organization-hsqeSzDu.js} +38 -38
  27. package/dist/{change-password-B6kO54-d.js → change-password-EtccCDRX.js} +73 -73
  28. package/dist/{chunk-EsrJ1IKw.js → chunk-CD4vhpVs.js} +3 -3
  29. package/dist/{components-DVIyiEVI.js → components-DFNyaAb9.js} +1584 -1584
  30. package/dist/core/request.d.ts +1 -1
  31. package/dist/core-DJIGzMMM.js +4885 -0
  32. package/dist/dist-7OjQvlya.js +468 -0
  33. package/dist/engine-oniguruma-CaNXwGSv.js +243 -0
  34. package/dist/features/settings/index.d.ts +90 -1
  35. package/dist/{form-EQ9eL9hv.js → form-C3VHofnN.js} +923 -443
  36. package/dist/index.js +4418 -3895
  37. package/dist/{modal-CSWipFvB.js → modal-Bl5xHbxa.js} +15510 -15790
  38. package/dist/{not-found-DBe-djEg.js → not-found-BCjngLzt.js} +19 -19
  39. package/dist/{not-permission-DQzWCpOK.js → not-permission-C26vTMvf.js} +19 -19
  40. package/dist/{profile-DJ3gpjsS.js → profile-BVXIFuBG.js} +3340 -3277
  41. package/dist/{question-line-BKVlJGUb.js → question-line-BG__Ycfv.js} +2 -2
  42. package/dist/{reload-DAR8dVYw.js → reload-DHx5Vwus.js} +4 -4
  43. package/dist/{right-VKgVtqD5.js → right-BxBlFUwj.js} +6 -6
  44. package/dist/style.css +1 -1
  45. package/dist/{tree-select-CTjWj5WT.js → tree-select-B8cTcGLa.js} +2575 -2256
  46. package/dist/watchDiff-CPZFtaOC.js +655 -0
  47. package/package.json +41 -41
  48. package/src/built-in/layout-component/components/Header/HeaderMenu.vue +2 -3
  49. package/src/built-in/layout-component/components/Menu/item.vue +2 -2
  50. package/src/built-in/layout-component/components/Menu/sub.vue +20 -1
  51. package/src/built-in/layout-component/composables/useContext.ts +1 -0
  52. package/src/built-in/layout-component/composables/useLayoutVisible.ts +1 -1
  53. package/src/built-in/layout-component/provider.ts +5 -0
  54. package/src/built-in/system-info/components/SystemInfo.vue +68 -66
  55. package/src/built-in/system-info/index.ts +4 -4
  56. package/src/core/ctx.ts +2 -2
  57. package/src/core/request.ts +1 -1
  58. package/src/features/components/PubinfoApp/index.vue +1 -0
  59. package/types/auto-imports.d.ts +63 -63
  60. package/types/components.d.ts +45 -1
  61. package/dist/HSlideover-Bc6OHPHe.js +0 -1695
  62. package/dist/HeaderFullMenu-BRhGliRJ.js +0 -6
  63. package/dist/HeaderFullMenu-DCF-gTCZ.js +0 -249
  64. package/dist/HeaderThinMenu-B_7vLcQX.js +0 -6
  65. package/dist/HeaderThinMenu-PA12XAvb.js +0 -437
  66. package/dist/PreferencesContent-cll4nwwl.js +0 -695
  67. package/dist/SettingBreadcrumb-BvSc7VUo.js +0 -45
  68. package/dist/SettingCopyright-DcWLKM5d.js +0 -45
  69. package/dist/SettingHome-Cd43oJmB.js +0 -31
  70. package/dist/SettingMenu-CJsN4F1l.js +0 -111
  71. package/dist/SettingNavSearch-BhHUWem3.js +0 -31
  72. package/dist/SettingOther-CDY0jSVT.js +0 -48
  73. package/dist/SettingPage-B0WNvUlj.js +0 -22
  74. package/dist/SettingToolbar-CHV_dVJ9.js +0 -50
  75. package/dist/SettingTopbar-CF1K_XIt.js +0 -49
  76. package/dist/auth-CPSkJwBz.js +0 -3968
  77. package/dist/core-Bg2PEcZK.js +0 -4884
  78. package/dist/dist-DAb-7mqe.js +0 -468
  79. package/dist/engine-oniguruma-CUfGsBrF.js +0 -243
  80. package/dist/overlayscrollbars-vue-BOGU2FK-.js +0 -1436
  81. package/dist/pick-C42gkI1h.js +0 -10
  82. package/dist/watchDiff-C4eGkl9e.js +0 -397
  83. /package/dist/{_plugin-vue_export-helper-DaPiLSxE.js → _plugin-vue_export-helper-sUTDUeGO.js} +0 -0
  84. /package/dist/{json-S7wVLDnW.js → json-Bu_Zprin.js} +0 -0
  85. /package/dist/{useContext-D6pJCZez.js → useContext-DLtu9F7E.js} +0 -0
  86. /package/dist/{vitesse-dark-BsnBIHGG.js → vitesse-dark-CTe40QT_.js} +0 -0
  87. /package/dist/{vitesse-light-Cs_6DF7j.js → vitesse-light-BWXC_WeB.js} +0 -0
  88. /package/dist/{wasm-EvDQvzqp.js → wasm-2zDVqo-C.js} +0 -0
@@ -1,437 +0,0 @@
1
- import { n as message_default } from "./modal-CSWipFvB.js";
2
- import { d as useTimeoutFn } from "./dist-DAb-7mqe.js";
3
- import { a as PubinfoIcon_default } from "./components-DVIyiEVI.js";
4
- import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-DaPiLSxE.js";
5
- import { n as useContext } from "./useContext-D6pJCZez.js";
6
- import { t as P } from "./overlayscrollbars-vue-BOGU2FK-.js";
7
- import { usePartyLogin } from "./index.js";
8
- import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, shallowRef, toDisplayString, toHandlers, unref, watch, withCtx, withModifiers } from "vue";
9
- import { useRoute, useRouter } from "vue-router";
10
- var _hoisted_1$1 = { class: "relative inline-flex" }, _hoisted_2 = {
11
- key: 0,
12
- class: "absolute left-[50%] top-0 z-20 whitespace-nowrap rounded-full bg-ui-primary px-1.5 text-xs text-ui-text ring-1 ring-light -translate-y-[50%] dark:ring-dark"
13
- }, HBadge_default = /* @__PURE__ */ defineComponent({
14
- __name: "HBadge",
15
- props: { value: { type: [
16
- String,
17
- Number,
18
- Boolean
19
- ] } },
20
- setup(i) {
21
- let k = i, A = computed(() => {
22
- switch (typeof k.value) {
23
- case "string": return k.value.length > 0;
24
- case "number": return k.value > 0;
25
- case "boolean": return k.value;
26
- default: return k.value !== void 0 && k.value !== null;
27
- }
28
- }), j = ref({
29
- enterActiveClass: "ease-in-out duration-500",
30
- enterFromClass: "opacity-0",
31
- enterToClass: "opacity-100",
32
- leaveActiveClass: "ease-in-out duration-500",
33
- leaveFromClass: "opacity-100",
34
- leaveToClass: "opacity-0"
35
- });
36
- return (k, M) => (openBlock(), createElementBlock("div", _hoisted_1$1, [renderSlot(k.$slots, "default"), createVNode(Transition, normalizeProps(guardReactiveProps(unref(j))), {
37
- default: withCtx(() => [unref(A) ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(i.value), 1)) : createCommentVNode("", !0)]),
38
- _: 1
39
- }, 16)]));
40
- }
41
- });
42
- function createInjectionKey(i) {
43
- return i;
44
- }
45
- const rootMenuInjectionKey = createInjectionKey("rootMenu");
46
- var _hoisted_1 = ["title"], item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
47
- name: "MenuItem",
48
- __name: "item",
49
- props: {
50
- uniqueKey: {},
51
- item: {},
52
- level: { default: 0 },
53
- subMenu: {
54
- type: Boolean,
55
- default: !1
56
- },
57
- expand: {
58
- type: Boolean,
59
- default: !1
60
- }
61
- },
62
- setup(i, { expose: k }) {
63
- let j = i, N = inject(rootMenuInjectionKey), { generateTitle: F } = useContext(), I = ref(), L = computed(() => j.subMenu ? N.subMenus[j.uniqueKey[j.uniqueKey.length - 1]]?.active : N.activeIndex === j.uniqueKey[j.uniqueKey.length - 1]), z = computed(() => L.value && (!j.subMenu || N.isMenuPopup)), B = computed(() => {
64
- let i;
65
- return j.item.meta?.icon && (i = j.item.meta.icon), L.value && (j.item.meta?.activeIcon === "system-point" ? i = "system-point" : j.item.meta?.activeIcon && (i = j.item.meta.activeIcon)), i;
66
- }), V = computed(() => j.item.meta?.iconOptions), U = computed(() => {
67
- let i = V.value?.boxType;
68
- return i && i !== "null" ? i : void 0;
69
- }), W = computed(() => V.value?.iconColor || void 0), G = computed(() => N.isMenuPopup ? "" : `padding-left: ${32 * (j.level ?? 0)}px`);
70
- return k({ ref: I }), (k, j) => {
71
- let M = HBadge_default;
72
- return openBlock(), createElementBlock("div", {
73
- ref_key: "itemRef",
74
- ref: I,
75
- class: normalizeClass(["menu-item relative transition-all", {
76
- active: unref(z),
77
- "px-2 py-1": unref(N).props.rounded,
78
- "px-1! py-2!": unref(N).props.rounded && unref(N).isMenuPopup && i.level === 0 && unref(N).props.mode === "horizontal"
79
- }])
80
- }, [createElementVNode("div", {
81
- class: normalizeClass(["group menu-item-container h-full w-full flex cursor-pointer items-center justify-between gap-1 px-5 py-14px text-[var(--g-sub-sidebar-menu-color)] transition-all hover:(bg-[var(--g-sub-sidebar-menu-hover-bg)] text-[var(--g-sub-sidebar-menu-hover-color)])", {
82
- "text-[var(--g-sub-sidebar-menu-active-color)]! bg-[var(--g-sub-sidebar-menu-active-bg)]!": unref(z),
83
- "rounded-2": unref(N).props.rounded,
84
- "px-2!": unref(N).isMenuPopup && i.level === 0,
85
- "py-3!": unref(N).props.rounded && unref(N).isMenuPopup && i.level !== 0
86
- }]),
87
- title: unref(F)(i.item.meta?.title)
88
- }, [createElementVNode("div", {
89
- class: normalizeClass(["menu-item-container-layout inline-flex flex-1 items-center justify-center gap-[12px]", {
90
- "flex-col gap-none": unref(N).isMenuPopup && i.level === 0,
91
- "flex-col gap-[2px]!": unref(N).isMenuPopup && i.level === 0 && unref(N).props.showCollapseName,
92
- "w-full": unref(N).isMenuPopup && i.level === 0 && unref(N).props.showCollapseName && unref(N).props.mode === "vertical",
93
- "w-[50px]": unref(N).isMenuPopup && i.level === 0 && unref(N).props.showCollapseName && unref(N).props.mode === "horizontal"
94
- }]),
95
- style: normalizeStyle(unref(G))
96
- }, [
97
- unref(B) && unref(B) !== "system-point" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(V) && unref(U) ? (openBlock(), createBlock(unref(PubinfoIcon_default), {
98
- key: 0,
99
- small: "",
100
- name: unref(B),
101
- box: unref(U),
102
- size: 20,
103
- "icon-size": unref(V)?.iconSize,
104
- angle: unref(V)?.angle,
105
- background: unref(V)?.background,
106
- radius: unref(V)?.radius,
107
- color: (unref(B) || "").startsWith("antd:") ? unref(W) || "#ffffff" : void 0,
108
- class: "menu-item-container-icon transition-transform group-hover:scale-115"
109
- }, null, 8, [
110
- "name",
111
- "box",
112
- "icon-size",
113
- "angle",
114
- "background",
115
- "radius",
116
- "color"
117
- ])) : (openBlock(), createBlock(unref(PubinfoIcon_default), {
118
- key: 1,
119
- name: unref(B),
120
- size: 20,
121
- color: (unref(B) || "").startsWith("antd:") ? unref(W) : void 0,
122
- class: "menu-item-container-icon transition-transform group-hover:scale-115"
123
- }, null, 8, ["name", "color"]))], 64)) : createCommentVNode("", !0),
124
- unref(N).isMenuPopup && i.level === 0 && !unref(N).props.showCollapseName ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
125
- key: 1,
126
- class: normalizeClass(["title w-0 flex-1 truncate text-sm transition-height transition-opacity transition-width", {
127
- "opacity-0 w-0 h-0": unref(N).isMenuPopup && i.level === 0 && !unref(N).props.showCollapseName,
128
- "w-full text-center": unref(N).isMenuPopup && i.level === 0 && unref(N).props.showCollapseName,
129
- "system-point": unref(B) === "system-point" && unref(z)
130
- }])
131
- }, toDisplayString(unref(F)(i.item.meta?.title)), 3)),
132
- i.item.meta?.badge ? (openBlock(), createBlock(M, {
133
- key: 2,
134
- value: typeof i.item.meta.badge == "function" ? i.item.meta.badge() : i.item.meta.badge,
135
- class: normalizeClass(["badge", { "opacity-0": unref(N).isMenuPopup && i.level === 0 }])
136
- }, null, 8, ["value", "class"])) : createCommentVNode("", !0)
137
- ], 6), i.subMenu && !(unref(N).isMenuPopup && i.level === 0) ? (openBlock(), createElementBlock("i", {
138
- key: 0,
139
- class: normalizeClass(["sharp-corner", [
140
- i.expand ? "before:-rotate-45 before:-translate-x-[2px] after:rotate-45 after:translate-x-[2px]" : "before:rotate-45 before:-translate-x-[2px] after:-rotate-45 after:translate-x-[2px] ",
141
- unref(N).isMenuPopup && i.level === 0 && "opacity-0",
142
- unref(N).isMenuPopup && i.level !== 0 && "-rotate-90 -top-[1.5px]"
143
- ]])
144
- }, null, 2)) : createCommentVNode("", !0)], 10, _hoisted_1)], 2);
145
- };
146
- }
147
- }), [["__scopeId", "data-v-dd5786b9"]]), sub_default = /* @__PURE__ */ defineComponent({
148
- name: "SubMenu",
149
- __name: "sub",
150
- props: {
151
- uniqueKey: {},
152
- menu: {},
153
- level: { default: 0 }
154
- },
155
- setup(i) {
156
- let A = i, j = A.menu.path ?? JSON.stringify(A.menu), M = shallowRef(), F = shallowRef(), R = inject(rootMenuInjectionKey), B = computed(() => R.openedMenus.includes(A.uniqueKey[A.uniqueKey.length - 1])), V = computed(() => R.isMenuPopup ? {
157
- enter(i) {
158
- i.offsetHeight > window.innerHeight && (i.style.height = `${window.innerHeight}px`);
159
- },
160
- afterEnter: () => {},
161
- beforeLeave: (i) => {
162
- i.style.overflow = "hidden", i.style.maxHeight = `${i.offsetHeight}px`;
163
- },
164
- leave: (i) => {
165
- i.style.maxHeight = "0";
166
- },
167
- afterLeave(i) {
168
- i.style.overflow = "", i.style.maxHeight = "";
169
- }
170
- } : {
171
- enter(i) {
172
- let k = i.offsetHeight;
173
- i.style.maxHeight = "0", i.style.overflow = "hidden", i.offsetHeight, i.style.maxHeight = `${k}px`;
174
- },
175
- afterEnter(i) {
176
- i.style.overflow = "", i.style.maxHeight = "";
177
- },
178
- beforeLeave(i) {
179
- i.style.overflow = "hidden", i.style.maxHeight = `${i.offsetHeight}px`;
180
- },
181
- leave(i) {
182
- i.style.maxHeight = "0";
183
- },
184
- afterLeave(i) {
185
- i.style.overflow = "", i.style.maxHeight = "";
186
- }
187
- }), G = computed(() => R.isMenuPopup ? {
188
- enterActiveClass: "ease-in-out duration-300",
189
- enterFromClass: "opacity-0 translate-x-4",
190
- enterToClass: "opacity-100",
191
- leaveActiveClass: "ease-in-out duration-300",
192
- leaveFromClass: "opacity-100",
193
- leaveToClass: "opacity-0"
194
- } : {
195
- enterActiveClass: "ease-in-out duration-300",
196
- enterFromClass: "opacity-0",
197
- enterToClass: "opacity-100",
198
- leaveActiveClass: "ease-in-out duration-300",
199
- leaveFromClass: "opacity-100",
200
- leaveToClass: "opacity-0"
201
- }), K = computed(() => {
202
- let i = !0;
203
- return A.menu.children ? A.menu.children.every((i) => i.meta?.sidebar === !1) && (i = !1) : i = !1, i;
204
- });
205
- function q() {
206
- R.isMenuPopup && K.value || (K.value ? R.handleSubMenuClick(j, A.uniqueKey) : R.handleMenuItemClick(j, A.menu.meta));
207
- }
208
- let J;
209
- function Y() {
210
- R.isMenuPopup && (R.mouseInMenu = A.uniqueKey, J?.(), {stop: J} = useTimeoutFn(() => {
211
- if (K.value) R.openMenu(j, A.uniqueKey), nextTick(() => {
212
- let i = M.value.ref, k = 0, j = 0;
213
- R.props.mode === "vertical" || A.level !== 0 ? (k = i.getBoundingClientRect().top + i.scrollTop, j = i.getBoundingClientRect().left + i.getBoundingClientRect().width, k + F.value.getElement().offsetHeight > window.innerHeight && (k = window.innerHeight - F.value.getElement().offsetHeight)) : (k = i.getBoundingClientRect().top + i.getBoundingClientRect().height, j = i.getBoundingClientRect().left, k + F.value.getElement().offsetHeight > window.innerHeight && (F.value.getElement().style.height = `${window.innerHeight - k}px`)), F.value.getElement().style.top = `${k}px`, F.value.getElement().style.left = `${j}px`;
214
- });
215
- else {
216
- let i = A.menu.children ? R.subMenus[j].indexPath.at(-1) : R.items[j].indexPath.at(-1);
217
- R.openMenu(i, R.subMenus[i].indexPath);
218
- }
219
- }, 300));
220
- }
221
- function X() {
222
- R.isMenuPopup && (R.mouseInMenu = [], J?.(), {stop: J} = useTimeoutFn(() => {
223
- R.mouseInMenu.length === 0 ? R.closeMenu(A.uniqueKey) : K.value && (R.mouseInMenu.includes(A.uniqueKey.at(-1)) || R.closeMenu(A.uniqueKey.at(-1)));
224
- }, 300));
225
- }
226
- return (k, A) => {
227
- let j = resolveComponent("SubMenu");
228
- return openBlock(), createElementBlock(Fragment, null, [createVNode(item_default, {
229
- ref_key: "itemRef",
230
- ref: M,
231
- "unique-key": i.uniqueKey,
232
- item: i.menu,
233
- level: i.level,
234
- "sub-menu": unref(K),
235
- expand: unref(B),
236
- onClick: q,
237
- onMouseenter: Y,
238
- onMouseleave: X
239
- }, null, 8, [
240
- "unique-key",
241
- "item",
242
- "level",
243
- "sub-menu",
244
- "expand"
245
- ]), unref(K) ? (openBlock(), createBlock(Teleport, {
246
- key: 0,
247
- to: "body",
248
- disabled: !unref(R).isMenuPopup
249
- }, [createVNode(Transition, mergeProps(unref(G), toHandlers(unref(V))), {
250
- default: withCtx(() => [unref(B) ? (openBlock(), createBlock(unref(P), {
251
- key: 0,
252
- ref_key: "subMenuRef",
253
- ref: F,
254
- options: { scrollbars: { visibility: "hidden" } },
255
- defer: "",
256
- class: normalizeClass(["sub-menu", {
257
- "bg-[var(--g-sub-sidebar-bg)]": unref(R).isMenuPopup,
258
- "ring-1 ring-stone-2 dark:ring-stone-8 shadow-xl fixed z-3000 w-[200px]": unref(R).isMenuPopup,
259
- "mx-2": unref(R).isMenuPopup && (unref(R).props.mode === "vertical" || i.level !== 0),
260
- "rounded-2 py-1": unref(R).props.rounded && unref(R).isMenuPopup
261
- }])
262
- }, {
263
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(i.menu.children, (k) => (openBlock(), createElementBlock(Fragment, { key: k.path ?? JSON.stringify(k) }, [k.meta?.sidebar === !1 ? createCommentVNode("", !0) : (openBlock(), createBlock(j, {
264
- key: 0,
265
- "unique-key": [...i.uniqueKey, k.path ?? JSON.stringify(k)],
266
- menu: k,
267
- level: i.level + 1
268
- }, null, 8, [
269
- "unique-key",
270
- "menu",
271
- "level"
272
- ]))], 64))), 128))]),
273
- _: 1
274
- }, 8, ["class"])) : createCommentVNode("", !0)]),
275
- _: 1
276
- }, 16)], 8, ["disabled"])) : createCommentVNode("", !0)], 64);
277
- };
278
- }
279
- }), Menu_default = /* @__PURE__ */ defineComponent({
280
- name: "MainMenu",
281
- __name: "index",
282
- props: {
283
- menu: {},
284
- value: {},
285
- accordion: {
286
- type: Boolean,
287
- default: !0
288
- },
289
- defaultOpeneds: { default: () => [] },
290
- mode: { default: "vertical" },
291
- collapse: {
292
- type: Boolean,
293
- default: !1
294
- },
295
- showCollapseName: {
296
- type: Boolean,
297
- default: !1
298
- },
299
- rounded: {
300
- type: Boolean,
301
- default: !1
302
- }
303
- },
304
- setup(k) {
305
- let A = k, j = useRouter(), M = ref(A.value), N = ref({}), I = ref({}), L = ref(A.defaultOpeneds.slice(0)), R = ref([]), z = computed(() => A.mode === "horizontal" || A.mode === "vertical" && A.collapse);
306
- function B(i = [], k = []) {
307
- i.forEach((i) => {
308
- let A = i.path ?? JSON.stringify(i);
309
- if (i.children && i.children.length > 0) {
310
- let j = [...k, A];
311
- I.value[A] = {
312
- index: A,
313
- indexPath: j,
314
- active: !1
315
- }, B(i.children, j);
316
- } else N.value[A] = {
317
- index: A,
318
- indexPath: k
319
- };
320
- });
321
- }
322
- let V = (i, k) => {
323
- L.value.includes(i) || (A.accordion && (L.value = L.value.filter((i) => k.includes(i))), L.value.push(i));
324
- }, H = (i) => {
325
- if (Array.isArray(i)) {
326
- nextTick(() => {
327
- H(i.at(-1)), i.length > 1 && H(i.slice(0, -1));
328
- });
329
- return;
330
- }
331
- Object.keys(I.value).forEach((k) => {
332
- I.value[k].indexPath.includes(i) && (L.value = L.value.filter((k) => k !== i));
333
- });
334
- };
335
- function U(i) {
336
- Object.keys(I.value).forEach((i) => {
337
- I.value[i].active = !1;
338
- }), N.value[i]?.indexPath.forEach((i) => {
339
- I.value[i].active = !0;
340
- });
341
- }
342
- let G = async (k, M) => {
343
- if (M?.isDev) {
344
- message_default.info("暂未上线,敬请期待!");
345
- return;
346
- }
347
- if ((A.mode === "horizontal" || A.collapse) && (L.value = []), U(k), M?.link) {
348
- let i = M?.partyLogin;
349
- if (i && Array.isArray(i) && i.length > 0) {
350
- let { url: k } = await usePartyLogin(i, M.link);
351
- window.open(k.value);
352
- } else window.open(M.link);
353
- return;
354
- }
355
- j.push(k);
356
- }, K = (i, k) => {
357
- L.value.includes(i) ? H(i) : V(i, k);
358
- };
359
- function X() {
360
- let i = M.value && N.value[M.value];
361
- U(M.value), !(!i || A.collapse) && i.indexPath.forEach((i) => {
362
- let k = I.value[i];
363
- k && V(i, k.indexPath);
364
- });
365
- }
366
- return watch(() => A.menu, (i) => {
367
- B(i), X();
368
- }, {
369
- deep: !0,
370
- immediate: !0
371
- }), watch(() => A.value, (i) => {
372
- N.value[i] || (M.value = "");
373
- let k = N.value[i] || M.value && N.value[M.value] || N.value[A.value];
374
- k ? M.value = k.index : M.value = i, X();
375
- }), watch(() => A.collapse, (i) => {
376
- i && (L.value = []), X();
377
- }), provide(rootMenuInjectionKey, reactive({
378
- props: A,
379
- items: N,
380
- subMenus: I,
381
- activeIndex: M,
382
- openedMenus: L,
383
- mouseInMenu: R,
384
- isMenuPopup: z,
385
- openMenu: V,
386
- closeMenu: H,
387
- handleMenuItemClick: G,
388
- handleSubMenuClick: K
389
- })), (i, j) => (openBlock(), createElementBlock("div", { class: normalizeClass(["flex flex-col of-hidden transition-all", {
390
- "w-[200px]": !unref(z) && A.mode === "vertical",
391
- "w-[64px]": unref(z) && A.mode === "vertical",
392
- "h-[80px]": A.mode === "horizontal",
393
- "flex-row! w-auto": unref(z) && A.mode === "horizontal"
394
- }]) }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.menu, (i, k) => (openBlock(), createElementBlock(Fragment, { key: k }, [i.children?.length && i.meta?.sidebar !== !1 ? (openBlock(), createBlock(sub_default, {
395
- key: 0,
396
- menu: i,
397
- "unique-key": [i.path ?? JSON.stringify(i)]
398
- }, null, 8, ["menu", "unique-key"])) : i.meta?.sidebar === !1 ? createCommentVNode("", !0) : (openBlock(), createBlock(item_default, {
399
- key: 1,
400
- item: i,
401
- "unique-key": [i.path ?? JSON.stringify(i)],
402
- onClick: (k) => G(i.path ?? JSON.stringify(i), i.meta)
403
- }, null, 8, [
404
- "item",
405
- "unique-key",
406
- "onClick"
407
- ]))], 64))), 128))], 2));
408
- }
409
- }), HeaderThinMenu_default = /* @__PURE__ */ defineComponent({
410
- name: "LayoutHeaderThinMenu",
411
- __name: "HeaderThinMenu",
412
- setup(i) {
413
- let k = useRoute(), { settingsStore: A, menuStore: j } = useContext(), N = ref();
414
- function F(i) {
415
- N.value.scrollBy({ left: (i.deltaY || i.detail) > 0 ? 50 : -50 });
416
- }
417
- return (i, M) => (openBlock(), createElementBlock("div", {
418
- ref_key: "menuRef",
419
- ref: N,
420
- class: "menu-container",
421
- onWheel: withModifiers(F, ["prevent"])
422
- }, [createVNode(Menu_default, {
423
- menu: unref(j).allMenus,
424
- value: unref(k).meta.activeMenu || unref(k).path,
425
- mode: "horizontal",
426
- "show-collapse-name": "",
427
- rounded: unref(A).settings.menu.isRounded,
428
- class: normalizeClass(["menu", { [`menu-active-${unref(A).settings.menu.menuActiveStyle}`]: unref(A).settings.menu.menuActiveStyle !== "" }])
429
- }, null, 8, [
430
- "menu",
431
- "value",
432
- "rounded",
433
- "class"
434
- ])], 544));
435
- }
436
- });
437
- export { Menu_default as n, HeaderThinMenu_default as t };