cosey 0.1.1 → 0.1.4

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 (321) hide show
  1. package/components/audio-card/audio-card.vue.js +1 -1
  2. package/components/audio-card/style/index.d.ts +1 -1
  3. package/components/audio-viewer/style/index.d.ts +1 -1
  4. package/components/close/close.vue.js +1 -1
  5. package/components/close/style/index.d.ts +1 -1
  6. package/components/col/style/index.d.ts +1 -1
  7. package/components/col/style/index.js +1 -1
  8. package/components/components.d.ts +98 -44
  9. package/components/config-provider/config-provider.js +1 -3
  10. package/components/config-provider/config-provider.vue.d.ts +2 -7
  11. package/components/config-provider/config-provider.vue.js +8 -4
  12. package/components/config-provider/index.d.ts +1 -1
  13. package/components/config-provider/override-element-plus.d.ts +3 -2
  14. package/components/config-provider/override-element-plus.js +2 -2
  15. package/components/container/container.d.ts +0 -1
  16. package/components/container/container.vue.js +0 -4
  17. package/components/container/style/index.d.ts +1 -1
  18. package/components/context-menu/content.vue.js +1 -1
  19. package/components/context-menu/context-menu.vue.js +2 -2
  20. package/components/context-menu/style/index.d.ts +1 -1
  21. package/components/copy/copy.d.ts +0 -2
  22. package/components/copy/copy.vue.d.ts +1 -7
  23. package/components/copy/copy.vue.js +1 -2
  24. package/components/copy/index.d.ts +3 -19
  25. package/components/copy/style/index.d.ts +1 -1
  26. package/components/cssinjs/parser.js +8 -25
  27. package/components/dnd-sort/dnd-sort-item.vue.js +3 -4
  28. package/components/dnd-sort/dnd-sort.vue.js +1 -2
  29. package/components/dnd-sort/index.d.ts +1 -1
  30. package/components/dnd-sort/style/index.d.ts +1 -1
  31. package/components/dnd-sort/style/index.js +1 -0
  32. package/components/editor/components/button-group.vue.d.ts +2 -7
  33. package/components/editor/components/button.vue.d.ts +2 -7
  34. package/components/editor/components/color-picker/color-picker.style.d.ts +1 -1
  35. package/components/editor/components/color-picker/color-picker.vue.d.ts +2 -43
  36. package/components/editor/components/color-picker/color-picker.vue.js +14 -11
  37. package/components/editor/components/list/list.style.d.ts +1 -1
  38. package/components/editor/components/picker/picker.style.d.ts +1 -1
  39. package/components/editor/components/picker/picker.vue.d.ts +2 -15
  40. package/components/editor/components/resize/resize.js +4 -4
  41. package/components/editor/components/resize/resize.style.d.ts +1 -1
  42. package/components/editor/components/resize/resize.style.js +9 -32
  43. package/components/editor/components/resize/resize.vue.js +21 -14
  44. package/components/editor/components/select-button.vue.d.ts +2 -9
  45. package/components/editor/components/select-button.vue.js +1 -1
  46. package/components/editor/components/split-button.vue.d.ts +2 -19
  47. package/components/editor/components/split-button.vue.js +1 -1
  48. package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +1 -1
  49. package/components/editor/components/table-toolbar/table-toolbar.vue.js +9 -9
  50. package/components/editor/components/toolbar/formats/align.vue.js +4 -4
  51. package/components/editor/components/toolbar/formats/blockquote.vue.js +1 -1
  52. package/components/editor/components/toolbar/formats/bold.vue.js +1 -1
  53. package/components/editor/components/toolbar/formats/clean.vue.js +1 -1
  54. package/components/editor/components/toolbar/formats/code-block.vue.js +1 -1
  55. package/components/editor/components/toolbar/formats/code.vue.js +1 -1
  56. package/components/editor/components/toolbar/formats/formula.vue.js +4 -3
  57. package/components/editor/components/toolbar/formats/image.vue.js +1 -1
  58. package/components/editor/components/toolbar/formats/indent.vue.js +2 -2
  59. package/components/editor/components/toolbar/formats/italic.vue.js +1 -1
  60. package/components/editor/components/toolbar/formats/link.vue.js +15 -13
  61. package/components/editor/components/toolbar/formats/list.vue.js +3 -3
  62. package/components/editor/components/toolbar/formats/script.vue.js +2 -2
  63. package/components/editor/components/toolbar/formats/size-delta.vue.js +2 -2
  64. package/components/editor/components/toolbar/formats/strike.vue.js +1 -1
  65. package/components/editor/components/toolbar/formats/table.style.d.ts +1 -1
  66. package/components/editor/components/toolbar/formats/table.vue.js +1 -1
  67. package/components/editor/components/toolbar/formats/underline.vue.js +1 -1
  68. package/components/editor/components/toolbar/formats/video.vue.js +1 -1
  69. package/components/editor/components/toolbar/toolbar.d.ts +1 -2
  70. package/components/editor/components/toolbar/toolbar.js +17 -21
  71. package/components/editor/components/toolbar/toolbarContext.js +1 -3
  72. package/components/editor/editor.d.ts +0 -2
  73. package/components/editor/editor.vue.js +1 -11
  74. package/components/editor/formats/image.d.ts +13 -0
  75. package/components/editor/formats/image.js +46 -0
  76. package/components/editor/formats/indent.d.ts +2 -0
  77. package/components/editor/formats/indent.js +12 -7
  78. package/components/editor/formats/link.js +1 -5
  79. package/components/editor/formats/list.d.ts +0 -4
  80. package/components/editor/formats/list.js +10 -5
  81. package/components/editor/formats/video.js +6 -9
  82. package/components/editor/modules/custom-list.js +1 -6
  83. package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +1 -1
  84. package/components/editor/modules/image-uploader/formats/image-loading.style.js +4 -4
  85. package/components/editor/modules/image-uploader/image-uploader.js +1 -3
  86. package/components/editor/quill.js +7 -4
  87. package/components/editor/quillContext.js +1 -3
  88. package/components/editor/style/hljs.d.ts +1 -1
  89. package/components/editor/style/index.d.ts +1 -1
  90. package/components/editor/style/index.js +1 -5
  91. package/components/field/components/checkbox-group/panel.vue.d.ts +2 -20
  92. package/components/field/components/checkbox-group/panel.vue.js +2 -2
  93. package/components/field/components/tree-select/tree-select.d.ts +1 -2
  94. package/components/field/components/tree-select/tree-select.js +69 -0
  95. package/components/file-card/file-card.vue.js +1 -1
  96. package/components/file-card/style/index.d.ts +1 -1
  97. package/components/form/form-item.vue.js +1 -1
  98. package/components/form/style/index.d.ts +1 -1
  99. package/components/form/useFormItemWidth.js +1 -1
  100. package/components/form/useFormTemplate.js +2 -10
  101. package/components/form-dialog/form-dialog.vue.d.ts +0 -1
  102. package/components/form-dialog/form-dialog.vue.js +1 -1
  103. package/components/form-dialog/index.d.ts +0 -3
  104. package/components/form-group/form-group.vue.js +1 -1
  105. package/components/form-list/form-list.js +1 -6
  106. package/components/form-list/form-list.vue.js +2 -2
  107. package/components/form-list/style/index.d.ts +1 -1
  108. package/components/form-query/form-query.vue.js +5 -5
  109. package/components/form-query/style/index.d.ts +1 -1
  110. package/components/highlight/highlight.d.ts +1 -1
  111. package/components/highlight/highlight.vue.js +11 -4
  112. package/components/highlight/style/index.d.ts +1 -1
  113. package/components/highlight/style/index.js +15 -5
  114. package/components/horizontal-tree/horizontal-tree.vue.js +16 -12
  115. package/components/horizontal-tree/style/index.d.ts +1 -1
  116. package/components/icon/style/index.d.ts +1 -1
  117. package/components/iconify-icon/iconify-icon.d.ts +3 -0
  118. package/components/iconify-icon/iconify-icon.js +9 -0
  119. package/components/iconify-icon/iconify-icon.vue.js +2 -5
  120. package/components/iconify-icon/index.js +1 -0
  121. package/components/image-card/style/index.d.ts +1 -1
  122. package/components/index.js +4 -2
  123. package/components/long-text/style/index.d.ts +1 -1
  124. package/components/mask/style/index.d.ts +1 -1
  125. package/components/media-card-group/media-card-group.vue.js +4 -3
  126. package/components/media-card-group/style/index.d.ts +1 -1
  127. package/components/panel/style/index.d.ts +1 -1
  128. package/components/row/style/index.d.ts +1 -1
  129. package/components/scroll-view/scroll-view.vue.js +1 -2
  130. package/components/scroll-view/style/index.d.ts +1 -1
  131. package/components/snug-menu/snug-menu.vue.js +1 -2
  132. package/components/snug-menu/style/index.d.ts +1 -1
  133. package/components/style/animation.d.ts +5 -0
  134. package/components/style/animation.js +33 -0
  135. package/components/style/index.d.ts +1 -1
  136. package/components/style/index.js +2 -2
  137. package/components/style/mixins.d.ts +2 -0
  138. package/components/style/mixins.js +10 -1
  139. package/components/table/index.d.ts +0 -8
  140. package/components/table/style/index.d.ts +1 -1
  141. package/components/table/style/index.js +2 -2
  142. package/components/table/table-column/renderer.js +22 -18
  143. package/components/table/table-column/style/index.d.ts +1 -1
  144. package/components/table/table-column/table-column.vue.d.ts +3 -3
  145. package/components/table/table-column-editor/item.vue.js +5 -8
  146. package/components/table/table-column-editor/style/index.d.ts +1 -1
  147. package/components/table/table-column-editor/style/index.js +1 -0
  148. package/components/table/table-column-editor/table-column-editor.vue.d.ts +2 -246
  149. package/components/table/table-column-editor/table-column-editor.vue.js +9 -9
  150. package/components/table/table-export/style/index.d.ts +1 -1
  151. package/components/table/table-export/table-export.vue.js +2 -2
  152. package/components/table/table-query/table-query.d.ts +0 -4
  153. package/components/table/table-query/table-query.js +0 -4
  154. package/components/table/table-query/table-query.vue.d.ts +0 -9
  155. package/components/table/table-query/table-query.vue.js +14 -12
  156. package/components/table/table.js +1 -3
  157. package/components/table/table.vue.js +22 -24
  158. package/components/table/useTable.js +1 -4
  159. package/components/table/utils.js +1 -3
  160. package/components/table-action/item.vue.js +5 -5
  161. package/components/table-action/style/index.d.ts +1 -1
  162. package/components/table-action/table-action.vue.js +4 -3
  163. package/components/theme/StyleContext.js +1 -3
  164. package/components/theme/createCacheToken.js +1 -4
  165. package/components/theme/getGlobalStyleHook.d.ts +2 -3
  166. package/components/theme/getGlobalStyleHook.js +5 -13
  167. package/components/theme/getOverrideStyleHook.d.ts +8 -0
  168. package/components/theme/getOverrideStyleHook.js +39 -0
  169. package/components/theme/getSimpleStyleHook.d.ts +2 -2
  170. package/components/theme/getSimpleStyleHook.js +4 -11
  171. package/components/theme/getStyleHook.d.ts +2 -2
  172. package/components/theme/getStyleHook.js +4 -11
  173. package/components/theme/index.d.ts +2 -1
  174. package/components/theme/index.js +1 -0
  175. package/components/theme/interface/index.d.ts +1 -1
  176. package/components/theme/theme-context.d.ts +11 -2
  177. package/components/theme/theme-context.js +36 -6
  178. package/components/theme/themes/shared/genColorMapToken.js +1 -4
  179. package/components/theme/useStyleRegister.d.ts +1 -7
  180. package/components/theme/useStyleRegister.js +3 -6
  181. package/components/theme/util/alias.js +4 -16
  182. package/components/theme/util/getAlphaColor.js +1 -6
  183. package/components/theme/util/normalizeStyle.js +1 -1
  184. package/components/theme/util/statistic.js +4 -1
  185. package/components/theme/util/useToken.d.ts +4 -4
  186. package/components/theme/util/useToken.js +7 -10
  187. package/components/toggle/toggle.vue.js +1 -1
  188. package/components/transition/style/index.d.ts +1 -1
  189. package/components/transition/transition.vue.js +1 -2
  190. package/components/transition-group/index.d.ts +3 -3
  191. package/components/transition-group/style/index.d.ts +1 -1
  192. package/components/transition-group/transition-group.vue.d.ts +1 -1
  193. package/components/upload/index.d.ts +0 -3
  194. package/components/upload/style/index.d.ts +1 -1
  195. package/components/upload/upload-item.vue.js +8 -8
  196. package/components/upload/upload.d.ts +0 -2
  197. package/components/upload/upload.js +0 -1
  198. package/components/upload/upload.vue.d.ts +0 -1
  199. package/components/upload/upload.vue.js +1 -5
  200. package/components/video-card/style/index.d.ts +1 -1
  201. package/components/video-card/video-card.vue.js +1 -1
  202. package/components/video-viewer/style/index.d.ts +1 -1
  203. package/config/http.d.ts +1 -1
  204. package/config/http.js +1 -1
  205. package/config/index.d.ts +23 -22
  206. package/config/index.js +2 -7
  207. package/config/layout.d.ts +36 -0
  208. package/config/layout.js +37 -1
  209. package/config/nprogress.style.d.ts +2 -0
  210. package/config/nprogress.style.js +51 -0
  211. package/config/root-config-provider.vue.d.ts +2 -20
  212. package/config/root-config-provider.vue.js +2 -0
  213. package/hooks/useColorScheme.js +5 -9
  214. package/hooks/useEcharts.js +2 -4
  215. package/hooks/useFetch.d.ts +1 -1
  216. package/hooks/useFetch.js +1 -7
  217. package/hooks/useFullPage.js +7 -9
  218. package/hooks/useLocale.js +1 -3
  219. package/hooks/useLockscreenObserver.js +1 -1
  220. package/hooks/usePersist.js +1 -3
  221. package/hooks/useTreeCheck.js +13 -26
  222. package/hooks/useUpsert.d.ts +15 -16
  223. package/hooks/useUpsert.js +3 -3
  224. package/index.d.ts +1 -0
  225. package/index.js +5 -4
  226. package/layout/index.js +2 -2
  227. package/layout/layout-aside/layout-aside.vue.js +2 -1
  228. package/layout/layout-aside/style/index.d.ts +1 -1
  229. package/layout/layout-auth/style/index.d.ts +1 -1
  230. package/layout/layout-base/layout-base.vue.js +9 -9
  231. package/layout/layout-base/style/index.d.ts +1 -1
  232. package/layout/layout-brand/style/index.d.ts +1 -1
  233. package/layout/layout-change-password/layout-change-password.vue.js +8 -8
  234. package/layout/layout-change-password/style/index.d.ts +1 -1
  235. package/layout/layout-change-password/style/index.js +1 -1
  236. package/layout/layout-color-scheme/layout-color-scheme.vue.js +8 -14
  237. package/layout/layout-color-scheme/style/index.d.ts +2 -5
  238. package/layout/layout-color-scheme/style/index.js +26 -44
  239. package/layout/layout-content/layout-content.vue.d.ts +2 -13
  240. package/layout/layout-content/style/index.d.ts +1 -1
  241. package/layout/layout-exception/style/index.d.ts +1 -1
  242. package/layout/layout-forbidden/layout-forbidden.vue.js +2 -2
  243. package/layout/layout-header/layout-header.vue.d.ts +2 -14
  244. package/layout/layout-header/style/index.d.ts +1 -1
  245. package/layout/layout-iframe/style/index.d.ts +1 -1
  246. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +2 -2
  247. package/layout/layout-login/layout-login.vue.js +5 -5
  248. package/layout/layout-login/style/index.d.ts +1 -1
  249. package/layout/layout-login/style/index.js +1 -1
  250. package/layout/layout-main/style/index.d.ts +1 -1
  251. package/layout/layout-mask/style/index.d.ts +1 -1
  252. package/layout/layout-mask/style/index.js +1 -1
  253. package/layout/layout-menu/layout-menu.vue.js +5 -0
  254. package/layout/layout-menu/style/index.d.ts +1 -1
  255. package/layout/layout-not-found/layout-not-found.vue.js +2 -2
  256. package/layout/layout-search/layout-search.vue.js +37 -34
  257. package/layout/layout-search/style/index.d.ts +1 -1
  258. package/layout/layout-sidebar/layout-sidebar.vue.d.ts +2 -15
  259. package/layout/layout-sidebar/style/index.d.ts +1 -1
  260. package/layout/layout-sidebar/style/index.js +1 -1
  261. package/layout/layout-snug-aside/style/index.d.ts +1 -1
  262. package/layout/layout-switch-effect/layout-switch-effect.vue.d.ts +2 -7
  263. package/layout/layout-switch-effect/style/index.d.ts +1 -1
  264. package/layout/layout-tabbar/layout-tabbar.vue.js +8 -3
  265. package/layout/layout-tabbar/reload.vue.js +1 -1
  266. package/layout/layout-tabbar/style/index.d.ts +1 -1
  267. package/layout/layout-tabbar/style/index.js +6 -2
  268. package/layout/layout-toggle/layout-toggle.vue.js +1 -1
  269. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +4 -3
  270. package/layout/layout-topbar/layout-topbar.vue.d.ts +2 -1217
  271. package/layout/layout-topbar/style/index.d.ts +1 -1
  272. package/layout/layout-user-menu/index.d.ts +1 -0
  273. package/layout/layout-user-menu/index.js +1 -0
  274. package/layout/{layout-user/layout-user.vue.js → layout-user-menu/layout-user-menu.vue.js} +18 -13
  275. package/layout/{layout-user → layout-user-menu}/style/index.d.ts +1 -1
  276. package/layout/{layout-user → layout-user-menu}/style/index.js +9 -5
  277. package/layout/layout.d.ts +1 -1
  278. package/layout/layout.js +1 -1
  279. package/layout/merged/index.d.ts +1 -1
  280. package/layout/merged/index.js +1 -1
  281. package/layout/merged/{layout-user.js → layout-user-menu.js} +1 -1
  282. package/layout/utils.js +1 -4
  283. package/package.json +16 -6
  284. package/request/useRequest.js +1 -1
  285. package/router/guard/auth.js +2 -5
  286. package/router/guard/index.js +2 -2
  287. package/router/guard/pageTitle.d.ts +2 -0
  288. package/router/guard/pageTitle.js +11 -0
  289. package/router/guard/progress.js +11 -1
  290. package/router/index.d.ts +22 -0
  291. package/router/index.js +1 -1
  292. package/router/routes/static/auth.js +5 -6
  293. package/router/routes/static/exception.js +3 -3
  294. package/router/utils.js +11 -3
  295. package/store/layout.d.ts +4 -10
  296. package/store/layout.js +19 -31
  297. package/store/user.d.ts +4 -4
  298. package/store/user.js +2 -1
  299. package/utils/array.js +3 -0
  300. package/utils/dynamicCSS.d.ts +3 -2
  301. package/utils/dynamicCSS.js +12 -1
  302. package/utils/excel/index.js +1 -3
  303. package/utils/excel/utils.js +1 -5
  304. package/utils/file.js +1 -3
  305. package/utils/index.js +1 -1
  306. package/utils/object.js +1 -3
  307. package/utils/tree.js +2 -11
  308. package/utils/vue.js +1 -1
  309. package/components/global.d.js +0 -1
  310. package/components/style/motion/index.d.ts +0 -1
  311. package/components/style/motion/index.js +0 -1
  312. package/components/style/motion/loading.d.ts +0 -3
  313. package/components/style/motion/loading.js +0 -23
  314. package/layout/layout-user/index.d.ts +0 -1
  315. package/layout/layout-user/index.js +0 -1
  316. package/router/guard/popup.d.ts +0 -2
  317. package/router/guard/popup.js +0 -6
  318. package/types/vue-router.d.js +0 -1
  319. package/types/vue.d.js +0 -1
  320. /package/layout/{layout-user/layout-user.vue.d.ts → layout-user-menu/layout-user-menu.vue.d.ts} +0 -0
  321. /package/layout/merged/{layout-user.d.ts → layout-user-menu.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => {
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../components/theme/theme-context").ThemeManager) => {
2
2
  hashId: import("vue").Ref<string, string>;
3
3
  };
4
4
  export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './layout-user-menu.vue';
@@ -0,0 +1 @@
1
+ export { default } from './layout-user-menu.vue.js';
@@ -1,26 +1,31 @@
1
- import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString } from 'vue';
1
+ import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, createElementVNode, normalizeClass, unref, createVNode, toDisplayString, resolveDynamicComponent } from 'vue';
2
2
  import { useRouter } from 'vue-router';
3
3
  import { useGlobalConfig } from '../../config/index.js';
4
4
  import { useUserStore } from '../../store/user.js';
5
5
  import stdin_default$1 from './style/index.js';
6
6
  import { useComponentConfig } from '../../components/config-provider/config-provider.js';
7
7
  import { Icon as _Icon } from '../../components/icon/index.js';
8
+ import { defineTemplate } from '../../utils/vue.js';
8
9
 
9
10
  var stdin_default = /* @__PURE__ */defineComponent({
10
11
  ...{
11
- name: "LayoutUser"
12
+ name: "LayoutUserMenu"
12
13
  },
13
- __name: "layout-user",
14
+ __name: "layout-user-menu",
14
15
  setup(__props) {
15
16
  const {
16
17
  prefixCls
17
- } = useComponentConfig("layout-user");
18
+ } = useComponentConfig("layout-user-menu");
18
19
  const {
19
20
  hashId
20
21
  } = stdin_default$1(prefixCls);
21
22
  const router = useRouter();
22
23
  const userStore = useUserStore();
23
- const routerConfig = useGlobalConfig().router;
24
+ const {
25
+ router: routerConfig,
26
+ slots: slotsConfig
27
+ } = useGlobalConfig();
28
+ const UserMenu = defineTemplate(() => slotsConfig.userMenu?.());
24
29
  const toHome = () => {
25
30
  router.push(routerConfig.homePath);
26
31
  };
@@ -45,22 +50,22 @@ var stdin_default = /* @__PURE__ */defineComponent({
45
50
  onClick: toHome
46
51
  }, {
47
52
  default: withCtx(() => [createVNode(unref(_Icon), {
48
- name: "mdi:home-outline",
53
+ name: "co:home",
49
54
  size: "lg"
50
55
  }), createElementVNode("span", {
51
- class: normalizeClass(`${unref(prefixCls)}-dropdown-item-title`)
56
+ class: normalizeClass(`${unref(prefixCls)}-item-title`)
52
57
  }, "\u9996\u9875", 2
53
58
  /* CLASS */)]),
54
59
  _: 1
55
60
  /* STABLE */
56
- }), createVNode(_component_el_dropdown_item, {
61
+ }), (openBlock(), createBlock(resolveDynamicComponent(unref(UserMenu)))), createVNode(_component_el_dropdown_item, {
57
62
  onClick: toChangePassword
58
63
  }, {
59
64
  default: withCtx(() => [createVNode(unref(_Icon), {
60
- name: "mdi:shield-key-outline",
65
+ name: "co:password",
61
66
  size: "lg"
62
67
  }), createElementVNode("span", {
63
- class: normalizeClass(`${unref(prefixCls)}-dropdown-item-title`)
68
+ class: normalizeClass(`${unref(prefixCls)}-item-title`)
64
69
  }, "\u4FEE\u6539\u5BC6\u7801", 2
65
70
  /* CLASS */)]),
66
71
  _: 1
@@ -70,10 +75,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
70
75
  onClick: logout
71
76
  }, {
72
77
  default: withCtx(() => [createVNode(unref(_Icon), {
73
- name: "mdi:location-exit",
78
+ name: "co:logout",
74
79
  size: "lg"
75
80
  }), createElementVNode("span", {
76
- class: normalizeClass(`${unref(prefixCls)}-dropdown-item-title`)
81
+ class: normalizeClass(`${unref(prefixCls)}-item-title`)
77
82
  }, "\u9000\u51FA", 2
78
83
  /* CLASS */)]),
79
84
  _: 1
@@ -89,7 +94,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
89
94
  src: unref(userStore).userInfo?.avatar
90
95
  }, {
91
96
  default: withCtx(() => [createVNode(unref(_Icon), {
92
- name: "mdi:account-outline"
97
+ name: "co:user"
93
98
  })]),
94
99
  _: 1
95
100
  /* STABLE */
@@ -1,4 +1,4 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => {
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../components/theme/theme-context").ThemeManager) => {
2
2
  hashId: import("vue").Ref<string, string>;
3
3
  };
4
4
  export default _default;
@@ -1,13 +1,17 @@
1
1
  import { getTruncateStyle } from '../../../components/style/mixins.js';
2
2
  import { getSimpleStyleHook } from '../../../components/theme/getSimpleStyleHook.js';
3
3
 
4
- var stdin_default = getSimpleStyleHook("LayoutUser", (token) => {
4
+ var stdin_default = getSimpleStyleHook("LayoutUserMenu", (token) => {
5
5
  const { componentCls } = token;
6
6
  return {
7
7
  [componentCls]: {
8
8
  display: "flex",
9
9
  alignItems: "center",
10
+ borderRadius: token.borderRadius,
10
11
  cursor: "pointer",
12
+ "&:focus-visible": {
13
+ outline: "none"
14
+ },
11
15
  [`${componentCls}-name`]: {
12
16
  marginInlineStart: token.marginXS,
13
17
  maxWidth: 160,
@@ -15,10 +19,10 @@ var stdin_default = getSimpleStyleHook("LayoutUser", (token) => {
15
19
  }
16
20
  },
17
21
  [`${componentCls}-dropdown`]: {
18
- width: 140,
19
- [`${componentCls}-dropdown-item-title`]: {
20
- marginInlineStart: token.marginXS
21
- }
22
+ minWidth: 140
23
+ },
24
+ [`${componentCls}-item-title`]: {
25
+ marginInlineStart: token.marginXS
22
26
  }
23
27
  };
24
28
  });
@@ -26,4 +26,4 @@ export { default as LayoutTabbar } from './layout-tabbar';
26
26
  export { default as LayoutToggle } from './layout-toggle';
27
27
  export { default as LayoutTopSnugMenu } from './layout-top-snug-menu';
28
28
  export { default as LayoutTopbar } from './layout-topbar';
29
- export { default as LayoutUser } from './layout-user';
29
+ export { default as LayoutUserMenu } from './layout-user-menu';
package/layout/layout.js CHANGED
@@ -26,4 +26,4 @@ export { default as LayoutTabbar } from './layout-tabbar/layout-tabbar.vue.js';
26
26
  export { default as LayoutToggle } from './layout-toggle/layout-toggle.vue.js';
27
27
  export { default as LayoutTopSnugMenu } from './layout-top-snug-menu/layout-top-snug-menu.vue.js';
28
28
  export { default as LayoutTopbar } from './layout-topbar/layout-topbar.vue.js';
29
- export { default as LayoutUser } from './layout-user/layout-user.vue.js';
29
+ export { default as LayoutUserMenu } from './layout-user-menu/layout-user-menu.vue.js';
@@ -26,4 +26,4 @@ export { default as MergedLayoutTabbar } from './layout-tabbar';
26
26
  export { default as MergedLayoutToggle } from './layout-toggle';
27
27
  export { default as MergedLayoutTopSnugMenu } from './layout-top-snug-menu';
28
28
  export { default as MergedLayoutTopbar } from './layout-topbar';
29
- export { default as MergedLayoutUser } from './layout-user';
29
+ export { default as MergedLayoutUserMenu } from './layout-user-menu';
@@ -26,4 +26,4 @@ export { default as MergedLayoutTabbar } from './layout-tabbar.js';
26
26
  export { default as MergedLayoutToggle } from './layout-toggle.js';
27
27
  export { default as MergedLayoutTopSnugMenu } from './layout-top-snug-menu.js';
28
28
  export { default as MergedLayoutTopbar } from './layout-topbar.js';
29
- export { default as MergedLayoutUser } from './layout-user.js';
29
+ export { default as MergedLayoutUserMenu } from './layout-user-menu.js';
@@ -1,4 +1,4 @@
1
- import stdin_default$1 from '../layout-user/layout-user.vue.js';
1
+ import stdin_default$1 from '../layout-user-menu/layout-user-menu.vue.js';
2
2
  import { mergedLayout } from '../utils.js';
3
3
 
4
4
  var stdin_default = mergedLayout("user", stdin_default$1);
package/layout/utils.js CHANGED
@@ -6,10 +6,7 @@ function mergedLayout(name, defaultComponent) {
6
6
  return defineComponent({
7
7
  setup(props, { slots }) {
8
8
  const { components } = useGlobalConfig();
9
- const component = useOptionalComponent(
10
- components?.[name],
11
- defaultComponent
12
- );
9
+ const component = useOptionalComponent(components?.[name], defaultComponent);
13
10
  return () => h(component.value, props, slots);
14
11
  }
15
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "基于 Vue3 的后台管理框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -8,17 +8,17 @@
8
8
  "scripts": {
9
9
  "test": "echo \"Error: no test specified\" && exit 1"
10
10
  },
11
- "author": "wuzhitao",
12
- "license": "MIT",
13
11
  "devDependencies": {
14
12
  "@casl/ability": "^6.7.3",
13
+ "@cosey/icons": "^0.1.5",
15
14
  "@ctrl/tinycolor": "^4.1.0",
16
15
  "@element-plus/icons-vue": "^2.3.1",
17
16
  "@emotion/hash": "^0.9.2",
18
17
  "@emotion/unitless": "^0.10.0",
19
18
  "@floating-ui/dom": "^1.6.13",
20
19
  "@gunny/persist": "^1.0.1",
21
- "@iconify-json/mdi": "^1.2.3",
20
+ "@iconify/types": "^2.0.0",
21
+ "@types/nprogress": "^0.2.3",
22
22
  "@types/stylis": "^4.2.7",
23
23
  "@vue/shared": "^3.5.13",
24
24
  "@vueuse/core": "^13.2.0",
@@ -32,6 +32,7 @@
32
32
  "jszip": "^3.10.1",
33
33
  "katex": "^0.16.22",
34
34
  "lodash-es": "^4.17.21",
35
+ "nprogress": "^0.2.0",
35
36
  "pinia": "^3.0.2",
36
37
  "quill": "^2.0.3",
37
38
  "stylis": "^4.3.6",
@@ -40,13 +41,15 @@
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@casl/ability": "^6.7.3",
44
+ "@cosey/icons": "^0.1.5",
43
45
  "@ctrl/tinycolor": "^4.1.0",
44
46
  "@element-plus/icons-vue": "^2.3.1",
45
47
  "@emotion/hash": "^0.9.2",
46
48
  "@emotion/unitless": "^0.10.0",
47
49
  "@floating-ui/dom": "^1.6.13",
48
50
  "@gunny/persist": "^1.0.1",
49
- "@iconify-json/mdi": "^1.2.3",
51
+ "@iconify/types": "^2.0.0",
52
+ "@types/nprogress": "^0.2.3",
50
53
  "@vue/shared": "^3.5.13",
51
54
  "@vueuse/core": "^13.2.0",
52
55
  "axios": "^1.7.9",
@@ -59,10 +62,17 @@
59
62
  "jszip": "^3.10.1",
60
63
  "katex": "^0.16.22",
61
64
  "lodash-es": "^4.17.21",
65
+ "nprogress": "^0.2.0",
62
66
  "pinia": "^3.0.2",
63
67
  "quill": "^2.0.3",
64
68
  "stylis": "^4.3.6",
65
69
  "vue": "^3.5.13",
66
70
  "vue-router": "^4.5.0"
67
- }
71
+ },
72
+ "repository": {
73
+ "type": "git",
74
+ "url": "git+https://github.com/sutras/cosey.git"
75
+ },
76
+ "author": "wuzhitao",
77
+ "license": "MIT"
68
78
  }
@@ -80,7 +80,7 @@ function useRequest(config = {}) {
80
80
  };
81
81
  const map = (object) => {
82
82
  const result = {};
83
- for (let [key, handler] of Object.entries(object)) {
83
+ for (const [key, handler] of Object.entries(object)) {
84
84
  result[key] = fn(handler);
85
85
  }
86
86
  return result;
@@ -24,13 +24,10 @@ function registerAuthGuard(router) {
24
24
  await userStore.getUserInfo();
25
25
  await userStore.setAuthorization();
26
26
  await userStore.addDynamicRoutes();
27
- layoutStore.menus = getMenus([
28
- ...getAllStaticRoutes(),
29
- ...userStore.dynamicRoutes
30
- ]);
27
+ layoutStore.menus = getMenus([...getAllStaticRoutes(), ...userStore.dynamicRoutes]);
31
28
  firstTimeAddRoutes = true;
32
29
  userStore.requestedUserInfo = true;
33
- } catch (err) {
30
+ } catch {
34
31
  return false;
35
32
  } finally {
36
33
  persist.remove(ROUTER_TO);
@@ -1,11 +1,11 @@
1
1
  import { registerProgressGuard } from './progress.js';
2
- import { registerPopupGuard } from './popup.js';
3
2
  import { registerAuthGuard } from './auth.js';
3
+ import { registerPageTitleGuard } from './pageTitle.js';
4
4
 
5
5
  function registerRouterGuard(router) {
6
6
  registerProgressGuard(router);
7
- registerPopupGuard(router);
8
7
  registerAuthGuard(router);
8
+ registerPageTitleGuard(router);
9
9
  }
10
10
 
11
11
  export { registerRouterGuard };
@@ -0,0 +1,2 @@
1
+ import { type Router } from 'vue-router';
2
+ export declare function registerPageTitleGuard(router: Router): void;
@@ -0,0 +1,11 @@
1
+ import { useGlobalConfig } from '../../config/index.js';
2
+
3
+ function registerPageTitleGuard(router) {
4
+ router.afterEach((to) => {
5
+ const siteConfig = useGlobalConfig().site;
6
+ const title = to.meta.title ? to.meta.title + " - " + siteConfig.name : siteConfig.name;
7
+ document.title = title;
8
+ });
9
+ }
10
+
11
+ export { registerPageTitleGuard };
@@ -1,5 +1,15 @@
1
+ import NProgress from 'nprogress';
2
+
1
3
  function registerProgressGuard(router) {
2
- router.beforeEach(() => {
4
+ const pathCache = {};
5
+ router.beforeEach((to) => {
6
+ if (!pathCache[to.path]) {
7
+ NProgress.start();
8
+ }
9
+ });
10
+ router.afterEach((to) => {
11
+ pathCache[to.path] = true;
12
+ NProgress.done();
3
13
  });
4
14
  }
5
15
 
package/router/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type RouteRecordRaw, type RouterOptions, type RouterHistory } from 'vue-router';
2
+ import type { AnyAbility } from '@casl/ability';
2
3
  export { type MenuItem, type MenuNode, getMenus, getMenusMap, getMenuPathKeys, getBreadcrumbRoutes, } from './menus';
3
4
  export { defineRoute, defineRoutes, mergeRouteModules } from './utils';
4
5
  export interface CoseyRouterOptions extends Omit<RouterOptions, 'routes' | 'history'> {
@@ -9,3 +10,24 @@ export interface CoseyRouterOptions extends Omit<RouterOptions, 'routes' | 'hist
9
10
  export declare const getAllDynamicRoutes: () => RouteRecordRaw[];
10
11
  export declare const getAllStaticRoutes: () => RouteRecordRaw[];
11
12
  export declare function createCoseyRouter(options?: CoseyRouterOptions): import("vue-router").Router;
13
+ declare module 'vue-router' {
14
+ interface RouteMeta {
15
+ title?: string;
16
+ icon?: string;
17
+ hideInMenu?: boolean;
18
+ hideChildrenInMenu?: boolean;
19
+ flatChildrenInMenu?: boolean;
20
+ type?: 'group';
21
+ closable?: boolean;
22
+ keepAlive?: boolean;
23
+ order?: number;
24
+ iframeSrc?: string;
25
+ authentication?: boolean;
26
+ authority?: (ability: AnyAbility) => boolean;
27
+ }
28
+ }
29
+ declare module 'vue-router' {
30
+ interface RouteMeta {
31
+ _externalLink?: boolean;
32
+ }
33
+ }
package/router/index.js CHANGED
@@ -24,7 +24,7 @@ function createCoseyRouter(options = {}) {
24
24
  },
25
25
  restOptions,
26
26
  {
27
- routes: [...staticRoutes, ...customStaticRoutes]
27
+ routes: getAllStaticRoutes()
28
28
  }
29
29
  );
30
30
  const router = createRouter(mergedOptions);
@@ -1,13 +1,12 @@
1
1
  import { defineRoutes } from '../../utils.js';
2
- import stdin_default$3 from '../../../layout/layout-auth/layout-auth.vue.js';
3
- import stdin_default$2 from '../../../layout/layout-change-password/layout-change-password.vue.js';
4
- import stdin_default$1 from '../../../layout/layout-login/layout-login.vue.js';
2
+ import stdin_default$3 from '../../../layout/merged/layout-auth.js';
3
+ import stdin_default$2 from '../../../layout/merged/layout-change-password.js';
4
+ import stdin_default$1 from '../../../layout/merged/layout-login.js';
5
5
 
6
6
  var stdin_default = defineRoutes({
7
7
  path: "/auth",
8
8
  name: "Auth",
9
9
  component: stdin_default$3,
10
- redirect: "/auth/login",
11
10
  meta: {
12
11
  hideInMenu: true
13
12
  },
@@ -23,10 +22,10 @@ var stdin_default = defineRoutes({
23
22
  },
24
23
  {
25
24
  path: "change-password",
26
- name: "ResetPassword",
25
+ name: "ChangePassword",
27
26
  component: stdin_default$2,
28
27
  meta: {
29
- title: "\u91CD\u7F6E\u5BC6\u7801"
28
+ title: "\u4FEE\u6539\u5BC6\u7801"
30
29
  }
31
30
  }
32
31
  ]
@@ -1,7 +1,7 @@
1
1
  import { defineRoutes } from '../../utils.js';
2
- import stdin_default$3 from '../../../layout/layout-exception/layout-exception.vue.js';
3
- import stdin_default$1 from '../../../layout/layout-forbidden/layout-forbidden.vue.js';
4
- import stdin_default$2 from '../../../layout/layout-internal-server-error/layout-internal-server-error.vue.js';
2
+ import stdin_default$3 from '../../../layout/merged/layout-exception.js';
3
+ import stdin_default$1 from '../../../layout/merged/layout-forbidden.js';
4
+ import stdin_default$2 from '../../../layout/merged/layout-internal-server-error.js';
5
5
  import { NotFoundRoute } from '../../not-found.js';
6
6
 
7
7
  var stdin_default = defineRoutes([
package/router/utils.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import { uuid } from '../utils/string.js';
2
2
 
3
3
  function defineRoute(route) {
4
- function recur(route2) {
4
+ function recur(route2, index = 0, parent) {
5
5
  const meta = route2.meta || {};
6
- return {
6
+ const newRoute = {
7
7
  ...route2,
8
8
  name: route2.name || uuid(),
9
- children: Array.isArray(route2.children) ? route2.children.map(recur) : void 0,
10
9
  meta: {
11
10
  ...meta,
12
11
  closable: meta.closable ?? true,
@@ -14,6 +13,15 @@ function defineRoute(route) {
14
13
  authentication: meta.authentication ?? true
15
14
  }
16
15
  };
16
+ if (Array.isArray(route2.children)) {
17
+ newRoute.children = route2.children.map((item, index2) => recur(item, index2, newRoute));
18
+ }
19
+ if (parent && !parent.redirect && index === 0) {
20
+ parent.redirect = {
21
+ name: newRoute.name
22
+ };
23
+ }
24
+ return newRoute;
17
25
  }
18
26
  return recur(route);
19
27
  }
package/store/layout.d.ts CHANGED
@@ -1,16 +1,14 @@
1
- import { type RouteLocationNormalized } from 'vue-router';
1
+ import { RouteMeta } from 'vue-router';
2
2
  import { type MenuItem } from '../router';
3
3
  export type LayoutMenuType = 'vertical' | 'biserial' | 'horizontal' | 'horizontal-vertical' | 'horizontal-biserial';
4
4
  export interface LayoutTab {
5
5
  name: string;
6
- meta: RouteLocationNormalized['meta'];
6
+ meta: RouteMeta;
7
7
  }
8
- export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", Pick<{
8
+ export declare const useLayoutStore: import("pinia").StoreDefinition<"cosey-layout", Pick<{
9
9
  sidebarVisible: import("vue").Ref<boolean, boolean>;
10
10
  collapse: import("vue").Ref<boolean, boolean>;
11
- settingVisible: import("vue").Ref<boolean, boolean>;
12
11
  isMobile: import("vue").Ref<boolean, boolean>;
13
- fixedHead: import("vue").Ref<boolean, boolean>;
14
12
  menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
15
13
  includeHorizontal: import("vue").ComputedRef<boolean>;
16
14
  isVertical: import("vue").ComputedRef<boolean>;
@@ -407,12 +405,10 @@ export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", P
407
405
  topbarHeight: import("vue").Ref<number, number>;
408
406
  tabbarHeight: import("vue").Ref<number, number>;
409
407
  headerHeight: import("vue").ComputedRef<number>;
410
- }, "collapse" | "menus" | "sidebarVisible" | "settingVisible" | "isMobile" | "fixedHead" | "menuType" | "firstLevelMenus" | "firstLevelActive" | "secondLevelActive" | "topMenus" | "topActive" | "tabbarVisible" | "activeTab" | "refreshing" | "tabList" | "keepAliveInclude" | "asideWidth" | "collapsedAsideWidth" | "snugAsideWidth" | "topbarHeight" | "tabbarHeight">, Pick<{
408
+ }, "collapse" | "menus" | "sidebarVisible" | "menuType" | "tabbarVisible" | "asideWidth" | "collapsedAsideWidth" | "snugAsideWidth" | "topbarHeight" | "tabbarHeight" | "isMobile" | "firstLevelMenus" | "firstLevelActive" | "secondLevelActive" | "topMenus" | "topActive" | "activeTab" | "refreshing" | "tabList" | "keepAliveInclude">, Pick<{
411
409
  sidebarVisible: import("vue").Ref<boolean, boolean>;
412
410
  collapse: import("vue").Ref<boolean, boolean>;
413
- settingVisible: import("vue").Ref<boolean, boolean>;
414
411
  isMobile: import("vue").Ref<boolean, boolean>;
415
- fixedHead: import("vue").Ref<boolean, boolean>;
416
412
  menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
417
413
  includeHorizontal: import("vue").ComputedRef<boolean>;
418
414
  isVertical: import("vue").ComputedRef<boolean>;
@@ -812,9 +808,7 @@ export declare const useLayoutStore: import("pinia").StoreDefinition<"layout", P
812
808
  }, "keepAlive" | "isHorizontal" | "includeHorizontal" | "isVertical" | "isBiserial" | "isHorizontalVertical" | "isHorizontalBiserial" | "menusMap" | "secondLevelMenus" | "thirdLevelMenus" | "snugMenus" | "snugActive" | "defaultMenus" | "iframeTabList" | "keepAliveExclude" | "sidebarWidth" | "headerHeight">, Pick<{
813
809
  sidebarVisible: import("vue").Ref<boolean, boolean>;
814
810
  collapse: import("vue").Ref<boolean, boolean>;
815
- settingVisible: import("vue").Ref<boolean, boolean>;
816
811
  isMobile: import("vue").Ref<boolean, boolean>;
817
- fixedHead: import("vue").Ref<boolean, boolean>;
818
812
  menuType: import("vue").Ref<LayoutMenuType, LayoutMenuType>;
819
813
  includeHorizontal: import("vue").ComputedRef<boolean>;
820
814
  isVertical: import("vue").ComputedRef<boolean>;
package/store/layout.js CHANGED
@@ -5,13 +5,11 @@ import { useGlobalConfig } from '../config/index.js';
5
5
  import { ref, watch, computed, nextTick } from 'vue';
6
6
  import { useWindowResize } from '../hooks/useWindowResize.js';
7
7
 
8
- const useLayoutStore = defineStore("layout", () => {
8
+ const useLayoutStore = defineStore("cosey-layout", () => {
9
9
  const { layout: layoutConfig } = useGlobalConfig();
10
10
  const route = useRoute();
11
- const sidebarVisible = ref(true);
12
- const collapse = ref(false);
13
- const settingVisible = ref(false);
14
- const fixedHead = ref(true);
11
+ const sidebarVisible = ref(layoutConfig.sidebarVisible);
12
+ const collapse = ref(layoutConfig.collapse);
15
13
  const isMobile = ref(false);
16
14
  watch(
17
15
  isMobile,
@@ -27,21 +25,15 @@ const useLayoutStore = defineStore("layout", () => {
27
25
  };
28
26
  onResize();
29
27
  useWindowResize(onResize);
30
- const menuType = ref("vertical");
28
+ const menuType = ref(layoutConfig.menuType);
31
29
  const includeHorizontal = computed(
32
- () => ["horizontal", "horizontal-vertical", "horizontal-biserial"].includes(
33
- menuType.value
34
- )
30
+ () => ["horizontal", "horizontal-vertical", "horizontal-biserial"].includes(menuType.value)
35
31
  );
36
32
  const isVertical = computed(() => menuType.value === "vertical");
37
33
  const isBiserial = computed(() => menuType.value === "biserial");
38
34
  const isHorizontal = computed(() => menuType.value === "horizontal");
39
- const isHorizontalVertical = computed(
40
- () => menuType.value === "horizontal-vertical"
41
- );
42
- const isHorizontalBiserial = computed(
43
- () => menuType.value === "horizontal-biserial"
44
- );
35
+ const isHorizontalVertical = computed(() => menuType.value === "horizontal-vertical");
36
+ const isHorizontalBiserial = computed(() => menuType.value === "horizontal-biserial");
45
37
  const menus = ref([]);
46
38
  const menusMap = computed(() => getMenusMap(menus.value));
47
39
  const firstLevelMenus = menus;
@@ -95,7 +87,7 @@ const useLayoutStore = defineStore("layout", () => {
95
87
  }
96
88
  }
97
89
  });
98
- const tabbarVisible = ref(true);
90
+ const tabbarVisible = ref(layoutConfig.tabbarVisible);
99
91
  const activeTab = ref("");
100
92
  const refreshing = ref(false);
101
93
  const tabList = ref([]);
@@ -127,21 +119,16 @@ const useLayoutStore = defineStore("layout", () => {
127
119
  const reload = () => {
128
120
  refreshing.value = true;
129
121
  if (keepAliveInclude.value.includes(route.name)) {
130
- keepAliveInclude.value = keepAliveInclude.value.filter(
131
- (item) => item !== route.name
132
- );
122
+ keepAliveInclude.value = keepAliveInclude.value.filter((item) => item !== route.name);
133
123
  }
134
124
  nextTick(() => {
135
125
  refreshing.value = false;
136
- keepAliveInclude.value = [
137
- ...keepAliveInclude.value,
138
- route.name
139
- ];
126
+ keepAliveInclude.value = [...keepAliveInclude.value, route.name];
140
127
  });
141
128
  };
142
- const asideWidth = ref(260);
143
- const collapsedAsideWidth = ref(64);
144
- const snugAsideWidth = ref(85);
129
+ const asideWidth = ref(layoutConfig.asideWidth);
130
+ const collapsedAsideWidth = ref(layoutConfig.collapsedAsideWidth);
131
+ const snugAsideWidth = ref(layoutConfig.snugAsideWidth);
145
132
  const sidebarWidth = computed(() => {
146
133
  if (isMobile.value) {
147
134
  return 0;
@@ -162,24 +149,25 @@ const useLayoutStore = defineStore("layout", () => {
162
149
  }
163
150
  return asideWidth.value;
164
151
  case "biserial":
165
- case "horizontal-biserial":
152
+ case "horizontal-biserial": {
166
153
  const snugAsideW = snugMenus.value.length === 0 ? 0 : snugAsideWidth.value;
167
154
  const asideW = defaultMenus.value.length === 0 ? 0 : collapse.value ? collapsedAsideWidth.value : asideWidth.value;
168
155
  return snugAsideW + asideW;
156
+ }
157
+ default:
158
+ return 0;
169
159
  }
170
160
  }
171
161
  });
172
- const topbarHeight = ref(48);
173
- const tabbarHeight = ref(41);
162
+ const topbarHeight = ref(layoutConfig.topbarHeight);
163
+ const tabbarHeight = ref(layoutConfig.tabbarHeight);
174
164
  const headerHeight = computed(() => {
175
165
  return topbarHeight.value + (tabbarVisible.value ? tabbarHeight.value : 0);
176
166
  });
177
167
  return {
178
168
  sidebarVisible,
179
169
  collapse,
180
- settingVisible,
181
170
  isMobile,
182
- fixedHead,
183
171
  menuType,
184
172
  includeHorizontal,
185
173
  isVertical,
package/store/user.d.ts CHANGED
@@ -5,12 +5,12 @@ interface UserInfo {
5
5
  avatar: string;
6
6
  [key: PropertyKey]: any;
7
7
  }
8
- export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<{
8
+ export declare const useUserStore: import("pinia").StoreDefinition<"cosey-user", Pick<{
9
9
  dynamicRoutes: import("vue").Ref<any[], any[]>;
10
10
  userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
11
11
  requestedUserInfo: import("vue").Ref<boolean, boolean>;
12
12
  login: (data: any) => Promise<void>;
13
- getUserInfo: () => Promise<void | undefined>;
13
+ getUserInfo: () => Promise<UserInfo | undefined>;
14
14
  changePassword: (data: any) => Promise<void>;
15
15
  setAuthorization: () => Promise<void | undefined>;
16
16
  addDynamicRoutes: () => Promise<void>;
@@ -20,7 +20,7 @@ export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<
20
20
  userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
21
21
  requestedUserInfo: import("vue").Ref<boolean, boolean>;
22
22
  login: (data: any) => Promise<void>;
23
- getUserInfo: () => Promise<void | undefined>;
23
+ getUserInfo: () => Promise<UserInfo | undefined>;
24
24
  changePassword: (data: any) => Promise<void>;
25
25
  setAuthorization: () => Promise<void | undefined>;
26
26
  addDynamicRoutes: () => Promise<void>;
@@ -30,7 +30,7 @@ export declare const useUserStore: import("pinia").StoreDefinition<"user", Pick<
30
30
  userInfo: import("vue").Ref<UserInfo | undefined, UserInfo | undefined>;
31
31
  requestedUserInfo: import("vue").Ref<boolean, boolean>;
32
32
  login: (data: any) => Promise<void>;
33
- getUserInfo: () => Promise<void | undefined>;
33
+ getUserInfo: () => Promise<UserInfo | undefined>;
34
34
  changePassword: (data: any) => Promise<void>;
35
35
  setAuthorization: () => Promise<void | undefined>;
36
36
  addDynamicRoutes: () => Promise<void>;