cosey 0.1.3 → 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 (134) hide show
  1. package/components/audio-card/style/index.d.ts +1 -1
  2. package/components/audio-viewer/style/index.d.ts +1 -1
  3. package/components/close/style/index.d.ts +1 -1
  4. package/components/col/style/index.d.ts +1 -1
  5. package/components/col/style/index.js +1 -1
  6. package/components/config-provider/config-provider.vue.js +8 -4
  7. package/components/config-provider/override-element-plus.d.ts +3 -2
  8. package/components/config-provider/override-element-plus.js +2 -2
  9. package/components/container/container.d.ts +0 -1
  10. package/components/container/container.vue.js +0 -4
  11. package/components/container/style/index.d.ts +1 -1
  12. package/components/context-menu/style/index.d.ts +1 -1
  13. package/components/copy/copy.d.ts +0 -2
  14. package/components/copy/copy.vue.d.ts +1 -7
  15. package/components/copy/copy.vue.js +0 -1
  16. package/components/copy/index.d.ts +3 -19
  17. package/components/copy/style/index.d.ts +1 -1
  18. package/components/dnd-sort/dnd-sort-item.vue.js +1 -1
  19. package/components/dnd-sort/style/index.d.ts +1 -1
  20. package/components/dnd-sort/style/index.js +1 -0
  21. package/components/editor/components/color-picker/color-picker.style.d.ts +1 -1
  22. package/components/editor/components/list/list.style.d.ts +1 -1
  23. package/components/editor/components/picker/picker.style.d.ts +1 -1
  24. package/components/editor/components/resize/resize.style.d.ts +1 -1
  25. package/components/editor/components/table-toolbar/table-toolbar.style.d.ts +1 -1
  26. package/components/editor/components/toolbar/formats/table.style.d.ts +1 -1
  27. package/components/editor/editor.d.ts +0 -2
  28. package/components/editor/editor.vue.js +1 -11
  29. package/components/editor/modules/image-uploader/formats/image-loading.style.d.ts +1 -1
  30. package/components/editor/modules/image-uploader/formats/image-loading.style.js +3 -3
  31. package/components/editor/style/hljs.d.ts +1 -1
  32. package/components/editor/style/index.d.ts +1 -1
  33. package/components/file-card/style/index.d.ts +1 -1
  34. package/components/form/style/index.d.ts +1 -1
  35. package/components/form-list/style/index.d.ts +1 -1
  36. package/components/form-query/style/index.d.ts +1 -1
  37. package/components/highlight/highlight.d.ts +1 -1
  38. package/components/highlight/highlight.vue.js +11 -4
  39. package/components/highlight/style/index.d.ts +1 -1
  40. package/components/highlight/style/index.js +15 -5
  41. package/components/horizontal-tree/style/index.d.ts +1 -1
  42. package/components/icon/style/index.d.ts +1 -1
  43. package/components/image-card/style/index.d.ts +1 -1
  44. package/components/index.js +1 -0
  45. package/components/long-text/style/index.d.ts +1 -1
  46. package/components/mask/style/index.d.ts +1 -1
  47. package/components/media-card-group/style/index.d.ts +1 -1
  48. package/components/panel/style/index.d.ts +1 -1
  49. package/components/row/style/index.d.ts +1 -1
  50. package/components/scroll-view/style/index.d.ts +1 -1
  51. package/components/snug-menu/style/index.d.ts +1 -1
  52. package/components/table/style/index.d.ts +1 -1
  53. package/components/table/table-column/style/index.d.ts +1 -1
  54. package/components/table/table-column/table-column.vue.d.ts +3 -3
  55. package/components/table/table-column-editor/item.vue.js +1 -1
  56. package/components/table/table-column-editor/style/index.d.ts +1 -1
  57. package/components/table/table-column-editor/style/index.js +1 -0
  58. package/components/table/table-export/style/index.d.ts +1 -1
  59. package/components/table-action/style/index.d.ts +1 -1
  60. package/components/theme/getGlobalStyleHook.d.ts +2 -3
  61. package/components/theme/getGlobalStyleHook.js +3 -8
  62. package/components/theme/getOverrideStyleHook.d.ts +8 -0
  63. package/components/theme/getOverrideStyleHook.js +39 -0
  64. package/components/theme/getSimpleStyleHook.d.ts +2 -2
  65. package/components/theme/getSimpleStyleHook.js +3 -7
  66. package/components/theme/getStyleHook.d.ts +2 -2
  67. package/components/theme/getStyleHook.js +3 -7
  68. package/components/theme/index.d.ts +2 -1
  69. package/components/theme/index.js +1 -0
  70. package/components/theme/theme-context.d.ts +11 -2
  71. package/components/theme/theme-context.js +36 -6
  72. package/components/theme/useStyleRegister.d.ts +1 -7
  73. package/components/theme/useStyleRegister.js +3 -4
  74. package/components/theme/util/useToken.d.ts +4 -4
  75. package/components/theme/util/useToken.js +6 -6
  76. package/components/transition/style/index.d.ts +1 -1
  77. package/components/transition-group/index.d.ts +3 -3
  78. package/components/transition-group/style/index.d.ts +1 -1
  79. package/components/transition-group/transition-group.vue.d.ts +1 -1
  80. package/components/upload/index.d.ts +0 -3
  81. package/components/upload/style/index.d.ts +1 -1
  82. package/components/upload/upload.d.ts +0 -2
  83. package/components/upload/upload.js +0 -1
  84. package/components/upload/upload.vue.d.ts +0 -1
  85. package/components/upload/upload.vue.js +0 -4
  86. package/components/video-card/style/index.d.ts +1 -1
  87. package/components/video-card/video-card.vue.js +1 -1
  88. package/components/video-viewer/style/index.d.ts +1 -1
  89. package/config/http.d.ts +1 -1
  90. package/config/http.js +1 -1
  91. package/config/index.d.ts +22 -22
  92. package/config/nprogress.style.d.ts +1 -1
  93. package/config/nprogress.style.js +1 -1
  94. package/hooks/useUpsert.d.ts +15 -16
  95. package/hooks/useUpsert.js +3 -3
  96. package/layout/layout-aside/style/index.d.ts +1 -1
  97. package/layout/layout-auth/style/index.d.ts +1 -1
  98. package/layout/layout-base/layout-base.vue.js +8 -8
  99. package/layout/layout-base/style/index.d.ts +1 -1
  100. package/layout/layout-brand/style/index.d.ts +1 -1
  101. package/layout/layout-change-password/style/index.d.ts +1 -1
  102. package/layout/layout-color-scheme/style/index.d.ts +2 -2
  103. package/layout/layout-content/style/index.d.ts +1 -1
  104. package/layout/layout-exception/style/index.d.ts +1 -1
  105. package/layout/layout-header/style/index.d.ts +1 -1
  106. package/layout/layout-iframe/style/index.d.ts +1 -1
  107. package/layout/layout-login/style/index.d.ts +1 -1
  108. package/layout/layout-main/style/index.d.ts +1 -1
  109. package/layout/layout-mask/style/index.d.ts +1 -1
  110. package/layout/layout-menu/layout-menu.vue.js +5 -0
  111. package/layout/layout-menu/style/index.d.ts +1 -1
  112. package/layout/layout-search/style/index.d.ts +1 -1
  113. package/layout/layout-sidebar/style/index.d.ts +1 -1
  114. package/layout/layout-snug-aside/style/index.d.ts +1 -1
  115. package/layout/layout-switch-effect/style/index.d.ts +1 -1
  116. package/layout/layout-tabbar/layout-tabbar.vue.js +6 -1
  117. package/layout/layout-tabbar/style/index.d.ts +1 -1
  118. package/layout/layout-tabbar/style/index.js +4 -0
  119. package/layout/layout-topbar/style/index.d.ts +1 -1
  120. package/layout/layout-user-menu/style/index.d.ts +1 -1
  121. package/package.json +3 -3
  122. package/router/guard/index.js +2 -0
  123. package/router/guard/pageTitle.d.ts +2 -0
  124. package/router/guard/pageTitle.js +11 -0
  125. package/router/index.js +1 -1
  126. package/router/routes/static/auth.js +5 -6
  127. package/router/routes/static/exception.js +3 -3
  128. package/router/utils.js +11 -3
  129. package/store/layout.d.ts +2 -2
  130. package/store/user.d.ts +3 -3
  131. package/store/user.js +1 -0
  132. package/utils/dynamicCSS.d.ts +3 -2
  133. package/utils/dynamicCSS.js +12 -1
  134. package/utils/index.js +1 -1
package/config/http.js CHANGED
@@ -12,7 +12,7 @@ const defaultHttpConfig = {
12
12
  */
13
13
  headers: {},
14
14
  /**
15
- * 认证的框架
15
+ * HTTP 认证方案
16
16
  */
17
17
  authScheme: "Bearer",
18
18
  /**
package/config/index.d.ts CHANGED
@@ -9,35 +9,35 @@ import { type App, type Component, type VNodeChild } from 'vue';
9
9
  import { type CoseyRouterOptions } from '../router';
10
10
  import { type RouteRecordRaw } from 'vue-router';
11
11
  export interface LayoutComponents {
12
- aside?: string | Component;
13
- auth?: string | Component;
14
12
  base?: string | Component;
15
- brand?: string | Component;
16
- breadcrumb?: string | Component;
17
- changePassword?: string | Component;
18
- colorScheme?: string | Component;
19
- content?: string | Component;
20
- empty?: string | Component;
21
- exception?: string | Component;
22
- forbidden?: string | Component;
23
- header?: string | Component;
24
- iframe?: string | Component;
25
- internalServerError?: string | Component;
26
- login?: string | Component;
27
- main?: string | Component;
28
- mask?: string | Component;
29
- menu?: string | Component;
30
- notFound?: string | Component;
31
- search?: string | Component;
32
13
  sidebar?: string | Component;
33
14
  snugAside?: string | Component;
34
15
  snugMenu?: string | Component;
35
- switchEffect?: string | Component;
36
- tabbar?: string | Component;
16
+ aside?: string | Component;
17
+ menu?: string | Component;
18
+ mask?: string | Component;
19
+ content?: string | Component;
20
+ header?: string | Component;
21
+ topbar?: string | Component;
22
+ brand?: string | Component;
37
23
  toggle?: string | Component;
38
24
  topSnugMenu?: string | Component;
39
- topbar?: string | Component;
25
+ breadcrumb?: string | Component;
26
+ search?: string | Component;
27
+ colorScheme?: string | Component;
40
28
  user?: string | Component;
29
+ tabbar?: string | Component;
30
+ main?: string | Component;
31
+ iframe?: string | Component;
32
+ switchEffect?: string | Component;
33
+ auth?: string | Component;
34
+ login?: string | Component;
35
+ changePassword?: string | Component;
36
+ exception?: string | Component;
37
+ forbidden?: string | Component;
38
+ notFound?: string | Component;
39
+ internalServerError?: string | Component;
40
+ empty?: string | Component;
41
41
  }
42
42
  export interface LayoutSlots {
43
43
  topbarRight?: () => VNodeChild;
@@ -1,2 +1,2 @@
1
- declare const _default: (theme?: import("vue").ComputedRef<import("../components").ThemeConfig | undefined>) => void;
1
+ declare const _default: (themeManager?: import("../components/theme/theme-context").ThemeManager) => void;
2
2
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import { rotation } from '../components/style/animation.js';
2
2
  import { getGlobalStyleHook } from '../components/theme/getGlobalStyleHook.js';
3
3
 
4
- var stdin_default = getGlobalStyleHook("co-editor-image-loading", (token) => {
4
+ var stdin_default = getGlobalStyleHook("NProgress", (token) => {
5
5
  return {
6
6
  "#nprogress": {
7
7
  pointerEvents: "none",
@@ -1,7 +1,8 @@
1
+ import { Ref, ShallowRef } from 'vue';
1
2
  export interface UseUpsertExposeOptions {
2
3
  success?: () => any;
3
4
  }
4
- export interface UseUpsertExpose<Row extends Record<string, any>, Data> {
5
+ export interface UseUpsertExpose<Row extends Record<string, any>, Data = any> {
5
6
  edit: (row: Row) => any;
6
7
  add: () => any;
7
8
  setData: (data: Data) => UseUpsertExpose<Row, Data>;
@@ -22,32 +23,30 @@ export interface UseUpsertOptions<Model, Row = Model, Data = Model> {
22
23
  addSuccessText?: string;
23
24
  editSuccessText?: string;
24
25
  }
25
- export declare function useUpsert<Model extends Record<string, any>, Row extends Record<string, any> = Model, Data = any>(options: UseUpsertOptions<Model, Row>): {
26
- expose: UseUpsertExpose<Row, Data>;
27
- edit: (row: Row) => any;
28
- add: () => any;
29
- setData: (data: Data) => UseUpsertExpose<Row, Data>;
30
- setOptions: (options: UseUpsertExposeOptions) => any;
26
+ export interface UseUpsertReturn<Model extends Record<string, any>, Row extends Record<string, any> = Model, Data = any> extends UseUpsertExpose<Row, Data> {
31
27
  dialogProps: {
32
- modelValue: boolean;
28
+ modelvalue: boolean;
33
29
  'onUpdate:modelValue': (value: boolean) => void;
34
30
  title: string;
35
31
  };
36
32
  formProps: {
37
- model: import("vue").UnwrapRef<Model>;
33
+ model: Model;
38
34
  ref: string;
39
35
  submit: () => Promise<void>;
40
36
  };
41
- formRef: Readonly<import("vue").ShallowRef<unknown>>;
42
- data: import("vue").Ref<Data | undefined, Data | undefined>;
43
- };
37
+ formRef: any;
38
+ data: Ref<Data | undefined>;
39
+ expose: UseUpsertExpose<Row, Data>;
40
+ }
41
+ export declare function useUpsert<Model extends Record<string, any>, Row extends Record<string, any> = Model, Data = any>(options: UseUpsertOptions<Model, Row>): UseUpsertReturn<Model, Row>;
44
42
  export interface UseExternalUpsertOptions {
45
43
  success?: () => any;
46
44
  }
47
- export declare function useOuterUpsert<Row extends Record<string, any>, Data>(options: UseExternalUpsertOptions): {
45
+ export interface UseExternalUpsertReturn<Row extends Record<string, any>, Data> {
48
46
  add: () => void;
49
47
  edit: (row: Row) => void;
50
- setData: (data: Data) => /*elided*/ any;
51
- expose: Readonly<import("vue").ShallowRef<UseUpsertExpose<Row, Data> | null>>;
48
+ setData: (data: Data) => void;
49
+ expose: Readonly<ShallowRef<UseUpsertExpose<Row, Data> | null>>;
52
50
  ref: string;
53
- };
51
+ }
52
+ export declare function useOuterUpsert<Row extends Record<string, any>, Data>(options: UseExternalUpsertOptions): UseExternalUpsertReturn<Row, Data>;
@@ -87,14 +87,15 @@ function useUpsert(options) {
87
87
  exposeOptions = options2;
88
88
  }
89
89
  };
90
- return {
90
+ const result = {
91
+ ...expose,
91
92
  dialogProps,
92
93
  formProps,
93
94
  formRef,
94
95
  data,
95
- ...expose,
96
96
  expose
97
97
  };
98
+ return result;
98
99
  }
99
100
  function useOuterUpsert(options) {
100
101
  const refKey = uuid();
@@ -107,7 +108,6 @@ function useOuterUpsert(options) {
107
108
  };
108
109
  const setData = (data) => {
109
110
  expose.value?.setData(data);
110
- return result;
111
111
  };
112
112
  onMounted(() => {
113
113
  expose.value?.setOptions(options);
@@ -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,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,17 +1,17 @@
1
1
  import { defineComponent, createElementBlock, openBlock, normalizeClass, unref, createBlock, createCommentVNode, createVNode, withCtx, resolveDynamicComponent } from 'vue';
2
2
  import stdin_default$4 from '../merged/layout-aside.js';
3
3
  import stdin_default$c from '../merged/layout-brand.js';
4
- import stdin_default$g from '../merged/layout-breadcrumb.js';
4
+ import stdin_default$e from '../merged/layout-breadcrumb.js';
5
5
  import stdin_default$6 from '../merged/layout-content.js';
6
6
  import stdin_default$7 from '../merged/layout-header.js';
7
7
  import stdin_default$i from '../merged/layout-main.js';
8
8
  import stdin_default$5 from '../merged/layout-mask.js';
9
- import stdin_default$f from '../merged/layout-menu.js';
9
+ import stdin_default$g from '../merged/layout-menu.js';
10
10
  import stdin_default$2 from '../merged/layout-sidebar.js';
11
11
  import stdin_default$3 from '../merged/layout-snug-aside.js';
12
12
  import stdin_default$h from '../merged/layout-tabbar.js';
13
13
  import stdin_default$d from '../merged/layout-toggle.js';
14
- import stdin_default$e from '../merged/layout-top-snug-menu.js';
14
+ import stdin_default$f from '../merged/layout-top-snug-menu.js';
15
15
  import stdin_default$8 from '../merged/layout-topbar.js';
16
16
  import stdin_default$a from '../merged/layout-color-scheme.js';
17
17
  import stdin_default$9 from '../merged/layout-search.js';
@@ -60,16 +60,16 @@ var stdin_default = /* @__PURE__ */defineComponent({
60
60
  "is-horizontal": ""
61
61
  })) : createCommentVNode("v-if", true), unref(layoutStore).isMobile || unref(layoutStore).isVertical || unref(layoutStore).isBiserial ? (openBlock(), createBlock(unref(stdin_default$d), {
62
62
  key: 1
63
- })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isHorizontalVertical || unref(layoutStore).isHorizontalBiserial) ? (openBlock(), createBlock(unref(stdin_default$e), {
63
+ })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isVertical || unref(layoutStore).isBiserial) ? (openBlock(), createBlock(unref(stdin_default$e), {
64
64
  key: 2
65
- })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && unref(layoutStore).isHorizontal ? (openBlock(), createBlock(unref(stdin_default$f), {
66
- key: 3,
65
+ })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isHorizontalVertical || unref(layoutStore).isHorizontalBiserial) ? (openBlock(), createBlock(unref(stdin_default$f), {
66
+ key: 3
67
+ })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && unref(layoutStore).isHorizontal ? (openBlock(), createBlock(unref(stdin_default$g), {
68
+ key: 4,
67
69
  mode: "horizontal",
68
70
  style: {
69
71
  "flex": "1"
70
72
  }
71
- })) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isVertical || unref(layoutStore).isBiserial) ? (openBlock(), createBlock(unref(stdin_default$g), {
72
- key: 4
73
73
  })) : createCommentVNode("v-if", true)]),
74
74
  right: withCtx(() => [createVNode(unref(stdin_default$9)), (openBlock(), createBlock(resolveDynamicComponent(unref(TopbarRight)))), createVNode(unref(stdin_default$a)), createVNode(unref(stdin_default$b))]),
75
75
  _: 1
@@ -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,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,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,5 +1,5 @@
1
- export declare const useGlobalStyle: (theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => void;
2
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, theme?: import("vue").ComputedRef<import("../../../components").ThemeConfig | undefined>) => {
1
+ export declare const useGlobalStyle: (themeManager?: import("../../../components/theme/theme-context").ThemeManager) => void;
2
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../../components/theme/theme-context").ThemeManager) => {
3
3
  hashId: import("vue").Ref<string, string>;
4
4
  };
5
5
  export default _default;
@@ -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,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,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,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,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,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,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;
@@ -74,9 +74,14 @@ var stdin_default = /* @__PURE__ */defineComponent({
74
74
  "index": item.name
75
75
  }, slots);
76
76
  }
77
+ const menuRoute = item.route;
78
+ const active = menuRoute.children?.length && menuRoute.meta.hideChildrenInMenu && route.matched.some(item2 => item2.name === menuRoute.name);
77
79
  return createVNode(ElMenuItem, {
78
80
  "key": item.name,
79
81
  "index": item.name,
82
+ "class": {
83
+ "is-active": active
84
+ },
80
85
  "onClick": () => onMenuItemClick(item)
81
86
  }, {
82
87
  title: titleVNode,
@@ -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,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,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,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,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;
@@ -7,6 +7,7 @@ import stdin_default$1 from './style/index.js';
7
7
  import { useToken } from '../../components/theme/util/useToken.js';
8
8
  import { ContextMenu as _ContextMenu, ContextMenuItem as _ContextMenuItem } from '../../components/context-menu/index.js';
9
9
  import { useComponentConfig } from '../../components/config-provider/config-provider.js';
10
+ import { Icon as _Icon } from '../../components/icon/index.js';
10
11
 
11
12
  var stdin_default = /* @__PURE__ */defineComponent({
12
13
  ...{
@@ -115,7 +116,11 @@ var stdin_default = /* @__PURE__ */defineComponent({
115
116
  name: item.name,
116
117
  closable: item.meta.closable
117
118
  }, {
118
- label: withCtx(() => [createTextVNode(toDisplayString(item.meta.title) + " ", 1
119
+ label: withCtx(() => [item.meta.icon ? (openBlock(), createBlock(unref(_Icon), {
120
+ key: 0,
121
+ name: item.meta.icon,
122
+ class: normalizeClass(`${unref(prefixCls)}-icon`)
123
+ }, null, 8, ["name", "class"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(item.meta.title) + " ", 1
119
124
  /* TEXT */), createVNode(unref(_ContextMenu), null, {
120
125
  reference: withCtx(() => [createElementVNode("div", {
121
126
  class: normalizeClass(`${unref(prefixCls)}-context-menu-reference`)
@@ -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;
@@ -15,6 +15,10 @@ var stdin_default = getSimpleStyleHook("LayoutTabbar", (token) => {
15
15
  width: 8,
16
16
  borderBlockEnd: `${token.lineWidth} ${token.lineType} ${token.colorBorder}`
17
17
  },
18
+ [`${componentCls}-icon`]: {
19
+ marginInlineEnd: token.marginXXS,
20
+ fontSize: 18
21
+ },
18
22
  ".el-tabs": {
19
23
  "--el-tabs-header-height": 32
20
24
  },
@@ -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,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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "基于 Vue3 的后台管理框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "devDependencies": {
12
12
  "@casl/ability": "^6.7.3",
13
- "@cosey/icons": "^0.1.2",
13
+ "@cosey/icons": "^0.1.5",
14
14
  "@ctrl/tinycolor": "^4.1.0",
15
15
  "@element-plus/icons-vue": "^2.3.1",
16
16
  "@emotion/hash": "^0.9.2",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@casl/ability": "^6.7.3",
44
- "@cosey/icons": "^0.1.2",
44
+ "@cosey/icons": "^0.1.5",
45
45
  "@ctrl/tinycolor": "^4.1.0",
46
46
  "@element-plus/icons-vue": "^2.3.1",
47
47
  "@emotion/hash": "^0.9.2",
@@ -1,9 +1,11 @@
1
1
  import { registerProgressGuard } from './progress.js';
2
2
  import { registerAuthGuard } from './auth.js';
3
+ import { registerPageTitleGuard } from './pageTitle.js';
3
4
 
4
5
  function registerRouterGuard(router) {
5
6
  registerProgressGuard(router);
6
7
  registerAuthGuard(router);
8
+ registerPageTitleGuard(router);
7
9
  }
8
10
 
9
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 };
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,9 +1,9 @@
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
8
  export declare const useLayoutStore: import("pinia").StoreDefinition<"cosey-layout", Pick<{
9
9
  sidebarVisible: import("vue").Ref<boolean, boolean>;
package/store/user.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare const useUserStore: import("pinia").StoreDefinition<"cosey-user",
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<"cosey-user",
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<"cosey-user",
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>;
package/store/user.js CHANGED
@@ -46,6 +46,7 @@ const useUserStore = defineStore("cosey-user", () => {
46
46
  nickname,
47
47
  avatar
48
48
  };
49
+ return userInfo.value;
49
50
  });
50
51
  };
51
52
  const changePassword = async (data) => {
@@ -1,4 +1,5 @@
1
1
  export declare function insertCSS(styleStr: string, styleId?: string): HTMLStyleElement;
2
- export declare function findCSSNode(styleId: string): Element | null;
3
- export declare function updateCSS(styleStr: string, styleId: string): Element | undefined;
2
+ export declare function findCSSNode(styleId: string): HTMLStyleElement | null;
3
+ export declare function updateCSS(styleStr: string, styleId: string): HTMLStyleElement | undefined;
4
+ export declare function updateCSSByStyle(style: HTMLStyleElement | undefined | null, styleStr: string, styleId: string): HTMLStyleElement | undefined;
4
5
  export declare function removeCSS(styleId: string): void;